|
|
@@ -1,36 +1,37 @@
|
|
|
<template>
|
|
|
- <!-- <PageWrapper contentBackground> -->
|
|
|
- <!-- <template #footer>
|
|
|
-
|
|
|
- <a-tabs v-model:activeKey="tableType" @change="changeTable">
|
|
|
- <a-tab-pane :key="0" :tab="t('routes.scenes.4dkk')" :disabled="loading" />
|
|
|
- <a-tab-pane :key="1" :tab="t('routes.scenes.4dkj')" :disabled="loading" />
|
|
|
- <a-tab-pane :key="2" :tab="t('routes.scenes.4dssdy')" :disabled="loading" />
|
|
|
- <a-tab-pane :key="4" :tab="t('routes.scenes.obj')" :disabled="loading" />
|
|
|
-
|
|
|
- </a-tabs>
|
|
|
- </template> -->
|
|
|
- <!-- :rowSelection="{ type: 'checkbox', onChange: handleSelect }" -->
|
|
|
- <BasicTable @register="registerTable">
|
|
|
- <template #toolbar>
|
|
|
- <!-- <a-button type="primary" @click="handleCreate"> 新增</a-button> -->
|
|
|
- <!-- <a-button type="primary" color="warning" @click="() => {}"> 编辑</a-button>
|
|
|
+ <div>
|
|
|
+ <BasicTable @register="registerTable">
|
|
|
+ <template #toolbar>
|
|
|
+ <!-- <a-button type="primary" @click="handleCreate"> 新增</a-button> -->
|
|
|
+ <!-- <a-button type="primary" color="warning" @click="() => {}"> 编辑</a-button>
|
|
|
<a-button type="primary" color="error" @click="() => {}"> 删除</a-button> -->
|
|
|
- </template>
|
|
|
+ </template>
|
|
|
|
|
|
- <template #cover="{ record }">
|
|
|
- <TableImg
|
|
|
- :size="120"
|
|
|
- :simpleShow="true"
|
|
|
- :imgList="[record.thumb || '/resource/img/header.jpg']"
|
|
|
- />
|
|
|
- </template>
|
|
|
- <template #createTime="{ record }">
|
|
|
- <Time v-if="record.createTime" :value="record.createTime" mode="datetime" />
|
|
|
- </template>
|
|
|
- </BasicTable>
|
|
|
+ <template #cover="{ record }">
|
|
|
+ <TableImg
|
|
|
+ :size="120"
|
|
|
+ :simpleShow="true"
|
|
|
+ :imgList="[record.thumb || '/resource/img/header.jpg']"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ <template #createTime="{ record }">
|
|
|
+ <Time v-if="record.createTime" :value="record.createTime" mode="datetime" />
|
|
|
+ </template>
|
|
|
|
|
|
- <!-- </PageWrapper> -->
|
|
|
+ <template #action="{ record }">
|
|
|
+ <TableAction
|
|
|
+ :actions="[
|
|
|
+ {
|
|
|
+ label: t('routes.scenes.unAssistant'),
|
|
|
+ onClick: handleUnAssistantModal.bind(null, record),
|
|
|
+ ifShow: isPatchAuth,
|
|
|
+ },
|
|
|
+ ]"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ </BasicTable>
|
|
|
+ <unAssistantModal @register="registerUnAssistantModal" />
|
|
|
+ </div>
|
|
|
</template>
|
|
|
<script lang="ts">
|
|
|
import { defineComponent, computed, ref } from 'vue';
|
|
|
@@ -39,7 +40,7 @@
|
|
|
useTable,
|
|
|
BasicColumn,
|
|
|
FormProps,
|
|
|
- // TableAction,
|
|
|
+ TableAction,
|
|
|
TableImg,
|
|
|
} from '/@/components/Table';
|
|
|
import { useMessage } from '/@/hooks/web/useMessage';
|
|
|
@@ -48,25 +49,28 @@
|
|
|
|
|
|
import { useI18n } from '/@/hooks/web/useI18n';
|
|
|
import { Time } from '/@/components/Time';
|
|
|
- // import { useUserStore } from '/@/store/modules/user';
|
|
|
|
|
|
import { useLocaleStore } from '/@/store/modules/locale';
|
|
|
- // import { PageWrapper } from '/@/components/Page';
|
|
|
+ import unAssistantModal from './unAssistantModal.vue';
|
|
|
+ import { useModal } from '/@/components/Modal';
|
|
|
+ import { useUserStore } from '/@/store/modules/user';
|
|
|
+ import { RoleEnum } from '/@/enums/roleEnum';
|
|
|
|
|
|
const localeStore = useLocaleStore();
|
|
|
console.log('localeStore', localeStore);
|
|
|
|
|
|
- // const userStore = useUserStore();
|
|
|
+ const userStore = useUserStore();
|
|
|
|
|
|
export default defineComponent({
|
|
|
components: {
|
|
|
BasicTable,
|
|
|
- // TableAction,
|
|
|
+ TableAction,
|
|
|
TableImg,
|
|
|
// PageWrapper,
|
|
|
Time,
|
|
|
[Tabs.name]: Tabs,
|
|
|
[Tabs.TabPane.name]: Tabs.TabPane,
|
|
|
+ unAssistantModal,
|
|
|
},
|
|
|
setup() {
|
|
|
const { createMessage } = useMessage();
|
|
|
@@ -118,15 +122,21 @@
|
|
|
slots: { customRender: 'createTime' },
|
|
|
width: 200,
|
|
|
},
|
|
|
- // {
|
|
|
- // title: t('common.operation'),
|
|
|
- // dataIndex: '',
|
|
|
- // slots: { customRender: 'action' },
|
|
|
- // width: isJA.value ? 100 : 100,
|
|
|
- // fixed: 'right',
|
|
|
- // },
|
|
|
+ {
|
|
|
+ title: t('common.operation'),
|
|
|
+ dataIndex: '',
|
|
|
+ slots: { customRender: 'action' },
|
|
|
+ width: 100,
|
|
|
+ // fixed: 'right',
|
|
|
+ },
|
|
|
];
|
|
|
|
|
|
+ const roleList = userStore.roleList;
|
|
|
+ console.log('roleList', roleList);
|
|
|
+
|
|
|
+ const isPatchAuth = computed(() => {
|
|
|
+ return roleList.includes(RoleEnum.PLAT_ADMIN) || roleList.includes(RoleEnum.SUPER);
|
|
|
+ });
|
|
|
const searchForm: Partial<FormProps> = {
|
|
|
labelWidth: 100,
|
|
|
schemas: [
|
|
|
@@ -156,7 +166,7 @@
|
|
|
},
|
|
|
],
|
|
|
};
|
|
|
- // { getForm }
|
|
|
+ const [registerUnAssistantModal, { openModal: openUnAssistantModal }] = useModal();
|
|
|
const [registerTable, { reload, getSelectRowKeys }] = useTable({
|
|
|
title: t('routes.dashboard.contractorManage'),
|
|
|
api: contractorListApi,
|
|
|
@@ -190,7 +200,11 @@
|
|
|
const handleCreate = () => {
|
|
|
console.log('handleCreate');
|
|
|
};
|
|
|
+ const handleUnAssistantModal = (record: Recordable) => {
|
|
|
+ openUnAssistantModal(true, { ...record });
|
|
|
+ };
|
|
|
return {
|
|
|
+ isPatchAuth,
|
|
|
registerTable,
|
|
|
createMessage,
|
|
|
t,
|
|
|
@@ -200,6 +214,8 @@
|
|
|
isJA,
|
|
|
handleSelect,
|
|
|
handleCreate,
|
|
|
+ handleUnAssistantModal,
|
|
|
+ registerUnAssistantModal,
|
|
|
};
|
|
|
},
|
|
|
});
|