| | |
| | | * @version: |
| | | * @Date: 2024-06-18 15:09:48 |
| | | * @LastEditors: Ben Lin |
| | | * @LastEditTime: 2024-07-29 21:26:39 |
| | | * @LastEditTime: 2024-08-03 10:09:25 |
| | | --> |
| | | <template> |
| | | <PageWrapper |
| | |
| | | </PageWrapper> |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import { Ref, h, nextTick, onMounted, provide, reactive, ref, unref } from 'vue'; |
| | | import { Ref, nextTick, onMounted, provide, ref, unref } from 'vue'; |
| | | import { Card } from 'ant-design-vue'; |
| | | import { PageWrapper } from '/@/components/Page'; |
| | | import baseForm from '../baseForm.vue'; |
| | |
| | | import { useGlobSetting } from '/@/hooks/setting'; |
| | | import { useRoute, useRouter } from 'vue-router'; |
| | | import CustModal from '/@/views/components/CustModal.vue'; |
| | | import { BasicForm, useForm } from '/@/components/Form/index'; |
| | | import { BasicForm } from '/@/components/Form/index'; |
| | | import { custOnChange, OpenCustModal } from '../../data'; |
| | | import { useModal } from '/@/components/Modal'; |
| | | import { useLocale } from '/@/locales/useLocale'; |
| | |
| | | import { useMultipleTabStore } from '/@/store/modules/multipleTab'; |
| | | import { useTabs } from '/@/hooks/web/useTabs'; |
| | | import { buildUUID } from '/@/utils/uuid'; |
| | | import { isNullOrEmpty, isNullOrUnDef } from '/@/utils/is'; |
| | | import { isNullOrUnDef } from '/@/utils/is'; |
| | | import { useI18n } from '/@/hooks/web/useI18n'; |
| | | import { isFunction } from 'xe-utils'; |
| | | import Editdtl from './editdtl.vue'; |
| | |
| | | const titleInfo = ref({}); //getTitle(objParams.value.Name); |
| | | const isAllUpdate = ref(objParams.value.CODE != '0'); |
| | | const globSetting = useGlobSetting(); |
| | | const formSchemas = ref({}); //弹出框或高级页面多表单结构 |
| | | const colSlots = ref<any>(objParams.value.colSlots); |
| | | const useModalData = ref({}); //表单中插槽渲染按钮打开模态框useModal方法 |
| | | const useFormData = ref({}); |
| | | const useTableData = ref({}); |
| | |
| | | if (!isNullOrUnDef(custImport.value)) { |
| | | const [{ GetHomeUrl }] = custImport.value['default'](); |
| | | // 本例的效果时点击返回始终跳转到账号列表页,实际应用时可返回上一页 |
| | | go(GetHomeUrl(entityName.value)); |
| | | go(GetHomeUrl({ colSlots: colSlots.value })); |
| | | } |
| | | } |
| | | |
| | |
| | | const currTableName = ref(''); |
| | | const currRecordId = ref(''); |
| | | /** |
| | | * @description: 打开弹框 |
| | | * @description: 表格内打开弹框事件 |
| | | * @param {*} d |
| | | * @return {*} |
| | | */ |
| | |
| | | } |
| | | |
| | | /** |
| | | * @description: |
| | | * @description: 表格内打开弹框事件返回 |
| | | * @param {*} d |
| | | * @param {*} u |
| | | * @return {*} |
| | | */ |
| | | function handleCustSuccess(d, u) { |
| | | let currRecord = {}; |
| | | const _data = data.value[currTableName.value].map((x) => { |
| | | if (x.ID == currRecordId.value) { |
| | | x.VAR_VALUE = d.values.val; |
| | | currRecord = x; |
| | | } |
| | | return x; |
| | | }); |
| | | const [{ CustEditEnd }] = custImport.value['default'](); |
| | | data.value[currTableName.value] = []; |
| | | useTables.value[currTableName.value][1].setProps({ |
| | | dataSource: [], |
| | |
| | | dataSource: data.value[currTableName.value], |
| | | }); |
| | | useTables.value[currTableName.value][1].reload(); |
| | | /* 单元格编辑完成后如果有自定义方法,就调用 */ |
| | | if(CustEditEnd && isFunction(CustEditEnd)){ |
| | | CustEditEnd({record:currRecord},currTableName.value, useTables.value, data); |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | where = `${d['code']} in (${data.value[d['keyName']].map((value) => `'${value[d['code']]}'`).join(',')})`; |
| | | } |
| | | /* 如果高级表单中关联的是ID(IsID == true),则不用初始化ID */ |
| | | if (!objParams.value['IsID']) { |
| | | //if (!objParams.value['IsID']) { |
| | | data.value[d['name']].map((item) => { |
| | | item.ID = buildUUID(); |
| | | }); |
| | | } |
| | | //} |
| | | AddAfterDelete(d['name'], data.value[d['name']], where).then((action) => { |
| | | if (action.IsSuccessed) { |
| | | cancel(); |
| | |
| | | validates, |
| | | ); |
| | | } |
| | | } catch (error) {} |
| | | } catch (error) { |
| | | console.log(error) |
| | | } |
| | | } |
| | | async function cancel() { |
| | | try { |