From f5a4eaa96894038f0e53bcbef34bf36bb9846ebc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BB=95=E5=B5=A9?= <17854119262@163.com> Date: Wed, 12 Jun 2024 17:51:25 +0800 Subject: [PATCH 01/18] =?UTF-8?q?=E8=A1=A8=E5=8D=95=E8=AE=BE=E8=AE=A1UI?= =?UTF-8?q?=E3=80=81=E8=A1=A8=E5=8D=95=E5=8F=91=E5=B8=83-=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E7=BC=96=E5=8F=B7=E9=87=8D=E5=A4=8D=E6=A3=80=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/demo/formModule.ts | 10 + .../src/collapse/CollapseContainer.vue | 5 + .../Container/src/collapse/CollapseHeader.vue | 46 +++- .../components/VFormDesign/index.vue | 10 +- .../VFormDesign/modules/Toolbar.vue | 36 +-- .../components/VFormDesign/styles/drag.less | 29 ++- .../VFormDesign/styles/variable.less | 12 +- .../demo/form-design/core/formItemConfig.ts | 2 +- .../demo/onlineform/formModule/modalForm.vue | 238 ++++++++++++++++-- 9 files changed, 323 insertions(+), 65 deletions(-) diff --git a/src/api/demo/formModule.ts b/src/api/demo/formModule.ts index 631cc344..235c16a2 100644 --- a/src/api/demo/formModule.ts +++ b/src/api/demo/formModule.ts @@ -25,6 +25,8 @@ enum Api { Post_UpdateForm = '/api/FormModule/UpdateForm', // 获取字典分类列表 Get_SysDataItemLoad = '/api/SysDataItem/Load', + // 判断数据表字段重复 + Get_ExistFiled = '/api/FormModule/ExistFiled', } // 获取分页列表 @@ -78,3 +80,11 @@ export function Get_SysDataItemLoad() { url: Api.Get_SysDataItemLoad, }); } + +// 判断数据表字段重复 +export function Get_Get_ExistFiled(params) { + return defHttp.get({ + url: Api.Get_ExistFiled, + params, + }); +} diff --git a/src/components/Container/src/collapse/CollapseContainer.vue b/src/components/Container/src/collapse/CollapseContainer.vue index c3a43c88..7535d8c0 100644 --- a/src/components/Container/src/collapse/CollapseContainer.vue +++ b/src/components/Container/src/collapse/CollapseContainer.vue @@ -31,6 +31,10 @@ * Delayed loading time */ lazyTime: { type: Number, default: 0 }, + /** + * Title is Bold? + */ + isTitleBold: { type: Boolean, default: false }, }; export type CollapseContainerProps = ExtractPropTypes; @@ -65,6 +69,7 @@ v-slots={{ title: slots.title, action: slots.action, + isTitleBold: slots.isTitleBold, }} /> diff --git a/src/components/Container/src/collapse/CollapseHeader.vue b/src/components/Container/src/collapse/CollapseHeader.vue index b49bb2a0..d2e73ad1 100644 --- a/src/components/Container/src/collapse/CollapseHeader.vue +++ b/src/components/Container/src/collapse/CollapseHeader.vue @@ -6,6 +6,7 @@ const collapseHeaderProps = { prefixCls: String, title: String, + isTitleBold: Boolean, show: Boolean, canExpan: Boolean, helpMessage: { @@ -24,21 +25,40 @@ setup(props, { slots, attrs, emit }) { const { prefixCls } = useDesign('collapse-container'); const _prefixCls = computed(() => props.prefixCls || unref(prefixCls)); - return () => ( -
- - {slots.title?.() || props.title} - + // v-if="props.isTitleBold" 无效 + if (props.isTitleBold) { + return () => ( +
+ + {slots.title?.() || props.title} + -
- {slots.action - ? slots.action({ expand: props.show, onClick: () => emit('expand') }) - : props.canExpan && ( - emit('expand')} /> - )} +
+ {slots.action + ? slots.action({ expand: props.show, onClick: () => emit('expand') }) + : props.canExpan && ( + emit('expand')} /> + )} +
-
- ); + ); + } else { + return () => ( +
+ + {slots.title?.() || props.title} + + +
+ {slots.action + ? slots.action({ expand: props.show, onClick: () => emit('expand') }) + : props.canExpan && ( + emit('expand')} /> + )} +
+
+ ); + } }, }); diff --git a/src/views/demo/form-design/components/VFormDesign/index.vue b/src/views/demo/form-design/components/VFormDesign/index.vue index de47f4a2..cfcb109f 100644 --- a/src/views/demo/form-design/components/VFormDesign/index.vue +++ b/src/views/demo/form-design/components/VFormDesign/index.vue @@ -18,7 +18,7 @@ breakpoint="md" >
- + - + - + diff --git a/src/views/demo/form-design/components/VFormDesign/modules/Toolbar.vue b/src/views/demo/form-design/components/VFormDesign/modules/Toolbar.vue index 0bca6dd6..3abfd83b 100644 --- a/src/views/demo/form-design/components/VFormDesign/modules/Toolbar.vue +++ b/src/views/demo/form-design/components/VFormDesign/modules/Toolbar.vue @@ -7,20 +7,25 @@
- - - + + + - - - - + + + - - - + + +
@@ -30,7 +35,7 @@ import { defineComponent, inject, reactive, toRefs } from 'vue'; import { UseRefHistoryReturn } from '@vueuse/core'; import { IFormConfig } from '../../../typings/v-form-component'; - import { Tooltip, Divider } from 'ant-design-vue'; + import { Tooltip } from 'ant-design-vue'; import Icon from '@/components/Icon/Icon.vue'; interface IToolbarsConfig { @@ -45,7 +50,6 @@ components: { Tooltip, Icon, - Divider, }, setup() { const state = reactive<{ @@ -56,7 +60,7 @@ title: '预览-支持布局', type: 'preview', event: 'handlePreview', - icon: 'ant-design:chrome-filled', + icon: 'bi:life-preserver', }, // { // title: '预览-不支持布局', @@ -113,9 +117,10 @@ line-height: @operating-area-height; text-align: left; - a { + #button { margin: 0 5px; - color: #666; + width: 32px; + height: 32px; &.disabled, &.disabled:hover { @@ -127,7 +132,6 @@ } > span { - padding-left: 2px; font-size: 14px; } } diff --git a/src/views/demo/form-design/components/VFormDesign/styles/drag.less b/src/views/demo/form-design/components/VFormDesign/styles/drag.less index 0f806340..38f5e62c 100644 --- a/src/views/demo/form-design/components/VFormDesign/styles/drag.less +++ b/src/views/demo/form-design/components/VFormDesign/styles/drag.less @@ -1,11 +1,14 @@ .draggable-box { height: 100%; overflow: auto; + background-color: @background-color; + :deep(.list-main) { position: relative; padding: 5px; overflow: hidden; + border-radius: 4px; .moving { position: relative; @@ -21,7 +24,7 @@ top: 0; right: 0; width: 100%; - height: 5px; + height: 3px; background-color: @primary-color; } } @@ -33,6 +36,7 @@ padding: 8px; overflow: hidden; transition: all 0.3s; + border-radius: 3px; &:hover { background-color: @primary-hover-bg-color; @@ -44,14 +48,16 @@ position: absolute; top: 0; right: -100%; - width: 100%; - height: 5px; + width: 0%; + height: 3px; transition: all 0.3s; + outline: 3px solid @primary-color; background-color: @primary-color; } &.active { - outline-offset: 0; + outline: 3px solid @primary-color; + // outline-offset: 0; background-color: @primary-hover-bg-color; &::before { @@ -84,7 +90,7 @@ .show-key-box { // 显示key position: absolute; - right: 5px; + right: 3px; bottom: 2px; // z-index: 999; color: @primary-color; @@ -133,6 +139,12 @@ overflow: hidden; transition: all 0.3s; background-color: @layout-background-color; + border-radius: 3px; + + // 鼠标划过 + &:hover { + background-color: @layout-hover-bg-color; + } .form-item-box { position: relative; @@ -170,14 +182,15 @@ position: absolute; top: 0; right: -100%; - width: 100%; - height: 5px; + width: 0%; + height: 3px; transition: all 0.3s; background: transparent; } &.active { - outline-offset: 0; + outline: 3px solid @layout-color; + // outline-offset: 0; background-color: @layout-hover-bg-color; &::before { diff --git a/src/views/demo/form-design/components/VFormDesign/styles/variable.less b/src/views/demo/form-design/components/VFormDesign/styles/variable.less index 8749dce1..d7badaf5 100644 --- a/src/views/demo/form-design/components/VFormDesign/styles/variable.less +++ b/src/views/demo/form-design/components/VFormDesign/styles/variable.less @@ -1,11 +1,11 @@ // 表单设计器样式 -@primary-color: #13c2c2; -@layout-color: #9867f7; +@background-color: #EBEDF1; +@primary-color: #1E5EFFFF; +@layout-color: #A91EFFFF; -@primary-background-color: fade(@primary-color, 6%); -@primary-hover-bg-color: fade(@primary-color, 20%); -@layout-background-color: fade(@layout-color, 12%); -@layout-hover-bg-color: fade(@layout-color, 24%); +@primary-hover-bg-color: #DFEAFC; +@layout-background-color: #E9E4F5; +@layout-hover-bg-color: #d7d2ff; @title-text-color: #fff; @border-color: #ccc; diff --git a/src/views/demo/form-design/core/formItemConfig.ts b/src/views/demo/form-design/core/formItemConfig.ts index 01d78423..ab7cd760 100644 --- a/src/views/demo/form-design/core/formItemConfig.ts +++ b/src/views/demo/form-design/core/formItemConfig.ts @@ -453,7 +453,7 @@ export const baseComponents: IVFormComponent[] = [ { component: 'Cascader', label: '级联选择', - icon: 'ant-design:check-outlined', + icon: 'ant-design:block-outlined', field: '', colProps: { span: 24 }, componentProps: { diff --git a/src/views/demo/onlineform/formModule/modalForm.vue b/src/views/demo/onlineform/formModule/modalForm.vue index aaa6e400..4ae4c802 100644 --- a/src/views/demo/onlineform/formModule/modalForm.vue +++ b/src/views/demo/onlineform/formModule/modalForm.vue @@ -74,9 +74,10 @@ import { useMessage } from '@/hooks/web/useMessage'; import { getMenuList } from '@/api/demo/system'; import { useI18n } from '@/hooks/web/useI18n'; - + import { FormInstance } from 'ant-design-vue'; import ModuleModal from './modalForm-Modal.vue'; import { functionGetSchemePageList, functionGetForm } from '@/api/demo/formScheme'; + import { Get_Get_ExistFiled } from '@/api/demo/formModule'; // emit const emit = defineEmits(['change-form-verisons', 'set-steps-current']); @@ -110,7 +111,7 @@ // 表单选择声明 const [registerModal, { openModal }] = useModal(); // 表单ref - const formModuleRef = ref(); + let formModuleRef: FormInstance | null = null; // 版本options const formVerisons = ref([]); // 上级options @@ -134,12 +135,147 @@ }); // 规则 let rules = { - code: [{ required: true, message: '请输入' }], - name: [{ required: true, message: '请输入' }], - icon: [{ component: 'IconPicker', required: true, message: '请输入' }], - formCodeName: [{ required: true, message: '请输入' }], - formVerison: [{ required: true, message: '请选择版本' }], - pmoduleId: [{ required: true, message: '请输入' }], + code: [ + { + required: true, + asyncValidator: async (rule, value, callback) => { + // 验证逻辑 + if (value) { + try { + let filedsJson = { + Code: formData.value.code, + }; + if (props.isEdit) { + // 编辑 + let query: any = { + keyValue: props.editData.record.id, + tableName: 'form_module', + keyName: 'Id', + filedsJson: JSON.stringify(filedsJson), + }; + await Get_Get_ExistFiled(query).then((res) => { + if (res) { + callback(); + } else { + callback(new Error('编号重复')); + } + }); + } else { + // 新增 + let query: any = { + tableName: 'form_module', + keyName: 'Id', + filedsJson: JSON.stringify(filedsJson), + }; + await Get_Get_ExistFiled(query).then((res) => { + if (res) { + callback(); + } else { + callback(new Error('编号重复')); + } + }); + } + } catch (error) { + ('验证出错'); + } + } else { + callback(new Error('请输入编号')); + } + }, + trigger: ['blur'], + }, + ], + name: [ + { + required: true, + validator: (rule, value, callback) => { + try { + // 验证逻辑 + if (value) { + callback(); + } else { + callback(new Error('请输入名称')); + } + } catch (error) { + console.log(error); + } + }, + trigger: ['blur'], + }, + ], + icon: [ + { + component: 'IconPicker', + required: true, + validator: (rule, value, callback) => { + try { + // 验证逻辑 + if (value) { + callback(); + } else { + callback(new Error('请选择图标')); + } + } catch (error) { + console.log(error); + } + }, + trigger: ['blur'], + }, + ], + formCodeName: [ + { + required: true, + validator: (rule, value, callback) => { + try { + // 验证逻辑 + if (value) { + callback(); + } else { + callback(new Error('请选择表单')); + } + } catch (error) { + console.log(error); + } + }, + trigger: ['blur'], + }, + ], + formVerison: [ + { + required: true, + validator: (rule, value, callback) => { + try { + // 验证逻辑 + if (value) { + callback(); + } else { + callback(new Error('请选择表单版本')); + } + } catch (error) { + console.log(error); + } + }, + trigger: ['blur'], + }, + ], + pmoduleId: [ + { + required: true, + validator: (rule, value, callback) => { + try { + // 验证逻辑 + if (value) { + callback(); + } else { + callback(new Error('请选择上级')); + } + } catch (error) { + console.log(error); + } + }, + trigger: ['blur'], + }, + ], enabledMark: [{ required: true }], }; @@ -159,21 +295,34 @@ // 监视props watch( () => props.isNextSteps, - () => { - // 基本配置页数据是否填完整 + async () => { if (props.isNextSteps) { - let checkdata = formData.value; + // if (formModuleRef) { + // try { + // await formModuleRef.validate(); + // } catch (error) { + // console.log(error); + // } + // } if ( - checkdata.code === '' || - checkdata.formCode === '' || - checkdata.name === '' || - checkdata.formVerison === '' || - checkdata.pmoduleId === '' + formData.value.code === '' || + formData.value.name === '' || + formData.value.icon === '' || + formData.value.formCode === '' || + formData.value.formVerison === '' || + formData.value.pmoduleId === '' ) { - createMessage.error(t('数据未填完整')); + createMessage.error(t('数据未填写完整')); emit('set-steps-current', false); } else { - emit('set-steps-current', true); + // 验证通过后的逻辑 + let res = await checkExistFiled(); + if (res) { + emit('set-steps-current', true); + } else { + createMessage.error(t('表单的编号值重复')); + emit('set-steps-current', false); + } } } }, @@ -238,6 +387,59 @@ getSchemeRow(result.info); } + // 验证通过后的逻辑 + async function checkExistFiled() { + try { + let filedsJson = { + Code: formData.value.code, + }; + let result = false; + if (props.isEdit) { + // 编辑 + let query: any = { + keyValue: props.editData.record.id, + tableName: 'form_module', + keyName: 'Id', + filedsJson: JSON.stringify(filedsJson), + }; + await Get_Get_ExistFiled(query) + .then((res) => { + if (res) { + result = true; + } else { + result = false; + } + }) + .catch((error) => { + createMessage.error('验证出错' + error); + result = true; + }); + } else { + // 新增 + let query: any = { + tableName: 'form_module', + keyName: 'Id', + filedsJson: JSON.stringify(filedsJson), + }; + await Get_Get_ExistFiled(query) + .then((res) => { + if (res) { + result = true; + } else { + result = false; + } + }) + .catch((error) => { + createMessage.error('验证出错' + error); + result = false; + }); + } + return result; + } catch (error) { + ('验证出错'); + } + } + defineExpose({ formData, }); From 28336ca91ae144602f87bb1734696e7db7542e12 Mon Sep 17 00:00:00 2001 From: Zhufu <1176354795@qq.com> Date: Thu, 13 Jun 2024 08:59:39 +0800 Subject: [PATCH 02/18] =?UTF-8?q?[=E6=B5=81=E7=A8=8B=E5=8F=91=E8=B5=B7]?= =?UTF-8?q?=E3=80=90=E5=BC=80=E5=A7=8B=E8=8A=82=E7=82=B9=E3=80=91=E3=80=90?= =?UTF-8?q?=E9=80=89=E9=A1=B9=E5=8D=A1+=E5=9B=BE=E6=96=91=E3=80=91?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E4=B8=A2=E5=A4=B1=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../package/penal/startEvent/index.vue | 231 +++++++++--------- 1 file changed, 120 insertions(+), 111 deletions(-) diff --git a/src/components/ProcessDesigner/package/penal/startEvent/index.vue b/src/components/ProcessDesigner/package/penal/startEvent/index.vue index 6b7708fe..9176c269 100644 --- a/src/components/ProcessDesigner/package/penal/startEvent/index.vue +++ b/src/components/ProcessDesigner/package/penal/startEvent/index.vue @@ -405,125 +405,134 @@ }); return result; }; + const getRFields = (dataList, rFieldList,fieldList) => { + dataList.forEach((element: { label?: string; field?: string; component: any; itemProps: any }) => { + if (['InputGuid'].includes(element.component)) { + rFieldList.push({ + label: element.label, + // value:element.prop + value: element.field, + }); + } + if(element.component === 'Tabs'){ + element.componentProps.options.forEach(childElement => { + const {rFieldList:rField, fieldList:field} = getRFields(childElement.children,rFieldList,fieldList) + rFieldList = rField + fieldList = field + }) + }else if ( + ![ + 'Divider', + 'Grid', + 'Card', + 'CreateUser', + 'CreateTime', + 'ModifyUser', + 'ModifyTime', + 'CardGroup', + ].includes(element.component) && + !element.itemProps.hidden + ) { + let obj: any = element; + obj.required = element.itemProps.required; + // obj.componentProps.disabled = false; + obj.disabled = true; + obj.ifShow = true; + obj.fieldName = element.componentProps.fieldName; + fieldList.push(obj); + } else if (['Grid'].includes(element.component) || element.type == 'subTable') { + console.log('gridtable'); + fieldList.push({ + field: `${element.field}_add`, + label: `${element.label || '表格'}-添加按钮`, + required: false, + disabled: true, + ifShow: false, + type: 'grid', + }); + fieldList.push({ + field: `${element.field}_remove`, + label: `${element.label || '表格'}-删除按钮`, + required: false, + disabled: true, + ifShow: false, + type: 'grid', + }); + + fieldList.push({ + field: `${element.field}_required`, + label: `${element.label || '表格'}-数据`, + required: element.itemProps.required, + disabled: false, + ifShow: false, + type: 'gridrequired', + }); + element.columns.forEach((child) => { + child.children.forEach((t) => { + fieldList.push({ + gridprop: element.field, + field: t.field, + label: `${element.label || '表格'}-${t.label}`, + required: t.itemProps.required, + disabled: true, + ifShow: true, + fieldName: t.componentProps.fieldName, + ...t, + }); + }); + }); + } else if (['Card'].includes(element.component)) { + console.log(3); + element.columns.forEach((child) => { + child.children.forEach((t) => { + fieldList.push({ + gridprop: element.field, + field: t.field, + required: t.itemProps.required, + disabled: true, + ifShow: true, + fieldName: t.componentProps.fieldName, + ...t, + }); + }); + }); + } else if ( + ['CreateUser', 'CreateTime', 'ModifyUser', 'ModifyTime'].includes(element.component) && + element.display + ) { + let obj: any = element; + obj.required = element.itemProps.required; + // obj.componentProps.disabled = false; + obj.disabled = true; + obj.ifShow = true; + obj.fieldName = element.componentProps.fieldName; + fieldList.push(obj); + } else if (['CardGroup'].includes(element.component)) { + let obj: any = element; + obj.required = element.itemProps.required; + // obj.componentProps.disabled = false; + obj.disabled = true; + obj.ifShow = true; + obj.fieldName = element.componentProps.fieldName; + obj.label = `卡片组-${element.label}`; + fieldList.push(obj); + fieldList = cardComponentChild(element.componentProps.options, fieldList); + } + },); + return {rFieldList,fieldList} + } function loadFormScheme(strScheme, isChange) { const scheme = JSON.parse(strScheme); let fields: any[] = []; - const rfields: { + let rfields: { label?: string; value?: string; }[] = []; scheme.formInfo.tabList = cardNestStructure(scheme.formInfo.tabList); - console.log(scheme.formInfo.tabList); scheme.formInfo.tabList.forEach((tabElement) => { - tabElement.schemas.forEach( - (element: { label?: string; field?: string; component: any; itemProps: any }) => { - if (['InputGuid'].includes(element.component)) { - rfields.push({ - label: element.label, - // value:element.prop - value: element.field, - }); - } - if ( - ![ - 'Divider', - 'Grid', - 'Card', - 'CreateUser', - 'CreateTime', - 'ModifyUser', - 'ModifyTime', - 'CardGroup', - ].includes(element.component) && - !element.itemProps.hidden - ) { - let obj: any = element; - obj.required = element.itemProps.required; - // obj.componentProps.disabled = false; - obj.disabled = true; - obj.ifShow = true; - obj.fieldName = element.componentProps.fieldName; - fields.push(obj); - } else if (['Grid'].includes(element.component) || element.type == 'subTable') { - console.log('gridtable'); - fields.push({ - field: `${element.field}_add`, - label: `${element.label || '表格'}-添加按钮`, - required: false, - disabled: true, - ifShow: false, - type: 'grid', - }); - fields.push({ - field: `${element.field}_remove`, - label: `${element.label || '表格'}-删除按钮`, - required: false, - disabled: true, - ifShow: false, - type: 'grid', - }); - - fields.push({ - field: `${element.field}_required`, - label: `${element.label || '表格'}-数据`, - required: element.itemProps.required, - disabled: false, - ifShow: false, - type: 'gridrequired', - }); - element.columns.forEach((child) => { - child.children.forEach((t) => { - fields.push({ - gridprop: element.field, - field: t.field, - label: `${element.label || '表格'}-${t.label}`, - required: t.itemProps.required, - disabled: true, - ifShow: true, - fieldName: t.componentProps.fieldName, - ...t, - }); - }); - }); - } else if (['Card'].includes(element.component)) { - console.log(3); - element.columns.forEach((child) => { - child.children.forEach((t) => { - fields.push({ - gridprop: element.field, - field: t.field, - required: t.itemProps.required, - disabled: true, - ifShow: true, - fieldName: t.componentProps.fieldName, - ...t, - }); - }); - }); - } else if ( - ['CreateUser', 'CreateTime', 'ModifyUser', 'ModifyTime'].includes(element.component) && - element.display - ) { - let obj: any = element; - obj.required = element.itemProps.required; - // obj.componentProps.disabled = false; - obj.disabled = true; - obj.ifShow = true; - obj.fieldName = element.componentProps.fieldName; - fields.push(obj); - } else if (['CardGroup'].includes(element.component)) { - let obj: any = element; - obj.required = element.itemProps.required; - // obj.componentProps.disabled = false; - obj.disabled = true; - obj.ifShow = true; - obj.fieldName = element.componentProps.fieldName; - obj.label = `卡片组-${element.label}`; - fields.push(obj); - fields = cardComponentChild(element.componentProps.options, fields); - } - }, - ); + const {rFieldList, fieldList} = getRFields(tabElement.schemas,rfields,fields) + rfields = rFieldList + fields = fieldList }); data.formRelations = rfields; if (isChange) { From 38c19bbfa971504a87900f7f6574153c79955a27 Mon Sep 17 00:00:00 2001 From: shichao <17568097882@163.com> Date: Thu, 13 Jun 2024 09:02:01 +0800 Subject: [PATCH 03/18] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=9C=B0=E5=9B=BE?= =?UTF-8?q?=E6=97=A0=E7=94=A8=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/MapboxMaps/MapComponent.vue | 1465 ++++++++++---------- src/components/MapboxMaps/MapboxMap.vue | 448 +++--- src/components/MapboxMaps/Styles/Styles.ts | 458 +++--- src/views/dashboard/analysis/index.vue | 18 +- 4 files changed, 1179 insertions(+), 1210 deletions(-) diff --git a/src/components/MapboxMaps/MapComponent.vue b/src/components/MapboxMaps/MapComponent.vue index ad8c453d..9a1dba96 100644 --- a/src/components/MapboxMaps/MapComponent.vue +++ b/src/components/MapboxMaps/MapComponent.vue @@ -1,816 +1,791 @@ - - - - - \ No newline at end of file + .mapbox-gl-draw_trash { + background-image: url(/del.png); + background-size: 100% 100%; + width: 100px; + height: 100px; + } + + .mapbox-gl-draw_combine { + background-image: url(/combine.png); + background-size: 100% 100%; + width: 100px; + height: 100px; + } + + .mapbox-gl-draw_uncombine { + background-image: url(/uncombine.png); + background-size: 100% 100%; + width: 100px; + height: 100px; + } + + .jas-ctrl-measure { + position: relative; + top: 6px; + right: 10px; + } + + .jas-ctrl-measure-item { + height: 22px; + color: #fff; + } + diff --git a/src/components/MapboxMaps/MapboxMap.vue b/src/components/MapboxMaps/MapboxMap.vue index f6ea28b4..e0e0598d 100644 --- a/src/components/MapboxMaps/MapboxMap.vue +++ b/src/components/MapboxMaps/MapboxMap.vue @@ -1,7 +1,7 @@ - - - - - \ No newline at end of file + diff --git a/src/components/MapboxMaps/Styles/Styles.ts b/src/components/MapboxMaps/Styles/Styles.ts index 790eea59..c5b8f82b 100644 --- a/src/components/MapboxMaps/Styles/Styles.ts +++ b/src/components/MapboxMaps/Styles/Styles.ts @@ -1,231 +1,229 @@ -let customDrawStyles = [{ - "id": "gl-draw-polygon-fill-inactive", - "type": "fill", - "filter": ["all", ["==", "active", "false"], - ["==", "$type", "Polygon"], - ["!=", "mode", "static"] - ], - "paint": { - "fill-color": "#3bb2d0", - "fill-outline-color": "#6495ed", - "fill-opacity": 0.5 - } -}, { - "id": "gl-draw-polygon-fill-active", - "type": "fill", - "filter": ["all", ["==", "active", "true"], - ["==", "$type", "Polygon"] - ], - "paint": { - "fill-color": "#fbb03b", - "fill-outline-color": "#fbb03b", - "fill-opacity": 0.5 - } -}, { - "id": "gl-draw-polygon-midpoint", - "type": "circle", - "filter": ["all", ["==", "$type", "Point"], - ["==", "meta", "midpoint"] - ], - "paint": { - "circle-radius": 3, - "circle-color": "#fbb03b" - } -}, { - "id": "gl-draw-polygon-stroke-inactive", - "type": "line", - "filter": ["all", ["==", "active", "false"], - ["==", "$type", "Polygon"], - ["!=", "mode", "static"] - ], - "layout": { - "line-cap": "round", - "line-join": "round" - }, - "paint": { - "line-color": "#3bb2d0", - "line-width": 2 - } -}, { - "id": "gl-draw-polygon-stroke-active", - "type": "line", - "filter": ["all", ["==", "active", "true"], - ["==", "$type", "Polygon"] - ], - "layout": { - "line-cap": "round", - "line-join": "round" - }, - "paint": { - "line-color": "#fbb03b", - "line-dasharray": [0.2, 2], - "line-width": 2 - } -}, { - "id": "gl-draw-line-inactive", - "type": "line", - "filter": ["all", ["==", "active", "false"], - ["==", "$type", "LineString"], - ["!=", "mode", "static"], - ["!=", "user_isSnapGuide", "true"] - ], - "layout": { - "line-cap": "round", - "line-join": "round" - }, - "paint": { - "line-color": "#3bb2d0", - "line-width": 2 - } -}, { - "id": "gl-draw-line-active", - "type": "line", - "filter": ["all", ["==", "$type", "LineString"], - ["==", "active", "true"] - ], - "layout": { - "line-cap": "round", - "line-join": "round" - }, - "paint": { - "line-color": "#fbb03b", - "line-dasharray": [0.2, 2], - "line-width": 2 - } -}, { - "id": "gl-draw-polygon-and-line-vertex-stroke-inactive", - "type": "circle", - "filter": ["all", ["==", "meta", "vertex"], - ["==", "$type", "Point"], - ["!=", "mode", "static"] - ], - "paint": { - "circle-radius": 5, - "circle-color": "#fff" - } -}, { - "id": "gl-draw-polygon-and-line-vertex-inactive", - "type": "circle", - "filter": ["all", ["==", "meta", "vertex"], - ["==", "$type", "Point"], - ["!=", "mode", "static"] - ], - "paint": { - "circle-radius": 3, - "circle-color": "#fbb03b" - } -}, { - "id": "gl-draw-point-point-stroke-inactive", - "type": "circle", - "filter": ["all", ["==", "active", "false"], - ["==", "$type", "Point"], - ["==", "meta", "feature"], - ["!=", "mode", "static"] - ], - "paint": { - "circle-radius": 5, - "circle-opacity": 1, - "circle-color": "#fff" - } -}, { - "id": "gl-draw-point-inactive", - "type": "circle", - "filter": ["all", ["==", "active", "false"], - ["==", "$type", "Point"], - ["==", "meta", "feature"], - ["!=", "mode", "static"] - ], - "paint": { - "circle-radius": 3, - "circle-color": "#3bb2d0" - } -}, { - "id": "gl-draw-point-stroke-active", - "type": "circle", - "filter": ["all", ["==", "$type", "Point"], - ["==", "active", "true"], - ["!=", "meta", "midpoint"] - ], - "paint": { - "circle-radius": 7, - "circle-color": "#fff" - } -}, { - "id": "gl-draw-point-active", - "type": "circle", - "filter": ["all", ["==", "$type", "Point"], - ["!=", "meta", "midpoint"], - ["==", "active", "true"] - ], - "paint": { - "circle-radius": 5, - "circle-color": "#fbb03b" - } -}, { - "id": "gl-draw-polygon-fill-static", - "type": "fill", - "filter": ["all", ["==", "mode", "static"], - ["==", "$type", "Polygon"] - ], - "paint": { - "fill-color": "#404040", - "fill-outline-color": "#404040", - "fill-opacity": 0.1 - } -}, { - "id": "gl-draw-polygon-stroke-static", - "type": "line", - "filter": ["all", ["==", "mode", "static"], - ["==", "$type", "Polygon"] - ], - "layout": { - "line-cap": "round", - "line-join": "round" - }, - "paint": { - "line-color": "#404040", - "line-width": 2 - } -}, { - "id": "gl-draw-line-static", - "type": "line", - "filter": ["all", ["==", "mode", "static"], - ["==", "$type", "LineString"] - ], - "layout": { - "line-cap": "round", - "line-join": "round" - }, - "paint": { - "line-color": "#404040", - "line-width": 2 - } -}, { - "id": "gl-draw-point-static", - "type": "circle", - "filter": ["all", ["==", "mode", "static"], - ["==", "$type", "Point"] - ], - "paint": { - "circle-radius": 5, - "circle-color": "#404040" - } -}, { - "id": "guide", - "type": "line", - "filter": ["all", ["==", "$type", "LineString"], - ["==", "user_isSnapGuide", "true"] - ], - "layout": { - "line-cap": "round", - "line-join": "round" - }, - "paint": { - "line-color": "#c00c00", - "line-width": 1, - "line-dasharray": [5, 5] - } -}] +const customDrawStyles = [ + { + id: 'gl-draw-polygon-fill-inactive', + type: 'fill', + filter: [ + 'all', + ['==', 'active', 'false'], + ['==', '$type', 'Polygon'], + ['!=', 'mode', 'static'], + ], + paint: { + 'fill-color': '#3bb2d0', + 'fill-outline-color': '#6495ed', + 'fill-opacity': 0.5, + }, + }, + { + id: 'gl-draw-polygon-fill-active', + type: 'fill', + filter: ['all', ['==', 'active', 'true'], ['==', '$type', 'Polygon']], + paint: { + 'fill-color': '#fbb03b', + 'fill-outline-color': '#fbb03b', + 'fill-opacity': 0.5, + }, + }, + { + id: 'gl-draw-polygon-midpoint', + type: 'circle', + filter: ['all', ['==', '$type', 'Point'], ['==', 'meta', 'midpoint']], + paint: { + 'circle-radius': 3, + 'circle-color': '#fbb03b', + }, + }, + { + id: 'gl-draw-polygon-stroke-inactive', + type: 'line', + filter: [ + 'all', + ['==', 'active', 'false'], + ['==', '$type', 'Polygon'], + ['!=', 'mode', 'static'], + ], + layout: { + 'line-cap': 'round', + 'line-join': 'round', + }, + paint: { + 'line-color': '#3bb2d0', + 'line-width': 2, + }, + }, + { + id: 'gl-draw-polygon-stroke-active', + type: 'line', + filter: ['all', ['==', 'active', 'true'], ['==', '$type', 'Polygon']], + layout: { + 'line-cap': 'round', + 'line-join': 'round', + }, + paint: { + 'line-color': '#fbb03b', + 'line-dasharray': [0.2, 2], + 'line-width': 2, + }, + }, + { + id: 'gl-draw-line-inactive', + type: 'line', + filter: [ + 'all', + ['==', 'active', 'false'], + ['==', '$type', 'LineString'], + ['!=', 'mode', 'static'], + ['!=', 'user_isSnapGuide', 'true'], + ], + layout: { + 'line-cap': 'round', + 'line-join': 'round', + }, + paint: { + 'line-color': '#3bb2d0', + 'line-width': 2, + }, + }, + { + id: 'gl-draw-line-active', + type: 'line', + filter: ['all', ['==', '$type', 'LineString'], ['==', 'active', 'true']], + layout: { + 'line-cap': 'round', + 'line-join': 'round', + }, + paint: { + 'line-color': '#fbb03b', + 'line-dasharray': [0.2, 2], + 'line-width': 2, + }, + }, + { + id: 'gl-draw-polygon-and-line-vertex-stroke-inactive', + type: 'circle', + filter: ['all', ['==', 'meta', 'vertex'], ['==', '$type', 'Point'], ['!=', 'mode', 'static']], + paint: { + 'circle-radius': 5, + 'circle-color': '#fff', + }, + }, + { + id: 'gl-draw-polygon-and-line-vertex-inactive', + type: 'circle', + filter: ['all', ['==', 'meta', 'vertex'], ['==', '$type', 'Point'], ['!=', 'mode', 'static']], + paint: { + 'circle-radius': 3, + 'circle-color': '#fbb03b', + }, + }, + { + id: 'gl-draw-point-point-stroke-inactive', + type: 'circle', + filter: [ + 'all', + ['==', 'active', 'false'], + ['==', '$type', 'Point'], + ['==', 'meta', 'feature'], + ['!=', 'mode', 'static'], + ], + paint: { + 'circle-radius': 5, + 'circle-opacity': 1, + 'circle-color': '#fff', + }, + }, + { + id: 'gl-draw-point-inactive', + type: 'circle', + filter: [ + 'all', + ['==', 'active', 'false'], + ['==', '$type', 'Point'], + ['==', 'meta', 'feature'], + ['!=', 'mode', 'static'], + ], + paint: { + 'circle-radius': 3, + 'circle-color': '#3bb2d0', + }, + }, + { + id: 'gl-draw-point-stroke-active', + type: 'circle', + filter: ['all', ['==', '$type', 'Point'], ['==', 'active', 'true'], ['!=', 'meta', 'midpoint']], + paint: { + 'circle-radius': 7, + 'circle-color': '#fff', + }, + }, + { + id: 'gl-draw-point-active', + type: 'circle', + filter: ['all', ['==', '$type', 'Point'], ['!=', 'meta', 'midpoint'], ['==', 'active', 'true']], + paint: { + 'circle-radius': 5, + 'circle-color': '#fbb03b', + }, + }, + { + id: 'gl-draw-polygon-fill-static', + type: 'fill', + filter: ['all', ['==', 'mode', 'static'], ['==', '$type', 'Polygon']], + paint: { + 'fill-color': '#404040', + 'fill-outline-color': '#404040', + 'fill-opacity': 0.1, + }, + }, + { + id: 'gl-draw-polygon-stroke-static', + type: 'line', + filter: ['all', ['==', 'mode', 'static'], ['==', '$type', 'Polygon']], + layout: { + 'line-cap': 'round', + 'line-join': 'round', + }, + paint: { + 'line-color': '#404040', + 'line-width': 2, + }, + }, + { + id: 'gl-draw-line-static', + type: 'line', + filter: ['all', ['==', 'mode', 'static'], ['==', '$type', 'LineString']], + layout: { + 'line-cap': 'round', + 'line-join': 'round', + }, + paint: { + 'line-color': '#404040', + 'line-width': 2, + }, + }, + { + id: 'gl-draw-point-static', + type: 'circle', + filter: ['all', ['==', 'mode', 'static'], ['==', '$type', 'Point']], + paint: { + 'circle-radius': 5, + 'circle-color': '#404040', + }, + }, + { + id: 'guide', + type: 'line', + filter: ['all', ['==', '$type', 'LineString'], ['==', 'user_isSnapGuide', 'true']], + layout: { + 'line-cap': 'round', + 'line-join': 'round', + }, + paint: { + 'line-color': '#c00c00', + 'line-width': 1, + 'line-dasharray': [5, 5], + }, + }, +]; - -export {customDrawStyles} \ No newline at end of file +export { customDrawStyles }; diff --git a/src/views/dashboard/analysis/index.vue b/src/views/dashboard/analysis/index.vue index ecd419c9..713fae45 100644 --- a/src/views/dashboard/analysis/index.vue +++ b/src/views/dashboard/analysis/index.vue @@ -95,19 +95,19 @@ let drawFeatures = [ const MapboxComponent = ref() // 添加 或者 编辑图斑 - setTimeout(function(){ - // 添加图斑 - // MapboxComponent.value.handlerDraw() - // 编辑图斑 - MapboxComponent.value.handlerDraw(drawFeatures) - },3000) + // setTimeout(function(){ + // // 添加图斑 + // // MapboxComponent.value.handlerDraw() + // // 编辑图斑 + // MapboxComponent.value.handlerDraw(drawFeatures) + // },3000) - setTimeout(function(){ - // MapboxComponent.value.handlerDraw() - },6000) + // setTimeout(function(){ + // // MapboxComponent.value.handlerDraw() + // },6000) // 图斑定位 // setTimeout(function(){ From d1a64265a05fbea0c6f0900b8fc1a794f7f83691 Mon Sep 17 00:00:00 2001 From: shichao <17568097882@163.com> Date: Thu, 13 Jun 2024 09:15:39 +0800 Subject: [PATCH 04/18] =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E5=8C=96=E5=A4=A7?= =?UTF-8?q?=E5=B1=8F=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/dashboard/dataScreen/index.vue | 1129 +++++++++++----------- 1 file changed, 578 insertions(+), 551 deletions(-) diff --git a/src/views/dashboard/dataScreen/index.vue b/src/views/dashboard/dataScreen/index.vue index 5f330592..192adb54 100644 --- a/src/views/dashboard/dataScreen/index.vue +++ b/src/views/dashboard/dataScreen/index.vue @@ -53,7 +53,6 @@ v-model:value="value" placeholder="请输入企业名称/法人/地址搜索" size="large" - @search="onSearch" > + - From 5fdf5b9da2ac8ce8b753dcfd550e1447e3e9184a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=A6=8D?= <1455167345@qq.com> Date: Thu, 13 Jun 2024 09:19:43 +0800 Subject: [PATCH 05/18] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E6=B5=81=E8=BD=AC=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../demo/workflow/task/process/audit.vue | 109 +++++++++--------- src/views/demo/workflow/task/process/look.vue | 48 ++++---- 2 files changed, 77 insertions(+), 80 deletions(-) diff --git a/src/views/demo/workflow/task/process/audit.vue b/src/views/demo/workflow/task/process/audit.vue index 641d0295..825f4ee2 100644 --- a/src/views/demo/workflow/task/process/audit.vue +++ b/src/views/demo/workflow/task/process/audit.vue @@ -7,13 +7,13 @@ 关闭
-
+
- + -
+
- - -
{{ item.time }}
- -
{{ item.name }}
-
- {{ userName }} - {{ item.des }} -
-
-
-
+
+ + +
{{ item.time }}
+ +
{{ item.name }}
+
+ {{ userName }} + {{ item.des }} +
+
+
+
+
- +
@@ -123,8 +125,6 @@ />
- -
@@ -235,7 +235,6 @@ des: [{ required: true, message: '请填写审批意见', trigger: 'blur' }], }); - if (props.type == 4) { rules.value = {}; } @@ -257,7 +256,7 @@ const designerData: designerDataType = reactive({ loading: false, xmlString: '', - height: document.documentElement.clientHeight - 200.5 + 'px;', + height: document.documentElement.clientHeight - 300.5 + 'px;', midVisible: false, isCustmerTitle: false, nodeUsers: [], @@ -290,19 +289,19 @@ const auditName = ref('audit'); const auditTitleVal = ref('审批栏'); const auditNameVal = ref('审批意见'); - const rejectOpen = ref(false); + const rejectOpen = ref(false); const footerStyle = ref({ - height:"220px", - width:mapConfig.value.isShowMap ? '100%':'60%', - overFlow:"auto", - color: '#fff', - backgroundColor: '#ffffff', - zIndex:"9999999999", - padding:"0px 100px", - position:"fixed", - bottom:"0px", - left:"0px" - }) + height: '220px', + width: mapConfig.value.isShowMap ? '100%' : '60%', + overFlow: 'auto', + color: '#fff', + backgroundColor: '#ffffff', + zIndex: '9999999999', + padding: '0px 100px', + position: 'fixed', + bottom: '0px', + left: '0px', + }); function changeActive(activeKey) { if (activeKey == 'flow') { @@ -350,14 +349,14 @@ currentNode = wfData.find((t) => t.type == 'bpmn:StartEvent'); mapConfig.value = currentNode.mapConfig; - footerStyle.value.width = mapConfig.value?.isShowMap ? "60%":"100%" - if(mapConfig.value?.isShowMap){} - + footerStyle.value.width = mapConfig.value?.isShowMap ? '60%' : '100%'; + if (mapConfig.value?.isShowMap) { + } } else { currentNode = auditNode; let currentMapNode = wfData.find((t) => t.type == 'bpmn:StartEvent'); mapConfig.value = currentMapNode.mapConfig; - footerStyle.value.width = mapConfig.value?.isShowMap ? "60%":"100%" + footerStyle.value.width = mapConfig.value?.isShowMap ? '60%' : '100%'; } if (currentNode.authFields.length > 0) { formVisble.value = true; @@ -470,7 +469,7 @@ for (let key in nodeMap) { nodeMap[key] = nodeMap[key].filter((t: { userIds: string | any[] }) => t.userIds.length > 0); } - + logs.reverse(); logs.forEach( (log: { unitId: string; @@ -754,13 +753,11 @@ } } - - - async function handlerShowGeomtrys(currentNode){ - let info = currentNode.authFields?.find((item,index)=>{ - return item.component == "MapGeom" - }) - let layer:string=""; + async function handlerShowGeomtrys(currentNode) { + let info = currentNode.authFields?.find((item, index) => { + return item.component == 'MapGeom'; + }); + let layer: string = ''; // let layer:string="drone_shp_data"; if (info) { @@ -772,7 +769,7 @@ } let geomfiledValue = info.field.toLowerCase(); - let gids = ""; + let gids = ''; try { await formBoxRef.value.getForm().then((res) => { @@ -818,9 +815,7 @@ } } - - function onMapboxLoad(){ - + function onMapboxLoad() { handlerShowGeomtrys(designerData.formCurrentNode); } // 驳回到指定节点 diff --git a/src/views/demo/workflow/task/process/look.vue b/src/views/demo/workflow/task/process/look.vue index 16394dc3..3eff37b0 100644 --- a/src/views/demo/workflow/task/process/look.vue +++ b/src/views/demo/workflow/task/process/look.vue @@ -57,27 +57,29 @@
- - -
{{ item.time }}
- -
{{ item.name }}
-
- {{ userName }} - {{ item.des }} -
-
-
-
+
+ + +
{{ item.time }}
+ +
{{ item.name }}
+
+ {{ userName }} + {{ item.des }} +
+
+
+
+
@@ -173,7 +175,7 @@ const designerData: designerDataType = reactive({ loading: false, xmlString: '', - height: document.documentElement.clientHeight - 200.5 + 'px;', + height: document.documentElement.clientHeight - 300.5 + 'px;', midVisible: false, isCustmerTitle: false, nodeUsers: [], @@ -343,7 +345,7 @@ for (let key in nodeMap) { nodeMap[key] = nodeMap[key].filter((t: { userIds: string | any[] }) => t.userIds.length > 0); } - + logs.reverse(); logs.forEach( (log: { unitId: string; From ef15878e30fe4435072bdab6a390aa57384ba7a8 Mon Sep 17 00:00:00 2001 From: Zhufu <1176354795@qq.com> Date: Thu, 13 Jun 2024 10:39:16 +0800 Subject: [PATCH 06/18] =?UTF-8?q?=E3=80=90=E6=95=B0=E6=8D=AE=E5=A4=A7?= =?UTF-8?q?=E5=B1=8F=E3=80=91=E8=BF=9B=E5=85=A5=E5=A4=A7=E5=B1=8F=E5=90=8E?= =?UTF-8?q?=E8=BF=9B=E5=85=A5=E5=85=B6=E4=BB=96=E7=94=BB=E9=9D=A2=E4=B8=8D?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/dashboard/dataScreen/index.vue | 161 ++++++++++++----------- 1 file changed, 81 insertions(+), 80 deletions(-) diff --git a/src/views/dashboard/dataScreen/index.vue b/src/views/dashboard/dataScreen/index.vue index 5f330592..a4f93b01 100644 --- a/src/views/dashboard/dataScreen/index.vue +++ b/src/views/dashboard/dataScreen/index.vue @@ -1,89 +1,91 @@ @@ -403,7 +405,6 @@ onMounted(() => { let enterpriseIncomeBarChart = echarts.init(enterpriseIncomeBarDom) let landAreaPieChart = echarts.init(landAreaPieDom) let realEstateAreaPieChart = echarts.init(realEstateAreaPieDom) - enterpriseAreaBarChart.setOption(enterpriseAreaBarChartOption); enterpriseIncomeBarChart.setOption(enterpriseIncomeBarChartOption); landAreaPieChart.setOption(landAreaPieChartOption); From d2af50359e3f88fe5bf7329fa85458f57638b71c Mon Sep 17 00:00:00 2001 From: Zhufu <1176354795@qq.com> Date: Thu, 13 Jun 2024 11:07:32 +0800 Subject: [PATCH 07/18] =?UTF-8?q?=E3=80=90=E6=B5=81=E7=A8=8B=E5=8F=91?= =?UTF-8?q?=E8=B5=B7=E3=80=91=E3=80=90=E9=80=89=E9=A1=B9=E5=8D=A1+?= =?UTF-8?q?=E5=9B=BE=E6=96=91=E3=80=91=E4=BB=BB=E5=8A=A1=E8=8A=82=E7=82=B9?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E4=B8=A2=E5=A4=B1=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../package/penal/startEvent/index.vue | 134 +----------------- .../package/penal/userTask/index.vue | 132 +---------------- src/views/demo/workflow/scheme/util.ts | 133 +++++++++++++++++ 3 files changed, 139 insertions(+), 260 deletions(-) create mode 100644 src/views/demo/workflow/scheme/util.ts diff --git a/src/components/ProcessDesigner/package/penal/startEvent/index.vue b/src/components/ProcessDesigner/package/penal/startEvent/index.vue index 9176c269..dc210a64 100644 --- a/src/components/ProcessDesigner/package/penal/startEvent/index.vue +++ b/src/components/ProcessDesigner/package/penal/startEvent/index.vue @@ -186,6 +186,7 @@ import { functionGetSchemePageList, functionLoadFormPage } from '@/api/demo/formScheme'; import { cardNestStructure } from '@/views/demo/onlineform/util.ts'; import { fun_GetPageList } from '@/api/demo/formModule'; + import { getRFields } from '@/views/demo/workflow/scheme/util.ts' const flowWfDataStore = flowStore(); const labelCol = { span: 7 }; @@ -388,139 +389,6 @@ }); loadFormScheme(obj.scheme, isChange); } - const cardComponentChild = (data, result) => { - data.forEach((optionsElement) => { - optionsElement.children.forEach((childrenElement) => { - let obj: any = childrenElement; - obj.required = childrenElement.itemProps.required; - obj.disabled = true; - obj.ifShow = true; - obj.label = `${optionsElement.label} - ${childrenElement.label}`; - obj.fieldName = childrenElement.componentProps.fieldName; - result.push(obj); - if (childrenElement.component === 'CardGroup') { - result = cardComponentChild(childrenElement.componentProps.options, result); - } - }); - }); - return result; - }; - const getRFields = (dataList, rFieldList,fieldList) => { - dataList.forEach((element: { label?: string; field?: string; component: any; itemProps: any }) => { - if (['InputGuid'].includes(element.component)) { - rFieldList.push({ - label: element.label, - // value:element.prop - value: element.field, - }); - } - if(element.component === 'Tabs'){ - element.componentProps.options.forEach(childElement => { - const {rFieldList:rField, fieldList:field} = getRFields(childElement.children,rFieldList,fieldList) - rFieldList = rField - fieldList = field - }) - }else if ( - ![ - 'Divider', - 'Grid', - 'Card', - 'CreateUser', - 'CreateTime', - 'ModifyUser', - 'ModifyTime', - 'CardGroup', - ].includes(element.component) && - !element.itemProps.hidden - ) { - let obj: any = element; - obj.required = element.itemProps.required; - // obj.componentProps.disabled = false; - obj.disabled = true; - obj.ifShow = true; - obj.fieldName = element.componentProps.fieldName; - fieldList.push(obj); - } else if (['Grid'].includes(element.component) || element.type == 'subTable') { - console.log('gridtable'); - fieldList.push({ - field: `${element.field}_add`, - label: `${element.label || '表格'}-添加按钮`, - required: false, - disabled: true, - ifShow: false, - type: 'grid', - }); - fieldList.push({ - field: `${element.field}_remove`, - label: `${element.label || '表格'}-删除按钮`, - required: false, - disabled: true, - ifShow: false, - type: 'grid', - }); - - fieldList.push({ - field: `${element.field}_required`, - label: `${element.label || '表格'}-数据`, - required: element.itemProps.required, - disabled: false, - ifShow: false, - type: 'gridrequired', - }); - element.columns.forEach((child) => { - child.children.forEach((t) => { - fieldList.push({ - gridprop: element.field, - field: t.field, - label: `${element.label || '表格'}-${t.label}`, - required: t.itemProps.required, - disabled: true, - ifShow: true, - fieldName: t.componentProps.fieldName, - ...t, - }); - }); - }); - } else if (['Card'].includes(element.component)) { - console.log(3); - element.columns.forEach((child) => { - child.children.forEach((t) => { - fieldList.push({ - gridprop: element.field, - field: t.field, - required: t.itemProps.required, - disabled: true, - ifShow: true, - fieldName: t.componentProps.fieldName, - ...t, - }); - }); - }); - } else if ( - ['CreateUser', 'CreateTime', 'ModifyUser', 'ModifyTime'].includes(element.component) && - element.display - ) { - let obj: any = element; - obj.required = element.itemProps.required; - // obj.componentProps.disabled = false; - obj.disabled = true; - obj.ifShow = true; - obj.fieldName = element.componentProps.fieldName; - fieldList.push(obj); - } else if (['CardGroup'].includes(element.component)) { - let obj: any = element; - obj.required = element.itemProps.required; - // obj.componentProps.disabled = false; - obj.disabled = true; - obj.ifShow = true; - obj.fieldName = element.componentProps.fieldName; - obj.label = `卡片组-${element.label}`; - fieldList.push(obj); - fieldList = cardComponentChild(element.componentProps.options, fieldList); - } - },); - return {rFieldList,fieldList} - } function loadFormScheme(strScheme, isChange) { const scheme = JSON.parse(strScheme); let fields: any[] = []; diff --git a/src/components/ProcessDesigner/package/penal/userTask/index.vue b/src/components/ProcessDesigner/package/penal/userTask/index.vue index d1b84d92..271d0e87 100644 --- a/src/components/ProcessDesigner/package/penal/userTask/index.vue +++ b/src/components/ProcessDesigner/package/penal/userTask/index.vue @@ -541,6 +541,7 @@ import { cardNestStructure } from '@/views/demo/onlineform/util.ts'; import { fun_GetPageList } from '@/api/demo/formModule'; import { SelectIssueForm } from '@/components/SelectIssueForm/index'; + import { getRFields } from '@/views/demo/workflow/scheme/util.ts' const flowWfDataStore = flowStore(); const labelCol = { span: 7 }; @@ -920,142 +921,19 @@ }); loadFormScheme(obj.scheme, isChange); } - const cardComponentChild = (data, result) => { - data.forEach((optionsElement) => { - optionsElement.children.forEach((childrenElement) => { - let obj: any = childrenElement; - obj.required = childrenElement.itemProps.required; - obj.disabled = true; - obj.ifShow = true; - obj.label = `${optionsElement.label} - ${childrenElement.label}`; - obj.fieldName = childrenElement.componentProps.fieldName; - result.push(obj); - if (childrenElement.component === 'CardGroup') { - result = cardComponentChild(childrenElement.componentProps.options, result); - } - }); - }); - return result; - }; function loadFormScheme(strScheme, isChange) { const scheme = JSON.parse(strScheme); let fields: any[] = []; - const rfields: { + let rfields: { label?: string; value?: string; }[] = []; scheme.formInfo.tabList = cardNestStructure(scheme.formInfo.tabList); console.log(scheme.formInfo.tabList); scheme.formInfo.tabList.forEach((tabElement) => { - tabElement.schemas.forEach( - (element: { label?: string; field?: string; component: any; itemProps: any }) => { - if (['InputGuid'].includes(element.component)) { - rfields.push({ - label: element.label, - // value:element.prop - value: element.field, - }); - } - if ( - ![ - 'Divider', - 'Grid', - 'Card', - 'CreateUser', - 'CreateTime', - 'ModifyUser', - 'ModifyTime', - 'CardGroup', - ].includes(element.component) && - !element.itemProps.hidden - ) { - let obj: any = element; - obj.required = element.itemProps.required; - // obj.componentProps.disabled = false; - obj.disabled = true; - obj.ifShow = true; - obj.fieldName = element.componentProps.fieldName; - fields.push(obj); - } else if (['Grid'].includes(element.component) || element.type == 'subTable') { - console.log('gridtable'); - fields.push({ - field: `${element.field}_add`, - label: `${element.label || '表格'}-添加按钮`, - required: false, - disabled: true, - ifShow: false, - type: 'grid', - }); - fields.push({ - field: `${element.field}_remove`, - label: `${element.label || '表格'}-删除按钮`, - required: false, - disabled: true, - ifShow: false, - type: 'grid', - }); - - fields.push({ - field: `${element.field}_required`, - label: `${element.label || '表格'}-数据`, - required: element.itemProps.required, - disabled: false, - ifShow: false, - type: 'gridrequired', - }); - element.columns.forEach((child) => { - child.children.forEach((t) => { - fields.push({ - gridprop: element.field, - field: t.field, - label: `${element.label || '表格'}-${t.label}`, - required: t.itemProps.required, - disabled: true, - ifShow: true, - fieldName: t.componentProps.fieldName, - ...t, - }); - }); - }); - } else if (['Card'].includes(element.component)) { - console.log(3); - element.columns.forEach((child) => { - child.children.forEach((t) => { - fields.push({ - gridprop: element.field, - field: t.field, - required: t.itemProps.required, - disabled: true, - ifShow: true, - fieldName: t.componentProps.fieldName, - ...t, - }); - }); - }); - } else if ( - ['CreateUser', 'CreateTime', 'ModifyUser', 'ModifyTime'].includes(element.component) && - element.display - ) { - let obj: any = element; - obj.required = element.itemProps.required; - // obj.componentProps.disabled = false; - obj.disabled = true; - obj.ifShow = true; - obj.fieldName = element.componentProps.fieldName; - fields.push(obj); - } else if (['CardGroup'].includes(element.component)) { - let obj: any = element; - obj.required = element.itemProps.required; - // obj.componentProps.disabled = false; - obj.disabled = true; - obj.ifShow = true; - obj.fieldName = element.componentProps.fieldName; - obj.label = `卡片组-${element.label}`; - fields.push(obj); - fields = cardComponentChild(element.componentProps.options, fields); - } - }, - ); + const {rFieldList, fieldList} = getRFields(tabElement.schemas,rfields,fields) + rfields = rFieldList + fields = fieldList }); data.formRelations = rfields; if (isChange) { diff --git a/src/views/demo/workflow/scheme/util.ts b/src/views/demo/workflow/scheme/util.ts new file mode 100644 index 00000000..eaaa841a --- /dev/null +++ b/src/views/demo/workflow/scheme/util.ts @@ -0,0 +1,133 @@ +export const getRFields = (dataList, rFieldList,fieldList) => { + dataList.forEach((element: { label?: string; field?: string; component: any; itemProps: any }) => { + if (['InputGuid'].includes(element.component)) { + rFieldList.push({ + label: element.label, + // value:element.prop + value: element.field, + }); + } + if(element.component === 'Tabs'){ + element.componentProps.options.forEach(childElement => { + const {rFieldList:rField, fieldList:field} = getRFields(childElement.children,rFieldList,fieldList) + rFieldList = rField + fieldList = field + }) + }else if ( + ![ + 'Divider', + 'Grid', + 'Card', + 'CreateUser', + 'CreateTime', + 'ModifyUser', + 'ModifyTime', + 'CardGroup', + ].includes(element.component) && + !element.itemProps.hidden + ) { + let obj: any = element; + obj.required = element.itemProps.required; + // obj.componentProps.disabled = false; + obj.disabled = true; + obj.ifShow = true; + obj.fieldName = element.componentProps.fieldName; + fieldList.push(obj); + } else if (['Grid'].includes(element.component) || element.type == 'subTable') { + console.log('gridtable'); + fieldList.push({ + field: `${element.field}_add`, + label: `${element.label || '表格'}-添加按钮`, + required: false, + disabled: true, + ifShow: false, + type: 'grid', + }); + fieldList.push({ + field: `${element.field}_remove`, + label: `${element.label || '表格'}-删除按钮`, + required: false, + disabled: true, + ifShow: false, + type: 'grid', + }); + + fieldList.push({ + field: `${element.field}_required`, + label: `${element.label || '表格'}-数据`, + required: element.itemProps.required, + disabled: false, + ifShow: false, + type: 'gridrequired', + }); + element.columns.forEach((child) => { + child.children.forEach((t) => { + fieldList.push({ + gridprop: element.field, + field: t.field, + label: `${element.label || '表格'}-${t.label}`, + required: t.itemProps.required, + disabled: true, + ifShow: true, + fieldName: t.componentProps.fieldName, + ...t, + }); + }); + }); + } else if (['Card'].includes(element.component)) { + console.log(3); + element.columns.forEach((child) => { + child.children.forEach((t) => { + fieldList.push({ + gridprop: element.field, + field: t.field, + required: t.itemProps.required, + disabled: true, + ifShow: true, + fieldName: t.componentProps.fieldName, + ...t, + }); + }); + }); + } else if ( + ['CreateUser', 'CreateTime', 'ModifyUser', 'ModifyTime'].includes(element.component) && + element.display + ) { + let obj: any = element; + obj.required = element.itemProps.required; + // obj.componentProps.disabled = false; + obj.disabled = true; + obj.ifShow = true; + obj.fieldName = element.componentProps.fieldName; + fieldList.push(obj); + } else if (['CardGroup'].includes(element.component)) { + let obj: any = element; + obj.required = element.itemProps.required; + // obj.componentProps.disabled = false; + obj.disabled = true; + obj.ifShow = true; + obj.fieldName = element.componentProps.fieldName; + obj.label = `卡片组-${element.label}`; + fieldList.push(obj); + fieldList = cardComponentChild(element.componentProps.options, fieldList); + } + },); + return {rFieldList,fieldList} +} +const cardComponentChild = (data, result) => { + data.forEach((optionsElement) => { + optionsElement.children.forEach((childrenElement) => { + let obj: any = childrenElement; + obj.required = childrenElement.itemProps.required; + obj.disabled = true; + obj.ifShow = true; + obj.label = `${optionsElement.label} - ${childrenElement.label}`; + obj.fieldName = childrenElement.componentProps.fieldName; + result.push(obj); + if (childrenElement.component === 'CardGroup') { + result = cardComponentChild(childrenElement.componentProps.options, result); + } + }); + }); + return result; +}; \ No newline at end of file From 43a59c62b85d0469ec1a267196867d873ed2d82c Mon Sep 17 00:00:00 2001 From: Zhufu <1176354795@qq.com> Date: Thu, 13 Jun 2024 11:18:37 +0800 Subject: [PATCH 08/18] =?UTF-8?q?[=E5=88=86=E6=9E=90=E9=A1=B5]=E5=8F=B3?= =?UTF-8?q?=E4=BE=A7=E6=8A=BD=E5=B1=89=E9=BB=98=E8=AE=A4=E5=B1=95=E5=BC=80?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=BA=E9=BB=98=E8=AE=A4=E5=85=B3=E9=97=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/MapboxMaps/RightShowInfo/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/MapboxMaps/RightShowInfo/index.vue b/src/components/MapboxMaps/RightShowInfo/index.vue index 0b5dfe96..b4e7ffee 100644 --- a/src/components/MapboxMaps/RightShowInfo/index.vue +++ b/src/components/MapboxMaps/RightShowInfo/index.vue @@ -19,7 +19,7 @@ import { ref, defineProps, watch } from 'vue'; import './index.scss'; - const open = ref(true); + const open = ref(false); const props = defineProps(['openModal']); watch( () => props.openModal, From cb7265cdb0b8dadee2b19fdb3ed60635cbea1be4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=A6=8D?= <1455167345@qq.com> Date: Thu, 13 Jun 2024 14:01:41 +0800 Subject: [PATCH 09/18] =?UTF-8?q?=E4=B8=A2=E5=A4=B1=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/demo/workflow/task/process/audit.vue | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/views/demo/workflow/task/process/audit.vue b/src/views/demo/workflow/task/process/audit.vue index 825f4ee2..7775a001 100644 --- a/src/views/demo/workflow/task/process/audit.vue +++ b/src/views/demo/workflow/task/process/audit.vue @@ -12,7 +12,15 @@ - +
Date: Thu, 13 Jun 2024 14:36:44 +0800 Subject: [PATCH 10/18] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/demo/onlineform/formCall/CreateFlow.vue | 7 ++++--- src/views/demo/workflow/create/preview.vue | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/views/demo/onlineform/formCall/CreateFlow.vue b/src/views/demo/onlineform/formCall/CreateFlow.vue index 0419bbd8..4de6f2ea 100644 --- a/src/views/demo/onlineform/formCall/CreateFlow.vue +++ b/src/views/demo/onlineform/formCall/CreateFlow.vue @@ -228,7 +228,10 @@ formBoxRef.value .getForm() .then(async (res) => { - if (res) { + console.log(res); + if (!res) { + createMessage.error('请检查表单必填项'); + } else { if (!props.isUpdate) { res[designerData.formCurrentNode.formRelationId] = processId; querys.pkeyValue = processId; @@ -254,8 +257,6 @@ if (formValue) { handleCreateFlow(processId, querys.pkeyValue); } - } else { - createMessage.error('请检查表单必填项'); } }) .catch((error) => { diff --git a/src/views/demo/workflow/create/preview.vue b/src/views/demo/workflow/create/preview.vue index 17515106..309a128d 100644 --- a/src/views/demo/workflow/create/preview.vue +++ b/src/views/demo/workflow/create/preview.vue @@ -16,7 +16,7 @@ >关闭
- + { + col.children.forEach((chil) => { + arr.push(chil); + }); + }); + }else if(childItem.component && childItem.component !== "Grid"){ + arr.push(childItem) + } + }) + }) }else if(item.component && item.component !== "Grid"){ arr.push(item) } From 74aa0fb15ca9a9016a085a454ce18ab16c917c58 Mon Sep 17 00:00:00 2001 From: Zhufu <1176354795@qq.com> Date: Thu, 13 Jun 2024 16:23:03 +0800 Subject: [PATCH 13/18] =?UTF-8?q?=E3=80=90=E8=A1=A8=E5=8D=95=E5=8F=91?= =?UTF-8?q?=E5=B8=83=E5=90=8E=E3=80=91=E8=AF=A6=E6=83=85=E5=8F=96=E6=B6=88?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/demo/onlineform/formCall/CallModal.vue | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/views/demo/onlineform/formCall/CallModal.vue b/src/views/demo/onlineform/formCall/CallModal.vue index c8c50735..1c6bece8 100644 --- a/src/views/demo/onlineform/formCall/CallModal.vue +++ b/src/views/demo/onlineform/formCall/CallModal.vue @@ -515,14 +515,16 @@ columns.push(val); }); }); - const obj = await validate(); setTimeout(() => { updateSchema(columns); resetFields(); }, 100); - setTimeout(() => { - setFieldsValue(obj); - }, 500); + if(!isDetail.value){ + const obj = await validate(); + setTimeout(() => { + setFieldsValue(obj); + }, 500); + } } function generateUniqueDigits(length: number): number[] { const digits = new Set(); From 9baeb47f41f9efeb05960b3af9d9bc65bf8ec3f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BB=95=E5=B5=A9?= <17854119262@163.com> Date: Thu, 13 Jun 2024 16:52:37 +0800 Subject: [PATCH 14/18] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=BB=BA=E8=A1=A8?= =?UTF-8?q?=E3=80=81=E8=84=9A=E6=9C=AC=E3=80=81=E8=A1=A8=E5=8D=95=E5=8F=91?= =?UTF-8?q?=E5=B8=83=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../VFormDesign/config/formItemPropsScript.ts | 69 ++----- src/views/demo/onlineform/formCall/utils.ts | 49 ++++- .../demo/onlineform/formModule/modalForm.vue | 174 +++--------------- .../formdesign/modal/AutomaticModal.vue | 73 +++++++- 4 files changed, 157 insertions(+), 208 deletions(-) diff --git a/src/views/demo/form-design/components/VFormDesign/config/formItemPropsScript.ts b/src/views/demo/form-design/components/VFormDesign/config/formItemPropsScript.ts index ffa8cca7..985bf4c0 100644 --- a/src/views/demo/form-design/components/VFormDesign/config/formItemPropsScript.ts +++ b/src/views/demo/form-design/components/VFormDesign/config/formItemPropsScript.ts @@ -1,49 +1,3 @@ -export const formItemPropsScript_ = ` -prop:组件id; -data:组件改变数据; -isUpdate:表单状态,新增或更新; -get(path):获取数据方法, 如果想获取某一个组件值就设置path参数值为组件id, 如果是子表的一行数据值就设置子表id.行号, 如果是子表某一行某一列值就设置子表id.行号.子组件id; -set(path,value):设置值方法,path说明和get方法一致; -getLabel(prop):获取组件的显示值,prop为组件id; -setRequired(prop,isRequired):设置组件是否必填,prop为组件id,isRequired 默认值true,如果取消必填就设置成false -setDisabled(prop,isDisabled):设置组件是否只读,prop为组件id,isDisabled 默认值true,如果取消只读就设置成false -setHide(prop,isHide):设置组件是否隐藏,isHide 默认值true,如果取消隐藏就设置成false -httpGet(option):get请求方法 -httpPost(option):post请求方法 -httpDelete(option):delete请求方法 -httpPut(option):put请求方法 -option:上面四个请求方法参数描述:url:请求地址,data:提交数据(get方法不支持),params:url参数,errorTips:请求失败错误提示,callback请求回调方法 返回结果为请求数据 -loading:显示加载状态 -hideLoading:隐藏加载状态 -message:显示提示消息 -loginUser:当前登录者信息 -callback:回调方法,在脚本里使用了http方法后才需要使用'; -`; - -export const formItemPropsScript__ = ` -// 示例代码,只支持ES5语法 -// 获取子表行数据 -var childRow = utils.get('子表组件id.行号') -// 获取子表单元格数据 -var childCell = utils.get('子表组件id.行号.单元格组件id') - - -// 添加子表行数据 -var row = {} -utils.set({path:'子表组件id',value:row,type:'addTable'}) -// 删除子表行数据 -utils.set({path:'子表组件id.行号',type:'deleteTable'}) -// 设置子表某一个单元格数据 -utils.set({path:'子表组件id.行号.单元格组件id',value:'xxxxxx'}) -// 去掉子表某一行删除按钮 -utils.set({path:'子表组件id.行号.hasNoDeleteBtn',value:false}) -// 让子表某一行变成不可编辑 -utils.set({path:'子表组件id.行号.disabled',value:true}) -// 让子表某一行除了某一列外不可以编辑 -utils.set({path:'子表组件id.行号.disabled',value:true}) -utils.set({path:'子表组件id.行号.abledList',value:['编辑列组件id']}) -`; - export const formItemPropsScript = ` // 获取表单是新增还是编辑 var isUpdate = utils.isUpdate(); @@ -52,10 +6,21 @@ var data = utils.data(); // 数据设置 // 获取主表数据 -utils.getValue('组件的字段标识'); +let mainValue = utils.getValue('组件的字段标识'); // 设置主表数据 setFieldsValue(utils.setValue('组件的字段标识', '设置的值')); +// 获取子表数据 +let childValue = getChildValue('组件的字段标识'); +// 添加子表数据 +subTableList.value = addChildValue(data); +data格式为[{组件的字段标识1: "value1", {组件的字段标识2: "value2"}]或者{组件的字段标识1: "value1"} +// 修改子表数据 +subTableList.value = addChildValue('组件的字段标识', '旧value', '新value'); +// 删除子表数据 +subTableList.value = deleteChildValue('组件的字段标识', 'value'); + + // 组件设置 // 设置组件为隐藏 formColumns.value = utils.setHide('组件的字段标识', false); @@ -96,8 +61,8 @@ url:api地址, params:参数 `; export function addBreakLines(text: string): string { - // 根据换行符分割文本为行 - const lines = text.split(/\r?\n/); - // 在每行后面添加 - return lines.map((line) => line + '
').join(''); -}; \ No newline at end of file + // 根据换行符分割文本为行 + const lines = text.split(/\r?\n/); + // 在每行后面添加 + return lines.map((line) => line + '
').join(''); +} diff --git a/src/views/demo/onlineform/formCall/utils.ts b/src/views/demo/onlineform/formCall/utils.ts index 35504822..75cf8eb3 100644 --- a/src/views/demo/onlineform/formCall/utils.ts +++ b/src/views/demo/onlineform/formCall/utils.ts @@ -141,12 +141,51 @@ export const utils = { }, // 获取子表数据 getChildValue: (field: any): any => { - return c_record[field]; + if (field == '') { + return c_subTableList; + } else { + const res: any = []; + c_subTableList.forEach((v) => { + res.push(v[field]); + }); + return res; + } }, - // 设置子表数据 - setChildValue: (field: any, value: any): any => { - c_record[field] = value; - return c_record; + // 添加子表数据 + addChildValue: (data: any): any => { + if (typeof data == 'object') { + if (Array.isArray(data)) { + data.forEach((d) => { + c_subTableList.push(d); + }); + } else { + c_subTableList.push(data); + } + } + return c_subTableList; + }, + // 修改子表数据 + updateChildValue: (field: string, oldValue: string, newValue: string): any => { + const c_subTableList_temp: any = []; + c_subTableList.forEach((sub) => { + if (sub[field] == oldValue) { + sub[field] = newValue; + } + c_subTableList_temp.push(sub); + }); + c_subTableList = c_subTableList_temp; + return c_subTableList; + }, + // 删除子表数据 + deleteChildValue: (field: string, value: string): any => { + const c_subTableList_temp: any = []; + c_subTableList.forEach((sub) => { + if (sub[field] != value) { + c_subTableList_temp.push(sub); + } + }); + c_subTableList = c_subTableList_temp; + return c_subTableList; }, // 组件----------------------------- // 获取组件 diff --git a/src/views/demo/onlineform/formModule/modalForm.vue b/src/views/demo/onlineform/formModule/modalForm.vue index 4ae4c802..6884f300 100644 --- a/src/views/demo/onlineform/formModule/modalForm.vue +++ b/src/views/demo/onlineform/formModule/modalForm.vue @@ -141,6 +141,7 @@ asyncValidator: async (rule, value, callback) => { // 验证逻辑 if (value) { + // 判断数据表字段重复 try { let filedsJson = { Code: formData.value.code, @@ -176,104 +177,51 @@ }); } } catch (error) { - ('验证出错'); + if (error) { + emit('set-steps-current', false); + } } } else { callback(new Error('请输入编号')); } }, - trigger: ['blur'], + trigger: 'blur', }, ], name: [ { required: true, - validator: (rule, value, callback) => { - try { - // 验证逻辑 - if (value) { - callback(); - } else { - callback(new Error('请输入名称')); - } - } catch (error) { - console.log(error); - } - }, - trigger: ['blur'], + message: '请输入名称', + trigger: 'blur', }, ], icon: [ { component: 'IconPicker', required: true, - validator: (rule, value, callback) => { - try { - // 验证逻辑 - if (value) { - callback(); - } else { - callback(new Error('请选择图标')); - } - } catch (error) { - console.log(error); - } - }, - trigger: ['blur'], + message: '请选择图标', + trigger: 'blur', }, ], formCodeName: [ { required: true, - validator: (rule, value, callback) => { - try { - // 验证逻辑 - if (value) { - callback(); - } else { - callback(new Error('请选择表单')); - } - } catch (error) { - console.log(error); - } - }, - trigger: ['blur'], + message: '请选择表单版本', + trigger: 'blur', }, ], formVerison: [ { required: true, - validator: (rule, value, callback) => { - try { - // 验证逻辑 - if (value) { - callback(); - } else { - callback(new Error('请选择表单版本')); - } - } catch (error) { - console.log(error); - } - }, - trigger: ['blur'], + message: '请选择表单版本', + trigger: 'blur', }, ], pmoduleId: [ { required: true, - validator: (rule, value, callback) => { - try { - // 验证逻辑 - if (value) { - callback(); - } else { - callback(new Error('请选择上级')); - } - } catch (error) { - console.log(error); - } - }, - trigger: ['blur'], + message: '请选择上级', + trigger: 'blur', }, ], enabledMark: [{ required: true }], @@ -292,36 +240,25 @@ } }, ); + // 监视props watch( () => props.isNextSteps, async () => { if (props.isNextSteps) { - // if (formModuleRef) { - // try { - // await formModuleRef.validate(); - // } catch (error) { - // console.log(error); - // } - // } - if ( - formData.value.code === '' || - formData.value.name === '' || - formData.value.icon === '' || - formData.value.formCode === '' || - formData.value.formVerison === '' || - formData.value.pmoduleId === '' - ) { - createMessage.error(t('数据未填写完整')); - emit('set-steps-current', false); - } else { - // 验证通过后的逻辑 - let res = await checkExistFiled(); - if (res) { - emit('set-steps-current', true); - } else { - createMessage.error(t('表单的编号值重复')); - emit('set-steps-current', false); + // 判断数据表字段重复 + if (formModuleRef) { + try { + const valid = await formModuleRef.validate(); + if (valid.errorFields) { + emit('set-steps-current', false); + } else { + emit('set-steps-current', true); + } + } catch (error) { + if (error) { + emit('set-steps-current', false); + } } } } @@ -387,59 +324,6 @@ getSchemeRow(result.info); } - // 验证通过后的逻辑 - async function checkExistFiled() { - try { - let filedsJson = { - Code: formData.value.code, - }; - let result = false; - if (props.isEdit) { - // 编辑 - let query: any = { - keyValue: props.editData.record.id, - tableName: 'form_module', - keyName: 'Id', - filedsJson: JSON.stringify(filedsJson), - }; - await Get_Get_ExistFiled(query) - .then((res) => { - if (res) { - result = true; - } else { - result = false; - } - }) - .catch((error) => { - createMessage.error('验证出错' + error); - result = true; - }); - } else { - // 新增 - let query: any = { - tableName: 'form_module', - keyName: 'Id', - filedsJson: JSON.stringify(filedsJson), - }; - await Get_Get_ExistFiled(query) - .then((res) => { - if (res) { - result = true; - } else { - result = false; - } - }) - .catch((error) => { - createMessage.error('验证出错' + error); - result = false; - }); - } - return result; - } catch (error) { - ('验证出错'); - } - } - defineExpose({ formData, }); diff --git a/src/views/demo/onlineform/formdesign/modal/AutomaticModal.vue b/src/views/demo/onlineform/formdesign/modal/AutomaticModal.vue index bf0ac726..3ddbcea0 100644 --- a/src/views/demo/onlineform/formdesign/modal/AutomaticModal.vue +++ b/src/views/demo/onlineform/formdesign/modal/AutomaticModal.vue @@ -9,12 +9,12 @@ :showCancelBtn="true" :showOkBtn="true" @ok="submit" - @cancel="closeModal()" + @cancel="closeModalDeleteGrid" @visible-change=" () => { db_list.value = []; chlidTableName = ''; - closeModal(); + isCloseSubmit.value = false; } " > @@ -381,6 +381,10 @@ else if (item.component == 'Card') { // 卡片布局的组件会自动进入主组件表内 } + // 栅格布局 + else if (item.component == 'Grid') { + // 栅格布局的组件会进入主组件表内 + } } else { // 普通组件 let temp = cloneDeep(dbColumnInfo); @@ -401,7 +405,16 @@ item.componentProps.dataTable = db_temp.tableName; item.componentProps.fieldName = temp.dbColumnName; - db_temp.dbColumnInfoList.push(temp); + // 主表不添加重复的普通组件(编辑情况下的栅格) + let gridFlag = true; + db_temp.dbColumnInfoList.forEach((dbColumn) => { + if (dbColumn.dbColumnName == temp.dbColumnName) { + gridFlag = false; + } + }); + if (gridFlag) { + db_temp.dbColumnInfoList.push(temp); + } } } schemas[index] = item; @@ -413,7 +426,16 @@ } }); if (gridType == 'main') { - db_list.value.unshift(db_temp); + // 筛掉重复项 + let dbFlag = true; + db_list.value.forEach((db) => { + if (db.tableName == db_temp.tableName) { + dbFlag = false; + } + }); + if (dbFlag) { + db_list.value.unshift(db_temp); + } } } @@ -677,7 +699,16 @@ } }); if (gridType == 'chlid') { - db_list.value.push(db_temp); + // 筛掉重复项 + let dbFlag = true; + db_list.value.forEach((db) => { + if (db.tableName == db_temp.tableName) { + dbFlag = false; + } + }); + if (dbFlag) { + db_list.value.push(db_temp); + } } } return scheme; @@ -745,6 +776,7 @@ } }); } + // 把弹窗的信息写入saveFormDatas getFromAndTable(); } @@ -790,6 +822,8 @@ saveFormDatas.scheme.scheme = JSON.stringify(schems); } + // submit提交关闭的 + const isCloseSubmit = ref(false); // 把弹窗的信息写入saveFormDatas function getFromAndTable() { let schems = JSON.parse(saveFormDatas.scheme.scheme); @@ -802,7 +836,8 @@ }); saveFormDatas.scheme.scheme = JSON.stringify(schems); emit('automatic-modal-submitsuccess', saveFormDatas); - closeModal(); + isCloseSubmit.value = true; + closeModalDeleteGrid(); } // 表名变化后修改表单里的表名 @@ -816,6 +851,32 @@ }); } + // 非提交关闭窗口时,栅格布局清除取出来的表单组件删除掉 + function closeModalDeleteGrid() { + // 非提交 + if (!isCloseSubmit.value) { + let scheme_close = JSON.parse(saveFormDatas.scheme.scheme); + let tabList_close = scheme_close.formInfo.tabList; + // tabList遍历 + tabList_close.forEach((list, list_index) => { + let schemas_temp: any = []; + let schemas_close = list.schemas; + // schemas遍历 + schemas_close.forEach((sch) => { + if (!sch.ptype || sch.ptype != 'gridlayout') { + // schemas添加 + schemas_temp.push(sch); + } + }); + tabList_close[list_index].schemas = schemas_temp; + }); + // scheme赋值 + scheme_close.formInfo.tabList = tabList_close; + saveFormDatas.scheme.scheme = JSON.stringify(scheme_close); + } + closeModal(); + } + // 数据格式(默认varchar)变化后修改字段长度 function isBoolChangeLength(record: Recordable) { if (record.dataType == 'bool') { From f829157c734be1a049d198d39a21f7c56101e056 Mon Sep 17 00:00:00 2001 From: Zhufu <1176354795@qq.com> Date: Thu, 13 Jun 2024 17:12:16 +0800 Subject: [PATCH 15/18] =?UTF-8?q?=E8=A7=A3=E6=9E=84=E7=BB=84=E5=90=88?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E5=85=B1=E9=80=9A=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../demo/onlineform/formdesign/FormModal.vue | 108 +----------------- 1 file changed, 1 insertion(+), 107 deletions(-) diff --git a/src/views/demo/onlineform/formdesign/FormModal.vue b/src/views/demo/onlineform/formdesign/FormModal.vue index 2d5c3759..d2d14d63 100644 --- a/src/views/demo/onlineform/formdesign/FormModal.vue +++ b/src/views/demo/onlineform/formdesign/FormModal.vue @@ -78,6 +78,7 @@ getOutKeyList, } from '@/api/formdesign/index'; import { functionGetForm } from '@/api/demo/formScheme'; + import { cardNestStructure, changeCardStructure } from '@/views/demo/onlineform/util.ts' defineOptions({ name: 'FormModal' }); @@ -118,66 +119,6 @@ } return arr; } - const changeCardStructure = (data) => { - let result = []; - if (data && data.length > 0) { - data.forEach((item) => { - if (item.component === 'Tabs') { - item.componentProps.options = changeCardStructure(item.componentProps.options); - } else if (item.component === 'CardGroup') { - item.componentProps.options = changeCardStructure(item.componentProps.options); - item.componentProps.options.forEach((childItem) => { - if (childItem.pfield) { - result.push(childItem); - } else { - result.push({ ...childItem, ptype: 'card', pfield: item.field }); - } - }); - item.componentProps.options = []; - } else if (item.component === 'Grid' && item.label === '栅格布局') { - item.columns = changeCardStructure(item.columns); - item.columns.forEach((childItem) => { - childItem.children.forEach((col) => { - result.push({ ...col, ptype: 'gridlayout', pfield: item.field }); - }); - }); - } else if (item.children && !item.field) { - item.children = changeCardStructure(item.children); - } else if (item.children && item.field.indexOf('use_card') === -1) { - item.children = changeCardStructure(item.children); - item.children = []; - } else { - if (['Card'].includes(item.component)) { - item.columns[0].children = changeCardStructure(item.columns[0].children); - if (item.component === 'Card' && item.columns[0].children) { - item.columns[0].children.forEach((childItem) => { - if (childItem.pfield) { - result.push(childItem); - } else { - result.push({ ...childItem, ptype: 'card', pfield: item.field }); - } - }); - item.columns[0].children = []; - } - } else if (item.field && item.field.indexOf('use_card') !== -1) { - item.children = changeCardStructure(item.children); - item.children.forEach((childItem) => { - if (childItem.pfield) { - result.push(childItem); - } else { - result.push({ ...childItem, ptype: 'card', pfield: item.field }); - } - }); - item.children = []; - } - } - result.push(item); - }); - return result; - } else { - return data; - } - }; async function designSendGrandson(value) { let designTab = JSON.parse(value); let schems = saveFormDatas.value.scheme.scheme @@ -525,53 +466,6 @@ saveFormDatas.value.scheme.type = 1; } } - - const cardNestStructure = (data) => { - let childList = {}; - let result = []; - data.forEach((item) => { - if (item.schemas) { - item.schemas = cardNestStructure(item.schemas); - result.push(item); - }else if(item.component === 'Tabs'){ - item.componentProps.options = cardNestStructure(item.componentProps.options); - result.push(item); - }else if(!item.ptype && Object.keys(item).includes('children')){ - item.children = cardNestStructure(item.children) - result.push(item); - } else if (item.ptype) { - if (Object.keys(item).includes('children')) { - item.children = childList[item.field] || []; - } - if (item.component === 'CardGroup' && Object.keys(item).includes('componentProps')) { - item.componentProps.options = childList[item.field] || []; - } - let pushItem = {}; - Object.keys(item).forEach((key) => { - if (key !== 'ptype' && key !== 'pfield') { - pushItem[key] = item[key]; - } - }); - if (childList[item.pfield]) { - childList[item.pfield].push(pushItem); - } else { - childList[item.pfield] = [pushItem]; - } - } else if (item.component === 'CardGroup') { - item.componentProps.options = childList[item.field] || []; - result.push(item); - } else if (item.component === 'Card') { - item.columns[0].children = childList[item.field] || []; - result.push(item); - } else if (item.field &&item.field.indexOf('use_card') !== -1) { - item.children = childList[item.field] || []; - result.push(item); - } else { - result.push(item); - } - }); - return result; - }; // 自动建表返回后,保存数据 function automaticFormDataBack(data) { if (isStageClick.value && stepsCurrent.value === 0) { From 6d39a0e7e246e275d3eee75b63312e99aeb6fa9c Mon Sep 17 00:00:00 2001 From: Zhufu <1176354795@qq.com> Date: Thu, 13 Jun 2024 17:21:03 +0800 Subject: [PATCH 16/18] =?UTF-8?q?=E5=9B=BE=E6=96=91=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E6=94=BE=E5=88=B0=E9=80=89=E9=A1=B9=E5=8D=A1=E9=87=8C=EF=BC=8C?= =?UTF-8?q?=E6=B8=85=E7=90=86=E3=80=90=E9=80=89=E9=A1=B9=E5=8D=A1+?= =?UTF-8?q?=E5=9B=BE=E6=96=91=E3=80=91=E8=A7=A3=E6=9E=90=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=8C=E6=B6=89=E5=8F=8A=E3=80=90=E6=B5=81?= =?UTF-8?q?=E7=A8=8B=E8=AE=BE=E8=AE=A1=E3=80=91=E3=80=90=E5=BC=80=E5=A7=8B?= =?UTF-8?q?=E8=8A=82=E7=82=B9=EF=BC=8C=E4=BB=BB=E5=8A=A1=E8=8A=82=E7=82=B9?= =?UTF-8?q?=E3=80=91=E3=80=90=E8=A1=A8=E5=8D=95=E5=8F=91=E5=B8=83=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=E5=88=97=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../demo/onlineform/formModule/modalDesign.vue | 14 -------------- src/views/demo/onlineform/util.ts | 6 ------ src/views/demo/workflow/scheme/util.ts | 7 ------- 3 files changed, 27 deletions(-) diff --git a/src/views/demo/onlineform/formModule/modalDesign.vue b/src/views/demo/onlineform/formModule/modalDesign.vue index dcb0e815..b6daea55 100644 --- a/src/views/demo/onlineform/formModule/modalDesign.vue +++ b/src/views/demo/onlineform/formModule/modalDesign.vue @@ -241,20 +241,6 @@ arr.push(chil); }); }); - }else if(item.component === 'Tabs'){ - item.componentProps.options.forEach(childTab => { - childTab.children.forEach(childItem => { - if (childItem.columns && (childItem.component === "Grid" && childItem.type === "subTable")) { - childItem.columns.forEach((col) => { - col.children.forEach((chil) => { - arr.push(chil); - }); - }); - }else if(childItem.component && childItem.component !== "Grid"){ - arr.push(childItem) - } - }) - }) }else if(item.component && item.component !== "Grid"){ arr.push(item) } diff --git a/src/views/demo/onlineform/util.ts b/src/views/demo/onlineform/util.ts index 97bcec2f..79549b63 100644 --- a/src/views/demo/onlineform/util.ts +++ b/src/views/demo/onlineform/util.ts @@ -5,12 +5,6 @@ export const cardNestStructure = (data) => { if(item.schemas){ item.schemas = cardNestStructure(item.schemas) result.push(item) - }else if(item.component === 'Tabs'){ - item.componentProps.options = cardNestStructure(item.componentProps.options); - result.push(item); - }else if(!item.ptype && Object.keys(item).includes('children')){ - item.children = cardNestStructure(item.children) - result.push(item); }else if(item.ptype){ if(Object.keys(item).includes('children')){ item.children = childList[item.field] || [] diff --git a/src/views/demo/workflow/scheme/util.ts b/src/views/demo/workflow/scheme/util.ts index eaaa841a..6b8df96a 100644 --- a/src/views/demo/workflow/scheme/util.ts +++ b/src/views/demo/workflow/scheme/util.ts @@ -6,13 +6,6 @@ export const getRFields = (dataList, rFieldList,fieldList) => { // value:element.prop value: element.field, }); - } - if(element.component === 'Tabs'){ - element.componentProps.options.forEach(childElement => { - const {rFieldList:rField, fieldList:field} = getRFields(childElement.children,rFieldList,fieldList) - rFieldList = rField - fieldList = field - }) }else if ( ![ 'Divider', From b03271b710260a185575182bffac6d3656f2d65e Mon Sep 17 00:00:00 2001 From: zzq <15064940501@163.com> Date: Thu, 13 Jun 2024 17:36:54 +0800 Subject: [PATCH 17/18] =?UTF-8?q?=E8=A1=A8=E5=8D=95=E8=B0=83=E7=94=A8?= =?UTF-8?q?=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../demo/onlineform/formCall/CallModal.vue | 140 ++++++++++-------- src/views/demo/onlineform/formCall/index.vue | 97 ++++-------- 2 files changed, 106 insertions(+), 131 deletions(-) diff --git a/src/views/demo/onlineform/formCall/CallModal.vue b/src/views/demo/onlineform/formCall/CallModal.vue index c8c50735..53c3b5b1 100644 --- a/src/views/demo/onlineform/formCall/CallModal.vue +++ b/src/views/demo/onlineform/formCall/CallModal.vue @@ -19,14 +19,17 @@ @register="registerForm" @click="codeClickFunction('beforeSetData', beforeSetData)" @change="codeClickFunction('changeDataEvent', changeDataEvent)" - /> - + > + +
@@ -123,7 +126,7 @@ import { v4 as uuidv4 } from 'uuid'; import FormItem from './ShowFormModal/FormItem/index.vue'; import CallModalFormItem from './CallModalFormItem/index.vue'; - import { CardGourp } from '@/components/FormViewer/index.ts' + import { CardGourp } from '@/components/FormViewer/index.ts'; import { subTableStore } from '@/store/modules/subTable'; import { changeCardStructure, cardNestStructure } from '@/views/demo/onlineform/util.ts'; @@ -150,7 +153,7 @@ }); const cardGroupData = ref([]); const cardGourpFormData = ref({}); - const cardGroupValues = ref({}) + const cardGroupValues = ref({}); const subTableId = ref(null); const subTableColumns: any = ref([]); const subTableData = ref([]); @@ -178,18 +181,18 @@ }); }; const getCardGroupLayoutKey = (dataList) => { - console.log('dataList',dataList) + console.log('dataList', dataList); dataList.children.forEach((item?) => { if (['CardGroup'].includes(item.component)) { - cardGroupValues.value[item.field] = "" - item.componentProps.options.forEach(childItem => { + cardGroupValues.value[item.field] = ''; + item.componentProps.options.forEach((childItem) => { getCardGroupLayoutKey(childItem); - }) - }else{ - cardGroupValues.value[item.field] = ""; + }); + } else { + cardGroupValues.value[item.field] = ''; } - }) - } + }); + }; const [registerModal, { setModalProps, closeModal }] = useModalInner((data: any) => { cardLayout.value = []; subTableDataStore.clearGoupData(); @@ -220,8 +223,9 @@ cardLayout.value.push(opt); } if (opt.component === 'CardGroup') { - if(cardGroupData.value.length !== index){ - cardGroupData.value.push(null) + opt.slot = 'CardGroup'; + if (cardGroupData.value.length !== index) { + cardGroupData.value.push(null); } cardGroupData.value.push(opt); } @@ -290,13 +294,17 @@ // show: index == 0 ? true : false, // }); } - + // arr.forEach((arrcol) => { + // if (arrcol.component === 'CardGroup') { + // arrcol.label = ''; + // } + // }); formColumns.value = arr; }); }); tabsColumns.value = item.componentProps.options; console.log('tabsColumns', tabsColumns.value); - console.log('formColumns', formColumns.value); + console.log('formColumns1', formColumns.value); } else { if (item.rules !== undefined) { let myString = item.rules[0].pattern; @@ -319,15 +327,21 @@ arr.push(item); } } + // arr.forEach((arrcol) => { + // if (arrcol.component === 'CardGroup') { + // arrcol.label = ''; + // } + // }); formColumns.value = arr; if (item.component === 'Card') { cardLayout.value.push(item); } if (item.component === 'CardGroup') { - cardGroupValues.value[item.field] = ""; - item.componentProps.options.forEach(childItem => { - getCardGroupLayoutKey(childItem) - }) + item.slot = 'CardGroup'; + cardGroupValues.value[item.field] = ''; + item.componentProps.options.forEach((childItem) => { + getCardGroupLayoutKey(childItem); + }); cardGroupData.value.push(item); } if (item.component === 'Button') { @@ -401,49 +415,49 @@ }); }); } - Object.keys(cardGroupValues.value).forEach(item => { - cardGroupValues.value[item] = data.infoUseMainTableData[item] - }) - subTableDataStore.setGroupData(cardGroupValues.value) + Object.keys(cardGroupValues.value).forEach((item) => { + cardGroupValues.value[item] = data.infoUseMainTableData[item]; + }); + subTableDataStore.setGroupData(cardGroupValues.value); } if (!unref(isUpdate) && unref(isDetail)) { getTitle.value = '详情'; - let isTabs = false - data.tab = changeCardStructure(data.tab) - data.tab.forEach(itemComponent => { - if(itemComponent.component === 'Tabs'){ - isTabs = true - itemComponent.componentProps.options.forEach(itemChild => { - itemChild.children.forEach(itemChildComponent => { - if(itemChildComponent.component){ - itemChildComponent.componentProps.disabled = true + let isTabs = false; + data.tab = changeCardStructure(data.tab); + data.tab.forEach((itemComponent) => { + if (itemComponent.component === 'Tabs') { + isTabs = true; + itemComponent.componentProps.options.forEach((itemChild) => { + itemChild.children.forEach((itemChildComponent) => { + if (itemChildComponent.component) { + itemChildComponent.componentProps.disabled = true; } - }) - }) - }else if(itemComponent.component){ - itemComponent.componentProps.disabled = true + }); + }); + } else if (itemComponent.component) { + itemComponent.componentProps.disabled = true; } - }) - if(isTabs){ - data.tab = data.tab[0] - data.tab.componentProps.options = data.tab.componentProps.options.map(item => { + }); + if (isTabs) { + data.tab = data.tab[0]; + data.tab.componentProps.options = data.tab.componentProps.options.map((item) => { return { value: item.value, label: item.label, - schemas: item.children - } - }) - data.tab.componentProps.options = cardNestStructure(data.tab.componentProps.options) - data.tab.componentProps.options = data.tab.componentProps.options.map(item => { + schemas: item.children, + }; + }); + data.tab.componentProps.options = cardNestStructure(data.tab.componentProps.options); + data.tab.componentProps.options = data.tab.componentProps.options.map((item) => { return { value: item.value, label: item.label, - children: item.schemas - } - }) - tabsColumns.value = data.tab.componentProps.options - }else{ - data.tab = cardNestStructure(data.tab) + children: item.schemas, + }; + }); + tabsColumns.value = data.tab.componentProps.options; + } else { + data.tab = cardNestStructure(data.tab); } if (Object.keys(cardValues.value).length > 0) { Object.keys(cardValues.value).forEach((cardItem) => { @@ -461,10 +475,10 @@ }); }); } - Object.keys(cardGroupValues.value).forEach(item => { - cardGroupValues.value[item] = data.infoUseMainTableData[item] - }) - subTableDataStore.setGroupData(cardGroupValues.value) + Object.keys(cardGroupValues.value).forEach((item) => { + cardGroupValues.value[item] = data.infoUseMainTableData[item]; + }); + subTableDataStore.setGroupData(cardGroupValues.value); } formModalVisible.value = true; primaryQuery.value = data.query; @@ -600,7 +614,7 @@ } }); } - query = {...query, ...subTableDataStore.getGroupData} + query = { ...query, ...subTableDataStore.getGroupData }; params.data = JSON.stringify(query); console.log('query222', query); console.log('params222', params); diff --git a/src/views/demo/onlineform/formCall/index.vue b/src/views/demo/onlineform/formCall/index.vue index 2f27a3b2..8f526417 100644 --- a/src/views/demo/onlineform/formCall/index.vue +++ b/src/views/demo/onlineform/formCall/index.vue @@ -459,8 +459,7 @@ if (rows.length == 0) { return createMessage.warn('请选择一条数据进行编辑'); } - // console.log('rowsrows',formConfig,rows); - + console.log('rowsrows', rows); btnList.value.forEach((element) => { if (element.prop === 'Edit' && element.isWFlow) { flowCode.value = element.wFlowCode; @@ -526,7 +525,7 @@ if (rows.length == 0) { return createMessage.warn('请选择一条数据查看详情'); } - console.log("DetailsRow",formConfig,rows); + console.log('DetailsRow', rows); let toProps = { isDetail: true, isUpdate: false, @@ -543,12 +542,33 @@ openShowFormModal.value = true; // 根据ids获取图斑 - - try{ - console.log("formConfig",formConfig); - handlerShowGeomtrys(formConfig,rows[0]) - }catch(e){ - createMessage.error("当前数据没有图斑!"); + try { + let getGeomPrams: GeomParams = { + TableName: 'drone_shp_data', + FieldName: 'geom', + // FieldValue:row[].split(","), + FiledValue: [1315, 1308], + }; + getGeom(getGeomPrams).then((res) => { + let geoms = []; + if (res) { + if (res.items?.length > 0) { + res.items.forEach((item, index) => { + let geom = { + key: item.gid, + mapgeom: item.geom, + }; + geoms.push(geom); + }); + } + // MapboxComponent.value.handlerDraw(status,mapgemoList.value, false); + MapboxComponent.value.handlerDraw(status, geoms, false); + } else { + createMessage.error('当前数据没有图斑!'); + } + }); + } catch (e) { + createMessage.error('当前数据没有图斑!'); } } else { openModal(true, toProps); @@ -563,65 +583,6 @@ } }; - - async function handlerShowGeomtrys(currentNode,rows){ - - let info = currentNode.value.schemas?.find((item,index)=>{ - return item.component == "MapGeom" - }) - let layer:string=""; - // let layer:string="drone_shp_data"; - if(info){ - layer = info?.mapSetData?.chooseLayer - } - if(!layer){ - createMessage.error("图斑未绑定图层服务!"); - return; - } - let geomfiledValue = info.field; - let gids = ""; - try { - // geomfiledValue = geomfiledValue.charAt(0).toLowerCase(); - geomfiledValue = geomfiledValue.charAt(0).toLowerCase() + geomfiledValue.slice(1); - gids = rows[geomfiledValue] - if(gids){ - try{ - let getGeomPrams = { - TableName:layer, - FieldName:"gid", - FieldValue:gids, - page:1, - limit:999, - key:null, - } - getGeom(getGeomPrams).then(res=>{ - let geoms = []; - if(res){ - if(res.items?.length>0){ - res.items.forEach((item,index)=>{ - let geom = { - key:item.gid, - mapgeom:item.geometry - } - geoms.push(geom); - }) - } - MapboxComponent.value.handlerDraw("Details",geoms, false) - }else{ - createMessage.error("当前数据没有图斑!"); - } - }) - }catch(e){ - createMessage.error("当前数据没有图斑!"); - } - }else{ - createMessage.error("当前数据没有图斑!"); - } - }catch{ - createMessage.error("获取图斑数据失败!"); - } - } - function handleSelect(selectedKeys: any, selected: any) { const rel = selected.node.dataRef; const obj: any = {}; From 666e8282d20e63d6618652a83ba0b8f126f74646 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BB=95=E5=B5=A9?= <17854119262@163.com> Date: Thu, 13 Jun 2024 17:43:25 +0800 Subject: [PATCH 18/18] =?UTF-8?q?=E8=A1=A8=E5=8D=95=E8=AE=BE=E8=AE=A1-?= =?UTF-8?q?=E4=B8=8B=E8=BE=B9=E6=A1=86=E6=8C=A1=E4=BD=8F=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../demo/form-design/components/VFormDesign/styles/drag.less | 2 ++ src/views/demo/onlineform/formdesign/modal/AutomaticModal.vue | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/views/demo/form-design/components/VFormDesign/styles/drag.less b/src/views/demo/form-design/components/VFormDesign/styles/drag.less index 38f5e62c..3328208b 100644 --- a/src/views/demo/form-design/components/VFormDesign/styles/drag.less +++ b/src/views/demo/form-design/components/VFormDesign/styles/drag.less @@ -34,6 +34,7 @@ box-sizing: border-box; min-height: 60px; padding: 8px; + margin: 5px; overflow: hidden; transition: all 0.3s; border-radius: 3px; @@ -136,6 +137,7 @@ box-sizing: border-box; width: 100%; padding: 5px; + margin: 5px; overflow: hidden; transition: all 0.3s; background-color: @layout-background-color; diff --git a/src/views/demo/onlineform/formdesign/modal/AutomaticModal.vue b/src/views/demo/onlineform/formdesign/modal/AutomaticModal.vue index 3ddbcea0..bf7e776c 100644 --- a/src/views/demo/onlineform/formdesign/modal/AutomaticModal.vue +++ b/src/views/demo/onlineform/formdesign/modal/AutomaticModal.vue @@ -417,6 +417,7 @@ } } } + item.csType = 'string'; schemas[index] = item; }); if (gridType == 'main') { @@ -690,6 +691,7 @@ db_temp.dbColumnInfoList.push(temp); } } + item.csType = 'csType'; schemas[index] = item; }); if (gridType == 'chlid') {