湖州项目前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

87 lines
2.6 KiB

1 year ago
<template>
<PageWrapper dense>
<!--引用表格-->
<BasicTable @register="registerTable">
2 weeks ago
<template #tableTitle>
<el-button type="primary" @click="handleAdd" v-if="isShowByRoles('projectContact')">
新增模板</el-button
>
</template>
1 year ago
<template #action="{ record }">
2 weeks ago
<TableAction :actions="getTableAction(record)" />
</template>
1 year ago
</BasicTable>
<detailTemplateContent @register="registerDetail" />
2 weeks ago
<modify @register="registerModify" @close="closeModel" />
<addTemplate ref="addTemplateRef" @success="reload()" />
1 year ago
</PageWrapper>
</template>
<script lang="ts" name="planSummary" setup>
2 weeks ago
//ts语法
import { BasicTable, useTable, ActionItem, TableAction } from '@/components/Table';
import { PageWrapper } from '@/components/Page';
import { useModal } from '@/components/Modal';
import { ref } from 'vue';
import { isShowByRoles } from '@/views/projectLib/projectInfo/projectInfo.api';
import detailTemplateContent from './detailTemplateContent.vue';
import modify from './modify.vue';
import { PerformanColumns } from './templateContent.data';
import { getPerforman } from './templateContent.api';
import addTemplate from './addTemplate.vue';
const [registerDetail, { openModal: openModalDetail }] = useModal();
const [registerModify, { openModal: openModalModify, closeModal: closeModalModify }] = useModal();
1 year ago
2 weeks ago
const [registerTable, { reload }] = useTable({
api: getPerforman,
columns: PerformanColumns,
useSearchForm: false,
pagination: false,
actionColumn: {
width: 140,
title: '操作',
dataIndex: 'action',
slots: { customRender: 'action' },
},
afterFetch: (data) => {},
//表单查询项设置
// formConfig: {
// schemas: searchFormSchema,
// }
});
function getTableAction(record): ActionItem[] {
return [
1 year ago
{
2 weeks ago
label: '详情',
onClick: handledetail.bind(null, record),
1 year ago
},
// {
// label: '修改',
// ifShow: () => {
2 weeks ago
// return isShowByRoles("manageOrg")
1 year ago
// },
// onClick: handleModify.bind(null, record),
// },
2 weeks ago
];
}
function handledetail(record) {
openModalDetail(true, { type: record.type });
console.log(record);
}
// function handleModify(record) {
// openModalModify(true,{type:record.type})
// console.log(record)
// }
function closeModel() {
closeModalModify();
reload();
}
//新增模板
const addTemplateRef = ref();
function handleAdd() {
addTemplateRef.value.showModal()
}
1 year ago
</script>
2 weeks ago
<style scoped></style>