Commit eab9be58 authored by 田翔's avatar 田翔

fix: 解决时间控件只读问题,下拉框中的站点增加ID存储,人员选择器选择角色机构优化为选择

parent 13a24969
{ {
"name": "panda-xform", "name": "panda-xform",
"version": "2.3.9", "version": "2.4.0",
"description": "2.3.9: 解决上报时关联表单自动生成工单/事件编号问题", "description": "2.4.0: 解决时间控件只读问题,下拉框中的站点增加ID存储,人员选择器选择角色机构优化为选择",
"keywords": [ "keywords": [
"panda-xform" "panda-xform"
], ],
......
...@@ -45,6 +45,14 @@ export function getSelectChildName(nodeName) { ...@@ -45,6 +45,14 @@ export function getSelectChildName(nodeName) {
}); });
} }
//站点选择器查询(带ID)
export function getStationIDListByUserID(id, isAll) {
return request({
url: `/PandaWorkFlow/WorkFlow/WorkFlow/GetStationIDListByUserID?userID=${id}${'&isAll=' + isAll}`,
method: 'get',
});
}
// 站点选择器查询 // 站点选择器查询
export function getStationListByUserID(id, isAll) { export function getStationListByUserID(id, isAll) {
return request({ return request({
...@@ -71,6 +79,13 @@ export function formAutomaticComputation(data) { ...@@ -71,6 +79,13 @@ export function formAutomaticComputation(data) {
}) })
} }
export function getGroupAndRole() {
return request({
url: `PandaOMS/OMS/CaseManage/GetGroupAndRole`,
method: 'get',
})
}
//人员选择器获取(三种形态) //人员选择器获取(三种形态)
export function getUserSelector(role, userID) { export function getUserSelector(role, userID) {
return request({ return request({
......
...@@ -153,7 +153,7 @@ const globalSettings = { ...@@ -153,7 +153,7 @@ const globalSettings = {
type: 'string', type: 'string',
default: 'row', default: 'row',
enum: ['row', 'column'], enum: ['row', 'column'],
enumNames: ['同行', '单独一行'], enumNames: ['左右', '上下'],
widget: 'select', widget: 'select',
displayType: 'row', displayType: 'row',
labelWidth: 100, labelWidth: 100,
......
...@@ -75,7 +75,7 @@ const layoutWidgets = [ ...@@ -75,7 +75,7 @@ const layoutWidgets = [
{ {
text: '分组名称', text: '分组名称',
name: '分组名称', name: '分组名称',
icon: <GroupOutlined />, // icon: <GroupOutlined />,
schema: { schema: {
title: '分组名称', title: '分组名称',
type: 'object', type: 'object',
...@@ -111,7 +111,7 @@ const textWidgets = [ ...@@ -111,7 +111,7 @@ const textWidgets = [
{ {
text: '文本', text: '文本',
name: '文本', name: '文本',
icon: <EditOutlined />, // icon: <EditOutlined />,
schema: { schema: {
title: '文本', title: '文本',
type: 'string', type: 'string',
...@@ -296,7 +296,7 @@ const textWidgets = [ ...@@ -296,7 +296,7 @@ const textWidgets = [
{ {
text: '多行文本', text: '多行文本',
name: '多行文本', name: '多行文本',
icon: <FormOutlined />, // icon: <FormOutlined />,
schema: { schema: {
title: '多行文本', title: '多行文本',
type: 'string', type: 'string',
...@@ -436,7 +436,7 @@ const textWidgets = [ ...@@ -436,7 +436,7 @@ const textWidgets = [
{ {
text: '数值', text: '数值',
name: '数值', name: '数值',
icon: <FieldBinaryOutlined />, // icon: <FieldBinaryOutlined />,
schema: { schema: {
title: '数值', title: '数值',
type: 'string', type: 'string',
...@@ -562,7 +562,7 @@ const textWidgets = [ ...@@ -562,7 +562,7 @@ const textWidgets = [
{ {
text: '富文本', text: '富文本',
name: '富文本', name: '富文本',
icon: <HighlightOutlined />, // icon: <HighlightOutlined />,
schema: { schema: {
title: '富文本', title: '富文本',
type: 'string', type: 'string',
...@@ -900,13 +900,12 @@ const selectWidgets = [ ...@@ -900,13 +900,12 @@ const selectWidgets = [
}, },
isMySite: { isMySite: {
title: '仅显示本人所属的站点', title: '仅显示本人所属的站点',
name: '仅显示本人所属的站点',
required: true, required: true,
default: false, default: false,
// description: '勾选后仅显示本人所属的站点',
hidden: '{{formData.sourceType !== "站点"}}', hidden: '{{formData.sourceType !== "站点"}}',
type: 'boolean', type: 'boolean',
widget: 'checkbox', widget: 'checkbox',
// width: '63%',
props: { props: {
style: { style: {
paddingLeft: '10px' paddingLeft: '10px'
...@@ -922,28 +921,28 @@ const selectWidgets = [ ...@@ -922,28 +921,28 @@ const selectWidgets = [
title: '必填', title: '必填',
type: 'boolean', type: 'boolean',
default: false, default: false,
width: '33%', width: '30%',
}, },
disabled: { disabled: {
title: '只读', title: '只读',
type: 'boolean', type: 'boolean',
widget: 'checkbox', widget: 'checkbox',
default: false, default: false,
width: '33%', width: '30%',
}, },
hidden: { hidden: {
title: '隐藏', title: '隐藏',
type: 'boolean', type: 'boolean',
widget: 'checkbox', widget: 'checkbox',
default: false, default: false,
width: '33%', width: '40%',
}, },
isMultiple: { isMultiple: {
title: '多选', title: '多选',
type: 'boolean', type: 'boolean',
widget: 'checkbox', widget: 'checkbox',
default: false, default: false,
width: '33%', width: '30%',
hidden: '{{formData.isEdit}}' hidden: '{{formData.isEdit}}'
}, },
isSearch: { isSearch: {
...@@ -951,9 +950,18 @@ const selectWidgets = [ ...@@ -951,9 +950,18 @@ const selectWidgets = [
type: 'boolean', type: 'boolean',
widget: 'checkbox', widget: 'checkbox',
default: false, default: false,
width: '33%', width: '30%',
default: true default: true
}, },
isStoreID: {
title: '是否存储ID',
required: true,
default: false,
hidden: '{{formData.sourceType !== "站点"}}',
type: 'boolean',
widget: 'checkbox',
width: '40%',
},
isEdit: { isEdit: {
title: '是否可编辑', title: '是否可编辑',
type: 'boolean', type: 'boolean',
...@@ -1696,6 +1704,7 @@ const businessWidgets = [ ...@@ -1696,6 +1704,7 @@ const businessWidgets = [
role: { role: {
title: '机构角色', title: '机构角色',
type: 'string', type: 'string',
widget: 'GroupAndRole',
displayType: 'row', displayType: 'row',
labelWidth: 80, labelWidth: 80,
}, },
...@@ -2192,7 +2201,7 @@ const dateWidgets = [ ...@@ -2192,7 +2201,7 @@ const dateWidgets = [
{ {
text: '时间选择', text: '时间选择',
name: '时间选择', name: '时间选择',
icon: <FieldTimeOutlined />, // icon: <FieldTimeOutlined />,
schema: { schema: {
title: '时间选择', title: '时间选择',
type: 'string', type: 'string',
...@@ -2341,7 +2350,7 @@ const fileWidgets = [ ...@@ -2341,7 +2350,7 @@ const fileWidgets = [
{ {
text: '附件', text: '附件',
name: '附件', name: '附件',
icon: <LinkOutlined />, // icon: <LinkOutlined />,
schema: { schema: {
title: '附件', title: '附件',
type: 'string', type: 'string',
......
...@@ -134,6 +134,10 @@ const FormDesigner = (props, ref) => { ...@@ -134,6 +134,10 @@ const FormDesigner = (props, ref) => {
{ {
text: '预览', text: '预览',
onClick: (e) => { onClick: (e) => {
const errors = designerRef.current.getErrorFields()
if (errors.length) {
return message.error('请按照提示完善表单内容')
}
setVisible(true) setVisible(true)
let json = getJSON(designerRef.current.getValue(), tableName) let json = getJSON(designerRef.current.getValue(), tableName)
setSchema(json) setSchema(json)
...@@ -144,11 +148,11 @@ const FormDesigner = (props, ref) => { ...@@ -144,11 +148,11 @@ const FormDesigner = (props, ref) => {
text: '提交', text: '提交',
onClick: async (value) => { onClick: async (value) => {
const errors = designerRef.current.getErrorFields() const errors = designerRef.current.getErrorFields()
let json = getJSON(designerRef.current.getValue(), tableName)
designerRef.current.setValue(json)
if (errors.length) { if (errors.length) {
return message.error('请按照提示完善表单内容') return message.error('请按照提示完善表单内容')
} }
let json = getJSON(designerRef.current.getValue(), tableName)
designerRef.current.setValue(json)
const { code, data, msg } = await saveTableConfig(json) const { code, data, msg } = await saveTableConfig(json)
if (code === 0) { if (code === 0) {
message.info('保存成功') message.info('保存成功')
......
...@@ -36,6 +36,7 @@ const Time = (props) => { ...@@ -36,6 +36,7 @@ const Time = (props) => {
onChange={timeChange} onChange={timeChange}
disabledDate={disabledDate} disabledDate={disabledDate}
locale={locale} locale={locale}
disabled={disabled}
placeholder={!disabled ? placeholder : ''} placeholder={!disabled ? placeholder : ''}
getPopupContainer={(targterNode) => targterNode.parentElement || document.body} getPopupContainer={(targterNode) => targterNode.parentElement || document.body}
/> />
......
import React, { useState, useMemo, useEffect } from 'react' import React, { useState, useMemo, useEffect } from 'react'
import { Select, message } from 'antd' import { Select, message } from 'antd'
import { GetSelectItemList, GetFieldValueFromTable, getStationListByUserID } from '../../../../apis/process' import { GetSelectItemList, GetFieldValueFromTable, getStationListByUserID, getStationIDListByUserID } from '../../../../apis/process'
const { Option } = Select const { Option } = Select
...@@ -8,7 +8,7 @@ const ComboBox = (props) => { ...@@ -8,7 +8,7 @@ const ComboBox = (props) => {
const userID = window?.globalConfig?.userInfo?.OID || 1 const userID = window?.globalConfig?.userInfo?.OID || 1
const { value, onChange, schema, addons } = props const { value, onChange, schema, addons } = props
const { placeholder, disabled, sourceType, options, dictionary, tableName, fieldName, presetValue, isMultiple, isEdit, isMySite, isSearch } = schema const { placeholder, disabled, sourceType, options, dictionary, tableName, fieldName, presetValue, isMultiple, isEdit, isMySite, isSearch, isStoreID } = schema
const [dictionaryList, setDictionaryList] = useState([]) const [dictionaryList, setDictionaryList] = useState([])
const [tableData, setTableData] = useState([]) const [tableData, setTableData] = useState([])
const [site, setSite] = useState([]) const [site, setSite] = useState([])
...@@ -48,11 +48,15 @@ const ComboBox = (props) => { ...@@ -48,11 +48,15 @@ const ComboBox = (props) => {
let children = [] let children = []
if (Array.isArray(enums)) { if (Array.isArray(enums)) {
enums.forEach(v => { enums.forEach(v => {
children.push(<Option key={v}>{v}</Option>) if (sourceType === '站点') {
children.push(<Option key={isStoreID ? v.stationID : v.stationName}>{v.stationName}</Option>)
} else {
children.push(<Option key={v}>{v}</Option>)
}
}) })
} }
return children return children
}, [enums]) }, [sourceType, enums, isStoreID])
const handleChange = value => { const handleChange = value => {
if (isMultiple || isEdit) { if (isMultiple || isEdit) {
...@@ -92,7 +96,7 @@ const ComboBox = (props) => { ...@@ -92,7 +96,7 @@ const ComboBox = (props) => {
} }
} }
if (sourceType === '站点') { if (sourceType === '站点') {
const { code, data, msg } = await getStationListByUserID(userID, !isMySite) const { code, data, msg } = await getStationIDListByUserID(userID, !isMySite)
if (code === 0) { if (code === 0) {
if (Array.isArray(data)) { if (Array.isArray(data)) {
setSite(data) setSite(data)
......
import React, { useState } from 'react'
import { Select, TreeSelect, message } from 'antd'
import { getGroupAndRole } from '../../../../../apis/process'
const { TreeNode } = TreeSelect
const GroupAndRole = (props) => {
const { addons, onChange, value } = props
const { $id, accountName, tableNameParent } = addons.formData
const [treeData, setTreeData] = useState({ groupList: [], roleList: [] })
const selectChange = (value) => {
onChange(value.join(','))
}
const onfocus = async () => {
const { code, data, msg } = await getGroupAndRole()
if (code === 0) {
setTreeData(data)
} else {
message.error(msg)
}
}
return (
<TreeSelect
value={value ? value.split(',') : []}
multiple
onFocus={onfocus}
onChange={selectChange}
allowClear
showSearch
getPopupContainer={(targterNode) => targterNode.parentElement || document.body}
>
<TreeNode value='机构' title='机构' disabled>
{treeData.groupList.map(s => <TreeNode value={s.name} title={s.name} key={s.name} />)}
</TreeNode>
<TreeNode value='角色' title='角色' disabled>
{treeData.roleList.map(s => <TreeNode value={s.name} title={s.name} key={s.name} />)}
</TreeNode>
</TreeSelect>
)
}
export default GroupAndRole
\ No newline at end of file
...@@ -35,6 +35,9 @@ const SourceType = (props) => { ...@@ -35,6 +35,9 @@ const SourceType = (props) => {
if (e !== '手动输入') { if (e !== '手动输入') {
addons.setValueByPath('isEdit', false) addons.setValueByPath('isEdit', false)
} }
if (e !== '站点') {
addons.setValueByPath('isStoreID', false)
}
onChange(e) onChange(e)
} }
......
import Dictionary from './Dictionary' import Dictionary from './Dictionary'
import AccountName from './AccountName' import AccountName from './AccountName'
import Fieldshine from './Fieldshine' import Fieldshine from './Fieldshine'
import GroupAndRole from './GroupAndRole'
import MappedField from './MappedField' import MappedField from './MappedField'
import ControlRules from './ControlRules' import ControlRules from './ControlRules'
import SourceType from './SourceType' import SourceType from './SourceType'
...@@ -12,6 +13,7 @@ const groupSource = { ...@@ -12,6 +13,7 @@ const groupSource = {
Dictionary, Dictionary,
AccountName, AccountName,
Fieldshine, Fieldshine,
GroupAndRole,
MappedField, MappedField,
ControlRules, ControlRules,
SourceType, SourceType,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment