优化代码

This commit is contained in:
不做码农 2022-06-28 20:27:23 +08:00
parent 3d86dfccc6
commit 874f0d789b
2 changed files with 7 additions and 7 deletions

View File

@ -158,7 +158,7 @@ const dictId = ref(0)
const state = reactive({ const state = reactive({
rules: { rules: {
dictName: [{ required: true, message: '字典名称不能为空', trigger: 'blur' }], dictName: [{ required: true, message: '字典名称不能为空', trigger: 'blur' }],
dictType: [{ required: true, message: '字典类型不能为空', trigger: 'blur' }], dictType: [{ required: true, message: '字典类型不能为空', trigger: 'blur' }]
}, },
form: {}, form: {},
queryParams: { queryParams: {
@ -166,8 +166,8 @@ const state = reactive({
pageSize: 10, pageSize: 10,
dictName: undefined, dictName: undefined,
dictType: undefined, dictType: undefined,
status: undefined, status: undefined
}, }
}) })
const { rules, form, queryParams } = toRefs(state) const { rules, form, queryParams } = toRefs(state)
@ -194,7 +194,7 @@ function reset() {
dictType: undefined, dictType: undefined,
status: '0', status: '0',
type: 'N', type: 'N',
remark: undefined, remark: undefined
} }
proxy.resetForm('formRef') proxy.resetForm('formRef')
} }
@ -258,7 +258,7 @@ function handleDelete(row) {
.$confirm('是否确认删除字典编号为"' + dictIds + '"的数据项?', '警告', { .$confirm('是否确认删除字典编号为"' + dictIds + '"的数据项?', '警告', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning'
}) })
.then(function () { .then(function () {
return delType(dictIds) return delType(dictIds)
@ -274,7 +274,7 @@ function handleExport() {
.$confirm('是否确认导出所有类型数据项?', '警告', { .$confirm('是否确认导出所有类型数据项?', '警告', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning'
}) })
.then(function () { .then(function () {
return exportType(queryParams.value) return exportType(queryParams.value)

View File

@ -117,8 +117,8 @@
</el-row> </el-row>
<template #footer> <template #footer>
<div class="dialog-footer"> <div class="dialog-footer">
<el-button text @click="open = false">{{ $t('btn.cancel') }}</el-button>
<el-button type="primary" @click="handleSubmit">{{ $t('btn.submit') }}</el-button> <el-button type="primary" @click="handleSubmit">{{ $t('btn.submit') }}</el-button>
<el-button @click="open = false">{{ $t('btn.cancel') }}</el-button>
</div> </div>
</template> </template>
</el-dialog> </el-dialog>