|
@@ -1,6 +1,6 @@
|
|
<template>
|
|
<template>
|
|
<div id="controlTest">
|
|
<div id="controlTest">
|
|
- <div class="query-area" style="padding:10px;">
|
|
|
|
|
|
+ <div class="query-area" style="padding:10px;" v-if="isShowSelect">
|
|
<el-select v-model="originName" placeholder="请选择数据源" clearable @change="changeHandleSelect">
|
|
<el-select v-model="originName" placeholder="请选择数据源" clearable @change="changeHandleSelect">
|
|
<el-option
|
|
<el-option
|
|
v-for="(item,index) in selectAggregate.originList"
|
|
v-for="(item,index) in selectAggregate.originList"
|
|
@@ -17,6 +17,15 @@
|
|
:value="index">
|
|
:value="index">
|
|
</el-option>
|
|
</el-option>
|
|
</el-select>
|
|
</el-select>
|
|
|
|
+ <el-input
|
|
|
|
+ placeholder="输入整合ID或点位描述"
|
|
|
|
+ style="width: 220px"
|
|
|
|
+ v-model.trim="describe"
|
|
|
|
+ clearable
|
|
|
|
+ @change="handleDescribe"
|
|
|
|
+ >
|
|
|
|
+ <i slot="prefix" class="el-input__icon el-icon-search"></i>
|
|
|
|
+ </el-input>
|
|
<span style="float: right">
|
|
<span style="float: right">
|
|
<el-popover
|
|
<el-popover
|
|
placement="bottom"
|
|
placement="bottom"
|
|
@@ -30,10 +39,13 @@
|
|
<el-button type="primary" size="mini" @click="implement">确定</el-button>
|
|
<el-button type="primary" size="mini" @click="implement">确定</el-button>
|
|
</div>
|
|
</div>
|
|
<el-button slot="reference">执行</el-button>
|
|
<el-button slot="reference">执行</el-button>
|
|
-</el-popover>
|
|
|
|
|
|
+ </el-popover>
|
|
<i class="el-icon-download" style="cursor: pointer" @click="downloads" title="下载"/>
|
|
<i class="el-icon-download" style="cursor: pointer" @click="downloads" title="下载"/>
|
|
</span>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
|
|
+ <div v-else class="query-area">
|
|
|
|
+ <el-button style="margin: 10px" @click="back">返回</el-button>
|
|
|
|
+ </div>
|
|
<!-- 数据表格 -->
|
|
<!-- 数据表格 -->
|
|
<div class="table-area">
|
|
<div class="table-area">
|
|
<el-table
|
|
<el-table
|
|
@@ -44,7 +56,7 @@
|
|
:header-cell-style="headerStyle"
|
|
:header-cell-style="headerStyle"
|
|
@selection-change="handleSelectionChange"
|
|
@selection-change="handleSelectionChange"
|
|
>
|
|
>
|
|
- <el-table-column type="selection"/>
|
|
|
|
|
|
+ <el-table-column type="selection" v-if="isShowSelect"/>
|
|
<el-table-column label="序号" type="index" align='center' width="55">
|
|
<el-table-column label="序号" type="index" align='center' width="55">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
{{ scope.$index + (currentPage - 1) * pageSize + 1 }}
|
|
{{ scope.$index + (currentPage - 1) * pageSize + 1 }}
|
|
@@ -54,7 +66,13 @@
|
|
<el-table-column prop='ReadWrite' label='读写' show-overflow-tooltip align='center'/>
|
|
<el-table-column prop='ReadWrite' label='读写' show-overflow-tooltip align='center'/>
|
|
<el-table-column prop='Meterfunc' label='整合ID' show-overflow-tooltip align='center'/>
|
|
<el-table-column prop='Meterfunc' label='整合ID' show-overflow-tooltip align='center'/>
|
|
<el-table-column prop='Description' label='点位描述' show-overflow-tooltip align='center'/>
|
|
<el-table-column prop='Description' label='点位描述' show-overflow-tooltip align='center'/>
|
|
- <el-table-column prop='Status' label='状态' show-overflow-tooltip align='center'/>
|
|
|
|
|
|
+ <el-table-column prop='Status' label='状态' show-overflow-tooltip align='center'>
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <span v-if="scope.row.Status== 0">进行中</span>
|
|
|
|
+ <span v-if="scope.row.Status== 1">成功</span>
|
|
|
|
+ <span v-if="scope.row.Status== 2">失败</span>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
<el-table-column prop='Data' label='反馈值' show-overflow-tooltip align='center'/>
|
|
<el-table-column prop='Data' label='反馈值' show-overflow-tooltip align='center'/>
|
|
</el-table>
|
|
</el-table>
|
|
<!-- 分页 -->
|
|
<!-- 分页 -->
|
|
@@ -65,18 +83,21 @@
|
|
style="float:right;margin-top:10px;padding:2px 5px;">
|
|
style="float:right;margin-top:10px;padding:2px 5px;">
|
|
</el-pagination>
|
|
</el-pagination>
|
|
</div>
|
|
</div>
|
|
-
|
|
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import {pointTest, settingValue} from '@/api/scan/request'
|
|
import {pointTest, settingValue} from '@/api/scan/request'
|
|
|
|
+import axios from "axios";
|
|
|
|
+import {mapGetters} from 'vuex'
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: "tabControlTest",
|
|
name: "tabControlTest",
|
|
props: ['selectAggregate'],
|
|
props: ['selectAggregate'],
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ isShowSelect: true,
|
|
|
|
+ describe: '',
|
|
pageSizes: [10, 20, 50, 100],
|
|
pageSizes: [10, 20, 50, 100],
|
|
pageSize: 50,
|
|
pageSize: 50,
|
|
currentPage: 1,
|
|
currentPage: 1,
|
|
@@ -99,18 +120,41 @@ export default {
|
|
created() {
|
|
created() {
|
|
this.getSettingValue()
|
|
this.getSettingValue()
|
|
},
|
|
},
|
|
|
|
+ computed: {
|
|
|
|
+ ...mapGetters('layout', ['projectId'])
|
|
|
|
+ },
|
|
methods: {
|
|
methods: {
|
|
|
|
+ //返回
|
|
|
|
+ back() {
|
|
|
|
+ this.isShowSelect = true
|
|
|
|
+ this.getSettingValue()
|
|
|
|
+ },
|
|
|
|
+ //搜索
|
|
|
|
+ handleDescribe() {
|
|
|
|
+ if (this.describe) {
|
|
|
|
+ let Filters = `Description='${this.describe}' or Meterfunc='${this.describe}';`
|
|
|
|
+ this.getSettingValue(Filters)
|
|
|
|
+ } else {
|
|
|
|
+ this.getSettingValue()
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ },
|
|
//执行
|
|
//执行
|
|
implement() {
|
|
implement() {
|
|
- let list = this.multipleSelection.map(i => ({Data:this.instructions,...i}))
|
|
|
|
this.visible = false
|
|
this.visible = false
|
|
- this.getPointTest(list)
|
|
|
|
|
|
+ if (this.multipleSelection) {
|
|
|
|
+ let list = this.multipleSelection
|
|
|
|
+ list.forEach(i => i.Data = this.instructions)
|
|
|
|
+ this.getPointTest(list)
|
|
|
|
+ } else {
|
|
|
|
+ return false
|
|
|
|
+ }
|
|
|
|
+ this.instructions = ''
|
|
},
|
|
},
|
|
//当前设定值
|
|
//当前设定值
|
|
- getSettingValue() {
|
|
|
|
|
|
+ getSettingValue(val) {
|
|
let _this = this
|
|
let _this = this
|
|
_this.loading = true;
|
|
_this.loading = true;
|
|
-
|
|
|
|
let param = {
|
|
let param = {
|
|
PageNumber: this.currentPage,
|
|
PageNumber: this.currentPage,
|
|
PageSize: this.pageSize
|
|
PageSize: this.pageSize
|
|
@@ -121,6 +165,9 @@ export default {
|
|
if (_this.statusName) {
|
|
if (_this.statusName) {
|
|
Filters += `ReadWrite='${_this.statusName}';`
|
|
Filters += `ReadWrite='${_this.statusName}';`
|
|
}
|
|
}
|
|
|
|
+ if (val) {
|
|
|
|
+ Filters += val
|
|
|
|
+ }
|
|
let index = Filters.lastIndexOf(';')
|
|
let index = Filters.lastIndexOf(';')
|
|
Filters = Filters.substring(0, index)
|
|
Filters = Filters.substring(0, index)
|
|
param.Filters = Filters !== '' ? Filters : undefined
|
|
param.Filters = Filters !== '' ? Filters : undefined
|
|
@@ -133,12 +180,22 @@ export default {
|
|
|
|
|
|
//点位测试
|
|
//点位测试
|
|
getPointTest(list) {
|
|
getPointTest(list) {
|
|
- pointTest(list, res => {
|
|
|
|
- this.tableDate = res.Content
|
|
|
|
-
|
|
|
|
- })
|
|
|
|
|
|
+ // pointTest(list, res => {
|
|
|
|
+ // this.tableDate = res.Content
|
|
|
|
+ //
|
|
|
|
+ // })
|
|
|
|
+ pointTest(list).then(res => {
|
|
|
|
+ if (res.data.Result === "failure") {
|
|
|
|
+ this.$message.error('执行失败')
|
|
|
|
+ this.getSettingValue()
|
|
|
|
+ } else {
|
|
|
|
+ this.isShowSelect = false
|
|
|
|
+ this.tableDate = res.data.Content
|
|
|
|
+ }
|
|
|
|
+ });
|
|
},
|
|
},
|
|
changeHandleSelect() {
|
|
changeHandleSelect() {
|
|
|
|
+ this.currentPage = 1
|
|
this.getSettingValue()
|
|
this.getSettingValue()
|
|
},
|
|
},
|
|
|
|
|
|
@@ -158,11 +215,37 @@ export default {
|
|
},
|
|
},
|
|
//点击下载
|
|
//点击下载
|
|
downloads() {
|
|
downloads() {
|
|
- let a = document.createElement('a')
|
|
|
|
- a.href = '/pointconfig/datasource/pointset-present-download'
|
|
|
|
- a.download = '控制测试'
|
|
|
|
- a.click()
|
|
|
|
- document.body.removeChild(a)
|
|
|
|
|
|
+ let param = {
|
|
|
|
+ method: 'post',
|
|
|
|
+ url: `/pointconfig/datasource/pointset-present-download`,
|
|
|
|
+ responseType: 'blob',
|
|
|
|
+ headers: {
|
|
|
|
+ ProjectId: this.projectId
|
|
|
|
+ },
|
|
|
|
+ data: {},
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ axios(param).then(function (res) {
|
|
|
|
+ var blob = new Blob([res.data], {
|
|
|
|
+ type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'
|
|
|
|
+ });
|
|
|
|
+ var fileName = res.headers['content-disposition'];
|
|
|
|
+ if (fileName)
|
|
|
|
+ fileName = fileName.substring(fileName.indexOf('=') + 1);
|
|
|
|
+ if ('download' in document.createElement('a')) { // 非IE下载
|
|
|
|
+ const elink = document.createElement('a')
|
|
|
|
+ elink.download = fileName
|
|
|
|
+ elink.style.display = 'none'
|
|
|
|
+ elink.href = URL.createObjectURL(blob)
|
|
|
|
+ document.body.appendChild(elink)
|
|
|
|
+ elink.click()
|
|
|
|
+ URL.revokeObjectURL(elink.href) // 释放URL 对象
|
|
|
|
+ document.body.removeChild(elink)
|
|
|
|
+ } else { // IE10+下载
|
|
|
|
+ navigator.msSaveBlob(blob, fileName)
|
|
|
|
+ }
|
|
|
|
+ }).catch(function (err) {
|
|
|
|
+ })
|
|
},
|
|
},
|
|
}
|
|
}
|
|
}
|
|
}
|