Преглед на файлове

1. 更新element-ui 2.2.1 用于解决tree半选中状态项不能传给后台接口问题。
2. 修改本地开发找不到baseUrl问题。

daxiong.yang преди 7 години
родител
ревизия
5be5a0010c
променени са 3 файла, в които са добавени 15 реда и са изтрити 16 реда
  1. 1 7
      index.html
  2. 7 7
      package.json
  3. 7 2
      src/views/role/add-or-update.vue

+ 1 - 7
index.html

18
    </script>
18
    </script>
19
  <% }else { %>
19
  <% }else { %>
20
    <!-- 开发环境 -->
20
    <!-- 开发环境 -->
21
    <script>
22
      (function () {
23
        var s = document.createElement('script');
24
        s.src = './static/config/index.js?v=' + new Date().getTime();
25
        document.getElementsByTagName('head')[0].appendChild(s);
26
      })();
27
    </script>
21
    <script src="./static/config/index.js?v=<%=new Date().getTime()%>"></script>
28
  <% } %>
22
  <% } %>
29
</head>
23
</head>
30
<body>
24
<body>

+ 7 - 7
package.json

17
    "axios": "0.17.1",
17
    "axios": "0.17.1",
18
    "babel-plugin-component": "0.10.1",
18
    "babel-plugin-component": "0.10.1",
19
    "babel-polyfill": "6.26.0",
19
    "babel-polyfill": "6.26.0",
20
    "element-ui": "2.1.0",
21
    "gulp": "^3.9.1",
22
    "gulp-concat": "^2.6.1",
23
    "gulp-load-plugins": "^1.5.0",
24
    "gulp-replace": "^0.6.1",
25
    "gulp-shell": "^0.6.5",
20
    "element-ui": "2.2.1",
21
    "gulp": "3.9.1",
22
    "gulp-concat": "2.6.1",
23
    "gulp-load-plugins": "1.5.0",
24
    "gulp-replace": "0.6.1",
25
    "gulp-shell": "0.6.5",
26
    "vue": "2.5.2",
26
    "vue": "2.5.2",
27
    "vue-cookie": "1.1.4",
27
    "vue-cookie": "1.1.4",
28
    "vue-router": "3.0.1",
28
    "vue-router": "3.0.1",
52
    "eslint-plugin-html": "3.0.0",
52
    "eslint-plugin-html": "3.0.0",
53
    "eslint-plugin-import": "2.7.0",
53
    "eslint-plugin-import": "2.7.0",
54
    "eslint-plugin-node": "5.2.0",
54
    "eslint-plugin-node": "5.2.0",
55
    "eslint-plugin-promise": "3.4.0",
55
    "eslint-plugin-promise": "3.5.0",
56
    "eslint-plugin-standard": "3.0.1",
56
    "eslint-plugin-standard": "3.0.1",
57
    "eventsource-polyfill": "0.9.6",
57
    "eventsource-polyfill": "0.9.6",
58
    "extract-text-webpack-plugin": "3.0.0",
58
    "extract-text-webpack-plugin": "3.0.0",

+ 7 - 2
src/views/role/add-or-update.vue

49
          roleName: [
49
          roleName: [
50
            { required: true, message: '角色名称不能为空', trigger: 'blur' }
50
            { required: true, message: '角色名称不能为空', trigger: 'blur' }
51
          ]
51
          ]
52
        }
52
        },
53
        tempKey: -666666 // 临时key, 用于解决tree半选中状态项不能传给后台接口问题. # 待优化
53
      }
54
      }
54
    },
55
    },
55
    methods: {
56
    methods: {
69
              if (data && data.code === 0) {
70
              if (data && data.code === 0) {
70
                this.dataForm.roleName = data.role.roleName
71
                this.dataForm.roleName = data.role.roleName
71
                this.dataForm.remark = data.role.remark
72
                this.dataForm.remark = data.role.remark
73
                var idx = data.role.menuIdList.indexOf(this.tempKey)
74
                if (idx !== -1) {
75
                  data.role.menuIdList.splice(idx, data.role.menuIdList.length - idx)
76
                }
72
                this.$refs.menuListTree.setCheckedKeys(data.role.menuIdList)
77
                this.$refs.menuListTree.setCheckedKeys(data.role.menuIdList)
73
              }
78
              }
74
            })
79
            })
83
              'roleId': this.dataForm.id || undefined,
88
              'roleId': this.dataForm.id || undefined,
84
              'roleName': this.dataForm.roleName,
89
              'roleName': this.dataForm.roleName,
85
              'remark': this.dataForm.remark,
90
              'remark': this.dataForm.remark,
86
              'menuIdList': this.$refs.menuListTree.getCheckedKeys()
91
              'menuIdList': [].concat(this.$refs.menuListTree.getCheckedKeys(), [this.tempKey], this.$refs.menuListTree.getHalfCheckedKeys())
87
            }
92
            }
88
            var tick = !this.dataForm.id ? API.role.add(params) : API.role.update(params)
93
            var tick = !this.dataForm.id ? API.role.add(params) : API.role.update(params)
89
            tick.then(({data}) => {
94
            tick.then(({data}) => {