| | |
| | | * @Author: Ben Lin |
| | | * @version: |
| | | * @Date: 2024-05-30 22:00:44 |
| | | * @LastEditors: your name |
| | | * @LastEditTime: 2024-06-13 14:21:16 |
| | | * @LastEditors: Ben Lin |
| | | * @LastEditTime: 2024-06-18 11:37:37 |
| | | --> |
| | | <!-- eslint-disable prettier/prettier --> |
| | | <template> |
| | |
| | | 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> |
| | | </template> |
| | |
| | | import { useModal } from '/@/components/Modal'; |
| | | 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; |
| | |
| | | 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[]); |
| | |
| | | { |
| | | value: 'PoPSelect', |
| | | label: '弹出选择框', |
| | | }, |
| | | ]); |
| | | |
| | | const isExistOptions = ref<SelectTypes['options']>([ |
| | | { |
| | | value: 'Y', |
| | | label: '是判断存在', |
| | | }, |
| | | { |
| | | value: 'N', |
| | | label: '不是判断存在', |
| | | }, |
| | | ]); |
| | | |
| | |
| | | [`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); |
| | |
| | | _n++; |
| | | } |
| | | if (Keys[k].toString().startsWith('Switch')) { |
| | | _json['ifShow'] = isNullOrEmpty(values[Keys[k]]) ? false : (values[Keys[k]] as boolean); |
| | | _json['ifShow'] = isNullOrUnDef(values[Keys[k]]) ? false : (values[Keys[k]] as boolean); |
| | | _n++; |
| | | } |
| | | if (!isNullOrEmpty(_json) && _n == 6) { |
| | |
| | | i = i + 2; |
| | | } |
| | | if (mKeys[k].toString().startsWith('Switch')) { |
| | | mjson['ifShow'] = isNullOrEmpty(mainvalues[mKeys[k]]) |
| | | mjson['ifShow'] = isNullOrUnDef(mainvalues[mKeys[k]]) |
| | | ? false |
| | | : (mainvalues[mKeys[k]] as boolean); |
| | | i++; |
| | | } |
| | | if (mKeys[k].toString().startsWith('sSwitch')) { |
| | | mjson['sorter'] = isNullOrEmpty(mainvalues[mKeys[k]]) |
| | | mjson['sorter'] = isNullOrUnDef(mainvalues[mKeys[k]]) |
| | | ? false |
| | | : (mainvalues[mKeys[k]] as boolean); |
| | | i++; |
| | | } |
| | | if (mKeys[k].toString().startsWith('wSwitch')) { |
| | | mjson['resizable'] = isNullOrEmpty(mainvalues[mKeys[k]]) |
| | | mjson['resizable'] = isNullOrUnDef(mainvalues[mKeys[k]]) |
| | | ? false |
| | | : (mainvalues[mKeys[k]] as boolean); |
| | | i++; |
| | |
| | | ? '' |
| | | : 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]}`], |
| | |
| | | c = c + 3; |
| | | } |
| | | if (cKeys[k].toString().startsWith('Switch')) { |
| | | cjson['show'] = isNullOrEmpty(crudvalues[cKeys[k]]) |
| | | cjson['show'] = isNullOrUnDef(crudvalues[cKeys[k]]) |
| | | ? false |
| | | : (crudvalues[cKeys[k]] as boolean); |
| | | c++; |
| | | } |
| | | if (cKeys[k].toString().startsWith('rSwitch')) { |
| | | cjson['required'] = isNullOrEmpty(crudvalues[cKeys[k]]) |
| | | cjson['required'] = isNullOrUnDef(crudvalues[cKeys[k]]) |
| | | ? false |
| | | : (crudvalues[cKeys[k]] as boolean); |
| | | c++; |