对比新文件 |
| | |
| | | import request from '@/config/axios' |
| | | |
| | | // 查询列表 |
| | | export const getPage = (params) => { |
| | | return request.get({ url: '/model/chart/page', params}) |
| | | } |
| | | |
| | | // 获得 |
| | | export const get = (id) => { |
| | | return request.get({ url: '/model/chart/get?id=' + id }) |
| | | } |
| | | |
| | | // 新增 |
| | | export const create = (data) => { |
| | | return request.post({ url: '/model/chart/create', data }) |
| | | } |
| | | |
| | | // 修改 |
| | | export const update = (data) => { |
| | | return request.put({ url: '/model/chart/update', data }) |
| | | } |
| | | |
| | | // 删除 |
| | | export const del = (id) => { |
| | | return request.delete({ url: '/model/chart/delete?id=' + id }) |
| | | } |
对比新文件 |
| | |
| | | import request from '@/config/axios' |
| | | |
| | | // 查询列表 |
| | | export const getPage = (params) => { |
| | | return request.get({ url: '/model/chart/param/page', params}) |
| | | } |
| | | |
| | | // 获得 |
| | | export const get = (id) => { |
| | | return request.get({ url: '/model/chart/param/get?id=' + id }) |
| | | } |
| | | |
| | | // 新增 |
| | | export const create = (data) => { |
| | | return request.post({ url: '/model/chart/param/create', data }) |
| | | } |
| | | |
| | | // 修改 |
| | | export const update = (data) => { |
| | | return request.put({ url: '/model/chart/param/update', data }) |
| | | } |
| | | |
| | | // 删除 |
| | | export const del = (id) => { |
| | | return request.delete({ url: '/model/chart/param/delete?id=' + id }) |
| | | } |
对比新文件 |
| | |
| | | <template> |
| | | <Dialog v-model="dialogVisible" :title="dialogTitle"> |
| | | <el-form |
| | | ref="formRef" |
| | | v-loading="formLoading" |
| | | :model="formData" |
| | | :rules="formRules" |
| | | label-width="80px" |
| | | > |
| | | <el-row :gutter="20"> |
| | | <el-col :span="20"> |
| | | <el-form-item label="图表名称" prop="chartName"> |
| | | <el-input v-model="formData.chartName" placeholder=""/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="20"> |
| | | <el-form-item label="图表编码" prop="chartCode"> |
| | | <el-input v-model="formData.chartCode" placeholder=""/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </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 ChartApi from '@/api/model/mpk/chart' |
| | | |
| | | defineOptions({ name: 'ChartForm' }) |
| | | |
| | | 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, |
| | | chartName: undefined, |
| | | chartCode: undefined, |
| | | }) |
| | | const formRules = reactive({ |
| | | chartName: [{ required: true, message: '不能为空', trigger: 'blur' }], |
| | | chartCode: [{ 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 ChartApi.get(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 |
| | | if (formType.value === 'create') { |
| | | await ChartApi.create(data) |
| | | message.success(t('common.createSuccess')) |
| | | } else { |
| | | await ChartApi.update(data) |
| | | message.success(t('common.updateSuccess')) |
| | | } |
| | | dialogVisible.value = false |
| | | // 发送操作成功的事件 |
| | | emit('success') |
| | | } finally { |
| | | formLoading.value = false |
| | | } |
| | | } |
| | | |
| | | /** 重置表单 */ |
| | | const resetForm = () => { |
| | | formData.value = { |
| | | id: undefined, |
| | | chartName: undefined, |
| | | chartCode: undefined, |
| | | paramName: undefined, |
| | | paramCode: undefined, |
| | | paramValue: undefined, |
| | | remark: 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="chartName"> |
| | | <el-input |
| | | v-model="queryParams.chartName" |
| | | placeholder="请输入图表名称" |
| | | clearable |
| | | class="!w-240px" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="参数编码" prop="chartCode"> |
| | | <el-input |
| | | v-model="queryParams.chartCode" |
| | | 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="['model:chart: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="chartName" label="图表名称"/> |
| | | <el-table-column prop="chartCode" label="图表编码"/> |
| | | <el-table-column prop="createTime" :formatter="dateFormatter" 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="['model:chart:update']" |
| | | > |
| | | 编辑 |
| | | </el-button> |
| | | <el-button |
| | | link |
| | | type="primary" |
| | | @click="openChartParam(scope.row.id)" |
| | | v-hasPermi="['model:chart:update']" |
| | | > |
| | | 参数 |
| | | </el-button> |
| | | <el-button link type="danger" @click="handleDelete(scope.row.id)" v-hasPermi="['model:chart:delete']"> |
| | | 删除 |
| | | </el-button> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <!-- 分页 --> |
| | | <Pagination |
| | | v-model:limit="queryParams.limit" |
| | | v-model:page="queryParams.page" |
| | | :total="total" |
| | | @pagination="getList" |
| | | /> |
| | | </ContentWrap> |
| | | |
| | | <!-- 表单弹窗:添加/修改 --> |
| | | <ChartForm ref="formRef" @success="getList" /> |
| | | |
| | | <!-- 分组列表 --> |
| | | <ChartParam ref="ChartParamRef" /> |
| | | |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import {dateFormatter} from '@/utils/formatTime' |
| | | import * as ChartApi from '@/api/model/mpk/chart' |
| | | import ChartForm from './ChartForm.vue' |
| | | import ChartParam from './param/index.vue' |
| | | |
| | | |
| | | defineOptions({name: 'Chart'}) |
| | | |
| | | const message = useMessage() // 消息弹窗 |
| | | const {t} = useI18n() // 国际化 |
| | | |
| | | const loading = ref(true) // 列表的加载中 |
| | | const total = ref(0) // 列表的总页数 |
| | | const list = ref([]) // 字典表格数据 |
| | | const queryParams = reactive({ |
| | | page: 1, |
| | | limit: 10, |
| | | chartName: '', |
| | | chartCode: '' |
| | | }) |
| | | const queryFormRef = ref() // 搜索的表单 |
| | | |
| | | const getList = async () => { |
| | | loading.value = true |
| | | try { |
| | | const data = await ChartApi.getPage(queryParams) |
| | | list.value = data.list |
| | | total.value = data.total |
| | | } 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 ChartApi.del(id) |
| | | message.success(t('common.delSuccess')) |
| | | // 刷新列表 |
| | | await getList() |
| | | } catch { |
| | | } |
| | | } |
| | | |
| | | /** List操作 */ |
| | | const ChartParamRef = ref() |
| | | const openChartParam = (id?: string) => { |
| | | ChartParamRef.value.open(id) |
| | | } |
| | | |
| | | /** 初始化 **/ |
| | | 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-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="参数名称" prop="paramName"> |
| | | <el-input v-model="formData.paramName" placeholder=""/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="参数编码" prop="paramCode"> |
| | | <el-input v-model="formData.paramCode" placeholder=""/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="参数值" prop="paramValue"> |
| | | <el-input v-model="formData.paramValue" placeholder=""/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="备注" prop="remark"> |
| | | <el-input v-model="formData.remark" type="textarea" :rows="2" placeholder=""/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </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 ChartParamApi from '@/api/model/mpk/chartParam' |
| | | import {deleteIcon} from "@/api/model/mpk/icon"; |
| | | |
| | | defineOptions({ name: 'ChartParamForm' }) |
| | | |
| | | 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, |
| | | chartId: undefined, |
| | | paramName: undefined, |
| | | paramCode: undefined, |
| | | paramValue: undefined, |
| | | remark: undefined, |
| | | }) |
| | | const formRules = reactive({ |
| | | paramName: [{ required: true, message: '不能为空', trigger: 'blur' }], |
| | | paramCode: [{ required: true, message: '不能为空', trigger: 'blur' }], |
| | | paramValue: [{ required: true, message: '不能为空', trigger: 'blur' }] |
| | | }) |
| | | const formRef = ref() // 表单 Ref |
| | | |
| | | /** 打开弹窗 */ |
| | | const open = async (type: string, id?: string, chartId?: string) => { |
| | | dialogVisible.value = true |
| | | dialogTitle.value = t('action.' + type) |
| | | formType.value = type |
| | | resetForm() |
| | | if (chartId) { |
| | | formData.value.chartId = chartId |
| | | } |
| | | // 修改时,设置数据 |
| | | if (id) { |
| | | formLoading.value = true |
| | | try { |
| | | formData.value = await ChartParamApi.get(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 |
| | | if (formType.value === 'create') { |
| | | await ChartParamApi.create(data) |
| | | message.success(t('common.createSuccess')) |
| | | } else { |
| | | await ChartParamApi.update(data) |
| | | message.success(t('common.updateSuccess')) |
| | | } |
| | | dialogVisible.value = false |
| | | // 发送操作成功的事件 |
| | | emit('success') |
| | | } finally { |
| | | formLoading.value = false |
| | | } |
| | | } |
| | | |
| | | /** 重置表单 */ |
| | | const resetForm = () => { |
| | | formData.value = { |
| | | id: undefined, |
| | | chartCode: undefined, |
| | | paramName: undefined, |
| | | paramCode: undefined, |
| | | paramValue: undefined, |
| | | remark: 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="paramName"> |
| | | <el-input |
| | | v-model="queryParams.paramName" |
| | | placeholder="请输入" |
| | | clearable |
| | | class="!w-240px" |
| | | /> |
| | | </el-form-item> |
| | | <!-- <el-form-item label="参数编码" prop="paramCode">--> |
| | | <!-- <el-input--> |
| | | <!-- v-model="queryParams.paramCode"--> |
| | | <!-- 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')" |
| | | > |
| | | <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="paramName" label="参数名称"/> |
| | | <el-table-column prop="paramCode" label="参数编码"/> |
| | | <el-table-column prop="paramValue" label="参数值"/> |
| | | <el-table-column label="操作" align="center" width="150px"> |
| | | <template #default="scope"> |
| | | <div class="flex items-center justify-center"> |
| | | <el-button |
| | | link |
| | | type="primary" |
| | | @click="openForm('update', scope.row.id)" |
| | | > |
| | | 编辑 |
| | | </el-button> |
| | | <el-button link type="danger" @click="handleDelete(scope.row.id)"> |
| | | 删除 |
| | | </el-button> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <!-- 分页 --> |
| | | <Pagination |
| | | v-model:limit="queryParams.limit" |
| | | v-model:page="queryParams.page" |
| | | :total="total" |
| | | @pagination="getList" |
| | | /> |
| | | </ContentWrap> |
| | | |
| | | <!-- 表单弹窗:添加/修改 --> |
| | | <ChartParamForm ref="formRef" @success="getList" /> |
| | | </el-drawer> |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import {dateFormatter} from '@/utils/formatTime' |
| | | import * as ChartParamApi from '@/api/model/mpk/chartParam' |
| | | import ChartParamForm from './ChartParamForm.vue' |
| | | |
| | | import type {DrawerProps} from "element-plus"; |
| | | |
| | | defineOptions({name: 'ChartParam'}) |
| | | |
| | | const message = useMessage() // 消息弹窗 |
| | | const {t} = useI18n() // 国际化 |
| | | |
| | | const drawer = ref(false) |
| | | const direction = ref<DrawerProps['direction']>('rtl') |
| | | const loading = ref(true) // 列表的加载中 |
| | | const total = ref(0) // 列表的总页数 |
| | | const list = ref([]) // 字典表格数据 |
| | | const queryParams = reactive({ |
| | | page: 1, |
| | | limit: 10, |
| | | chartId: undefined, |
| | | paramName: undefined, |
| | | paramCode: undefined, |
| | | }) |
| | | const queryFormRef = ref() // 搜索的表单 |
| | | |
| | | const getList = async () => { |
| | | loading.value = true |
| | | try { |
| | | const data = await ChartParamApi.getPage(queryParams) |
| | | list.value = data.list |
| | | total.value = data.total |
| | | } 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, queryParams.chartId) |
| | | } |
| | | |
| | | /** 删除按钮操作 */ |
| | | const handleDelete = async (id: string) => { |
| | | try { |
| | | // 删除的二次确认 |
| | | await message.delConfirm() |
| | | // 发起删除 |
| | | await ChartParamApi.del(id) |
| | | message.success(t('common.delSuccess')) |
| | | // 刷新列表 |
| | | await getList() |
| | | } catch { |
| | | } |
| | | } |
| | | |
| | | /** 打开弹窗 */ |
| | | const open = async (chartId?: string) => { |
| | | resetForm() |
| | | drawer.value = true |
| | | queryParams.chartId = chartId |
| | | if (chartId) { |
| | | getList() |
| | | } |
| | | } |
| | | defineExpose({open}) // 提供 open 方法,用于打开弹窗 |
| | | |
| | | /** 重置表单 */ |
| | | const resetForm = () => { |
| | | queryParams.chartId = '' |
| | | queryParams.name = '' |
| | | } |
| | | |
| | | const handleClose = (done: () => void) => { |
| | | drawer.value = false |
| | | } |
| | | </script> |
| | |
| | | const formRef = ref() |
| | | // 运行 |
| | | const modelRun = async () => { |
| | | modelRunResult.value = '' |
| | | // 校验表单 |
| | | if (!formRef) return |
| | | const valid = await formRef.value.validate() |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item label="关联模型"> |
| | | <el-form-item label="关联项目"> |
| | | <el-select v-model="dataForm.mmPredictModel.mpkprojectid" placeholder="请选择"> |
| | | <el-option |
| | | v-for="item in mpkProjectList" |