已修改12个文件
已重命名4个文件
已删除12个文件
已添加9个文件
对比新文件 |
| | |
| | | import request from '@/config/axios' |
| | | |
| | | export interface MpkGroupVO { |
| | | id: string |
| | | name: string |
| | | sort: number |
| | | } |
| | | |
| | | // 查询列表 |
| | | export const getList = () => { |
| | | return request.get({ url: '/model/mpk/group/list' }) |
| | | } |
| | | |
| | | // 获得 |
| | | export const getGroup = (id: number) => { |
| | | return request.get({ url: '/model/mpk/group/get?id=' + id }) |
| | | } |
| | | |
| | | // 新增 |
| | | export const createGroup = (data: MpkIconVO) => { |
| | | return request.post({ url: '/model/mpk/group/create', data }) |
| | | } |
| | | |
| | | // 修改 |
| | | export const updateGroup = (data: MpkIconVO) => { |
| | | return request.put({ url: '/model/mpk/group/update', data }) |
| | | } |
| | | |
| | | // 删除 |
| | | export const deleteGroup = (id: string) => { |
| | | return request.delete({ url: '/model/mpk/group/delete?id=' + id }) |
| | | } |
对比新文件 |
| | |
| | | import request from '@/config/axios' |
| | | |
| | | export interface MpkIconVO { |
| | | id: string |
| | | iconName: string |
| | | iconDesc: string |
| | | sort: number |
| | | } |
| | | |
| | | export interface MpkIconPageReqVO extends PageParam { |
| | | iconName?: string |
| | | } |
| | | |
| | | // 查询分页列表 |
| | | export const getPage = (params: MpkIconPageReqVO) => { |
| | | return request.get({ url: '/model/mpk/icon/page', params }) |
| | | } |
| | | |
| | | // 查询列表 |
| | | export const getList = () => { |
| | | return request.get({ url: '/model/mpk/icon/list' }) |
| | | } |
| | | |
| | | // 获得 |
| | | export const getIcon = (id: number) => { |
| | | return request.get({ url: '/model/mpk/icon/get?id=' + id }) |
| | | } |
| | | |
| | | // 新增 |
| | | export const createIcon = (data: MpkIconVO) => { |
| | | return request.post({ url: '/model/mpk/icon/create', data }) |
| | | } |
| | | |
| | | // 修改 |
| | | export const updateIcon = (data: MpkIconVO) => { |
| | | return request.put({ url: '/model/mpk/icon/update', data }) |
| | | } |
| | | |
| | | // 删除 |
| | | export const deleteIcon = (id: string) => { |
| | | return request.delete({ url: '/model/mpk/icon/delete?id=' + id }) |
| | | } |
对比新文件 |
| | |
| | | import request from '@/config/axios' |
| | | |
| | | export interface MpkMenuVO { |
| | | id: string |
| | | name: string |
| | | sort: number |
| | | } |
| | | |
| | | // 查询列表 |
| | | export const getList = () => { |
| | | return request.get({ url: '/model/mpk/menu/list' }) |
| | | } |
| | | |
| | | // 获得 |
| | | export const getMenu = (id: number) => { |
| | | return request.get({ url: '/model/mpk/menu/get?id=' + id }) |
| | | } |
| | | |
| | | // 新增 |
| | | export const createMenu = (data: MpkIconVO) => { |
| | | return request.post({ url: '/model/mpk/menu/create', data }) |
| | | } |
| | | |
| | | // 修改 |
| | | export const updateMenu = (data: MpkIconVO) => { |
| | | return request.put({ url: '/model/mpk/menu/update', data }) |
| | | } |
| | | |
| | | // 删除 |
| | | export const deleteMenu = (id: string) => { |
| | | return request.delete({ url: '/model/mpk/menu/delete?id=' + id }) |
| | | } |
| | |
| | | component: () => import('@/views/model/mpk/file/MpkForm.vue'), |
| | | name: 'MpkForm', |
| | | meta: { |
| | | title: 'Mpk表单', |
| | | title: 'MDK表单', |
| | | noCache: true, |
| | | hidden: true, |
| | | canTo: true, |
| | |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import {DICT_TYPE, getDictOptions} from '@/utils/dict' |
| | | import * as MpkApi from '@/api/mpk/mpk' |
| | | import * as MpkApi from '@/api/model/mpk/mpk' |
| | | import {FormRules} from 'element-plus' |
| | | import {getAccessToken, getTenantId} from "@/utils/auth"; |
| | | import SettingForm from './SettingForm.vue' |
| | |
| | | </Dialog> |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import * as MpkApi from '@/api/mpk/mpk' |
| | | import * as MpkApi from '@/api/model/mpk/mpk' |
| | | import download from "@/utils/download"; |
| | | import {formatToDateString} from "@/utils/dateUtil"; |
| | | |
| | |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import download from "@/utils/download"; |
| | | import * as HistoryApi from "@/api/mpk/mpkHistory"; |
| | | import * as HistoryApi from "@/api/model/mpk/mpkHistory"; |
| | | import { dateFormatter } from '@/utils/formatTime' |
| | | |
| | | |
| | |
| | | </Dialog> |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import * as MpkApi from '@/api/mpk/mpk' |
| | | import * as MpkApi from '@/api/model/mpk/mpk' |
| | | import {FormRules} from "element-plus"; |
| | | import {getAccessToken, getTenantId} from "@/utils/auth"; |
| | | |
| | |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import {DICT_TYPE,getDictOptions} from '@/utils/dict'; |
| | | import * as ProjectApi from '@/api/mpk/project' |
| | | import * as MpkApi from '@/api/mpk/mpk' |
| | | import * as ProjectApi from '@/api/model/mpk/project' |
| | | import * as MpkApi from '@/api/model/mpk/mpk' |
| | | import {FormRules} from 'element-plus' |
| | | import {generateUUID} from "@/utils"; |
| | | import {func} from "vue-types"; |
| | |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import {dateFormatter} from '@/utils/formatTime' |
| | | import * as MpkApi from '@/api/mpk/mpk' |
| | | import * as MpkApi from '@/api/model/mpk/mpk' |
| | | import MpkGenerator from './MpkGenerator.vue' |
| | | import GeneratorCodeHistory from './MpkGeneratorHistory.vue' |
| | | import MpkRun from './MpkRun.vue' |
对比新文件 |
| | |
| | | <template> |
| | | <Dialog v-model="dialogVisible" :title="dialogTitle"> |
| | | <el-form |
| | | ref="formRef" |
| | | v-loading="formLoading" |
| | | :model="formData" |
| | | :rules="formRules" |
| | | label-width="80px" |
| | | > |
| | | <el-form-item label="图标名称" prop="iconName"> |
| | | <el-input v-model="formData.iconName" placeholder="请输入图标名称" /> |
| | | </el-form-item> |
| | | <el-form-item label="图标描述" prop="iconDesc"> |
| | | <el-input v-model="formData.iconDesc" placeholder="请输入图标描述" /> |
| | | </el-form-item> |
| | | <el-form-item label="排序" prop="sort"> |
| | | <el-input v-model="formData.sort" placeholder="请输入排序" /> |
| | | </el-form-item> |
| | | |
| | | </el-form> |
| | | <template #footer> |
| | | <el-button :disabled="formLoading" type="primary" @click="submitForm">确 定</el-button> |
| | | <el-button @click="dialogVisible = false">取 消</el-button> |
| | | </template> |
| | | </Dialog> |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import * as MpkIconApi from '@/api/model/mpk/icon' |
| | | import {deleteIcon} from "@/api/model/mpk/icon"; |
| | | |
| | | defineOptions({ name: 'MpkIconForm' }) |
| | | |
| | | const { t } = useI18n() // 国际化 |
| | | const message = useMessage() // 消息弹窗 |
| | | |
| | | const dialogVisible = ref(false) // 弹窗的是否展示 |
| | | const dialogTitle = ref('') // 弹窗的标题 |
| | | const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用 |
| | | const formType = ref('') // 表单的类型:create - 新增;update - 修改 |
| | | const formData = ref({ |
| | | id: undefined, |
| | | iconName: '', |
| | | iconDesc: '', |
| | | sort: undefined |
| | | }) |
| | | const formRules = reactive({ |
| | | iconName: [{ required: true, message: '名称不能为空', trigger: 'blur' }] |
| | | }) |
| | | const formRef = ref() // 表单 Ref |
| | | |
| | | /** 打开弹窗 */ |
| | | const open = async (type: string, id?: string) => { |
| | | dialogVisible.value = true |
| | | dialogTitle.value = t('action.' + type) |
| | | formType.value = type |
| | | resetForm() |
| | | // 修改时,设置数据 |
| | | if (id) { |
| | | formLoading.value = true |
| | | try { |
| | | formData.value = await MpkIconApi.getIcon(id) |
| | | } finally { |
| | | formLoading.value = false |
| | | } |
| | | } |
| | | } |
| | | defineExpose({ open }) // 提供 open 方法,用于打开弹窗 |
| | | |
| | | /** 提交表单 */ |
| | | const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调 |
| | | const submitForm = async () => { |
| | | // 校验表单 |
| | | if (!formRef) return |
| | | const valid = await formRef.value.validate() |
| | | if (!valid) return |
| | | // 提交请求 |
| | | formLoading.value = true |
| | | try { |
| | | const data = formData.value as MpkIconApi.MpkIconVO |
| | | if (formType.value === 'create') { |
| | | await MpkIconApi.createIcon(data) |
| | | message.success(t('common.createSuccess')) |
| | | } else { |
| | | await MpkIconApi.updateIcon(data) |
| | | message.success(t('common.updateSuccess')) |
| | | } |
| | | dialogVisible.value = false |
| | | // 发送操作成功的事件 |
| | | emit('success') |
| | | } finally { |
| | | formLoading.value = false |
| | | } |
| | | } |
| | | |
| | | /** 重置表单 */ |
| | | const resetForm = () => { |
| | | formData.value = { |
| | | id: undefined, |
| | | iconName: '', |
| | | iconDesc: '', |
| | | sort: undefined |
| | | } |
| | | formRef.value?.resetFields() |
| | | } |
| | | </script> |
对比新文件 |
| | |
| | | <template> |
| | | <!-- 搜索工作栏 --> |
| | | <ContentWrap> |
| | | <el-form |
| | | class="-mb-15px" |
| | | :model="queryParams" |
| | | ref="queryFormRef" |
| | | :inline="true" |
| | | label-width="68px" |
| | | > |
| | | <el-form-item label="模型名称" prop="iconName"> |
| | | <el-input |
| | | v-model="queryParams.iconName" |
| | | placeholder="请输入名称" |
| | | clearable |
| | | class="!w-240px" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button @click="handleQuery"> |
| | | <Icon icon="ep:search" class="mr-5px"/> |
| | | 搜索 |
| | | </el-button> |
| | | <el-button @click="resetQuery"> |
| | | <Icon icon="ep:refresh" class="mr-5px"/> |
| | | 重置 |
| | | </el-button> |
| | | <el-button |
| | | type="primary" |
| | | plain |
| | | @click="openForm('create')" |
| | | v-hasPermi="['mpk:icon:create']" |
| | | > |
| | | <Icon icon="ep:plus" class="mr-5px" /> |
| | | 新增 |
| | | </el-button> |
| | | |
| | | </el-form-item> |
| | | </el-form> |
| | | </ContentWrap> |
| | | |
| | | <!-- 列表 --> |
| | | <ContentWrap> |
| | | <el-table |
| | | v-loading="loading" |
| | | :data="list" |
| | | row-key="id" |
| | | > |
| | | <el-table-column prop="iconName" label="名称"/> |
| | | <el-table-column prop="iconDesc" label="描述"/> |
| | | <el-table-column prop="sort" label="排序"/> |
| | | <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:icon:update']" |
| | | > |
| | | 编辑 |
| | | </el-button> |
| | | <el-button link type="danger" @click="handleDelete(scope.row.id)" v-hasPermi="['mpk:icon:delete']"> |
| | | <Icon icon="ep:delete"/>删除 |
| | | </el-button> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <!-- 分页 --> |
| | | <Pagination |
| | | v-model:limit="queryParams.pageSize" |
| | | v-model:page="queryParams.page" |
| | | :total="total" |
| | | @pagination="getList" |
| | | /> |
| | | </ContentWrap> |
| | | |
| | | <!-- 表单弹窗:添加/修改 --> |
| | | <IconForm ref="formRef" @success="getList" /> |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import {dateFormatter} from '@/utils/formatTime' |
| | | import * as MpkIconApi from '@/api/model/mpk/icon' |
| | | import IconForm from './IconForm.vue' |
| | | |
| | | defineOptions({name: 'MpkIcon'}) |
| | | |
| | | const message = useMessage() // 消息弹窗 |
| | | const {t} = useI18n() // 国际化 |
| | | |
| | | const loading = ref(true) // 列表的加载中 |
| | | const total = ref(0) // 列表的总页数 |
| | | const list = ref([]) // 字典表格数据 |
| | | const queryParams = reactive({ |
| | | page: 1, |
| | | pageSize: 10, |
| | | iconName: '' |
| | | }) |
| | | const queryFormRef = ref() // 搜索的表单 |
| | | |
| | | const getList = async () => { |
| | | loading.value = true |
| | | try { |
| | | const data = await MpkIconApi.getPage(queryParams) |
| | | list.value = data.list |
| | | total.value = data.total |
| | | } finally { |
| | | loading.value = false |
| | | } |
| | | } |
| | | |
| | | /** 搜索按钮操作 */ |
| | | const handleQuery = () => { |
| | | getList() |
| | | } |
| | | |
| | | /** 重置按钮操作 */ |
| | | const resetQuery = () => { |
| | | queryParams.page = 1 |
| | | queryFormRef.value.resetFields() |
| | | handleQuery() |
| | | } |
| | | |
| | | /** 添加/修改操作 */ |
| | | const formRef = ref() |
| | | const openForm = (type: string, id?: string) => { |
| | | formRef.value.open(type, id) |
| | | } |
| | | |
| | | /** 删除按钮操作 */ |
| | | const handleDelete = async (id: string) => { |
| | | try { |
| | | // 删除的二次确认 |
| | | await message.delConfirm() |
| | | // 发起删除 |
| | | await MpkIconApi.deleteIcon(id) |
| | | message.success(t('common.delSuccess')) |
| | | // 刷新列表 |
| | | await getList() |
| | | } catch { |
| | | } |
| | | } |
| | | |
| | | /** 初始化 **/ |
| | | onMounted(async () => { |
| | | await getList() |
| | | }) |
| | | </script> |
对比新文件 |
| | |
| | | <template> |
| | | <Dialog v-model="dialogVisible" :title="dialogTitle"> |
| | | <el-form |
| | | ref="formRef" |
| | | v-loading="formLoading" |
| | | :model="formData" |
| | | :rules="formRules" |
| | | label-width="80px" |
| | | > |
| | | <el-form-item label="图标名称" prop="iconName"> |
| | | <el-input v-model="formData.iconName" placeholder="请输入图标名称" /> |
| | | </el-form-item> |
| | | <el-form-item label="图标描述" prop="iconDesc"> |
| | | <el-input v-model="formData.iconDesc" placeholder="请输入图标描述" /> |
| | | </el-form-item> |
| | | <el-form-item label="排序" prop="sort"> |
| | | <el-input v-model="formData.sort" placeholder="请输入排序" /> |
| | | </el-form-item> |
| | | |
| | | </el-form> |
| | | <template #footer> |
| | | <el-button :disabled="formLoading" type="primary" @click="submitForm">确 定</el-button> |
| | | <el-button @click="dialogVisible = false">取 消</el-button> |
| | | </template> |
| | | </Dialog> |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import * as MpkMenuApi from '@/api/model/mpk/menu' |
| | | |
| | | defineOptions({ name: 'MpkMenuForm' }) |
| | | |
| | | const { t } = useI18n() // 国际化 |
| | | const message = useMessage() // 消息弹窗 |
| | | |
| | | const dialogVisible = ref(false) // 弹窗的是否展示 |
| | | const dialogTitle = ref('') // 弹窗的标题 |
| | | const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用 |
| | | const formType = ref('') // 表单的类型:create - 新增;update - 修改 |
| | | const formData = ref({ |
| | | id: undefined, |
| | | name: '', |
| | | sort: undefined |
| | | }) |
| | | const formRules = reactive({ |
| | | name: [{ required: true, message: '名称不能为空', trigger: 'blur' }] |
| | | }) |
| | | const formRef = ref() // 表单 Ref |
| | | |
| | | /** 打开弹窗 */ |
| | | const open = async (type: string, id?: number) => { |
| | | dialogVisible.value = true |
| | | dialogTitle.value = t('action.' + type) |
| | | formType.value = type |
| | | resetForm() |
| | | // 修改时,设置数据 |
| | | if (id) { |
| | | formLoading.value = true |
| | | try { |
| | | formData.value = await MpkMenuApi.getMenu(id) |
| | | } finally { |
| | | formLoading.value = false |
| | | } |
| | | } |
| | | } |
| | | defineExpose({ open }) // 提供 open 方法,用于打开弹窗 |
| | | |
| | | /** 提交表单 */ |
| | | const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调 |
| | | const submitForm = async () => { |
| | | // 校验表单 |
| | | if (!formRef) return |
| | | const valid = await formRef.value.validate() |
| | | if (!valid) return |
| | | // 提交请求 |
| | | formLoading.value = true |
| | | try { |
| | | const data = formData.value as MpkMenuApi.MpkMenuVO |
| | | if (formType.value === 'create') { |
| | | await MpkMenuApi.createMenu(data) |
| | | message.success(t('common.createSuccess')) |
| | | } else { |
| | | await MpkMenuApi.updateMenu(data) |
| | | message.success(t('common.updateSuccess')) |
| | | } |
| | | dialogVisible.value = false |
| | | // 发送操作成功的事件 |
| | | emit('success') |
| | | } finally { |
| | | formLoading.value = false |
| | | } |
| | | } |
| | | |
| | | /** 重置表单 */ |
| | | const resetForm = () => { |
| | | formData.value = { |
| | | id: undefined, |
| | | name: '', |
| | | sort: undefined |
| | | } |
| | | formRef.value?.resetFields() |
| | | } |
| | | </script> |
对比新文件 |
| | |
| | | <template> |
| | | <Dialog v-model="dialogVisible" :title="dialogTitle"> |
| | | <el-form |
| | | ref="formRef" |
| | | v-loading="formLoading" |
| | | :model="formData" |
| | | :rules="formRules" |
| | | label-width="80px" |
| | | > |
| | | <el-form-item label="分组名称" prop="name"> |
| | | <el-input v-model="formData.name" placeholder="请输入分组名称" /> |
| | | </el-form-item> |
| | | <el-form-item label="排序" prop="sort"> |
| | | <el-input v-model="formData.sort" placeholder="请输入排序" /> |
| | | </el-form-item> |
| | | |
| | | </el-form> |
| | | <template #footer> |
| | | <el-button :disabled="formLoading" type="primary" @click="submitForm">确 定</el-button> |
| | | <el-button @click="dialogVisible = false">取 消</el-button> |
| | | </template> |
| | | </Dialog> |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import * as MpkGroupApi from '@/api/model/mpk/group' |
| | | |
| | | defineOptions({ name: 'MpkGroupForm' }) |
| | | |
| | | const { t } = useI18n() // 国际化 |
| | | const message = useMessage() // 消息弹窗 |
| | | |
| | | const dialogVisible = ref(false) // 弹窗的是否展示 |
| | | const dialogTitle = ref('') // 弹窗的标题 |
| | | const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用 |
| | | const formType = ref('') // 表单的类型:create - 新增;update - 修改 |
| | | const formData = ref({ |
| | | id: undefined, |
| | | name: '', |
| | | sort: undefined |
| | | }) |
| | | const formRules = reactive({ |
| | | name: [{ required: true, message: '名称不能为空', trigger: 'blur' }] |
| | | }) |
| | | const formRef = ref() // 表单 Ref |
| | | |
| | | /** 打开弹窗 */ |
| | | const open = async (type: string, id?: number) => { |
| | | dialogVisible.value = true |
| | | dialogTitle.value = t('action.' + type) |
| | | formType.value = type |
| | | resetForm() |
| | | // 修改时,设置数据 |
| | | if (id) { |
| | | formLoading.value = true |
| | | try { |
| | | formData.value = await MpkGroupApi.getGroup(id) |
| | | } finally { |
| | | formLoading.value = false |
| | | } |
| | | } |
| | | } |
| | | defineExpose({ open }) // 提供 open 方法,用于打开弹窗 |
| | | |
| | | /** 提交表单 */ |
| | | const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调 |
| | | const submitForm = async () => { |
| | | // 校验表单 |
| | | if (!formRef) return |
| | | const valid = await formRef.value.validate() |
| | | if (!valid) return |
| | | // 提交请求 |
| | | formLoading.value = true |
| | | try { |
| | | const data = formData.value as MpkGroupApi.MpkGroupVO |
| | | if (formType.value === 'create') { |
| | | await MpkGroupApi.createGroup(data) |
| | | message.success(t('common.createSuccess')) |
| | | } else { |
| | | await MpkGroupApi.updateGroup(data) |
| | | message.success(t('common.updateSuccess')) |
| | | } |
| | | dialogVisible.value = false |
| | | // 发送操作成功的事件 |
| | | emit('success') |
| | | } finally { |
| | | formLoading.value = false |
| | | } |
| | | } |
| | | |
| | | /** 重置表单 */ |
| | | const resetForm = () => { |
| | | formData.value = { |
| | | id: undefined, |
| | | name: '', |
| | | sort: undefined |
| | | } |
| | | formRef.value?.resetFields() |
| | | } |
| | | </script> |
对比新文件 |
| | |
| | | <template> |
| | | <el-drawer |
| | | v-model="drawer" |
| | | size="40%" |
| | | title="分组列表" |
| | | :direction="direction" |
| | | :before-close="handleClose" |
| | | > |
| | | <!-- 搜索工作栏 --> |
| | | <ContentWrap> |
| | | <el-form |
| | | class="-mb-15px" |
| | | :model="queryParams" |
| | | ref="queryFormRef" |
| | | :inline="true" |
| | | label-width="68px" |
| | | > |
| | | <el-form-item label="模型名称" prop="iconName"> |
| | | <el-input |
| | | v-model="queryParams.iconName" |
| | | placeholder="请输入名称" |
| | | clearable |
| | | class="!w-240px" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button @click="handleQuery"> |
| | | <Icon icon="ep:search" class="mr-5px"/> |
| | | 搜索 |
| | | </el-button> |
| | | <el-button @click="resetQuery"> |
| | | <Icon icon="ep:refresh" class="mr-5px"/> |
| | | 重置 |
| | | </el-button> |
| | | <el-button |
| | | type="primary" |
| | | plain |
| | | @click="openForm('create')" |
| | | v-hasPermi="['mpk:menu:create']" |
| | | > |
| | | <Icon icon="ep:plus" class="mr-5px" /> |
| | | 新增 |
| | | </el-button> |
| | | |
| | | </el-form-item> |
| | | </el-form> |
| | | </ContentWrap> |
| | | |
| | | <!-- 列表 --> |
| | | <ContentWrap> |
| | | <el-table |
| | | v-loading="loading" |
| | | :data="list" |
| | | row-key="id" |
| | | > |
| | | <el-table-column prop="name" label="名称"/> |
| | | <el-table-column prop="sort" label="排序"/> |
| | | <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:menu:update']" |
| | | > |
| | | 编辑 |
| | | </el-button> |
| | | <el-button link type="danger" @click="handleDelete(scope.row.id)" v-hasPermi="['mpk:menu:delete']"> |
| | | <Icon icon="ep:delete"/>删除 |
| | | </el-button> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </ContentWrap> |
| | | |
| | | <!-- 表单弹窗:添加/修改 --> |
| | | <GroupForm ref="formRef" @success="getList" /> |
| | | </el-drawer> |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import {dateFormatter} from '@/utils/formatTime' |
| | | import * as MpkGroupApi from '@/api/model/mpk/group' |
| | | import GroupForm from './GroupForm.vue' |
| | | import type {DrawerProps} from "element-plus"; |
| | | |
| | | defineOptions({name: 'MpkGroup'}) |
| | | |
| | | const message = useMessage() // 消息弹窗 |
| | | const {t} = useI18n() // 国际化 |
| | | |
| | | const drawer = ref(false) |
| | | const direction = ref<DrawerProps['direction']>('rtl') |
| | | const loading = ref(true) // 列表的加载中 |
| | | const list = ref([]) // 字典表格数据 |
| | | const queryParams = reactive({ |
| | | menuId: '', |
| | | name: '' |
| | | }) |
| | | const queryFormRef = ref() // 搜索的表单 |
| | | |
| | | const getList = async () => { |
| | | loading.value = true |
| | | try { |
| | | const data = await MpkGroupApi.getList(queryParams) |
| | | list.value = data.list |
| | | } finally { |
| | | loading.value = false |
| | | } |
| | | } |
| | | |
| | | /** 搜索按钮操作 */ |
| | | const handleQuery = () => { |
| | | getList() |
| | | } |
| | | |
| | | /** 重置按钮操作 */ |
| | | const resetQuery = () => { |
| | | queryFormRef.value.resetFields() |
| | | handleQuery() |
| | | } |
| | | |
| | | /** 添加/修改操作 */ |
| | | const formRef = ref() |
| | | const openForm = (type: string, id?: string) => { |
| | | formRef.value.open(type, id) |
| | | } |
| | | |
| | | /** 删除按钮操作 */ |
| | | const handleDelete = async (id: string) => { |
| | | try { |
| | | // 删除的二次确认 |
| | | await message.delConfirm() |
| | | // 发起删除 |
| | | await MpkGroupApi.deleteGroup(id) |
| | | message.success(t('common.delSuccess')) |
| | | // 刷新列表 |
| | | await getList() |
| | | } catch { |
| | | } |
| | | } |
| | | |
| | | /** 打开弹窗 */ |
| | | const open = async (menuId?: string) => { |
| | | resetForm() |
| | | drawer.value = true |
| | | queryParams.menuId = menuId |
| | | if (menuId) { |
| | | getList() |
| | | } |
| | | } |
| | | defineExpose({open}) // 提供 open 方法,用于打开弹窗 |
| | | |
| | | /** 重置表单 */ |
| | | const resetForm = () => { |
| | | queryParams.menuId = '' |
| | | queryParams.name = '' |
| | | } |
| | | |
| | | const handleClose = (done: () => void) => { |
| | | drawer.value = false |
| | | } |
| | | </script> |
对比新文件 |
| | |
| | | <template> |
| | | <!-- 搜索工作栏 --> |
| | | <ContentWrap> |
| | | <el-form |
| | | class="-mb-15px" |
| | | :model="queryParams" |
| | | ref="queryFormRef" |
| | | :inline="true" |
| | | label-width="68px" |
| | | > |
| | | <el-form-item label="模型名称" prop="iconName"> |
| | | <el-input |
| | | v-model="queryParams.iconName" |
| | | placeholder="请输入名称" |
| | | clearable |
| | | class="!w-240px" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button @click="handleQuery"> |
| | | <Icon icon="ep:search" class="mr-5px"/> |
| | | 搜索 |
| | | </el-button> |
| | | <el-button @click="resetQuery"> |
| | | <Icon icon="ep:refresh" class="mr-5px"/> |
| | | 重置 |
| | | </el-button> |
| | | <el-button |
| | | type="primary" |
| | | plain |
| | | @click="openForm('create')" |
| | | v-hasPermi="['mpk:menu:create']" |
| | | > |
| | | <Icon icon="ep:plus" class="mr-5px" /> |
| | | 新增 |
| | | </el-button> |
| | | |
| | | </el-form-item> |
| | | </el-form> |
| | | </ContentWrap> |
| | | |
| | | <!-- 列表 --> |
| | | <ContentWrap> |
| | | <el-table |
| | | v-loading="loading" |
| | | :data="list" |
| | | row-key="id" |
| | | > |
| | | <el-table-column prop="name" label="名称"/> |
| | | <el-table-column prop="sort" label="排序"/> |
| | | <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:menu:update']" |
| | | > |
| | | 编辑 |
| | | </el-button> |
| | | <el-button |
| | | link |
| | | type="primary" |
| | | @click="openGroupList(scope.row.id)" |
| | | v-hasPermi="['mpk:menu:update']" |
| | | > |
| | | 分组 |
| | | </el-button> |
| | | <el-button link type="danger" @click="handleDelete(scope.row.id)" v-hasPermi="['mpk:menu:delete']"> |
| | | <Icon icon="ep:delete"/>删除 |
| | | </el-button> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </ContentWrap> |
| | | |
| | | <!-- 表单弹窗:添加/修改 --> |
| | | <MenuForm ref="formRef" @success="getList" /> |
| | | |
| | | <!-- 分组列表 --> |
| | | <GroupList ref="listRef" /> |
| | | |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import {dateFormatter} from '@/utils/formatTime' |
| | | import * as MpkMenuApi from '@/api/model/mpk/menu' |
| | | import MenuForm from './MenuForm.vue' |
| | | import GroupList from './group/index.vue' |
| | | |
| | | defineOptions({name: 'MpkMenu'}) |
| | | |
| | | const message = useMessage() // 消息弹窗 |
| | | const {t} = useI18n() // 国际化 |
| | | |
| | | const loading = ref(true) // 列表的加载中 |
| | | const list = ref([]) // 字典表格数据 |
| | | const queryParams = reactive({ |
| | | name: '' |
| | | }) |
| | | const queryFormRef = ref() // 搜索的表单 |
| | | |
| | | const getList = async () => { |
| | | loading.value = true |
| | | try { |
| | | const data = await MpkMenuApi.getList(queryParams) |
| | | list.value = data.list |
| | | } finally { |
| | | loading.value = false |
| | | } |
| | | } |
| | | |
| | | /** 搜索按钮操作 */ |
| | | const handleQuery = () => { |
| | | getList() |
| | | } |
| | | |
| | | /** 重置按钮操作 */ |
| | | const resetQuery = () => { |
| | | queryFormRef.value.resetFields() |
| | | handleQuery() |
| | | } |
| | | |
| | | /** 添加/修改操作 */ |
| | | const formRef = ref() |
| | | const openForm = (type: string, id?: string) => { |
| | | formRef.value.open(type, id) |
| | | } |
| | | |
| | | /** 删除按钮操作 */ |
| | | const handleDelete = async (id: string) => { |
| | | try { |
| | | // 删除的二次确认 |
| | | await message.delConfirm() |
| | | // 发起删除 |
| | | await MpkMenuApi.deleteMenu(id) |
| | | message.success(t('common.delSuccess')) |
| | | // 刷新列表 |
| | | await getList() |
| | | } catch { |
| | | } |
| | | } |
| | | |
| | | /** List操作 */ |
| | | const listRef = ref() |
| | | const openGroupList = (id?: string) => { |
| | | listRef.value.open(id) |
| | | } |
| | | |
| | | /** 初始化 **/ |
| | | onMounted(async () => { |
| | | await getList() |
| | | }) |
| | | </script> |
| | |
| | | </Dialog> |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import * as ProjectApi from '@/api/mpk/project' |
| | | import * as MpkApi from '@/api/mpk/mpk' |
| | | import * as ProjectApi from '@/api/model/mpk/project' |
| | | import * as MpkApi from '@/api/model/mpk/mpk' |
| | | import {FormRules} from 'element-plus' |
| | | |
| | | |
| | |
| | | </Dialog> |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import * as ProjectApi from '@/api/mpk/project' |
| | | import * as ProjectApi from '@/api/model/mpk/project' |
| | | import download from "@/utils/download"; |
| | | import {FormRules} from "element-plus"; |
| | | import {formatToDateString} from "@/utils/dateUtil"; |
| | |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import download from "@/utils/download"; |
| | | import * as PackageHistoryApi from '@/api/mpk/projectPackageHistory' |
| | | import * as ProjectApi from '@/api/mpk/project' |
| | | import * as PackageHistoryApi from '@/api/model/mpk/projectPackageHistory' |
| | | import * as ProjectApi from '@/api/model/mpk/project' |
| | | import {dateFormatter} from '@/utils/formatTime' |
| | | import PackageModel from './ProjectPackageModelDialog.vue' |
| | | |
| | |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import download from "@/utils/download"; |
| | | import * as projectHistoryApi from '@/api/mpk/projectPackageHistory' |
| | | import * as projectApi from '@/api/mpk/project' |
| | | import * as projectHistoryApi from '@/api/model/mpk/projectPackageHistory' |
| | | import * as projectApi from '@/api/model/mpk/project' |
| | | import { dateFormatter } from '@/utils/formatTime' |
| | | import { DICT_TYPE, getDictLabel } from '@/utils/dict' |
| | | |
| | |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import {dateFormatter} from '@/utils/formatTime' |
| | | import * as ProjectApi from '@/api/mpk/project' |
| | | import * as ProjectApi from '@/api/model/mpk/project' |
| | | import ProjectForm from './ProjectForm.vue' |
| | | import ProjectPackage from './ProjectPackage.vue' |
| | | import RelevanceModel from './ProjectPackageModelDialog.vue' |