|
@@ -26,13 +26,11 @@
|
|
|
</div>
|
|
|
<div class="content-box">
|
|
|
<div class="button">
|
|
|
- <el-button @click="del" :plain="toBeDelCount?false:true" :disabled="toBeDelCount?false:true"
|
|
|
- :title="toBeDelCount ? '':'没有待删除的设备'">需从模型中删除的设备
|
|
|
+ <el-button @click="del" :disabled="toBeDelCount?false:true" :title="toBeDelCount ? '':'没有待删除的设备'">需从模型中删除的设备
|
|
|
</el-button>
|
|
|
- <el-button @click="supplement" :plain="toBeSuppCount?false:true" :disabled="toBeSuppCount?false:true"
|
|
|
- :title="toBeSuppCount ? '':'没有待补充的设备'">模型待补充的设备
|
|
|
+ <el-button @click="supplement" :disabled="toBeSuppCount?false:true" :title="toBeSuppCount ? '':'没有待补充的设备'">模型待补充的设备
|
|
|
</el-button>
|
|
|
- <el-button type="info" :loading="load" @click='getExportReport'>导出模型问题报告</el-button>
|
|
|
+ <el-button :loading="load" @click='getExportReport'>导出模型问题报告</el-button>
|
|
|
</div>
|
|
|
<div class="table"
|
|
|
:style="tableList&&tableList.length?'width: 100%;height: calc(100% - 47px)':'width: 100%;height: calc(100% - 10px)'">
|
|
@@ -163,7 +161,7 @@
|
|
|
</template>
|
|
|
</el-table>
|
|
|
<el-pagination class="right" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="page.pageNumber"
|
|
|
- :page-sizes="page.pageSizes" :page-size="page.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="page.total">
|
|
|
+ :page-sizes="page.pageSizes" :page-size="page.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="page.total">
|
|
|
</el-pagination>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -208,261 +206,261 @@
|
|
|
toBeSuppCount: 0,
|
|
|
toBeDelCount: 0
|
|
|
}
|
|
|
- },
|
|
|
- mounted() { },
|
|
|
- created() {
|
|
|
- this.params = {
|
|
|
- Orders: "Name asc"
|
|
|
- }
|
|
|
- this.getModelFileCount();
|
|
|
- this.getModelFloorCount();
|
|
|
- },
|
|
|
- computed: {
|
|
|
- ...mapGetters('layout', ['projectId'])
|
|
|
- },
|
|
|
- methods: {
|
|
|
- cellStyle({row, column, rowIndex, columnIndex}) {
|
|
|
- if (column.label !== '模型楼层' && column.label !== '待删除设备数量' && column.label !== '待补充设备数量' && column.label !== '有问题的检查项') {
|
|
|
- return {
|
|
|
- background: '#f3f3f3',
|
|
|
- lineHeight: '30px'
|
|
|
- }
|
|
|
+ },
|
|
|
+ mounted() { },
|
|
|
+ created() {
|
|
|
+ this.params = {
|
|
|
+ Orders: "Name asc"
|
|
|
}
|
|
|
+ this.getModelFileCount();
|
|
|
+ this.getModelFloorCount();
|
|
|
},
|
|
|
- getModelFloorCount() {// 获取楼层模型文件数量,计算出检查出问题的模型文件
|
|
|
- let promise1 = new Promise(resolve => {
|
|
|
- queryFloorList({Filters:"Status=4"}, res => {
|
|
|
- resolve(res);
|
|
|
- })
|
|
|
- })
|
|
|
- Promise.all([promise1]).then(response => {
|
|
|
- this.problemCount = 0;
|
|
|
- let res = response[0];
|
|
|
- this.modelFloorCount = res.Total;
|
|
|
- this.modelFloor = res.Content;
|
|
|
- this.getModelFileIcon();
|
|
|
- this.modelFloor.forEach(item => {
|
|
|
- if (!item.DataCheckResult) {
|
|
|
- this.problemCount++;
|
|
|
+ computed: {
|
|
|
+ ...mapGetters('layout', ['projectId'])
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ cellStyle({row, column, rowIndex, columnIndex}) {
|
|
|
+ if (column.label !== '模型楼层' && column.label !== '待删除设备数量' && column.label !== '待补充设备数量' && column.label !== '有问题的检查项') {
|
|
|
+ return {
|
|
|
+ background: '#f3f3f3',
|
|
|
+ lineHeight: '30px'
|
|
|
}
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getModelFloorCount() {// 获取楼层模型文件数量,计算出检查出问题的模型文件
|
|
|
+ let promise1 = new Promise(resolve => {
|
|
|
+ queryFloorList({Filters:"Status=4"}, res => {
|
|
|
+ resolve(res);
|
|
|
+ })
|
|
|
})
|
|
|
- })
|
|
|
- },
|
|
|
- getModelFileIcon() {// 计算文件夹的图标
|
|
|
- this.tableList.forEach(item => {
|
|
|
- this.modelFloor.forEach(it => {
|
|
|
- if (item.Code === it.FolderId) {
|
|
|
+ Promise.all([promise1]).then(response => {
|
|
|
+ this.problemCount = 0;
|
|
|
+ let res = response[0];
|
|
|
+ this.modelFloorCount = res.Total;
|
|
|
+ this.modelFloor = res.Content;
|
|
|
+ this.getModelFileIcon();
|
|
|
+ this.modelFloor.forEach(item => {
|
|
|
if (!item.DataCheckResult) {
|
|
|
- item.flag = false;
|
|
|
+ this.problemCount++;
|
|
|
}
|
|
|
- }
|
|
|
- })
|
|
|
- })
|
|
|
- },
|
|
|
- getData(tab) {// 切换tab时执行
|
|
|
- this.getModelFloor();
|
|
|
- },
|
|
|
- getModelFileCount() {// 获取项目下所有模型文件夹
|
|
|
- queryModel(this.params, res => {
|
|
|
- this.ModelFileCount = res.Content.length;
|
|
|
- this.tableList = res.Content;
|
|
|
- if (this.tableList && this.tableList.length) {
|
|
|
- this.tableList.forEach((item, index) => {
|
|
|
- item.Code = item.Id;
|
|
|
})
|
|
|
- this.activeTab = this.tableList[0].Code;// 默认选中第一个模型文件夹
|
|
|
- }
|
|
|
- this.getModelFloor();
|
|
|
- });
|
|
|
- },
|
|
|
- getModelFloor() {// 获取当前楼层下的模型楼层和各个检查项的数据
|
|
|
- let params = {
|
|
|
- ProjectId: this.projectId,
|
|
|
- Id: `${this.activeTab}`,
|
|
|
- PageNumber: this.page.pageNumber,
|
|
|
- PageSize: this.page.pageSize
|
|
|
- }
|
|
|
- queryReportList(params, res => {
|
|
|
- this.FloorName = res.Content;
|
|
|
- this.tableData = [];
|
|
|
- if (this.FloorName && this.FloorName.length) {
|
|
|
- this.loading = true;
|
|
|
- let i = 0;
|
|
|
- this.FloorName.forEach(item => {
|
|
|
- item.questionItem = 0;
|
|
|
- for (let key in item) {
|
|
|
- if (item[key] > 0 && key !== "FloorName" && key !== "questionItem") {
|
|
|
- i += 1;
|
|
|
- item.questionItem += 1;
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getModelFileIcon() {// 计算文件夹的图标
|
|
|
+ this.tableList.forEach(item => {
|
|
|
+ this.modelFloor.forEach(it => {
|
|
|
+ if (item.Code === it.FolderId) {
|
|
|
+ if (!item.DataCheckResult) {
|
|
|
+ item.flag = false;
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
- this.floorIconType = i;
|
|
|
- }
|
|
|
- this.getLostModelFloor();
|
|
|
- })
|
|
|
- },
|
|
|
- getLostModelFloor() {// 获取缺失楼层
|
|
|
- let params = {
|
|
|
- ProjectId: this.projectId,
|
|
|
- Filters: `FolderId='${this.activeTab}';Status=4`
|
|
|
- }
|
|
|
- queryLostReportList(params, res => {
|
|
|
- this.LostFloorName = res.Content;
|
|
|
- this.getToBeCount();
|
|
|
- })
|
|
|
- },
|
|
|
- getToBeCount() {// 根据模型ID获取待删除数量和待补充数量
|
|
|
- let equipComDelList = [];
|
|
|
- this.equipComDelList = [];
|
|
|
- this.LostFloorName.forEach(item => {
|
|
|
- if (item.CurrentModelId) {
|
|
|
- equipComDelList.push({
|
|
|
- ModelId: item.CurrentModelId
|
|
|
- });
|
|
|
- this.equipComDelList.push(item.CurrentModelId)
|
|
|
- } else {
|
|
|
- item.flag = 'lost';
|
|
|
- item.FloorName = `${item.Note + item.FloorName}`
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getData(tab) {// 切换tab时执行
|
|
|
+ this.getModelFloor();
|
|
|
+ },
|
|
|
+ getModelFileCount() {// 获取项目下所有模型文件夹
|
|
|
+ queryModel(this.params, res => {
|
|
|
+ this.ModelFileCount = res.Content.length;
|
|
|
+ this.tableList = res.Content;
|
|
|
+ if (this.tableList && this.tableList.length) {
|
|
|
+ this.tableList.forEach((item, index) => {
|
|
|
+ item.Code = item.Id;
|
|
|
+ })
|
|
|
+ this.activeTab = this.tableList[0].Code;// 默认选中第一个模型文件夹
|
|
|
+ }
|
|
|
+ this.getModelFloor();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getModelFloor() {// 获取当前楼层下的模型楼层和各个检查项的数据
|
|
|
+ let params = {
|
|
|
+ ProjectId: this.projectId,
|
|
|
+ Id: `${this.activeTab}`,
|
|
|
+ PageNumber: this.page.pageNumber,
|
|
|
+ PageSize: this.page.pageSize
|
|
|
}
|
|
|
- })
|
|
|
- let params = {
|
|
|
- ProjectId: this.projectId,
|
|
|
- data: equipComDelList
|
|
|
- }
|
|
|
- let promise1 = new Promise(resolve => {
|
|
|
- getToBeDelEquip(params, res => {
|
|
|
- resolve(res);
|
|
|
+ queryReportList(params, res => {
|
|
|
+ this.FloorName = res.Content;
|
|
|
+ this.tableData = [];
|
|
|
+ if (this.FloorName && this.FloorName.length) {
|
|
|
+ this.loading = true;
|
|
|
+ let i = 0;
|
|
|
+ this.FloorName.forEach(item => {
|
|
|
+ item.questionItem = 0;
|
|
|
+ for (let key in item) {
|
|
|
+ if (item[key] > 0 && key !== "FloorName" && key !== "questionItem") {
|
|
|
+ i += 1;
|
|
|
+ item.questionItem += 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.floorIconType = i;
|
|
|
+ }
|
|
|
+ this.getLostModelFloor();
|
|
|
})
|
|
|
- })
|
|
|
- let promise2 = new Promise(resolve => {
|
|
|
- getSupplement(params, res => {
|
|
|
- resolve(res);
|
|
|
+ },
|
|
|
+ getLostModelFloor() {// 获取缺失楼层
|
|
|
+ let params = {
|
|
|
+ ProjectId: this.projectId,
|
|
|
+ Filters: `FolderId='${this.activeTab}';Status=4`
|
|
|
+ }
|
|
|
+ queryLostReportList(params, res => {
|
|
|
+ this.LostFloorName = res.Content;
|
|
|
+ this.getToBeCount();
|
|
|
})
|
|
|
- })
|
|
|
- Promise.all([promise1, promise2]).then(response => {
|
|
|
- let res = response[0];
|
|
|
- let res1 = response[1];
|
|
|
- this.toBeDelCount = 0;
|
|
|
- this.toBeSuppCount = 0;
|
|
|
- res.Content.forEach(item => {
|
|
|
-
|
|
|
- if (item.Count > 0) {
|
|
|
- this.toBeDelCount += 1;
|
|
|
+ },
|
|
|
+ getToBeCount() {// 根据模型ID获取待删除数量和待补充数量
|
|
|
+ let equipComDelList = [];
|
|
|
+ this.equipComDelList = [];
|
|
|
+ this.LostFloorName.forEach(item => {
|
|
|
+ if (item.CurrentModelId) {
|
|
|
+ equipComDelList.push({
|
|
|
+ ModelId: item.CurrentModelId
|
|
|
+ });
|
|
|
+ this.equipComDelList.push(item.CurrentModelId)
|
|
|
+ } else {
|
|
|
+ item.flag = 'lost';
|
|
|
+ item.FloorName = `${item.Note + item.FloorName}`
|
|
|
}
|
|
|
- this.LostFloorName.forEach(it => {
|
|
|
- if (item.ModelId === it.CurrentModelId) {
|
|
|
- it.toBeDel = item.Count;
|
|
|
- }
|
|
|
+ })
|
|
|
+ let params = {
|
|
|
+ ProjectId: this.projectId,
|
|
|
+ data: equipComDelList
|
|
|
+ }
|
|
|
+ let promise1 = new Promise(resolve => {
|
|
|
+ getToBeDelEquip(params, res => {
|
|
|
+ resolve(res);
|
|
|
})
|
|
|
})
|
|
|
- res1.Content.forEach(item => {
|
|
|
- if (item.Count > 0) {
|
|
|
- this.toBeSuppCount += 1;
|
|
|
- }
|
|
|
- this.LostFloorName.forEach(it => {
|
|
|
- if (item.ModelId === it.CurrentModelId) {
|
|
|
- it.toBeSupplement = item.Count;
|
|
|
- }
|
|
|
+ let promise2 = new Promise(resolve => {
|
|
|
+ getSupplement(params, res => {
|
|
|
+ resolve(res);
|
|
|
})
|
|
|
})
|
|
|
- if (this.LostFloorName && this.LostFloorName.length) {
|
|
|
- this.LostFloorName.forEach(item => {
|
|
|
- this.FloorName.forEach(it => {
|
|
|
- if (item.FloorName === it.FloorName) {
|
|
|
- for (let key in it) {
|
|
|
- item[key] = it[key];
|
|
|
- }
|
|
|
+ Promise.all([promise1, promise2]).then(response => {
|
|
|
+ let res = response[0];
|
|
|
+ let res1 = response[1];
|
|
|
+ this.toBeDelCount = 0;
|
|
|
+ this.toBeSuppCount = 0;
|
|
|
+ res.Content.forEach(item => {
|
|
|
+
|
|
|
+ if (item.Count > 0) {
|
|
|
+ this.toBeDelCount += 1;
|
|
|
+ }
|
|
|
+ this.LostFloorName.forEach(it => {
|
|
|
+ if (item.ModelId === it.CurrentModelId) {
|
|
|
+ it.toBeDel = item.Count;
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
- this.tableData = this.LostFloorName;
|
|
|
- } else {
|
|
|
- this.tableData = [];
|
|
|
- }
|
|
|
- this.page.total = this.tableData.length;
|
|
|
- this.loading = false;
|
|
|
- })
|
|
|
- },
|
|
|
- del() {// 点击需从模型中删除的设备
|
|
|
- let equipComDelList = encodeURIComponent(JSON.stringify(this.equipComDelList));
|
|
|
- let jumpRouter = this.$router.resolve({ path: '/model/report/deleted', query: { equipComDelList: equipComDelList } })
|
|
|
- window.open(jumpRouter.href, '_blank')
|
|
|
- },
|
|
|
- supplement() {// 点击模型待补充的设备
|
|
|
- let equipComDelList = encodeURIComponent(JSON.stringify(this.equipComDelList));
|
|
|
- let jumpRouter = this.$router.resolve({ path: '/model/report/supplement', query: { equipComDelList: equipComDelList } })
|
|
|
- window.open(jumpRouter.href, '_blank')
|
|
|
- },
|
|
|
- getExportReport() {// 导出模型问题报告
|
|
|
- let that = this;
|
|
|
- this.load = true;
|
|
|
- axios({
|
|
|
- method: 'post',
|
|
|
- url: `/modelapi/report/non-blocking`,
|
|
|
- data: {
|
|
|
- Id: this.activeTab,
|
|
|
- ProjectId: this.projectId
|
|
|
- },
|
|
|
- headers: {
|
|
|
- ProjectId: this.projectId
|
|
|
- },
|
|
|
- responseType: 'blob'
|
|
|
- }).then(function (res) {
|
|
|
- if (res.data.type == 'application/vnd.ms-excel') {
|
|
|
- let blob = new Blob([res.data], { type: 'application/vnd.ms-excel;charset=utf-8' });
|
|
|
- let fileName = decodeURI(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)
|
|
|
- that.load = false;
|
|
|
- } else { // IE10+下载
|
|
|
- navigator.msSaveBlob(blob, fileName)
|
|
|
- that.load = false;
|
|
|
+ res1.Content.forEach(item => {
|
|
|
+ if (item.Count > 0) {
|
|
|
+ this.toBeSuppCount += 1;
|
|
|
+ }
|
|
|
+ this.LostFloorName.forEach(it => {
|
|
|
+ if (item.ModelId === it.CurrentModelId) {
|
|
|
+ it.toBeSupplement = item.Count;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ if (this.LostFloorName && this.LostFloorName.length) {
|
|
|
+ this.LostFloorName.forEach(item => {
|
|
|
+ this.FloorName.forEach(it => {
|
|
|
+ if (item.FloorName === it.FloorName) {
|
|
|
+ for (let key in it) {
|
|
|
+ item[key] = it[key];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ this.tableData = this.LostFloorName;
|
|
|
+ } else {
|
|
|
+ this.tableData = [];
|
|
|
}
|
|
|
- } else {
|
|
|
- let reader = new FileReader()
|
|
|
- reader.onload = e => {
|
|
|
- if (e.target.readyState === 2) {
|
|
|
- let res = {}
|
|
|
+ this.page.total = this.tableData.length;
|
|
|
+ this.loading = false;
|
|
|
+ })
|
|
|
+ },
|
|
|
+ del() {// 点击需从模型中删除的设备
|
|
|
+ let equipComDelList = encodeURIComponent(JSON.stringify(this.equipComDelList));
|
|
|
+ let jumpRouter = this.$router.resolve({ path: '/model/report/deleted', query: { equipComDelList: equipComDelList } })
|
|
|
+ window.open(jumpRouter.href, '_blank')
|
|
|
+ },
|
|
|
+ supplement() {// 点击模型待补充的设备
|
|
|
+ let equipComDelList = encodeURIComponent(JSON.stringify(this.equipComDelList));
|
|
|
+ let jumpRouter = this.$router.resolve({ path: '/model/report/supplement', query: { equipComDelList: equipComDelList } })
|
|
|
+ window.open(jumpRouter.href, '_blank')
|
|
|
+ },
|
|
|
+ getExportReport() {// 导出模型问题报告
|
|
|
+ let that = this;
|
|
|
+ this.load = true;
|
|
|
+ axios({
|
|
|
+ method: 'post',
|
|
|
+ url: `/modelapi/report/non-blocking`,
|
|
|
+ data: {
|
|
|
+ Id: this.activeTab,
|
|
|
+ ProjectId: this.projectId
|
|
|
+ },
|
|
|
+ headers: {
|
|
|
+ ProjectId: this.projectId
|
|
|
+ },
|
|
|
+ responseType: 'blob'
|
|
|
+ }).then(function (res) {
|
|
|
+ if (res.data.type == 'application/vnd.ms-excel') {
|
|
|
+ let blob = new Blob([res.data], { type: 'application/vnd.ms-excel;charset=utf-8' });
|
|
|
+ let fileName = decodeURI(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)
|
|
|
+ that.load = false;
|
|
|
+ } else { // IE10+下载
|
|
|
+ navigator.msSaveBlob(blob, fileName)
|
|
|
that.load = false;
|
|
|
- res = JSON.parse(e.target.result)
|
|
|
- that.$message.error(res.Message);
|
|
|
}
|
|
|
+ } else {
|
|
|
+ let reader = new FileReader()
|
|
|
+ reader.onload = e => {
|
|
|
+ if (e.target.readyState === 2) {
|
|
|
+ let res = {}
|
|
|
+ that.load = false;
|
|
|
+ res = JSON.parse(e.target.result)
|
|
|
+ that.$message.error(res.Message);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ reader.readAsText(res.data)
|
|
|
}
|
|
|
- reader.readAsText(res.data)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ tableRowClassName({ row, rowIndex, column }) {// 设置缺失楼层所在行的背景色
|
|
|
+ if (row.flag && row.flag === 'lost') {
|
|
|
+ return 'warning-row';
|
|
|
}
|
|
|
- })
|
|
|
- },
|
|
|
- tableRowClassName({ row, rowIndex, column }) {// 设置缺失楼层所在行的背景色
|
|
|
- if (row.flag && row.flag === 'lost') {
|
|
|
- return 'warning-row';
|
|
|
+ },
|
|
|
+ handleSizeChange(val) {// 切换每页显示数量
|
|
|
+ this.page.pageSize = val;
|
|
|
+ this.getModelFloor();
|
|
|
+ },
|
|
|
+ handleCurrentChange(val) {// 切换页码
|
|
|
+ this.page.pageNumber = val;
|
|
|
+ this.getModelFloor();
|
|
|
}
|
|
|
},
|
|
|
- handleSizeChange(val) {// 切换每页显示数量
|
|
|
- this.page.pageSize = val;
|
|
|
- this.getModelFloor();
|
|
|
- },
|
|
|
- handleCurrentChange(val) {// 切换页码
|
|
|
- this.page.pageNumber = val;
|
|
|
- this.getModelFloor();
|
|
|
- }
|
|
|
- },
|
|
|
- watch: {
|
|
|
- projectId() {
|
|
|
- this.getModelFileCount();
|
|
|
- this.getModelFloorCount();
|
|
|
+ watch: {
|
|
|
+ projectId() {
|
|
|
+ this.getModelFileCount();
|
|
|
+ this.getModelFloorCount();
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
-}
|
|
|
</script>
|
|
|
|
|
|
<style lang="less" scoped>
|
|
@@ -504,11 +502,6 @@
|
|
|
.button {
|
|
|
padding-left: 10px;
|
|
|
|
|
|
- button {
|
|
|
- border: 1px solid #dcdfe6;
|
|
|
- color: #606266;
|
|
|
- background: white;
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
.success-color {
|