| | |
| | | <template> |
| | | <PageWrapper dense contentFullHeight fixedHeight contentClass="flex"> |
| | | <CustTree |
| | | <GeneralTree |
| | | class="w-1/4 xl:w-1/5" |
| | | @select="handleSelect" |
| | | :title="title" |
| | |
| | | /><!-- |
| | | add |
| | | @handle-add="handleAdd" --> |
| | | <BasicTable class="w-3/4 xl:w-4/5" @register="registerTable"> |
| | | <div class="w-3/4 xl:w-4/5"></div> |
| | | <!-- <BasicTable class="w-3/4 xl:w-4/5" @register="registerTable"> |
| | | <template #toolbar> |
| | | <a-button type="primary" @click="handleCreate" preIcon="add_02|svg"> 新增 </a-button> |
| | | </template> |
| | |
| | | <TableAction :actions="createActions(record)" /> |
| | | </template> |
| | | </template> |
| | | </BasicTable> |
| | | </BasicTable> --> |
| | | <normalDrawer @register="registerDrawer" @success="handleSuccess" /> |
| | | <CustModal |
| | | @register="registerCust" |
| | |
| | | @click="handleCustClick(field)" |
| | | :preIcon="item.preIcons[name]" |
| | | /> |
| | | <NormalModal |
| | | <GeneralModal |
| | | @register="useModalData[name][0]" |
| | | @success="(d, u) => handleEntSuccess(d, u, item.name)" |
| | | /> |
| | |
| | | </PageWrapper> |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import { BasicTable, useTable, TableAction } from '@/components/Table'; |
| | | import { getEntity, getRoleListByPage, convertToTree } from '@/api/tigerapi/system'; |
| | | import { PageWrapper } from '@/components/Page'; |
| | | import CustTree from './CustTree.vue'; |
| | | import GeneralTree from '/@/views/components/GeneralTree.vue'; |
| | | import { useModal } from '@/components/Modal'; |
| | | import normalDrawer from '../normalDrawer.vue'; |
| | | import NormalModal from '/@/views/components/NormalModal.vue'; |
| | | import GeneralModal from '/@/views/components/GeneralModal.vue'; |
| | | import CustModal from '/@/views/components/CustModal.vue'; |
| | | import { columns, searchFormSchema } from './dept.data'; |
| | | import { |
| | | GetActionsData, |
| | | GetSelectSuccess, |
| | |
| | | import { BasicForm, useForm } from '/@/components/Form/index'; |
| | | import { TreeItem } from '/@/components/TigerTree'; |
| | | import { createIconByType } from '../data'; |
| | | import { RouteToProd } from '/@/api/tigerapi/mes/router'; |
| | | import { RouteToProd } from '/@/api/tigerapi/mes/router'; |
| | | import { useTabs } from '/@/hooks/web/useTabs'; |
| | | |
| | | defineOptions({ name: 'DeptManagement' }); |
| | | |
| | | const route = useRoute(); |
| | | const { setTitle } = useTabs(); |
| | | const objParams = ref(JSON.parse(decodeURI(route.params?.id as string))); |
| | | const entityName = ref(objParams.value.Name); |
| | | const formSchemas = ref({}); //弹出框或高级页面多表单结构 |
| | |
| | | const [registerCust, { openModal: openCustomModal, closeModal }] = useModal(); |
| | | const [registerItemAdd, { openModal: openItemModal }] = useModal(); |
| | | const [registerDrawer, { openDrawer }] = useDrawer(); |
| | | const [registerTable, { reload }] = useTable({ |
| | | title: '列表信息', |
| | | api: getRoleListByPage, |
| | | columns, |
| | | formConfig: { |
| | | labelWidth: 120, |
| | | schemas: searchFormSchema, |
| | | }, |
| | | pagination: false, |
| | | striped: false, |
| | | useSearchForm: true, |
| | | showTableSetting: true, |
| | | bordered: true, |
| | | showIndexColumn: false, |
| | | canResize: false, |
| | | actionColumn: { |
| | | width: 80, |
| | | title: '操作', |
| | | dataIndex: 'action', |
| | | // slots: { customRender: 'action' }, |
| | | fixed: undefined, |
| | | }, |
| | | }); |
| | | setTitle(objParams.value.Title); //设置标签页标题 |
| | | // const [registerTable, { reload }] = useTable({ |
| | | // title: '列表信息', |
| | | // api: getRoleListByPage, |
| | | // columns, |
| | | // formConfig: { |
| | | // labelWidth: 120, |
| | | // schemas: searchFormSchema, |
| | | // }, |
| | | // pagination: false, |
| | | // striped: false, |
| | | // useSearchForm: true, |
| | | // showTableSetting: true, |
| | | // bordered: true, |
| | | // showIndexColumn: false, |
| | | // canResize: false, |
| | | // actionColumn: { |
| | | // width: 80, |
| | | // title: '操作', |
| | | // dataIndex: 'action', |
| | | // // slots: { customRender: 'action' }, |
| | | // fixed: undefined, |
| | | // }, |
| | | // }); |
| | | |
| | | /** |
| | | * @description: 获取树形数据 |
| | |
| | | */ |
| | | async function fetch(type: string) { |
| | | //根据type获取树形数据 |
| | | const data = await fetchTreeData(type); |
| | | const data = await fetchTreeData(type, objParams.value.CODE); |
| | | title.value = data.title; |
| | | treeData.value = data.treeData; |
| | | fieldNames.value = data.fieldNames; |
| | |
| | | * @return {*} |
| | | */ |
| | | function createActions(record) { |
| | | return GetActionsData( |
| | | { |
| | | record, |
| | | isUpdate: true, |
| | | ifSave: true, |
| | | entityName: entityName.value, |
| | | formJson: getFormSchema(`${entityName.value}_Crud`), |
| | | cType, |
| | | dtlSlots, |
| | | useModalData, |
| | | useFormData, |
| | | crudColSlots, |
| | | }, |
| | | openDrawer, |
| | | reload, |
| | | openCustomModal, |
| | | useForm, |
| | | useModal, |
| | | ); |
| | | // return GetActionsData( |
| | | // { |
| | | // record, |
| | | // isUpdate: true, |
| | | // ifSave: true, |
| | | // entityName: entityName.value, |
| | | // formJson: getFormSchema(`${entityName.value}_Crud`), |
| | | // cType, |
| | | // dtlSlots, |
| | | // useModalData, |
| | | // useFormData, |
| | | // crudColSlots, |
| | | // }, |
| | | // openDrawer, |
| | | // reload, |
| | | // openCustomModal, |
| | | // useForm, |
| | | // useModal, |
| | | // ); |
| | | } |
| | | |
| | | /** |