feat: add success text

pull/5/MERGE
xingyu 2023-04-25 18:24:09 +08:00
parent 1dec183d77
commit 482e411f06
41 changed files with 241 additions and 66 deletions

View File

@ -9,8 +9,8 @@ import { BasicModal, useModalInner } from '@/components/Modal'
import { BasicForm, FormSchema, useForm } from '@/components/Form'
import { useI18n } from '@/hooks/web/useI18n'
const emit = defineEmits(['success', 'register'])
const { t } = useI18n()
const emit = defineEmits(['success', 'register'])
const schemas: FormSchema[] = [
{
field: 'filename',

View File

@ -22,8 +22,8 @@
import { computed } from 'vue'
import { useI18n } from '@/hooks/web/useI18n'
import { useDesign } from '@/hooks/web/useDesign'
import { BasicModal, useModalInner } from '@/components/Modal'
import { BasicForm, useForm } from '@/components/Form'
import { BasicModal, useModalInner } from '@/components/Modal'
import { useUserStore } from '@/store/modules/user'
import { useLockStore } from '@/store/modules/lock'
import headerImg from '@/assets/images/header.jpg'

View File

@ -6,6 +6,7 @@ export default {
cancelText: 'Cancel',
loadingText: 'Loading...',
saveText: 'Save',
saveSuccessText: 'Save success',
delText: 'Delete',
delMessage: 'Do you want to delete data?',
delSuccessText: 'Delete success',

View File

@ -6,6 +6,7 @@ export default {
cancelText: '取消',
loadingText: '加载中...',
saveText: '保存',
saveSuccessText: '保存成功',
delText: '删除',
delMessage: '是否要删除数据?',
delSuccessText: '删除成功',

View File

@ -5,11 +5,15 @@
</template>
<script lang="ts" setup name="PasswordModal">
import { ref } from 'vue'
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 { passwordSchema } from './data'
import { updateUserPwdApi } from '@/api/base/profile'
const { t } = useI18n()
const { createMessage } = useMessage()
const emit = defineEmits(['success', 'register'])
const title = ref('修改密码')
@ -35,6 +39,7 @@ async function handleSubmit() {
closeModal()
emit('success')
} finally {
createMessage.success(t('common.saveSuccessText'))
setModalProps({ confirmLoading: false })
}
}

View File

@ -1,15 +1,19 @@
<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" />
</BasicModal>
</template>
<script lang="ts" setup name="BpmGroupModal">
import { ref, unref } from 'vue'
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 './group.data'
import { createUserGroup, getUserGroup, updateUserGroup } from '@/api/bpm/userGroup'
const { t } = useI18n()
const { createMessage } = useMessage()
const emit = defineEmits(['success', 'register'])
const isUpdate = ref(true)
@ -43,6 +47,7 @@ async function handleSubmit() {
closeModal()
emit('success')
} finally {
createMessage.success(t('common.saveSuccessText'))
setModalProps({ confirmLoading: false })
}
}

View File

@ -1,15 +1,19 @@
<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" />
</BasicModal>
</template>
<script lang="ts" setup name="BpmModelModal">
import { ref, unref } from 'vue'
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 './model.data'
import { createModel, getModel, updateModel } from '@/api/bpm/model'
const { t } = useI18n()
const { createMessage } = useMessage()
const emit = defineEmits(['success', 'register'])
const isUpdate = ref(true)
@ -43,6 +47,7 @@ async function handleSubmit() {
closeModal()
emit('success')
} finally {
createMessage.success(t('common.saveSuccessText'))
setModalProps({ confirmLoading: false })
}
}

View File

@ -1,15 +1,19 @@
<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" />
</BasicModal>
</template>
<script lang="ts" setup name="InfraConfigModal">
import { ref, unref } from 'vue'
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 './config.data'
import { createConfig, getConfig, updateConfig } from '@/api/infra/config'
const { t } = useI18n()
const { createMessage } = useMessage()
const emit = defineEmits(['success', 'register'])
const isUpdate = ref(true)
@ -43,6 +47,7 @@ async function handleSubmit() {
closeModal()
emit('success')
} finally {
createMessage.success(t('common.saveSuccessText'))
setModalProps({ confirmLoading: false })
}
}

View File

@ -1,15 +1,19 @@
<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" />
</BasicModal>
</template>
<script lang="ts" setup name="InfraDataSourceConfigModal">
import { ref, unref } from 'vue'
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 './dataSourceConfig.data'
import { createDataSourceConfig, getDataSourceConfig, updateDataSourceConfig } from '@/api/infra/dataSourceConfig'
const { t } = useI18n()
const { createMessage } = useMessage()
const emit = defineEmits(['success', 'register'])
const isUpdate = ref(true)
@ -43,6 +47,7 @@ async function handleSubmit() {
closeModal()
emit('success')
} finally {
createMessage.success(t('common.saveSuccessText'))
setModalProps({ confirmLoading: false })
}
}

View File

@ -1,15 +1,19 @@
<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" />
</BasicModal>
</template>
<script lang="ts" setup name="InfraFileConfigModal">
import { ref, unref } from 'vue'
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 './ficleConfig.data'
import { createFileConfig, getFileConfig, updateFileConfig } from '@/api/infra/fileConfig'
const { t } = useI18n()
const { createMessage } = useMessage()
const emit = defineEmits(['success', 'register'])
const isUpdate = ref(true)
@ -43,6 +47,7 @@ async function handleSubmit() {
closeModal()
emit('success')
} finally {
createMessage.success(t('common.saveSuccessText'))
setModalProps({ confirmLoading: false })
}
}

View File

@ -1,15 +1,19 @@
<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" />
</BasicModal>
</template>
<script lang="ts" setup name="InfraJobModal">
import { ref, unref } from 'vue'
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 './job.data'
import { createJob, getJob, updateJob } from '@/api/infra/job'
const { t } = useI18n()
const { createMessage } = useMessage()
const emit = defineEmits(['success', 'register'])
const isUpdate = ref(true)
@ -43,6 +47,7 @@ async function handleSubmit() {
closeModal()
emit('success')
} finally {
createMessage.success(t('common.saveSuccessText'))
setModalProps({ confirmLoading: false })
}
}

View File

@ -20,8 +20,8 @@
<script lang="ts" setup name="RedisModal">
import { ref } from 'vue'
import { List } from 'ant-design-vue'
import { BasicModal, useModalInner } from '@/components/Modal'
import { BasicForm, useForm } from '@/components/Form'
import { BasicModal, useModalInner } from '@/components/Modal'
import { formSchema } from '../redis.data'
import { deleteKey, getKeyList } from '@/api/infra/redis'

View File

@ -1,15 +1,19 @@
<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" />
</BasicModal>
</template>
<script lang="ts" setup name="MpAccountModal">
import { ref, unref } from 'vue'
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 './account.data'
import { createAccount, getAccount, updateAccount } from '@/api/mp/account'
const { t } = useI18n()
const { createMessage } = useMessage()
const emit = defineEmits(['success', 'register'])
const isUpdate = ref(true)
@ -43,6 +47,7 @@ async function handleSubmit() {
closeModal()
emit('success')
} finally {
createMessage.success(t('common.saveSuccessText'))
setModalProps({ confirmLoading: false })
}
}

View File

@ -4,12 +4,16 @@
</BasicModal>
</template>
<script lang="ts" setup name="MpMessageModal">
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 './message.data'
import { sendMessage } from '@/api/mp/message'
import { ref } from 'vue'
const { t } = useI18n()
const { createMessage } = useMessage()
const emit = defineEmits(['success', 'register'])
const userId = ref(0)
@ -37,6 +41,7 @@ async function handleSubmit() {
closeModal()
emit('success')
} finally {
createMessage.success(t('common.saveSuccessText'))
setModalProps({ confirmLoading: false })
}
}

View File

@ -1,15 +1,19 @@
<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" />
</BasicModal>
</template>
<script lang="ts" setup name="MpTagModal">
import { ref, unref } from 'vue'
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 './tag.data'
import { createTag, updateTag, getTag } from '@/api/mp/tag'
const { t } = useI18n()
const { createMessage } = useMessage()
const emit = defineEmits(['success', 'register'])
const isUpdate = ref(true)
@ -43,6 +47,7 @@ async function handleSubmit() {
closeModal()
emit('success')
} finally {
createMessage.success(t('common.saveSuccessText'))
setModalProps({ confirmLoading: false })
}
}

View File

@ -4,11 +4,15 @@
</BasicModal>
</template>
<script lang="ts" setup name="MpUserModal">
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 './mpuser.data'
import { getUser, updateUser } from '@/api/mp/mpuser'
const { t } = useI18n()
const { createMessage } = useMessage()
const emit = defineEmits(['success', 'register'])
const [registerForm, { setFieldsValue, resetFields, validate }] = useForm({
@ -34,6 +38,7 @@ async function handleSubmit() {
closeModal()
emit('success')
} finally {
createMessage.success(t('common.saveSuccessText'))
setModalProps({ confirmLoading: false })
}
}

View File

@ -1,15 +1,19 @@
<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" />
</BasicModal>
</template>
<script lang="ts" setup name="PayAppModal">
import { ref, unref } from 'vue'
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 './app.data'
import { createApp, updateApp, getApp } from '@/api/pay/app'
const { t } = useI18n()
const { createMessage } = useMessage()
const emit = defineEmits(['success', 'register'])
const isUpdate = ref(true)
@ -43,6 +47,7 @@ async function handleSubmit() {
closeModal()
emit('success')
} finally {
createMessage.success(t('common.saveSuccessText'))
setModalProps({ confirmLoading: false })
}
}

View File

@ -1,15 +1,19 @@
<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" />
</BasicModal>
</template>
<script lang="ts" setup name="PayMerchantModal">
import { ref, unref } from 'vue'
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 './merchant.data'
import { createMerchant, updateMerchant, getMerchant } from '@/api/pay/merchant'
const { t } = useI18n()
const { createMessage } = useMessage()
const emit = defineEmits(['success', 'register'])
const isUpdate = ref(true)
@ -43,6 +47,7 @@ async function handleSubmit() {
closeModal()
emit('success')
} finally {
createMessage.success(t('common.saveSuccessText'))
setModalProps({ confirmLoading: false })
}
}

View File

@ -4,8 +4,8 @@
</BasicModal>
</template>
<script lang="ts" setup name="SystemAreaModal">
import { BasicModal, useModalInner } from '@/components/Modal'
import { BasicForm, useForm } from '@/components/Form'
import { BasicModal, useModalInner } from '@/components/Modal'
import { formSchema } from './area.data'
import { getAreaByIp } from '@/api/system/area'

View File

@ -1,15 +1,19 @@
<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" />
</BasicModal>
</template>
<script lang="ts" setup name="DeptModal">
import { ref, unref } from 'vue'
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 './dept.data'
import { createDept, getDept, updateDept } from '@/api/system/dept'
const { t } = useI18n()
const { createMessage } = useMessage()
const emit = defineEmits(['success', 'register'])
const isUpdate = ref(true)
@ -43,6 +47,7 @@ async function handleSubmit() {
closeModal()
emit('success')
} finally {
createMessage.success(t('common.saveSuccessText'))
setModalProps({ confirmLoading: false })
}
}

View File

@ -1,15 +1,19 @@
<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" />
</BasicModal>
</template>
<script lang="ts" setup name="SystemDictDataModal">
import { ref, unref } from 'vue'
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 { dataFormSchema } from './dict.data'
import { createDictData, getDictData, updateDictData } from '@/api/system/dict/data'
const { t } = useI18n()
const { createMessage } = useMessage()
const emit = defineEmits(['success', 'register'])
const isUpdate = ref(true)
@ -47,6 +51,7 @@ async function handleSubmit() {
closeModal()
emit('success')
} finally {
createMessage.success(t('common.saveSuccessText'))
setModalProps({ confirmLoading: false })
}
}

View File

@ -1,15 +1,19 @@
<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" />
</BasicModal>
</template>
<script lang="ts" setup name="SystemDictTypeModal">
import { ref, unref } from 'vue'
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 { typeFormSchema } from './dict.type'
import { createDictType, getDictType, updateDictType } from '@/api/system/dict/type'
const { t } = useI18n()
const { createMessage } = useMessage()
const emit = defineEmits(['success', 'register'])
const isUpdate = ref(true)
@ -43,6 +47,7 @@ async function handleSubmit() {
closeModal()
emit('success')
} finally {
createMessage.success(t('common.saveSuccessText'))
setModalProps({ confirmLoading: false })
}
}

View File

@ -1,15 +1,19 @@
<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" />
</BasicModal>
</template>
<script lang="ts" setup name="SystemErrorCodeModal">
import { ref, unref } from 'vue'
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 './errorCode.data'
import { createErrorCode, getErrorCode, updateErrorCode } from '@/api/system/errorCode'
const { t } = useI18n()
const { createMessage } = useMessage()
const emit = defineEmits(['success', 'register'])
const isUpdate = ref(true)
@ -43,6 +47,7 @@ async function handleSubmit() {
closeModal()
emit('success')
} finally {
createMessage.success(t('common.saveSuccessText'))
setModalProps({ confirmLoading: false })
}
}

View File

@ -1,15 +1,19 @@
<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" />
</BasicModal>
</template>
<script lang="ts" setup name="SystemMailAccountModal">
import { ref, unref } from 'vue'
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 './account.data'
import { createMailAccount, getMailAccount, updateMailAccount } from '@/api/system/mail/account'
const { t } = useI18n()
const { createMessage } = useMessage()
const emit = defineEmits(['success', 'register'])
const isUpdate = ref(true)
@ -43,6 +47,7 @@ async function handleSubmit() {
closeModal()
emit('success')
} finally {
createMessage.success(t('common.saveSuccessText'))
setModalProps({ confirmLoading: false })
}
}

View File

@ -1,15 +1,19 @@
<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" />
</BasicModal>
</template>
<script lang="ts" setup name="SystemMailTemplateModal">
import { ref, unref } from 'vue'
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 './template.data'
import { createMailTemplate, getMailTemplate, updateMailTemplate } from '@/api/system/mail/template'
const { t } = useI18n()
const { createMessage } = useMessage()
const emit = defineEmits(['success', 'register'])
const isUpdate = ref(true)
@ -43,6 +47,7 @@ async function handleSubmit() {
closeModal()
emit('success')
} finally {
createMessage.success(t('common.saveSuccessText'))
setModalProps({ confirmLoading: false })
}
}

View File

@ -1,15 +1,19 @@
<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" />
</BasicModal>
</template>
<script lang="ts" setup name="SystemMenuModal">
import { ref, unref } from 'vue'
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 './menu.data'
import { createMenu, getMenu, updateMenu } from '@/api/system/menu'
const { t } = useI18n()
const { createMessage } = useMessage()
const emit = defineEmits(['success', 'register'])
const isUpdate = ref(true)
@ -43,6 +47,7 @@ async function handleSubmit() {
closeModal()
emit('success')
} finally {
createMessage.success(t('common.saveSuccessText'))
setModalProps({ confirmLoading: false })
}
}

View File

@ -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 })
}
}

View File

@ -1,15 +1,19 @@
<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" />
</BasicModal>
</template>
<script lang="ts" setup name="NotifyTemplateModal">
import { ref, unref } from 'vue'
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 './template.data'
import { createNotifyTemplate, getNotifyTemplate, updateNotifyTemplate } from '@/api/system/notify/template'
const { t } = useI18n()
const { createMessage } = useMessage()
const emit = defineEmits(['success', 'register'])
const isUpdate = ref(true)
@ -43,6 +47,7 @@ async function handleSubmit() {
closeModal()
emit('success')
} finally {
createMessage.success(t('common.saveSuccessText'))
setModalProps({ confirmLoading: false })
}
}

View File

@ -1,15 +1,19 @@
<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" />
</BasicModal>
</template>
<script lang="ts" setup name="SystemClientModal">
import { ref, unref } from 'vue'
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 './client.data'
import { createOAuth2Client, getOAuth2Client, updateOAuth2Client } from '@/api/system/oauth2/client'
const { t } = useI18n()
const { createMessage } = useMessage()
const emit = defineEmits(['success', 'register'])
const isUpdate = ref(true)
@ -43,6 +47,7 @@ async function handleSubmit() {
closeModal()
emit('success')
} finally {
createMessage.success(t('common.saveSuccessText'))
setModalProps({ confirmLoading: false })
}
}

View File

@ -1,15 +1,19 @@
<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" />
</BasicModal>
</template>
<script lang="ts" setup name="SystemPostModal">
import { ref, unref } from 'vue'
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 './post.data'
import { createPost, getPost, updatePost } from '@/api/system/post'
const { t } = useI18n()
const { createMessage } = useMessage()
const emit = defineEmits(['success', 'register'])
const isUpdate = ref(true)
@ -43,6 +47,7 @@ async function handleSubmit() {
closeModal()
emit('success')
} finally {
createMessage.success(t('common.saveSuccessText'))
setModalProps({ confirmLoading: false })
}
}

View File

@ -17,8 +17,10 @@
</template>
<script lang="ts" setup name="SystemRoleMenuModal">
import { ref, unref } from 'vue'
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 { menuScopeFormSchema } from './role.data'
import { getRole } from '@/api/system/role'
import { BasicTree, TreeItem } from '@/components/Tree'
@ -26,6 +28,8 @@ import { listSimpleMenus } from '@/api/system/menu'
import { handleTree } from '@/utils/tree'
import { assignRoleMenu, listRoleMenus } from '@/api/system/permission'
const { t } = useI18n()
const { createMessage } = useMessage()
const emit = defineEmits(['success', 'register'])
const treeData = ref<TreeItem[]>([])
@ -62,6 +66,7 @@ async function handleSubmit() {
closeModal()
emit('success')
} finally {
createMessage.success(t('common.saveSuccessText'))
setModalProps({ confirmLoading: false })
}
}

View File

@ -1,15 +1,19 @@
<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" />
</BasicModal>
</template>
<script lang="ts" setup name="SystemRoleModal">
import { ref, unref } from 'vue'
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 './role.data'
import { createRole, getRole, updateRole } from '@/api/system/role'
const { t } = useI18n()
const { createMessage } = useMessage()
const emit = defineEmits(['success', 'register'])
const isUpdate = ref(true)
@ -43,6 +47,7 @@ async function handleSubmit() {
closeModal()
emit('success')
} finally {
createMessage.success(t('common.saveSuccessText'))
setModalProps({ confirmLoading: false })
}
}

View File

@ -17,8 +17,10 @@
</template>
<script lang="ts" setup name="SystemRoleScopeModal">
import { ref, unref } from 'vue'
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 { BasicTree, TreeItem } from '@/components/Tree'
import { dataScopeFormSchema } from './role.data'
import { getRole } from '@/api/system/role'
@ -26,6 +28,8 @@ import { listSimpleDept } from '@/api/system/dept'
import { handleTree } from '@/utils/tree'
import { assignRoleDataScope } from '@/api/system/permission'
const { t } = useI18n()
const { createMessage } = useMessage()
const emit = defineEmits(['success', 'register'])
const treeData = ref<TreeItem[]>([])
@ -57,6 +61,7 @@ async function handleSubmit() {
closeModal()
emit('success')
} finally {
createMessage.success(t('common.saveSuccessText'))
setModalProps({ confirmLoading: false })
}
}

View File

@ -1,15 +1,19 @@
<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" />
</BasicModal>
</template>
<script lang="ts" setup name="SystemSensitiveWordModal">
import { ref, unref } from 'vue'
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 './sensitiveWord.data'
import { createSensitiveWord, getSensitiveWord, updateSensitiveWord } from '@/api/system/sensitiveWord'
const { t } = useI18n()
const { createMessage } = useMessage()
const emit = defineEmits(['success', 'register'])
const isUpdate = ref(true)
@ -43,6 +47,7 @@ async function handleSubmit() {
closeModal()
emit('success')
} finally {
createMessage.success(t('common.saveSuccessText'))
setModalProps({ confirmLoading: false })
}
}

View File

@ -1,15 +1,19 @@
<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" />
</BasicModal>
</template>
<script lang="ts" setup name="SystemSmsChannelModal">
import { ref, unref } from 'vue'
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 './smsChannel.data'
import { createSmsChannel, getSmsChannel, updateSmsChannel } from '@/api/system/sms/smsChannel'
const { t } = useI18n()
const { createMessage } = useMessage()
const emit = defineEmits(['success', 'register'])
const isUpdate = ref(true)
@ -43,6 +47,7 @@ async function handleSubmit() {
closeModal()
emit('success')
} finally {
createMessage.success(t('common.saveSuccessText'))
setModalProps({ confirmLoading: false })
}
}

View File

@ -1,15 +1,19 @@
<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" />
</BasicModal>
</template>
<script lang="ts" setup name="SystemSmsTemplateModal">
import { ref, unref } from 'vue'
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 './smsTemplate.data'
import { createSmsTemplate, getSmsTemplate, updateSmsTemplate } from '@/api/system/sms/smsTemplate'
const { t } = useI18n()
const { createMessage } = useMessage()
const emit = defineEmits(['success', 'register'])
const isUpdate = ref(true)
@ -43,6 +47,7 @@ async function handleSubmit() {
closeModal()
emit('success')
} finally {
createMessage.success(t('common.saveSuccessText'))
setModalProps({ confirmLoading: false })
}
}

View File

@ -1,15 +1,19 @@
<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" />
</BasicModal>
</template>
<script lang="ts" setup name="SystemTenantModal">
import { ref, unref } from 'vue'
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 './tenant.data'
import { createTenant, getTenant, updateTenant } from '@/api/system/tenant'
const { t } = useI18n()
const { createMessage } = useMessage()
const emit = defineEmits(['success', 'register'])
const isUpdate = ref(true)
@ -43,6 +47,7 @@ async function handleSubmit() {
closeModal()
emit('success')
} finally {
createMessage.success(t('common.saveSuccessText'))
setModalProps({ confirmLoading: false })
}
}

View File

@ -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 #menuIds="{ model, field }">
<BasicTree
@ -25,6 +25,8 @@ import { createTenantPackage, getTenantPackage, updateTenantPackage } from '@/ap
import { listSimpleMenus } from '@/api/system/menu'
import { handleTree } from '@/utils/tree'
const { t } = useI18n()
const { createMessage } = useMessage()
const emit = defineEmits(['success', 'register'])
const isUpdate = ref(true)
const treeData = ref<TreeItem[]>([])
@ -66,6 +68,7 @@ async function handleSubmit() {
closeModal()
emit('success')
} finally {
createMessage.success(t('common.saveSuccessText'))
setModalProps({ confirmLoading: false })
}
}

View File

@ -5,11 +5,15 @@
</template>
<script lang="ts" setup name="SystemResetPwdModal">
import { ref } from 'vue'
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 { userPwdFormSchema } from './user.data'
import { resetUserPwd } from '@/api/system/user'
const { t } = useI18n()
const { createMessage } = useMessage()
const emit = defineEmits(['success', 'register'])
const userId = ref(0)
@ -36,6 +40,7 @@ async function handleSubmit() {
closeModal()
emit('success')
} finally {
createMessage.success(t('common.saveSuccessText'))
setModalProps({ confirmLoading: false })
}
}

View File

@ -1,15 +1,19 @@
<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" />
</BasicModal>
</template>
<script lang="ts" setup name="SystemUserModal">
import { ref, unref } from 'vue'
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 './user.data'
import { createUser, getUser, updateUser } from '@/api/system/user'
const { t } = useI18n()
const { createMessage } = useMessage()
const emit = defineEmits(['success', 'register'])
const isUpdate = ref(true)
@ -43,6 +47,7 @@ async function handleSubmit() {
closeModal()
emit('success')
} finally {
createMessage.success(t('common.saveSuccessText'))
setModalProps({ confirmLoading: false })
}
}

View File

@ -4,12 +4,16 @@
</BasicModal>
</template>
<script lang="ts" setup name="SystemUserRoleModal">
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 { userRoleFormSchema } from './user.data'
import { getUser } from '@/api/system/user'
import { assignUserRole, listUserRoles } from '@/api/system/permission'
const { t } = useI18n()
const { createMessage } = useMessage()
const emit = defineEmits(['success', 'register'])
const [registerForm, { setFieldsValue, resetFields, validate }] = useForm({
@ -38,6 +42,7 @@ async function handleSubmit() {
closeModal()
emit('success')
} finally {
createMessage.success(t('common.saveSuccessText'))
setModalProps({ confirmLoading: false })
}
}