Merge pull request #7391 from dataease/pr@dev-v2@style_template-manage

style: 文案提示修改
This commit is contained in:
王嘉豪 2023-12-27 12:17:35 +08:00 committed by GitHub
commit 3e1cb06eea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 3 deletions

View File

@ -631,7 +631,7 @@ export default {
belong_group: '所属分组', belong_group: '所属分组',
select_group: '选择分组', select_group: '选择分组',
name_can_not_empty: '名称不能为空', name_can_not_empty: '名称不能为空',
template_can_not_empty: '选择仪表', template_can_not_empty: '导入模',
custom_count: '记录数', custom_count: '记录数',
table_title_fontsize: '表头字体大小', table_title_fontsize: '表头字体大小',
table_item_fontsize: '表格字体大小', table_item_fontsize: '表格字体大小',

View File

@ -8,7 +8,12 @@
label-position="top" label-position="top"
> >
<el-form-item :label="'选择分类'" prop="categories" style="margin-top: 16px"> <el-form-item :label="'选择分类'" prop="categories" style="margin-top: 16px">
<el-select v-model="state.templateInfo.categories" multiple style="width: 100%"> <el-select
v-model="state.templateInfo.categories"
placeholder="可多选"
multiple
style="width: 100%"
>
<el-option <el-option
v-for="option in templateCategories" v-for="option in templateCategories"
:key="option.id" :key="option.id"
@ -30,6 +35,7 @@
import { onMounted, reactive, ref } from 'vue' import { onMounted, reactive, ref } from 'vue'
import { useI18n } from '@/hooks/web/useI18n' import { useI18n } from '@/hooks/web/useI18n'
import { batchUpdate } from '@/api/template' import { batchUpdate } from '@/api/template'
import { ElMessage } from 'element-plus-secondary'
const emits = defineEmits(['closeBatchEditTemplateDialog', 'refresh']) const emits = defineEmits(['closeBatchEditTemplateDialog', 'refresh'])
const { t } = useI18n() const { t } = useI18n()
const props = defineProps({ const props = defineProps({
@ -52,7 +58,7 @@ const state = reactive({
categories: [ categories: [
{ {
required: true, required: true,
message: t('commons.input_content'), message: '请选择分类',
trigger: 'change' trigger: 'change'
} }
] ]
@ -72,7 +78,16 @@ const saveChange = () => {
templateIds: props.templateIds, templateIds: props.templateIds,
categories: state.templateInfo.categories categories: state.templateInfo.categories
} }
if (!state.templateInfo.categories.length) {
ElMessage.warning('请选择分类')
return false
}
batchUpdate(params).then(rsp => { batchUpdate(params).then(rsp => {
ElMessage({
message: '修改成功',
type: 'success',
showClose: true
})
emits('refresh') emits('refresh')
emits('closeBatchEditTemplateDialog') emits('closeBatchEditTemplateDialog')
}) })

View File

@ -283,6 +283,11 @@ const batchPreDelete = () => {
categories: [state.currentTemplateId] categories: [state.currentTemplateId]
} }
batchDelete(params).then(rsp => { batchDelete(params).then(rsp => {
ElMessage({
message: t('commons.delete_success'),
type: 'success',
showClose: true
})
showCurrentTemplate(state.currentTemplateId, state.currentTemplateLabel) showCurrentTemplate(state.currentTemplateId, state.currentTemplateLabel)
}) })
}) })