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

style: 修改模版管理添加分类样式
This commit is contained in:
王嘉豪 2023-12-25 12:00:01 +08:00 committed by GitHub
commit a3da49e87e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 6 deletions

View File

@ -172,7 +172,7 @@ const editTemplate = () => {
nameCheck(nameCheckRequest).then(response => {
save(state.templateInfo).then(response => {
ElMessage.success(t('编辑成功'))
emits('refresh')
emits('refresh', { optType: 'refresh' })
emits('closeEditTemplateDialog')
})
})
@ -196,7 +196,7 @@ const importTemplate = () => {
}).then(() => {
save(state.templateInfo).then(response => {
ElMessage.success(t('覆盖成功'))
emits('refresh')
emits('refresh', { optType: 'refresh' })
emits('closeEditTemplateDialog')
})
})
@ -205,7 +205,7 @@ const importTemplate = () => {
nameCheck(nameCheckRequest).then(response => {
save(state.templateInfo).then(response => {
ElMessage.success(t('导入成功'))
emits('refresh')
emits('refresh', { optType: 'refresh' })
emits('closeEditTemplateDialog')
})
})
@ -235,7 +235,7 @@ const goFile = () => {
}
const doAddCategory = () => {
emits('addCategoryInfo')
emits('refresh', { optType: 'addCategory' })
}
onMounted(() => {

View File

@ -123,7 +123,7 @@
:template-id="state.templateDialog.templateId"
:opt-type="state.templateDialog.optType"
:template-categories="state.templateCategories"
@addCategoryInfo="showTemplateEditDialog('new', null)"
@doTest="closeEditTemplateDialog"
@refresh="showCurrentTemplate(state.currentTemplateId, state.currentTemplateLabel)"
@closeEditTemplateDialog="closeEditTemplateDialog"
/>
@ -144,7 +144,7 @@
:template-id="state.templateDialog.templateId"
:opt-type="state.templateDialog.optType"
:template-categories="state.templateCategories"
@refresh="showCurrentTemplate(state.currentTemplateId, state.currentTemplateLabel)"
@refresh="importRefresh"
@closeEditTemplateDialog="closeEditTemplateDialog"
/>
</el-dialog>
@ -351,6 +351,14 @@ const handleClick = (tab, event) => {
getTree()
}
const importRefresh = params => {
if (params.optType === 'refresh') {
showCurrentTemplate(state.currentTemplateId, state.currentTemplateLabel)
} else {
showTemplateEditDialog('new', null)
}
}
const showCurrentTemplate = (pid, label) => {
state.currentTemplateId = pid
state.currentTemplateLabel = label