|
@@ -5,19 +5,25 @@
|
|
|
<el-button style="float:left;" size="small" type="default" icon="el-icon-back" @click="goBack"></el-button>
|
|
|
<floor-cascader ref="floorCascader" @change="changeFloor"></floor-cascader>
|
|
|
<my-cascader ref="cascader" @change="changeDevice"></my-cascader>
|
|
|
- <el-input placeholder="请输入安装位置" style="width: 200px;margin-left:20px;" v-model="keycode" clearable @keyup.enter.native="getTableData">
|
|
|
+ <el-input placeholder="请输入安装位置" style="width: 200px;margin-left:20px;" v-model="keycode" clearable
|
|
|
+ @keyup.enter.native="getTableData">
|
|
|
<i slot="suffix" class="el-input__icon el-icon-search" style="cursor:pointer;" @click="getTableData"></i>
|
|
|
</el-input>
|
|
|
<el-button style="float:right;margin-top:1px;" @click="handleClickCreate">创建已选</el-button>
|
|
|
</div>
|
|
|
- <div class="main" :style="tableData && tableData.length?'height: calc(100% - 96px);':'height: calc(100% - 46px);'">
|
|
|
- <el-table ref="multipleTable" :data="tableData" v-loading='loading' stripe height="100%" @selection-change="handleSelectionChange" :header-cell-style="headerStyle">
|
|
|
+ <div class="main"
|
|
|
+ :style="tableData && tableData.length?'height: calc(100% - 96px);':'height: calc(100% - 46px);'">
|
|
|
+ <el-table ref="multipleTable" :data="tableData" v-loading='loading' stripe height="100%"
|
|
|
+ @selection-change="handleSelectionChange" :header-cell-style="headerStyle">
|
|
|
<el-table-column type="selection" width="55"></el-table-column>
|
|
|
<el-table-column type="expand">
|
|
|
<template slot-scope="props">
|
|
|
- <p v-if="props.row.ComponentCount && props.row.ComponentCount.length" style="color:#99a9bf;line-height:32px;font-size:14px;">包含的部件:</p>
|
|
|
- <el-form label-position="left" label-width="auto" inline class="demo-table-expand" v-if="props.row.ComponentCount && props.row.ComponentCount.length">
|
|
|
- <el-form-item v-for="item in props.row.ComponentCount?props.row.ComponentCount:[]" :key="item.code" :label="`${item.name}:`">
|
|
|
+ <p v-if="props.row.ComponentCount && props.row.ComponentCount.length"
|
|
|
+ style="color:#99a9bf;line-height:32px;font-size:14px;">包含的部件:</p>
|
|
|
+ <el-form label-position="left" label-width="auto" inline class="demo-table-expand"
|
|
|
+ v-if="props.row.ComponentCount && props.row.ComponentCount.length">
|
|
|
+ <el-form-item v-for="item in props.row.ComponentCount?props.row.ComponentCount:[]" :key="item.code"
|
|
|
+ :label="`${item.name}:`">
|
|
|
<span>{{ item.count }}</span>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
@@ -26,17 +32,21 @@
|
|
|
<el-table-column label="所属建筑楼层" width="200">
|
|
|
<template slot-scope="scope">
|
|
|
<div>
|
|
|
- {{scope.row.Building?scope.row.Building.BuildLocalName?scope.row.Building.BuildLocalName:'':''}} -
|
|
|
- {{scope.row.Floor?scope.row.Floor.FloorLocalName?scope.row.Floor.FloorLocalName:'':''}}
|
|
|
+ {{
|
|
|
+ scope.row.Building ? scope.row.Building.BuildLocalName ? scope.row.Building.BuildLocalName : '' : ''
|
|
|
+ }}
|
|
|
+ -
|
|
|
+ {{ scope.row.Floor ? scope.row.Floor.FloorLocalName ? scope.row.Floor.FloorLocalName : '' : '' }}
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="EquipLocalName" label="设备本地名称" show-overflow-tooltip>
|
|
|
- <template slot-scope="scope">
|
|
|
+ <template slot-scope="scope">
|
|
|
<div>
|
|
|
- {{scope.row.EquipLocalName}}
|
|
|
+ {{ scope.row.EquipLocalName }}
|
|
|
<el-badge v-if="scope.row.Component&&scope.row.Component.length?true:false"
|
|
|
- :value="scope.row.Component&&scope.row.Component.length?scope.row.Component.length:0" class="item" type="warning">
|
|
|
+ :value="scope.row.Component&&scope.row.Component.length?scope.row.Component.length:0"
|
|
|
+ class="item" type="warning">
|
|
|
</el-badge>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -47,7 +57,8 @@
|
|
|
<el-table-column prop="type" label="现场验证操作规定" width="200">
|
|
|
<template slot-scope="scope">
|
|
|
<el-select style="width:100px;" v-model="scope.row.SchemeId" placeholder="请选择">
|
|
|
- <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
|
|
|
+ <el-option v-for="item in options" :key="item.value" :label="item.label"
|
|
|
+ :value="item.value"></el-option>
|
|
|
</el-select>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -77,55 +88,55 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import {mapGetters} from "vuex"
|
|
|
- //组件
|
|
|
- import floorCascader from "@/components/ledger/lib/floorCascader"
|
|
|
- import myCascader from "@/components/ledger/lib/cascader"
|
|
|
- //api
|
|
|
- import {queryEquip} from "@/api/scan/request"
|
|
|
- import {createDeviceTask} from "@/api/data_admin/buildTaskApi"
|
|
|
+import {mapGetters} from "vuex"
|
|
|
+//组件
|
|
|
+import floorCascader from "@/components/ledger/lib/floorCascader"
|
|
|
+import myCascader from "@/components/ledger/lib/cascader"
|
|
|
+//api
|
|
|
+import {queryEquip} from "@/api/scan/request"
|
|
|
+import {createDeviceTask} from "@/api/data_admin/buildTaskApi"
|
|
|
|
|
|
- export default {
|
|
|
- data() {
|
|
|
- return {
|
|
|
- params: {},
|
|
|
- loading: false,
|
|
|
- keycode: '',
|
|
|
- page: {
|
|
|
- pageSize: 50,
|
|
|
- pageSizes: [10, 20, 50, 100],
|
|
|
- pageNumber: 1,
|
|
|
- total: 0
|
|
|
- },
|
|
|
- options: [{//方案
|
|
|
- value: '1',
|
|
|
- label: '极简'
|
|
|
- }, {
|
|
|
- value: '2',
|
|
|
- label: '标准'
|
|
|
- }],
|
|
|
- tableData: [],
|
|
|
- multipleSelection: [],
|
|
|
- headerStyle: {
|
|
|
- backgroundColor: '#e1e4e5',
|
|
|
- color: '#2b2b2b',
|
|
|
- lineHeight: '30px'
|
|
|
- }, // 列表样式
|
|
|
- }
|
|
|
- },
|
|
|
- computed: {
|
|
|
- ...mapGetters("layout", ["projectId", "userId", "secret"])
|
|
|
- },
|
|
|
- components: {
|
|
|
- floorCascader,
|
|
|
- myCascader
|
|
|
- },
|
|
|
- created() {
|
|
|
- this.params = this.$route.query
|
|
|
- console.log(this.params)
|
|
|
- },
|
|
|
- mounted() {
|
|
|
- this.getTableData()
|
|
|
+export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ params: {},
|
|
|
+ loading: false,
|
|
|
+ keycode: '',
|
|
|
+ page: {
|
|
|
+ pageSize: 50,
|
|
|
+ pageSizes: [10, 20, 50, 100],
|
|
|
+ pageNumber: 1,
|
|
|
+ total: 0
|
|
|
+ },
|
|
|
+ options: [{//方案
|
|
|
+ value: '1',
|
|
|
+ label: '极简'
|
|
|
+ }, {
|
|
|
+ value: '2',
|
|
|
+ label: '标准'
|
|
|
+ }],
|
|
|
+ tableData: [],
|
|
|
+ multipleSelection: [],
|
|
|
+ headerStyle: {
|
|
|
+ backgroundColor: '#e1e4e5',
|
|
|
+ color: '#2b2b2b',
|
|
|
+ lineHeight: '30px'
|
|
|
+ }, // 列表样式
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapGetters("layout", ["projectId", "userId", "secret"])
|
|
|
+ },
|
|
|
+ components: {
|
|
|
+ floorCascader,
|
|
|
+ myCascader
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.params = this.$route.query
|
|
|
+ console.log(this.params)
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.getTableData()
|
|
|
},
|
|
|
watch: {
|
|
|
projectId() {
|
|
@@ -137,11 +148,11 @@
|
|
|
methods: {
|
|
|
//返回
|
|
|
goBack() {
|
|
|
- this.$router.push({ name: "buildTask" })
|
|
|
+ this.$router.push({name: "buildTask"})
|
|
|
},
|
|
|
//选择设备或部件
|
|
|
changeDevice(val) {
|
|
|
- if(val.code) {
|
|
|
+ if (val.code) {
|
|
|
this.params.category = val.code
|
|
|
} else {
|
|
|
this.params.category = ''
|
|
@@ -168,12 +179,14 @@
|
|
|
let param = this.formatFilter()
|
|
|
queryEquip(param, res => {
|
|
|
this.tableData = res.Content.map(item => {
|
|
|
- if(item.Component && item.Component.length){
|
|
|
+ if (item.Component && item.Component.length) {
|
|
|
item.ComponentCount = []
|
|
|
item.Component.map(parts => {
|
|
|
- if(parts.EquipCategory && parts.EquipCategory.EquipCode && parts.EquipCategory.EquipName){
|
|
|
- let index = item.ComponentCount.findIndex(c => {return c.code == parts.EquipCategory.EquipCode})
|
|
|
- if(index != -1){
|
|
|
+ if (parts.EquipCategory && parts.EquipCategory.EquipCode && parts.EquipCategory.EquipName) {
|
|
|
+ let index = item.ComponentCount.findIndex(c => {
|
|
|
+ return c.code == parts.EquipCategory.EquipCode
|
|
|
+ })
|
|
|
+ if (index != -1) {
|
|
|
item.ComponentCount[index].count++
|
|
|
} else {
|
|
|
item.ComponentCount.push({
|
|
@@ -207,11 +220,11 @@
|
|
|
},
|
|
|
{
|
|
|
Name: "building",
|
|
|
- Projection: [ "BuildLocalName", "BuildName", "BuildID" ]
|
|
|
+ Projection: ["BuildLocalName", "BuildName", "BuildID"]
|
|
|
},
|
|
|
{
|
|
|
Name: "floor",
|
|
|
- Projection: [ "FloorLocalName", "FloorName", "FloorID" ]
|
|
|
+ Projection: ["FloorLocalName", "FloorName", "FloorID"]
|
|
|
}
|
|
|
],
|
|
|
Filters: `ProjectId='${this.projectId}'`,
|
|
@@ -220,7 +233,7 @@
|
|
|
PageSize: this.page.pageSize
|
|
|
}
|
|
|
|
|
|
- if(this.params.isVerification){
|
|
|
+ if (this.params.isVerification == 'true') {
|
|
|
// params.Filters += `;(TaskState isNull || TaskState=0 || TaskState=-1)`
|
|
|
// params.Filters += `;(TaskState!=0 || TaskState!=-1 || TaskState!=1)`
|
|
|
params.Filters += `;TaskState isnull`
|
|
@@ -231,11 +244,11 @@
|
|
|
|
|
|
}
|
|
|
|
|
|
- if(this.keycode){
|
|
|
+ if (this.keycode) {
|
|
|
params.Filters += `;LedgerParam.Siteinstall.InstallLocation contain '${this.keycode}'`
|
|
|
}
|
|
|
|
|
|
- if(this.params.category){
|
|
|
+ if (this.params.category) {
|
|
|
params.Filters += `;Category='${this.params.category}'`
|
|
|
}
|
|
|
|
|
@@ -286,7 +299,7 @@
|
|
|
}
|
|
|
createDeviceTask(param, res => {
|
|
|
this.$message.success("创建成功!")
|
|
|
- this.$router.push({ name: "buildTask",query:{ newTaskTypes:this.$route.query.newTaskTypes } })
|
|
|
+ this.$router.push({name: "buildTask", query: {newTaskTypes: this.$route.query.newTaskTypes}})
|
|
|
})
|
|
|
} else {
|
|
|
this.$message('请选择要创建的任务!')
|
|
@@ -314,7 +327,8 @@
|
|
|
padding-bottom: 10px;
|
|
|
border-bottom: 1px solid #bcbcbc;
|
|
|
}
|
|
|
- .main{
|
|
|
+
|
|
|
+ .main {
|
|
|
margin-top: 10px;
|
|
|
}
|
|
|
}
|
|
@@ -322,17 +336,19 @@
|
|
|
</style>
|
|
|
|
|
|
<style>
|
|
|
- .demo-table-expand {
|
|
|
- font-size: 0;
|
|
|
- }
|
|
|
- .demo-table-expand label {
|
|
|
- width: 90px;
|
|
|
- color: #99a9bf;
|
|
|
- }
|
|
|
- .demo-table-expand .el-form-item {
|
|
|
- margin-right: 0;
|
|
|
- margin-bottom: 0;
|
|
|
- margin-left: 120px;
|
|
|
- width: 100%;
|
|
|
- }
|
|
|
+.demo-table-expand {
|
|
|
+ font-size: 0;
|
|
|
+}
|
|
|
+
|
|
|
+.demo-table-expand label {
|
|
|
+ width: 90px;
|
|
|
+ color: #99a9bf;
|
|
|
+}
|
|
|
+
|
|
|
+.demo-table-expand .el-form-item {
|
|
|
+ margin-right: 0;
|
|
|
+ margin-bottom: 0;
|
|
|
+ margin-left: 120px;
|
|
|
+ width: 100%;
|
|
|
+}
|
|
|
</style>
|