Browse Source

角色管理

master
jiangyy 3 years ago
parent
commit
be1b79b16a
  1. 4
      src/router/index.js
  2. 4489
      src/views/modules/base/organization/organization.vue
  3. 26
      src/views/modules/workSys/role/role.vue
  4. 31
      src/views/modules/workSys/role/roleForm.vue

4
src/router/index.js

@ -380,7 +380,7 @@ router.beforeEach((to, from, next) => {
// fnAddDynamicMenuRoutes2(window.SITE_CONFIG["menuShujuList"]); // fnAddDynamicMenuRoutes2(window.SITE_CONFIG["menuShujuList"]);
http http
.get("/gov/access/menu/nav?tableName=data_menu") .get("gov/access/menu/navDigitalCommunity?tableName=data_menu")
.then(({ data: res }) => { .then(({ data: res }) => {
if (res.code == 10005 || res.code == 10006 || res.code == 10007) { if (res.code == 10005 || res.code == 10006 || res.code == 10007) {
// 10005 token为空 10006登陆超时 10007别处登录 // 10005 token为空 10006登陆超时 10007别处登录
@ -406,7 +406,7 @@ router.beforeEach((to, from, next) => {
}); });
http http
.get("/gov/access/menu/nav") .get("gov/access/menu/navDigitalCommunity")
.then(({ data: res }) => { .then(({ data: res }) => {
if (res.code == 10005 || res.code == 10006 || res.code == 10007) { if (res.code == 10005 || res.code == 10006 || res.code == 10007) {
// 10005 token为空 10006登陆超时 10007别处登录 // 10005 token为空 10006登陆超时 10007别处登录

4489
src/views/modules/base/organization/organization.vue

File diff suppressed because it is too large

26
src/views/modules/workSys/role/role.vue

@ -16,7 +16,7 @@
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建时间" <!-- <el-form-item label="创建时间"
label-width="110px" label-width="110px"
prop="createdTime"> prop="createdTime">
<el-date-picker v-model="formData.createdTime" <el-date-picker v-model="formData.createdTime"
@ -28,7 +28,7 @@
placeholder="创建时间"> placeholder="创建时间">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item> -->
<el-button style="margin-left:30px" <el-button style="margin-left:30px"
size="small" size="small"
@ -92,12 +92,15 @@
<el-button v-if="true" <el-button v-if="true"
type="text" type="text"
class="div-table-button--detail"
size="small"
@click="handleDetail(scope.row)">查看</el-button>
<el-button type="text"
class="div-table-button--edit" class="div-table-button--edit"
size="small" size="small"
@click="handleEdit(scope.row)">修改</el-button> @click="handleEdit(scope.row)">修改</el-button>
<el-button v-if="true" <el-button type="text"
type="text"
class="div-table-button--delete " class="div-table-button--delete "
size="small" size="small"
@click="handleDelete(scope.row)">删除</el-button> @click="handleDelete(scope.row)">删除</el-button>
@ -158,7 +161,7 @@ export default {
timeRange: [], timeRange: [],
formData: { formData: {
name: '',// name: '',//
createdTime: '',// // createdTime: '',//
}, },
@ -260,6 +263,13 @@ export default {
this.$refs.ref_form.initForm('edit', row.id) this.$refs.ref_form.initForm('edit', row.id)
}) })
}, },
handleDetail (row) {
this.formTitle = '详情'
this.formShow = true
this.$nextTick(() => {
this.$refs.ref_form.initForm('detail', row.id)
})
},
addFormOk () { addFormOk () {
this.formShow = false this.formShow = false
@ -285,12 +295,10 @@ export default {
async deleteRole (row) { async deleteRole (row) {
const url = "/gov/access/govrole/del/" + array const url = "/gov/access/govrole/del"
let params = { let params = [row.id]
ids: [row.id]
}
const { data, code, msg } = await requestPost(url, params) const { data, code, msg } = await requestPost(url, params)

31
src/views/modules/workSys/role/roleForm.vue

@ -43,6 +43,7 @@
:data="menuList" :data="menuList"
:props="{ label: 'name', children: 'children' }" :props="{ label: 'name', children: 'children' }"
node-key="id" node-key="id"
:default-expanded-keys="['000']"
ref="menuListTree" ref="menuListTree"
accordion accordion
show-checkbox> show-checkbox>
@ -56,6 +57,7 @@
:data="menuListShuju" :data="menuListShuju"
:props="{ label: 'name', children: 'children' }" :props="{ label: 'name', children: 'children' }"
node-key="id" node-key="id"
:default-expanded-keys="['000']"
ref="menuListShujuTree" ref="menuListShujuTree"
accordion accordion
show-checkbox> show-checkbox>
@ -111,9 +113,7 @@ export default {
components: {}, components: {},
async mounted () { async mounted () {
//
await this.getMenuList()
await this.getMenuShujuList()
}, },
methods: { methods: {
@ -122,6 +122,9 @@ export default {
this.startLoading() this.startLoading()
this.customerId = localStorage.getItem("customerId"); this.customerId = localStorage.getItem("customerId");
this.formData.customerId = this.customerId this.formData.customerId = this.customerId
//
await this.getMenuList()
await this.getMenuShujuList()
this.$refs['ref_form'].resetFields(); this.$refs['ref_form'].resetFields();
this.$refs.menuListTree.setCheckedKeys([]) this.$refs.menuListTree.setCheckedKeys([])
@ -149,7 +152,14 @@ export default {
const { data, code, msg } = await requestGet(url, params) const { data, code, msg } = await requestGet(url, params)
if (code === 0) { if (code === 0) {
this.menuList = data this.menuList = [
{
id: '000',
name: '全部菜单',
children: [...data]
}
]
// this.menuList = data
} else { } else {
this.$message.error(msg) this.$message.error(msg)
@ -167,7 +177,14 @@ export default {
const { data, code, msg } = await requestGet(url, params) const { data, code, msg } = await requestGet(url, params)
if (code === 0) { if (code === 0) {
this.menuListShuju = data this.menuListShuju = [
{
id: '000',
name: '全部菜单',
children: [...data]
}
]
// this.menuListShuju = data
} else { } else {
this.$message.error(msg) this.$message.error(msg)
@ -188,6 +205,9 @@ export default {
this.formData.menuIdList.forEach(item => { this.formData.menuIdList.forEach(item => {
this.$refs.menuListTree.setChecked(item, true) this.$refs.menuListTree.setChecked(item, true)
})
this.formData.menuIdList.forEach(item => {
this.$refs.menuListShujuTree.setChecked(item, true) this.$refs.menuListShujuTree.setChecked(item, true)
}) })
this.formData.customerId = this.customerId this.formData.customerId = this.customerId
@ -231,6 +251,7 @@ export default {
...this.$refs.menuListShujuTree.getCheckedKeys(), ...this.$refs.menuListShujuTree.getCheckedKeys(),
...this.$refs.menuListShujuTree.getHalfCheckedKeys() ...this.$refs.menuListShujuTree.getHalfCheckedKeys()
] ]
this.formData.menuIdList = this.formData.menuIdList.filter(item => item !== '000')
console.log('menuAll', this.formData) console.log('menuAll', this.formData)

Loading…
Cancel
Save