Browse Source

Merge branch 'system-integration' of http://39.106.8.246:3003/web/ibms into system-integration

shaun-sheep 4 years ago
parent
commit
5aa9afbfa0

+ 1 - 1
.gitignore

@@ -1,6 +1,6 @@
 .DS_Store
 node_modules/
-/dist/
+dist/
 npm-debug.log*
 yarn-debug.log*
 yarn-error.log*

+ 3 - 1
src/api/model/file.js

@@ -89,7 +89,9 @@ let api = {
             Filters += `;Status in [${data.Status}]`
         }
         let params = {
-            Filters: Filters
+            Filters: Filters,
+            PageNumber: 1,
+            PageSize: 500
         }
         return httputils.postJson(`${baseUrl}/model-floor/query-list`, params, success)
     },

+ 46 - 2
src/api/scan/httpUtil.js

@@ -29,7 +29,22 @@ function errorResponse(vm, response, err) {
     Message.error({ message: '请求错误' });
   }
 }
-
+function downFile(blob, fileName) {
+  // 非IE下载
+  if ('download' in document.createElement('a')) {
+      let link = document.createElement('a')
+      link.href = window.URL.createObjectURL(blob) // 创建下载的链接
+      link.download = fileName // 下载后文件名
+      link.style.display = 'none'
+      document.body.appendChild(link)
+      link.click() // 点击下载
+      window.URL.revokeObjectURL(link.href) // 释放掉blob对象
+      document.body.removeChild(link) // 下载完成移除元素
+  } else {
+      // IE10+下载
+      window.navigator.msSaveBlob(blob, fileName)
+  }
+}
 export default {
   getJson: function(url, data, success, failed, err) {
     let ProjectId = localStorage.getItem("projectId")
@@ -50,5 +65,34 @@ export default {
     }).catch(error => {
       errorResponse(vm, error, err);
     });
-  }
+  },
+  download(url, requestData) {
+    // 响应类型:arraybuffer, blob
+    fetch
+        .post(url, requestData, { responseType: 'blob' })
+        .then(resp => {
+            let headers = resp.headers
+            let contentType = headers['content-type']
+
+            console.log('响应头信息', headers)
+            if (!resp.data) {
+                console.error('响应异常:', resp)
+                return false
+            } else {
+                console.log('下载文件:', resp)
+                const blob = new Blob([resp.data], { type: contentType })
+
+                const contentDisposition = resp.headers['content-disposition']
+                let fileName = 'unknown'
+                if (contentDisposition) {
+                    fileName = window.decodeURI(resp.headers['content-disposition'].split('=')[1])
+                }
+                console.log('文件名称:', fileName)
+                downFile(blob, fileName)
+            }
+        })
+        .catch(function(error) {
+            console.log(error)
+        })
+},
 }

+ 43 - 13
src/components/config_point/toolLibrary/detailDialog.vue

@@ -2,22 +2,22 @@
   <el-dialog :title="object.val" :visible.sync="dialogTableVisible" width="70%">
     <el-table :data="gridData" border :header-cell-style="{background:'#F3F4F7'}">
       <el-table-column type="index" label="序号" align="center" width="50"></el-table-column>
-      <el-table-column property="name" label="名称" show-overflow-tooltip align="center"></el-table-column>
+      <el-table-column property="Name" label="名称" show-overflow-tooltip align="center"></el-table-column>
       <el-table-column property="address" label="软件" align="center" width="80">
-        <template slot-scope="scope">
-          <el-button type="text" @click="handleDown(scope.$index,scope.row)">下载</el-button>
+        <template slot-scope="scope" v-if="scope.row.Application">
+          <el-button type="text" @click="handleDown(scope.$index,scope.row,'Application')">下载</el-button>
         </template>
       </el-table-column>
-      <el-table-column property="date" label="特殊说明" align="center"></el-table-column>
-      <el-table-column property="name" label="适用厂家" align="center"></el-table-column>
-      <el-table-column property="address" label="使用说明" align="center" width="80">
-        <template slot-scope="scope">
-          <el-button type="text" @click="handleDown(scope.$index,scope.row)">下载</el-button>
+      <el-table-column property="Remark" label="特殊说明" align="center"></el-table-column>
+      <el-table-column property="Scope" label="适用厂家" align="center"></el-table-column>
+      <el-table-column property="Manual" label="使用说明" align="center" width="80">
+        <template slot-scope="scope" v-if="scope.row.Manual">
+          <el-button type="text" @click="handleDown(scope.$index,scope.row,'Manual')">下载</el-button>
         </template>
       </el-table-column>
-      <el-table-column property="address" label="配置示例" align="center" width="80">
-        <template slot-scope="scope">
-          <el-button type="text" @click="handleDown(scope.$index,scope.row)">下载</el-button>
+      <el-table-column property="Eg" label="配置示例" align="center" width="80">
+        <template slot-scope="scope" v-if="scope.row.Eg">
+          <el-button type="text" @click="handleDown(scope.$index,scope.row,'Eg')">下载</el-button>
         </template>
       </el-table-column>
 
@@ -26,6 +26,7 @@
 </template>
 
 <script>
+  import {queryTxList,dowloadProtocol} from "@/fetch/point_http"
   export default {
     name: "settingDialog",
     data() {
@@ -55,9 +56,38 @@
       show(val) {
         this.dialogTableVisible = true
         this.object = val
+        this.getTxOption(this.object.val)
       },
-      handleDown(index, row) {
-
+      getTxOption(object ){
+        let data = {
+          Filters:`Type='${object}'`
+        }
+        queryTxList(data,res=>{
+          console.log(res)
+          this.gridData = res.Content
+        })
+      },
+      handleDown(index, row,name) {
+        let params
+        console.log(row)
+        if(name=='Application'){
+          params = {
+            Property: 'Application',
+            ProtocolId: row.Id
+          }
+        }else if(name=='Manual'){
+           params = {
+            Property: 'Manual',
+            ProtocolId: row.Id
+          }
+        }else if(name=='Eg'){
+           params = {
+            Property: 'Eg',
+            ProtocolId: row.Id
+          }
+        }
+        dowloadProtocol(params,res=>{
+        })
       },
 
     }

+ 251 - 75
src/components/config_point/toolLibrary/settingDialog.vue

@@ -1,37 +1,38 @@
 <template>
   <el-dialog title="配置集成工具库" :visible.sync="dialogTableVisible" width="70%">
-    <el-button type="default" style="margin-bottom: 20px" @click="handleEdit">添加协议</el-button>
-    <el-table :data="gridData" border :header-cell-style="{background:'#F3F4F7'}">
+    <el-button type="default" style="margin-bottom: 20px" @click="handleEdit(1)">添加协议</el-button>
+    <el-table :data="gridData" border height="500" :header-cell-style="{background:'#F3F4F7'}">
       <el-table-column type="index" label="序号" align="center" width="50"></el-table-column>
-      <el-table-column property="name" label="协议类型" show-overflow-tooltip align="center"></el-table-column>
-      <el-table-column property="name" label="名称" show-overflow-tooltip align="center"></el-table-column>
+      <el-table-column property="Type" label="协议类型" show-overflow-tooltip align="center"></el-table-column>
+      <el-table-column property="Name" label="名称" show-overflow-tooltip align="center"></el-table-column>
       <el-table-column property="address" label="软件" align="center" width="80">
-        <template slot-scope="scope">
-          <el-button type="text" @click="handleDown(scope.$index,scope.row)">下载</el-button>
+        <template slot-scope="scope" v-if="scope.row.Application">
+          <el-button type="text" download @click="handleDown(scope.$index,scope.row,'Application')">下载</el-button>
         </template>
       </el-table-column>
-      <el-table-column property="date" label="特殊说明" align="center"></el-table-column>
-      <el-table-column property="name" label="适用厂家" align="center"></el-table-column>
-      <el-table-column property="address" label="使用说明" align="center" width="80">
-        <template slot-scope="scope">
-          <el-button type="text" @click="handleDown(scope.$index,scope.row)">下载</el-button>
+      <el-table-column property="Remark" label="特殊说明" align="center"></el-table-column>
+      <el-table-column property="Scope" label="适用厂家" align="center">
+          <template slot-scope="scope">
+            {{scope.row.Scope || '通用厂家'}}
+          </template>
+      </el-table-column>
+      <el-table-column property="Manual" label="使用说明" align="center" width="80">
+        <template slot-scope="scope" v-if="scope.row.Manual">
+          <el-button type="text" download @click="handleDown(scope.$index,scope.row,'Manual')">下载</el-button>
         </template>
       </el-table-column>
       <el-table-column property="address" label="配置示例" align="center" width="80">
-        <template slot-scope="scope">
-          <el-button type="text" @click="handleDown(scope.$index,scope.row)">下载</el-button>
+        <template slot-scope="scope" v-if="scope.row.Eg">
+          <el-button type="text" download @click="handleDown(scope.$index,scope.row,'Eg')">下载</el-button>
         </template>
       </el-table-column>
       <el-table-column property="address" label="操作" align="center">
         <template slot-scope="scope">
-          <el-button @click="handleEdit(scope.$index, scope.row)">编辑
+          <el-button @click="handleEdit(2,scope.$index, scope.row)">编辑
           </el-button>
-          <el-popconfirm
-            title="这是一段内容确定删除吗?"
-            @onConfirm="handleDelete(scope.$index, scope.row)"
-          >
-            <el-button slot="reference" type="danger" >删除</el-button>
-          </el-popconfirm>
+         
+            <el-button @click="handleDelete(scope.$index, scope.row)" slot="reference" type="danger" >删除</el-button>
+       
         </template>
       </el-table-column>
     </el-table>
@@ -40,62 +41,66 @@
       :title="title"
       :visible.sync="innerVisible"
       append-to-body>
-      <el-form :model="form">
-        <el-form-item label="协议类型">
-          <el-select v-model="form.ProtocolType" filterable @change="handleChangeProtocolType"
+      <el-form :model="form" :rules="rules" ref="ruleForm">
+        <el-form-item label="协议类型" v-if="this.title=='添加协议'">
+          <el-select v-model="form.Type" filterable @change="handleChangeProtocolType"
                      placeholder="请选择">
             <el-option v-for="item in options" :key="item.value" :label="item.label"
                        :value="item.value"></el-option>
           </el-select>
         </el-form-item>
-        <el-form-item label="协议名称">
-          <el-input v-model="form.name" autocomplete="off" placeholder="请输入协议名称,必须唯一" style="width: 220px"/>
+        <el-form-item label="协议类型" v-if="this.title=='编辑协议'">
+            <el-input v-model="form.Type" autocomplete="off" disabled style="width: 220px"/>
+        </el-form-item>
+        <el-form-item label="协议名称" prop="Name">
+          <el-input v-model="form.Name" autocomplete="off" placeholder="请输入协议名称,必须唯一" style="width: 220px"/>
         </el-form-item>
-        <el-form-item label="上传软件版本">
-          <upload-files
-            v-model="form.copyright"
-            :readOnly="false"
-            :isShow="1"
-            :keys-arr="[]"
-            :show-file-list="false"
-            @change="changeItem"/>
+        <!-- <p v-if="msg1" style="color: #F56C6C">请输入协议名称</p> -->
+        <el-form-item label="上传软件版本" prop="Application">
+          <el-upload
+            action="String"
+            :on-change="changeItem1"
+            >
+            <i class="el-icon-upload"></i>
+            <span style="padding-left:20px;" v-if="file1">文件名:{{file1}}</span>
+          </el-upload>
         </el-form-item>
+        <!-- <p v-if='msg2' style="color: #F56C6C">请上传软件版本</p> -->
         <el-form-item label="特殊说明">
-          <el-input type="textarea" v-model="form.data1" :autosize="{ minRows: 4, maxRows: 4}" style="width: 220px"/>
+          <el-input type="textarea" v-model="form.Remark" placeholder="请输入描述内容,300个字以内" :autosize="{ minRows: 4, maxRows: 4}" style="width: 220px"/>
         </el-form-item>
         <el-form-item label="适用厂家">
-          <el-input type="textarea" v-model="form.data2" :autosize="{ minRows: 4, maxRows: 4}" style="width: 220px"/>
+          <el-input type="textarea" v-model="form.Scope" 
+          placeholder="请输入描述内容,300个字以内" :autosize="{ minRows: 4, maxRows: 4}" style="width: 220px"/>
         </el-form-item>
         <el-form-item label="使用说明">
-          <upload-files
-            v-model="form.see"
-            :readOnly="false"
-            :isShow="1"
-            :keys-arr="[]"
-            :show-file-list="false"
-            @change="changeItem"/>
-        </el-form-item>
-        <el-form-item label="配置实例">
-          <upload-files
-            v-model="form.new"
-            :readOnly="false"
-            :isShow="1"
-            :keys-arr="[]"
-            :show-file-list="false"
-            @change="changeItem"/>
+          <el-upload
+            action="String"
+            :on-change="changeItem2"
+            >
+            <i class="el-icon-upload"></i><span style="padding-left:20px;" v-if="file2">文件名:{{file2}}</span>
+          </el-upload>
         </el-form-item>
+        <el-form-item label="配置示例">
+         <el-upload
+            action="String"
+            :on-change="changeItem3"
+            >
+            <i class="el-icon-upload"></i><span style="padding-left:20px;" v-if="file3">文件名:{{file3}}</span>
+          </el-upload>
+        </el-form-item>  
       </el-form>
-      <div slot="footer" class="dialog-footer">
-        <el-button @click="innerVisible = false">取 消</el-button>
-        <el-button type="primary">保 存</el-button>
-      </div>
+       <div slot="footer" class="dialog-footer">
+            <el-button @click="innerVisible = false">取 消</el-button>
+            <el-button type="primary" @click="save">保 存</el-button>
+          </div>
     </el-dialog>
   </el-dialog>
 </template>
 
 <script>
   import uploadFiles from "@/components/business_space/lib/uploadFiles";
-
+  import {queryTxList,dowloadProtocol,addProtocol,updateProtocol,deleteProtocol,uploadProtocol} from "@/fetch/point_http"
   export default {
     name: "",
     components: {uploadFiles},
@@ -120,16 +125,32 @@
         }],
         dialogTableVisible: false,
         innerVisible: false,
-        title: '',
+        title: '添加协议',
         form: {
-          name: '',
-          ProtocolType: '',
-          copyright: '',
-          data1: '',
-          data2: '',
-          see: '',
-          new: ''
+          Name: '',
+          Type:"",
+          Remark: '',
+          Scope: '',
+          Eg: '',
+          Manual: '',
+          Application: ''
         },
+         rules: {
+          Name: [
+            { required: true, message: '请输入协议名称', trigger: 'blur' }
+          ],
+           Application: [
+            { type: 'date', required: true, message: '', trigger: 'change' }
+          ],
+         },
+        file1:"",
+        file2:"",
+        file3:"",
+        // msg1:false,
+        // msg2:false,
+        formData1:null,
+        formData2:null,
+        formData3:null,
         options: [
           {
             value: 'modbus-tcp',
@@ -164,33 +185,188 @@
     methods: {
       show() {
         this.dialogTableVisible = true
-
+        this.getTxOption()
       },
-      handleDown(index, row) {
-
+       getTxOption(object ){
+        let data = {
+        }
+        queryTxList(data,res=>{
+          console.log(res)
+          this.gridData = res.Content
+        })
       },
-      handleEdit(index, row) {
+      handleDown(index, row,name) {
+        let params
+        if(name=='Application'){
+          params = {
+            Property: 'Application',
+            ProtocolId: row.Id
+          }
+        }else if(name=='Manual'){
+           params = {
+            Property: 'Manual',
+            ProtocolId: row.Id
+          }
+        }else if(name=='Eg'){
+           params = {
+            Property: 'Eg',
+            ProtocolId: row.Id
+          }
+        }
+        dowloadProtocol(params,res=>{
+        })
+      },
+      handleEdit(tb,index, row) {
         this.innerVisible = true
-        if (row) {
+        console.log(row,tb)
+        if (tb==2) {
+          console.log(row)
           this.title = '编辑协议'
+          this.form = row
+          this.file1 = row.Application
+          this.file2 = row.Manual
+          this.file3 = row.Eg
         } else {
           this.title = '添加协议'
-
+          this.form = {
+            Name:"",
+            Type:"",
+            Application:'',
+            Eg:"",
+            Manual:"",
+            Remark: '',
+            Scope: '',
+          }
+          this.file1 = ''
+          this.file2 = ''
+          this.file3 = ''
+        }
+      },
+      save(){
+        if(this.title == '添加协议'){
+          if(this.form.Name && this.file1){
+            let params = this.form
+            addProtocol(params,res=>{
+              console.log(res)
+              if(res.Result=='success'){
+                this.innerVisible = false
+                if(this.file1){
+                   this.formData1.append('protocolId',res.Message)
+                   uploadProtocol(this.formData1,res=>{
+                     if(res.Result=='success'){
+                       console.log('文件上传成功')
+                     }
+                   })
+                }
+                if(this.file2){
+                   this.formData2.append('protocolId',res.Message)
+                    uploadProtocol(this.formData2,res=>{
+                      if(res.Result=='success'){
+                        console.log('文件上传成功')
+                      }
+                    })
+                }
+               if(this.file3){
+                   this.formData3.append('protocolId',res.Message)
+                  uploadProtocol(this.formData3,res=>{
+                    if(res.Result=='success'){
+                      console.log('文件上传成功')
+                    }
+                  })
+               }
+                 this.getTxOption()
+              }
+            })
+          }
+        }else if(this.title == '编辑协议'){
+           if(this.form.Name && this.file1){
+            let params = {
+              Content:[
+                 this.form
+              ]
+            }
+            updateProtocol(params,res=>{
+              if(res.Result=='success'){
+                   this.innerVisible = false
+                    if(this.formData1){
+                        this.formData1.append('protocolId',this.form.Id)
+                        uploadProtocol(this.formData1,res=>{
+                          if(res.Result=='success'){
+                            console.log('文件上传成功')
+                          }
+                        })
+                    }
+                    if(this.formData2){
+                        this.formData2.append('protocolId',this.form.Id)
+                          uploadProtocol(this.formData2,res=>{
+                            if(res.Result=='success'){
+                              console.log('文件上传成功')
+                            }
+                          })
+                    }
+                    if(this.formData3){
+                          this.formData3.append('protocolId',this.form.Id)
+                          uploadProtocol(this.formData3,res=>{
+                            if(res.Result=='success'){
+                              console.log('文件上传成功')
+                            }
+                          })
+                    }
+                    this.getTxOption()
+              }
+            })
+           }
         }
       },
       handleDelete(index, row) {
-        console.log(row)
+         this.$confirm("删除后无法恢复,是否需要删除?", "提示", {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          }).then(() => {
+            console.log(row)
+            let params = [row.Id]
+            deleteProtocol(params,res=>{
+               this.getTxOption()
+            })
+          }).catch(() => {
+            this.$message("取消删除")
+          })
       },
       handleChangeProtocolType(val) {
-
       },
-      changeItem(val) {
-
+      changeItem1(file, fileList) {
+        this.file1 = file.name
+        this.formData1 = null
+        this.formData1 = new FormData()
+        this.formData1.append('multipartFile',file.raw)
+        this.formData1.append('property','Application')
+      },
+      changeItem2(file, fileList) {
+        this.file2 = file.name
+        this.formData2 = null
+        this.formData2 = new FormData();
+        this.formData2.append('multipartFile',file.raw)
+        this.formData2.append('property','Manual')
+      },
+      changeItem3(file, fileList) {
+        this.file3 = file.name
+        this.formData3 = null
+        this.formData3 = new FormData()
+        this.formData3.append('multipartFile',file.raw)
+        this.formData3.append('property','Eg')
       }
     }
   }
 </script>
 
-<style scoped>
+<style lang='less'>
+.el-form{
+  .el-form-item__label{
+    width:108px;
+    display: inline-block;
+  }
+}
+
 
 </style>

+ 44 - 2
src/fetch/point_http.js

@@ -1,5 +1,5 @@
 import {get, post, request } from './request'
-
+import httpUtil from "@/api/scan/httpUtil";
 let point = '/pointconfig'
 let relation = '/relation'
 
@@ -345,4 +345,46 @@ export function AIFindPoint(param, success) {
 export function AIPlan(param, success) {
     let data = param.data
     return post(`${point}/point/${param.type}/query-ai`, data, success)
-}
+}
+
+//查询协议列表
+export function queryProtocalList(param, success) {
+    let url = `${point}/protocol/type-list`
+    httpUtil.postJson(url, param, success)
+  }
+
+  //查询通讯模式
+  export function queryTxList(param, success){
+    let url = `${point}/protocol/query`
+    httpUtil.postJson(url, param, success)
+  }
+  //测试数据源  
+  export function queryTest(param, success){
+    let url = `${point}/datasource/check`
+    httpUtil.postJson(url, param, success)
+  }
+  //下载协议
+  export function dowloadProtocol(param, success){
+    let url = `${point}/protocol/download`
+    httpUtil.download(url, param, success)
+  }
+  //添加协议
+  export function addProtocol(param, success){
+    let url = `${point}/protocol/create`
+    httpUtil.postJson(url, param, success)
+  }
+  //删除协议
+  export function deleteProtocol(param, success){
+    let url = `${point}/protocol/delete`
+    httpUtil.postJson(url, param, success)
+  }
+  //更新协议
+  export function updateProtocol(param, success){
+    let url = `${point}/protocol/update`
+    httpUtil.postJson(url, param, success)
+  }
+   //上传协议
+   export function uploadProtocol(param, success){
+    let url = `${point}/protocol/upload`
+    httpUtil.postJson(url, param, success)
+  }

+ 0 - 1
src/views/data_admin/buildAssets/index.vue

@@ -107,7 +107,6 @@
         }
         problemQuery(param, res => {
           this.total = res.Total
-          debugger
           this.setErrorReport(res.Content)
         })
 

+ 1 - 0
src/views/data_admin/buildTask/addTask/addModelTask.vue

@@ -89,6 +89,7 @@
         let data = {
           FolderId: val,
           Status: '4',
+          
           ProjectId: this.projectId
         };
         request.queryFloorList(data, res => {

+ 1 - 1
src/views/model/report/index.vue

@@ -229,7 +229,7 @@
       },
       getModelFloorCount() {// 获取楼层模型文件数量,计算出检查出问题的模型文件
         let promise1 = new Promise(resolve => {
-          queryFloorList({Filters:"Status=4"}, res => {
+          queryFloorList({Filters:"Status=4",pageNumber:1,PageSize: 500}, res => {
             resolve(res);
           })
         })

+ 82 - 37
src/views/point/config_point/edit_origin/dialog.vue

@@ -38,10 +38,10 @@
           </el-select>
         </el-form-item>
         <el-form-item label="HBase库名">
-          <el-input/>
+          <el-input v-model="formData.hbase"></el-input>
         </el-form-item>
         <el-form-item label="zookeeper">
-          <el-input/>
+          <el-input v-model="formData.zookeeper"></el-input>
         </el-form-item>
       </template>
       <template
@@ -61,8 +61,9 @@
         <el-input-number v-model="formData.CollectInterval" controls-position="right" :min="10"></el-input-number>
       </el-form-item>
       <el-form-item label="通讯模式" v-if="formData.ProtocolType != 'common'  && formData.ProtocolType != 'ems-collect' ">
-        <el-select filterable>
-          <el-option></el-option>
+        <el-select filterable v-model="formData.tx">
+          <el-option v-for="item in txOptions" :key="item.value" :label="item.label"
+                     :value="item.value"></el-option>
         </el-select>
       </el-form-item>
       <el-form-item label="网络类型">
@@ -77,7 +78,7 @@
                   placeholder="请输入描述内容,200个字以内"></el-input>
       </el-form-item>
       <el-form-item>
-        <el-button :disabled="formData.wangluo =='jianjie'?true:false">测试</el-button>
+        <el-button :disabled="formData.wangluo =='jianjie'?true:false" @click="test">测试</el-button>
         <el-button @click="dialogVisible = false">取消</el-button>
         <el-button type="primary" @click="btnClick">保存</el-button>
       </el-form-item>
@@ -96,7 +97,7 @@
   import ipInput from "@/components/config_point/ip_input"
   // import bread from "components/common/bread_crumb"
   import tools from "@/utils/tools"
-  import {createDataSource, queryDataSource, updateDataSource} from "@/fetch/point_http"
+  import {createDataSource, queryDataSource, updateDataSource,queryProtocalList,queryTxList,queryTest} from "@/fetch/point_http"
   import {mapGetters} from "vuex";
 
   export default {
@@ -113,6 +114,8 @@
           ProtocolType: "", //协议类型
           ProtocolStandarded: true,
           Name: "",
+          hbase:"",
+          zookeeper:"",
           ProtocolInfo: {
             Ip: "", //ip
             Port: "", //端口号,有些协议类型没有该信息
@@ -124,35 +127,37 @@
           CollectInterval: 10
         },
         ProtocolInfo: "",//自定义协议信息
+        txOptions:[],
         options: [
-          {
-            value: 'modbus-tcp',
-            label: 'Modbus TCP'
-          }, {
-            value: 'bacnet-ip',
-            label: 'BACNet IP'
-          }, {
-            value: 'opc',
-            label: 'OPC'
-          }, {
-            value: 'knx',
-          label: 'KNX'
-        }, {
-          value: 'mqtt',
-          label: 'MQTT'
-        }, {
-          value: 'amqp',
-          label: 'AMQP'
-        }, {
-          value: 'lora',
-          label: 'LoRa'
-        }, {
-          value: 'ems-collect',
-          label: 'ems-collect'
-        }, {
-          value: 'common',
-          label: '其他'
-        }],
+        //   {
+        //     value: 'modbus-tcp',
+        //     label: 'Modbus TCP'
+        //   }, {
+        //     value: 'bacnet-ip',
+        //     label: 'BACNet IP'
+        //   }, {
+        //     value: 'opc',
+        //     label: 'OPC'
+        //   }, {
+        //     value: 'knx',
+        //   label: 'KNX'
+        // }, {
+        //   value: 'mqtt',
+        //   label: 'MQTT'
+        // }, {
+        //   value: 'amqp',
+        //   label: 'AMQP'
+        // }, {
+        //   value: 'lora',
+        //   label: 'LoRa'
+        // }, {
+        //   value: 'ems-collect',
+        //   label: 'ems-collect'
+        // }, {
+        //   value: 'common',
+        //   label: '其他'
+        // }
+        ],
         netOptons: [
           {
             value: 'zhilian',
@@ -181,19 +186,60 @@
     },
 
     methods: {
+      getProtocalList(){
+        let data = {
+        }
+        queryProtocalList(data,res=>{
+          console.log(res)
+          this.options = []
+          let data = res.Content
+          data.forEach(el=>{
+             this.options.push({
+              label:el,
+              value:el
+            })
+          })
+        })
+      },
+      getTxOption(){
+        let data = {
+          Filters:`Type='${this.formData.ProtocolType}'`
+        }
+        queryTxList(data,res=>{
+          console.log(res)
+          this.txOptions = []
+          let data = res.Content
+          data.forEach(el=>{
+             this.txOptions.push({
+              label:el.Name,
+              value:el.Name
+            })
+          })
+        })
+      },
+      test(){
+        let data = this.formData
+        queryTest(data,res=>{
+          console.log(res)
+          if(res.Result=='success'){
+            
+          }
+        })
+      },
       openDialog(obj) {
         this.dialogVisible = true
         this.title = obj ? '编辑数据源' : '添加数据源'
         if (obj) {
           this.getDataSouse(obj)
         }
-
+        this.getProtocalList()
       },
       changeItem(ip, port) {
         this.formData.ProtocolInfo.Ip = ip
         this.formData.ProtocolInfo.Port = port
       },
       handleChangeProtocolType(val) {//切换协议类型
+        this.getTxOption()
         switch (val) {
           case 'modbus-tcp':
           case 'bacnet-ip':
@@ -212,7 +258,6 @@
             break
 
         }
-
       },
       handleChangeNetType(val) { //网络类型
         console.log(val)
@@ -233,6 +278,7 @@
           let data = res.Content[0]
           data.ProtocolType = data.ProtocolType == '其他' ? 'common' : data.ProtocolType
           this.formData = data
+          console.log(data)
           if (!this.formData.ProtocolInfo) {
             //信息点为空时
             this.formData.ProtocolInfo = {
@@ -245,7 +291,6 @@
           } else {
             //有信息点时
             this.ProtocolInfo = JSON.stringify(data.ProtocolInfo)
-            debugger
           }
           this.handleChangeProtocolType(data.ProtocolType)
         })

+ 0 - 1
src/views/point/config_point/edit_origin/index.vue

@@ -199,7 +199,6 @@
 
           },
           getDataSouse() {
-            debugger
             let param = {
               Filters: {
                 Id: this.id

+ 16 - 1
src/views/point/toolLibrary/index.vue

@@ -15,7 +15,7 @@
 <script>
   import detailDialog from "@/components/config_point/toolLibrary/detailDialog";
   import settingDialog from "@/components/config_point/toolLibrary/settingDialog";
-
+  import {queryProtocalList} from "@/fetch/point_http"
   export default {
     data() {
       return {
@@ -25,7 +25,22 @@
       }
     },
     components: {detailDialog, settingDialog},
+    mounted(){
+      this.queryList()
+    },
     methods: {
+      queryList(){
+        let params = {}
+        queryProtocalList(params,res=>{
+          this.list = []
+         let data = res.Content
+         data.forEach(el=>{
+           this.list.push({
+             val:el
+           })
+         })
+        })
+      },
       detailItem(item) {
         this.$refs.detailObject.show(item)
       },