diff --git a/src/views/appmana/jixian/livestock/SurvHisdataLivestockwater.api.ts b/src/views/appmana/jixian/livestock/SurvHisdataLivestockwater.api.ts new file mode 100644 index 0000000..597d8e2 --- /dev/null +++ b/src/views/appmana/jixian/livestock/SurvHisdataLivestockwater.api.ts @@ -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 }); +} diff --git a/src/views/appmana/jixian/livestock/SurvHisdataLivestockwater.data.ts b/src/views/appmana/jixian/livestock/SurvHisdataLivestockwater.data.ts new file mode 100644 index 0000000..5be1bd9 --- /dev/null +++ b/src/views/appmana/jixian/livestock/SurvHisdataLivestockwater.data.ts @@ -0,0 +1,243 @@ +import {BasicColumn} from '/@/components/Table'; +import {FormSchema} from '/@/components/Table'; +import { rules} from '/@/utils/helper/validator'; +import { render } from '/@/utils/common/renderUtils'; +import {getStationList} from "/@/views/appmana/station/SurvStationInfo.api"; +//列表数据 +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' + // }, + // { + // title: '转储时间', + // align: "center", + // dataIndex: 'transDate', + // }, +]; + +//查询数据 +export const searchFormSchema: FormSchema[] = [ + { + field: 'stationCode', + component: 'ApiSelect', + label: '监测站点', + componentProps: { + // more details see /src/components/Form/src/components/ApiSelect.vue + api: getStationList, + params: { + id: 1, + stationType: 'livestock' + }, + resultField: 'list', + // use name as label + labelField: 'stationName', + // use id as value + valueField: 'stationCode', + // not request untill to select + immediate: false, + onChange: (e) => { + console.log('selected:', e); + }, + // atfer request callback + onOptionsChange: (options) => { + console.log('get options', options.length, options); + }, + }, + colProps: { + span: 8, + }, + }, + // { + // field: 'deployId', + // component: 'ApiSelect', + // label: '选择设备', + // componentProps: { + // // more details see /src/components/Form/src/components/ApiSelect.vue + // api: getDeviceList, + // params: { + // id: 1, + // deployTypes: ["6_water"] + // }, + // resultField: 'list', + // // use name as label + // labelField: 'deployDes', + // // use id as value + // valueField: 'id', + // // not request untill to select + // immediate: false, + // onChange: (e) => { + // console.log('selected:', e); + // }, + // // atfer request callback + // onOptionsChange: (options) => { + // console.log('get options', options.length, options); + // }, + // }, + // colProps: { + // span: 8, + // }, + // }, + { + field: 'dataDateTime', + label: '监测时间', + component: 'RangePicker', + colProps: { span: 8 }, + componentProps: { + picker: 'date', + valueFormat: 'YYYY-MM-DD', + }, + }, + { + field: 'deployType', + label: '', + component: 'JInput', + colProps: { span: 8 }, + show: false, + defaultValue: 'standard', + }, + { + field: 'column', + label: '', + component: 'JInput', + colProps: { span: 8 }, + show: false, + defaultValue: 'dataDateTime', + }, + { + field: 'order', + label: '', + component: 'JInput', + colProps: { span: 8 }, + show: false, + defaultValue: 'desc', + }, +]; + +//表单数据 +export const formSchema: FormSchema[] = [ + { + label: '租户号', + field: 'tenantId', + component: 'Input', + }, + { + label: '乐观锁', + field: 'reVision', + component: 'InputNumber', + }, + { + label: '创建人', + field: 'createdBy', + component: 'Input', + }, + { + label: '创建时间', + field: 'createTime', + component: 'DatePicker', + }, + { + label: '更新人', + field: 'updatedBy', + component: 'Input', + }, + { + label: '逻辑删除', + field: 'isDel', + component: 'InputNumber', + }, + { + label: '更新时间', + field: 'updatedTime', + component: 'DatePicker', + }, + { + label: '数据ID', + field: 'dataId', + component: 'Input', + }, + { + label: '总磷', + field: 'dataWaterTpSy', + component: 'Input', + }, + { + label: '总氮', + field: 'dataWaterTnSy', + component: 'Input', + }, + { + label: '化学需氧量', + field: 'dataWaterCodSy', + component: 'Input', + }, + // { + // label: '硝态氮', + // field: 'dataWaterNo', + // component: 'Input', + // }, + { + label: '数据更新时间', + field: 'dataDateTime', + component: 'DatePicker', + }, + { + label: '数据类型;realTime=实时,dayTime=日数据,month=月数据,year=年数据', + field: 'dataGatherType', + component: 'Input', + }, + { + label: '转储时间', + field: 'transDate', + component: 'DatePicker', + }, + // TODO 主键隐藏字段,目前写死为ID + { + label: '', + field: 'id', + component: 'Input', + show: false, + }, +]; diff --git a/src/views/appmana/jixian/livestock/SurvHisdataLivestockwaterList.vue b/src/views/appmana/jixian/livestock/SurvHisdataLivestockwaterList.vue new file mode 100644 index 0000000..d235cb5 --- /dev/null +++ b/src/views/appmana/jixian/livestock/SurvHisdataLivestockwaterList.vue @@ -0,0 +1,278 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 导出 + + + + + + + 删除 + + + + + + + + + + + + + + + + + + {{ getAreaTextByCode(text) }} + + + 无文件 + 下载 + + + + + + + + + + diff --git a/src/views/appmana/jixian/livestock/components/SurvHisdataLivestockwaterForm.vue b/src/views/appmana/jixian/livestock/components/SurvHisdataLivestockwaterForm.vue new file mode 100644 index 0000000..8d86834 --- /dev/null +++ b/src/views/appmana/jixian/livestock/components/SurvHisdataLivestockwaterForm.vue @@ -0,0 +1,203 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/views/appmana/jixian/livestock/components/SurvHisdataLivestockwaterModal.vue b/src/views/appmana/jixian/livestock/components/SurvHisdataLivestockwaterModal.vue new file mode 100644 index 0000000..d6de60c --- /dev/null +++ b/src/views/appmana/jixian/livestock/components/SurvHisdataLivestockwaterModal.vue @@ -0,0 +1,75 @@ + + + + + + + + + diff --git a/src/views/appmana/jixian/orient/SurvHisdataOrientwater.api.ts b/src/views/appmana/jixian/orient/SurvHisdataOrientwater.api.ts new file mode 100644 index 0000000..eb01cc2 --- /dev/null +++ b/src/views/appmana/jixian/orient/SurvHisdataOrientwater.api.ts @@ -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 }); +} diff --git a/src/views/appmana/jixian/orient/SurvHisdataOrientwater.data.ts b/src/views/appmana/jixian/orient/SurvHisdataOrientwater.data.ts new file mode 100644 index 0000000..e40c434 --- /dev/null +++ b/src/views/appmana/jixian/orient/SurvHisdataOrientwater.data.ts @@ -0,0 +1,267 @@ +import {BasicColumn} from '/@/components/Table'; +import {FormSchema} from '/@/components/Table'; +import { rules} from '/@/utils/helper/validator'; +import { render } from '/@/utils/common/renderUtils'; +import {getStationList} from "/@/views/appmana/station/SurvStationInfo.api"; +//列表数据 +export const columns: BasicColumn[] = [ + { + title: '站点名称', + align: 'center', + dataIndex: 'stationName', + }, + { + title: '设备编号', + align: 'center', + dataIndex: 'deployCode', + }, + { + title: '数据更新时间', + align: 'center', + dataIndex: 'dataDateTime', + }, + // { + // title: '数据ID', + // align: "center", + // dataIndex: 'dataId' + // }, + { + title: '总磷(mg/L)', + align: 'center', + dataIndex: 'dataWaterTpSy', + }, + { + title: '总氮(mg/L)', + align: 'center', + dataIndex: 'dataWaterTnSy', + }, + // { + // title: '化学需氧量(mg/L)', + // align: 'center', + // dataIndex: 'dataWaterCodSy', + // }, + { + title: '硝态氮(mg/L)', + align: "center", + dataIndex: 'dataWaterNoSy' + }, + // { + // title: '1#球阀状态', + // align: "center", + // dataIndex: 'firstValveStatus', + // customRender: ({ text }) => { + // if (!text || text == '00') { + // return '开'; + // } else if (text == '01') { + // return '关'; + // } + // }, + // }, + // { + // title: '2#球阀状态', + // align: "center", + // dataIndex: 'secondValveStatus', + // customRender: ({ text }) => { + // if (!text || text == '00') { + // return '开'; + // } else if (text == '01') { + // return '关'; + // } + // }, + // }, + + // { + // title: '数据类型;realTime=实时,dayTime=日数据,month=月数据,year=年数据', + // align: "center", + // dataIndex: 'dataGatherType' + // }, + // { + // title: '转储时间', + // align: "center", + // dataIndex: 'transDate', + // }, +]; + +//查询数据 +export const searchFormSchema: FormSchema[] = [ + { + field: 'stationCode', + component: 'ApiSelect', + label: '监测站点', + componentProps: { + // more details see /src/components/Form/src/components/ApiSelect.vue + api: getStationList, + params: { + id: 1, + stationType: 'orient' + }, + resultField: 'list', + // use name as label + labelField: 'stationName', + // use id as value + valueField: 'stationCode', + // not request untill to select + immediate: false, + onChange: (e) => { + console.log('selected:', e); + }, + // atfer request callback + onOptionsChange: (options) => { + console.log('get options', options.length, options); + }, + }, + colProps: { + span: 8, + }, + }, + // { + // field: 'deployId', + // component: 'ApiSelect', + // label: '选择设备', + // componentProps: { + // // more details see /src/components/Form/src/components/ApiSelect.vue + // api: getDeviceList, + // params: { + // id: 1, + // deployTypes: ["6_water"] + // }, + // resultField: 'list', + // // use name as label + // labelField: 'deployDes', + // // use id as value + // valueField: 'id', + // // not request untill to select + // immediate: false, + // onChange: (e) => { + // console.log('selected:', e); + // }, + // // atfer request callback + // onOptionsChange: (options) => { + // console.log('get options', options.length, options); + // }, + // }, + // colProps: { + // span: 8, + // }, + // }, + { + field: 'dataDateTime', + label: '监测时间', + component: 'RangePicker', + colProps: { span: 8 }, + componentProps: { + picker: 'date', + valueFormat: 'YYYY-MM-DD', + }, + }, + { + field: 'deployType', + label: '', + component: 'JInput', + colProps: { span: 8 }, + ifShow: false, + defaultValue: 'orient_no', + }, + { + field: 'column', + label: '', + component: 'JInput', + colProps: { span: 8 }, + ifShow: false, + defaultValue: 'dataDateTime', + }, + { + field: 'order', + label: '', + component: 'JInput', + colProps: { span: 8 }, + ifShow: false, + defaultValue: 'desc', + }, +]; + +//表单数据 +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, + }, +]; diff --git a/src/views/appmana/jixian/orient/SurvHisdataOrientwaterList.vue b/src/views/appmana/jixian/orient/SurvHisdataOrientwaterList.vue new file mode 100644 index 0000000..8ddf0b9 --- /dev/null +++ b/src/views/appmana/jixian/orient/SurvHisdataOrientwaterList.vue @@ -0,0 +1,280 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 导出 + + + + + + + 删除 + + + + + + + + + + + + + + + + + + {{ getAreaTextByCode(text) }} + + + 无文件 + 下载 + + + + + + + + + + diff --git a/src/views/appmana/jixian/orient/components/SurvHisdataOrientwaterForm.vue b/src/views/appmana/jixian/orient/components/SurvHisdataOrientwaterForm.vue new file mode 100644 index 0000000..4aa7126 --- /dev/null +++ b/src/views/appmana/jixian/orient/components/SurvHisdataOrientwaterForm.vue @@ -0,0 +1,247 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/views/appmana/jixian/orient/components/SurvHisdataOrientwaterModal.vue b/src/views/appmana/jixian/orient/components/SurvHisdataOrientwaterModal.vue new file mode 100644 index 0000000..f861981 --- /dev/null +++ b/src/views/appmana/jixian/orient/components/SurvHisdataOrientwaterModal.vue @@ -0,0 +1,75 @@ + + + + + + + + +