| | |
| | | * @version: |
| | | * @Date: 2024-05-30 13:28:20 |
| | | * @LastEditors: your name |
| | | * @LastEditTime: 2024-06-14 11:21:25 |
| | | * @LastEditTime: 2024-06-16 00:41:25 |
| | | --> |
| | | <template> |
| | | <div> |
| | |
| | | const cType = ref(''); |
| | | const dtlSlots = ref([] as any[]); |
| | | const selectVals = ref({}); |
| | | const isExistSql = ref(''); |
| | | |
| | | const [registerCust, { openModal: openCustomModal, closeModal }] = useModal(); |
| | | const [registerItemAdd, { openModal: openItemModal }] = useModal(); |
| | |
| | | entityName: objParams.value.ID, |
| | | formJson: _crudFormSchema.value, |
| | | crudColSlots, |
| | | isExistSql: isExistSql.value, |
| | | }); |
| | | break; |
| | | } |
| | |
| | | _cruds[i].componentProps.maxNumber = 1; |
| | | _cruds[i].rules = [{ required: true, message: '请选择上传文件' }]; |
| | | } |
| | | if (_cruds[i].isexist == 'Y') { |
| | | isExistSql.value = _cruds[i].field; |
| | | } |
| | | onChangeConfig(_cruds[i]); |
| | | } |
| | | _crudFormSchema.value = _cruds; |
| | |
| | | _columns.value = objs; |
| | | }); |
| | | |
| | | /* 弹出选择框选择成功后事件 */ |
| | | /** |
| | | * @description: 弹出选择框选择成功后事件 |
| | | * @param {*} d |
| | | * @param {*} u |
| | | * @param {*} item |
| | | * @return {*} |
| | | */ |
| | | function handleItemSuccess(d, u, item) { |
| | | getForm().setFieldsValue(GetSelectSuccess(d, u, getForm().getFieldsValue()[`${item.replace(/form-/, '').replace(/add/, '')}PSelect_0`])); |
| | | } |
| | | |
| | | /* 弹出选择框 */ |
| | | /** |
| | | * @description: 弹出选择框 |
| | | * @param {*} item |
| | | * @return {*} |
| | | */ |
| | | function handleSelectItem(item) { |
| | | OpenSelectItem(openItemModal, getForm().getFieldsValue()[`${item.replace(/form-/, '').replace(/add/, '')}PSelect_0`]); |
| | | } |
| | | |
| | | /* Select 自定义onChange方法 */ |
| | | /** |
| | | * @description: Select 自定义onChange方法 |
| | | * @param {*} obj |
| | | * @return {*} |
| | | */ |
| | | function onChangeConfig(obj: any) { |
| | | if (obj.component == 'Select') { |
| | | var options = obj.componentProps.options; |
| | |
| | | reload(); |
| | | } |
| | | |
| | | /* 各表单内弹出选择框选择成功后方法 */ |
| | | /** |
| | | * @description: 各表单内弹出选择框选择成功后方法 |
| | | * @param {*} d |
| | | * @param {*} u |
| | | * @param {*} item |
| | | * @return {*} |
| | | */ |
| | | function handleEntSuccess(d, u, item) { |
| | | var values = GetSelectSuccess(d, u, cType.value); |
| | | selectVals.value = values; //保存弹出框选择的结果 |
| | |
| | | useFormData.value[item][1].setFieldsValue(_val); |
| | | } |
| | | |
| | | /* 打开自定义模态框 */ |
| | | /** |
| | | * @description: 打开自定义模态框 |
| | | * @param {*} item |
| | | * @return {*} |
| | | */ |
| | | function handleCustClick(item) { |
| | | OpenCustModal( |
| | | useModalData.value[item][1].openModal, //带入openModal方法 |