|
@@ -0,0 +1,191 @@
|
|
|
+<script lang="ts">
|
|
|
+// 声明额外的选项
|
|
|
+export default {
|
|
|
+ name: "Edit"
|
|
|
+};
|
|
|
+</script>
|
|
|
+<script setup lang="ts">
|
|
|
+import { inject, ref } from "vue";
|
|
|
+import { useRenderIcon } from "@/components/ReIcon/src/hooks";
|
|
|
+import { ElMessage, ElMessageBox } from "element-plus";
|
|
|
+import Upload from "@iconify-icons/ri/upload-2-fill"
|
|
|
+import Close from "@iconify-icons/ri/close-fill"
|
|
|
+import { http } from "@/utils/http";
|
|
|
+// 获取URLLIST
|
|
|
+import { getGroupUrl } from "@/utils/getUrl/getUrl";
|
|
|
+
|
|
|
+const props = defineProps<{
|
|
|
+ editVisible: {
|
|
|
+ type: Boolean;
|
|
|
+ default: false;
|
|
|
+ };
|
|
|
+ width: {
|
|
|
+ type: Number;
|
|
|
+ default: 50;
|
|
|
+ };
|
|
|
+ formData: {
|
|
|
+ type: Object;
|
|
|
+ default: {};
|
|
|
+ };
|
|
|
+}>();
|
|
|
+// 表单数据
|
|
|
+let UpdateForm: any = ref({
|
|
|
+ name: "", //菜单名称
|
|
|
+ enName: "", //英文名称
|
|
|
+ permission: "", //权限标识
|
|
|
+ path: "", //路由路径
|
|
|
+ parentId: "", //父菜单ID
|
|
|
+ icon: "", //菜单图标
|
|
|
+ visible: "", //是否可见,0隐藏,1显示
|
|
|
+ sortOrder: "", //排序值,越小越靠前
|
|
|
+ keepAlive: "", //是否缓存,0否,1是
|
|
|
+ embedded: "", //是否内嵌,0否,1是
|
|
|
+ menuType: "", //菜单类型,0目录,1菜单,2按钮
|
|
|
+
|
|
|
+});
|
|
|
+
|
|
|
+// 选项卡参数(默认值为列表某项的id)
|
|
|
+const activeId = ref('1')
|
|
|
+// 提交函数
|
|
|
+const submit = async () => {
|
|
|
+ const UrlList = await getGroupUrl(['KxsConfigServer']);
|
|
|
+ const { status, msg }: any = await http.Request({ method: UrlList.KxsConfigServer.SysMenuupdate.method, url: UrlList.KxsConfigServer.SysMenuupdate.url, params: UpdateForm.value});
|
|
|
+ if (status === 1) {
|
|
|
+ ElMessage({
|
|
|
+ message: "修改成功",
|
|
|
+ type: "success"
|
|
|
+ });
|
|
|
+ UpdateForm.value = {
|
|
|
+ name: "", //菜单名称
|
|
|
+ enName: "", //英文名称
|
|
|
+ permission: "", //权限标识
|
|
|
+ path: "", //路由路径
|
|
|
+ parentId: "", //父菜单ID
|
|
|
+ icon: "", //菜单图标
|
|
|
+ visible: "", //是否可见,0隐藏,1显示
|
|
|
+ sortOrder: "", //排序值,越小越靠前
|
|
|
+ keepAlive: "", //是否缓存,0否,1是
|
|
|
+ embedded: "", //是否内嵌,0否,1是
|
|
|
+ menuType: "", //菜单类型,0目录,1菜单,2按钮
|
|
|
+
|
|
|
+ };
|
|
|
+ closeVisible();
|
|
|
+ } else {
|
|
|
+ ElMessageBox.alert(msg, "提示", {
|
|
|
+ confirmButtonText: "关闭",
|
|
|
+ type: "warning"
|
|
|
+ });
|
|
|
+ };
|
|
|
+};
|
|
|
+// 关闭弹窗回调函数
|
|
|
+const closeFn: any = inject('closeEditVisible');
|
|
|
+const openVisible = async () => {
|
|
|
+ //通过ID获取表格数据
|
|
|
+ const UrlList = await getGroupUrl(['KxsConfigServer']);
|
|
|
+ const { status, data }: any = await http.Request({method: UrlList.KxsConfigServer.SysMenuquery.method, url: UrlList.KxsConfigServer.SysMenuquery.url, params: props.formData});
|
|
|
+ if (status === 1) {
|
|
|
+ UpdateForm.value = data;
|
|
|
+ }
|
|
|
+};
|
|
|
+// 关闭弹窗回调函数
|
|
|
+const closeVisible = () => {
|
|
|
+ UpdateForm.value = {
|
|
|
+ groupName: "", //名称
|
|
|
+ groupRemark: "", //说明
|
|
|
+ groupVersion: "", //版本号
|
|
|
+
|
|
|
+ };
|
|
|
+ closeFn();
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<template lang="pug">
|
|
|
+.main
|
|
|
+ el-dialog(v-model='props.editVisible' width="50%" title="修改" @close="closeVisible()" @open="openVisible")
|
|
|
+ el-form(:model='UpdateForm' label-position="right" label-width="100px")
|
|
|
+ el-form-item(label='菜单名称' prop="name")
|
|
|
+ el-input(v-model='UpdateForm.name' autocomplete='off' class="!w-[230px]"
|
|
|
+ placeholder="请输入菜单名称")
|
|
|
+ el-form-item(label='英文名称' prop="enName")
|
|
|
+ el-input(v-model='UpdateForm.enName' autocomplete='off' class="!w-[230px]"
|
|
|
+ placeholder="请输入英文名称")
|
|
|
+ el-form-item(label='权限标识' prop="permission")
|
|
|
+ el-input(v-model='UpdateForm.permission' autocomplete='off' class="!w-[230px]"
|
|
|
+ placeholder="请输入权限标识")
|
|
|
+ el-form-item(label='路由路径' prop="path")
|
|
|
+ el-input(v-model='UpdateForm.path' autocomplete='off' class="!w-[230px]"
|
|
|
+ placeholder="请输入路由路径")
|
|
|
+ el-form-item(label='父菜单ID' prop="parentId")
|
|
|
+ el-input(v-model='UpdateForm.parentId' autocomplete='off' class="!w-[230px]"
|
|
|
+ placeholder="请输入父菜单ID")
|
|
|
+ el-form-item(label='菜单图标' prop="icon")
|
|
|
+ el-input(v-model='UpdateForm.icon' autocomplete='off' class="!w-[230px]"
|
|
|
+ placeholder="请输入菜单图标")
|
|
|
+ el-form-item(label='是否可见,0隐藏,1显示' prop="visible")
|
|
|
+ el-input(v-model='UpdateForm.visible' autocomplete='off' class="!w-[230px]"
|
|
|
+ placeholder="请输入是否可见,0隐藏,1显示")
|
|
|
+ el-form-item(label='排序值,越小越靠前' prop="sortOrder")
|
|
|
+ el-input(v-model='UpdateForm.sortOrder' autocomplete='off' class="!w-[230px]"
|
|
|
+ placeholder="请输入排序值,越小越靠前")
|
|
|
+ el-form-item(label='是否缓存,0否,1是' prop="keepAlive")
|
|
|
+ el-input(v-model='UpdateForm.keepAlive' autocomplete='off' class="!w-[230px]"
|
|
|
+ placeholder="请输入是否缓存,0否,1是")
|
|
|
+ el-form-item(label='是否内嵌,0否,1是' prop="embedded")
|
|
|
+ el-input(v-model='UpdateForm.embedded' autocomplete='off' class="!w-[230px]"
|
|
|
+ placeholder="请输入是否内嵌,0否,1是")
|
|
|
+ el-form-item(label='菜单类型,0目录,1菜单,2按钮' prop="menuType")
|
|
|
+ el-input(v-model='UpdateForm.menuType' autocomplete='off' class="!w-[230px]"
|
|
|
+ placeholder="请输入菜单类型,0目录,1菜单,2按钮")
|
|
|
+
|
|
|
+ el-button(
|
|
|
+ :icon="useRenderIcon(Close)",
|
|
|
+ :loading="loading",
|
|
|
+ @click="closeVisible()"
|
|
|
+ ) 关闭
|
|
|
+ el-button(
|
|
|
+ type="primary",
|
|
|
+ :icon="useRenderIcon(Upload)",
|
|
|
+ :loading="loading",
|
|
|
+ @click="submit"
|
|
|
+ ) 确认提交
|
|
|
+</template>
|
|
|
+
|
|
|
+<style scoped lang="scss">
|
|
|
+:deep(.el-dropdown-menu__item i) {
|
|
|
+ margin: 0;
|
|
|
+}
|
|
|
+
|
|
|
+:deep(.el-form-item__label) {
|
|
|
+ font-weight: 700;
|
|
|
+}
|
|
|
+
|
|
|
+:deep(.el-pagination) {
|
|
|
+ flex-flow: wrap;
|
|
|
+}
|
|
|
+
|
|
|
+:deep(.is-draggable) {
|
|
|
+ max-height: 80vh;
|
|
|
+ overflow: auto;
|
|
|
+}
|
|
|
+
|
|
|
+:deep(.el-dialog__header) {
|
|
|
+ position: sticky;
|
|
|
+ top: 0;
|
|
|
+ z-index: 2;
|
|
|
+ background: #fff;
|
|
|
+}
|
|
|
+
|
|
|
+.collapsedom {
|
|
|
+ padding: 0 20px;
|
|
|
+ background-color: #fff;
|
|
|
+}
|
|
|
+
|
|
|
+.ovh-x {
|
|
|
+ height: 40vh;
|
|
|
+ overflow-y: auto;
|
|
|
+}
|
|
|
+
|
|
|
+:deep(.el-descriptions__header) {
|
|
|
+ margin: 16px 0 !important;
|
|
|
+}
|
|
|
+</style>
|