瀏覽代碼

fix:修改

chenxinlei 2 年之前
父節點
當前提交
b97f680339

+ 62 - 0
src/api/realtimeDatabaseConfiguration.js

@@ -458,7 +458,69 @@ const deleteWeatherStation = (data) => {
     method: 'delete',
   })
 }
+// DELETE
+// /pro-basic-logical-unit/{ids}
+// 部件-删除
+// POST
+// /pro-basic-logical-unit/add
+// 部件-新增or修改
+// GET
+// /pro-basic-logical-unit/list
+// 部件-列表
+const logicalUnitList = (data) => {
+  return request({
+    url: `/pro-basic-logical-unit/list?name=${data.name}&pageNum=${data.pageNum}&pageSize=${data.pageSize}`,
+    method: 'get',
+  })
+}
+const logicalUnitAdd = (pairs) => {
+  return request({
+    url: `/pro-basic-logical-unit/add`,
+    method: 'post',
+    data: pairs,
+  })
+}
+const logicalUnitDelete = (data) => {
+  return request({
+    url: `/pro-basic-logical-unit/${data.id}`,
+    method: 'delete',
+  })
+}
+// DELETE
+// /pro-econ-logical-unit/{ids}
+// 逻辑部件-删除
+// POST
+// /pro-econ-logical-unit/add
+// 逻辑部件-新增or修改
+// GET
+// /pro-econ-logical-unit/list
+// 逻辑部件-列表
+const logicalUnitListEcon = (data) => {
+  return request({
+    url: `/pro-econ-logical-unit/list?name=${data.name}&pageNum=${data.pageNum}&pageSize=${data.pageSize}`,
+    method: 'get',
+  })
+}
+const logicalUnitAddEcon = (pairs) => {
+  return request({
+    url: `/pro-econ-logical-unit/add`,
+    method: 'post',
+    data: pairs,
+  })
+}
+const logicalUnitDeleteEcon = (data) => {
+  return request({
+    url: `/pro-econ-logical-unit/${data.id}`,
+    method: 'delete',
+  })
+}
 export default {
+  logicalUnitListEcon,
+  logicalUnitAddEcon,
+  logicalUnitDeleteEcon,
+  logicalUnitList,
+  logicalUnitAdd,
+  logicalUnitDelete,
   pointList,
   generatePoint,
   weatherStationList,

+ 14 - 0
src/router/index.js

@@ -207,6 +207,20 @@ export const asyncRoutes = [
           import('@/views/stationConfiguration/weatherStation/index'),
         meta: { title: '气象站' },
       },
+      {
+        path: 'partsConfiguration',
+        name: 'partsConfiguration',
+        component: () =>
+          import('@/views/stationConfiguration/partsConfiguration/index'),
+        meta: { title: '部件配置' },
+      },
+      {
+        path: 'partsConfigurationEcon',
+        name: 'partsConfigurationEcon',
+        component: () =>
+          import('@/views/stationConfiguration/partsConfigurationEcon/index'),
+        meta: { title: '逻辑部件配置' },
+      },
     ],
   },
   // {

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

@@ -130,9 +130,9 @@ export default {
     },
     equipmentCategoryFormatter(row, column, cellValue, index){
       let val = this.equipmentCategoryOptions.filter(item=>{
-        return item.id === row.equipmentCategory
+        return item.id == row.equipmentCategory
       });
-      return val[0].name
+      return val[0] ? val[0].name : ""
     },
 		handleQuery() {
 			this.queryForm.pageNo = 1

+ 140 - 0
src/views/stationConfiguration/partsConfiguration/components/TableEdit.vue

@@ -0,0 +1,140 @@
+<template>
+	<el-dialog :title="title" :visible.sync="dialogFormVisible" width="800px" @close="close">
+		<el-form ref="form" :model="form" :rules="rules" label-width="150px">
+      <el-row>
+        <el-col :span="12"><el-form-item label="编号" prop="id"><el-input class="inputs" v-model="form.id" autocomplete="off" :disabled="!idAdd?true:false"></el-input></el-form-item></el-col>
+        <el-col :span="12"><el-form-item label="编码" prop="nemCode"><el-input class="inputs" v-model="form.nemCode" autocomplete="off"></el-input></el-form-item></el-col>
+        <el-col :span="12"><el-form-item label="名称" prop="name"><el-input class="inputs" v-model="form.name" autocomplete="off"></el-input></el-form-item></el-col>
+        <el-col :span="12"><el-form-item label="别名" prop="aname"><el-input class="inputs" v-model="form.aname" autocomplete="off"></el-input></el-form-item></el-col>
+        <el-col :span="12"><el-form-item label="拼音编码" prop="pycode"><el-input class="inputs" v-model="form.pycode" autocomplete="off"></el-input></el-form-item></el-col>
+        <el-col :span="12"><el-form-item label="规格类型" prop="specificationType"><el-input class="inputs" v-model="form.specificationType" autocomplete="off"></el-input></el-form-item></el-col>
+        <el-col :span="12"><el-form-item label="父编号" prop="parentId"><el-input class="inputs" v-model="form.parentId" autocomplete="off"></el-input></el-form-item></el-col>
+        <el-col :span="12"><el-form-item label="图片" prop="photo"><el-input class="inputs" v-model="form.photo" autocomplete="off"></el-input></el-form-item></el-col>
+        <el-col :span="12"><el-form-item label="类型" prop="typeId">
+          <el-select v-model="form.typeId" placeholder="请选择" clearable style="width:200px">
+						<el-option v-for="item in typeIdOptions" :key="item.id" :label="item.name" :value="item.id">
+						</el-option>
+					</el-select>
+        </el-form-item></el-col>
+        <el-col :span="12"><el-form-item label="顺序" prop="orderNum"><el-input class="inputs" v-model="form.orderNum" autocomplete="off"></el-input></el-form-item></el-col>
+      </el-row>
+		</el-form>
+		<div slot="footer" class="dialog-footer">
+			<el-button @click="close">取 消</el-button>
+			<el-button type="primary" @click="save">确 定</el-button>
+		</div>
+	</el-dialog>
+</template>
+
+<script>
+import api from '@/api/realtimeDatabaseConfiguration'
+import dayjs from "dayjs";
+export default {
+	name: 'TableEdit',
+	props: {
+		options: {
+			type: Array,
+			default: []
+		},
+		stationList: {
+			type: Array,
+			default: []
+		},
+	},
+	data() {
+		return {
+      typeIdOptions: [
+        {id:"fd", name:"风电"},
+        {id:"gf", name:"光伏"},
+      ],
+			form: {
+				id: "",
+        nemCode: "",
+        name: "",
+        aname: "",
+        pycode: "",
+        specificationType: "",
+        parentId: "",
+        photo: "",
+        typeId: "",
+        orderNum: "",
+			},
+			rules: {
+				id: [{ required: true, trigger: 'blur', message: '请输入' }],
+				nemCode: [{ required: true, trigger: 'blur', message: '请输入' }],
+				name: [{ required: true, trigger: 'blur', message: '请输入' }],
+				aname: [{ required: true, trigger: 'blur', message: '请输入' }],
+				pycode: [{ required: true, trigger: 'blur', message: '请输入' }],
+				specificationType: [{ required: true, trigger: 'blur', message: '请输入' }],
+				parentId: [{ required: true, trigger: 'blur', message: '请输入' }],
+				photo: [{ required: true, trigger: 'blur', message: '请输入' }],
+				typeId: [{ required: true, trigger: 'blur', message: '请输入' }],
+				orderNum: [{ required: true, trigger: 'blur', message: '请输入' }],
+			},
+			title: '',
+			dialogFormVisible: false,
+			idAdd: true,
+		}
+	},
+	created() { },
+	methods: {
+    changeDate() {
+      this.$forceUpdate()
+    },
+		showEdit(row) {
+			if (!row) {
+				this.title = '添加'
+				this.idAdd = true
+			} else {
+				this.title = '编辑'
+				this.idAdd = false
+				this.form = Object.assign({}, row)
+			}
+			this.dialogFormVisible = true
+		},
+		close() {
+			this.$refs['form'].resetFields()
+			this.form = this.$options.data().form
+			this.dialogFormVisible = false
+			this.$emit('fetch-data')
+		},
+		save() {
+			this.$refs['form'].validate(async (valid) => {
+				if (valid) {
+					api.logicalUnitAdd(this.form).then(res => {
+						if (res.data) {
+							this.$message({
+								type: 'success',
+								message: '添加成功!'
+							});
+							this.$emit('save-success');
+							this.dialogFormVisible = false
+						}
+					})
+				} else {
+					return false
+				}
+			})
+		},
+		handleChange() {
+		},
+		onBlur(val, param) {
+			if (typeof (this.form[param]) !== 'number') {
+				this.form[param] = val.replace(/[^0-9]/ig, "")
+			}
+		},
+	},
+}
+</script>
+<style lang="less" scoped>
+.inputs {
+	width: 200px;
+}
+
+.lists {
+	display: flex;
+	flex-direction: row;
+	align-items: center;
+	justify-content: space-between;
+}
+</style>

+ 259 - 0
src/views/stationConfiguration/partsConfiguration/index.vue

@@ -0,0 +1,259 @@
+<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="searchFetchData">
+						查询
+					</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>
+ <!-- *   编号 private String id;
+ *        编码 private String nemCode;
+ *        名称 private String name;
+ *        别名 private String aname;
+ *        拼音编码 private String pycode;
+ *        规格类型 private String specificationType;
+ *        父编号 private String parentId;
+ *        图片 private String photo;
+ *        类型(风电,光伏) private String typeId;
+ *        顺序 private Integer orderNum;
+ *        备用1 private String spare1;
+ *        备用2 private String spare2;
+ *        备用3 private String spare3;
+ *        备用4 private String spare4; -->
+			<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="编号" prop="id" align="center" sortable></el-table-column>
+				<el-table-column show-overflow-tooltip label="编码" prop="nemCode" 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="aname" align="center" sortable></el-table-column>
+				<el-table-column show-overflow-tooltip label="拼音编码" prop="pycode" align="center" sortable></el-table-column>
+				<el-table-column show-overflow-tooltip label="规格类型" prop="specificationType" align="center" sortable></el-table-column>
+				<el-table-column show-overflow-tooltip label="父编号" prop="parentId" align="center" sortable></el-table-column>
+				<el-table-column show-overflow-tooltip label="图片" prop="photo" align="center" sortable></el-table-column>
+				<el-table-column :formatter="typeIdFormatter" show-overflow-tooltip label="类型" prop="typeId" align="center" sortable></el-table-column>
+				<el-table-column show-overflow-tooltip label="顺序" prop="orderNum" 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'
+import ExportExcel from '@/components/ExportExcel/index'
+import api from '@/api/realtimeDatabaseConfiguration'
+import stationApi from '@/api/station'
+import TableEdit from './components/TableEdit'
+export default {
+	components: {
+		UploadExcel,
+		ExportExcel,
+		TableEdit,
+	},
+	data() {
+		return {
+      typeIdOptions: [
+        {id:"fd", name:"风电"},
+        {id:"gf", name:"光伏"},
+      ],
+			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: {
+    typeIdFormatter(row){
+      for (const iterator of this.typeIdOptions) {
+        if(row.typeId == iterator.id){
+          return iterator.name
+        }
+      }
+    },
+		getMyExcelData(val) {
+			val.forEach(item => {
+				api.logicalUnitAdd(item).then(res => {
+					if (res.code == 200) {
+						this.$message({
+							type: 'success',
+							message: '添加成功!'
+						});
+						this.fetchData()
+					}
+				})
+			})
+		},
+		getStation() {
+			stationApi.windpowerstationList({
+				id: '',
+				name: '',
+				companyid: '',
+				pageNum: 1,
+				pageSize: 1000,
+			}).then(res => {
+				if (res.data) {
+					this.listLoading = false
+					this.stationList = res.data.records
+				}
+			})
+		},
+    searchFetchData(){
+      this.queryForm.pageNo = 1
+      this.fetchData()
+    },
+		fetchData() {
+			api.logicalUnitList({
+				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: "",
+							nemCode: "",
+							name: "",
+							aname: "",
+							pycode: "",
+							specificationType: "",
+							parentId: "",
+							photo: "",
+							typeId: "",
+							orderNum: "",
+						}
+					]
+					// 导出
+					let exportExcel = []
+					res.data.records.forEach(item => {
+						exportExcel.push({
+							id: item.id,
+							nemCode: item.nemCode,
+							name: item.name,
+							aname: item.aname,
+							pycode: item.pycode,
+							specificationType: item.specificationType,
+							parentId: item.parentId,
+							photo: item.photo,
+							typeId: item.typeId,
+							orderNum: item.orderNum,
+						})
+					})
+					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.logicalUnitDelete({
+						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;
+}
+
+.left {
+	display: flex;
+	flex-direction: row;
+	align-items: center;
+
+	.left-item {
+		display: flex;
+		flex-direction: row;
+		align-items: center;
+		margin-right: 10px;
+	}
+}
+</style>

+ 153 - 0
src/views/stationConfiguration/partsConfigurationEcon/components/TableEdit.vue

@@ -0,0 +1,153 @@
+<template>
+	<el-dialog :title="title" :visible.sync="dialogFormVisible" width="800px" @close="close">
+		<el-form ref="form" :model="form" :rules="rules" label-width="150px">
+      <el-row>
+        <!-- 
+        <el-table-column show-overflow-tooltip label="编号" prop="id" align="center" sortable></el-table-column>
+				<el-table-column show-overflow-tooltip label="编码" prop="nemCode" 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="aname" align="center" sortable></el-table-column>
+				<el-table-column show-overflow-tooltip label="拼音编码" prop="pycode" align="center" sortable></el-table-column>
+				<el-table-column show-overflow-tooltip label="规格类型" prop="specificationType" align="center" sortable></el-table-column>
+				<el-table-column show-overflow-tooltip label="父编号" prop="parentId" 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="equipmentId" align="center" sortable></el-table-column>
+				<el-table-column show-overflow-tooltip label="型号编号" prop="modelId" align="center" sortable></el-table-column>
+         -->
+        <el-col :span="12"><el-form-item label="编号" prop="id"><el-input class="inputs" v-model="form.id" autocomplete="off" :disabled="!idAdd?true:false"></el-input></el-form-item></el-col>
+        <el-col :span="12"><el-form-item label="编码" prop="nemCode"><el-input class="inputs" v-model="form.nemCode" autocomplete="off"></el-input></el-form-item></el-col>
+        <el-col :span="12"><el-form-item label="名称" prop="name"><el-input class="inputs" v-model="form.name" autocomplete="off"></el-input></el-form-item></el-col>
+        <el-col :span="12"><el-form-item label="别名" prop="aname"><el-input class="inputs" v-model="form.aname" autocomplete="off"></el-input></el-form-item></el-col>
+        <el-col :span="12"><el-form-item label="拼音编码" prop="pycode"><el-input class="inputs" v-model="form.pycode" autocomplete="off"></el-input></el-form-item></el-col>
+        <el-col :span="12"><el-form-item label="规格类型" prop="specificationType"><el-input class="inputs" v-model="form.specificationType" autocomplete="off"></el-input></el-form-item></el-col>
+        <el-col :span="12"><el-form-item label="父编号" prop="parentId"><el-input class="inputs" v-model="form.parentId" autocomplete="off"></el-input></el-form-item></el-col>
+        <el-col :span="12"><el-form-item label="图片" prop="photo"><el-input class="inputs" v-model="form.photo" autocomplete="off"></el-input></el-form-item></el-col>
+        <el-col :span="12"><el-form-item label="逻辑设备编号" prop="equipmentId"><el-input class="inputs" v-model="form.equipmentId" autocomplete="off"></el-input></el-form-item></el-col>
+        <el-col :span="12"><el-form-item label="型号编号" prop="modelId"><el-input class="inputs" v-model="form.modelId" autocomplete="off"></el-input></el-form-item></el-col>
+        <!-- <el-col :span="12"><el-form-item label="类型" prop="typeId">
+          <el-select v-model="form.typeId" placeholder="请选择" clearable style="width:200px">
+						<el-option v-for="item in typeIdOptions" :key="item.id" :label="item.name" :value="item.id">
+						</el-option>
+					</el-select>
+        </el-form-item></el-col> -->
+      </el-row>
+		</el-form>
+		<div slot="footer" class="dialog-footer">
+			<el-button @click="close">取 消</el-button>
+			<el-button type="primary" @click="save">确 定</el-button>
+		</div>
+	</el-dialog>
+</template>
+
+<script>
+import api from '@/api/realtimeDatabaseConfiguration'
+import dayjs from "dayjs";
+export default {
+	name: 'TableEdit',
+	props: {
+		options: {
+			type: Array,
+			default: []
+		},
+		stationList: {
+			type: Array,
+			default: []
+		},
+	},
+	data() {
+		return {
+      typeIdOptions: [
+        {id:"fd", name:"风电"},
+        {id:"gf", name:"光伏"},
+      ],
+			form: {
+				id: "",
+        nemCode: "",
+        name: "",
+        aname: "",
+        pycode: "",
+        specificationType: "",
+        parentId: "",
+        photo: "",
+        equipmentId: "",
+        modelId: "",
+			},
+			rules: {
+				id: [{ required: true, trigger: 'blur', message: '请输入' }],
+				nemCode: [{ required: true, trigger: 'blur', message: '请输入' }],
+				name: [{ required: true, trigger: 'blur', message: '请输入' }],
+				aname: [{ required: true, trigger: 'blur', message: '请输入' }],
+				pycode: [{ required: true, trigger: 'blur', message: '请输入' }],
+				specificationType: [{ required: true, trigger: 'blur', message: '请输入' }],
+				parentId: [{ required: true, trigger: 'blur', message: '请输入' }],
+				photo: [{ required: true, trigger: 'blur', message: '请输入' }],
+				equipmentId: [{ required: true, trigger: 'blur', message: '请输入' }],
+				modelId: [{ required: true, trigger: 'blur', message: '请输入' }],
+			},
+			title: '',
+			dialogFormVisible: false,
+			idAdd: true,
+		}
+	},
+	created() { },
+	methods: {
+    changeDate() {
+      this.$forceUpdate()
+    },
+		showEdit(row) {
+			if (!row) {
+				this.title = '添加'
+				this.idAdd = true
+			} else {
+				this.title = '编辑'
+				this.idAdd = false
+				this.form = Object.assign({}, row)
+			}
+			this.dialogFormVisible = true
+		},
+		close() {
+			this.$refs['form'].resetFields()
+			this.form = this.$options.data().form
+			this.dialogFormVisible = false
+			this.$emit('fetch-data')
+		},
+		save() {
+			this.$refs['form'].validate(async (valid) => {
+				if (valid) {
+					api.logicalUnitAddEcon(this.form).then(res => {
+						if (res.data) {
+							this.$message({
+								type: 'success',
+								message: '添加成功!'
+							});
+							this.$emit('save-success');
+							this.dialogFormVisible = false
+						}
+					})
+				} else {
+					return false
+				}
+			})
+		},
+		handleChange() {
+		},
+		onBlur(val, param) {
+			if (typeof (this.form[param]) !== 'number') {
+				this.form[param] = val.replace(/[^0-9]/ig, "")
+			}
+		},
+	},
+}
+</script>
+<style lang="less" scoped>
+.inputs {
+	width: 200px;
+}
+
+.lists {
+	display: flex;
+	flex-direction: row;
+	align-items: center;
+	justify-content: space-between;
+}
+</style>

+ 257 - 0
src/views/stationConfiguration/partsConfigurationEcon/index.vue

@@ -0,0 +1,257 @@
+<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="searchFetchData">
+						查询
+					</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>
+      <!-- *  
+      * 编号 private String id;
+      * 编码 private String nemCode;
+      * 名称 private String name;
+      * 别名 private String aname;
+      * 拼音编码 private String pycode;
+      * 规格类型 private String specificationType;
+      * 父编号 private String parentId;
+      * 图片 private String photo;
+      * 逻辑设备编号 private String equipmentId;
+      * 型号编号 private String modelId;
+			<el-table-column :formatter="typeIdFormatter" show-overflow-tooltip label="类型" prop="typeId" align="center" sortable></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="编号" prop="id" align="center" sortable></el-table-column>
+				<el-table-column show-overflow-tooltip label="编码" prop="nemCode" 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="aname" align="center" sortable></el-table-column>
+				<el-table-column show-overflow-tooltip label="拼音编码" prop="pycode" align="center" sortable></el-table-column>
+				<el-table-column show-overflow-tooltip label="规格类型" prop="specificationType" align="center" sortable></el-table-column>
+				<el-table-column show-overflow-tooltip label="父编号" prop="parentId" 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="equipmentId" 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="操作" 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'
+import ExportExcel from '@/components/ExportExcel/index'
+import api from '@/api/realtimeDatabaseConfiguration'
+import stationApi from '@/api/station'
+import TableEdit from './components/TableEdit'
+export default {
+	components: {
+		UploadExcel,
+		ExportExcel,
+		TableEdit,
+	},
+	data() {
+		return {
+      typeIdOptions: [
+        {id:"fd", name:"风电"},
+        {id:"gf", name:"光伏"},
+      ],
+			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: {
+    typeIdFormatter(row){
+      for (const iterator of this.typeIdOptions) {
+        if(row.typeId == iterator.id){
+          return iterator.name
+        }
+      }
+    },
+		getMyExcelData(val) {
+			val.forEach(item => {
+				api.logicalUnitAddEcon(item).then(res => {
+					if (res.code == 200) {
+						this.$message({
+							type: 'success',
+							message: '添加成功!'
+						});
+						this.fetchData()
+					}
+				})
+			})
+		},
+		getStation() {
+			stationApi.windpowerstationList({
+				id: '',
+				name: '',
+				companyid: '',
+				pageNum: 1,
+				pageSize: 1000,
+			}).then(res => {
+				if (res.data) {
+					this.listLoading = false
+					this.stationList = res.data.records
+				}
+			})
+		},
+    searchFetchData(){
+      this.queryForm.pageNo = 1
+      this.fetchData()
+    },
+		fetchData() {
+			api.logicalUnitListEcon({
+				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: "",
+							nemCode: "",
+							name: "",
+							aname: "",
+							pycode: "",
+							specificationType: "",
+							parentId: "",
+							photo: "",
+							equipmentId: "",
+							modelId: "",
+						}
+					]
+					// 导出
+					let exportExcel = []
+					res.data.records.forEach(item => {
+						exportExcel.push({
+							id: item.id,
+							nemCode: item.nemCode,
+							name: item.name,
+							aname: item.aname,
+							pycode: item.pycode,
+							specificationType: item.specificationType,
+							parentId: item.parentId,
+							photo: item.photo,
+							equipmentId: item.equipmentId,
+							modelId: item.modelId,
+						})
+					})
+					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.logicalUnitDeleteEcon({
+						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;
+}
+
+.left {
+	display: flex;
+	flex-direction: row;
+	align-items: center;
+
+	.left-item {
+		display: flex;
+		flex-direction: row;
+		align-items: center;
+		margin-right: 10px;
+	}
+}
+</style>