Commit 0a06d8f2 authored by neogcg's avatar neogcg

配置管理导出

parent afa22ecf
import request from '@/utils/request' import request from '@/utils/request'
const path = { const path = {
// 告警管理 // 告警管理
exportLeakyCable: 'sysMonitorAlarm/export', exportLeakyCable: 'sysMonitorAlarm/export',
exportConnet: 'sysConnectAlarm/export', exportConnet: 'sysConnectAlarm/export',
// 配置管理 // 配置管理
exportRailWay: "railWay/export",
exportSite: "site/export",
exportFsu: "fsu/export",
exportMonitorEquip: "monitorEquip/export",
exportLeaky: "leakyCable/export",
// 实时状态 // 实时状态
exportLeakyCableTime: 'sysLeakyCableStatus/export', exportLeakyCableTime: 'sysLeakyCableStatus/export',
exportConnetTime: 'sysDeviceStatus/export', exportConnetTime: 'sysDeviceStatus/export',
// 历史数据 // 历史数据
exportLeakyStatusHistory: 'sysHistoryMonitorStatus/export', exportLeakyStatusHistory: 'sysHistoryMonitorStatus/export',
exportLeakyMaintainHistory: 'sysHistoryMonitorMaintain/export', exportLeakyMaintainHistory: 'sysHistoryMonitorMaintain/export',
exportConnectStatusHistory: 'sysHistoryConnectStatus/export', exportConnectStatusHistory: 'sysHistoryConnectStatus/export',
exportConnectMaintainHistory: 'sysHistoryConnectMaintain/export', exportConnectMaintainHistory: 'sysHistoryConnectMaintain/export',
// 用户管理 // 用户管理
exportLog: 'sysLog/exportLog', exportLog: 'sysLog/exportLog',
} }
const blobConf = { responseType: 'blob' } const blobConf = { responseType: 'blob' }
...@@ -36,6 +41,23 @@ export function exportConnet() { ...@@ -36,6 +41,23 @@ export function exportConnet() {
return requestBlob(path.exportConnet, ...arguments) return requestBlob(path.exportConnet, ...arguments)
} }
export function exportRailWay() {
return requestBlob(path.exportRailWay, ...arguments)
}
export function exportSite() {
return requestBlob(path.exportSite, ...arguments)
}
export function exportFsu() {
return requestBlob(path.exportFsu, ...arguments)
}
export function exportMonitorEquip() {
return requestBlob(path.exportMonitorEquip, ...arguments)
}
export function exportLeaky() {
return requestBlob(path.exportLeaky, ...arguments)
}
export function exportLeakyCableTime() { export function exportLeakyCableTime() {
return requestBlob(path.exportLeakyCableTime, ...arguments) return requestBlob(path.exportLeakyCableTime, ...arguments)
} }
......
...@@ -84,6 +84,7 @@ ...@@ -84,6 +84,7 @@
import { cableTimeList } from '../api' import { cableTimeList } from '../api'
import { exportLeakyCable } from '@/api/export' import { exportLeakyCable } from '@/api/export'
import search from '@/views/monitor/leakageCable/components/search.vue' import search from '@/views/monitor/leakageCable/components/search.vue'
import download from '@/utils/download'
export default { export default {
data() { data() {
return { return {
......
...@@ -142,6 +142,8 @@ import { ...@@ -142,6 +142,8 @@ import {
selectForSite, selectForSite,
} from "../../api"; } from "../../api";
import { successAlert, warningAlert } from "@/utils/alert"; import { successAlert, warningAlert } from "@/utils/alert";
import download from "@/utils/download";
import { exportFsu } from "@/api/export";
export default { export default {
props: [], props: [],
components: {}, components: {},
...@@ -163,6 +165,7 @@ export default { ...@@ -163,6 +165,7 @@ export default {
ids: [], ids: [],
block: 0, block: 0,
istrue: 0, istrue: 0,
exids: [],
}; };
}, },
computed: {}, computed: {},
...@@ -202,7 +205,16 @@ export default { ...@@ -202,7 +205,16 @@ export default {
this.FSUForm = formInit(); this.FSUForm = formInit();
}, },
exportData() {}, exportData() {
fsulist({size:this.total}).then((res) => {
let list = res.records || [];
this.exids = list.map((i) => i.id);
});
exportFsu({ ids: this.exids }).then((res) => {
download(res, "vnd.ms-excel", `FSU表.xls`);
});
},
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val; this.multipleSelection = val;
......
...@@ -193,6 +193,8 @@ import { ...@@ -193,6 +193,8 @@ import {
} from "../../api"; } from "../../api";
import { cableTypeEnum } from "../../../maintain/api"; import { cableTypeEnum } from "../../../maintain/api";
import { successAlert, warningAlert } from "@/utils/alert"; import { successAlert, warningAlert } from "@/utils/alert";
import download from "@/utils/download";
import { exportLeaky } from "@/api/export";
export default { export default {
props: [], props: [],
components: {}, components: {},
...@@ -214,6 +216,7 @@ export default { ...@@ -214,6 +216,7 @@ export default {
ids: [], ids: [],
block: 0, block: 0,
istrue: 0, istrue: 0,
exids: [],
}; };
}, },
computed: {}, computed: {},
...@@ -263,7 +266,16 @@ export default { ...@@ -263,7 +266,16 @@ export default {
this.leakyCableForm = formInit(); this.leakyCableForm = formInit();
}, },
exportData() {}, exportData() {
leakyCablelist({size:this.total}).then((res) => {
let list = res.records || [];
this.exids = list.map((i) => i.id);
});
exportLeaky({ ids: this.exids }).then((res) => {
download(res, "vnd.ms-excel", `漏缆表.xls`);
});
},
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val; this.multipleSelection = val;
......
...@@ -149,7 +149,8 @@ import { ...@@ -149,7 +149,8 @@ import {
selectForFsu, selectForFsu,
} from "../../api"; } from "../../api";
import { successAlert, warningAlert } from "@/utils/alert"; import { successAlert, warningAlert } from "@/utils/alert";
import download from "@/utils/download";
import { exportMonitorEquip } from "@/api/export";
export default { export default {
props: [], props: [],
components: {}, components: {},
...@@ -169,6 +170,7 @@ export default { ...@@ -169,6 +170,7 @@ export default {
ids: [], ids: [],
block: 0, block: 0,
istrue: 0, istrue: 0,
exids: [],
}; };
}, },
computed: {}, computed: {},
...@@ -214,7 +216,16 @@ export default { ...@@ -214,7 +216,16 @@ export default {
this.monitorForm = formInit(); this.monitorForm = formInit();
}, },
exportData() {}, exportData() {
monitorEquiplist({size:this.total}).then((res) => {
let list = res.records || [];
this.exids = list.map((i) => i.id);
});
exportMonitorEquip({ ids: this.exids }).then((res) => {
download(res, "vnd.ms-excel", `监测设备表.xls`);
});
},
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val; this.multipleSelection = val;
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
> >
<el-button type="primary" @click="refresh()">刷新</el-button> <el-button type="primary" @click="refresh()">刷新</el-button>
<el-button type="primary" @click="block = !block">查询</el-button> <el-button type="primary" @click="block = !block">查询</el-button>
<el-button type="primary" @click="exportData">导出</el-button> <el-button type="primary" @click="exportData()">导出</el-button>
</div> </div>
</div> </div>
<el-form <el-form
...@@ -114,7 +114,9 @@ ...@@ -114,7 +114,9 @@
</template> </template>
<script> <script>
import { railWaylist, railWaydetail, railWaybatchDelete } from "../../api"; import { railWaylist, railWaydetail, railWaybatchDelete } from "../../api";
import { exportRailWay } from "@/api/export";
import { successAlert, warningAlert } from "@/utils/alert"; import { successAlert, warningAlert } from "@/utils/alert";
import download from "@/utils/download";
export default { export default {
props: [], props: [],
components: {}, components: {},
...@@ -132,6 +134,7 @@ export default { ...@@ -132,6 +134,7 @@ export default {
ids: [], ids: [],
block: 0, block: 0,
istrue: 0, istrue: 0,
exids: [],
}; };
}, },
computed: {}, computed: {},
...@@ -147,7 +150,7 @@ export default { ...@@ -147,7 +150,7 @@ export default {
railWaybatchDelete({ ids }).then((res) => { railWaybatchDelete({ ids }).then((res) => {
if (res.code == 200) { if (res.code == 200) {
successAlert("删除成功"); successAlert("删除成功");
this.getTableData(); this.getTableData();
} else { } else {
warningAlert("删除失败"); warningAlert("删除失败");
...@@ -166,7 +169,16 @@ export default { ...@@ -166,7 +169,16 @@ export default {
this.railData = formInit(); this.railData = formInit();
}, },
exportData() {}, exportData() {
railWaylist({size:this.total}).then((res) => {
let list = res.records || [];
this.exids = list.map((i) => i.id);
});
exportRailWay({ ids: this.exids }).then((res) => {
download(res, "vnd.ms-excel", `铁路线表.xls`);
});
},
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val; this.multipleSelection = val;
// console.log(val); // console.log(val);
...@@ -192,6 +204,7 @@ export default { ...@@ -192,6 +204,7 @@ export default {
let list = res.records || []; let list = res.records || [];
this.tableData = list; this.tableData = list;
this.total = res.total; this.total = res.total;
if (this.istrue == 1) { if (this.istrue == 1) {
if (this.tableData.length) { if (this.tableData.length) {
successAlert("查询成功"); successAlert("查询成功");
......
...@@ -122,7 +122,8 @@ ...@@ -122,7 +122,8 @@
<script> <script>
import { sitelist, sitebatchDelete, sitedetail, railWaylist } from "../../api"; import { sitelist, sitebatchDelete, sitedetail, railWaylist } from "../../api";
import { successAlert, warningAlert } from "@/utils/alert"; import { successAlert, warningAlert } from "@/utils/alert";
import download from "@/utils/download";
import { exportSite } from "@/api/export";
export default { export default {
props: [], props: [],
components: {}, components: {},
...@@ -142,6 +143,7 @@ export default { ...@@ -142,6 +143,7 @@ export default {
ids: [], ids: [],
block: 0, block: 0,
istrue: 0, istrue: 0,
exids: [],
}; };
}, },
computed: {}, computed: {},
...@@ -175,7 +177,16 @@ export default { ...@@ -175,7 +177,16 @@ export default {
reset() { reset() {
this.siteForm = formInit(); this.siteForm = formInit();
}, },
exportData() {}, exportData() {
sitelist({size:this.total}).then((res) => {
let list = res.records || [];
this.exids = list.map((i) => i.id);
});
exportSite({ ids: this.exids }).then((res) => {
download(res, "vnd.ms-excel", `站点表.xls`);
});
},
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val; this.multipleSelection = val;
this.ids = this.multipleSelection.map((i) => i.id); this.ids = this.multipleSelection.map((i) => i.id);
......
...@@ -43,10 +43,10 @@ ...@@ -43,10 +43,10 @@
</template> </template>
<script> <script>
import { exportLog, logList } from '../api' import { logList } from '../api';
import search from './components/search.vue' import search from './components/search.vue';
import { exportLog } from '@/api/export' import { exportLog } from '@/api/export';
import download from '@/utils/download' import download from '@/utils/download';
export default { export default {
data() { data() {
return { return {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment