|
@@ -16,15 +16,29 @@
|
|
|
<view class="message">
|
|
|
<view class="radiolist">
|
|
|
|
|
|
- <view class="uni-list">
|
|
|
- <checkbox-group @change="checkboxChange">
|
|
|
- <label class="uni-list-cell uni-list-cell-pd checked-bar" v-for="item in items" :key="item.value">
|
|
|
+ <view class="uni-list father-list">
|
|
|
+ <checkbox-group @change="fatherChange">
|
|
|
+ <label class="uni-list-cell uni-list-cell-pd checked-bar" v-for="fatheritem in list" :key="fatheritem.menuId">
|
|
|
<view class="main-checked-list">
|
|
|
- <checkbox :value="item.value" :checked="item.checked" />
|
|
|
- <view class="title">{{ item.name }}</view>
|
|
|
+ <checkbox :value="fatheritem.value" :checked="item.checked"/>
|
|
|
+ <view class="title">{{ fatheritem.name }}</view>
|
|
|
</view>
|
|
|
- <image v-if="!item.checked" class="moreicon" src="../../static/images/moreicon.png"></image>
|
|
|
- <image v-if="item.checked" class="downicon" src="../../static/images/downmoreicon.png"></image>
|
|
|
+ <!-- 子权限 -->
|
|
|
+ <view class="childemenu">
|
|
|
+ <view class="uni-list son-list">
|
|
|
+ <checkbox-group @change="sonChange" class="son-checked-warp">
|
|
|
+ <label class="uni-list-cell uni-list-cell-pd son-bar" v-for="sonitem in fatheritem.children" :key="sonitem.value">
|
|
|
+ <view class="son-checked-list">
|
|
|
+ <checkbox style="transform:scale(0.7)" :value="sonitem.value" :checked="item.checked"/>
|
|
|
+ <view class="son-title">{{sonitem.name}}</view>
|
|
|
+ </view>
|
|
|
+ </label>
|
|
|
+ </checkbox-group>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <image v-if="!item.checked && item.children" class="moreicon" src="../../static/images/moreicon.png"></image>
|
|
|
+ <image v-if="item.checked && item.children" class="downicon" src="../../static/images/downmoreicon.png"></image>
|
|
|
</label>
|
|
|
</checkbox-group>
|
|
|
</view>
|
|
@@ -41,59 +55,27 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import editclassifyVue from '../goods/editclassify.vue';
|
|
|
export default {
|
|
|
name: 'mask',
|
|
|
props: {
|
|
|
- txt: {
|
|
|
- type: String,
|
|
|
- default: '该订单已核销',
|
|
|
+ list:{
|
|
|
+ type:Array,
|
|
|
+ default: [],
|
|
|
},
|
|
|
- iconShow: {
|
|
|
- type: Boolean,
|
|
|
- default: false
|
|
|
+ hasList: {
|
|
|
+ type:Array,
|
|
|
+ default: []
|
|
|
}
|
|
|
},
|
|
|
data () {
|
|
|
//这里存放数据
|
|
|
return {
|
|
|
- checkedIndex: false,
|
|
|
- checkedSetting: false,
|
|
|
- checkedBasics: false,
|
|
|
- checkedVip: false,
|
|
|
- checkedGoods: false,
|
|
|
- checkedShop: false,
|
|
|
-
|
|
|
- items: [{
|
|
|
- value: 'index',
|
|
|
- name: '首页管理'
|
|
|
- },
|
|
|
- {
|
|
|
- value: 'setting',
|
|
|
- name: '系统管理',
|
|
|
- checked: 'true'
|
|
|
- },
|
|
|
- {
|
|
|
- value: 'bascis',
|
|
|
- name: '基础管理'
|
|
|
- },
|
|
|
- {
|
|
|
- value: 'Vip',
|
|
|
- name: '会员管理'
|
|
|
- },
|
|
|
- {
|
|
|
- value: 'goods',
|
|
|
- name: '商家管理'
|
|
|
- },
|
|
|
- {
|
|
|
- value: 'shop',
|
|
|
- name: '商品管理'
|
|
|
- }
|
|
|
- ]
|
|
|
+ roleArray: []
|
|
|
}
|
|
|
},
|
|
|
//方法集合
|
|
|
methods: {
|
|
|
- // 确认后
|
|
|
sureconver () {
|
|
|
this.$emit('isSureConver', true)
|
|
|
},
|
|
@@ -101,9 +83,31 @@ export default {
|
|
|
this.$emit('isSureConver', false)
|
|
|
},
|
|
|
|
|
|
- checkboxChange: function (e) {
|
|
|
+ // 显示已经拥有权限
|
|
|
+
|
|
|
+
|
|
|
+ // 父级权限选择
|
|
|
+ fatherChange (e) {
|
|
|
+ console.log(this.hasList);
|
|
|
+
|
|
|
console.log(e);
|
|
|
- let items = this.items,
|
|
|
+ let items = this.list
|
|
|
+ values = e.detail.value; // 选中的集合
|
|
|
+ for (let i = 0; i < items.length; ++i) {
|
|
|
+ const element = items[i]
|
|
|
+ if (values.includes(element.value)) {
|
|
|
+ this.$set(element, 'checked', true)
|
|
|
+ } else {
|
|
|
+ this.$set(element, 'checked', false)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ console.log(this.list);
|
|
|
+ },
|
|
|
+
|
|
|
+ // 子集权限选择
|
|
|
+ sonChange (e) {
|
|
|
+ console.log(e);
|
|
|
+ let items = this.list,
|
|
|
values = e.detail.value; // 选中的集合
|
|
|
for (let i = 0; i < items.length; ++i) {
|
|
|
const element = items[i]
|
|
@@ -114,8 +118,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- },
|
|
|
- onLoad () { },
|
|
|
+ }
|
|
|
};
|
|
|
</script>
|
|
|
<style lang='scss' scoped>
|
|
@@ -177,16 +180,20 @@ export default {
|
|
|
border-bottom-left-radius: 20upx;
|
|
|
border-bottom-right-radius: 20upx;
|
|
|
.message {
|
|
|
- padding: 50upx 60upx 0;
|
|
|
+ padding: 10upx 60upx 0;
|
|
|
overflow-y: scroll;
|
|
|
height: 670upx;
|
|
|
.radiolist {
|
|
|
- .uni-list {
|
|
|
+ .father-list {
|
|
|
.checked-bar {
|
|
|
display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ justify-content: flex-end;
|
|
|
+ padding-top: 45upx;
|
|
|
.main-checked-list{
|
|
|
- flex: 1;
|
|
|
display: flex;
|
|
|
+ width: 100%;
|
|
|
+ // flex: 1;
|
|
|
.title {
|
|
|
margin-left: 30upx;
|
|
|
color: #666666;
|
|
@@ -201,6 +208,31 @@ export default {
|
|
|
width: 27upx;
|
|
|
height: 19upx;
|
|
|
}
|
|
|
+ .childemenu {
|
|
|
+ width: 100%;
|
|
|
+ .son-checked-warp {
|
|
|
+ display: flex;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ padding-left: 40upx;
|
|
|
+ box-sizing: border-box;
|
|
|
+ .son-bar {
|
|
|
+ width: 45%;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ box-sizing: border-box;
|
|
|
+ &:nth-child(odd){
|
|
|
+ margin-right: 35upx;
|
|
|
+ }
|
|
|
+ .son-checked-list {
|
|
|
+ display: flex;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .son-title {
|
|
|
+ margin-left: 15upx;
|
|
|
+ color: #666666;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|