|
@@ -2,12 +2,18 @@
|
|
|
<div>
|
|
|
<BasicTable @register="registerTable" :scroll="{ x: 'max-content', y: '500' }">
|
|
|
<template #tableTitle>
|
|
|
- <Button type="primary" danger preIcon="ant-design:delete-outlined" v-if="showDeleteButton"
|
|
|
- @click="handleBatchDelete">
|
|
|
+ <Button
|
|
|
+ type="primary"
|
|
|
+ danger
|
|
|
+ preIcon="ant-design:delete-outlined"
|
|
|
+ v-if="showDeleteButton"
|
|
|
+ @click="handleBatchDelete"
|
|
|
+ >
|
|
|
{{ t('common.delete') }}
|
|
|
</Button>
|
|
|
</template>
|
|
|
<template #toolbar>
|
|
|
+ <!-- <a-button @click="handleExport">导入</a-button> -->
|
|
|
<a-button type="primary" @click="handleCreate">
|
|
|
{{ t('wechat.sopTask.addSopTask') }}
|
|
|
</a-button>
|
|
@@ -18,234 +24,457 @@
|
|
|
</template>
|
|
|
</template>
|
|
|
</BasicTable>
|
|
|
+ <!-- 树形控件展示 -->
|
|
|
+ <Modal v-model:visible="treeModalVisible" title="大纲" footer>
|
|
|
+ <Tree show-line :default-expanded-keys="['0-0-0']" :tree-data="treeData" @select="onSelect">
|
|
|
+ <template #icon><CarryOutOutlined /></template>
|
|
|
+ <template #title="{ dataRef }">
|
|
|
+ <template v-if="dataRef.key === '0-0-0-1'">
|
|
|
+ <div>multiple line title</div>
|
|
|
+ <!-- <div>multiple line title</div> -->
|
|
|
+ </template>
|
|
|
+ <template v-else>{{ dataRef.title }}</template>
|
|
|
+ </template>
|
|
|
+ <template #switcherIcon="{ dataRef, defaultIcon }">
|
|
|
+ <!-- <SmileTwoTone v-if="dataRef.key === '0-0-2'" /> -->
|
|
|
+ <component :is="defaultIcon" />
|
|
|
+ </template>
|
|
|
+ </Tree>
|
|
|
+ </Modal>
|
|
|
+ <!-- <Modal
|
|
|
+ width="500px"
|
|
|
+ height="300px"
|
|
|
+ v-model:open="exportModalVisible"
|
|
|
+ @ok="handleExportOk"
|
|
|
+ @cancel="handleExportCancel"
|
|
|
+ title="导入"
|
|
|
+ >
|
|
|
+ <Form
|
|
|
+ :model="exportModalForm"
|
|
|
+ layout="inline"
|
|
|
+ style="gap: 20px; height: auto; display: flex; flex-direction: column"
|
|
|
+ >
|
|
|
+ <FormItem name="name" label="任务名称" style="margin-left: 30px">
|
|
|
+ <Input v-model:value="exportModalForm.name" placeholder="请输入任务名称" />
|
|
|
+ </FormItem>
|
|
|
+ <FormItem name="" style="margin-left: 30px">
|
|
|
+ <BasicUpload
|
|
|
+ :maxSize="10"
|
|
|
+ :maxNumber="1"
|
|
|
+ @change="handleChange"
|
|
|
+ :api="uploadApi"
|
|
|
+ v-model:value="exportModalForm.url"
|
|
|
+ :showPreviewNumber="false"
|
|
|
+ emptyHidePreview
|
|
|
+ :accept="['.xls', '.xlsx']"
|
|
|
+ />
|
|
|
+ </FormItem>
|
|
|
+ </Form>
|
|
|
+ </Modal> -->
|
|
|
+ <Modal
|
|
|
+ width="500px"
|
|
|
+ height="300px"
|
|
|
+ v-model:open="modalVisible"
|
|
|
+ title="复制"
|
|
|
+ @ok="handleOk"
|
|
|
+ @cancel="handleCancel"
|
|
|
+ class="custom-modal"
|
|
|
+ >
|
|
|
+ <Form :model="form" layout="inline" style="gap: 20px; height: auto">
|
|
|
+ <FormItem
|
|
|
+ name="name"
|
|
|
+ label="任务名称"
|
|
|
+ style="margin-left: 30px"
|
|
|
+ :rules="[{ required: true, message: '请输入任务名称' }]"
|
|
|
+ >
|
|
|
+ <Input v-model:value="form.name" placeholder="请输入任务名称" />
|
|
|
+ </FormItem>
|
|
|
+ <FormItem v-if="permCode === '001'" name="id" label="租户" style="margin-left: 30px">
|
|
|
+ <Select
|
|
|
+ v-model:value="form.id"
|
|
|
+ :options="modeList"
|
|
|
+ allowClear
|
|
|
+ size="middle"
|
|
|
+ placeholder="请选择"
|
|
|
+ :style="{ width: '330px', margin: '0 5px' }"
|
|
|
+ ></Select>
|
|
|
+ </FormItem>
|
|
|
+ </Form>
|
|
|
+ </Modal>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script lang="ts">
|
|
|
-import { createVNode, defineComponent, ref } from 'vue';
|
|
|
-import { Modal, message } from 'ant-design-vue';
|
|
|
-import { ExclamationCircleOutlined } from '@ant-design/icons-vue/lib/icons';
|
|
|
-import { BasicTable, useTable, TableAction } from '@/components/Table';
|
|
|
-import { Button } from '@/components/Button';
|
|
|
-import { useI18n } from 'vue-i18n';
|
|
|
-import { columns, searchFormSchema } from './sopTask.data';
|
|
|
-import { getSopTaskList, deleteSopTask ,stopSopTask,startSopTask} from '@/api/wechat/sopTask';
|
|
|
-import { useGo } from "/@/hooks/web/usePage";
|
|
|
-import { PageEnum } from '@/enums/pageEnum';
|
|
|
-import { useRouter } from 'vue-router';
|
|
|
-export default defineComponent({
|
|
|
- name: 'SopTaskManagement',
|
|
|
- components: { BasicTable, TableAction, Button },
|
|
|
+ import { createVNode, defineComponent, ref, reactive, onMounted } from 'vue';
|
|
|
+ import { Modal, message, Form, FormItem, Select, Input, Tree } from 'ant-design-vue';
|
|
|
+ import {
|
|
|
+ ExclamationCircleOutlined,
|
|
|
+ CarryOutOutlined,
|
|
|
+ SmileTwoTone,
|
|
|
+ } from '@ant-design/icons-vue/lib/icons';
|
|
|
+ import { BasicTable, useTable, TableAction } from '@/components/Table';
|
|
|
+ import { Button } from '@/components/Button';
|
|
|
+ import { useI18n } from 'vue-i18n';
|
|
|
+ import { columns, searchFormSchema } from './sopTask.data';
|
|
|
+ import {
|
|
|
+ getSopTaskList,
|
|
|
+ deleteSopTask,
|
|
|
+ stopSopTask,
|
|
|
+ startSopTask,
|
|
|
+ copySopTask,
|
|
|
+ } from '@/api/wechat/sopTask';
|
|
|
+ import { getDepartmentList } from '@/api/sys/department';
|
|
|
+ import { useGo } from '/@/hooks/web/usePage';
|
|
|
+ import { PageEnum } from '@/enums/pageEnum';
|
|
|
+ import { useRouter } from 'vue-router';
|
|
|
+ import { getPermCode } from '@/api/sys/user';
|
|
|
+ import { BasicUpload } from '@/components/Upload';
|
|
|
+ import { deleteFile, downloadFile, getFileList, uploadApi } from '@/api/fms/file';
|
|
|
+ export default defineComponent({
|
|
|
+ name: 'SopTaskManagement',
|
|
|
+ components: {
|
|
|
+ BasicTable,
|
|
|
+ TableAction,
|
|
|
+ Button,
|
|
|
+ Modal,
|
|
|
+ Form,
|
|
|
+ FormItem,
|
|
|
+ Select,
|
|
|
+ Input,
|
|
|
+ BasicUpload,
|
|
|
+ Tree,
|
|
|
+ },
|
|
|
|
|
|
- setup() {
|
|
|
- const router = useRouter();
|
|
|
- const { t } = useI18n();
|
|
|
- const selectedIds = ref<number[] | string[]>();
|
|
|
- const showDeleteButton = ref<boolean>(false);
|
|
|
-
|
|
|
- const go = useGo();
|
|
|
- const [registerTable, { reload }] = useTable({
|
|
|
- title: t('wechat.sopTask.sopTaskList'),
|
|
|
- api: getSopTaskList,
|
|
|
- columns,
|
|
|
- formConfig: {
|
|
|
- // labelWidth: 120,
|
|
|
- schemas: searchFormSchema,
|
|
|
- },
|
|
|
- useSearchForm: true,
|
|
|
- showTableSetting: true,
|
|
|
- bordered: false,
|
|
|
- showIndexColumn: false,
|
|
|
- clickToRowSelect: false,
|
|
|
- scroll:{ x: 1000, y: 500 },
|
|
|
- actionColumn: {
|
|
|
- width: 200,
|
|
|
- title: t('common.action'),
|
|
|
- dataIndex: 'action',
|
|
|
- fixed: 'right',
|
|
|
- },
|
|
|
- rowKey: 'id',
|
|
|
- rowSelection: {
|
|
|
- type: 'checkbox',
|
|
|
- onChange: (selectedRowKeys, _selectedRows) => {
|
|
|
- selectedIds.value = selectedRowKeys as number[];
|
|
|
- showDeleteButton.value = selectedRowKeys.length > 0;
|
|
|
+ setup() {
|
|
|
+ const router = useRouter();
|
|
|
+ const { t } = useI18n();
|
|
|
+ const selectedIds = ref<number[] | string[]>();
|
|
|
+ const showDeleteButton = ref<boolean>(false);
|
|
|
+ const form = reactive({
|
|
|
+ name: '',
|
|
|
+ id: undefined,
|
|
|
+ });
|
|
|
+ const initialForm = reactive({
|
|
|
+ name: '',
|
|
|
+ id: undefined,
|
|
|
+ });
|
|
|
+ const modeList = ref<any[]>([]);
|
|
|
+ const exportModalVisible = ref(false);
|
|
|
+ const treeModalVisible = ref(false);
|
|
|
+ const treeData = ref([]);
|
|
|
+ const exportModalForm = reactive({
|
|
|
+ name: '',
|
|
|
+ url: '',
|
|
|
+ });
|
|
|
+ const initialExportModalForm = reactive({
|
|
|
+ name: '',
|
|
|
+ });
|
|
|
+ const recordId = ref<number>();
|
|
|
+ const modalVisible = ref(false);
|
|
|
+ const go = useGo();
|
|
|
+ const permCode = ref('');
|
|
|
+ const [registerTable, { reload }] = useTable({
|
|
|
+ title: t('wechat.sopTask.sopTaskList'),
|
|
|
+ api: getSopTaskList,
|
|
|
+ columns,
|
|
|
+ formConfig: {
|
|
|
+ // labelWidth: 120,
|
|
|
+ schemas: searchFormSchema,
|
|
|
+ },
|
|
|
+ useSearchForm: true,
|
|
|
+ showTableSetting: true,
|
|
|
+ bordered: false,
|
|
|
+ showIndexColumn: false,
|
|
|
+ clickToRowSelect: false,
|
|
|
+ scroll: { x: 1000, y: 500 },
|
|
|
+ actionColumn: {
|
|
|
+ width: 300,
|
|
|
+ title: t('common.action'),
|
|
|
+ dataIndex: 'action',
|
|
|
+ fixed: 'right',
|
|
|
+ },
|
|
|
+ rowKey: 'id',
|
|
|
+ rowSelection: {
|
|
|
+ type: 'checkbox',
|
|
|
+ onChange: (selectedRowKeys, _selectedRows) => {
|
|
|
+ selectedIds.value = selectedRowKeys as number[];
|
|
|
+ showDeleteButton.value = selectedRowKeys.length > 0;
|
|
|
+ },
|
|
|
},
|
|
|
- },
|
|
|
- });
|
|
|
-
|
|
|
- //新建SOP页面跳转
|
|
|
- function handleCreate() {
|
|
|
- console.log('跳转SOP页面')
|
|
|
- go(PageEnum.ADD_SOP);
|
|
|
- }
|
|
|
-
|
|
|
- function handleEdit(record: Recordable) {
|
|
|
- console.log('编辑',record.id);
|
|
|
- router.push({
|
|
|
- path: PageEnum.ADD_SOP,
|
|
|
- query: { task_id: record.id }
|
|
|
});
|
|
|
- }
|
|
|
-
|
|
|
- async function handleDelete(record: Recordable) {
|
|
|
- const result = await deleteSopTask({ ids: [record.id] });
|
|
|
- if (result.code === 0) {
|
|
|
- await reload();
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- //复制
|
|
|
- function handleCopy(record: Recordable) {
|
|
|
- message.success('复制成功!')
|
|
|
- console.log('复制')
|
|
|
- }
|
|
|
|
|
|
- //执行任务
|
|
|
- function handleTask(record: Recordable) {
|
|
|
- console.log('执行任务')
|
|
|
- router.push({
|
|
|
- path: PageEnum.PERFORM_TASKS,
|
|
|
- query: { task_id: record.id }
|
|
|
+ onMounted(async () => {
|
|
|
+ let res = await getPermCode();
|
|
|
+ permCode.value = res.data[0];
|
|
|
+ let res1 = await getDepartmentList({ page: 1, pageSize: 1000 });
|
|
|
+ const data = res1.data.data.map((item) => ({
|
|
|
+ label: item.name,
|
|
|
+ value: item.id,
|
|
|
+ }));
|
|
|
+ modeList.value = data;
|
|
|
});
|
|
|
- }
|
|
|
-
|
|
|
- //启用
|
|
|
- async function handleOpen(record: Recordable) {
|
|
|
- console.log('启用')
|
|
|
- // record.status = 2;
|
|
|
- await startSopTask({ id: record.id });
|
|
|
- message.success('启用成功!')
|
|
|
- await reload();
|
|
|
- }
|
|
|
+ //新建SOP页面跳转
|
|
|
+ function handleCreate() {
|
|
|
+ go(PageEnum.ADD_SOP);
|
|
|
+ }
|
|
|
|
|
|
- //禁用
|
|
|
- async function handleStop(record: Recordable) {
|
|
|
- console.log('禁用',record.id)
|
|
|
- // record.status = 3;
|
|
|
- let result = await stopSopTask({id: record.id});
|
|
|
- message.success('禁用成功!')
|
|
|
- await reload();
|
|
|
- }
|
|
|
+ //导入表格
|
|
|
+ function handleExport() {
|
|
|
+ exportModalVisible.value = true;
|
|
|
+ }
|
|
|
+ function handleEdit(record: Recordable) {
|
|
|
+ router.push({
|
|
|
+ path: PageEnum.ADD_SOP,
|
|
|
+ query: { task_id: record.id },
|
|
|
+ });
|
|
|
+ }
|
|
|
|
|
|
- //查看
|
|
|
- function handleView(record: Recordable) {
|
|
|
- console.log('查看')
|
|
|
- router.push({
|
|
|
- path: PageEnum.ADD_SOP,
|
|
|
- query: { task_id: record.id }
|
|
|
- });
|
|
|
- }
|
|
|
+ async function handleDelete(record: Recordable) {
|
|
|
+ const result = await deleteSopTask({ ids: [record.id] });
|
|
|
+ if (result.code === 0) {
|
|
|
+ await reload();
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- async function handleBatchDelete() {
|
|
|
- Modal.confirm({
|
|
|
- title: t('common.deleteConfirm'),
|
|
|
- icon: createVNode(ExclamationCircleOutlined),
|
|
|
- async onOk() {
|
|
|
- const result = await deleteSopTask({ ids: selectedIds.value as number[] });
|
|
|
- if (result.code === 0) {
|
|
|
- showDeleteButton.value = false;
|
|
|
- await reload();
|
|
|
- }
|
|
|
- },
|
|
|
- onCancel() {
|
|
|
- console.log('Cancel');
|
|
|
- },
|
|
|
- });
|
|
|
- }
|
|
|
+ //复制
|
|
|
+ async function handleCopy(record: Recordable) {
|
|
|
+ modalVisible.value = true;
|
|
|
+ recordId.value = record.id;
|
|
|
+ }
|
|
|
|
|
|
- function getActions(record: Recordable) {
|
|
|
- if (record.status === 1) {
|
|
|
- return [
|
|
|
+ //大纲
|
|
|
+ async function handleTree(record: Recordable) {
|
|
|
+ treeModalVisible.value = true;
|
|
|
+ treeData.value = [
|
|
|
{
|
|
|
- label: '编辑',
|
|
|
- onClick: handleEdit.bind(null, record),
|
|
|
- ifShow: true,
|
|
|
+ title: 'parent 1',
|
|
|
+ key: '0-0',
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ title: 'parent 1-0',
|
|
|
+ key: '0-0-0',
|
|
|
+ children: [
|
|
|
+ { title: 'leaf', key: '0-0-0-0' },
|
|
|
+ {
|
|
|
+ key: '0-0-0-1',
|
|
|
+ },
|
|
|
+ { title: 'leaf', key: '0-0-0-2' },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: 'parent 1-1',
|
|
|
+ key: '0-0-1',
|
|
|
+ children: [{ title: 'leaf', key: '0-0-1-0' }],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: 'parent 1-2',
|
|
|
+ key: '0-0-2',
|
|
|
+ children: [
|
|
|
+ { title: 'leaf 1', key: '0-0-2-0' },
|
|
|
+ {
|
|
|
+ title: 'leaf 2',
|
|
|
+ key: '0-0-2-1',
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ ],
|
|
|
},
|
|
|
{
|
|
|
- color: 'error',
|
|
|
- label: '删除',
|
|
|
- popConfirm: {
|
|
|
- title: t('common.deleteConfirm'),
|
|
|
- placement: 'left',
|
|
|
- confirm: handleDelete.bind(null, record),
|
|
|
- },
|
|
|
- ifShow: true,
|
|
|
- },
|
|
|
- {
|
|
|
- label: '复制',
|
|
|
- onClick: handleCopy.bind(null, record),
|
|
|
- ifShow: true,
|
|
|
- }
|
|
|
- ];
|
|
|
- } else if (record.status === 2) {
|
|
|
- return [
|
|
|
- // {
|
|
|
- // icon: 'clarity:note-edit-line',
|
|
|
- // onClick: handleEdit.bind(null, record),
|
|
|
- // tooltip: '编辑',
|
|
|
- // ifShow: true,
|
|
|
- // },
|
|
|
- {
|
|
|
- // color: 'error',
|
|
|
- onClick: handleOpen.bind(null, record),
|
|
|
- label: '启用',
|
|
|
- ifShow: true,
|
|
|
- },
|
|
|
- {
|
|
|
- onClick: handleTask.bind(null, record),
|
|
|
- label: '执行任务',
|
|
|
- ifShow: true,
|
|
|
+ title: 'parent 2',
|
|
|
+ key: '0-1',
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ title: 'parent 2-0',
|
|
|
+ key: '0-1-0',
|
|
|
+ children: [
|
|
|
+ { title: 'leaf', key: '0-1-0-0' },
|
|
|
+ { title: 'leaf', key: '0-1-0-1' },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ ],
|
|
|
},
|
|
|
- {
|
|
|
- onClick: handleView.bind(null, record),
|
|
|
- label: '查看',
|
|
|
- ifShow: true,
|
|
|
- }
|
|
|
];
|
|
|
- } else if (record.status === 3) {
|
|
|
- return [
|
|
|
- // {
|
|
|
- // icon: 'clarity:note-edit-line',
|
|
|
- // onClick: handleEdit.bind(null, record),
|
|
|
- // tooltip: '编辑',
|
|
|
- // ifShow: true,
|
|
|
- // },
|
|
|
- {
|
|
|
- color: 'error',
|
|
|
- onClick: handleStop.bind(null, record),
|
|
|
- label: '禁用',
|
|
|
- ifShow: true,
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ function onSelect(keys, event) {
|
|
|
+ console.log('Selected: ', keys, event);
|
|
|
+ }
|
|
|
+ async function handleOk() {
|
|
|
+ let res = await copySopTask({ id: recordId.value, name: form.name, organizationId: form.id });
|
|
|
+ message.success('复制成功!');
|
|
|
+ modalVisible.value = false;
|
|
|
+ await reload();
|
|
|
+ }
|
|
|
+ //执行任务
|
|
|
+ function handleTask(record: Recordable) {
|
|
|
+ router.push({
|
|
|
+ path: PageEnum.PERFORM_TASKS,
|
|
|
+ query: { task_id: record.id },
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ //启用
|
|
|
+ async function handleOpen(record: Recordable) {
|
|
|
+ // record.status = 2;
|
|
|
+ await startSopTask({ id: record.id });
|
|
|
+ message.success('启用成功!');
|
|
|
+ await reload();
|
|
|
+ }
|
|
|
+
|
|
|
+ //禁用
|
|
|
+ async function handleStop(record: Recordable) {
|
|
|
+ // record.status = 3;
|
|
|
+ let result = await stopSopTask({ id: record.id });
|
|
|
+ message.success('禁用成功!');
|
|
|
+ await reload();
|
|
|
+ }
|
|
|
+
|
|
|
+ //查看
|
|
|
+ function handleView(record: Recordable) {
|
|
|
+ router.push({
|
|
|
+ path: PageEnum.ADD_SOP,
|
|
|
+ query: { task_id: record.id },
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ async function handleBatchDelete() {
|
|
|
+ Modal.confirm({
|
|
|
+ title: t('common.deleteConfirm'),
|
|
|
+ icon: createVNode(ExclamationCircleOutlined),
|
|
|
+ async onOk() {
|
|
|
+ const result = await deleteSopTask({ ids: selectedIds.value as number[] });
|
|
|
+ if (result.code === 0) {
|
|
|
+ showDeleteButton.value = false;
|
|
|
+ await reload();
|
|
|
+ }
|
|
|
},
|
|
|
- {
|
|
|
- onClick: handleTask.bind(null, record),
|
|
|
- label: '执行任务',
|
|
|
- ifShow: true,
|
|
|
+ onCancel() {
|
|
|
+ console.log('Cancel');
|
|
|
},
|
|
|
- {
|
|
|
- onClick: handleView.bind(null, record),
|
|
|
- label: '查看',
|
|
|
- ifShow: true,
|
|
|
- }
|
|
|
- ];
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ function getActions(record: Recordable) {
|
|
|
+ if (record.status === 1) {
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ label: '编辑',
|
|
|
+ onClick: handleEdit.bind(null, record),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ color: 'error',
|
|
|
+ label: '删除',
|
|
|
+ popConfirm: {
|
|
|
+ title: t('common.deleteConfirm'),
|
|
|
+ placement: 'left',
|
|
|
+ confirm: handleDelete.bind(null, record),
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '复制',
|
|
|
+ onClick: handleCopy.bind(null, record),
|
|
|
+ },
|
|
|
+ // {
|
|
|
+ // label: '大纲',
|
|
|
+ // onClick: handleTree.bind(null, record),
|
|
|
+ // },
|
|
|
+ ];
|
|
|
+ } else if (record.status === 2) {
|
|
|
+ return [
|
|
|
+ // {
|
|
|
+ // icon: 'clarity:note-edit-line',
|
|
|
+ // onClick: handleEdit.bind(null, record),
|
|
|
+ // tooltip: '编辑',
|
|
|
+ // },
|
|
|
+ {
|
|
|
+ onClick: handleOpen.bind(null, record),
|
|
|
+ label: '启用',
|
|
|
+ ifShow: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ onClick: handleTask.bind(null, record),
|
|
|
+ label: '执行任务',
|
|
|
+ ifShow: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ onClick: handleView.bind(null, record),
|
|
|
+ label: '查看',
|
|
|
+ ifShow: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '复制',
|
|
|
+ onClick: handleCopy.bind(null, record),
|
|
|
+ ifShow: true,
|
|
|
+ },
|
|
|
+ // {
|
|
|
+ // label: '大纲',
|
|
|
+ // onClick: handleTree.bind(null, record),
|
|
|
+ // },
|
|
|
+ ];
|
|
|
+ } else if (record.status === 3) {
|
|
|
+ return [
|
|
|
+ // {
|
|
|
+ // icon: 'clarity:note-edit-line',
|
|
|
+ // onClick: handleEdit.bind(null, record),
|
|
|
+ // tooltip: '编辑',
|
|
|
+ // },
|
|
|
+ {
|
|
|
+ color: 'error',
|
|
|
+ onClick: handleStop.bind(null, record),
|
|
|
+ label: '禁用',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ onClick: handleTask.bind(null, record),
|
|
|
+ label: '执行任务',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ onClick: handleView.bind(null, record),
|
|
|
+ label: '查看',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '复制',
|
|
|
+ onClick: handleCopy.bind(null, record),
|
|
|
+ },
|
|
|
+ // {
|
|
|
+ // label: '大纲',
|
|
|
+ // onClick: handleTree.bind(null, record),
|
|
|
+ // },
|
|
|
+ ];
|
|
|
+ }
|
|
|
+ return [];
|
|
|
}
|
|
|
- return [];
|
|
|
- }
|
|
|
|
|
|
- return {
|
|
|
- t,
|
|
|
- registerTable,
|
|
|
- handleCreate,
|
|
|
- handleEdit,
|
|
|
- handleDelete,
|
|
|
- handleCopy,
|
|
|
- handleOpen,
|
|
|
- handleTask,
|
|
|
- handleStop,
|
|
|
- handleView,
|
|
|
- getActions,
|
|
|
- handleBatchDelete,
|
|
|
- showDeleteButton,
|
|
|
- };
|
|
|
- },
|
|
|
-});
|
|
|
+ return {
|
|
|
+ t,
|
|
|
+ registerTable,
|
|
|
+ handleCreate,
|
|
|
+ handleEdit,
|
|
|
+ handleDelete,
|
|
|
+ handleCopy,
|
|
|
+ handleOpen,
|
|
|
+ handleTask,
|
|
|
+ handleStop,
|
|
|
+ handleView,
|
|
|
+ getActions,
|
|
|
+ handleBatchDelete,
|
|
|
+ showDeleteButton,
|
|
|
+ modalVisible,
|
|
|
+ form,
|
|
|
+ initialForm,
|
|
|
+ permCode,
|
|
|
+ handleExport,
|
|
|
+ exportModalVisible,
|
|
|
+ initialExportModalForm,
|
|
|
+ exportModalForm,
|
|
|
+ modeList,
|
|
|
+ recordId,
|
|
|
+ handleOk,
|
|
|
+ uploadApi,
|
|
|
+ handleTree,
|
|
|
+ treeModalVisible,
|
|
|
+ treeData,
|
|
|
+ onSelect,
|
|
|
+ };
|
|
|
+ },
|
|
|
+ });
|
|
|
</script>
|