温度监测修改上报状态
This commit is contained in:
parent
618e68875f
commit
b63375f441
|
@ -5,6 +5,7 @@ enum Api {
|
||||||
companylist = '/heating/thermalcompany/list',
|
companylist = '/heating/thermalcompany/list',
|
||||||
heatsourcelist = '/heating/heatsource/list',
|
heatsourcelist = '/heating/heatsource/list',
|
||||||
heatsourcestationlist = '/heating/heatsourcestation/list',
|
heatsourcestationlist = '/heating/heatsourcestation/list',
|
||||||
|
updateType = '/heating/heatanalysis/updateType',
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -22,3 +23,11 @@ export const heatsourcelist = (params) =>
|
||||||
|
|
||||||
export const heatsourcestationlist = (params) =>
|
export const heatsourcestationlist = (params) =>
|
||||||
defHttp.get({url: Api.heatsourcestationlist, params});
|
defHttp.get({url: Api.heatsourcestationlist, params});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新
|
||||||
|
* @param params
|
||||||
|
*/
|
||||||
|
export const updateType = (params) => {
|
||||||
|
return defHttp.post({url: Api.updateType, params});
|
||||||
|
}
|
||||||
|
|
|
@ -110,8 +110,7 @@
|
||||||
<!--引用表格-->
|
<!--引用表格-->
|
||||||
<BasicTable @register="registerTable" :rowClassName="tableRowClassName">
|
<BasicTable @register="registerTable" :rowClassName="tableRowClassName">
|
||||||
<template #reportType="{ record }">
|
<template #reportType="{ record }">
|
||||||
<span v-if="record.reportType == 1">上报</span>
|
<a-switch v-model:checked="record.reportType" :checked-value="1" :un-checked-value="2" checked-children="上报" un-checked-children="模拟" @change="editReportType(record)"/>
|
||||||
<a-tag v-else color="purple">模拟</a-tag>
|
|
||||||
</template>
|
</template>
|
||||||
<template #isExtract="{ record }">
|
<template #isExtract="{ record }">
|
||||||
<a-tag v-if="record.isExtract == 1" color="green" style="cursor:pointer" @click="showExtract(record)">是</a-tag>
|
<a-tag v-if="record.isExtract == 1" color="green" style="cursor:pointer" @click="showExtract(record)">是</a-tag>
|
||||||
|
@ -133,13 +132,16 @@ import {ref, reactive, onMounted} from 'vue';
|
||||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||||
import { useListPage } from '/@/hooks/system/useListPage';
|
import { useListPage } from '/@/hooks/system/useListPage';
|
||||||
import { columns } from './Heatanalysis.data';
|
import { columns } from './Heatanalysis.data';
|
||||||
import { list, companylist, heatsourcelist, heatsourcestationlist } from './Heatanalysis.api';
|
import { list, companylist, heatsourcelist, heatsourcestationlist , updateType} from './Heatanalysis.api';
|
||||||
import StationExtractModal from './components/extract/StationExtractModal.vue';
|
import StationExtractModal from './components/extract/StationExtractModal.vue';
|
||||||
import StationExtractedModal from './components/extracted/StationExtractedModal.vue';
|
import StationExtractedModal from './components/extracted/StationExtractedModal.vue';
|
||||||
|
import {saveOrUpdate} from "@/views/heating/heatanalysis/Heatanalysis.api";
|
||||||
|
import {useMessage} from "@/hooks/web/useMessage";
|
||||||
const queryParam = ref<any>({});
|
const queryParam = ref<any>({});
|
||||||
const toggleSearchStatus = ref<boolean>(false);
|
const toggleSearchStatus = ref<boolean>(false);
|
||||||
const registerModal = ref();
|
const registerModal = ref();
|
||||||
const registerModalExtracted = ref();
|
const registerModalExtracted = ref();
|
||||||
|
const { createMessage } = useMessage();
|
||||||
//注册table数据
|
//注册table数据
|
||||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||||
tableProps: {
|
tableProps: {
|
||||||
|
@ -184,6 +186,20 @@ function tableRowClassName(record){
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function editReportType(record){
|
||||||
|
console.log(record.reportType);
|
||||||
|
const model = reactive<Record<string, any>>({
|
||||||
|
id: record.id,
|
||||||
|
reportType: record.reportType
|
||||||
|
})
|
||||||
|
updateType(model).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
createMessage.success(res.message);
|
||||||
|
} else {
|
||||||
|
createMessage.warning(res.message);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 成功回调
|
* 成功回调
|
||||||
|
|
Loading…
Reference in New Issue