Commit b751cb9c by 无尘

feat: 增加编辑管理员

parent 3ec128f8
......@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2020-07-21 10:10:57
* @LastEditors: 无尘
* @LastEditTime: 2020-08-04 12:47:24
* @LastEditTime: 2020-08-05 10:35:14
-->
<!--
门店绑定-选择分组
......@@ -116,15 +116,15 @@ export default {
return false
} */
if(!!e.children) {
// 父级已被绑定,子级要红色显示
// 父级已被绑定,子级要红色显示(暂时去掉)
const className = document.getElementById(e.storeGroupId).previousElementSibling.children[0].className;
const parentNode = !!that.$refs.groupTree.getNode(e.storeGroupId) ? that.$refs.groupTree.getNode(e.storeGroupId).parent : '';
const checkFlag = checkedKeys.checkedKeys.includes(e.storeGroupId);
// 选择并且父级已绑定
if (className.includes('is-checked') && !!parentNode &&parentNode.data.bindFlag == 1) {
document.getElementById(e.storeGroupId).previousElementSibling.children[0].children[0].style.borderColor = '#f5222d';
document.getElementById(e.storeGroupId).previousElementSibling.children[0].children[0].style.backgroundColor = '#f5222d';
// document.getElementById(e.storeGroupId).previousElementSibling.children[0].children[0].style.borderColor = '#f5222d';
// document.getElementById(e.storeGroupId).previousElementSibling.children[0].children[0].style.backgroundColor = '#f5222d';
}/* else {
document.getElementById(e.storeGroupId).previousElementSibling.children[0].children[0].style.borderColor = '#dcdfe6';
document.getElementById(e.storeGroupId).previousElementSibling.children[0].children[0].style.backgroundColor = '#ffffff';
......@@ -162,12 +162,11 @@ export default {
that.$emit('checkGroupIds', []);
}
that.$nextTick(()=> {
// 被禁用时的红色
// 被禁用时的红色,去掉样式
const nodes = document.querySelectorAll('.el-checkbox__input');
if (!!nodes && !!nodes.length) {
nodes.forEach(ele => {
if (ele.className.includes('is-checked')&& ele.className.includes('is-disabled')) {
console.log(ele.children[0])
ele.children[0].setAttribute('style', '');
}
})
......
<!--
* @Descripttion: 当前组件信息
* @version: 1.0.0
* @Author: 无尘
* @Date: 2019-03-20 14:36:37
* @LastEditors: 无尘
* @LastEditTime: 2020-08-05 12:32:01
-->
<template>
<div>新建、编辑管理员</div>
<div class="my-customer-wrap common-set-wrap">
<nav-crumb :navpath="navpath"> </nav-crumb>
<div class="right-content">
<div class="right-box" style="min-height: calc(100vh - 104px);">
<div class="apps-content flex" style="min-height: calc(100vh - 104px);">
<div class="apps-content-right">
<el-form :model="adminForm" :rules="rules" ref="adminForm" label-width="100px" >
<el-form-item label="活动名称" prop="adminList">
<div class="admin-list-wrap">
<div class="el-select store-item-content" @click="showStore(1)">
<div v-if="!!adminForm.adminList.length" class="el-select__tags">
<span style="display:block;">
<template v-for="(item, index) in adminForm.adminList">
<span class="el-tag el-tag--info el-tag--small" :key="index+'bind'">
<span class="el-select__tags-text">{{ item.staffName || '--' }}</span>
<i class="el-tag__close el-icon-close" @click.stop="delStore(index, adminForm.adminList)"></i>
</span>
</template>
</span>
</div>
<div v-if="!adminForm.adminList.length" class="add-admin-btn font-14 color-606266 cursor-pointer" @click="addAdmin">
<span class="iconfont icontianjiajiahaowubiankuang font-12"></span><span class="p-l-10">添加</span>
</div>
</div>
</div>
</el-form-item>
<el-form-item label="活动区域" prop="tableData">
<el-table ref="multipleTable" v-loading="loading" :data="tableData" tooltip-effect="dark" style="width: 100%">
<el-table-column label="商户名称" width="150">
<template slot-scope="scope">
{{scope.row.enterpriseName || '--'}}
</template>
</el-table-column>
<el-table-column label="授权范围">
<template slot-scope="scope">
<div class="el-select store-item-content" @click="showStore(1)">
<div v-if="!!scope.row.enterpriseList.length" class="el-select__tags">
<span style="display:block;">
<template v-for="(item, index) in scope.row.enterpriseList">
<span class="el-tag el-tag--info el-tag--small" :key="index+'bind'">
<span class="el-select__tags-text">{{ item.storeInfoName || item.storeGroupName }}</span>
<i class="el-tag__close el-icon-close" @click.stop="delStore(index, scope.row.enterpriseList)"></i>
</span>
</template>
</span>
</div>
<div v-if="!scope.row.enterpriseList.length" class="add-admin-btn font-14 color-606266 cursor-pointer" @click="addAdmin">
<span class="iconfont icontianjiajiahaowubiankuang font-12"></span><span class="p-l-10">添加</span>
</div>
</div>
</template>
</el-table-column>
</el-table>
</el-form-item>
</el-form>
</div>
</div>
</div>
</div>
<!-- <vue-gic-footer></vue-gic-footer> -->
</div>
</template>
<script>
import navCrumb from '@/components/nav/nav.vue';
import fetch from '@/api/merchantAuth.js';
const { getAuthEnterprise } = fetch;
// import { _debounce } from '@/common/js/public';
export default {
name: 'edit-admin'
}
name: 'authMerchant',
data() {
return {
// 面包屑参数
navpath: [
{
name: '管理员',
path: '/admin-list'
},
{
name: !!this.$route.query.staffId ? '编辑管理员':'新建管理员',
path: ''
}
],
wxEnterpriseId: localStorage.getItem('haoBanUser') ? JSON.parse(localStorage.getItem('haoBanUser')).wxEnterpriseId : '',
adminName: !!this.$route.query.staffName ? this.$route.query.staffName : '',
adminForm: {
adminList: [],
tableData: [],
},
rules: {
adminList: [
{ type: 'array', required: true, message: '请选择管理员', trigger: 'change' },
],
tableData: [
{ type: 'array', required: true, message: '请选择授权范围', trigger: 'change' },
]
},
tableData: [],
};
},
computed: {},
methods: {
/**
* 路由跳转
*/
changeRoute(path) {
this.$router.push(path);
},
/**
* 获取列表数据
*/
getTableList(val) {
const that = this;
let para = {
wxEnterpriseId: that.wxEnterpriseId
};
getAuthEnterprise(para)
.then(res => {
that.tableData = res.result || [];
})
.catch(function(error) {
});
}
},
watch: {
},
mounted() {
const that = this;
that.$emit('showAsideMenu', false);
if (that.$route.query.staffId) {
that.getTableList();
}
document.documentElement.style.backgroundColor = '#f0f2f5';
},
destroyed() {
document.documentElement.style.backgroundColor = '#fff';
},
components: {
navCrumb
}
};
</script>
<style type="text/less" lang="less" scoped>
.my-customer-wrap {
height: 100%;
.apps-content-right {
width: 100%;
.admin-list-wrap {
.add-admin-btn {
width: 114px;
height: 32px;
line-height: 32px;
text-align: center;
border: 1px solid rgba(228,231,237,1);
}
.store-item-content {
position: relative;
width: 302px;
height: 32px;
overflow: hidden;
white-space: nowrap;
border-radius: 2px;
border: 1px solid #c4c6cf;
cursor: pointer;
box-sizing: border-box;
.el-select__tags {
max-width: 348px;
white-space: nowrap;
overflow: hidden;
}
}
}
}
}
</style>
......@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2019-03-20 14:36:37
* @LastEditors: 无尘
* @LastEditTime: 2020-08-03 14:01:51
* @LastEditTime: 2020-08-05 10:59:35
-->
<template>
<div class="daily-set-wrap ">
......@@ -144,7 +144,7 @@ export default {
/**
* 删除
*/
toDel(index, row) {
toDel(row) {
const that = this;
that
.$confirm('确定删除当前自建应用?', '提示', {
......@@ -153,11 +153,11 @@ export default {
type: 'warning'
})
.then(() => {
that.postDel(index, row);
that.postDel( row);
})
.catch(() => {});
},
postDel(index, row) {
postDel(row) {
const that = this;
let para = {
secretId: row.secretId
......
......@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2019-03-20 14:36:37
* @LastEditors: 无尘
* @LastEditTime: 2020-07-21 13:42:01
* @LastEditTime: 2020-08-05 12:23:04
-->
<template>
<div class="my-customer-wrap common-set-wrap">
......@@ -12,13 +12,13 @@
<div class="enterprise-wrap__body">
<div id="content" class="content">
<div class="content-body">
<div class="right-content border-box">
<div class="right-content border-box" :style="{padding: showAsideMenu ? '20px': '0 20px 20px 20px'}">
<div class="right-box" style="min-height: calc(100vh - 86px);">
<div class="apps-content flex" style="min-height: calc(100vh - 86px);">
<div class="apps-content-left w-157" style="min-height: calc(100vh - 86px)" v-show="showAsideMenu">
<common-detail-left :tabListData="tabListData" :activeSelTab="activeSelTab" @setSelectTab="setSelectTab"></common-detail-left>
</div>
<div class="apps-content-right border-box" :style="{width: showAsideMenu ? 'calc(100% - 157px)' : '100%'}">
<div class="apps-content-right border-box" :style="{width: showAsideMenu ? 'calc(100% - 157px)' : '100%',paddingLeft: showAsideMenu ? '10px': '0'}">
<transition name="fade" mode="out-in">
<router-view :brandId="activeBrand" :activeGroupId="activeGroup" :tabType="activeTab" @showTab="showTab" @showAsideMenu="show => showAsideMenu = show"></router-view>
</transition>
......@@ -291,7 +291,7 @@ export default {
}
}
.apps-content-right {
padding-left: 10px;
// padding-left: 10px;
background: #f0f2f5;
.daily-set-wrap {
height: 100%;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment