Hwt há 3 anos atrás
pai
commit
7d76d9fb46

+ 326 - 265
smart/src/components/common/Header.vue

@@ -1,289 +1,350 @@
 <template>
-    <div class="header" :class="[collapse ? 'collapse' : 'expand']">
-        <v-tags></v-tags>
-        <div class="header-right">
-            <div class="header-user-con">
-                <div class="formulation" @click="formulationToPage" v-if="permissionFiltering">
-                    <img src="@assets/img/formulation/icon_diygzt@2x.png" alt="" />
-                    工作台自拟定 <span class="border"></span>
-                </div>
-                <div>欢迎你,{{ cruUserInfo.username }}</div>
-                <!-- 用户头像 -->
-                <div class="user-avator" @click="editUserInfo">
-                    <el-tooltip v-show="!cruUserInfo.photo" placement="bottom" content="编辑用户信息">
-                        <img src="@assets/img/formulation/icon_avatar@2x.png" alt="" />
-                    </el-tooltip>
-                    <img v-show="cruUserInfo.photo" :src="envConfig.baseImgApi + cruUserInfo.photo" style="object-fit: cover" />
-                </div>
-                <div class="message">
-                    <span class="main" @click="goMessage('unread')">
-                        <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">
-                        <p>消息通知</p>
-                        <ul>
-                            <li v-for="(items, index) in messageList" :key="index" @click="toUrl(items.typeId)" style="cursor: pointer">
-                                <img :src="imgList[items.typeId]" style="width: 30px; height: 30px" />
-                                <div>
-                                    <span class="cont">【{{ items.shortName }}】{{ items.messageContent }}</span>
-                                    <span class="time">{{ items.dateCreate }}</span>
-                                </div>
-                            </li>
-                        </ul>
-                        <el-button type="text" class="more" @click="goMessage('more')">查看更多</el-button>
-                    </div>
-                    <div class="msg-content" v-else>
-                        <p>消息通知</p>
-                        <ul>
-                            <li style="text-align: center; display: block; padding: 0 rem(20); line-height: rem(60)">暂无消息</li>
-                        </ul>
-                        <el-button type="text" class="more" disabled>查看更多</el-button>
-                    </div>
-                </div>
-                <span class="border"></span>
-                <div class="logout" @click="logOut">
-                    <el-tooltip placement="bottom" content="退出">
-                        <i class="zoniot_font zoniot-icon-tuichu"></i>
-                    </el-tooltip>
+  <div
+    class="header"
+    :class="[collapse ? 'collapse' : 'expand']"
+  >
+    <v-tags></v-tags>
+    <div class="header-right">
+      <div class="header-user-con">
+        <div
+          class="formulation"
+          @click="formulationToPage"
+          v-if="permissionFiltering"
+        >
+          <img
+            src="@assets/img/formulation/icon_diygzt@2x.png"
+            alt=""
+          />
+          工作台自拟定 <span class="border"></span>
+        </div>
+        <div>欢迎你,{{ cruUserInfo.username }}</div>
+        <!-- 用户头像 -->
+        <div
+          class="user-avator"
+          @click="editUserInfo"
+        >
+          <el-tooltip
+            v-show="!cruUserInfo.photo"
+            placement="bottom"
+            content="编辑用户信息"
+          >
+            <img
+              src="@assets/img/formulation/icon_avatar@2x.png"
+              alt=""
+            />
+          </el-tooltip>
+          <img
+            v-show="cruUserInfo.photo"
+            :src="envConfig.baseImgApi + cruUserInfo.photo"
+            style="object-fit: cover"
+          />
+        </div>
+        <div class="message">
+          <span
+            class="main"
+            @click="goMessage('unread')"
+          >
+            <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"
+          >
+            <p>消息通知</p>
+            <ul>
+              <li
+                v-for="(items, index) in messageList"
+                :key="index"
+                @click="toUrl(items.typeId)"
+                style="cursor: pointer"
+              >
+                <img
+                  :src="imgList[items.typeId]"
+                  style="width: 30px; height: 30px"
+                />
+                <div>
+                  <span class="cont">【{{ items.shortName }}】{{ items.messageContent }}</span>
+                  <span class="time">{{ items.dateCreate }}</span>
                 </div>
-            </div>
+              </li>
+            </ul>
+            <el-button
+              type="text"
+              class="more"
+              @click="goMessage('more')"
+            >查看更多</el-button>
+          </div>
+          <div
+            class="msg-content"
+            v-else
+          >
+            <p>消息通知</p>
+            <ul>
+              <li style="text-align: center; display: block; padding: 0 rem(20); line-height: rem(60)">暂无消息</li>
+            </ul>
+            <el-button
+              type="text"
+              class="more"
+              disabled
+            >查看更多</el-button>
+          </div>
+        </div>
+        <span class="border"></span>
+        <div
+          class="logout"
+          @click="logOut"
+        >
+          <el-tooltip
+            placement="bottom"
+            content="退出"
+          >
+            <i class="zoniot_font zoniot-icon-tuichu"></i>
+          </el-tooltip>
         </div>
+      </div>
     </div>
+  </div>
 </template>
 <script>
 import { mapState, mapGetters, mapMutations, mapActions } from 'vuex';
 import envConfig from '@/config';
 import vTags from './Tags.vue';
 export default {
-    data() {
-        return {
-            name: '',
-            envConfig: envConfig,
-            imgList: {
-                1: require('@/assets/img/icon_msg1.png'),
-                2: require('@/assets/img/icon_msg7.png'),
-                10: require('@/assets/img/icon_msg9.png'),
-                11: require('@/assets/img/icon_msg9.png'),
-                13: require('@/assets/img/icon_msg9.png')
-            }
-        };
+  data () {
+    return {
+      name: '',
+      envConfig: envConfig,
+      imgList: {
+        1: require('@/assets/img/icon_msg1.png'),
+        2: require('@/assets/img/icon_msg7.png'),
+        10: require('@/assets/img/icon_msg9.png'),
+        11: require('@/assets/img/icon_msg9.png'),
+        13: require('@/assets/img/icon_msg9.png')
+      }
+    };
+  },
+  components: {
+    vTags
+  },
+  computed: {
+    cruUserInfo () {
+      return this.$store.getters['getCruUserInfo'];
     },
-    components: {
-        vTags
+    collapse () {
+      return this.$store.getters['getCollapse'];
     },
-    computed: {
-        cruUserInfo() {
-            return this.$store.getters['getCruUserInfo'];
-        },
-        collapse() {
-            return this.$store.getters['getCollapse'];
-        },
-        permissionFiltering() {
-            let arr = this.$store.getters['getMenuList'] || [];
-            if (arr.length !== 0) {
-                return this.filterFuntion(false, arr);
-            } else {
-                return false;
-            }
-        },
-        ...mapState(['messageNumber']),
-        ...mapState(['messageList'])
+    permissionFiltering () {
+      let arr = this.$store.getters['getMenuList'] || [];
+      if (arr.length !== 0) {
+        return this.filterFuntion(false, arr);
+      } else {
+        return false;
+      }
     },
-    methods: {
-        filterFuntion(status, arr) {
-            arr.some((item, index) => {
-                if (item.children == null && item.name == '工作台' && item.linkPath == 'newWorkBench/index') {
-                    status = true;
-                    return false;
-                }
-            });
-            return status;
-        },
-        toUrl(type) {
-            this.$router.push({
-                path: '/msg'
-            });
-        },
-        formulationToPage() {
-            this.$router.push({
-                path: '/editWorkbench'
-            });
-        },
-        // 退出登录
-        logOut() {
-            var access_token = localStorage.getItem('SC_token');
-            this.$http.postForm('/user-auth/user/logout', { access_token: access_token }).then(({ status, data, msg }) => {
-                if (0 === status) {
-                    this.$message({
-                        type: 'success',
-                        message: '您已退出登录'
-                    });
-                    localStorage.removeItem('SC_token');
-                    sessionStorage.removeItem('SC_listMuen');
-                    this.$store.commit('setloginInfo', '');
-                    this.$store.dispatch('tags', []);
+    ...mapState(['messageNumber']),
+    ...mapState(['messageList'])
+  },
+  methods: {
+    filterFuntion (status, arr) {
+      arr.some((item, index) => {
+        if (item.children == null && item.name == '工作台' && item.linkPath == 'newWorkBench/index') {
+          status = true;
+          return false;
+        }
+      });
+      return status;
+    },
+    toUrl (type) {
+      this.$router.push({
+        path: '/msg'
+      });
+    },
+    formulationToPage () {
+      this.$router.push({
+        path: '/editWorkbench'
+      });
+    },
+    // 退出登录
+    logOut () {
+      var access_token = localStorage.getItem('SC_token');
+      this.$http.postForm('/user-auth/user/logout', { access_token: access_token }).then(({ status, data, msg }) => {
+        if (0 === status) {
+          this.$message({
+            type: 'success',
+            message: '您已退出登录'
+          });
+          localStorage.removeItem('SC_token');
+          sessionStorage.removeItem('SC_listMuen');
+          this.$store.commit('setloginInfo', '');
+          this.$store.dispatch('tags', []);
 
-                    sessionStorage.removeItem('tabs');
-                    location.href = this.envConfig.loginUrl;
-                } else {
-                    this.$message.error(msg);
-                }
-            });
-        },
-        getUserInfo(resolve) {
-            this.$http.postForm('/sc-user-center/user/findLoginUserById').then(({ status, data, msg }) => {
-                if (status === 0) {
-                    this.$store.commit('setcCruUserInfo', data);
-                } else {
-                    this.$message.error('获取用户信息失败');
-                }
-                resolve && resolve(true);
-            });
-        },
-        editUserInfo() {
-            new Promise((resolve) => {
-                this.$store.dispatch('addPopup', {
-                    url: '/system/users/popups/edituser.vue',
-                    width: '500px',
-                    height: '500px',
-                    props: {
-                        data: JSON.parse(JSON.stringify(this.cruUserInfo)),
-                        callback: resolve
-                    },
-                    title: '编辑用户信息'
-                });
-            }).then(() => {
-                this.getUserInfo();
-            });
-        },
-        goMessage(msg) {
-            let messageStatus = 2; //全部
-            if (msg == 'unread') {
-                messageStatus = 0; //未读
-            }
-            this.$store.commit('setmessageStatus', messageStatus);
-            this.$router.push({
-                path: '/msg'
-            });
-        },
-        //获取最新消息列表
-        getMessageList() {
-            this.$http.postForm('/sc-message/message/queryLastMessage', { num: '5' }).then(({ status, data, msg }) => {
-                if (status === 0) {
-                    this.$store.commit('setmessageList', data);
-                }
-            });
-        },
-        //查询未读消息数量
-        getUnreadNumber() {
-            this.$http.postForm('/sc-message/message/queryUnreadMessageStatic').then(({ status, data, msg }) => {
-                if (status === 0) {
-                    data.map((item, index) => {
-                        if (item.cn) {
-                            this.$store.commit('setmessageNumber', true);
-                        }
-                    });
-                }
-            });
-        },
-        //初始化websoket
-        initWebSocket(id) {
-            if ('WebSocket' in window) {
-                var serviceIp = this.envConfig.websoketUrl;
-                this.websocket = new WebSocket('ws://' + serviceIp + '/sc-message/webSocket/' + id);
-            } else {
-                console.log('当前浏览器 Not support websocket');
+          sessionStorage.removeItem('tabs');
+          location.href = this.envConfig.loginUrl;
+        } else {
+          this.$message.error(msg);
+        }
+      });
+    },
+    getUserInfo (resolve) {
+      this.$http.postForm('/sc-user-center/user/findLoginUserById').then(({ status, data, msg }) => {
+        if (status === 0) {
+          this.$store.commit('setcCruUserInfo', data);
+        } else {
+          this.$message.error('获取用户信息失败');
+        }
+        resolve && resolve(true);
+      });
+    },
+    editUserInfo () {
+      new Promise((resolve) => {
+        this.$store.dispatch('addPopup', {
+          url: '/system/users/popups/edituser.vue',
+          width: '500px',
+          height: '500px',
+          props: {
+            data: JSON.parse(JSON.stringify(this.cruUserInfo)),
+            callback: resolve
+          },
+          title: '编辑用户信息'
+        });
+      }).then(() => {
+        this.getUserInfo();
+      });
+    },
+    goMessage (msg) {
+      let messageStatus = 2; //全部
+      if (msg == 'unread') {
+        messageStatus = 0; //未读
+      }
+      this.$store.commit('setmessageStatus', messageStatus);
+      this.$router.push({
+        path: '/msg'
+      });
+    },
+    //获取最新消息列表
+    getMessageList () {
+      this.$http.postForm('/sc-message/message/queryLastMessage', { num: '5' }).then(({ status, data, msg }) => {
+        if (status === 0) {
+          this.$store.commit('setmessageList', data);
+        }
+      });
+    },
+    //查询未读消息数量
+    getUnreadNumber () {
+      this.$http.postForm('/sc-message/message/queryUnreadMessageStatic').then(({ status, data, msg }) => {
+        if (status === 0) {
+          data.map((item, index) => {
+            if (item.cn) {
+              this.$store.commit('setmessageNumber', true);
             }
-            let that = this;
-            this.interval = window.setInterval(function () {
-                //每隔30秒钟发送一次心跳,避免websocket连接因超时而自动断开
-                if (that.websocket != null) {
-                    // that.websocket.send('HeartBeat');
-                    // console.log('发送心跳包:HeartBeat');
-                }
-            }, 30000);
-            //连接发生错误的回调方法
-            this.websocket.onerror = function (ev) {
-                console.log('WebSocket连接发生错误');
-            };
+          });
+        }
+      });
+    },
+    //初始化websoket
+    initWebSocket (id) {
+      if ('WebSocket' in window) {
+        var serviceIp = this.envConfig.websoketUrl;
+        this.websocket = new WebSocket('ws://' + serviceIp + '/sc-message/webSocket/' + id);
+      } else {
+        console.log('当前浏览器 Not support websocket');
+      }
+      let that = this;
+      this.interval = window.setInterval(function () {
+        //每隔30秒钟发送一次心跳,避免websocket连接因超时而自动断开
+        if (that.websocket != null) {
+          // that.websocket.send('HeartBeat');
+          // console.log('发送心跳包:HeartBeat');
+        }
+      }, 30000);
+      //连接发生错误的回调方法
+      this.websocket.onerror = function (ev) {
+        console.log('WebSocket连接发生错误');
+      };
 
-            //连接成功建立的回调方法
-            this.websocket.onopen = function (ev) {
-                console.log('WebSocket连接成功');
-                // this.send('addsocket');
-            };
+      //连接成功建立的回调方法
+      this.websocket.onopen = function (ev) {
+        console.log('WebSocket连接成功');
+        // this.send('addsocket');
+      };
 
-            //接收到消息的回调方法
-            this.websocket.onmessage = function (event) {
-                try {
-                    let msg = JSON.parse(event.data);
-                    // let i = msg.typeId - 1;
-                    let i = msg.typeId;
-                    if (msg.userId) {
-                        that.$notify({
-                            dangerouslyUseHTMLString: true,
-                            showClose: true,
-                            customClass: 'notice_icon',
-                            offset: 50,
-                            duration: 3000,
-                            message:
-                                "<div class='notice'><img src=" +
-                                that.imgList[i] +
-                                " class='img'/><div class='notice-content'><span class='title'>新消息通知</span><span class='nowrap'>" +
-                                '【' +
-                                msg.type +
-                                '】' +
-                                msg.content +
-                                '</span></div></div>'
-                        });
-                        that.getMessageList();
-                        that.getUnreadNumber();
-                    }
-                } catch (e) {}
-            };
+      //接收到消息的回调方法
+      this.websocket.onmessage = function (event) {
+        try {
+          let msg = JSON.parse(event.data);
+          // let i = msg.typeId - 1;
+          let i = msg.typeId;
+          if (msg.userId) {
+            that.$notify({
+              dangerouslyUseHTMLString: true,
+              showClose: true,
+              customClass: 'notice_icon',
+              offset: 50,
+              duration: 3000,
+              message:
+                "<div class='notice'><img src=" +
+                that.imgList[i] +
+                " class='img'/><div class='notice-content'><span class='title'>新消息通知</span><span class='nowrap'>" +
+                '【' +
+                msg.type +
+                '】' +
+                msg.content +
+                '</span></div></div>'
+            });
+            that.getMessageList();
+            that.getUnreadNumber();
+          }
+        } catch (e) { }
+      };
 
-            //连接关闭的回调方法
-            this.websocket.onclose = function (ev) {
-                console.log('WebSocket连接关闭');
-                this.websocket = null;
-            };
-        },
-        send(message) {
-            if (this.websocket && this.websocket != null) {
-                // this.websocket.send(message);
-                console.log('发送的消息:' + message);
-            }
-        },
-        //关闭WebSocket连接
-        closeWebSocket() {
-            if (this.websocket != null) {
-                this.websocket.close();
-            }
-            if (this.interval) {
-                window.clearInterval(this.interval);
-            }
-        }
+      //连接关闭的回调方法
+      this.websocket.onclose = function (ev) {
+        console.log('WebSocket连接关闭');
+        this.websocket = null;
+      };
     },
-    mounted() {
-        let vm = this;
-        window.onbeforeunload = function () {
-            vm.closeWebSocket();
-        };
+    send (message) {
+      if (this.websocket && this.websocket != null) {
+        // this.websocket.send(message);
+        console.log('发送的消息:' + message);
+      }
     },
-    destoryed() {
-        this.closeWebSocket();
-    },
-    created() {
-        new Promise((resolve) => {
-            this.getUserInfo(resolve);
-        }).then((_) => {
-            let id = this.$store.state.cruUserInfo.id;
-            this.initWebSocket(id);
-            this.getMessageList();
-            this.getUnreadNumber();
-        });
+    //关闭WebSocket连接
+    closeWebSocket () {
+      if (this.websocket != null) {
+        this.websocket.close();
+      }
+      if (this.interval) {
+        window.clearInterval(this.interval);
+      }
     }
+  },
+  mounted () {
+    let vm = this;
+    window.onbeforeunload = function () {
+      vm.closeWebSocket();
+    };
+  },
+  destoryed () {
+    this.closeWebSocket();
+  },
+  created () {
+    new Promise((resolve) => {
+      this.getUserInfo(resolve);
+    }).then((_) => {
+      let id = this.$store.state.cruUserInfo.id;
+      this.initWebSocket(id);
+      this.getMessageList();
+      this.getUnreadNumber();
+    });
+  }
 };
 </script>
 <style lang='scss' scoped>

+ 9 - 0
smart/src/router/dynamicMuen.js

@@ -1,8 +1,16 @@
 import store from '../store/store.js';
+import msg from '@views/messages/index.vue';
 const staticMuen = [
     {
         path: '*',
         redirect: '/404'
+    },
+    {
+        path: '/msg',
+        name: 'msg',
+        // component: () => import(/* webpackChunkName: "messages" */ '@views/messages'),
+        component: msg,
+        meta: { title: '消息中心' }
     }
 ];
 //路由格式
@@ -37,6 +45,7 @@ const dimension = (arrList, arr) => {
 //添加路由
 const AddRt = (router, dynamicMuenList) => {
     let NEWdynamicMuenList = [...dynamicMuenList, ...staticMuen];
+    debugger;
     if (NEWdynamicMuenList.length !== 0) {
         NEWdynamicMuenList.forEach((item) => {
             router.options.routes[0].children.push(item);

+ 413 - 0
smart/src/views/messages/index.vue

@@ -0,0 +1,413 @@
+<!--
+ * @Author: zouwenying
+ * @Date: 2020-11-12 16:58:16
+ * @LastEditTime: 2021-05-13 15:18:31
+ * @LastEditors: zwy
+ * @Description: In User Settings Edit
+ * @FilePath: \userCenter\src\views\messages\index.vue
+-->
+<template>
+  <div class="msg_wrap">
+    <div class="msg_type">
+      <div
+        class="title"
+        :class="{ active: messageStatus == item.id }"
+        v-for="(item, index) in messageList"
+        :key="index"
+        @click="setType(item.id)"
+      >
+        {{ item.name }}
+        <span v-if="item.id === 0">({{ unreadNum }})</span>
+      </div>
+    </div>
+    <div class="content_type">
+      <div class="msg_title">
+        <div
+          class="title"
+          :class="{ active: typeId == item.typeId }"
+          v-for="(item, index) in typeList"
+          :key="index"
+          @click="setValue(item.typeId)"
+        >
+          {{ item.type }}
+          <span v-if="messageStatus == 0">({{ item.cn }})</span>
+        </div>
+      </div>
+      <zz-table
+        ref="table"
+        :cols="cols"
+        :settings="{ showCheckbox: true, stripe: true }"
+        :data="mixins_list"
+        :pageset="mixins_pageset"
+        @page-change="pageChange"
+        :loading="mixins_onQuery"
+        @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"
+          >
+            <span
+              v-if="!scope.row.messageStatus"
+              class="point"
+            ></span>
+            <span
+              v-else
+              class="unpoint"
+            ></span>
+            {{ scope.row.messageContent }}
+          </p>
+        </template>
+        <template
+          slot-scope="scope"
+          slot="batchtodo"
+        >
+          <div class="operate">
+            <el-button
+              type="primary"
+              :class="{ disabled: selectRow.length == 0 }"
+              :disabled="selectRow.length == 0"
+              @click="deleteOne"
+            >删除</el-button>
+            <el-button
+              type="primary"
+              :class="{ disabled: selectRow.length == 0 }"
+              :disabled="selectRow.length == 0"
+              @click="mark"
+            >标为已读</el-button>
+            <el-button
+              type="primary"
+              class="btn"
+              @click="markAll"
+            >全部已读</el-button>
+            <el-button
+              type="primary"
+              class="btn"
+              @click="deleteAll"
+            >全部删除</el-button>
+          </div>
+        </template>
+      </zz-table>
+    </div>
+  </div>
+</template>
+
+<script>
+import list from '@utils/list.js';
+import envConfig from '@/config';
+import { mapState, mapGetters, mapMutations, mapActions } from 'vuex';
+export default {
+  mixins: [list],
+  data () {
+    return {
+      envConfig: envConfig,
+      messageList: [
+        { id: 2, name: '全部消息' },
+        { id: 0, name: '未读消息' },
+        { id: 1, name: '已读消息' }
+      ],
+      unreadNum: 0,
+      typeId: -1,
+      typeList: [],
+      selectRow: [],
+      sceneTypes: { 1: '1014', 2: '1014', 3: '1016', 4: '1015', 5: '1014' },
+      cols: [
+        {
+          label: '消息内容',
+          prop: 'messageContent',
+          slot: 'messageContent'
+        },
+        {
+          label: '消息类型',
+          prop: 'typeName'
+        },
+        {
+          label: '创建时间',
+          prop: 'dateCreate'
+        }
+      ]
+    };
+  },
+  computed: {
+    ...mapState(['messageStatus'])
+  },
+  watch: {
+    messageStatus () {
+      this.search();
+    }
+  },
+  methods: {
+    setType (id) {
+      this.$store.commit('setmessageStatus', id);
+      this.selectRow = [];
+      this.search();
+    },
+    setValue (id) {
+      this.typeId = id;
+      this.selectRow = [];
+      this.search();
+    },
+    search () {
+      if (this.typeId == -1 && this.messageStatus == 2) {
+        this.mixins_query = {};
+      } else if (this.messageStatus == 2) {
+        this.mixins_query = {
+          typeId: this.typeId
+        };
+      } else if (this.typeId == -1) {
+        this.mixins_query = {
+          messageStatus: this.messageStatus
+        };
+      } else {
+        this.mixins_query = {
+          typeId: this.typeId,
+          messageStatus: this.messageStatus
+        };
+      }
+      this.selectRow = [];
+      this.getMessageList();
+      this.getUnreadNumber();
+      this.mixins_search();
+    },
+    toUrl (id, type, sceneType, urllink) {
+      debugger;
+      this.$http.post('/sc-message/message/updateMultiple', { ids: [id], messageStatus: 1 }).then(({ status, data, msg }) => { });
+      let url, appId;
+      url = urllink;
+      appId = '1003';
+      // if (type == 1 || type == 2) {
+      //     appId = this.sceneTypes[sceneType] || '1003';
+      // } else if (type == 4) {
+      //     appId = '1003';
+      // } else if (type == 3 || type == 7) {
+      //     appId = '1003';
+      // }
+      //查询linkpath能不能跳转
+      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);
+          // if(status==0&&data==0){
+          //     window.open(url);
+          // }else{
+          //     this.$message.error("您没有该系统权限")
+          // }
+        });
+    },
+    selectionChange (val) {
+      let arr = [];
+      if (val.length) {
+        val.map((item, index) => {
+          arr.push(item.id);
+        });
+        this.selectRow = arr;
+        return;
+      }
+      this.selectRow = [];
+    },
+    deleteOne () {
+      this.$msgBox(`您确定要删除选中的${this.selectRow.length}条消息`, '删除后将无法恢复,是否继续?')
+        .then((_) => {
+          this.$http
+            .post('/sc-message/message/updateMultiple', { ids: this.selectRow, status: 0 })
+            .then(({ status, data, msg }) => {
+              if (status === 0) {
+                this.search();
+                this.$refs.table.checkAllChange();
+                this.$message.success('删除消息成功');
+              }
+            });
+        })
+        .catch((err) => { });
+    },
+    deleteAll () {
+      this.$msgBox(`您确定要删除全部消息`, '删除后将无法恢复,是否继续?')
+        .then((_) => {
+          this.$http.post('/sc-message/message/updateMultiple', { ids: [], status: 0 }).then(({ status, data, msg }) => {
+            if (status === 0) {
+              this.search();
+              this.$refs.table.checkAllChange();
+              this.$message.success('删除全部消息成功');
+            }
+          });
+        })
+        .catch((err) => { });
+    },
+    mark () {
+      this.$msgBox(`您确定要标记选中的${this.selectRow.length}条消息为已读`, '标记后将无法恢复,是否继续?', 'warning')
+        .then((_) => {
+          this.$http
+            .post('/sc-message/message/updateMultiple', { ids: this.selectRow, messageStatus: 1 })
+            .then(({ status, data, msg }) => {
+              if (status === 0) {
+                this.search();
+                this.$refs.table.checkAllChange();
+                this.$message.success('标记已读消息成功');
+              }
+            });
+        })
+        .catch((err) => { });
+    },
+    markAll () {
+      this.$msgBox(`您确定要标记全部消息为已读`, '标记后将无法恢复,是否继续?', 'warning')
+        .then((_) => {
+          this.$http.post('/sc-message/message/updateMultiple', { ids: [], messageStatus: 1 }).then(({ status, data, msg }) => {
+            if (status === 0) {
+              this.search();
+              this.$refs.table.checkAllChange();
+              this.$message.success('标记全部消息成功');
+            }
+          });
+        })
+        .catch((err) => { });
+    },
+    //查询未读消息数量
+    getUnreadNumber () {
+      this.$http.postForm('/sc-message/message/queryUnreadMessageStatic').then(({ status, data, msg }) => {
+        if (status === 0) {
+          let sum = 0;
+          data.map((item, index) => {
+            sum = sum + item.cn;
+          });
+          this.unreadNum = sum;
+          if (sum == 0) {
+            this.$store.commit('setmessageNumber', false);
+          } else {
+            this.$store.commit('setmessageNumber', true);
+          }
+          data.unshift({ type: '全部类型', cn: sum, typeId: -1 });
+          this.typeList = data;
+        }
+      });
+    },
+    //获取最新消息列表
+    getMessageList () {
+      this.$http.postForm('/sc-message/message/queryLastMessage', { num: '5' }).then(({ status, data, msg }) => {
+        if (status === 0) {
+          this.$store.commit('setmessageList', data);
+        }
+      });
+    }
+  },
+  created () {
+    debugger
+    this.mixins_dataUrl = '/sc-message/message/selectPage';
+    this.search();
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+@import '@assets/css/public-style.scss';
+.msg_wrap {
+    width: 100%;
+    height: 100%;
+    display: flex;
+    .msg_type {
+        // float: left;
+        width: 200px;
+        height: 730px;
+        border-right: 1px solid #f6f6f6;
+        box-sizing: border-box;
+        background: #ffffff;
+        .title {
+            height: 48px;
+            line-height: 48px;
+            padding-left: 20px;
+            color: #212226;
+            margin-top: 6px;
+            font-size: 16px;
+            cursor: pointer;
+        }
+        .active {
+            background: rgba(39, 135, 241, 0.1);
+            color: $mainTextColor;
+            border-right: 2px solid $mainTextColor;
+        }
+    }
+    .content_type {
+        width: calc(100% - 200px);
+        .msg_title {
+            display: flex;
+            height: 60px;
+            line-height: 60px;
+            font-size: 14px;
+            background: #ffffff;
+            .title {
+                height: 58px;
+                margin: 0 25px;
+                text-align: center;
+                cursor: pointer;
+            }
+            .active {
+                color: $mainTextColor;
+                border-bottom: 2px solid $mainTextColor;
+            }
+        }
+    }
+    .operate {
+        .btn {
+            height: 30px;
+        }
+        .disabled {
+            height: 30px;
+            background: #f8fcff;
+            border: 1px solid #d8d8d8;
+            border-radius: 4px;
+            color: #d8d8d8;
+        }
+    }
+}
+.active {
+    color: $mainTextColor;
+    cursor: pointer;
+}
+.point {
+    width: 4px;
+    height: 4px;
+    background: #fe7271;
+    border-radius: 50%;
+    display: inline-block;
+    margin-right: 5px;
+    vertical-align: middle;
+}
+.unpoint {
+    width: 4px;
+    height: 4px;
+    border-radius: 50%;
+    display: inline-block;
+    margin-right: 5px;
+    vertical-align: middle;
+}
+/deep/ .el-table {
+    border: none;
+    border-top: 1px solid #f6f6f6;
+    height: 670px;
+    overflow: auto;
+}
+
+/deep/ .foot {
+    display: flex;
+    justify-content: space-between;
+    .selectAll {
+        display: flex;
+        margin-top: 20px;
+        .el-checkbox__input {
+            margin: 5px 20px 5px 15px;
+            vertical-align: middle;
+        }
+    }
+}
+/deep/ .el-table__header .el-table_1_column_2 .cell span {
+    margin-left: 10px;
+}
+</style>

+ 38 - 2
smart/src/views/parkingSpaceManagement/parkingSpaceList.vue

@@ -41,7 +41,7 @@
         icon="el-icon-search"
       >查询 </el-button>
       <div class="search-icon">
-        <el-tooltip
+        <!-- <el-tooltip
           class="item"
           effect="light"
           placement="bottom"
@@ -51,7 +51,32 @@
             class="zoniot_font zoniot-icon-tianjia2"
             @click="addOrEdit('add')"
           ></i>
-        </el-tooltip>
+        </el-tooltip> -->
+        <el-dropdown
+          type="primary"
+          @command="addCommand"
+        >
+          <span class="zoniot_font zoniot-icon-tianjia2"></span>
+          <el-dropdown-menu
+            slot="dropdown"
+            hide-on-click="false"
+            class="device-search-dropdown"
+          >
+            <el-dropdown-item command="add">单个添加</el-dropdown-item>
+            <el-dropdown-item command="batchAdd">
+              <div class="upload_div">
+                <xk-upload
+                  class="upload_class"
+                  @callback="mixins_search"
+                  :params="{ importType: 'RESIDENT' }"
+                >
+                  <span slot="content">批量添加</span>
+                </xk-upload>
+              </div>
+            </el-dropdown-item>
+            <el-dropdown-item command="template">下载模板</el-dropdown-item>
+          </el-dropdown-menu>
+        </el-dropdown>
         <el-tooltip
           class="item"
           effect="light"
@@ -159,6 +184,17 @@ export default {
     };
   },
   methods: {
+    // 批量添加
+    addCommand (command) {
+      if (command === 'add') {
+        this.addOrEdit('add');
+        return;
+      }
+      if (command === 'template') {
+        this.__exportExcel('/sc-community/excel/download/template', { importType: 'PARKING' });
+        return;
+      }
+    },
     //获取社区名称下拉列表
     communityNameList () {
       this.communityList = [];

+ 2 - 1
smart/src/views/rechargeRecord/index.vue

@@ -123,7 +123,8 @@ export default {
     lookDetails () {
       console.log(this.mixins_query)
       this.mixins_dataUrl = '/sc-community-web/parkingCar/queryChargeRecord';
-      this.mixins_query = { parkId: this.mixins_query.parkId, plateNo: this.mixins_query.plateNo, startTime: this.mixins_query.startTime, endTime: this.mixins_query.endTime };
+      // parkingTime: this.mixins_query.parkingTime,
+      this.mixins_query = { parkingTime: this.mixins_query.parkingTime, parkId: this.mixins_query.parkId, plateNo: this.mixins_query.plateNo, startTime: this.mixins_query.startTime, endTime: this.mixins_query.endTime };
       console.log(this.mixins_query)
       this.mixins_search();
     },

+ 2 - 2
smart/src/views/vehicleInformation/index.vue

@@ -198,8 +198,8 @@ export default {
       }
       if (command === 'template') {
         // this.__exportExcel('/sc-community/excel/download/template', { importType: 'FACILITY' });
-        // this.__exportExcel('/sc-community-web/excel/download/template', { importType: 'CAR' });
-        this.__exportExcel(' /sc-community-web/excel/import/excel', { importType: 'CAR' });
+        this.__exportExcel('/sc-community-web/excel/download/template', { importType: 'CAR' });
+        // this.__exportExcel(' /sc-community-web/excel/import/excel', { importType: 'CAR' });
         // /sc-community-web/excel/import/excel
         return;
       }

+ 93 - 24
smart/src/views/vehicleInformation/setpPage/details.vue

@@ -214,7 +214,7 @@
             align="center"
           >
             <template slot-scope="scope">
-              <span style="width: 5px;color: #F56C6C; float: left;">*</span>
+              <span style="width: 5px;color: #F56C6C; float: left; margin-right: 5px;">*</span>
               <el-form-item
                 prop="parkingArea"
                 ref="againValue"
@@ -313,8 +313,11 @@
             width="230"
           >
             <template slot-scope="scope">
-              <span style="width: 100%;color: #F56C6C;display: flex; justify-content: center;">*</span>
-              <el-col :span="10">
+              <span style="color: #F56C6C;float: left; margin-right: 5px;">*</span>
+              <el-col
+                :span="10"
+                style="float: left;"
+              >
                 <el-form-item
                   prop="againInput"
                   ref="againInput"
@@ -333,20 +336,31 @@
                   </el-select>
                 </el-form-item>
               </el-col>
-              <el-col :span="14">
+              <el-col
+                :span="12"
+                style="float: left;"
+              >
                 <!-- <el-form-item
                   prop="againInput"
                   ref="againInput"
                 > -->
                 <!-- <input  ref="searchInput" v-focus>
  -->
-                <el-input
-                  placeholder="车牌号"
-                  v-model="parkingSpaceSetting[scope.$index].license"
-                  clearable
-                  ref="searchInput"
+                <el-form-item
+                  prop="againLicense"
+                  ref="againLicense"
                 >
-                </el-input>
+                  <el-input
+                    placeholder="车牌号"
+                    v-model="parkingSpaceSetting[scope.$index].license"
+                    clearable
+                    ref="searchInput"
+                    @input="parkingSpace()"
+                    @blur="Setting()"
+                  >
+                  </el-input>
+                </el-form-item>
+
                 <!-- </el-form-item> -->
 
               </el-col>
@@ -471,7 +485,8 @@ export default {
         // 校验
         parking: false,
         parkingArea: '',
-        againInput: ''
+        againInput: '',
+        againLicense: ''
       },
       tableData: [
         {
@@ -645,7 +660,10 @@ export default {
           { required: true, message: '请选择可停区域', trigger: 'change' }
         ],
         againInput: [
-          { required: true, message: '请选择车牌号', trigger: 'change' },
+          { required: true, message: '请选择车牌', trigger: 'change' },
+        ],
+        againLicense: [
+          { required: true, message: '请输入车牌号', trigger: 'change' },
         ]
 
       },
@@ -670,11 +688,42 @@ export default {
     };
   },
   methods: {
+    // 车牌号
+    // @input="parkingSpace()"
+    // @blur="Setting()"
+    parkingSpace () {
+      // parkingSpaceSetting[scope.$index].license
+      for (let i = 0; i < this.parkingSpaceSetting.length; i++) {
+        console.log(this.parkingSpaceSetting[i].license);
+        if (this.parkingSpaceSetting[i].license.length == 0) {
+          this.formDate.againLicense = ''
+          this.rules.againLicense[0].required = !this.formDate.parking;
+        } else {
+          this.formDate.againLicense = '验证'
+          this.rules.againLicense[0].required = this.formDate.parking;
+          this.clearValidate('againLicense');
+        }
+      }
+    },
+    Setting () {
+      for (let i = 0; i < this.parkingSpaceSetting.length; i++) {
+        console.log(this.parkingSpaceSetting[i].license);
+        if (this.parkingSpaceSetting[i].license.length == 0) {
+          this.formDate.againLicense = ''
+          this.rules.againLicense[0].required = !this.formDate.parking;
+        } else {
+          this.formDate.againLicense = '验证'
+          this.rules.againLicense[0].required = this.formDate.parking;
+          this.clearValidate('againLicense');
+        }
+      }
+    },
+
     clearValidate (formName) {
       this.$refs[formName].clearValidate();
     },
     resDate (val) {
-      // debugger
+      debugger
       this.formDate.resDate = val.label;
       this.formDate.id = val.residentId;
       this.formDate.idName = val.name;
@@ -766,7 +815,7 @@ export default {
           .get('/sc-community/parkingCar/getUserInfo', { phone: this.formDate.tel })
           .then(({ data, msg, status }) => {
             for (let i = 0; i < data.houseInfos.length; i++) {
-
+              debugger
               this.room.push({
                 name: data.houseInfos[i].roomNumber,
                 label: data.houseInfos[i].id,
@@ -779,6 +828,7 @@ export default {
               this.formDate.resDate = data.houseInfos[0].id;
               this.formDate.id = data.houseInfos[0].residentId;
               this.formDate.idName = data.houseInfos[0].roomNumber
+
             }
           })
           .catch(() => { });
@@ -793,6 +843,7 @@ export default {
 
 
     addTime () {
+      debugger
       this.tableData.push({
         parkingArea: '',
         positionInformation: ''
@@ -809,6 +860,7 @@ export default {
     },
     deleteUserByUserName (row) {
       // console.log(row)
+      debugger
       if (this.tableData.length > 1) {
         this.tableData.splice(row, 1);
       }
@@ -925,18 +977,18 @@ export default {
     },
     submit () {
       if (this.params.comm == 'add') {
-        // this.url = '/sc-community-web/parkingCar/addVehicleInfor'
         this.url = '/sc-community-web/parkingCar/updateVehicleInfor'
       } else {
-        // this.url = '/sc-community-web/parkingCar/updateVehicleInfor'
         this.url = '/sc-community-web/parkingCar/addVehicleInfor'
       }
       this.$refs.formDate.validate((valid) => {
         console.log('valid', valid);
         if (valid) {
           var table = [];
+          this.plateNoInfo = []
+          console.log('333333', this.tableData);
           for (let i = 0; i < this.tableData.length; i++) {
-            // this.tableData[i].areaName = (Array.from(new Set(this.areaNamed))).join(',');
+
             this.tableData[i].areaName = (Array.from(new Set(this.areaNamed))).join(',');
             console.log(this.tableData[i]);
             table.push({
@@ -971,6 +1023,7 @@ export default {
               carBrand: this.form[k].vehicleBrand,
 
             });
+
             this.fullCarNoStr = this.parkingSpaceSetting[k].licensePlate + this.parkingSpaceSetting[k].license;
             this.plateNoInfo.push((this.parkingSpaceSetting[k].licensePlate + this.parkingSpaceSetting[k].license));
 
@@ -980,12 +1033,15 @@ export default {
             }
 
           }
+          debugger
+          console.log('111', this.formDate)
           this.$http.post(this.url, {
             cardId: this.params.cardId != undefined ? this.params.cardId : '',
             cardName: this.formDate.userName,
             userName: this.formDate.userName,
             tel: this.formDate.tel,
-            houseId: this.formDate.residentId,
+            // houseId: this.formDate.residentId,
+            houseId: this.formDate.resDate,
             residentId: this.formDate.id,
             // residentId: this.formDate.ruleId,
             remark: this.formDate.remark,
@@ -1036,13 +1092,21 @@ export default {
 
     if (this.params.cardId != undefined) {
       this.formDate.parkingArea = '验证';
-      this.formDate.againInput = '验证'
+      this.formDate.againInput = '验证';
+      this.formDate.againLicense = '验证'
+      debugger
       this.params.cardId;
       this.$http.get('/sc-community-web/parkingCar/getVehicleInfor', { id: this.params.cardId }).then(({ data, msg, status }) => {
         console.log(data);
+        debugger
         this.formDate.userName = data.userName
         this.formDate.tel = data.tel
-        this.formDate.resDate = data.houseId
+        // this.personnel();
+        // this.formDate.resDate = '1480'
+        // this.formDate.resDate = '10243'
+        //   this.formDate.resDate = val.label;
+
+        // this.personnel();
         this.formDate.remark = data.remark
         this.formDate.carTypes = data.cardType == 0 ? '临时车'
           : data.cardType == 1 ? 'VIP车'
@@ -1054,22 +1118,26 @@ export default {
                       : data.cardType == 7 ? '贵宾卡'
                         : '员工卡'
 
-
+        // this.formDate.areaName = data.areaName;
 
         this.nameParkingLotName = '1';//随便
 
         this.formDate.beginTime = data.beginTime
         this.formDate.parkId = data.parkId
         var carLotStr = JSON.parse(data.carLotStr)
+        debugger
         for (let i = 0; i < carLotStr.length; i++) {
+          debugger
+          this.formDate.areaName = carLotStr[i].areaName;
           this.tableData[i].areaName = carLotStr[i].areaName
+          this.areaNamed.push(carLotStr[i].areaName);
           this.tableData[i].carType = data.cardType
           this.tableData[i].lotCount = carLotStr[i].lotCount
           this.tableData[i].positionInformation = carLotStr[i].lotName
           this.tableData[i].parkingId = carLotStr[i].parkingId
           this.formDate.ruleId = carLotStr.ruleId
           this.formDate.sort = carLotStr.sequence
-          this
+
         }
         for (let k = 0; k < data.parkCarDetails.length; k++) {
           this.parkingSpaceSetting[k].licensePlate = (data.fullCarNoStr).substr(0, 1)
@@ -1079,11 +1147,11 @@ export default {
 
         }
 
-
+        this.personnel();
         this.rechargeRules();
         this.nameParking();
         this.region();
-        this.personnel();
+        // this.personnel();
 
         for (let i = 0; i < carLotStr.length; i++) {
           this.tableData[i].parkingArea = Number(carLotStr[i].areaId)
@@ -1096,6 +1164,7 @@ export default {
           this.form[k].vehicleColors = data.parkCarDetails[k].carColor
           this.form[k].vehicleBrand = data.parkCarDetails[k].carBrand
         }
+        console.log('2222', this.tableData);
 
       });
     }

+ 6 - 27
smart/src/views/vehicleInformation/setpPage/native.vue

@@ -138,40 +138,19 @@ export default {
     }
   },
   created () {
-    debugger
+    // 数图
+    this.garage();
     this.id = this.params.id;
     console.log(this.id);
     this.Information = this.params.positionInformation;
+    debugger;
     this.value = this.params.value;
-    this.checkedData = {
-      name: this.Information,
-      value: this.value,
-      id: "57-592011253-2-4793",
-      parentId: "57-592011253-2"
+    // 显示
+    this.defaultcheckedkeys = [this.params.value]
+
 
-    }
-    this.garage();
   }
 }
 </script>
 
 
-<style scoped>
-/* /deep/ .el-tree > .el-tree-node > .el-tree-node__content .el-checkbox {
-    display: none;
-}
-
-/deep/.el-tree > .el-tree-node > .el-tree-node__children > .el-tree-node > .el-tree-node__content .el-checkbox {
-    display: none;
-} */
-/* /deep/.el-tree
-    > .el-tree-node
-    > .el-tree-node__children
-    > .el-tree-node
-    > .el-tree-node__children
-    > .el-tree-node
-    > .el-tree-node__content
-    .el-checkbox {
-    display: none;
-} */
-</style>