|
@@ -6,47 +6,35 @@ import {
|
|
|
httpDetail
|
|
|
} from "/@/api/interest/role";
|
|
|
import { ElMessage, FormInstance, FormRules } from "element-plus";
|
|
|
-import { reactive, ref, watch, nextTick, computed } from "vue";
|
|
|
-import menuType from "./types";
|
|
|
+import { reactive, ref, computed } from "vue";
|
|
|
+import { responseHandle } from "/@/utils/responseHandle";
|
|
|
import { useNav } from "/@/layout/hooks/useNav";
|
|
|
import { LEVEL_OPTIONS } from "/@/config/status";
|
|
|
+enum FROM_TYPE {
|
|
|
+ create = "create",
|
|
|
+ edit = "edit",
|
|
|
+ view = "view"
|
|
|
+}
|
|
|
const { logout } = useNav();
|
|
|
-const formSize = ref("default");
|
|
|
-const ruleFormRef = ref<FormInstance>();
|
|
|
-
|
|
|
-const props = defineProps({
|
|
|
- itemId: {
|
|
|
- type: String,
|
|
|
- default: ""
|
|
|
- },
|
|
|
- showModel: {
|
|
|
- type: Boolean,
|
|
|
- default: false
|
|
|
- },
|
|
|
- isDetails: {
|
|
|
- type: String,
|
|
|
- default: "add"
|
|
|
- }
|
|
|
-});
|
|
|
-const showModelThis = ref(false);
|
|
|
-const emit = defineEmits<{
|
|
|
- (e: "cancel"): void;
|
|
|
- (e: "refresh"): void;
|
|
|
-}>();
|
|
|
+const formRef = ref<FormInstance>();
|
|
|
+const showModel = ref(false);
|
|
|
+const loading = ref(false);
|
|
|
+const titleType = ref("");
|
|
|
+const emit = defineEmits(["reload"]);
|
|
|
const id = ref("");
|
|
|
-const editType = ref("create");
|
|
|
+const TYPE = ref<FROM_TYPE>(FROM_TYPE.create);
|
|
|
const menuactionList = ref([]);
|
|
|
const action_list = ref([]);
|
|
|
const action_data_list = ref([]);
|
|
|
const private_data_list = ref([]);
|
|
|
-const formModel = {
|
|
|
+const initform = {
|
|
|
roleid: "",
|
|
|
name: "",
|
|
|
level: "1",
|
|
|
action: "",
|
|
|
private_data: ""
|
|
|
};
|
|
|
-const ruleForm = reactive<menuType>({ ...formModel });
|
|
|
+const ruleForm = ref({ ...initform });
|
|
|
const rules = reactive<FormRules>({
|
|
|
name: [
|
|
|
{ required: true, message: "请输入角色名称", trigger: "blur" },
|
|
@@ -158,13 +146,12 @@ const handleFieldChange = (checked, id, index, subIndex, item) => {
|
|
|
// this.$set(menuactionList.value, index, item);
|
|
|
// console.log(menuactionList.value[index].child[subIndex]);
|
|
|
};
|
|
|
-const submitForm = async (formEl: FormInstance | undefined) => {
|
|
|
- if (!formEl) return;
|
|
|
- await formEl.validate(async (valid, fields) => {
|
|
|
+function handleSave() {
|
|
|
+ formRef.value.validate(async valid => {
|
|
|
if (valid) {
|
|
|
- if (loading.value === true) return;
|
|
|
+ if (loading.value) return;
|
|
|
loading.value = true;
|
|
|
- const { level, name, roleid } = ruleForm;
|
|
|
+ const { level, name, roleid } = ruleForm.value;
|
|
|
|
|
|
action_list.value = []; // 字段数据
|
|
|
action_data_list.value = []; // 功能数据
|
|
@@ -187,218 +174,198 @@ const submitForm = async (formEl: FormInstance | undefined) => {
|
|
|
let model = {
|
|
|
level,
|
|
|
name,
|
|
|
- roleid,
|
|
|
- action_data: action_data_list.value, //按钮权限
|
|
|
+ id: roleid,
|
|
|
+ action_data: action_data_list.value, //角色权限
|
|
|
private_data: private_data_list.value //私有权限
|
|
|
};
|
|
|
|
|
|
- if (editType.value === "create") {
|
|
|
+ if (TYPE.value === "create") {
|
|
|
delete model["roleid"];
|
|
|
}
|
|
|
const { code, message } =
|
|
|
- editType.value === "create"
|
|
|
+ TYPE.value === "create"
|
|
|
? await httpAdd(model)
|
|
|
: await httpUpdate(model);
|
|
|
loading.value = false;
|
|
|
- if (code === 0) {
|
|
|
- ElMessage.success(titleType.value + "成功!");
|
|
|
- showModelThis.value = false;
|
|
|
- emit("refresh");
|
|
|
- } else if (code > 100 && code < 140) {
|
|
|
- showModelThis.value = false;
|
|
|
- logout();
|
|
|
- } else {
|
|
|
- ElMessage.error(message);
|
|
|
- }
|
|
|
- } else {
|
|
|
- console.log("error submit!", fields);
|
|
|
+ responseHandle({
|
|
|
+ code,
|
|
|
+ message,
|
|
|
+ logout,
|
|
|
+ handler: () => {
|
|
|
+ ElMessage.success(titleType.value + "成功!");
|
|
|
+ showModel.value = false;
|
|
|
+ emit("reload");
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
});
|
|
|
-};
|
|
|
-const resetForm = async (formEl: FormInstance | undefined, item) => {
|
|
|
- if (!formEl) return;
|
|
|
- formEl.clearValidate();
|
|
|
- formEl.resetFields();
|
|
|
- await nextTick(async () => {
|
|
|
- for (let key in ruleForm) {
|
|
|
- if (key === "role") {
|
|
|
- ruleForm[key] = item["roleid"] || "";
|
|
|
- } else {
|
|
|
- ruleForm[key] = item[key];
|
|
|
- }
|
|
|
+}
|
|
|
+
|
|
|
+const initData = async () => {
|
|
|
+ const { code, data, message } = await httpDetail({ id: id.value });
|
|
|
+ responseHandle({
|
|
|
+ code,
|
|
|
+ message,
|
|
|
+ logout,
|
|
|
+ handler: () => {
|
|
|
+ // action_list.value = [];
|
|
|
+ // action_data_list.value = [];
|
|
|
+ // private_data_list.value = [];
|
|
|
+ const { action, action_data, private_data, name, level } = data ?? {};
|
|
|
+ // console.log(action ?? []);
|
|
|
+ // console.log(action_data);
|
|
|
+ // console.log(private_data);
|
|
|
+ ruleForm.value.roleid = id.value;
|
|
|
+ ruleForm.value.name = name + "" || "";
|
|
|
+ ruleForm.value.level = level + "" || "1";
|
|
|
+ action_list.value = action ?? [];
|
|
|
+ action_data_list.value = action_data ?? [];
|
|
|
+ private_data_list.value = private_data ?? [];
|
|
|
+ // console.log(action_list.value);
|
|
|
+ // console.log(action_data_list.value);
|
|
|
+ // console.log(private_data_list.value);
|
|
|
+
|
|
|
+ const arr = JSON.parse(JSON.stringify(menuactionList.value));
|
|
|
+ arr.map(x => {
|
|
|
+ if (x.child && x.child.length > 0) {
|
|
|
+ x.child.map(y => {
|
|
|
+ if (y.action && y.action.length > 0) {
|
|
|
+ y.action.map(z => {
|
|
|
+ const Aindex =
|
|
|
+ action_list.value.length > 0
|
|
|
+ ? action_list.value.findIndex(a => a === z.id)
|
|
|
+ : -1;
|
|
|
+ if (Aindex !== -1) {
|
|
|
+ y.checkList.push(action_list.value[Aindex]);
|
|
|
+ }
|
|
|
+ return z;
|
|
|
+ });
|
|
|
+ if (y.action.length === y.checkList.length) {
|
|
|
+ y.checkAll = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (y.action_data && y.action_data.length > 0) {
|
|
|
+ y.action.map(z => {
|
|
|
+ const Bindex =
|
|
|
+ action_data_list.value.length > 0
|
|
|
+ ? action_data_list.value.findIndex(a => a === z.id)
|
|
|
+ : -1;
|
|
|
+ if (Bindex !== -1) {
|
|
|
+ y.fieldList.push(action_data_list.value[Bindex]);
|
|
|
+ }
|
|
|
+ return z;
|
|
|
+ });
|
|
|
+ if (y.action_data.length === y.fieldList.length) {
|
|
|
+ y.fieldAll = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ console.log(private_data_list.value);
|
|
|
+ // console.log(y.private);
|
|
|
+ if (y.private && y.private.length === 2) {
|
|
|
+ let Cindex =
|
|
|
+ private_data_list.value.length > 0
|
|
|
+ ? private_data_list.value.findIndex(a => a === y.id)
|
|
|
+ : -1;
|
|
|
+ if (Cindex !== -1) {
|
|
|
+ y.is_private_change = "1";
|
|
|
+ } else {
|
|
|
+ y.is_private_change = "0";
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ y.is_private_change = "0";
|
|
|
+ }
|
|
|
+ return y;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return x;
|
|
|
+ });
|
|
|
+
|
|
|
+ menuactionList.value = arr;
|
|
|
+ console.log(menuactionList.value);
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
-const closeDialog = () => {
|
|
|
- showModelThis.value = false;
|
|
|
- emit("cancel");
|
|
|
-};
|
|
|
-
|
|
|
-const loading = ref(true);
|
|
|
-const titleType = ref("");
|
|
|
-async function initForm(item: Object) {
|
|
|
+async function show(node: any, did: string, isCreate: string) {
|
|
|
loading.value = true;
|
|
|
- switch (editType.value) {
|
|
|
+ id.value = did;
|
|
|
+ Object.keys(ruleForm.value).forEach(key => {
|
|
|
+ ruleForm.value[key] =
|
|
|
+ isCreate === "create"
|
|
|
+ ? initform[key]
|
|
|
+ ? initform[key] + ""
|
|
|
+ : ""
|
|
|
+ : node[key]
|
|
|
+ ? node[key] + ""
|
|
|
+ : "";
|
|
|
+ });
|
|
|
+ TYPE.value = isCreate;
|
|
|
+ switch (TYPE.value) {
|
|
|
case "create":
|
|
|
titleType.value = "新建角色";
|
|
|
break;
|
|
|
- case "update":
|
|
|
+ case "edit":
|
|
|
titleType.value = "编辑角色";
|
|
|
break;
|
|
|
- case "preview":
|
|
|
+ case "view":
|
|
|
titleType.value = "角色详情";
|
|
|
break;
|
|
|
default:
|
|
|
titleType.value = "新建角色";
|
|
|
}
|
|
|
- const { code, data, message } = await httpMenuAll({});
|
|
|
- if (code === 0) {
|
|
|
- let arr = JSON.parse(JSON.stringify(data ?? []));
|
|
|
- arr = arr.filter(item => item.child && item.child.length > 0);
|
|
|
- arr = arr.map(x => {
|
|
|
- x.child.map(y => {
|
|
|
- y.checkAll = false;
|
|
|
- y.checkList = [];
|
|
|
- y.fieldAll = false;
|
|
|
- y.fieldList = [];
|
|
|
- y.is_private_change = "0";
|
|
|
- if (y.is_private === "0") {
|
|
|
- y.private = [];
|
|
|
- } else {
|
|
|
- y.private = [
|
|
|
- {
|
|
|
- id: "0",
|
|
|
- label: "公有数据"
|
|
|
- },
|
|
|
- {
|
|
|
- id: "1",
|
|
|
- label: "私有数据"
|
|
|
- }
|
|
|
- ];
|
|
|
- }
|
|
|
- if (y.action && y.action.length > 0) {
|
|
|
- y.action.map(z => {
|
|
|
- z.id = String(z.id);
|
|
|
- z.menuid = String(z.menuid);
|
|
|
- z.status = String(z.status);
|
|
|
- return z;
|
|
|
- });
|
|
|
- }
|
|
|
- return y;
|
|
|
- });
|
|
|
- return x;
|
|
|
- });
|
|
|
- menuactionList.value = arr;
|
|
|
- // console.log(menuactionList.value);
|
|
|
- } else if (code > 100 && code < 140) {
|
|
|
- logout();
|
|
|
- } else {
|
|
|
- ElMessage.error(message);
|
|
|
- }
|
|
|
- await resetForm(ruleFormRef.value, item);
|
|
|
- if (editType.value !== "create") {
|
|
|
+ await getMenuAll();
|
|
|
+ if (TYPE.value !== "create") {
|
|
|
await initData();
|
|
|
}
|
|
|
- // console.log(ruleForm);
|
|
|
+ showModel.value = true;
|
|
|
loading.value = false;
|
|
|
}
|
|
|
-const initData = async () => {
|
|
|
- const { code, data, message } = await httpDetail({ id: id.value });
|
|
|
- if (code === 0) {
|
|
|
- // action_list.value = [];
|
|
|
- // action_data_list.value = [];
|
|
|
- // private_data_list.value = [];
|
|
|
- const { action, action_data, private_data, name, level } = data ?? {};
|
|
|
- // console.log(action ?? []);
|
|
|
- // console.log(action_data);
|
|
|
- // console.log(private_data);
|
|
|
- ruleForm.roleid = id.value;
|
|
|
- ruleForm.name = name ?? "";
|
|
|
- ruleForm.level = level ?? "1";
|
|
|
- action_list.value = action ?? [];
|
|
|
- action_data_list.value = action_data ?? [];
|
|
|
- private_data_list.value = private_data ?? [];
|
|
|
- // console.log(action_list.value);
|
|
|
- // console.log(action_data_list.value);
|
|
|
- // console.log(private_data_list.value);
|
|
|
-
|
|
|
- const arr = JSON.parse(JSON.stringify(menuactionList.value));
|
|
|
- arr.map(x => {
|
|
|
- if (x.child && x.child.length > 0) {
|
|
|
+async function getMenuAll() {
|
|
|
+ const { code, data, message } = await httpMenuAll({});
|
|
|
+ responseHandle({
|
|
|
+ code,
|
|
|
+ message,
|
|
|
+ logout,
|
|
|
+ handler: () => {
|
|
|
+ let arr = JSON.parse(JSON.stringify(data ?? []));
|
|
|
+ arr = arr.filter(item => item.child && item.child.length > 0);
|
|
|
+ arr = arr.map(x => {
|
|
|
x.child.map(y => {
|
|
|
- if (y.action && y.action.length > 0) {
|
|
|
- y.action.map(z => {
|
|
|
- const Aindex =
|
|
|
- action_list.value.length > 0
|
|
|
- ? action_list.value.findIndex(a => a === z.id)
|
|
|
- : -1;
|
|
|
- if (Aindex !== -1) {
|
|
|
- y.checkList.push(action_list.value[Aindex]);
|
|
|
+ y.checkAll = false;
|
|
|
+ y.checkList = [];
|
|
|
+ y.fieldAll = false;
|
|
|
+ y.fieldList = [];
|
|
|
+ y.is_private_change = "0";
|
|
|
+ if (y.is_private === "0") {
|
|
|
+ y.private = [];
|
|
|
+ } else {
|
|
|
+ y.private = [
|
|
|
+ {
|
|
|
+ id: "0",
|
|
|
+ label: "公有数据"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: "1",
|
|
|
+ label: "私有数据"
|
|
|
}
|
|
|
- return z;
|
|
|
- });
|
|
|
- if (y.action.length === y.checkList.length) {
|
|
|
- y.checkAll = true;
|
|
|
- }
|
|
|
+ ];
|
|
|
}
|
|
|
- if (y.action_data && y.action_data.length > 0) {
|
|
|
+ if (y.action && y.action.length > 0) {
|
|
|
y.action.map(z => {
|
|
|
- const Bindex =
|
|
|
- action_data_list.value.length > 0
|
|
|
- ? action_data_list.value.findIndex(a => a === z.id)
|
|
|
- : -1;
|
|
|
- if (Bindex !== -1) {
|
|
|
- y.fieldList.push(action_data_list.value[Bindex]);
|
|
|
- }
|
|
|
+ z.id = String(z.id);
|
|
|
+ z.menuid = String(z.menuid);
|
|
|
+ z.status = String(z.status);
|
|
|
return z;
|
|
|
});
|
|
|
- if (y.action_data.length === y.fieldList.length) {
|
|
|
- y.fieldAll = true;
|
|
|
- }
|
|
|
- }
|
|
|
- console.log(private_data_list.value);
|
|
|
- // console.log(y.private);
|
|
|
- if (y.private && y.private.length === 2) {
|
|
|
- let Cindex =
|
|
|
- private_data_list.value.length > 0
|
|
|
- ? private_data_list.value.findIndex(a => a === y.id)
|
|
|
- : -1;
|
|
|
- if (Cindex !== -1) {
|
|
|
- y.is_private_change = "1";
|
|
|
- } else {
|
|
|
- y.is_private_change = "0";
|
|
|
- }
|
|
|
- } else {
|
|
|
- y.is_private_change = "0";
|
|
|
}
|
|
|
return y;
|
|
|
});
|
|
|
- }
|
|
|
- return x;
|
|
|
- });
|
|
|
-
|
|
|
- menuactionList.value = arr;
|
|
|
- console.log(menuactionList.value);
|
|
|
- } else if (code >= 100 && code <= 104) {
|
|
|
- logout();
|
|
|
- } else {
|
|
|
- ElMessage.warning(message);
|
|
|
- }
|
|
|
-};
|
|
|
-watch(
|
|
|
- () => {
|
|
|
- return props.showModel;
|
|
|
- },
|
|
|
- () => {
|
|
|
- const { showModel, itemId, isDetails } = props;
|
|
|
- showModelThis.value = showModel;
|
|
|
- if (showModelThis.value) {
|
|
|
- id.value = itemId;
|
|
|
- editType.value = isDetails;
|
|
|
- initForm(formModel);
|
|
|
+ return x;
|
|
|
+ });
|
|
|
+ menuactionList.value = arr;
|
|
|
}
|
|
|
- }
|
|
|
-);
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
let indeterminateCheck = computed(() => {
|
|
|
return item => {
|
|
|
// 选中子节点的数量
|
|
@@ -435,27 +402,29 @@ let indeterminateField = computed(() => {
|
|
|
return selectItemLength > 0 && noSlectItemLength > 0;
|
|
|
};
|
|
|
});
|
|
|
+defineExpose({
|
|
|
+ show
|
|
|
+});
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
|
<el-dialog
|
|
|
:close-on-press-escape="false"
|
|
|
- v-model="showModelThis"
|
|
|
+ v-model="showModel"
|
|
|
append-to-body
|
|
|
center
|
|
|
:top="'5vh'"
|
|
|
:width="'900px'"
|
|
|
:title="titleType"
|
|
|
v-loading="loading"
|
|
|
- @close="closeDialog"
|
|
|
>
|
|
|
<el-form
|
|
|
- ref="ruleFormRef"
|
|
|
+ ref="formRef"
|
|
|
:model="ruleForm"
|
|
|
:rules="rules"
|
|
|
label-width="90px"
|
|
|
class="role-addedit"
|
|
|
- :size="formSize"
|
|
|
+ :size="'small'"
|
|
|
status-icon
|
|
|
>
|
|
|
<el-row>
|
|
@@ -463,7 +432,7 @@ let indeterminateField = computed(() => {
|
|
|
<el-form-item label="角色名称" prop="name">
|
|
|
<el-input
|
|
|
v-model="ruleForm.name"
|
|
|
- :disabled="editType === 'view'"
|
|
|
+ :disabled="TYPE === 'view'"
|
|
|
placeholder="角色名称"
|
|
|
/> </el-form-item
|
|
|
></el-col>
|
|
@@ -472,7 +441,7 @@ let indeterminateField = computed(() => {
|
|
|
<el-select
|
|
|
v-model="ruleForm.level"
|
|
|
style="width: 100%"
|
|
|
- :disabled="editType === 'view'"
|
|
|
+ :disabled="TYPE === 'view'"
|
|
|
placeholder="菜单类型"
|
|
|
>
|
|
|
<el-option
|
|
@@ -530,7 +499,8 @@ let indeterminateField = computed(() => {
|
|
|
<span class="_h2">{{ subItem.menu_name }}</span>
|
|
|
<el-radio-group
|
|
|
style="margin: 0 0 0 20px"
|
|
|
- :size="'mini'"
|
|
|
+ :size="'small'"
|
|
|
+ :disabled="TYPE === 'view'"
|
|
|
v-if="
|
|
|
subItem &&
|
|
|
subItem.private &&
|
|
@@ -542,6 +512,8 @@ let indeterminateField = computed(() => {
|
|
|
v-for="(radioN, ri) in subItem.private"
|
|
|
:key="radioN.label + ri"
|
|
|
:label="radioN.id"
|
|
|
+ :disabled="TYPE === 'view'"
|
|
|
+ :size="'small'"
|
|
|
>{{ radioN.label }}</el-radio-button
|
|
|
>
|
|
|
</el-radio-group>
|
|
@@ -553,7 +525,8 @@ let indeterminateField = computed(() => {
|
|
|
<div class="checkAll">
|
|
|
<el-checkbox
|
|
|
v-model="subItem.checkAll"
|
|
|
- :disabled="editType === 'view'"
|
|
|
+ :disabled="TYPE === 'view'"
|
|
|
+ :size="'small'"
|
|
|
:indeterminate="indeterminateCheck(subItem)"
|
|
|
@change="
|
|
|
handleCheckAllChange(
|
|
@@ -569,7 +542,8 @@ let indeterminateField = computed(() => {
|
|
|
<div class="checkItem">
|
|
|
<el-checkbox-group
|
|
|
v-model="subItem.checkList"
|
|
|
- :disabled="editType === 'view'"
|
|
|
+ :size="'small'"
|
|
|
+ :disabled="TYPE === 'view'"
|
|
|
@change="
|
|
|
handleCheckedGroupChange(
|
|
|
$event,
|
|
@@ -580,8 +554,9 @@ let indeterminateField = computed(() => {
|
|
|
"
|
|
|
>
|
|
|
<el-checkbox
|
|
|
- :disabled="editType === 'view'"
|
|
|
+ :disabled="TYPE === 'view'"
|
|
|
v-for="children in subItem.action"
|
|
|
+ :size="'small'"
|
|
|
:key="'checkItem' + children.id"
|
|
|
:label="children.id"
|
|
|
@change="
|
|
@@ -608,7 +583,8 @@ let indeterminateField = computed(() => {
|
|
|
<div class="checkAll">
|
|
|
<el-checkbox
|
|
|
v-model="subItem.fieldAll"
|
|
|
- :disabled="editType === 'view'"
|
|
|
+ :disabled="TYPE === 'view'"
|
|
|
+ :size="'small'"
|
|
|
:indeterminate="indeterminateField(subItem)"
|
|
|
@change="
|
|
|
handleFieldAllChange(
|
|
@@ -624,7 +600,8 @@ let indeterminateField = computed(() => {
|
|
|
<div class="checkItem">
|
|
|
<el-checkbox-group
|
|
|
v-model="subItem.fieldList"
|
|
|
- :disabled="editType === 'view'"
|
|
|
+ :size="'small'"
|
|
|
+ :disabled="TYPE === 'view'"
|
|
|
@change="
|
|
|
handleFieldGroupChange(
|
|
|
$event,
|
|
@@ -638,7 +615,8 @@ let indeterminateField = computed(() => {
|
|
|
v-for="children in subItem.action_data"
|
|
|
:key="'FieldItem' + children.id"
|
|
|
:label="children.id"
|
|
|
- :disabled="editType === 'view'"
|
|
|
+ :size="'small'"
|
|
|
+ :disabled="TYPE === 'view'"
|
|
|
@change="
|
|
|
handleFieldChange(
|
|
|
$event,
|
|
@@ -665,16 +643,20 @@ let indeterminateField = computed(() => {
|
|
|
</el-row>
|
|
|
<el-col :span="24" class="clear">
|
|
|
<el-button
|
|
|
- v-if="editType === 'create' || editType === 'edit'"
|
|
|
+ class="fr"
|
|
|
+ style="margin: 10px 0 0 16px"
|
|
|
+ @click="showModel = false"
|
|
|
+ >关闭</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ v-if="TYPE === 'create' || TYPE === 'edit'"
|
|
|
type="primary"
|
|
|
class="fr"
|
|
|
- style="margin: 0 0 0 16px"
|
|
|
- @click="submitForm(ruleFormRef)"
|
|
|
+ :disabled="loading"
|
|
|
+ style="margin: 10px 0 0 16px"
|
|
|
+ @click="handleSave"
|
|
|
>保存</el-button
|
|
|
>
|
|
|
- <el-button class="fr" style="margin: 0 0 0 16px" @click="closeDialog"
|
|
|
- >关闭</el-button
|
|
|
- >
|
|
|
</el-col>
|
|
|
</el-form>
|
|
|
</el-dialog>
|