|
|
@@ -1,36 +1,403 @@
|
|
|
<template>
|
|
|
- <div
|
|
|
- class="main-content"
|
|
|
- :style="{ width: '100%', padding: '20px 30px', fontSize: '15px' }"
|
|
|
- >
|
|
|
- <el-tabs v-model="activeName" @tab-click="handleClick">
|
|
|
- <el-tab-pane label="变电站负荷数据" name="stationLoad"
|
|
|
- >
|
|
|
- <stationLoadList/>
|
|
|
- </el-tab-pane
|
|
|
+ <div class="main-content" :style="{ width: '100%', padding: '20px 30px', fontSize: '15px' }">
|
|
|
+ <!-- 列表页 -->
|
|
|
+ <template v-if="!addOrUpdateOrDetailFlag">
|
|
|
+ <el-form
|
|
|
+ class="center-form-pv"
|
|
|
+ :style="{
|
|
|
+ border: '0px solid #fff',
|
|
|
+ padding: '10px',
|
|
|
+ margin: '0',
|
|
|
+ flexWrap: 'wrap',
|
|
|
+ background: '#ffffff',
|
|
|
+ display: 'flex',
|
|
|
+ width: '100%',
|
|
|
+ }"
|
|
|
+ :inline="true"
|
|
|
+ :model="searchForm"
|
|
|
>
|
|
|
- <el-tab-pane label="线路负荷数据" name="lineLoad"
|
|
|
- >线路负荷数据</el-tab-pane
|
|
|
+ <el-row
|
|
|
+ :style="{
|
|
|
+ padding: '10px',
|
|
|
+ alignItems: 'center',
|
|
|
+ flexWrap: 'wrap',
|
|
|
+ background: 'none',
|
|
|
+ display: 'flex',
|
|
|
+ }"
|
|
|
+ >
|
|
|
+ <div
|
|
|
+ :style="{
|
|
|
+ alignItems: 'center',
|
|
|
+ margin: '0 10px 0 0',
|
|
|
+ display: 'flex',
|
|
|
+ }"
|
|
|
+ >
|
|
|
+ <label
|
|
|
+ :style="{
|
|
|
+ margin: '0 10px 0 0',
|
|
|
+ whiteSpace: 'nowrap',
|
|
|
+ color: '#666',
|
|
|
+ display: 'inline-block',
|
|
|
+ lineHeight: '40px',
|
|
|
+ fontSize: 'inherit',
|
|
|
+ fontWeight: '500',
|
|
|
+ height: '40px',
|
|
|
+ }"
|
|
|
+ class="item-label"
|
|
|
+ >变电站名称</label
|
|
|
+ >
|
|
|
+ <el-input v-model="searchForm.subName" placeholder="变电站名称" @keydown.enter.native="search()" clearable></el-input>
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ :style="{
|
|
|
+ alignItems: 'center',
|
|
|
+ margin: '0 10px 0 0',
|
|
|
+ display: 'flex',
|
|
|
+ }"
|
|
|
+ >
|
|
|
+ <label
|
|
|
+ :style="{
|
|
|
+ margin: '0 10px 0 0',
|
|
|
+ whiteSpace: 'nowrap',
|
|
|
+ color: '#666',
|
|
|
+ display: 'inline-block',
|
|
|
+ lineHeight: '40px',
|
|
|
+ fontSize: 'inherit',
|
|
|
+ fontWeight: '500',
|
|
|
+ height: '40px',
|
|
|
+ }"
|
|
|
+ class="item-label"
|
|
|
+ >归属县旗</label
|
|
|
+ >
|
|
|
+ <el-select
|
|
|
+ style="width: 100%"
|
|
|
+ v-model="searchForm.compNm"
|
|
|
+ placeholder="归属县旗名称"
|
|
|
+ @keydown.enter.native="search()"
|
|
|
+ clearable
|
|
|
+ >
|
|
|
+ <el-option v-for="item in compList" :key="item.value" :label="item.label" :value="item.label" />
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <el-button class="search" type="success" @click="search()">
|
|
|
+ <span
|
|
|
+ class="icon iconfont icon-fangdajing07"
|
|
|
+ :style="{
|
|
|
+ margin: '0 2px',
|
|
|
+ fontSize: '16px',
|
|
|
+ color: '#fff',
|
|
|
+ display: 'none',
|
|
|
+ height: '40px',
|
|
|
+ }"
|
|
|
+ ></span>
|
|
|
+ 搜索
|
|
|
+ </el-button>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row
|
|
|
+ class="actions"
|
|
|
+ :style="{
|
|
|
+ padding: '10px',
|
|
|
+ margin: '0px 0',
|
|
|
+ flexWrap: 'wrap',
|
|
|
+ background: 'none',
|
|
|
+ display: 'flex',
|
|
|
+ }"
|
|
|
+ >
|
|
|
+ <el-button class="del" :disabled="dataListSelections.length ? false : true" type="danger" @click="deleteHandler()">
|
|
|
+ <span
|
|
|
+ class="icon iconfont icon-xihuan"
|
|
|
+ :style="{
|
|
|
+ margin: '0 2px',
|
|
|
+ fontSize: '14px',
|
|
|
+ color: '#fff',
|
|
|
+ display: 'none',
|
|
|
+ height: '34px',
|
|
|
+ }"
|
|
|
+ ></span>
|
|
|
+ 批量删除
|
|
|
+ </el-button>
|
|
|
+ <el-button class="add" type="danger" @click="importHandler()">
|
|
|
+ <span
|
|
|
+ class="icon iconfont icon-xihuan"
|
|
|
+ :style="{
|
|
|
+ margin: '0 2px',
|
|
|
+ fontSize: '14px',
|
|
|
+ color: '#fff',
|
|
|
+ display: 'none',
|
|
|
+ height: '34px',
|
|
|
+ }"
|
|
|
+ ></span>
|
|
|
+ 导入
|
|
|
+ </el-button>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ <div
|
|
|
+ :style="{
|
|
|
+ border: '0px solid #fff',
|
|
|
+ width: '100%',
|
|
|
+ padding: '0 20px 20px',
|
|
|
+ fontSize: '14px',
|
|
|
+ color: '#000',
|
|
|
+ background: '#fff',
|
|
|
+ }"
|
|
|
>
|
|
|
- </el-tabs>
|
|
|
+ <el-table
|
|
|
+ class="tables"
|
|
|
+ :stripe="false"
|
|
|
+ :style="{
|
|
|
+ padding: '0px 0',
|
|
|
+ borderColor: '#f0f0f0',
|
|
|
+ borderRadius: '0',
|
|
|
+ borderWidth: '0px 0 0 1px',
|
|
|
+ background: '#fff',
|
|
|
+ width: '100%',
|
|
|
+ fontSize: 'inherit',
|
|
|
+ borderStyle: 'solid',
|
|
|
+ }"
|
|
|
+ :border="true"
|
|
|
+ :data="dataList"
|
|
|
+ v-loading="dataListLoading"
|
|
|
+ @selection-change="selectionChangeHandler"
|
|
|
+ >
|
|
|
+ <el-table-column :resizable="true" type="selection" align="center" width="50"></el-table-column>
|
|
|
+ <el-table-column :resizable="true" :sortable="true" label="序号" type="index" width="50" />
|
|
|
+
|
|
|
+ <el-table-column :resizable="true" :sortable="true" prop="subNm" label="变电站名称">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.subNm }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column :resizable="true" :sortable="true" prop="compNm" label="归属旗县">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.compNm }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column :resizable="true" :sortable="true" prop="voltageLevel" label="电压等级">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.voltageLevel }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column :resizable="true" :sortable="true" prop="mainNum" label="主变台数">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.mainNum }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column :resizable="true" :sortable="true" prop="mainCapacity" label="主变容量(MVA)">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.mainCapacity }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column :resizable="true" :sortable="true" prop="dataDate" label="采集日期" />
|
|
|
+ <el-table-column :resizable="true" :sortable="true" prop="temperature" label="当日温度(℃)">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.temperature }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column :resizable="true" :sortable="true" prop="peakLoad" label="最大负荷(MW)" />
|
|
|
+ <el-table-column :resizable="true" :sortable="true" prop="baseLoad" label="基础负荷(MW)" />
|
|
|
+ <el-table-column :resizable="true" :sortable="true" prop="electricHeatingLoad" label="电采暖负荷(MW)" />
|
|
|
+ <el-table-column :resizable="true" :sortable="true" prop="usersNum" label="用户数" />
|
|
|
+ <el-table-column :resizable="true" :sortable="true" prop="pingfangUsers" label="平房区用户数" />
|
|
|
+ <el-table-column :resizable="true" :sortable="true" prop="electricHeatingUsers" label="平房区接入电暖用户数" />
|
|
|
+ <el-table-column :resizable="true" :sortable="true" prop="pingfangElectricHeatingCapacity" label="平房区已接入电采暖容量(MWA)" />
|
|
|
+ <el-table-column width="120" label="操作">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button class="view" type="success" @click="addOrUpdateHandler(scope.row.id, 'view')">
|
|
|
+ <span
|
|
|
+ class="icon iconfont icon-xihuan"
|
|
|
+ :style="{
|
|
|
+ margin: '0 2px',
|
|
|
+ fontSize: '14px',
|
|
|
+ color: '#fff',
|
|
|
+ display: 'none',
|
|
|
+ height: '40px',
|
|
|
+ }"
|
|
|
+ ></span>
|
|
|
+ 明细
|
|
|
+ </el-button>
|
|
|
+ <el-button class="del" type="primary" @click="deleteHandler(scope.row.id)">
|
|
|
+ <span
|
|
|
+ class="icon iconfont icon-xihuan"
|
|
|
+ :style="{
|
|
|
+ margin: '0 2px',
|
|
|
+ fontSize: '14px',
|
|
|
+ color: '#fff',
|
|
|
+ display: 'none',
|
|
|
+ height: '40px',
|
|
|
+ }"
|
|
|
+ ></span>
|
|
|
+ 删除
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ <el-pagination
|
|
|
+ @size-change="sizeChangeHandle"
|
|
|
+ @current-change="currentChangeHandle"
|
|
|
+ :current-page="pageIndex"
|
|
|
+ background
|
|
|
+ :page-sizes="[10, 50, 100, 200]"
|
|
|
+ :page-size="pageSize"
|
|
|
+ :layout="layouts.join()"
|
|
|
+ :total="totalPage"
|
|
|
+ prev-text="< "
|
|
|
+ next-text="> "
|
|
|
+ :hide-on-single-page="false"
|
|
|
+ :style="{
|
|
|
+ padding: '0 20px 20px',
|
|
|
+ margin: '0px auto',
|
|
|
+ whiteSpace: 'nowrap',
|
|
|
+ color: '#333',
|
|
|
+ textAlign: 'left',
|
|
|
+ background: '#fff',
|
|
|
+ width: '100%',
|
|
|
+ fontSize: 'inherit',
|
|
|
+ position: 'relative',
|
|
|
+ fontWeight: '500',
|
|
|
+ }"
|
|
|
+ ></el-pagination>
|
|
|
+ </template>
|
|
|
+ <!-- 添加/修改页面 将父组件的search方法传递给子组件-->
|
|
|
+ <add-or-update v-if="addOrUpdateOrDetailFlag" :parent="this" ref="addOrUpdate"></add-or-update>
|
|
|
+ <!-- 上传文件弹窗 -->
|
|
|
+ <upload-modal :parent="this" ref="uploadModal"></upload-modal>
|
|
|
</div>
|
|
|
</template>
|
|
|
+
|
|
|
<script>
|
|
|
-import stationLoadList from "@/views/modules/load-data/components/stationLoadList.vue";
|
|
|
+import AddOrUpdate from './components/add-or-update.vue';
|
|
|
+import uploadModal from './components/uploadModal.vue';
|
|
|
export default {
|
|
|
+ components: {
|
|
|
+ AddOrUpdate,
|
|
|
+ uploadModal,
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
- activeName: "stationLoad",
|
|
|
+ searchForm: {
|
|
|
+ subNm: '',
|
|
|
+ compNm: '',
|
|
|
+ },
|
|
|
+ dataList: [],
|
|
|
+ pageIndex: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ totalPage: 0,
|
|
|
+ dataListLoading: false,
|
|
|
+ dataListSelections: [],
|
|
|
+ layouts: ['prev', 'pager', 'next', 'sizes'],
|
|
|
+ compList: [],
|
|
|
+ addOrUpdateOrDetailFlag: false,
|
|
|
};
|
|
|
},
|
|
|
- created() {},
|
|
|
- mounted() {},
|
|
|
- components: {
|
|
|
- stationLoadList,
|
|
|
+ created() {
|
|
|
+ this.getCompList();
|
|
|
+ this.getDataList();
|
|
|
},
|
|
|
methods: {
|
|
|
- handleClick(tab) {
|
|
|
- console.log(tab);
|
|
|
+ // 获取公司列表
|
|
|
+ async getCompList() {
|
|
|
+ this.compList = [];
|
|
|
+ const { data } = await this.$http({
|
|
|
+ url: `/company/lists`,
|
|
|
+ method: 'get',
|
|
|
+ });
|
|
|
+ if (data && data.code === 0) {
|
|
|
+ this.compList = data.data.map(item => ({
|
|
|
+ label: item.compName,
|
|
|
+ value: String(item.id),
|
|
|
+ }));
|
|
|
+ }
|
|
|
+ },
|
|
|
+ importHandler() {
|
|
|
+ this.$refs.uploadModal.openDialog();
|
|
|
+ },
|
|
|
+ search() {
|
|
|
+ this.pageIndex = 1;
|
|
|
+ this.getDataList();
|
|
|
+ },
|
|
|
+ // 获取数据列表
|
|
|
+ getDataList() {
|
|
|
+ this.dataListLoading = true;
|
|
|
+ let params = {
|
|
|
+ page: this.pageIndex,
|
|
|
+ limit: this.pageSize,
|
|
|
+ sort: 'id',
|
|
|
+ order: 'desc',
|
|
|
+ };
|
|
|
+ if (this.searchForm.subNm != '' && this.searchForm.subNm != undefined) {
|
|
|
+ params['subNm'] = '%' + this.searchForm.subNm + '%';
|
|
|
+ }
|
|
|
+ if (this.searchForm.compNm != '' && this.searchForm.compNm != undefined) {
|
|
|
+ params['compNm'] = '%' + this.searchForm.compNm + '%';
|
|
|
+ }
|
|
|
+ this.$http({
|
|
|
+ url: '/subLoad/page',
|
|
|
+ method: 'get',
|
|
|
+ params: params,
|
|
|
+ }).then(({ data }) => {
|
|
|
+ if (data && data.code === 0) {
|
|
|
+ this.dataList = data.data.list;
|
|
|
+ this.totalPage = data.data.total;
|
|
|
+ } else {
|
|
|
+ this.dataList = [];
|
|
|
+ this.totalPage = 0;
|
|
|
+ }
|
|
|
+ this.dataListLoading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 每页数
|
|
|
+ sizeChangeHandle(val) {
|
|
|
+ this.pageSize = val;
|
|
|
+ this.pageIndex = 1;
|
|
|
+ this.getDataList();
|
|
|
+ },
|
|
|
+ // 当前页
|
|
|
+ currentChangeHandle(val) {
|
|
|
+ this.pageIndex = val;
|
|
|
+ this.getDataList();
|
|
|
+ },
|
|
|
+ // 多选
|
|
|
+ selectionChangeHandler(val) {
|
|
|
+ this.dataListSelections = val;
|
|
|
+ },
|
|
|
+ // 添加/修改
|
|
|
+ addOrUpdateHandler(id, type) {
|
|
|
+ this.addOrUpdateOrDetailFlag = true;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.addOrUpdate.openDialog(id, type);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 删除
|
|
|
+ async deleteHandler(id) {
|
|
|
+ var ids = id
|
|
|
+ ? [Number(id)]
|
|
|
+ : this.dataListSelections.map(item => {
|
|
|
+ return Number(item.id);
|
|
|
+ });
|
|
|
+ await this.$confirm(`确定进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning',
|
|
|
+ }).then(async () => {
|
|
|
+ await this.$http({
|
|
|
+ url: 'subLoad/delete',
|
|
|
+ method: 'post',
|
|
|
+ data: ids,
|
|
|
+ }).then(async ({ data }) => {
|
|
|
+ if (data && data.code === 0) {
|
|
|
+ this.$message({
|
|
|
+ message: '操作成功',
|
|
|
+ type: 'success',
|
|
|
+ });
|
|
|
+ this.search();
|
|
|
+ } else {
|
|
|
+ this.$message.error(data.msg);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
},
|
|
|
},
|
|
|
};
|
|
|
@@ -476,12 +843,7 @@ export default {
|
|
|
position: relative;
|
|
|
}
|
|
|
|
|
|
-.main-content
|
|
|
- .el-pagination
|
|
|
- ::v-deep
|
|
|
- .el-pagination__sizes
|
|
|
- .el-input
|
|
|
- .el-input__inner {
|
|
|
+.main-content .el-pagination ::v-deep .el-pagination__sizes .el-input .el-input__inner {
|
|
|
border: 1px solid #dcdfe6;
|
|
|
cursor: pointer;
|
|
|
padding: 0 25px 0 8px;
|
|
|
@@ -497,25 +859,14 @@ export default {
|
|
|
height: 28px;
|
|
|
}
|
|
|
|
|
|
-.main-content
|
|
|
- .el-pagination
|
|
|
- ::v-deep
|
|
|
- .el-pagination__sizes
|
|
|
- .el-input
|
|
|
- span.el-input__suffix {
|
|
|
+.main-content .el-pagination ::v-deep .el-pagination__sizes .el-input span.el-input__suffix {
|
|
|
top: 0;
|
|
|
position: absolute;
|
|
|
right: 0;
|
|
|
height: 100%;
|
|
|
}
|
|
|
|
|
|
-.main-content
|
|
|
- .el-pagination
|
|
|
- ::v-deep
|
|
|
- .el-pagination__sizes
|
|
|
- .el-input
|
|
|
- .el-input__suffix
|
|
|
- .el-select__caret {
|
|
|
+.main-content .el-pagination ::v-deep .el-pagination__sizes .el-input .el-input__suffix .el-select__caret {
|
|
|
cursor: pointer;
|
|
|
color: #c0c4cc;
|
|
|
width: 25px;
|
|
|
@@ -547,12 +898,7 @@ export default {
|
|
|
height: 28px;
|
|
|
}
|
|
|
|
|
|
-.main-content
|
|
|
- .el-pagination
|
|
|
- ::v-deep
|
|
|
- .el-pagination__jump
|
|
|
- .el-input
|
|
|
- .el-input__inner {
|
|
|
+.main-content .el-pagination ::v-deep .el-pagination__jump .el-input .el-input__inner {
|
|
|
border: 1px solid #dcdfe6;
|
|
|
cursor: pointer;
|
|
|
padding: 0 3px;
|