Pārlūkot izejas kodu

提交插件调整

Lijy 1 gadu atpakaļ
vecāks
revīzija
3100b0e1a4

+ 7 - 1
fhKeeper/formulahousekeeper/plugIn/form-design-master/src/components/ComponentGroup.vue

@@ -22,7 +22,13 @@ import { cloneDeep } from 'lodash-es'
 const props = defineProps<{ fields: any[]; title: string; list: any[], allList: any }>()
 let moveFlag = $ref(false)
 const moveStart = () => {
-  const flag = props.allList.list.length < 5
+  // const flag = props.allList.list.length < 5
+  const array = props.allList.list.map((item: any) => item.model)
+  const plateNumbers = array.filter((item: any) => item.includes('plate')).map((item: any) => {
+    const match = item.match(/plate(\d+)/);
+    return match ? match[1] : null;
+  });
+  const flag = plateNumbers.length < 5
   if (!flag && !moveFlag) {
     moveFlag = true
     ElMessage.warning('最多添加五个')