diff --git a/src/components/DesignForm/formControlPropertiNew.vue b/src/components/DesignForm/formControlPropertiNew.vue index d1576e1..06c2427 100644 --- a/src/components/DesignForm/formControlPropertiNew.vue +++ b/src/components/DesignForm/formControlPropertiNew.vue @@ -72,8 +72,9 @@ const emits = defineEmits<{ const { formConfig, formData } = toRefs(props) const store = useDesignFormStore() as any const controlData = computed(() => { - // console.log("注册自定义事件----------------->",props.formInfo) - // console.log("注册自定义事件--------1--------->",store.controlAttr) + console.log("注册自定义事件----------------->",props.formInfo) + console.log("注册自定义事件--------1--------->",store.controlAttr) + // console.log("注册自定义事件---------3-------->",controlData.value.customRules) return store.controlAttr }) //获取组件样式Demo @@ -134,8 +135,12 @@ const state = reactive({ @ 时间: 2024-08-14 08:41:02 @ 功能: 必填 */ -const ValidateTextTypes = reactive({ - +const ValidateText = reactive({ + type: 'required', + label: '必填', + regExp: /^\s*$/, + message: '必填项', + checkbox: false }) const formAttr = computed(() => { @@ -214,31 +219,31 @@ const formAttr = computed(() => { ] }) const attrList = computed(() => { - // console.log("controlData.value-1-->",controlData.value) - if (Object.keys(controlData.value).length) { + // console.log("controlData.value-1-->",controlData.value) + if (Object.keys(controlData.value).length) { const { - control = {}, - type, - name, - config = {}, - item = {}, - attr = {}, - selectvalue = "default", - mathFormula = {}, - unitName - }: { control: any;type:any;name:any;item:any;attr:any; config: any,selectvalue:any,mathFormula:any,unitName:any } = controlData.value - // console.log("controlData.value--->",controlData.value) - // console.log("controlData.value-1-->",unitName) - let columnIndex = false // 是否显示序号列 - if (type === 'table') { - // 表格时处理 + control = {}, + type, + name, + config = {}, + item = {}, + attr = {}, + selectvalue = "default", + mathFormula = {}, + unitName + }: { control: any;type:any;name:any;item:any;attr:any; config: any,selectvalue:any,mathFormula:any,unitName:any } = controlData.value + // console.log("controlData.value--->",controlData.value) + // console.log("controlData.value-1-->",unitName) + let columnIndex = false // 是否显示序号列 + if (type === 'table') { + // 表格时处理 const list = controlData.value && controlData.value.list - if (list && list.length > 0) { - columnIndex = list[0].type === 'index' - } + if (list && list.length > 0) { + columnIndex = list[0].type === 'index' } + } - const temp =reactive([ + const temp =reactive([ { label: '标签名称', value: item.label, @@ -816,8 +821,6 @@ const attrList = computed(() => { vIf: state.isSearch, vShow: ['videoUpAndPlay'] }, - - { label: '上传地址', value: control.action, @@ -988,9 +991,9 @@ const attrList = computed(() => { vShow: ['digitpage'], control:control } - ]) + ]) // 过滤显示对应的值 - return temp.filter((item: any) => { + return temp.filter((item: any) => { let hasFilter = true if (item.vShow) { hasFilter = item.vShow.includes(type) @@ -1003,11 +1006,11 @@ const attrList = computed(() => { hasFilter = false } return hasFilter - }) - } else { - return [] - } - }) + }) + } else { + return [] + } +}) watch( () => store.activeKey, @@ -2421,6 +2424,7 @@ function handleDetermineFillRoles(){ watch(()=>store.activeKey, () => { + // console.log("activeKey",store.activeKey); if(controlData.value.type==='associatedForms'){ setTimeout(() => { formidChanged() @@ -2502,6 +2506,7 @@ function handleDetermineGlxxszDialogCheckBox(){ } //同步开关的设置值和开关关联选项设置的值 watch(()=>controlData.value.control,(newVal) => { + // console.log("同步开关的设置值和开关关联选项设置的值",typeof(newVal)) if(typeof(newVal)!="undefined"){ if(typeof(newVal.glxxszSwitch)!="undefined"){ if(typeof(controlData.value.control.activeValue)!="undefined"){ @@ -2514,6 +2519,7 @@ watch(()=>controlData.value.control,(newVal) => { } } } + console.log("同步开关的设置值和开关关联选项设置的值",controlData.value.control) },{ deep: true }) @@ -2745,6 +2751,20 @@ const disabledIstrue = (val:string) => { return false; } } + +watch(()=>controlData.value.customRules,(val:any) => { + console.log("啊啊啊啊啊",val,typeof(val)); + if(typeof(val)=="object"){ + if(Array.isArray(val)){ + val.forEach((item:any)=>{ + + }) + } + } +},{ + deep: true +}) +