Commit 2c673d35 by 无尘

fix: 修改注释

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