From 7767e500607c8a47d14728f9fc61952e824c8acc Mon Sep 17 00:00:00 2001 From: dengzedong <dengzedong@email> Date: 星期三, 18 九月 2024 09:24:40 +0800 Subject: [PATCH] mpk setting+select --- src/views/mpk/mpk.vue | 47 +++++++++++++++++++++++------------------------ 1 files changed, 23 insertions(+), 24 deletions(-) diff --git a/src/views/mpk/mpk.vue b/src/views/mpk/mpk.vue index 9354e60..fa4fb84 100644 --- a/src/views/mpk/mpk.vue +++ b/src/views/mpk/mpk.vue @@ -25,15 +25,13 @@ <Icon icon="ep:refresh" class="mr-5px"/> 重置 </el-button> - <el-button - type="primary" - plain - @click="openForm('create')" - v-hasPermi="['mpk:create']" - > - <Icon icon="ep:plus" class="mr-5px"/> - 新增 - </el-button> + <div class="ml-12px"> + <router-link :to="'/mpk/form'"> + <el-button type="primary" plain v-hasPermi="['mpk:create']"> + <Icon icon="ep:plus" class="mr-5px"/>新增</el-button> + </router-link> + </div> + </el-form-item> </el-form> </ContentWrap> @@ -45,17 +43,21 @@ :data="list" row-key="id" > + <el-table-column prop="pyChineseName" label="模型中文名称"/> <el-table-column prop="pyName" label="模型名称"/> - <el-table-column prop="pkgName" label="包名"/> - <el-table-column prop="pyModule" label="模型路径" width="200px"/> - <el-table-column prop="remark" label="备注" width="300px"/> + <el-table-column prop="pyType" label="模型类型" :formatter="(r,c,v) => getDictLabel(DICT_TYPE.MODEL_TYPE,v)"/> + <el-table-column prop="menuName" label="所属菜单" width="120px"/> + <el-table-column prop="groupName" label="所属组" width="120px"/> + <el-table-column prop="remark" label="备注" width="200px"/> <el-table-column prop="createDate" label="创建时间" :formatter="dateFormatter" width="170px"/> <el-table-column label="操作" align="center" width="200px"> <template #default="scope"> <div class="flex items-center justify-center"> - <el-button link type="primary" @click="openForm('update', scope.row.id)" v-hasPermi="['mpk:update']"> - <Icon icon="ep:edit"/>修改 - </el-button> + <router-link :to="'/mpk/form/' + scope.row.id"> + <el-button type="primary" link v-hasPermi="['mpk:update']"> + <Icon icon="ep:edit"/>修改 + </el-button> + </router-link> <el-button link type="danger" @click="handleDelete(scope.row.id)" v-hasPermi="['mpk:delete']"> <Icon icon="ep:delete"/>删除 </el-button> @@ -98,8 +100,6 @@ /> </ContentWrap> - <!-- 表单弹窗:添加/修改 --> - <MpkForm ref="formRef" @success="getList"/> <MpkGenerator ref="mpkGenerator"/> <GeneratorCodeHistory ref="generatorCodeHistory"/> <MpkRun ref="mpkRun"/> @@ -107,11 +107,12 @@ <script lang="ts" setup> import {dateFormatter} from '@/utils/formatTime' import * as MpkApi from '@/api/mpk/mpk' - import MpkForm from './MpkForm.vue' import MpkGenerator from './MpkGenerator.vue' import GeneratorCodeHistory from './MpkGeneratorHistory.vue' import MpkRun from './MpkRun.vue' import * as UserApi from "@/api/system/user"; + import { DICT_TYPE, getDictLabel } from '@/utils/dict' + import {useAppStoreWithOut} from "@/store/modules/app"; defineOptions({name: 'Mpk'}) @@ -183,12 +184,6 @@ handleQuery() } - /** 添加/修改操作 */ - const formRef = ref() - const openForm = (type: string, id?: number) => { - formRef.value.open(type, id) - } - /** 删除按钮操作 */ const handleDelete = async (id: number) => { try { @@ -203,6 +198,10 @@ } } + onActivated((to) => { + getList() + }) + /** 初始化 **/ onMounted(async () => { await getList() -- Gitblit v1.9.3