Browse Source

fix:计划电量,指标录入导入导出,可延电量,

chenxinlei 2 years ago
parent
commit
96fecac3b2

+ 32 - 2
src/api/realtimeDatabaseConfiguration.js

@@ -100,14 +100,41 @@ const addWindsubstation = (pairs) => {
     data: pairs,
   })
 }
-// /pro-basic-windsub-station/remove-WindsubStation/{ids}
 const deleteWindsubstation = (data) => {
   return request({
     url: `/pro-basic-windsub-station/remove-WindsubStation/${data.id}`,
     method: 'delete',
   })
 }
-
+// 可研电量
+// POST
+// /pro-basic-project-study/add
+// 工程可研电量-新增or修改
+// GET
+// /pro-basic-project-study/List
+// 工程可研电量-列表
+// DELETE
+// /pro-basic-project-study/remove-project-study/{ids}
+// 工程可研电量-删除
+const projectstudy = (data) => {
+  return request({
+    url: `/pro-basic-project-study/List?projectId=${data.projectId}&pageNum=${data.pageNum}&pageSize=${data.pageSize}`,
+    method: 'get',
+  })
+}
+const addProjectstudy = (pairs) => {
+  return request({
+    url: `/pro-basic-project-study/add`,
+    method: 'post',
+    data: pairs,
+  })
+}
+const deleteProjectstudy = (data) => {
+  return request({
+    url: `/pro-basic-project-study/remove-project-study/${data.id}`,
+    method: 'delete',
+  })
+}
 export default {
   database,
   addDatabase,
@@ -121,4 +148,7 @@ export default {
   deleteManufacturer,
   deleteModelpower,
   deleteWindsubstation,
+  addProjectstudy,
+  projectstudy,
+  deleteProjectstudy,
 }

+ 1 - 0
src/api/station.js

@@ -244,6 +244,7 @@ const standardpoint = (data) => {
     method: 'get',
   })
 }
+
 export default {
   groupList,
   addGroup,

+ 0 - 23
src/api/table.js

@@ -69,26 +69,6 @@ const newtreeTreels = (data) => {
   })
 }
 
-// 可研电量
-const projectstudy = (data) => {
-  return request({
-    url: `/projectstudy/List?windpower=${data.windpower}&pageNum=${data.pageNum}&pageSize=${data.pageSize}`,
-    method: 'get',
-  })
-}
-const addProjectstudy = (pairs) => {
-  return request({
-    url: `/projectstudy/add`,
-    method: 'post',
-    data: pairs,
-  })
-}
-const deleteProjectstudy = (data) => {
-  return request({
-    url: `/projectstudy/remove-study/${data.id}`,
-    method: 'delete',
-  })
-}
 const treels = (data) => {
   return request({
     url: `/newtree/treels`,
@@ -105,7 +85,4 @@ export default {
   addIndicators,
   removeIndicators,
   newtreeTreels,
-  addProjectstudy,
-  projectstudy,
-  deleteProjectstudy,
 }

+ 41 - 41
src/router/index.js

@@ -145,13 +145,13 @@ export const asyncRoutes = [
           import('@/views/stationConfiguration/windsubstation/index'),
         meta: { title: '变电所' },
       },
-      // {
-      //   path: 'projectstudy',
-      //   name: 'projectstudy',
-      //   component: () =>
-      //     import('@/views/stationConfiguration/projectstudy/index'),
-      //   meta: { title: '可研电量' },
-      // },
+      {
+        path: 'projectstudy',
+        name: 'projectstudy',
+        component: () =>
+          import('@/views/stationConfiguration/projectstudy/index'),
+        meta: { title: '可研电量' },
+      },
       // {
       //   path: 'admlist',
       //   name: 'admlist',
@@ -178,40 +178,40 @@ export const asyncRoutes = [
   //     },
   //   ],
   // },
-  {
-    path: '/meterpoint',
-    component: Layout,
-    redirect: 'noRedirect',
-    children: [
-      {
-        path: 'meterpoint',
-        name: 'meterpoint',
-        component: () => import('@/views/meterpoint/index'),
-        meta: {
-          title: '电计量配置',
-          icon: 'allergies',
-          permissions: ['admin'],
-        },
-      },
-    ],
-  },
-  {
-    path: '/realDatabaseConfig',
-    component: Layout,
-    redirect: 'noRedirect',
-    children: [
-      {
-        path: 'realDatabaseConfig',
-        name: 'realDatabaseConfig',
-        component: () => import('@/views/realDatabaseConfig/index'),
-        meta: {
-          title: '实时数据库配置',
-          icon: 'allergies',
-          permissions: ['admin'],
-        },
-      },
-    ],
-  },
+  // {
+  //   path: '/meterpoint',
+  //   component: Layout,
+  //   redirect: 'noRedirect',
+  //   children: [
+  //     {
+  //       path: 'meterpoint',
+  //       name: 'meterpoint',
+  //       component: () => import('@/views/meterpoint/index'),
+  //       meta: {
+  //         title: '电计量配置',
+  //         icon: 'allergies',
+  //         permissions: ['admin'],
+  //       },
+  //     },
+  //   ],
+  // },
+  // {
+  //   path: '/realDatabaseConfig',
+  //   component: Layout,
+  //   redirect: 'noRedirect',
+  //   children: [
+  //     {
+  //       path: 'realDatabaseConfig',
+  //       name: 'realDatabaseConfig',
+  //       component: () => import('@/views/realDatabaseConfig/index'),
+  //       meta: {
+  //         title: '实时数据库配置',
+  //         icon: 'allergies',
+  //         permissions: ['admin'],
+  //       },
+  //     },
+  //   ],
+  // },
 
   // {
   //   path: "/square",

+ 6 - 9
src/views/index/components/TableEdit.vue

@@ -5,20 +5,20 @@
         <el-cascader v-model="form.cascaderSel" :options="options" style="width: 240px"
           :props="{ checkStrictly: true, label: 'name', value: 'id', children: 'children' }" clearable />
       </el-form-item>
-      <el-form-item label="场站" prop="windpowerstationId" v-if="!idAdd">
+      <el-form-item label="公司" prop="windpowerstationId" v-if="!idAdd">
         <el-input class="inputs" v-model="chooseStation.name" disabled style="width: 240px"></el-input>
       </el-form-item>
-      <el-form-item label="期次" prop="windpowerstationId" v-if="!idAdd">
+      <el-form-item label="场站" prop="windpowerstationId" v-if="!idAdd">
         <el-input class="inputs" v-model="chooseProject.name" disabled style="width: 240px"></el-input>
       </el-form-item>
+      <!-- <el-form-item label="期次" prop="projectId" v-if="!idAdd">
+        <el-input class="inputs" v-model="form.projectId" disabled style="width: 240px"></el-input>
+      </el-form-item> -->
       <el-form-item label="请选择日期" prop="dateValues">
         <el-date-picker v-model="form.dateValues" type="month" placeholder="选择月" :disabled="!idAdd ? true : false"
           style="width: 240px">
         </el-date-picker>
       </el-form-item>
-      <el-form-item label="期次" prop="projectId" v-if="!idAdd">
-        <el-input class="inputs" v-model="form.projectId" disabled style="width: 240px"></el-input>
-      </el-form-item>
       <el-form-item label="计划发电量" prop="generatingCapacity">
         <el-input class="inputs" v-model="form.generatingCapacity" style="width: 240px" placeholder="请输入"></el-input>
       </el-form-item>
@@ -68,7 +68,7 @@ export default {
   created() { },
   methods: {
     showEdit(row) {
-
+      this.dialogFormVisible = true
       if (!row) {
         this.title = '添加'
         this.idAdd = true
@@ -80,7 +80,6 @@ export default {
         this.chooseStation = this.stationFind(this.options, this.form.windpowerstationId)
         this.chooseProject = this.stationFind(this.options, this.form.projectId)
       }
-      this.dialogFormVisible = true
     },
     close() {
       this.$refs['form'].resetFields()
@@ -89,7 +88,6 @@ export default {
       this.$emit('fetch-data')
     },
     handleSave() {
-
       this.$refs['form'].validate(async (valid) => {
         if (valid) {
           this.form.year = new Date(this.form.dateValues).getFullYear()
@@ -100,7 +98,6 @@ export default {
           if (!this.form.windpowerstationId) {
             this.form.windpowerstationId = this.form.cascaderSel[1]
           }
-          console.log(this.form);
           api.addProjectplan(this.form).then(res => {
             if (res.code == 200) {
               this.$message({

+ 47 - 2
src/views/index/index.vue

@@ -25,6 +25,9 @@
         <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>
       </vab-query-form-right-panel>
     </vab-query-form>
 
@@ -56,12 +59,16 @@
 </template>
 
 <script>
+import UploadExcel from '@/components/UploadExcel/index'
+import ExportExcel from '@/components/ExportExcel/index'
 import api from '@/api/table'
 import TableEdit from './components/TableEdit'
 export default {
   name: 'ComprehensiveTable',
   components: {
-    TableEdit
+    TableEdit,
+    UploadExcel,
+		ExportExcel,
   },
   filters: {
     statusFilter(status) {
@@ -75,6 +82,8 @@ export default {
   },
   data() {
     return {
+      exportExcel: [],
+      templateExcel: [],
       fuzzyQuery: [],
       imgShow: true,
       list: [],
@@ -106,6 +115,19 @@ export default {
   beforeDestroy() { },
   mounted() { },
   methods: {
+    getMyExcelData(val) {
+			val.forEach(item => {
+				api.addProjectplan(item).then(res => {
+					if (res.code == 200) {
+						this.$message({
+							type: 'success',
+							message: '添加成功!'
+						});
+						this.fetchData()
+					}
+				})
+			})
+		},
     stationFind(data, id) {
       let res = null
       for (let i = 0; i < data.length; i++) {
@@ -120,7 +142,7 @@ export default {
       return res
     },
     getStation() {
-      api.newtreeTreels({ tag: 3 }).then(res => {
+      api.newtreeTreels({ tag: 2 }).then(res => {
         if (res.data) {
           this.options = res.data
           this.fetchData()
@@ -206,6 +228,29 @@ export default {
           setTimeout(() => {
             this.listLoading = false
           }, 500)
+          this.templateExcel = [
+						{
+							windpowerstation: "",
+              project: "",
+              generatingCapacity: "",
+              outageHours: "",
+              year: "",
+              month: "",
+						}
+					]
+					// 导出
+					let exportExcel = []
+					res.data.records.forEach(item => {
+						exportExcel.push({
+							windpowerstation: item.windpowerstation,
+							project: item.project,
+							generatingCapacity: item.generatingCapacity,
+							outageHours: item.outageHours,
+							year: item.year,
+							month: item.month
+						})
+					})
+					this.exportExcel = exportExcel
         }
       })
 

+ 46 - 19
src/views/indicators/index.vue

@@ -2,15 +2,6 @@
 	<div class="table-container">
 		<div class="title">
 			<div class="left">
-				<!-- <div class="left-item">
-          <div style="width: 70px;">场站:</div>
-          <el-cascader 
-            v-model="selectValue" 
-            :options="options" 
-            style="width: 200px" 
-            :props="{ checkStrictly: true, label: 'name', value: 'id' , children:'children', expandTrigger: 'hover' }" 
-            clearable />
-        </div> -->
 				<div class="left-item">
 					<div style="width: 150px;">组织机构编码:</div>
 					<el-input v-model="fuzzyQuery" placeholder="请输入" clearable />
@@ -26,17 +17,11 @@
 				<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>
-    <!-- 
-      
-      ✓	id	编号	VARCHAR2	50			编号
-      Comapny_Code	组织机构编码	VARCHAR2	50	✓		组织机构编码
-      target_Code	指标编码	VARCHAR2	50	✓		指标编码
-      target_Date	时间	VARCHAR2	50	✓		时间
-      Target_Value	值	NUMBER	18,2	✓		值
-      Target_cycle	周期	VARCHAR2	50	✓		周期
-     -->
 		<el-table ref="tableSort" v-loading="listLoading" :data="list" :element-loading-text="elementLoadingText"
       header-cell-class-name="table_header_style" border
 			:height="height" @selection-change="setSelectRows">
@@ -64,13 +49,17 @@
 </template>
 
 <script>
+import UploadExcel from '@/components/UploadExcel/index'
+import ExportExcel from '@/components/ExportExcel/index'
 import api from '@/api/table'
 import apis from '@/api/station'
 import TableEdit from './components/TableEdit'
 export default {
 	name: 'ComprehensiveTable',
 	components: {
-		TableEdit
+		TableEdit,
+    UploadExcel,
+		ExportExcel,
 	},
 	filters: {
 		statusFilter(status) {
@@ -84,6 +73,8 @@ export default {
 	},
 	data() {
 		return {
+      exportExcel: [],
+      templateExcel: [],
 			options: [],
 			imgShow: true,
 			list: [],
@@ -119,6 +110,19 @@ export default {
 	beforeDestroy() { },
 	mounted() { },
 	methods: {
+    getMyExcelData(val) {
+			val.forEach(item => {
+				api.addIndicators(item).then(res => {
+					if (res.code == 200) {
+						this.$message({
+							type: 'success',
+							message: '添加成功!'
+						});
+						this.fetchData()
+					}
+				})
+			})
+		},
 		getTree() {
 			api.newtreeTreels({ tag: 2 }).then(res => {
 				if (res.data) {
@@ -207,6 +211,29 @@ export default {
 						this.listLoading = false
 					}, 500)
 				}
+        this.templateExcel = [
+						{
+							id: "",
+              companyCode: "",
+              targetCode: "",
+              targetDate: "",
+              targetValue: "",
+              targetCycle: "",
+						}
+					]
+					// 导出
+					let exportExcel = []
+					res.data.records.forEach(item => {
+						exportExcel.push({
+							id: item.id,
+							companyCode: item.companyCode,
+							targetCode: item.targetCode,
+							targetDate: item.targetDate,
+							targetValue: item.targetValue,
+							targetCycle: item.targetCycle
+						})
+					})
+					this.exportExcel = exportExcel
 			})
 		},
 		getSummaries(param) {

+ 84 - 45
src/views/stationConfiguration/projectstudy/components/TableEdit.vue

@@ -1,37 +1,56 @@
 <template>
 	<el-dialog :title="title" :visible.sync="dialogFormVisible" width="800px" @close="close">
-		<el-form ref="form" :model="form" :rules="rules" label-width="120px">
-			<el-form-item label="场站" prop="cascaderSel" v-if="idAdd">
-				<el-cascader v-model="form.cascaderSel" :options="options" style="width: 200px;"
-					:props="{ checkStrictly: true, label: 'name', value: 'id' }" clearable>
-				</el-cascader>
-			</el-form-item>
-			<el-form-item label="场站" prop="generatingcapacity" v-if="!idAdd">
-				<el-input class="inputs" v-model="form.windpower" disabled></el-input>
-			</el-form-item>
-			<el-form-item label="期次" prop="generatingcapacity" v-if="!idAdd">
-				<el-input class="inputs" v-model="form.projectid" disabled></el-input>
-			</el-form-item>
-			<el-form-item label="计划发电量" prop="generatingcapacity">
-				<el-input class="inputs" v-model="form.generatingcapacity"></el-input>
-			</el-form-item>
-			<el-form-item label="计划停运小时" prop="outagehours">
-				<el-input class="inputs" v-model="form.outagehours"></el-input>
-			</el-form-item>
-			<el-form-item label="请选择日期" prop="dateValues">
-				<el-date-picker style="width: 200px;" v-model="form.dateValues" type="month" placeholder="选择月" :disabled="!idAdd?true:false">
-				</el-date-picker>
-			</el-form-item>
+		<el-form ref="form" :model="form" :rules="rules" label-width="150px">
+      <!-- id
+      projectId
+      generatingCapacity
+      outageHours
+      year
+      month
+      windpowerstationId -->
+      <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="projectId">
+            <el-input class="inputs" v-model="form.projectId" autocomplete="off"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="计划发电量" prop="generatingCapacity">
+            <el-input class="inputs" v-model="form.generatingCapacity" autocomplete="off"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="计划停运小时" prop="outageHours">
+            <el-input class="inputs" v-model="form.outageHours" autocomplete="off"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="日期" prop="dateVal">
+            <el-date-picker key="100" style="width:200px" @input="changeDate" v-model="form.dateVal" type="month" placeholder="选择月"></el-date-picker>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="场站编号冗余" prop="windpowerstationId">
+            <el-input class="inputs" v-model="form.windpowerstationId" 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="handleSave()">确 定</el-button>
+			<el-button type="primary" @click="save">确 定</el-button>
 		</div>
 	</el-dialog>
 </template>
 
 <script>
-import api from '@/api/table'
+import api from '@/api/realtimeDatabaseConfiguration'
+import dayjs from "dayjs";
 export default {
 	name: 'TableEdit',
 	props: {
@@ -39,20 +58,30 @@ export default {
 			type: Array,
 			default: []
 		},
+		stationList: {
+			type: Array,
+			default: []
+		},
 	},
 	data() {
 		return {
 			form: {
-				generatingcapacity: '',
-				outagehours: '',
-				cascaderSel: [],
-				dateValues: '',
+				id: "",
+        projectId: "",
+        generatingCapacity: "",
+        outageHours: "",
+        year: "",
+        month: "",
+        windpowerstationId: "",
+        dateVal: ""
 			},
 			rules: {
-				generatingcapacity: [{ required: true, trigger: 'blur', message: '请输入发电量' }],
-				outagehours: [{ required: true, trigger: 'blur', message: '请输入停运小时' }],
-				cascaderSel: [{ required: true, trigger: 'blur', message: '请选择场站' }],
-				dateValues: [{ required: true, trigger: 'blur', message: '请选择日期' }],
+				id: [{ required: true, trigger: 'blur', message: '请输入' }],
+				projectId: [{ required: true, trigger: 'blur', message: '请输入' }],
+				generatingCapacity: [{ required: true, trigger: 'blur', message: '请输入' }],
+				outageHours: [{ required: true, trigger: 'blur', message: '请输入' }],
+				dateVal: [{ required: true, trigger: 'blur', message: '请输入' }],
+				windpowerstationId: [{ required: true, trigger: 'blur', message: '请输入' }],
 			},
 			title: '',
 			dialogFormVisible: false,
@@ -61,6 +90,9 @@ export default {
 	},
 	created() { },
 	methods: {
+    changeDate() {
+      this.$forceUpdate()
+    },
 		showEdit(row) {
 			if (!row) {
 				this.title = '添加'
@@ -69,7 +101,7 @@ export default {
 				this.title = '编辑'
 				this.idAdd = false
 				this.form = Object.assign({}, row)
-				this.form.dateValues = this.form.year && this.form.month ? new Date(`${this.form.year}-${this.form.month}-01`).getTime() : ''
+        this.form.dateVal = this.form.year && this.form.month ? new Date(`${this.form.year}-${this.form.month}-01`).getTime() : ''
 			}
 			this.dialogFormVisible = true
 		},
@@ -79,25 +111,18 @@ export default {
 			this.dialogFormVisible = false
 			this.$emit('fetch-data')
 		},
-		handleSave() {
+		save() {
 			this.$refs['form'].validate(async (valid) => {
 				if (valid) {
-					this.form.year = new Date(this.form.dateValues).getFullYear()
-					this.form.month = new Date(this.form.dateValues).getMonth() + 1
-					if (!this.form.projectid) {
-						this.form.projectid = this.form.cascaderSel[2]
-					}
-					if (!this.form.windpower) {
-						this.form.windpower = this.form.cascaderSel[1]
-					}
-
+          this.form.year = new Date(this.form.dateVal).getFullYear()
+          this.form.month = new Date(this.form.dateVal).getMonth() + 1
 					api.addProjectstudy(this.form).then(res => {
-						if (res.code == 200) {
+						if (res.data) {
 							this.$message({
 								type: 'success',
 								message: '添加成功!'
 							});
-							this.$emit('handleSuccess');
+							this.$emit('save-success');
 							this.dialogFormVisible = false
 						}
 					})
@@ -106,6 +131,13 @@ export default {
 				}
 			})
 		},
+		handleChange() {
+		},
+		onBlur(val, param) {
+			if (typeof (this.form[param]) !== 'number') {
+				this.form[param] = val.replace(/[^0-9]/ig, "")
+			}
+		},
 	},
 }
 </script>
@@ -113,4 +145,11 @@ export default {
 .inputs {
 	width: 200px;
 }
+
+.lists {
+	display: flex;
+	flex-direction: row;
+	align-items: center;
+	justify-content: space-between;
+}
 </style>

+ 164 - 191
src/views/stationConfiguration/projectstudy/index.vue

@@ -1,98 +1,94 @@
 <template>
 	<div class="table-container">
 		<vab-query-form>
-			<vab-query-form-left-panel>
-				<el-form ref="form" :model="queryForm" :inline="true" @submit.native.prevent>
-					<el-form-item>
-						<el-select v-model="queryForm.stationId" placeholder="请选择" clearable>
-							<el-option v-for="item in stationList" :key="item.id" :label="item.name" :value="item.id">
-							</el-option>
-						</el-select>
-					</el-form-item>
-					<el-form-item>
-						<el-button icon="el-icon-search" type="primary" native-type="submit" @click="handleQuery">
-							查询
-						</el-button>
-					</el-form-item>
-				</el-form>
-			</vab-query-form-left-panel>
-			<vab-query-form-right-panel>
-				<el-button icon="el-icon-plus" type="primary" @click="handleAdd">
-					添加
-				</el-button>
-				<el-button icon="el-icon-delete" type="danger" @click="handleDelete">
-					删除
-				</el-button>
-			</vab-query-form-right-panel>
+			<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>
+      <!-- 
+        id	编号	VARCHAR2	50			编号
+        project_id	工程编号	VARCHAR2	50	✓		工程编号
+        generating_capacity	计划发电量	NUMBER	18,2	✓		计划发电量
+        outage_hours	计划停运小时	NUMBER	18,2	✓		计划停运小时
+        year	年	VARCHAR2	50	✓		年
+        month	月	VARCHAR2	50	✓		月
+        windpowerstation_id	场站编号冗余	VARCHAR2	50	✓		场站编号(冗余)
+       -->
+			<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="projectId" align="center" sortable></el-table-column>
+				<el-table-column show-overflow-tooltip label="计划发电量" prop="generatingCapacity" align="center" sortable></el-table-column>
+				<el-table-column show-overflow-tooltip label="计划停运小时" prop="outageHours" align="center" sortable></el-table-column>
+				<el-table-column show-overflow-tooltip label="年" prop="year" align="center" sortable></el-table-column>
+				<el-table-column show-overflow-tooltip label="月" prop="month" align="center" sortable></el-table-column>
+				<el-table-column show-overflow-tooltip label="场站编号冗余" prop="windpowerstationId" 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>
-
-		<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>
-			<el-table-column show-overflow-tooltip label="计划发电量" prop="generatingcapacity" align="center" sortable>
-			</el-table-column>
-			<el-table-column show-overflow-tooltip label="计划停运小时" prop="outagehours" align="center" sortable>
-			</el-table-column>
-			<el-table-column show-overflow-tooltip label="年份" prop="year" align="center" sortable></el-table-column>
-			<el-table-column show-overflow-tooltip label="月份" prop="month" align="center" sortable></el-table-column>
-			<el-table-column show-overflow-tooltip label="操作" width="180px">
-				<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" @handleSuccess="fetchData"></table-edit>
 	</div>
 </template>
-
 <script>
-import api from '@/api/table'
+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 {
-	name: 'ComprehensiveTable',
 	components: {
-		TableEdit
-	},
-	filters: {
-		statusFilter(status) {
-			const statusMap = {
-				published: 'success',
-				draft: 'gray',
-				deleted: 'danger',
-			}
-			return statusMap[status]
-		},
+		UploadExcel,
+		ExportExcel,
+		TableEdit,
 	},
 	data() {
 		return {
-			imgShow: true,
-			list: [],
-			cascaderSel: [],
-			imageList: [],
-			stationList: [],
+			fuzzyQuery_name: '',
 			listLoading: true,
+			list: [],
+			options: [],
+			exportExcel: [],
+			templateExcel: [],
+			elementLoadingText: '正在加载...',
+			selectRows: '',
 			layout: 'total, sizes, prev, pager, next, jumper',
 			total: 0,
 			background: true,
-			selectRows: '',
-			elementLoadingText: '正在加载...',
+			exportList: [],
 			queryForm: {
-				stationId: '',
 				pageNo: 1,
 				pageSize: 20,
-				title: '',
 			},
-			options: []
-		}
+			stationList: [],
+			selectValue: ''
+		};
 	},
 	computed: {
 		height() {
@@ -100,35 +96,86 @@ export default {
 		},
 	},
 	created() {
-		this.getStation()
+		// this.getStation()
 		this.fetchData()
 	},
-	beforeDestroy() { },
-	mounted() { },
 	methods: {
+		getMyExcelData(val) {
+			val.forEach(item => {
+				api.addProjectstudy(item).then(res => {
+					if (res.code == 200) {
+						this.$message({
+							type: 'success',
+							message: '添加成功!'
+						});
+						this.fetchData()
+					}
+				})
+			})
+		},
 		getStation() {
 			stationApi.windpowerstationList({
 				id: '',
 				name: '',
 				companyid: '',
 				pageNum: 1,
-				pageSize: 10000,
+				pageSize: 1000,
 			}).then(res => {
 				if (res.data) {
-					this.queryForm.stationId = ''
+					this.listLoading = false
 					this.stationList = res.data.records
 				}
 			})
 		},
-		tableSortChange() {
-			const imageList = []
-			this.$refs.tableSort.tableData.forEach((item, index) => {
-				imageList.push(item.img)
+    searchFetchData(){
+      this.queryForm.pageNo = 1
+      this.fetchData()
+    },
+		fetchData() {
+			api.projectstudy({
+				projectId: 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: "",
+              projectId: "",
+              generatingCapacity: "",
+              outageHours: "",
+              year: "",
+              month: "",
+              windpowerstationId: "",
+						}
+					]
+					// 导出
+					let exportExcel = []
+					res.data.records.forEach(item => {
+						exportExcel.push({
+							id: item.id,
+              projectId: item.projectId,
+              generatingCapacity: item.generatingCapacity,
+              outageHours: item.outageHours,
+              year: item.year,
+              month: item.month,
+              windpowerstationId: item.windpowerstationId,
+						})
+					})
+					this.exportExcel = exportExcel
+				}
 			})
-			this.imageList = imageList
 		},
-		setSelectRows(val) {
-			this.selectRows = val
+		handleSizeChange(val) {
+			this.queryForm.pageSize = val
+			this.fetchData()
+		},
+		handleCurrentChange(val) {
+			this.queryForm.pageNo = val
+			this.fetchData()
 		},
 		handleAdd() {
 			this.$refs['edit'].showEdit()
@@ -137,125 +184,51 @@ export default {
 			this.$refs['edit'].showEdit(row)
 		},
 		handleDelete(row) {
-			if (row.id) {
-				this.$baseConfirm('你确定要删除当前项吗', null, async () => {
+			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.deleteProjectstudy({
-						id: row.id
+						id: row.id || ids
 					}).then(res => {
-						if (res.code == 200) {
+						if (res.data) {
 							this.$baseMessage('删除成功', 'success')
 							this.fetchData()
 						}
 					})
 				})
 			} else {
-				if (this.selectRows.length > 0) {
-					const ids = this.selectRows.map((item) => item.id).join()
-					this.$baseConfirm('你确定要删除选中项吗', null, async () => {
-						api.deleteProjectstudy({
-							id: ids
-						}).then(res => {
-							if (res.code == 200) {
-								this.$baseMessage('删除成功', 'success')
-								this.fetchData()
-							}
-						})
-					})
-				} else {
-					this.$baseMessage('未选中任何行', 'error')
-					return false
-				}
+				this.$baseMessage('未选中任何行', 'error')
+				return false
 			}
 		},
-		handleSizeChange(val) {
-			this.queryForm.pageSize = val
-			this.fetchData()
-		},
-		handleCurrentChange(val) {
-			this.queryForm.pageNo = val
-			this.fetchData()
-		},
-		handleQuery() {
-			this.queryForm.pageNo = 1
-			this.fetchData()
-		},
-		async fetchData() {
-			this.listLoading = true
-			api.projectstudy({
-				windpower: this.queryForm.stationId,
-				pageNum: this.queryForm.pageNo,
-				pageSize: this.queryForm.pageSize,
-			}).then(res => {
-				if (res.data) {
-					this.total = res.data.total
-					this.list = res.data.records
-					setTimeout(() => {
-						this.listLoading = false
-					}, 500)
-				}
-			})
-
-		},
-		testMessage() {
-			this.$baseMessage('test1', 'success')
-		},
-		testALert() {
-			this.$baseAlert('11')
-			this.$baseAlert('11', '自定义标题', () => {
-				/* 可以写回调; */
-			})
-			this.$baseAlert('11', null, () => {
-				/* 可以写回调; */
-			})
-		},
-		testConfirm() {
-			this.$baseConfirm(
-				'你确定要执行该操作?',
-				null,
-				() => {
-					/* 可以写回调; */
-				},
-				() => {
-					/* 可以写回调; */
-				}
-			)
-		},
-		testNotify() {
-			this.$baseNotify('测试消息提示', 'test', 'success', 'bottom-right')
+		setSelectRows(val) {
+			this.selectRows = val
 		},
-		getSummaries(param) {
-			console.log(11111);
-			const { columns, data } = param;
-			const sums = [];
-			columns.forEach((column, index) => {
-				if (index === 0) {
-					sums[index] = '总计';
-					return;
-				}
-				else if (index === 3) {
-					let totle = 0
-					data.forEach(item => {
-						totle = totle + Number(item.generatingcapacity)
-					})
-					sums[index] = totle;
-				}
-				else if (index === 4) {
-					let totle = 0
-					data.forEach(item => {
-						totle = totle + Number(item.outagehours)
-					})
-					sums[index] = totle;
-				} else {
-					sums[index] = '--';
-				}
-			});
-			return sums;
-		}
 	},
 }
 </script>
 <style lang="less" scoped>
-.cascaders {
-	width: 300px;
+.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>
+</style>