Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
WebPublic
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
前端开发小组
WebPublic
Commits
3d4ca361
提交
3d4ca361
authored
12月 20, 2021
作者:
钟是志
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
23704 学工通用流程审批界面新增支持流程节点下查询
上级
78f60e0b
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
421 行增加
和
384 行删除
+421
-384
AuditPage.js
FormInsertDiy/AffairPage/AuditPage/AuditPage.js
+17
-5
destruction.js
FormInsertDiy/AffairPage/destruction.js
+398
-379
publicApiService.js
FormInsertDiy/AffairPage/publicApiService.js
+6
-0
没有找到文件。
FormInsertDiy/AffairPage/AuditPage/AuditPage.js
浏览文件 @
3d4ca361
...
...
@@ -61,7 +61,7 @@ export default class AuditPage extends Component {
};
handleSearchSet
=
()
=>
{
const
{
columns
,
searchCondition
}
=
this
.
props
;
const
{
columns
,
searchCondition
,
allConfigSetInfo
}
=
this
.
props
;
console
.
log
(
searchCondition
);
const
tab1
=
{
search
:
{
...
...
@@ -71,7 +71,7 @@ export default class AuditPage extends Component {
beforeSearchData
:
(
data
)
=>
{
let
searcherKeyValue
=
{};
for
(
let
item
of
searchCondition
)
{
if
(
typeof
data
[
item
.
key
]
!==
'undefined'
)
{
if
(
typeof
data
[
item
.
key
]
!==
'undefined'
&&
item
.
key
!==
'taskDefKey'
)
{
searcherKeyValue
[
item
.
base52
]
=
data
[
item
.
key
];
}
}
...
...
@@ -83,7 +83,13 @@ export default class AuditPage extends Component {
responseCallBack
:
(
response
)
=>
{
return
response
;
},
condition
:
searchCondition
,
condition
:
searchCondition
.
filter
((
g
)
=>
{
if
(
!
allConfigSetInfo
.
isShowWaitTaskDef
){
return
g
.
key
!==
'taskDefKey'
;
}
else
{
return
true
;
}
}),
nameSpan
:
{
big
:
8
,
small
:
9
},
fileSpan
:
{
big
:
4
,
small
:
4
},
},
...
...
@@ -101,7 +107,7 @@ export default class AuditPage extends Component {
beforeSearchData
:
(
data
)
=>
{
let
searcherKeyValue
=
{};
for
(
let
item
of
searchCondition
)
{
if
(
typeof
data
[
item
.
key
]
!==
'undefined'
)
{
if
(
typeof
data
[
item
.
key
]
!==
'undefined'
&&
item
.
key
!==
'taskDefKey'
)
{
searcherKeyValue
[
item
.
base52
]
=
data
[
item
.
key
];
}
}
...
...
@@ -110,7 +116,13 @@ export default class AuditPage extends Component {
}
return
data
;
},
condition
:
searchCondition
,
condition
:
searchCondition
.
filter
((
g
)
=>
{
if
(
!
allConfigSetInfo
.
isShowHandledTaskDef
){
return
g
.
key
!==
'taskDefKey'
;
}
else
{
return
true
;
}
}),
nameSpan
:
{
big
:
8
,
small
:
9
},
fileSpan
:
{
big
:
4
,
small
:
4
},
},
...
...
FormInsertDiy/AffairPage/destruction.js
浏览文件 @
3d4ca361
...
...
@@ -5,407 +5,426 @@ import config from '@/config/config';
import
{
Tooltip
}
from
'antd'
;
import
moment
from
'moment'
;
import
React
from
'react'
;
import
{
findListTaskDefinition
}
from
'@/webPublic/FormInsertDiy/AffairPage/publicApiService'
;
const
handleSqlModels
=
(
sqlModels
,
defaultValues
)
=>
{
if
(
typeof
sqlModels
===
'undefined'
||
!
Array
.
isArray
(
sqlModels
))
{
return
[];
}
else
{
let
res
=
[];
for
(
let
x
of
sqlModels
)
{
let
key
=
x
.
key
;
if
(
!
isJSON
(
x
.
cols
))
{
let
info
=
x
.
dataObjModel
.
columnModels
;
for
(
let
item
in
info
)
{
let
z
=
info
[
item
];
let
oneFields
=
{
key
:
key
+
'_'
+
z
.
name
,
name
:
z
.
title
,
dataType
:
z
.
type
,
required
:
false
,
dataId
:
item
,
comName
:
date
.
indexOf
(
z
.
type
)
>
-
1
?
'DatePicker'
:
'Input'
,
disabled
:
true
,
};
oneFields
.
defaultValue
=
defaultValues
[
oneFields
.
key
]
||
''
;
res
.
push
(
oneFields
);
}
continue
;
}
let
info
=
JSON
.
parse
(
x
.
cols
);
// name, title, type
for
(
let
item
in
info
)
{
let
z
=
info
[
item
];
let
oneFields
=
{
key
:
key
+
'_'
+
z
.
name
,
name
:
z
.
title
,
dataType
:
z
.
type
,
required
:
false
,
dataId
:
item
,
comName
:
date
.
indexOf
(
z
.
type
)
>
-
1
?
'DatePicker'
:
'Input'
,
disabled
:
true
,
};
oneFields
.
defaultValue
=
defaultValues
[
oneFields
.
key
]
||
''
;
res
.
push
(
oneFields
);
}
}
return
res
;
}
if
(
typeof
sqlModels
===
'undefined'
||
!
Array
.
isArray
(
sqlModels
))
{
return
[];
}
else
{
let
res
=
[];
for
(
let
x
of
sqlModels
)
{
let
key
=
x
.
key
;
if
(
!
isJSON
(
x
.
cols
))
{
let
info
=
x
.
dataObjModel
.
columnModels
;
for
(
let
item
in
info
)
{
let
z
=
info
[
item
];
let
oneFields
=
{
key
:
key
+
'_'
+
z
.
name
,
name
:
z
.
title
,
dataType
:
z
.
type
,
required
:
false
,
dataId
:
item
,
comName
:
date
.
indexOf
(
z
.
type
)
>
-
1
?
'DatePicker'
:
'Input'
,
disabled
:
true
,
};
oneFields
.
defaultValue
=
defaultValues
[
oneFields
.
key
]
||
''
;
res
.
push
(
oneFields
);
}
continue
;
}
let
info
=
JSON
.
parse
(
x
.
cols
);
// name, title, type
for
(
let
item
in
info
)
{
let
z
=
info
[
item
];
let
oneFields
=
{
key
:
key
+
'_'
+
z
.
name
,
name
:
z
.
title
,
dataType
:
z
.
type
,
required
:
false
,
dataId
:
item
,
comName
:
date
.
indexOf
(
z
.
type
)
>
-
1
?
'DatePicker'
:
'Input'
,
disabled
:
true
,
};
oneFields
.
defaultValue
=
defaultValues
[
oneFields
.
key
]
||
''
;
res
.
push
(
oneFields
);
}
}
return
res
;
}
};
const
funcHandleFileds
=
(
source
,
obj
,
fieldsColumns
)
=>
{
let
fileds
=
[];
for
(
let
item
of
source
)
{
for
(
let
info
of
item
)
{
let
oneFiled
=
{};
if
(
info
.
content
)
{
let
content
=
info
.
content
;
let
fileds
=
[];
for
(
let
item
of
source
)
{
for
(
let
info
of
item
)
{
let
oneFiled
=
{};
if
(
info
.
content
)
{
let
content
=
info
.
content
;
oneFiled
=
{
comName
:
content
.
comName
,
name
:
content
.
label
||
''
,
};
if
(
content
.
comName
===
'DatePicker'
)
{
if
(
content
.
format
)
{
oneFiled
.
format
=
content
.
format
;
}
}
if
(
content
.
comName
===
'PartForm'
)
{
const
{
childFormKey
,
columnIds
}
=
content
;
if
(
childFormKey
)
{
let
thisSource
=
(
obj
[
childFormKey
]
&&
obj
[
childFormKey
].
items
)
||
[];
let
thisFields
=
funcHandleFileds
(
thisSource
,
obj
,
fieldsColumns
);
for
(
let
i
=
0
;
i
<
thisFields
.
length
;
i
++
)
{
if
(
typeof
thisFields
[
i
].
c1
!==
'undefined'
)
{
thisFields
[
i
]
=
{
...
fieldsColumns
[
thisFields
[
i
].
c1
],
...
thisFields
[
i
],
};
}
}
oneFiled
.
componentProps
=
{
columnIds
,
childFormKey
,
thisFields
,
};
}
}
if
(
content
.
comName
===
'RangePicker'
)
{
if
(
content
.
format
)
{
oneFiled
.
format
=
content
.
format
;
}
}
if
(
content
.
comName
===
'Description'
)
{
oneFiled
.
key
=
content
.
sqls
[
1
];
}
if
([
'Radio'
,
'Select'
,
'Checkbox'
].
indexOf
(
content
.
comName
)
>
-
1
)
{
// 枚举值
if
(
content
.
optionType
)
{
oneFiled
.
optionType
=
content
.
optionType
;
switch
(
oneFiled
.
optionType
)
{
case
'enum'
:
if
(
content
.
enums
)
{
let
options
=
isJSON
(
content
.
enums
)
?
JSON
.
parse
(
content
.
enums
)
:
[];
options
=
options
.
map
((
x
)
=>
{
return
{
key
:
x
.
value
,
name
:
x
.
label
};
});
oneFiled
.
options
=
options
;
}
break
;
case
'reference'
:
oneFiled
.
filterSql
=
content
.
filterSql
;
break
;
case
'sql'
:
oneFiled
.
sqlKey
=
content
.
sqlKey
;
oneFiled
.
labelName
=
content
.
labelName
;
oneFiled
.
valueName
=
content
.
valueName
;
break
;
default
:
oneFiled
.
options
=
[];
break
;
}
}
}
if
(
content
.
comName
===
'ChildForm'
)
{
const
{
childFormKey
,
columnIds
}
=
content
;
let
thisSource
=
obj
[
childFormKey
].
items
;
let
thisFields
=
funcHandleFileds
(
thisSource
,
obj
,
fieldsColumns
);
for
(
let
i
=
0
;
i
<
thisFields
.
length
;
i
++
)
{
if
(
typeof
thisFields
[
i
].
c1
!==
'undefined'
&&
typeof
fieldsColumns
[
thisFields
[
i
].
c1
]
!==
'undefined'
)
{
thisFields
[
i
]
=
{
...
fieldsColumns
[
thisFields
[
i
].
c1
],
...
thisFields
[
i
],
};
}
}
oneFiled
.
componentProps
=
{
columnIds
,
childFormKey
,
thisFields
,
};
}
if
(
content
.
comName
===
'TableSelect'
)
{
oneFiled
.
componentProps
=
{
sqlKey
:
content
.
sqlKey
,
labelName
:
content
.
labelName
,
valueName
:
content
.
valueName
,
isMultiple
:
content
.
isMultiple
,
};
}
if
(
content
.
comName
===
'Label'
)
{
// 提示信息显示
if
(
info
.
hidden
)
{
continue
;
}
oneFiled
.
key
=
content
.
initialValue
?
content
.
initialValue
.
slice
(
0
,
10
)
:
' '
;
oneFiled
.
name
=
' '
;
oneFiled
.
defaultValue
=
content
.
initialValue
;
oneFiled
.
dataType
=
'TEXT'
;
}
for
(
let
j
in
content
.
columnIds
)
{
let
oneFields
=
content
.
columnIds
[
j
];
oneFiled
[
j
]
=
oneFields
[
1
];
}
fileds
.
push
(
oneFiled
);
}
}
}
oneFiled
=
{
comName
:
content
.
comName
,
name
:
content
.
label
||
''
,
};
if
(
content
.
comName
===
'DatePicker'
)
{
if
(
content
.
format
)
{
oneFiled
.
format
=
content
.
format
;
}
}
if
(
content
.
comName
===
'PartForm'
)
{
const
{
childFormKey
,
columnIds
}
=
content
;
if
(
childFormKey
)
{
let
thisSource
=
(
obj
[
childFormKey
]
&&
obj
[
childFormKey
].
items
)
||
[];
let
thisFields
=
funcHandleFileds
(
thisSource
,
obj
,
fieldsColumns
);
for
(
let
i
=
0
;
i
<
thisFields
.
length
;
i
++
)
{
if
(
typeof
thisFields
[
i
].
c1
!==
'undefined'
)
{
thisFields
[
i
]
=
{
...
fieldsColumns
[
thisFields
[
i
].
c1
],
...
thisFields
[
i
],
};
}
}
oneFiled
.
componentProps
=
{
columnIds
,
childFormKey
,
thisFields
,
};
}
}
if
(
content
.
comName
===
'RangePicker'
)
{
if
(
content
.
format
)
{
oneFiled
.
format
=
content
.
format
;
}
}
if
(
content
.
comName
===
'Description'
)
{
oneFiled
.
key
=
content
.
sqls
[
1
];
}
if
([
'Radio'
,
'Select'
,
'Checkbox'
].
indexOf
(
content
.
comName
)
>
-
1
)
{
// 枚举值
if
(
content
.
optionType
)
{
oneFiled
.
optionType
=
content
.
optionType
;
switch
(
oneFiled
.
optionType
)
{
case
'enum'
:
if
(
content
.
enums
)
{
let
options
=
isJSON
(
content
.
enums
)
?
JSON
.
parse
(
content
.
enums
)
:
[];
options
=
options
.
map
((
x
)
=>
{
return
{
key
:
x
.
value
,
name
:
x
.
label
};
});
oneFiled
.
options
=
options
;
}
break
;
case
'reference'
:
oneFiled
.
filterSql
=
content
.
filterSql
;
break
;
case
'sql'
:
oneFiled
.
sqlKey
=
content
.
sqlKey
;
oneFiled
.
labelName
=
content
.
labelName
;
oneFiled
.
valueName
=
content
.
valueName
;
break
;
default
:
oneFiled
.
options
=
[];
break
;
}
}
}
if
(
content
.
comName
===
'ChildForm'
)
{
const
{
childFormKey
,
columnIds
}
=
content
;
let
thisSource
=
obj
[
childFormKey
].
items
;
let
thisFields
=
funcHandleFileds
(
thisSource
,
obj
,
fieldsColumns
);
for
(
let
i
=
0
;
i
<
thisFields
.
length
;
i
++
)
{
if
(
typeof
thisFields
[
i
].
c1
!==
'undefined'
&&
typeof
fieldsColumns
[
thisFields
[
i
].
c1
]
!==
'undefined'
)
{
thisFields
[
i
]
=
{
...
fieldsColumns
[
thisFields
[
i
].
c1
],
...
thisFields
[
i
],
};
}
}
oneFiled
.
componentProps
=
{
columnIds
,
childFormKey
,
thisFields
,
};
}
if
(
content
.
comName
===
'TableSelect'
)
{
oneFiled
.
componentProps
=
{
sqlKey
:
content
.
sqlKey
,
labelName
:
content
.
labelName
,
valueName
:
content
.
valueName
,
isMultiple
:
content
.
isMultiple
,
};
}
if
(
content
.
comName
===
'Label'
)
{
// 提示信息显示
if
(
info
.
hidden
)
{
continue
;
}
oneFiled
.
key
=
content
.
initialValue
?
content
.
initialValue
.
slice
(
0
,
10
)
:
' '
;
oneFiled
.
name
=
' '
;
oneFiled
.
defaultValue
=
content
.
initialValue
;
oneFiled
.
dataType
=
'TEXT'
;
}
for
(
let
j
in
content
.
columnIds
)
{
let
oneFields
=
content
.
columnIds
[
j
];
oneFiled
[
j
]
=
oneFields
[
1
];
}
fileds
.
push
(
oneFiled
);
}
}
}
return
fileds
;
return
fileds
;
};
export
async
function
destructionGetDetail
(
response
)
{
/**
* 如果数据校验不通过直接pass 返回默认值,
* */
if
(
typeof
response
.
unifiedServicePatternModel
===
'undefined'
||
!
isJSON
(
response
.
unifiedServicePatternModel
.
content
)
||
!
Array
.
isArray
(
response
.
unifiedServicePatternModel
.
dataObjModels
)
||
!
response
.
unifiedServicePatternModel
.
dataObjModels
.
length
||
typeof
response
.
unifiedServicePatternModel
.
dataObjModels
[
0
].
columnModels
===
'undefined'
)
{
return
{
addFields
:
[],
tableInfo
:
{},
allConfigSetInfo
:
response
,
searchCondition
:
[],
};
}
const
basicPatternModel
=
response
.
unifiedServicePatternModel
;
/**
* 如果数据校验不通过直接pass 返回默认值,
* */
if
(
typeof
response
.
unifiedServicePatternModel
===
'undefined'
||
!
isJSON
(
response
.
unifiedServicePatternModel
.
content
)
||
!
Array
.
isArray
(
response
.
unifiedServicePatternModel
.
dataObjModels
)
||
!
response
.
unifiedServicePatternModel
.
dataObjModels
.
length
||
typeof
response
.
unifiedServicePatternModel
.
dataObjModels
[
0
].
columnModels
===
'undefined'
)
{
return
{
addFields
:
[],
tableInfo
:
{},
allConfigSetInfo
:
response
,
searchCondition
:
[],
};
}
const
basicPatternModel
=
response
.
unifiedServicePatternModel
;
/** 正式开始 **/
/** 正式开始 **/
/*** 字段name, dataType ***/
let
fieldsColumns
=
{};
for
(
let
dataObjModels
of
basicPatternModel
.
dataObjModels
)
{
let
columns
=
dataObjModels
.
columnModels
;
for
(
let
item
of
columns
)
{
fieldsColumns
[
item
.
base52
]
=
{
name
:
item
.
title
,
dataType
:
item
.
type
,
key
:
item
.
base52
,
dataId
:
item
.
id
,
referenceCodeName
:
item
.
referenceCodeName
,
referenceNameName
:
item
.
referenceNameName
,
required
:
Boolean
(
!
item
.
isNull
),
};
}
}
/*** 字段name, dataType ***/
let
fieldsColumns
=
{};
for
(
let
dataObjModels
of
basicPatternModel
.
dataObjModels
)
{
let
columns
=
dataObjModels
.
columnModels
;
for
(
let
item
of
columns
)
{
fieldsColumns
[
item
.
base52
]
=
{
name
:
item
.
title
,
dataType
:
item
.
type
,
key
:
item
.
base52
,
dataId
:
item
.
id
,
referenceCodeName
:
item
.
referenceCodeName
,
referenceNameName
:
item
.
referenceNameName
,
required
:
Boolean
(
!
item
.
isNull
),
};
}
}
/*** 字段组件类型 ***/
let
data
=
JSON
.
parse
(
basicPatternModel
.
content
);
let
key
=
data
.
init
;
let
source
=
data
.
datas
[
key
].
items
;
let
fileds
=
funcHandleFileds
(
source
,
data
.
datas
,
fieldsColumns
);
/*** 字段组件类型 ***/
let
data
=
JSON
.
parse
(
basicPatternModel
.
content
);
let
key
=
data
.
init
;
let
source
=
data
.
datas
[
key
].
items
;
let
fileds
=
funcHandleFileds
(
source
,
data
.
datas
,
fieldsColumns
);
/*** 字段默认值 ***/
let
sqlModeData
=
handleSqlModels
(
basicPatternModel
.
sqlModels
,
basicPatternModel
.
defaultValues
);
//Array
let
defaultBinds
=
data
.
datas
[
key
].
defaultBinds
;
let
defaultKeys
=
{};
if
(
defaultBinds
)
{
for
(
let
item
in
defaultBinds
)
{
let
one
=
defaultBinds
[
item
];
if
(
one
&&
one
.
columnIds
&&
one
.
sqls
)
{
defaultKeys
[
one
.
sqls
[
1
]]
=
one
.
columnIds
[
1
];
}
}
}
for
(
let
item
of
sqlModeData
)
{
if
(
defaultKeys
[
item
.
key
])
{
item
.
defaultKey
=
defaultKeys
[
item
.
key
];
}
}
/*** 字段默认值 ***/
let
sqlModeData
=
handleSqlModels
(
basicPatternModel
.
sqlModels
,
basicPatternModel
.
defaultValues
);
//Array
let
defaultBinds
=
data
.
datas
[
key
].
defaultBinds
;
let
defaultKeys
=
{};
if
(
defaultBinds
)
{
for
(
let
item
in
defaultBinds
)
{
let
one
=
defaultBinds
[
item
];
if
(
one
&&
one
.
columnIds
&&
one
.
sqls
)
{
defaultKeys
[
one
.
sqls
[
1
]]
=
one
.
columnIds
[
1
];
}
}
}
for
(
let
item
of
sqlModeData
)
{
if
(
defaultKeys
[
item
.
key
])
{
item
.
defaultKey
=
defaultKeys
[
item
.
key
];
}
}
/*** 流程表数据 ***/
let
tableInfo
=
{
base52
:
basicPatternModel
.
dataObjModels
[
0
].
base52
,
name
:
basicPatternModel
.
dataObjModels
[
0
].
name
,
defaultValuesId
:
key
,
};
for
(
let
i
=
0
;
i
<
fileds
.
length
;
i
++
)
{
let
item
=
fileds
[
i
];
if
(
item
.
comName
===
'Description'
)
{
if
(
item
.
key
&&
!
item
.
defaultValue
&&
basicPatternModel
.
defaultValues
&&
basicPatternModel
.
defaultValues
[
item
.
key
]
)
{
item
.
defaultValue
=
basicPatternModel
.
defaultValues
[
item
.
key
];
}
for
(
let
x
of
sqlModeData
)
{
if
(
x
.
key
===
item
.
key
)
{
item
.
c1
=
x
.
defaultKey
;
fileds
[
i
]
=
{
...
item
,
...
x
,
};
}
}
}
}
for
(
let
i
=
0
;
i
<
fileds
.
length
;
i
++
)
{
if
(
typeof
fileds
[
i
].
c1
!==
'undefined'
)
{
if
(
fileds
[
i
].
key
&&
fieldsColumns
[
fileds
[
i
].
c1
]
&&
fieldsColumns
[
fileds
[
i
].
c1
].
key
&&
fileds
[
i
].
key
!==
fieldsColumns
[
fileds
[
i
].
c1
].
key
)
{
fileds
[
i
].
onestopDefaultKey
=
fileds
[
i
].
key
;
}
fileds
[
i
]
=
{
...
fileds
[
i
],
...
fieldsColumns
[
fileds
[
i
].
c1
],
};
}
}
/*** 流程表数据 ***/
let
tableInfo
=
{
base52
:
basicPatternModel
.
dataObjModels
[
0
].
base52
,
name
:
basicPatternModel
.
dataObjModels
[
0
].
name
,
defaultValuesId
:
key
,
};
for
(
let
i
=
0
;
i
<
fileds
.
length
;
i
++
)
{
let
item
=
fileds
[
i
];
if
(
item
.
comName
===
'Description'
)
{
if
(
item
.
key
&&
!
item
.
defaultValue
&&
basicPatternModel
.
defaultValues
&&
basicPatternModel
.
defaultValues
[
item
.
key
]
)
{
item
.
defaultValue
=
basicPatternModel
.
defaultValues
[
item
.
key
];
}
for
(
let
x
of
sqlModeData
)
{
if
(
x
.
key
===
item
.
key
)
{
item
.
c1
=
x
.
defaultKey
;
fileds
[
i
]
=
{
...
item
,
...
x
,
};
}
}
}
}
for
(
let
i
=
0
;
i
<
fileds
.
length
;
i
++
)
{
if
(
typeof
fileds
[
i
].
c1
!==
'undefined'
)
{
if
(
fileds
[
i
].
key
&&
fieldsColumns
[
fileds
[
i
].
c1
]
&&
fieldsColumns
[
fileds
[
i
].
c1
].
key
&&
fileds
[
i
].
key
!==
fieldsColumns
[
fileds
[
i
].
c1
].
key
)
{
fileds
[
i
].
onestopDefaultKey
=
fileds
[
i
].
key
;
}
fileds
[
i
]
=
{
...
fileds
[
i
],
...
fieldsColumns
[
fileds
[
i
].
c1
],
};
}
}
return
{
addFields
:
await
translateAddFields
(
fileds
,
tableInfo
),
tableInfo
,
allConfigSetInfo
:
response
,
searchCondition
:
await
getSearchCondition
(
basicPatternModel
?.
dataObjModels
[
0
]?.
id
,
),
// ,response.id),
const
searchCondition
=
await
getSearchCondition
(
basicPatternModel
?.
dataObjModels
[
0
]?.
id
);
// ,response.id),
if
(
response
.
isShowWaitTaskDef
||
response
.
isShowHandledTaskDef
)
{
let
optProcess
=
await
findListTaskDefinition
({
appId
:
response
.
id
,
});
if
(
optProcess
){
searchCondition
.
push
({
key
:
'taskDefKey'
,
name
:
'流程节点'
,
type
:
'select'
,
options
:
optProcess
.
map
((
g
)
=>
{
return
{
key
:
g
.
id
,
name
:
g
.
name
,
};
}),
});
}
}
return
{
addFields
:
await
translateAddFields
(
fileds
,
tableInfo
),
tableInfo
,
allConfigSetInfo
:
response
,
searchCondition
,
// 姚鑫国改这里
};
};
}
export
function
getDefaultValues
(
addFields
=
[],
tableInfo
=
{})
{
const
values
=
{
defaultValues
:
{
[
tableInfo
.
defaultValuesId
]:
{},
},
};
const
defalutValues
=
{};
for
(
let
item
of
addFields
)
{
if
(
typeof
item
.
defaultValue
!==
'undefined'
)
{
values
[
item
.
key
]
=
item
.
defaultValue
;
// values[item.onestopDefaultKey] = item.defaultValue;l;l
}
if
(
typeof
item
.
defaultKey
!==
'undefined'
&&
item
.
defaultKey
)
{
values
[
item
.
defaultKey
]
=
item
.
defaultValue
;
// 表单渲染需要这个值
defalutValues
[
item
.
key
]
=
item
.
defaultValue
;
defalutValues
[
item
.
onestopDefaultKey
]
=
item
.
defaultValue
;
}
}
values
.
defaultValues
[
tableInfo
.
defaultValuesId
]
=
defalutValues
;
//传给后台需要这个值
return
values
;
const
values
=
{
defaultValues
:
{
[
tableInfo
.
defaultValuesId
]:
{},
},
};
const
defalutValues
=
{};
for
(
let
item
of
addFields
)
{
if
(
typeof
item
.
defaultValue
!==
'undefined'
)
{
values
[
item
.
key
]
=
item
.
defaultValue
;
// values[item.onestopDefaultKey] = item.defaultValue;l;l
}
if
(
typeof
item
.
defaultKey
!==
'undefined'
&&
item
.
defaultKey
)
{
values
[
item
.
defaultKey
]
=
item
.
defaultValue
;
// 表单渲染需要这个值
defalutValues
[
item
.
key
]
=
item
.
defaultValue
;
defalutValues
[
item
.
onestopDefaultKey
]
=
item
.
defaultValue
;
}
}
values
.
defaultValues
[
tableInfo
.
defaultValuesId
]
=
defalutValues
;
//传给后台需要这个值
return
values
;
}
export
function
handleColumns
(
columns
)
{
const
columnsLength
=
columns
.
length
;
for
(
let
item
of
columns
)
{
if
(
item
.
dataIndex
.
indexOf
(
'process_status'
)
>
-
1
)
{
item
.
render
=
(
val
)
=>
(
val
?
(
val
===
'0'
?
'审核通过'
:
'审核未通过'
)
:
null
);
}
if
(
item
.
dataType
)
{
if
(
text
.
indexOf
(
item
.
dataType
)
>
-
1
)
{
// 文本类型字段
item
.
render
=
(
text
)
=>
{
if
(
isJSON
(
text
))
{
text
=
JSON
.
parse
(
text
);
}
if
(
item
.
extendType
===
'file'
&&
typeof
text
===
'string'
)
{
let
url
=
text
.
includes
(
'http'
)
?
text
:
config
.
sqlFormsServer
+
text
;
return
(
<
a
href
=
{
url
}
target
=
{
'_blank'
}
>
点击查看
<
/a
>
);
}
else
if
(
typeof
text
===
'string'
&&
text
.
length
>
20
)
{
const
oldTitle
=
text
;
const
newTitle
=
text
.
slice
(
0
,
20
)
+
'...'
;
return
(
<
Tooltip
title
=
{
oldTitle
}
key
=
{
oldTitle
}
style
=
{{
width
:
260
}}
>
<
span
key
=
{
text
}
>
{
newTitle
}
<
/span
>
<
/Tooltip
>
);
}
else
if
(
item
.
extendType
===
'file'
&&
text
&&
typeof
text
===
'object'
&&
Array
.
isArray
(
text
.
files
)
&&
text
.
files
.
length
)
{
return
text
.
files
.
map
((
file
,
index
)
=>
{
let
url
=
file
.
path
.
includes
(
'http'
)
?
file
.
path
:
config
.
sqlFormsServer
+
file
.
path
;
return
(
<
a
href
=
{
url
}
target
=
{
'_blank'
}
key
=
{
file
.
name
}
style
=
{{
marginRight
:
'10px'
}}
>
{
file
.
name
}
<
/a
>
);
});
}
else
{
return
text
;
}
};
}
else
if
(
date
.
indexOf
(
item
.
dataType
)
>
-
1
)
{
// 日期类型字段
item
.
render
=
(
text
,
record
)
=>
{
if
(
!
isNaN
(
Number
(
text
))
&&
Number
(
text
)
>
10000000
)
{
text
=
Number
(
text
);
if
(
item
.
dataFormatStrWeb
)
{
return
moment
(
text
).
format
(
item
.
dataFormatStrWeb
);
}
return
moment
(
text
).
format
(
format
[
item
.
dataType
]);
}
else
{
return
''
;
}
};
}
else
if
(
taskNode
.
indexOf
(
item
.
dataType
)
>
-
1
)
{
// 流程节点类型
item
.
render
=
(
text
,
record
)
=>
{
if
(
record
.
isEnd
)
{
return
'已完成'
;
}
else
{
return
text
||
record
.
taskName
;
}
};
}
}
const
columnsLength
=
columns
.
length
;
for
(
let
item
of
columns
)
{
if
(
item
.
dataIndex
.
indexOf
(
'process_status'
)
>
-
1
)
{
item
.
render
=
(
val
)
=>
(
val
?
(
val
===
'0'
?
'审核通过'
:
'审核未通过'
)
:
null
);
}
if
(
item
.
dataType
)
{
if
(
text
.
indexOf
(
item
.
dataType
)
>
-
1
)
{
// 文本类型字段
item
.
render
=
(
text
)
=>
{
if
(
isJSON
(
text
))
{
text
=
JSON
.
parse
(
text
);
}
if
(
item
.
extendType
===
'file'
&&
typeof
text
===
'string'
)
{
let
url
=
text
.
includes
(
'http'
)
?
text
:
config
.
sqlFormsServer
+
text
;
return
(
<
a
href
=
{
url
}
target
=
{
'_blank'
}
>
点击查看
<
/a
>
);
}
else
if
(
typeof
text
===
'string'
&&
text
.
length
>
20
)
{
const
oldTitle
=
text
;
const
newTitle
=
text
.
slice
(
0
,
20
)
+
'...'
;
return
(
<
Tooltip
title
=
{
oldTitle
}
key
=
{
oldTitle
}
style
=
{{
width
:
260
}}
>
<
span
key
=
{
text
}
>
{
newTitle
}
<
/span
>
<
/Tooltip
>
);
}
else
if
(
item
.
extendType
===
'file'
&&
text
&&
typeof
text
===
'object'
&&
Array
.
isArray
(
text
.
files
)
&&
text
.
files
.
length
)
{
return
text
.
files
.
map
((
file
,
index
)
=>
{
let
url
=
file
.
path
.
includes
(
'http'
)
?
file
.
path
:
config
.
sqlFormsServer
+
file
.
path
;
return
(
<
a
href
=
{
url
}
target
=
{
'_blank'
}
key
=
{
file
.
name
}
style
=
{{
marginRight
:
'10px'
}}
>
{
file
.
name
}
<
/a
>
);
});
}
else
{
return
text
;
}
};
}
else
if
(
date
.
indexOf
(
item
.
dataType
)
>
-
1
)
{
// 日期类型字段
item
.
render
=
(
text
,
record
)
=>
{
if
(
!
isNaN
(
Number
(
text
))
&&
Number
(
text
)
>
10000000
)
{
text
=
Number
(
text
);
if
(
item
.
dataFormatStrWeb
)
{
return
moment
(
text
).
format
(
item
.
dataFormatStrWeb
);
}
return
moment
(
text
).
format
(
format
[
item
.
dataType
]);
}
else
{
return
''
;
}
};
}
else
if
(
taskNode
.
indexOf
(
item
.
dataType
)
>
-
1
)
{
// 流程节点类型
item
.
render
=
(
text
,
record
)
=>
{
if
(
record
.
isEnd
)
{
return
'已完成'
;
}
else
{
return
text
||
record
.
taskName
;
}
};
}
}
if
(
item
.
dataIndex
===
'rate'
)
{
item
.
render
=
(
text
,
record
)
=>
{
if
(
text
||
text
==
0
)
{
return
Number
(
text
)
+
'%'
;
}
else
{
return
''
;
}
};
}
/*if (columnsLength > 10 && item.title && !item.width) {
item.width = item.title.length * 30;
if (item.title === '学号') {
item.width = 140;
}
if (item.title.indexOf('时间') > -1) {
item.width = 150;
}
}*/
}
return
columns
;
if
(
item
.
dataIndex
===
'rate'
)
{
item
.
render
=
(
text
,
record
)
=>
{
if
(
text
||
text
==
0
)
{
return
Number
(
text
)
+
'%'
;
}
else
{
return
''
;
}
};
}
/*if (columnsLength > 10 && item.title && !item.width) {
item.width = item.title.length * 30;
if (item.title === '学号') {
item.width = 140;
}
if (item.title.indexOf('时间') > -1) {
item.width = 150;
}
}*/
}
return
columns
;
}
FormInsertDiy/AffairPage/publicApiService.js
浏览文件 @
3d4ca361
...
...
@@ -60,6 +60,11 @@ const getColumns = (workId) => {
return
apiRequest
(
'/UnifiedAppFormApi/getFormTitle'
,
{
id
:
workId
});
};
const
findListTaskDefinition
=
(
params
)
=>
{
// 获取表头 workId
return
apiRequest
(
'/UnifiedAppFormApi/findListTaskDefinition'
,
params
);
};
const
getHead
=
(
dataObjId
)
=>
{
// 获取表头 workId
return
apiRequest
(
'/DataColumnApi/getHeaderList'
,
{
dataObjId
});
...
...
@@ -238,4 +243,5 @@ export {
getSqlOptions
,
getHead
,
getGroupList
,
findListTaskDefinition
,
};
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论