| | |
| | | :inline="true" |
| | | label-width="68px" |
| | | > |
| | | <el-form-item label="参数名称" prop="paramName"> |
| | | <el-form-item label="数据编号" prop="dataNo"> |
| | | <el-input |
| | | v-model="queryParams.paramName" |
| | | placeholder="请输入参数名称" |
| | | v-model="queryParams.dataNo" |
| | | placeholder="请输入数据编号" |
| | | clearable |
| | | class="!w-240px" |
| | | /> |
| | |
| | | </ContentWrap> |
| | | |
| | | <!-- 表单弹窗:添加/修改 --> |
| | | <ChartParamForm ref="formRef" @success="getList" /> |
| | | <ConfigDetForm 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 * as configDetApi from '@/api/model/sche/suggest/snapshotConfigDet' |
| | | import ConfigDetForm from './configDetForm.vue' |
| | | |
| | | import type {DrawerProps} from "element-plus"; |
| | | |
| | | defineOptions({name: 'ChartParam'}) |
| | | defineOptions({name: 'ConfigDet'}) |
| | | |
| | | const message = useMessage() // 消息弹窗 |
| | | const {t} = useI18n() // 国际化 |
| | |
| | | const queryParams = reactive({ |
| | | page: 1, |
| | | limit: 10, |
| | | confId: '', |
| | | }) |
| | | const queryFormRef = ref() // 搜索的表单 |
| | | |
| | | const getList = async () => { |
| | | loading.value = true |
| | | try { |
| | | const data = await ChartParamApi.getPage(queryParams) |
| | | const data = await configDetApi.getPage(queryParams) |
| | | list.value = data.list |
| | | total.value = data.total |
| | | } finally { |
| | |
| | | /** 添加/修改操作 */ |
| | | const formRef = ref() |
| | | const openForm = (type: string, id?: string) => { |
| | | formRef.value.open(type, id, queryParams.chartId) |
| | | formRef.value.open(type, id, queryParams.confId) |
| | | } |
| | | |
| | | /** 删除按钮操作 */ |
| | |
| | | // 删除的二次确认 |
| | | await message.delConfirm() |
| | | // 发起删除 |
| | | await ChartParamApi.del(id) |
| | | await configDetApi.del(id) |
| | | message.success(t('common.delSuccess')) |
| | | // 刷新列表 |
| | | await getList() |
| | |
| | | } |
| | | |
| | | /** 打开弹窗 */ |
| | | const open = async (chartId?: string) => { |
| | | const open = async (confId?: string) => { |
| | | resetForm() |
| | | drawer.value = true |
| | | queryParams.chartId = chartId |
| | | if (chartId) { |
| | | queryParams.confId = confId |
| | | if (confId) { |
| | | getList() |
| | | } |
| | | } |
| | |
| | | |
| | | /** 重置表单 */ |
| | | const resetForm = () => { |
| | | queryParams.chartId = '' |
| | | queryParams.name = '' |
| | | queryParams.confId = '' |
| | | } |
| | | |
| | | const handleClose = (done: () => void) => { |