Commit eab9be58 authored by 田翔's avatar 田翔

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

parent 13a24969
{
"name": "panda-xform",
"version": "2.3.9",
"description": "2.3.9: 解决上报时关联表单自动生成工单/事件编号问题",
"version": "2.4.0",
"description": "2.4.0: 解决时间控件只读问题,下拉框中的站点增加ID存储,人员选择器选择角色机构优化为选择",
"keywords": [
"panda-xform"
],
......
......@@ -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) {
return request({
......@@ -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) {
return request({
......
......@@ -153,7 +153,7 @@ const globalSettings = {
type: 'string',
default: 'row',
enum: ['row', 'column'],
enumNames: ['同行', '单独一行'],
enumNames: ['左右', '上下'],
widget: 'select',
displayType: 'row',
labelWidth: 100,
......
......@@ -75,7 +75,7 @@ const layoutWidgets = [
{
text: '分组名称',
name: '分组名称',
icon: <GroupOutlined />,
// icon: <GroupOutlined />,
schema: {
title: '分组名称',
type: 'object',
......@@ -111,7 +111,7 @@ const textWidgets = [
{
text: '文本',
name: '文本',
icon: <EditOutlined />,
// icon: <EditOutlined />,
schema: {
title: '文本',
type: 'string',
......@@ -296,7 +296,7 @@ const textWidgets = [
{
text: '多行文本',
name: '多行文本',
icon: <FormOutlined />,
// icon: <FormOutlined />,
schema: {
title: '多行文本',
type: 'string',
......@@ -436,7 +436,7 @@ const textWidgets = [
{
text: '数值',
name: '数值',
icon: <FieldBinaryOutlined />,
// icon: <FieldBinaryOutlined />,
schema: {
title: '数值',
type: 'string',
......@@ -562,7 +562,7 @@ const textWidgets = [
{
text: '富文本',
name: '富文本',
icon: <HighlightOutlined />,
// icon: <HighlightOutlined />,
schema: {
title: '富文本',
type: 'string',
......@@ -900,13 +900,12 @@ const selectWidgets = [
},
isMySite: {
title: '仅显示本人所属的站点',
name: '仅显示本人所属的站点',
required: true,
default: false,
// description: '勾选后仅显示本人所属的站点',
hidden: '{{formData.sourceType !== "站点"}}',
type: 'boolean',
widget: 'checkbox',
// width: '63%',
props: {
style: {
paddingLeft: '10px'
......@@ -922,28 +921,28 @@ const selectWidgets = [
title: '必填',
type: 'boolean',
default: false,
width: '33%',
width: '30%',
},
disabled: {
title: '只读',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '33%',
width: '30%',
},
hidden: {
title: '隐藏',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '33%',
width: '40%',
},
isMultiple: {
title: '多选',
type: 'boolean',
widget: 'checkbox',
default: false,
width: '33%',
width: '30%',
hidden: '{{formData.isEdit}}'
},
isSearch: {
......@@ -951,9 +950,18 @@ const selectWidgets = [
type: 'boolean',
widget: 'checkbox',
default: false,
width: '33%',
width: '30%',
default: true
},
isStoreID: {
title: '是否存储ID',
required: true,
default: false,
hidden: '{{formData.sourceType !== "站点"}}',
type: 'boolean',
widget: 'checkbox',
width: '40%',
},
isEdit: {
title: '是否可编辑',
type: 'boolean',
......@@ -1696,6 +1704,7 @@ const businessWidgets = [
role: {
title: '机构角色',
type: 'string',
widget: 'GroupAndRole',
displayType: 'row',
labelWidth: 80,
},
......@@ -2192,7 +2201,7 @@ const dateWidgets = [
{
text: '时间选择',
name: '时间选择',
icon: <FieldTimeOutlined />,
// icon: <FieldTimeOutlined />,
schema: {
title: '时间选择',
type: 'string',
......@@ -2341,7 +2350,7 @@ const fileWidgets = [
{
text: '附件',
name: '附件',
icon: <LinkOutlined />,
// icon: <LinkOutlined />,
schema: {
title: '附件',
type: 'string',
......
......@@ -134,6 +134,10 @@ const FormDesigner = (props, ref) => {
{
text: '预览',
onClick: (e) => {
const errors = designerRef.current.getErrorFields()
if (errors.length) {
return message.error('请按照提示完善表单内容')
}
setVisible(true)
let json = getJSON(designerRef.current.getValue(), tableName)
setSchema(json)
......@@ -144,11 +148,11 @@ const FormDesigner = (props, ref) => {
text: '提交',
onClick: async (value) => {
const errors = designerRef.current.getErrorFields()
let json = getJSON(designerRef.current.getValue(), tableName)
designerRef.current.setValue(json)
if (errors.length) {
return message.error('请按照提示完善表单内容')
}
let json = getJSON(designerRef.current.getValue(), tableName)
designerRef.current.setValue(json)
const { code, data, msg } = await saveTableConfig(json)
if (code === 0) {
message.info('保存成功')
......
......@@ -36,6 +36,7 @@ const Time = (props) => {
onChange={timeChange}
disabledDate={disabledDate}
locale={locale}
disabled={disabled}
placeholder={!disabled ? placeholder : ''}
getPopupContainer={(targterNode) => targterNode.parentElement || document.body}
/>
......
import React, { useState, useMemo, useEffect } from 'react'
import { Select, message } from 'antd'
import { GetSelectItemList, GetFieldValueFromTable, getStationListByUserID } from '../../../../apis/process'
import { GetSelectItemList, GetFieldValueFromTable, getStationListByUserID, getStationIDListByUserID } from '../../../../apis/process'
const { Option } = Select
......@@ -8,7 +8,7 @@ const ComboBox = (props) => {
const userID = window?.globalConfig?.userInfo?.OID || 1
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 [tableData, setTableData] = useState([])
const [site, setSite] = useState([])
......@@ -48,11 +48,15 @@ const ComboBox = (props) => {
let children = []
if (Array.isArray(enums)) {
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
}, [enums])
}, [sourceType, enums, isStoreID])
const handleChange = value => {
if (isMultiple || isEdit) {
......@@ -92,7 +96,7 @@ const ComboBox = (props) => {
}
}
if (sourceType === '站点') {
const { code, data, msg } = await getStationListByUserID(userID, !isMySite)
const { code, data, msg } = await getStationIDListByUserID(userID, !isMySite)
if (code === 0) {
if (Array.isArray(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) => {
if (e !== '手动输入') {
addons.setValueByPath('isEdit', false)
}
if (e !== '站点') {
addons.setValueByPath('isStoreID', false)
}
onChange(e)
}
......
import Dictionary from './Dictionary'
import AccountName from './AccountName'
import Fieldshine from './Fieldshine'
import GroupAndRole from './GroupAndRole'
import MappedField from './MappedField'
import ControlRules from './ControlRules'
import SourceType from './SourceType'
......@@ -12,6 +13,7 @@ const groupSource = {
Dictionary,
AccountName,
Fieldshine,
GroupAndRole,
MappedField,
ControlRules,
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