优化优化

This commit is contained in:
陈红丽 2024-12-11 19:24:11 +08:00
parent 2107ea8a71
commit 4e5554cb50
3 changed files with 26 additions and 9 deletions

View File

@ -1,7 +1,7 @@
<template>
<PageWrapper>
<a-row :gutter="10" class="mt-3">
<a-col :xs="24" :sm="24" :md="6" :lg="6" :xl="6">
<a-col :xs="24" :sm="24" :md="8" :lg="8" :xl="8">
<a-card shadow="hover" class="border-0">
<template #title>
<a-row>
@ -63,7 +63,7 @@
/>
</a-card>
</a-col>
<a-col :xs="24" :sm="24" :md="18" :lg="18" :xl="18">
<a-col :xs="24" :sm="24" :md="16" :lg="16" :xl="16">
<a-card shadow="hover" class="mb-4 border-0 proCard">
<configItem :configId="configId" v-if="configItemShow" />
</a-card>

View File

@ -1,7 +1,7 @@
<template>
<PageWrapper>
<a-row :gutter="10" class="mt-3">
<a-col :xs="24" :sm="24" :md="6" :lg="6" :xl="6">
<a-col :xs="24" :sm="24" :md="8" :lg="8" :xl="8">
<a-card shadow="hover" class="border-0">
<template #title>
<a-row>
@ -71,7 +71,7 @@
/>
</a-card>
</a-col>
<a-col :xs="24" :sm="24" :md="18" :lg="18" :xl="18">
<a-col :xs="24" :sm="24" :md="16" :lg="16" :xl="16">
<a-card shadow="hover" class="mb-4 border-0 proCard">
<dictItem :dictId="dictId" v-if="dictItemShow" />
</a-card>

View File

@ -1,11 +1,11 @@
<template>
<a-modal
<a-drawer
v-model:visible="props.visible"
:title="props.noticeId ? '编辑' : '新增'"
:width="`${size}px`"
@cancel="dialogClose"
style="top: 20px"
>
:footer-style="{ textAlign: 'right' }"
@close="dialogClose">
<a-form
class="ls-form"
ref="formRef"
@ -19,6 +19,21 @@
>
<a-input class="ls-input" v-model:value="formData.title" placeholder="通知标题" clearable />
</a-form-item>
<a-form-item
label="通知封面"
name="cover"
:rules="{ required: true, message: '请上传通知封面', trigger: 'change' }"
>
<UploadImg
@changeFileName="(name) => (formData.imageImgName = name)"
:fileType="['image/jpeg', 'image/png', 'image/jpg', 'image/gif']"
name="notice"
:fileSize="20"
v-model:image-url="formData.cover"
>
<template #tip>支持扩展名: jpg png jpeg;文件大小不超过20M</template>
</UploadImg>
</a-form-item>
<a-form-item label="通知类型">
<a-select v-model:value="formData.type" placeholder="请选择通知类型">
<a-select-option :value="1">通知</a-select-option>
@ -48,12 +63,13 @@
<a-button :loading="subLoading" type="primary" @click="submit"> 确定 </a-button>
</span>
</template>
</a-modal>
</a-drawer>
</template>
<script lang="ts" setup>
import type { FormInstance } from 'element-plus';
import { getNoticeDetail, noticeAdd, noticeUpdate } from '@/api/data/notice';
import { onMounted, reactive, shallowRef, ref } from 'vue';
import UploadImg from '@/components/Upload/Image.vue';
import Editor from '@/components/Editor/tinymce.vue';
import { message } from 'ant-design-vue';
import { useLockFn } from '@/utils/useLockFn';
@ -72,6 +88,7 @@
const formData = reactive({
id: '',
title: '',
cover:'',
status: 1,
type: 1,
content: '',