木子李·De 4 년 전
부모
커밋
3726ce16f5

+ 0 - 1
report-ui/src/components/AnjiPlus/anji-crud/anji-crud.vue

@@ -248,7 +248,6 @@ export default {
     } else {
       this.hasRowCustomButton = false
     }
-    console.log(`是否有自定义行按钮: ${this.hasRowCustomButton}`)
   },
   methods: {
     queryFormFieldSpan(item) {

+ 29 - 26
report-ui/src/views/accessAuthority/index.vue

@@ -1,6 +1,5 @@
 <template>
-  <anji-crud ref="listPage"
-             :option="crudOption">
+  <anji-crud ref="listPage" :option="crudOption">
     <template v-slot:buttonLeftOnTable>
     </template>
 
@@ -18,10 +17,16 @@
   </anji-crud>
 </template>
 <script>
-import { accessAuthorityList, accessAuthorityAdd, accessAuthorityDeleteBatch, accessAuthorityUpdate, accessAuthorityDetail } from '@/api/accessAuthority'
+import {
+  accessAuthorityList,
+  accessAuthorityAdd,
+  accessAuthorityDeleteBatch,
+  accessAuthorityUpdate,
+  accessAuthorityDetail,
+} from '@/api/accessAuthority'
 export default {
   name: 'AccessAuthority',
-  data () {
+  data() {
     return {
       crudOption: {
         // 使用菜单做为页面标题
@@ -46,7 +51,7 @@ export default {
               dictCode: 'ENABLE_FLAG',
             },
             label: '启用状态',
-            field: 'enableFlag'
+            field: 'enableFlag',
           },
           {
             inputType: 'input',
@@ -73,23 +78,23 @@ export default {
         buttons: {
           query: {
             api: accessAuthorityList,
-            permission: 'authorityManage:query'
+            permission: 'authorityManage:query',
           },
           queryByPrimarykey: {
             api: accessAuthorityDetail,
-            permission: 'authorityManage:query'
+            permission: 'authorityManage:query',
           },
           add: {
             api: accessAuthorityAdd,
-            permission: 'authorityManage:insert'
+            permission: 'authorityManage:insert',
           },
           delete: {
             api: accessAuthorityDeleteBatch,
-            permission: 'authorityManage:delete'
+            permission: 'authorityManage:delete',
           },
           edit: {
             api: accessAuthorityUpdate,
-            permission: 'authorityManage:update'
+            permission: 'authorityManage:update',
           },
         },
         // 表格列
@@ -102,7 +107,7 @@ export default {
             editHide: true, // 编辑弹框中不显示
           },
           {
-            label: '菜单代码',//目标菜单
+            label: '菜单代码', //目标菜单
             placeholder: '',
             field: 'target',
             editField: 'target',
@@ -110,12 +115,12 @@ export default {
             inputType: 'input',
             rules: [
               { required: true, message: '目标菜单必填', trigger: 'blur' },
-              { min: 1, max: 64, message: '不超过64个字符', trigger: 'blur' }
+              { min: 1, max: 64, message: '不超过64个字符', trigger: 'blur' },
             ],
             disabled: false,
           },
           {
-            label: '菜单名称',//目标菜单名称
+            label: '菜单名称', //目标菜单名称
             placeholder: '',
             field: 'targetName',
             sortable: true,
@@ -127,12 +132,12 @@ export default {
             inputType: 'input',
             rules: [
               { required: true, message: '目标菜单名称必填', trigger: 'blur' },
-              { min: 1, max: 128, message: '不超过128个字符', trigger: 'blur' }
+              { min: 1, max: 128, message: '不超过128个字符', trigger: 'blur' },
             ],
             disabled: false,
           },
           {
-            label: '按钮代码',//目标按钮
+            label: '按钮代码', //目标按钮
             placeholder: '',
             field: 'action',
             tableHide: true, // 表格中不显示
@@ -141,12 +146,12 @@ export default {
             inputType: 'input',
             rules: [
               { required: true, message: '目标必填', trigger: 'blur' },
-              { min: 1, max: 64, message: '不超过64个字符', trigger: 'blur' }
+              { min: 1, max: 64, message: '不超过64个字符', trigger: 'blur' },
             ],
             disabled: false,
           },
           {
-            label: '按钮名称',//目标按钮名称
+            label: '按钮名称', //目标按钮名称
             placeholder: '',
             field: 'actionName',
             fieldTableRowRenderer: (row) => {
@@ -158,12 +163,12 @@ export default {
             inputType: 'input',
             rules: [
               { required: true, message: '目标按钮名称必填', trigger: 'blur' },
-              { min: 1, max: 128, message: '不超过128个字符', trigger: 'blur' }
+              { min: 1, max: 128, message: '不超过128个字符', trigger: 'blur' },
             ],
             disabled: false,
           },
           {
-            label: '启用状态',//0--已禁用 1--已启用  DIC_NAME=ENABLE_FLAG
+            label: '启用状态', //0--已禁用 1--已启用  DIC_NAME=ENABLE_FLAG
             placeholder: '',
             field: 'enableFlag',
             fieldTableRowRenderer: (row) => {
@@ -176,7 +181,7 @@ export default {
             },
             colorStyle: {
               0: 'table-danger', //key为editField渲染的值(字典的提交值)'红色': 'danger','蓝色': 'primary','绿色': 'success','黄色': 'warning','灰色': 'info','白色':''
-              1: 'table-success'
+              1: 'table-success',
             },
             rules: [
               { required: true, message: '启用状态必填', trigger: 'blur' },
@@ -184,13 +189,12 @@ export default {
             disabled: false,
           },
           {
-            label: '排序',//
+            label: '排序', //
             placeholder: '',
             field: 'sort',
             editField: 'sort',
             inputType: 'input',
-            rules: [
-            ],
+            rules: [],
             disabled: false,
           },
 
@@ -239,9 +243,8 @@ export default {
     }
   },
 
-  created () { },
-  methods: {
-  }
+  created() {},
+  methods: {},
 }
 </script>
 

+ 11 - 27
report-ui/src/views/accessRole/components/RoleAuthority.vue

@@ -1,25 +1,9 @@
 <template>
-  <el-dialog class="tree_dialog"
-             title="设置权限项"
-             width="60%"
-             :close-on-click-modal="false"
-             center
-             :visible.sync="visib"
-             :before-close="closeDialog">
-    <el-tree ref="roleTree"
-             :data="treeData"
-             show-checkbox
-             node-key="id"
-             default-expand-all
-             :default-checked-keys="checkedKeys" />
-    <div slot="footer"
-         style="text-align: center">
-      <el-button type="primary"
-                 plain
-                 @click="saveTreeData">保存</el-button>
-      <el-button type="danger"
-                 plain
-                 @click="closeDialog">取消</el-button>
+  <el-dialog class="tree_dialog" title="为角色分配权限" width="60%" :close-on-click-modal="false" center :visible.sync="visib" :before-close="closeDialog">
+    <el-tree ref="roleTree" :data="treeData" show-checkbox node-key="id" default-expand-all :default-checked-keys="checkedKeys" />
+    <div slot="footer" style="text-align: center">
+      <el-button type="primary" plain @click="saveTreeData">保存</el-button>
+      <el-button type="danger" plain @click="closeDialog">取消</el-button>
     </div>
   </el-dialog>
 </template>
@@ -40,14 +24,14 @@ export default {
       },
     },
   },
-  data () {
+  data() {
     return {
       checkedKeys: [], // 当前选中的keys
       treeData: [], // 所有的树结点
     }
   },
   watch: {
-    visib (val) {
+    visib(val) {
       if (val) {
         // 弹窗弹出时需要执行的逻辑
         console.log(1)
@@ -55,17 +39,17 @@ export default {
       }
     },
   },
-  created () { },
+  created() {},
   methods: {
     // 获取所有的树形结构数据
-    async getTreeData () {
+    async getTreeData() {
       const { code, data } = await accessRoleAuthorityTree(this.roleCode)
       if (code != '200') return
       this.treeData = data.treeData
       this.checkedKeys = data.checkedKeys
     },
 
-    async saveTreeData () {
+    async saveTreeData() {
       var params = {
         roleCode: this.roleCode,
         authorityList: this.$refs.roleTree.getCheckedKeys(true),
@@ -76,7 +60,7 @@ export default {
     },
 
     // 弹窗关闭之前需要执行的逻辑
-    closeDialog () {
+    closeDialog() {
       this.treeData = []
       this.checkedKeys = []
       this.$emit('handleClose')

+ 26 - 25
report-ui/src/views/accessRole/index.vue

@@ -1,31 +1,32 @@
 <template>
-  <anji-crud ref="listPage"
-             :option="crudOption">
+  <anji-crud ref="listPage" :option="crudOption">
     <template v-slot:buttonLeftOnTable>
     </template>
 
-    <template slot="rowButton"
-              slot-scope="props">
-      <el-button type="text"
-                 @click="handleOpenDialogSetAuthorityForRole(props)">设定权限</el-button>
+    <template slot="rowButton" slot-scope="props">
+      <el-button type="text" @click="handleOpenDialogSetAuthorityForRole(props)" v-permission="'roleManage:grantAuthority'">分配权限</el-button>
     </template>
     <!--自定义的卡片插槽,将在编辑详情页面,出现在底部新卡片-->
     <template v-slot:pageSection>
-      <RoleAuthority :role-code="roleCode"
-                     :visib="dialogVisibleSetAuthorityForRole"
-                     @handleClose="dialogVisibleSetAuthorityForRole = false" />
+      <RoleAuthority :role-code="roleCode" :visib="dialogVisibleSetAuthorityForRole" @handleClose="dialogVisibleSetAuthorityForRole = false" />
     </template>
   </anji-crud>
 </template>
 <script>
-import { accessRoleList, accessRoleAdd, accessRoleDeleteBatch, accessRoleUpdate, accessRoleDetail } from '@/api/accessRole'
+import {
+  accessRoleList,
+  accessRoleAdd,
+  accessRoleDeleteBatch,
+  accessRoleUpdate,
+  accessRoleDetail,
+} from '@/api/accessRole'
 import RoleAuthority from '@/views/accessRole/components/RoleAuthority'
 export default {
   name: 'AccessRole',
   components: {
     RoleAuthority: RoleAuthority,
   },
-  data () {
+  data() {
     return {
       // 选中一个角色,点设定权限时,弹出对话框
       dialogVisibleSetAuthorityForRole: false,
@@ -42,12 +43,12 @@ export default {
           {
             inputType: 'input',
             label: '角色编码',
-            field: 'roleCode'
+            field: 'roleCode',
           },
           {
             inputType: 'input',
             label: '角色名称',
-            field: 'roleName'
+            field: 'roleName',
           },
           {
             inputType: 'anji-select', //form表单类型 input|input-number|anji-select(传递url或者dictCode)|anji-tree(左侧树)|date|datetime|datetimerange
@@ -62,23 +63,23 @@ export default {
         buttons: {
           query: {
             api: accessRoleList,
-            permission: 'roleManage:query'
+            permission: 'roleManage:query',
           },
           queryByPrimarykey: {
             api: accessRoleDetail,
-            permission: 'roleManage:query'
+            permission: 'roleManage:query',
           },
           add: {
             api: accessRoleAdd,
-            permission: 'roleManage:insert'
+            permission: 'roleManage:insert',
           },
           delete: {
             api: accessRoleDeleteBatch,
-            permission: 'roleManage:delete'
+            permission: 'roleManage:delete',
           },
           edit: {
             api: accessRoleUpdate,
-            permission: 'roleManage:update'
+            permission: 'roleManage:update',
           },
         },
         // 表格列
@@ -99,7 +100,7 @@ export default {
             inputType: 'input',
             rules: [
               { required: true, message: '角色编码必填', trigger: 'blur' },
-              { min: 1, max: 32, message: '不超过32个字符', trigger: 'blur' }
+              { min: 1, max: 32, message: '不超过32个字符', trigger: 'blur' },
             ],
             disabled: false,
           },
@@ -114,12 +115,12 @@ export default {
             inputType: 'input',
             rules: [
               { required: true, message: '角色名称必填', trigger: 'blur' },
-              { min: 1, max: 64, message: '不超过64个字符', trigger: 'blur' }
+              { min: 1, max: 64, message: '不超过64个字符', trigger: 'blur' },
             ],
             disabled: false,
           },
           {
-            label: '启用状态',//0--已禁用 1--已启用  DIC_NAME=ENABLE_FLAG
+            label: '启用状态', //0--已禁用 1--已启用  DIC_NAME=ENABLE_FLAG
             placeholder: '',
             field: 'enableFlag',
             fieldTableRowRenderer: (row) => {
@@ -132,7 +133,7 @@ export default {
             },
             colorStyle: {
               0: 'table-danger', //key为editField渲染的值(字典的提交值)'红色': 'danger','蓝色': 'primary','绿色': 'success','黄色': 'warning','灰色': 'info','白色':''
-              1: 'table-success'
+              1: 'table-success',
             },
             rules: [
               { required: true, message: '启用状态必填', trigger: 'blur' },
@@ -180,13 +181,13 @@ export default {
       },
     }
   },
-  created () { },
+  created() {},
   methods: {
-    handleOpenDialogSetAuthorityForRole (props) {
+    handleOpenDialogSetAuthorityForRole(props) {
       this.roleCode = props.msg.roleCode
       this.dialogVisibleSetAuthorityForRole = true
     },
-  }
+  },
 }
 </script>
 

+ 11 - 27
report-ui/src/views/accessUser/components/UserRole.vue

@@ -1,25 +1,9 @@
 <template>
-  <el-dialog class="tree_dialog"
-             title="授权角色"
-             width="60%"
-             :close-on-click-modal="false"
-             center
-             :visible.sync="visib"
-             :before-close="closeDialog">
-    <el-tree ref="roleTree"
-             :data="treeData"
-             show-checkbox
-             node-key="id"
-             default-expand-all
-             :default-checked-keys="checkedKeys" />
-    <div slot="footer"
-         style="text-align: center">
-      <el-button type="primary"
-                 plain
-                 @click="saveTreeData">保存</el-button>
-      <el-button type="danger"
-                 plain
-                 @click="closeDialog">取消</el-button>
+  <el-dialog class="tree_dialog" title="为用户分配角色" width="60%" :close-on-click-modal="false" center :visible.sync="visib" :before-close="closeDialog">
+    <el-tree ref="roleTree" :data="treeData" show-checkbox node-key="id" default-expand-all :default-checked-keys="checkedKeys" />
+    <div slot="footer" style="text-align: center">
+      <el-button type="primary" plain @click="saveTreeData">保存</el-button>
+      <el-button type="danger" plain @click="closeDialog">取消</el-button>
     </div>
   </el-dialog>
 </template>
@@ -40,14 +24,14 @@ export default {
       },
     },
   },
-  data () {
+  data() {
     return {
       checkedKeys: [], // 当前选中的keys
       treeData: [], // 所有的树结点
     }
   },
   watch: {
-    visib (val) {
+    visib(val) {
       if (val) {
         // 弹窗弹出时需要执行的逻辑
         console.log(1)
@@ -55,17 +39,17 @@ export default {
       }
     },
   },
-  created () { },
+  created() {},
   methods: {
     // 获取所有的树形结构数据
-    async getTreeData () {
+    async getTreeData() {
       const { code, data } = await getRoleTree(this.loginName)
       if (code != '200') return
       this.treeData = data.treeData
       this.checkedKeys = data.checkedKeys
     },
 
-    async saveTreeData () {
+    async saveTreeData() {
       var params = {
         loginName: this.loginName,
         roleCodeList: this.$refs.roleTree.getCheckedKeys(true),
@@ -76,7 +60,7 @@ export default {
     },
 
     // 弹窗关闭之前需要执行的逻辑
-    closeDialog () {
+    closeDialog() {
       this.treeData = []
       this.checkedKeys = []
       this.$emit('handleClose')

+ 2 - 1
report-ui/src/views/accessUser/index.vue

@@ -4,7 +4,8 @@
     </template>
 
     <template slot="rowButton" slot-scope="props">
-      <el-button type="text" @click="handleOpenDialogSetRoleForUser(props)">授予角色</el-button>
+      <el-button type="text" @click="handleOpenDialogSetRoleForUser(props)" v-permission="'userManage:grantRole'">分配角色</el-button>
+      <!--<el-button type="text" @click="handleOpenDialogSetRoleForUser(props)" v-permission="'userManage:resetPassword'">重置密码</el-button>-->
     </template>
     <!--自定义的卡片插槽,将在编辑详情页面,出现在底部新卡片-->
     <template v-slot:pageSection>