|
|
@ -7,6 +7,16 @@ |
|
|
|
:rules="formRules" |
|
|
|
:rules="formRules" |
|
|
|
label-width="100px" |
|
|
|
label-width="100px" |
|
|
|
> |
|
|
|
> |
|
|
|
|
|
|
|
<el-form-item label="服务类型" prop="serviceId"> |
|
|
|
|
|
|
|
<el-select v-model="formData.serviceId" placeholder="选择服务类型" filterable> |
|
|
|
|
|
|
|
<el-option |
|
|
|
|
|
|
|
v-for="item in appList" |
|
|
|
|
|
|
|
:key="item.serviceId" |
|
|
|
|
|
|
|
:label="item.serviceName" |
|
|
|
|
|
|
|
:value="item.serviceId" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</el-select> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="上级菜单"> |
|
|
|
<el-form-item label="上级菜单"> |
|
|
|
<el-tree-select |
|
|
|
<el-tree-select |
|
|
|
v-model="formData.parentId" |
|
|
|
v-model="formData.parentId" |
|
|
@ -132,7 +142,8 @@ const formData = ref({ |
|
|
|
status: CommonStatusEnum.ENABLE, |
|
|
|
status: CommonStatusEnum.ENABLE, |
|
|
|
visible: true, |
|
|
|
visible: true, |
|
|
|
keepAlive: true, |
|
|
|
keepAlive: true, |
|
|
|
alwaysShow: true |
|
|
|
alwaysShow: true, |
|
|
|
|
|
|
|
serviceId: undefined |
|
|
|
}) |
|
|
|
}) |
|
|
|
const formRules = reactive({ |
|
|
|
const formRules = reactive({ |
|
|
|
name: [{ required: true, message: '菜单名称不能为空', trigger: 'blur' }], |
|
|
|
name: [{ required: true, message: '菜单名称不能为空', trigger: 'blur' }], |
|
|
@ -148,6 +159,7 @@ const open = async (type: string, id?: number, parentId?: number) => { |
|
|
|
dialogTitle.value = t('action.' + type) |
|
|
|
dialogTitle.value = t('action.' + type) |
|
|
|
formType.value = type |
|
|
|
formType.value = type |
|
|
|
resetForm() |
|
|
|
resetForm() |
|
|
|
|
|
|
|
getOptions() |
|
|
|
if (parentId) { |
|
|
|
if (parentId) { |
|
|
|
formData.value.parentId = parentId |
|
|
|
formData.value.parentId = parentId |
|
|
|
} |
|
|
|
} |
|
|
@ -165,6 +177,13 @@ const open = async (type: string, id?: number, parentId?: number) => { |
|
|
|
} |
|
|
|
} |
|
|
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗 |
|
|
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const appList = ref([]) |
|
|
|
|
|
|
|
const getOptions = () => { |
|
|
|
|
|
|
|
MenuApi.getServiceAppList().then((data) => { |
|
|
|
|
|
|
|
appList.value = data |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** 提交表单 */ |
|
|
|
/** 提交表单 */ |
|
|
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调 |
|
|
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调 |
|
|
|
const submitForm = async () => { |
|
|
|
const submitForm = async () => { |
|
|
@ -233,7 +252,8 @@ const resetForm = () => { |
|
|
|
status: CommonStatusEnum.ENABLE, |
|
|
|
status: CommonStatusEnum.ENABLE, |
|
|
|
visible: true, |
|
|
|
visible: true, |
|
|
|
keepAlive: true, |
|
|
|
keepAlive: true, |
|
|
|
alwaysShow: true |
|
|
|
alwaysShow: true, |
|
|
|
|
|
|
|
serviceId: undefined |
|
|
|
} |
|
|
|
} |
|
|
|
formRef.value?.resetFields() |
|
|
|
formRef.value?.resetFields() |
|
|
|
} |
|
|
|
} |
|
|
|