Browse Source

feat:测点配置内的设备点表配置和场站点表配置接口联调配置

chenxinlei 2 years ago
parent
commit
d58a7d95b0

+ 62 - 2
src/api/pointConfiguration.js

@@ -6,7 +6,7 @@ const standardpointList = (data) => {
     method: 'get',
   })
 }
-// 添加 
+// 添加
 const addStandardpoint = (pairs) => {
   return request({
     url: `/standardpoint/add`,
@@ -14,16 +14,76 @@ const addStandardpoint = (pairs) => {
     data: pairs,
   })
 }
-// 删除 
+// 删除
 const deleteStandardpoint = (data) => {
   return request({
     url: `/standardpoint/${data.id}`,
     method: 'delete',
   })
 }
+// 设备点表
+// 查询  http://localhost:7020/windturbinetestingpointnew/list?pageNum=1&pageSize=1
+// 添加:ttp://localhost:7020/windturbinetestingpointnew/add
+// 删除:ttp://localhost:7020/windturbinetestingpointnew/
+// 列表
+const windturbinetestingpointnewList = (data) => {
+  return request({
+    url: `/windturbinetestingpointnew/list?id=${data.id}&code=${data.code}&name=${data.name}&model=${data.model}&uniformcode=${data.uniformcode}&windpowerstationid=${data.windpowerstationid}&pageNum=${data.pageNum}&pageSize=${data.pageSize}`,
+    method: 'get',
+  })
+}
+// 添加
+const addWindturbinetestingpointnew = (pairs) => {
+  return request({
+    url: `/windturbinetestingpointnew/add`,
+    method: 'post',
+    data: pairs,
+  })
+}
+// 删除
+const deleteWindturbinetestingpointnew = (data) => {
+  return request({
+    url: `/windturbinetestingpointnew/${data.id}`,
+    method: 'delete',
+  })
+}
+// 场站点表
+// 查询 http://localhost:7020/windpowerstationpointnew/list?pageNum=1&pageSize=1
+// 添加 http://localhost:7020/windpowerstationpointnew/add
+// 删除:http://localhost:7020/windpowerstationpointnew/
+// 列表
+const windpowerstationpointnewList = (data) => {
+  return request({
+    url: `/windpowerstationpointnew/list?id=${data.id}&code=${data.code}&name=${data.name}&model=${data.model}&uniformcode=${data.uniformcode}&windpowerstationid=${data.windpowerstationid}&pageNum=${data.pageNum}&pageSize=${data.pageSize}`,
+    method: 'get',
+  })
+}
+// 添加
+const addWindpowerstationpointnew = (pairs) => {
+  return request({
+    url: `/windpowerstationpointnew/add`,
+    method: 'post',
+    data: pairs,
+  })
+}
+// 删除
+const deleteWindpowerstationpointnew = (data) => {
+  return request({
+    url: `/windpowerstationpointnew/${data.id}`,
+    method: 'delete',
+  })
+}
 
 export default {
   deleteStandardpoint,
   standardpointList,
   addStandardpoint,
+  //
+  windturbinetestingpointnewList,
+  addWindturbinetestingpointnew,
+  deleteWindturbinetestingpointnew,
+  //
+  windpowerstationpointnewList,
+  addWindpowerstationpointnew,
+  deleteWindpowerstationpointnew,
 }

+ 35 - 1
src/router/index.js

@@ -128,13 +128,47 @@ export const asyncRoutes = [
         component: () => import("@/views/pointConfiguration/index"),
         meta: {
           title: "测点配置",
-          icon: "marker",
+          icon: "allergies",
           permissions: ["admin"],
         },
       },
     ],
   },
   // {
+  //   path: "/equipmentAllocation",
+  //   component: Layout,
+  //   redirect: "noRedirect",
+  //   children: [
+  //     {
+  //       path: "equipmentAllocation",
+  //       name: "equipmentAllocation",
+  //       component: () => import("@/views/pointConfiguration/equipmentAllocation/index"),
+  //       meta: {
+  //         title: "设备点表配置",
+  //         icon: "marker",
+  //         permissions: ["admin"],
+  //       },
+  //     },
+  //   ],
+  // },
+  // {
+  //   path: "/stationAllocation",
+  //   component: Layout,
+  //   redirect: "noRedirect",
+  //   children: [
+  //     {
+  //       path: "stationAllocation",
+  //       name: "stationAllocation",
+  //       component: () => import("@/views/pointConfiguration/stationAllocation/index"),
+  //       meta: {
+  //         title: "场站点表配置",
+  //         icon: "marker",
+  //         permissions: ["admin"],
+  //       },
+  //     },
+  //   ],
+  // },
+  // {
   //   path: '/personnelManagement',
   //   component: Layout,
   //   redirect: 'noRedirect',

+ 3 - 3
src/views/pointConfiguration/components/TableEdit.vue

@@ -1,9 +1,9 @@
 <template>
   <el-dialog :title="title" :visible.sync="dialogFormVisible" width="800px" @close="close">
     <el-form ref="form" :model="form" :rules="rules"  label-width="80px">
-      <el-form-item label="id" prop="id">
+      <!-- <el-form-item label="id" prop="id">
         <el-input placeholder="请输入" class="inputs" v-model.trim="form.id" autocomplete="off" :disabled="!idAdd?true:false"></el-input>
-      </el-form-item>
+      </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>
@@ -53,7 +53,7 @@ export default {
         type: '',
       },
       rules: {
-        id: [{ required: true, trigger: 'blur', message: '请输入' }],
+        // id: [{ required: true, trigger: 'blur', message: '请输入' }],
         code: [{ required: true, trigger: 'blur', message: '请输入' }],
         name: [{ required: true, trigger: 'blur', message: '请输入' }],
         type: [{ required: true, trigger: 'blur', message: '请输入' }],

+ 121 - 0
src/views/pointConfiguration/equipmentAllocation/components/TableEdit.vue

@@ -0,0 +1,121 @@
+<template>
+  <el-dialog :title="title" :visible.sync="dialogFormVisible" width="800px" @close="close">
+    <el-form ref="form" :model="form" :rules="rules"  label-width="80px">
+      <el-form-item label="编码" prop="code">
+        <el-input placeholder="请输入" class="inputs" v-model.trim="form.code" autocomplete="off"></el-input>
+      </el-form-item>
+      <el-form-item label="名称" prop="name">
+        <el-input placeholder="请输入" class="inputs" v-model.trim="form.name" autocomplete="off"></el-input>
+      </el-form-item>
+      <el-form-item label="型号" prop="model">
+        <el-input placeholder="请输入" class="inputs" v-model.trim="form.model" autocomplete="off"></el-input>
+      </el-form-item>
+      <el-form-item label="统一编码" prop="uniformcode">
+        <el-input placeholder="请输入" class="inputs" v-model.trim="form.uniformcode" autocomplete="off"></el-input>
+      </el-form-item>
+      <el-form-item label="场站编号" prop="windpowerstationid">
+        <el-input placeholder="请输入" class="inputs" v-model.trim="form.windpowerstationid" autocomplete="off"></el-input>
+      </el-form-item>
+      <!-- <el-form-item label="类型" prop="type">
+        <el-select class="inputs" v-model="form.type" placeholder="请选择">
+          <el-option
+            v-for="item in typeOptions"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value">
+          </el-option>
+        </el-select>
+      </el-form-item> -->
+    </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/pointConfiguration'
+import axios from "axios";
+export default {
+  name: 'TableEdit',
+  props: {
+    options: {
+      type: Array,
+      default: []
+    },
+  },
+  data() {
+    return {
+      typeOptions: [
+        {value: '风机计算', label:'风机计算'},
+        {value: '场站计算', label:'场站计算'},
+        {value: '风机基础点', label:'风机基础点'},
+      ],
+      form: {
+        id: '',
+        code: '',
+        name: '',
+        model: '',
+        uniformcode: '',
+        windpowerstationid: '',
+      },
+      rules: {
+        code: [{ required: true, trigger: 'blur', message: '请输入' }],
+        name: [{ required: true, trigger: 'blur', message: '请输入' }],
+        model: [{ required: true, trigger: 'blur', message: '请输入' }],
+        uniformcode: [{ required: true, trigger: 'blur', message: '请输入' }],
+        windpowerstationid: [{ required: true, trigger: 'blur', message: '请输入' }],
+      },
+      title: '',
+      dialogFormVisible: false,
+      idAdd: true,
+    }
+  },
+  created() { },
+  methods: {
+    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.addWindturbinetestingpointnew(this.form).then(res => {
+            if (res.data) {
+              this.$message({
+                type: 'success',
+                message: '添加成功!'
+              });
+              this.$emit('save-success');
+              this.dialogFormVisible = false
+            }
+          })
+        } else {
+          return false
+        }
+      })
+    },
+    handleChange() {
+    },
+  },
+}
+</script>
+<style lang="less" scoped>
+.inputs {
+  width: 200px;
+}
+</style>

+ 213 - 0
src/views/pointConfiguration/equipmentAllocation/index.vue

@@ -0,0 +1,213 @@
+<template>
+  <div class="table-container">
+    <!-- <vab-query-form> -->
+      <!-- <vab-query-form-left-panel> -->
+        <el-row>
+          <el-button @click="getBack" style="float: right; margin:0 0 10px 0">返回</el-button>
+        </el-row>
+        <el-form ref="form" :model="queryForm" :inline="true" @submit.native.prevent>
+          <el-form-item label="编码"><el-input placeholder="请输入" v-model="form.code"></el-input></el-form-item>
+          <el-form-item label="名称"><el-input placeholder="请输入" v-model="form.name"></el-input></el-form-item>
+          <el-form-item label="型号"><el-input placeholder="请输入" v-model="form.model"></el-input></el-form-item>
+          <el-form-item label="统一编码"><el-input placeholder="请输入" v-model="form.uniformcode"></el-input></el-form-item>
+          <el-form-item label="场站编号"><el-input placeholder="请输入" v-model="form.windpowerstationid"></el-input></el-form-item>
+          <!-- <el-form-item label="类型">
+            <el-select v-model="form.type" placeholder="请选择">
+              <el-option
+                v-for="item in typeOptions"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value">
+              </el-option>
+            </el-select>
+          </el-form-item> -->
+          <el-form-item>
+            <el-button icon="el-icon-search" type="primary" native-type="submit" @click="fetchData">查询</el-button>
+          </el-form-item>
+          <el-form-item style="float: 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>
+          </el-form-item>
+        </el-form>
+      <!-- </vab-query-form-left-panel> -->
+      <!-- <vab-query-form-right-panel> -->
+        <!-- <UploadExcel style="margin-left: 10px;" @getResult="getMyExcelData"></UploadExcel>
+        <ExportExcel :exportList="exportExcel" partsName="公司"></ExportExcel> -->
+      <!-- </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">
+      <el-table-column show-overflow-tooltip type="selection" width="55"></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="model" align="center" sortable></el-table-column>
+      <el-table-column show-overflow-tooltip label="统一编码" prop="uniformcode" 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="180px">
+        <template #default="{ row }">
+          <el-button type="text" @click="handleEdit(row)">编辑</el-button>
+          <el-button type="text" @click="handleDelete(row)">删除</el-button>
+          <!-- <el-button type="text" @click="handleDelete(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" @save-success="fetchData"></table-edit>
+  </div>
+</template>
+<script>
+// import UploadExcel from '@/components/UploadExcel/index'
+// import ExportExcel from '@/components/ExportExcel/index'
+import TableEdit from './components/TableEdit'
+import api from '@/api/pointConfiguration'
+export default {
+   props: {
+    showValue: {
+      type: Object,
+      default: {}
+    },
+  },
+  components: {
+    // UploadExcel,
+    // ExportExcel,
+    TableEdit,
+  },
+  data() {
+    return {
+      typeOptions: [
+        {value: '风机计算', label:'风机计算'},
+        {value: '场站计算', label:'场站计算'},
+        {value: '风机基础点', label:'风机基础点'},
+      ],
+      form :{
+        code: '',
+        name: '',
+        model: '',
+        uniformcode: '',
+        windpowerstationid: '',
+      },
+      // 
+      // fuzzyQuery: '',
+      listLoading: true,
+      list: [],
+      options: [],
+      exportExcel: [],
+      elementLoadingText: '正在加载...',
+      selectRows: '',
+      layout: 'total, sizes, prev, pager, next, jumper',
+      total: 0,
+      background: true,
+      exportList: [],
+      queryForm: {
+        pageNo: 1,
+        pageSize: 20,
+      },
+    };
+  },
+  created() {
+    this.fetchData()
+    this.form.code = this.showValue.code
+    this.form.name = this.showValue.name
+  },
+  computed: {
+    height() {
+      return this.$baseTableHeight() + 50
+    },
+  },
+  methods: {
+    getBack(){
+      this.$emit("cutState" , 1)
+    },
+    getMyExcelData(val) {
+      val.forEach(item => {
+        api.addCompanys(item).then(res => {
+          if (res.code == 200) {
+            this.$message({
+              type: 'success',
+              message: '添加成功!'
+            });
+            this.fetchData()
+          }
+        })
+      })
+
+    },
+    fetchData() {
+      this.listLoading = true
+      api.windturbinetestingpointnewList({
+        id: '',
+        code: this.form.code ? this.form.code : this.showValue.code,
+        name: this.form.name ? this.form.name : this.showValue.name,
+        model: this.form.model,
+        uniformcode: this.form.uniformcode,
+        windpowerstationid: this.form.windpowerstationid,
+        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
+          let exportExcel = []
+          res.data.records.forEach(item => {
+            exportExcel.push({
+              id: item.id,
+              name: item.name,
+              rid: item.rid,
+            })
+          })
+          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.deleteWindturbinetestingpointnew({
+            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>
+ a{
+  float: right;
+ }
+</style>

+ 71 - 50
src/views/pointConfiguration/index.vue

@@ -1,58 +1,64 @@
 <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 label="统一编码"><el-input placeholder="请输入" v-model="form.code"></el-input></el-form-item>
-          <el-form-item label="名称"><el-input placeholder="请输入" v-model="form.name"></el-input></el-form-item>
-          <el-form-item label="类型">
-            <el-select v-model="form.type" placeholder="请选择">
-              <el-option
-                v-for="item in typeOptions"
-                :key="item.value"
-                :label="item.label"
-                :value="item.value">
-              </el-option>
-            </el-select>
-          </el-form-item>
-          <el-form-item>
-            <el-button icon="el-icon-search" type="primary" native-type="submit" @click="fetchData">查询</el-button>
-          </el-form-item>
-          <el-form-item style="float: 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>
-          </el-form-item>
-        </el-form>
-      <!-- </vab-query-form-left-panel> -->
-      <!-- <vab-query-form-right-panel> -->
-        <!-- <UploadExcel style="margin-left: 10px;" @getResult="getMyExcelData"></UploadExcel>
-        <ExportExcel :exportList="exportExcel" partsName="公司"></ExportExcel> -->
-      <!-- </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">
-      <el-table-column show-overflow-tooltip type="selection" width="55"></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="type" align="center" sortable></el-table-column>
-      <el-table-column show-overflow-tooltip label="操作" width="260px">
-        <template #default="{ row }">
-          <el-button type="text" @click="handleEdit(row)">编辑</el-button>
-          <el-button type="text" @click="handleDelete(row)">删除</el-button>
-          <el-button type="text" @click="handleDelete(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" @save-success="fetchData"></table-edit>
+    <template v-if="showState === 1">
+      <!-- <vab-query-form> -->
+        <!-- <vab-query-form-left-panel> -->
+          <el-form ref="form" :model="queryForm" :inline="true" @submit.native.prevent>
+            <el-form-item label="统一编码"><el-input placeholder="请输入" v-model="form.code"></el-input></el-form-item>
+            <el-form-item label="名称"><el-input placeholder="请输入" v-model="form.name"></el-input></el-form-item>
+            <el-form-item label="类型">
+              <el-select v-model="form.type" placeholder="请选择">
+                <el-option
+                  v-for="item in typeOptions"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value">
+                </el-option>
+              </el-select>
+            </el-form-item>
+            <el-form-item>
+              <el-button icon="el-icon-search" type="primary" native-type="submit" @click="fetchData">查询</el-button>
+            </el-form-item>
+            <el-form-item style="float: 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>
+            </el-form-item>
+          </el-form>
+        <!-- </vab-query-form-left-panel> -->
+        <!-- <vab-query-form-right-panel> -->
+          <!-- <UploadExcel style="margin-left: 10px;" @getResult="getMyExcelData"></UploadExcel>
+          <ExportExcel :exportList="exportExcel" partsName="公司"></ExportExcel> -->
+        <!-- </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">
+        <el-table-column show-overflow-tooltip type="selection" width="55"></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="type" align="center" sortable></el-table-column>
+        <el-table-column show-overflow-tooltip label="操作" width="260px">
+          <template #default="{ row }">
+            <el-button type="text" @click="handleEdit(row)">编辑</el-button>
+            <el-button type="text" @click="handleDelete(row)">删除</el-button>
+            <el-button type="text" @click="equipmentAllocation(row)">设备点表配置</el-button>
+            <el-button type="text" @click="stationAllocation(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" @save-success="fetchData"></table-edit>
+    </template>
+    <EquipmentAllocation :showValue="showData" v-if="showState === 2" @cutState="cutState"/>
+    <StationAllocation :showValue="showData" v-if="showState === 3" @cutState="cutState"/>
   </div>
 </template>
 <script>
-// import UploadExcel from '@/components/UploadExcel/index'
+import EquipmentAllocation from './equipmentAllocation/index'
+import StationAllocation from './stationAllocation/index'
+// import ExportExcel from '@/components/ExportExcel/index'
 // import ExportExcel from '@/components/ExportExcel/index'
 import TableEdit from './components/TableEdit'
 import api from '@/api/pointConfiguration'
@@ -61,9 +67,13 @@ export default {
     // UploadExcel,
     // ExportExcel,
     TableEdit,
+    EquipmentAllocation,
+    StationAllocation
   },
   data() {
     return {
+      showState: 1,
+      showData: {},
       typeOptions: [
         {value: '风机计算', label:'风机计算'},
         {value: '场站计算', label:'场站计算'},
@@ -101,6 +111,17 @@ export default {
     },
   },
   methods: {
+    cutState(data){
+      this.showState = data
+    },
+    equipmentAllocation(data){
+      this.showState = 2
+      this.showData = data
+    },
+    stationAllocation(data){
+      this.showState = 3
+      this.showData = data
+    },
     getMyExcelData(val) {
       val.forEach(item => {
         api.addCompanys(item).then(res => {

+ 121 - 0
src/views/pointConfiguration/stationAllocation/components/TableEdit.vue

@@ -0,0 +1,121 @@
+<template>
+  <el-dialog :title="title" :visible.sync="dialogFormVisible" width="800px" @close="close">
+    <el-form ref="form" :model="form" :rules="rules"  label-width="80px">
+      <el-form-item label="编码" prop="code">
+        <el-input placeholder="请输入" class="inputs" v-model.trim="form.code" autocomplete="off"></el-input>
+      </el-form-item>
+      <el-form-item label="名称" prop="name">
+        <el-input placeholder="请输入" class="inputs" v-model.trim="form.name" autocomplete="off"></el-input>
+      </el-form-item>
+      <el-form-item label="型号" prop="model">
+        <el-input placeholder="请输入" class="inputs" v-model.trim="form.model" autocomplete="off"></el-input>
+      </el-form-item>
+      <el-form-item label="统一编码" prop="uniformcode">
+        <el-input placeholder="请输入" class="inputs" v-model.trim="form.uniformcode" autocomplete="off"></el-input>
+      </el-form-item>
+      <el-form-item label="场站编号" prop="windpowerstationid">
+        <el-input placeholder="请输入" class="inputs" v-model.trim="form.windpowerstationid" autocomplete="off"></el-input>
+      </el-form-item>
+      <!-- <el-form-item label="类型" prop="type">
+        <el-select class="inputs" v-model="form.type" placeholder="请选择">
+          <el-option
+            v-for="item in typeOptions"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value">
+          </el-option>
+        </el-select>
+      </el-form-item> -->
+    </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/pointConfiguration'
+import axios from "axios";
+export default {
+  name: 'TableEdit',
+  props: {
+    options: {
+      type: Array,
+      default: []
+    },
+  },
+  data() {
+    return {
+      typeOptions: [
+        {value: '风机计算', label:'风机计算'},
+        {value: '场站计算', label:'场站计算'},
+        {value: '风机基础点', label:'风机基础点'},
+      ],
+      form: {
+        id: '',
+        code: '',
+        name: '',
+        model: '',
+        uniformcode: '',
+        windpowerstationid: '',
+      },
+      rules: {
+        code: [{ required: true, trigger: 'blur', message: '请输入' }],
+        name: [{ required: true, trigger: 'blur', message: '请输入' }],
+        model: [{ required: true, trigger: 'blur', message: '请输入' }],
+        uniformcode: [{ required: true, trigger: 'blur', message: '请输入' }],
+        windpowerstationid: [{ required: true, trigger: 'blur', message: '请输入' }],
+      },
+      title: '',
+      dialogFormVisible: false,
+      idAdd: true,
+    }
+  },
+  created() { },
+  methods: {
+    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.addWindpowerstationpointnew(this.form).then(res => {
+            if (res.data) {
+              this.$message({
+                type: 'success',
+                message: '添加成功!'
+              });
+              this.$emit('save-success');
+              this.dialogFormVisible = false
+            }
+          })
+        } else {
+          return false
+        }
+      })
+    },
+    handleChange() {
+    },
+  },
+}
+</script>
+<style lang="less" scoped>
+.inputs {
+  width: 200px;
+}
+</style>

+ 213 - 0
src/views/pointConfiguration/stationAllocation/index.vue

@@ -0,0 +1,213 @@
+<template>
+  <div class="table-container">
+    <!-- <vab-query-form> -->
+      <!-- <vab-query-form-left-panel> -->
+        <el-row>
+          <el-button @click="getBack" style="float: right; margin:0 0 10px 0">返回</el-button>
+        </el-row>
+        <el-form ref="form" :model="queryForm" :inline="true" @submit.native.prevent>
+          <el-form-item label="编码"><el-input placeholder="请输入" v-model="form.code"></el-input></el-form-item>
+          <el-form-item label="名称"><el-input placeholder="请输入" v-model="form.name"></el-input></el-form-item>
+          <el-form-item label="型号"><el-input placeholder="请输入" v-model="form.model"></el-input></el-form-item>
+          <el-form-item label="统一编码"><el-input placeholder="请输入" v-model="form.uniformcode"></el-input></el-form-item>
+          <el-form-item label="场站编号"><el-input placeholder="请输入" v-model="form.windpowerstationid"></el-input></el-form-item>
+          <!-- <el-form-item label="类型">
+            <el-select v-model="form.type" placeholder="请选择">
+              <el-option
+                v-for="item in typeOptions"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value">
+              </el-option>
+            </el-select>
+          </el-form-item> -->
+          <el-form-item>
+            <el-button icon="el-icon-search" type="primary" native-type="submit" @click="fetchData">查询</el-button>
+          </el-form-item>
+          <el-form-item style="float: 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>
+          </el-form-item>
+        </el-form>
+      <!-- </vab-query-form-left-panel> -->
+      <!-- <vab-query-form-right-panel> -->
+        <!-- <UploadExcel style="margin-left: 10px;" @getResult="getMyExcelData"></UploadExcel>
+        <ExportExcel :exportList="exportExcel" partsName="公司"></ExportExcel> -->
+      <!-- </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">
+      <el-table-column show-overflow-tooltip type="selection" width="55"></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="model" align="center" sortable></el-table-column>
+      <el-table-column show-overflow-tooltip label="统一编码" prop="uniformcode" 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="180px">
+        <template #default="{ row }">
+          <el-button type="text" @click="handleEdit(row)">编辑</el-button>
+          <el-button type="text" @click="handleDelete(row)">删除</el-button>
+          <!-- <el-button type="text" @click="handleDelete(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" @save-success="fetchData"></table-edit>
+  </div>
+</template>
+<script>
+// import UploadExcel from '@/components/UploadExcel/index'
+// import ExportExcel from '@/components/ExportExcel/index'
+import TableEdit from './components/TableEdit'
+import api from '@/api/pointConfiguration'
+export default {
+  props: {
+    showValue: {
+      type: Object,
+      default: {}
+    },
+  },
+  components: {
+    // UploadExcel,
+    // ExportExcel,
+    TableEdit,
+  },
+  data() {
+    return {
+      typeOptions: [
+        {value: '风机计算', label:'风机计算'},
+        {value: '场站计算', label:'场站计算'},
+        {value: '风机基础点', label:'风机基础点'},
+      ],
+      form :{
+        code: '',
+        name: '',
+        model: '',
+        uniformcode: '',
+        windpowerstationid: '',
+      },
+      // 
+      // fuzzyQuery: '',
+      listLoading: true,
+      list: [],
+      options: [],
+      exportExcel: [],
+      elementLoadingText: '正在加载...',
+      selectRows: '',
+      layout: 'total, sizes, prev, pager, next, jumper',
+      total: 0,
+      background: true,
+      exportList: [],
+      queryForm: {
+        pageNo: 1,
+        pageSize: 20,
+      },
+    };
+  },
+  created() {
+    this.fetchData()
+    this.form.code = this.showValue.code
+    this.form.name = this.showValue.name
+  },
+  computed: {
+    height() {
+      return this.$baseTableHeight() + 50
+    },
+  },
+  methods: {
+    getBack(){
+      this.$emit("cutState" , 1)
+    },
+    getMyExcelData(val) {
+      val.forEach(item => {
+        api.addCompanys(item).then(res => {
+          if (res.code == 200) {
+            this.$message({
+              type: 'success',
+              message: '添加成功!'
+            });
+            this.fetchData()
+          }
+        })
+      })
+
+    },
+    fetchData() {
+      this.listLoading = true
+      api.windpowerstationpointnewList({
+        id: '',
+        code: this.form.code ? this.form.code : this.showValue.code,
+        name: this.form.name ? this.form.name : this.showValue.name,
+        model: this.form.model,
+        uniformcode: this.form.uniformcode,
+        windpowerstationid: this.form.windpowerstationid,
+        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
+          let exportExcel = []
+          res.data.records.forEach(item => {
+            exportExcel.push({
+              id: item.id,
+              name: item.name,
+              rid: item.rid,
+            })
+          })
+          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.deleteWindpowerstationpointnew({
+            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>
+ a{
+  float: right;
+ }
+</style>