|
@@ -5,8 +5,7 @@
|
|
</div>
|
|
</div>
|
|
<el-row class="right">
|
|
<el-row class="right">
|
|
<span style="float:left;">当前筛选条件下共{{page.total || '--'}}设备</span>
|
|
<span style="float:left;">当前筛选条件下共{{page.total || '--'}}设备</span>
|
|
- <el-checkbox v-show="onlyRead" v-model="allMess" @change="getTableHeader">只看要采集的信息</el-checkbox>
|
|
|
|
- <el-select v-model="onlyRead" @change="getTableHeader">
|
|
|
|
|
|
+ <el-select v-model="onlyRead" @change="getTableHeader" style="width:100px;margin-right:10px;vertical-align:bottom;">
|
|
<el-option
|
|
<el-option
|
|
v-for="item in options"
|
|
v-for="item in options"
|
|
:key="item.value"
|
|
:key="item.value"
|
|
@@ -14,7 +13,11 @@
|
|
:value="item.value">
|
|
:value="item.value">
|
|
</el-option>
|
|
</el-option>
|
|
</el-select>
|
|
</el-select>
|
|
- <el-button @click="createTableData">添加竖井</el-button>
|
|
|
|
|
|
+ <div v-show="onlyRead" style="width:200px;display:inline-block;text-align:left;color:gray;">
|
|
|
|
+ <span>只看要采集的信息</span>
|
|
|
|
+ <el-checkbox v-model="allMess" @change="getTableHeader"></el-checkbox>
|
|
|
|
+ </div>
|
|
|
|
+ <el-button @click="handleCreateTableData">添加竖井</el-button>
|
|
<el-button @click="getTableHeader">刷新</el-button>
|
|
<el-button @click="getTableHeader">刷新</el-button>
|
|
<el-button v-show="!onlyRead" @click="undo">撤销</el-button>
|
|
<el-button v-show="!onlyRead" @click="undo">撤销</el-button>
|
|
</el-row>
|
|
</el-row>
|
|
@@ -68,7 +71,7 @@ import text from "@/utils/handsontable/mainText"
|
|
|
|
|
|
import cenoteType from "@/components/ledger/lib/cenoteType";
|
|
import cenoteType from "@/components/ledger/lib/cenoteType";
|
|
import handsonTable from "@/components/common/handsontable";
|
|
import handsonTable from "@/components/common/handsontable";
|
|
-import { getCenoteType, getCenoteTableHeader, getCenoteTableData, updataCenoteTableData, deleteCenoteTableData, saveCenoteRelateSpace, createCenoteTableData } from "@/api/scan/request"
|
|
|
|
|
|
+import { getCenoteTableHeader, getCenoteTableData, updataCenoteTableData, deleteCenoteTableData, saveCenoteRelateSpace } from "@/api/scan/request"
|
|
import { mapGetters, mapActions } from "vuex";
|
|
import { mapGetters, mapActions } from "vuex";
|
|
export default {
|
|
export default {
|
|
components: {
|
|
components: {
|
|
@@ -79,7 +82,6 @@ export default {
|
|
return {
|
|
return {
|
|
cenoteId: "",//竖井类型id
|
|
cenoteId: "",//竖井类型id
|
|
shaftId: "",//要操作的竖井id
|
|
shaftId: "",//要操作的竖井id
|
|
- cenoteTypeList: [],
|
|
|
|
isTableRightShow: false,
|
|
isTableRightShow: false,
|
|
spaceList: "",
|
|
spaceList: "",
|
|
options: [{
|
|
options: [{
|
|
@@ -100,8 +102,7 @@ export default {
|
|
},
|
|
},
|
|
tableData: [],
|
|
tableData: [],
|
|
copyTableData: [],
|
|
copyTableData: [],
|
|
- assetGroupList: [],
|
|
|
|
- graphyId: null
|
|
|
|
|
|
+ tableExample:null
|
|
};
|
|
};
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -112,7 +113,6 @@ export default {
|
|
])
|
|
])
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
- this.getCenoteTypeData()
|
|
|
|
this.getTableHeader()
|
|
this.getTableHeader()
|
|
},
|
|
},
|
|
// watch: {
|
|
// watch: {
|
|
@@ -121,21 +121,6 @@ export default {
|
|
// }
|
|
// }
|
|
// },
|
|
// },
|
|
methods: {
|
|
methods: {
|
|
- // 获取竖井类型
|
|
|
|
- async getCenoteTypeData() {
|
|
|
|
- let param = {
|
|
|
|
- ProjId: this.projectId,
|
|
|
|
- secret: this.secret,
|
|
|
|
- data: {}
|
|
|
|
- }
|
|
|
|
- await getCenoteType (param, res => {
|
|
|
|
- let data = res.Content
|
|
|
|
- this.cenoteTypeList = data.map((item) => {
|
|
|
|
- item.Code = item.ID
|
|
|
|
- return item
|
|
|
|
- })
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
// 获取表头数据(初始化表格)
|
|
// 获取表头数据(初始化表格)
|
|
async getTableHeader() {
|
|
async getTableHeader() {
|
|
let param = {
|
|
let param = {
|
|
@@ -171,33 +156,6 @@ export default {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- // 添加竖井信息
|
|
|
|
- async createTableData() {
|
|
|
|
- const params = {
|
|
|
|
- ProjId: this.projectId,
|
|
|
|
- secret: this.secret,
|
|
|
|
- data: {}
|
|
|
|
- }
|
|
|
|
- createCenoteTableData(params, (res) => {
|
|
|
|
- let id = res.Id
|
|
|
|
- if (this.tableData.length) {
|
|
|
|
- let data = this.tableExample.getSourceData()
|
|
|
|
- data.unshift({
|
|
|
|
- ShaftID: id
|
|
|
|
- })
|
|
|
|
- this.tableExample.loadData(data)
|
|
|
|
- this.tableExample.updateSettings({
|
|
|
|
- maxRows: data.length
|
|
|
|
- })
|
|
|
|
- } else {
|
|
|
|
- this.tableData = [{
|
|
|
|
- ShaftID: id
|
|
|
|
- }]
|
|
|
|
- this.initTable()
|
|
|
|
- }
|
|
|
|
- this.$message.success("添加成功!")
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
// 修改表格内容
|
|
// 修改表格内容
|
|
async updateTableData(data, change) {
|
|
async updateTableData(data, change) {
|
|
let param = {
|
|
let param = {
|
|
@@ -205,9 +163,15 @@ export default {
|
|
secret: this.secret,
|
|
secret: this.secret,
|
|
data: {
|
|
data: {
|
|
Content: [],
|
|
Content: [],
|
|
- Projection: data[0]? Object.keys(data[0]): []
|
|
|
|
|
|
+ Projection: []
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
+ //生成要修改字段列表
|
|
|
|
+ change.map((item) => {
|
|
|
|
+ if(item[1] && param.data.Projection.indexOf(item[1] != -1)) {
|
|
|
|
+ param.data.Projection.push(item[1])
|
|
|
|
+ }
|
|
|
|
+ })
|
|
//生成对应修改数据
|
|
//生成对应修改数据
|
|
data.map((item, index) => {
|
|
data.map((item, index) => {
|
|
let key = change[index][1]
|
|
let key = change[index][1]
|
|
@@ -242,25 +206,9 @@ export default {
|
|
this.getTableHeader()
|
|
this.getTableHeader()
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- // 添加竖井数据
|
|
|
|
|
|
+ // 添加竖井
|
|
handleCreateTableData() {
|
|
handleCreateTableData() {
|
|
- if (this.tableData.length) {
|
|
|
|
- let data = this.tableExample.getSourceData()
|
|
|
|
- data.unshift({
|
|
|
|
-
|
|
|
|
- })
|
|
|
|
- this.tableExample.loadData(data)
|
|
|
|
- this.tableExample.updateSettings({
|
|
|
|
- maxRows: data.length
|
|
|
|
- })
|
|
|
|
- this.createTableData()
|
|
|
|
- } else {
|
|
|
|
- this.tableData = [{
|
|
|
|
-
|
|
|
|
- }]
|
|
|
|
- this.initTable()
|
|
|
|
- this.createTableData()
|
|
|
|
- }
|
|
|
|
|
|
+ this.$router.push({ name: 'cenoteadd'})
|
|
},
|
|
},
|
|
// 删除表格行
|
|
// 删除表格行
|
|
handleDeleteTableRow() {
|
|
handleDeleteTableRow() {
|
|
@@ -375,7 +323,7 @@ export default {
|
|
},
|
|
},
|
|
// 事件
|
|
// 事件
|
|
afterChange: this.handleUpdataTable, //修改后
|
|
afterChange: this.handleUpdataTable, //修改后
|
|
- afterFilter: this.trimmedRows, //排序前
|
|
|
|
|
|
+ // afterFilter: this.trimmedRows, //排序前
|
|
afterRemoveRow: this.handleDeleteTableRow, //右键删除
|
|
afterRemoveRow: this.handleDeleteTableRow, //右键删除
|
|
afterOnCellMouseDown: this.handleTdClick //鼠标点击
|
|
afterOnCellMouseDown: this.handleTdClick //鼠标点击
|
|
};
|
|
};
|
|
@@ -456,96 +404,7 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return a;
|
|
return a;
|
|
- },
|
|
|
|
- // getProjName() {
|
|
|
|
- // let param = {
|
|
|
|
- // list: [{ id: this.param.ProjId }],
|
|
|
|
- // perjectId: this.param.ProjId,
|
|
|
|
- // secret: this.param.secret,
|
|
|
|
- // }
|
|
|
|
- // getSpaceName(param).then(res => {
|
|
|
|
- // if (res.data.Result == "success") {
|
|
|
|
- // this.mess.perjectName = res.data.Content[0].infos.ProjLocalName
|
|
|
|
- // this.getEqCode()
|
|
|
|
- // } else {
|
|
|
|
- // this.$message.error("请求失败:" + res.data.ResultMsg)
|
|
|
|
- // }
|
|
|
|
- // }).catch(_ => {
|
|
|
|
- // this.$message.error("请求失败")
|
|
|
|
- // })
|
|
|
|
- // },
|
|
|
|
- close(val) {
|
|
|
|
- this.getEqCode()
|
|
|
|
- console.log(val)
|
|
|
|
- if(this.$refs.cascader)
|
|
|
|
- this.$refs.cascader.changeVal([val.code])
|
|
|
|
- // this.$refs.tableMain.getHeaderData(this.param);
|
|
|
|
- },
|
|
|
|
- getEqCode() {
|
|
|
|
- getEquipmentFamily(res => {
|
|
|
|
- this.assetGroupList = res.Content
|
|
|
|
- this.getGraphyId()
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- getFamilyList() {
|
|
|
|
- let param = {
|
|
|
|
- ProjId: this.param.ProjId,
|
|
|
|
- secret: this.param.secret,
|
|
|
|
- data: { type: "Eq" }
|
|
|
|
- }
|
|
|
|
- getFamilyList(param, res => {
|
|
|
|
- if (this.$refs.cascader) {
|
|
|
|
- this.$refs.cascader.pushData(res.Content)
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- //获取header的list
|
|
|
|
- // getNumber() {
|
|
|
|
- // let param = {
|
|
|
|
- // ProjId: this.param.ProjId,
|
|
|
|
- // secret: this.param.secret,
|
|
|
|
- // data: { type: "Eq" }
|
|
|
|
- // }
|
|
|
|
- // getNumber(param, res => {
|
|
|
|
- // console.log(res)
|
|
|
|
- // this.mess.name[0].num = res.content.count
|
|
|
|
- // this.mess.name[1].num = res.content.bindingCount
|
|
|
|
- // this.getFamilyList()
|
|
|
|
- // })
|
|
|
|
- // },
|
|
|
|
-
|
|
|
|
- getGraphyId() {
|
|
|
|
- let param = {
|
|
|
|
- ProjId: this.param.ProjId,
|
|
|
|
- secret: this.param.secret,
|
|
|
|
- type: "SystemEquip"
|
|
|
|
- }
|
|
|
|
- getGraphyId(param).then(res => {
|
|
|
|
- if (res.data.Result == "success") {
|
|
|
|
- this.graphyId = res.data.graph_id
|
|
|
|
- if(this.$refs.tableMain)
|
|
|
|
- this.$refs.tableMain.setGraphyId(this.graphyId, this.assetGroupList);
|
|
|
|
- // this.getNumber()
|
|
|
|
- } else {
|
|
|
|
- this.$message.error("请求错误:" + res.data.ResultMsg)
|
|
|
|
- }
|
|
|
|
- }).catch(_ => {
|
|
|
|
- this.$message.error("请求错误")
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
- //修改设备族
|
|
|
|
- changeDevice(value) {
|
|
|
|
- this.param.deviceId = value.code
|
|
|
|
- this.param.name = value.facility
|
|
|
|
- if (!!value) {
|
|
|
|
- if(this.$refs.tableMain)
|
|
|
|
- this.$refs.tableMain.getHeaderData(this.param);
|
|
|
|
- } else {
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
@@ -553,8 +412,12 @@ export default {
|
|
#deviceList {
|
|
#deviceList {
|
|
overflow: hidden;
|
|
overflow: hidden;
|
|
height: 100%;
|
|
height: 100%;
|
|
- background-color: #f6f6f6;
|
|
|
|
|
|
+ background-color: #fff;
|
|
|
|
+ padding: 10px;
|
|
position: relative;
|
|
position: relative;
|
|
|
|
+ .right {
|
|
|
|
+ background: #fff;
|
|
|
|
+ }
|
|
.search-header {
|
|
.search-header {
|
|
overflow: hidden;
|
|
overflow: hidden;
|
|
padding:0 10px 10px 10px;
|
|
padding:0 10px 10px 10px;
|