From 323e576c64129723df20fd18effb20d96d8d18b3 Mon Sep 17 00:00:00 2001
From: Ben Lin <maobin001@msn.com>
Date: 星期一, 22 七月 2024 10:27:50 +0800
Subject: [PATCH] 工单更新

---
 src/views/tigerprojects/system/lowcode/setting/pageDetail.vue | 1049 ++++++++++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 910 insertions(+), 139 deletions(-)

diff --git a/src/views/tigerprojects/system/lowcode/setting/pageDetail.vue b/src/views/tigerprojects/system/lowcode/setting/pageDetail.vue
index 6ff3592..306d5e1 100644
--- a/src/views/tigerprojects/system/lowcode/setting/pageDetail.vue
+++ b/src/views/tigerprojects/system/lowcode/setting/pageDetail.vue
@@ -1,3 +1,12 @@
+<!--
+ * @Description: 浣庝唬鐮佺敓鎴愰〉闈�
+ * @Author: Ben Lin
+ * @version: 
+ * @Date: 2024-05-30 22:00:44
+ * @LastEditors: Ben Lin
+ * @LastEditTime: 2024-07-17 11:14:27
+-->
+<!-- eslint-disable prettier/prettier -->
 <template>
   <PageWrapper
     class="high-form"
@@ -43,8 +52,9 @@
               :params="{ StartWith: getFieldsValue().ASSEMBLY_NAME, Namespace: 'Tiger.Model' }"
               v-model:value="model[field]"
               resultField="items"
-              label-field="Name"
+              label-field="DisplayName"
               valueField="Name"
+              @change="(value, option) => change(value, option, field)"
             />
             <a-input v-model:value="objInputs[field]" style="width: 55%" />
             <Select
@@ -53,11 +63,36 @@
               style="width: 20%"
               :options="options"
               :readonly="true"
+              @change="(value, option) => searchOnChange(value, option, field)"
             />
           </a-input-group>
         </template>
         <template #[item]="{ model, field }" v-for="item in swSlots" :key="item">
           <a-switch v-model:checked="model[field]" />
+        </template>
+        <template #[item]="{ model, field }" v-for="item in searchApiSlots" :key="item">
+          <a-input v-model:value="model[field]" />
+        </template>
+        <template #[item]="{ model, field }" v-for="item in searchParamsSlots" :key="item">
+          <a-input v-model:value="model[field]" />
+        </template>
+        <template #[item]="{ model, field }" v-for="item in searchResultFieldSlots" :key="item">
+          <a-input v-model:value="model[field]" />
+        </template>
+        <template #[item]="{ model, field }" v-for="item in searchLabelFieldSlots" :key="item">
+          <a-input v-model:value="model[field]" />
+        </template>
+        <template #[item]="{ model, field }" v-for="item in searchValueFieldSlots" :key="item">
+          <a-input v-model:value="model[field]" />
+        </template>
+        <template #[item]="{ model, field }" v-for="item in searchOptionsSlots" :key="item">
+          <a-input v-model:value="model[field]" />
+        </template>
+        <template #[item]="{ model, field }" v-for="item in searchOnChangeSlots" :key="item">
+          <a-input v-model:value="model[field]" />
+        </template>
+        <template #[item]="{ model, field }" v-for="item in searchPOptionsSlots" :key="item">
+          <a-input v-model:value="model[field]" />
         </template>
       </BasicForm>
     </a-card>
@@ -103,8 +138,9 @@
                 }"
                 v-model:value="model[field]"
                 resultField="items"
-                label-field="Name"
+                label-field="DisplayName"
                 valueField="Name"
+                @change="(value, option) => mainChange(value, option, field)"
               />
               <a-input v-model:value="mainInputs[field]" style="width: 70%" />
             </a-input-group>
@@ -117,6 +153,9 @@
           </template>
           <template #[item]="{ model, field }" v-for="item in mainwSwSlots" :key="item">
             <a-switch v-model:checked="model[field]" />
+          </template>
+          <template #[item]="{ model, field }" v-for="item in mainIaSlots" :key="item">
+            <a-input v-model:value="model[field]" />
           </template>
         </BasicForm>
       </div>
@@ -162,15 +201,24 @@
               }"
               v-model:value="model[field]"
               resultField="items"
-              label-field="Name"
+              label-field="DisplayName"
               valueField="Name"
+              @change="(value, option) => crudChange(value, option, field)"
             />
-            <a-input v-model:value="crudInputs[field]" style="width: 55%" />
+            <a-input v-model:value="crudInputs[field]" style="width: 33%" />
             <Select
               ref="select"
               v-model:value="crudSelectVals[field]"
-              style="width: 20%"
+              style="width: 21%"
               :options="options"
+              :readonly="true"
+              @change="(value, option) => componentChange(value, option, field)"
+            />
+            <Select
+              ref="select"
+              v-model:value="crudIsExistVals[field]"
+              style="width: 21%"
+              :options="isExistOptions"
               :readonly="true"
             />
           </a-input-group>
@@ -180,6 +228,30 @@
         </template>
         <template #[item]="{ model, field }" v-for="item in crudrSwSlots" :key="item">
           <a-switch v-model:checked="model[field]" />
+        </template>
+        <template #[item]="{ model, field }" v-for="item in crudApiSlots" :key="item">
+          <a-input v-model:value="model[field]" />
+        </template>
+        <template #[item]="{ model, field }" v-for="item in crudParamsSlots" :key="item">
+          <a-input v-model:value="model[field]" />
+        </template>
+        <template #[item]="{ model, field }" v-for="item in crudResultFieldSlots" :key="item">
+          <a-input v-model:value="model[field]" />
+        </template>
+        <template #[item]="{ model, field }" v-for="item in crudLabelFieldSlots" :key="item">
+          <a-input v-model:value="model[field]" />
+        </template>
+        <template #[item]="{ model, field }" v-for="item in crudValueFieldSlots" :key="item">
+          <a-input v-model:value="model[field]" />
+        </template>
+        <template #[item]="{ model, field }" v-for="item in crudOptionsSlots" :key="item">
+          <a-input v-model:value="model[field]" />
+        </template>
+        <template #[item]="{ model, field }" v-for="item in crudOnChangeSlots" :key="item">
+          <a-input v-model:value="model[field]" />
+        </template>
+        <template #[item]="{ model, field }" v-for="item in crudPOptionsSlots" :key="item">
+          <a-input v-model:value="model[field]" />
         </template>
       </BasicForm>
     </a-card>
@@ -191,8 +263,8 @@
   </PageWrapper>
 </template>
 <script lang="ts" setup>
-  import { BasicForm, useForm } from '/@/components/Form';
-  import { onMounted, ref, unref } from 'vue';
+  import { BasicForm, FormSchema, useForm } from '/@/components/Form';
+  import { nextTick, onMounted, ref, unref } from 'vue';
   import { Card, InputGroup, Select, Input, Switch } from 'ant-design-vue';
   import { ApiSelect } from '/@/components/Form/index';
   import { useRoute, useRouter } from 'vue-router';
@@ -205,9 +277,9 @@
   import { SelectTypes } from 'ant-design-vue/es/select';
   import { useMultipleTabStore } from '/@/store/modules/multipleTab';
   import { useModal } from '/@/components/Modal';
-  import { SaveEntity, getEntityPropertieList } from '/@/api/tigerapi/system';
+  import { SaveEntity, getEntity, getEntityPropertieList } from '/@/api/tigerapi/system';
   import { EntityPropertie, SYS_LOW_CODE } from '/@/api/tigerapi/model/systemModel';
-  import { isNullOrEmpty } from '/@/utils/is';
+  import { isNullOrEmpty, isNullOrUnDef } from '/@/utils/is';
   import { useUserStore } from '/@/store/modules/user';
 
   const ACard = Card;
@@ -246,7 +318,7 @@
       validate,
     },
   ] = useForm({
-    labelWidth: 120,
+    labelWidth: 130,
     baseColProps: {
       span: 24,
     },
@@ -263,7 +335,7 @@
       validate: crudvalidate,
     },
   ] = useForm({
-    labelWidth: 120,
+    labelWidth: 130,
     baseColProps: {
       span: 24,
     },
@@ -280,31 +352,56 @@
       validate: validateMainForm,
     },
   ] = useForm({
-    labelWidth: 120,
+    labelWidth: 130,
     baseColProps: {
       span: 24,
     },
     schemas: mainSchemas,
     showActionButtonGroup: false,
   });
+  /* 鏌ヨ */
+  const SearchEntName = ref('');
   const objInputs = ref({} as { [key: string]: any });
-  const mainInputs = ref({} as { [key: string]: any });
-  const crudInputs = ref({} as { [key: string]: any });
   const searchProperties = ref([] as EntityPropertie[]);
-  const mainProperties = ref([] as EntityPropertie[]);
-  const crudProperties = ref([] as EntityPropertie[]);
   const searchSlots = ref([] as string[]);
-  const mainSlots = ref([] as string[]);
-  const crudSlots = ref([] as string[]);
+  const searchSelectVals = ref({} as { [key: string]: any });
   const swSlots = ref([] as string[]);
+  const searchApiSlots = ref([] as string[]);
+  const searchParamsSlots = ref([] as string[]);
+  const searchResultFieldSlots = ref([] as string[]);
+  const searchLabelFieldSlots = ref([] as string[]);
+  const searchValueFieldSlots = ref([] as string[]);
+  const searchOptionsSlots = ref([] as string[]);
+  const searchOnChangeSlots = ref([] as string[]);
+  const searchPOptionsSlots = ref([] as string[]);
+  /* 涓昏〃 */
+  const MainEntName = ref('');
+  const mainSelectVals = ref({} as { [key: string]: any });
+  const mainProperties = ref([] as EntityPropertie[]);
+  const mainInputs = ref({} as { [key: string]: any });
+  const mainSlots = ref([] as string[]);
   const mainSwSlots = ref([] as string[]);
-  const crudSwSlots = ref([] as string[]);
   const mainsSwSlots = ref([] as string[]);
   const mainwSwSlots = ref([] as string[]);
-  const crudrSwSlots = ref([] as string[]);
-  const searchSelectVals = ref({} as { [key: string]: any });
-  const mainSelectVals = ref({} as { [key: string]: any });
+  const mainIaSlots = ref([] as string[]);
+  /* 澧炲垹鏀� */
+  const CrudEntName = ref('');
+  const crudInputs = ref({} as { [key: string]: any });
+  const crudProperties = ref([] as EntityPropertie[]);
   const crudSelectVals = ref({} as { [key: string]: any });
+  const crudIsExistVals = ref({} as { [key: string]: any });
+  const crudSlots = ref([] as string[]);
+  const crudSwSlots = ref([] as string[]);
+  const crudrSwSlots = ref([] as string[]);
+  const crudApiSlots = ref([] as string[]);
+  const crudParamsSlots = ref([] as string[]);
+  const crudResultFieldSlots = ref([] as string[]);
+  const crudLabelFieldSlots = ref([] as string[]);
+  const crudValueFieldSlots = ref([] as string[]);
+  const crudOptionsSlots = ref([] as string[]);
+  const crudOnChangeSlots = ref([] as string[]);
+  const crudPOptionsSlots = ref([] as string[]);
+
   const options = ref<SelectTypes['options']>([
     {
       value: 'Input',
@@ -331,16 +428,164 @@
       label: 'Checkbox',
     },
     {
-      value: 'TimePicker',
+      value: 'Upload',
+      label: '鏂囦欢涓婁紶',
+    },
+    {
+      value: 'RangePicker',
       label: '鏃堕棿閫夋嫨鍣�',
     },
     {
       value: 'Switch',
       label: '寮�鍏�',
     },
+    {
+      value: 'PoPSelect',
+      label: '寮瑰嚭閫夋嫨妗�',
+    },
   ]);
-  onMounted(async () => {});
 
+  const isExistOptions = ref<SelectTypes['options']>([
+    {
+      value: 'Y',
+      label: '鏄垽鏂瓨鍦�',
+    },
+    {
+      value: 'N',
+      label: '涓嶆槸鍒ゆ柇瀛樺湪',
+    },
+  ]);
+
+  /**
+   * @description: 瀹炰緥缁勪欢鎸傝浇鏃�
+   * @return {*}
+   */
+  onMounted(() => {
+    if (unref(objParams.value.Update) == '1') {
+      getEntity({
+        sqlcmd: "ID ='" + objParams.value.ID + "'",
+        entityName: 'SYS_LOW_CODE',
+        order: ''
+      }).then((data) => {
+        /* 鏌ヨ鍔犺浇 */
+        var searchForms = JSON.parse(data.Data.Items[0].SEARCH_FORM_JSON);
+        SearchEntName.value = data.Data.Items[0].SEARCH_ASSY_NAME;
+        setFieldsValue({ ASSEMBLY_NAME: data.Data.Items[0].SEARCH_ASSY_NAME });
+        searchForms = searchForms.filter((item) => !item['field'].toString().startsWith(SearchEntName.value) && !item['field'].toString().endsWith('PSelect_0'));
+        for (const i in searchForms) {
+          condAdd();
+            if (searchForms[i]['component'] == 'ApiSelect') {
+              addApiSelectOption(`${SearchEntName.value}${Number(i) + 1}a`, 'search');
+              setFieldsValue({
+                [`ApiSelect${SearchEntName.value}${Number(i) + 1}a`]:
+                  searchForms[i]['componentProps']['api'],
+                [`Params${SearchEntName.value}${Number(i) + 1}a`]: JSON.stringify(
+                  searchForms[i]['componentProps']['params'],
+                ),
+                [`Result${SearchEntName.value}${Number(i) + 1}a`]:
+                  searchForms[i]['componentProps']['resultField'],
+                [`Label${SearchEntName.value}${Number(i) + 1}a`]:
+                  searchForms[i]['componentProps']['labelField'],
+                [`Value${SearchEntName.value}${Number(i) + 1}a`]:
+                  searchForms[i]['componentProps']['valueField'],
+              });
+            }
+            if (searchForms[i]['component'] == 'Select') {
+              addSelectOption(`${SearchEntName.value}${Number(i) + 1}a`, 'search');
+              setFieldsValue({
+                [`XSelect${SearchEntName.value}${Number(i) + 1}a`]: JSON.stringify(
+                  searchForms[i]['componentProps']['options'],
+                ),
+                [`XOnChange${SearchEntName.value}${Number(i) + 1}a`]:
+                  searchForms[i]['componentProps']['onChange'],
+              });
+            }
+            setFieldsValue({
+              [`${SearchEntName.value}${Number(i) + 1}a`]: searchForms[i]['field'],
+              [`InputNumber${Number(i) + 1}`]: searchForms[i]['colProps'].span,
+              [`Switch${Number(i) + 1}`]: searchForms[i]['ifShow'],
+            });
+            objInputs.value[`${SearchEntName.value}${Number(i) + 1}a`] = searchForms[i]['label'];
+            searchSelectVals.value[`${SearchEntName.value}${Number(i) + 1}a`] = searchForms[i]['comp']? searchForms[i]['comp']: searchForms[i]['component'];
+            if(searchForms[i]['comp']){
+              addPopSelectOption(`${SearchEntName.value}${Number(i) + 1}a`, 'search');
+              setFieldsValue({
+                [`PSelect${SearchEntName.value}${Number(i) + 1}a`]: searchForms[i]['entityName'],
+              });
+            }
+        }
+        /* 澧炲垹鏀瑰姞杞� */
+        var crudForms = JSON.parse(data.Data.Items[0].FORM_JSON);
+        CrudEntName.value = data.Data.Items[0].CRUD_ASSY_NAME;
+        setFieldsValueCrud({ crudAssemblyName: data.Data.Items[0].CRUD_ASSY_NAME });
+        crudForms = crudForms.filter((item) => !item['field'].toString().startsWith(CrudEntName.value) && !item['field'].toString().endsWith('PSelect_0'));
+        for (const i in crudForms) {
+          crudCondAdd();
+            if (crudForms[i]['component'] == 'ApiSelect') {
+              addApiSelectOption(`${CrudEntName.value}${Number(i) + 1}a`, 'crud');
+              setFieldsValueCrud({
+                [`ApiSelect${CrudEntName.value}${Number(i) + 1}a`]:
+                  crudForms[i]['componentProps']['api'],
+                [`Params${CrudEntName.value}${Number(i) + 1}a`]: JSON.stringify(
+                  crudForms[i]['componentProps']['params'],
+                ),
+                [`Result${CrudEntName.value}${Number(i) + 1}a`]:
+                  crudForms[i]['componentProps']['resultField'],
+                [`Label${CrudEntName.value}${Number(i) + 1}a`]:
+                  crudForms[i]['componentProps']['labelField'],
+                [`Value${CrudEntName.value}${Number(i) + 1}a`]:
+                  crudForms[i]['componentProps']['valueField'],
+              });
+            }
+            if (crudForms[i]['component'] == 'Select') {
+              addSelectOption(`${CrudEntName.value}${Number(i) + 1}a`, 'crud');
+              setFieldsValueCrud({
+                [`XSelect${CrudEntName.value}${Number(i) + 1}a`]: JSON.stringify(
+                  crudForms[i]['componentProps']['options'],
+                ),
+                [`XOnChange${CrudEntName.value}${Number(i) + 1}a`]:
+                  crudForms[i]['componentProps']['onChange'],
+              });
+            }
+            setFieldsValueCrud({
+              [`${CrudEntName.value}${Number(i) + 1}a`]: crudForms[i]['field'],
+              [`InputNumber${Number(i) + 1}`]: crudForms[i]['colProps'].span,
+              [`Switch${Number(i) + 1}`]: crudForms[i]['show'],
+              [`rSwitch${Number(i) + 1}`]: crudForms[i]['required'],
+            });
+            crudInputs.value[`${CrudEntName.value}${Number(i) + 1}a`] = crudForms[i]['label'];
+            crudSelectVals.value[`${CrudEntName.value}${Number(i) + 1}a`] = crudForms[i]['comp']? crudForms[i]['comp']: crudForms[i]['component'];
+            if(crudForms[i]['comp']){
+              addPopSelectOption(`${CrudEntName.value}${Number(i) + 1}a`, 'crud');
+              setFieldsValueCrud({
+                [`PSelect${CrudEntName.value}${Number(i) + 1}a`]: crudForms[i]['entityName'],
+              });
+            }
+            crudIsExistVals.value[`${CrudEntName.value}${Number(i) + 1}a`] = crudForms[i]['isexist'];
+        }
+        /* 涓昏〃鍔犺浇 */
+        var objs = JSON.parse(data.Data.Items[0].BASE_FORM_JSON);
+        MainEntName.value = data.Data.Items[0].ASSEMBLY_NAME;
+        setFieldsValueMain({ MainAssemblyName: MainEntName.value, BY_ORG:data.Data.Items[0].BY_ORG });
+        for (const i in objs) {
+          mainCondAdd();
+          setFieldsValueMain({
+            [`${MainEntName.value}${Number(i) + 1}a`]: objs[i]['dataIndex'],
+            [`Switch${Number(i) + 1}`]: objs[i]['ifShow'],
+            [`sSwitch${Number(i) + 1}`]: objs[i]['sorter'],
+            [`wSwitch${Number(i) + 1}`]: objs[i]['resizable'],
+            [`InputTextArea${Number(i) + 1}`]: objs[i]['customRender'],
+          });
+          mainInputs.value[`${MainEntName.value}${Number(i) + 1}a`] = objs[i]['title'];
+        }
+      });
+    }
+  });
+
+  /**
+   * @description: 鍏ㄩ儴鎻愪氦
+   * @return {*}
+   */
   async function submitAll() {
     try {
       const [values, crudvalues, mainvalues] = await Promise.all([
@@ -348,34 +593,65 @@
         crudvalidate(),
         validateMainForm(),
       ]);
+
       /* 鏌ヨ鏉′欢Json */
       const Keys = Object.getOwnPropertyNames(values);
       var searchjsons = [];
       var _json = {};
       var _n = 0;
+      let firstField = '';
       for (const k in Keys) {
         console.log(`${k}:${Keys[k]}`);
-        if (!isNullOrEmpty(values[Keys[k]])) {
-          if (Keys[k].toString().startsWith(getFieldsValue().ASSEMBLY_NAME)) {
-            _json['field'] = values[Keys[k]];
-            _json['label'] = objInputs.value[Keys[k]];
-            _json['defaultValue'] = '';
-            _json['component'] = searchSelectVals.value[Keys[k]];
-            _n = _n + 4;
+        if (Keys[k].toString().startsWith(getFieldsValue().ASSEMBLY_NAME)) {
+          firstField = Keys[k];
+          _json['field'] = isNullOrEmpty(values[Keys[k]]) ? '' : values[Keys[k]];
+          _json['label'] = objInputs.value[Keys[k]];
+          _json['defaultValue'] = '';
+          _json['component'] = searchSelectVals.value[Keys[k]];
+          if (searchSelectVals.value[Keys[k]] == 'ApiSelect') {
+            _json['componentProps'] = {
+              api: values[`ApiSelect${Keys[k]}`],
+              params: JSON.parse(values[`Params${Keys[k]}`]),
+              resultField: values[`Result${Keys[k]}`],
+              labelField: values[`Label${Keys[k]}`],
+              valueField: values[`Value${Keys[k]}`],
+            };
           }
-          if (Keys[k].toString().startsWith('InputNumber')) {
-            _json['colProps'] = { span: values[Keys[k]] };
-            _n++;
+          if (searchSelectVals.value[Keys[k]] == 'Select') {
+            _json['componentProps'] = {
+              options: JSON.parse(values[`XSelect${Keys[k]}`]),
+              onChange: values[`XOnChange${Keys[k]}`],
+            };
           }
-          if (Keys[k].toString().startsWith('Switch')) {
-            _json['ifShow'] = values[Keys[k]] as boolean;
-            _n++;
-          }
-          if (!isNullOrEmpty(_json) && _n == 6) {
+          _n = _n + 4;
+        }
+        if (Keys[k].toString().startsWith('InputNumber')) {
+          _json['colProps'] = { span: values[Keys[k]] };
+          _n++;
+        }
+        if (Keys[k].toString().startsWith('Switch')) {
+          _json['ifShow'] = isNullOrUnDef(values[Keys[k]]) ? false : (values[Keys[k]] as boolean);
+          _n++;
+        }
+        if (!isNullOrEmpty(_json) && _n == 6) {
+          //濡傛灉鏄脊鍑洪�夋嫨妗�
+          if (_json['component'] == 'PoPSelect') {
+            _json['component'] = 'Input';
+            _json['comp'] = 'PoPSelect';
+            _json['entityName'] = values[`PSelect${firstField}`];
             searchjsons.push(_json);
             _json = {};
-            _n = 0;
+            _json['field'] = `${firstField}PSelect_0`;
+            _json['label'] = '1';
+            _json['defaultValue'] = values[`PSelect${firstField}`];
+            _json['component'] = 'Input';
+            _json['colProps'] = { span: 4 };
+            _json['ifShow'] = true;
+            _json['colSlot'] = `${firstField}add`;
           }
+          searchjsons.push(_json);
+          _json = {};
+          _n = 0;
         }
       }
       console.log(JSON.stringify(searchjsons));
@@ -386,38 +662,37 @@
       var i = 0;
       for (const k in mKeys) {
         console.log(`${k}:${mKeys[k]}`);
-        if (isNullOrEmpty(mainvalues[mKeys[k]])) {
-          if (
-            mKeys[k].toString().startsWith('Switch') ||
-            mKeys[k].toString().startsWith('sSwitch') ||
-            mKeys[k].toString().startsWith('wSwitch')
-          ) {
-            mainvalues[mKeys[k]] = false;
-          }
+        if (mKeys[k].toString().startsWith(getFieldsValueMain().MainAssemblyName)) {
+          mjson['dataIndex'] = isNullOrEmpty(mainvalues[mKeys[k]]) ? '' : mainvalues[mKeys[k]];
+          mjson['title'] = isNullOrEmpty(mainvalues[mKeys[k]]) ? '' : mainInputs.value[mKeys[k]];
+          i = i + 2;
         }
-        if (!isNullOrEmpty(mainvalues[mKeys[k]])) {
-          if (mKeys[k].toString().startsWith(getFieldsValueMain().MainAssemblyName)) {
-            mjson['dataIndex'] = mainvalues[mKeys[k]];
-            mjson['title'] = mainInputs.value[mKeys[k]];
-            i = i + 2;
-          }
-          if (mKeys[k].toString().startsWith('Switch')) {
-            mjson['ifShow'] = mainvalues[mKeys[k]] as boolean;
-            i++;
-          }
-          if (mKeys[k].toString().startsWith('sSwitch')) {
-            mjson['sorter'] = mainvalues[mKeys[k]] as boolean;
-            i++;
-          }
-          if (mKeys[k].toString().startsWith('wSwitch')) {
-            mjson['resizable'] = mainvalues[mKeys[k]] as boolean;
-            i++;
-          }
-          if (!isNullOrEmpty(mjson) && i == 5) {
-            mjsons.push(mjson);
-            i = 0;
-            mjson = {};
-          }
+        if (mKeys[k].toString().startsWith('Switch')) {
+          mjson['ifShow'] = isNullOrUnDef(mainvalues[mKeys[k]])
+            ? false
+            : (mainvalues[mKeys[k]] as boolean);
+          i++;
+        }
+        if (mKeys[k].toString().startsWith('sSwitch')) {
+          mjson['sorter'] = isNullOrUnDef(mainvalues[mKeys[k]])
+            ? false
+            : (mainvalues[mKeys[k]] as boolean);
+          i++;
+        }
+        if (mKeys[k].toString().startsWith('wSwitch')) {
+          mjson['resizable'] = isNullOrUnDef(mainvalues[mKeys[k]])
+            ? false
+            : (mainvalues[mKeys[k]] as boolean);
+          i++;
+        }
+        if (mKeys[k].toString().startsWith('InputTextArea')) {
+          mjson['customRender'] = isNullOrEmpty(mainvalues[mKeys[k]]) ? '' : mainvalues[mKeys[k]];
+          i++;
+        }
+        if (!isNullOrEmpty(mjson) && i == 6) {
+          mjsons.push(mjson);
+          i = 0;
+          mjson = {};
         }
       }
       console.log(JSON.stringify(mjsons));
@@ -426,44 +701,74 @@
       var cjsons = [];
       var cjson = {};
       var c = 0;
+      let cfirstField = '';
       for (const k in cKeys) {
         console.log(`${k}:${cKeys[k]}`);
-        if (isNullOrEmpty(crudvalues[mKeys[k]])) {
-          if (
-            cKeys[k].toString().startsWith('Switch') ||
-            cKeys[k].toString().startsWith('rSwitch')
-          ) {
-            crudvalues[mKeys[k]] = false;
+        if (cKeys[k].toString().startsWith(getFieldsValueCrud().crudAssemblyName)) {
+          cfirstField = cKeys[k];
+          cjson['field'] = isNullOrEmpty(crudvalues[cKeys[k]]) ? '' : crudvalues[cKeys[k]];
+          cjson['label'] = isNullOrEmpty(crudInputs.value[cKeys[k]])
+            ? ''
+            : crudInputs.value[cKeys[k]];
+          cjson['component'] = crudSelectVals.value[cKeys[k]];
+          cjson['isexist'] = crudIsExistVals.value[cKeys[k]];
+          if (crudSelectVals.value[cKeys[k]] == 'ApiSelect') {
+            cjson['componentProps'] = {
+              api: crudvalues[`ApiSelect${cKeys[k]}`],
+              params: JSON.parse(crudvalues[`Params${cKeys[k]}`]),
+              resultField: crudvalues[`Result${cKeys[k]}`],
+              labelField: crudvalues[`Label${cKeys[k]}`],
+              valueField: crudvalues[`Value${cKeys[k]}`],
+            };
           }
+          if (crudSelectVals.value[cKeys[k]] == 'Select') {
+            cjson['componentProps'] = {
+              options: JSON.parse(crudvalues[`XSelect${cKeys[k]}`]),
+              onChange: crudvalues[`XOnChange${cKeys[k]}`],
+            };
+          }
+          c = c + 3;
         }
-        if (!isNullOrEmpty(crudvalues[cKeys[k]])) {
-          if (cKeys[k].toString().startsWith(getFieldsValueCrud().crudAssemblyName)) {
-            cjson['field'] = crudvalues[cKeys[k]];
-            cjson['label'] = crudInputs.value[cKeys[k]];
-            cjson['component'] = crudSelectVals.value[cKeys[k]];
-            c = c + 3;
-          }
-          if (cKeys[k].toString().startsWith('Switch')) {
-            cjson['show'] = crudvalues[cKeys[k]] as boolean;
-            c++;
-          }
-          if (cKeys[k].toString().startsWith('rSwitch')) {
-            cjson['required'] = crudvalues[cKeys[k]] as boolean;
-            c++;
-          }
-          if (cKeys[k].toString().startsWith('InputNumber')) {
-            cjson['colProps'] = { span: crudvalues[cKeys[k]] };
-            c++;
-          }
-          if (!isNullOrEmpty(cjson) && c == 6) {
+        if (cKeys[k].toString().startsWith('Switch')) {
+          cjson['show'] = isNullOrUnDef(crudvalues[cKeys[k]])
+            ? false
+            : (crudvalues[cKeys[k]] as boolean);
+          c++;
+        }
+        if (cKeys[k].toString().startsWith('rSwitch')) {
+          cjson['required'] = isNullOrUnDef(crudvalues[cKeys[k]])
+            ? false
+            : (crudvalues[cKeys[k]] as boolean);
+          c++;
+        }
+        if (cKeys[k].toString().startsWith('InputNumber')) {
+          cjson['colProps'] = { span: crudvalues[cKeys[k]] };
+          c++;
+        }
+        if (!isNullOrEmpty(cjson) && c == 6) {
+          //濡傛灉鏄脊鍑洪�夋嫨妗�
+          if (cjson['component'] == 'PoPSelect') {
+            cjson['component'] = 'Input';
+            cjson['comp'] = 'PoPSelect';
+            cjson['entityName'] = crudvalues[`PSelect${cfirstField}`];
             cjsons.push(cjson);
-            c = 0;
             cjson = {};
+            cjson['field'] = `${cfirstField}PSelect_0`;
+            cjson['label'] = '1';
+            cjson['defaultValue'] = crudvalues[`PSelect${cfirstField}`];
+            cjson['component'] = 'Input';
+            cjson['colProps'] = { span: 4 };
+            cjson['ifShow'] = true;
+            cjson['colSlot'] = `${cfirstField}add`;
           }
+          cjsons.push(cjson);
+          c = 0;
+          cjson = {};
         }
       }
       console.log(JSON.stringify(cjsons));
       var entity: SYS_LOW_CODE = {
+        ID: objParams.value.ID,
         CREATE_USER: useUserStore().getUserInfo.userId as string,
         UPDATE_USER: useUserStore().getUserInfo.userId as string,
         SEARCH_FORM_JSON: JSON.stringify(searchjsons),
@@ -472,6 +777,7 @@
         ASSEMBLY_NAME: getFieldsValueMain().MainAssemblyName,
         CRUD_ASSY_NAME: getFieldsValueCrud().crudAssemblyName,
         SEARCH_ASSY_NAME: getFieldsValue().ASSEMBLY_NAME,
+        BY_ORG: getFieldsValueMain().BY_ORG,
       };
       SaveEntity(entity, unref(objParams.value.Update) == '1', 'SYS_LOW_CODE').then((action) => {
         if (action.IsSuccessed) {
@@ -493,7 +799,10 @@
   }
 
   function handleEdit(record: Recordable) {}
-  //鐐瑰嚮鎵撳紑鐗╂枡鍒楄〃妗�
+  /**
+   * @description: 鏌ヨ閰嶇疆绫诲悕閫夋嫨鎸夐挳鏂规硶
+   * @return {*}
+   */  
   function handleSelecNew() {
     openNewModal(true, {
       data: 'content',
@@ -501,6 +810,10 @@
     });
   }
 
+  /**
+   * @description: 涓昏〃閰嶇疆绫诲悕閫夋嫨鎸夐挳鏂规硶
+   * @return {*}
+   */  
   function mainSelectAssy() {
     openMainModal(true, {
       data: 'content',
@@ -508,6 +821,10 @@
     });
   }
 
+  /**
+   * @description: 澧炲垹鏀归厤缃被鍚嶉�夋嫨鎸夐挳鏂规硶
+   * @return {*}
+   */  
   function handleSelectCrud() {
     openCrudModal(true, {
       data: 'content',
@@ -515,33 +832,466 @@
     });
   }
 
+  /**
+   * @description: 閫夋嫨绫诲悕寮瑰嚭妗嗚繑鍥炴垚鍔熸柟娉�
+   * @param {*} d
+   * @param {*} u
+   * @return {*}
+   */  
   async function mainAssySuccess(d, u) {
     setFieldsValueMain({
-      MainAssemblyName: d.values.values,
+      MainAssemblyName: d.values['val'],
     });
     var data = await getEntityPropertieList({
-      StartWith: d.values.values,
+      StartWith: d.values['val'],
       Namespace: 'Tiger.Model',
     });
     mainProperties.value = data.items;
+    MainEntName.value = d.values['val'];
   }
 
   async function handleNewSuccess(d, u) {
     setFieldsValue({
-      ASSEMBLY_NAME: d.values.values,
+      ASSEMBLY_NAME: d.values['val'],
     });
     var data = await getEntityPropertieList({
-      StartWith: d.values.values,
+      StartWith: d.values['val'],
       Namespace: 'Tiger.Model',
     });
     searchProperties.value = data.items;
+    SearchEntName.value = d.values['val'];
   }
 
-  function handleCrudSuccess(d, u) {
+  async function handleCrudSuccess(d, u) {
     setFieldsValueCrud({
-      crudAssemblyName: d.values.values,
+      crudAssemblyName: d.values['val'],
     });
+    var data = await getEntityPropertieList({
+      StartWith: d.values['val'],
+      Namespace: 'Tiger.Model',
+    });
+    crudProperties.value = data.items;
+    CrudEntName.value = d.values['val'];
   }
+  /* 閫夋嫨绫诲悕寮瑰嚭妗嗚繑鍥炴垚鍔熸柟娉� End */
+
+  /**
+   * @description: 閰嶇疆瀛楁閫夋嫨鏀瑰彉鍚庝簨浠舵柟娉�
+   * @param {*} value
+   * @param {*} option
+   * @param {*} field
+   * @return {*}
+   */  
+  function change(value, option, field) {
+    console.log(value, option, field);
+    objInputs.value[field] = option.label;
+  }
+  function mainChange(value, option, field) {
+    console.log(value, option, field);
+    mainInputs.value[field] = option.label;
+  }
+  function crudChange(value, option, field) {
+    console.log(value, option, field);
+    crudInputs.value[field] = option.label;
+  }
+  /* 閰嶇疆瀛楁閫夋嫨鏀瑰彉鍚庝簨浠舵柟娉� End */
+
+  /**
+   * @description: 鏌ヨ缁勪欢閫夋嫨浜嬩欢
+   * @param {*} value
+   * @param {*} option
+   * @param {*} field
+   * @return {*}
+   */  
+  function searchOnChange(value, option, field) {
+    console.log(value, option, field);
+    if (value == 'ApiSelect') {
+      addApiSelectOption(field, 'search');
+      delSelectOption(field, 'search');
+      delPSelectOption(field, 'search');
+    } else {
+      delApiSelectOption(field, 'search');
+    }
+    if (value == 'Select') {
+      addSelectOption(field, 'search');
+      delApiSelectOption(field, 'search');
+      delPSelectOption(field, 'search');
+    } else {
+      delSelectOption(field, 'search');
+    }
+    if (value == 'PoPSelect') {
+      addPopSelectOption(field, 'search');
+      delApiSelectOption(field, 'search');
+      delSelectOption(field, 'search');
+    } else {
+      delPSelectOption(field, 'search');
+    }
+  }
+  
+  /**
+   * @description: 澧炲垹鏀圭粍浠堕�夋嫨浜嬩欢
+   * @param {*} value
+   * @param {*} option
+   * @param {*} field
+   * @return {*}
+   */  
+  function componentChange(value, option, field) {
+    console.log(value, option, field);
+    if (value == 'ApiSelect') {
+      addApiSelectOption(field, 'crud');
+      delSelectOption(field, 'crud');
+      delPSelectOption(field, 'crud');
+    } else {
+      delApiSelectOption(field, 'crud');
+    }
+    if (value == 'Select') {
+      addSelectOption(field, 'crud');
+      delApiSelectOption(field, 'crud');
+      delPSelectOption(field, 'crud');
+    } else {
+      delSelectOption(field, 'crud');
+    }
+    if (value == 'PoPSelect') {
+      addPopSelectOption(field, 'crud');
+      delApiSelectOption(field, 'crud');
+      delSelectOption(field, 'crud');
+    } else {
+      delPSelectOption(field, 'crud');
+    }
+  }
+
+  /**
+   * @description: 閫夋嫨浜咥piSelect缁勪欢閫夐」鍚庯紝澧炲姞鐩稿簲鐨勮緭鍏ラ」
+   * @param {*} field
+   * @param {*} type
+   * @return {*}
+   */  
+  function addApiSelectOption(field: string, type: string) {
+    const appendData: FormSchema[] = [
+      {
+        field: `ApiSelect${field}`,
+        component: 'Input',
+        label: `api`,
+        slot: `Api${field}`,
+        colProps: { span: 5 },
+      },
+      {
+        field: `Params${field}`,
+        component: 'Input',
+        label: 'params',
+        slot: `Params_${field}`,
+        colProps: { span: 6 },
+      },
+      {
+        field: `Result${field}`,
+        component: 'Input',
+        label: 'resultField',
+        slot: `ResultField${field}`,
+        colProps: { span: 5 },
+      },
+      {
+        field: `Label${field}`,
+        component: 'Input',
+        label: 'labelField',
+        slot: `LabelField${field}`,
+        colProps: { span: 4 },
+      },
+      {
+        field: `Value${field}`,
+        component: 'Input',
+        label: 'valueField',
+        slot: `ValueField${field}`,
+        colProps: { span: 4 },
+      },
+    ];
+    switch (type) {
+      case 'search':
+        appendSchemaByField(appendData, '');
+        searchSlotsPush(field);
+        break;
+      case 'crud':
+        appendSchemaByFieldCrud(appendData, '');
+        crudSlotsPush(field);
+        break;
+    }
+  }
+
+  /**
+   * @description: 澧炲垹鏀笰piSelect鎻掓Ы鏁版嵁娣诲姞
+   * @param {*} field
+   * @return {*}
+   */  
+  function crudSlotsPush(field: string) {
+    crudApiSlots.value.push(`Api${field}`);
+    crudParamsSlots.value.push(`Params_${field}`);
+    crudResultFieldSlots.value.push(`ResultField${field}`);
+    crudLabelFieldSlots.value.push(`LabelField${field}`);
+    crudValueFieldSlots.value.push(`ValueField${field}`);
+  }
+  
+  /**
+   * @description: 鏌ヨApiSelect鎻掓Ы鏁版嵁娣诲姞
+   * @param {*} field
+   * @return {*}
+   */  
+  function searchSlotsPush(field: string) {
+    searchApiSlots.value.push(`Api${field}`);
+    searchParamsSlots.value.push(`Params_${field}`);
+    searchResultFieldSlots.value.push(`ResultField${field}`);
+    searchLabelFieldSlots.value.push(`LabelField${field}`);
+    searchValueFieldSlots.value.push(`ValueField${field}`);
+  }
+
+  /**
+   * @description: 鍙栨秷ApiSelect缁勪欢鍚庡垹闄ゆ坊鍔犵殑杈撳叆椤�
+   * @param {*} field
+   * @param {*} type
+   * @return {*}
+   */  
+  function delApiSelectOption(field: string, type: string) {
+    const removeData: string[] = [
+      `ApiSelect${field}`,
+      `Params${field}`,
+      `Result${field}`,
+      `Label${field}`,
+      `Value${field}`,
+    ];
+    switch (type) {
+      case 'search':
+        //if (!isNullOrEmpty(getFieldsValue()[`ApiSelect${field}`])) {
+        removeSchemaByField(removeData);
+        searchSlotsSplice(field);
+        //}
+        break;
+      case 'crud':
+        //if (!isNullOrEmpty(getFieldsValueCrud()[`ApiSelect${field}`])) {
+        removeSchemaByFieldCrud(removeData);
+        crudSlotsSplice(field);
+        //}
+        break;
+    }
+  }
+
+  /**
+   * @description: 澧炲垹鏀规彃妲藉垹闄ら」
+   * @param {*} field
+   * @return {*}
+   */  
+  function crudSlotsSplice(field: string) {
+    crudApiSlots.value = crudApiSlots.value.filter((item) => item !== `Api${field}`);
+    crudParamsSlots.value = crudParamsSlots.value.filter((item) => item !== `Params_${field}`);
+    crudResultFieldSlots.value = crudResultFieldSlots.value.filter(
+      (item) => item !== `ResultField${field}`,
+    );
+    crudLabelFieldSlots.value = crudLabelFieldSlots.value.filter(
+      (item) => item !== `LabelField${field}`,
+    );
+    crudValueFieldSlots.value = crudValueFieldSlots.value.filter(
+      (item) => item !== `ValueField${field}`,
+    );
+  }
+  
+  /**
+   * @description: 澧炲垹鏀规彃妲藉垹闄ら」
+   * @param {*} field
+   * @return {*}
+   */  
+  function searchSlotsSplice(field: string) {
+    searchApiSlots.value = searchApiSlots.value.filter((item) => item !== `Api${field}`);
+    searchParamsSlots.value = searchParamsSlots.value.filter((item) => item !== `Params_${field}`);
+    searchResultFieldSlots.value = searchResultFieldSlots.value.filter(
+      (item) => item !== `ResultField${field}`,
+    );
+    searchLabelFieldSlots.value = searchLabelFieldSlots.value.filter(
+      (item) => item !== `LabelField${field}`,
+    );
+    searchValueFieldSlots.value = searchValueFieldSlots.value.filter(
+      (item) => item !== `ValueField${field}`,
+    );
+  }
+
+  /**
+   * @description: 涓嬫媺妗哠elect娣诲姞閫夐」
+   * @return {*}
+   */
+  function addSelectOption(field: string, type: string) {
+    const appendData: FormSchema[] = [
+      {
+        field: `XSelect${field}`,
+        component: 'Input',
+        label: `options`,
+        slot: `Select_${field}`,
+        colProps: { span: 12 },
+      },
+      {
+        field: `XOnChange${field}`,
+        component: 'Input',
+        label: 'onChange',
+        slot: `OnChange_${field}`,
+        colProps: { span: 12 },
+      },
+    ];
+    switch (type) {
+      case 'search':
+        appendSchemaByField(appendData, '');
+        searchSelSlotsPush(field);
+        break;
+      case 'crud':
+        appendSchemaByFieldCrud(appendData, '');
+        crudSelSlotsPush(field);
+        break;
+    }
+  }
+
+  /**
+   * @description: 鍙栨秷Select缁勪欢鍚庡垹闄ゆ坊鍔犵殑杈撳叆椤�
+   * @param {*} field
+   * @param {*} type
+   * @return {*}
+   */  
+  function delSelectOption(field: string, type: string) {
+    const removeData: string[] = [`XSelect${field}`, `XOnChange${field}`];
+    switch (type) {
+      case 'search':
+        //if (!isNullOrEmpty(getFieldsValue()[`XSelect${field}`])) {
+        removeSchemaByField(removeData);
+        searchSelSlotsSplice(field);
+        //}
+        break;
+      case 'crud':
+        //if (!isNullOrEmpty(getFieldsValueCrud()[`XSelect${field}`])) {
+        removeSchemaByFieldCrud(removeData);
+        crudSelSlotsSplice(field);
+        //}
+        break;
+    }
+  }
+
+  /**
+   * @description: 鏌ヨSelect鎻掓Ы鏁版嵁娣诲姞
+   * @param {*} field
+   * @return {*}
+   */  
+  function searchSelSlotsPush(field: string) {
+    searchOptionsSlots.value.push(`Select_${field}`);
+    searchOptionsSlots.value.push(`OnChange_${field}`);
+  }
+
+  /**
+   * @description: 鏌ヨ鎻掓Ы鍒犻櫎椤�
+   * @param {*} field
+   * @return {*}
+   */  
+  function searchSelSlotsSplice(field: string) {
+    searchOptionsSlots.value = searchOptionsSlots.value.filter(
+      (item) => item !== `Select_${field}`,
+    );
+    searchOptionsSlots.value = searchOptionsSlots.value.filter(
+      (item) => item !== `OnChange_${field}`,
+    );
+  }
+
+  /**
+   * @description: 澧炲垹鏀筍elect鎻掓Ы鏁版嵁娣诲姞
+   * @param {*} field
+   * @return {*}
+   */  
+  function crudSelSlotsPush(field: string) {
+    crudOptionsSlots.value.push(`Select_${field}`);
+    crudOnChangeSlots.value.push(`OnChange_${field}`);
+  }
+
+  /**
+   * @description: 澧炲垹鏀规彃妲藉垹闄ら」
+   * @return {*}
+   */
+  function crudSelSlotsSplice(field: string) {
+    crudOptionsSlots.value = crudOptionsSlots.value.filter((item) => item !== `Select_${field}`);
+    crudOnChangeSlots.value = crudOnChangeSlots.value.filter(
+      (item) => item !== `OnChange_${field}`,
+    );
+  }
+
+  /**
+   * @description: 寮瑰嚭閫夋嫨妗哖opSelect娣诲姞閫夐」
+   * @param {*} field
+   * @param {*} type
+   * @return {*}
+   */  
+  function addPopSelectOption(field: string, type: string) {
+    const appendData: FormSchema[] = [
+      {
+        field: `PSelect${field}`,
+        component: 'Input',
+        label: `defaultValue`,
+        slot: `PSelect_${field}`,
+        colProps: { span: 24 },
+      },
+    ];
+    switch (type) {
+      case 'search':
+        appendSchemaByField(appendData, '');
+        searchPSelSlotsPush(field);
+        break;
+      case 'crud':
+        appendSchemaByFieldCrud(appendData, '');
+        crudPSelSlotsPush(field);
+        break;
+    }
+  }
+
+  /**
+   * @description: 鏌ヨPopSelect鎻掓Ы鏁版嵁娣诲姞
+   * @param {*} field
+   * @return {*}
+   */  
+  function searchPSelSlotsPush(field: string) {
+    searchPOptionsSlots.value.push(`PSelect_${field}`);
+  }
+
+  /**
+   * @description: 澧炲垹鏀筆opSelect鎻掓Ы鏁版嵁娣诲姞
+   * @param {*} field
+   * @return {*}
+   */  
+  function crudPSelSlotsPush(field: string) {
+    crudPOptionsSlots.value.push(`PSelect_${field}`);
+  }
+
+  function delPSelectOption(field: string, type: string) {
+    const removeData: string[] = [`PSelect${field}`];
+    switch (type) {
+      case 'search':
+        removeSchemaByField(removeData);
+        searchPSelSlotsSplice(field);
+        break;
+      case 'crud':
+        removeSchemaByFieldCrud(removeData);
+        crudPSelSlotsSplice(field);
+        break;
+    }
+  }
+
+  /**
+   * @description: 鏌ヨ鎻掓Ы鍒犻櫎椤�
+   * @param {*} field
+   * @return {*}
+   */  
+  function searchPSelSlotsSplice(field: string) {
+    searchPOptionsSlots.value = searchPOptionsSlots.value.filter(
+      (item) => item !== `PSelect_${field}`,
+    );
+  }
+
+  /**
+   * @description: 澧炲垹鏀规彃妲藉垹闄ら」
+   * @param {*} field
+   * @return {*}
+   */  
+  function crudPSelSlotsSplice(field: string) {
+    crudPOptionsSlots.value = crudPOptionsSlots.value.filter((item) => item !== `PSelect_${field}`);
+  }
+
   const n = ref(1);
   const m = ref(1);
   const j = ref(1);
@@ -552,10 +1302,10 @@
     appendSchemaByField(
       [
         {
-          field: `${getFieldsValue().ASSEMBLY_NAME}${n.value}a`,
+          field: `${SearchEntName.value}${n.value}a`,
           component: 'InputGroup',
           label: '瀛楁' + n.value,
-          // required: true,
+          //required: true,
           slot: 'fac' + n.value,
           colProps: { span: 14 },
         },
@@ -584,32 +1334,38 @@
     );
     searchSlots.value.push('fac' + n.value);
     swSlots.value.push(`sw${n.value}`);
-    objInputs.value[`${getFieldsValue().ASSEMBLY_NAME}${n.value}a`] = '';
-    searchSelectVals.value[`${getFieldsValue().ASSEMBLY_NAME}${n.value}a`] = '';
+    objInputs.value[`${SearchEntName.value}${n.value}a`] = '';
+    searchSelectVals.value[`${SearchEntName.value}${n.value}a`] = '';
     console.log(searchSlots.value);
     n.value++;
   }
 
   function del(field) {
     removeSchemaByField([
-      `${getFieldsValue().ASSEMBLY_NAME}${field}a`,
+      `${SearchEntName.value}${field}a`,
       `Switch${field}`,
       `InputNumber${field}`,
       `${field}`,
     ]);
-    swSlots.value.splice(swSlots.value.indexOf(`sw${field}`), 1);
-    searchSlots.value.splice(searchSlots.value.indexOf(`fac${field}`), 1);
+    swSlots.value = swSlots.value.filter((item) => item !== `sw${field}`);
+    searchSlots.value = searchSlots.value.filter((item) => item !== `fac${field}`);
     if (searchSlots.value.length == 0) {
       n.value = 1;
     }
+    delApiSelectOption(`${CrudEntName.value}${field}a`, 'search');
+    delSelectOption(`${CrudEntName.value}${field}a`, 'search');
+    delPSelectOption(`${CrudEntName.value}${field}a`, 'search');
   }
 
-  /* 涓昏〃閰嶇疆 */
+  /**
+   * @description: 涓昏〃閰嶇疆
+   * @return {*}
+   */  
   function mainCondAdd() {
     appendSchemaByFieldMain(
       [
         {
-          field: `${getFieldsValueMain().MainAssemblyName}${m.value}a`,
+          field: `${MainEntName.value}${m.value}a`,
           component: 'InputGroup',
           label: '瀛楁' + m.value,
           // required: true,
@@ -621,28 +1377,33 @@
           component: 'Switch',
           label: '鏄惁鏄剧ず',
           slot: `mainSw${m.value}`,
-          colProps: { span: 3 },
+          colProps: { span: 4 },
         },
         {
           field: `sSwitch${m.value}`,
           component: 'Switch',
           label: '鏄惁鎺掑簭',
           slot: `mainsSw${m.value}`,
-          colProps: { span: 3 },
+          colProps: { span: 4 },
         },
         {
           field: `wSwitch${m.value}`,
           component: 'Switch',
           label: '鏄惁鍙皟瀹�',
           slot: `mainwSw${m.value}`,
-          colProps: { span: 3 },
+          colProps: { span: 4 },
         },
-        // {
-        //   field: `InputNumber${m.value}`,
-        //   component: 'InputNumber',
-        //   label: '鍒楀',
-        //   colProps: { span: 3 },
-        // },
+        {
+          field: `InputTextArea${m.value}`,
+          component: 'InputTextArea',
+          label: '鑷畾涔夋覆鏌�',
+          slot: `mainwIa${m.value}`,
+          colProps: { span: 21 },
+          componentProps: {
+            placeholder: '璇风紪杈戞覆鏌撲唬鐮�',
+            rows: 4,
+          },
+        },
         {
           field: `${m.value}`,
           component: 'Input',
@@ -657,36 +1418,41 @@
     mainSwSlots.value.push(`mainSw${m.value}`);
     mainsSwSlots.value.push(`mainsSw${m.value}`);
     mainwSwSlots.value.push(`mainwSw${m.value}`);
-    mainInputs.value[`${getFieldsValueMain().MainAssemblyName}${m.value}a`] = '';
-    mainSelectVals.value[`${getFieldsValueMain().MainAssemblyName}${m.value}a`] = '';
+    mainIaSlots.value.push(`mainwIa${m.value}`);
+    mainInputs.value[`${MainEntName.value}${m.value}a`] = '';
+    mainSelectVals.value[`${MainEntName.value}${m.value}a`] = '';
     console.log(mainSlots.value);
     m.value++;
   }
 
   function mainDel(field) {
     removeSchemaByFieldMain([
-      `${getFieldsValueMain().MainAssemblyName}${field}a`,
+      `${MainEntName.value}${field}a`,
       `Switch${field}`,
       `sSwitch${field}`,
       `wSwitch${field}`,
-      `InputNumber${field}`,
+      `InputTextArea${field}`,
       `${field}`,
     ]);
-    mainSwSlots.value.splice(mainSwSlots.value.indexOf(`mainSw${field}`), 1);
-    mainsSwSlots.value.splice(mainsSwSlots.value.indexOf(`mainsSw${field}`), 1);
-    mainwSwSlots.value.splice(mainwSwSlots.value.indexOf(`mainwSw${field}`), 1);
-    mainSlots.value.splice(mainSlots.value.indexOf(`mainfac${field}`), 1);
+    mainSwSlots.value = mainSwSlots.value.filter((item) => item !== `mainSw${field}`);
+    mainsSwSlots.value = mainsSwSlots.value.filter((item) => item !== `mainsSw${field}`);
+    mainwSwSlots.value = mainwSwSlots.value.filter((item) => item !== `mainwSw${field}`);
+    mainIaSlots.value = mainIaSlots.value.filter((item) => item !== `mainwIa${field}`);
+    mainSlots.value = mainSlots.value.filter((item) => item !== `mainfac${field}`);
     if (mainSlots.value.length == 0) {
       m.value = 1;
     }
   }
 
-  /* 澧炲垹鏀归厤缃� */
+  /**
+   * @description: 澧炲垹鏀归厤缃�
+   * @return {*}
+   */  
   function crudCondAdd() {
     appendSchemaByFieldCrud(
       [
         {
-          field: `${getFieldsValueCrud().crudAssemblyName}${j.value}a`,
+          field: `${CrudEntName.value}${j.value}a`,
           component: 'InputGroup',
           label: '瀛楁' + j.value,
           // required: true,
@@ -726,26 +1492,29 @@
     crudSlots.value.push('crudfac' + j.value);
     crudSwSlots.value.push(`crudSw${j.value}`);
     crudrSwSlots.value.push(`crudrSw${j.value}`);
-    crudInputs.value[`${getFieldsValueCrud().crudAssemblyName}${j.value}a`] = '';
-    crudSelectVals.value[`${getFieldsValueCrud().crudAssemblyName}${j.value}a`] = '';
+    crudInputs.value[`${CrudEntName.value}${j.value}a`] = '';
+    crudSelectVals.value[`${CrudEntName.value}${j.value}a`] = '';
     console.log(crudSlots.value);
     j.value++;
   }
 
   function crudDel(field) {
     removeSchemaByFieldCrud([
-      `${getFieldsValueCrud().crudAssemblyName}${field}a`,
+      `${CrudEntName.value}${field}a`,
       `Switch${field}`,
       `rSwitch${field}`,
       `InputNumber${field}`,
       `${field}`,
     ]);
-    crudSwSlots.value.splice(crudSwSlots.value.indexOf(`crudSw${field}`), 1);
-    crudrSwSlots.value.splice(crudrSwSlots.value.indexOf(`crudrSw${field}`), 1);
-    crudSlots.value.splice(crudSlots.value.indexOf(`crudfac${field}`), 1);
+    crudSwSlots.value = crudSwSlots.value.filter((item) => item !== `crudSw${field}`);
+    crudrSwSlots.value = crudrSwSlots.value.filter((item) => item !== `crudrSw${field}`);
+    crudSlots.value = crudSlots.value.filter((item) => item !== `crudfac${field}`);
     if (crudSlots.value.length == 0) {
       j.value = 1;
     }
+    delApiSelectOption(`${CrudEntName.value}${field}a`, 'crud');
+    delSelectOption(`${CrudEntName.value}${field}a`, 'crud');
+    delPSelectOption(`${CrudEntName.value}${field}a`, 'crud');
   }
 
   function goBack() {
@@ -758,3 +1527,5 @@
     padding-bottom: 48px;
   }
 </style>
+: { values: any[]; }: any: { values: any[]; }: any: { values: any[]; }: any: any: any: any: any:
+any: any

--
Gitblit v1.9.3