system-phone 3.1.8-1-t9 → 3.1.8-1-t11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -82,8 +82,11 @@ let asyncReady = async function (self, url) {
82
82
  mod_url = `${url}/${dir_module[mod].name}/rs/vue`
83
83
  }
84
84
  const config = await Vue.resetget(mod_url, {data: {}}, {resolveMsg: null, rejectMsg: null})
85
- self.delConfigKey(config.data)
86
- vueConfig[dir_module[mod].name] = config.data;
85
+ // 拿到的配置有问题就跳过
86
+ if(config.data instanceof Object){
87
+ self.delConfigKey(config.data)
88
+ vueConfig[dir_module[mod].name] = config.data;
89
+ }
87
90
  }
88
91
  }
89
92
  that.$set('config', vueConfig)
@@ -168,20 +171,23 @@ export default {
168
171
  },
169
172
  // 对资源菜单进行排序
170
173
  sortFunctions (val) {
171
- if (val && val.length > 0) {
172
- for (var i = 0; i < val.length - 1; i++) {
173
- for (var j = 0; j < val.length - 1 - i; j++) {
174
- if (val[j].position > val[j + 1].position) {
175
- var temp = val[j + 1]
176
- val[j + 1] = val[j]
177
- val[j] = temp
178
- }
179
- }
174
+ this.sortArr(val)
175
+ val.forEach((item)=>{
176
+ if(item.children && Array.isArray(item.children)){
177
+ this.sortArr(item.children)
180
178
  }
181
- return val
182
- }
179
+ })
183
180
  return val
184
181
  },
182
+ sortArr(val){
183
+ val.sort((itemA, itemB)=>{
184
+ if(itemA.position !== itemB.position){
185
+ return itemA.position - itemB.position
186
+ }else{
187
+ return itemA.id - itemB.id
188
+ }
189
+ })
190
+ },
185
191
  // 记住密码选中/未选中
186
192
  showoff () {
187
193
  this.showsave = false