chenrui  1 жил өмнө
parent
commit
653a1ca457

+ 75 - 14
src/views/userManagement/role/index.vue

@@ -10,23 +10,79 @@
       </div>
     </div>
     <div class="application-content">
-      <Table :tableHeader="tableHeader" @btnClick="btnClick" :tableBtnGroup="tableBtnGroup" :tableData="tableData" />
+      <Table
+        :tableHeader="tableHeader"
+        @btnClick="btnClick"
+        :tableBtnGroup="tableBtnGroup"
+        :tableData="tableData"
+      />
     </div>
     <!--删除弹框-->
-    <Dialog :flag="flag" msgTitle="删除角色" type="del" :delName="title" @delRest="delRest" @delRemove="remove" />
+    <Dialog
+      :flag="flag"
+      msgTitle="删除角色"
+      type="del"
+      :delName="title"
+      @delRest="delRest"
+      @delRemove="remove"
+    />
     <!--新增/编辑-->
-    <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="角色ID" :rules="[{required: true,message: '请输入角色ID',trigger: 'blur',}]" prop="role_id">
-          <el-input :disabled="msgFlag" v-model="ruleForm.role_id" size="default" placeholder="请输入角色名称" />
+    <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="角色ID"
+          :rules="[
+            { required: true, message: '请输入角色ID', trigger: 'blur' },
+          ]"
+          prop="role_id"
+        >
+          <el-input
+            :disabled="msgFlag"
+            v-model="ruleForm.role_id"
+            size="default"
+            placeholder="请输入角色名称"
+          />
         </el-form-item>
-        <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
+          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-input
+            v-model="ruleForm.role_comment"
+            size="default"
+            type="textarea"
+            :rows="3"
+            placeholder="请输入角色描述"
+          />
         </el-form-item>
-        <el-form-item label="是否启用" :rules="[{required: true,message: '请选择是否启用',trigger: 'change',}]" 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>
@@ -154,7 +210,12 @@ const addApp = () => {
   msgFlag.value = false;
   ruleForm.value = {};
 };
-const btnAuthMap = [, 'new_role_button', 'role_editing_button', 'role_deletion_button']
+const btnAuthMap = [
+  ,
+  "new_role_button",
+  "role_editing_button",
+  "role_deletion_button",
+];
 // 新增/编辑/删除角色
 const saveRole = async (event, data) => {
   try {
@@ -165,10 +226,10 @@ const saveRole = async (event, data) => {
       btnAuthMap[event]
     );
     if (code == 0) {
-      ElMessage.success(message);
+      ElMessage.success(`操作成功`);
       gueryRole();
     } else {
-      ElMessage.error(message);
+      ElMessage.error(`操作失败`);
     }
   } catch (error) {}
 };
@@ -204,4 +265,4 @@ const resetForm = (formEl: FormInstance | undefined) => {
     height: calc(100% - 56px);
   }
 }
-</style>
+</style>