增加河津前端代码

This commit is contained in:
zhangyue 2026-08-13 10:29:39 +08:00
parent c385d53744
commit 692c332b09
41 changed files with 6268 additions and 6 deletions

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/survHisdataAir/list',
save='/appmana/survHisdataAir/add',
edit='/appmana/survHisdataAir/edit',
deleteOne = '/appmana/survHisdataAir/delete',
deleteBatch = '/appmana/survHisdataAir/deleteBatch',
importExcel = '/appmana/survHisdataAir/importExcel',
exportXls = '/appmana/survHisdataAir/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,171 @@
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: '大气温度(℃)',
align: "center",
dataIndex: 'dataAirTemp'
},
{
title: '大气湿度(%RH)',
align: "center",
dataIndex: 'dataAirWet'
},
{
title: '大气压力(hPa)',
align: "center",
dataIndex: 'dataAirPress'
},
{
title: '雨量(mm)',
align: "center",
dataIndex: 'dataRainFall'
},
{
title: '风速(m/s)',
align: "center",
dataIndex: 'dataWindSpeed'
},
{
title: '风向(°)',
align: "center",
dataIndex: 'dataWindDirection'
},
{
title: '太阳全辐射(W/m2)',
align: "center",
dataIndex: 'dataSunFallout'
},
// {
// title: '数据类型',
// align: "center",
// dataIndex: 'dataGatherType'
// },
// {
// title: '转储时间',
// align: "center",
// dataIndex: 'transDate',
// customRender:({text}) =>{
// return !text?"":(text.length>10?text.substr(0,10):text);
// },
// },
];
//查询数据
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: '大气温度',
field: 'dataAirTemp',
component: 'Input',
},
{
label: '大气湿度',
field: 'dataAirWet',
component: 'Input',
},
{
label: '大气压力',
field: 'dataAirPress',
component: 'Input',
},
{
label: '雨量',
field: 'dataRainFall',
component: 'Input',
},
{
label: '风速',
field: 'dataWindSpeed',
component: 'Input',
},
{
label: '风向',
field: 'dataWindDirection',
component: 'Input',
},
{
label: '太阳全辐射',
field: 'dataSunFallout',
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,279 @@
<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_air_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>
<!-- 表单区域 -->
<SurvHisdataAirModal ref="registerModal" @success="handleSuccess"></SurvHisdataAirModal>
</div>
</template>
<script lang="ts" name="appmana-survHisdataAir" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns } from './SurvHisdataAir.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './SurvHisdataAir.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import SurvHisdataAirModal from './components/SurvHisdataAirModal.vue'
import { ApiSelect} from '/@/components/Form/index';
import { getStationList } from '/@/views/appmana/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_air',
api: list,
columns,
canResize:false,
useSearchForm: false,
actionColumn: {
width: 120,
fixed: 'right',
},
beforeFetch: (params) => {
return Object.assign(params, queryParam);
},
},
exportConfig: {
name: "surv_hisdata_air",
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,220 @@
<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="大气温度(℃)" v-bind="validateInfos.dataAirTemp">
<a-input v-model:value="formData.dataAirTemp" placeholder="" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="大气湿度(%RH)" v-bind="validateInfos.dataAirWet">
<a-input v-model:value="formData.dataAirWet" placeholder="" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="大气压力(hPa)" v-bind="validateInfos.dataAirPress">
<a-input v-model:value="formData.dataAirPress" placeholder="" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="雨量(mm)" v-bind="validateInfos.dataRainFall">
<a-input v-model:value="formData.dataRainFall" placeholder="" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="风速(m/s)" v-bind="validateInfos.dataWindSpeed">
<a-input v-model:value="formData.dataWindSpeed" placeholder="" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="风向(°)" v-bind="validateInfos.dataWindDirection">
<a-input v-model:value="formData.dataWindDirection" placeholder="" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="太阳全辐射(W/m2)" v-bind="validateInfos.dataSunFallout">
<a-input v-model:value="formData.dataSunFallout" placeholder="" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="雨量累计(mm)" v-bind="validateInfos.dataRainTotal">
<a-input v-model:value="formData.dataRainTotal" placeholder="" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="太阳辐射累计(MJ/m2)" v-bind="validateInfos.dataSunTotal">
<a-input v-model:value="formData.dataSunTotal" 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 '../SurvHisdataAir.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: '',
dataAirTemp: '',
dataAirWet: '',
dataAirPress: '',
dataRainFall: '',
dataWindSpeed: '',
dataWindDirection: '',
dataSunFallout: '',
dataDateTime: '',
dataGatherType: '',
transDate: '',
deviceName: '',
deployCode: '',
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="关闭">
<SurvHisdataAirForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></SurvHisdataAirForm>
</a-modal>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import SurvHisdataAirForm from './SurvHisdataAirForm.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/survTransdataAir/list',
save='/appmana/survTransdataAir/add',
edit='/appmana/survTransdataAir/edit',
deleteOne = '/appmana/survTransdataAir/delete',
deleteBatch = '/appmana/survTransdataAir/deleteBatch',
importExcel = '/appmana/survTransdataAir/importExcel',
exportXls = '/appmana/survTransdataAir/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,157 @@
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: '大气温度(℃)',
align: 'center',
dataIndex: 'dataAirTemp',
},
{
title: '大气湿度(%RH)',
align: 'center',
dataIndex: 'dataAirWet',
},
{
title: '大气压力(hPa)',
align: 'center',
dataIndex: 'dataAirPress',
},
{
title: '雨量(mm)',
align: 'center',
dataIndex: 'dataRainFall',
},
{
title: '风速(m/s)',
align: 'center',
dataIndex: 'dataWindSpeed',
},
{
title: '风向(°)',
align: 'center',
dataIndex: 'dataWindDirection',
},
{
title: '太阳全辐射(W/m2)',
align: 'center',
dataIndex: 'dataSunFallout',
},
// {
// title: '数据类型',
// align: "center",
// dataIndex: 'dataGatherType'
// },
];
//查询数据
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: '大气温度',
field: 'dataAirTemp',
component: 'Input',
},
{
label: '大气湿度',
field: 'dataAirWet',
component: 'Input',
},
{
label: '大气压力',
field: 'dataAirPress',
component: 'Input',
},
{
label: '雨量',
field: 'dataRainFall',
component: 'Input',
},
{
label: '风速',
field: 'dataWindSpeed',
component: 'Input',
},
{
label: '风向',
field: 'dataWindDirection',
component: 'Input',
},
{
label: '太阳全辐射',
field: 'dataSunFallout',
component: 'Input',
},
{
label: '数据更新时间',
field: 'dataDateTime',
component: 'DatePicker',
},
{
label: '数据类型;realTime=实时dayTime=日数据month=月数据year=年数据',
field: 'dataGatherType',
component: 'Input',
},
// TODO 主键隐藏字段目前写死为ID
{
label: '',
field: 'id',
component: 'Input',
show: false,
},
];

View File

@ -0,0 +1,274 @@
<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_air_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="getDetailAction(record)" />
<!-- <TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(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>
<!-- 表单区域 -->
<SurvTransdataAirModal ref="registerModal" @success="handleSuccess"></SurvTransdataAirModal>
</div>
</template>
<script lang="ts" name="appmana-survTransdataAir" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns } from './SurvTransdataAir.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './SurvTransdataAir.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import SurvTransdataAirModal from './components/SurvTransdataAirModal.vue';
import { ApiSelect } from '/@/components/Form/index';
import { getStationList } from '/@/views/appmana/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_transdata_air',
api: list,
columns,
canResize: false,
useSearchForm: false,
actionColumn: {
width: 120,
fixed: 'right',
},
beforeFetch: (params) => {
return Object.assign(params, queryParam);
},
},
exportConfig: {
name: 'surv_transdata_air',
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,214 @@
<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="大气温度(℃)" v-bind="validateInfos.dataAirTemp">
<a-input v-model:value="formData.dataAirTemp" placeholder="" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="大气湿度(%RH)" v-bind="validateInfos.dataAirWet">
<a-input v-model:value="formData.dataAirWet" placeholder="" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="大气压力(hPa)" v-bind="validateInfos.dataAirPress">
<a-input v-model:value="formData.dataAirPress" placeholder="" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="雨量(mm)" v-bind="validateInfos.dataRainFall">
<a-input v-model:value="formData.dataRainFall" placeholder="" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="风速(m/s)" v-bind="validateInfos.dataWindSpeed">
<a-input v-model:value="formData.dataWindSpeed" placeholder="" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="风向(°)" v-bind="validateInfos.dataWindDirection">
<a-input v-model:value="formData.dataWindDirection" placeholder="" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="太阳全辐射(W/m2)" v-bind="validateInfos.dataSunFallout">
<a-input v-model:value="formData.dataSunFallout" placeholder="" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="雨量累计(mm)" v-bind="validateInfos.dataRainTotal">
<a-input v-model:value="formData.dataRainTotal" placeholder="" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="太阳辐射累计(MJ/m2)" v-bind="validateInfos.dataSunTotal">
<a-input v-model:value="formData.dataSunTotal" 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-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 '../SurvTransdataAir.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: '',
dataAirTemp: '',
dataAirWet: '',
dataAirPress: '',
dataRainFall: '',
dataWindSpeed: '',
dataWindDirection: '',
dataSunFallout: '',
dataDateTime: '',
dataGatherType: '',
deviceName: '',
deployCode: '',
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="关闭">
<SurvTransdataAirForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></SurvTransdataAirForm>
</a-modal>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import SurvTransdataAirForm from './SurvTransdataAirForm.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/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,143 @@
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: 'dataWaterTp',
},
{
title: '总氮(mg/L)',
align: 'center',
dataIndex: 'dataWaterTn',
},
{
title: '氨氮(mg/L)',
align: 'center',
dataIndex: 'dataWaterNh',
},
{
title: '化学需氧量(mg/L)',
align: 'center',
dataIndex: 'dataWaterCod',
},
// {
// 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: '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,274 @@
<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 '/@/views/appmana/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) => {
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.dataWaterTp">
<a-input v-model:value="formData.dataWaterTp" 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>
</a-col>
<a-col :span="24">
<a-form-item label="氨氮(mg/L)" v-bind="validateInfos.dataWaterNh">
<a-input v-model:value="formData.dataWaterNh" 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.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: '',
deployCode: '',
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/survTransdataLivestockwater/list',
save='/appmana/survTransdataLivestockwater/add',
edit='/appmana/survTransdataLivestockwater/edit',
deleteOne = '/appmana/survTransdataLivestockwater/delete',
deleteBatch = '/appmana/survTransdataLivestockwater/deleteBatch',
importExcel = '/appmana/survTransdataLivestockwater/importExcel',
exportXls = '/appmana/survTransdataLivestockwater/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,133 @@
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: 'dataWaterTp',
},
{
title: '总氮(mg/L)',
align: 'center',
dataIndex: 'dataWaterTn',
},
{
title: '氨氮(mg/L)',
align: 'center',
dataIndex: 'dataWaterNh',
},
{
title: '化学需氧量(mg/L)',
align: 'center',
dataIndex: 'dataWaterCod',
},
// {
// title: '数据获取类型;realTime=实时dayTime=日数据month=月数据year=年数据',
// align: "center",
// dataIndex: 'dataGatherType'
// },
];
//查询数据
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: 'dataWaterNo',
component: 'Input',
},
{
label: '数据更新时间',
field: 'dataDateTime',
component: 'DatePicker',
},
{
label: '数据获取类型;realTime=实时dayTime=日数据month=月数据year=年数据',
field: 'dataGatherType',
component: 'Input',
},
// TODO 主键隐藏字段目前写死为ID
{
label: '',
field: 'id',
component: 'Input',
show: false,
},
];

View File

@ -0,0 +1,274 @@
<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>
<!-- 表单区域 -->
<SurvTransdataLivestockwaterModal ref="registerModal" @success="handleSuccess"></SurvTransdataLivestockwaterModal>
</div>
</template>
<script lang="ts" name="appmana-survTransdataLivestockwater" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns } from './SurvTransdataLivestockwater.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './SurvTransdataLivestockwater.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import SurvTransdataLivestockwaterModal from './components/SurvTransdataLivestockwaterModal.vue';
import { ApiSelect } from '/@/components/Form/index';
import { getStationList } from '/@/views/appmana/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_transdata_livestockwater',
api: list,
columns,
canResize: false,
useSearchForm: false,
actionColumn: {
width: 120,
fixed: 'right',
},
beforeFetch: (params) => {
return Object.assign(params, queryParam);
},
},
exportConfig: {
name: 'surv_transdata_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,193 @@
<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.dataWaterTp">
<a-input v-model:value="formData.dataWaterTp" 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>
</a-col>
<a-col :span="24">
<a-form-item label="氨氮(mg/L)" v-bind="validateInfos.dataWaterNh">
<a-input v-model:value="formData.dataWaterNh" 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.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-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 '../SurvTransdataLivestockwater.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: '',
deviceName: '',
deployCode: '',
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="关闭">
<SurvTransdataLivestockwaterForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></SurvTransdataLivestockwaterForm>
</a-modal>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import SurvTransdataLivestockwaterForm from './SurvTransdataLivestockwaterForm.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,167 @@
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: 'dataWaterTp',
},
{
title: '总氮(mg/L)',
align: 'center',
dataIndex: 'dataWaterTn',
},
{
title: '硝态氮(mg/L)',
align: 'center',
dataIndex: 'dataWaterNo',
},
{
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,274 @@
<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 '/@/views/appmana/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) => {
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,242 @@
<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.dataWaterTp">
<a-input v-model:value="formData.dataWaterTp" 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>
</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="总磷水样" 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: '',
deployCode: '',
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/survTransdataOrientwater/list',
save='/appmana/survTransdataOrientwater/add',
edit='/appmana/survTransdataOrientwater/edit',
deleteOne = '/appmana/survTransdataOrientwater/delete',
deleteBatch = '/appmana/survTransdataOrientwater/deleteBatch',
importExcel = '/appmana/survTransdataOrientwater/importExcel',
exportXls = '/appmana/survTransdataOrientwater/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,156 @@
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: 'dataWaterTp',
},
{
title: '总氮(mg/L)',
align: 'center',
dataIndex: 'dataWaterTn',
},
{
title: '硝态氮(mg/L)',
align: 'center',
dataIndex: 'dataWaterNo',
},
{
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'
// },
];
//查询数据
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',
},
// TODO 主键隐藏字段目前写死为ID
{
label: '',
field: 'id',
component: 'Input',
show: false,
},
];

View File

@ -0,0 +1,274 @@
<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>
<!-- 表单区域 -->
<SurvTransdataOrientwaterModal ref="registerModal" @success="handleSuccess"></SurvTransdataOrientwaterModal>
</div>
</template>
<script lang="ts" name="appmana-survTransdataOrientwater" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns } from './SurvTransdataOrientwater.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './SurvTransdataOrientwater.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import SurvTransdataOrientwaterModal from './components/SurvTransdataOrientwaterModal.vue';
import { ApiSelect } from '/@/components/Form/index';
import { getStationList } from '/@/views/appmana/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_transdata_orientwater',
api: list,
columns,
canResize: false,
useSearchForm: false,
actionColumn: {
width: 120,
fixed: 'right',
},
beforeFetch: (params) => {
return Object.assign(params, queryParam);
},
},
exportConfig: {
name: 'surv_transdata_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 getDetailAction(record) {
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
},
];
}
/**
* 操作栏
*/
function getTableAction(record) {
return [
{
label: '编辑',
onClick: handleEdit.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,236 @@
<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.dataWaterTp">
<a-input v-model:value="formData.dataWaterTp" 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>
</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="总磷水样" 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-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 '../SurvTransdataOrientwater.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: '',
deviceName: '',
deployCode: '',
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="关闭">
<SurvTransdataOrientwaterForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></SurvTransdataOrientwaterForm>
</a-modal>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import SurvTransdataOrientwaterForm from './SurvTransdataOrientwaterForm.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/survHisdataSoil/list',
save='/appmana/survHisdataSoil/add',
edit='/appmana/survHisdataSoil/edit',
deleteOne = '/appmana/survHisdataSoil/delete',
deleteBatch = '/appmana/survHisdataSoil/deleteBatch',
importExcel = '/appmana/survHisdataSoil/importExcel',
exportXls = '/appmana/survHisdataSoil/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,128 @@
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: '20CM土壤温度(℃)',
align: 'center',
dataIndex: 'dataSoilTemp',
},
{
title: '20CM土壤湿度(%)',
align: 'center',
dataIndex: 'dataSoilWet',
},
{
title: '20CM土壤盐分(uS/cm)',
align: 'center',
dataIndex: 'dataSoilDdl',
},
// {
// title: '数据类型',
// 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: '土壤温度;106',
field: 'dataSoilTemp',
component: 'Input',
},
{
label: '土壤湿度;107',
field: 'dataSoilWet',
component: 'Input',
},
{
label: '土壤盐分;198',
field: 'dataSoilSalt',
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,274 @@
<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_soil_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>
<!-- 表单区域 -->
<SurvHisdataSoilModal ref="registerModal" @success="handleSuccess"></SurvHisdataSoilModal>
</div>
</template>
<script lang="ts" name="appmana-survHisdataSoil" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns } from './SurvHisdataSoil.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './SurvHisdataSoil.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import SurvHisdataSoilModal from './components/SurvHisdataSoilModal.vue';
import { ApiSelect } from '/@/components/Form/index';
import { getStationList } from '/@/views/appmana/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_soil',
api: list,
columns,
canResize: false,
useSearchForm: false,
actionColumn: {
width: 120,
fixed: 'right',
},
beforeFetch: (params) => {
return Object.assign(params, queryParam);
},
},
exportConfig: {
name: 'surv_hisdata_soil',
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,209 @@
<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="20CM土壤温度(℃)" v-bind="validateInfos.dataSoilTemp">
<a-input v-model:value="formData.dataSoilTemp" placeholder="" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="20CM土壤湿度(%)" v-bind="validateInfos.dataSoilWet">
<a-input v-model:value="formData.dataSoilWet" placeholder="" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="20CM土壤盐分(uS/cm)" v-bind="validateInfos.dataSoilSalt">
<a-input v-model:value="formData.dataSoilDdl" placeholder="" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="40CM土壤温度(℃)" v-bind="validateInfos.dataSoilTemp">
<a-input v-model:value="formData.dataSoilTemp2" placeholder="" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="40CM土壤湿度(%)" v-bind="validateInfos.dataSoilWet">
<a-input v-model:value="formData.dataSoilWet2" placeholder="" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="40CM土壤盐分(uS/cm)" v-bind="validateInfos.dataSoilSalt">
<a-input v-model:value="formData.dataSoilDdl2" placeholder="" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="60CM土壤温度(℃)" v-bind="validateInfos.dataSoilTemp">
<a-input v-model:value="formData.dataSoilTemp3" placeholder="" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="60CM土壤湿度(%)" v-bind="validateInfos.dataSoilWet">
<a-input v-model:value="formData.dataSoilWet3" placeholder="" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="60CM土壤盐分(uS/cm)" v-bind="validateInfos.dataSoilSalt">
<a-input v-model:value="formData.dataSoilDdl3" 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="数据类型">
<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 '../SurvHisdataSoil.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: '',
dataSoilTemp: '',
dataSoilWet: '',
dataSoilSalt: '',
dataDateTime: '',
dataGatherType: '',
transDate: '',
deviceName: '',
deployCode: '',
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="关闭">
<SurvHisdataSoilForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></SurvHisdataSoilForm>
</a-modal>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import SurvHisdataSoilForm from './SurvHisdataSoilForm.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/survTransdataSoil/list',
save='/appmana/survTransdataSoil/add',
edit='/appmana/survTransdataSoil/edit',
deleteOne = '/appmana/survTransdataSoil/delete',
deleteBatch = '/appmana/survTransdataSoil/deleteBatch',
importExcel = '/appmana/survTransdataSoil/importExcel',
exportXls = '/appmana/survTransdataSoil/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,118 @@
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: '20CM土壤温度(℃)',
align: 'center',
dataIndex: 'dataSoilTemp',
},
{
title: '20CM土壤湿度(%)',
align: 'center',
dataIndex: 'dataSoilWet',
},
{
title: '20CM土壤盐分(uS/cm)',
align: 'center',
dataIndex: 'dataSoilDdl',
},
// {
// title: '数据类型',
// align: "center",
// dataIndex: 'dataGatherType'
// },
];
//查询数据
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: '土壤温度;106',
field: 'dataSoilTemp',
component: 'Input',
},
{
label: '土壤湿度;107',
field: 'dataSoilWet',
component: 'Input',
},
{
label: '土壤盐分;198',
field: 'dataSoilSalt',
component: 'Input',
},
{
label: '数据更新时间',
field: 'dataDateTime',
component: 'DatePicker',
},
{
label: '数据类型;realTime=实时dayTime=日数据month=月数据year=年数据',
field: 'dataGatherType',
component: 'Input',
},
// TODO 主键隐藏字段目前写死为ID
{
label: '',
field: 'id',
component: 'Input',
show: false,
},
];

View File

@ -0,0 +1,274 @@
<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_soil_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>
<!-- 表单区域 -->
<SurvTransdataSoilModal ref="registerModal" @success="handleSuccess"></SurvTransdataSoilModal>
</div>
</template>
<script lang="ts" name="appmana-survTransdataSoil" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns } from './SurvTransdataSoil.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './SurvTransdataSoil.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import SurvTransdataSoilModal from './components/SurvTransdataSoilModal.vue';
import { ApiSelect } from '/@/components/Form/index';
import { getStationList } from '/@/views/appmana/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_transdata_soil',
api: list,
columns,
canResize: false,
useSearchForm: false,
actionColumn: {
width: 120,
fixed: 'right',
},
beforeFetch: (params) => {
return Object.assign(params, queryParam);
},
},
exportConfig: {
name: 'surv_transdata_soil',
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 getDropDownAction(record) {
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
},
{
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
},
},
];
}
/**
* 操作栏
*/
function getDetailAction(record) {
return [
{
label: '详情',
onClick: handleDetail.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,203 @@
<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="20CM土壤温度(℃)" v-bind="validateInfos.dataSoilTemp">
<a-input v-model:value="formData.dataSoilTemp" placeholder="请输入土壤温度" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="20CM土壤湿度(%)" v-bind="validateInfos.dataSoilWet">
<a-input v-model:value="formData.dataSoilWet" placeholder="请输入土壤湿度" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="20CM土壤盐分(uS/cm)" v-bind="validateInfos.dataSoilSalt">
<a-input v-model:value="formData.dataSoilDdl" placeholder="请输入土壤盐分" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="40CM土壤温度(℃)" v-bind="validateInfos.dataSoilTemp">
<a-input v-model:value="formData.dataSoilTemp2" placeholder="" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="40CM土壤湿度(%)" v-bind="validateInfos.dataSoilWet">
<a-input v-model:value="formData.dataSoilWet2" placeholder="" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="40CM土壤盐分(uS/cm)" v-bind="validateInfos.dataSoilSalt">
<a-input v-model:value="formData.dataSoilDdl2" placeholder="" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="60CM土壤温度(℃)" v-bind="validateInfos.dataSoilTemp">
<a-input v-model:value="formData.dataSoilTemp3" placeholder="" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="60CM土壤湿度(%)" v-bind="validateInfos.dataSoilWet">
<a-input v-model:value="formData.dataSoilWet3" placeholder="" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="60CM土壤盐分(uS/cm)" v-bind="validateInfos.dataSoilSalt">
<a-input v-model:value="formData.dataSoilDdl3" 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-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 '../SurvTransdataSoil.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: '',
dataSoilTemp: '',
dataSoilWet: '',
dataSoilSalt: '',
dataDateTime: '',
dataGatherType: '',
deviceName: '',
deployCode: '',
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="关闭">
<SurvTransdataSoilForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></SurvTransdataSoilForm>
</a-modal>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import SurvTransdataSoilForm from './SurvTransdataSoilForm.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

@ -38,12 +38,12 @@ export const columns: BasicColumn[] = [
} }
} }
}, },
{ // {
title: '头像', // title: '头像',
align: "center", // align: "center",
dataIndex: 'avatar', // dataIndex: 'avatar',
customRender: render.renderAvatar, // customRender: render.renderAvatar,
}, // },
]; ];
//查询数据 //查询数据