diff --git a/src/views/heating/extract/DataExtractConfig.api.ts b/src/views/heating/extract/DataExtractConfig.api.ts new file mode 100644 index 0000000..8bf012c --- /dev/null +++ b/src/views/heating/extract/DataExtractConfig.api.ts @@ -0,0 +1,84 @@ +import { defHttp } from '/@/utils/http/axios'; +import { useMessage } from "/@/hooks/web/useMessage"; + +const { createConfirm } = useMessage(); + +enum Api { + list = '/heating/dataExtractConfig/list', + save='/heating/dataExtractConfig/add', + edit='/heating/dataExtractConfig/edit', + deleteOne = '/heating/dataExtractConfig/delete', + deleteBatch = '/heating/dataExtractConfig/deleteBatch', + importExcel = '/heating/dataExtractConfig/importExcel', + exportXls = '/heating/dataExtractConfig/exportXls', + companylist = '/heating/thermalcompany/list', + heatsourcelist = '/heating/heatsource/list', + heatsourcestationlist = '/heating/heatsourcestation/list', +} + +/** + * 导出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 }); +} + +export const companylist = (params) => + defHttp.get({url: Api.companylist, params}); + +export const heatsourcelist = (params) => + defHttp.get({url: Api.heatsourcelist, params}); + +export const heatsourcestationlist = (params) => + defHttp.get({url: Api.heatsourcestationlist, params}); diff --git a/src/views/heating/extract/DataExtractConfig.data.ts b/src/views/heating/extract/DataExtractConfig.data.ts new file mode 100644 index 0000000..84e0140 --- /dev/null +++ b/src/views/heating/extract/DataExtractConfig.data.ts @@ -0,0 +1,126 @@ +import {BasicColumn} from '/@/components/Table'; +import {FormSchema} from '/@/components/Table'; +import { rules} from '/@/utils/helper/validator'; +import { render } from '/@/utils/common/renderUtils'; +import { getWeekMonthQuarterYear } from '/@/utils'; +//列表数据 +export const columns: BasicColumn[] = [ + + { + title: 'SIM', + width: 100, + align: "center", + dataIndex: 'sim' + }, + { + title: '供热公司', + width: 120, + align: "center", + dataIndex: 'company' + }, + { + title: '热源站', + width: 120, + align: "center", + dataIndex: 'source' + }, + { + title: '换热站', + align: "center", + dataIndex: 'station' + }, + { + title: '一次网抽取', + width: 100, + children: [ + { + title: 'SIM', + width: 100, + align: "center", + dataIndex: 'onePipeSim' + }, + // { + // title: '供热公司', + // align: "center", + // dataIndex: 'oneCompany' + // }, + // { + // title: '热源站', + // align: "center", + // dataIndex: 'oneSource' + // }, + { + title: '站点', + align: "center", + dataIndex: 'oneStation' + }, + { + title: '类型', + width: 100, + align: "center", + dataIndex: 'onePipeType', + customRender: ({ record }) =>{ + if(record.onePipeType == '1'){ + return '一次网' + }else if(record.onePipeType == '2'){ + return '二次网' + }else{ + return '无' + } + } + }, + ] + }, + { + title: '二次网抽取', + width: 100, + children: [ + { + title: 'SIM', + width: 100, + align: "center", + dataIndex: 'twoPipeSim' + }, + // { + // title: '供热公司', + // align: "center", + // dataIndex: 'twoCompany' + // }, + // { + // title: '热源站', + // align: "center", + // dataIndex: 'twoSource' + // }, + { + title: '站点', + align: "center", + dataIndex: 'twoStation' + }, + { + title: '类型', + width: 100, + align: "center", + dataIndex: 'twoPipeType', + customRender: ({ record }) =>{ + if(record.twoPipeType == '1'){ + return '一次网' + }else if(record.twoPipeType == '2'){ + return '二次网' + }else{ + return '无' + } + } + }, + ] + }, + { + title: '是否生效', + width: 100, + align: "center", + dataIndex: 'flag', + customRender: ({ record }) =>{ + return record.flag ? (record.flag == 1 ? '是' : '否') : ''; + } + }, +]; + diff --git a/src/views/heating/extract/DataExtractConfigList.vue b/src/views/heating/extract/DataExtractConfigList.vue new file mode 100644 index 0000000..6fae6b9 --- /dev/null +++ b/src/views/heating/extract/DataExtractConfigList.vue @@ -0,0 +1,366 @@ + + + + + diff --git a/src/views/heating/extract/components/DataExtractConfigForm.vue b/src/views/heating/extract/components/DataExtractConfigForm.vue new file mode 100644 index 0000000..e174b2e --- /dev/null +++ b/src/views/heating/extract/components/DataExtractConfigForm.vue @@ -0,0 +1,176 @@ + + + + + diff --git a/src/views/heating/extract/components/DataExtractConfigModal.vue b/src/views/heating/extract/components/DataExtractConfigModal.vue new file mode 100644 index 0000000..e1129f6 --- /dev/null +++ b/src/views/heating/extract/components/DataExtractConfigModal.vue @@ -0,0 +1,77 @@ + + + + + + diff --git a/src/views/heating/Heatanalysis.api.ts b/src/views/heating/heatanalysis/Heatanalysis.api.ts similarity index 100% rename from src/views/heating/Heatanalysis.api.ts rename to src/views/heating/heatanalysis/Heatanalysis.api.ts diff --git a/src/views/heating/Heatanalysis.data.ts b/src/views/heating/heatanalysis/Heatanalysis.data.ts similarity index 100% rename from src/views/heating/Heatanalysis.data.ts rename to src/views/heating/heatanalysis/Heatanalysis.data.ts diff --git a/src/views/heating/HeatanalysisList.vue b/src/views/heating/heatanalysis/HeatanalysisList.vue similarity index 99% rename from src/views/heating/HeatanalysisList.vue rename to src/views/heating/heatanalysis/HeatanalysisList.vue index 159083e..c8c9abb 100644 --- a/src/views/heating/HeatanalysisList.vue +++ b/src/views/heating/heatanalysis/HeatanalysisList.vue @@ -33,7 +33,7 @@ {{item.stationName}} diff --git a/src/views/heating/HeatanalysisListModal.vue b/src/views/heating/heatanalysis/HeatanalysisListModal.vue similarity index 100% rename from src/views/heating/HeatanalysisListModal.vue rename to src/views/heating/heatanalysis/HeatanalysisListModal.vue diff --git a/src/views/heating/components/HeatanalysisForm.vue b/src/views/heating/heatanalysis/components/HeatanalysisForm.vue similarity index 100% rename from src/views/heating/components/HeatanalysisForm.vue rename to src/views/heating/heatanalysis/components/HeatanalysisForm.vue diff --git a/src/views/heating/components/HeatanalysisModal.vue b/src/views/heating/heatanalysis/components/HeatanalysisModal.vue similarity index 100% rename from src/views/heating/components/HeatanalysisModal.vue rename to src/views/heating/heatanalysis/components/HeatanalysisModal.vue