!130 流程表单:使用异步组件的方式动态加载业务表单指定的查看表单的组件,直接显示到审批页面,不再需要点击查看

Merge pull request !130 from puhui999/dev-to-dev
This commit is contained in:
芋道源码 2023-04-19 11:44:47 +00:00 committed by Gitee
commit d87c02b232
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
7 changed files with 158 additions and 108 deletions

View File

@ -1,10 +1,22 @@
import type { RouteLocationNormalized, Router, RouteRecordNormalized } from 'vue-router'
import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router' import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'
import type { Router, RouteLocationNormalized, RouteRecordNormalized } from 'vue-router'
import { isUrl } from '@/utils/is' import { isUrl } from '@/utils/is'
import { omit, cloneDeep } from 'lodash-es' import { cloneDeep, omit } from 'lodash-es'
const modules = import.meta.glob('../views/**/*.{vue,tsx}') const modules = import.meta.glob('../views/**/*.{vue,tsx}')
/**
*
* @param componentPath :/bpm/oa/leave/detail
*/
export const registerComponent = (componentPath: string) => {
for (const item in modules) {
if (item.includes(componentPath)) {
// 使用异步组件的方式来动态加载组件
// @ts-ignore
return defineAsyncComponent(modules[item])
}
}
}
/* Layout */ /* Layout */
export const Layout = () => import('@/layout/Layout.vue') export const Layout = () => import('@/layout/Layout.vue')

View File

@ -44,10 +44,13 @@ import { CommonStatusEnum } from '@/utils/constants'
import * as FormApi from '@/api/bpm/form' import * as FormApi from '@/api/bpm/form'
import FcDesigner from '@form-create/designer' import FcDesigner from '@form-create/designer'
import { encodeConf, encodeFields, setConfAndFields } from '@/utils/formCreate' import { encodeConf, encodeFields, setConfAndFields } from '@/utils/formCreate'
import { useTagsViewStore } from '@/store/modules/tagsView'
const { t } = useI18n() // const { t } = useI18n() //
const message = useMessage() // const message = useMessage() //
const { query } = useRoute() // const { push, currentRoute } = useRouter() //
const { query } = useRoute() //
const { delView } = useTagsViewStore() //
const designer = ref() // const designer = ref() //
const dialogVisible = ref(false) // const dialogVisible = ref(false) //
@ -88,10 +91,16 @@ const submitForm = async () => {
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
} }
dialogVisible.value = false dialogVisible.value = false
close()
} finally { } finally {
formLoading.value = false formLoading.value = false
} }
} }
/** 关闭按钮 */
const close = () => {
delView(unref(currentRoute))
push('/bpm/manager/form')
}
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {

View File

@ -2,26 +2,33 @@
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<el-form <el-form
class="-mb-15px"
:model="queryParams"
ref="queryFormRef" ref="queryFormRef"
:inline="true" :inline="true"
:model="queryParams"
class="-mb-15px"
label-width="68px" label-width="68px"
> >
<el-form-item label="表单名" prop="name"> <el-form-item label="表单名" prop="name">
<el-input <el-input
v-model="queryParams.name" v-model="queryParams.name"
placeholder="请输入表单名"
clearable
@keyup.enter="handleQuery"
class="!w-240px" class="!w-240px"
clearable
placeholder="请输入表单名"
@keyup.enter="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button> <el-button @click="handleQuery">
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button> <Icon class="mr-5px" icon="ep:search" />
<el-button type="primary" plain @click="openForm" v-hasPermi="['bpm:form:create']"> 搜索
<Icon icon="ep:plus" class="mr-5px" /> 新增 </el-button>
<el-button @click="resetQuery">
<Icon class="mr-5px" icon="ep:refresh" />
重置
</el-button>
<el-button v-hasPermi="['bpm:form:create']" plain type="primary" @click="openForm">
<Icon class="mr-5px" icon="ep:plus" />
新增
</el-button> </el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -30,38 +37,38 @@
<!-- 列表 --> <!-- 列表 -->
<ContentWrap> <ContentWrap>
<el-table v-loading="loading" :data="list"> <el-table v-loading="loading" :data="list">
<el-table-column label="编号" align="center" prop="id" /> <el-table-column align="center" label="编号" prop="id" />
<el-table-column label="表单名" align="center" prop="name" /> <el-table-column align="center" label="表单名" prop="name" />
<el-table-column label="状态" align="center" prop="status"> <el-table-column align="center" label="状态" prop="status">
<template #default="scope"> <template #default="scope">
<dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status" /> <dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="备注" align="center" prop="remark" /> <el-table-column align="center" label="备注" prop="remark" />
<el-table-column <el-table-column
label="创建时间"
align="center"
prop="createTime"
:formatter="dateFormatter" :formatter="dateFormatter"
align="center"
label="创建时间"
prop="createTime"
/> />
<el-table-column label="操作" align="center"> <el-table-column align="center" label="操作">
<template #default="scope"> <template #default="scope">
<el-button <el-button
v-hasPermi="['bpm:form:update']"
link link
type="primary" type="primary"
@click="openForm(scope.row.id)" @click="openForm(scope.row.id)"
v-hasPermi="['bpm:form:update']"
> >
编辑 编辑
</el-button> </el-button>
<el-button link @click="openDetail(scope.row.id)" v-hasPermi="['bpm:form:query']"> <el-button v-hasPermi="['bpm:form:query']" link @click="openDetail(scope.row.id)">
详情 详情
</el-button> </el-button>
<el-button <el-button
v-hasPermi="['bpm:form:delete']"
link link
type="danger" type="danger"
@click="handleDelete(scope.row.id)" @click="handleDelete(scope.row.id)"
v-hasPermi="['bpm:form:delete']"
> >
删除 删除
</el-button> </el-button>
@ -70,27 +77,28 @@
</el-table> </el-table>
<!-- 分页 --> <!-- 分页 -->
<Pagination <Pagination
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize" v-model:limit="queryParams.pageSize"
v-model:page="queryParams.pageNo"
:total="total"
@pagination="getList" @pagination="getList"
/> />
</ContentWrap> </ContentWrap>
<!-- 表单详情的弹窗 --> <!-- 表单详情的弹窗 -->
<Dialog title="表单详情" v-model="detailVisible" width="800"> <Dialog v-model="detailVisible" title="表单详情" width="800">
<form-create :rule="detailData.rule" :option="detailData.option" /> <form-create :option="detailData.option" :rule="detailData.rule" />
</Dialog> </Dialog>
</template> </template>
<script setup lang="ts" name="BpmForm"> <script lang="ts" name="BpmForm" setup>
import { DICT_TYPE } from '@/utils/dict' import { DICT_TYPE } from '@/utils/dict'
import { dateFormatter } from '@/utils/formatTime' import { dateFormatter } from '@/utils/formatTime'
import * as FormApi from '@/api/bpm/form' import * as FormApi from '@/api/bpm/form'
import { setConfAndFields2 } from '@/utils/formCreate' import { setConfAndFields2 } from '@/utils/formCreate'
const message = useMessage() // const message = useMessage() //
const { t } = useI18n() // const { t } = useI18n() //
const { push } = useRouter() // const { currentRoute, push } = useRouter() //
const loading = ref(true) // const loading = ref(true) //
const total = ref(0) // const total = ref(0) //
@ -128,12 +136,16 @@ const resetQuery = () => {
/** 添加/修改操作 */ /** 添加/修改操作 */
const openForm = (id?: number) => { const openForm = (id?: number) => {
push({ const toRouter: { name: string; query?: { id: number } } = {
name: 'BpmFormEditor', name: 'BpmFormEditor'
query: { }
// idevent
if (typeof id === 'number') {
toRouter.query = {
id id
} }
}) }
push(toRouter)
} }
/** 删除按钮操作 */ /** 删除按钮操作 */
@ -162,7 +174,16 @@ const openDetail = async (rowId: number) => {
// //
detailVisible.value = true detailVisible.value = true
} }
/**表单保存返回后重新加载列表 */
watch(
() => currentRoute.value,
() => {
getList()
},
{
immediate: true
}
)
/** 初始化 **/ /** 初始化 **/
onMounted(() => { onMounted(() => {
getList() getList()

View File

@ -11,7 +11,7 @@
<el-input v-model="formData.name" placeholder="请输入组名" /> <el-input v-model="formData.name" placeholder="请输入组名" />
</el-form-item> </el-form-item>
<el-form-item label="描述"> <el-form-item label="描述">
<el-input v-model="formData.name" placeholder="请输入描述" type="textarea" /> <el-input v-model="formData.description" placeholder="请输入描述" type="textarea" />
</el-form-item> </el-form-item>
<el-form-item label="成员" prop="memberUserIds"> <el-form-item label="成员" prop="memberUserIds">
<el-select v-model="formData.memberUserIds" multiple placeholder="请选择成员"> <el-select v-model="formData.memberUserIds" multiple placeholder="请选择成员">

View File

@ -1,6 +1,6 @@
<template> <template>
<ContentWrap> <ContentWrap>
<el-descriptions border :column="1"> <el-descriptions :column="1" border>
<el-descriptions-item label="请假类型"> <el-descriptions-item label="请假类型">
<dict-tag :type="DICT_TYPE.BPM_OA_LEAVE_TYPE" :value="detailData.type" /> <dict-tag :type="DICT_TYPE.BPM_OA_LEAVE_TYPE" :value="detailData.type" />
</el-descriptions-item> </el-descriptions-item>
@ -21,6 +21,7 @@ import { DICT_TYPE } from '@/utils/dict'
import { formatDate } from '@/utils/formatTime' import { formatDate } from '@/utils/formatTime'
import { propTypes } from '@/utils/propTypes' import { propTypes } from '@/utils/propTypes'
import * as LeaveApi from '@/api/bpm/leave' import * as LeaveApi from '@/api/bpm/leave'
const { query } = useRoute() // const { query } = useRoute() //
const props = defineProps({ const props = defineProps({
@ -34,7 +35,7 @@ const queryId = query.id as unknown as number // 从 URL 传递过来的 id 编
const getInfo = async () => { const getInfo = async () => {
detailLoading.value = true detailLoading.value = true
try { try {
detailData.value = await LeaveApi.getLeave(queryId || props.id) detailData.value = await LeaveApi.getLeave(props.id || queryId)
} finally { } finally {
detailLoading.value = false detailLoading.value = false
} }

View File

@ -2,81 +2,78 @@
<ContentWrap> <ContentWrap>
<!-- 审批信息 --> <!-- 审批信息 -->
<el-card <el-card
class="box-card"
v-loading="processInstanceLoading"
v-for="(item, index) in runningTasks" v-for="(item, index) in runningTasks"
:key="index" :key="index"
v-loading="processInstanceLoading"
class="box-card"
> >
<template #header> <template #header>
<span class="el-icon-picture-outline">审批任务{{ item.name }}</span> <span class="el-icon-picture-outline">审批任务{{ item.name }}</span>
</template> </template>
<el-col :span="16" :offset="6"> <el-col :offset="6" :span="16">
<el-form <el-form
:ref="'form' + index" :ref="'form' + index"
:model="auditForms[index]" :model="auditForms[index]"
:rules="auditRule" :rules="auditRule"
label-width="100px" label-width="100px"
> >
<el-form-item label="流程名" v-if="processInstance && processInstance.name"> <el-form-item v-if="processInstance && processInstance.name" label="流程名">
{{ processInstance.name }} {{ processInstance.name }}
</el-form-item> </el-form-item>
<el-form-item label="流程发起人" v-if="processInstance && processInstance.startUser"> <el-form-item v-if="processInstance && processInstance.startUser" label="流程发起人">
{{ processInstance.startUser.nickname }} {{ processInstance.startUser.nickname }}
<el-tag type="info" size="small">{{ processInstance.startUser.deptName }}</el-tag> <el-tag size="small" type="info">{{ processInstance.startUser.deptName }}</el-tag>
</el-form-item> </el-form-item>
<el-form-item label="审批建议" prop="reason"> <el-form-item label="审批建议" prop="reason">
<el-input <el-input
type="textarea"
v-model="auditForms[index].reason" v-model="auditForms[index].reason"
placeholder="请输入审批建议" placeholder="请输入审批建议"
type="textarea"
/> />
</el-form-item> </el-form-item>
</el-form> </el-form>
<div style="margin-left: 10%; margin-bottom: 20px; font-size: 14px"> <div style="margin-left: 10%; margin-bottom: 20px; font-size: 14px">
<el-button type="success" @click="handleAudit(item, true)"> <el-button type="success" @click="handleAudit(item, true)">
<Icon icon="ep:select" /> 通过 <Icon icon="ep:select" />
通过
</el-button> </el-button>
<el-button type="danger" @click="handleAudit(item, false)"> <el-button type="danger" @click="handleAudit(item, false)">
<Icon icon="ep:close" /> 不通过 <Icon icon="ep:close" />
不通过
</el-button> </el-button>
<el-button type="primary" @click="openTaskUpdateAssigneeForm(item.id)"> <el-button type="primary" @click="openTaskUpdateAssigneeForm(item.id)">
<Icon icon="ep:edit" /> 转办 <Icon icon="ep:edit" />
转办
</el-button> </el-button>
<el-button type="primary" @click="handleDelegate(item)"> <el-button type="primary" @click="handleDelegate(item)">
<Icon icon="ep:position" /> 委派 <Icon icon="ep:position" />
委派
</el-button> </el-button>
<el-button type="warning" @click="handleBack(item)"> <el-button type="warning" @click="handleBack(item)">
<Icon icon="ep:back" /> 回退 <Icon icon="ep:back" />
回退
</el-button> </el-button>
</div> </div>
</el-col> </el-col>
</el-card> </el-card>
<!-- 申请信息 --> <!-- 申请信息 -->
<el-card class="box-card" v-loading="processInstanceLoading"> <el-card v-loading="processInstanceLoading" class="box-card">
<template #header> <template #header>
<span class="el-icon-document">申请信息{{ processInstance.name }}</span> <span class="el-icon-document">申请信息{{ processInstance.name }}</span>
</template> </template>
<!-- 情况一流程表单 --> <!-- 情况一流程表单 -->
<el-col v-if="processInstance?.processDefinition?.formType === 10" :span="16" :offset="6"> <el-col v-if="processInstance?.processDefinition?.formType === 10" :offset="6" :span="16">
<form-create <form-create
ref="fApi" ref="fApi"
:rule="detailForm.rule"
:option="detailForm.option"
v-model="detailForm.value" v-model="detailForm.value"
:option="detailForm.option"
:rule="detailForm.rule"
/> />
</el-col> </el-col>
<!-- 情况二流程表单 --> <!-- 情况二业务表单 -->
<div v-if="processInstance?.processDefinition?.formType === 20"> <div v-if="processInstance?.processDefinition?.formType === 20">
<router-link <autoComponent :id="processInstance.businessKey" />
:to="
processInstance.processDefinition.formCustomViewPath +
'?id=' +
processInstance.businessKey
"
>
<el-button type="primary"><Icon icon="ep:view" /> 点击查看</el-button>
</router-link>
</div> </div>
</el-card> </el-card>
@ -85,18 +82,18 @@
<!-- 高亮流程图 --> <!-- 高亮流程图 -->
<ProcessInstanceBpmnViewer <ProcessInstanceBpmnViewer
:id="id" :id="`${id}`"
:process-instance="processInstance"
:loading="processInstanceLoading"
:tasks="tasks"
:bpmn-xml="bpmnXML" :bpmn-xml="bpmnXML"
:loading="processInstanceLoading"
:process-instance="processInstance"
:tasks="tasks"
/> />
<!-- 弹窗转派审批人 --> <!-- 弹窗转派审批人 -->
<TaskUpdateAssigneeForm ref="taskUpdateAssigneeFormRef" @success="getDetail" /> <TaskUpdateAssigneeForm ref="taskUpdateAssigneeFormRef" @success="getDetail" />
</ContentWrap> </ContentWrap>
</template> </template>
<script setup lang="ts" name="BpmProcessInstanceDetail"> <script lang="ts" name="BpmProcessInstanceDetail" setup>
import { useUserStore } from '@/store/modules/user' import { useUserStore } from '@/store/modules/user'
import { setConfAndFields2 } from '@/utils/formCreate' import { setConfAndFields2 } from '@/utils/formCreate'
import type { ApiAttrs } from '@form-create/element-ui/types/config' import type { ApiAttrs } from '@form-create/element-ui/types/config'
@ -106,6 +103,8 @@ import * as TaskApi from '@/api/bpm/task'
import TaskUpdateAssigneeForm from './TaskUpdateAssigneeForm.vue' import TaskUpdateAssigneeForm from './TaskUpdateAssigneeForm.vue'
import ProcessInstanceBpmnViewer from './ProcessInstanceBpmnViewer.vue' import ProcessInstanceBpmnViewer from './ProcessInstanceBpmnViewer.vue'
import ProcessInstanceTaskList from './ProcessInstanceTaskList.vue' import ProcessInstanceTaskList from './ProcessInstanceTaskList.vue'
import { registerComponent } from '@/utils/routerHelper'
const { query } = useRoute() // const { query } = useRoute() //
const message = useMessage() // const message = useMessage() //
const { proxy } = getCurrentInstance() as any const { proxy } = getCurrentInstance() as any
@ -184,7 +183,7 @@ const getDetail = () => {
// 2. // 2.
getTaskList() getTaskList()
} }
const autoComponent = ref(null) //
/** 加载流程实例 */ /** 加载流程实例 */
const getProcessInstance = async () => { const getProcessInstance = async () => {
try { try {
@ -195,7 +194,7 @@ const getProcessInstance = async () => {
return return
} }
processInstance.value = data processInstance.value = data
autoComponent.value = registerComponent(data.processDefinition.formCustomViewPath)
// //
const processDefinition = data.processDefinition const processDefinition = data.processDefinition
if (processDefinition.formType === 10) { if (processDefinition.formType === 10) {
@ -213,7 +212,7 @@ const getProcessInstance = async () => {
} }
// //
bpmnXML.value = await DefinitionApi.getProcessDefinitionBpmnXML(processDefinition.id) bpmnXML.value = await DefinitionApi.getProcessDefinitionBpmnXML(processDefinition.id as number)
} finally { } finally {
processInstanceLoading.value = false processInstanceLoading.value = false
} }

View File

@ -5,46 +5,53 @@
<!-- 搜索 --> <!-- 搜索 -->
<ContentWrap> <ContentWrap>
<el-form <el-form
class="-mb-15px"
:model="queryParams"
ref="queryFormRef" ref="queryFormRef"
:inline="true" :inline="true"
:model="queryParams"
class="-mb-15px"
label-width="68px" label-width="68px"
> >
<el-form-item label="表名称" prop="tableName"> <el-form-item label="表名称" prop="tableName">
<el-input <el-input
v-model="queryParams.tableName" v-model="queryParams.tableName"
placeholder="请输入表名称"
clearable
@keyup.enter="handleQuery"
class="!w-240px" class="!w-240px"
clearable
placeholder="请输入表名称"
@keyup.enter="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="表描述" prop="tableComment"> <el-form-item label="表描述" prop="tableComment">
<el-input <el-input
v-model="queryParams.tableComment" v-model="queryParams.tableComment"
placeholder="请输入表描述"
clearable
@keyup.enter="handleQuery"
class="!w-240px" class="!w-240px"
clearable
placeholder="请输入表描述"
@keyup.enter="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="创建时间" prop="createTime"> <el-form-item label="创建时间" prop="createTime">
<el-date-picker <el-date-picker
v-model="queryParams.createTime" v-model="queryParams.createTime"
value-format="YYYY-MM-dd HH:mm:ss"
type="daterange"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]" :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
class="!w-240px" class="!w-240px"
end-placeholder="结束日期"
start-placeholder="开始日期"
type="daterange"
value-format="YYYY-MM-dd HH:mm:ss"
/> />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" />搜索</el-button> <el-button @click="handleQuery">
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" />重置</el-button> <Icon class="mr-5px" icon="ep:search" />
<el-button type="primary" v-hasPermi="['infra:codegen:create']" @click="openImportTable()"> 搜索
<Icon icon="ep:zoom-in" class="mr-5px" /> 导入 </el-button>
<el-button @click="resetQuery">
<Icon class="mr-5px" icon="ep:refresh" />
重置
</el-button>
<el-button v-hasPermi="['infra:codegen:create']" type="primary" @click="openImportTable()">
<Icon class="mr-5px" icon="ep:zoom-in" />
导入
</el-button> </el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -53,75 +60,75 @@
<!-- 列表 --> <!-- 列表 -->
<ContentWrap> <ContentWrap>
<el-table v-loading="loading" :data="list"> <el-table v-loading="loading" :data="list">
<el-table-column label="数据源" align="center"> <el-table-column align="center" label="数据源">
<template #default="scope"> <template #default="scope">
{{ {{
dataSourceConfigList.find((config) => config.id === scope.row.dataSourceConfigId)?.name dataSourceConfigList.find((config) => config.id === scope.row.dataSourceConfigId)?.name
}} }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="表名称" align="center" prop="tableName" width="200" /> <el-table-column align="center" label="表名称" prop="tableName" width="200" />
<el-table-column <el-table-column
label="表描述"
align="center"
prop="tableComment"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
align="center"
label="表描述"
prop="tableComment"
width="200" width="200"
/> />
<el-table-column label="实体" align="center" prop="className" width="200" /> <el-table-column align="center" label="实体" prop="className" width="200" />
<el-table-column <el-table-column
:formatter="dateFormatter"
align="center"
label="创建时间" label="创建时间"
align="center"
prop="createTime" prop="createTime"
width="180" width="180"
:formatter="dateFormatter"
/> />
<el-table-column <el-table-column
label="更新时间" :formatter="dateFormatter"
align="center" align="center"
label="更新时间"
prop="createTime" prop="createTime"
width="180" width="180"
:formatter="dateFormatter"
/> />
<el-table-column label="操作" align="center" width="300px" fixed="right"> <el-table-column align="center" fixed="right" label="操作" width="300px">
<template #default="scope"> <template #default="scope">
<el-button <el-button
v-hasPermi="['infra:codegen:preview']"
link link
type="primary" type="primary"
@click="handlePreview(scope.row)" @click="handlePreview(scope.row)"
v-hasPermi="['infra:codegen:preview']"
> >
预览 预览
</el-button> </el-button>
<el-button <el-button
v-hasPermi="['infra:codegen:update']"
link link
type="primary" type="primary"
@click="handleUpdate(scope.row.id)" @click="handleUpdate(scope.row.id)"
v-hasPermi="['infra:codegen:update']"
> >
编辑 编辑
</el-button> </el-button>
<el-button <el-button
v-hasPermi="['infra:codegen:delete']"
link link
type="danger" type="danger"
@click="handleDelete(scope.row.id)" @click="handleDelete(scope.row.id)"
v-hasPermi="['infra:codegen:delete']"
> >
删除 删除
</el-button> </el-button>
<el-button <el-button
v-hasPermi="['infra:codegen:update']"
link link
type="primary" type="primary"
@click="handleSyncDB(scope.row)" @click="handleSyncDB(scope.row)"
v-hasPermi="['infra:codegen:update']"
> >
同步 同步
</el-button> </el-button>
<el-button <el-button
v-hasPermi="['infra:codegen:download']"
link link
type="primary" type="primary"
@click="handleGenTable(scope.row)" @click="handleGenTable(scope.row)"
v-hasPermi="['infra:codegen:download']"
> >
生成代码 生成代码
</el-button> </el-button>
@ -130,25 +137,26 @@
</el-table> </el-table>
<!-- 分页 --> <!-- 分页 -->
<Pagination <Pagination
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize" v-model:limit="queryParams.pageSize"
v-model:page="queryParams.pageNo"
:total="total"
@pagination="getList" @pagination="getList"
/> />
</ContentWrap> </ContentWrap>
<!-- 弹窗导入表 --> <!-- 弹窗导入表 -->
<ImportTable ref="importRef" success="getList" /> <ImportTable ref="importRef" @success="getList" />
<!-- 弹窗预览代码 --> <!-- 弹窗预览代码 -->
<PreviewCode ref="previewRef" /> <PreviewCode ref="previewRef" />
</template> </template>
<script setup lang="ts" name="InfraCodegen"> <script lang="ts" name="InfraCodegen" setup>
import { dateFormatter } from '@/utils/formatTime' import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download' import download from '@/utils/download'
import * as CodegenApi from '@/api/infra/codegen' import * as CodegenApi from '@/api/infra/codegen'
import * as DataSourceConfigApi from '@/api/infra/dataSourceConfig' import * as DataSourceConfigApi from '@/api/infra/dataSourceConfig'
import ImportTable from './ImportTable.vue' import ImportTable from './ImportTable.vue'
import PreviewCode from './PreviewCode.vue' import PreviewCode from './PreviewCode.vue'
const message = useMessage() // const message = useMessage() //
const { t } = useI18n() // const { t } = useI18n() //
const { push } = useRouter() // const { push } = useRouter() //