增加武乡 三种监测页面

This commit is contained in:
zy 2026-03-21 18:18:57 +08:00
parent 17c8961750
commit 37e786ca23
18 changed files with 2545 additions and 88 deletions

View File

@ -7,20 +7,22 @@
:labelStyle="{ fontWeight: 'bold', textAlign: 'center' }"
:contentStyle="{ textAlign: 'center' }"
>
<a-descriptions-item :label="item.moduleName" v-for="item in formState.runList" :key="item.id"> <span>停止</span> </a-descriptions-item>
<a-descriptions-item :label="item.moduleName" v-for="item in formState.runList" :key="item.id">
<span style="color: red">停止</span>
</a-descriptions-item>
</a-descriptions>
<a-descriptions title="" layout="vertical" bordered style="margin-top: 20px">
<a-descriptions-item label="控制项">
<a-form :model="formState" :label-col="labelCol" :wrapper-col="wrapperCol">
<!-- <a-form-item label="上报时间">-->
<!-- <a-input v-model:value="formState.dataTime" disabled="true" />-->
<!-- </a-form-item>-->
<!-- <a-form-item label="上报时间">-->
<!-- <a-input v-model:value="formState.dataTime" disabled="true" />-->
<!-- </a-form-item>-->
<div class="card-container">
<a-row :gutter="16" type="flex">
<a-col :span="8" v-for="group in formState.moduleList" :key="group.id" class="card-col">
<a-card :title="group.groupName" :bordered="true">
<template #extra><a href="#">一键启动</a></template>
<!-- <template #extra><a href="#">一键启动</a></template>-->
<a-form-item :label="item.moduleName" v-for="item in group.modules" :key="item.id">
<a-switch
v-model:checked="formState[item.id]"
@ -46,7 +48,7 @@
import { message } from 'ant-design-vue';
const bodystyle = {
height: '900px',
height: '1000px',
margin: '20px',
};
@ -146,7 +148,9 @@
function showup(record) {
title.value = '球阀控制';
visible.value = true;
formState.moduleList = [];
formState.runList = [];
formState.dataTime = '';
getRelayList({ deployId: record.deployId }).then((res) => {
if (res.code == 200) {
formState.moduleList = res.result.moduleList;

View File

@ -6,17 +6,17 @@ import { render } from '/@/utils/common/renderUtils';
export const columns: BasicColumn[] = [
{
title: '站点名称',
align: "center",
align: 'center',
dataIndex: 'stationName',
},
{
title: '设备编号',
align: "center",
align: 'center',
dataIndex: 'deployCode',
},
{
title: '数据更新时间',
align: "center",
align: 'center',
dataIndex: 'dataDateTime',
},
// {
@ -26,18 +26,18 @@ export const columns: BasicColumn[] = [
// },
{
title: '总磷(mg/L)',
align: "center",
dataIndex: 'dataWaterTp'
align: 'center',
dataIndex: 'dataWaterTpSy',
},
{
title: '总氮(mg/L)',
align: "center",
dataIndex: 'dataWaterTn'
align: 'center',
dataIndex: 'dataWaterTnSy',
},
{
title: '化学需氧量(mg/L)',
align: "center",
dataIndex: 'dataWaterCod'
align: 'center',
dataIndex: 'dataWaterCodSy',
},
// {
// title: '硝态氮(mg/L)',

View File

@ -23,78 +23,85 @@
</a-form-item>
</a-col> -->
<a-col :span="24">
<a-form-item label="总磷(mg/L)" v-bind="validateInfos.dataWaterTp">
<a-input v-model:value="formData.dataWaterTp" placeholder="" :disabled="disabled"></a-input>
<a-form-item label="总磷(mg/L)" v-bind="validateInfos.dataWaterTpSy">
<a-input v-model:value="formData.dataWaterTpSy" placeholder="" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="总氮(mg/L)" v-bind="validateInfos.dataWaterTn">
<a-input v-model:value="formData.dataWaterTn" placeholder="" :disabled="disabled"></a-input>
<a-form-item label="总氮(mg/L)" v-bind="validateInfos.dataWaterTnSy">
<a-input v-model:value="formData.dataWaterTnSy" placeholder="" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<!-- <a-col :span="24">-->
<!-- <a-form-item label="硝态氮(mg/L)" v-bind="validateInfos.dataWaterNo">-->
<!-- <a-input v-model:value="formData.dataWaterNo" placeholder="" :disabled="disabled"></a-input>-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-item label="硝态氮(mg/L)" v-bind="validateInfos.dataWaterNo">-->
<!-- <a-input v-model:value="formData.dataWaterNo" placeholder="" :disabled="disabled"></a-input>-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<a-col :span="24">
<a-form-item label="化学需氧量(mg/L)" v-bind="validateInfos.dataWaterCod">
<a-input v-model:value="formData.dataWaterCod" placeholder="请输入化学需氧量" :disabled="disabled"></a-input>
<a-form-item label="化学需氧量(mg/L)" v-bind="validateInfos.dataWaterCodSy">
<a-input v-model:value="formData.dataWaterCodSy" placeholder="请输入化学需氧量" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<!-- <a-col :span="24">-->
<!-- <a-form-item label="总磷水样" v-bind="validateInfos.dataWaterTpSy">-->
<!-- <a-input v-model:value="formData.dataWaterTpSy" placeholder="" :disabled="disabled"></a-input>-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-item label="总磷零点" v-bind="validateInfos.dataWaterTpLd">-->
<!-- <a-input v-model:value="formData.dataWaterTpLd" placeholder="" :disabled="disabled"></a-input>-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-item label="总氮水样" v-bind="validateInfos.dataWaterTnSy">-->
<!-- <a-input v-model:value="formData.dataWaterTnSy" placeholder="" :disabled="disabled"></a-input>-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-item label="总氮零点" v-bind="validateInfos.dataWaterTnLd">-->
<!-- <a-input v-model:value="formData.dataWaterTnLd" placeholder="" :disabled="disabled"></a-input>-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-item label="总氮零点" v-bind="validateInfos.fluidLevel">-->
<!-- <a-input v-model:value="formData.fluidLevel" placeholder="" :disabled="disabled"></a-input>-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-item label="1#球阀状态" v-bind="validateInfos.firstValveStatus">-->
<!-- <a-input v-model:value="formData.firstValveStatus" placeholder="" :disabled="disabled"></a-input>-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-item label="2#球阀状态" v-bind="validateInfos.secondValveStatus">-->
<!-- <a-input v-model:value="formData.secondValveStatus" placeholder="" :disabled="disabled"></a-input>-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-item label="急停状态" v-bind="validateInfos.crashStopStatus">-->
<!-- <a-input v-model:value="formData.crashStopStatus" placeholder="" :disabled="disabled"></a-input>-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-item label="水泵状态" v-bind="validateInfos.waterPumpStatus">-->
<!-- <a-input v-model:value="formData.waterPumpStatus" placeholder="" :disabled="disabled"></a-input>-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-item label="主副泵状态" v-bind="validateInfos.mainSideStatus">-->
<!-- <a-input v-model:value="formData.mainSideStatus" placeholder="" :disabled="disabled"></a-input>-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-item label="总磷水样" v-bind="validateInfos.dataWaterTpSy">-->
<!-- <a-input v-model:value="formData.dataWaterTpSy" placeholder="" :disabled="disabled"></a-input>-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-item label="总磷零点" v-bind="validateInfos.dataWaterTpLd">-->
<!-- <a-input v-model:value="formData.dataWaterTpLd" placeholder="" :disabled="disabled"></a-input>-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-item label="总氮水样" v-bind="validateInfos.dataWaterTnSy">-->
<!-- <a-input v-model:value="formData.dataWaterTnSy" placeholder="" :disabled="disabled"></a-input>-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-item label="总氮零点" v-bind="validateInfos.dataWaterTnLd">-->
<!-- <a-input v-model:value="formData.dataWaterTnLd" placeholder="" :disabled="disabled"></a-input>-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-item label="总氮零点" v-bind="validateInfos.fluidLevel">-->
<!-- <a-input v-model:value="formData.fluidLevel" placeholder="" :disabled="disabled"></a-input>-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-item label="1#球阀状态" v-bind="validateInfos.firstValveStatus">-->
<!-- <a-input v-model:value="formData.firstValveStatus" placeholder="" :disabled="disabled"></a-input>-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-item label="2#球阀状态" v-bind="validateInfos.secondValveStatus">-->
<!-- <a-input v-model:value="formData.secondValveStatus" placeholder="" :disabled="disabled"></a-input>-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-item label="急停状态" v-bind="validateInfos.crashStopStatus">-->
<!-- <a-input v-model:value="formData.crashStopStatus" placeholder="" :disabled="disabled"></a-input>-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-item label="水泵状态" v-bind="validateInfos.waterPumpStatus">-->
<!-- <a-input v-model:value="formData.waterPumpStatus" placeholder="" :disabled="disabled"></a-input>-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-item label="主副泵状态" v-bind="validateInfos.mainSideStatus">-->
<!-- <a-input v-model:value="formData.mainSideStatus" placeholder="" :disabled="disabled"></a-input>-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<a-col :span="24">
<a-form-item label="数据更新时间" v-bind="validateInfos.dataDateTime">
<a-date-picker placeholder="" v-model:value="formData.dataDateTime" value-format="YYYY-MM-DD HH:mm:ss" show-time="{ format: 'YYYY-MM-DD HH:mm:ss' }" style="width: 100%" :disabled="disabled"/>
<a-date-picker
placeholder=""
v-model:value="formData.dataDateTime"
value-format="YYYY-MM-DD HH:mm:ss"
show-time="{ format: 'YYYY-MM-DD HH:mm:ss' }"
style="width: 100%"
:disabled="disabled"
/>
</a-form-item>
</a-col>
<!-- <a-col :span="24">
@ -122,8 +129,8 @@
const props = defineProps({
formDisabled: { type: Boolean, default: false },
formData: { type: Object, default: ()=>{} },
formBpm: { type: Boolean, default: true }
formData: { type: Object, default: () => {} },
formBpm: { type: Boolean, default: true },
});
const formRef = ref();
const useForm = Form.useForm;
@ -153,23 +160,21 @@
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
const confirmLoading = ref<boolean>(false);
//
const validatorRules = {
};
const validatorRules = {};
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: true });
//
const disabled = computed(()=>{
if(props.formBpm === true){
if(props.formData.disabled === false){
const disabled = computed(() => {
if (props.formBpm === true) {
if (props.formData.disabled === false) {
return false;
}else{
} else {
return true;
}
}
return props.formDisabled;
});
/**
* 新增
*/
@ -226,7 +231,6 @@
});
}
defineExpose({
add,
edit,

View File

@ -0,0 +1,72 @@
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
list = '/appmana/survHisdataLivestockwater/list',
save='/appmana/survHisdataLivestockwater/add',
edit='/appmana/survHisdataLivestockwater/edit',
deleteOne = '/appmana/survHisdataLivestockwater/delete',
deleteBatch = '/appmana/survHisdataLivestockwater/deleteBatch',
importExcel = '/appmana/survHisdataLivestockwater/importExcel',
exportXls = '/appmana/survHisdataLivestockwater/exportXls',
}
/**
* api
* @param params
*/
export const getExportUrl = Api.exportXls;
/**
* api
*/
export const getImportUrl = Api.importExcel;
/**
*
* @param params
*/
export const list = (params) => defHttp.get({ url: Api.list, params });
/**
*
* @param params
* @param handleSuccess
*/
export const deleteOne = (params,handleSuccess) => {
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
/**
*
* @param params
* @param handleSuccess
*/
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
* @param isUpdate
*/
export const saveOrUpdate = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.save;
return defHttp.post({ url: url, params }, { isTransformResponse: false });
}

View File

@ -0,0 +1,148 @@
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: 'stationName',
},
{
title: '设备编号',
align: 'center',
dataIndex: 'deployCode',
},
{
title: '数据更新时间',
align: 'center',
dataIndex: 'dataDateTime',
},
// {
// title: '数据ID',
// align: "center",
// dataIndex: 'dataId'
// },
{
title: '总磷(mg/L)',
align: 'center',
dataIndex: 'dataWaterTpSy',
},
{
title: '总氮(mg/L)',
align: 'center',
dataIndex: 'dataWaterTnSy',
},
// {
// title: '氨氮(mg/L)',
// align: "center",
// dataIndex: 'dataWaterNh'
// },
{
title: '化学需氧量(mg/L)',
align: 'center',
dataIndex: 'dataWaterCodSy',
},
// {
// title: '数据类型;realTime=实时dayTime=日数据month=月数据year=年数据',
// align: "center",
// dataIndex: 'dataGatherType'
// },
// {
// title: '转储时间',
// align: "center",
// dataIndex: 'transDate',
// },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
{
label: '租户号',
field: 'tenantId',
component: 'Input',
},
{
label: '乐观锁',
field: 'reVision',
component: 'InputNumber',
},
{
label: '创建人',
field: 'createdBy',
component: 'Input',
},
{
label: '创建时间',
field: 'createTime',
component: 'DatePicker',
},
{
label: '更新人',
field: 'updatedBy',
component: 'Input',
},
{
label: '逻辑删除',
field: 'isDel',
component: 'InputNumber',
},
{
label: '更新时间',
field: 'updatedTime',
component: 'DatePicker',
},
{
label: '数据ID',
field: 'dataId',
component: 'Input',
},
{
label: '总磷',
field: 'dataWaterTpSy',
component: 'Input',
},
{
label: '总氮',
field: 'dataWaterTnSy',
component: 'Input',
},
{
label: '化学需氧量',
field: 'dataWaterCodSy',
component: 'Input',
},
// {
// label: '硝态氮',
// field: 'dataWaterNo',
// component: 'Input',
// },
{
label: '数据更新时间',
field: 'dataDateTime',
component: 'DatePicker',
},
{
label: '数据类型;realTime=实时dayTime=日数据month=月数据year=年数据',
field: 'dataGatherType',
component: 'Input',
},
{
label: '转储时间',
field: 'transDate',
component: 'DatePicker',
},
// TODO 主键隐藏字段目前写死为ID
{
label: '',
field: 'id',
component: 'Input',
show: false,
},
];

View File

@ -0,0 +1,273 @@
<template>
<div>
<!--查询区域-->
<div class="jeecg-basic-table-form-container">
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-row :gutter="24">
<a-col :xs="24" :sm="8" :md="6" :lg="8" :xl="6" :xxl="6" style="margin-left: -10px; margin-top: 16px">
<a-form-item label="选择监测站" name="stationCode">
<ApiSelect
:api="getStationList"
:params="stationType"
showSearch
v-model:value="queryParam.stationCode"
optionFilterProp="label"
resultField="list"
labelField="stationName"
valueField="stationCode"
placeholder="请选择"
/>
</a-form-item>
</a-col>
<a-col :xs="24" :sm="8" :md="6" :lg="8" :xl="6" :xxl="6" style="margin-left: -10px; margin-top: 16px">
<a-form-item label="数据更新时间" name="dataDateTime">
<a-date-picker placeholder="" v-model:value="queryParam.dataDateTime" value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />
</a-form-item>
</a-col>
<template v-if="toggleSearchStatus">
<a-col :xs="24" :sm="8" :md="6" :lg="8" :xl="6" :xxl="6" style="margin-left: -10px; margin-top: 16px">
<a-form-item label="设备部署编号" name="deviceCode">
<a-input placeholder="请输入设备部署编号查询" v-model:value="queryParam.deviceCode"></a-input>
</a-form-item>
</a-col>
<!-- <a-col :xs="24" :sm="8" :md="6" :lg="8" :xl="6" :xxl="6" style="margin-left:-10px;margin-top: 16px;">
<a-form-item label="污染物类型" name="pollution">
<JDictSelectTag type="select" v-model:value="queryParam.pollution" dictCode="surv_livestock_pullution" placeholder="请选择污染物类型" />
</a-form-item>
</a-col> -->
</template>
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
<a-col :xs="24" :sm="8" :md="6" :lg="8" :xl="6" :xxl="6" style="margin-left: -10px; margin-top: 16px">
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset" style="margin-left: 8px">重置</a-button>
<a @click="toggleSearchStatus = !toggleSearchStatus" style="margin-left: 8px">
{{ toggleSearchStatus ? '收起' : '展开' }}
<Icon :icon="toggleSearchStatus ? 'ant-design:up-outlined' : 'ant-design:down-outlined'" />
</a>
</a-col>
</span>
</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-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
<!-- <j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-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)" :dropDownActions="getDropDownAction(record)"/> -->
<TableAction :actions="getDetailAction(record)" />
</template>
<!--字段回显插槽-->
<template #htmlSlot="{ text }">
<div v-html="text"></div>
</template>
<!--省市区字段回显插槽-->
<template #pcaSlot="{ text }">
{{ getAreaTextByCode(text) }}
</template>
<template #fileSlot="{ text }">
<span v-if="!text" style="font-size: 12px; font-style: italic">无文件</span>
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button>
</template>
</BasicTable>
<!-- 表单区域 -->
<SurvHisdataLivestockwaterModal ref="registerModal" @success="handleSuccess"></SurvHisdataLivestockwaterModal>
</div>
</template>
<script lang="ts" name="appmana-survHisdataLivestockwater" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns } from './SurvHisdataLivestockwater.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './SurvHisdataLivestockwater.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import SurvHisdataLivestockwaterModal from './components/SurvHisdataLivestockwaterModal.vue'
import { ApiSelect} from '/@/components/Form/index';
import { getStationList } from '../../station/SurvStationInfo.api';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
const formRef = ref();
const queryParam = reactive<any>({});
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
const stationType = { stationType: 'livestock'};
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: 'surv_hisdata_livestockwater',
api: list,
columns,
canResize:false,
useSearchForm: false,
actionColumn: {
width: 120,
fixed: 'right',
},
beforeFetch: (params) => {
queryParam.dataType = 'standard';
return Object.assign(params, queryParam);
},
},
exportConfig: {
name: "surv_hisdata_livestockwater",
url: getExportUrl,
params: queryParam,
},
importConfig: {
url: getImportUrl,
success: handleSuccess
},
});
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 handleAdd() {
registerModal.value.disableSubmit = false;
registerModal.value.add();
}
/**
* 编辑事件
*/
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: handleEdit.bind(null, record),
},
];
}
/**
* 操作栏
*/
function getDetailAction(record) {
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
},
];
}
/**
* 下拉操作栏
*/
function getDropDownAction(record) {
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
}, {
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
}
}
]
}
/**
* 查询
*/
function searchQuery() {
reload();
}
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
selectedRowKeys.value = [];
//
reload();
}
</script>
<style lang="less" scoped>
.jeecg-basic-table-form-container {
.table-page-search-submitButtons {
display: block;
margin-bottom: 24px;
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;
}
}
</style>

View File

@ -0,0 +1,199 @@
<template>
<a-spin :spinning="confirmLoading">
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-row>
<a-col :span="24">
<a-form-item label="站点名称" v-bind="validateInfos.stationName">
<a-input v-model:value="formData.stationName" placeholder="请输入站点名称" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="设备名称" v-bind="validateInfos.deviceName">
<a-input v-model:value="formData.deviceName" placeholder="请输入设备名称" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="设备编号" v-bind="validateInfos.deployCode">
<a-input v-model:value="formData.deployCode" placeholder="请输入设备编号" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<!-- <a-col :span="24">-->
<!-- <a-form-item label="数据ID" v-bind="validateInfos.dataId">-->
<!-- <a-input v-model:value="formData.dataId" placeholder="请输入数据ID" :disabled="disabled"></a-input>-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<a-col :span="24">
<a-form-item label="总磷(mg/L)" v-bind="validateInfos.dataWaterTpSy">
<a-input v-model:value="formData.dataWaterTpSy" placeholder="请输入总磷" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="总氮(mg/L)" v-bind="validateInfos.dataWaterTnSy">
<a-input v-model:value="formData.dataWaterTnSy" placeholder="请输入总氮" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<!-- <a-col :span="24">-->
<!-- <a-form-item label="氨氮(mg/L)" v-bind="validateInfos.dataWaterNh">-->
<!-- <a-input v-model:value="formData.dataWaterNhSy" placeholder="请输入氨氮" :disabled="disabled"></a-input>-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<a-col :span="24">
<a-form-item label="化学需氧量(mg/L)" v-bind="validateInfos.dataWaterCodSy">
<a-input v-model:value="formData.dataWaterCodSy" placeholder="请输入化学需氧量" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="数据更新时间" v-bind="validateInfos.dataDateTime">
<a-date-picker
placeholder=""
v-model:value="formData.dataDateTime"
value-format="YYYY-MM-DD HH:mm:ss"
show-time="{ format: 'YYYY-MM-DD HH:mm:ss' }"
style="width: 100%"
:disabled="disabled"
/>
</a-form-item>
</a-col>
<!-- <a-col :span="24">
<a-form-item label="数据类型" v-bind="validateInfos.dataGatherType">
<a-input v-model:value="formData.dataGatherType" placeholder="" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="转储时间" v-bind="validateInfos.transDate">
<a-date-picker placeholder="" v-model:value="formData.transDate" value-format="YYYY-MM-DD HH:mm:ss" show-time="{ format: 'YYYY-MM-DD HH:mm:ss' }" style="width: 100%" :disabled="disabled"/>
</a-form-item>
</a-col> -->
</a-row>
</a-form>
</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 '../SurvHisdataLivestockwater.api';
import { Form } from 'ant-design-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: '',
tenantId: '',
reVision: undefined,
createdBy: '',
createTime: '',
updatedBy: '',
isDel: undefined,
updatedTime: '',
dataId: '',
dataWaterTp: '',
dataWaterTn: '',
dataWaterNh: '',
dataWaterCod: '',
dataDateTime: '',
dataGatherType: '',
transDate: '',
deviceName: '',
deviceCode: '',
stationName: '',
});
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 = {};
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() {
edit({});
}
/**
* 编辑
*/
function edit(record) {
nextTick(() => {
resetFields();
//
Object.assign(formData, record);
});
}
/**
* 提交数据
*/
async function submitForm() {
//
await validate();
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>

View File

@ -0,0 +1,75 @@
<template>
<a-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
<SurvHisdataLivestockwaterForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></SurvHisdataLivestockwaterForm>
</a-modal>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import SurvHisdataLivestockwaterForm from './SurvHisdataLivestockwaterForm.vue'
const title = ref<string>('');
const width = ref<number>(800);
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>
/**隐藏样式-modal确定按钮 */
.jee-hidden {
display: none !important;
}
</style>

View File

@ -0,0 +1,72 @@
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
list = '/appmana/survHisdataOrientwater/list',
save='/appmana/survHisdataOrientwater/add',
edit='/appmana/survHisdataOrientwater/edit',
deleteOne = '/appmana/survHisdataOrientwater/delete',
deleteBatch = '/appmana/survHisdataOrientwater/deleteBatch',
importExcel = '/appmana/survHisdataOrientwater/importExcel',
exportXls = '/appmana/survHisdataOrientwater/exportXls',
}
/**
* api
* @param params
*/
export const getExportUrl = Api.exportXls;
/**
* api
*/
export const getImportUrl = Api.importExcel;
/**
*
* @param params
*/
export const list = (params) => defHttp.get({ url: Api.list, params });
/**
*
* @param params
* @param handleSuccess
*/
export const deleteOne = (params,handleSuccess) => {
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
/**
*
* @param params
* @param handleSuccess
*/
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
* @param isUpdate
*/
export const saveOrUpdate = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.save;
return defHttp.post({ url: url, params }, { isTransformResponse: false });
}

View File

@ -0,0 +1,172 @@
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: 'stationName',
},
{
title: '设备编号',
align: 'center',
dataIndex: 'deployCode',
},
{
title: '数据更新时间',
align: 'center',
dataIndex: 'dataDateTime',
},
// {
// title: '数据ID',
// align: "center",
// dataIndex: 'dataId'
// },
{
title: '总磷(mg/L)',
align: 'center',
dataIndex: 'dataWaterTpSy',
},
{
title: '总氮(mg/L)',
align: 'center',
dataIndex: 'dataWaterTnSy',
},
// {
// title: '化学需氧量(mg/L)',
// align: 'center',
// dataIndex: 'dataWaterCodSy',
// },
{
title: '硝态氮(mg/L)',
align: "center",
dataIndex: 'dataWaterNoSy'
},
// {
// title: '1#球阀状态',
// align: "center",
// dataIndex: 'firstValveStatus',
// customRender: ({ text }) => {
// if (!text || text == '00') {
// return '开';
// } else if (text == '01') {
// return '关';
// }
// },
// },
// {
// title: '2#球阀状态',
// align: "center",
// dataIndex: 'secondValveStatus',
// customRender: ({ text }) => {
// if (!text || text == '00') {
// return '开';
// } else if (text == '01') {
// return '关';
// }
// },
// },
// {
// title: '数据类型;realTime=实时dayTime=日数据month=月数据year=年数据',
// align: "center",
// dataIndex: 'dataGatherType'
// },
// {
// title: '转储时间',
// align: "center",
// dataIndex: 'transDate',
// },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
{
label: '租户号',
field: 'tenantId',
component: 'Input',
},
{
label: '乐观锁',
field: 'reVision',
component: 'InputNumber',
},
{
label: '创建人',
field: 'createdBy',
component: 'Input',
},
{
label: '创建时间',
field: 'createTime',
component: 'DatePicker',
},
{
label: '更新人',
field: 'updatedBy',
component: 'Input',
},
{
label: '逻辑删除',
field: 'isDel',
component: 'InputNumber',
},
{
label: '更新时间',
field: 'updatedTime',
component: 'DatePicker',
},
{
label: '数据ID',
field: 'dataId',
component: 'Input',
},
{
label: '总磷',
field: 'dataWaterTp',
component: 'Input',
},
{
label: '总氮',
field: 'dataWaterTn',
component: 'Input',
},
{
label: '氨氮',
field: 'dataWaterNh',
component: 'Input',
},
{
label: '化学需氧量',
field: 'dataWaterCod',
component: 'Input',
},
{
label: '数据更新时间',
field: 'dataDateTime',
component: 'DatePicker',
},
{
label: '数据类型;realTime=实时dayTime=日数据month=月数据year=年数据',
field: 'dataGatherType',
component: 'Input',
},
{
label: '转储时间',
field: 'transDate',
component: 'DatePicker',
},
// TODO 主键隐藏字段目前写死为ID
{
label: '',
field: 'id',
component: 'Input',
show: false,
},
];

View File

@ -0,0 +1,275 @@
<template>
<div>
<!--查询区域-->
<div class="jeecg-basic-table-form-container">
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-row :gutter="24">
<a-col :xs="24" :sm="8" :md="6" :lg="8" :xl="6" :xxl="6" style="margin-left: -10px; margin-top: 16px">
<a-form-item label="选择监测站" name="stationCode">
<ApiSelect
:api="getStationList"
:params="stationType"
showSearch
v-model:value="queryParam.stationCode"
optionFilterProp="label"
resultField="list"
labelField="stationName"
valueField="stationCode"
placeholder="请选择"
/>
</a-form-item>
</a-col>
<a-col :xs="24" :sm="8" :md="6" :lg="8" :xl="6" :xxl="6" style="margin-left: -10px; margin-top: 16px">
<a-form-item label="数据更新时间" name="dataDateTime">
<a-date-picker placeholder="" v-model:value="queryParam.dataDateTime" value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />
</a-form-item>
</a-col>
<template v-if="toggleSearchStatus">
<a-col :xs="24" :sm="8" :md="6" :lg="8" :xl="6" :xxl="6" style="margin-left: -10px; margin-top: 16px">
<a-form-item label="设备部署编号" name="deviceCode">
<a-input placeholder="请输入设备部署编号查询" v-model:value="queryParam.deviceCode"></a-input>
</a-form-item>
</a-col>
<!-- <a-col :xs="24" :sm="8" :md="6" :lg="8" :xl="6" :xxl="6" style="margin-left:-10px;margin-top: 16px;">
<a-form-item label="污染物类型" name="pollution">
<JDictSelectTag type="select" v-model:value="queryParam.pollution" dictCode="surv_orient_pullution" placeholder="请选择污染物类型" />
</a-form-item>
</a-col> -->
</template>
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
<a-col :xs="24" :sm="8" :md="6" :lg="8" :xl="6" :xxl="6" style="margin-left: -10px; margin-top: 16px">
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset" style="margin-left: 8px">重置</a-button>
<a @click="toggleSearchStatus = !toggleSearchStatus" style="margin-left: 8px">
{{ toggleSearchStatus ? '收起' : '展开' }}
<Icon :icon="toggleSearchStatus ? 'ant-design:up-outlined' : 'ant-design:down-outlined'" />
</a>
</a-col>
</span>
</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-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
<!-- <j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-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)" :dropDownActions="getDropDownAction(record)"/> -->
<TableAction :actions="getDetailAction(record)" />
</template>
<!--字段回显插槽-->
<template #htmlSlot="{ text }">
<div v-html="text"></div>
</template>
<!--省市区字段回显插槽-->
<template #pcaSlot="{ text }">
{{ getAreaTextByCode(text) }}
</template>
<template #fileSlot="{ text }">
<span v-if="!text" style="font-size: 12px; font-style: italic">无文件</span>
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button>
</template>
</BasicTable>
<!-- 表单区域 -->
<SurvHisdataOrientwaterModal ref="registerModal" @success="handleSuccess"></SurvHisdataOrientwaterModal>
</div>
</template>
<script lang="ts" name="appmana-survHisdataOrientwater" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns } from './SurvHisdataOrientwater.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './SurvHisdataOrientwater.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import SurvHisdataOrientwaterModal from './components/SurvHisdataOrientwaterModal.vue';
import { ApiSelect } from '/@/components/Form/index';
import { getStationList } from '../../station/SurvStationInfo.api';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
const formRef = ref();
const queryParam = reactive<any>({});
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
const stationType = { stationType: 'orient'};
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: 'surv_hisdata_orientwater',
api: list,
columns,
canResize: false,
useSearchForm: false,
actionColumn: {
width: 120,
fixed: 'right',
},
beforeFetch: (params) => {
queryParam.dataType = 'standard';
return Object.assign(params, queryParam);
},
},
exportConfig: {
name: 'surv_hisdata_orientwater',
url: getExportUrl,
params: queryParam,
},
importConfig: {
url: getImportUrl,
success: handleSuccess,
},
});
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 handleAdd() {
registerModal.value.disableSubmit = false;
registerModal.value.add();
}
/**
* 编辑事件
*/
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: handleEdit.bind(null, record),
},
];
}
/**
* 操作栏
*/
function getDetailAction(record) {
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
},
];
}
/**
* 下拉操作栏
*/
function getDropDownAction(record) {
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
},
{
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
},
},
];
}
/**
* 查询
*/
function searchQuery() {
reload();
}
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
selectedRowKeys.value = [];
//
reload();
}
</script>
<style lang="less" scoped>
.jeecg-basic-table-form-container {
.table-page-search-submitButtons {
display: block;
margin-bottom: 24px;
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;
}
}
</style>

View File

@ -0,0 +1,247 @@
<template>
<a-spin :spinning="confirmLoading">
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-row>
<a-col :span="24">
<a-form-item label="站点名称" v-bind="validateInfos.stationName">
<a-input v-model:value="formData.stationName" placeholder="" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<!-- <a-col :span="24">
<a-form-item label="设备名称" v-bind="validateInfos.deviceName">
<a-input v-model:value="formData.deviceName" placeholder="" :disabled="disabled"></a-input>
</a-form-item>
</a-col> -->
<a-col :span="24">
<a-form-item label="设备编号" v-bind="validateInfos.deployCode">
<a-input v-model:value="formData.deployCode" placeholder="" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<!-- <a-col :span="24">
<a-form-item label="数据ID" v-bind="validateInfos.dataId">
<a-input v-model:value="formData.dataId" placeholder="" :disabled="disabled"></a-input>
</a-form-item>
</a-col> -->
<a-col :span="24">
<a-form-item label="总磷(mg/L)" v-bind="validateInfos.dataWaterTpSy">
<a-input v-model:value="formData.dataWaterTpSy" placeholder="" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="总氮(mg/L)" v-bind="validateInfos.dataWaterTnSy">
<a-input v-model:value="formData.dataWaterTnSy" placeholder="" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="硝态氮(mg/L)" v-bind="validateInfos.dataWaterNoSy">
<a-input v-model:value="formData.dataWaterNoSy" placeholder="" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<!-- <a-col :span="24">-->
<!-- <a-form-item label="化学需氧量(mg/L)" v-bind="validateInfos.dataWaterCod">-->
<!-- <a-input v-model:value="formData.dataWaterCod" placeholder="请输入化学需氧量" :disabled="disabled"></a-input>-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-item label="总磷水样" v-bind="validateInfos.dataWaterTpSy">-->
<!-- <a-input v-model:value="formData.dataWaterTpSy" placeholder="" :disabled="disabled"></a-input>-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-item label="总磷零点" v-bind="validateInfos.dataWaterTpLd">-->
<!-- <a-input v-model:value="formData.dataWaterTpLd" placeholder="" :disabled="disabled"></a-input>-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-item label="总氮水样" v-bind="validateInfos.dataWaterTnSy">-->
<!-- <a-input v-model:value="formData.dataWaterTnSy" placeholder="" :disabled="disabled"></a-input>-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-item label="总氮零点" v-bind="validateInfos.dataWaterTnLd">-->
<!-- <a-input v-model:value="formData.dataWaterTnLd" placeholder="" :disabled="disabled"></a-input>-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-item label="总氮零点" v-bind="validateInfos.fluidLevel">-->
<!-- <a-input v-model:value="formData.fluidLevel" placeholder="" :disabled="disabled"></a-input>-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-item label="1#球阀状态" v-bind="validateInfos.firstValveStatus">-->
<!-- <a-input v-model:value="formData.firstValveStatus" placeholder="" :disabled="disabled"></a-input>-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-item label="2#球阀状态" v-bind="validateInfos.secondValveStatus">-->
<!-- <a-input v-model:value="formData.secondValveStatus" placeholder="" :disabled="disabled"></a-input>-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-item label="急停状态" v-bind="validateInfos.crashStopStatus">-->
<!-- <a-input v-model:value="formData.crashStopStatus" placeholder="" :disabled="disabled"></a-input>-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-item label="水泵状态" v-bind="validateInfos.waterPumpStatus">-->
<!-- <a-input v-model:value="formData.waterPumpStatus" placeholder="" :disabled="disabled"></a-input>-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-item label="主副泵状态" v-bind="validateInfos.mainSideStatus">-->
<!-- <a-input v-model:value="formData.mainSideStatus" placeholder="" :disabled="disabled"></a-input>-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<a-col :span="24">
<a-form-item label="数据更新时间" v-bind="validateInfos.dataDateTime">
<a-date-picker
placeholder=""
v-model:value="formData.dataDateTime"
value-format="YYYY-MM-DD HH:mm:ss"
show-time="{ format: 'YYYY-MM-DD HH:mm:ss' }"
style="width: 100%"
:disabled="disabled"
/>
</a-form-item>
</a-col>
<!-- <a-col :span="24">
<a-form-item label="数据类型" v-bind="validateInfos.dataGatherType">
<a-input v-model:value="formData.dataGatherType" placeholder="请输入数据类型" :disabled="disabled"></a-input>
</a-form-item>
</a-col> -->
<!-- <a-col :span="24">
<a-form-item label="转储时间" v-bind="validateInfos.transDate">
<a-date-picker placeholder="" v-model:value="formData.transDate" value-format="YYYY-MM-DD HH:mm:ss" show-time="{ format: 'YYYY-MM-DD HH:mm:ss' }" style="width: 100%" :disabled="disabled"/>
</a-form-item>
</a-col> -->
</a-row>
</a-form>
</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 '../SurvHisdataOrientwater.api';
import { Form } from 'ant-design-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: '',
tenantId: '',
reVision: undefined,
createdBy: '',
createTime: '',
updatedBy: '',
isDel: undefined,
updatedTime: '',
dataId: '',
dataWaterTp: '',
dataWaterTn: '',
dataWaterNo: '',
dataDateTime: '',
dataGatherType: '',
transDate: '',
deviceName: '',
deviceCode: '',
stationName: '',
});
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 = {};
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() {
edit({});
}
/**
* 编辑
*/
function edit(record) {
nextTick(() => {
resetFields();
//
Object.assign(formData, record);
});
}
/**
* 提交数据
*/
async function submitForm() {
//
await validate();
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>

View File

@ -0,0 +1,75 @@
<template>
<a-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
<SurvHisdataOrientwaterForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></SurvHisdataOrientwaterForm>
</a-modal>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import SurvHisdataOrientwaterForm from './SurvHisdataOrientwaterForm.vue'
const title = ref<string>('');
const width = ref<number>(800);
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>
/**隐藏样式-modal确定按钮 */
.jee-hidden {
display: none !important;
}
</style>

View File

@ -0,0 +1,72 @@
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
list = '/appmana/survHisdataOrientwater/list',
save='/appmana/survHisdataOrientwater/add',
edit='/appmana/survHisdataOrientwater/edit',
deleteOne = '/appmana/survHisdataOrientwater/delete',
deleteBatch = '/appmana/survHisdataOrientwater/deleteBatch',
importExcel = '/appmana/survHisdataOrientwater/importExcel',
exportXls = '/appmana/survHisdataOrientwater/exportXls',
}
/**
* api
* @param params
*/
export const getExportUrl = Api.exportXls;
/**
* api
*/
export const getImportUrl = Api.importExcel;
/**
*
* @param params
*/
export const list = (params) => defHttp.get({ url: Api.list, params });
/**
*
* @param params
* @param handleSuccess
*/
export const deleteOne = (params,handleSuccess) => {
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
/**
*
* @param params
* @param handleSuccess
*/
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
* @param isUpdate
*/
export const saveOrUpdate = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.save;
return defHttp.post({ url: url, params }, { isTransformResponse: false });
}

View File

@ -0,0 +1,172 @@
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: 'stationName',
},
{
title: '设备编号',
align: 'center',
dataIndex: 'deployCode',
},
{
title: '数据更新时间',
align: 'center',
dataIndex: 'dataDateTime',
},
// {
// title: '数据ID',
// align: "center",
// dataIndex: 'dataId'
// },
{
title: '总磷(mg/L)',
align: 'center',
dataIndex: 'dataWaterTpSy',
},
{
title: '总氮(mg/L)',
align: 'center',
dataIndex: 'dataWaterTnSy',
},
// {
// title: '硝态氮(mg/L)',
// align: 'center',
// dataIndex: 'dataWaterNoSy',
// },
{
title: '化学需氧量(mg/L)',
align: "center",
dataIndex: 'dataWaterCodSy'
},
// {
// title: '1#球阀状态',
// align: "center",
// dataIndex: 'firstValveStatus',
// customRender: ({ text }) => {
// if (!text || text == '00') {
// return '开';
// } else if (text == '01') {
// return '关';
// }
// },
// },
// {
// title: '2#球阀状态',
// align: "center",
// dataIndex: 'secondValveStatus',
// customRender: ({ text }) => {
// if (!text || text == '00') {
// return '开';
// } else if (text == '01') {
// return '关';
// }
// },
// },
// {
// title: '数据类型;realTime=实时dayTime=日数据month=月数据year=年数据',
// align: "center",
// dataIndex: 'dataGatherType'
// },
// {
// title: '转储时间',
// align: "center",
// dataIndex: 'transDate',
// },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
{
label: '租户号',
field: 'tenantId',
component: 'Input',
},
{
label: '乐观锁',
field: 'reVision',
component: 'InputNumber',
},
{
label: '创建人',
field: 'createdBy',
component: 'Input',
},
{
label: '创建时间',
field: 'createTime',
component: 'DatePicker',
},
{
label: '更新人',
field: 'updatedBy',
component: 'Input',
},
{
label: '逻辑删除',
field: 'isDel',
component: 'InputNumber',
},
{
label: '更新时间',
field: 'updatedTime',
component: 'DatePicker',
},
{
label: '数据ID',
field: 'dataId',
component: 'Input',
},
{
label: '总磷',
field: 'dataWaterTp',
component: 'Input',
},
{
label: '总氮',
field: 'dataWaterTn',
component: 'Input',
},
{
label: '氨氮',
field: 'dataWaterNh',
component: 'Input',
},
{
label: '化学需氧量',
field: 'dataWaterCod',
component: 'Input',
},
{
label: '数据更新时间',
field: 'dataDateTime',
component: 'DatePicker',
},
{
label: '数据类型;realTime=实时dayTime=日数据month=月数据year=年数据',
field: 'dataGatherType',
component: 'Input',
},
{
label: '转储时间',
field: 'transDate',
component: 'DatePicker',
},
// TODO 主键隐藏字段目前写死为ID
{
label: '',
field: 'id',
component: 'Input',
show: false,
},
];

View File

@ -0,0 +1,275 @@
<template>
<div>
<!--查询区域-->
<div class="jeecg-basic-table-form-container">
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-row :gutter="24">
<a-col :xs="24" :sm="8" :md="6" :lg="8" :xl="6" :xxl="6" style="margin-left: -10px; margin-top: 16px">
<a-form-item label="选择监测站" name="stationCode">
<ApiSelect
:api="getStationList"
:params="stationType"
showSearch
v-model:value="queryParam.stationCode"
optionFilterProp="label"
resultField="list"
labelField="stationName"
valueField="stationCode"
placeholder="请选择"
/>
</a-form-item>
</a-col>
<a-col :xs="24" :sm="8" :md="6" :lg="8" :xl="6" :xxl="6" style="margin-left: -10px; margin-top: 16px">
<a-form-item label="数据更新时间" name="dataDateTime">
<a-date-picker placeholder="" v-model:value="queryParam.dataDateTime" value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />
</a-form-item>
</a-col>
<template v-if="toggleSearchStatus">
<a-col :xs="24" :sm="8" :md="6" :lg="8" :xl="6" :xxl="6" style="margin-left: -10px; margin-top: 16px">
<a-form-item label="设备部署编号" name="deviceCode">
<a-input placeholder="请输入设备部署编号查询" v-model:value="queryParam.deviceCode"></a-input>
</a-form-item>
</a-col>
<!-- <a-col :xs="24" :sm="8" :md="6" :lg="8" :xl="6" :xxl="6" style="margin-left:-10px;margin-top: 16px;">
<a-form-item label="污染物类型" name="pollution">
<JDictSelectTag type="select" v-model:value="queryParam.pollution" dictCode="surv_orient_pullution" placeholder="请选择污染物类型" />
</a-form-item>
</a-col> -->
</template>
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
<a-col :xs="24" :sm="8" :md="6" :lg="8" :xl="6" :xxl="6" style="margin-left: -10px; margin-top: 16px">
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset" style="margin-left: 8px">重置</a-button>
<a @click="toggleSearchStatus = !toggleSearchStatus" style="margin-left: 8px">
{{ toggleSearchStatus ? '收起' : '展开' }}
<Icon :icon="toggleSearchStatus ? 'ant-design:up-outlined' : 'ant-design:down-outlined'" />
</a>
</a-col>
</span>
</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-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
<!-- <j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-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)" :dropDownActions="getDropDownAction(record)"/> -->
<TableAction :actions="getDetailAction(record)" />
</template>
<!--字段回显插槽-->
<template #htmlSlot="{ text }">
<div v-html="text"></div>
</template>
<!--省市区字段回显插槽-->
<template #pcaSlot="{ text }">
{{ getAreaTextByCode(text) }}
</template>
<template #fileSlot="{ text }">
<span v-if="!text" style="font-size: 12px; font-style: italic">无文件</span>
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button>
</template>
</BasicTable>
<!-- 表单区域 -->
<SurvHisdataOrientwaterModal ref="registerModal" @success="handleSuccess"></SurvHisdataOrientwaterModal>
</div>
</template>
<script lang="ts" name="appmana-survHisdataOrientwater" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns } from './SurvHisdataOrientwater.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './SurvHisdataOrientwater.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import SurvHisdataOrientwaterModal from './components/SurvHisdataOrientwaterModal.vue';
import { ApiSelect } from '/@/components/Form/index';
import { getStationList } from '../../station/SurvStationInfo.api';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
const formRef = ref();
const queryParam = reactive<any>({});
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
const stationType = { stationType: 'watershed' };
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: 'surv_hisdata_orientwater',
api: list,
columns,
canResize: false,
useSearchForm: false,
actionColumn: {
width: 120,
fixed: 'right',
},
beforeFetch: (params) => {
queryParam.dataType = 'watershed';
return Object.assign(params, queryParam);
},
},
exportConfig: {
name: 'surv_hisdata_orientwater',
url: getExportUrl,
params: queryParam,
},
importConfig: {
url: getImportUrl,
success: handleSuccess,
},
});
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 handleAdd() {
registerModal.value.disableSubmit = false;
registerModal.value.add();
}
/**
* 编辑事件
*/
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: handleEdit.bind(null, record),
},
];
}
/**
* 操作栏
*/
function getDetailAction(record) {
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
},
];
}
/**
* 下拉操作栏
*/
function getDropDownAction(record) {
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
},
{
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
},
},
];
}
/**
* 查询
*/
function searchQuery() {
reload();
}
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
selectedRowKeys.value = [];
//
reload();
}
</script>
<style lang="less" scoped>
.jeecg-basic-table-form-container {
.table-page-search-submitButtons {
display: block;
margin-bottom: 24px;
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;
}
}
</style>

View File

@ -0,0 +1,247 @@
<template>
<a-spin :spinning="confirmLoading">
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-row>
<a-col :span="24">
<a-form-item label="站点名称" v-bind="validateInfos.stationName">
<a-input v-model:value="formData.stationName" placeholder="" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<!-- <a-col :span="24">
<a-form-item label="设备名称" v-bind="validateInfos.deviceName">
<a-input v-model:value="formData.deviceName" placeholder="" :disabled="disabled"></a-input>
</a-form-item>
</a-col> -->
<a-col :span="24">
<a-form-item label="设备编号" v-bind="validateInfos.deployCode">
<a-input v-model:value="formData.deployCode" placeholder="" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<!-- <a-col :span="24">
<a-form-item label="数据ID" v-bind="validateInfos.dataId">
<a-input v-model:value="formData.dataId" placeholder="" :disabled="disabled"></a-input>
</a-form-item>
</a-col> -->
<a-col :span="24">
<a-form-item label="总磷(mg/L)" v-bind="validateInfos.dataWaterTpSy">
<a-input v-model:value="formData.dataWaterTpSy" placeholder="" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="总氮(mg/L)" v-bind="validateInfos.dataWaterTnSy">
<a-input v-model:value="formData.dataWaterTnSy" placeholder="" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<!-- <a-col :span="24">-->
<!-- <a-form-item label="硝态氮(mg/L)" v-bind="validateInfos.dataWaterNoSy">-->
<!-- <a-input v-model:value="formData.dataWaterNoSy" placeholder="" :disabled="disabled"></a-input>-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<a-col :span="24">
<a-form-item label="化学需氧量(mg/L)" v-bind="validateInfos.dataWaterCodSy">
<a-input v-model:value="formData.dataWaterCodSy" placeholder="请输入化学需氧量" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<!-- <a-col :span="24">-->
<!-- <a-form-item label="总磷水样" v-bind="validateInfos.dataWaterTpSy">-->
<!-- <a-input v-model:value="formData.dataWaterTpSy" placeholder="" :disabled="disabled"></a-input>-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-item label="总磷零点" v-bind="validateInfos.dataWaterTpLd">-->
<!-- <a-input v-model:value="formData.dataWaterTpLd" placeholder="" :disabled="disabled"></a-input>-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-item label="总氮水样" v-bind="validateInfos.dataWaterTnSy">-->
<!-- <a-input v-model:value="formData.dataWaterTnSy" placeholder="" :disabled="disabled"></a-input>-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-item label="总氮零点" v-bind="validateInfos.dataWaterTnLd">-->
<!-- <a-input v-model:value="formData.dataWaterTnLd" placeholder="" :disabled="disabled"></a-input>-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-item label="总氮零点" v-bind="validateInfos.fluidLevel">-->
<!-- <a-input v-model:value="formData.fluidLevel" placeholder="" :disabled="disabled"></a-input>-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-item label="1#球阀状态" v-bind="validateInfos.firstValveStatus">-->
<!-- <a-input v-model:value="formData.firstValveStatus" placeholder="" :disabled="disabled"></a-input>-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-item label="2#球阀状态" v-bind="validateInfos.secondValveStatus">-->
<!-- <a-input v-model:value="formData.secondValveStatus" placeholder="" :disabled="disabled"></a-input>-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-item label="急停状态" v-bind="validateInfos.crashStopStatus">-->
<!-- <a-input v-model:value="formData.crashStopStatus" placeholder="" :disabled="disabled"></a-input>-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-item label="水泵状态" v-bind="validateInfos.waterPumpStatus">-->
<!-- <a-input v-model:value="formData.waterPumpStatus" placeholder="" :disabled="disabled"></a-input>-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-item label="主副泵状态" v-bind="validateInfos.mainSideStatus">-->
<!-- <a-input v-model:value="formData.mainSideStatus" placeholder="" :disabled="disabled"></a-input>-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<a-col :span="24">
<a-form-item label="数据更新时间" v-bind="validateInfos.dataDateTime">
<a-date-picker
placeholder=""
v-model:value="formData.dataDateTime"
value-format="YYYY-MM-DD HH:mm:ss"
show-time="{ format: 'YYYY-MM-DD HH:mm:ss' }"
style="width: 100%"
:disabled="disabled"
/>
</a-form-item>
</a-col>
<!-- <a-col :span="24">
<a-form-item label="数据类型" v-bind="validateInfos.dataGatherType">
<a-input v-model:value="formData.dataGatherType" placeholder="请输入数据类型" :disabled="disabled"></a-input>
</a-form-item>
</a-col> -->
<!-- <a-col :span="24">
<a-form-item label="转储时间" v-bind="validateInfos.transDate">
<a-date-picker placeholder="" v-model:value="formData.transDate" value-format="YYYY-MM-DD HH:mm:ss" show-time="{ format: 'YYYY-MM-DD HH:mm:ss' }" style="width: 100%" :disabled="disabled"/>
</a-form-item>
</a-col> -->
</a-row>
</a-form>
</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 '../SurvHisdataOrientwater.api';
import { Form } from 'ant-design-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: '',
tenantId: '',
reVision: undefined,
createdBy: '',
createTime: '',
updatedBy: '',
isDel: undefined,
updatedTime: '',
dataId: '',
dataWaterTp: '',
dataWaterTn: '',
dataWaterNo: '',
dataDateTime: '',
dataGatherType: '',
transDate: '',
deviceName: '',
deviceCode: '',
stationName: '',
});
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 = {};
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() {
edit({});
}
/**
* 编辑
*/
function edit(record) {
nextTick(() => {
resetFields();
//
Object.assign(formData, record);
});
}
/**
* 提交数据
*/
async function submitForm() {
//
await validate();
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>

View File

@ -0,0 +1,75 @@
<template>
<a-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
<SurvHisdataOrientwaterForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></SurvHisdataOrientwaterForm>
</a-modal>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import SurvHisdataOrientwaterForm from './SurvHisdataOrientwaterForm.vue'
const title = ref<string>('');
const width = ref<number>(800);
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>
/**隐藏样式-modal确定按钮 */
.jee-hidden {
display: none !important;
}
</style>