zhaoke 2 жил өмнө
parent
commit
1672ea39c8

+ 33 - 55
src/views/userManagement/permission/index.vue

@@ -66,61 +66,39 @@
       </div>
     </div>
     <!--删除弹框-->
-    <Dialog :flag="flag">
-      <div class="airportInfoDialog">
-        <div class="title del-title">删除权限</div>
-        <div class="Delcontent">
-          <div class="content del-content">
-            <span class="DelIcon"></span>是否确认删除<span class="error l10">{{ title }}</span>?
-          </div>
-          <div class="Delfoot text-right t30">
-            <el-button size="default" type="danger" @click="remove">删除</el-button>
-            <el-button size="default" @click="flag = false">取消</el-button>
-          </div>
-        </div>
-      </div>
-    </Dialog>
+    <Dialog :flag="flag" msgTitle="删除权限" type="del" :delName="title" @delRest="delRest" @delRemove="remove" />
     <!--新增/编辑-->
-    <Dialog :flag="editDialogVisible" width="628px" :show-flag="true">
-      <div class="airportInfoDialog dialog-public-background">
-        <div class="title">{{ editDialogTitle }}</div>
-        <div class="content">
-          <el-form ref="ruleFormRef" :model="ruleForm" :rules="rules" label-width="110px" class="demo-ruleForm">
-            <el-form-item label="权限名称" prop="auth_name">
-              <el-input v-model="ruleForm.auth_name" size="default" placeholder="请输入权限名称" />
-            </el-form-item>
-            <div class="flex">
-              <el-form-item label="权限类型" prop="auth_type">
-                <el-select v-model="ruleForm.auth_type" size="default" placeholder="请选择">
-                  <el-option v-for="(item, index) in optionsType" :key="index" :label="item.label" :value="item.value"> </el-option>
-                </el-select>
-              </el-form-item>
-              <el-form-item label="父级权限" prop="authParent">
-                <el-select v-model="ruleForm.auth_id" size="default" placeholder="请选择">
-                  <el-option v-for="(item, index) in optionsParent" :key="index" :label="item.label" :value="item.value"> </el-option>
-                </el-select>
-              </el-form-item>
-            </div>
-            <div class="flex-wrap">
-              <el-form-item class="flex1" label="所属应用" prop="app_name">
-                <el-select v-model="ruleForm.app_name" style="display: block" size="default" placeholder="请选择">
-                  <el-option v-for="(item, index) in optionsApp" :key="index" :label="item.label" :value="item.value"> </el-option>
-                </el-select>
-              </el-form-item>
-            </div>
-            <el-form-item label="权限标识符" prop="auth_ident">
-              <el-input v-model="ruleForm.auth_ident" size="default" type="textarea" :rows="3" placeholder="请输入权限标识符" />
-            </el-form-item>
-            <el-form-item label="数据项描述" prop="auth_comment">
-              <el-input v-model="ruleForm.auth_comment" size="default" type="textarea" :rows="3" placeholder="请输入数据项描述" />
-            </el-form-item>
-          </el-form>
+    <Dialog :flag="editDialogVisible" :msg-title="editDialogTitle" @submitForm="submitForm(ruleFormRef)" @reset-form="resetForm(ruleFormRef)" width="628px" :show-flag="true">
+      <el-form ref="ruleFormRef" :model="ruleForm" :rules="rules" label-width="110px" class="demo-ruleForm">
+        <el-form-item label="权限名称" prop="auth_name">
+          <el-input v-model="ruleForm.auth_name" size="default" placeholder="请输入权限名称" />
+        </el-form-item>
+        <div class="flex">
+          <el-form-item label="权限类型" prop="auth_type">
+            <el-select v-model="ruleForm.auth_type" size="default" placeholder="请选择">
+              <el-option v-for="(item, index) in optionsType" :key="index" :label="item.label" :value="item.value"> </el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="父级权限" prop="authParent">
+            <el-select v-model="ruleForm.auth_id" size="default" placeholder="请选择">
+              <el-option v-for="(item, index) in optionsParent" :key="index" :label="item.label" :value="item.value"> </el-option>
+            </el-select>
+          </el-form-item>
         </div>
-        <div class="foot text-right t30">
-          <el-button size="default" type="primary" class="r25 r26" @click="submitForm(ruleFormRef)">提交</el-button>
-          <el-button size="default" class="r26" @click="resetForm(ruleFormRef)">取消</el-button>
+        <div class="flex-wrap">
+          <el-form-item class="flex1" label="所属应用" prop="app_name">
+            <el-select v-model="ruleForm.app_name" style="display: block" size="default" placeholder="请选择">
+              <el-option v-for="(item, index) in optionsApp" :key="index" :label="item.label" :value="item.value"> </el-option>
+            </el-select>
+          </el-form-item>
         </div>
-      </div>
+        <el-form-item label="权限标识符" prop="auth_ident">
+          <el-input v-model="ruleForm.auth_ident" size="default" type="textarea" :rows="3" placeholder="请输入权限标识符" />
+        </el-form-item>
+        <el-form-item label="数据项描述" prop="auth_comment">
+          <el-input v-model="ruleForm.auth_comment" size="default" type="textarea" :rows="3" placeholder="请输入数据项描述" />
+        </el-form-item>
+      </el-form>
     </Dialog>
   </div>
 </template>
@@ -190,8 +168,6 @@ const ruleForm = reactive({
   auth_comment: "",
   app_name: "",
   auth_ident: "",
-  auth_type: "",
-  app_name: "",
   app_id: "",
   auth_status: true,
 });
@@ -224,7 +200,9 @@ const renderChange = (data) => {
 const renderEdit = (data) => {
   console.log(data);
 };
-
+const delRest = () => {
+  flag.value = false;
+};
 //删除弹框
 const onNodeClick = (data) => {
   flag.value = true;