运维日志
This commit is contained in:
parent
7ac05e75d0
commit
2ae20014b1
|
|
@ -18,7 +18,7 @@ export const columns: BasicColumn[] = [
|
||||||
ellipsis: false
|
ellipsis: false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '锅炉房',
|
title: '换热站',
|
||||||
align: "center",
|
align: "center",
|
||||||
dataIndex: 'view004Name',
|
dataIndex: 'view004Name',
|
||||||
ellipsis: false
|
ellipsis: false
|
||||||
|
|
@ -204,7 +204,7 @@ export const formSchema: FormSchema[] = [
|
||||||
field: 'view002Name',
|
field: 'view002Name',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '锅炉房',
|
label: '换热站',
|
||||||
field: 'view004Name',
|
field: 'view004Name',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
import {defHttp} from '/@/utils/http/axios';
|
||||||
|
import { useMessage } from "/@/hooks/web/useMessage";
|
||||||
|
|
||||||
|
const { createConfirm } = useMessage();
|
||||||
|
|
||||||
|
enum Api {
|
||||||
|
list = '/heating/heatanalysis/page',
|
||||||
|
edit='/heating/heatanalysis/updateFaultLevel',
|
||||||
|
companylist = '/heating/thermalcompany/list',
|
||||||
|
heatsourcelist = '/heating/heatsource/list',
|
||||||
|
heatsourcestationlist = '/heating/heatsourcestation/list',
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 列表接口
|
||||||
|
* @param params
|
||||||
|
*/
|
||||||
|
export const list = (params) =>
|
||||||
|
defHttp.get({url: Api.list, params});
|
||||||
|
|
||||||
|
export const companylist = (params) =>
|
||||||
|
defHttp.get({url: Api.companylist, params});
|
||||||
|
|
||||||
|
export const heatsourcelist = (params) =>
|
||||||
|
defHttp.get({url: Api.heatsourcelist, params});
|
||||||
|
|
||||||
|
export const heatsourcestationlist = (params) =>
|
||||||
|
defHttp.get({url: Api.heatsourcestationlist, params});
|
||||||
|
/**
|
||||||
|
* 更新故障等级
|
||||||
|
* @param params
|
||||||
|
*/
|
||||||
|
export const saveOrUpdate = (params) => {
|
||||||
|
return defHttp.post({url: Api.edit, params},{ isTransformResponse: false });
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,137 @@
|
||||||
|
import {BasicColumn} from '/@/components/Table';
|
||||||
|
import {FormSchema} from '/@/components/Table';
|
||||||
|
import { rules} from '/@/utils/helper/validator';
|
||||||
|
import { render } from '/@/utils/common/renderUtils';
|
||||||
|
//列表数据
|
||||||
|
export const columns: BasicColumn[] = [
|
||||||
|
{
|
||||||
|
title: '区域',
|
||||||
|
align: "center",
|
||||||
|
dataIndex: 'regionType',
|
||||||
|
width:80,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '供热公司',
|
||||||
|
align: "center",
|
||||||
|
dataIndex: 'view001Name',
|
||||||
|
width:140,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '锅炉房',
|
||||||
|
align: "center",
|
||||||
|
dataIndex: 'view002Name',
|
||||||
|
width:140,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '换热站',
|
||||||
|
align: "center",
|
||||||
|
dataIndex: 'view004Name',
|
||||||
|
width:140,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'SIM',
|
||||||
|
align: "center",
|
||||||
|
dataIndex: 'sim',
|
||||||
|
width:140,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'CODE',
|
||||||
|
align: "center",
|
||||||
|
dataIndex: 'code',
|
||||||
|
width:120,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'SN',
|
||||||
|
align: "center",
|
||||||
|
dataIndex: 'view031',
|
||||||
|
width:140,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '故障等级',
|
||||||
|
align: "center",
|
||||||
|
dataIndex: 'faultLevel',
|
||||||
|
width:140,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '数据时间',
|
||||||
|
align: "center",
|
||||||
|
dataIndex: 'datatime',
|
||||||
|
width:160,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title:'一次网',
|
||||||
|
width:100,
|
||||||
|
children:[
|
||||||
|
{
|
||||||
|
title: '供水温度',
|
||||||
|
align:"center",
|
||||||
|
width:120,
|
||||||
|
dataIndex: 'view005',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '回水温度',
|
||||||
|
align:"center",
|
||||||
|
width:120,
|
||||||
|
dataIndex: 'view006'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '供水压力',
|
||||||
|
align:"center",
|
||||||
|
width:120,
|
||||||
|
dataIndex: 'view007'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '回水压力',
|
||||||
|
align:"center",
|
||||||
|
width:120,
|
||||||
|
dataIndex: 'view008'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title:'二次网',
|
||||||
|
width:100,
|
||||||
|
children:[
|
||||||
|
{
|
||||||
|
title: '供水温度',
|
||||||
|
align:"center",
|
||||||
|
width:120,
|
||||||
|
dataIndex: 'view009'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '回水温度',
|
||||||
|
align:"center",
|
||||||
|
width:120,
|
||||||
|
dataIndex: 'view010'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '供水压力',
|
||||||
|
align:"center",
|
||||||
|
width:120,
|
||||||
|
dataIndex: 'view011'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '回水压力',
|
||||||
|
align:"center",
|
||||||
|
width:120,
|
||||||
|
dataIndex: 'view012'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '热量',
|
||||||
|
align:"center",
|
||||||
|
width:120,
|
||||||
|
dataIndex: 'view041',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '水流量',
|
||||||
|
align:"center",
|
||||||
|
width:120,
|
||||||
|
dataIndex: 'view037'
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
//查询数据
|
||||||
|
export const searchFormSchema: FormSchema[] = [
|
||||||
|
];
|
||||||
|
|
@ -0,0 +1,146 @@
|
||||||
|
<template>
|
||||||
|
<a-spin :spinning="confirmLoading">
|
||||||
|
<JFormContainer :disabled="disabled">
|
||||||
|
<template #detail>
|
||||||
|
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol" name="changeLevelForm">
|
||||||
|
<a-row>
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="故障等级" v-bind="validateInfos.faultLevel" id="changeLevelForm-faultLevel" name="faultLevel">
|
||||||
|
<j-dict-select-tag v-model:value="formData.faultLevel" dictCode="fault_level" placeholder="请选择故障等级" allow-clear />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
</a-form>
|
||||||
|
</template>
|
||||||
|
</JFormContainer>
|
||||||
|
</a-spin>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted } from 'vue';
|
||||||
|
import { defHttp } from '/@/utils/http/axios';
|
||||||
|
import { useMessage } from '/@/hooks/web/useMessage';
|
||||||
|
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||||
|
import { getValueType } from '/@/utils';
|
||||||
|
import { saveOrUpdate } from '../Heatanalysis.api';
|
||||||
|
import { Form } from 'ant-design-vue';
|
||||||
|
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
|
||||||
|
const props = defineProps({
|
||||||
|
formDisabled: { type: Boolean, default: false },
|
||||||
|
formData: { type: Object, default: () => ({})},
|
||||||
|
formBpm: { type: Boolean, default: true }
|
||||||
|
});
|
||||||
|
const formRef = ref();
|
||||||
|
const useForm = Form.useForm;
|
||||||
|
const emit = defineEmits(['register', 'ok']);
|
||||||
|
const formData = reactive<Record<string, any>>({
|
||||||
|
id: '',
|
||||||
|
faultLevel: '',
|
||||||
|
});
|
||||||
|
const { createMessage } = useMessage();
|
||||||
|
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
|
||||||
|
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
|
||||||
|
const confirmLoading = ref<boolean>(false);
|
||||||
|
//表单验证
|
||||||
|
const validatorRules = reactive({
|
||||||
|
faultLevel: [{ required: true, message: '请选择故障等级!'},],
|
||||||
|
});
|
||||||
|
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
|
||||||
|
|
||||||
|
// 表单禁用
|
||||||
|
const disabled = computed(()=>{
|
||||||
|
if(props.formBpm === true){
|
||||||
|
if(props.formData.disabled === false){
|
||||||
|
return false;
|
||||||
|
}else{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return props.formDisabled;
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增
|
||||||
|
*/
|
||||||
|
function add() {
|
||||||
|
edit({});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*/
|
||||||
|
function edit(record) {
|
||||||
|
nextTick(() => {
|
||||||
|
resetFields();
|
||||||
|
const tmpData = {};
|
||||||
|
Object.keys(formData).forEach((key) => {
|
||||||
|
if(record.hasOwnProperty(key)){
|
||||||
|
tmpData[key] = record[key]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
//赋值
|
||||||
|
Object.assign(formData, tmpData);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提交数据
|
||||||
|
*/
|
||||||
|
async function submitForm() {
|
||||||
|
try {
|
||||||
|
// 触发表单验证
|
||||||
|
await validate();
|
||||||
|
} catch ({ errorFields }) {
|
||||||
|
if (errorFields) {
|
||||||
|
const firstField = errorFields[0];
|
||||||
|
if (firstField) {
|
||||||
|
formRef.value.scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Promise.reject(errorFields);
|
||||||
|
}
|
||||||
|
confirmLoading.value = true;
|
||||||
|
const isUpdate = ref<boolean>(false);
|
||||||
|
//时间格式化
|
||||||
|
let model = formData;
|
||||||
|
if (model.id) {
|
||||||
|
isUpdate.value = true;
|
||||||
|
}
|
||||||
|
//循环数据
|
||||||
|
for (let data in model) {
|
||||||
|
//如果该数据是数组并且是字符串类型
|
||||||
|
if (model[data] instanceof Array) {
|
||||||
|
let valueType = getValueType(formRef.value.getProps, data);
|
||||||
|
//如果是字符串类型的需要变成以逗号分割的字符串
|
||||||
|
if (valueType === 'string') {
|
||||||
|
model[data] = model[data].join(',');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
await saveOrUpdate(model).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
createMessage.success(res.message);
|
||||||
|
emit('ok');
|
||||||
|
} else {
|
||||||
|
createMessage.warning(res.message);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
confirmLoading.value = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
add,
|
||||||
|
edit,
|
||||||
|
submitForm,
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
.antd-modal-form {
|
||||||
|
padding: 14px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,75 @@
|
||||||
|
<template>
|
||||||
|
<a-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
|
||||||
|
<ChangeLevelForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></ChangeLevelForm>
|
||||||
|
</a-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref, nextTick, defineExpose } from 'vue';
|
||||||
|
import ChangeLevelForm from './ChangeLevelForm.vue'
|
||||||
|
|
||||||
|
const title = ref<string>('');
|
||||||
|
const width = ref<number>(600);
|
||||||
|
const visible = ref<boolean>(false);
|
||||||
|
const disableSubmit = ref<boolean>(false);
|
||||||
|
const registerForm = ref();
|
||||||
|
const emit = defineEmits(['register', 'success']);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增
|
||||||
|
*/
|
||||||
|
function add() {
|
||||||
|
title.value = '新增';
|
||||||
|
visible.value = true;
|
||||||
|
nextTick(() => {
|
||||||
|
registerForm.value.add();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
* @param record
|
||||||
|
*/
|
||||||
|
function edit(record) {
|
||||||
|
title.value = disableSubmit.value ? '详情' : '编辑';
|
||||||
|
visible.value = true;
|
||||||
|
nextTick(() => {
|
||||||
|
registerForm.value.edit(record);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 确定按钮点击事件
|
||||||
|
*/
|
||||||
|
function handleOk() {
|
||||||
|
registerForm.value.submitForm();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* form保存回调事件
|
||||||
|
*/
|
||||||
|
function submitCallback() {
|
||||||
|
handleCancel();
|
||||||
|
emit('success');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消按钮回调事件
|
||||||
|
*/
|
||||||
|
function handleCancel() {
|
||||||
|
visible.value = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
add,
|
||||||
|
edit,
|
||||||
|
disableSubmit,
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
/**隐藏样式-modal确定按钮 */
|
||||||
|
.jee-hidden {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,54 @@
|
||||||
|
import {defHttp} from '/@/utils/http/axios';
|
||||||
|
import { useMessage } from "/@/hooks/web/useMessage";
|
||||||
|
|
||||||
|
const { createConfirm } = useMessage();
|
||||||
|
|
||||||
|
enum Api {
|
||||||
|
list = '/heating/heatanalysisRemarks/page',
|
||||||
|
save='/heating/heatanalysisRemarks/add',
|
||||||
|
edit='/heating/heatanalysisRemarks/edit',
|
||||||
|
deleteOne = '/heating/heatanalysisRemarks/delete',
|
||||||
|
deleteBatch = '/heating/heatanalysisRemarks/deleteBatch',
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 列表接口
|
||||||
|
* @param params
|
||||||
|
*/
|
||||||
|
export const list = (params) =>
|
||||||
|
defHttp.get({url: Api.list, params});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除单个
|
||||||
|
*/
|
||||||
|
export const deleteOne = (params,handleSuccess) => {
|
||||||
|
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
|
||||||
|
handleSuccess();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
* @param params
|
||||||
|
*/
|
||||||
|
export const batchDelete = (params, handleSuccess) => {
|
||||||
|
createConfirm({
|
||||||
|
iconType: 'warning',
|
||||||
|
title: '确认删除',
|
||||||
|
content: '是否删除选中数据',
|
||||||
|
okText: '确认',
|
||||||
|
cancelText: '取消',
|
||||||
|
onOk: () => {
|
||||||
|
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
|
||||||
|
handleSuccess();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 保存或者更新
|
||||||
|
* @param params
|
||||||
|
*/
|
||||||
|
export const saveOrUpdate = (params, isUpdate) => {
|
||||||
|
let url = isUpdate ? Api.edit : Api.save;
|
||||||
|
return defHttp.post({url: url, params}, { isTransformResponse: false });
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,69 @@
|
||||||
|
import {BasicColumn} from '/@/components/Table';
|
||||||
|
import {FormSchema} from '/@/components/Table';
|
||||||
|
import { rules} from '/@/utils/helper/validator';
|
||||||
|
import { render } from '/@/utils/common/renderUtils';
|
||||||
|
import { getWeekMonthQuarterYear } from '/@/utils';
|
||||||
|
//列表数据
|
||||||
|
export const columns: BasicColumn[] = [
|
||||||
|
{
|
||||||
|
title: '序号',
|
||||||
|
align:"center",
|
||||||
|
dataIndex: 'id',
|
||||||
|
width: 80
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// title: '公司名称',
|
||||||
|
// align:"center",
|
||||||
|
// dataIndex: 'companyName'
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// title: '锅炉房',
|
||||||
|
// align:"center",
|
||||||
|
// dataIndex: 'sourceName'
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// title: '换热站',
|
||||||
|
// align:"center",
|
||||||
|
// dataIndex: 'stationName'
|
||||||
|
// },
|
||||||
|
{
|
||||||
|
title: '创建时间',
|
||||||
|
align:"center",
|
||||||
|
dataIndex: 'createDate',
|
||||||
|
width: 160
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '更新时间',
|
||||||
|
align:"center",
|
||||||
|
dataIndex: 'updateDate',
|
||||||
|
width: 160
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '备注',
|
||||||
|
align:"center",
|
||||||
|
dataIndex: 'remarks'
|
||||||
|
},
|
||||||
|
];
|
||||||
|
//查询数据
|
||||||
|
export const searchFormSchema: FormSchema[] = [
|
||||||
|
{
|
||||||
|
label: '删除',
|
||||||
|
field: 'delFlag',
|
||||||
|
component: 'Select',
|
||||||
|
componentProps: {
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
label: '正常',
|
||||||
|
value: '0',
|
||||||
|
key: '0',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '删除',
|
||||||
|
value: '1',
|
||||||
|
key: '1',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
colProps: { span: 6 },
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
@ -0,0 +1,77 @@
|
||||||
|
<template>
|
||||||
|
<j-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
|
||||||
|
<HeatanalysisRemarksForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></HeatanalysisRemarksForm>
|
||||||
|
</j-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref, nextTick, defineExpose } from 'vue';
|
||||||
|
import HeatanalysisRemarksForm from './HeatanalysisRemarksForm.vue'
|
||||||
|
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
|
||||||
|
|
||||||
|
const title = ref<string>('');
|
||||||
|
const width = ref<number>(1200);
|
||||||
|
const visible = ref<boolean>(false);
|
||||||
|
const disableSubmit = ref<boolean>(false);
|
||||||
|
const registerForm = ref();
|
||||||
|
const emit = defineEmits(['register', 'success']);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增
|
||||||
|
*/
|
||||||
|
function add(parentData) {
|
||||||
|
title.value = '新增';
|
||||||
|
visible.value = true;
|
||||||
|
nextTick(() => {
|
||||||
|
registerForm.value.add(parentData);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
* @param record
|
||||||
|
*/
|
||||||
|
function edit(record) {
|
||||||
|
title.value = disableSubmit.value ? '详情' : '编辑';
|
||||||
|
visible.value = true;
|
||||||
|
nextTick(() => {
|
||||||
|
registerForm.value.edit(record);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 确定按钮点击事件
|
||||||
|
*/
|
||||||
|
function handleOk() {
|
||||||
|
registerForm.value.submitForm();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* form保存回调事件
|
||||||
|
*/
|
||||||
|
function submitCallback() {
|
||||||
|
handleCancel();
|
||||||
|
emit('success');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消按钮回调事件
|
||||||
|
*/
|
||||||
|
function handleCancel() {
|
||||||
|
visible.value = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
add,
|
||||||
|
edit,
|
||||||
|
disableSubmit,
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less">
|
||||||
|
/**隐藏样式-modal确定按钮 */
|
||||||
|
.jee-hidden {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<style lang="less" scoped></style>
|
||||||
|
|
@ -0,0 +1,77 @@
|
||||||
|
<template>
|
||||||
|
<j-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
|
||||||
|
<HeatanalysisRemarksList ref="remarksList" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></HeatanalysisRemarksList>
|
||||||
|
</j-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref, nextTick, defineExpose } from 'vue';
|
||||||
|
import HeatanalysisRemarksList from './HeatanalysisRemarksList.vue'
|
||||||
|
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
|
||||||
|
|
||||||
|
const title = ref<string>('');
|
||||||
|
const width = ref<number>(1600);
|
||||||
|
const visible = ref<boolean>(false);
|
||||||
|
const disableSubmit = ref<boolean>(false);
|
||||||
|
const remarksList = ref();
|
||||||
|
const emit = defineEmits(['register', 'success']);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增
|
||||||
|
*/
|
||||||
|
function add() {
|
||||||
|
title.value = '新增';
|
||||||
|
visible.value = true;
|
||||||
|
nextTick(() => {
|
||||||
|
remarksList.value.add();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
* @param record
|
||||||
|
*/
|
||||||
|
function edit(record) {
|
||||||
|
const names = [record.view001Name, record.view002Name, record.view004Name].filter(v => v && v !== '');
|
||||||
|
title.value = names.join(' → ');
|
||||||
|
visible.value = true;
|
||||||
|
nextTick(() => {
|
||||||
|
remarksList.value.init(record);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 确定按钮点击事件
|
||||||
|
*/
|
||||||
|
function handleOk() {
|
||||||
|
remarksList.value.submitForm();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* form保存回调事件
|
||||||
|
*/
|
||||||
|
function submitCallback() {
|
||||||
|
handleCancel();
|
||||||
|
emit('success');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消按钮回调事件
|
||||||
|
*/
|
||||||
|
function handleCancel() {
|
||||||
|
visible.value = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
edit,
|
||||||
|
disableSubmit,
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less">
|
||||||
|
/**隐藏样式-modal确定按钮 */
|
||||||
|
.jee-hidden {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<style lang="less" scoped></style>
|
||||||
|
|
@ -0,0 +1,179 @@
|
||||||
|
<template>
|
||||||
|
<a-spin :spinning="confirmLoading">
|
||||||
|
<JFormContainer :disabled="disabled">
|
||||||
|
<template #detail>
|
||||||
|
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
|
<a-row>
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="供热公司">
|
||||||
|
<a-input v-model:value="formData.companyName" placeholder="请输入供热公司" style="width: 100%" disabled="true"/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="锅炉房">
|
||||||
|
<a-input v-model:value="formData.sourceName" placeholder="请输入锅炉房" style="width: 100%" disabled="true"/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="换热站">
|
||||||
|
<a-input v-model:value="formData.stationName" placeholder="请输入换热站" style="width: 100%" disabled="true"/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="备注" v-bind="validateInfos.remarks">
|
||||||
|
<a-textarea v-model:value="formData.remarks" placeholder="请输入备注" :rows="4" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
</a-form>
|
||||||
|
</template>
|
||||||
|
</JFormContainer>
|
||||||
|
</a-spin>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted } from 'vue';
|
||||||
|
import { defHttp } from '/@/utils/http/axios';
|
||||||
|
import { useMessage } from '/@/hooks/web/useMessage';
|
||||||
|
import { getValueType } from '/@/utils';
|
||||||
|
import { saveOrUpdate } from './HeatanalysisReamrks.api';
|
||||||
|
import { Form } from 'ant-design-vue';
|
||||||
|
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
formDisabled: { type: Boolean, default: false },
|
||||||
|
formData: { type: Object, default: ()=>{} },
|
||||||
|
formBpm: { type: Boolean, default: true }
|
||||||
|
});
|
||||||
|
const formRef = ref();
|
||||||
|
const useForm = Form.useForm;
|
||||||
|
const emit = defineEmits(['register', 'ok']);
|
||||||
|
const formData = reactive<Record<string, any>>({
|
||||||
|
id: undefined,
|
||||||
|
mainId: undefined,
|
||||||
|
companyId: undefined,
|
||||||
|
companyName: undefined,
|
||||||
|
sourceId: undefined,
|
||||||
|
sourceName: undefined,
|
||||||
|
stationId: undefined,
|
||||||
|
stationName: undefined,
|
||||||
|
remarks: undefined,
|
||||||
|
});
|
||||||
|
const { createMessage } = useMessage();
|
||||||
|
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
|
||||||
|
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
|
||||||
|
const confirmLoading = ref<boolean>(false);
|
||||||
|
//表单验证
|
||||||
|
const validatorRules = {
|
||||||
|
remarks: [{ required: true, message: '请输入备注!'},],
|
||||||
|
};
|
||||||
|
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: true });
|
||||||
|
|
||||||
|
// 表单禁用
|
||||||
|
const disabled = computed(()=>{
|
||||||
|
if(props.formBpm === true){
|
||||||
|
if(props.formData.disabled === false){
|
||||||
|
return false;
|
||||||
|
}else{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return props.formDisabled;
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增
|
||||||
|
*/
|
||||||
|
function add(parentData) {
|
||||||
|
let record = {};
|
||||||
|
record["mainId"] = parentData["id"];
|
||||||
|
record["companyId"] = parentData["view001"];
|
||||||
|
record["companyName"] = parentData["view001Name"];
|
||||||
|
record["sourceId"] = parentData["view002"];
|
||||||
|
record["sourceName"] = parentData["view002Name"];
|
||||||
|
record["stationId"] = parentData["view004"];
|
||||||
|
record["stationName"] = parentData["view004Name"];
|
||||||
|
edit(record);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*/
|
||||||
|
function edit(record) {
|
||||||
|
nextTick(() => {
|
||||||
|
resetFields();
|
||||||
|
//赋值
|
||||||
|
const tmpData = {};
|
||||||
|
Object.keys(formData).forEach((key) => {
|
||||||
|
if(record.hasOwnProperty(key)){
|
||||||
|
tmpData[key] = record[key]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
//赋值
|
||||||
|
Object.assign(formData, tmpData);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提交数据
|
||||||
|
*/
|
||||||
|
async function submitForm() {
|
||||||
|
try {
|
||||||
|
// 触发表单验证
|
||||||
|
await validate();
|
||||||
|
} catch ({ errorFields }) {
|
||||||
|
if (errorFields) {
|
||||||
|
const firstField = errorFields[0];
|
||||||
|
if (firstField) {
|
||||||
|
formRef.value.scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Promise.reject(errorFields);
|
||||||
|
}
|
||||||
|
confirmLoading.value = true;
|
||||||
|
const isUpdate = ref<boolean>(false);
|
||||||
|
//时间格式化
|
||||||
|
let model = formData;
|
||||||
|
if (model.id) {
|
||||||
|
isUpdate.value = true;
|
||||||
|
}
|
||||||
|
//循环数据
|
||||||
|
for (let data in model) {
|
||||||
|
//如果该数据是数组并且是字符串类型
|
||||||
|
if (model[data] instanceof Array) {
|
||||||
|
let valueType = getValueType(formRef.value.getProps, data);
|
||||||
|
//如果是字符串类型的需要变成以逗号分割的字符串
|
||||||
|
if (valueType === 'string') {
|
||||||
|
model[data] = model[data].join(',');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
await saveOrUpdate(model, isUpdate.value)
|
||||||
|
.then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
createMessage.success(res.message);
|
||||||
|
emit('ok');
|
||||||
|
} else {
|
||||||
|
createMessage.warning(res.message);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
confirmLoading.value = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
add,
|
||||||
|
edit,
|
||||||
|
submitForm,
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
.antd-modal-form {
|
||||||
|
min-height: 500px !important;
|
||||||
|
overflow-y: auto;
|
||||||
|
padding: 24px 24px 24px 24px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,253 @@
|
||||||
|
<template>
|
||||||
|
<div class="p-2">
|
||||||
|
<JFormContainer :disabled="disabled">
|
||||||
|
<template #detail>
|
||||||
|
</template>
|
||||||
|
</JFormContainer>
|
||||||
|
<!--查询区域-->
|
||||||
|
<div class="jeecg-basic-table-form-container">
|
||||||
|
<a-form @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
|
||||||
|
<a-row :gutter="24">
|
||||||
|
<a-col :lg="6">
|
||||||
|
<a-form-item label="删除状态">
|
||||||
|
<a-select ref="select" placeholder="请选择状态" v-model:value="queryParam.delFlag">
|
||||||
|
<a-select-option value="0">正常</a-select-option>
|
||||||
|
<a-select-option value="1">删除</a-select-option>
|
||||||
|
</a-select>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :lg="6">
|
||||||
|
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
|
||||||
|
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
|
||||||
|
<a-button preIcon="ant-design:sync-outlined" @click="searchReset" style="margin-left: 8px">重置</a-button>
|
||||||
|
</span>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
</a-form>
|
||||||
|
</div>
|
||||||
|
<!--引用表格-->
|
||||||
|
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
||||||
|
<!--插槽:table标题-->
|
||||||
|
<template #tableTitle>
|
||||||
|
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
|
||||||
|
<a-dropdown v-if="selectedRowKeys.length > 0">
|
||||||
|
<template #overlay>
|
||||||
|
<a-menu>
|
||||||
|
<a-menu-item key="1" @click="batchHandleDelete">
|
||||||
|
<Icon icon="ant-design:delete-outlined"></Icon>
|
||||||
|
删除
|
||||||
|
</a-menu-item>
|
||||||
|
</a-menu>
|
||||||
|
</template>
|
||||||
|
<a-button >批量操作
|
||||||
|
<Icon icon="mdi:chevron-down"></Icon>
|
||||||
|
</a-button>
|
||||||
|
</a-dropdown>
|
||||||
|
</template>
|
||||||
|
<!--操作栏-->
|
||||||
|
<template #action="{ record }">
|
||||||
|
<TableAction :actions="getTableAction(record)"/>
|
||||||
|
</template>
|
||||||
|
<!--字段回显插槽-->
|
||||||
|
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||||
|
</template>
|
||||||
|
</BasicTable>
|
||||||
|
<!-- 表单区域 -->
|
||||||
|
<HeatanalysisReamrksFormModal ref="registerModal" @success="handleSuccess"></HeatanalysisReamrksFormModal>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" name="heating-remarks-list" setup>
|
||||||
|
import {ref, reactive, computed, unref, defineProps} from 'vue';
|
||||||
|
import {BasicTable, useTable, TableAction} from '/@/components/Table';
|
||||||
|
import { useListPage } from '/@/hooks/system/useListPage';
|
||||||
|
import HeatanalysisReamrksFormModal from './HeatanalysisReamrksFormModal.vue';
|
||||||
|
import {columns, searchFormSchema} from './HeatanalysisReamrks.data';
|
||||||
|
import {list, deleteOne, batchDelete} from './HeatanalysisReamrks.api';
|
||||||
|
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||||
|
import { useUserStore } from '/@/store/modules/user';
|
||||||
|
const props = defineProps({
|
||||||
|
formDisabled: { type: Boolean, default: false },
|
||||||
|
formData: { type: Object, default: () => ({})},
|
||||||
|
formBpm: { type: Boolean, default: true }
|
||||||
|
});
|
||||||
|
const queryParam = reactive<any>({});
|
||||||
|
const parentData = ref();
|
||||||
|
const checkedKeys = ref<Array<string | number>>([]);
|
||||||
|
const userStore = useUserStore();
|
||||||
|
const registerModal = ref();
|
||||||
|
//注册table数据
|
||||||
|
const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({
|
||||||
|
tableProps:{
|
||||||
|
title: '设备维护日志',
|
||||||
|
api: list,
|
||||||
|
defSort: {
|
||||||
|
column: 'id',
|
||||||
|
order: 'asc',
|
||||||
|
},
|
||||||
|
columns,
|
||||||
|
canResize:false,
|
||||||
|
actionColumn: {
|
||||||
|
width: 180,
|
||||||
|
fixed:'right'
|
||||||
|
},
|
||||||
|
beforeFetch: (params) => {
|
||||||
|
return Object.assign(params, queryParam);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
|
||||||
|
const labelCol = reactive({
|
||||||
|
xs: { span: 24 },
|
||||||
|
sm: { span: 7 },
|
||||||
|
});
|
||||||
|
const wrapperCol = reactive({
|
||||||
|
xs: { span: 24 },
|
||||||
|
sm: { span: 16 },
|
||||||
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增事件
|
||||||
|
*/
|
||||||
|
function handleAdd() {
|
||||||
|
registerModal.value.disableSubmit = false;
|
||||||
|
registerModal.value.add(parentData.value);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 编辑事件
|
||||||
|
*/
|
||||||
|
function handleEdit(record: Recordable) {
|
||||||
|
registerModal.value.disableSubmit = false;
|
||||||
|
registerModal.value.edit(record);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 详情
|
||||||
|
*/
|
||||||
|
function handleDetail(record: Recordable) {
|
||||||
|
registerModal.value.disableSubmit = true;
|
||||||
|
registerModal.value.edit(record);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 删除事件
|
||||||
|
*/
|
||||||
|
async function handleDelete(record) {
|
||||||
|
await deleteOne({id: record.id}, handleSuccess);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 批量删除事件
|
||||||
|
*/
|
||||||
|
async function batchHandleDelete() {
|
||||||
|
await batchDelete({ids: selectedRowKeys.value}, handleSuccess);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 成功回调
|
||||||
|
*/
|
||||||
|
function handleSuccess() {
|
||||||
|
(selectedRowKeys.value = []) && reload();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 操作栏
|
||||||
|
*/
|
||||||
|
function getTableAction(record){
|
||||||
|
// return [
|
||||||
|
// {
|
||||||
|
// label: '详情',
|
||||||
|
// onClick: handleDetail.bind(null, record),
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// label: '编辑',
|
||||||
|
// onClick: handleEdit.bind(null, record),
|
||||||
|
// }, {
|
||||||
|
// label: '删除',
|
||||||
|
// popConfirm: {
|
||||||
|
// title: '是否确认删除',
|
||||||
|
// confirm: handleDelete.bind(null, record),
|
||||||
|
// placement: 'topLeft',
|
||||||
|
// },
|
||||||
|
// }
|
||||||
|
// ]
|
||||||
|
const actions = [{}];
|
||||||
|
actions.push(
|
||||||
|
{
|
||||||
|
label: '详情',
|
||||||
|
onClick: handleDetail.bind(null, record),
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if(record.delFlag == '0'){
|
||||||
|
actions.push(
|
||||||
|
{
|
||||||
|
label: '编辑',
|
||||||
|
onClick: handleEdit.bind(null, record),
|
||||||
|
}
|
||||||
|
);
|
||||||
|
actions.push(
|
||||||
|
{
|
||||||
|
label: '删除',
|
||||||
|
popConfirm: {
|
||||||
|
title: '是否确认删除',
|
||||||
|
confirm: handleDelete.bind(null, record),
|
||||||
|
placement: 'topLeft',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return actions;
|
||||||
|
}
|
||||||
|
|
||||||
|
function init(record){
|
||||||
|
parentData.value = unref(record);
|
||||||
|
queryParam.mainId = parentData.value.id;
|
||||||
|
queryParam.delFlag = '0';
|
||||||
|
}
|
||||||
|
|
||||||
|
function searchQuery(){
|
||||||
|
reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
function searchReset(){
|
||||||
|
queryParam.delFlag = '0';
|
||||||
|
selectedRowKeys.value = [];
|
||||||
|
//刷新数据
|
||||||
|
reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 暴露给父组件的方法
|
||||||
|
defineExpose({
|
||||||
|
init
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
|
||||||
|
.jeecg-basic-table-form-container {
|
||||||
|
.table-page-search-submitButtons {
|
||||||
|
display: block;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.query-group-cust {
|
||||||
|
width: calc(50% - 15px);
|
||||||
|
min-width: 100px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.query-group-split-cust {
|
||||||
|
width: 30px;
|
||||||
|
display: inline-block;
|
||||||
|
text-align: center
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.jeecg-basic-table-form-container) {
|
||||||
|
padding: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.ant-form-item) {
|
||||||
|
margin-bottom: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,294 @@
|
||||||
|
<template>
|
||||||
|
<div class="p-2">
|
||||||
|
<!--查询区域-->
|
||||||
|
<div class="jeecg-basic-table-form-container">
|
||||||
|
<a-form @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
|
||||||
|
<a-row :gutter="24">
|
||||||
|
<a-col :lg="6">
|
||||||
|
<a-form-item label="供热公司">
|
||||||
|
<a-select ref="select" placeholder="请选择供热公司" v-model:value="queryParam.view001"
|
||||||
|
@focus="focus" @change="handleChange1">
|
||||||
|
<a-select-option :value="item.id" v-for="item in thermalcompany" :key="item.id">{{ item.companyName
|
||||||
|
}}</a-select-option>
|
||||||
|
</a-select>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :lg="6">
|
||||||
|
<a-form-item label="锅炉房">
|
||||||
|
<a-select ref="select" placeholder="请选择锅炉房" v-model:value="queryParam.view002"
|
||||||
|
@focus="focus" @change="handleChange2">
|
||||||
|
<a-select-option :value="item.id" v-for="item in heatsource" :key="item.id">{{ item.sourceName
|
||||||
|
}}</a-select-option>
|
||||||
|
</a-select>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :lg="6">
|
||||||
|
<a-form-item label="换热站">
|
||||||
|
<a-select ref="select" placeholder="请选择换热站" v-model:value="queryParam.view004"
|
||||||
|
@focus="focus" @change="handleChange3">
|
||||||
|
<a-select-option :value="item.id" v-for="item in heatsourcestation" :key="item.id">{{ item.stationName
|
||||||
|
}}</a-select-option>
|
||||||
|
</a-select>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
<a-row :gutter="24" style="margin-top: 5px;">
|
||||||
|
<a-col :lg="6">
|
||||||
|
<a-form-item label="区域">
|
||||||
|
<a-select ref="select" placeholder="请选择换区域" v-model:value="queryParam.regionType">
|
||||||
|
<a-select-option value="">全部</a-select-option>
|
||||||
|
<a-select-option value="城区">城区</a-select-option>
|
||||||
|
<a-select-option value="郊县">郊县</a-select-option>
|
||||||
|
</a-select>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :lg="6">
|
||||||
|
<a-form-item label="故障等级">
|
||||||
|
<a-select ref="select" placeholder="请选择换区域" v-model:value="queryParam.faultLevel">
|
||||||
|
<a-select-option value="">全部</a-select-option>
|
||||||
|
<a-select-option value="0">正常</a-select-option>
|
||||||
|
<a-select-option value="1">低级</a-select-option>
|
||||||
|
<a-select-option value="2">中级</a-select-option>
|
||||||
|
<a-select-option value="3">高级</a-select-option>
|
||||||
|
</a-select>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :lg="6">
|
||||||
|
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
|
||||||
|
<a-col :lg="6">
|
||||||
|
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
|
||||||
|
<a-button preIcon="ant-design:sync-outlined" @click="searchReset" style="margin-left: 8px">重置</a-button>
|
||||||
|
</a-col>
|
||||||
|
</span>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
</a-form>
|
||||||
|
</div>
|
||||||
|
<!--引用表格-->
|
||||||
|
<BasicTable @register="registerTable" :rowClassName="tableRowClassName">
|
||||||
|
<!--操作栏-->
|
||||||
|
<template #action="{ record }">
|
||||||
|
<TableAction :actions="getTableAction(record)" />
|
||||||
|
</template>
|
||||||
|
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||||
|
<template v-if="column.dataIndex === 'view005'">
|
||||||
|
<span v-if="record.fromFlow == 0">{{ record.view005 }}</span>
|
||||||
|
<span v-else-if="record.fromFlow == 1">{{ record.view035 }}</span>
|
||||||
|
<span v-else>{{ record.view005 || record.view035 || 0 }}</span>
|
||||||
|
</template>
|
||||||
|
<template v-if="column.dataIndex === 'view006'">
|
||||||
|
<span v-if="record.fromFlow == 0">{{ record.view006 }}</span>
|
||||||
|
<span v-else-if="record.fromFlow == 1">{{ record.view036 }}</span>
|
||||||
|
<span v-else>{{ record.view005 || record.view035 || 0 }}</span>
|
||||||
|
</template>
|
||||||
|
<template v-if="column.dataIndex === 'faultLevel'">
|
||||||
|
<div style="cursor:pointer" @click="changeLevel(record)">
|
||||||
|
<a-tag color="pink" v-if="record.faultLevel == 1" >低级</a-tag>
|
||||||
|
<a-tag color="pink" v-else-if="record.faultLevel == 2">中级</a-tag>
|
||||||
|
<a-tag color="pink" v-else-if="record.faultLevel == 3">高级</a-tag>
|
||||||
|
<a-tag color="green" v-else>正常</a-tag>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</BasicTable>
|
||||||
|
|
||||||
|
<ChangeLevelModal ref="levelModal" @success="handleSuccess()"></ChangeLevelModal>
|
||||||
|
<HeatanalysisReamrksListModal ref="remarksModal"></HeatanalysisReamrksListModal>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" name="heatanalysis-heatanalysis" setup>
|
||||||
|
import { ref, reactive, onMounted } from 'vue';
|
||||||
|
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||||
|
import { useListPage } from '/@/hooks/system/useListPage';
|
||||||
|
import { columns } from './Heatanalysis.data';
|
||||||
|
import { list, companylist, heatsourcelist, heatsourcestationlist } from './Heatanalysis.api';
|
||||||
|
import HeatanalysisReamrksListModal from './components/HeatanalysisReamrksListModal.vue'
|
||||||
|
import ChangeLevelModal from './components/ChangeLevelModal.vue'
|
||||||
|
|
||||||
|
const queryParam = ref<any>({});
|
||||||
|
const toggleSearchStatus = ref<boolean>(false);
|
||||||
|
const levelModal = ref();
|
||||||
|
const remarksModal = ref();
|
||||||
|
//注册table数据
|
||||||
|
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||||
|
tableProps: {
|
||||||
|
title: '',
|
||||||
|
api: list,
|
||||||
|
columns,
|
||||||
|
canResize: false,
|
||||||
|
useSearchForm: false,
|
||||||
|
clickToRowSelect: false,
|
||||||
|
showIndexColumn: false,
|
||||||
|
tableSetting: {
|
||||||
|
// 是否显示刷新按钮
|
||||||
|
redo: false,
|
||||||
|
// 是否显示尺寸调整按钮
|
||||||
|
size: false,
|
||||||
|
// 是否显示字段调整按钮
|
||||||
|
setting: false,
|
||||||
|
// 是否显示全屏按钮
|
||||||
|
fullScreen: false,
|
||||||
|
},
|
||||||
|
actionColumn: {
|
||||||
|
width: 80,
|
||||||
|
fixed:'right'
|
||||||
|
},
|
||||||
|
beforeFetch: (params) => {
|
||||||
|
params.column = '', params.order = '';//新生成的默认不带排序
|
||||||
|
return Object.assign(params, queryParam.value);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||||
|
const labelCol = reactive({
|
||||||
|
xs: { span: 24 },
|
||||||
|
sm: { span: 7 },
|
||||||
|
});
|
||||||
|
const wrapperCol = reactive({
|
||||||
|
xs: { span: 24 },
|
||||||
|
sm: { span: 16 },
|
||||||
|
});
|
||||||
|
|
||||||
|
function tableRowClassName(record) {
|
||||||
|
if (record.faultLevel == 1) {
|
||||||
|
return 'rowYellowColor';
|
||||||
|
}
|
||||||
|
if (record.faultLevel == 2) {
|
||||||
|
return 'rowOrangeColor';
|
||||||
|
}
|
||||||
|
if (record.faultLevel == 3) {
|
||||||
|
return 'rowRedColor';
|
||||||
|
}
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 成功回调
|
||||||
|
*/
|
||||||
|
function handleSuccess() {
|
||||||
|
(selectedRowKeys.value = []) && reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询
|
||||||
|
*/
|
||||||
|
function searchQuery() {
|
||||||
|
reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重置
|
||||||
|
*/
|
||||||
|
function searchReset() {
|
||||||
|
queryParam.value = {};
|
||||||
|
selectedRowKeys.value = [];
|
||||||
|
getHeatsource();
|
||||||
|
getHeatsourcestation();
|
||||||
|
//刷新数据
|
||||||
|
reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
const thermalcompany = ref();
|
||||||
|
async function getThermalcompany() {
|
||||||
|
thermalcompany.value = await companylist();
|
||||||
|
}
|
||||||
|
|
||||||
|
const heatsource = ref();
|
||||||
|
async function getHeatsource() {
|
||||||
|
heatsource.value = await heatsourcelist();
|
||||||
|
}
|
||||||
|
|
||||||
|
const heatsourcestation = ref();
|
||||||
|
async function getHeatsourcestation() {
|
||||||
|
heatsourcestation.value = await heatsourcestationlist();
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleChange1(record) {
|
||||||
|
var params = { companyId: record};
|
||||||
|
heatsource.value = await heatsourcelist(params);
|
||||||
|
heatsourcestation.value = [];
|
||||||
|
}
|
||||||
|
async function handleChange2(record) {
|
||||||
|
var params = { sourceId: record };
|
||||||
|
heatsourcestation.value = await heatsourcestationlist(params);
|
||||||
|
}
|
||||||
|
function handleChange3(record) {
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleDetail(record: Recordable) {
|
||||||
|
remarksModal.value.disableSubmit = true;
|
||||||
|
remarksModal.value.edit(record)
|
||||||
|
}
|
||||||
|
|
||||||
|
function changeLevel(record) {
|
||||||
|
levelModal.value.disableSubmit = false;
|
||||||
|
levelModal.value.edit(record);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作栏
|
||||||
|
*/
|
||||||
|
function getTableAction(record) {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
label: '备注',
|
||||||
|
onClick: handleDetail.bind(null, record),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
getThermalcompany();
|
||||||
|
getHeatsource();
|
||||||
|
getHeatsourcestation();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
.jeecg-basic-table-form-container {
|
||||||
|
.table-page-search-submitButtons {
|
||||||
|
display: block;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.query-group-cust {
|
||||||
|
width: calc(50% - 15px);
|
||||||
|
min-width: 100px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.query-group-split-cust {
|
||||||
|
width: 30px;
|
||||||
|
display: inline-block;
|
||||||
|
text-align: center
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.ant-table-title) {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.jeecg-basic-table-form-container) {
|
||||||
|
padding: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.ant-form-item) {
|
||||||
|
margin-bottom: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.ant-table-tbody .rowYellowColor) {
|
||||||
|
background-color: rgb(250, 215, 20) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.ant-table-tbody .rowOrangeColor) {
|
||||||
|
background-color: rgb(255, 147, 0) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.ant-table-tbody .rowRedColor) {
|
||||||
|
background-color: rgb(245, 34, 34) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
Loading…
Reference in New Issue