chenxinlei 2 anos atrás
pai
commit
62b65e44f8

+ 16 - 7
src/api/station.js

@@ -40,9 +40,9 @@ const deleteCompanys = (data) => {
 }
 const lines = (data) => {
   return request({
-    url: `/line/listByPage?id=${data.id}&name=${encodeURIComponent(
+    url: `/pro-basic-line/listByPage?id=${data.id}&name=${encodeURIComponent(
       data.name
-    )}&pagenum=${data.pageNum}&pagesize=${data.pageSize}`,
+    )}&pageNum=${data.pageNum}&pageSize=${data.pageSize}`,
     method: 'get',
   })
 }
@@ -108,21 +108,30 @@ const deleteProject = (data) => {
 }
 const addLine = (pairs) => {
   return request({
-    url: `/line/add-Line`,
+    url: `/pro-basic-line/add-line`,
     method: 'post',
     data: pairs,
   })
 }
 const deleteLine = (data) => {
   return request({
-    url: `/line/remove-lines/${data.id}`,
+    url: `/pro-basic-line/remove-lines/${data.id}`,
     method: 'delete',
   })
 }
 
+// DELETE
+// /pro-basic-windturbine/{ids}
+// 风机-删除
+// POST
+// /pro-basic-windturbine/add
+// 风机-新增or修改
+// GET
+// /pro-basic-windturbine/list
+// 发电设备-列表
 const windturbine = (data) => {
   return request({
-    url: `/windturbine/companys?pageNum=${data.pageNum}&pageSize=${
+    url: `/pro-basic-windturbine/list?pageNum=${data.pageNum}&pageSize=${
       data.pageSize
     }&name=${encodeURIComponent(data.name)}`,
     method: 'get',
@@ -130,14 +139,14 @@ const windturbine = (data) => {
 }
 const addWindturbine = (pairs) => {
   return request({
-    url: `/windturbine/add`,
+    url: `/pro-basic-windturbine/add`,
     method: 'post',
     data: pairs,
   })
 }
 const deleteWindturbine = (data) => {
   return request({
-    url: `/windturbine/${data.id}`,
+    url: `/pro-basic-windturbine/${data.id}`,
     method: 'delete',
   })
 }

+ 17 - 15
src/views/stationConfiguration/line/components/TableEdit.vue

@@ -5,8 +5,8 @@
         <el-form-item label="编码" prop="id">
           <el-input placeholder="请输入" class="inputs" v-model="form.id" autocomplete="off" :disabled="!idAdd?true:false"></el-input>
         </el-form-item>
-        <el-form-item label="编号" prop="code">
-          <el-input placeholder="请输入" class="inputs" v-model.trim="form.code" autocomplete="off"></el-input>
+        <el-form-item label="编号" prop="nemCode">
+          <el-input placeholder="请输入" class="inputs" v-model.trim="form.nemCode" autocomplete="off"></el-input>
         </el-form-item>
       </div>
       <div class="lists">
@@ -18,10 +18,10 @@
         </el-form-item>
       </div>
       <div class="lists">
-        <el-form-item label="期次" prop="projectid">
-          <!-- <el-input class="inputs" v-model.trim="form.projectid" autocomplete="off"></el-input> -->
+        <el-form-item label="期次" prop="projectId">
+          <!-- <el-input class="inputs" v-model.trim="form.projectId" autocomplete="off"></el-input> -->
           <el-cascader 
-            v-model="form.projectid" 
+            v-model="form.projectId" 
             :options="options" 
             style="width: 200px" 
             :props="{ checkStrictly: true, label: 'name', value: 'id' , children:'children',}" 
@@ -34,8 +34,8 @@
         </el-form-item>
       </div>
       <div class="lists">
-        <el-form-item label="容量单位" prop="capacityunit">
-          <el-input placeholder="请输入" class="inputs" v-model.trim="form.capacityunit" autocomplete="off"></el-input>
+        <el-form-item label="容量单位" prop="capacityUnit">
+          <el-input placeholder="请输入" class="inputs" v-model.trim="form.capacityUnit" autocomplete="off"></el-input>
         </el-form-item>
         <el-form-item label="装机数量" prop="quantity">
           <el-input placeholder="请输入" class="inputs" v-model.number="form.quantity" autocomplete="off"
@@ -43,8 +43,8 @@
         </el-form-item>
       </div>
       <div class="lists">
-        <el-form-item label="顺序" prop="ordernum">
-          <el-input placeholder="请输入" class="inputs" v-model.trim="form.ordernum" autocomplete="off"></el-input>
+        <el-form-item label="顺序" prop="orderNum">
+          <el-input placeholder="请输入" class="inputs" v-model.trim="form.orderNum" autocomplete="off"></el-input>
         </el-form-item>
       </div>
     </el-form>
@@ -79,19 +79,19 @@ export default {
       form: {
         id: '',
         name: '',
-        code: '',
+        nemCode: '',
       },
       rules: {
         id: [{ required: true, trigger: 'blur', message: '请输入' }],
         name: [{ required: true, trigger: 'blur', message: '请输入' }],
-        code: [{ required: true, trigger: 'blur', message: '请输入' }],
+        nemCode: [{ required: true, trigger: 'blur', message: '请输入' }],
         aname: [{ required: true, trigger: 'blur', message: '请输入' }],
         capacity: [{ required: true, trigger: 'blur', message: '请输入' }],
-        capacityunit: [{ required: true, trigger: 'blur', message: '请输入' }],
+        capacityUnit: [{ required: true, trigger: 'blur', message: '请输入' }],
         model: [{ required: true, trigger: 'blur', message: '请输入' }],
-        ordernum: [{ required: true, trigger: 'blur', message: '请输入' }],
+        orderNum: [{ required: true, trigger: 'blur', message: '请输入' }],
         quantity: [{ required: true, trigger: 'blur', message: '请输入' }],
-        // projectid: [{ required: true, trigger: 'blur', message: '请输入' }],
+        // projectId: [{ required: true, trigger: 'blur', message: '请输入' }],
       },
       title: '',
       dialogFormVisible: false,
@@ -120,7 +120,9 @@ export default {
     save() {
       this.$refs['form'].validate(async (valid) => {
         if (valid) {
-          this.form.projectid = this.form.projectid[this.form.projectid.length - 1]
+          if(Array.isArray(this.form.projectId)) {
+            this.form.projectId = this.form.projectId[this.form.projectId.length - 1]
+          }
           api.addLine(this.form).then(res => {
             if (res.data) {
               this.$message({

+ 15 - 13
src/views/stationConfiguration/line/index.vue

@@ -29,14 +29,15 @@
         :height="height" @selection-change="setSelectRows">
         <el-table-column show-overflow-tooltip type="selection" width="55" align="center"></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="code" 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 :formatter="nameEcho" show-overflow-tooltip label="期次" prop="projectid" align="center" sortable></el-table-column>
+        <!-- :formatter="nameEcho"  -->
+        <el-table-column show-overflow-tooltip label="期次" prop="projectId" align="center" sortable></el-table-column>
         <el-table-column show-overflow-tooltip label="装机容量" prop="capacity" align="center" sortable></el-table-column>
-        <el-table-column show-overflow-tooltip label="装机单位" prop="capacityunit" align="center" sortable></el-table-column>
+        <el-table-column show-overflow-tooltip label="装机单位" prop="capacityUnit" align="center" sortable></el-table-column>
         <el-table-column show-overflow-tooltip label="装机数量" prop="quantity" 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="顺序" prop="orderNum" align="center" sortable></el-table-column>
         <el-table-column show-overflow-tooltip label="操作" width="100px" fixed="right">
           <template #default="{ row }" fixed="right">
             <el-button type="text" @click="handleEdit(row)">编辑</el-button>
@@ -55,6 +56,7 @@
 import UploadExcel from '@/components/UploadExcel/index'
 import ExportExcel from '@/components/ExportExcel/index'
 import api from '@/api/station'
+import apis from '@/api/table'
 import TableEdit from './components/TableEdit'
 import { recursionTree } from '@/utils/deepTree'
 export default {
@@ -113,7 +115,7 @@ export default {
       return str
     },
     getTree() {
-      api.newtreeTreels({tag:3}).then(res => {
+      apis.newtreeTreels({tag:3}).then(res => {
         if (res.data) {
           this.options = res.data
           this.deepTreeData = recursionTree(res.data)
@@ -148,14 +150,14 @@ export default {
           this.templateExcel = [
             {
               id: '',
-              code: '',
+              nemCode: '',
               name: '',
               aname: '',
-              projectid: '',
+              projectId: '',
               capacity: '',
-              capacityunit: '',
+              capacityUnit: '',
               quantity: '',
-              ordernum: '',
+              orderNum: '',
             }
           ]
           // 导出
@@ -163,14 +165,14 @@ export default {
           res.data.records.forEach(item => {
             exportExcel.push({
               id: item.id,
-              code: item.code,
+              nemCode: item.nemCode,
               name: item.name,
               aname: item.aname,
-              projectid: item.projectid,
+              projectId: item.projectId,
               capacity: item.capacity,
-              capacityunit: item.capacityunit,
+              capacityUnit: item.capacityUnit,
               quantity: item.quantity,
-              ordernum: item.ordernum,
+              orderNum: item.orderNum,
             })
           })
           this.exportExcel = exportExcel

+ 1 - 1
src/views/stationConfiguration/period/index.vue

@@ -112,7 +112,7 @@ export default {
       this.fetchData()
     },
     getTree() {
-      apis.newtreeTreels({ tag: 3 }).then(res => {
+      apis.newtreeTreels({ tag: 2 }).then(res => {
         if (res.data) {
           this.options = res.data
           this.fetchData()

+ 57 - 36
src/views/stationConfiguration/windterbin/components/TableEdit.vue

@@ -5,45 +5,45 @@
         <el-form-item label="编码" prop="id">
           <el-input placeholder="请输入" class="inputs" v-model="form.id" autocomplete="off" :disabled="!idAdd?true:false"></el-input>
         </el-form-item>
-        <el-form-item label="编号" prop="status">
-          <el-input placeholder="请输入" class="inputs" v-model.trim="form.status" autocomplete="off"></el-input>
+        <el-form-item label="编号" prop="nemCode">
+          <el-input placeholder="请输入" class="inputs" v-model.trim="form.nemCode" autocomplete="off"></el-input>
         </el-form-item>
       </div>
       <div class="lists">
         <el-form-item label="风机名称" prop="name">
           <el-input placeholder="请输入" class="inputs" v-model="form.name" autocomplete="off"></el-input>
         </el-form-item>
-        <el-form-item label="首次并网时间" prop="firstintegratedtime">
-          <el-date-picker style="width: 200px" v-model="form.firstintegratedtime" type="date" placeholder="选择日期">
+        <el-form-item label="首次并网时间" prop="firstIntegratedTime">
+          <el-date-picker style="width: 200px" v-model="form.firstIntegratedTime" type="date" placeholder="选择日期">
           </el-date-picker>
         </el-form-item>
       </div>
       <div class="lists">
-        <el-form-item label="风场编号" prop="windpowerstationid">
-          <!-- <el-select v-model="form.windpowerstationid" placeholder="请选择" clearable>
+        <el-form-item label="风场编号" prop="windpowerstationId">
+          <!-- <el-select v-model="form.windpowerstationId" placeholder="请选择" clearable>
             <el-option v-for="item in stationList" :key="item.id" :label="item.name" :value="item.id">
             </el-option>
           </el-select> -->
           <el-cascader 
-            @change="windpowerstationidChange"
+            @change="windpowerstationIdChange"
             placeholder="请选择"
-            v-model="form.windpowerstationid" 
-            :options="windpowerstationid_options" 
+            v-model="form.windpowerstationId" 
+            :options="windpowerstationId_options" 
             style="width: 200px" 
             :props="{ checkStrictly: true, label: 'name', value: 'id' , children:'children'}"
             clearable />
         </el-form-item>
-        <el-form-item label="工程编号" prop="projectid">
-          <el-input placeholder="请输入" class="inputs" v-model.trim="form.projectid" autocomplete="off"></el-input>
+        <el-form-item label="工程编号" prop="projectId">
+          <el-input placeholder="请输入" class="inputs" v-model.trim="form.projectId" autocomplete="off"></el-input>
         </el-form-item>
       </div>
       <div class="lists">
-        <el-form-item label="线路编号" prop="lineid">
-          <!-- <el-input class="inputs" v-model.trim="form.lineid" autocomplete="off"></el-input> -->
+        <el-form-item label="线路编号" prop="lineId">
+          <!-- <el-input class="inputs" v-model.trim="form.lineId" autocomplete="off"></el-input> -->
           <el-cascader 
             placeholder="请选择"
-            v-model="form.lineid" 
-            :options="lineid_options" 
+            v-model="form.lineId" 
+            :options="lineId_options" 
             style="width: 200px" 
             :props="{ checkStrictly: true, label: 'name', value: 'id' , children:'children'}"
             clearable />
@@ -56,8 +56,16 @@
         <el-form-item label="地球经度" prop="longitude">
           <el-input placeholder="请输入" class="inputs" v-model="form.longitude" autocomplete="off"></el-input>
         </el-form-item>
-        <el-form-item label="机型" prop="modelid">
-          <el-input placeholder="请输入" class="inputs" v-model.trim="form.modelid" autocomplete="off"></el-input>
+        <el-form-item label="机型" prop="equipmentCategory">
+          <!-- <el-input placeholder="请输入" class="inputs" v-model.trim="form.equipmentCategory" autocomplete="off"></el-input> -->
+           <el-select v-model="form.equipmentCategory" placeholder="请选择" style="width:200px">
+            <el-option
+              v-for="item in equipmentCategoryOptions"
+              :key="item.id"
+              :label="item.name"
+              :value="item.id">
+            </el-option>
+          </el-select>
         </el-form-item>
       </div>
       <div class="lists">
@@ -65,9 +73,9 @@
           <el-input placeholder="请输入" class="inputs" v-model="form.photo" autocomplete="off">
           </el-input>
         </el-form-item>
-        <el-form-item label="标杆风机" prop="standardid">
+        <!-- <el-form-item label="标杆风机" prop="standardid">
           <el-input placeholder="请输入" class="inputs" v-model.trim="form.standardid" autocomplete="off"></el-input>
-        </el-form-item>
+        </el-form-item> -->
       </div>
     </el-form>
     <div slot="footer" class="dialog-footer">
@@ -79,6 +87,7 @@
 
 <script>
 import api from '@/api/station'
+import apis from '@/api/table'
 import dayjs from "dayjs";
 import { recursionTree, recursionTreeChildren } from '@/utils/deepTree'
 
@@ -96,9 +105,15 @@ export default {
   },
   data() {
     return {
+      // 0:风机;1:集中;2:组串
+      equipmentCategoryOptions: [
+        {id: 0, name: "风机"},
+        {id: 1, name: "集中"},
+        {id: 2, name: "组串"},
+      ],
       optionsAll: [],
-      windpowerstationid_options: [],
-      lineid_options: [],
+      windpowerstationId_options: [],
+      lineId_options: [],
       form: {
         id: '',
         name: '',
@@ -107,14 +122,14 @@ export default {
       rules: {
         id: [{ required: true, trigger: 'blur', message: '请输入' }],
         name: [{ required: true, trigger: 'blur', message: '请输入' }],
-        status: [{ required: true, trigger: 'blur', message: '请输入' }],
-        firstintegratedtime: [{ required: true, trigger: 'blur', message: '请输入' }],
-        windpowerstationid: [{ required: true, trigger: 'blur', message: '请输入' }],
-        projectid: [{ required: true, trigger: 'blur', message: '请输入' }],
-        lineid: [{ required: true, trigger: 'blur', message: '请输入' }],
+        nemCode: [{ required: true, trigger: 'blur', message: '请输入' }],
+        firstIntegratedTime: [{ required: true, trigger: 'blur', message: '请输入' }],
+        windpowerstationId: [{ required: true, trigger: 'blur', message: '请输入' }],
+        projectId: [{ required: true, trigger: 'blur', message: '请输入' }],
+        lineId: [{ required: true, trigger: 'blur', message: '请输入' }],
         latitude: [{ required: true, trigger: 'blur', message: '请输入' }],
         longitude: [{ required: true, trigger: 'blur', message: '请输入' }],
-        modelid: [{ required: true, trigger: 'blur', message: '请输入' }],
+        equipmentCategory: [{ required: true, trigger: 'blur', message: '请输入' }],
         photo: [{ required: true, trigger: 'blur', message: '请输入' }],
         standardid: [{ required: true, trigger: 'blur', message: '请输入' }],
       },
@@ -126,20 +141,21 @@ export default {
   created() {
   },
   methods: {
-    windpowerstationidChange(data){
+    windpowerstationIdChange(data){
       if(data){
-        this.lineid_options = recursionTreeChildren(data[data.length - 1], this.optionsAll)
+        this.lineId_options = recursionTreeChildren(data[data.length - 1], this.optionsAll)
       }
     },
     getTree() {
-      api.newtreeTreels({tag:2}).then(res => {
+      apis.newtreeTreels({tag:2}).then(res => {
         if (res.data) {
-          this.windpowerstationid_options = res.data
+          this.windpowerstationId_options = res.data
         }
       })
-      api.newtreeTreels({tag:4}).then(res => {
+      apis.newtreeTreels({tag:4}).then(res => {
         if (res.data) {
           this.optionsAll = res.data
+          this.lineId_options = recursionTreeChildren(this.form.windpowerstationId, this.optionsAll)
         }
       })
     },
@@ -152,7 +168,6 @@ export default {
         this.title = '编辑'
         this.idAdd = false
         this.form = Object.assign({}, row)
-        // this.lineid_options = recursionTreeChildren(this.form.windpowerstationid, this.optionsAll)
       }
       this.dialogFormVisible = true
     },
@@ -165,9 +180,15 @@ export default {
     save() {
       this.$refs['form'].validate(async (valid) => {
         if (valid) {
-          this.form.windpowerstationid = this.form.windpowerstationid[this.form.windpowerstationid.length - 1]
-          this.form.lineid = this.form.lineid[this.form.lineid.length - 1]
-          this.form.firstintegratedtime = dayjs(this.form.firstintegratedtime).format("YYYY-MM-DD")
+          if(Array.isArray(this.form.windpowerstationId)) {
+            this.form.windpowerstationId = this.form.windpowerstationId[this.form.windpowerstationId.length - 1]
+          }
+          if(Array.isArray(this.form.lineId)) {
+            this.form.lineId = this.form.lineId[this.form.lineId.length - 1]
+          }
+          // this.form.windpowerstationId = this.form.windpowerstationId[this.form.windpowerstationId.length - 1]
+          // this.form.lineId = this.form.lineId[this.form.lineId.length - 1]
+          this.form.firstIntegratedTime = dayjs(this.form.firstIntegratedTime).format("YYYY-MM-DD")
           api.addWindturbine(this.form).then(res => {
             if (res.data) {
               this.$message({

+ 23 - 22
src/views/stationConfiguration/windterbin/index.vue

@@ -28,17 +28,17 @@
         :height="height" @selection-change="setSelectRows">
         <el-table-column show-overflow-tooltip type="selection" width="55" align="center"></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="status" 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 width="150" show-overflow-tooltip label="首次并网时间" prop="firstintegratedtime" 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="工程编号" prop="projectid" align="center" sortable></el-table-column>
-        <el-table-column show-overflow-tooltip label="线路编号" prop="lineid" align="center" sortable></el-table-column>
+        <el-table-column width="150" show-overflow-tooltip label="首次并网时间" prop="firstIntegratedTime" 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="工程编号" prop="projectId" align="center" sortable></el-table-column>
+        <el-table-column show-overflow-tooltip label="线路编号" prop="lineId" align="center" sortable></el-table-column>
         <el-table-column show-overflow-tooltip label="地球纬度" prop="latitude" align="center" sortable></el-table-column>
         <el-table-column show-overflow-tooltip label="地球经度" prop="longitude" 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="equipmentCategory" 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="standardid" align="center" sortable></el-table-column>
+        <!-- <el-table-column show-overflow-tooltip label="标杆风机" prop="isStandard" align="center" sortable></el-table-column> -->
         <el-table-column show-overflow-tooltip label="操作" fixed="right">
           <template #default="{ row }">
             <el-button type="text" @click="handleEdit(row)">编辑</el-button>
@@ -57,6 +57,7 @@
 import UploadExcel from '@/components/UploadExcel/index'
 import ExportExcel from '@/components/ExportExcel/index'
 import api from '@/api/station'
+import apis from '@/api/table'
 import TableEdit from './components/TableEdit'
 import { recursionTree } from '@/utils/deepTree'
 export default {
@@ -115,7 +116,7 @@ export default {
       return str
     },
     getTree() {
-      api.newtreeTreels({tag:4}).then(res => {
+      apis.newtreeTreels({tag:4}).then(res => {
         if (res.data) {
           this.options = res.data
           this.deepTreeData = recursionTree(res.data)
@@ -162,17 +163,17 @@ export default {
           this.templateExcel = [
             {
               id: '',
-              status: '',
+              nemCode: '',
               name: '',
-              firstintegratedtime: '',
-              windpowerstationid: '',
-              projectid: '',
-              lineid: '',
+              firstIntegratedTime: '',
+              windpowerstationId: '',
+              projectId: '',
+              lineId: '',
               latitude: '',
               longitude: '',
-              modelid: '',
+              equipmentCategory: '',
               photo: '',
-              standardid: '',
+              isStandard: '',
             }
           ]
           // 导出
@@ -180,17 +181,17 @@ export default {
           res.data.records.forEach(item => {
             exportExcel.push({
               id: item.id,
-              status: item.status,
+              nemCode: item.nemCode,
               name: item.name,
-              firstintegratedtime: item.firstintegratedtime,
-              windpowerstationid: item.windpowerstationid,
-              projectid: item.projectid,
-              lineid: item.lineid,
+              firstIntegratedTime: item.firstIntegratedTime,
+              windpowerstationId: item.windpowerstationId,
+              projectId: item.projectId,
+              lineId: item.lineId,
               latitude: item.latitude,
               longitude: item.longitude,
-              modelid: item.modelid,
+              equipmentCategory: item.equipmentCategory,
               photo: item.photo,
-              standardid: item.standardid,
+              isStandard: item.isStandard,
             })
           })
           this.exportExcel = exportExcel