Browse Source

Merge pull request 'dev-xjf' (#70) from dev-xjf into master

Reviewed-on: http://120.26.116.243:3000/root/alert-front/pulls/70
pull/79/head
xiaojinfei 1 month ago
parent
commit
98f9160fa3
  1. 8
      src/api/alert/run/instant/index.ts
  2. 4
      src/views/run/instant/UpdateModal.vue
  3. 2
      src/views/run/instant/detail.vue
  4. 10
      src/views/run/instant/index.vue
  5. 6
      src/views/run/instant/instant.data.ts
  6. 4
      src/views/run/instant/warnConfig/index.vue

8
src/api/alert/run/instant/index.ts

@ -73,8 +73,8 @@ export function updateInstant(data: InstantVO) {
} }
// 删除模型实例 // 删除模型实例
export function deleteInstant(id: number) { export function deleteInstant(mpId: number) {
return defHttp.delete({ url: `/alert/instant/delete?id=${id}` }) return defHttp.delete({ url: `/alert/instant/delete?id=${mpId}` })
} }
@ -85,8 +85,8 @@ export function getInstantCount() {
} }
// 查询模型实例测点列表 // 查询模型实例测点列表
export function getInstantPoint(id: number) { export function getInstantPoint(mpId: number) {
return defHttp.get({ url: `/alert/instant/getPoint?id=${id}` }) return defHttp.get({ url: `/alert/instant/getPoint?id=${mpId}` })
} }
// 查询模型实例测点曲线 // 查询模型实例测点曲线
export function getInstantChart(data: InstantChartReqVO) { export function getInstantChart(data: InstantChartReqVO) {

4
src/views/run/instant/UpdateModal.vue

@ -31,7 +31,7 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data
// modal // modal
isUpdate.value = !!data?.isUpdate isUpdate.value = !!data?.isUpdate
if (unref(isUpdate)) { if (unref(isUpdate)) {
const res = await getInstant(data.record.id) const res = await getInstant(data.record.mpId)
setFieldsValue({ ...res }) setFieldsValue({ ...res })
} }
// //
@ -45,7 +45,7 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data
const calcGroupList = [] as any const calcGroupList = [] as any
// // // //
calcGroupData.forEach((item) => { calcGroupData.forEach((item) => {
calcGroupList.push({ label: item.groupName, value: item.id }) calcGroupList.push({ label: item.groupName, value: item.groupId })
}) })
// //

2
src/views/run/instant/detail.vue

@ -51,7 +51,7 @@ const [registerForm, { getFieldsValue, setProps }] = useForm({
actionColOptions: { span: 2 }, actionColOptions: { span: 2 },
}) })
const instantId = ref<any>(route.query.id) // URLquery const instantId = ref<any>(route.query.mpId) // URLquery
onMounted(async () => { onMounted(async () => {
loadingBasic.value = true loadingBasic.value = true

10
src/views/run/instant/index.vue

@ -27,7 +27,7 @@ const [registerUpdateModal, { openModal: openUpdateModal }] = useModal()
const [registerTable, { getForm, reload, getDataSource, updateTableDataRecord }] = useTable({ const [registerTable, { getForm, reload, getDataSource, updateTableDataRecord }] = useTable({
title: '实例列表', title: '实例列表',
api: getInstantPage, api: getInstantPage,
rowKey: 'id', rowKey: 'mpId',
immediate: true, immediate: true,
columns, columns,
formConfig: { formConfig: {
@ -52,7 +52,7 @@ const [registerTable, { getForm, reload, getDataSource, updateTableDataRecord }]
function handleDetail(record) { function handleDetail(record) {
console.log(record) console.log(record)
router.push(`/run/instant/detail?id=${record.id}`) router.push(`/run/instant/detail?mpId=${record.mpId}`)
} }
async function updateStatus(record) { async function updateStatus(record) {
@ -72,7 +72,7 @@ function handleEdit(record: Recordable) {
openUpdateModal(true, { record, isUpdate: true }) openUpdateModal(true, { record, isUpdate: true })
} }
async function handleDelete(record: Recordable) { async function handleDelete(record: Recordable) {
await deleteInstant(record.id) await deleteInstant(record.mpId)
createMessage.success(t('common.delSuccessText')) createMessage.success(t('common.delSuccessText'))
reload() reload()
} }
@ -140,7 +140,7 @@ async function getNow() {
} }
function handleWarnConfig(record: Recordable) { function handleWarnConfig(record: Recordable) {
router.push(`/run/instant/warn/config?id=${record.id}`) router.push(`/run/instant/warn/config?mpId=${record.mpId}`)
} }
</script> </script>
@ -217,7 +217,7 @@ function handleWarnConfig(record: Recordable) {
<!-- </template>--> <!-- </template>-->
<template #status="{ record }"> <template #status="{ record }">
<Switch <Switch
v-model:checked="record.status" :checked-value="1" :un-checked-value="0" checked-children="开" v-model:checked="record.instantStatus" :checked-value="1" :un-checked-value="0" checked-children="开"
un-checked-children="关" @change="updateStatus(record)" un-checked-children="关" @change="updateStatus(record)"
/> />
</template> </template>

6
src/views/run/instant/instant.data.ts

@ -10,7 +10,7 @@ import type { systemSelectParams } from '@/api/alert/model/model/optionsModel'
export const columns: BasicColumn[] = [ export const columns: BasicColumn[] = [
{ {
title: '编号', title: '编号',
dataIndex: 'id', dataIndex: 'mpId',
width: 80, width: 80,
fixed: 'left', fixed: 'left',
}, },
@ -76,7 +76,7 @@ export const columns: BasicColumn[] = [
}, },
{ {
title: '投切', title: '投切',
dataIndex: 'status', dataIndex: 'instantStatus',
width: 100, width: 100,
slots: { customRender: 'status' }, slots: { customRender: 'status' },
fixed: 'right', fixed: 'right',
@ -422,7 +422,7 @@ export const updateInstantForm: FormSchema[] = [
{ {
label: '编号', label: '编号',
field: 'id', field: 'mpId',
component: 'Input', component: 'Input',
required: true, required: true,
show: false, show: false,

4
src/views/run/instant/warnConfig/index.vue

@ -38,11 +38,11 @@ const [registerTable, { getForm, reload, getDataSource, updateTableDataRecord }]
}, },
beforeFetch: (params) => { beforeFetch: (params) => {
// //
params.mpId = route.query.id params.mpId = route.query.mpId
getForm().setFieldsValue(params) getForm().setFieldsValue(params)
return params return params
}, },
useSearchForm: !route.query.id, useSearchForm: !route.query.mpId,
showTableSetting: true, showTableSetting: true,
showIndexColumn: false, showIndexColumn: false,
actionColumn: { actionColumn: {

Loading…
Cancel
Save