Ben Lin
2024-06-18 ebbd788fbb2c0b45d4473798efc57eec8ba74a25
src/views/tigerprojects/system/lowcode/normal/index.vue
@@ -4,7 +4,7 @@
 * @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>
@@ -83,6 +83,7 @@
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();
@@ -143,6 +144,7 @@
        entityName: objParams.value.ID,
        formJson: _crudFormSchema.value,
        crudColSlots,
        isExistSql: isExistSql.value,
      });
      break;
  }
@@ -229,6 +231,9 @@
      _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;
@@ -248,17 +253,31 @@
  _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;
@@ -277,7 +296,13 @@
  reload();
}
/* 各表单内弹出选择框选择成功后方法 */
/**
 * @description: 各表单内弹出选择框选择成功后方法
 * @param {*} d
 * @param {*} u
 * @param {*} item
 * @return {*}
 */
function handleEntSuccess(d, u, item) {
  var values = GetSelectSuccess(d, u, cType.value);
  selectVals.value = values; //保存弹出框选择的结果
@@ -286,7 +311,11 @@
  useFormData.value[item][1].setFieldsValue(_val);
}
/* 打开自定义模态框 */
/**
 * @description: 打开自定义模态框
 * @param {*} item
 * @return {*}
 */
function handleCustClick(item) {
  OpenCustModal(
    useModalData.value[item][1].openModal, //带入openModal方法