Shannon_mu 3 лет назад
Родитель
Сommit
7838252db7

BIN
operationSupport/src/assets/img/btn_baofei_d.png


BIN
operationSupport/src/assets/img/btn_daochu.png


BIN
operationSupport/src/assets/img/ownerManagement/img_zhaopian2@2x.png


+ 2 - 1
operationSupport/src/components/common/XKUpload.vue

@@ -11,6 +11,7 @@
 </template>
 
 <script>
+import envConfig from '@/config';
 const fileMatch = {
   excel: {
     label: "Excel表格",
@@ -54,7 +55,7 @@ export default {
   methods: {
     beforeUpload(file) {
       let currentSize =
-        this.limitSize || this.__CONFIG.upload[`${this.fileType}Size`] || 5;
+        this.limitSize || envConfig.upload[`${this.fileType}Size`] || 5;
       let currentType = fileMatch[this.fileType];
       const isMatchType = currentType.reg.test(file.name);
       const isMatchSize = file.size / 1024 / 1024 < currentSize;

+ 1 - 1
operationSupport/src/config/env.sit.js

@@ -14,7 +14,7 @@ module.exports = {
     baseImgApi: "http://114.135.61.186:21020", // 图片api请求地址
     baseExcelApi: "http://114.135.61.186:21020", // excel请求地址
     baseMapApi:"http://114.135.61.187:38082",
-    loginUrl: "http://114.135.61.186:21020/login/login", // 项目地址
+    loginUrl: "http://114.135.61.188:18093/sc-login/", // 项目地址
     websoketUrl:'114.135.61.186:21020',
     warnDetailUrl:"http://114.135.61.186:21020/dispatch/warnDetail",// 综合调度系统-系统管理-报警管理-报警详情界面
     twosupplywarnDetailUrl:"http://114.135.61.186:21020/secondwatersupply/warnDetail",// 二供系统-报警管理-报警详情界面

+ 3 - 20
operationSupport/src/main.js

@@ -9,6 +9,7 @@
 import Vue from 'vue';
 import App from './App.vue';
 import router from './router';
+import { funcRouter } from "./router/dynamicMuen";
 import Vuex from 'vuex';
 import ElementUI from 'element-ui';
 import commonComponents from './components/common';
@@ -32,8 +33,6 @@ import "./assets/ucd.styl";
 
 // import VueAMap from 'vue-amap';
 
-import { funcRouter } from "./router/dynamicMuen";
-
 Vue.prototype.$moment = moment;
 Vue.config.productionTip = false;
 Vue.use(Vuex);
@@ -54,22 +53,9 @@ Vue.use(ElementUI, {
 //     v: '1.4.4'
 // });
 
-Vue.prototype.$http = http;
-Vue.prototype.$api = apiService(http);
-
-let defaultPath = '';
-Vue.prototype.routerLoad = {
-};
 //使用钩子函数对路由进行权限跳转
 router.beforeEach((to, from, next) => {
-    // if (to.path != '/404') {
-    //     // 跳转时存储路由
-    //     localStorage.setItem('path', to.fullPath)
-    // }
-    // next();
-
     if (localStorage.getItem("SC_token")) {
-
         let menuList = window.sessionStorage.getItem("operationMuen")
         let newAr = [];
         if (menuList === null || menuList === undefined) {
@@ -100,9 +86,6 @@ new Vue({
     router,
     store,
     render: h => h(App),
-    created() {
-        // if (localStorage.getItem('SC_token')) {
-        //     this.routerLoad.loadMenus();
-        // }
-    }
 }).$mount('#app');
+Vue.prototype.$http = http;
+Vue.prototype.$api = apiService(http);

+ 16 - 7
operationSupport/src/router/dynamicMuen.js

@@ -1,8 +1,14 @@
 import store from "../store/store.js";
 const staticMuen = [
+  {
+    path: "/workbench/index",
+    meta: { title: '工作台' },
+    component: () =>
+      import("@views/workbench/index.vue"
+      )
+  },
   {
     path: '/msg',
-    name: 'msg',
     component: () => import(/* webpackChunkName: "messages" */ '@views/messages'),
     meta: { title: '消息中心' }
   },
@@ -80,7 +86,7 @@ const staticMuen = [
     component: () => import(/* webpackChunkName: "404" */ '@views/ownerManagement/details.vue'),
     meta: { title: '住户详情' }
   }
-  
+
 ]
 //路由格式
 // 自定义路由文件
@@ -93,11 +99,15 @@ const setListMunt = (arrList, item) => {
 }
 const dimension = (arrList, arr) => {
   arr.forEach((item, index) => {
-    if (!!item.children) {
-      dimension(arrList, item.children)
-    } else {
-      setListMunt(arrList, item)
+    //默认去掉第一个添加路由
+    if (item.linkPath !== 'workbench/index') {
+      if (!!item.children) {
+        dimension(arrList, item.children)
+      } else {
+        setListMunt(arrList, item)
+      }
     }
+
   })
 }
 //添加路由
@@ -107,7 +117,6 @@ const AddRt = (router, dynamicMuenList) => {
     NEWdynamicMuenList.forEach(item => {
       router.options.routes[0].children.push(item)
     })
-
     router.options.routes[0].redirect = router.options.routes[0].children[0].path
     router.addRoutes(router.options.routes)
   }

+ 23 - 32
operationSupport/src/router/index.js

@@ -1,41 +1,32 @@
 import Vue from 'vue';
 import Router from 'vue-router';
 
-Vue.use(Router);
-const originalPush = VueRouter.prototype.push
-VueRouter.prototype.push = function push(location) {
-    return originalPush.call(this, location).catch(err => err)
+const original = Router.prototype.push
+Router.prototype.push = function push(location) {
+    return original.call(this, location).catch(err => err)
 }
-export default new Router({
+Vue.use(Router);
+
+const quietRoute = [
+    {
+        path: '/',
+        component: () => import(/* webpackChunkName: "home" */ '@/components/common/Home.vue'),
+        children: [
+
+        ],
+        // redirect: '/workbench/index'
+    },
+    {
+        path: '*',
+        redirect: '/404'
+    }
+]
+
+const route = new Router({
     mode: 'history',
     base: process.env.BASE_URL,
     routes: [
-        {
-            path: '/',
-            component: () => import(/* webpackChunkName: "home" */ '../components/common/Home.vue'),
-            children: [
-                // {
-                //     path: '/msg',
-                //     name: 'msg',
-                //     component: () => import(/* webpackChunkName: "messages" */ '@views/messages'),
-                //     meta: { title: '消息中心' }
-                // },
-                // {
-                //     path: '/403',
-                //     component: () => import(/* webpackChunkName: "404" */ '@views/403'),
-                //     meta: { title: '403' }
-                // },
-                // {
-                //     path: '/404',
-                //     component: () => import(/* webpackChunkName: "404" */ '@views/404'),
-                //     meta: { title: '404' }
-                // },
-            ],
-            // redirect: '/workbench/index'
-        },
-        {
-            path: '*',
-            redirect: '/404'
-        }
+        ...quietRoute
     ]
 });
+export default route

+ 20 - 1
operationSupport/src/views/deviceManagement/index.vue

@@ -31,6 +31,10 @@
                         <el-tooltip class="item" effect="light" placement="bottom" content="删除">
                             <img class="optImg" @click="deluserbyidFn(scope.row.id)" src="@/assets/img/btn_shanchu.png" />
                         </el-tooltip>
+                        <el-tooltip class="item" effect="light" placement="bottom" content="报废">
+                            <img v-if="scope.row.deviceStatus === 5" src="@/assets/img/btn_baofei_d.png" alt="">
+                            <img v-else class="optImg" @click="Scrap(scope.row.id)" src="@/assets/img/btn_baofei.png" />
+                        </el-tooltip>
                     </div>
                 </template>
             </zz-table>
@@ -170,7 +174,7 @@ export default {
             }
             this.$msgBox(`删除`, '删除后将无法恢复,请问是否继续?')
                 .then(() => {
-                    this.$http.post('/facility/delete', ids).then(({ status, data, msg }) => {
+                    this.$http.post('/device/delete', ids).then(({ status, data, msg }) => {
                         if (0 === status) {
                             this.$message({
                                 type: 'success',
@@ -182,6 +186,21 @@ export default {
                 })
                 .catch(() => {});
         },
+        Scrap(id) {
+            this.$msgBox(`确认提示`, '设备报废后将无法正常接收数据,请问是否继续?')
+                .then(() => {
+                    this.$http.post('/device/deviceScrapInterface', { id: id, deviceStatus: 5 }).then(({ status, data, msg }) => {
+                        if (0 === status) {
+                            this.$message({
+                                type: 'success',
+                                message: '报废成功!'
+                            });
+                            this.mixins_search();
+                        }
+                    });
+                })
+                .catch(() => {});
+        },
         addOrEdit(todo, data = {}) {
             new Promise((resolve) => {
                 let title = '添加设备管理';

+ 19 - 0
operationSupport/src/views/deviceManagement/indexFacilities.vue

@@ -38,6 +38,10 @@
                         <el-tooltip class="item" effect="light" placement="bottom" content="删除">
                             <img class="optImg" @click="deluserbyidFn(scope.row.id)" src="@/assets/img/btn_shanchu.png" />
                         </el-tooltip>
+                        <el-tooltip class="item" effect="light" placement="bottom" content="报废">
+                            <img v-if="scope.row.facilityStatus === 0" src="@/assets/img/btn_baofei_d.png" alt="" />
+                            <img v-else class="optImg" @click="Scrap(scope.row.id)" src="@/assets/img/btn_baofei.png" />
+                        </el-tooltip>
                     </div>
                 </template>
             </zz-table>
@@ -179,6 +183,21 @@ export default {
                 })
                 .catch(() => {});
         },
+        Scrap(id) {
+            this.$msgBox(`确认提示`, '设备报废后将无法正常接收数据,请问是否继续?')
+                .then(() => {
+                    this.$http.post('/facility/facilityScrap', { id: id, facilityStatus: 0 }).then(({ status, data, msg }) => {
+                        if (0 === status) {
+                            this.$message({
+                                type: 'success',
+                                message: '报废成功!'
+                            });
+                            this.mixins_search();
+                        }
+                    });
+                })
+                .catch(() => {});
+        },
         addOrEdit(todo, data = {}) {
             new Promise((resolve) => {
                 let title = '添加设备管理';

+ 25 - 0
operationSupport/src/views/ownerManagement/details.vue

@@ -19,6 +19,16 @@
                     <household-table :tableName="householdTable.left" :tabData="detailsData"></household-table>
                     <household-table :tableName="householdTable.right" :tabData="detailsData"></household-table>
                 </div>
+                <div class="formContent-item_title">人脸信息</div>
+                <div class="detailImg">
+                    <div class="clickUpText">
+                        <img class="dataImg" v-if="!!detailsData.facePictureUrl" :src="detailsData.facePictureUrl" />
+                        <template v-else>
+                            <img class="bg-img" src="@/assets/img/ownerManagement/img_zhaopian2@2x.png" alt="" />
+                            <div>无人脸图片</div>
+                        </template>
+                    </div>
+                </div>
             </div>
             <div class="content-item" v-show="tabsIndex === 1">
                 <div class="widthFlex" v-for="item in 2" :key="item">
@@ -257,4 +267,19 @@ export default {
 </script>
 <style lang='scss' scoped >
 @import './style.scss';
+.detailImg {
+    width: 200px;
+    height: 280px;
+    background: #f8fcff;
+    border-radius: 4px;
+    border: 1px solid #e0e1e3;
+    color: #424656;
+    text-align: center;
+    .clickUpText {
+        position: inherit;
+        img.bg-img {
+            width: 100px;
+        }
+    }
+}
 </style>

+ 10 - 1
operationSupport/src/views/ownerManagement/ownerReview/index.vue

@@ -76,7 +76,16 @@ export default {
                 },
                 {
                     label: '状态',
-                    prop: 'auditStatus'
+                    prop: 'auditStatus',
+                    format(val) {
+                        let va = '';
+                        if (val === 0) {
+                            va = '未审核';
+                        } else if (val === 1) {
+                            va = '已审核';
+                        }
+                        return va;
+                    }
                 },
                 {
                     label: '入住时间',

+ 29 - 28
operationSupport/src/views/ownerManagement/stepPage/add.vue

@@ -27,36 +27,28 @@
                             </template>
                         </template>
                     </zz-form>
-                    <!-- 查看审核 -->
-                    <template v-if="islooks">
-                        <div class="lookImg">
-                            <img :src="formData.facePictureUrl" alt="" />
-                        </div>
-                    </template>
-                    <!-- 添加编辑 -->
-                    <template v-else>
-                        <div @click="clickUpload">
-                            11111
+
+                    <template>
+                        <div class="clickUpload">
+                            <div class="clickUpText">
+                                <img class="dataImg" v-if="!!formData.facePictureUrl" :src="formData.facePictureUrl" />
+                                <template v-else>
+                                    <img class="bg-img" src="@/assets/img/ownerManagement/img_zhaopian2@2x.png" alt="" />
+                                    <div>{{ !islooks ? '点击添加人脸照片' : '无人脸图片' }}</div>
+                                </template>
+                            </div>
                             <el-upload
+                                v-if="!islooks"
                                 :headers="token"
                                 ref="uploaduserlogo"
                                 class="mini-upload"
                                 limit="1"
                                 action="/sc-community/upload/uploadFile"
-                                list-type="picture-card"
                                 :on-success="uploadsuccess"
+                                :before-upload="beforeAvatarUpload"
                                 :auto-upload="true"
-                                name="avatarfile"
+                                name="file"
                             >
-                                <i slot="default" class="el-icon-plus"></i>
-                                <div slot="file" slot-scope="{ file }">
-                                    <img class="el-upload-list__item-thumbnail" :src="file.url" alt="" />
-                                    <span class="el-upload-list__item-actions">
-                                        <span v-if="!disabled" class="el-upload-list__item-delete" @click="handleRemove(file)">
-                                            <i class="el-icon-delete"></i>
-                                        </span>
-                                    </span>
-                                </div>
                             </el-upload>
                         </div>
                     </template>
@@ -145,7 +137,7 @@
                 <div class="formContent-item_title">绑定房产</div>
                 <div class="formContent-formList" v-for="(item, index) in formData.houseList" :key="index">
                     <div class="block-title">
-                        <div class="floor list-title" v-if="islooks">{{ `${item.buildingName} ${item.unitName}${item.roomNumber}` }}</div>
+                        <div class="floor list-title" v-if="!isAdd">{{ `${item.buildingName} ${item.unitName}${item.roomNumber}` }}</div>
                         <div class="floor list-title" v-else>{{ item.name }}</div>
                         <span class="remove list-title" v-if="!islooks" @click="removeHouse(index, 'houseList')">移除</span>
                         <img class="bg-img" src="@/assets/img/ownerManagement/bg_card@2x.png" alt="" />
@@ -216,6 +208,7 @@
     </div>
 </template>
 <script>
+import envConfig from '@/config';
 export default {
     props: {
         params: {
@@ -257,6 +250,7 @@ export default {
     },
     data() {
         return {
+            envConfig: envConfig,
             token: {
                 [localStorage.getItem('SC_token') && 'Authorization']: 'Bearer ' + localStorage.getItem('SC_token')
             },
@@ -480,17 +474,24 @@ export default {
                 }
             });
         },
-        clickUpload() {
-            this.$refs.uploaduserlogo.submit();
-        },
-        handleRemove(file) {
-            this.$refs.uploaduserlogo.clearFiles();
-        },
         uploadsuccess(response, file, fileList) {
+            this.$refs.uploaduserlogo.clearFiles();
             if (0 === response.status) {
                 this.formData.facePictureUrl = response.data;
             }
         },
+        beforeAvatarUpload(file) {
+            const isJPG = file.type === 'image/jpeg';
+            const isLt2M = file.size / 1024 / 1024 < 2;
+
+            if (!isJPG) {
+                this.$message.error('上传头像图片只能是 JPG 格式!');
+            }
+            if (!isLt2M) {
+                this.$message.error('上传头像图片大小不能超过 2MB!');
+            }
+            return isJPG && isLt2M;
+        },
         effectiveDateToggle(va) {
             this.formData.effectiveDateStart = va[0];
             this.formData.effectiveDateEnd = va[1];

+ 37 - 0
operationSupport/src/views/ownerManagement/style.scss

@@ -182,3 +182,40 @@
     }
   }
 }
+
+.clickUpload {
+  width: 130px;
+  height: 182px;
+  background: #f8fcff;
+  border-radius: 4px;
+  border: 1px solid #e0e1e3;
+  position: relative;
+  z-index: 1000;
+  text-align: center;
+  overflow: hidden;
+  font-size: 12px;
+  cursor: pointer;
+  color: #e0e1e3;
+  .mini-upload {
+    position: absolute;
+    z-index: 0;
+  }
+}
+.clickUpText {
+  height: 100%;
+  width: 100%;
+  pointer-events: none;
+  position: absolute;
+  background: #f8fcff;
+  z-index: 1;
+  img.bg-img {
+    width: 52px;
+    margin-top: 46px;
+    margin-bottom: 12px;
+  }
+  img.dataImg {
+    width: 100%;
+    height: 100%;
+    object-fit: cover;
+  }
+}