This commit is contained in:
shizhong 2023-06-13 10:56:20 +08:00
parent 38fa336816
commit 7cfb09fe3c
26 changed files with 173 additions and 126 deletions

3
.gitignore vendored
View File

@ -9,3 +9,6 @@ pnpm-debug
.idea
.history
yarn.lock
*.iml

View File

@ -1,5 +1,5 @@
<template>
<Dialog :title="modelTitle" v-model="modelVisible">
<Dialog :title="dialogTitle" v-model="dialogVisible">
<el-form
ref="formRef"
:model="formData"
@ -37,7 +37,7 @@
</el-form>
<template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
<el-button @click="modelVisible = false"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</template>
</Dialog>
</template>
@ -50,8 +50,8 @@ import * as UserApi from '@/api/system/user'
const { t } = useI18n() //
const message = useMessage() //
const modelVisible = ref(false) //
const modelTitle = ref('') //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const formData = ref({
@ -72,8 +72,8 @@ const userList = ref([]) // 用户列表
/** 打开弹窗 */
const open = async (type: string, id?: number) => {
modelVisible.value = true
modelTitle.value = t('action.' + type)
dialogVisible.value = true
dialogTitle.value = t('action.' + type)
formType.value = type
resetForm()
//
@ -108,7 +108,7 @@ const submitForm = async () => {
await UserGroupApi.updateUserGroup(data)
message.success(t('common.updateSuccess'))
}
modelVisible.value = false
dialogVisible.value = false
//
emit('success')
} finally {

View File

@ -1,5 +1,5 @@
<template>
<Dialog :title="modelTitle" v-model="modelVisible" width="600">
<Dialog :title="dialogTitle" v-model="dialogVisible" width="600">
<el-form
ref="formRef"
:model="formData"
@ -117,7 +117,7 @@
</el-form>
<template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
<el-button @click="modelVisible = false"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</template>
</Dialog>
</template>
@ -129,8 +129,8 @@ import * as FormApi from '@/api/bpm/form'
const { t } = useI18n() //
const message = useMessage() //
const modelVisible = ref(false) //
const modelTitle = ref('') //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const formData = ref({
@ -154,8 +154,8 @@ const formList = ref([]) // 流程表单的下拉框的数据
/** 打开弹窗 */
const open = async (type: string, id?: number) => {
modelVisible.value = true
modelTitle.value = t('action.' + type)
dialogVisible.value = true
dialogTitle.value = t('action.' + type)
formType.value = type
resetForm()
//
@ -203,7 +203,7 @@ const submitForm = async () => {
await ModelApi.updateModelApi(data)
message.success(t('common.updateSuccess'))
}
modelVisible.value = false
dialogVisible.value = false
//
emit('success')
} finally {

View File

@ -1,5 +1,5 @@
<template>
<Dialog title="导入流程" v-model="modelVisible" width="400">
<Dialog title="导入流程" v-model="dialogVisible" width="400">
<div>
<el-upload
ref="uploadRef"
@ -45,7 +45,7 @@
</div>
<template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
<el-button @click="modelVisible = false"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</template>
</Dialog>
</template>
@ -53,7 +53,7 @@
import { getAccessToken, getTenantId } from '@/utils/auth'
const message = useMessage() //
const modelVisible = ref(false) //
const dialogVisible = ref(false) //
const formLoading = ref(false) //
const formData = ref({
key: '',
@ -72,7 +72,7 @@ const fileList = ref([]) // 文件列表
/** 打开弹窗 */
const open = async () => {
modelVisible.value = true
dialogVisible.value = true
resetForm()
}
defineExpose({ open }) // open

View File

@ -1,5 +1,5 @@
<template>
<Dialog title="转派审批人" v-model="modelVisible" width="500">
<Dialog title="转派审批人" v-model="dialogVisible" width="500">
<el-form
ref="formRef"
:model="formData"
@ -20,7 +20,7 @@
</el-form>
<template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
<el-button @click="modelVisible = false"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</template>
</Dialog>
</template>
@ -28,7 +28,7 @@
import * as TaskApi from '@/api/bpm/task'
import * as UserApi from '@/api/system/user'
const modelVisible = ref(false) //
const dialogVisible = ref(false) //
const formLoading = ref(false) //
const formData = ref({
id: '',
@ -43,7 +43,7 @@ const userList = ref<any[]>([]) // 用户列表
/** 打开弹窗 */
const open = async (id: string) => {
modelVisible.value = true
dialogVisible.value = true
resetForm()
formData.value.id = id
//
@ -62,7 +62,7 @@ const submitForm = async () => {
formLoading.value = true
try {
await TaskApi.updateTaskAssignee(formData.value)
modelVisible.value = false
dialogVisible.value = false
//
emit('success')
} finally {

View File

@ -1,5 +1,5 @@
<template>
<Dialog title="修改任务规则" v-model="modelVisible" width="600">
<Dialog title="修改任务规则" v-model="dialogVisible" width="600">
<el-form ref="formRef" :model="formData" :rules="formRules" label-width="80px">
<el-form-item label="任务名称" prop="taskDefinitionName">
<el-input v-model="formData.taskDefinitionName" placeholder="请输入流标标识" disabled />
@ -93,7 +93,7 @@
<!-- 操作按钮 -->
<template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
<el-button @click="modelVisible = false"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</template>
</Dialog>
</template>
@ -109,7 +109,7 @@ import * as UserGroupApi from '@/api/bpm/userGroup'
const { t } = useI18n() //
const message = useMessage() //
const modelVisible = ref(false) //
const dialogVisible = ref(false) //
const formLoading = ref(false) // 12
const formData = ref({
type: Number(undefined),
@ -171,7 +171,7 @@ const open = async (modelId: string, row: TaskAssignRuleApi.TaskAssignVO) => {
formData.value.scripts.push(...row.options)
}
//
modelVisible.value = true
dialogVisible.value = true
//
roleOptions.value = await RoleApi.getSimpleRoleList()
@ -232,7 +232,7 @@ const submitForm = async () => {
await TaskAssignRuleApi.updateTaskAssignRule(data)
message.success(t('common.updateSuccess'))
}
modelVisible.value = false
dialogVisible.value = false
//
emit('success')
} finally {

View File

@ -1,5 +1,5 @@
<template>
<Dialog title="详情" v-model="modelVisible" :scroll="true" :max-height="500" width="800">
<Dialog title="详情" v-model="dialogVisible" :scroll="true" :max-height="500" width="800">
<el-descriptions border :column="1">
<el-descriptions-item label="日志主键" min-width="120">
{{ detailData.id }}
@ -45,13 +45,13 @@ import { DICT_TYPE } from '@/utils/dict'
import { formatDate } from '@/utils/formatTime'
import * as ApiAccessLog from '@/api/infra/apiAccessLog'
const modelVisible = ref(false) //
const dialogVisible = ref(false) //
const detailLoading = ref(false) //
const detailData = ref() //
/** 打开弹窗 */
const open = async (data: ApiAccessLog.ApiAccessLogVO) => {
modelVisible.value = true
dialogVisible.value = true
//
detailLoading.value = true
try {

View File

@ -1,5 +1,5 @@
<template>
<Dialog title="详情" v-model="modelVisible" :scroll="true" :max-height="500" width="800">
<Dialog title="详情" v-model="dialogVisible" :scroll="true" :max-height="500" width="800">
<el-descriptions border :column="1">
<el-descriptions-item label="日志主键" min-width="120">
{{ detailData.id }}
@ -60,13 +60,13 @@ import { DICT_TYPE } from '@/utils/dict'
import { formatDate } from '@/utils/formatTime'
import * as ApiErrorLog from '@/api/infra/apiErrorLog'
const modelVisible = ref(false) //
const dialogVisible = ref(false) //
const detailLoading = ref(false) //
const detailData = ref() //
/** 打开弹窗 */
const open = async (data: ApiErrorLog.ApiErrorLogVO) => {
modelVisible.value = true
dialogVisible.value = true
//
detailLoading.value = true
try {

View File

@ -1,5 +1,5 @@
<template>
<Dialog title="导入表" v-model="modelVisible" width="800px">
<Dialog title="导入表" v-model="dialogVisible" width="800px">
<!-- 搜索栏 -->
<el-form :model="queryParams" ref="queryFormRef" :inline="true" label-width="68px">
<el-form-item label="数据源" prop="dataSourceConfigId">
@ -69,7 +69,7 @@ import * as DataSourceConfigApi from '@/api/infra/dataSourceConfig'
import { ElTable } from 'element-plus'
const message = useMessage() //
const modelVisible = ref(false) //
const dialogVisible = ref(false) //
const dbTableLoading = ref(true) //
const dbTableList = ref<CodegenApi.DatabaseTableVO[]>([]) //
const queryParams = reactive({
@ -103,7 +103,7 @@ const open = async () => {
//
dataSourceConfigList.value = await DataSourceConfigApi.getDataSourceConfigList()
queryParams.dataSourceConfigId = dataSourceConfigList.value[0].id as number
modelVisible.value = true
dialogVisible.value = true
//
await getList()
}
@ -111,7 +111,7 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗
/** 关闭弹窗 */
const close = () => {
modelVisible.value = false
dialogVisible.value = false
tableList.value = []
}

View File

@ -1,7 +1,7 @@
<template>
<Dialog
title="代码预览"
v-model="modelVisible"
v-model="dialogVisible"
align-center
width="80%"
class="app-infra-codegen-preview-container"
@ -61,7 +61,7 @@ import * as CodegenApi from '@/api/infra/codegen'
const { t } = useI18n() //
const message = useMessage() //
const modelVisible = ref(false) //
const dialogVisible = ref(false) //
const loading = ref(false) //
const preview = reactive({
fileTree: [], //
@ -86,7 +86,7 @@ interface filesType {
/** 打开弹窗 */
const open = async (id: number) => {
modelVisible.value = true
dialogVisible.value = true
try {
loading.value = true
//

View File

@ -1,5 +1,5 @@
<template>
<Dialog :title="modelTitle" v-model="modelVisible">
<Dialog :title="dialogTitle" v-model="dialogVisible">
<el-form
ref="formRef"
:model="formData"
@ -36,7 +36,7 @@
</el-form>
<template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
<el-button @click="modelVisible = false"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</template>
</Dialog>
</template>
@ -47,8 +47,8 @@ import * as ConfigApi from '@/api/infra/config'
const { t } = useI18n() //
const message = useMessage() //
const modelVisible = ref(false) //
const modelTitle = ref('') //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const formData = ref({
@ -71,8 +71,8 @@ const formRef = ref() // 表单 Ref
/** 打开弹窗 */
const openModal = async (type: string, id?: number) => {
modelVisible.value = true
modelTitle.value = t('action.' + type)
dialogVisible.value = true
dialogTitle.value = t('action.' + type)
formType.value = type
resetForm()
//
@ -105,7 +105,7 @@ const submitForm = async () => {
await ConfigApi.updateConfig(data)
message.success(t('common.updateSuccess'))
}
modelVisible.value = false
dialogVisible.value = false
//
emit('success')
} finally {

View File

@ -1,5 +1,5 @@
<template>
<Dialog :title="modelTitle" v-model="modelVisible">
<Dialog :title="dialogTitle" v-model="dialogVisible">
<el-form
ref="formRef"
:model="formData"
@ -22,7 +22,7 @@
</el-form>
<template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
<el-button @click="modelVisible = false"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</template>
</Dialog>
</template>
@ -32,8 +32,8 @@ import * as DataSourceConfigApi from '@/api/infra/dataSourceConfig'
const { t } = useI18n() //
const message = useMessage() //
const modelVisible = ref(false) //
const modelTitle = ref('') //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const formData = ref<DataSourceConfigApi.DataSourceConfigVO>({
@ -53,8 +53,8 @@ const formRef = ref() // 表单 Ref
/** 打开弹窗 */
const openModal = async (type: string, id?: number) => {
modelVisible.value = true
modelTitle.value = t('action.' + type)
dialogVisible.value = true
dialogTitle.value = t('action.' + type)
formType.value = type
resetForm()
//
@ -87,7 +87,7 @@ const submitForm = async () => {
await DataSourceConfigApi.updateDataSourceConfig(data)
message.success(t('common.updateSuccess'))
}
modelVisible.value = false
dialogVisible.value = false
//
emit('success')
} finally {

View File

@ -1,5 +1,5 @@
<template>
<Dialog :title="modelTitle" v-model="modelVisible">
<Dialog :title="dialogTitle" v-model="dialogVisible">
<el-upload
ref="uploadRef"
:limit="1"
@ -24,7 +24,7 @@
</el-upload>
<template #footer>
<el-button @click="submitFileForm" type="primary" :disabled="formLoading"> </el-button>
<el-button @click="modelVisible = false"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</template>
</Dialog>
</template>
@ -36,8 +36,8 @@ import { getAccessToken } from '@/utils/auth'
const { t } = useI18n() //
const message = useMessage() //
const modelVisible = ref(false) //
const modelTitle = ref('') //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const url = import.meta.env.VITE_UPLOAD_URL
const headers = { Authorization: 'Bearer ' + getAccessToken() }
@ -46,8 +46,8 @@ const uploadRef = ref()
/** 打开弹窗 */
const openModal = async () => {
modelVisible.value = true
modelTitle.value = t('action.fileUpload')
dialogVisible.value = true
dialogTitle.value = t('action.fileUpload')
}
defineExpose({ openModal }) // openModal
@ -71,7 +71,7 @@ const submitFileForm = () => {
/** 文件上传成功处理 */
const handleFileSuccess = () => {
//
modelVisible.value = false
dialogVisible.value = false
formLoading.value = false
unref(uploadRef)?.clearFiles()
//

View File

@ -1,5 +1,5 @@
<template>
<Dialog :title="modelTitle" v-model="modelVisible">
<Dialog :title="dialogTitle" v-model="dialogVisible">
<el-form
ref="formRef"
:model="formData"
@ -94,7 +94,7 @@
</el-form>
<template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
<el-button @click="modelVisible = false"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</template>
</Dialog>
</template>
@ -105,8 +105,8 @@ import * as FileConfigApi from '@/api/infra/fileConfig'
const { t } = useI18n() //
const message = useMessage() //
const modelVisible = ref(false) //
const modelTitle = ref('') //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const formData = ref({
@ -137,8 +137,8 @@ const formRef = ref() // 表单 Ref
/** 打开弹窗 */
const openModal = async (type: string, id?: number) => {
modelVisible.value = true
modelTitle.value = t('action.' + type)
dialogVisible.value = true
dialogTitle.value = t('action.' + type)
formType.value = type
resetForm()
//
@ -171,7 +171,7 @@ const submitForm = async () => {
await FileConfigApi.updateFileConfig(data)
message.success(t('common.updateSuccess'))
}
modelVisible.value = false
dialogVisible.value = false
//
emit('success')
} finally {

View File

@ -1,5 +1,5 @@
<template>
<Dialog title="任务详细" v-model="modelVisible" width="700px">
<Dialog title="任务详细" v-model="dialogVisible" width="700px">
<el-descriptions border :column="1">
<el-descriptions-item label="任务编号" min-width="60">
{{ detailData.id }}
@ -47,14 +47,14 @@ import { DICT_TYPE } from '@/utils/dict'
import { formatDate } from '@/utils/formatTime'
import * as JobApi from '@/api/infra/job'
const modelVisible = ref(false) //
const dialogVisible = ref(false) //
const detailLoading = ref(false) //
const detailData = ref({}) //
const nextTimes = ref([]) //
/** 打开弹窗 */
const open = async (id: number) => {
modelVisible.value = true
dialogVisible.value = true
//
if (id) {
detailLoading.value = true

View File

@ -1,5 +1,5 @@
<template>
<Dialog :title="modelTitle" v-model="modelVisible">
<Dialog :title="dialogTitle" v-model="dialogVisible">
<el-form
ref="formRef"
:model="formData"
@ -41,7 +41,7 @@
</el-form>
<template #footer>
<el-button type="primary" @click="submitForm" :loading="formLoading"> </el-button>
<el-button @click="modelVisible = false"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</template>
</Dialog>
</template>
@ -50,8 +50,8 @@ import * as JobApi from '@/api/infra/job'
const { t } = useI18n() //
const message = useMessage() //
const modelVisible = ref(false) //
const modelTitle = ref('') //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const formData = ref({
@ -72,8 +72,8 @@ const formRef = ref() // 表单 Ref
/** 打开弹窗 */
const open = async (type: string, id?: number) => {
modelVisible.value = true
modelTitle.value = t('action.' + type)
dialogVisible.value = true
dialogTitle.value = t('action.' + type)
formType.value = type
resetForm()
//
@ -106,7 +106,7 @@ const submitForm = async () => {
await JobApi.updateJob(data)
message.success(t('common.updateSuccess'))
}
modelVisible.value = false
dialogVisible.value = false
//
emit('success')
} finally {

View File

@ -1,5 +1,5 @@
<template>
<Dialog title="任务详细" v-model="modelVisible" width="700px">
<Dialog title="任务详细" v-model="dialogVisible" width="700px">
<el-descriptions border :column="1">
<el-descriptions-item label="日志编号" min-width="60">
{{ detailData.id }}
@ -36,13 +36,13 @@ import { DICT_TYPE } from '@/utils/dict'
import { formatDate } from '@/utils/formatTime'
import * as JobLogApi from '@/api/infra/jobLog'
const modelVisible = ref(false) //
const dialogVisible = ref(false) //
const detailLoading = ref(false) //
const detailData = ref({}) //
/** 打开弹窗 */
const open = async (id: number) => {
modelVisible.value = true
dialogVisible.value = true
//
if (id) {
detailLoading.value = true

View File

@ -0,0 +1,44 @@
export const parseTime = (time) => {
if (!time) {
return null
}
const format = '{y}-{m}-{d} {h}:{i}:{s}'
let date
if (typeof time === 'object') {
date = time
} else {
if (typeof time === 'string' && /^[0-9]+$/.test(time)) {
time = parseInt(time)
} else if (typeof time === 'string') {
time = time
.replace(new RegExp(/-/gm), '/')
.replace('T', ' ')
.replace(new RegExp(/\.[\d]{3}/gm), '')
}
if (typeof time === 'number' && time.toString().length === 10) {
time = time * 1000
}
date = new Date(time)
}
const formatObj = {
y: date.getFullYear(),
m: date.getMonth() + 1,
d: date.getDate(),
h: date.getHours(),
i: date.getMinutes(),
s: date.getSeconds(),
a: date.getDay()
}
const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => {
let value = formatObj[key]
// Note: getDay() returns 0 on Sunday
if (key === 'a') {
return ['日', '一', '二', '三', '四', '五', '六'][value]
}
if (result.length > 0 && value < 10) {
value = '0' + value
}
return value || 0
})
return time_str
}

View File

@ -1,5 +1,5 @@
<template>
<Dialog :title="modelTitle" v-model="modelVisible">
<Dialog :title="dialogTitle" v-model="dialogVisible">
<el-form
ref="formRef"
:model="formData"
@ -46,7 +46,7 @@
</el-form>
<template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
<el-button @click="modelVisible = false"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</template>
</Dialog>
</template>
@ -58,8 +58,8 @@ import * as ProductCategoryApi from '@/api/mall/product/category'
const { t } = useI18n() //
const message = useMessage() //
const modelVisible = ref(false) //
const modelTitle = ref('') //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const formData = ref({
@ -81,8 +81,8 @@ const categoryTree = ref<any[]>([]) // 分类树
/** 打开弹窗 */
const open = async (type: string, id?: number) => {
modelVisible.value = true
modelTitle.value = t('action.' + type)
dialogVisible.value = true
dialogTitle.value = t('action.' + type)
formType.value = type
resetForm()
//
@ -117,7 +117,7 @@ const submitForm = async () => {
await ProductCategoryApi.updateCategory(data)
message.success(t('common.updateSuccess'))
}
modelVisible.value = false
dialogVisible.value = false
//
emit('success')
} finally {

View File

@ -1,5 +1,5 @@
<template>
<Dialog :title="modelTitle" v-model="modelVisible">
<Dialog :title="dialogTitle" v-model="dialogVisible">
<el-form
ref="formRef"
:model="formData"
@ -17,7 +17,7 @@
<template #footer>
<div class="dialog-footer">
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
<el-button @click="modelVisible = false"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</div>
</template>
</Dialog>
@ -27,8 +27,8 @@ import * as PropertyApi from '@/api/mall/product/property'
const { t } = useI18n() //
const message = useMessage() //
const modelVisible = ref(false) //
const modelTitle = ref('') //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const formData = ref({
@ -42,8 +42,8 @@ const formRef = ref() // 表单 Ref
/** 打开弹窗 */
const open = async (type: string, id?: number) => {
modelVisible.value = true
modelTitle.value = t('action.' + type)
dialogVisible.value = true
dialogTitle.value = t('action.' + type)
formType.value = type
resetForm()
//
@ -76,7 +76,7 @@ const submitForm = async () => {
await PropertyApi.updateProperty(data)
message.success(t('common.updateSuccess'))
}
modelVisible.value = false
dialogVisible.value = false
//
emit('success')
} finally {

View File

@ -110,7 +110,7 @@ const queryParams = reactive({
})
const queryFormRef = ref() //
/** 查询参数列表 */
/** 查询列表 */
const getList = async () => {
loading.value = true
try {

View File

@ -1,5 +1,5 @@
<template>
<Dialog :title="modelTitle" v-model="modelVisible">
<Dialog :title="dialogTitle" v-model="dialogVisible">
<el-form
ref="formRef"
:model="formData"
@ -19,7 +19,7 @@
</el-form>
<template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
<el-button @click="modelVisible = false"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</template>
</Dialog>
</template>
@ -28,8 +28,8 @@ import * as PropertyApi from '@/api/mall/product/property'
const { t } = useI18n() //
const message = useMessage() //
const modelVisible = ref(false) //
const modelTitle = ref('') //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const formData = ref({
@ -46,8 +46,8 @@ const formRef = ref() // 表单 Ref
/** 打开弹窗 */
const open = async (type: string, propertyId: number, id?: number) => {
modelVisible.value = true
modelTitle.value = t('action.' + type)
dialogVisible.value = true
dialogTitle.value = t('action.' + type)
formType.value = type
resetForm()
formData.value.propertyId = propertyId
@ -81,7 +81,7 @@ const submitForm = async () => {
await PropertyApi.updatePropertyValue(data)
message.success(t('common.updateSuccess'))
}
modelVisible.value = false
dialogVisible.value = false
//
emit('success')
} finally {

View File

@ -108,7 +108,7 @@ const queryParams = reactive({
const queryFormRef = ref() //
const propertyOptions = ref([]) //
/** 查询参数列表 */
/** 查询列表 */
const getList = async () => {
loading.value = true
try {

View File

@ -1,5 +1,5 @@
<template>
<Dialog :title="modelTitle" v-model="modelVisible">
<Dialog :title="dialogTitle" v-model="dialogVisible">
<el-form
ref="formRef"
:model="formData"
@ -64,7 +64,7 @@
</el-form>
<template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
<el-button @click="modelVisible = false"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</template>
</Dialog>
</template>
@ -73,8 +73,8 @@ import * as AccountApi from '@/api/mp/account'
const { t } = useI18n() //
const message = useMessage() //
const modelVisible = ref(false) //
const modelTitle = ref('') //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const formData = ref({
@ -98,8 +98,8 @@ const formRef = ref() // 表单 Ref
/** 打开弹窗 */
const open = async (type: string, id?: number) => {
modelVisible.value = true
modelTitle.value = t('action.' + type)
dialogVisible.value = true
dialogTitle.value = t('action.' + type)
formType.value = type
resetForm()
//
@ -132,7 +132,7 @@ const submitForm = async () => {
await AccountApi.updateAccount(data)
message.success(t('common.updateSuccess'))
}
modelVisible.value = false
dialogVisible.value = false
//
emit('success')
} finally {

View File

@ -1,5 +1,5 @@
<template>
<Dialog :title="modelTitle" v-model="modelVisible">
<Dialog :title="dialogTitle" v-model="dialogVisible">
<el-form
ref="formRef"
:model="formData"
@ -13,7 +13,7 @@
</el-form>
<template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
<el-button @click="modelVisible = false"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</template>
</Dialog>
</template>
@ -22,8 +22,8 @@ import * as MpTagApi from '@/api/mp/tag'
const { t } = useI18n() //
const message = useMessage() //
const modelVisible = ref(false) //
const modelTitle = ref('') //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const formData = ref({
@ -37,8 +37,8 @@ const formRef = ref() // 表单 Ref
/** 打开弹窗 */
const open = async (type: string, accountId: number, id?: number) => {
modelVisible.value = true
modelTitle.value = t('action.' + type)
dialogVisible.value = true
dialogTitle.value = t('action.' + type)
formType.value = type
resetForm()
formData.value.accountId = accountId
@ -72,7 +72,7 @@ const submitForm = async () => {
await MpTagApi.updateTag(data)
message.success(t('common.updateSuccess'))
}
modelVisible.value = false
dialogVisible.value = false
//
emit('success')
} finally {

View File

@ -46,7 +46,7 @@
</ContentWrap>
<!-- 添加/修改的弹窗 -->
<XModal id="templateModel" :loading="modelLoading" v-model="modelVisible" :title="modelTitle">
<XModal id="templateModel" :loading="modelLoading" v-model="dialogVisible" :title="dialogTitle">
<!-- 表单添加/修改 -->
<Form
ref="formRef"
@ -70,7 +70,7 @@
@click="submitForm()"
/>
<!-- 按钮关闭 -->
<XButton :loading="actionLoading" :title="t('dialog.close')" @click="modelVisible = false" />
<XButton :loading="actionLoading" :title="t('dialog.close')" @click="dialogVisible = false" />
</template>
</XModal>
@ -132,8 +132,8 @@ const [registerTable, { reload, deleteData }] = useXTable({
})
//
const modelVisible = ref(false) //
const modelTitle = ref('edit') //
const dialogVisible = ref(false) //
const dialogTitle = ref('edit') //
const modelLoading = ref(false) // loading
const actionType = ref('') //
const actionLoading = ref(false) // Loading
@ -143,9 +143,9 @@ const detailData = ref() // 详情 Ref
//
const setDialogTile = (type: string) => {
modelLoading.value = true
modelTitle.value = t('action.' + type)
dialogTitle.value = t('action.' + type)
actionType.value = type
modelVisible.value = true
dialogVisible.value = true
}
//
@ -188,7 +188,7 @@ const submitForm = async () => {
await NotifyTemplateApi.updateNotifyTemplateApi(data)
message.success(t('common.updateSuccess'))
}
modelVisible.value = false
dialogVisible.value = false
} finally {
actionLoading.value = false
//