feat: tab页允许手动修改标题 新建流程改为tab页而不是弹框

This commit is contained in:
gaoyunqi
2024-02-05 11:27:33 +08:00
parent 445292105f
commit ec11057a12
7 changed files with 606 additions and 37 deletions

View File

@ -7,23 +7,23 @@
? '!p-0 !pr-7px'
: ''
"
:title="t('流程模板列表')"
:searchConfig="searchConfig"
:title="t('流程模板列表')"
@search="search"
@scroll-height="scrollHeight"
>
<template #left>
<BasicTree
search
:title="t('流程模板分类')"
:clickRowToExpand="true"
:treeData="data.treeData"
:fieldNames="{ key: 'id', title: 'name' }"
:title="t('流程模板分类')"
:treeData="data.treeData"
search
@select="handleSelect"
/>
</template>
<template #search> </template>
<template #search></template>
<template #right>
<div
@ -35,19 +35,20 @@
v-for="(item, index) in data.list"
:key="index"
:item="item"
@click="launchProcess(item.id)"
@click="launchProcessInTab(item.id)"
/>
</div>
<div class="page-box">
<a-pagination
v-model:current="data.pagination.current"
:total="data.pagination.total"
v-model:pageSize="data.pagination.pageSize"
:pageSizeOptions="['18', '36', '54', '72']"
:showSizeChanger="true"
:show-total="(total) => t(`共 {total} 条数据`, { total })"
:showSizeChanger="true"
:total="data.pagination.total"
@change="getList"
/></div>
/>
</div>
</div>
<div v-else>
@ -62,7 +63,7 @@
</PageLayout>
</template>
<script setup lang="ts">
<script lang="ts" setup>
import { onMounted, reactive, ref, unref, watch } from 'vue';
import TemplateCard from '/@bpmn/components/card/TemplateCard.vue';
import { EmptyBox } from '/@/components/ModalPanel/index';
@ -76,8 +77,10 @@
import userTableScrollHeight from '/@/hooks/setting/userTableScrollHeight';
import { useRouter } from 'vue-router';
import { useI18n } from '/@/hooks/web/useI18n';
const { t } = useI18n();
const { currentRoute } = useRouter();
const router = useRouter();
const { currentRoute } = router;
const searchConfig = [
{
field: 'code',
@ -121,12 +124,14 @@
getCategoryTree();
init();
});
async function init() {
data.pagination.current = 1;
data.pagination.total = 0;
data.selectDeptId = '';
await getList();
}
async function getCategoryTree() {
let res = (await getDicDetailList({
itemId: FlowCategory.ID,
@ -136,6 +141,7 @@
return ele;
});
}
async function getList(params?: any) {
const searchParams = {
...{
@ -158,10 +164,24 @@
data.selectDeptId = deptIds[0];
getList();
}
async function launchProcess(id: string) {
data.schemaId = id;
visibleLaunchProcess.value = true;
/*
async function launchProcess(id: string) {
data.schemaId = id;
visibleLaunchProcess.value = true;
}
*/
function launchProcessInTab(id: string) {
router.push({
path: '/flow/createFlow',
query: {
schemaId: id,
tabKey: 'new_' + id,
},
});
}
function search(params: any) {
data.pagination.current = 1;
getList(params);