Browse Source

修改二维码

Shannon_mu 3 years ago
parent
commit
8a5e5569ad

+ 4 - 3
operationSupport/src/components/common/Header.vue

@@ -15,13 +15,13 @@
                 <!-- 用户头像 -->
                 <div class="user-avator" @click="editUserInfo">
                     <i class="iconfont" v-show="!cruUserInfo.photo" v-bottom-txt-tip data-txt="编辑用户信息">&#xe6e8;</i>
-                    <img v-show="cruUserInfo.photo" :src="envConfig.baseImgApi + cruUserInfo.photo" />
+                    <img v-show="cruUserInfo.photo" :src="envConfig.baseImgApi + cruUserInfo.photo" style="object-fit:cover" />
                 </div>
                 <!-- <span style="width: 1px; height: 16px; background: #FFFFFF; opacity: 0.5"></span> -->
                 <div class="message">
                     <span class="main" @click="goMessage('unread')">
                         <!-- <i class="iconfont btn">&#xe6ea;</i> -->
-                        <img :src='"@assets/img/btn_news.png"' alt="">
+                        <img src="@assets/img/btn_news.png" alt="">
                         <span class="iconfont point" v-if="messageNumber"></span>
                     </span>
                     <div class="msg-content" v-if="messageList&&messageList.length">
@@ -145,7 +145,7 @@ export default {
             });
         },
         getUserInfo(resolve) {
-            this.$http.postForm('/user/findLoginUserById').then(({ status, data, msg }) => {
+            this.$http.postForm('/sc-user-center/user/findLoginUserById').then(({ status, data, msg }) => {
                 if (status === 0) {
                     this.$store.commit('setcCruUserInfo', data);
                 } else {
@@ -359,6 +359,7 @@ export default {
     display: block;
     width: 20px;
     height: 20px;
+    cursor: pointer;
 }
 .message {
     margin: 10px 20px 0px 0px;

+ 1 - 1
operationSupport/src/components/common/Home.vue

@@ -60,7 +60,7 @@ export default {
         },
         // 获取用户权限
         getElement() {
-            this.$http.post("/menu/selectAuthCode").then(res => {
+            this.$http.post("/sc-user-center/menu/selectAuthCode").then(res => {
                 let data = res.data || [];
                 this.$store.commit("setPermissionList", new Set(data));
                 console.log("获取到的权限标识为",data)

+ 37 - 18
operationSupport/src/main.js

@@ -52,36 +52,48 @@ Vue.use(ElementUI, {
 //     // 高德 sdk 版本,默认为 1.4.4
 //     v: '1.4.4'
 // });
-
+let defaultPath = '';
 Vue.prototype.routerLoad = {
-    findOne(arr){
-        return arr.map(v=>{
-            if(v.children){
+    findOne(arr) {
+        return arr.map(v => {
+            if (v.children) {
                 return this.findOne(v.children)
-            }else{
+            } else {
                 return {
-                    path:"/"+v.linkPath,
-                    name:v.name
+                    path: "/" + v.linkPath,
+                    name: v.name
                 }
             }
         })
     },
+    findMen(arr, indexPath) {
+        let status = false;
+        arr.map(v => {
+            if (v.children) {
+                this.findMen(v.children)
+            } else {
+                if (('/' + v.linkPath) === indexPath) {
+                    status = true
+                }
+            }
+        })
+        return status
+    },
+    close() {
+        let activeRout = localStorage.getItem('path');
+        let tagsList = store.getters['getTagsList'];
+        tagsList.forEach((item, index) => {
+            if (item.path == activeRout) {
+                tagsList.splice(index, 1);
+                return true;
+            }
+        });
+    },
     // 获取菜单
     loadMenus() {
         http.get('/sc-user-center/user/findUserMenu', { appId: '1002' }).then(({ status, data, msg }) => {
             if (0 === status) {
-
-                let routerArr = this.findOne(data[0].children);
                 store.commit('setMenuList', data[0].children)
-                if (routerArr[0].length) {
-                    defaultPath = routerArr[0][0].path;
-                } else {
-                    defaultPath = routerArr[0].path;
-                }
-                if (localStorage.getItem('path') == '/') {
-                    localStorage.setItem('path', defaultPath)
-                }
-                router.push({ path: localStorage.getItem('path') })
             }
         });
     }
@@ -117,6 +129,13 @@ Vue.prototype.routerLoad = {
 //         next();
 //     }
 // });
+router.beforeEach((to, from, next) => {
+    if (to.path != '/404') {
+        // 跳转时存储路由
+        localStorage.setItem('path', to.fullPath)
+    }
+    next();
+});
 new Vue({
     router,
     store,

+ 1 - 1
operationSupport/src/views/403/index.vue

@@ -8,7 +8,7 @@
     <div class="box-40">
         <img src="@/assets/img/403.png" alt="" />
         <div class="title">
-            <h2>404</h2>
+            <h2>403</h2>
             <div class="text-title">抱歉,您无权访问此页面</div>
             <el-button type="primary" @click="goback()">返回</el-button>
         </div>

+ 44 - 6
operationSupport/src/views/deviceManagement/index.vue

@@ -2,12 +2,22 @@
     <div class="main">
         <div class="search">
             <el-input placeholder="设备名称或编号" class="search-input" clearable v-model="mixins_query.deviceNo"></el-input>
-            <el-select slot="status" v-model="mixins_query.deviceStatus" clearable>
+            <el-select slot="status" placeholder="状态" v-model="mixins_query.deviceStatus" clearable>
                 <el-option v-for="(item, index) in deviceStatus" :key="index" :label="item.label" :value="item.status">{{
                     item.label
                 }}</el-option>
             </el-select>
-            <el-button type="primary" class="search-btn" @click="mixins_search" icon="el-icon-search">查询 </el-button>
+            <el-cascader
+                slot="productId"
+                v-model="productIds"
+                :options="productOptions"
+                :props="defaultProps"
+                clearable
+                placeholder="设备类型"
+                @change="productChange($event)"
+            >
+            </el-cascader>
+            <el-button type="primary" placeholder="状态" class="search-btn" @click="mixins_search" icon="el-icon-search">查询 </el-button>
             <div class="search-icon">
                 <i class="iconfont" @click="deluserbyidFn()" v-txt-tip data-txt="删除">&#xe63b;</i>
                 <i class="iconfont" @click="addOrEdit('add')" v-left-txt-tip data-txt="新增">&#xe641;</i>
@@ -23,6 +33,9 @@
                 @page-change="pageChange"
                 @selection-change="selectionChange"
             >
+                <template slot="deviceQrcode">
+                    <i class="zoniot_font zoniot-icon-erweimachakan"></i>
+                </template>
                 <template slot-scope="scope" slot="opt">
                     <div class="opt">
                         <el-tooltip effect="light" placement="bottom" content="编辑">
@@ -35,10 +48,20 @@
                             <i v-if="scope.row.deviceStatus === 5" class="zoniot_font zoniot-icon-baofei ashText"></i>
                             <i v-else class="zoniot_font zoniot-icon-baofei redText" @click="Scrap(scope.row.id)"></i>
                         </el-tooltip>
+                        <el-tooltip effect="light" placement="bottom" content="下载二维码">
+                            <i class="zoniot_font zoniot-icon-erweimachakan" @click="downImg(scope.row.id)"></i>
+                        </el-tooltip>
                     </div>
                 </template>
             </zz-table>
         </div>
+        <el-dialog title="下载二维码" :visible.sync="centerDialogVisible" width="30%" center>
+            <img :src="QRImg" alt="" />
+            <span slot="footer" class="dialog-footer">
+                <el-button @click="centerDialogVisible = false">取 消</el-button>
+                <el-button type="primary" @click="centerDialogVisible = false">确 定</el-button>
+            </span>
+        </el-dialog>
     </div>
 </template>
 
@@ -126,7 +149,8 @@ export default {
                 },
                 {
                     label: '二维码',
-                    prop: 'deviceQrcode'
+                    prop: 'deviceQrcode',
+                    slot: 'deviceQrcode'
                 },
                 {
                     label: '操作',
@@ -135,7 +159,14 @@ export default {
                 }
             ],
             mixins_post: 'post',
-            productOptions: []
+            productOptions: [],
+            defaultProps: {
+                value: 'id', // 唯一标识
+                label: 'label', // 标签显示
+                children: 'children' // 子级
+            },
+            centerDialogVisible: false,
+            QRImg: ''
         };
     },
     created() {
@@ -150,6 +181,9 @@ export default {
         this.getProductOptions();
     },
     methods: {
+        productChange(va) {
+            this.mixins_query.productId = _.last(va);
+        },
         getorgTree() {
             this.$http
                 .get('/sc-community/assets/community/list')
@@ -201,13 +235,17 @@ export default {
                 })
                 .catch(() => {});
         },
+        downImg(id) {
+            this.QRImg = `/sc-community/device/generateQRCodeImage?id=${id}&type=DEVICE`;
+            this.centerDialogVisible = !this.centerDialogVisible;
+        },
         addOrEdit(todo, data = {}) {
             new Promise((resolve) => {
-                let title = '添加设备管理';
+                let title = '添加设备';
                 if (todo == 'add') {
                     // title = this.mixins_query.alarmCategory == '2' ? '添加离线规则' : '添加告警';
                 } else {
-                    title = '修改设备管理';
+                    title = '修改设备';
                 }
                 this.$store.dispatch('addPopup', {
                     url: '/deviceManagement/popups/addDeviceManagement.vue',

+ 6 - 6
operationSupport/src/views/deviceManagement/indexFacilities.vue

@@ -1,13 +1,13 @@
 <template>
     <div class="main">
         <div class="search">
-            <el-input placeholder="设施名称" class="search-input" clearable v-model="mixins_query.facilityNo"></el-input>
-            <el-select v-model="mixins_query.facilityStatus" clearable>
+            <el-input placeholder="设施名称或编号" class="search-input" clearable v-model="mixins_query.facilityNo"></el-input>
+            <el-select v-model="mixins_query.facilityStatus" placeholder="状态" clearable>
                 <el-option v-for="(item, index) in deviceStatus" :key="index" :label="item.label" :value="item.status">{{
                     item.label
                 }}</el-option>
             </el-select>
-            <el-select clearable class="servertype-serch" v-model="mixins_query.typeId" placeholder="请选择设施">
+            <el-select clearable class="servertype-serch" v-model="mixins_query.typeId" placeholder="设施类型">
                 <el-option v-for="item in TypeOptions" :key="item.id" :label="item.name" :value="item.id"></el-option>
             </el-select>
             <el-button type="primary" class="search-btn" @click="mixins_search" icon="el-icon-search">查询 </el-button>
@@ -187,7 +187,7 @@ export default {
         Scrap(id) {
             this.$msgBox(`确认提示`, '设备报废后将无法正常接收数据,请问是否继续?')
                 .then(() => {
-                    this.$http.post('/facility/facilityScrap', { id: id, facilityStatus: 0 }).then(({ status, data, msg }) => {
+                    this.$http.post('/facility/facilityScrap', { id: id, facilityStatus: 5 }).then(({ status, data, msg }) => {
                         if (0 === status) {
                             this.$message({
                                 type: 'success',
@@ -201,11 +201,11 @@ export default {
         },
         addOrEdit(todo, data = {}) {
             new Promise((resolve) => {
-                let title = '添加设备管理';
+                let title = '添加设';
                 if (todo == 'add') {
                     // title = this.mixins_query.alarmCategory == '2' ? '添加离线规则' : '添加告警';
                 } else {
-                    title = '修改设备管理';
+                    title = '修改设';
                 }
                 this.$store.dispatch('addPopup', {
                     url: '/deviceManagement/popups/addFacilities.vue',

+ 58 - 55
operationSupport/src/views/messages/index.vue

@@ -33,7 +33,8 @@
                     <span v-if="messageStatus == 0">({{ item.cn }})</span>
                 </div>
             </div>
-            <zz-table ref="table"
+            <zz-table
+                ref="table"
                 :cols="cols"
                 :settings="{ showCheckbox: true, stripe: true }"
                 :data="mixins_list"
@@ -43,7 +44,11 @@
                 @selection-change="selectionChange"
             >
                 <template slot-scope="scope" slot="messageContent">
-                    <p @click="toUrl(scope.row.id,scope.row.typeId,scope.row.sceneType,scope.row.url)" :class="{ active: scope.row.url!==null}" style="cursor: pointer;">
+                    <p
+                        @click="toUrl(scope.row.id, scope.row.typeId, scope.row.sceneType, scope.row.url)"
+                        :class="{ active: scope.row.url !== null }"
+                        style="cursor: pointer"
+                    >
                         <span v-if="!scope.row.messageStatus" class="point"></span>
                         <span v-else class="unpoint"></span>
                         {{ scope.row.messageContent }}
@@ -92,21 +97,16 @@ export default {
             typeId: -1,
             typeList: [],
             selectRow: [],
-            sceneTypes:{"1":"1014",
-            "2":"1014",
-            "3":"1016",
-            "4":"1015",
-            "5":"1014"
-            },
+            sceneTypes: { 1: '1014', 2: '1014', 3: '1016', 4: '1015', 5: '1014' },
             cols: [
                 {
                     label: '消息内容',
                     prop: 'messageContent',
-                    slot: 'messageContent',
+                    slot: 'messageContent'
                 },
                 {
                     label: '消息类型',
-                    prop: 'typeName',
+                    prop: 'typeName'
                 },
                 {
                     label: '创建时间',
@@ -115,17 +115,17 @@ export default {
             ]
         };
     },
-   computed:{
-       ...mapState(['messageStatus'])
-   },
-   watch:{
-       messageStatus(){
-           this.search();
-       }
-   },
+    computed: {
+        ...mapState(['messageStatus'])
+    },
+    watch: {
+        messageStatus() {
+            this.search();
+        }
+    },
     methods: {
         setType(id) {
-            this.$store.commit('setmessageStatus',id);
+            this.$store.commit('setmessageStatus', id);
             this.selectRow = [];
             this.search();
         },
@@ -156,38 +156,42 @@ export default {
             this.getUnreadNumber();
             this.mixins_search();
         },
-        toUrl(id,type,sceneType,urllink) {
+        toUrl(id, type, sceneType, urllink) {
             this.$http.post('/sc-message/message/updateMultiple', { ids: [id], messageStatus: 1 }).then(({ status, data, msg }) => {});
-            let url,appId;
-            if(type==1||type==2){
-                url=urllink||this.envConfig.warnDetailUrl;
-                appId=this.sceneTypes[sceneType]||'1002'
-            }else if(type==4){
-                url=this.envConfig.taskManagementUrl;
-                appId="1003";
-            }else if(type==3||type==7){
-                url=this.envConfig.eventHiddenDangerUrl;
-                appId="1003";
+            let url, appId;
+            if (type == 1 || type == 2) {
+                url = urllink || this.envConfig.warnDetailUrl;
+                appId = this.sceneTypes[sceneType] || '1002';
+            } else if (type == 4) {
+                url = this.envConfig.taskManagementUrl;
+                appId = '1003';
+            } else if (type == 3 || type == 7) {
+                url = this.envConfig.eventHiddenDangerUrl;
+                appId = '1003';
             }
             //查询linkpath能不能跳转
-            this.$http.postForm('/sc-message/message/judgingTheMessageJumpPermission',{
-                url:url.split('/')[url.split('/').length - 1],
-                appId:appId
-            }).then(({ status, data, msg })=>{
-                if(status==0&&data==0){
+            this.$http
+                .postForm('/sc-message/message/judgingTheMessageJumpPermission', {
+                    url: url.split('/')[url.split('/').length - 1],
+                    appId: appId
+                })
+                .then(({ status, data, msg }) => {
+                    url = url + '&access_token=' + localStorage.getItem('SC_token');
                     window.open(url);
-                }else{
-                    this.$message.error("您没有该系统权限")
-                }
-            })
+                    // if(status==0&&data==0){
+                    //     window.open(url);
+                    // }else{
+                    //     this.$message.error("您没有该系统权限")
+                    // }
+                });
         },
         selectionChange(val) {
-            let arr=[];
+            let arr = [];
             if (val.length) {
                 val.map((item, index) => {
                     arr.push(item.id);
                 });
-                this.selectRow=arr;
+                this.selectRow = arr;
                 return;
             }
             this.selectRow = [];
@@ -245,7 +249,6 @@ export default {
                             this.$message.success('标记全部消息成功');
                         }
                     });
-
                 })
                 .catch((err) => {});
         },
@@ -258,9 +261,9 @@ export default {
                         sum = sum + item.cn;
                     });
                     this.unreadNum = sum;
-                    if(sum==0){
+                    if (sum == 0) {
                         this.$store.commit('setmessageNumber', false);
-                    }else{
+                    } else {
                         this.$store.commit('setmessageNumber', true);
                     }
                     data.unshift({ type: '全部类型', cn: sum, typeId: -1 });
@@ -269,13 +272,13 @@ export default {
             });
         },
         //获取最新消息列表
-        getMessageList(){
-            this.$http.postForm('/sc-message/message/queryLastMessage',{num:'5'}).then(({ status, data, msg }) => {
+        getMessageList() {
+            this.$http.postForm('/sc-message/message/queryLastMessage', { num: '5' }).then(({ status, data, msg }) => {
                 if (status === 0) {
                     this.$store.commit('setmessageList', data);
                 }
             });
-        },
+        }
     },
     created() {
         this.mixins_dataUrl = '/sc-message/message/selectPage';
@@ -294,7 +297,7 @@ export default {
         // float: left;
         width: 200px;
         height: 730px;
-        border-right: 1px solid #F6F6F6;
+        border-right: 1px solid #f6f6f6;
         box-sizing: border-box;
         background: #ffffff;
         .title {
@@ -338,10 +341,10 @@ export default {
         }
         .disabled {
             height: 30px;
-            background: #F8FCFF;
-            border: 1px solid #D8D8D8;
+            background: #f8fcff;
+            border: 1px solid #d8d8d8;
             border-radius: 4px;
-            color: #D8D8D8;
+            color: #d8d8d8;
         }
     }
 }
@@ -352,13 +355,13 @@ export default {
 .point {
     width: 4px;
     height: 4px;
-    background: #FE7271;
+    background: #fe7271;
     border-radius: 50%;
     display: inline-block;
     margin-right: 5px;
     vertical-align: middle;
 }
-.unpoint{
+.unpoint {
     width: 4px;
     height: 4px;
     border-radius: 50%;
@@ -368,7 +371,7 @@ export default {
 }
 /deep/ .el-table {
     border: none;
-    border-top: 1px solid #F6F6F6;
+    border-top: 1px solid #f6f6f6;
     height: 670px;
     overflow: auto;
 }
@@ -385,7 +388,7 @@ export default {
         }
     }
 }
-/deep/ .el-table__header .el-table_1_column_2 .cell span{
+/deep/ .el-table__header .el-table_1_column_2 .cell span {
     margin-left: 10px;
 }
 </style>

+ 13 - 0
operationSupport/src/views/ownerManagement/index.vue

@@ -292,6 +292,19 @@ export default {
             this.selectRow.forEach((v) => {
                 ids.push(v.id);
             });
+             this.$msgBox(`删除`, '删除后将无法恢复,请问是否继续?')
+                .then(() => {
+                    this.$http.post('/scResident/batchDelete', ids).then(({ status, data, msg }) => {
+                        if (0 === status) {
+                            this.$message({
+                                type: 'success',
+                                message: '删除成功!'
+                            });
+                            this.mixins_search();
+                        }
+                    });
+                })
+                .catch(() => {});
         },
         addCommand(command) {
             if (command === 'add') {

+ 3 - 6
operationSupport/src/views/ownerManagement/ownerReview/index.vue

@@ -28,12 +28,9 @@
         >
             <template slot-scope="scope" slot="opt">
                 <div class="opt">
-                    <el-tooltip effect="light" placement="bottom" content="审核">
-                        <i
-                            class="zoniot_font zoniot-icon-yanshou1"
-                            :class="scope.row.auditStatus == 0 ? '' : 'ashText'"
-                            @click="Review(scope.row)"
-                        ></i>
+                    <el-tooltip effect="light" placement="bottom" :content="scope.row.auditStatus == 0?'已经审核':'审核'">
+                        <i v-if="scope.row.auditStatus == 0" class="zoniot_font zoniot-icon-yanshou1" @click="Review(scope.row)"></i>
+                        <i class="zoniot_font zoniot-icon-yanshou1 ashText" v-else></i>
                     </el-tooltip>
                 </div>
             </template>

+ 3 - 2
userCenter/src/main.js

@@ -92,8 +92,9 @@ Vue.prototype.routerLoad = {
                 if (this.findMen(data[0].children, localStorage.getItem('path'))) {
                     router.push({ path: localStorage.getItem('path') })
                 } else {
-                    this.close();
-                    router.replace({ path: '403' })
+                    // this.close();
+                    router.push({ path: defaultPath})
+                    // router.replace({ path: '403' })
                 }
 
             }