|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
<template> |
|
|
|
|
<BasicModal v-bind="$attrs" @register="registerModal" :title="isUpdate ? '编辑' : '新增'" @ok="handleSubmit"> |
|
|
|
|
<BasicModal v-bind="$attrs" @register="registerModal" :title="isUpdate ? t('action.edit') : t('action.create')" @ok="handleSubmit"> |
|
|
|
|
<BasicForm @register="registerForm"> |
|
|
|
|
<template #editor="{ model, field }"> |
|
|
|
|
<Tinymce v-model="model[field]" width="100%" /> |
|
|
|
@ -10,11 +10,15 @@
|
|
|
|
|
<script lang="ts" setup name="SystemNoticeModal"> |
|
|
|
|
import { ref, unref } from 'vue' |
|
|
|
|
import { Tinymce } from '@/components/Tinymce' |
|
|
|
|
import { BasicModal, useModalInner } from '@/components/Modal' |
|
|
|
|
import { useI18n } from '@/hooks/web/useI18n' |
|
|
|
|
import { useMessage } from '@/hooks/web/useMessage' |
|
|
|
|
import { BasicForm, useForm } from '@/components/Form' |
|
|
|
|
import { BasicModal, useModalInner } from '@/components/Modal' |
|
|
|
|
import { formSchema } from './notice.data' |
|
|
|
|
import { createNotice, getNotice, updateNotice } from '@/api/system/notice' |
|
|
|
|
|
|
|
|
|
const { t } = useI18n() |
|
|
|
|
const { createMessage } = useMessage() |
|
|
|
|
const emit = defineEmits(['success', 'register']) |
|
|
|
|
const isUpdate = ref(true) |
|
|
|
|
|
|
|
|
@ -48,6 +52,7 @@ async function handleSubmit() {
|
|
|
|
|
closeModal() |
|
|
|
|
emit('success') |
|
|
|
|
} finally { |
|
|
|
|
createMessage.success(t('common.saveSuccessText')) |
|
|
|
|
setModalProps({ confirmLoading: false }) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|