|
@@ -10,13 +10,13 @@
|
|
|
<h4 class="vongi-center">您可以将常用的应用添加到主页</h4>
|
|
|
<ul class="mui-table-view mui-grid-view mui-grid-9">
|
|
|
<!-- <draggable element="ul" v-model="menuList" :options="{draggable:'.mui-table-view-cell'}"> -->
|
|
|
- <li draggable="true" v-for="(item,index) in menuList" class="mui-table-view-cell mui-media mui-col-xs-3">
|
|
|
- <!-- <router-link :to="{name:item.iconRoute,query:item.iconParam}"> -->
|
|
|
- <img :src="requirePic(item.iconPic)" />
|
|
|
- <div class="mui-media-body" v-text="item.iconName"></div>
|
|
|
- <!-- </router-link> -->
|
|
|
- <span slot="footer" @click="del(item.id,index)" class="mui-icon mui-icon-closeempty vongi-close"></span>
|
|
|
- </li>
|
|
|
+ <li draggable="true" v-for="(item,index) in menuList" class="mui-table-view-cell mui-media mui-col-xs-3">
|
|
|
+ <!-- <router-link :to="{name:item.iconRoute,query:item.iconParam}"> -->
|
|
|
+ <img :src="requirePic(item.iconPic)" />
|
|
|
+ <div class="mui-media-body" v-text="item.iconName"></div>
|
|
|
+ <!-- </router-link> -->
|
|
|
+ <span slot="footer" @click="del(item.id,index)" class="mui-icon mui-icon-closeempty vongi-close"></span>
|
|
|
+ </li>
|
|
|
<!-- </draggable> -->
|
|
|
</ul>
|
|
|
</div>
|
|
@@ -95,9 +95,9 @@
|
|
|
}
|
|
|
},
|
|
|
//获取所有的功能列表包括常用功能
|
|
|
- getAllFunList() {
|
|
|
+ getFunList() {
|
|
|
this.isLoading = true;
|
|
|
- API_User.getAllFunList().then(response => {
|
|
|
+ API_User.getFunList().then(response => {
|
|
|
this.isLoading = false;
|
|
|
this.allFunList = this.resetAllFunList(response.allIcon);
|
|
|
}).catch(error => {
|
|
@@ -129,9 +129,13 @@
|
|
|
},
|
|
|
//添加图标
|
|
|
add(indy, index) {
|
|
|
- this.menuList.push(this.allFunList[indy]['list'][index])
|
|
|
- this.allFunList[indy]['list'][index]['is_show'] = 0;
|
|
|
- this.allFunList[indy]['cun_num']--;
|
|
|
+ if (this.menuList.length < 7) {
|
|
|
+ this.menuList.push(this.allFunList[indy]['list'][index])
|
|
|
+ this.allFunList[indy]['list'][index]['is_show'] = 0;
|
|
|
+ this.allFunList[indy]['cun_num']--;
|
|
|
+ } else {
|
|
|
+ mui.toast('最多只能添加7个常用服务');
|
|
|
+ }
|
|
|
},
|
|
|
//减少图标
|
|
|
del(id, index) {
|
|
@@ -171,7 +175,7 @@
|
|
|
},
|
|
|
},
|
|
|
mounted() {
|
|
|
- this.getAllFunList()
|
|
|
+ this.getFunList()
|
|
|
},
|
|
|
destroyed() {
|
|
|
|