|
@@ -5,8 +5,7 @@
|
|
|
</div>
|
|
|
<el-row class="right">
|
|
|
<span style="float:left;">当前筛选条件下共{{page.total || '--'}}设备</span>
|
|
|
- <el-checkbox v-show="onlyRead" v-model="allMess">只看要采集的信息</el-checkbox>
|
|
|
- <el-checkbox v-show="!onlyRead" v-model="isWatch">隐藏自动填充的信息点</el-checkbox>
|
|
|
+ <el-checkbox v-show="onlyRead" v-model="allMess" @change="handleChangeAllMess">只看要采集的信息</el-checkbox>
|
|
|
<el-select v-model="onlyRead">
|
|
|
<el-option
|
|
|
v-for="item in options"
|
|
@@ -28,7 +27,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<el-pagination
|
|
|
- class="center"
|
|
|
+ class="right"
|
|
|
@size-change="handleSizeChange"
|
|
|
@current-change="handleCurrentChange"
|
|
|
:current-page="page.pageNumber"
|
|
@@ -40,17 +39,20 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
+import tools from "@/utils/scan/tools";
|
|
|
+
|
|
|
import cenoteType from "@/components/ledger/lib/cenoteType";
|
|
|
-import hansonTable from "@/components/common/handsontable";
|
|
|
-import { getCenoteType, getGraphyId, getEquipmentFamily } from "@/api/scan/request"
|
|
|
+import handsonTable from "@/components/common/handsontable";
|
|
|
+import { getCenoteTableHeader, getCenoteTableData, getEquipmentFamily } from "@/api/scan/request"
|
|
|
import { mapGetters, mapActions } from "vuex";
|
|
|
export default {
|
|
|
components: {
|
|
|
cenoteType,
|
|
|
- hansonTable
|
|
|
+ handsonTable
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ cenoteId: "",
|
|
|
options: [{
|
|
|
value: true,
|
|
|
label: '只读模式'
|
|
@@ -60,13 +62,14 @@ export default {
|
|
|
}],
|
|
|
onlyRead: true,
|
|
|
allMess: true,
|
|
|
- isWatch:true,
|
|
|
+ tableHeader: [],
|
|
|
page: {
|
|
|
pageSize: 20,
|
|
|
pageSizes: [10, 20, 50, 100],
|
|
|
pageNumber: 1,
|
|
|
total: 400
|
|
|
},
|
|
|
+ tableData: [],
|
|
|
param: {
|
|
|
buildId: "",
|
|
|
floorId: "",
|
|
@@ -88,7 +91,7 @@ export default {
|
|
|
created() {
|
|
|
this.param.ProjId = this.projectId
|
|
|
this.param.secret = this.secret
|
|
|
- this.handleGetCenoteType()
|
|
|
+ this.getTableHeader()
|
|
|
// this.getProjName()
|
|
|
},
|
|
|
watch: {
|
|
@@ -98,21 +101,100 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- handleGetCenoteType() {
|
|
|
+ async getTableHeader() {
|
|
|
let param = {
|
|
|
ProjId: this.projectId,
|
|
|
secret: this.secret,
|
|
|
- data: {}
|
|
|
+ data: {
|
|
|
+ "CollectFlag": this.allMess
|
|
|
+ }
|
|
|
}
|
|
|
- getCenoteType(param).then(res => {
|
|
|
- if (res.data.Result == "success") {
|
|
|
- debugger;
|
|
|
- } else {
|
|
|
- this.$message.error("请求失败:" + res.data.ResultMsg)
|
|
|
+ await getCenoteTableHeader(param, res => {
|
|
|
+ this.tableHeader = res.Content;
|
|
|
+ this.getTableData()
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handleChangeAllMess() {
|
|
|
+ this.getTableHeader()
|
|
|
+ },
|
|
|
+ formatHeaderData(list) {
|
|
|
+ let arr = tools.copyArr(list)
|
|
|
+ let data = arr.map((item) => {
|
|
|
+ return item.Name;
|
|
|
+ })
|
|
|
+ data.unshift("操作", "当前关联的资产", "所属系统实例", "包含的部件");
|
|
|
+ debugger;
|
|
|
+ return data;
|
|
|
+ },
|
|
|
+ formatHeaderType(list) {
|
|
|
+ let arr = tools.copyArr(list)
|
|
|
+ let data = arr.map(item => {
|
|
|
+
|
|
|
+ if (item.Field == "") {
|
|
|
+ item.renderer = text.picType
|
|
|
+ }
|
|
|
+ if (item.data == "infos." + "Archive" ||
|
|
|
+ item.data == "infos." + "CheckReport" ||
|
|
|
+ item.data == "infos." + "InsuranceFile") {
|
|
|
+ item.renderer = text.fileType
|
|
|
}
|
|
|
- }).catch(_ => {
|
|
|
- this.$message.error("请求失败")
|
|
|
})
|
|
|
+ data.unshift("操作", "当前关联的资产", "所属系统实例", "包含的部件");
|
|
|
+ debugger;
|
|
|
+ return data;
|
|
|
+ },
|
|
|
+ async getTableData() {
|
|
|
+ let data = {};
|
|
|
+ if(this.cenoteId){
|
|
|
+ data = {
|
|
|
+ Filters: `ID=${this.cenoteId}`,
|
|
|
+ PageNumber: this.page.pageNumber,
|
|
|
+ PageSize: this.page.pageSize
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ data = {
|
|
|
+ PageNumber: this.page.pageNumber,
|
|
|
+ PageSize: this.page.pageSize
|
|
|
+ }
|
|
|
+ }
|
|
|
+ const params = {
|
|
|
+ ProjId: this.projectId,
|
|
|
+ secret: this.secret,
|
|
|
+ data: data
|
|
|
+ }
|
|
|
+ await getCenoteTableData(params, (res) => {
|
|
|
+ this.tableData = res.Content
|
|
|
+ if(this.tableData && this.tableData.length){
|
|
|
+ this.initTable()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ initTable() {
|
|
|
+ let settings = {
|
|
|
+ data: this.tableData,
|
|
|
+ colHeaders: this.formatHeaderData(this.tableHeader),
|
|
|
+ columns: this.formatHeaderType(this.tableHeader),
|
|
|
+ rowHeights: 30,
|
|
|
+ maxRows: this.tableData.length,
|
|
|
+ fixedRowsTop: 1,
|
|
|
+ fixedColumnsLeft: 4,
|
|
|
+ contextMenu: {
|
|
|
+ items: {
|
|
|
+ remove_row: {
|
|
|
+ name: "删除竖井"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 事件
|
|
|
+ afterChange: this.tdChange, //修改后
|
|
|
+ afterFilter: this.trimmedRows, //排序前
|
|
|
+ afterRemoveRow: this.romoveFm, //右键删除
|
|
|
+ afterOnCellMouseDown: this.handleTdClick //鼠标点击
|
|
|
+ };
|
|
|
+ this.$nextTick(() => {
|
|
|
+ console.log(this.$refs.table);
|
|
|
+ this.tableExample = this.$refs.table.init(settings);
|
|
|
+ });
|
|
|
},
|
|
|
// getProjName() {
|
|
|
// let param = {
|
|
@@ -191,16 +273,9 @@ export default {
|
|
|
this.$message.error("请求错误")
|
|
|
})
|
|
|
},
|
|
|
- //修改楼层
|
|
|
+ //切换竖井类型
|
|
|
changeFloor(value) {
|
|
|
- if (value[0]) {
|
|
|
- this.param.buildId = value[0]
|
|
|
- }
|
|
|
- if (value[1]) {
|
|
|
- this.param.floorId = value[1]
|
|
|
- } else {
|
|
|
- this.param.floorId = null
|
|
|
- }
|
|
|
+ const id = value.ID;
|
|
|
if (!!this.param.deviceId) {
|
|
|
if(this.$refs.tableMain)
|
|
|
this.$refs.tableMain.getHeaderData(this.param);
|
|
@@ -220,7 +295,11 @@ export default {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- }
|
|
|
+ },
|
|
|
+ handleSizeChange() {
|
|
|
+
|
|
|
+ },
|
|
|
+ handleCurrentChange() {},
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
@@ -237,14 +316,18 @@ export default {
|
|
|
}
|
|
|
.tableBox {
|
|
|
display: flex;
|
|
|
- height: calc(100% - 130px);
|
|
|
+ height: calc(100% - 140px);
|
|
|
+ margin-top: 10px;
|
|
|
.tableLeft {
|
|
|
flex: 2;
|
|
|
+ margin-right: 20px;
|
|
|
}
|
|
|
.tableRight {
|
|
|
flex: 1;
|
|
|
// display: none;
|
|
|
border-left: 1px solid #dadada;
|
|
|
+ margin-right: 5px;
|
|
|
+ box-shadow: 0px 1px 5px 0px rgba(59, 66, 84, 0.15);
|
|
|
}
|
|
|
}
|
|
|
}
|