mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-26 09:11:52 +08:00
feat: 添加提交前验证
This commit is contained in:
parent
aa983a6fa9
commit
855d23aec3
@ -50,23 +50,29 @@
|
|||||||
|
|
||||||
// 提交按钮
|
// 提交按钮
|
||||||
const submitForm = async () => {
|
const submitForm = async () => {
|
||||||
actionLoading.value = true
|
const elForm = unref(formRef)?.getElFormRef()
|
||||||
// 提交请求
|
if (!elForm) return
|
||||||
try {
|
elForm.validate(async (valid) => {
|
||||||
const data = unref(formRef)?.formModel as ${simpleClassName}VO
|
if (valid) {
|
||||||
if (actionType.value === 'create') {
|
actionLoading.value = true
|
||||||
await ${simpleClassName}Api.create${simpleClassName}Api(data)
|
// 提交请求
|
||||||
ElMessage.success(t('common.createSuccess'))
|
try {
|
||||||
} else {
|
const data = unref(formRef)?.formModel as ${simpleClassName}VO
|
||||||
await ${simpleClassName}Api.update${simpleClassName}Api(data)
|
if (actionType.value === 'create') {
|
||||||
ElMessage.success(t('common.updateSuccess'))
|
await ${simpleClassName}Api.create${simpleClassName}Api(data)
|
||||||
|
ElMessage.success(t('common.createSuccess'))
|
||||||
|
} else {
|
||||||
|
await ${simpleClassName}Api.update${simpleClassName}Api(data)
|
||||||
|
ElMessage.success(t('common.updateSuccess'))
|
||||||
|
}
|
||||||
|
// 操作成功,重新加载列表
|
||||||
|
dialogVisible.value = false
|
||||||
|
await getList()
|
||||||
|
} finally {
|
||||||
|
actionLoading.value = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 操作成功,重新加载列表
|
})
|
||||||
dialogVisible.value = false
|
|
||||||
await getList()
|
|
||||||
} finally {
|
|
||||||
actionLoading.value = false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ========== 详情相关 ==========
|
// ========== 详情相关 ==========
|
||||||
|
@ -128,12 +128,18 @@ service.interceptors.response.use(
|
|||||||
const refreshTokenRes = await refreshToken()
|
const refreshTokenRes = await refreshToken()
|
||||||
// 2.1 刷新成功,则回放队列的请求 + 当前请求
|
// 2.1 刷新成功,则回放队列的请求 + 当前请求
|
||||||
setToken(refreshTokenRes.data)
|
setToken(refreshTokenRes.data)
|
||||||
requestList.forEach((cb: any) => cb())
|
;(config as Recordable).headers.Authorization = 'Bearer ' + getAccessToken()
|
||||||
|
requestList.forEach((cb: any) => {
|
||||||
|
cb()
|
||||||
|
})
|
||||||
|
requestList = []
|
||||||
return service(response.config)
|
return service(response.config)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// 为什么需要 catch 异常呢?刷新失败时,请求因为 Promise.reject 触发异常。
|
// 为什么需要 catch 异常呢?刷新失败时,请求因为 Promise.reject 触发异常。
|
||||||
// 2.2 刷新失败,只回放队列的请求
|
// 2.2 刷新失败,只回放队列的请求
|
||||||
requestList.forEach((cb: any) => cb())
|
requestList.forEach((cb: any) => {
|
||||||
|
cb()
|
||||||
|
})
|
||||||
// 提示是否要登出。即不回放当前请求!不然会形成递归
|
// 提示是否要登出。即不回放当前请求!不然会形成递归
|
||||||
return handleAuthorized()
|
return handleAuthorized()
|
||||||
} finally {
|
} finally {
|
||||||
@ -194,10 +200,7 @@ service.interceptors.response.use(
|
|||||||
)
|
)
|
||||||
|
|
||||||
const refreshToken = async () => {
|
const refreshToken = async () => {
|
||||||
return await service({
|
return await axios.post(base_url + '/system/auth/refresh-token?refreshToken=' + getRefreshToken())
|
||||||
url: '/system/auth/refresh-token?refreshToken=' + getRefreshToken(),
|
|
||||||
method: 'post'
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
const handleAuthorized = () => {
|
const handleAuthorized = () => {
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
|
@ -111,6 +111,10 @@ const handleLogin = async (params) => {
|
|||||||
}
|
}
|
||||||
loginData.loginForm.captchaVerification = params.captchaVerification
|
loginData.loginForm.captchaVerification = params.captchaVerification
|
||||||
const res = await LoginApi.loginApi(loginData.loginForm)
|
const res = await LoginApi.loginApi(loginData.loginForm)
|
||||||
|
if (!res) {
|
||||||
|
loginLoading.value = false
|
||||||
|
return
|
||||||
|
}
|
||||||
setToken(res)
|
setToken(res)
|
||||||
if (!redirect.value) {
|
if (!redirect.value) {
|
||||||
redirect.value = '/'
|
redirect.value = '/'
|
||||||
|
@ -49,23 +49,29 @@ const handleUpdate = async (row: FormVO) => {
|
|||||||
|
|
||||||
// 提交按钮
|
// 提交按钮
|
||||||
const submitForm = async () => {
|
const submitForm = async () => {
|
||||||
actionLoading.value = true
|
const elForm = unref(formRef)?.getElFormRef()
|
||||||
// 提交请求
|
if (!elForm) return
|
||||||
try {
|
elForm.validate(async (valid) => {
|
||||||
const data = unref(formRef)?.formModel as FormVO
|
if (valid) {
|
||||||
if (actionType.value === 'create') {
|
actionLoading.value = true
|
||||||
await FormApi.createFormApi(data)
|
// 提交请求
|
||||||
ElMessage.success(t('common.createSuccess'))
|
try {
|
||||||
} else {
|
const data = unref(formRef)?.formModel as FormVO
|
||||||
await FormApi.updateFormApi(data)
|
if (actionType.value === 'create') {
|
||||||
ElMessage.success(t('common.updateSuccess'))
|
await FormApi.createFormApi(data)
|
||||||
|
ElMessage.success(t('common.createSuccess'))
|
||||||
|
} else {
|
||||||
|
await FormApi.updateFormApi(data)
|
||||||
|
ElMessage.success(t('common.updateSuccess'))
|
||||||
|
}
|
||||||
|
// 操作成功,重新加载列表
|
||||||
|
dialogVisible.value = false
|
||||||
|
await getList()
|
||||||
|
} finally {
|
||||||
|
actionLoading.value = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 操作成功,重新加载列表
|
})
|
||||||
dialogVisible.value = false
|
|
||||||
await getList()
|
|
||||||
} finally {
|
|
||||||
actionLoading.value = false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ========== 详情相关 ==========
|
// ========== 详情相关 ==========
|
||||||
|
@ -62,24 +62,30 @@ const handleUpdate = async (row: UserGroupVO) => {
|
|||||||
|
|
||||||
// 提交按钮
|
// 提交按钮
|
||||||
const submitForm = async () => {
|
const submitForm = async () => {
|
||||||
actionLoading.value = true
|
const elForm = unref(formRef)?.getElFormRef()
|
||||||
// 提交请求
|
if (!elForm) return
|
||||||
try {
|
elForm.validate(async (valid) => {
|
||||||
const data = unref(formRef)?.formModel as UserGroupVO
|
if (valid) {
|
||||||
data.memberUserIds = userIds.value
|
actionLoading.value = true
|
||||||
if (actionType.value === 'create') {
|
// 提交请求
|
||||||
await UserGroupApi.createUserGroupApi(data)
|
try {
|
||||||
ElMessage.success(t('common.createSuccess'))
|
const data = unref(formRef)?.formModel as UserGroupVO
|
||||||
} else {
|
data.memberUserIds = userIds.value
|
||||||
await UserGroupApi.updateUserGroupApi(data)
|
if (actionType.value === 'create') {
|
||||||
ElMessage.success(t('common.updateSuccess'))
|
await UserGroupApi.createUserGroupApi(data)
|
||||||
|
ElMessage.success(t('common.createSuccess'))
|
||||||
|
} else {
|
||||||
|
await UserGroupApi.updateUserGroupApi(data)
|
||||||
|
ElMessage.success(t('common.updateSuccess'))
|
||||||
|
}
|
||||||
|
// 操作成功,重新加载列表
|
||||||
|
dialogVisible.value = false
|
||||||
|
await getList()
|
||||||
|
} finally {
|
||||||
|
actionLoading.value = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 操作成功,重新加载列表
|
})
|
||||||
dialogVisible.value = false
|
|
||||||
await getList()
|
|
||||||
} finally {
|
|
||||||
actionLoading.value = false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 根据用户名获取用户真实名
|
// 根据用户名获取用户真实名
|
||||||
|
@ -51,23 +51,29 @@ const handleUpdate = async (row: ModelVO) => {
|
|||||||
|
|
||||||
// 提交按钮
|
// 提交按钮
|
||||||
const submitForm = async () => {
|
const submitForm = async () => {
|
||||||
actionLoading.value = true
|
const elForm = unref(formRef)?.getElFormRef()
|
||||||
// 提交请求
|
if (!elForm) return
|
||||||
try {
|
elForm.validate(async (valid) => {
|
||||||
const data = unref(formRef)?.formModel as ModelVO
|
if (valid) {
|
||||||
if (actionType.value === 'create') {
|
actionLoading.value = true
|
||||||
await ModelApi.createModelApi(data)
|
// 提交请求
|
||||||
message.success(t('common.createSuccess'))
|
try {
|
||||||
} else {
|
const data = unref(formRef)?.formModel as ModelVO
|
||||||
await ModelApi.updateModelApi(data)
|
if (actionType.value === 'create') {
|
||||||
message.success(t('common.updateSuccess'))
|
await ModelApi.createModelApi(data)
|
||||||
|
message.success(t('common.createSuccess'))
|
||||||
|
} else {
|
||||||
|
await ModelApi.updateModelApi(data)
|
||||||
|
message.success(t('common.updateSuccess'))
|
||||||
|
}
|
||||||
|
// 操作成功,重新加载列表
|
||||||
|
dialogVisible.value = false
|
||||||
|
await getList()
|
||||||
|
} finally {
|
||||||
|
actionLoading.value = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 操作成功,重新加载列表
|
})
|
||||||
dialogVisible.value = false
|
|
||||||
await getList()
|
|
||||||
} finally {
|
|
||||||
actionLoading.value = false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 流程表单的详情按钮操作 */
|
/** 流程表单的详情按钮操作 */
|
||||||
|
@ -50,23 +50,29 @@ const handleUpdate = async (row: ConfigVO) => {
|
|||||||
|
|
||||||
// 提交按钮
|
// 提交按钮
|
||||||
const submitForm = async () => {
|
const submitForm = async () => {
|
||||||
actionLoading.value = true
|
const elForm = unref(formRef)?.getElFormRef()
|
||||||
// 提交请求
|
if (!elForm) return
|
||||||
try {
|
elForm.validate(async (valid) => {
|
||||||
const data = unref(formRef)?.formModel as ConfigVO
|
if (valid) {
|
||||||
if (actionType.value === 'create') {
|
actionLoading.value = true
|
||||||
await ConfigApi.createConfigApi(data)
|
// 提交请求
|
||||||
ElMessage.success(t('common.createSuccess'))
|
try {
|
||||||
} else {
|
const data = unref(formRef)?.formModel as ConfigVO
|
||||||
await ConfigApi.updateConfigApi(data)
|
if (actionType.value === 'create') {
|
||||||
ElMessage.success(t('common.updateSuccess'))
|
await ConfigApi.createConfigApi(data)
|
||||||
|
ElMessage.success(t('common.createSuccess'))
|
||||||
|
} else {
|
||||||
|
await ConfigApi.updateConfigApi(data)
|
||||||
|
ElMessage.success(t('common.updateSuccess'))
|
||||||
|
}
|
||||||
|
// 操作成功,重新加载列表
|
||||||
|
dialogVisible.value = false
|
||||||
|
await getList()
|
||||||
|
} finally {
|
||||||
|
actionLoading.value = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 操作成功,重新加载列表
|
})
|
||||||
dialogVisible.value = false
|
|
||||||
await getList()
|
|
||||||
} finally {
|
|
||||||
actionLoading.value = false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ========== 详情相关 ==========
|
// ========== 详情相关 ==========
|
||||||
|
@ -44,23 +44,29 @@ const handleUpdate = async (row: DataSourceConfigVO) => {
|
|||||||
|
|
||||||
// 提交按钮
|
// 提交按钮
|
||||||
const submitForm = async () => {
|
const submitForm = async () => {
|
||||||
loading.value = true
|
const elForm = unref(formRef)?.getElFormRef()
|
||||||
// 提交请求
|
if (!elForm) return
|
||||||
try {
|
elForm.validate(async (valid) => {
|
||||||
const data = unref(formRef)?.formModel as DataSourceConfigVO
|
if (valid) {
|
||||||
if (actionType.value === 'create') {
|
loading.value = true
|
||||||
await DataSourceConfiggApi.createDataSourceConfigApi(data)
|
// 提交请求
|
||||||
ElMessage.success(t('common.createSuccess'))
|
try {
|
||||||
} else {
|
const data = unref(formRef)?.formModel as DataSourceConfigVO
|
||||||
await DataSourceConfiggApi.updateDataSourceConfigApi(data)
|
if (actionType.value === 'create') {
|
||||||
ElMessage.success(t('common.updateSuccess'))
|
await DataSourceConfiggApi.createDataSourceConfigApi(data)
|
||||||
|
ElMessage.success(t('common.createSuccess'))
|
||||||
|
} else {
|
||||||
|
await DataSourceConfiggApi.updateDataSourceConfigApi(data)
|
||||||
|
ElMessage.success(t('common.updateSuccess'))
|
||||||
|
}
|
||||||
|
// 操作成功,重新加载列表
|
||||||
|
dialogVisible.value = false
|
||||||
|
await getList()
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 操作成功,重新加载列表
|
})
|
||||||
dialogVisible.value = false
|
|
||||||
await getList()
|
|
||||||
} finally {
|
|
||||||
loading.value = false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除操作
|
// 删除操作
|
||||||
|
@ -60,23 +60,29 @@ const handleMaster = (row: FileConfigVO) => {
|
|||||||
|
|
||||||
// 提交按钮
|
// 提交按钮
|
||||||
const submitForm = async () => {
|
const submitForm = async () => {
|
||||||
actionLoading.value = true
|
const elForm = unref(formRef)?.getElFormRef()
|
||||||
// 提交请求
|
if (!elForm) return
|
||||||
try {
|
elForm.validate(async (valid) => {
|
||||||
const data = unref(formRef)?.formModel as FileConfigVO
|
if (valid) {
|
||||||
if (actionType.value === 'create') {
|
actionLoading.value = true
|
||||||
await FileConfigApi.createFileConfigApi(data)
|
// 提交请求
|
||||||
message.success(t('common.createSuccess'))
|
try {
|
||||||
} else {
|
const data = unref(formRef)?.formModel as FileConfigVO
|
||||||
await FileConfigApi.updateFileConfigApi(data)
|
if (actionType.value === 'create') {
|
||||||
message.success(t('common.updateSuccess'))
|
await FileConfigApi.createFileConfigApi(data)
|
||||||
|
message.success(t('common.createSuccess'))
|
||||||
|
} else {
|
||||||
|
await FileConfigApi.updateFileConfigApi(data)
|
||||||
|
message.success(t('common.updateSuccess'))
|
||||||
|
}
|
||||||
|
// 操作成功,重新加载列表
|
||||||
|
dialogVisible.value = false
|
||||||
|
await getList()
|
||||||
|
} finally {
|
||||||
|
actionLoading.value = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 操作成功,重新加载列表
|
})
|
||||||
dialogVisible.value = false
|
|
||||||
await getList()
|
|
||||||
} finally {
|
|
||||||
actionLoading.value = false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ========== 详情相关 ==========
|
// ========== 详情相关 ==========
|
||||||
|
@ -98,24 +98,30 @@ const handleRun = (row: JobVO) => {
|
|||||||
}
|
}
|
||||||
// 提交按钮
|
// 提交按钮
|
||||||
const submitForm = async () => {
|
const submitForm = async () => {
|
||||||
actionLoading.value = true
|
const elForm = unref(formRef)?.getElFormRef()
|
||||||
// 提交请求
|
if (!elForm) return
|
||||||
try {
|
elForm.validate(async (valid) => {
|
||||||
const data = unref(formRef)?.formModel as JobVO
|
if (valid) {
|
||||||
data.cronExpression = cronExpression.value
|
actionLoading.value = true
|
||||||
if (actionType.value === 'create') {
|
// 提交请求
|
||||||
await JobApi.createJobApi(data)
|
try {
|
||||||
message.success(t('common.createSuccess'))
|
const data = unref(formRef)?.formModel as JobVO
|
||||||
} else {
|
data.cronExpression = cronExpression.value
|
||||||
await JobApi.updateJobApi(data)
|
if (actionType.value === 'create') {
|
||||||
message.success(t('common.updateSuccess'))
|
await JobApi.createJobApi(data)
|
||||||
|
message.success(t('common.createSuccess'))
|
||||||
|
} else {
|
||||||
|
await JobApi.updateJobApi(data)
|
||||||
|
message.success(t('common.updateSuccess'))
|
||||||
|
}
|
||||||
|
// 操作成功,重新加载列表
|
||||||
|
dialogVisible.value = false
|
||||||
|
await getList()
|
||||||
|
} finally {
|
||||||
|
actionLoading.value = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 操作成功,重新加载列表
|
})
|
||||||
dialogVisible.value = false
|
|
||||||
await getList()
|
|
||||||
} finally {
|
|
||||||
actionLoading.value = false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ========== 详情相关 ==========
|
// ========== 详情相关 ==========
|
||||||
|
@ -50,23 +50,29 @@ const handleUpdate = async (row: AppVO) => {
|
|||||||
|
|
||||||
// 提交按钮
|
// 提交按钮
|
||||||
const submitForm = async () => {
|
const submitForm = async () => {
|
||||||
actionLoading.value = true
|
const elForm = unref(formRef)?.getElFormRef()
|
||||||
// 提交请求
|
if (!elForm) return
|
||||||
try {
|
elForm.validate(async (valid) => {
|
||||||
const data = unref(formRef)?.formModel as AppVO
|
if (valid) {
|
||||||
if (actionType.value === 'create') {
|
actionLoading.value = true
|
||||||
await AppApi.createAppApi(data)
|
// 提交请求
|
||||||
ElMessage.success(t('common.createSuccess'))
|
try {
|
||||||
} else {
|
const data = unref(formRef)?.formModel as AppVO
|
||||||
await AppApi.updateAppApi(data)
|
if (actionType.value === 'create') {
|
||||||
ElMessage.success(t('common.updateSuccess'))
|
await AppApi.createAppApi(data)
|
||||||
|
ElMessage.success(t('common.createSuccess'))
|
||||||
|
} else {
|
||||||
|
await AppApi.updateAppApi(data)
|
||||||
|
ElMessage.success(t('common.updateSuccess'))
|
||||||
|
}
|
||||||
|
// 操作成功,重新加载列表
|
||||||
|
dialogVisible.value = false
|
||||||
|
await getList()
|
||||||
|
} finally {
|
||||||
|
actionLoading.value = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 操作成功,重新加载列表
|
})
|
||||||
dialogVisible.value = false
|
|
||||||
await getList()
|
|
||||||
} finally {
|
|
||||||
actionLoading.value = false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ========== 详情相关 ==========
|
// ========== 详情相关 ==========
|
||||||
|
@ -50,23 +50,29 @@ const handleUpdate = async (row: MerchantVO) => {
|
|||||||
|
|
||||||
// 提交按钮
|
// 提交按钮
|
||||||
const submitForm = async () => {
|
const submitForm = async () => {
|
||||||
actionLoading.value = true
|
const elForm = unref(formRef)?.getElFormRef()
|
||||||
// 提交请求
|
if (!elForm) return
|
||||||
try {
|
elForm.validate(async (valid) => {
|
||||||
const data = unref(formRef)?.formModel as MerchantVO
|
if (valid) {
|
||||||
if (actionType.value === 'create') {
|
actionLoading.value = true
|
||||||
await MerchantApi.createMerchantApi(data)
|
// 提交请求
|
||||||
ElMessage.success(t('common.createSuccess'))
|
try {
|
||||||
} else {
|
const data = unref(formRef)?.formModel as MerchantVO
|
||||||
await MerchantApi.updateMerchantApi(data)
|
if (actionType.value === 'create') {
|
||||||
ElMessage.success(t('common.updateSuccess'))
|
await MerchantApi.createMerchantApi(data)
|
||||||
|
ElMessage.success(t('common.createSuccess'))
|
||||||
|
} else {
|
||||||
|
await MerchantApi.updateMerchantApi(data)
|
||||||
|
ElMessage.success(t('common.updateSuccess'))
|
||||||
|
}
|
||||||
|
// 操作成功,重新加载列表
|
||||||
|
dialogVisible.value = false
|
||||||
|
await getList()
|
||||||
|
} finally {
|
||||||
|
actionLoading.value = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 操作成功,重新加载列表
|
})
|
||||||
dialogVisible.value = false
|
|
||||||
await getList()
|
|
||||||
} finally {
|
|
||||||
actionLoading.value = false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ========== 详情相关 ==========
|
// ========== 详情相关 ==========
|
||||||
|
@ -48,23 +48,29 @@ const handleUpdate = async (row: OrderVO) => {
|
|||||||
|
|
||||||
// 提交按钮
|
// 提交按钮
|
||||||
const submitForm = async () => {
|
const submitForm = async () => {
|
||||||
actionLoading.value = true
|
const elForm = unref(formRef)?.getElFormRef()
|
||||||
// 提交请求
|
if (!elForm) return
|
||||||
try {
|
elForm.validate(async (valid) => {
|
||||||
const data = unref(formRef)?.formModel as OrderVO
|
if (valid) {
|
||||||
if (actionType.value === 'create') {
|
actionLoading.value = true
|
||||||
await OrderApi.createOrderApi(data)
|
// 提交请求
|
||||||
ElMessage.success(t('common.createSuccess'))
|
try {
|
||||||
} else {
|
const data = unref(formRef)?.formModel as OrderVO
|
||||||
await OrderApi.updateOrderApi(data)
|
if (actionType.value === 'create') {
|
||||||
ElMessage.success(t('common.updateSuccess'))
|
await OrderApi.createOrderApi(data)
|
||||||
|
ElMessage.success(t('common.createSuccess'))
|
||||||
|
} else {
|
||||||
|
await OrderApi.updateOrderApi(data)
|
||||||
|
ElMessage.success(t('common.updateSuccess'))
|
||||||
|
}
|
||||||
|
// 操作成功,重新加载列表
|
||||||
|
dialogVisible.value = false
|
||||||
|
await getList()
|
||||||
|
} finally {
|
||||||
|
actionLoading.value = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 操作成功,重新加载列表
|
})
|
||||||
dialogVisible.value = false
|
|
||||||
await getList()
|
|
||||||
} finally {
|
|
||||||
actionLoading.value = false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ========== 详情相关 ==========
|
// ========== 详情相关 ==========
|
||||||
|
@ -82,22 +82,28 @@ const handleDelete = async (data: { id: number }) => {
|
|||||||
}
|
}
|
||||||
// 提交按钮
|
// 提交按钮
|
||||||
const submitForm = async () => {
|
const submitForm = async () => {
|
||||||
loading.value = true
|
const elForm = unref(formRef)?.getElFormRef()
|
||||||
// 提交请求
|
if (!elForm) return
|
||||||
try {
|
elForm.validate(async (valid) => {
|
||||||
const data = unref(formRef)?.formModel as DeptVO
|
if (valid) {
|
||||||
data.parentId = deptParentId.value
|
loading.value = true
|
||||||
data.leaderUserId = leaderUserId.value
|
// 提交请求
|
||||||
if (formTitle.value.startsWith('新增')) {
|
try {
|
||||||
await DeptApi.createDeptApi(data)
|
const data = unref(formRef)?.formModel as DeptVO
|
||||||
} else if (formTitle.value.startsWith('修改')) {
|
data.parentId = deptParentId.value
|
||||||
await DeptApi.updateDeptApi(data)
|
data.leaderUserId = leaderUserId.value
|
||||||
|
if (formTitle.value.startsWith('新增')) {
|
||||||
|
await DeptApi.createDeptApi(data)
|
||||||
|
} else if (formTitle.value.startsWith('修改')) {
|
||||||
|
await DeptApi.updateDeptApi(data)
|
||||||
|
}
|
||||||
|
// 操作成功,重新加载列表
|
||||||
|
dialogVisible.value = false
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 操作成功,重新加载列表
|
})
|
||||||
dialogVisible.value = false
|
|
||||||
} finally {
|
|
||||||
loading.value = false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await getTree()
|
await getTree()
|
||||||
|
@ -92,43 +92,55 @@ const setDialogTile = (type: string) => {
|
|||||||
}
|
}
|
||||||
// 提交按钮
|
// 提交按钮
|
||||||
const submitTypeForm = async () => {
|
const submitTypeForm = async () => {
|
||||||
actionLoading.value = true
|
const elForm = unref(typeFormRef)?.getElFormRef()
|
||||||
// 提交请求
|
if (!elForm) return
|
||||||
try {
|
elForm.validate(async (valid) => {
|
||||||
const data = unref(typeFormRef)?.formModel as DictTypeVO
|
if (valid) {
|
||||||
if (actionType.value === 'typeCreate') {
|
actionLoading.value = true
|
||||||
await DictTypeApi.createDictTypeApi(data)
|
// 提交请求
|
||||||
ElMessage.success(t('common.createSuccess'))
|
try {
|
||||||
} else if (actionType.value === 'typeUpdate') {
|
const data = unref(typeFormRef)?.formModel as DictTypeVO
|
||||||
await DictTypeApi.updateDictTypeApi(data)
|
if (actionType.value === 'typeCreate') {
|
||||||
ElMessage.success(t('common.updateSuccess'))
|
await DictTypeApi.createDictTypeApi(data)
|
||||||
|
ElMessage.success(t('common.createSuccess'))
|
||||||
|
} else if (actionType.value === 'typeUpdate') {
|
||||||
|
await DictTypeApi.updateDictTypeApi(data)
|
||||||
|
ElMessage.success(t('common.updateSuccess'))
|
||||||
|
}
|
||||||
|
// 操作成功,重新加载列表
|
||||||
|
await getTypeList()
|
||||||
|
dialogVisible.value = false
|
||||||
|
} finally {
|
||||||
|
actionLoading.value = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 操作成功,重新加载列表
|
})
|
||||||
await getTypeList()
|
|
||||||
dialogVisible.value = false
|
|
||||||
} finally {
|
|
||||||
actionLoading.value = false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
const submitDataForm = async () => {
|
const submitDataForm = async () => {
|
||||||
actionLoading.value = true
|
const elForm = unref(dataFormRef)?.getElFormRef()
|
||||||
// 提交请求
|
if (!elForm) return
|
||||||
try {
|
elForm.validate(async (valid) => {
|
||||||
const data = unref(dataFormRef)?.formModel as DictDataVO
|
if (valid) {
|
||||||
if (actionType.value === 'dataCreate') {
|
actionLoading.value = true
|
||||||
data.dictType = parentType.value
|
// 提交请求
|
||||||
await DictDataApi.createDictDataApi(data)
|
try {
|
||||||
ElMessage.success(t('common.createSuccess'))
|
const data = unref(dataFormRef)?.formModel as DictDataVO
|
||||||
} else if (actionType.value === 'dataUpdate') {
|
if (actionType.value === 'dataCreate') {
|
||||||
await DictDataApi.updateDictDataApi(data)
|
data.dictType = parentType.value
|
||||||
ElMessage.success(t('common.updateSuccess'))
|
await DictDataApi.createDictDataApi(data)
|
||||||
|
ElMessage.success(t('common.createSuccess'))
|
||||||
|
} else if (actionType.value === 'dataUpdate') {
|
||||||
|
await DictDataApi.updateDictDataApi(data)
|
||||||
|
ElMessage.success(t('common.updateSuccess'))
|
||||||
|
}
|
||||||
|
await getDataList()
|
||||||
|
// 操作成功,重新加载列表
|
||||||
|
dialogVisible.value = false
|
||||||
|
} finally {
|
||||||
|
actionLoading.value = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
await getDataList()
|
})
|
||||||
// 操作成功,重新加载列表
|
|
||||||
dialogVisible.value = false
|
|
||||||
} finally {
|
|
||||||
actionLoading.value = false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// 初始化查询
|
// 初始化查询
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
@ -49,23 +49,29 @@ const handleUpdate = async (row: ErrorCodeVO) => {
|
|||||||
|
|
||||||
// 提交按钮
|
// 提交按钮
|
||||||
const submitForm = async () => {
|
const submitForm = async () => {
|
||||||
loading.value = true
|
const elForm = unref(formRef)?.getElFormRef()
|
||||||
// 提交请求
|
if (!elForm) return
|
||||||
try {
|
elForm.validate(async (valid) => {
|
||||||
const data = unref(formRef)?.formModel as ErrorCodeVO
|
if (valid) {
|
||||||
if (actionType.value === 'create') {
|
loading.value = true
|
||||||
await ErrorCodeApi.createErrorCodeApi(data)
|
// 提交请求
|
||||||
ElMessage.success(t('common.createSuccess'))
|
try {
|
||||||
} else {
|
const data = unref(formRef)?.formModel as ErrorCodeVO
|
||||||
await ErrorCodeApi.updateErrorCodeApi(data)
|
if (actionType.value === 'create') {
|
||||||
ElMessage.success(t('common.updateSuccess'))
|
await ErrorCodeApi.createErrorCodeApi(data)
|
||||||
|
ElMessage.success(t('common.createSuccess'))
|
||||||
|
} else {
|
||||||
|
await ErrorCodeApi.updateErrorCodeApi(data)
|
||||||
|
ElMessage.success(t('common.updateSuccess'))
|
||||||
|
}
|
||||||
|
// 操作成功,重新加载列表
|
||||||
|
dialogVisible.value = false
|
||||||
|
await getList()
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 操作成功,重新加载列表
|
})
|
||||||
dialogVisible.value = false
|
|
||||||
await getList()
|
|
||||||
} finally {
|
|
||||||
loading.value = false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ========== 详情相关 ==========
|
// ========== 详情相关 ==========
|
||||||
|
@ -127,7 +127,7 @@ const handleDelete = async (row: MenuVO) => {
|
|||||||
await getList()
|
await getList()
|
||||||
}
|
}
|
||||||
// 保存操作
|
// 保存操作
|
||||||
function isExternal(path: string) {
|
const isExternal = (path: string) => {
|
||||||
return /^(https?:|mailto:|tel:)/.test(path)
|
return /^(https?:|mailto:|tel:)/.test(path)
|
||||||
}
|
}
|
||||||
const submitForm = async () => {
|
const submitForm = async () => {
|
||||||
|
@ -48,23 +48,29 @@ const handleUpdate = async (row: NoticeVO) => {
|
|||||||
|
|
||||||
// 提交按钮
|
// 提交按钮
|
||||||
const submitForm = async () => {
|
const submitForm = async () => {
|
||||||
actionLoading.value = true
|
const elForm = unref(formRef)?.getElFormRef()
|
||||||
// 提交请求
|
if (!elForm) return
|
||||||
try {
|
elForm.validate(async (valid) => {
|
||||||
const data = unref(formRef)?.formModel as NoticeVO
|
if (valid) {
|
||||||
if (actionType.value === 'create') {
|
actionLoading.value = true
|
||||||
await NoticeApi.createNoticeApi(data)
|
// 提交请求
|
||||||
ElMessage.success(t('common.createSuccess'))
|
try {
|
||||||
} else {
|
const data = unref(formRef)?.formModel as NoticeVO
|
||||||
await NoticeApi.updateNoticeApi(data)
|
if (actionType.value === 'create') {
|
||||||
ElMessage.success(t('common.updateSuccess'))
|
await NoticeApi.createNoticeApi(data)
|
||||||
|
ElMessage.success(t('common.createSuccess'))
|
||||||
|
} else {
|
||||||
|
await NoticeApi.updateNoticeApi(data)
|
||||||
|
ElMessage.success(t('common.updateSuccess'))
|
||||||
|
}
|
||||||
|
// 操作成功,重新加载列表
|
||||||
|
dialogVisible.value = false
|
||||||
|
await getList()
|
||||||
|
} finally {
|
||||||
|
actionLoading.value = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 操作成功,重新加载列表
|
})
|
||||||
dialogVisible.value = false
|
|
||||||
await getList()
|
|
||||||
} finally {
|
|
||||||
actionLoading.value = false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ========== 详情相关 ==========
|
// ========== 详情相关 ==========
|
||||||
|
@ -49,23 +49,29 @@ const handleUpdate = async (row: OAuth2ClientVo) => {
|
|||||||
|
|
||||||
// 提交按钮
|
// 提交按钮
|
||||||
const submitForm = async () => {
|
const submitForm = async () => {
|
||||||
actionLoading.value = true
|
const elForm = unref(formRef)?.getElFormRef()
|
||||||
// 提交请求
|
if (!elForm) return
|
||||||
try {
|
elForm.validate(async (valid) => {
|
||||||
const data = unref(formRef)?.formModel as OAuth2ClientVo
|
if (valid) {
|
||||||
if (actionType.value === 'create') {
|
actionLoading.value = true
|
||||||
await ClientApi.createOAuth2ClientApi(data)
|
// 提交请求
|
||||||
ElMessage.success(t('common.createSuccess'))
|
try {
|
||||||
} else {
|
const data = unref(formRef)?.formModel as OAuth2ClientVo
|
||||||
await ClientApi.updateOAuth2ClientApi(data)
|
if (actionType.value === 'create') {
|
||||||
ElMessage.success(t('common.updateSuccess'))
|
await ClientApi.createOAuth2ClientApi(data)
|
||||||
|
ElMessage.success(t('common.createSuccess'))
|
||||||
|
} else {
|
||||||
|
await ClientApi.updateOAuth2ClientApi(data)
|
||||||
|
ElMessage.success(t('common.updateSuccess'))
|
||||||
|
}
|
||||||
|
// 操作成功,重新加载列表
|
||||||
|
dialogVisible.value = false
|
||||||
|
await getList()
|
||||||
|
} finally {
|
||||||
|
actionLoading.value = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 操作成功,重新加载列表
|
})
|
||||||
dialogVisible.value = false
|
|
||||||
await getList()
|
|
||||||
} finally {
|
|
||||||
actionLoading.value = false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ========== 详情相关 ==========
|
// ========== 详情相关 ==========
|
||||||
|
@ -50,23 +50,29 @@ const handleUpdate = async (row: PostVO) => {
|
|||||||
|
|
||||||
// 提交按钮
|
// 提交按钮
|
||||||
const submitForm = async () => {
|
const submitForm = async () => {
|
||||||
actionLoading.value = true
|
const elForm = unref(formRef)?.getElFormRef()
|
||||||
// 提交请求
|
if (!elForm) return
|
||||||
try {
|
elForm.validate(async (valid) => {
|
||||||
const data = unref(formRef)?.formModel as PostVO
|
if (valid) {
|
||||||
if (actionType.value === 'create') {
|
actionLoading.value = true
|
||||||
await PostApi.createPostApi(data)
|
// 提交请求
|
||||||
ElMessage.success(t('common.createSuccess'))
|
try {
|
||||||
} else {
|
const data = unref(formRef)?.formModel as PostVO
|
||||||
await PostApi.updatePostApi(data)
|
if (actionType.value === 'create') {
|
||||||
ElMessage.success(t('common.updateSuccess'))
|
await PostApi.createPostApi(data)
|
||||||
|
ElMessage.success(t('common.createSuccess'))
|
||||||
|
} else {
|
||||||
|
await PostApi.updatePostApi(data)
|
||||||
|
ElMessage.success(t('common.updateSuccess'))
|
||||||
|
}
|
||||||
|
// 操作成功,重新加载列表
|
||||||
|
dialogVisible.value = false
|
||||||
|
await getList()
|
||||||
|
} finally {
|
||||||
|
actionLoading.value = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 操作成功,重新加载列表
|
})
|
||||||
dialogVisible.value = false
|
|
||||||
await getList()
|
|
||||||
} finally {
|
|
||||||
actionLoading.value = false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ========== 详情相关 ==========
|
// ========== 详情相关 ==========
|
||||||
|
@ -68,23 +68,29 @@ const handleUpdate = async (row: RoleVO) => {
|
|||||||
|
|
||||||
// 提交按钮
|
// 提交按钮
|
||||||
const submitForm = async () => {
|
const submitForm = async () => {
|
||||||
loading.value = true
|
const elForm = unref(formRef)?.getElFormRef()
|
||||||
// 提交请求
|
if (!elForm) return
|
||||||
try {
|
elForm.validate(async (valid) => {
|
||||||
const data = unref(formRef)?.formModel as RoleVO
|
if (valid) {
|
||||||
if (actionType.value === 'create') {
|
loading.value = true
|
||||||
await RoleApi.createRoleApi(data)
|
// 提交请求
|
||||||
ElMessage.success(t('common.createSuccess'))
|
try {
|
||||||
} else {
|
const data = unref(formRef)?.formModel as RoleVO
|
||||||
await RoleApi.updateRoleApi(data)
|
if (actionType.value === 'create') {
|
||||||
ElMessage.success(t('common.updateSuccess'))
|
await RoleApi.createRoleApi(data)
|
||||||
|
ElMessage.success(t('common.createSuccess'))
|
||||||
|
} else {
|
||||||
|
await RoleApi.updateRoleApi(data)
|
||||||
|
ElMessage.success(t('common.updateSuccess'))
|
||||||
|
}
|
||||||
|
// 操作成功,重新加载列表
|
||||||
|
dialogVisible.value = false
|
||||||
|
await getList()
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 操作成功,重新加载列表
|
})
|
||||||
dialogVisible.value = false
|
|
||||||
await getList()
|
|
||||||
} finally {
|
|
||||||
loading.value = false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ========== 详情相关 ==========
|
// ========== 详情相关 ==========
|
||||||
|
@ -56,23 +56,29 @@ const handleUpdate = async (row: SensitiveWordVO) => {
|
|||||||
|
|
||||||
// 提交按钮
|
// 提交按钮
|
||||||
const submitForm = async () => {
|
const submitForm = async () => {
|
||||||
actionLoading.value = true
|
const elForm = unref(formRef)?.getElFormRef()
|
||||||
// 提交请求
|
if (!elForm) return
|
||||||
try {
|
elForm.validate(async (valid) => {
|
||||||
const data = unref(formRef)?.formModel as SensitiveWordVO
|
if (valid) {
|
||||||
if (actionType.value === 'create') {
|
actionLoading.value = true
|
||||||
await SensitiveWordApi.createSensitiveWordApi(data)
|
// 提交请求
|
||||||
ElMessage.success(t('common.createSuccess'))
|
try {
|
||||||
} else {
|
const data = unref(formRef)?.formModel as SensitiveWordVO
|
||||||
await SensitiveWordApi.updateSensitiveWordApi(data)
|
if (actionType.value === 'create') {
|
||||||
ElMessage.success(t('common.updateSuccess'))
|
await SensitiveWordApi.createSensitiveWordApi(data)
|
||||||
|
ElMessage.success(t('common.createSuccess'))
|
||||||
|
} else {
|
||||||
|
await SensitiveWordApi.updateSensitiveWordApi(data)
|
||||||
|
ElMessage.success(t('common.updateSuccess'))
|
||||||
|
}
|
||||||
|
// 操作成功,重新加载列表
|
||||||
|
dialogVisible.value = false
|
||||||
|
await getList()
|
||||||
|
} finally {
|
||||||
|
actionLoading.value = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 操作成功,重新加载列表
|
})
|
||||||
dialogVisible.value = false
|
|
||||||
await getList()
|
|
||||||
} finally {
|
|
||||||
actionLoading.value = false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ========== 详情相关 ==========
|
// ========== 详情相关 ==========
|
||||||
|
@ -49,23 +49,29 @@ const handleUpdate = async (row: SmsChannelVO) => {
|
|||||||
|
|
||||||
// 提交按钮
|
// 提交按钮
|
||||||
const submitForm = async () => {
|
const submitForm = async () => {
|
||||||
loading.value = true
|
const elForm = unref(formRef)?.getElFormRef()
|
||||||
// 提交请求
|
if (!elForm) return
|
||||||
try {
|
elForm.validate(async (valid) => {
|
||||||
const data = unref(formRef)?.formModel as SmsChannelVO
|
if (valid) {
|
||||||
if (actionType.value === 'create') {
|
loading.value = true
|
||||||
await SmsChannelApi.createSmsChannelApi(data)
|
// 提交请求
|
||||||
ElMessage.success(t('common.createSuccess'))
|
try {
|
||||||
} else {
|
const data = unref(formRef)?.formModel as SmsChannelVO
|
||||||
await SmsChannelApi.updateSmsChannelApi(data)
|
if (actionType.value === 'create') {
|
||||||
ElMessage.success(t('common.updateSuccess'))
|
await SmsChannelApi.createSmsChannelApi(data)
|
||||||
|
ElMessage.success(t('common.createSuccess'))
|
||||||
|
} else {
|
||||||
|
await SmsChannelApi.updateSmsChannelApi(data)
|
||||||
|
ElMessage.success(t('common.updateSuccess'))
|
||||||
|
}
|
||||||
|
// 操作成功,重新加载列表
|
||||||
|
dialogVisible.value = false
|
||||||
|
await getList()
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 操作成功,重新加载列表
|
})
|
||||||
dialogVisible.value = false
|
|
||||||
await getList()
|
|
||||||
} finally {
|
|
||||||
loading.value = false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ========== 详情相关 ==========
|
// ========== 详情相关 ==========
|
||||||
|
@ -49,23 +49,29 @@ const handleUpdate = async (row: SmsTemplateVO) => {
|
|||||||
|
|
||||||
// 提交按钮
|
// 提交按钮
|
||||||
const submitForm = async () => {
|
const submitForm = async () => {
|
||||||
loading.value = true
|
const elForm = unref(formRef)?.getElFormRef()
|
||||||
// 提交请求
|
if (!elForm) return
|
||||||
try {
|
elForm.validate(async (valid) => {
|
||||||
const data = unref(formRef)?.formModel as SmsTemplateVO
|
if (valid) {
|
||||||
if (actionType.value === 'create') {
|
loading.value = true
|
||||||
await SmsTemplateApi.createSmsTemplateApi(data)
|
// 提交请求
|
||||||
ElMessage.success(t('common.createSuccess'))
|
try {
|
||||||
} else {
|
const data = unref(formRef)?.formModel as SmsTemplateVO
|
||||||
await SmsTemplateApi.updateSmsTemplateApi(data)
|
if (actionType.value === 'create') {
|
||||||
ElMessage.success(t('common.updateSuccess'))
|
await SmsTemplateApi.createSmsTemplateApi(data)
|
||||||
|
ElMessage.success(t('common.createSuccess'))
|
||||||
|
} else {
|
||||||
|
await SmsTemplateApi.updateSmsTemplateApi(data)
|
||||||
|
ElMessage.success(t('common.updateSuccess'))
|
||||||
|
}
|
||||||
|
// 操作成功,重新加载列表
|
||||||
|
dialogVisible.value = false
|
||||||
|
await getList()
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 操作成功,重新加载列表
|
})
|
||||||
dialogVisible.value = false
|
|
||||||
await getList()
|
|
||||||
} finally {
|
|
||||||
loading.value = false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ========== 详情相关 ==========
|
// ========== 详情相关 ==========
|
||||||
|
@ -71,26 +71,32 @@ const handleUpdate = async (row: any) => {
|
|||||||
|
|
||||||
// 提交按钮
|
// 提交按钮
|
||||||
const submitForm = async () => {
|
const submitForm = async () => {
|
||||||
actionLoading.value = true
|
const elForm = unref(formRef)?.getElFormRef()
|
||||||
// 提交请求 unix()
|
if (!elForm) return
|
||||||
try {
|
elForm.validate(async (valid) => {
|
||||||
const data = unref(formRef)?.formModel as TenantVO
|
if (valid) {
|
||||||
data.packageId = tenantPackageId.value
|
actionLoading.value = true
|
||||||
if (actionType.value === 'create') {
|
// 提交请求
|
||||||
data.expireTime = dayjs(data.expireTime).valueOf().toString()
|
try {
|
||||||
await TenantApi.createTenantApi(data)
|
const data = unref(formRef)?.formModel as TenantVO
|
||||||
ElMessage.success(t('common.createSuccess'))
|
data.packageId = tenantPackageId.value
|
||||||
} else {
|
if (actionType.value === 'create') {
|
||||||
data.expireTime = dayjs(data.expireTime).valueOf().toString()
|
data.expireTime = dayjs(data.expireTime).valueOf().toString()
|
||||||
await TenantApi.updateTenantApi(data)
|
await TenantApi.createTenantApi(data)
|
||||||
ElMessage.success(t('common.updateSuccess'))
|
ElMessage.success(t('common.createSuccess'))
|
||||||
|
} else {
|
||||||
|
data.expireTime = dayjs(data.expireTime).valueOf().toString()
|
||||||
|
await TenantApi.updateTenantApi(data)
|
||||||
|
ElMessage.success(t('common.updateSuccess'))
|
||||||
|
}
|
||||||
|
// 操作成功,重新加载列表
|
||||||
|
dialogVisible.value = false
|
||||||
|
await getList()
|
||||||
|
} finally {
|
||||||
|
actionLoading.value = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 操作成功,重新加载列表
|
})
|
||||||
dialogVisible.value = false
|
|
||||||
await getList()
|
|
||||||
} finally {
|
|
||||||
actionLoading.value = false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ========== 详情相关 ==========
|
// ========== 详情相关 ==========
|
||||||
|
@ -76,24 +76,30 @@ const handleUpdate = async (row: any) => {
|
|||||||
}
|
}
|
||||||
// 提交按钮
|
// 提交按钮
|
||||||
const submitForm = async () => {
|
const submitForm = async () => {
|
||||||
loading.value = true
|
const elForm = unref(formRef)?.getElFormRef()
|
||||||
// 提交请求
|
if (!elForm) return
|
||||||
try {
|
elForm.validate(async (valid) => {
|
||||||
const data = unref(formRef)?.formModel as TenantPackageVO
|
if (valid) {
|
||||||
data.menuIds = treeRef.value!.getCheckedKeys(false) as string[]
|
loading.value = true
|
||||||
if (actionType.value === 'create') {
|
// 提交请求
|
||||||
await TenantPackageApi.createTenantPackageTypeApi(data)
|
try {
|
||||||
ElMessage.success(t('common.createSuccess'))
|
const data = unref(formRef)?.formModel as TenantPackageVO
|
||||||
} else {
|
data.menuIds = treeRef.value!.getCheckedKeys(false) as string[]
|
||||||
await TenantPackageApi.updateTenantPackageTypeApi(data)
|
if (actionType.value === 'create') {
|
||||||
ElMessage.success(t('common.updateSuccess'))
|
await TenantPackageApi.createTenantPackageTypeApi(data)
|
||||||
|
ElMessage.success(t('common.createSuccess'))
|
||||||
|
} else {
|
||||||
|
await TenantPackageApi.updateTenantPackageTypeApi(data)
|
||||||
|
ElMessage.success(t('common.updateSuccess'))
|
||||||
|
}
|
||||||
|
// 操作成功,重新加载列表
|
||||||
|
dialogVisible.value = false
|
||||||
|
await getList()
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 操作成功,重新加载列表
|
})
|
||||||
dialogVisible.value = false
|
|
||||||
await getList()
|
|
||||||
} finally {
|
|
||||||
loading.value = false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ========== 初始化 ==========
|
// ========== 初始化 ==========
|
||||||
|
Loading…
Reference in New Issue
Block a user