|
@@ -0,0 +1,615 @@
|
|
|
+<script setup lang="tsx">
|
|
|
+import SvgIcon from '@/components/custom/svg-icon.vue';
|
|
|
+import { menuTypeOptions } from '@/constants/business';
|
|
|
+import { useAntdForm, useFormRules } from '@/hooks/common/form';
|
|
|
+import { $t } from '@/locales';
|
|
|
+import { fetchAddMenu, fetchGetMenuDetail, fetchGetMenuList, fetchGetSysApiList, fetchUpdateMenu } from '@/service/api';
|
|
|
+import { getLocalIcons } from '@/utils/icon';
|
|
|
+import { SimpleScrollbar } from '@sa/materials';
|
|
|
+import { computed, nextTick, reactive, ref, watch } from 'vue';
|
|
|
+// import {
|
|
|
+// getLayoutAndPage,
|
|
|
+// getPathParamFromRoutePath,
|
|
|
+// getRoutePathByRouteName,
|
|
|
+// getRoutePathWithParam,
|
|
|
+// transformLayoutAndPageToComponent
|
|
|
+// } from './shared';
|
|
|
+
|
|
|
+import {
|
|
|
+QuestionCircleFilled
|
|
|
+} from '@ant-design/icons-vue';
|
|
|
+defineOptions({
|
|
|
+ name: 'MenuOperateModal'
|
|
|
+});
|
|
|
+const menuOptions = ref([])
|
|
|
+const sysapiList = ref([])
|
|
|
+export type OperateType = AntDesign.TableOperateType | 'addChild';
|
|
|
+interface Option {
|
|
|
+ label: string;
|
|
|
+ value: string;
|
|
|
+}
|
|
|
+interface Props {
|
|
|
+ /** the type of operation */
|
|
|
+ operateType: OperateType;
|
|
|
+ /** the edit menu data or the parent menu data when adding a child menu */
|
|
|
+ rowData?: Api.SystemManage.Menu | null;
|
|
|
+ /** all pages */
|
|
|
+ allPages: string[];
|
|
|
+ visibleOptions: Option[];
|
|
|
+}
|
|
|
+
|
|
|
+const props = defineProps<Props>();
|
|
|
+
|
|
|
+interface Emits {
|
|
|
+ (e: 'submitted'): void;
|
|
|
+}
|
|
|
+
|
|
|
+const emit = defineEmits<Emits>();
|
|
|
+
|
|
|
+const visible = defineModel<boolean>('visible', {
|
|
|
+ default: false
|
|
|
+});
|
|
|
+
|
|
|
+const { formRef, validate, resetFields } = useAntdForm();
|
|
|
+const { defaultRequiredRule } = useFormRules();
|
|
|
+
|
|
|
+const title = computed(() => {
|
|
|
+ const titles: Record<OperateType, string> = {
|
|
|
+ add: $t('page.manage.menu.addMenu'),
|
|
|
+ addChild: $t('page.manage.menu.addChildMenu'),
|
|
|
+ edit: $t('page.manage.menu.editMenu')
|
|
|
+ };
|
|
|
+ return titles[props.operateType];
|
|
|
+});
|
|
|
+
|
|
|
+type Model = Pick<
|
|
|
+ Api.SystemManage.Menu,
|
|
|
+ | 'menuType'
|
|
|
+ | 'menuName'
|
|
|
+ | 'path'
|
|
|
+ | 'component'
|
|
|
+ | 'sort'
|
|
|
+ | 'i18nKey'
|
|
|
+ | 'icon'
|
|
|
+ | 'visible'
|
|
|
+ | 'parentId'
|
|
|
+ | 'isFrame'
|
|
|
+ | 'permission'
|
|
|
+ | 'title'
|
|
|
+ | 'apis'
|
|
|
+> & {
|
|
|
+ // query: NonNullable<Api.SystemManage.Menu['query']>;
|
|
|
+ // buttons: NonNullable<Api.SystemManage.Menu['buttons']>;
|
|
|
+ layout: string;
|
|
|
+ path: string;
|
|
|
+};
|
|
|
+
|
|
|
+const model: Model = reactive(createDefaultModel());
|
|
|
+
|
|
|
+function createDefaultModel(): Model {
|
|
|
+ return {
|
|
|
+ menuType: 'M',
|
|
|
+ title: '',
|
|
|
+ path: '',
|
|
|
+ component: '',
|
|
|
+ layout: '',
|
|
|
+ // i18nKey: null,
|
|
|
+ icon: '',
|
|
|
+ parentId: 0,
|
|
|
+ visible: '0',
|
|
|
+ isFrame: '1',
|
|
|
+ sort: 0,
|
|
|
+ menuName: '',
|
|
|
+ permission: '',
|
|
|
+ apis: []
|
|
|
+ };
|
|
|
+}
|
|
|
+
|
|
|
+type RuleKey = Extract<keyof Model, 'title' >;
|
|
|
+
|
|
|
+const rules: Record<RuleKey, App.Global.FormRule> = {
|
|
|
+ title: defaultRequiredRule
|
|
|
+};
|
|
|
+
|
|
|
+const isEdit = computed(() => props.operateType === 'edit');
|
|
|
+
|
|
|
+const localIcons = getLocalIcons();
|
|
|
+const localIconOptions = localIcons.map(item => ({
|
|
|
+ label: () => (
|
|
|
+ <div class="flex-y-center gap-16px">
|
|
|
+ <SvgIcon localIcon={item} class="text-icon" />
|
|
|
+ <span>{item}</span>
|
|
|
+ </div>
|
|
|
+ ),
|
|
|
+ value: item
|
|
|
+}));
|
|
|
+
|
|
|
+const showLayout = computed(() => model.parentId === 0);
|
|
|
+
|
|
|
+
|
|
|
+const layoutOptions: CommonType.Option[] = [
|
|
|
+ {
|
|
|
+ label: 'base',
|
|
|
+ value: 'base'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: 'blank',
|
|
|
+ value: 'blank'
|
|
|
+ }
|
|
|
+];
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+/** - add a query input */
|
|
|
+// function addQuery(index: number) {
|
|
|
+// model.query.splice(index + 1, 0, {
|
|
|
+// key: '',
|
|
|
+// value: ''
|
|
|
+// });
|
|
|
+// }
|
|
|
+
|
|
|
+// /** - remove a query input */
|
|
|
+// function removeQuery(index: number) {
|
|
|
+// model.query.splice(index, 1);
|
|
|
+// }
|
|
|
+
|
|
|
+/** - add a button input */
|
|
|
+// function addButton(index: number) {
|
|
|
+// model.buttons.splice(index + 1, 0, {
|
|
|
+// code: '',
|
|
|
+// desc: ''
|
|
|
+// });
|
|
|
+// }
|
|
|
+
|
|
|
+// /** - remove a button input */
|
|
|
+// function removeButton(index: number) {
|
|
|
+// model.buttons.splice(index, 1);
|
|
|
+// }
|
|
|
+
|
|
|
+async function handleInitModel() {
|
|
|
+ Object.assign(model, createDefaultModel());
|
|
|
+
|
|
|
+ if (!props.rowData) return;
|
|
|
+
|
|
|
+ await nextTick();
|
|
|
+
|
|
|
+ if (props.operateType === 'addChild') {
|
|
|
+ const { menuId } = props.rowData;
|
|
|
+
|
|
|
+ Object.assign(model, { parentId: menuId });
|
|
|
+ }
|
|
|
+
|
|
|
+ if (props.operateType === 'edit') {
|
|
|
+ const { menuId } = props.rowData;
|
|
|
+ // const { apis, component, ...rest } = props.rowData;
|
|
|
+
|
|
|
+ // const { layout, page } = getLayoutAndPage(component);
|
|
|
+ // const { path, param } = getPathParamFromRoutePath(rest.path);
|
|
|
+ const res:any = await fetchGetMenuDetail(menuId)
|
|
|
+ if (res && res.code === 200) {
|
|
|
+ Object.assign(model, res.data );
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+function closeDrawer() {
|
|
|
+ visible.value = false;
|
|
|
+}
|
|
|
+
|
|
|
+// function handleUpdateRoutePathByRouteName() {
|
|
|
+// if (model.routeName) {
|
|
|
+// model.path = getRoutePathByRouteName(model.routeName);
|
|
|
+// } else {
|
|
|
+// model.path = '';
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
+// function handleUpdateI18nKeyByRouteName() {
|
|
|
+// if (model.routeName) {
|
|
|
+// model.i18nKey = `route.${model.routeName}` as App.I18n.I18nKey;
|
|
|
+// } else {
|
|
|
+// model.i18nKey = null;
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
+function getSubmitParams() {
|
|
|
+ const { layout, path, ...params } = model;
|
|
|
+
|
|
|
+ // const component = transformLayoutAndPageToComponent(layout, model.page);
|
|
|
+ // const routePath = getRoutePathWithParam(model.path, pathParam);
|
|
|
+
|
|
|
+ // params.component = component;
|
|
|
+ // params.path = routePath;
|
|
|
+ params.path = path
|
|
|
+
|
|
|
+ return params;
|
|
|
+}
|
|
|
+
|
|
|
+async function handleSubmit() {
|
|
|
+ await validate();
|
|
|
+
|
|
|
+ const params = getSubmitParams();
|
|
|
+ let res:any = {}
|
|
|
+ // request
|
|
|
+ if(isEdit.value) {
|
|
|
+ if (params.menuType === 'M'){
|
|
|
+ model.apis = []
|
|
|
+ params.apis = []
|
|
|
+ }
|
|
|
+ res = await fetchUpdateMenu(params, props.rowData.menuId)
|
|
|
+ } else {
|
|
|
+ res = await fetchAddMenu(params)
|
|
|
+ }
|
|
|
+ if (res && res.code == 200) {
|
|
|
+ if(isEdit.value){
|
|
|
+ window.$message?.success($t('common.updateSuccess'));
|
|
|
+ } else {
|
|
|
+ window.$message?.success('添加成功');
|
|
|
+ }
|
|
|
+
|
|
|
+ } else {
|
|
|
+ window.$message?.error(res.msg || '更新失败!');
|
|
|
+ }
|
|
|
+
|
|
|
+ closeDrawer();
|
|
|
+ emit('submitted');
|
|
|
+}
|
|
|
+/** 查询菜单下拉树结构 */
|
|
|
+function getTreeselect() {
|
|
|
+ fetchGetMenuList().then((response:any) => {
|
|
|
+ if (response.code === 200) {
|
|
|
+ menuOptions.value = []
|
|
|
+ const menu = { menuId: 0, title: '主类目', children: [] }
|
|
|
+ menu.children = response.data
|
|
|
+ menuOptions.value.push(menu)
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+async function getApiList() {
|
|
|
+ const res:any = await fetchGetSysApiList({ 'pageSize': 10000, 'type': 'BUS' })
|
|
|
+ if (res && res.code === 200) {
|
|
|
+ sysapiList.value = res.data.list
|
|
|
+ }
|
|
|
+}
|
|
|
+function handelChangeType() {
|
|
|
+ model.apis = []
|
|
|
+}
|
|
|
+watch(visible, () => {
|
|
|
+ if (visible.value) {
|
|
|
+ handleInitModel();
|
|
|
+ resetFields();
|
|
|
+ getTreeselect();
|
|
|
+ getApiList();
|
|
|
+ }
|
|
|
+});
|
|
|
+
|
|
|
+// watch(
|
|
|
+// () => model.routeName,
|
|
|
+// () => {
|
|
|
+// handleUpdateRoutePathByRouteName();
|
|
|
+// handleUpdateI18nKeyByRouteName();
|
|
|
+// }
|
|
|
+// );
|
|
|
+</script>
|
|
|
+
|
|
|
+<template>
|
|
|
+ <AModal v-model:open="visible" :title="title" width="800px">
|
|
|
+ <div class="h-480px">
|
|
|
+ <SimpleScrollbar>
|
|
|
+ <AForm ref="formRef" :model="model" :rules="rules" :label-col="{ lg: 8, xs: 4 }" label-wrap class="pr-20px">
|
|
|
+ <ARow wrap>
|
|
|
+ <ACol :lg="12" :xs="24">
|
|
|
+ <AFormItem label="上级菜单" name="parentId">
|
|
|
+ <ATreeSelect v-model:value="model.parentId" show-search :tree-data="menuOptions"
|
|
|
+ :fieldNames="{value: 'menuId', children: 'children', label: 'title'}"
|
|
|
+ placeholder="选择上级菜单" allowClear/>
|
|
|
+ </AFormItem>
|
|
|
+ </ACol>
|
|
|
+ <ACol :lg="12" :xs="24">
|
|
|
+ <AFormItem name="title">
|
|
|
+ <template #label>
|
|
|
+ <span class="marginRight5">{{$t('page.manage.menu.menuName')}}</span>
|
|
|
+ <ATooltip>
|
|
|
+ <template #title>菜单位置显示的说明信息.</template>
|
|
|
+ <QuestionCircleFilled />
|
|
|
+ </ATooltip>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <AInput v-model:value="model.title" :placeholder="$t('page.manage.menu.form.menuName')" allowClear/>
|
|
|
+ </AFormItem>
|
|
|
+ </ACol>
|
|
|
+ <ACol :lg="12" :xs="24">
|
|
|
+ <AFormItem name="sort">
|
|
|
+ <template #label>
|
|
|
+ <span class="marginRight5">显示排序</span>
|
|
|
+ <ATooltip>
|
|
|
+ <template #title>根据序号升序排列</template>
|
|
|
+ <QuestionCircleFilled />
|
|
|
+ </ATooltip>
|
|
|
+ </template>
|
|
|
+ <AInputNumber v-model:value="model.sort as number" :placeholder="$t('page.manage.menu.form.order')" class="w-full" />
|
|
|
+
|
|
|
+ </AFormItem>
|
|
|
+ </ACol>
|
|
|
+ <ACol :lg="12" :xs="24">
|
|
|
+ <AFormItem name="menuType">
|
|
|
+ <template #label>
|
|
|
+ <span class="marginRight5">{{ $t('page.manage.menu.menuType') }}</span>
|
|
|
+ <ATooltip>
|
|
|
+ <template #title>包含目录:以及菜单或者菜单组,菜单:具体对应某一个页面,按钮:功能才做按钮;</template>
|
|
|
+ <QuestionCircleFilled />
|
|
|
+ </ATooltip>
|
|
|
+ </template>
|
|
|
+ <ARadioGroup v-model:value="model.menuType" >
|
|
|
+ <ARadio v-for="item in menuTypeOptions" :key="item.value" :value="item.value" @change="handelChangeType">
|
|
|
+ {{ $t(item.label) }}
|
|
|
+ </ARadio>
|
|
|
+ </ARadioGroup>
|
|
|
+ </AFormItem>
|
|
|
+ </ACol>
|
|
|
+
|
|
|
+ <ACol :lg="12" :xs="24" v-if="model.menuType == 'M' || model.menuType == 'C'">
|
|
|
+ <AFormItem name="menuName" >
|
|
|
+ <template #label>
|
|
|
+ <span class="marginRight5">{{ $t('page.manage.menu.routeName') }}</span>
|
|
|
+ <ATooltip>
|
|
|
+ <template #title>需要和页面name保持一致,对应页面即可选择缓存.</template>
|
|
|
+ <QuestionCircleFilled />
|
|
|
+ </ATooltip>
|
|
|
+ </template>
|
|
|
+ <AInput v-model:value="model.menuName" :placeholder="$t('page.manage.menu.form.routeName')" allowClear/>
|
|
|
+ </AFormItem>
|
|
|
+ </ACol>
|
|
|
+ <ACol :lg="12" :xs="24" v-if="model.menuType == 'M' || model.menuType == 'C'" >
|
|
|
+ <AFormItem name="component">
|
|
|
+ <template #label>
|
|
|
+ <span class="marginRight5">{{ $t('page.manage.menu.routePath') }}</span>
|
|
|
+ <ATooltip>
|
|
|
+ <template #title>菜单对应的具体vue页面文件路径;</template>
|
|
|
+ <QuestionCircleFilled />
|
|
|
+ </ATooltip>
|
|
|
+ </template>
|
|
|
+ <AInput v-model:value="model.component" :placeholder="$t('page.manage.menu.form.routePath')" allowClear/>
|
|
|
+ </AFormItem>
|
|
|
+ </ACol>
|
|
|
+
|
|
|
+ <ACol :lg="12" :xs="24" v-if="model.menuType != 'F'">
|
|
|
+ <AFormItem label="路由地址" name="path">
|
|
|
+ <AInput v-model:value="model.path" placeholder="请输入路由地址" allowClear/>
|
|
|
+ </AFormItem>
|
|
|
+ </ACol>
|
|
|
+ <ACol :lg="12" :xs="24" v-if="showLayout">
|
|
|
+ <AFormItem :label="$t('page.manage.menu.layout')" name="layout">
|
|
|
+ <ASelect
|
|
|
+ v-model:value="model.layout"
|
|
|
+ :options="layoutOptions"
|
|
|
+ :placeholder="$t('page.manage.menu.form.layout')"
|
|
|
+ allowClear
|
|
|
+ />
|
|
|
+ </AFormItem>
|
|
|
+ </ACol>
|
|
|
+
|
|
|
+ <!-- <ACol :lg="12" :xs="24">
|
|
|
+ <AFormItem :label="$t('page.manage.menu.i18nKey')" name="i18nKey">
|
|
|
+ <AInput v-model:value="model.i18nKey as string" :placeholder="$t('page.manage.menu.form.i18nKey')" />
|
|
|
+ </AFormItem>
|
|
|
+ </ACol> -->
|
|
|
+ <!-- <ACol :lg="12" :xs="24">
|
|
|
+ <AFormItem :label="$t('page.manage.menu.iconTypeTitle')" name="iconType">
|
|
|
+ <ARadioGroup v-model:value="model.iconType">
|
|
|
+ <ARadio v-for="item in menuIconTypeOptions" :key="item.value" :value="item.value">
|
|
|
+ {{ $t(item.label) }}
|
|
|
+ </ARadio>
|
|
|
+ </ARadioGroup>
|
|
|
+ </AFormItem>
|
|
|
+ </ACol> -->
|
|
|
+
|
|
|
+ <ACol :lg="12" :xs="24">
|
|
|
+ <AFormItem :label="$t('page.manage.menu.icon')" name="icon">
|
|
|
+ <!-- <template v-if="model.iconType === '1'">
|
|
|
+ <AInput v-model:value="model.icon" :placeholder="$t('page.manage.menu.form.icon')" class="flex-1">
|
|
|
+ <template #suffix>
|
|
|
+ <SvgIcon v-if="model.icon" :icon="model.icon" class="text-icon" />
|
|
|
+ </template>
|
|
|
+ </AInput>
|
|
|
+ </template> -->
|
|
|
+ <ASelect
|
|
|
+ v-model:value="model.icon"
|
|
|
+ :placeholder="$t('page.manage.menu.form.localIcon')"
|
|
|
+ :options="localIconOptions"
|
|
|
+ allowClear
|
|
|
+ />
|
|
|
+ </AFormItem>
|
|
|
+ </ACol>
|
|
|
+ <ACol :lg="12" :xs="24">
|
|
|
+ <AFormItem name="visible">
|
|
|
+ <template #label>
|
|
|
+ <span class="marginRight5">{{$t('page.manage.menu.menuStatus') }}</span>
|
|
|
+ <ATooltip>
|
|
|
+ <template #title>需要显示在菜单列表的菜单设置为显示,否则设置为隐藏;</template>
|
|
|
+ <QuestionCircleFilled />
|
|
|
+ </ATooltip>
|
|
|
+ </template>
|
|
|
+ <ARadioGroup v-model:value="model.visible">
|
|
|
+ <ARadio v-for="item in visibleOptions" :key="item.value" :value="item.value">
|
|
|
+ {{ item.label }}
|
|
|
+ </ARadio>
|
|
|
+ </ARadioGroup>
|
|
|
+ </AFormItem>
|
|
|
+ </ACol>
|
|
|
+ <ACol :lg="12" :xs="24" v-if="model.menuType == 'M' || model.menuType == 'C'">
|
|
|
+ <AFormItem name="isFrame">
|
|
|
+ <template #label>
|
|
|
+ <span class="marginRight5">{{ $t('page.manage.menu.href') }}</span>
|
|
|
+ <ATooltip>
|
|
|
+ <template #title>可以通过iframe打开指定地址</template>
|
|
|
+ <QuestionCircleFilled />
|
|
|
+ </ATooltip>
|
|
|
+ </template>
|
|
|
+ <ARadioGroup v-model:value="model.isFrame">
|
|
|
+ <ARadio value="0">{{ $t('common.yesOrNo.yes') }}</ARadio>
|
|
|
+ <ARadio value="1">{{ $t('common.yesOrNo.no') }}</ARadio>
|
|
|
+ </ARadioGroup>
|
|
|
+ </AFormItem>
|
|
|
+ </ACol>
|
|
|
+
|
|
|
+ <ACol :lg="12" :xs="24" v-if="model.menuType == 'F' || model.menuType == 'C'" >
|
|
|
+ <AFormItem name="component">
|
|
|
+ <template #label>
|
|
|
+ <span class="marginRight5">权限标识</span>
|
|
|
+ <ATooltip>
|
|
|
+ <template #title>前端权限控制按钮是否显示</template>
|
|
|
+ <QuestionCircleFilled />
|
|
|
+ </ATooltip>
|
|
|
+ </template>
|
|
|
+ <AInput v-model:value="model.permission" placeholder="请输入权限标识" />
|
|
|
+ </AFormItem>
|
|
|
+ </ACol>
|
|
|
+ <ACol :lg="24" :xs="24" v-if="model.menuType == 'F' || model.menuType == 'C'">
|
|
|
+ <AFormItem name="component" :label-col="{ style: { width: '120px' } }">
|
|
|
+ <template #label >
|
|
|
+ <span class="marginRight5">api权限</span>
|
|
|
+ <ATooltip>
|
|
|
+ <template #title>配置在这个才做上需要使用到的接口,否则在设置用户角色时,接口将无权访问。</template>
|
|
|
+ <QuestionCircleFilled />
|
|
|
+ </ATooltip>
|
|
|
+ </template>
|
|
|
+ <ATransfer
|
|
|
+ v-model:target-keys="model.apis"
|
|
|
+ :data-source="sysapiList"
|
|
|
+ :rowKey="record => record.id"
|
|
|
+ show-search
|
|
|
+ :titles="['未授权','已授权']"
|
|
|
+ :list-style="{
|
|
|
+ width: '250px',
|
|
|
+ height: '300px',
|
|
|
+ }"
|
|
|
+ :operations="['授权 ','收回' ]"
|
|
|
+ :render="item => `${item.title}`"
|
|
|
+ >
|
|
|
+
|
|
|
+ <template #notFoundContent>
|
|
|
+ <span>没数据</span>
|
|
|
+ </template>
|
|
|
+ </ATransfer>
|
|
|
+ </AFormItem>
|
|
|
+ </ACol>
|
|
|
+
|
|
|
+ <!-- <ACol :span="24">
|
|
|
+ <AFormItem :label-col="{ span: 4 }" :label="$t('page.manage.menu.query')" name="query">
|
|
|
+ <AButton v-if="model.query.length === 0" type="dashed" block @click="addQuery(-1)">
|
|
|
+ <template #icon>
|
|
|
+ <icon-carbon-add class="align-sub text-icon" />
|
|
|
+ </template>
|
|
|
+ <span class="ml-8px">{{ $t('common.add') }}</span>
|
|
|
+ </AButton>
|
|
|
+ <template v-else>
|
|
|
+ <div v-for="(item, index) in model.query" :key="index" class="flex gap-3">
|
|
|
+ <ACol :span="9">
|
|
|
+ <AFormItem :name="['query', index, 'key']">
|
|
|
+ <AInput
|
|
|
+ v-model:value="item.key"
|
|
|
+ :placeholder="$t('page.manage.menu.form.queryKey')"
|
|
|
+ class="flex-1"
|
|
|
+ />
|
|
|
+ </AFormItem>
|
|
|
+ </ACol>
|
|
|
+ <ACol :span="9">
|
|
|
+ <AFormItem :name="['query', index, 'value']">
|
|
|
+ <AInput
|
|
|
+ v-model:value="item.value"
|
|
|
+ :placeholder="$t('page.manage.menu.form.queryValue')"
|
|
|
+ class="flex-1"
|
|
|
+ />
|
|
|
+ </AFormItem>
|
|
|
+ </ACol>
|
|
|
+ <ACol :span="5">
|
|
|
+ <ASpace class="ml-12px">
|
|
|
+ <AButton size="middle" @click="addQuery(index)">
|
|
|
+ <template #icon>
|
|
|
+ <icon-ic:round-plus class="align-sub text-icon" />
|
|
|
+ </template>
|
|
|
+ </AButton>
|
|
|
+ <AButton size="middle" @click="removeQuery(index)">
|
|
|
+ <template #icon>
|
|
|
+ <icon-ic-round-remove class="align-sub text-icon" />
|
|
|
+ </template>
|
|
|
+ </AButton>
|
|
|
+ </ASpace>
|
|
|
+ </ACol>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </AFormItem>
|
|
|
+ </ACol> -->
|
|
|
+ <!-- <ACol :span="24">
|
|
|
+ <AFormItem :label-col="{ span: 4 }" :label="$t('page.manage.menu.button')" name="buttons">
|
|
|
+ <AButton v-if="model.buttons.length === 0" type="dashed" block @click="addButton(-1)">
|
|
|
+ <template #icon>
|
|
|
+ <icon-carbon-add class="align-sub text-icon" />
|
|
|
+ </template>
|
|
|
+ <span class="ml-8px">{{ $t('common.add') }}</span>
|
|
|
+ </AButton>
|
|
|
+ <template v-else>
|
|
|
+ <div v-for="(item, index) in model.buttons" :key="index" class="flex gap-3">
|
|
|
+ <ACol :span="9">
|
|
|
+ <AFormItem :name="['buttons', index, 'code']">
|
|
|
+ <AInput
|
|
|
+ v-model:value="item.code"
|
|
|
+ :placeholder="$t('page.manage.menu.form.buttonCode')"
|
|
|
+ class="flex-1"
|
|
|
+ ></AInput>
|
|
|
+ </AFormItem>
|
|
|
+ </ACol>
|
|
|
+ <ACol :span="9">
|
|
|
+ <AFormItem :name="['buttons', index, 'desc']">
|
|
|
+ <AInput
|
|
|
+ v-model:value="item.desc"
|
|
|
+ :placeholder="$t('page.manage.menu.form.buttonDesc')"
|
|
|
+ class="flex-1"
|
|
|
+ ></AInput>
|
|
|
+ </AFormItem>
|
|
|
+ </ACol>
|
|
|
+ <ACol :span="5">
|
|
|
+ <ASpace class="ml-12px">
|
|
|
+ <AButton size="middle" @click="addButton(index)">
|
|
|
+ <template #icon>
|
|
|
+ <icon-ic:round-plus class="align-sub text-icon" />
|
|
|
+ </template>
|
|
|
+ </AButton>
|
|
|
+ <AButton size="middle" @click="removeButton(index)">
|
|
|
+ <template #icon>
|
|
|
+ <icon-ic-round-remove class="align-sub text-icon" />
|
|
|
+ </template>
|
|
|
+ </AButton>
|
|
|
+ </ASpace>
|
|
|
+ </ACol>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </AFormItem>
|
|
|
+ </ACol> -->
|
|
|
+ </ARow>
|
|
|
+ </AForm>
|
|
|
+ </SimpleScrollbar>
|
|
|
+ </div>
|
|
|
+ <template #footer>
|
|
|
+ <ASpace justify="end" :size="16">
|
|
|
+ <AButton @click="closeDrawer">{{ $t('common.cancel') }}</AButton>
|
|
|
+ <AButton type="primary" @click="handleSubmit">{{ $t('common.confirm') }}</AButton>
|
|
|
+ </ASpace>
|
|
|
+ </template>
|
|
|
+ </AModal>
|
|
|
+</template>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+.marginRight5{
|
|
|
+ margin-right: 5px;
|
|
|
+}
|
|
|
+::v-deep .ant-transfer-operation .ant-btn{
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
+</style>
|