diff --git a/package.json b/package.json index 886ae96..8df430c 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "ant-design-vue": "^1.7.8", "axios": "^0.24.0", "core-js": "^3.6.5", + "element-ui": "^2.15.6", "less": "^4.1.2", "less-loader": "5.0.0", "momen": "^0.0.1-security", diff --git a/src/api/basic/role/index.js b/src/api/basic/role/index.js index 37e24a4..2906a53 100644 --- a/src/api/basic/role/index.js +++ b/src/api/basic/role/index.js @@ -9,6 +9,38 @@ export function rolelist(params) { data: params, }) } +// 新增角色 +export function roleInsert(params) { + return httpService({ + url: `/user/role/insert`, + method: 'post', + data: params, + }) +} +// 编辑角色 +export function roleUpdate(params) { + return httpService({ + url: `/user/role/update`, + method: 'post', + data: params, + }) +} +// 分配角色 +export function assignRoles(params) { + return httpService({ + url: `/user/role/assignRoles`, + method: 'post', + data: params, + }) +} +// 删除角色 +export function roleDel(params) { + return httpService({ + url: `user/role/delete`, + method: 'post', + data: params, + }) +} // 角色-----员工列表 export function listByRole(params) { return httpService({ diff --git a/src/main.js b/src/main.js index 31b520a..eea5209 100644 --- a/src/main.js +++ b/src/main.js @@ -3,6 +3,8 @@ import App from './App.vue' import './styles/index.less'; import mixins from "@/mixins" import Antd from 'ant-design-vue'; +import ElementUI from 'element-ui'; +import 'element-ui/lib/theme-chalk/index.css'; // import moment from 'moment'; import util from '@/utils/util.js' import 'ant-design-vue/dist/antd.css'; @@ -10,6 +12,7 @@ import 'ant-design-vue/dist/antd.css'; Vue.use(util); Vue.use(Antd); Vue.use(mixins); +Vue.use(ElementUI); import store from "@/store"; import router from "@/permission"; diff --git a/src/request/index.js b/src/request/index.js index 8b32f84..c9f4cfd 100644 --- a/src/request/index.js +++ b/src/request/index.js @@ -24,9 +24,8 @@ function filterRequestData(obj) { return o; } //创建axios的实例 -const communityCode = store.getters.getCommunityCode; const httpService = axios.create({ - baseURL: process.env.VUE_APP_URL+ communityCode +'/manage',// TODO:具体的配置可以根据项目情况而来 + baseURL: process.env.VUE_APP_URL ,// TODO:具体的配置可以根据项目情况而来 timeout: 5000 }) @@ -38,6 +37,7 @@ httpService.interceptors.request.use(config => { config.headers['Content-Type'] = "application/json"; config.headers['manage-login-token'] = store.getters.getToken; // config.headers['device-type'] = "web"; + config.baseURL = process.env.VUE_APP_URL + store.getters.getCommunityCode + '/manage' if(config.method === 'post') { config.data = rqData; } else { diff --git a/src/views/Basic/Authority/depend/form.vue b/src/views/Basic/Authority/depend/form.vue index c5fb5d6..4a9a143 100644 --- a/src/views/Basic/Authority/depend/form.vue +++ b/src/views/Basic/Authority/depend/form.vue @@ -1,375 +1,138 @@ - + \ No newline at end of file diff --git a/src/views/Basic/Authority/depend/permissions copy.vue b/src/views/Basic/Authority/depend/permissions copy.vue deleted file mode 100644 index 67a1c86..0000000 --- a/src/views/Basic/Authority/depend/permissions copy.vue +++ /dev/null @@ -1,167 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/views/Basic/Authority/depend/permissions.vue b/src/views/Basic/Authority/depend/permissions.vue index 7922825..f109172 100644 --- a/src/views/Basic/Authority/depend/permissions.vue +++ b/src/views/Basic/Authority/depend/permissions.vue @@ -1,118 +1,186 @@ @@ -155,11 +233,25 @@ export default { display: flex; justify-content: space-between; } -/deep/.ant-tree ul{ +/deep/.ant-tree ul { width: 200px; } -.tree{ +.tree { display: flex; margin-left: 20px; } +.role-card { + line-height: 30px; + font-size: 16px; + cursor: pointer; + border-bottom: 1px solid #d9d9d9; + margin-bottom: 10px; + display: flex; + justify-content: space-between; +} +.role-li { + display: flex; + justify-content: space-between; + width: 100%; +} \ No newline at end of file diff --git a/src/views/Basic/Authority/index.vue b/src/views/Basic/Authority/index.vue index ac1d21a..3bad29e 100644 --- a/src/views/Basic/Authority/index.vue +++ b/src/views/Basic/Authority/index.vue @@ -16,8 +16,25 @@ v-for="(rolechild, indexs) in item.childrenList" class="role-card" :key="indexs" + @click='rolechoose(rolechild.id)' > - {{ rolechild.name }} + + {{ rolechild.name || "无" }} + + + + @@ -26,9 +43,12 @@