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/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/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) { 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(){ 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/formCall/index.vue b/src/views/demo/onlineform/formCall/index.vue index 51ba9b82..2f27a3b2 100644 --- a/src/views/demo/onlineform/formCall/index.vue +++ b/src/views/demo/onlineform/formCall/index.vue @@ -526,12 +526,7 @@ if (rows.length == 0) { return createMessage.warn('请选择一条数据查看详情'); } -<<<<<<< HEAD - console.log("DetailsRow",formConfig,rows); -======= - console.log('DetailsRow', rows); ->>>>>>> 2d727b56b33f5b20ec09e72b777cfa6a88e157e9 let toProps = { isDetail: true, isUpdate: false, @@ -548,41 +543,12 @@ openShowFormModal.value = true; // 根据ids获取图斑 -<<<<<<< HEAD + 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('当前数据没有图斑!'); ->>>>>>> 2d727b56b33f5b20ec09e72b777cfa6a88e157e9 } } else { openModal(true, toProps); @@ -597,7 +563,7 @@ } }; -<<<<<<< HEAD + async function handlerShowGeomtrys(currentNode,rows){ let info = currentNode.value.schemas?.find((item,index)=>{ @@ -656,8 +622,6 @@ } } -======= ->>>>>>> 2d727b56b33f5b20ec09e72b777cfa6a88e157e9 function handleSelect(selectedKeys: any, selected: any) { const rel = selected.node.dataRef; const obj: any = {}; 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, });