【优化】优化一些移动端相关的代码

pull/85/head
小诺 2023-02-06 22:56:12 +08:00 committed by 俞宝山
parent 4926efe662
commit 3aee08136b
6 changed files with 246 additions and 260 deletions

View File

@ -29,8 +29,8 @@ export default {
name: '实底风格',
key: 'filled',
item: filledJsonData.glyphs
},
}
]
},
}
]
}

View File

@ -55,9 +55,7 @@
}
//
const onSubmit = () => {
formRef.value
.validate()
.then(() => {
formRef.value.validate().then(() => {
const defParam = {
category: 'BUTTON',
parentId: recordData.value.id

View File

@ -10,21 +10,16 @@
>
<a-form ref="formRef" :model="formData" :rules="formRules" layout="vertical">
<a-form-item label="显示名称:" name="title">
<span>{{formData.title}}</span>
<span>{{ formData.title }}</span>
</a-form-item>
<a-form-item label="所属目录:" name="module" v-if="formData.parentId === '0'" >
<a-form-item label="所属目录:" name="module" v-if="formData.parentId === '0'">
<a-radio-group v-model:value="formData.module" button-style="solid">
<a-radio-button
v-for="module in moduleTypeList"
:key="module.id"
:value="module.id"
>
<a-radio-button v-for="module in moduleTypeList" :key="module.id" :value="module.id">
<component :is="module.icon" />
{{ module.title }}</a-radio-button
>
</a-radio-group>
</a-form-item>
</a-form>
<template #footer>
<a-button style="margin-right: 8px" @click="onClose"></a-button>
@ -35,9 +30,7 @@
<script setup>
import { required } from '@/utils/formRules'
import tool from '@/utils/tool'
import mobileMenuApi from '@/api/mobile/resource/menuApi'
import { getCurrentInstance } from 'vue'
//
let visible = $ref(false)
const emit = defineEmits({ successful: null })
@ -64,23 +57,24 @@
}
//
const formRules = {
module: [required('请选择所属目录')],
module: [required('请选择所属目录')]
}
//
const onSubmit = () => {
formRef.value
.validate()
.then(() => {
formRef.value.validate().then(() => {
const param = {
id: formData.value.id,
module: formData.value.module
}
submitLoading.value = true
mobileMenuApi.mobileMenuChangeModule(param).then(() => {
mobileMenuApi
.mobileMenuChangeModule(param)
.then(() => {
submitLoading.value = false
emit('successful')
}).finally(() => {
})
.finally(() => {
visible = false
})
})

View File

@ -43,9 +43,7 @@
<a-form-item v-if="formData.menuType !== 'CATALOG'" name="path">
<template #label>
<a-tooltip>
<template #title>
类型为内外链条时输入https开头的链接即可https://xiaonuo.vip
</template>
<template #title> 类型为内外链条时输入https开头的链接即可https://xiaonuo.vip </template>
<question-circle-outlined />
</a-tooltip>
&nbsp {{ formData.menuType === 'MENU' || formData.menuType === 'CATALOG' ? '界面地址' : 'https链接地址' }}
@ -191,9 +189,7 @@
}
//
const onSubmit = () => {
formRef.value
.validate()
.then(() => {
formRef.value.validate().then(() => {
submitLoading.value = true
const formDataParam = parameterChanges(cloneDeep(formData.value))
mobileMenuApi

View File

@ -47,11 +47,11 @@
<template #bodyCell="{ column, record }">
<template v-if="column.dataIndex === 'path'">
<span v-if="record.menuType === 'CATALOG'">-</span>
<span v-else>{{record.path}}</span>
<span v-else>{{ record.path }}</span>
</template>
<template v-if="column.dataIndex === 'icon'">
<a-tag :color="record.color">
<span class="snowy xn-icons" :class="record.icon" ></span>
<span class="snowy xn-icons" :class="record.icon"></span>
</a-tag>
</template>
<template v-if="column.dataIndex === 'regType'">
@ -92,7 +92,7 @@
</s-table>
</a-card>
<Form ref="formRef" @successful="table.refresh(true)" />
<changeModuleForm ref="changeModuleFormRef" @successful="table.refresh(true)"/>
<changeModuleForm ref="changeModuleFormRef" @successful="table.refresh(true)" />
<Button ref="button" />
</template>

View File

@ -74,9 +74,7 @@
//
const onSubmit = () => {
formRef.value
.validate()
.then(() => {
formRef.value.validate().then(() => {
moduleApi.submitForm(formData.value, !formData.value.id).then(() => {
onClose()
emit('successful')