Browse Source

wanda-adm:feat > 修改bug

shaun-sheep 4 years ago
parent
commit
95dcd503d0

+ 2 - 2
package.json

@@ -69,13 +69,13 @@
     "eslint-plugin-vue": "^7.1.0",
     "sass": "^1.28.0",
     "sass-loader": "^10.0.4",
-    "style-resources-loader": "^1.3.3",
     "spark-md5": "^3.0.0",
     "stompjs": "^2.3.3",
+    "style-resources-loader": "^1.3.3",
     "typescript": "^4.0.5",
-    "vue-simple-uploader": "^0.7.4",
     "vue-cli-plugin-element": "^1.0.1",
     "vue-cli-plugin-style-resources-loader": "^0.1.4",
+    "vue-simple-uploader": "^0.7.4",
     "vue-template-compiler": "^2.6.12",
     "webpack": "^4.46.0"
   }

+ 5 - 0
src/api/datacenter.ts

@@ -57,6 +57,11 @@ export function queryEquip(postParams: any): any {
     return httputils.postJson(`${ baseApi }/object/equip/query`, postParams)
 }
 
+// 根据id删除设备信息
+export function deleteEquip(postParams: any): any {
+    return httputils.postJson(`${ baseApi }/object/equip/delete`, postParams)
+}
+
 // 创建设备信息
 export function createEquip(postParams: any): any {
     return httputils.postJson(`${ baseApi }/object/equip/create`, postParams)

+ 0 - 1
src/main.ts

@@ -19,7 +19,6 @@ import "@/permission";
 import moment from "moment";
 Vue.prototype.moment = moment;
 moment.locale('zh-cn')
-
 Vue.use(uploader);
 Vue.use(ElementUI, { size: "small", zIndex: 1000 });
 Vue.use(SvgIcon, {

+ 27 - 8
src/views/maintain/device/index.vue

@@ -34,21 +34,21 @@
         <el-scrollbar style="height:400px;">
             <el-dialog
                 :title="deviceMsg"
+                :width="!isWidth ? '30%':''"
                 :visible.sync="dialogVisible"
-                @close="close"
-            >
+                @close="close">
                 <template slot="title">
                     <div class="alertTitle">
                         <span>{{ deviceMsg }}</span>
-                        <el-button type="text" >
-                            <span class="el-icon-question" />
+                        <el-button type="text">
+                            <span class="el-icon-question"/>
                             <a href="/datacenter/object/equip/downloads" download="维护帮助"> 维护帮助</a>
-                           </el-button>
+                        </el-button>
                     </div>
                 </template>
                 <template v-if="deviceMsg == '添加设备'">
                     <template v-if="next">
-                        <div class="align" style="height: 400px">
+                        <div class="align " :style="{ 'height': isWidth ? '400px':'200px' }">
                             <span class="text ">设备类别</span>
                             <el-cascader :options="list" clearable v-model="deviceVal"
                                          :props="optionProps"
@@ -82,6 +82,7 @@
                     <template v-else>
                         <dataForm :deviceHeaders="deviceHeaders" ref="dataForm" :currRowContent="currRowContent"/>
                         <span slot="footer" class="dialog-footer">
+                              <el-button type="danger" style="float: left" @click="deleteDevice">删除设备</el-button>
                          <el-button type="primary" @click="handleDataForm">确 定</el-button>
                          <el-button @click="handlePosition">维护位置</el-button>
                     </span>
@@ -97,7 +98,7 @@
 import { Component, Vue, Watch } from "vue-property-decorator";
 import { AdmMultiTable, AdmSearch, dataForm, Pagination, Statistics } from '../components/index'
 import { allDevice, BeatchQueryParam, dictInfo } from "@/api/equipComponent";
-import { createEquip, queryCount, queryEquip, updateEquip } from "@/api/datacenter";
+import { createEquip, queryCount, queryEquip, updateEquip, deleteEquip } from "@/api/datacenter";
 import { UserModule } from "@/store/modules/user";
 import deviceGraph from "./components/deviceGraph.vue"
 import tools from "@/utils/maintain"
@@ -123,6 +124,8 @@ export default class extends Vue {
         total: 0
 
     }
+    // 设置高度
+    isWidth = false
     // 设备类值
     deviceType = ''
     // 弹窗设备类值
@@ -239,6 +242,7 @@ export default class extends Vue {
     async handleNext() {
         if (this.deviceVal[1]) {
             this.next = false
+            this.isWidth = true
             let param = {
                 category: this.deviceVal[1]
             }
@@ -387,7 +391,7 @@ export default class extends Vue {
 
     // 维护位置
     handlePosition() {
-        this.currentRow= this.$refs.dataForm.form
+        this.currentRow = this.$refs.dataForm.form
         this.$refs.dataForm.submitForm(this.handlePositionSave)
     }
 
@@ -401,6 +405,18 @@ export default class extends Vue {
         this.$refs.dataForm.submitForm(this.handleDataFormSave)
     }
 
+    // 删除设备
+    deleteDevice() {
+        deleteEquip([{ id: this.currRowContent.id }]).then(res => {
+            if (res.result == 'success') {
+                this.$message.success('删除成功')
+                this.handleChangeDevice()
+                this.dialogVisible = false;
+            }
+
+        })
+    }
+
     handleDataFormSave() {
         const eq = tools.formatData(this.$refs.dataForm.form);
         if (eq.id) {
@@ -424,6 +440,7 @@ export default class extends Vue {
     // close
     close() {
         this.next = true
+        this.isWidth = false
         if (this.deviceType) {
             this.deviceVal = this.deviceType
         } else {
@@ -605,6 +622,8 @@ $border: 1px solid #E1E7EA;
 </style>
 <style lang="scss">
 .adm-device {
+
+
     .el-dialog__header {
         padding: 10px;
     }

+ 1 - 1
src/views/maintain/relationship/components/tableHeader.ts

@@ -7,6 +7,6 @@ const tableHeader = {
     '空间所在建筑': [['建筑', 'localName'], ['空间本地名称', "objectInfo-localName"], ['空间本地编码', "objectInfo-localId"], ['楼层', 'objectInfo-floorName']],
     '空间所在楼层': [['建筑', 'buildingName'], ['楼层', 'localName'], ['空间本地名称', "objectInfo-localName"], ['空间本地编码', "objectInfo-localId"]],
     '空间服务空间': [['空间本地名称', "buildingName"], ['空间本地编码', "localId"], ['建筑', 'buildingName'], ['楼层', 'floorName'], ['空间本地名称', "objectInfo-localName"], ['空间本地编码', "objectInfo-localId"], ['楼层', 'objectInfo-floorName']],
-    '系统下的设备': [['系统分类', 'systemCategory'], ['系统名称', ''], ['系统编码', ''], ['BIM构件名称', 'bimTypeId'], ['系统分类', 'systemCategory'], ['设备类型名称', 'codeName'], ['设备本地编码', "localId"]],
+    '系统下的设备': [['系统分类', 'systemCategory'], ['系统名称', 'localName'], ['系统编码', 'localId'], ['BIM构件名称', 'objectInfo-bimTypeId'], ['系统分类', 'objectInfo-systemCategory'], ['设备类型名称', 'objectInfo-codeName'], ['设备本地编码', "objectInfo-localId"]],
 }
 export default tableHeader

+ 5 - 5
src/views/maintain/space/index.vue

@@ -125,19 +125,19 @@ export default class spaceIndex extends Vue {
     zoneTypeOption = [
         {
             value: "FunctionZone",
-            label: "功能分区",
+            label: "功能空间",
         },
         {
             value: "Zone",
-            label: "业务分区",
+            label: "业务空间",
             children: [
                 {
                     value: "FireZone",
-                    label: "防火空间",
+                    label: "防火分区",
                 },
                 {
                     value: "PowerSupplyZone",
-                    label: "供电空间",
+                    label: "供电分区",
                 },
             ],
         },
@@ -449,7 +449,7 @@ export default class spaceIndex extends Vue {
 
                 this.headersStage = {
                     basicInfos: {
-                        name: "模型解析",
+                        name: "基础信息台账",
                         data: basicInfos,
                     },
                     dictStages: {

+ 20 - 10
src/views/maintain/system/index.vue

@@ -1,6 +1,6 @@
 <template>
     <div class="adm-system">
-        <statistics :statistics-msg="statisticsMsg" />
+        <statistics :statistics-msg="statisticsMsg"/>
         <div class="hr"></div>
         <div class="operation">
             <el-cascader :options="list" ref="floorCascader" clearable v-model="systemType" :props="optionProps"
@@ -27,16 +27,20 @@
                     />
                 </template>
                 <div v-else class="void align">
-                    <svg-icon :height="String(123)" :width="String(120)" name="void" />
+                    <svg-icon :height="String(123)" :width="String(120)" name="void"/>
                     <p class="void-title">暂无内容</p>
                     <p class="void-tips">可点击左上角选择系统类型</p>
                 </div>
             </div>
         </div>
         <!--        添加/编辑 系统-->
-        <el-dialog :title="systemMsg" :visible.sync="dialogVisible" @close="close">
+        <el-dialog
+            :title="systemMsg"
+            :width="!isWidth ? '30%':''"
+            :visible.sync="dialogVisible"
+            @close="close">
             <template v-if="next">
-                <div class="align" style="height: 400px">
+                <div class="align" :style="{ 'height': isWidth ? '400px':'200px' }">
                     <span class="text">系统类别</span>
                     <el-cascader :options="list" clearable v-model="systemVal"
                                  :props="optionProps"
@@ -77,7 +81,8 @@ export default class extends Vue {
         label: 'name',
         children: 'children'
     }
-
+    // 设置高度
+    isWidth = false
     // loading
     loading = false;
     // 下拉数据
@@ -117,6 +122,7 @@ export default class extends Vue {
     // 搜索内容
     inputSearch = "";
     systemHeaders = {}
+
     // 项目id
     get projectId(): string {
         return UserModule.projectId;
@@ -161,7 +167,7 @@ export default class extends Vue {
                 });
             }
         });
-        if (param.data.length >0 ) {
+        if (param.data.length > 0) {
             BeatchQueryParam(param).then((res) => {
                 this.tableData = data.map((item) => {
                     res.data.map((child) => {
@@ -222,6 +228,7 @@ export default class extends Vue {
     async handleNext() {
         if (this.systemVal[1]) {
             this.next = false
+            this.isWidth = true
             let param = {
                 type: this.systemVal[1],
                 orders: "sort asc, name desc",
@@ -258,6 +265,7 @@ export default class extends Vue {
             this.systemVal = ''
         }
         this.next = true;
+        this.isWidth = false
     }
 
     // 编辑当前行
@@ -271,7 +279,7 @@ export default class extends Vue {
 
     //信息点重组
     informationArrangement(arr: []): any {
-        let basicInfos = [{ path: "classification", name: "系统分类"}],
+        let basicInfos = [{ path: "classification", name: "系统分类" }],
             dictStages: any[] = [];
         this.all = arr;
         arr.forEach((item: any) => {
@@ -311,11 +319,11 @@ export default class extends Vue {
                 filters: this.systemType[1] ? `classCode='${ this.systemType[1] }'` : undefined,
                 pageNumber: this.paginationList.page,
                 pageSize: this.paginationList.size,
-                orders: "createTime asc, id asc",
+                orders: "createTime desc, id asc",
                 projectId: this.projectId,
             };
             if (this.inputSearch != "") {
-                param2.filters = `localName contain '${this.inputSearch}' or localId contain '${this.inputSearch}'`;
+                param2.filters = `localName contain '${ this.inputSearch }' or localId contain '${ this.inputSearch }'`;
             }
             let promise = new Promise((resolve) => {
                 dictQuery(param).then((res) => {
@@ -407,7 +415,8 @@ $border: 1px solid #e1e7ea;
     justify-content: center;
     flex-direction: column;
     flex-wrap: wrap;
-    .text{
+
+    .text {
         margin-right: 150px;
         margin-bottom: 10px;
     }
@@ -493,6 +502,7 @@ $border: 1px solid #e1e7ea;
     .el-select, .el-date-editor.el-input, .el-date-editor.el-input__inner {
         width: 100%;
     }
+
     .el-dialog__header {
         border-bottom: 1px solid #D8D8D8;
     }

+ 11 - 8
src/views/scene/tiepoint/components/equipTab/index.vue

@@ -1,5 +1,5 @@
 <template>
-    <div class="tab-content">
+    <div class="tab-content" >
         <div class="search">
             <el-cascader
                 :options="deviceOptions"
@@ -9,7 +9,7 @@
                 @change="handleChangeDevice"
                 class="item"
             ></el-cascader>
-            <admSearch @SearchValue="searchValue" class="item" />
+            <admSearch @SearchValue="searchValue" class="item"/>
             <el-upload
                 style="float: right"
                 action="https://jsonplaceholder.typicode.com/posts/"
@@ -38,7 +38,7 @@
                 />
             </template>
             <div v-else class="void align">
-                <svg-icon name="void" :width="String(120)" :height="String(123)" />
+                <svg-icon name="void" :width="String(120)" :height="String(123)"/>
                 <p class="void-title">暂无内容</p>
                 <p class="void-tips">可点击左上角筛选</p>
             </div>
@@ -46,7 +46,7 @@
         <!--编辑 设备-->
         <el-dialog title="编辑设备" :visible.sync="dialogVisible">
             <template>
-                <baseDataForm :objectHeaders="headersStage" :currRowContent="currRowContent" ref="baseDataForm" />
+                <baseDataForm :objectHeaders="headersStage" :currRowContent="currRowContent" ref="baseDataForm"/>
                 <span slot="footer" class="dialog-footer">
                     <el-button @click="dialogVisible = false">取消</el-button>
                     <el-button type="primary" @click="handleDataForm">完成</el-button>
@@ -75,6 +75,7 @@ import tools from "@/utils/maintain";
 export default class EquipTab extends Vue {
     // 信息点输入组组件
     @Ref("baseDataForm") readonly baseDataForm!: baseDataForm;
+
     // 项目id
     private get projectId(): string {
         return UserModule.projectId;
@@ -147,14 +148,14 @@ export default class EquipTab extends Vue {
                 category: this.deviceType,
             };
             let param2 = {
-                filters: `classCode='${this.deviceType}'`,
+                filters: `classCode='${ this.deviceType }'`,
                 pageNumber: this.paginationList.page,
                 pageSize: this.paginationList.size,
                 orders: "createTime desc, id asc",
                 projectId: this.projectId,
             };
             if (this.keyWord != "") {
-                param2.filters += `;codeName contain '${this.keyWord}' or systemCategory contain '${this.keyWord}' or bimTypeId contain '${this.keyWord}' or localId contain '${this.keyWord}'`;
+                param2.filters += `;codeName contain '${ this.keyWord }' or systemCategory contain '${ this.keyWord }' or bimTypeId contain '${ this.keyWord }' or localId contain '${ this.keyWord }'`;
             }
             let promise = new Promise((resolve) => {
                 dictInfo(param).then((res: any) => {
@@ -188,14 +189,14 @@ export default class EquipTab extends Vue {
         if (this.deviceType) {
             this.loading = true;
             let params = {
-                filters: `classCode='${this.deviceType}'`,
+                filters: `classCode='${ this.deviceType }'`,
                 pageNumber: this.paginationList.page,
                 pageSize: this.paginationList.size,
                 orders: "createTime desc, id asc",
                 projectId: this.projectId,
             };
             if (this.keyWord != "") {
-                params.filters += `;codeName contain '${this.keyWord}' or systemCategory contain '${this.keyWord}' or bimTypeId contain '${this.keyWord}' or localId contain '${this.keyWord}'`;
+                params.filters += `;codeName contain '${ this.keyWord }' or systemCategory contain '${ this.keyWord }' or bimTypeId contain '${ this.keyWord }' or localId contain '${ this.keyWord }'`;
             }
             const res = await queryEquip(params);
             if (res.result === "success") {
@@ -340,11 +341,13 @@ export default class EquipTab extends Vue {
 
     .search {
         padding: 12px;
+
         & > .item {
             margin-right: 12px;
         }
     }
 }
+
 // 数据暂未
 .align {
     height: 100%;

+ 1 - 1
src/views/scene/tiepoint/index.vue

@@ -1,5 +1,5 @@
 <template>
-    <div class="adm-tiepoint">
+    <div class="adm-tiepoint"style="display: none">
         <div class="tabs">
             <el-tabs v-model="activeName" type="card" @tab-click="tabChange">
                 <el-tab-pane label="设备" name="equip">