chuwu 6 vuotta sitten
vanhempi
commit
43dc93c6b0

+ 5 - 382
src/assets/scss/reset.scss

@@ -1,16 +1,9 @@
-$WinWitdh:1200px;
-$BaseC:#555;
-$LinkC:#06f;
-$HoverC:#f60;
-$FontSize:13px;
 $fontFamily: "Spurce Han Sans,Wah Kang font,Microsoft YaHei";
-$allColor: #333; //正文#333
-$color1: #666; //辅助文字#666
-$color2: #999; //#999
-$color3: #ccc; //失效文字#ccc
-$color4: #00A0E8; //链接文字
-$color5: #8E9CC1; //表头文字加粗
-$colorList: ( 1:$color1, 2:$color2, 3:$color3, 4:$color4, 5:$color5);
+$allColor: #303133; //主要文字
+$color1: #606266; //常规文字
+$color2: #909399; //次要文字
+$color3: #C0C4CC; //占位文字
+$colorList: ( 1:$color1, 2:$color2, 3:$color3);
 $theme1: #5BA7FF;
 $theme2: #FFF;
 $theme3: #8E9CC1;
@@ -31,23 +24,6 @@ $bg5: #E5F6D3;
 $bgList: ( 1:$bg1, 2:$bg2, 3:$bg3, 4:$bg4, 5:$bg5);
 $allSize: 14px; //正常文字大小
 $size1: 12px; //辅助文字大小
-// mixins
-@mixin dz($time:0.25s) {
-    -webkit-transition: all $time ease-in-out;
-    -moz-transition: all $time ease-in-out;
-    -o-transition: all $time ease-in-out;
-    transition: all $time ease-in-out;
-}
-
-// .el-dialog__headerbtn {
-//     top: -24px;
-//     right: -24px;
-//     width: 24px;
-//     height: 24px;
-//     border-radius: 50%;
-//     color: #8E9CC1;
-//     background-color: #fff;
-// }
 .el-dialog__header {
     border-bottom: 1px solid #C2CEDB;
     box-sizing: border-box;
@@ -58,38 +34,6 @@ $size1: 12px; //辅助文字大小
     }
 }
 
-// .el-button--mini,
-// .el-button--mini.is-round {
-//     padding: 5px 20px;
-// }
-// .el-button {
-//     box-sizing: border-box;
-//     border-color: $auxiliary1;
-// }
-// .el-button span {
-//     color: $color4;
-// }
-// .el-button:focus,
-// .el-button:hover {
-//     background-color: $bg1;
-//     border-color: $auxiliary1;
-// }
-// .el-button span {
-//     display: inline-block;
-//     line-height: 20px;
-//     height: 20px;
-// }
-// * {
-//     font-family: $fontFamily;
-//     font-size: $allSize;
-//     color: $allColor;
-// }
-// .color {
-//     color: $allColor;
-// }
-// .el-input__inner:hover{
-//     border-color: 
-// }
 //文字色
 @each $i,
 $color in $colorList {
@@ -149,325 +93,4 @@ $bg in $bgList {
         border-width: #{$i}px;
         border-style: solid;
     }
-}
-
-// .color2 {
-//     color: $color2;
-// }
-// .color3 {
-//     color: $color3;
-// }
-// .color4 {
-//     color: $color4;
-// }
-// .color5 {
-//     color: $color5
-// }
-// @charset "UTF-8";
-body,
-ul,
-ol,
-dl,
-dd,
-h1,
-h2,
-h3,
-h4,
-h5,
-h6,
-pre,
-form,
-fieldset,
-legend,
-input,
-button,
-textarea,
-p,
-blockquote,
-table,
-th,
-td,
-menu {
-    margin: 0;
-    padding: 0
-}
-
-html,
-body,
-#app {
-    height: 100%;
-    width: 100%;
-}
-
-table {
-    border-collapse: collapse;
-    border-spacing: 0;
-    table-layout: fixed
-}
-
-ul,
-ol,
-menu {
-    list-style: none
-}
-
-fieldset,
-img {
-    border: none
-}
-
-img,
-object,
-select,
-input,
-textarea,
-button {
-    vertical-align: middle
-}
-
-input,
-textarea,
-select,
-address,
-caption,
-cite,
-code,
-dfn,
-em,
-i,
-b,
-strong,
-small,
-th,
-var,
-abbr {
-    font-size: 100%;
-    font-style: normal
-}
-
-caption,
-th {
-    text-align: left;
-}
-
-article,
-aside,
-footer,
-header,
-hgroup,
-nav,
-section,
-figure,
-figcaption {
-    display: block;
-}
-
-code,
-kbd,
-pre,
-samp,
-tt {
-    font-family: Consolas, "Courier New", Courier, monospace;
-}
-
-address,
-cite,
-dfn,
-em,
-var,
-i {
-    font-style: normal;
-}
-
-blockquote,
-q {
-    quotes: none;
-}
-
-blockquote:before,
-blockquote:after,
-q:before,
-q:after {
-    content: "";
-    content: none;
-}
-
-a {
-    color: $LinkC;
-    text-decoration: none;
-    cursor: pointer;
-    &:link,
-    &:visited,
-    &:active {
-        color: $LinkC;
-    }
-    &:hover,
-    &:focus {
-        color: $HoverC;
-        text-decoration: underline;
-        outline: none;
-    }
-    &,
-    span,
-    i,
-    em,
-    u,
-    strong,
-    b,
-    p,
-    img,
-    ul,
-    li,
-    div,
-    dd,
-    dt,
-    dl,
-    ol,
-    table,
-    th,
-    td,
-    h1,
-    h2,
-    h3,
-    h4,
-    h5,
-    h6,
-    input,
-    textarea,
-    button,
-    small,
-    select {
-        cursor: pointer;
-        @include dz;
-    }
-}
-
-abbr[title],
-acronym[title] {
-    border-bottom: 1px dotted;
-    cursor: help;
-}
-
-// base by fungleo
-html {
-    min-width: $WinWitdh;
-    // overflow-y: scroll;
-}
-
-body {
-    font-size: $FontSize;
-    color: $BaseC;
-    line-height: 2;
-}
-
-body,
-button,
-input,
-select,
-textarea {
-    font-family: tahoma, Helvetica, Arial, "\5FAE\8F6F\96C5\9ED1";
-    *font-family: "\5FAE\8F6F\96C5\9ED1";
-}
-
-h1 {
-    font-size: $FontSize+10;
-}
-
-h2 {
-    font-size: $FontSize+8;
-}
-
-h3 {
-    font-size: $FontSize+6;
-}
-
-h4 {
-    font-size: $FontSize+4;
-}
-
-h5 {
-    font-size: $FontSize+2;
-}
-
-h6 {
-    font-size: $FontSize;
-}
-
-hr {
-    border: none;
-    height: 1px;
-    background: lighten($BaseC, 50%);
-}
-
-.fl {
-    float: left;
-}
-
-.fr {
-    float: right;
-}
-
-.tl {
-    text-align: left;
-}
-
-.tr {
-    text-align: right;
-}
-
-.tc {
-    text-align: center;
-}
-
-.cf:before,
-.cf:after,
-.web:before,
-.web:after,
-.web_:before,
-.web_:after {
-    content: "";
-    display: table;
-}
-
-.cf:after,
-.web:after,
-.web_:after {
-    clear: both;
-}
-
-.cf {
-    zoom: 1;
-}
-
-.web {
-    width: $WinWitdh;
-    margin-left: auto;
-    margin-right: auto;
-    zoom: 1;
-}
-
-.web_ {
-    min-width: $WinWitdh;
-    width: 100%;
-    zoom: 1;
-}
-
-.block {
-    display: block;
-}
-
-.none {
-    display: none
-}
-
-.clear {
-    clear: both;
-}
-
-.fl {
-    float: left;
-}
-
-.disIne {
-    display: inline-block;
 }

+ 1 - 1
src/components/config_point/step3_edit/split_handle.vue

@@ -149,7 +149,7 @@ export default {
     .form {
         .dev-know {
             margin-top: 5px;
-            background: #EBEEF5;
+            background: #e6e6e6;
             padding: 5px 50px 5px 0;
             width: 470px;
             position: relative;

+ 1 - 1
src/components/ledger/handsontables/system.vue

@@ -615,7 +615,7 @@ export default {
         columns: this.getType(this.headers), //数据显示格式
         filters: true,
         maxRows: this.main.length,
-        height: winHeight - 100 - 50 - 150,
+        height: winHeight - 100 - 50 - 270,
         columnSorting: true, //添加排序
         sortIndicator: true, //添加排序
         renderAllRows: true,

+ 3 - 3
src/components/ledger/lib/title.vue

@@ -79,9 +79,9 @@ export default {
 <style lang="less" scoped>
 #listHeader {
   background-color: #fff;
-  width: calc(100% - 20px);
-  height: 120px;
-  margin: 10px;
+//   width: calc(100% - 20px);
+//   height: 120px;
+//   margin: 10px;
   .border-main {
     width: 100%;
     height: 100%;

+ 10 - 4
src/store/index.js

@@ -1,9 +1,12 @@
 import Vue from 'vue'
 import Vuex from 'vuex'
-import storage from '@/framework/utils/storage'
+import storage from '@/utils/storage'
 import layout from '@/framework/layout/layout-store'
+import project from "./modules/project"
+import peojMess from "./modules/proMess"
+import alarm from './modules/alarm'
 Vue.use(Vuex)
-
+console.log(project, 'project')
 const KEY_LAST_ROUTE = 'last_route'
 
 export default new Vuex.Store({
@@ -34,6 +37,9 @@ export default new Vuex.Store({
     },
     actions: {},
     modules: {
-        layout
+        layout,
+        project,
+        peojMess,
+        alarm
     }
-})
+})

+ 28 - 0
src/store/modules/alarm.js

@@ -0,0 +1,28 @@
+const alarm = {
+    namespaced: true,
+  state: {
+        index: 0, //刷新数据的index 递增刷新
+        spaceNameObj: null, //对象空间的名称字典
+        spaceCodeObj: null //对象类空间字典对象
+  },
+  getters: {
+      index: state => state.index,
+        spaceNameObj: state => state.spaceNameObj,
+        spaceCodeObj: state => state.spaceCodeObj
+  },
+  mutations: {
+    //   刷新index
+      ADD_INDEX(state) {
+        state.index = state.index + 1 ;
+      },
+    //   空间名称dict
+      SPACE_NAME_OBJ(state, spaceNameObj ){
+          state.spaceNameObj = spaceNameObj
+      },
+    //   空间code值dict
+        SPACE_CODE_OBJ(state, spaceCodeObj) {
+            state.spaceCodeObj = spaceCodeObj
+        }
+  }
+}
+export default alarm;

+ 29 - 0
src/store/modules/proMess.js

@@ -0,0 +1,29 @@
+const project_mess = {
+    namespaced: true,
+    state: {
+        projectId: "Pj1101080003", //项目id
+        secret: "saga123456", //数据源id
+        userId: "test", //数据源类型
+    },
+    mutations: {
+        set_project(state, val) {
+            state.projectId = val
+        },
+        set_secret(state, val) {
+            state.secret = val
+        },
+        set_userId(state, val) {
+            state.userId = val
+        }
+    },
+    actions: {
+
+    },
+    getters: {
+        projectId: state => state.projectId,
+        userId: state => state.userId,
+        secret: state => state.secret
+    }
+}
+
+export default project_mess

+ 42 - 0
src/store/modules/project.js

@@ -0,0 +1,42 @@
+const project_mess = {
+    namespaced: true,
+    state: {
+        projectId: "", //项目id
+        datasourceId: "4", //数据源id
+        protocolType: "amqp", //数据源类型
+        dataName: ""
+    },
+    mutations: {
+        set_project(state, val) {
+            state.projectId = val
+        },
+        set_datasource(state, val) {
+            state.datasourceId = val
+        },
+        set_protocol_type(state, val) {
+            state.protocolType = val
+        },
+        set_datasource_name(state, val) {
+            state.dataName = val
+        }
+    },
+    actions: {
+
+    },
+    getters: {
+        projectId: state => state.projectId,
+        datasourceId: state => state.datasourceId,
+        protocolType: state => state.protocolType,
+        dataName: state => state.dataName
+    }
+}
+
+let projectId = localStorage.getItem('projectId')
+if (!projectId) {
+    localStorage.setItem('projectId', '1234567890')
+    project_mess.state.projectId = '1234567890'
+} else {
+    project_mess.state.projectId = projectId
+}
+
+export default project_mess

+ 5 - 0
src/views/ledger/index.scss

@@ -0,0 +1,5 @@
+.page-content {
+    #listHeader {
+        height: 200px;
+    }
+}

+ 2 - 1
src/views/ledger/property/index.vue

@@ -25,6 +25,7 @@ import {
     mapActions
 } from "vuex";
 import { getNumber, getFamilyList, getSpaceName } from "@/api/scan/request"
+import "./../index.scss"
 export default {
   components: {
     sagaTitle,
@@ -153,7 +154,7 @@ export default {
   }
 };
 </script>
-<style lang="less" scoped>
+<style lang="scss" scoped>
 #deviceList {
   overflow: hidden;
   height: 100%;

+ 94 - 31
src/views/point/config_point/steps/step1.vue

@@ -2,9 +2,10 @@
     <div id="handsonStep1">
         <div class="btns-view">
             <el-button>获取原始点位当前值</el-button>
-            <el-button>导出Excel模板</el-button>
-            <el-button>导入Excel</el-button>
+            <el-button @click="downloadExcel = true">导出Excel模板</el-button>
+            <el-button @click="updateExcel = true">导入Excel</el-button>
             <el-button @click="addRow">新增行</el-button>
+            <el-button @click="downData">下载数据</el-button>
             <el-button @click="saveData">保存</el-button>
             <el-checkbox v-model="checked">只显示使用的原始点位</el-checkbox>
         </div>
@@ -20,6 +21,8 @@
                 <el-button type="text" @click="download">下载模板</el-button>
             </div>
         </own-dialog>
+        <own-dialog :width="'580px'" :index="true" title="导出excel模板" :dialogVisible="updateExcel" @cancel="close">
+        </own-dialog>
         <div class="center">
             <pagination :page="pages" @change="changePage"></pagination>
         </div>
@@ -45,6 +48,7 @@
         createPoint,
         downloadTemplete
     } from "@/fetch/point_http"
+    import axios from 'axios'
     export default {
         data() {
             return {
@@ -55,7 +59,7 @@
                 localtionDialog: false,
                 renderData: {},
                 allData: [],
-                pages:{
+                pages: {
                     size: 10,
                     sizes: [10, 30, 50, 100],
                     total: 0,
@@ -65,8 +69,9 @@
                     currentPage: 0,
                     size: 10
                 },
-                downloadExcel: true,
-                isLoading: false
+                downloadExcel: false,
+                isLoading: false,
+                updateExcel: false,
             }
         },
         computed: {
@@ -88,21 +93,49 @@
         },
         methods: {
             //关闭弹窗
-            close(){
+            close() {
                 this.localtionDialog = false
                 this.downloadExcel = false
+                this.updateExcel = false
+            },
+            downData() {
+                axios({
+                    method: 'post',
+                    url: `/pointconfig/point/${this.protocolType}/pointlist-export`,
+                    data: {DataSourceId: this.datasourceId},
+                    responseType: 'blob',
+                    headers:{ProjectId: this.projectId}
+                }).then(function(res) {
+                    var blob = new Blob([res.data], {
+                        type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'
+                    });
+                    var fileName = res.headers['content-disposition'];
+                    if (fileName)
+                        fileName = fileName.substring(fileName.indexOf('=') + 1);
+                    if ('download' in document.createElement('a')) { // 非IE下载
+                        const elink = document.createElement('a')
+                        elink.download = fileName
+                        elink.style.display = 'none'
+                        elink.href = URL.createObjectURL(blob)
+                        document.body.appendChild(elink)
+                        elink.click()
+                        URL.revokeObjectURL(elink.href) // 释放URL 对象
+                        document.body.removeChild(elink)
+                    } else { // IE10+下载
+                        navigator.msSaveBlob(blob, fileName)
+                    }
+                }).catch(function(err) {
+                    console.dirxml(err);
+                })
             },
-
             //下载excel模板
-            download(){
-                downloadTemplete({
-                    data: {
-                        DataSourceId: this.datasourceId,
-                    },
-                    type: this.protocolType
-                },{
+            download() {
+                axios({
+                    method: 'post',
+                    url: `/pointconfig/point/${this.protocolType}/template-export`,
+                    data: {},
                     responseType: 'blob'
-                },res => {
+                }).then(function(res) {
                     var blob = new Blob([res.data], {
                         type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'
                     });
@@ -121,33 +154,62 @@
                     } else { // IE10+下载
                         navigator.msSaveBlob(blob, fileName)
                     }
+                }).catch(function(err) {
+                    console.dirxml(err);
                 })
+                // downloadTemplete({
+                //     data: {
+                //         DataSourceId: this.datasourceId,
+                //     },
+                //     type: this.protocolType
+                // },{
+                //     responseType: 'blob'
+                // },res => {
+                //     var blob = new Blob([res.data], {
+                //         type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'
+                //     });
+                //     var fileName = res.headers['content-disposition'];
+                //     if (fileName)
+                //         fileName = fileName.substring(fileName.indexOf('=') + 1);
+                //     if ('download' in document.createElement('a')) { // 非IE下载
+                //         const elink = document.createElement('a')
+                //         elink.download = fileName
+                //         elink.style.display = 'none'
+                //         elink.href = URL.createObjectURL(blob)
+                //         document.body.appendChild(elink)
+                //         elink.click()
+                //         URL.revokeObjectURL(elink.href) // 释放URL 对象
+                //         document.body.removeChild(elink)
+                //     } else { // IE10+下载
+                //         navigator.msSaveBlob(blob, fileName)
+                //     }
+                // })
             },
             //点击表格
-            clickTable(info,row){
+            clickTable(info, row) {
                 let activeCell = this.hot.getActiveEditor()
                 this.renderData = info
                 console.log(activeCell)
-                if(activeCell.prop == "LocationFlag"){
+                if (activeCell.prop == "LocationFlag") {
                     this.localtionDialog = true
                 }
             },
             addRow() {
-                if(!!this.allData.length){
+                if (!!this.allData.length) {
                     let data = this.hot.getSourceData()
                     data.unshift({})
                     this.hot.loadData(data)
                     this.hot.updateSettings({
                         maxRows: data.length
-                    }) 
-                }else{
+                    })
+                } else {
                     this.allData = [{}]
                     this.createHot()
                 }
             },
             //页面发生更改
-            changePage(){
-                if(!this.changeFlag){
+            changePage() {
+                if (!this.changeFlag) {
                     //发生更改,提示是否保存
                     this.$confirm('存在数据未保存, 是否继续?', '提示', {
                         confirmButtonText: '确定',
@@ -160,7 +222,7 @@
                         this.pages.size = this.oldPage.size
                         return false
                     });
-                }else{
+                } else {
                     this.getData()
                 }
             },
@@ -191,7 +253,7 @@
                 })
             },
             //创建实例
-            createHot(){
+            createHot() {
                 let header, width, settings
                 header = getHeaderSetting(this.protocolType)
                 settings = {
@@ -202,10 +264,10 @@
                     rowHeights: 30,
                     maxRows: this.allData.length
                 }
-                if(!this.allData.length){
+                if (!this.allData.length) {
                     return false
                 }
-                this.$nextTick( _ => {
+                this.$nextTick(_ => {
                     this.hot = this.$refs.handsontable.init(settings)
                     console.log(this.hot)
                 })
@@ -222,7 +284,8 @@
                 if (!!this.hot) {
                     console.log(this.hot.getSourceData())
                     let data = this.hot.getSourceData(),
-                        updateList = [],arr1 = [],
+                        updateList = [],
+                        arr1 = [],
                         createList = [];
                     data.map(item => {
                         // console.log(item.LocationFlag,1111)
@@ -240,7 +303,7 @@
                             createList.push(item)
                         }
                     })
-                    console.log(updateList,arr1, "updateList")
+                    console.log(updateList, arr1, "updateList")
                     if (updateList.length) {
                         this.update(updateList)
                     }
@@ -263,11 +326,11 @@
             },
             async create(obj) {
                 console.log(obj)
-                for(let key in obj){
-                    if(key == "LocationFlag" && obj[key] == ""){
+                for (let key in obj) {
+                    if (key == "LocationFlag" && obj[key] == "") {
                         obj[key] = []
                     }
-                    if(obj[key] === ""){
+                    if (obj[key] === "") {
                         obj[key] = null
                     }
                 }

+ 40 - 0
src/views/system/auth/index.vue

@@ -0,0 +1,40 @@
+<template>
+    <div>
+        <h4>请稍候...</h4>
+    </div>
+</template>
+<script>
+import { mapGetters, mapMutations } from 'vuex'
+import adminapi from '@/api/system/admin'
+import authutils from '@/utils/authutils'
+export default {
+    name: 'index',
+    props: [],
+    data() {
+        return {}
+    },
+    created() {
+        // console.log('--------------------- index created')
+        // console.log(this.$route.query)
+        let token = this.$route.query.token
+        this.$store.commit('setSsoToken', token)   
+             
+        this.$store.dispatch('layout/loadUserInfo').then(resp => {
+            console.log('store dispatch result ', resp)
+            if (resp.result == 'success') {
+                let lastRoute = this.$store.getters['lastRoute']
+                console.log('last route ', lastRoute)
+                if (lastRoute) {
+                    this.$router.replace(lastRoute)
+                } else {
+                    this.$router.replace('/')
+                }
+            } else {
+                authutils.toLoginPage()
+            }
+        })
+    },
+    mounted() {},
+    components: {}
+}
+</script>

+ 23 - 0
src/views/system/nouser/index.vue

@@ -0,0 +1,23 @@
+<template>
+    <div>
+        <h4>用户未授权,请联系管理员!</h4>
+    </div>
+</template>
+<script>
+export default {
+    name: 'index',
+    props: [],
+    data() {
+        return {}
+    },
+    computed: {},
+    methods: {},
+    created() {
+        console.log('--------------------- index created')
+    },
+    mounted() {},
+    components: {}
+}
+</script>
+<style lang='scss' scoped>
+</style>

+ 3 - 0
src/views/system/pwd/ChangePwd.vue

@@ -93,6 +93,9 @@ export default {
         resetForm(formName) {
             this.$refs[formName].resetFields()
         }
+    },
+    created() {
+        this.$store.dispatch('setBreadcrumb', [{ label: '修改密码' }])
     }
 }
 </script>

+ 9 - 4
src/views/system/role/RoleList.vue

@@ -1,11 +1,11 @@
 <template>
     <table-page-template>
         <el-form :inline='true' slot='form' size='mini'>
-            <el-form-item label='用户'>
-                <el-input class='input' v-model.trim='searchValue' placeholder='请输入name进行查询' clearable></el-input>
+            <el-form-item label='角色'>
+                <el-input class='input' v-model.trim='searchValue' placeholder='请输入角色名进行查询' clearable></el-input>
             </el-form-item>
             <el-form-item>
-                <el-button type='primary' @click='query'>查询</el-button>
+                <el-button v-if='hasPermission("system:role:query")' type='primary' @click='query'>查询</el-button>
                 <el-button type='primary' @click='editRole(null)'>创建角色</el-button>
             </el-form-item>
         </el-form>
@@ -53,7 +53,7 @@ export default {
             this.$refs['roleEdit'].show(row)
         },
         editAuth(row) {
-            this.$refs['roleManage'].show()
+            this.$refs['roleManage'].show(row.id)
         },
         deleteRole(row) {
             let opt = {
@@ -79,6 +79,11 @@ export default {
     created() {
         this.query()
     },
+    beforeRouteEnter(to, from, next) {
+        next(vm => {
+            vm.query()
+        })
+    },
     components: {
         RoleEdit,
         RoleManage

+ 22 - 4
src/views/system/role/RoleManage.vue

@@ -36,12 +36,14 @@
 </template>
 
 <script>
+import roleapi from '@/api/system/role'
 import menus from '@/data/menus'
 import utils from './eleTreeUtils'
 export default {
     name: 'ele-tree',
     data() {
         return {
+            roleId: null,
             dialogVisible: false,
             treeProps: {
                 label: 'name'
@@ -52,7 +54,14 @@ export default {
         }
     },
     methods: {
-        show() {
+        show(roleId) {
+            this.roleId = roleId
+            console.log('edit role id = ', roleId)
+            roleapi.getOperations(roleId).then(resp => {
+                console.log('role opts ', resp)
+                this.permissions = resp.data ? resp.data : []
+                this.init()
+            })
             this.dialogVisible = true
         },
         changeCheckBox(node, data) {
@@ -123,14 +132,23 @@ export default {
                     })
                 }
             })
-            console.log(arr)
+            roleapi.setOperations({ roleId: this.roleId, opts: arr }).then(resp => {
+                if (resp.result == 'success') {
+                    this.$message.success('保存成功')
+                    this.dialogVisible = false
+                } else {
+                    this.$message.error('保存失败')
+                }
+            })
         },
         isCheckBasic() {
             utils.changeChecked(this.data)
         },
         init() {
-            console.log('menus = ', menus)
-            let _menus = menus.demoMenus
+            let _menus = []
+            if (process.env.NODE_ENV != 'production') {
+                _menus = _menus.concat(menus.demoMenus)
+            }
             _menus = _menus.concat(menus.menus)
             let arr = utils.initCheckboxList(_menus, this.permissions)
             //获取默认选中

+ 7 - 2
src/views/system/user/UserList.vue

@@ -2,11 +2,11 @@
     <table-page-template>
         <el-form :inline='true' :model='queryData' slot='form' size='mini'>
             <el-form-item label='用户'>
-                <el-input v-model.trim='queryData.username'></el-input>
+                <el-input v-model.trim='queryData.username' placeholder='请输入用户名进行查询' clearable></el-input>
             </el-form-item>
             <el-form-item>
                 <el-button type='primary' @click='query'>查询</el-button>
-                <el-button type='primary' @click='openAdd(null)'>新增</el-button>
+                <el-button v-if='hasPermission("system:user:create")' type='primary' @click='openAdd(null)'>创建用户</el-button>
             </el-form-item>
         </el-form>
         <el-table :data='pageData.users' border stripe slot='table'>
@@ -75,6 +75,11 @@ export default {
     created() {
         this.query()
     },
+    beforeRouteEnter(to, from, next) {
+        next(vm => {
+            vm.query()
+        })
+    },
     components: {
         'user-add': UserAdd
     }