Browse Source

修改权限项

zhaoke 2 years ago
parent
commit
7f9a9c2b92

+ 25 - 3
src/views/userManagement/account/index.vue

@@ -18,16 +18,21 @@
     <!--新增/编辑-->
     <Dialog :flag="editDialogVisible" :msgTitle="editDialogTitle" @submitForm="submitForm(ruleFormRef)" @resetForm="resetForm(ruleFormRef)" :show-flag="true">
       <el-form ref="ruleFormRef" :model="ruleForm" label-width="110px" class="demo-ruleForm">
-        <el-form-item label="账号名称" prop="user_name">
+        <el-form-item label="账号名称" :rules="[{required: true,message: '请输入账号名称',trigger: 'blur',}]" prop="user_name">
           <el-input :disabled="dT == 'edit'" v-model="ruleForm.user_name" size="default" placeholder="请输入账号名称" />
         </el-form-item>
-        <el-form-item label="账号密码" prop="user_pwd">
+        <el-form-item label="账号密码" :rules="[{required: true,message: '请输入账号密码',trigger: 'blur',}]" prop="user_pwd">
           <el-input v-model="ruleForm.user_pwd" type="password" show-password size="default" placeholder="请输入账号名称" />
         </el-form-item>
+        <el-form-item label="账号组关联" prop="user_gropu_id">
+          <el-select size="default" style="width: 100%" v-model="ruleForm.user_group_id" placeholder="请选择">
+            <el-option v-for="item in options" :key="item.v" :label="item.k" :value="item.v"> </el-option>
+          </el-select>
+        </el-form-item>
         <el-form-item label="账号描述" prop="user_comment">
           <el-input v-model="ruleForm.user_comment" size="default" type="textarea" :rows="3" placeholder="请输入账号描述" />
         </el-form-item>
-        <el-form-item label="是否启用" prop="user_status">
+        <el-form-item label="是否启用" :rules="[{required: true,message: '请选择是否启用',trigger: 'change',}]" prop="user_status">
           <el-radio-group v-model="ruleForm.user_status">
             <el-radio :label="1">启用</el-radio>
             <el-radio :label="2"> 禁用</el-radio>
@@ -83,9 +88,11 @@ const ruleForm = ref<any>({
   user_comment: "",
   user_status: "",
   user_pwd: "",
+  user_group_id: "",
 });
 const rowIndex = ref<any>({});
 const data = ref<any>([]);
+const options = ref<any>([]);
 const msgId = ref(null);
 const msgType = ref("all");
 const PageIndex = ref(1);
@@ -168,9 +175,24 @@ const dataChange = async (event, data) => {
   }
 };
 
+//获取账号组
+const getGroupSelect = async () => {
+  const res = await Query({
+    id: DATACONTENT_ID.accountGroupSelId,
+    dataContent: [],
+  });
+  if (res.code == 0) {
+    const { listValues } = res.returnData;
+    options.value = listValues;
+  } else {
+    ElMessage.error(res.message);
+  }
+};
+
 onBeforeMount(() => {
   getGroup();
   accountList();
+  getGroupSelect();
 });
 
 const handleNodeClick = (data) => {

+ 1 - 1
src/views/userManagement/accountGroup/index.vue

@@ -15,7 +15,7 @@
     <!--新增/编辑-->
     <Dialog :flag="editDialogVisible" :msgTitle="editDialogTitle" @submitForm="submitForm(ruleFormRef)" @resetForm="resetForm(ruleFormRef)" :show-flag="true">
       <el-form ref="ruleFormRef" :model="ruleForm" label-width="110px" class="demo-ruleForm">
-        <el-form-item label="账号组名称" prop="user_group_name">
+        <el-form-item label="账号组名称" :rules="[{required: true,message: '请输入账号组名称',trigger: 'blur',}]" prop="user_group_name">
           <el-input v-model="ruleForm.user_group_name" size="default" placeholder="请输入账号组名称" />
         </el-form-item>
         <el-form-item label="账号组描述" prop="user_group_comment">

+ 3 - 4
src/views/userManagement/application/index.vue

@@ -14,13 +14,13 @@
     <!--新增/编辑-->
     <Dialog :flag="editDialogVisible" :msgTitle="editDialogTitle" @submitForm="submitForm(ruleFormRef)" @resetForm="resetForm(ruleFormRef)" :show-flag="true">
       <el-form ref="ruleFormRef" :model="ruleForm" label-width="110px" class="demo-ruleForm">
-        <el-form-item label="应用名称" prop="app_name" :rules="formRules.isNotNull">
+        <el-form-item label="应用名称" prop="app_name" :rules="[{required: true,message: '请输入应用名称',trigger: 'blur',}]">
           <el-input v-model="ruleForm.app_name" size="default" placeholder="请输入应用名称" />
         </el-form-item>
-        <el-form-item label="应用链接账号" prop="app_show_id" :rules="formRules.isNotNull">
+        <el-form-item label="应用链接账号" prop="app_show_id" :rules="[{required: true,message: '请输入应用链接账号',trigger: 'blur',}]">
           <el-input v-model="ruleForm.app_show_id" size="default" placeholder="请输入应用链接账号" />
         </el-form-item>
-        <el-form-item label="应用链接密钥" prop="app_show_id" :rules="formRules.isNotNull">
+        <el-form-item label="应用链接密钥" prop="app_show_secret" :rules="[{required: true,message: '请输入应用链接密钥',trigger: 'blur',}]">
           <el-input v-model="ruleForm.app_show_secret" size="default" placeholder="请输入应用链接密钥" />
         </el-form-item>
         <el-form-item label="应用描述" prop="app_comment">
@@ -40,7 +40,6 @@ import table from "../hooks/useTable";
 const ruleFormRef = ref<FormInstance>();
 const tableHeader = ref<any>([]);
 const tableData = ref<any>([]);
-const formRules = useElement().formRules;
 const tableBtnGroup = [
   {
     name: "编辑",

+ 4 - 1
src/views/userManagement/permission/index.vue

@@ -10,7 +10,9 @@
       <div class="permission-content-tree box">
         <div class="manageTitle">权限树</div>
         <div class="contentTree">
-          <el-tree :data="data" :props="defaultProps" node-key="auth_id" highlight-current :default-expanded-keys="currentKey" :expand-on-click-node="false" @node-click="handleNodeClick" />
+          <el-scrollbar>
+            <el-tree :data="data" :props="defaultProps" node-key="auth_id" highlight-current :default-expanded-keys="currentKey" :expand-on-click-node="false" @node-click="handleNodeClick" />
+          </el-scrollbar>
         </div>
       </div>
       <div class="permission-content-card box">
@@ -367,6 +369,7 @@ const resetForm = (formEl: FormInstance | undefined) => {
       margin-right: 24px;
       .contentTree {
         margin-top: 30px;
+        height: calc(100% - 60px);
       }
     }
     &-card {

+ 4 - 4
src/views/userManagement/role/index.vue

@@ -17,16 +17,16 @@
     <!--新增/编辑-->
     <Dialog :flag="editDialogVisible" :msgTitle="editDialogTitle" @submitForm="submitForm(ruleFormRef)" @resetForm="resetForm(ruleFormRef)" :show-flag="true">
       <el-form ref="ruleFormRef" :model="ruleForm" label-width="110px" class="demo-ruleForm">
-        <el-form-item label="角色名称" prop="role_name">
+        <el-form-item label="角色名称" :rules="[{required: true,message: '请输入角色名称',trigger: 'blur',}]" prop="role_name">
           <el-input v-model="ruleForm.role_name" size="default" placeholder="请输入角色名称" />
         </el-form-item>
         <el-form-item label="角色描述" prop="role_comment">
           <el-input v-model="ruleForm.role_comment" size="default" type="textarea" :rows="3" placeholder="请输入角色描述" />
         </el-form-item>
-        <el-form-item label="是否启用" prop="role_status">
+        <el-form-item label="是否启用" :rules="[{required: true,message: '请选择是否启用',trigger: 'change',}]" prop="role_status">
           <el-radio-group v-model="ruleForm.role_status">
-            <el-radio label="1">启用</el-radio>
-            <el-radio label="2"> 禁用</el-radio>
+            <el-radio :label="1">启用</el-radio>
+            <el-radio :label="2"> 禁用</el-radio>
           </el-radio-group>
         </el-form-item>
       </el-form>