Commit 2c673d35 by 无尘

fix: 修改注释

parent 3062b898
......@@ -92,7 +92,10 @@ export default {
this.getRoleList();
},
methods: {
// 获取角色列表
/**
* @description: 获取角色列表
* @author: 无尘
*/
getRoleList() {
// roleType 1门店角色2管理员角色
roleList({ roleType: 2 }).then(res => {
......@@ -104,12 +107,20 @@ export default {
}
});
},
// 新建角色、编辑角色跳转
/**
* @description: 新建角色、编辑角色跳转
* @param {Object} roleData
* @author: 无尘
*/
onEditRole(roleData) {
const { roleId } = roleData || {};
this.$router.push(`/edit-role${roleId ? `?roleId=${roleId}` : ''}`);
},
// 切换角色菜单
/**
* @description: 切换角色菜单
* @param {Object} roleData
* @author: 无尘
*/
onChangeRole(roleData) {
this.activeRoleId = roleData.roleId;
this.getAdminList();
......@@ -120,7 +131,10 @@ export default {
}
this.getRoleList();
},
// 获取选中的角色下的管理员列表
/**
* @description: 获取选中的角色下的管理员列表
* @author: 无尘
*/
getAdminList() {
const { currentPage, pageSize } = this.pager;
const params = {
......@@ -135,10 +149,19 @@ export default {
this.adminList = result || [];
});
},
/**
* @description: 搜索
* @author: 无尘
*/
onSearch() {
this.pager.currentPage = 1;
this.getAdminList();
},
/**
* @description: 分页
* @param {Number} pageSize
* @author: 无尘
*/
onSizeChange(pageSize) {
this.pager.pageSize = pageSize;
this.onSearch();
......@@ -147,12 +170,20 @@ export default {
this.pager.currentPage = currentPage;
this.getAdminList();
},
// 添加管理员、管辖范围跳转
/**
* @description: 添加管理员、管辖范围跳转
* @param {Object} adminData
* @author: 无尘
*/
toEditAdmin(adminData) {
const { staffId, staffName } = adminData || {};
this.$router.push(`/edit-admin?roleId=${this.activeRoleId}${staffName ? `&staffName=${staffName}` : ''}${staffId ? `&staffId=${staffId}` : ''}`);
},
// 删除管理员
/**
* @description: 删除管理员
* @param {Object} adminData
* @author: 无尘
*/
onDelAdmin(adminData) {
const { staffName, staffId } = adminData;
this.$confirm(`确定删除【 ${staffName} 】吗?`, '提示', { type: 'warning' }).then(() => {
......
......@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2019-03-20 14:36:37
* @LastEditors: 无尘
* @LastEditTime: 2020-08-27 17:33:13
* @LastEditTime: 2020-09-25 14:06:52
-->
<template>
<div class="my-customer-wrap common-set-wrap">
......@@ -157,8 +157,9 @@ export default {
},
methods: {
/**
* 保存管理员
* @description: 保存管理员
* @param {String} formName
* @author: 无尘
*/
saveAdmin(formName) {
const that = this;
......@@ -221,8 +222,9 @@ export default {
});
},
/**
* 显示选择管理员
* @description: 显示选择管理员
* @returns {Boolean}
* @author: 无尘
*/
showAdmin() {
const that = this;
......@@ -233,9 +235,10 @@ export default {
that.showAdminFlag = true;
},
/**
* 删除已选管理员
* @description: 删除已选管理员
* @param {Number} index
* @param {Array} arr
* @author: 无尘
*/
delAdmin(index, arr) {
arr.splice(index, 1);
......@@ -249,9 +252,10 @@ export default {
that.adminForm.adminList = res;
},
/**
* 显示授权
* @description: 显示授权
* @param {Number} index
* @param {Object} row
* @author: 无尘
*/
showAuth(index, row){
const that = this;
......@@ -275,23 +279,26 @@ export default {
},
/**
* 删除已选授权
* @description: 删除已选授权
* @param {Number} index
* @param {Array} arr
* @author: 无尘
*/
delAuth(index, arr) {
arr.splice(index, 1);
},
/**
* 路由跳转
* @description: 路由跳转
* @param {String} path
* @author: 无尘
*/
changeRoute(path) {
this.$router.push(path);
},
/**
* 获取列表数据
* @description: 获取列表数据
* @author: 无尘
*/
getTableList() {
const that = this;
......
......@@ -95,7 +95,12 @@ export default {
}
},
methods: {
// 获取权限菜单列表
/**
* @description: 获取权限菜单列表
* @param {String} roleId
* @return {Function}
* @author: 无尘
*/
getMenuList(roleId) {
// roleType 1管理员,0门店
const params = { wxEnterpriseId: this.wxEnterpriseId, roleType: 1 };
......@@ -120,7 +125,11 @@ export default {
});
return Promise.all(prom);
},
// 获取角色详情
/**
* @description: 获取角色详情
* @param {String} roleId
* @author: 无尘
*/
getRoleDetail(roleId) {
roleDetail({ roleId }).then(res => {
let { roleId, roleName, menuIds } = res.result;
......@@ -181,7 +190,12 @@ export default {
return result;
}
},
// 将平铺的数据转为树形结构
/**
* @description: 将平铺的数据转为树形结构
* @param {Array} data
* @return {Array}
* @author: 无尘
*/
flatDataToTree(data) {
return data.filter(el => {
// 返回当前节点下的子节点
......@@ -204,9 +218,11 @@ export default {
const result = this.tabList.filter(el => el.appType == this.activeType);
return result[0].appIds;
},
// 保存选中的子节点id
// 将选中的子节点的id存在tabList对应元素的checkedId中
// 同时更新roleData中menuIds的数据
/**
* @description: 保存选中的子节点id,将选中的子节点的id存在tabList对应元素的checkedId中,同时更新roleData中menuIds的数据
* @param {String} checkedId
* @author: 无尘
*/
onCheckedChange(checkedId) {
let menuIds = [];
let flatMenu = [];
......@@ -247,8 +263,11 @@ export default {
return result;
}
},
// 切换应用的开启关闭状态
// 如果应用是关闭状态,需要将应用下的子菜单设置为禁用状态
/**
* @description: 切换应用的开启关闭状态,如果应用是关闭状态,需要将应用下的子菜单设置为禁用状态
* @param {Array} appIds
* @author: 无尘
*/
onAppOpenChange(appIds) {
this.tabList.some(el => {
if (el.appType == this.activeType) {
......@@ -282,7 +301,10 @@ export default {
});
}
},
// 新建、编辑角色的保存
/**
* @description: 新建、编辑角色的保存
* @author: 无尘
*/
onSave() {
this.$refs.roleData.validate(vali => {
if (!vali) return;
......
......@@ -46,16 +46,28 @@ export default {
};
},
methods: {
// 左侧一级节点改变时,切换右侧的树数据
/**
* @description: 左侧一级节点改变时,切换右侧的树数据
* @param {Object} menuData
* @author: 无尘
*/
onMenuChange(menuData) {
this.activeMenuId = menuData ? menuData.menuId : '';
this.treeData = menuData ? [ menuData ] : [];
},
// 点击树节点
/**
* @description: 点击树节点
* @author: 无尘
*/
onNodeClick() {
this.onChange(this.$refs.menuList.getCheckedKeys());
},
// 获取指定菜单及其所有子菜单的id
/**
* @description: 获取指定菜单及其所有子菜单的id
* @param {Array} menuList
* @returns {Array}
* @author: 无尘
*/
getAllMenuId(menuList) {
let result = [];
menuList.forEach(el => {
......@@ -66,7 +78,11 @@ export default {
});
return result;
},
// emit更新后的菜单id
/**
* @description: emit更新后的菜单id
* @param {Array} menuIds
* @author: 无尘
*/
onChange(menuIds) {
const activeChecked = {};
activeChecked[this.activeMenuId] = menuIds;
......
......@@ -106,9 +106,13 @@ export default {
this.getRoleDetail(roleId);
},
methods: {
/**
* @description: 获取权限数据
* @returns {Function}
* @author: 无尘
*/
initData() {
const prom = [];
// 获取权限数据
this.tabList.forEach(el => {
// appType 1好办后台2应用后台3好办小程序4小程序应用
// roleType 1管理员角色 2门店角色
......@@ -123,7 +127,11 @@ export default {
return Promise.all(prom);
},
// 获取角色相关的数据
/**
* @description: 获取角色相关的数据
* @param {String} roleId
* @author: 无尘
*/
getRoleDetail(roleId) {
// 获取角色权限配置、资源范围等数据
roleDetail({ roleId }).then(res => {
......@@ -215,7 +223,12 @@ export default {
const result = this.tabList.filter(el => el.appType == this.activeType);
return result[0].appIds;
},
// 将平铺的数据转为树形结构
/**
* @description: 将平铺的数据转为树形结构
* @param {Array} data
* @return {Array}
* @author: 无尘
*/
flatDataToTree(data) {
return data.filter(el => {
// 返回当前节点下的子节点
......@@ -226,9 +239,11 @@ export default {
return el.parentCode == '';
});
},
// 保存选中的子节点id
// 将选中的子节点的id存在tabList对应元素的checkedId中
// 同时更新roleData中menuIds的数据
/**
* @description: 保存选中的子节点id,将选中的子节点的id存在tabList对应元素的checkedId中,同时更新roleData中menuIds的数据
* @param {String} checkedId
* @author: 无尘
*/
onCheckedChange(checkedId) {
let menuIds = [];
let flatMenu = [];
......@@ -269,6 +284,11 @@ export default {
return result;
}
},
/**
* @description: 应用小程序权限
* @param {Array} appIds
* @author: 无尘
*/
onAppOpenChange(appIds) {
this.tabList.some(el => {
if (el.appType == this.activeType) {
......@@ -302,11 +322,19 @@ export default {
});
}
},
/**
* @description: 门店导购范围选择
* @author: 无尘
*/
onSeeTypeChange() {
if (this.roleData.seeType == 0) {
this.roleData.managerType = '0';
}
},
/**
* @description: 保存角色
* @author: 无尘
*/
onSave() {
this.$refs.roleData.validate(vali => {
if (!vali) return;
......
......@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2019-03-20 14:36:37
* @LastEditors: 无尘
* @LastEditTime: 2020-08-18 18:18:21
* @LastEditTime: 2020-09-25 14:29:44
-->
<template>
<div class="daily-set-wrap ">
......@@ -116,7 +116,8 @@ export default {
},
methods: {
/**
* 添加
* @description: 添加
* @author: 无尘
*/
addSecret() {
const that = this;
......@@ -124,8 +125,9 @@ export default {
that.editRow = {};
},
/**
* 编辑
* @description: 编辑
* @param {Object} row
* @author: 无尘
*/
toEdit(row) {
const that = this;
......@@ -144,8 +146,9 @@ export default {
that.getApp();
},
/**
* 刷新app
* @description: 刷新app
* @param {Object} row
* @author: 无尘
*/
refreshApp(row) {
const that = this;
......@@ -169,8 +172,9 @@ export default {
});
},
/**
* 删除
* @description: 删除
* @param {Object} row
* @author: 无尘
*/
toDel(row) {
const that = this;
......@@ -213,8 +217,8 @@ export default {
that.refreshData();
},
/**
* 刷新数据
*
* @description: 刷新数据
* @author: 无尘
*/
refreshData() {
const that = this;
......@@ -235,7 +239,8 @@ export default {
});
},
/**
* 获取自建应用
* @description: 获取自建应用
* @author: 无尘
*/
getApp() {
const that = this;
......@@ -251,7 +256,8 @@ export default {
});
},
/**
* 获取数据
* @description: 获取数据
* @author: 无尘
*/
getData() {
const that = this;
......
......@@ -79,6 +79,10 @@ export default {
this.getRoleList();
},
methods: {
/**
* @description: 获取角色数据
* @author: 无尘
*/
getRoleList() {
const haoBanUser = JSON.parse(localStorage.getItem('haoBanUser') || '{}');
const wxEnterpriseId = haoBanUser.wxEnterpriseId;
......@@ -112,6 +116,10 @@ export default {
});
});
},
/**
* @description: 获取管理员数据
* @author: 无尘
*/
getAdminList() {
const params = {
roleId: this.activeRoleId,
......@@ -126,7 +134,11 @@ export default {
this.adminList = result || [];
});
},
// 切换角色菜单
/**
* @description: 切换角色菜单
* @param {Object} roleData
* @author: 无尘
*/
onChangeRole(roleData) {
const { roleId, enterpriseId } = roleData;
this.activeRoleId = roleId;
......@@ -135,14 +147,27 @@ export default {
this.pager.currentPage = 1;
this.getAdminList();
},
// 编辑角色菜单
/**
* @description: 编辑角色菜单
* @param {Object} roleData
* @author: 无尘
*/
onEditRole(roleData) {
this.$router.push(`/edit-store-role?roleId=${roleData.roleId}`);
},
/**
* @description: 搜索
* @author: 无尘
*/
onSearch() {
this.pager.currentPage = 1;
this.getAdminList();
},
/**
* @description: 分页
* @param {Number} pageSize
* @author: 无尘
*/
onSizeChange(pageSize) {
this.pager.pageSize = pageSize;
this.onSearch();
......
......@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2020-03-16 09:59:39
* @LastEditors: 无尘
* @LastEditTime: 2020-08-18 18:16:58
* @LastEditTime: 2020-09-25 14:09:44
-->
<template>
<div class="daily-set-wrap ">
......@@ -59,7 +59,8 @@ export default {
methods: {
/**
* 获取数据
* @description: 获取超级管理员数据
* @author: 无尘
*/
getData() {
const that = this;
......
......@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2018-10-10 14:44:45
* @LastEditors: 无尘
* @LastEditTime: 2020-09-24 10:24:09
* @LastEditTime: 2020-09-25 13:57:38
-->
<template>
<div class="reviewed-wrap common-set-wrap">
......@@ -333,7 +333,8 @@ export default {
});
},
/**
* 获取列表数据
* @description: 获取列表数据
* @author: 无尘
*/
getTableList() {
const that = this;
......
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