Pārlūkot izejas kodu

feat: 人员 角色

luoyali 1 gadu atpakaļ
vecāks
revīzija
1e2b7c6b44

+ 176 - 208
src/components/packages/formEditor/components/Layout/DragGable.jsx

@@ -1,16 +1,4 @@
-import {
-  defineComponent,
-  resolveComponent,
-  watch,
-  useAttrs,
-  useSlots,
-  defineAsyncComponent,
-  unref,
-  nextTick,
-  ref,
-  inject,
-  reactive
-} from 'vue'
+import { defineComponent, resolveComponent, watch, useAttrs, useSlots, defineAsyncComponent, unref, nextTick, ref, inject, reactive } from 'vue'
 import { isHTMLTag } from '@vue/shared'
 import DragGable from 'vuedraggable'
 import utils from '@ER/utils'
@@ -25,201 +13,181 @@ import LayoutSubformLayout from './SubformLayout'
 import Selection from '@ER/formEditor/components/Selection/selectElement.jsx'
 import ControlInsertionPlugin from './ControlInsertionPlugin'
 const dragGableWrap = defineComponent({
-  inheritAttrs: false,
-  name: 'customDragGable',
-  customOptions: {},
-  components: {
-    DragGable
-  },
-  setup (props) {
-    const {
-      isEditModel
-    } = hooks.useTarget()
-    return () => {
-      const attrs = useAttrs()
-      let node = ''
-      if (unref(isEditModel)) {
-        node = (
-          <dragGable
-            {...attrs}>
-            {useSlots()}
-          </dragGable>
-        )
-      } else {
-        const tag = isHTMLTag(attrs.tag) ? attrs.tag : resolveComponent(attrs.tag)
-        const {
-          item
-        } = useSlots()
-        node = (
-          <tag {...attrs.componentData}>
-            {attrs.list.map(e => {
-              return item({
-                element: e
-              })
-            })}
-          </tag>
-        )
-      }
-      return node
-    }
-  }
+	name: 'CustomDragGable',
+	components: {
+		DragGable
+	},
+	inheritAttrs: false,
+	customOptions: {},
+	setup(props) {
+		const { isEditModel } = hooks.useTarget()
+		return () => {
+			const attrs = useAttrs()
+			let node = ''
+			if (unref(isEditModel)) {
+				node = <dragGable {...attrs}>{useSlots()}</dragGable>
+			} else {
+				const tag = isHTMLTag(attrs.tag) ? attrs.tag : resolveComponent(attrs.tag)
+				const { item } = useSlots()
+				node = (
+					<tag {...attrs.componentData}>
+						{attrs.list.map(e => {
+							return item({
+								element: e
+							})
+						})}
+					</tag>
+				)
+			}
+			return node
+		}
+	}
 })
-export {
-  dragGableWrap
-}
+export { dragGableWrap }
 export default defineComponent({
-  name: 'DragGableLayout',
-  components: {
-    // DragGable
-  },
-  props: {
-    isRoot: {
-      type: Boolean,
-      default: false
-    },
-    data: Object,
-    parent: Object,
-    tag: {
-      type: String,
-      default: 'div'
-    },
-    type: {
-      type: String
-    }
-  },
-  setup (props) {
-    const ER = inject('Everright')
-    const isInline = props.type === 'inline'
-    const ns = hooks.useNamespace('DragGableLayout')
-    const {
-      state,
-      isEditModel,
-      isPc,
-      setSelection
-    } = hooks.useTarget()
-    console.log(state, 'state=======')
-    const handleMove = (e) => {
-      return true
-    }
-    const dragOptions = {
-      swapThreshold: 1,
-      group: {
-        name: 'er-Canves'
-      },
-      parent: props.parent,
-      plugins: [ControlInsertionPlugin(ER)],
-      ControlInsertion: true
-    }
-    const loadComponent = () => {
-      let componentMap = {}
-      watch(() => state.platform, () => {
-        componentMap = {}
-      })
-      return {
-        findComponent (type, element) {
-          let info = componentMap[type + element]
-          if (!info) {
-            info = componentMap[type + element] = defineAsyncComponent(() => import(`../${type}/${_.startCase(element)}/${state.platform}.vue`))
-          }
-          return info
-        }
-      }
-    }
-    const load = loadComponent()
-    const slots = {
-      item: ({ element }) => {
-        let node = ''
-        switch (element.type) {
-          case 'grid':
-            node = (<LayoutGridLayout key={element.id} data={element} parent={props.data}></LayoutGridLayout>)
-            break
-          case 'table':
-            node = (<LayoutTableLayout key={element.id} data={element} parent={props.data}></LayoutTableLayout>)
-            break
-          case 'tabs':
-            node = (<LayoutTabsLayout key={element.id} data={element} parent={props.data}></LayoutTabsLayout>)
-            break
-          case 'collapse':
-            node = (<LayoutCollapseLayout key={element.id} data={element} parent={props.data}></LayoutCollapseLayout>)
-            break
-          case 'inline':
-            node = (<LayoutInlineLayout key={element.id} data={element} parent={props.data}></LayoutInlineLayout>)
-            break
-          case 'subform':
-            if (unref(isEditModel) || _.get(state.fieldsLogicState.get(element), 'visible', undefined) !== 0) {
-              node = (<LayoutSubformLayout key={element.id} data={element} parent={props.data}></LayoutSubformLayout>)
-            }
-            break
-          default:
-            let TypeComponent = ''
-            if (unref(isEditModel) || _.get(state.fieldsLogicState.get(element), 'visible', undefined) !== 0) {
-              const typeProps = hooks.useProps(state, element, unref(isPc))
-              console.log(typeProps, 'typeProps')
-              TypeComponent = load.findComponent('FormTypes', element.type)
-              const params = {
-                data: element,
-                parent: props.data,
-                key: element.id
-              }
-              if (process.env.NODE_ENV === 'test') {
-                params['data-field-id'] = `${element.id}`
-              }
-              if (unref(isPc)) {
-                node = (
-                  // <Selection hasWidthScale hasCopy hasDel hasDrag hasMask data={element} parent={props.data}>
-                  <Selection hasWidthScale hasCopy hasDel hasDrag hasMask { ...params }>
-                    {
-                      element.type !== 'divider'
-                        ? (<el-form-item
-                          {...typeProps.value}
-                        >
-                          <TypeComponent data={element} params={typeProps.value}></TypeComponent>
-                        </el-form-item>)
-                        : <TypeComponent data={element} params={typeProps.value}></TypeComponent>
-                    }
-                  </Selection>
-                )
-              } else {
-                node = (
-                  <Selection hasWidthScale hasCopy hasDel hasDrag hasMask { ...params }>
-                    <TypeComponent data={element} params={typeProps.value}></TypeComponent>
-                  </Selection>
-                )
-              }
-            }
-            break
-        }
-        return node
-      },
-      footer () {
-        let node = ''
-        if (_.isEmpty(props.data)) {
-          if (!props.isRoot) {
-            node = (
-              <div class={ns.e('dropHere')}>
-                Drop here
-              </div>
-            )
-          }
-        }
-        return node
-      }
-    }
-    return () => {
-      return (
-        <dragGableWrap
-          list={props.data}
-          handle=".ER-handle"
-          class={[ns.b(), unref(isEditModel) && ns.e('edit')]}
-          tag={props.tag}
-          item-key="id"
-          move={handleMove}
-          {...dragOptions}
-          v-slots={slots}
-          componentData={useAttrs()}
-        >
-        </dragGableWrap>
-      )
-    }
-  }
+	name: 'DragGableLayout',
+	components: {
+		// DragGable
+	},
+	props: {
+		isRoot: {
+			type: Boolean,
+			default: false
+		},
+		data: Object,
+		parent: Object,
+		tag: {
+			type: String,
+			default: 'div'
+		},
+		type: {
+			type: String
+		}
+	},
+	setup(props) {
+		const ER = inject('Everright')
+		const isInline = props.type === 'inline'
+		const ns = hooks.useNamespace('DragGableLayout')
+		const { state, isEditModel, isPc, setSelection } = hooks.useTarget()
+		console.log(state, 'state=======')
+		const handleMove = e => {
+			return true
+		}
+		const dragOptions = {
+			swapThreshold: 1,
+			group: {
+				name: 'er-Canves'
+			},
+			parent: props.parent,
+			plugins: [ControlInsertionPlugin(ER)],
+			ControlInsertion: true
+		}
+		const loadComponent = () => {
+			let componentMap = {}
+			watch(
+				() => state.platform,
+				() => {
+					componentMap = {}
+				}
+			)
+			return {
+				findComponent(type, element) {
+					let info = componentMap[type + element]
+					if (!info) {
+						info = componentMap[type + element] = defineAsyncComponent(() => import(`../${type}/${_.startCase(element)}/${state.platform}.vue`))
+					}
+					return info
+				}
+			}
+		}
+		const load = loadComponent()
+		const slots = {
+			item: ({ element }) => {
+				let node = ''
+				switch (element.type) {
+					case 'grid':
+						node = <LayoutGridLayout key={element.id} data={element} parent={props.data}></LayoutGridLayout>
+						break
+					case 'table':
+						node = <LayoutTableLayout key={element.id} data={element} parent={props.data}></LayoutTableLayout>
+						break
+					case 'tabs':
+						node = <LayoutTabsLayout key={element.id} data={element} parent={props.data}></LayoutTabsLayout>
+						break
+					case 'collapse':
+						node = <LayoutCollapseLayout key={element.id} data={element} parent={props.data}></LayoutCollapseLayout>
+						break
+					case 'inline':
+						node = <LayoutInlineLayout key={element.id} data={element} parent={props.data}></LayoutInlineLayout>
+						break
+					case 'subform':
+						if (unref(isEditModel) || _.get(state.fieldsLogicState.get(element), 'visible', undefined) !== 0) {
+							node = <LayoutSubformLayout key={element.id} data={element} parent={props.data}></LayoutSubformLayout>
+						}
+						break
+					default:
+						let TypeComponent = ''
+						if (unref(isEditModel) || _.get(state.fieldsLogicState.get(element), 'visible', undefined) !== 0) {
+							const typeProps = hooks.useProps(state, element, unref(isPc))
+							console.log(typeProps, 'typeProps')
+							TypeComponent = load.findComponent('FormTypes', element.type)
+							const params = {
+								data: element,
+								parent: props.data,
+								key: element.id
+							}
+							if (process.env.NODE_ENV === 'test') {
+								params['data-field-id'] = `${element.id}`
+							}
+							if (unref(isPc)) {
+								node = (
+									// <Selection hasWidthScale hasCopy hasDel hasDrag hasMask data={element} parent={props.data}>
+									<Selection hasWidthScale hasCopy hasDel hasDrag hasMask {...params}>
+										{element.type !== 'divider' ? (
+											<el-form-item {...typeProps.value}>
+												<TypeComponent data={element} params={typeProps.value}></TypeComponent>
+											</el-form-item>
+										) : (
+											<TypeComponent data={element} params={typeProps.value}></TypeComponent>
+										)}
+									</Selection>
+								)
+							} else {
+								node = (
+									<Selection hasWidthScale hasCopy hasDel hasDrag hasMask {...params}>
+										<TypeComponent data={element} params={typeProps.value}></TypeComponent>
+									</Selection>
+								)
+							}
+						}
+						break
+				}
+				return node
+			},
+			footer() {
+				let node = ''
+				if (_.isEmpty(props.data)) {
+					if (!props.isRoot) {
+						node = <div class={ns.e('dropHere')}>Drop here</div>
+					}
+				}
+				return node
+			}
+		}
+		return () => {
+			return (
+				<dragGableWrap
+					list={props.data}
+					handle=".ER-handle"
+					class={[ns.b(), unref(isEditModel) && ns.e('edit')]}
+					tag={props.tag}
+					item-key="id"
+					move={handleMove}
+					{...dragOptions}
+					v-slots={slots}
+					componentData={useAttrs()}
+				></dragGableWrap>
+			)
+		}
+	}
 })

+ 1 - 1
src/components/packages/formEditor/components/Panels/Config/components/PropsPanel.vue

@@ -533,7 +533,7 @@ onMounted(() => {
       <template v-else-if="checkTypeBySelected(['subform'], 'defaultValue')">
         <PanelsConfigComponentsSubformDefaultValue/>
       </template>
-      <template v-else-if="checkTypeBySelected(['select'], 'defaultValue') && [2, 3].indexOf(target.options.renderType) > -1 ">
+      <template v-else-if="checkTypeBySelected(['select'], 'defaultValue') && [2, 3, 4].indexOf(target.options.renderType) > -1 ">
         <el-select
           v-model="target.options.defaultValue"
           :class="[utils.addTestId('configPanel-defaultValue', 'id')]"

+ 20 - 0
src/components/packages/formEditor/componentsConfig.js

@@ -150,6 +150,26 @@ export const fieldsConfig = [
           required: false,
           renderType: 3
         }
+      },
+      {
+        type: 'select',
+        label: '部门',
+        icon: 'dropdown0',
+        key: '',
+        id: '',
+        options: {
+          dataKey: '',
+          filterable: true,
+          multiple: false,
+          defaultValue: '',
+          placeholder: '',
+          labelWidth: 100,
+          isShowLabel: true,
+          disabled: false,
+          clearable: true,
+          required: false,
+          renderType: 4
+        }
       }
     ]
   },

+ 507 - 445
src/components/packages/formEditor/index.vue

@@ -12,96 +12,111 @@ import utils from '@ER/utils'
 import _ from 'lodash-es'
 import defaultProps from './defaultProps'
 import generatorData from './generatorData'
+
 export default {
-  name: 'Everright-form-editor'
+	name: 'EverrightFormEditor'
 }
 </script>
 <script setup>
+import { ls } from '@/utils/index'
+import user from '@/api/system/user'
+import role from '@/api/system/role'
+import department from '@/api/system/department'
+
+const token = ls.get('token')
+const userOptList = ref([])
+const roleOptList = ref([])
+const departmentOptList = ref([])
 const emit = defineEmits(['listener'])
-const props = defineProps(_.merge({
-  fieldsPanelWidth: {
-    type: String,
-    default: '220px'
-  },
-  fieldsPanelDefaultOpeneds: {
-    type: Array,
-    default: () => ['defaultField', 'field', 'container']
-  },
-  delHandle: {
-    type: Function,
-    default: () => {}
-  },
-  copyHandle: {
-    type: Function,
-    default: () => {}
-  },
-  inlineMax: {
-    type: Number,
-    default: 4
-  },
-  isShowClear: {
-    type: Boolean,
-    default: true
-  },
-  isShowI18n: {
-    type: Boolean,
-    default: true
-  },
-  dragMode: {
-    type: String,
-    default: 'icon',
-    validator: (value) => ['full', 'icon'].includes(value)
-  },
-  checkFieldsForNewBadge: {
-    type: Function,
-    default: () => {}
-  }
-}, defaultProps))
+const props = defineProps(
+	_.merge(
+		{
+			fieldsPanelWidth: {
+				type: String,
+				default: '220px'
+			},
+			fieldsPanelDefaultOpeneds: {
+				type: Array,
+				default: () => ['defaultField', 'field', 'container']
+			},
+			delHandle: {
+				type: Function,
+				default: () => {}
+			},
+			copyHandle: {
+				type: Function,
+				default: () => {}
+			},
+			inlineMax: {
+				type: Number,
+				default: 4
+			},
+			isShowClear: {
+				type: Boolean,
+				default: true
+			},
+			isShowI18n: {
+				type: Boolean,
+				default: true
+			},
+			dragMode: {
+				type: String,
+				default: 'icon',
+				validator: value => ['full', 'icon'].includes(value)
+			},
+			checkFieldsForNewBadge: {
+				type: Function,
+				default: () => {}
+			}
+		},
+		defaultProps
+	)
+)
 const layout = {
-  pc: [],
-  mobile: []
+	pc: [],
+	mobile: []
 }
 const previewPlatform = ref('pc')
 const previewLoading = ref(true)
 const state = reactive({
-  store: [],
-  selected: {},
-  mode: 'edit',
-  platform: 'pc',
-  children: [],
-  config: props.globalConfig,
-  previewVisible: false,
-  widthScaleLock: false,
-  data: {},
-  validateStates: [],
-  fields: [],
-  Namespace: 'formEditor',
-  logic: {}
+	store: [],
+	selected: {},
+	mode: 'edit',
+	platform: 'pc',
+	children: [],
+	config: props.globalConfig,
+	previewVisible: false,
+	widthScaleLock: false,
+	data: {},
+	validateStates: [],
+	fields: [],
+	Namespace: 'formEditor',
+	logic: {}
 })
 const isFoldFields = ref(true)
 const isFoldConfig = ref(true)
 state.validator = (target, fn) => {
-  if (target) {
-    const count = _.countBy(state.validateStates, 'data.key')
-    const newValue = target.key.trim()
-    if (utils.isNull(newValue)) {
-      _.find(state.validateStates, { data: { key: target.key } }).isWarning = true
-      fn && fn(0)
-      return false
-    }
-    state.validateStates.forEach(e => {
-      if (count[e.data.key] > 1) {
-        e.isWarning = true
-      } else {
-        e.isWarning = false
-      }
-    })
-    if (fn) {
-      fn(!(count[newValue] > 1) ? 1 : 2)
-    }
-  } else {
-    fn(state.validateStates.every(e => !e.isWarning))
-  }
+	if (target) {
+		const count = _.countBy(state.validateStates, 'data.key')
+		const newValue = target.key.trim()
+		if (utils.isNull(newValue)) {
+			_.find(state.validateStates, { data: { key: target.key } }).isWarning = true
+			fn && fn(0)
+			return false
+		}
+		state.validateStates.forEach(e => {
+			if (count[e.data.key] > 1) {
+				e.isWarning = true
+			} else {
+				e.isWarning = false
+			}
+		})
+		if (fn) {
+			fn(!(count[newValue] > 1) ? 1 : 2)
+		}
+	} else {
+		fn(state.validateStates.every(e => !e.isWarning))
+	}
 }
 // const {
 //   canUndo,
@@ -114,411 +129,458 @@ state.validator = (target, fn) => {
 //   // stop,
 //   // restart
 // } = hooks.useHistory(state)
-const {
-  t,
-  lang
-} = hooks.useI18n(props)
+const { t, lang } = hooks.useI18n(props)
 const EReditorPreviewRef = ref('')
 const isShow = ref(true)
 const isShowConfig = ref(true)
-const setSelection = (node) => {
-  let result = ''
-  if (node === 'root') {
-    result = state.config
-  } else {
-    if (node.type === 'inline') {
-      result = node.columns[0]
-    } else {
-      result = node
-    }
-  }
-  isShowConfig.value = state.selected === result
-  state.selected = result
-  nextTick(() => {
-    isShowConfig.value = true
-  })
+
+// 人员列表
+const getUserList = async () => {
+	const res = await user.userPageApi({ page: 1, pageSize: 99999 })
+	userOptList.value = res.records.map(item => {
+		return {
+			value: item.id,
+			label: item.username
+		}
+	})
+}
+getUserList()
+
+// 角色列表
+const getRoleList = async () => {
+	let res = await role.rolePageApi({ page: 1, pageSize: 99999 })
+	roleOptList.value = res.records.map(item => {
+		return {
+			value: item.id,
+			label: item.name
+		}
+	})
+}
+getRoleList()
+
+// 部门列表
+const getDepartmentList = async () => {
+	let res = await department.departmentPageApi({ page: 1, pageSize: 99999 })
+	departmentOptList.value = res.records.map(item => {
+		return {
+			value: item.id,
+			label: item.name
+		}
+	})
+}
+getDepartmentList()
+
+const setSelection = node => {
+	let result = ''
+	if (node === 'root') {
+		result = state.config
+	} else {
+		if (node.type === 'inline') {
+			result = node.columns[0]
+		} else {
+			result = node
+		}
+	}
+	isShowConfig.value = state.selected === result
+	state.selected = result
+	nextTick(() => {
+		isShowConfig.value = true
+	})
 }
 setSelection(state.config)
-const addField = (node) => {
-  if (utils.checkIsField(node)) {
-    const findIndex = _.findIndex(state.fields, {
-      id: node.id
-    })
-    if (findIndex === -1) {
-      state.fields.push(node)
-    } else {
-      state.fields.splice(findIndex, 1, node)
-    }
-  }
+const addField = node => {
+	if (utils.checkIsField(node)) {
+		const findIndex = _.findIndex(state.fields, {
+			id: node.id
+		})
+		if (findIndex === -1) {
+			state.fields.push(node)
+		} else {
+			state.fields.splice(findIndex, 1, node)
+		}
+	}
 }
-const delField = (node) => {
-  const fieldIndex = _.findIndex(state.fields, {
-    id: node.id
-  })
-  if (fieldIndex !== -1) {
-    if (utils.checkIdExistInLogic(node.id, state.logic)) {
-      ElMessage({
-        showClose: true,
-        duration: 4000,
-        message: t('er.logic.logicSuggests'),
-        type: 'warning'
-      })
-      utils.removeLogicDataByid(node.id, state.logic)
-    }
-    state.fields.splice(fieldIndex, 1)
-  }
+const delField = node => {
+	const fieldIndex = _.findIndex(state.fields, {
+		id: node.id
+	})
+	if (fieldIndex !== -1) {
+		if (utils.checkIdExistInLogic(node.id, state.logic)) {
+			ElMessage({
+				showClose: true,
+				duration: 4000,
+				message: t('er.logic.logicSuggests'),
+				type: 'warning'
+			})
+			utils.removeLogicDataByid(node.id, state.logic)
+		}
+		state.fields.splice(fieldIndex, 1)
+	}
 }
 const addFieldData = (node, isCopy = false) => {
-  if (/^(radio|cascader|checkbox|select)$/.test(node.type)) {
-    if (isCopy) {
-      state.data[node.id] = _.cloneDeep(state.data[node.options.dataKey])
-      node.options.dataKey = node.id
-    } else {
-      if (!state.data[node.id]) {
-        node.options.dataKey = node.id
-        state.data[node.id] = {
-          type: node.type,
-          list: utils.generateOptions(3).map((e, i) => {
-            e.label += i + 1
-            return e
-          })
-        }
-      }
-    }
-  }
-  if (/^(uploadfile|signature|html)$/.test(node.type)) {
-    node.options.headers = { accessToken: 'eyJhbGciOiJIUzUxMiJ9.eyJqdGkiOiIwIiwiaXNzIjoiYWRtaW4iLCJ1YSI6IjllNzdhIiwib2ciOiIxIiwiaWF0IjoxNzEzMTUxMzU5fQ.eqN343Zpic1WlzaaOgFsVHhSBk5kPNfrtaoXbgCBenpmI9L4R8eiTMpyM0Y3lvDTbR-aZde_o8Hb-9EO6baFQg' }
-    node.options.action = props.fileUploadURI
-    console.log(node.type, 'node.type=')
-  }
+	if (/^(radio|cascader|checkbox|select)$/.test(node.type)) {
+		if (node.type === 'select') {
+			if (node.options.renderType === 2) {
+				node.options.options = userOptList.value
+			}
+			if (node.options.renderType === 3) {
+				node.options.options = roleOptList.value
+			}
+			if (node.options.renderType === 4) {
+				node.options.options = departmentOptList.value
+			}
+		}
+		if (isCopy) {
+			state.data[node.id] = _.cloneDeep(state.data[node.options.dataKey])
+			node.options.dataKey = node.id
+		} else {
+			if (!state.data[node.id]) {
+				node.options.dataKey = node.id
+				state.data[node.id] = {
+					type: node.type,
+					list: utils.generateOptions(3).map((e, i) => {
+						e.label += i + 1
+						return e
+					})
+				}
+			}
+		}
+	}
+	if (/^(uploadfile|signature|html)$/.test(node.type)) {
+		node.options.headers = { accessToken: token }
+		node.options.action = props.fileUploadURI
+	}
 }
 const wrapElement = (el, isWrap = true, isSetSelection = true, sourceBlock = true, resetWidth = true) => {
-  const node = sourceBlock
-    ? generatorData(el, isWrap, lang.value, sourceBlock, (node) => {
-      addFieldData(node)
-      addField(node)
-    })
-    : isWrap
-      ? {
-          type: 'inline',
-          columns: [
-            el
-          ]
-        }
-      : el
-  if (!sourceBlock && resetWidth) {
-    if (utils.checkIsField(el)) {
-      if (state.platform === 'pc') {
-        el.style.width.pc = '100%'
-      } else {
-        el.style.width.mobile = '100%'
-      }
-      // el.style.width = {
-      //   pc: '100%',
-      //   mobile: '100%'
-      // }
-    } else {
-      el.style.width = '100%'
-    }
-  }
-  if (isSetSelection) {
-    // nextTick(() => {
-    //   setSelection(node)
-    // })
-  }
-  return node
+	const node = sourceBlock
+		? generatorData(el, isWrap, lang.value, sourceBlock, node => {
+				addFieldData(node)
+				addField(node)
+		  })
+		: isWrap
+		? {
+				type: 'inline',
+				columns: [el]
+		  }
+		: el
+	if (!sourceBlock && resetWidth) {
+		if (utils.checkIsField(el)) {
+			if (state.platform === 'pc') {
+				el.style.width.pc = '100%'
+			} else {
+				el.style.width.mobile = '100%'
+			}
+			// el.style.width = {
+			//   pc: '100%',
+			//   mobile: '100%'
+			// }
+		} else {
+			el.style.width = '100%'
+		}
+	}
+	if (isSetSelection) {
+		// nextTick(() => {
+		//   setSelection(node)
+		// })
+	}
+	return node
 }
 const syncLayout = (platform, fn) => {
-  const isPc = platform === 'pc'
-  const original = _.cloneDeep(state.store)
-  utils.disassemblyData2(original)
-  layout[isPc ? 'mobile' : 'pc'] = original
-  if (_.isEmpty(isPc ? layout.pc : layout.mobile)) {
-    // const newData = _.cloneDeep(state.fields.map(e => wrapElement(e, true, false)))
-    const newData = state.fields.filter(field => !utils.checkIsInSubform(field)).map(e => wrapElement(e, true, false, false, false))
-    fn && fn(newData)
-  } else {
-    // debugger
-    const layoutFields = utils.pickfields(isPc ? layout.pc : layout.mobile).map(e => {
-      return {
-        id: e
-      }
-    })
-    const copyData = _.cloneDeep(isPc ? layout.pc : layout.mobile)
-    const addFields = _.differenceBy(state.fields.filter(field => !utils.checkIsInSubform(field)), layoutFields, 'id')
-    const delFields = _.differenceBy(layoutFields, state.fields, 'id')
-    utils.repairLayout(copyData, delFields)
-    // console.log(JSON.stringify(copyData, '', 2))
-    utils.combinationData2(copyData, state.fields)
-    // console.log(JSON.stringify(copyData, '', 2))
-    copyData.push(...addFields.map(e => wrapElement(e, true, false, false, false)))
-    // copyData.push(...addFields)
-    fn && fn(copyData)
-  }
+	const isPc = platform === 'pc'
+	const original = _.cloneDeep(state.store)
+	utils.disassemblyData2(original)
+	layout[isPc ? 'mobile' : 'pc'] = original
+	if (_.isEmpty(isPc ? layout.pc : layout.mobile)) {
+		// const newData = _.cloneDeep(state.fields.map(e => wrapElement(e, true, false)))
+		const newData = state.fields.filter(field => !utils.checkIsInSubform(field)).map(e => wrapElement(e, true, false, false, false))
+		fn && fn(newData)
+	} else {
+		// debugger
+		const layoutFields = utils.pickfields(isPc ? layout.pc : layout.mobile).map(e => {
+			return {
+				id: e
+			}
+		})
+		const copyData = _.cloneDeep(isPc ? layout.pc : layout.mobile)
+		const addFields = _.differenceBy(
+			state.fields.filter(field => !utils.checkIsInSubform(field)),
+			layoutFields,
+			'id'
+		)
+		const delFields = _.differenceBy(layoutFields, state.fields, 'id')
+		utils.repairLayout(copyData, delFields)
+		// console.log(JSON.stringify(copyData, '', 2))
+		utils.combinationData2(copyData, state.fields)
+		// console.log(JSON.stringify(copyData, '', 2))
+		copyData.push(...addFields.map(e => wrapElement(e, true, false, false, false)))
+		// copyData.push(...addFields)
+		fn && fn(copyData)
+	}
 }
-const getLayoutDataByplatform = (platform) => {
-  const isPc = platform === 'pc'
-  if (_.isEmpty(isPc ? layout.pc : layout.mobile)) {
-    if (platform === state.platform) {
-      const original = _.cloneDeep(state.store)
-      utils.disassemblyData2(original)
-      return original
-    } else {
-      const newData = _.cloneDeep(state.fields.filter(field => !utils.checkIsInSubform(field)).map(e => wrapElement(e, true, false, false, false)))
-      utils.disassemblyData2(newData)
-      return newData
-    }
-  } else {
-    if (platform === state.platform) {
-      const original = _.cloneDeep(state.store)
-      utils.disassemblyData2(original)
-      layout[isPc ? 'pc' : 'mobile'] = original
-    }
-    const layoutFields = utils.pickfields(isPc ? layout.pc : layout.mobile).map(e => {
-      return {
-        id: e
-      }
-    })
-    const copyData = _.cloneDeep(isPc ? layout.pc : layout.mobile)
-    const addFields = _.cloneDeep(_.differenceBy(state.fields.filter(field => !utils.checkIsInSubform(field)), layoutFields, 'id').map(e => wrapElement(e, true, false, false, false)))
-    const delFields = _.differenceBy(layoutFields, state.fields, 'id')
-    utils.repairLayout(copyData, delFields)
-    utils.disassemblyData2(addFields)
-    copyData.push(...addFields)
-    return copyData
-  }
+const getLayoutDataByplatform = platform => {
+	const isPc = platform === 'pc'
+	if (_.isEmpty(isPc ? layout.pc : layout.mobile)) {
+		if (platform === state.platform) {
+			const original = _.cloneDeep(state.store)
+			utils.disassemblyData2(original)
+			return original
+		} else {
+			const newData = _.cloneDeep(state.fields.filter(field => !utils.checkIsInSubform(field)).map(e => wrapElement(e, true, false, false, false)))
+			utils.disassemblyData2(newData)
+			return newData
+		}
+	} else {
+		if (platform === state.platform) {
+			const original = _.cloneDeep(state.store)
+			utils.disassemblyData2(original)
+			layout[isPc ? 'pc' : 'mobile'] = original
+		}
+		const layoutFields = utils.pickfields(isPc ? layout.pc : layout.mobile).map(e => {
+			return {
+				id: e
+			}
+		})
+		const copyData = _.cloneDeep(isPc ? layout.pc : layout.mobile)
+		const addFields = _.cloneDeep(
+			_.differenceBy(
+				state.fields.filter(field => !utils.checkIsInSubform(field)),
+				layoutFields,
+				'id'
+			).map(e => wrapElement(e, true, false, false, false))
+		)
+		const delFields = _.differenceBy(layoutFields, state.fields, 'id')
+		utils.repairLayout(copyData, delFields)
+		utils.disassemblyData2(addFields)
+		copyData.push(...addFields)
+		return copyData
+	}
 }
-const switchPlatform = (platform) => {
-  if (state.platform === platform) {
-    return false
-  }
-  if (props.layoutType === 2) {
-    syncLayout(platform, (newData) => {
-      state.store = newData
-      // console.log(JSON.stringify(newData, '', 2))
-      state.store.forEach((e) => {
-        utils.addContext(e, state.store)
-      })
-    })
-  }
-  state.platform = platform
+const switchPlatform = platform => {
+	if (state.platform === platform) {
+		return false
+	}
+	if (props.layoutType === 2) {
+		syncLayout(platform, newData => {
+			state.store = newData
+			// console.log(JSON.stringify(newData, '', 2))
+			state.store.forEach(e => {
+				utils.addContext(e, state.store)
+			})
+		})
+	}
+	state.platform = platform
 }
 const canvesScrollRef = ref('')
 const fireEvent = (type, data) => {
-  emit('listener', {
-    type,
-    data
-  })
+	emit('listener', {
+		type,
+		data
+	})
 }
 const ns = hooks.useNamespace('Main', state.Namespace)
 const getData1 = () => {
-  return utils.disassemblyData1(_.cloneDeep({
-    list: state.store,
-    config: state.config,
-    data: state.data,
-    logic: state.logic
-  }))
+	return utils.disassemblyData1(
+		_.cloneDeep({
+			list: state.store,
+			config: state.config,
+			data: state.data,
+			logic: state.logic
+		})
+	)
 }
 const getData2 = () => {
-  const fields = utils.processField(_.cloneDeep(state.store))
-  layout.pc = getLayoutDataByplatform('pc')
-  layout.mobile = getLayoutDataByplatform('mobile')
-  return _.cloneDeep({
-    layout,
-    data: state.data,
-    config: state.config,
-    fields,
-    logic: state.logic
-  })
+	const fields = utils.processField(_.cloneDeep(state.store))
+	layout.pc = getLayoutDataByplatform('pc')
+	layout.mobile = getLayoutDataByplatform('mobile')
+	return _.cloneDeep({
+		layout,
+		data: state.data,
+		config: state.config,
+		fields,
+		logic: state.logic
+	})
 }
-const setData1 = (data) => {
-  if (_.isEmpty(data)) return false
-  // stop()
-  const newData = utils.combinationData1(_.cloneDeep(data))
-  // console.log(newData.list[0].columns[0].list[0][0].columns[0])
-  isShow.value = false
-  // console.log(data.list.slice(data.list.length - 1))
-  state.store = newData.list
-  // state.store = data.list.slice(data.list.length - 1)
-  state.config = newData.config
-  state.data = newData.data
-  state.fields = newData.fields
-  state.logic = newData.logic
-  setSelection(state.config)
-  state.store.forEach((e) => {
-    utils.addContext(e, state.store)
-  })
-  nextTick(() => {
-    isShow.value = true
-    // setSelection(state.store[0])
-    // restart()
-  })
+const setData1 = data => {
+	if (_.isEmpty(data)) return false
+	// stop()
+	const newData = utils.combinationData1(_.cloneDeep(data))
+	// console.log(newData.list[0].columns[0].list[0][0].columns[0])
+	isShow.value = false
+	// console.log(data.list.slice(data.list.length - 1))
+	state.store = newData.list
+	// state.store = data.list.slice(data.list.length - 1)
+	state.config = newData.config
+	state.data = newData.data
+	state.fields = newData.fields
+	state.logic = newData.logic
+	setSelection(state.config)
+	state.store.forEach(e => {
+		utils.addContext(e, state.store)
+	})
+	nextTick(() => {
+		isShow.value = true
+		// setSelection(state.store[0])
+		// restart()
+	})
 }
-const setData2 = (data) => {
-  if (_.isEmpty(data)) return false
-  // stop()
-  const newData = _.cloneDeep(data)
-  layout.pc = newData.layout.pc
-  layout.mobile = newData.layout.mobile
-  isShow.value = false
-  state.store = newData.list
-  state.fields = newData.fields
-  const curLayout = _.cloneDeep(newData.layout[state.platform])
-  utils.combinationData2(curLayout, state.fields)
-  state.store = curLayout
-  state.config = newData.config
-  state.data = newData.data
-  state.logic = newData.logic
-  setSelection(state.config)
-  state.store.forEach((e) => {
-    utils.addContext(e, state.store)
-  })
-  nextTick(() => {
-    isShow.value = true
-    // restart()
-  })
+const setData2 = data => {
+	if (_.isEmpty(data)) return false
+	// stop()
+	const newData = _.cloneDeep(data)
+	layout.pc = newData.layout.pc
+	layout.mobile = newData.layout.mobile
+	isShow.value = false
+	state.store = newData.list
+	state.fields = newData.fields
+	const curLayout = _.cloneDeep(newData.layout[state.platform])
+	utils.combinationData2(curLayout, state.fields)
+	state.store = curLayout
+	state.config = newData.config
+	state.data = newData.data
+	state.logic = newData.logic
+	setSelection(state.config)
+	state.store.forEach(e => {
+		utils.addContext(e, state.store)
+	})
+	nextTick(() => {
+		isShow.value = true
+		// restart()
+	})
 }
 const clearData = () => {
-  // layout.pc = []
-  // layout.mobile = []
-  // state.fields.splice(0)
-  // state.store.splice(0)
+	// layout.pc = []
+	// layout.mobile = []
+	// state.fields.splice(0)
+	// state.store.splice(0)
 }
 const getData = () => {
-  if (!state.validateStates.every(e => !e.isWarning)) {
-    return {}
-  } else {
-    return (props.layoutType === 1 ? getData1 : getData2)()
-  }
+	if (!state.validateStates.every(e => !e.isWarning)) {
+		return {}
+	} else {
+		return (props.layoutType === 1 ? getData1 : getData2)()
+	}
 }
 const setData = props.layoutType === 1 ? setData1 : setData2
 defineExpose({
-  switchPlatform (platform) {
-    switchPlatform(platform)
-  },
-  setData,
-  getData
+	switchPlatform(platform) {
+		switchPlatform(platform)
+	},
+	setData,
+	getData
 })
 const handleOperation = (type, val) => {
-  switch (type) {
-    case 1:
-      break
-    case 2:
-      // state.store = []
-      layout.pc = []
-      layout.mobile = []
-      state.fields.splice(0)
-      state.store.splice(0)
-      state.data = {}
-      setSelection('root')
-      break
-    case 3:
-      state.previewVisible = true
-      previewLoading.value = true
-      nextTick(() => {
-        EReditorPreviewRef.value.setData(getData())
-        nextTick(() => {
-          previewLoading.value = false
-        })
-      })
-      break
-    case 4:
-      fireEvent('save', getData())
-      break
-    case 5:
-      isFoldFields.value = !isFoldFields.value
-      break
-    case 6:
-      isFoldConfig.value = !isFoldConfig.value
-      break
-    case 7:
-      previewLoading.value = true
-      previewPlatform.value = val
-      EReditorPreviewRef.value.switchPlatform(val)
-      EReditorPreviewRef.value.setData(getData())
-      nextTick(() => {
-        nextTick(() => {
-          previewLoading.value = false
-        })
-      })
-      break
-  }
-}
-watch(() => state.selected, (newVal) => {
-  fireEvent('changeParams', _.cloneDeep(newVal))
-}, {
-  deep: true,
-  immediate: true
-})
-const onClickOutside = () => {
+	switch (type) {
+		case 1:
+			break
+		case 2:
+			// state.store = []
+			layout.pc = []
+			layout.mobile = []
+			state.fields.splice(0)
+			state.store.splice(0)
+			state.data = {}
+			setSelection('root')
+			break
+		case 3:
+			state.previewVisible = true
+			previewLoading.value = true
+			nextTick(() => {
+				EReditorPreviewRef.value.setData(getData())
+				nextTick(() => {
+					previewLoading.value = false
+				})
+			})
+			break
+		case 4:
+			fireEvent('save', getData())
+			break
+		case 5:
+			isFoldFields.value = !isFoldFields.value
+			break
+		case 6:
+			isFoldConfig.value = !isFoldConfig.value
+			break
+		case 7:
+			previewLoading.value = true
+			previewPlatform.value = val
+			EReditorPreviewRef.value.switchPlatform(val)
+			EReditorPreviewRef.value.setData(getData())
+			nextTick(() => {
+				nextTick(() => {
+					previewLoading.value = false
+				})
+			})
+			break
+	}
 }
+watch(
+	() => state.selected,
+	newVal => {
+		fireEvent('changeParams', _.cloneDeep(newVal))
+	},
+	{
+		deep: true,
+		immediate: true
+	}
+)
+const onClickOutside = () => {}
 provide('Everright', {
-  state,
-  setSelection,
-  props,
-  wrapElement,
-  delField,
-  addField,
-  switchPlatform,
-  addFieldData,
-  canvesScrollRef,
-  fireEvent,
-  getData
+	state,
+	setSelection,
+	props,
+	wrapElement,
+	delField,
+	addField,
+	switchPlatform,
+	addFieldData,
+	canvesScrollRef,
+	fireEvent,
+	getData
 })
 </script>
 <template>
-  <el-dialog
-    destroy-on-close
-    fullscreen
-    :class="[ns.e('previewDialog')]"
-    @closed="previewPlatform = pc"
-    v-model="state.previewVisible">
-    <template v-slot:header>
-      <DeviceSwitch :modelValue="previewPlatform" @update:modelValue="(val) => handleOperation(7, val)"></DeviceSwitch>
-    </template>
-    <el-scrollbar>
-      <div v-loading="previewLoading" :class="[ns.e('previewDialogWrap'), previewPlatform === 'mobile' && ns.is('mobilePreview')]">
-        <er-form-preview
-          v-bind="props"
-          ref="EReditorPreviewRef"
-        />
-      </div>
-    </el-scrollbar>
-  </el-dialog>
-  <el-container :class="[ns.b()]" direction="vertical">
-    <el-container>
-      <FieldsPanel v-show="isFoldFields"/>
-      <el-container :class="[ns.e('container')]">
-        <el-header :class="[ns.e('operation')]">
-          <div>
-            <Icon @click="handleOperation(4)" :class="[ns.e('icon')]" icon="save"></Icon>
-            <Icon v-if="isShowClear" @click="handleOperation(2)" :class="[ns.e('icon')]" icon="clear0"></Icon>
-            <slot name="operation-left"></slot>
-          </div>
-          <div>
-            <DeviceSwitch :modelValue="state.platform" @update:modelValue="(val) => switchPlatform(val)"></DeviceSwitch>
-          </div>
-          <div>
-            <slot name="operation-right"></slot>
-            <el-dropdown
-              v-if="isShowI18n"
-              @command="(command) => fireEvent('lang', command)">
-              <Icon :class="[ns.e('icon')]" icon="language"></Icon>
-              <template #dropdown>
-                <el-dropdown-menu>
-                  <el-dropdown-item command="zh-cn" :disabled="lang === 'zh-cn'">中文</el-dropdown-item>
-                  <el-dropdown-item command="en" :disabled="lang === 'en'">English</el-dropdown-item>
-                </el-dropdown-menu>
-              </template>
-            </el-dropdown>
-            <Icon @click="handleOperation(3)" :class="[ns.e('icon')]" icon="preview"></Icon>
-          </div>
-        </el-header>
-        <CanvesPanel v-click-outside="onClickOutside" v-if="isShow" :data="state.store"></CanvesPanel>
-        <Icon @click="handleOperation(5)" :class="[ns.e('arrowLeft'), !isFoldFields && ns.is('close')]" icon="arrowLeft"></Icon>
-        <Icon @click="handleOperation(6)" :class="[ns.e('arrowRight'), !isFoldConfig && ns.is('close')]" icon="arrowRight"></Icon>
-      </el-container>
-      <ConfigPanel v-show="isFoldConfig" v-if="isShow && isShowConfig"></ConfigPanel>
-    </el-container>
-  </el-container>
+	<el-dialog v-model="state.previewVisible" destroy-on-close fullscreen :class="[ns.e('previewDialog')]" @closed="previewPlatform = pc">
+		<template #header>
+			<DeviceSwitch :model-value="previewPlatform" @update:modelValue="val => handleOperation(7, val)"></DeviceSwitch>
+		</template>
+		<el-scrollbar>
+			<div v-loading="previewLoading" :class="[ns.e('previewDialogWrap'), previewPlatform === 'mobile' && ns.is('mobilePreview')]">
+				<er-form-preview v-bind="props" ref="EReditorPreviewRef" />
+			</div>
+		</el-scrollbar>
+	</el-dialog>
+	<el-container :class="[ns.b()]" direction="vertical">
+		<el-container>
+			<FieldsPanel v-show="isFoldFields" />
+			<el-container :class="[ns.e('container')]">
+				<el-header :class="[ns.e('operation')]">
+					<div>
+						<Icon :class="[ns.e('icon')]" icon="save" @click="handleOperation(4)"></Icon>
+						<Icon v-if="isShowClear" :class="[ns.e('icon')]" icon="clear0" @click="handleOperation(2)"></Icon>
+						<slot name="operation-left"></slot>
+					</div>
+					<div>
+						<DeviceSwitch :model-value="state.platform" @update:modelValue="val => switchPlatform(val)"></DeviceSwitch>
+					</div>
+					<div>
+						<slot name="operation-right"></slot>
+						<el-dropdown v-if="isShowI18n" @command="command => fireEvent('lang', command)">
+							<Icon :class="[ns.e('icon')]" icon="language"></Icon>
+							<template #dropdown>
+								<el-dropdown-menu>
+									<el-dropdown-item command="zh-cn" :disabled="lang === 'zh-cn'">中文</el-dropdown-item>
+									<el-dropdown-item command="en" :disabled="lang === 'en'">English</el-dropdown-item>
+								</el-dropdown-menu>
+							</template>
+						</el-dropdown>
+						<Icon :class="[ns.e('icon')]" icon="preview" @click="handleOperation(3)"></Icon>
+					</div>
+				</el-header>
+				<CanvesPanel v-if="isShow" v-click-outside="onClickOutside" :data="state.store"></CanvesPanel>
+				<Icon :class="[ns.e('arrowLeft'), !isFoldFields && ns.is('close')]" icon="arrowLeft" @click="handleOperation(5)"></Icon>
+				<Icon :class="[ns.e('arrowRight'), !isFoldConfig && ns.is('close')]" icon="arrowRight" @click="handleOperation(6)"></Icon>
+			</el-container>
+			<ConfigPanel v-show="isFoldConfig" v-if="isShow && isShowConfig"></ConfigPanel>
+		</el-container>
+	</el-container>
 </template>

+ 1 - 1
src/components/packages/formEditor/locale/en.js

@@ -15,7 +15,7 @@ export default {
       number: 'Number',
       radio: 'Radio',
       checkbox: 'Checkbox',
-      select: ['Select', 'Employee', 'Role'],
+      select: ['Select', 'Employee', 'Role', 'Department'],
       time: 'Time',
       date: 'Date',
       rate: 'Rate',

+ 1 - 1
src/components/packages/formEditor/locale/zh-cn.js

@@ -15,7 +15,7 @@ export default {
       number: '数字',
       radio: '单选框',
       checkbox: '复选框',
-      select: ['下拉框', '人员', '角色'],
+      select: ['下拉框', '人员', '角色', '部门'],
       time: '时间',
       date: '日期',
       rate: '评分',

+ 468 - 501
src/components/packages/hooks/use-props/index.js

@@ -7,513 +7,480 @@ import { areaList } from '@vant/area-data'
 import { useI18n } from '../use-i18n'
 import utils from '@ER/utils'
 const findPosition = (node, parent) => {
-  for (let y = 0; y < parent.list.length; y++) {
-    const row = parent.list[y]
-    const x = row.indexOf(node)
-    if (x !== -1) {
-      return { x, y }
-    }
-  }
+	for (let y = 0; y < parent.list.length; y++) {
+		const row = parent.list[y]
+		const x = row.indexOf(node)
+		if (x !== -1) {
+			return { x, y }
+		}
+	}
 
-  return { x: -1, y: -1 }
+	return { x: -1, y: -1 }
 }
 const addValidate = (result, node, isPc, t, state, ExtraParams) => {
-  const {
-    options
-  } = node
-  if (isPc) {
-    result.prop = node.context && node.context.parents.map((e, index) => {
-      let result = ''
-      if (!index) {
-        result = e.context.parent.indexOf(e)
-      } else {
-        const parent = e.context.parent
-        let nodes = []
-        if (parent.type === 'subform') {
-          const {
-            x,
-            y
-          } = findPosition(e, parent)
-          result += `list.${y}.${x}`
-        } else {
-          if (parent.columns) {
-            nodes = parent.columns
-            result += 'columns.'
-          } else if (parent.list) {
-            nodes = parent.list
-            result += 'list.'
-          } else if (parent.rows) {
-            nodes = parent.rows
-            result += 'rows.'
-          }
-          result += nodes.indexOf(e)
-        }
-      }
-      return result
-    }).join('.') + '.options.defaultValue'
-  }
+	const { options } = node
+	if (isPc) {
+		result.prop =
+			node.context &&
+			node.context.parents
+				.map((e, index) => {
+					let result = ''
+					if (!index) {
+						result = e.context.parent.indexOf(e)
+					} else {
+						const parent = e.context.parent
+						let nodes = []
+						if (parent.type === 'subform') {
+							const { x, y } = findPosition(e, parent)
+							result += `list.${y}.${x}`
+						} else {
+							if (parent.columns) {
+								nodes = parent.columns
+								result += 'columns.'
+							} else if (parent.list) {
+								nodes = parent.list
+								result += 'list.'
+							} else if (parent.rows) {
+								nodes = parent.rows
+								result += 'rows.'
+							}
+							result += nodes.indexOf(e)
+						}
+					}
+					return result
+				})
+				.join('.') + '.options.defaultValue'
+	}
 
-  const obj = {
-  }
-  const validator = (...arg0) => new Promise((...arg1) => {
-    const resolve = () => {
-      arg1[0]()
-    }
-    const reject = isPc
-      ? arg1[1]
-      : (message) => {
-          obj.message = message
-          arg1[0](false)
-        }
-    let value = isPc ? arg0[1] : arg0[0]
-    if (/^(signature|radio|checkbox|select|html)$/.test(node.type)) {
-      value = options.defaultValue
-    }
-    const newValue = options.isShowTrim ? value.trim() : value
-    if (node.type === 'subform') {
-      const allFields = utils.findSubFormAllFields(node)
-      if (result.required) {
-        if (allFields.length) {
-          if (allFields.some(e => utils.isEmpty(e.options.isShowTrim ? e.options.defaultValue.trim() : e.options.defaultValue))) {
-            reject(t('er.validateMsg.required'))
-          }
-        } else {
-          reject(t('er.validateMsg.required'))
-        }
-      } else {
-        resolve()
-      }
-    } else {
-      let isRequired = result.required
-      if (state.mode === 'preview' && utils.checkIsInSubform(node)) {
-        const parent = node?.context?.parent?.context?.parent
-        if (parent) {
-          const {
-            readOnly,
-            required
-          } = getLogicStateByField(parent, state.fieldsLogicState)
-          const parentProps = useProps(state, parent, isPc, false, false, t, ExtraParams).value
-          if (required !== undefined) {
-            isRequired = parentProps.required
-          }
-        }
-      }
-      if (isRequired && node.type !== 'subform' && utils.isEmpty(newValue)) {
-        reject(t('er.validateMsg.required'))
-        return
-      }
-    }
-    switch (node.type) {
-      case 'input':
-        switch (options.renderType) {
-          case 1:
-            if (!!newValue && options.isShowWordLimit && newValue.length < options.min) {
-              reject(t('er.validateMsg.limitWord', { min: options.min }))
-            } else {
-              resolve()
-            }
-            break
-          case 2:
-            if (!!newValue && !/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(newValue)) {
-              reject(t('er.validateMsg.email'))
-            } else {
-              resolve()
-            }
-            break
-          case 3:
-            if (!!newValue && !/^(^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$)|(^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])((\d{4})|\d{3}[Xx])$)$/.test(newValue)) {
-              reject(t('er.validateMsg.IdNumber'))
-            } else {
-              resolve()
-            }
-            break
-          case 4:
-            if (!!newValue && !/^(13[0-9]|15[012356789]|166|17[3678]|18[0-9]|14[57])[0-9]{8}$/.test(newValue)) {
-              reject(t('er.validateMsg.phone'))
-            } else {
-              resolve()
-            }
-            break
-          case 5:
-            if (!!newValue && !/^https?:\/\/(([a-zA-Z0-9_-])+(\.)?)*(:\d+)?(\/((\.)?(\?)?=?&?[a-zA-Z0-9_-](\?)?)*)*$/i.test(newValue)) {
-              reject(t('er.validateMsg.http'))
-            } else {
-              resolve()
-            }
-            break
-        }
-        break
-      case 'textarea':
-        if (!!newValue && options.isShowWordLimit && newValue.length < options.min) {
-          reject(t('er.validateMsg.limitWord', { min: options.min }))
-        } else {
-          resolve()
-        }
-        break
-      default:
-        resolve()
-        break
-    }
-  })
-  if (isPc) {
-    obj.required = options.required
-    obj.asyncValidator = validator
-  } else {
-    obj.validator = validator
-  }
-  result.rules = [obj]
+	const obj = {}
+	const validator = (...arg0) =>
+		new Promise((...arg1) => {
+			const resolve = () => {
+				arg1[0]()
+			}
+			const reject = isPc
+				? arg1[1]
+				: message => {
+						obj.message = message
+						arg1[0](false)
+				  }
+			let value = isPc ? arg0[1] : arg0[0]
+			if (/^(signature|radio|checkbox|select|html)$/.test(node.type)) {
+				value = options.defaultValue
+			}
+			const newValue = options.isShowTrim ? value.trim() : value
+			if (node.type === 'subform') {
+				const allFields = utils.findSubFormAllFields(node)
+				if (result.required) {
+					if (allFields.length) {
+						if (allFields.some(e => utils.isEmpty(e.options.isShowTrim ? e.options.defaultValue.trim() : e.options.defaultValue))) {
+							reject(t('er.validateMsg.required'))
+						}
+					} else {
+						reject(t('er.validateMsg.required'))
+					}
+				} else {
+					resolve()
+				}
+			} else {
+				let isRequired = result.required
+				if (state.mode === 'preview' && utils.checkIsInSubform(node)) {
+					const parent = node?.context?.parent?.context?.parent
+					if (parent) {
+						const { readOnly, required } = getLogicStateByField(parent, state.fieldsLogicState)
+						const parentProps = useProps(state, parent, isPc, false, false, t, ExtraParams).value
+						if (required !== undefined) {
+							isRequired = parentProps.required
+						}
+					}
+				}
+				if (isRequired && node.type !== 'subform' && utils.isEmpty(newValue)) {
+					reject(t('er.validateMsg.required'))
+					return
+				}
+			}
+			switch (node.type) {
+				case 'input':
+					switch (options.renderType) {
+						case 1:
+							if (!!newValue && options.isShowWordLimit && newValue.length < options.min) {
+								reject(t('er.validateMsg.limitWord', { min: options.min }))
+							} else {
+								resolve()
+							}
+							break
+						case 2:
+							if (!!newValue && !/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(newValue)) {
+								reject(t('er.validateMsg.email'))
+							} else {
+								resolve()
+							}
+							break
+						case 3:
+							if (
+								!!newValue &&
+								!/^(^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$)|(^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])((\d{4})|\d{3}[Xx])$)$/.test(
+									newValue
+								)
+							) {
+								reject(t('er.validateMsg.IdNumber'))
+							} else {
+								resolve()
+							}
+							break
+						case 4:
+							if (!!newValue && !/^(13[0-9]|15[012356789]|166|17[3678]|18[0-9]|14[57])[0-9]{8}$/.test(newValue)) {
+								reject(t('er.validateMsg.phone'))
+							} else {
+								resolve()
+							}
+							break
+						case 5:
+							if (!!newValue && !/^https?:\/\/(([a-zA-Z0-9_-])+(\.)?)*(:\d+)?(\/((\.)?(\?)?=?&?[a-zA-Z0-9_-](\?)?)*)*$/i.test(newValue)) {
+								reject(t('er.validateMsg.http'))
+							} else {
+								resolve()
+							}
+							break
+					}
+					break
+				case 'textarea':
+					if (!!newValue && options.isShowWordLimit && newValue.length < options.min) {
+						reject(t('er.validateMsg.limitWord', { min: options.min }))
+					} else {
+						resolve()
+					}
+					break
+				default:
+					resolve()
+					break
+			}
+		})
+	if (isPc) {
+		obj.required = options.required
+		obj.asyncValidator = validator
+	} else {
+		obj.validator = validator
+	}
+	result.rules = [obj]
 }
 const getLogicStateByField = (field, fieldsLogicState) => {
-  const fieldState = fieldsLogicState.get(field)
-  const required = _.get(fieldState, 'required', undefined)
-  const readOnly = _.get(fieldState, 'readOnly', undefined)
-  return {
-    required,
-    readOnly
-  }
+	const fieldState = fieldsLogicState.get(field)
+	const required = _.get(fieldState, 'required', undefined)
+	const readOnly = _.get(fieldState, 'readOnly', undefined)
+	return {
+		required,
+		readOnly
+	}
 }
 export const useProps = (state, data, isPc = true, isRoot = false, specialHandling, t, ExtraParams) => {
-  if (!t) {
-    t = useI18n().t
-  }
-  if (!ExtraParams) {
-    ExtraParams = inject('EverrightExtraParams', {})
-  }
-  return computed(() => {
-    let node = isRoot ? data.config : data
-    let result = {}
-    const platform = isPc ? 'pc' : 'mobile'
-    if (isRoot) {
-      if (isPc) {
-        result.model = data.store
-        result.size = node.pc.size
-        result.labelPosition = node[platform].labelPosition
-      } else {
-        result.labelAlign = node[platform].labelPosition
-      }
-      return result
-    }
-    if (isRef(data)) {
-      node = data.value
-    }
-    const {
-      options
-    } = node
-    result = {
-      label: options.isShowLabel ? node.label : '',
-      disabled: options.disabled,
-      placeholder: options.placeholder,
-      clearable: options.clearable,
-      required: options.required
-    }
-    if (state.mode === 'preview') {
-      const {
-        readOnly,
-        required
-      } = getLogicStateByField(node, state.fieldsLogicState)
-      if (readOnly === undefined) {
-        result.disabled = options.disabled
-      } else {
-        result.disabled = readOnly === 1
-      }
-      if (required === undefined) {
-        result.required = result.disabled ? false : result.required
-      } else {
-        result.required = result.disabled ? false : required === 1
-      }
-      if (utils.checkIsInSubform(node)) {
-        const parent = node?.context?.parent?.context?.parent
-        if (parent) {
-          const {
-            readOnly,
-            required
-          } = getLogicStateByField(node, state.fieldsLogicState)
-          const parentProps = useProps(state, parent, isPc, false, false, t, ExtraParams).value
-          if (readOnly !== undefined) {
-            result.disabled = parentProps.disabled
-          }
-          if (required !== undefined) {
-            result.required = parentProps.required
-          }
-        }
-      }
-    }
-    try {
-      if (ExtraParams.inSubformDefaultValueComponent) {
-        result.disabled = result.required = false
-      }
-    } catch (e) {
-    }
-    addValidate(result, node, isPc, t, state, ExtraParams)
-    if (isPc) {
-      result.labelWidth = options.isShowLabel ? options.labelWidth + 'px' : 'auto'
-    }
-    switch (node.type) {
-      case 'input':
-        if (options.isShowWordLimit) {
-          result.maxlength = options.max
-          result['show-word-limit'] = options.isShowWordLimit
-        }
-        if (isPc) {
-          result.showPassword = options.showPassword
-          result.prepend = options.prepend
-          result.append = options.append
-        } else {
-          if (options.showPassword) {
-            result.type = 'password'
-          }
-          if (options.renderType === 4) {
-            result.type = 'tel'
-          }
-        }
-        break
-      case 'textarea':
-        if (options.isShowWordLimit) {
-          result.maxlength = options.max
-          result['show-word-limit'] = options.isShowWordLimit
-        }
-        result.type = 'textarea'
-        result.rows = options.rows
-        break
-      case 'number':
-        if (isPc) {
-          result.controls = options.controls
-          if (options.controls) {
-            result['controls-position'] = options.controlsPosition ? 'right' : ''
-          }
-        } else {
-          // result.inputWidth = '100px'
-          result.defaultValue = null
-          result.allowEmpty = true
-        }
-        if (options.isShowWordLimit) {
-          result.min = options.min
-          result.max = options.max
-        } else {
-          result.min = Number.NEGATIVE_INFINITY
-          result.max = Number.POSITIVE_INFINITY
-        }
-        result.step = options.step
-        result.precision = options.precision
-        break
-      case 'radio':
-      case 'checkbox':
-        result.options = _.get(state, `data[${options.dataKey}].list`, [])
-        break
-      case 'select':
-        const { renderType } = options
-        // 当前选中的值,如果是人员就获取人员的api,部门就获取部门的api
-        if (renderType === 2) {
-          result.options = [
-            { value: '啦啦啦啦002', label: '001' }
-          ]
-        } else if (renderType === 3) {
-          result.options = [
-            { value: '啦啦啦啦003', label: '003' }
-          ]
-        } else if (renderType === 1) {
-          result.options = _.get(state, `data[${options.dataKey}].list`, [])
-        }
-        result.multiple = options.multiple
-        result.filterable = options.filterable
-        break
-      case 'time':
-        result.format = options.format
-        if (isPc) {
-          result.valueFormat = options.valueFormat
-        }
-        break
-      case 'date':
-        result.placeholder = options.placeholder
-        // result.startPlaceholder = options.startPlaceholder
-        // result.endPlaceholder = options.endPlaceholder
-        result.format = options.format
-        result.type = options.type
-        if (isPc) {
-          result.valueFormat = 'X'
-          if (options.type === 'daterange') {
-            result.rangeSeparator = ''
-            result.startPlaceholder = options.placeholder
-          }
-          result.disabledDate = (time) => {
-            const {
-              startTime,
-              endTime,
-              isShowWeeksLimit
-            } = options
-            const startDate = dayjs.unix(startTime)
-            const endDate = dayjs.unix(endTime)
-            const currentDate = dayjs(time)
-            let result = false
-            if (options.isShowWordLimit) {
-              result = currentDate.isBefore(startDate) || currentDate.isAfter(endDate)
-            }
-            return result
-          }
-        } else {
-          const {
-            startTime,
-            endTime,
-            isShowWeeksLimit
-          } = options
-          switch (options.type) {
-            case 'date':
-            case 'datetime':
-              if (startTime && options.isShowWordLimit) {
-                result.minDate = dayjs.unix(startTime).toDate()
-              } else {
-                result.minDate = dayjs.unix(0).toDate()
-              }
-              if (endTime && options.isShowWordLimit) {
-                result.maxDate = dayjs.unix(endTime).toDate()
-              } else {
-                result.maxDate = dayjs().add(20, 'year').toDate()
-              }
-              break
-            case 'dates':
-              if (_.isEmpty(options.defaultValue)) {
-                result.defaultDate = null
-              } else {
-                options.defaultValue.map(e => dayjs.unix(e).toDate())
-              }
-              if (startTime && options.isShowWordLimit) {
-                result.minDate = dayjs.unix(startTime).toDate()
-              } else {
-                result.minDate = dayjs().subtract(1, 'year').toDate()
-              }
-              if (endTime && options.isShowWordLimit) {
-                result.maxDate = dayjs.unix(endTime).toDate()
-              } else {
-                result.maxDate = dayjs().add(1, 'year').toDate()
-              }
-              break
-            case 'daterange':
-              if (options.defaultValue) {
-                result.defaultDate = options.defaultValue.map(e => dayjs.unix(e).toDate())
-              } else {
-                result.defaultDate = null
-              }
-              if (startTime && options.isShowWordLimit) {
-                result.minDate = dayjs.unix(startTime).toDate()
-              } else {
-                result.minDate = dayjs().subtract(1, 'year').toDate()
-              }
-              if (endTime && options.isShowWordLimit) {
-                result.maxDate = dayjs.unix(endTime).toDate()
-              } else {
-                result.maxDate = dayjs().add(1, 'year').toDate()
-              }
-              break
-          }
-        }
-        break
-      case 'cascader':
-        result.options = _.get(state, `data[${options.dataKey}].list`, [])
-        result.props = {
-          multiple: options.multiple,
-          checkStrictly: options.checkStrictly
-        }
-        // result.options = options.options
-        break
-      case 'slider':
-        result.step = options.step
-        result.min = options.min
-        result.max = options.max
-        break
-      case 'divider':
-        result.contentPosition = options.contentPosition
-        break
-      case 'rate':
-        result.allowHalf = options.allowHalf
-        if (!isPc) {
-          result.count = options.max
-        } else {
-          result.max = options.max
-        }
-        break
-      case 'html':
-        result.type = 'textarea'
-        result.rows = 4
-        result.action = options.action
-        result.maxSize = options.size * 1024 * 1024
-        result.config = {
-          placeholder: options.placeholder
-        }
-        if (!isPc) {
-          result.config.toolbar = {
-            items: [
-              'formattingOptions',
-              '|',
-              'uploadImage',
-              'bold',
-              'italic',
-              'underline',
-              'strikethrough',
-              'link',
-              'undo',
-              'redo'
-            ]
-          }
-          result.config.formattingOptions = [
-            'fontFamily',
-            'fontSize',
-            'fontColor',
-            'fontBackgroundColor',
-            '|',
-            'alignment',
-            'blockQuote',
-            '|',
-            'bulletedList',
-            'numberedList',
-            '|',
-            'outdent',
-            'indent',
-            '|',
-            'insertTable',
-            'removeFormat'
-          ]
-        }
-        break
-      case 'uploadfile':
-        console.log(options, 'uploadfile')
-        result.multiple = options.multiple
-        result.action = options.action
-        // result.size = options.size
-        result.accept = options.accept
-        result.maxSize = options.size * 1024 * 1024
-        result.headers = options.headers
-        if (isPc) {
-          result.limit = options.limit
-        } else {
-          result.maxCount = options.limit
-          result.onOversize = (file) => {
-            showToast(t('er.validateMsg.fileSize', { size: options.size }))
-          }
-        }
-        break
-      case 'region':
-        if (isPc) {
-          const region = new Region(areaList, {
-            isFilter: false,
-            selectType: options.selectType
-          })
-          result.options = region.getAll()
-          result.props = {
-            emitPath: false
-          }
-          result.filterable = options.filterable
-        } else {
-          result.areaList = areaList
-          result.columnsNum = options.selectType
-        }
-        break
-      case 'signature':
-        console.log(options, 'signature')
-        result.headers = options.headers
-        break
-    }
-    specialHandling && specialHandling(node.type, result)
-    // console.log(result, '===result===')
-    return result
-  })
+	if (!t) {
+		t = useI18n().t
+	}
+	if (!ExtraParams) {
+		ExtraParams = inject('EverrightExtraParams', {})
+	}
+	return computed(() => {
+		let node = isRoot ? data.config : data
+		let result = {}
+		const platform = isPc ? 'pc' : 'mobile'
+		if (isRoot) {
+			if (isPc) {
+				result.model = data.store
+				result.size = node.pc.size
+				result.labelPosition = node[platform].labelPosition
+			} else {
+				result.labelAlign = node[platform].labelPosition
+			}
+			return result
+		}
+		if (isRef(data)) {
+			node = data.value
+		}
+		const { options } = node
+		result = {
+			label: options.isShowLabel ? node.label : '',
+			disabled: options.disabled,
+			placeholder: options.placeholder,
+			clearable: options.clearable,
+			required: options.required
+		}
+		if (state.mode === 'preview') {
+			const { readOnly, required } = getLogicStateByField(node, state.fieldsLogicState)
+			if (readOnly === undefined) {
+				result.disabled = options.disabled
+			} else {
+				result.disabled = readOnly === 1
+			}
+			if (required === undefined) {
+				result.required = result.disabled ? false : result.required
+			} else {
+				result.required = result.disabled ? false : required === 1
+			}
+			if (utils.checkIsInSubform(node)) {
+				const parent = node?.context?.parent?.context?.parent
+				if (parent) {
+					const { readOnly, required } = getLogicStateByField(node, state.fieldsLogicState)
+					const parentProps = useProps(state, parent, isPc, false, false, t, ExtraParams).value
+					if (readOnly !== undefined) {
+						result.disabled = parentProps.disabled
+					}
+					if (required !== undefined) {
+						result.required = parentProps.required
+					}
+				}
+			}
+		}
+		try {
+			if (ExtraParams.inSubformDefaultValueComponent) {
+				result.disabled = result.required = false
+			}
+		} catch (e) {}
+		addValidate(result, node, isPc, t, state, ExtraParams)
+		if (isPc) {
+			result.labelWidth = options.isShowLabel ? options.labelWidth + 'px' : 'auto'
+		}
+		switch (node.type) {
+			case 'input':
+				if (options.isShowWordLimit) {
+					result.maxlength = options.max
+					result['show-word-limit'] = options.isShowWordLimit
+				}
+				if (isPc) {
+					result.showPassword = options.showPassword
+					result.prepend = options.prepend
+					result.append = options.append
+				} else {
+					if (options.showPassword) {
+						result.type = 'password'
+					}
+					if (options.renderType === 4) {
+						result.type = 'tel'
+					}
+				}
+				break
+			case 'textarea':
+				if (options.isShowWordLimit) {
+					result.maxlength = options.max
+					result['show-word-limit'] = options.isShowWordLimit
+				}
+				result.type = 'textarea'
+				result.rows = options.rows
+				break
+			case 'number':
+				if (isPc) {
+					result.controls = options.controls
+					if (options.controls) {
+						result['controls-position'] = options.controlsPosition ? 'right' : ''
+					}
+				} else {
+					// result.inputWidth = '100px'
+					result.defaultValue = null
+					result.allowEmpty = true
+				}
+				if (options.isShowWordLimit) {
+					result.min = options.min
+					result.max = options.max
+				} else {
+					result.min = Number.NEGATIVE_INFINITY
+					result.max = Number.POSITIVE_INFINITY
+				}
+				result.step = options.step
+				result.precision = options.precision
+				break
+			case 'radio':
+			case 'checkbox':
+				result.options = _.get(state, `data[${options.dataKey}].list`, [])
+				break
+			case 'select':
+				const { renderType } = options
+				// 当前选中的值,如果是人员就获取人员的api,部门就获取部门的api
+				if ([2, 3, 4].indexOf(renderType) > -1) {
+					result.options = options?.options
+				} else if (renderType === 1) {
+					result.options = _.get(state, `data[${options.dataKey}].list`, [])
+				}
+				result.multiple = options.multiple
+				result.filterable = options.filterable
+				break
+			case 'time':
+				result.format = options.format
+				if (isPc) {
+					result.valueFormat = options.valueFormat
+				}
+				break
+			case 'date':
+				result.placeholder = options.placeholder
+				// result.startPlaceholder = options.startPlaceholder
+				// result.endPlaceholder = options.endPlaceholder
+				result.format = options.format
+				result.type = options.type
+				if (isPc) {
+					result.valueFormat = 'X'
+					if (options.type === 'daterange') {
+						result.rangeSeparator = ''
+						result.startPlaceholder = options.placeholder
+					}
+					result.disabledDate = time => {
+						const { startTime, endTime, isShowWeeksLimit } = options
+						const startDate = dayjs.unix(startTime)
+						const endDate = dayjs.unix(endTime)
+						const currentDate = dayjs(time)
+						let result = false
+						if (options.isShowWordLimit) {
+							result = currentDate.isBefore(startDate) || currentDate.isAfter(endDate)
+						}
+						return result
+					}
+				} else {
+					const { startTime, endTime, isShowWeeksLimit } = options
+					switch (options.type) {
+						case 'date':
+						case 'datetime':
+							if (startTime && options.isShowWordLimit) {
+								result.minDate = dayjs.unix(startTime).toDate()
+							} else {
+								result.minDate = dayjs.unix(0).toDate()
+							}
+							if (endTime && options.isShowWordLimit) {
+								result.maxDate = dayjs.unix(endTime).toDate()
+							} else {
+								result.maxDate = dayjs().add(20, 'year').toDate()
+							}
+							break
+						case 'dates':
+							if (_.isEmpty(options.defaultValue)) {
+								result.defaultDate = null
+							} else {
+								options.defaultValue.map(e => dayjs.unix(e).toDate())
+							}
+							if (startTime && options.isShowWordLimit) {
+								result.minDate = dayjs.unix(startTime).toDate()
+							} else {
+								result.minDate = dayjs().subtract(1, 'year').toDate()
+							}
+							if (endTime && options.isShowWordLimit) {
+								result.maxDate = dayjs.unix(endTime).toDate()
+							} else {
+								result.maxDate = dayjs().add(1, 'year').toDate()
+							}
+							break
+						case 'daterange':
+							if (options.defaultValue) {
+								result.defaultDate = options.defaultValue.map(e => dayjs.unix(e).toDate())
+							} else {
+								result.defaultDate = null
+							}
+							if (startTime && options.isShowWordLimit) {
+								result.minDate = dayjs.unix(startTime).toDate()
+							} else {
+								result.minDate = dayjs().subtract(1, 'year').toDate()
+							}
+							if (endTime && options.isShowWordLimit) {
+								result.maxDate = dayjs.unix(endTime).toDate()
+							} else {
+								result.maxDate = dayjs().add(1, 'year').toDate()
+							}
+							break
+					}
+				}
+				break
+			case 'cascader':
+				result.options = _.get(state, `data[${options.dataKey}].list`, [])
+				result.props = {
+					multiple: options.multiple,
+					checkStrictly: options.checkStrictly
+				}
+				// result.options = options.options
+				break
+			case 'slider':
+				result.step = options.step
+				result.min = options.min
+				result.max = options.max
+				break
+			case 'divider':
+				result.contentPosition = options.contentPosition
+				break
+			case 'rate':
+				result.allowHalf = options.allowHalf
+				if (!isPc) {
+					result.count = options.max
+				} else {
+					result.max = options.max
+				}
+				break
+			case 'html':
+				result.type = 'textarea'
+				result.rows = 4
+				result.action = options.action
+				result.maxSize = options.size * 1024 * 1024
+				result.config = {
+					placeholder: options.placeholder
+				}
+				if (!isPc) {
+					result.config.toolbar = {
+						items: ['formattingOptions', '|', 'uploadImage', 'bold', 'italic', 'underline', 'strikethrough', 'link', 'undo', 'redo']
+					}
+					result.config.formattingOptions = [
+						'fontFamily',
+						'fontSize',
+						'fontColor',
+						'fontBackgroundColor',
+						'|',
+						'alignment',
+						'blockQuote',
+						'|',
+						'bulletedList',
+						'numberedList',
+						'|',
+						'outdent',
+						'indent',
+						'|',
+						'insertTable',
+						'removeFormat'
+					]
+				}
+				break
+			case 'uploadfile':
+				console.log(options, 'uploadfile')
+				result.multiple = options.multiple
+				result.action = options.action
+				// result.size = options.size
+				result.accept = options.accept
+				result.maxSize = options.size * 1024 * 1024
+				result.headers = options.headers
+				if (isPc) {
+					result.limit = options.limit
+				} else {
+					result.maxCount = options.limit
+					result.onOversize = file => {
+						showToast(t('er.validateMsg.fileSize', { size: options.size }))
+					}
+				}
+				break
+			case 'region':
+				if (isPc) {
+					const region = new Region(areaList, {
+						isFilter: false,
+						selectType: options.selectType
+					})
+					result.options = region.getAll()
+					result.props = {
+						emitPath: false
+					}
+					result.filterable = options.filterable
+				} else {
+					result.areaList = areaList
+					result.columnsNum = options.selectType
+				}
+				break
+			case 'signature':
+				console.log(options, 'signature')
+				result.headers = options.headers
+				break
+		}
+		specialHandling && specialHandling(node.type, result)
+		// console.log(result, '===result===')
+		return result
+	})
 }

+ 1 - 1
src/components/scWorkflow/nodes/approver.vue

@@ -68,7 +68,7 @@
 							</el-form-item>
 
 							<el-form-item v-if="form.setType === 1" label="选择成员">
-								<el-button type="primary" icon="plus" round @click="selectHandle(1, form.nodeUserList)">选择人员 2222</el-button>
+								<el-button type="primary" icon="plus" round @click="selectHandle(1, form.nodeUserList)">选择人员</el-button>
 								<div class="tags-list">
 									<el-tag v-for="(user, index) in form.nodeUserList" :key="user.id" closable @close="delUser(index)">{{ user.name }}</el-tag>
 								</div>