吉县增加后台菜单功能
This commit is contained in:
parent
4eb2be9791
commit
d781ed8385
|
|
@ -6,7 +6,7 @@ VITE_PUBLIC_PATH = /
|
||||||
|
|
||||||
# 跨域代理,您可以配置多个 ,请注意,没有换行符
|
# 跨域代理,您可以配置多个 ,请注意,没有换行符
|
||||||
VITE_PROXY = [["/jeecgboot","http://192.168.2.110:9999"],["/upload","http://192.168.2.110:3300/upload"]]
|
VITE_PROXY = [["/jeecgboot","http://192.168.2.110:9999"],["/upload","http://192.168.2.110:3300/upload"]]
|
||||||
VITE_PROXY = [["/jeecgboot","https://fxnsp.sxcooh.com/lh-api/"],["/upload","http://192.168.2.111:3300/upload"]]
|
#VITE_PROXY = [["/jeecgboot","https://fxnsp.sxcooh.com/lh-api/"],["/upload","http://192.168.2.111:3300/upload"]]
|
||||||
|
|
||||||
# 控制台不输出
|
# 控制台不输出
|
||||||
VITE_DROP_CONSOLE = false
|
VITE_DROP_CONSOLE = false
|
||||||
|
|
@ -16,7 +16,7 @@ VITE_GLOB_API_URL=/jeecgboot
|
||||||
|
|
||||||
#后台接口全路径地址(必填)
|
#后台接口全路径地址(必填)
|
||||||
VITE_GLOB_DOMAIN_URL=http://192.168.2.110:9999
|
VITE_GLOB_DOMAIN_URL=http://192.168.2.110:9999
|
||||||
VITE_GLOB_DOMAIN_URL=https://fxnsp.sxcooh.com
|
#VITE_GLOB_DOMAIN_URL=https://fxnsp.sxcooh.com
|
||||||
|
|
||||||
# 接口前缀
|
# 接口前缀
|
||||||
VITE_GLOB_API_URL_PREFIX=
|
VITE_GLOB_API_URL_PREFIX=
|
||||||
|
|
|
||||||
|
|
@ -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 });
|
||||||
|
}
|
||||||
|
|
@ -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: 'dataWaterTpSy',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '总氮(mg/L)',
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'dataWaterTnSy',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '氨氮(mg/L)',
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'dataWaterNhSy',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '化学需氧量(mg/L)',
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'dataWaterCodSy',
|
||||||
|
},
|
||||||
|
|
||||||
|
// {
|
||||||
|
// 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,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
@ -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_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 '../../../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>
|
||||||
|
|
@ -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.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.deviceCode">
|
||||||
|
<a-input v-model:value="formData.deviceCode" 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: '',
|
||||||
|
deviceCode: '',
|
||||||
|
stationName: '',
|
||||||
|
});
|
||||||
|
const { createMessage } = useMessage();
|
||||||
|
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
|
||||||
|
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
|
||||||
|
const confirmLoading = ref<boolean>(false);
|
||||||
|
//表单验证
|
||||||
|
const validatorRules = {};
|
||||||
|
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: true });
|
||||||
|
|
||||||
|
// 表单禁用
|
||||||
|
const disabled = computed(() => {
|
||||||
|
if (props.formBpm === true) {
|
||||||
|
if (props.formData.disabled === false) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return props.formDisabled;
|
||||||
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增
|
||||||
|
*/
|
||||||
|
function add() {
|
||||||
|
edit({});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*/
|
||||||
|
function edit(record) {
|
||||||
|
nextTick(() => {
|
||||||
|
resetFields();
|
||||||
|
//赋值
|
||||||
|
Object.assign(formData, record);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提交数据
|
||||||
|
*/
|
||||||
|
async function submitForm() {
|
||||||
|
// 触发表单验证
|
||||||
|
await validate();
|
||||||
|
confirmLoading.value = true;
|
||||||
|
const isUpdate = ref<boolean>(false);
|
||||||
|
//时间格式化
|
||||||
|
let model = formData;
|
||||||
|
if (model.id) {
|
||||||
|
isUpdate.value = true;
|
||||||
|
}
|
||||||
|
//循环数据
|
||||||
|
for (let data in model) {
|
||||||
|
//如果该数据是数组并且是字符串类型
|
||||||
|
if (model[data] instanceof Array) {
|
||||||
|
let valueType = getValueType(formRef.value.getProps, data);
|
||||||
|
//如果是字符串类型的需要变成以逗号分割的字符串
|
||||||
|
if (valueType === 'string') {
|
||||||
|
model[data] = model[data].join(',');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
await saveOrUpdate(model, isUpdate.value)
|
||||||
|
.then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
createMessage.success(res.message);
|
||||||
|
emit('ok');
|
||||||
|
} else {
|
||||||
|
createMessage.warning(res.message);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
confirmLoading.value = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
add,
|
||||||
|
edit,
|
||||||
|
submitForm,
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
.antd-modal-form {
|
||||||
|
min-height: 500px !important;
|
||||||
|
overflow-y: auto;
|
||||||
|
padding: 24px 24px 24px 24px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -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>
|
||||||
|
|
@ -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 });
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,161 @@
|
||||||
|
import {BasicColumn} from '/@/components/Table';
|
||||||
|
import {FormSchema} from '/@/components/Table';
|
||||||
|
import { rules} from '/@/utils/helper/validator';
|
||||||
|
import { render } from '/@/utils/common/renderUtils';
|
||||||
|
//列表数据
|
||||||
|
export const columns: BasicColumn[] = [
|
||||||
|
{
|
||||||
|
title: '站点名称',
|
||||||
|
align: "center",
|
||||||
|
dataIndex: 'stationName',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '设备编号',
|
||||||
|
align: "center",
|
||||||
|
dataIndex: 'deployCode',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '数据更新时间',
|
||||||
|
align: "center",
|
||||||
|
dataIndex: 'dataDateTime',
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// title: '数据ID',
|
||||||
|
// align: "center",
|
||||||
|
// dataIndex: 'dataId'
|
||||||
|
// },
|
||||||
|
{
|
||||||
|
title: '总磷(mg/L)',
|
||||||
|
align: "center",
|
||||||
|
dataIndex: 'dataWaterTpSy'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '总氮(mg/L)',
|
||||||
|
align: "center",
|
||||||
|
dataIndex: 'dataWaterTnSy'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '硝态氮(mg/L)',
|
||||||
|
align: "center",
|
||||||
|
dataIndex: 'dataWaterNoSy'
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// title: '化学需氧量(mg/L)',
|
||||||
|
// align: "center",
|
||||||
|
// dataIndex: 'dataWaterCod'
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// 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,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
@ -0,0 +1,278 @@
|
||||||
|
<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 '../../../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>
|
||||||
|
|
@ -0,0 +1,240 @@
|
||||||
|
<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.deviceCode">
|
||||||
|
<a-input v-model:value="formData.deviceCode" placeholder="请输入设备编号" :disabled="disabled"></a-input>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<!-- <a-col :span="24">
|
||||||
|
<a-form-item label="数据ID" v-bind="validateInfos.dataId">
|
||||||
|
<a-input v-model:value="formData.dataId" placeholder="请输入数据ID" :disabled="disabled"></a-input>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col> -->
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="总磷(mg/L)" v-bind="validateInfos.dataWaterTpSy">
|
||||||
|
<a-input v-model:value="formData.dataWaterTpSy" placeholder="请输入总磷" :disabled="disabled"></a-input>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="总氮(mg/L)" v-bind="validateInfos.dataWaterTnSy">
|
||||||
|
<a-input v-model:value="formData.dataWaterTnSy" placeholder="请输入总氮" :disabled="disabled"></a-input>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="硝态氮(mg/L)" v-bind="validateInfos.dataWaterNoSy">
|
||||||
|
<a-input v-model:value="formData.dataWaterNoSy" placeholder="请输入硝态氮" :disabled="disabled"></a-input>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<!-- <a-col :span="24">-->
|
||||||
|
<!-- <a-form-item label="化学需氧量(mg/L)" v-bind="validateInfos.dataWaterCod">-->
|
||||||
|
<!-- <a-input v-model:value="formData.dataWaterCod" placeholder="请输入化学需氧量" :disabled="disabled"></a-input>-->
|
||||||
|
<!-- </a-form-item>-->
|
||||||
|
<!-- </a-col>-->
|
||||||
|
<!-- <a-col :span="24">-->
|
||||||
|
<!-- <a-form-item label="总磷水样" v-bind="validateInfos.dataWaterTpSy">-->
|
||||||
|
<!-- <a-input v-model:value="formData.dataWaterTpSy" placeholder="" :disabled="disabled"></a-input>-->
|
||||||
|
<!-- </a-form-item>-->
|
||||||
|
<!-- </a-col>-->
|
||||||
|
<!-- <a-col :span="24">-->
|
||||||
|
<!-- <a-form-item label="总磷零点" v-bind="validateInfos.dataWaterTpLd">-->
|
||||||
|
<!-- <a-input v-model:value="formData.dataWaterTpLd" placeholder="" :disabled="disabled"></a-input>-->
|
||||||
|
<!-- </a-form-item>-->
|
||||||
|
<!-- </a-col>-->
|
||||||
|
<!-- <a-col :span="24">-->
|
||||||
|
<!-- <a-form-item label="总氮水样" v-bind="validateInfos.dataWaterTnSy">-->
|
||||||
|
<!-- <a-input v-model:value="formData.dataWaterTnSy" placeholder="" :disabled="disabled"></a-input>-->
|
||||||
|
<!-- </a-form-item>-->
|
||||||
|
<!-- </a-col>-->
|
||||||
|
<!-- <a-col :span="24">-->
|
||||||
|
<!-- <a-form-item label="总氮零点" v-bind="validateInfos.dataWaterTnLd">-->
|
||||||
|
<!-- <a-input v-model:value="formData.dataWaterTnLd" placeholder="" :disabled="disabled"></a-input>-->
|
||||||
|
<!-- </a-form-item>-->
|
||||||
|
<!-- </a-col>-->
|
||||||
|
<!-- <a-col :span="24">-->
|
||||||
|
<!-- <a-form-item label="总氮零点" v-bind="validateInfos.fluidLevel">-->
|
||||||
|
<!-- <a-input v-model:value="formData.fluidLevel" placeholder="" :disabled="disabled"></a-input>-->
|
||||||
|
<!-- </a-form-item>-->
|
||||||
|
<!-- </a-col>-->
|
||||||
|
<!-- <a-col :span="24">-->
|
||||||
|
<!-- <a-form-item label="1#球阀状态" v-bind="validateInfos.firstValveStatus">-->
|
||||||
|
<!-- <a-input v-model:value="formData.firstValveStatus" placeholder="" :disabled="disabled"></a-input>-->
|
||||||
|
<!-- </a-form-item>-->
|
||||||
|
<!-- </a-col>-->
|
||||||
|
<!-- <a-col :span="24">-->
|
||||||
|
<!-- <a-form-item label="2#球阀状态" v-bind="validateInfos.secondValveStatus">-->
|
||||||
|
<!-- <a-input v-model:value="formData.secondValveStatus" placeholder="" :disabled="disabled"></a-input>-->
|
||||||
|
<!-- </a-form-item>-->
|
||||||
|
<!-- </a-col>-->
|
||||||
|
<!-- <a-col :span="24">-->
|
||||||
|
<!-- <a-form-item label="急停状态" v-bind="validateInfos.crashStopStatus">-->
|
||||||
|
<!-- <a-input v-model:value="formData.crashStopStatus" placeholder="" :disabled="disabled"></a-input>-->
|
||||||
|
<!-- </a-form-item>-->
|
||||||
|
<!-- </a-col>-->
|
||||||
|
<!-- <a-col :span="24">-->
|
||||||
|
<!-- <a-form-item label="水泵状态" v-bind="validateInfos.waterPumpStatus">-->
|
||||||
|
<!-- <a-input v-model:value="formData.waterPumpStatus" placeholder="" :disabled="disabled"></a-input>-->
|
||||||
|
<!-- </a-form-item>-->
|
||||||
|
<!-- </a-col>-->
|
||||||
|
<!-- <a-col :span="24">-->
|
||||||
|
<!-- <a-form-item label="主副泵状态" v-bind="validateInfos.mainSideStatus">-->
|
||||||
|
<!-- <a-input v-model:value="formData.mainSideStatus" placeholder="" :disabled="disabled"></a-input>-->
|
||||||
|
<!-- </a-form-item>-->
|
||||||
|
<!-- </a-col>-->
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="数据更新时间" v-bind="validateInfos.dataDateTime">
|
||||||
|
<a-date-picker placeholder="" v-model:value="formData.dataDateTime" value-format="YYYY-MM-DD HH:mm:ss" show-time="{ format: 'YYYY-MM-DD HH:mm:ss' }" style="width: 100%" :disabled="disabled"/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<!-- <a-col :span="24">
|
||||||
|
<a-form-item label="数据类型" v-bind="validateInfos.dataGatherType">
|
||||||
|
<a-input v-model:value="formData.dataGatherType" placeholder="" :disabled="disabled"></a-input>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col> -->
|
||||||
|
</a-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: '',
|
||||||
|
dataWaterTpSy: '',
|
||||||
|
dataWaterTnSy: '',
|
||||||
|
dataWaterNoSy: '',
|
||||||
|
dataDateTime: '',
|
||||||
|
dataGatherType: '',
|
||||||
|
deviceName: '',
|
||||||
|
deviceCode: '',
|
||||||
|
stationName: '',
|
||||||
|
});
|
||||||
|
const { createMessage } = useMessage();
|
||||||
|
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
|
||||||
|
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
|
||||||
|
const confirmLoading = ref<boolean>(false);
|
||||||
|
//表单验证
|
||||||
|
const validatorRules = {
|
||||||
|
};
|
||||||
|
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: true });
|
||||||
|
|
||||||
|
// 表单禁用
|
||||||
|
const disabled = computed(()=>{
|
||||||
|
if(props.formBpm === true){
|
||||||
|
if(props.formData.disabled === false){
|
||||||
|
return false;
|
||||||
|
}else{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return props.formDisabled;
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增
|
||||||
|
*/
|
||||||
|
function add() {
|
||||||
|
edit({});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*/
|
||||||
|
function edit(record) {
|
||||||
|
nextTick(() => {
|
||||||
|
resetFields();
|
||||||
|
//赋值
|
||||||
|
Object.assign(formData, record);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提交数据
|
||||||
|
*/
|
||||||
|
async function submitForm() {
|
||||||
|
// 触发表单验证
|
||||||
|
await validate();
|
||||||
|
confirmLoading.value = true;
|
||||||
|
const isUpdate = ref<boolean>(false);
|
||||||
|
//时间格式化
|
||||||
|
let model = formData;
|
||||||
|
if (model.id) {
|
||||||
|
isUpdate.value = true;
|
||||||
|
}
|
||||||
|
//循环数据
|
||||||
|
for (let data in model) {
|
||||||
|
//如果该数据是数组并且是字符串类型
|
||||||
|
if (model[data] instanceof Array) {
|
||||||
|
let valueType = getValueType(formRef.value.getProps, data);
|
||||||
|
//如果是字符串类型的需要变成以逗号分割的字符串
|
||||||
|
if (valueType === 'string') {
|
||||||
|
model[data] = model[data].join(',');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
await saveOrUpdate(model, isUpdate.value)
|
||||||
|
.then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
createMessage.success(res.message);
|
||||||
|
emit('ok');
|
||||||
|
} else {
|
||||||
|
createMessage.warning(res.message);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
confirmLoading.value = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
add,
|
||||||
|
edit,
|
||||||
|
submitForm,
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
.antd-modal-form {
|
||||||
|
min-height: 500px !important;
|
||||||
|
overflow-y: auto;
|
||||||
|
padding: 24px 24px 24px 24px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -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>
|
||||||
|
|
@ -6,17 +6,17 @@ import { render } from '/@/utils/common/renderUtils';
|
||||||
export const columns: BasicColumn[] = [
|
export const columns: BasicColumn[] = [
|
||||||
{
|
{
|
||||||
title: '站点名称',
|
title: '站点名称',
|
||||||
align: "center",
|
align: 'center',
|
||||||
dataIndex: 'stationName',
|
dataIndex: 'stationName',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '设备编号',
|
title: '设备编号',
|
||||||
align: "center",
|
align: 'center',
|
||||||
dataIndex: 'deviceCode',
|
dataIndex: 'deployCode',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '数据更新时间',
|
title: '数据更新时间',
|
||||||
align: "center",
|
align: 'center',
|
||||||
dataIndex: 'dataDateTime',
|
dataIndex: 'dataDateTime',
|
||||||
},
|
},
|
||||||
// {
|
// {
|
||||||
|
|
@ -26,23 +26,23 @@ export const columns: BasicColumn[] = [
|
||||||
// },
|
// },
|
||||||
{
|
{
|
||||||
title: '总磷(mg/L)',
|
title: '总磷(mg/L)',
|
||||||
align: "center",
|
align: 'center',
|
||||||
dataIndex: 'dataWaterTp'
|
dataIndex: 'dataWaterTp',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '总氮(mg/L)',
|
title: '总氮(mg/L)',
|
||||||
align: "center",
|
align: 'center',
|
||||||
dataIndex: 'dataWaterTn'
|
dataIndex: 'dataWaterTn',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '氨氮(mg/L)',
|
title: '氨氮(mg/L)',
|
||||||
align: "center",
|
align: 'center',
|
||||||
dataIndex: 'dataWaterNh'
|
dataIndex: 'dataWaterNh',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '化学需氧量(mg/L)',
|
title: '化学需氧量(mg/L)',
|
||||||
align: "center",
|
align: 'center',
|
||||||
dataIndex: 'dataWaterCod'
|
dataIndex: 'dataWaterCod',
|
||||||
},
|
},
|
||||||
|
|
||||||
// {
|
// {
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,8 @@
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-form-item label="设备名称" v-bind="validateInfos.deviceName">
|
<a-form-item label="设备名称" v-bind="validateInfos.deployCode">
|
||||||
<a-input v-model:value="formData.deviceName" placeholder="请输入设备名称" :disabled="disabled"></a-input>
|
<a-input v-model:value="formData.deployCode" placeholder="请输入设备名称" :disabled="disabled"></a-input>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
|
|
@ -45,7 +45,14 @@
|
||||||
|
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-form-item label="数据更新时间" v-bind="validateInfos.dataDateTime">
|
<a-form-item label="数据更新时间" v-bind="validateInfos.dataDateTime">
|
||||||
<a-date-picker placeholder="" v-model:value="formData.dataDateTime" value-format="YYYY-MM-DD HH:mm:ss" show-time="{ format: 'YYYY-MM-DD HH:mm:ss' }" style="width: 100%" :disabled="disabled"/>
|
<a-date-picker
|
||||||
|
placeholder=""
|
||||||
|
v-model:value="formData.dataDateTime"
|
||||||
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
|
show-time="{ format: 'YYYY-MM-DD HH:mm:ss' }"
|
||||||
|
style="width: 100%"
|
||||||
|
:disabled="disabled"
|
||||||
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<!-- <a-col :span="24">
|
<!-- <a-col :span="24">
|
||||||
|
|
@ -65,57 +72,55 @@
|
||||||
import { getValueType } from '/@/utils';
|
import { getValueType } from '/@/utils';
|
||||||
import { saveOrUpdate } from '../SurvTransdataLivestockwater.api';
|
import { saveOrUpdate } from '../SurvTransdataLivestockwater.api';
|
||||||
import { Form } from 'ant-design-vue';
|
import { Form } from 'ant-design-vue';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
formDisabled: { type: Boolean, default: false },
|
formDisabled: { type: Boolean, default: false },
|
||||||
formData: { type: Object, default: ()=>{} },
|
formData: { type: Object, default: () => {} },
|
||||||
formBpm: { type: Boolean, default: true }
|
formBpm: { type: Boolean, default: true },
|
||||||
});
|
});
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
const useForm = Form.useForm;
|
const useForm = Form.useForm;
|
||||||
const emit = defineEmits(['register', 'ok']);
|
const emit = defineEmits(['register', 'ok']);
|
||||||
const formData = reactive<Record<string, any>>({
|
const formData = reactive<Record<string, any>>({
|
||||||
id: '',
|
id: '',
|
||||||
tenantId: '',
|
tenantId: '',
|
||||||
reVision: undefined,
|
reVision: undefined,
|
||||||
createdBy: '',
|
createdBy: '',
|
||||||
createTime: '',
|
createTime: '',
|
||||||
updatedBy: '',
|
updatedBy: '',
|
||||||
isDel: undefined,
|
isDel: undefined,
|
||||||
updatedTime: '',
|
updatedTime: '',
|
||||||
dataId: '',
|
dataId: '',
|
||||||
dataWaterTp: '',
|
dataWaterTp: '',
|
||||||
dataWaterTn: '',
|
dataWaterTn: '',
|
||||||
dataWaterNh: '',
|
dataWaterNh: '',
|
||||||
dataWaterCod: '',
|
dataWaterCod: '',
|
||||||
dataDateTime: '',
|
dataDateTime: '',
|
||||||
dataGatherType: '',
|
dataGatherType: '',
|
||||||
deviceName: '',
|
deviceName: '',
|
||||||
deviceCode: '',
|
deviceCode: '',
|
||||||
stationName: '',
|
stationName: '',
|
||||||
});
|
});
|
||||||
const { createMessage } = useMessage();
|
const { createMessage } = useMessage();
|
||||||
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
|
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
|
||||||
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
|
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
|
||||||
const confirmLoading = ref<boolean>(false);
|
const confirmLoading = ref<boolean>(false);
|
||||||
//表单验证
|
//表单验证
|
||||||
const validatorRules = {
|
const validatorRules = {};
|
||||||
};
|
|
||||||
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: true });
|
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: true });
|
||||||
|
|
||||||
// 表单禁用
|
// 表单禁用
|
||||||
const disabled = computed(()=>{
|
const disabled = computed(() => {
|
||||||
if(props.formBpm === true){
|
if (props.formBpm === true) {
|
||||||
if(props.formData.disabled === false){
|
if (props.formData.disabled === false) {
|
||||||
return false;
|
return false;
|
||||||
}else{
|
} else {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return props.formDisabled;
|
return props.formDisabled;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增
|
* 新增
|
||||||
*/
|
*/
|
||||||
|
|
@ -172,7 +177,6 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
add,
|
add,
|
||||||
edit,
|
edit,
|
||||||
|
|
|
||||||
|
|
@ -5,49 +5,44 @@ import { render } from '/@/utils/common/renderUtils';
|
||||||
//列表数据
|
//列表数据
|
||||||
export const columns: BasicColumn[] = [
|
export const columns: BasicColumn[] = [
|
||||||
{
|
{
|
||||||
title: '创建者',
|
title: '设备名称',
|
||||||
align: "center",
|
align: 'center',
|
||||||
dataIndex: 'createId'
|
dataIndex: 'deployName',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '更新者',
|
title: '所属站点',
|
||||||
align: "center",
|
align: 'center',
|
||||||
dataIndex: 'updateId'
|
dataIndex: 'stationName',
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '设备主键',
|
|
||||||
align: "center",
|
|
||||||
dataIndex: 'equId'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '指标code',
|
|
||||||
align: "center",
|
|
||||||
dataIndex: 'code'
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '指标名称',
|
title: '指标名称',
|
||||||
align: "center",
|
align: 'center',
|
||||||
dataIndex: 'name'
|
dataIndex: 'name',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '低阈值',
|
title: '低阈值',
|
||||||
align: "center",
|
align: 'center',
|
||||||
dataIndex: 'valLow'
|
dataIndex: 'valLow',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '高阈值',
|
title: '高阈值',
|
||||||
align: "center",
|
align: 'center',
|
||||||
dataIndex: 'valHeight'
|
dataIndex: 'valHeight',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '计量单位',
|
title: '计量单位',
|
||||||
align: "center",
|
align: 'center',
|
||||||
dataIndex: 'nuit'
|
dataIndex: 'nuit',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
//查询数据
|
//查询数据
|
||||||
export const searchFormSchema: FormSchema[] = [
|
export const searchFormSchema: FormSchema[] = [
|
||||||
|
{
|
||||||
|
title: '设备名称',
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'deviceName',
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
//表单数据
|
//表单数据
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,31 @@
|
||||||
<div class="jeecg-basic-table-form-container">
|
<div class="jeecg-basic-table-form-container">
|
||||||
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
|
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
|
||||||
<a-row :gutter="24">
|
<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"
|
||||||
|
showSearch
|
||||||
|
v-model:value="queryParam.stationCode"
|
||||||
|
optionFilterProp="label"
|
||||||
|
resultField="list"
|
||||||
|
labelField="stationName"
|
||||||
|
valueField="stationCode"
|
||||||
|
placeholder="请选择"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
|
||||||
|
<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-row>
|
||||||
</a-form>
|
</a-form>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -11,37 +36,38 @@
|
||||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
||||||
<!--插槽:table标题-->
|
<!--插槽:table标题-->
|
||||||
<template #tableTitle>
|
<template #tableTitle>
|
||||||
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
|
<!-- <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>
|
<!-- <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>
|
<!-- <j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>-->
|
||||||
<a-dropdown v-if="selectedRowKeys.length > 0">
|
<a-dropdown v-if="selectedRowKeys.length > 0">
|
||||||
<template #overlay>
|
<template #overlay>
|
||||||
<a-menu>
|
<a-menu>
|
||||||
<a-menu-item key="1" @click="batchHandleDelete">
|
<!-- <a-menu-item key="1" @click="batchHandleDelete">-->
|
||||||
<Icon icon="ant-design:delete-outlined"></Icon>
|
<!-- <Icon icon="ant-design:delete-outlined"></Icon>-->
|
||||||
删除
|
<!-- 删除-->
|
||||||
</a-menu-item>
|
<!-- </a-menu-item>-->
|
||||||
</a-menu>
|
</a-menu>
|
||||||
</template>
|
</template>
|
||||||
<a-button>批量操作
|
<a-button
|
||||||
|
>批量操作
|
||||||
<Icon icon="mdi:chevron-down"></Icon>
|
<Icon icon="mdi:chevron-down"></Icon>
|
||||||
</a-button>
|
</a-button>
|
||||||
</a-dropdown>
|
</a-dropdown>
|
||||||
</template>
|
</template>
|
||||||
<!--操作栏-->
|
<!--操作栏-->
|
||||||
<template #action="{ record }">
|
<template #action="{ record }">
|
||||||
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
|
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
|
||||||
</template>
|
</template>
|
||||||
<!--字段回显插槽-->
|
<!--字段回显插槽-->
|
||||||
<template #htmlSlot="{text}">
|
<template #htmlSlot="{ text }">
|
||||||
<div v-html="text"></div>
|
<div v-html="text"></div>
|
||||||
</template>
|
</template>
|
||||||
<!--省市区字段回显插槽-->
|
<!--省市区字段回显插槽-->
|
||||||
<template #pcaSlot="{text}">
|
<template #pcaSlot="{ text }">
|
||||||
{{ getAreaTextByCode(text) }}
|
{{ getAreaTextByCode(text) }}
|
||||||
</template>
|
</template>
|
||||||
<template #fileSlot="{text}">
|
<template #fileSlot="{ text }">
|
||||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
|
<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>
|
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button>
|
||||||
</template>
|
</template>
|
||||||
</BasicTable>
|
</BasicTable>
|
||||||
|
|
@ -57,7 +83,10 @@
|
||||||
import { columns } from './ScEquZhibiao.data';
|
import { columns } from './ScEquZhibiao.data';
|
||||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './ScEquZhibiao.api';
|
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './ScEquZhibiao.api';
|
||||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||||
import ScEquZhibiaoModal from './components/ScEquZhibiaoModal.vue'
|
import ScEquZhibiaoModal from './components/ScEquZhibiaoModal.vue';
|
||||||
|
import { getStationList } from '/@/views/appmana/station/SurvStationInfo.api';
|
||||||
|
import { ApiSelect } from '/@/components/Form';
|
||||||
|
import { getDeviceCateList } from '/@/views/appmana/deploy/SurvDeviceDeploy.api';
|
||||||
|
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
const queryParam = reactive<any>({});
|
const queryParam = reactive<any>({});
|
||||||
|
|
@ -69,7 +98,7 @@
|
||||||
title: 'sc_equ_zhibiao',
|
title: 'sc_equ_zhibiao',
|
||||||
api: list,
|
api: list,
|
||||||
columns,
|
columns,
|
||||||
canResize:false,
|
canResize: false,
|
||||||
useSearchForm: false,
|
useSearchForm: false,
|
||||||
actionColumn: {
|
actionColumn: {
|
||||||
width: 120,
|
width: 120,
|
||||||
|
|
@ -80,16 +109,17 @@
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
exportConfig: {
|
exportConfig: {
|
||||||
name: "sc_equ_zhibiao",
|
name: 'sc_equ_zhibiao',
|
||||||
url: getExportUrl,
|
url: getExportUrl,
|
||||||
params: queryParam,
|
params: queryParam,
|
||||||
},
|
},
|
||||||
importConfig: {
|
importConfig: {
|
||||||
url: getImportUrl,
|
url: getImportUrl,
|
||||||
success: handleSuccess
|
success: handleSuccess,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
|
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] =
|
||||||
|
tableContext;
|
||||||
const labelCol = reactive({
|
const labelCol = reactive({
|
||||||
xs: { span: 24 },
|
xs: { span: 24 },
|
||||||
sm: { span: 7 },
|
sm: { span: 7 },
|
||||||
|
|
@ -106,7 +136,7 @@
|
||||||
registerModal.value.disableSubmit = false;
|
registerModal.value.disableSubmit = false;
|
||||||
registerModal.value.add();
|
registerModal.value.add();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 编辑事件
|
* 编辑事件
|
||||||
*/
|
*/
|
||||||
|
|
@ -114,7 +144,7 @@
|
||||||
registerModal.value.disableSubmit = false;
|
registerModal.value.disableSubmit = false;
|
||||||
registerModal.value.edit(record);
|
registerModal.value.edit(record);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 详情
|
* 详情
|
||||||
*/
|
*/
|
||||||
|
|
@ -122,28 +152,28 @@
|
||||||
registerModal.value.disableSubmit = true;
|
registerModal.value.disableSubmit = true;
|
||||||
registerModal.value.edit(record);
|
registerModal.value.edit(record);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除事件
|
* 删除事件
|
||||||
*/
|
*/
|
||||||
async function handleDelete(record) {
|
async function handleDelete(record) {
|
||||||
await deleteOne({ id: record.id }, handleSuccess);
|
await deleteOne({ id: record.id }, handleSuccess);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除事件
|
* 批量删除事件
|
||||||
*/
|
*/
|
||||||
async function batchHandleDelete() {
|
async function batchHandleDelete() {
|
||||||
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
|
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 成功回调
|
* 成功回调
|
||||||
*/
|
*/
|
||||||
function handleSuccess() {
|
function handleSuccess() {
|
||||||
(selectedRowKeys.value = []) && reload();
|
(selectedRowKeys.value = []) && reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 操作栏
|
* 操作栏
|
||||||
*/
|
*/
|
||||||
|
|
@ -155,7 +185,7 @@
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 下拉操作栏
|
* 下拉操作栏
|
||||||
*/
|
*/
|
||||||
|
|
@ -164,14 +194,15 @@
|
||||||
{
|
{
|
||||||
label: '详情',
|
label: '详情',
|
||||||
onClick: handleDetail.bind(null, record),
|
onClick: handleDetail.bind(null, record),
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
label: '删除',
|
label: '删除',
|
||||||
popConfirm: {
|
popConfirm: {
|
||||||
title: '是否确认删除',
|
title: '是否确认删除',
|
||||||
confirm: handleDelete.bind(null, record),
|
confirm: handleDelete.bind(null, record),
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
]
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -180,7 +211,7 @@
|
||||||
function searchQuery() {
|
function searchQuery() {
|
||||||
reload();
|
reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 重置
|
* 重置
|
||||||
*/
|
*/
|
||||||
|
|
@ -190,10 +221,6 @@
|
||||||
//刷新数据
|
//刷新数据
|
||||||
reload();
|
reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
|
|
@ -203,14 +230,14 @@
|
||||||
margin-bottom: 24px;
|
margin-bottom: 24px;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
.query-group-cust{
|
.query-group-cust {
|
||||||
width: calc(50% - 15px);
|
width: calc(50% - 15px);
|
||||||
min-width: 100px !important;
|
min-width: 100px !important;
|
||||||
}
|
}
|
||||||
.query-group-split-cust{
|
.query-group-split-cust {
|
||||||
width: 30px;
|
width: 30px;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
text-align: center
|
text-align: center;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -3,23 +3,13 @@
|
||||||
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
<a-row>
|
<a-row>
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-form-item label="创建者" v-bind="validateInfos.createId">
|
<a-form-item label="设备名称" v-bind="validateInfos.deployName">
|
||||||
<a-input v-model:value="formData.createId" placeholder="请输入创建者" :disabled="disabled"></a-input>
|
<a-input v-model:value="formData.deployName" placeholder="请输入设备名称" :disabled="disabled"></a-input>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-form-item label="更新者" v-bind="validateInfos.updateId">
|
<a-form-item label="所属站点" v-bind="validateInfos.stationName">
|
||||||
<a-input v-model:value="formData.updateId" placeholder="请输入更新者" :disabled="disabled"></a-input>
|
<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.equId">
|
|
||||||
<a-input v-model:value="formData.equId" placeholder="请输入设备主键" :disabled="disabled"></a-input>
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="24">
|
|
||||||
<a-form-item label="指标code" v-bind="validateInfos.code">
|
|
||||||
<a-input v-model:value="formData.code" placeholder="请输入指标code" :disabled="disabled"></a-input>
|
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
|
|
@ -29,12 +19,12 @@
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-form-item label="低阈值" v-bind="validateInfos.valLow">
|
<a-form-item label="低阈值" v-bind="validateInfos.valLow">
|
||||||
<a-input-number v-model:value="formData.valLow" placeholder="请输入低阈值" style="width: 100%" :disabled="disabled"/>
|
<a-input-number v-model:value="formData.valLow" placeholder="请输入低阈值" style="width: 100%" :disabled="disabled" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-form-item label="高阈值" v-bind="validateInfos.valHeight">
|
<a-form-item label="高阈值" v-bind="validateInfos.valHeight">
|
||||||
<a-input-number v-model:value="formData.valHeight" placeholder="请输入高阈值" style="width: 100%" :disabled="disabled"/>
|
<a-input-number v-model:value="formData.valHeight" placeholder="请输入高阈值" style="width: 100%" :disabled="disabled" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
|
|
@ -54,48 +44,46 @@
|
||||||
import { getValueType } from '/@/utils';
|
import { getValueType } from '/@/utils';
|
||||||
import { saveOrUpdate } from '../ScEquZhibiao.api';
|
import { saveOrUpdate } from '../ScEquZhibiao.api';
|
||||||
import { Form } from 'ant-design-vue';
|
import { Form } from 'ant-design-vue';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
formDisabled: { type: Boolean, default: false },
|
formDisabled: { type: Boolean, default: false },
|
||||||
formData: { type: Object, default: ()=>{} },
|
formData: { type: Object, default: () => {} },
|
||||||
formBpm: { type: Boolean, default: true }
|
formBpm: { type: Boolean, default: true },
|
||||||
});
|
});
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
const useForm = Form.useForm;
|
const useForm = Form.useForm;
|
||||||
const emit = defineEmits(['register', 'ok']);
|
const emit = defineEmits(['register', 'ok']);
|
||||||
const formData = reactive<Record<string, any>>({
|
const formData = reactive<Record<string, any>>({
|
||||||
id: '',
|
id: '',
|
||||||
createId: '',
|
createId: '',
|
||||||
updateId: '',
|
updateId: '',
|
||||||
equId: '',
|
equId: '',
|
||||||
code: '',
|
code: '',
|
||||||
name: '',
|
name: '',
|
||||||
valLow: undefined,
|
valLow: undefined,
|
||||||
valHeight: undefined,
|
valHeight: undefined,
|
||||||
nuit: '',
|
nuit: '',
|
||||||
});
|
});
|
||||||
const { createMessage } = useMessage();
|
const { createMessage } = useMessage();
|
||||||
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
|
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
|
||||||
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
|
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
|
||||||
const confirmLoading = ref<boolean>(false);
|
const confirmLoading = ref<boolean>(false);
|
||||||
//表单验证
|
//表单验证
|
||||||
const validatorRules = {
|
const validatorRules = {};
|
||||||
};
|
|
||||||
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: true });
|
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: true });
|
||||||
|
|
||||||
// 表单禁用
|
// 表单禁用
|
||||||
const disabled = computed(()=>{
|
const disabled = computed(() => {
|
||||||
if(props.formBpm === true){
|
if (props.formBpm === true) {
|
||||||
if(props.formData.disabled === false){
|
if (props.formData.disabled === false) {
|
||||||
return false;
|
return false;
|
||||||
}else{
|
} else {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return props.formDisabled;
|
return props.formDisabled;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增
|
* 新增
|
||||||
*/
|
*/
|
||||||
|
|
@ -142,7 +130,6 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
add,
|
add,
|
||||||
edit,
|
edit,
|
||||||
|
|
|
||||||
|
|
@ -95,6 +95,76 @@
|
||||||
summaryNoDataList.value = res.result[0].NOSummry;
|
summaryNoDataList.value = res.result[0].NOSummry;
|
||||||
summaryNhDataList.value = res.result[0].NHSummry;
|
summaryNhDataList.value = res.result[0].NHSummry;
|
||||||
summaryCodDataList.value = res.result[0].CODSummry;
|
summaryCodDataList.value = res.result[0].CODSummry;
|
||||||
|
|
||||||
|
let seriesData = [];
|
||||||
|
if (summaryTpDataList.value && summaryTpDataList.value.length > 0) {
|
||||||
|
seriesData.push({
|
||||||
|
smooth: true,
|
||||||
|
name: '总磷',
|
||||||
|
stack: 'mg/L',
|
||||||
|
data: summaryTpDataList.value,
|
||||||
|
type: 'line',
|
||||||
|
areaStyle: {},
|
||||||
|
itemStyle: {
|
||||||
|
color: '#5ab1ef',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (summaryTnDataList.value && summaryTnDataList.value.length > 0) {
|
||||||
|
seriesData.push({
|
||||||
|
smooth: true,
|
||||||
|
name: '总氮',
|
||||||
|
stack: 'mg/L',
|
||||||
|
data: summaryTnDataList.value,
|
||||||
|
type: 'line',
|
||||||
|
areaStyle: {},
|
||||||
|
itemStyle: {
|
||||||
|
color: '#019680',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (summaryNoDataList.value && summaryNoDataList.value.length > 0) {
|
||||||
|
seriesData.push({
|
||||||
|
smooth: true,
|
||||||
|
name: '硝态氮',
|
||||||
|
stack: 'mg/L',
|
||||||
|
data: summaryNoDataList.value,
|
||||||
|
type: 'line',
|
||||||
|
areaStyle: {},
|
||||||
|
itemStyle: {
|
||||||
|
color: '#019634',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (summaryNhDataList.value && summaryNhDataList.value.length > 0) {
|
||||||
|
seriesData.push({
|
||||||
|
smooth: true,
|
||||||
|
name: '氨氮',
|
||||||
|
stack: 'mg/L',
|
||||||
|
data: summaryNhDataList.value,
|
||||||
|
type: 'line',
|
||||||
|
areaStyle: {},
|
||||||
|
itemStyle: {
|
||||||
|
color: '#075ca6',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (summaryCodDataList.value && summaryCodDataList.value.length > 0) {
|
||||||
|
seriesData.push({
|
||||||
|
smooth: true,
|
||||||
|
name: '化学需氧量',
|
||||||
|
stack: 'mg/L',
|
||||||
|
data: summaryCodDataList.value,
|
||||||
|
type: 'line',
|
||||||
|
areaStyle: {},
|
||||||
|
itemStyle: {
|
||||||
|
color: '#a65107',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
setOptions({
|
setOptions({
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'axis',
|
trigger: 'axis',
|
||||||
|
|
@ -150,63 +220,7 @@
|
||||||
right: 20,
|
right: 20,
|
||||||
top: 20,
|
top: 20,
|
||||||
},
|
},
|
||||||
series: [
|
series: seriesData,
|
||||||
{
|
|
||||||
smooth: true,
|
|
||||||
name: '总磷',
|
|
||||||
stack: 'mg/L',
|
|
||||||
data: summaryTpDataList.value,
|
|
||||||
type: 'line',
|
|
||||||
areaStyle: {},
|
|
||||||
itemStyle: {
|
|
||||||
color: '#5ab1ef',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
smooth: true,
|
|
||||||
name: '总氮',
|
|
||||||
stack: 'mg/L',
|
|
||||||
data: summaryTnDataList.value,
|
|
||||||
type: 'line',
|
|
||||||
areaStyle: {},
|
|
||||||
itemStyle: {
|
|
||||||
color: '#019680',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
// {
|
|
||||||
// smooth: true,
|
|
||||||
// name: '硝态氮',
|
|
||||||
// stack: 'mg/L',
|
|
||||||
// data: summaryNoDataList.value,
|
|
||||||
// type: 'line',
|
|
||||||
// areaStyle: {},
|
|
||||||
// itemStyle: {
|
|
||||||
// color: '#019634',
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
{
|
|
||||||
smooth: true,
|
|
||||||
name: '化学需氧量',
|
|
||||||
stack: 'mg/L',
|
|
||||||
data: summaryCodDataList.value,
|
|
||||||
type: 'line',
|
|
||||||
areaStyle: {},
|
|
||||||
itemStyle: {
|
|
||||||
color: '#a65107',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
// {
|
|
||||||
// smooth: true,
|
|
||||||
// name: '氨氮',
|
|
||||||
// stack: 'mg/L',
|
|
||||||
// data: summaryNhDataList.value,
|
|
||||||
// type: 'line',
|
|
||||||
// areaStyle: {},
|
|
||||||
// itemStyle: {
|
|
||||||
// color: '#075ca6',
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
],
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue