Jelajahi Sumber

2022-11-02 update

1. 调整 admlist / modelpower / projectstudy / manufacturer / windsubstation / realDatabaseConfig / meterpoint / equipmentmodel  的表格样式及居中统一
moccus 2 tahun lalu
induk
melakukan
e79d719b4d

+ 3 - 3
src/views/meterpoint/index.vue

@@ -23,9 +23,9 @@
 					<ExportExcel :exportList="templateExcel" :useType="'template'" partsName="电计量模板"></ExportExcel>
 				</div>
 			</div>
-			<el-table ref="tableSort" v-loading="listLoading" :data="list" :element-loading-text="elementLoadingText"
-				:height="height" @selection-change="setSelectRows">
-				<el-table-column show-overflow-tooltip type="selection" width="40"></el-table-column>
+			<el-table header-cell-class-name="table_header_style" border ref="tableSort" v-loading="listLoading" :data="list"
+				:element-loading-text="elementLoadingText" :height="height" @selection-change="setSelectRows">
+				<el-table-column show-overflow-tooltip type="selection" align="center" width="40"></el-table-column>
 				<el-table-column show-overflow-tooltip label="id" prop="id" align="center" sortable></el-table-column>
 				<el-table-column show-overflow-tooltip label="编码" prop="code" align="center" sortable></el-table-column>
 				<el-table-column show-overflow-tooltip label="名称" prop="name" align="center" sortable></el-table-column>

+ 3 - 3
src/views/realDatabaseConfig/index.vue

@@ -23,9 +23,9 @@
 					<ExportExcel :exportList="templateExcel" :useType="'template'" partsName="实时数据库模板"></ExportExcel>
 				</div>
 			</div>
-			<el-table ref="tableSort" v-loading="listLoading" :data="list" :element-loading-text="elementLoadingText"
-				:height="height" @selection-change="setSelectRows">
-				<el-table-column show-overflow-tooltip type="selection" width="40"></el-table-column>
+			<el-table header-cell-class-name="table_header_style" border ref="tableSort" v-loading="listLoading" :data="list"
+				:element-loading-text="elementLoadingText" :height="height" @selection-change="setSelectRows">
+				<el-table-column show-overflow-tooltip type="selection" align="center" width="40"></el-table-column>
 				<el-table-column show-overflow-tooltip label="id" prop="id" align="center" sortable></el-table-column>
 				<el-table-column show-overflow-tooltip label="服务名" prop="surname" align="center" sortable></el-table-column>
 				<el-table-column show-overflow-tooltip label="服务名历史" prop="namehist" align="center" sortable></el-table-column>

+ 4 - 4
src/views/stationConfiguration/admlist/index.vue

@@ -40,8 +40,8 @@
 					<!-- <ExportExcel :exportList="templateExcel" :useType="'template'" partsName="设备类型模板"></ExportExcel> -->
 				</div>
 			</div>
-			<el-table ref="tableSort" v-loading="listLoading" :data="list" :element-loading-text="elementLoadingText"
-				:height="height" @selection-change="setSelectRows">
+			<el-table header-cell-class-name="table_header_style" border ref="tableSort" v-loading="listLoading" :data="list"
+				:element-loading-text="elementLoadingText" :height="height" @selection-change="setSelectRows">
 				<!-- <el-table-column show-overflow-tooltip type="selection" width="40"></el-table-column> -->
 				<el-table-column show-overflow-tooltip label="id" prop="id" align="center" sortable></el-table-column>
 				<el-table-column show-overflow-tooltip label="编号" prop="code" align="center" sortable></el-table-column>
@@ -136,10 +136,10 @@ export default {
 				if (res.data) {
 					this.companyId = ''
 					this.companyList = res.data.records
-					if(this.companyList.length){
+					if (this.companyList.length) {
 						this.companyId = this.companyList[0].id
 						this.getRegionAndStation(this.companyId)
-					}else{
+					} else {
 						this.getRegionAndStation('')
 					}
 					this.fetchData()

+ 232 - 232
src/views/stationConfiguration/equipmentmodel/index.vue

@@ -1,65 +1,65 @@
 <template>
-  <div class="table-container">
-    <vab-query-form>
-      <div class="title">
-        <div class="left">
-          <div class="left-item">
-            <div style="width: 70px;">名称:</div>
-            <el-input v-model="fuzzyQuery_name" placeholder="请输入" clearable />
-          </div>
-          <el-button icon="el-icon-search" type="primary" native-type="submit" @click="handleQuery">
-            查询
-          </el-button>
-        </div>
-        <div class="right">
-          <el-button icon="el-icon-plus" type="primary" @click="handleAdd">
-            添加
-          </el-button>
-          <el-button icon="el-icon-delete" type="danger" @click="handleDelete">
-            删除
-          </el-button>
-          <UploadExcel style="margin-left: 10px;" @getResult="getMyExcelData"></UploadExcel>
-          <ExportExcel :exportList="exportExcel" :useType="'export'" partsName="设备型号"></ExportExcel>
-          <ExportExcel :exportList="templateExcel" :useType="'template'" partsName="设备型号模板"></ExportExcel>
-        </div>
-      </div>
-      <el-table ref="tableSort" v-loading="listLoading" :data="list" :element-loading-text="elementLoadingText"
-        :height="height" @selection-change="setSelectRows">
-        <el-table-column show-overflow-tooltip type="selection" width="40"></el-table-column>
-        <el-table-column show-overflow-tooltip label="id" prop="id" align="center" sortable></el-table-column>
-        <el-table-column show-overflow-tooltip label="编码" prop="code" align="center" sortable></el-table-column>
-        <el-table-column show-overflow-tooltip label="名称" prop="name" align="center" sortable></el-table-column>
-        <el-table-column show-overflow-tooltip label="描述" prop="description" align="center" sortable></el-table-column>
-        <el-table-column show-overflow-tooltip label="容量" prop="powerproduction" align="center" sortable>
-        </el-table-column>
-        <el-table-column show-overflow-tooltip label="厂商编号" prop="windturbinemanufacturerid" align="center" sortable>
-        </el-table-column>
-        <el-table-column show-overflow-tooltip label="图片" prop="photo" align="center" sortable>
-        </el-table-column>
-        <el-table-column show-overflow-tooltip label="传输总发电量单位" prop="unit" align="center" sortable></el-table-column>
-        <el-table-column show-overflow-tooltip label="切入风速" prop="cutinwindspeed" align="center" sortable>
-        </el-table-column>
-        <el-table-column show-overflow-tooltip label="额定风速" prop="ratedwindspeed" align="center" sortable>
-        </el-table-column>
-        <el-table-column show-overflow-tooltip label="切出风速" prop="cutoutwindspeed" align="center" sortable>
-        </el-table-column>
-        <el-table-column show-overflow-tooltip label="叶片切入面积" prop="sweptarea" align="center" sortable>
-        </el-table-column>
-        <el-table-column show-overflow-tooltip label="设备类别" prop="equipmentcategory" align="center" sortable>
-        </el-table-column>
-        <el-table-column show-overflow-tooltip label="操作" width="100px" fixed="right">
-          <template #default="{ row }">
-            <el-button type="text" @click="handleEdit(row)">编辑</el-button>
-            <el-button type="text" @click="handleDelete(row)">删除</el-button>
-          </template>
-        </el-table-column>
-      </el-table>
-      <el-pagination :background="background" :current-page="queryForm.pageNo" :layout="layout"
-        :page-size="queryForm.pageSize" :total="total" @current-change="handleCurrentChange"
-        @size-change="handleSizeChange"></el-pagination>
-      <table-edit ref="edit" :options="options" :stationList="stationList" @save-success="fetchData"></table-edit>
-    </vab-query-form>
-  </div>
+	<div class="table-container">
+		<vab-query-form>
+			<div class="title">
+				<div class="left">
+					<div class="left-item">
+						<div style="width: 70px;">名称:</div>
+						<el-input v-model="fuzzyQuery_name" placeholder="请输入" clearable />
+					</div>
+					<el-button icon="el-icon-search" type="primary" native-type="submit" @click="handleQuery">
+						查询
+					</el-button>
+				</div>
+				<div class="right">
+					<el-button icon="el-icon-plus" type="primary" @click="handleAdd">
+						添加
+					</el-button>
+					<el-button icon="el-icon-delete" type="danger" @click="handleDelete">
+						删除
+					</el-button>
+					<UploadExcel style="margin-left: 10px;" @getResult="getMyExcelData"></UploadExcel>
+					<ExportExcel :exportList="exportExcel" :useType="'export'" partsName="设备型号"></ExportExcel>
+					<ExportExcel :exportList="templateExcel" :useType="'template'" partsName="设备型号模板"></ExportExcel>
+				</div>
+			</div>
+			<el-table header-cell-class-name="table_header_style" border ref="tableSort" v-loading="listLoading" :data="list"
+				:element-loading-text="elementLoadingText" :height="height" @selection-change="setSelectRows">
+				<el-table-column show-overflow-tooltip type="selection" align="center" width="40"></el-table-column>
+				<el-table-column show-overflow-tooltip label="id" prop="id" align="center" sortable></el-table-column>
+				<el-table-column show-overflow-tooltip label="编码" prop="code" align="center" sortable></el-table-column>
+				<el-table-column show-overflow-tooltip label="名称" prop="name" align="center" sortable></el-table-column>
+				<el-table-column show-overflow-tooltip label="描述" prop="description" align="center" sortable></el-table-column>
+				<el-table-column show-overflow-tooltip label="容量" prop="powerproduction" align="center" sortable>
+				</el-table-column>
+				<el-table-column show-overflow-tooltip label="厂商编号" prop="windturbinemanufacturerid" align="center" sortable>
+				</el-table-column>
+				<el-table-column show-overflow-tooltip label="图片" prop="photo" align="center" sortable>
+				</el-table-column>
+				<el-table-column show-overflow-tooltip label="传输总发电量单位" prop="unit" align="center" sortable></el-table-column>
+				<el-table-column show-overflow-tooltip label="切入风速" prop="cutinwindspeed" align="center" sortable>
+				</el-table-column>
+				<el-table-column show-overflow-tooltip label="额定风速" prop="ratedwindspeed" align="center" sortable>
+				</el-table-column>
+				<el-table-column show-overflow-tooltip label="切出风速" prop="cutoutwindspeed" align="center" sortable>
+				</el-table-column>
+				<el-table-column show-overflow-tooltip label="叶片切入面积" prop="sweptarea" align="center" sortable>
+				</el-table-column>
+				<el-table-column show-overflow-tooltip label="设备类别" prop="equipmentcategory" align="center" sortable>
+				</el-table-column>
+				<el-table-column show-overflow-tooltip label="操作" width="100px" fixed="right">
+					<template #default="{ row }">
+						<el-button type="text" @click="handleEdit(row)">编辑</el-button>
+						<el-button type="text" @click="handleDelete(row)">删除</el-button>
+					</template>
+				</el-table-column>
+			</el-table>
+			<el-pagination :background="background" :current-page="queryForm.pageNo" :layout="layout"
+				:page-size="queryForm.pageSize" :total="total" @current-change="handleCurrentChange"
+				@size-change="handleSizeChange"></el-pagination>
+			<table-edit ref="edit" :options="options" :stationList="stationList" @save-success="fetchData"></table-edit>
+		</vab-query-form>
+	</div>
 </template>
 <script>
 import UploadExcel from '@/components/UploadExcel/index'
@@ -67,184 +67,184 @@ import ExportExcel from '@/components/ExportExcel/index'
 import api from '@/api/station'
 import TableEdit from './components/TableEdit'
 export default {
-  components: {
-    UploadExcel,
-    ExportExcel,
-    TableEdit,
-  },
-  data() {
-    return {
-      fuzzyQuery_name: '',
-      listLoading: true,
-      list: [],
-      options: [],
-      exportExcel: [],
-      templateExcel: [],
-      elementLoadingText: '正在加载...',
-      selectRows: '',
-      layout: 'total, sizes, prev, pager, next, jumper',
-      total: 0,
-      background: true,
-      exportList: [],
-      queryForm: {
-        pageNo: 1,
-        pageSize: 20,
-      },
-      stationList: [],
-      selectValue: ''
-    };
-  },
-  computed: {
-    height() {
-      return this.$baseTableHeight() + 50
-    },
-  },
-  created() {
-    // this.getStation()
-    this.fetchData()
-  },
-  methods: {
-    handleQuery() {
-      this.queryForm.pageNo = 1
-      this.fetchData()
-    },
-    getMyExcelData(val) {
-      val.forEach(item => {
-        api.addEquipmentmodel(item).then(res => {
-          if (res.code == 200) {
-            this.$message({
-              type: 'success',
-              message: '添加成功!'
-            });
-            this.fetchData()
-          }
-        })
-      })
-    },
-    getStation() {
-      api.windpowerstationList({
-        id: '',
-        name: '',
-        companyid: '',
-        pageNum: 1,
-        pageSize: 1000,
-      }).then(res => {
-        if (res.data) {
-          this.listLoading = false
-          this.stationList = res.data.records
-        }
-      })
-    },
-    fetchData() {
-      api.equipmentmodel({
-        name: this.fuzzyQuery_name,
-        pageNum: this.queryForm.pageNo,
-        pageSize: this.queryForm.pageSize,
-      }).then(res => {
-        if (res.data) {
-          this.listLoading = false
-          this.total = res.data.total
-          this.list = res.data.records
-          this.templateExcel = [
-            {
-              id: '',
-              code: '',
-              name: '',
-              description: '',
-              powerproduction: '',
-              windturbinemanufacturerid: '',
-              photo: '',
-              unit: '',
-              cutinwindspeed: '',
-              ratedwindspeed: '',
-              cutoutwindspeed: '',
-              sweptarea: '',
-              equipmentcategory: '',
-            }
-          ]
-          // 导出
-          let exportExcel = []
-          res.data.records.forEach(item => {
-            exportExcel.push({
-              id: item.id,
-              code: item.code,
-              name: item.name,
-              description: item.description,
-              powerproduction: item.powerproduction,
-              windturbinemanufacturerid: item.windturbinemanufacturerid,
-              photo: item.photo,
-              unit: item.unit,
-              cutinwindspeed: item.cutinwindspeed,
-              ratedwindspeed: item.ratedwindspeed,
-              cutoutwindspeed: item.cutoutwindspeed,
-              sweptarea: item.sweptarea,
-              equipmentcategory: item.equipmentcategory,
-            })
-          })
-          this.exportExcel = exportExcel
-        }
-      })
-    },
-    handleSizeChange(val) {
-      this.queryForm.pageSize = val
-      this.fetchData()
-    },
-    handleCurrentChange(val) {
-      this.queryForm.pageNo = val
-      this.fetchData()
-    },
-    handleAdd() {
-      this.$refs['edit'].showEdit()
-    },
-    handleEdit(row) {
-      this.$refs['edit'].showEdit(row)
-    },
-    handleDelete(row) {
-      if (row.id || this.selectRows.length > 0) {
-        this.$baseConfirm('你确定要删除吗', null, async () => {
-          let ids = ''
-          if (this.selectRows.length > 0) {
-            ids = this.selectRows.map((item) => item.id).join()
-          }
-          api.deleteEquipmentmodel({
-            id: row.id || ids
-          }).then(res => {
-            if (res.data) {
-              this.$baseMessage('删除成功', 'success')
-              this.fetchData()
-            }
-          })
-        })
-      } else {
-        this.$baseMessage('未选中任何行', 'error')
-        return false
-      }
-    },
-    setSelectRows(val) {
-      this.selectRows = val
-    },
-  },
+	components: {
+		UploadExcel,
+		ExportExcel,
+		TableEdit,
+	},
+	data() {
+		return {
+			fuzzyQuery_name: '',
+			listLoading: true,
+			list: [],
+			options: [],
+			exportExcel: [],
+			templateExcel: [],
+			elementLoadingText: '正在加载...',
+			selectRows: '',
+			layout: 'total, sizes, prev, pager, next, jumper',
+			total: 0,
+			background: true,
+			exportList: [],
+			queryForm: {
+				pageNo: 1,
+				pageSize: 20,
+			},
+			stationList: [],
+			selectValue: ''
+		};
+	},
+	computed: {
+		height() {
+			return this.$baseTableHeight() + 50
+		},
+	},
+	created() {
+		// this.getStation()
+		this.fetchData()
+	},
+	methods: {
+		handleQuery() {
+			this.queryForm.pageNo = 1
+			this.fetchData()
+		},
+		getMyExcelData(val) {
+			val.forEach(item => {
+				api.addEquipmentmodel(item).then(res => {
+					if (res.code == 200) {
+						this.$message({
+							type: 'success',
+							message: '添加成功!'
+						});
+						this.fetchData()
+					}
+				})
+			})
+		},
+		getStation() {
+			api.windpowerstationList({
+				id: '',
+				name: '',
+				companyid: '',
+				pageNum: 1,
+				pageSize: 1000,
+			}).then(res => {
+				if (res.data) {
+					this.listLoading = false
+					this.stationList = res.data.records
+				}
+			})
+		},
+		fetchData() {
+			api.equipmentmodel({
+				name: this.fuzzyQuery_name,
+				pageNum: this.queryForm.pageNo,
+				pageSize: this.queryForm.pageSize,
+			}).then(res => {
+				if (res.data) {
+					this.listLoading = false
+					this.total = res.data.total
+					this.list = res.data.records
+					this.templateExcel = [
+						{
+							id: '',
+							code: '',
+							name: '',
+							description: '',
+							powerproduction: '',
+							windturbinemanufacturerid: '',
+							photo: '',
+							unit: '',
+							cutinwindspeed: '',
+							ratedwindspeed: '',
+							cutoutwindspeed: '',
+							sweptarea: '',
+							equipmentcategory: '',
+						}
+					]
+					// 导出
+					let exportExcel = []
+					res.data.records.forEach(item => {
+						exportExcel.push({
+							id: item.id,
+							code: item.code,
+							name: item.name,
+							description: item.description,
+							powerproduction: item.powerproduction,
+							windturbinemanufacturerid: item.windturbinemanufacturerid,
+							photo: item.photo,
+							unit: item.unit,
+							cutinwindspeed: item.cutinwindspeed,
+							ratedwindspeed: item.ratedwindspeed,
+							cutoutwindspeed: item.cutoutwindspeed,
+							sweptarea: item.sweptarea,
+							equipmentcategory: item.equipmentcategory,
+						})
+					})
+					this.exportExcel = exportExcel
+				}
+			})
+		},
+		handleSizeChange(val) {
+			this.queryForm.pageSize = val
+			this.fetchData()
+		},
+		handleCurrentChange(val) {
+			this.queryForm.pageNo = val
+			this.fetchData()
+		},
+		handleAdd() {
+			this.$refs['edit'].showEdit()
+		},
+		handleEdit(row) {
+			this.$refs['edit'].showEdit(row)
+		},
+		handleDelete(row) {
+			if (row.id || this.selectRows.length > 0) {
+				this.$baseConfirm('你确定要删除吗', null, async () => {
+					let ids = ''
+					if (this.selectRows.length > 0) {
+						ids = this.selectRows.map((item) => item.id).join()
+					}
+					api.deleteEquipmentmodel({
+						id: row.id || ids
+					}).then(res => {
+						if (res.data) {
+							this.$baseMessage('删除成功', 'success')
+							this.fetchData()
+						}
+					})
+				})
+			} else {
+				this.$baseMessage('未选中任何行', 'error')
+				return false
+			}
+		},
+		setSelectRows(val) {
+			this.selectRows = val
+		},
+	},
 }
 </script>
 <style lang="less" scoped>
 .title {
-  display: flex;
-  flex-direction: row;
-  align-items: center;
-  justify-content: space-between;
-  margin-bottom: 20px;
+	display: flex;
+	flex-direction: row;
+	align-items: center;
+	justify-content: space-between;
+	margin-bottom: 20px;
 }
 
 .left {
-  display: flex;
-  flex-direction: row;
-  align-items: center;
+	display: flex;
+	flex-direction: row;
+	align-items: center;
 
-  .left-item {
-    display: flex;
-    flex-direction: row;
-    align-items: center;
-    margin-right: 10px;
-  }
+	.left-item {
+		display: flex;
+		flex-direction: row;
+		align-items: center;
+		margin-right: 10px;
+	}
 }
 </style>

+ 3 - 3
src/views/stationConfiguration/manufacturer/index.vue

@@ -23,9 +23,9 @@
 					<ExportExcel :exportList="templateExcel" :useType="'template'" partsName="设备厂商模板"></ExportExcel>
 				</div>
 			</div>
-			<el-table ref="tableSort" v-loading="listLoading" :data="list" :element-loading-text="elementLoadingText"
-				:height="height" @selection-change="setSelectRows">
-				<el-table-column show-overflow-tooltip type="selection" width="40"></el-table-column>
+			<el-table header-cell-class-name="table_header_style" border ref="tableSort" v-loading="listLoading" :data="list"
+				:element-loading-text="elementLoadingText" :height="height" @selection-change="setSelectRows">
+				<el-table-column show-overflow-tooltip type="selection" align="center" width="40"></el-table-column>
 				<el-table-column show-overflow-tooltip label="id" prop="id" align="center" sortable></el-table-column>
 				<el-table-column show-overflow-tooltip label="名称" prop="name" align="center" sortable></el-table-column>
 				<el-table-column show-overflow-tooltip label="国家地区" prop="country" align="center" sortable></el-table-column>

+ 3 - 3
src/views/stationConfiguration/modelpower/index.vue

@@ -23,9 +23,9 @@
 					<ExportExcel :exportList="templateExcel" :useType="'template'" partsName="设备类型模板"></ExportExcel>
 				</div>
 			</div>
-			<el-table ref="tableSort" v-loading="listLoading" :data="list" :element-loading-text="elementLoadingText"
-				:height="height" @selection-change="setSelectRows">
-				<el-table-column show-overflow-tooltip type="selection" width="40"></el-table-column>
+			<el-table header-cell-class-name="table_header_style" border ref="tableSort" v-loading="listLoading" :data="list"
+				:element-loading-text="elementLoadingText" :height="height" @selection-change="setSelectRows">
+				<el-table-column show-overflow-tooltip type="selection" align="center" width="40"></el-table-column>
 				<el-table-column show-overflow-tooltip label="id" prop="id" align="center" sortable></el-table-column>
 				<el-table-column show-overflow-tooltip label="型号编号" prop="modelid" align="center" sortable></el-table-column>
 				<el-table-column show-overflow-tooltip label="风速/光照度" prop="speed" align="center" sortable></el-table-column>

+ 4 - 4
src/views/stationConfiguration/projectstudy/index.vue

@@ -26,10 +26,10 @@
 			</vab-query-form-right-panel>
 		</vab-query-form>
 
-		<el-table ref="tableSort" v-loading="listLoading" :data="list" :element-loading-text="elementLoadingText"
-			:height="height" @selection-change="setSelectRows" @sort-change="tableSortChange" show-summary
-			:summary-method="getSummaries">
-			<el-table-column show-overflow-tooltip type="selection" width="65"></el-table-column>
+		<el-table header-cell-class-name="table_header_style" border ref="tableSort" v-loading="listLoading" :data="list"
+			:element-loading-text="elementLoadingText" :height="height" @selection-change="setSelectRows"
+			@sort-change="tableSortChange" show-summary :summary-method="getSummaries">
+			<el-table-column show-overflow-tooltip type="selection" align="center" width="65"></el-table-column>
 			<el-table-column show-overflow-tooltip label="风场编号" prop="windpower" width="200" align="center" sortable>
 			</el-table-column>
 			<el-table-column show-overflow-tooltip label="工程编号" prop="projectid" align="center" sortable></el-table-column>

+ 3 - 3
src/views/stationConfiguration/windsubstation/index.vue

@@ -23,9 +23,9 @@
 					<ExportExcel :exportList="templateExcel" :useType="'template'" partsName="变电所模板"></ExportExcel>
 				</div>
 			</div>
-			<el-table ref="tableSort" v-loading="listLoading" :data="list" :element-loading-text="elementLoadingText"
-				:height="height" @selection-change="setSelectRows">
-				<el-table-column show-overflow-tooltip type="selection" width="40"></el-table-column>
+			<el-table header-cell-class-name="table_header_style" border ref="tableSort" v-loading="listLoading" :data="list"
+				:element-loading-text="elementLoadingText" :height="height" @selection-change="setSelectRows">
+				<el-table-column show-overflow-tooltip type="selection" align="center" width="40"></el-table-column>
 				<el-table-column show-overflow-tooltip label="id" prop="id" align="center" sortable></el-table-column>
 				<el-table-column show-overflow-tooltip label="编码" prop="code" align="center" sortable></el-table-column>
 				<el-table-column show-overflow-tooltip label="名称" prop="name" align="center" sortable></el-table-column>