|
@@ -3,28 +3,31 @@
|
|
|
<statistics :statistics-msg="statisticsMsg"/>
|
|
|
<div class="hr"></div>
|
|
|
<div class="operation">
|
|
|
- <el-select
|
|
|
- v-model="systemType"
|
|
|
- class="adm-select"
|
|
|
- clearable
|
|
|
- filterable
|
|
|
- placeholder="请选择系统类别"
|
|
|
- @change="handleFilter"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="item in list"
|
|
|
- :key="item.code"
|
|
|
- :label="item.name"
|
|
|
- :value="{ value: item.code,label: item.name }"
|
|
|
- />
|
|
|
- </el-select>
|
|
|
+<!-- <el-select-->
|
|
|
+<!-- v-model="systemType"-->
|
|
|
+<!-- class="adm-select"-->
|
|
|
+<!-- clearable-->
|
|
|
+<!-- filterable-->
|
|
|
+<!-- placeholder="请选择系统类别"-->
|
|
|
+<!-- @change="handleFilter"-->
|
|
|
+<!-- >-->
|
|
|
+<!-- <el-option-->
|
|
|
+<!-- v-for="item in list"-->
|
|
|
+<!-- :key="item.code"-->
|
|
|
+<!-- :label="item.name"-->
|
|
|
+<!-- :value="{ value: item.code,label: item.name }"-->
|
|
|
+<!-- />-->
|
|
|
+<!-- </el-select>-->
|
|
|
+ <el-cascader :options="options" clearable v-model="linshi" ref="floorCascader" @change="changeLinshi" class="adm-select" ></el-cascader>
|
|
|
+
|
|
|
<admSearch @SearchValue="SearchValue"/>
|
|
|
<el-button class="adm-btn" type="default" @click="addDevice">添加系统</el-button>
|
|
|
</div>
|
|
|
|
|
|
<div class="content">
|
|
|
<div v-loading="loading" class="table">
|
|
|
- <template v-if="systemType">
|
|
|
+<!-- <template v-if="systemType">-->
|
|
|
+ <template v-if="linshi.length > 0">
|
|
|
<admMultiTable :currentHeader="currentHeader" :headersStage="headersStage" :tableData="tableData"/>
|
|
|
<Pagination :paginationList="paginationList" @handleCurrentChange="handleCurrentChange"
|
|
|
v-if="tableData.length > 0"
|
|
@@ -84,6 +87,30 @@ import { BeatchQueryParam } from "@/api/equipComponent";
|
|
|
components: { Statistics, AdmSearch, AdmMultiTable, Pagination, dataForm }
|
|
|
})
|
|
|
export default class extends Vue {
|
|
|
+ // 临时假数据
|
|
|
+ linshi=''
|
|
|
+ options= [{
|
|
|
+ value: 'zzzz',
|
|
|
+ label: '安防专业',
|
|
|
+ children: [{
|
|
|
+ value: 'CFPK',
|
|
|
+ label: '停车场',
|
|
|
+
|
|
|
+ }, {
|
|
|
+ value: 'WEMM',
|
|
|
+ label: '气象监测系统',
|
|
|
+ }]
|
|
|
+ },{
|
|
|
+ value: 'zzzz',
|
|
|
+ label: '弱电专业',
|
|
|
+ children: [{
|
|
|
+ value: 'SEOP',
|
|
|
+ label: '室外动力系统',
|
|
|
+ }, {
|
|
|
+ value: 'WSWS',
|
|
|
+ label: '水景系统',
|
|
|
+ }]
|
|
|
+ }]
|
|
|
// loading
|
|
|
loading = false
|
|
|
// 下拉数据
|
|
@@ -128,7 +155,7 @@ export default class extends Vue {
|
|
|
}
|
|
|
|
|
|
created() {
|
|
|
- this.systemList();
|
|
|
+ // this.systemList();
|
|
|
this.dataCount()
|
|
|
}
|
|
|
|
|
@@ -208,18 +235,18 @@ export default class extends Vue {
|
|
|
// 搜索
|
|
|
SearchValue(val: string) {
|
|
|
this.inputSearch = val
|
|
|
- this.handleFilter(this.systemType)
|
|
|
+ // this.handleFilter(this.systemType)
|
|
|
}
|
|
|
|
|
|
// 当前分页
|
|
|
handleCurrentChange(val: number) {
|
|
|
this.paginationList.page = val
|
|
|
- this.handleFilter(this.systemType)
|
|
|
+ // this.handleFilter(this.systemType)
|
|
|
}
|
|
|
|
|
|
handleSizeChange(val: number) {
|
|
|
this.paginationList.size = val
|
|
|
- this.handleFilter(this.systemType)
|
|
|
+ // this.handleFilter(this.systemType)
|
|
|
}
|
|
|
|
|
|
// 添加设备
|
|
@@ -239,7 +266,90 @@ export default class extends Vue {
|
|
|
this.next = true
|
|
|
this.displayLocation = false
|
|
|
}
|
|
|
+ // todo 临时假数据函数
|
|
|
+ private changeLinshi(val) {
|
|
|
+
|
|
|
|
|
|
+ if (this.linshi[1]) {
|
|
|
+ let systemLabel = this.$refs['floorCascader'].getCheckedNodes()[0].pathLabels
|
|
|
+ this.systemLabel = systemLabel[1]
|
|
|
+ this.loading = true
|
|
|
+ let param = {
|
|
|
+ "type": this.linshi[1],
|
|
|
+ "orders": "sort asc, name desc"
|
|
|
+ }
|
|
|
+ let param2 = {
|
|
|
+ filters: this.linshi[1] ? `classCode='${ this.linshi[1]}'` : undefined,
|
|
|
+ pageNumber: this.paginationList.page,
|
|
|
+ pageSize: this.paginationList.size,
|
|
|
+ orders: "createTime desc, id asc",
|
|
|
+ projectId: this.projectId
|
|
|
+ }
|
|
|
+ if (this.inputSearch != '') {
|
|
|
+ param2.filters = `localName contain '${ this.inputSearch }' or localId contain '${ this.inputSearch }'`
|
|
|
+ }
|
|
|
+ let promise = new Promise(resolve => {
|
|
|
+ dictQuery(param).then(res => {
|
|
|
+ resolve(res)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ let promise2 = new Promise(resolve => {
|
|
|
+ querySystem(param2).then(res => {
|
|
|
+ resolve(res)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ Promise.all([promise, promise2]).then(res => {
|
|
|
+ let tableData = []
|
|
|
+ this.loading = false
|
|
|
+ // 类型下信息点,重组数据
|
|
|
+ let basicInfos = [{ path: 'classification', name: '系统分类' }], dictStages = []
|
|
|
+ this.all = res[0].content
|
|
|
+ res[0].content.forEach(item => {
|
|
|
+ let i = ["localName", "localId"]
|
|
|
+ if (i.includes(item.path)) {
|
|
|
+ basicInfos.push(item)
|
|
|
+ } else {
|
|
|
+ dictStages.push(item)
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ this.headersStage = {
|
|
|
+ basicInfos: {
|
|
|
+ name: '基础信息台账',
|
|
|
+ data: basicInfos
|
|
|
+ },
|
|
|
+ dictStages: {
|
|
|
+ name: '运维阶段',
|
|
|
+ data: dictStages
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.paginationList.total = res[1].total
|
|
|
+ tableData = res[1].content // 主体数据
|
|
|
+ // 添加系统分类
|
|
|
+ this.tableData = tableData.map(item => {
|
|
|
+ item = { ...item, classification: this.systemLabel }
|
|
|
+ return item
|
|
|
+ })
|
|
|
+ })
|
|
|
+ // 动态信息点
|
|
|
+ this.codeToDataSource = {}
|
|
|
+ this.all.forEach(item => {
|
|
|
+ if (item.dataSource) {
|
|
|
+ try {
|
|
|
+ this.codeToDataSource[item.code] = {}
|
|
|
+ item.dataSource.forEach(dic => {
|
|
|
+ this.codeToDataSource[item.code][dic.code] = dic.name;
|
|
|
+ })
|
|
|
+ } catch (e) {
|
|
|
+ console.log(e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.getBatch(this.tableData)
|
|
|
+ } else {
|
|
|
+ console.log('void')
|
|
|
+ }
|
|
|
+ }
|
|
|
private handleFilter(val) {
|
|
|
this.systemLabel = val.label
|
|
|
if (val) {
|