bug: 代办任务流程图不显示bug修复

This commit is contained in:
lbw 2023-03-07 09:19:58 +08:00
parent 2cbfa8506a
commit 4b841f9b21
2 changed files with 109 additions and 106 deletions

View File

@ -46,6 +46,7 @@ const pageList = () => {
const state: BasicTableProps = reactive<BasicTableProps>({
isPage: false,
queryForm: {},
createdIsNeed: false,
pageList: pageList,
});

View File

@ -1,141 +1,143 @@
<template>
<div class="layout-padding">
<el-card class="layout-padding-auto">
<el-row v-show="showSearch" class="mb8">
<el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList">
<el-form-item :label="$t('task.taskName')" prop="taskName">
<el-input :placeholder="t('task.inputTaskNameTip')" v-model="state.queryForm.taskName"
style="max-width: 180px" />
</el-form-item>
<el-form-item class="ml2">
<el-button formDialogRef icon="search" type="primary" @click="getDataList">
{{ $t('common.queryBtn') }}
</el-button>
<el-button icon="Refresh" formDialogRef @click="resetQuery">{{ $t('common.resetBtn') }}</el-button>
</el-form-item>
</el-form>
</el-row>
<el-row>
<div class="mb8" style="width: 100%">
<el-button formDialogRef icon="Download" type="primary" class="ml10" @click="exportExcel">
{{ $t('common.exportBtn') }}
</el-button>
<el-button formDialogRef :disabled="multiple" icon="Delete" type="primary" class="ml10"
@click="handleDelete(selectObjs)">
{{ $t('common.delBtn') }}
</el-button>
<right-toolbar v-model:showSearch="showSearch" class="ml10" style="float: right;margin-right: 20px"
@queryTable="getDataList"></right-toolbar>
</div>
</el-row>
<el-table :data="state.dataList" v-loading="state.loading" style="width: 100%"
@selection-change="handleSelectionChange" @sort-change="sortChangeHandle">
<el-table-column type="selection" width="60" align="center" />
<el-table-column type="index" :label="t('task.index')" width="80" />
<el-table-column prop="taskId" :label="t('task.taskId')" show-overflow-tooltip />
<el-table-column prop="taskName" :label="t('task.taskName')" show-overflow-tooltip />
<el-table-column prop="time" :label="t('task.time')" show-overflow-tooltip />
<el-table-column :label="$t('common.action')" width="200">
<template #default="scope">
<el-button text type="primary" @click="handleView(scope.row)">流程图
</el-button>
<el-button text type="primary" @click="formDialogRef.openDialog(scope.row.taskId)">审批
</el-button>
<el-button text type="primary" @click="commentDialogRef.openDialog(scope.row.taskId)">批注
</el-button>
</template>
</el-table-column>
</el-table>
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
</el-card>
<div class="layout-padding">
<el-card class="layout-padding-auto">
<el-row v-show="showSearch" class="mb8">
<el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList">
<el-form-item :label="$t('task.taskName')" prop="taskName">
<el-input :placeholder="t('task.inputTaskNameTip')" v-model="state.queryForm.taskName" style="max-width: 180px" />
</el-form-item>
<el-form-item class="ml2">
<el-button formDialogRef icon="search" type="primary" @click="getDataList">
{{ $t('common.queryBtn') }}
</el-button>
<el-button icon="Refresh" formDialogRef @click="resetQuery">{{ $t('common.resetBtn') }}</el-button>
</el-form-item>
</el-form>
</el-row>
<el-row>
<div class="mb8" style="width: 100%">
<el-button formDialogRef icon="Download" type="primary" class="ml10" @click="exportExcel">
{{ $t('common.exportBtn') }}
</el-button>
<el-button formDialogRef :disabled="multiple" icon="Delete" type="primary" class="ml10" @click="handleDelete(selectObjs)">
{{ $t('common.delBtn') }}
</el-button>
<right-toolbar
v-model:showSearch="showSearch"
class="ml10"
style="float: right; margin-right: 20px"
@queryTable="getDataList"
></right-toolbar>
</div>
</el-row>
<el-table
:data="state.dataList"
v-loading="state.loading"
style="width: 100%"
@selection-change="handleSelectionChange"
@sort-change="sortChangeHandle"
>
<el-table-column type="selection" width="60" align="center" />
<el-table-column type="index" :label="t('task.index')" width="80" />
<el-table-column prop="taskId" :label="t('task.taskId')" show-overflow-tooltip />
<el-table-column prop="taskName" :label="t('task.taskName')" show-overflow-tooltip />
<el-table-column prop="time" :label="t('task.time')" show-overflow-tooltip />
<el-table-column :label="$t('common.action')" width="200">
<template #default="scope">
<el-button text type="primary" @click="handleView(scope.row)">流程图 </el-button>
<el-button text type="primary" @click="formDialogRef.openDialog(scope.row.taskId)">审批 </el-button>
<el-button text type="primary" @click="commentDialogRef.openDialog(scope.row.taskId)">批注 </el-button>
</template>
</el-table-column>
</el-table>
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
</el-card>
<!-- 编辑新增 -->
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
<comment-dialog ref="commentDialogRef" @refresh="getDataList(false)" />
<!-- 编辑新增 -->
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
<comment-dialog ref="commentDialogRef" @refresh="getDataList(false)" />
<el-dialog v-model="showPicDialog" title="流程图">
<img :src="actPicUrl" style="width: 100%;">
</el-dialog>
</div>
<el-dialog v-model="showPicDialog" title="流程图">
<img :src="actPicUrl" style="width: 100%" />
</el-dialog>
</div>
</template>
<script setup lang="ts" name="systemTask">
import { BasicTableProps, useTable } from "/@/hooks/table";
import { fetchList ,delObj} from "/@/api/oa/task";
import { useI18n } from "vue-i18n";
import { useMessage,useMessageBox } from "/@/hooks/message";
import { BasicTableProps, useTable } from '/@/hooks/table';
import { fetchList, delObj } from '/@/api/oa/task';
import { useI18n } from 'vue-i18n';
import { useMessage, useMessageBox } from '/@/hooks/message';
import { Session } from '/@/utils/storage';
//
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
const CommentDialog = defineAsyncComponent(() => import('./comment.vue'));
const { t } = useI18n()
const { t } = useI18n();
//
const formDialogRef = ref()
const commentDialogRef = ref()
const formDialogRef = ref();
const commentDialogRef = ref();
//
const queryRef = ref()
const showSearch = ref(true)
const queryRef = ref();
const showSearch = ref(true);
//
const selectObjs = ref([]) as any
const multiple = ref(true)
const selectObjs = ref([]) as any;
const multiple = ref(true);
// URL
const actPicUrl = ref('')
const actPicUrl = ref('');
//
const showPicDialog = ref(false)
const showPicDialog = ref(false);
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {},
pageList: fetchList
})
queryForm: {},
pageList: fetchList,
});
// table hook
const {
getDataList,
currentChangeHandle,
sizeChangeHandle,
sortChangeHandle,
downBlobFile
} = useTable(state)
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile } = useTable(state);
//
const resetQuery = () => {
//
queryRef.value.resetFields()
//
selectObjs.value = []
getDataList()
}
//
queryRef.value.resetFields();
//
selectObjs.value = [];
getDataList();
};
// excel
const exportExcel = () => {
downBlobFile('/admin/task/export', state.queryForm, 'task.xlsx')
}
downBlobFile('/admin/task/export', state.queryForm, 'task.xlsx');
};
//
const handleSelectionChange = (objs: any) => {
selectObjs.value = []
objs.forEach((val: any) => {
selectObjs.value.push(val.taskId)
});
multiple.value = !objs.length
}
selectObjs.value = [];
objs.forEach((val: any) => {
selectObjs.value.push(val.taskId);
});
multiple.value = !objs.length;
};
//
const handleDelete = (ids: string[]) => {
useMessageBox().confirm(t('common.delConfirmText'))
.then(() => {
delObj(ids).then(() => {
getDataList();
useMessage().success(t('common.delSuccessText'));
}).catch((err: any) => {
useMessage().error(err.msg)
})
})
useMessageBox()
.confirm(t('common.delConfirmText'))
.then(() => {
delObj(ids)
.then(() => {
getDataList();
useMessage().success(t('common.delSuccessText'));
})
.catch((err: any) => {
useMessage().error(err.msg);
});
});
};
//
const handleView = (row: any) => {
actPicUrl.value = `/admin/task/view/${row.taskId}`
showPicDialog.value = true
}
actPicUrl.value = `/admin/task/view/${row.taskId}?access_token=${Session.getToken()}&TENANT-ID=${Session.getTenant()}`;
showPicDialog.value = true;
};
</script>