forked from github/dataease
commit
50d63b9f2a
@ -9,6 +9,7 @@ import CollapseBar from './components/CollapseBar.vue'
|
||||
import { ElContainer } from 'element-plus-secondary'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { XpackComponent } from '@/components/plugin'
|
||||
import { useI18n } from '@/hooks/web/useI18n'
|
||||
const route = useRoute()
|
||||
const systemMenu = computed(() => route.path.includes('system'))
|
||||
const settingMenu = computed(() => route.path.includes('sys-setting'))
|
||||
@ -18,20 +19,21 @@ const isCollapse = ref(false)
|
||||
const setCollapse = () => {
|
||||
isCollapse.value = !isCollapse.value
|
||||
}
|
||||
const { t } = useI18n()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="common-layout">
|
||||
<HeaderSystem
|
||||
v-if="settingMenu || marketMenu || toolboxMenu"
|
||||
:title="toolboxMenu ? '工具箱' : marketMenu ? '模板中心' : ''"
|
||||
:title="toolboxMenu ? t('toolbox.name') : marketMenu ? t('toolbox.template_center') : ''"
|
||||
/>
|
||||
<Header v-else></Header>
|
||||
<el-container class="layout-container">
|
||||
<template v-if="systemMenu || settingMenu || toolboxMenu">
|
||||
<Sidebar v-if="!isCollapse" class="layout-sidebar">
|
||||
<div @click="setCollapse" v-if="systemMenu && !isCollapse" class="org-config-center">
|
||||
组织管理中心
|
||||
{{ t('toolbox.org_center') }}
|
||||
</div>
|
||||
<Menu :style="{ height: systemMenu ? 'calc(100% - 48px)' : '100%' }"></Menu>
|
||||
</Sidebar>
|
||||
|
@ -36,6 +36,63 @@ export default {
|
||||
delete_success: 'Delete success',
|
||||
no_auth_tips: 'Missing menu permissions, please contact the administrator'
|
||||
},
|
||||
toolbox: {
|
||||
name: 'Toolbox',
|
||||
template_center: 'Template Center',
|
||||
org_center: 'Organization Management Center'
|
||||
},
|
||||
operate_log: {
|
||||
name: 'Operation Log',
|
||||
search_by_operate_info: 'Search by Operation Details',
|
||||
detail: 'Operation Details',
|
||||
type: 'Operation Type',
|
||||
status: 'Operation Status',
|
||||
success: 'Success',
|
||||
failed: 'Failed',
|
||||
user: 'Operating User',
|
||||
time: 'Operation Time',
|
||||
ip: 'IP Address',
|
||||
error_msg: 'Error Message'
|
||||
},
|
||||
template_manage: {
|
||||
name: 'Template Management',
|
||||
rename: 'Rename',
|
||||
edit_template: 'Edit Template',
|
||||
import_template: 'Import Template',
|
||||
template_name: 'Template Name',
|
||||
keywords: 'Search Keywords',
|
||||
catalog_name: 'Category Name',
|
||||
search_result: 'Search Results for',
|
||||
search_result_unit: '',
|
||||
selected_count: '{0} Items Selected',
|
||||
select_all_count: 'Select All {0} Items',
|
||||
add_catalog: 'Add Category',
|
||||
edit_catalog: 'Edit Category',
|
||||
select_catalog: 'Select Category',
|
||||
no_selectable_catalog: 'No Selectable Categories Available',
|
||||
please_select_catalog: 'Please Select a Category',
|
||||
no_template: 'No Templates Available',
|
||||
not_found: 'No Related Templates Found',
|
||||
delete_failed_hint: 'Cannot Delete Category',
|
||||
delete_failed_tip: 'Please Remove All Templates Under This Category Before Deleting',
|
||||
delete_failed_confirm: 'Understood',
|
||||
delete_hint: 'Are You Sure You Want to Delete This Template?',
|
||||
delete_batch_hint: 'Are You Sure You Want to Delete {0} Templates?',
|
||||
add_success: 'Added Successfully',
|
||||
edit_success: 'Edited Successfully',
|
||||
import_success: 'Imported Successfully',
|
||||
cover_success: 'Overridden Successfully',
|
||||
cover_exists_hint:
|
||||
'A Template with the Same Name Exists in This Category. Do You Want to Override?',
|
||||
template_size_hint: 'Template Size Must Be Less Than 35MB',
|
||||
hint: 'Hint',
|
||||
relevant_content_found: 'No Related Content Found',
|
||||
no_catalog: 'No Categories Available',
|
||||
delete_catalog_hint: 'Are You Sure You Want to Delete This Category?',
|
||||
delete_catalog_tip: 'Deletion Is Irreversible. Do You Want to Continue?',
|
||||
illegal_name_hint: 'Illegal Name. Please Change!',
|
||||
exists_name_hint: 'This Name Already Exists in Template Management. Please Modify'
|
||||
},
|
||||
commons: {
|
||||
date: {
|
||||
permanent: 'Permanent',
|
||||
|
@ -61,6 +61,62 @@ export default {
|
||||
no_auth_tips: '缺少菜單權限,請聯系管理員',
|
||||
no_menu_tips: '未找到資源 401錯誤'
|
||||
},
|
||||
toolbox: {
|
||||
name: '工具箱',
|
||||
template_center: '模板中心',
|
||||
org_center: '組織管理中心'
|
||||
},
|
||||
operate_log: {
|
||||
name: '操作日志',
|
||||
search_by_operate_info: '通過操作詳情搜索',
|
||||
detail: '操作詳情',
|
||||
type: '操作類型',
|
||||
status: '操作狀態',
|
||||
success: '成功',
|
||||
failed: '失敗',
|
||||
user: '操作用戶',
|
||||
time: '操作時間',
|
||||
ip: 'IP地址',
|
||||
error_msg: '錯誤信息'
|
||||
},
|
||||
template_manage: {
|
||||
name: '模板管理',
|
||||
rename: '重命名',
|
||||
edit_template: '編輯模板',
|
||||
import_template: '導入模板',
|
||||
template_name: '模板名稱',
|
||||
keywords: '搜索關鍵字',
|
||||
catalog_name: '分類名稱',
|
||||
search_result: '的搜索結果',
|
||||
search_result_unit: '個',
|
||||
selected_count: '已選 {0} 項',
|
||||
select_all_count: '全選 {0} 項',
|
||||
add_catalog: '添加分類',
|
||||
edit_catalog: '修改分類',
|
||||
select_catalog: '選擇分類',
|
||||
no_selectable_catalog: '暫無可選分類',
|
||||
please_select_catalog: '請選擇分類',
|
||||
no_template: '暫無模板',
|
||||
not_found: '沒有找到相關模板',
|
||||
delete_failed_hint: '無法刪除分類',
|
||||
delete_failed_tip: '請先移除該分類下所有模板再進行刪除分類操作',
|
||||
delete_failed_confirm: '知道了',
|
||||
delete_hint: '確定刪除該模板嗎?',
|
||||
delete_batch_hint: '確定刪除{0}個模板嗎?',
|
||||
add_success: '添加成功',
|
||||
edit_success: '修改成功',
|
||||
import_success: '導入成功',
|
||||
cover_success: '覆蓋成功',
|
||||
cover_exists_hint: '當前分類存在相同模板名稱,是否覆蓋?',
|
||||
template_size_hint: '模板大小需小于35MB',
|
||||
hint: '提示',
|
||||
relevant_content_found: '沒有找到相關內容',
|
||||
no_catalog: '當前無分類',
|
||||
delete_catalog_hint: '確定刪除該分類嗎?',
|
||||
delete_catalog_tip: '刪除后不可恢復,是否繼續?',
|
||||
illegal_name_hint: '不合法命名,請更換!',
|
||||
exists_name_hint: '當前名稱已在模版管理中存在,請修改'
|
||||
},
|
||||
work_branch: {
|
||||
recommended_dashboard: '推薦儀表板',
|
||||
template_market_official: '未獲取模板下載鏈接請聯系模板市場官方',
|
||||
|
@ -61,6 +61,62 @@ export default {
|
||||
no_auth_tips: '缺少菜单权限,请联系管理员',
|
||||
no_menu_tips: '未找到资源 401错误'
|
||||
},
|
||||
toolbox: {
|
||||
name: '工具箱',
|
||||
template_center: '模板中心',
|
||||
org_center: '组织管理中心'
|
||||
},
|
||||
operate_log: {
|
||||
name: '操作日志',
|
||||
search_by_operate_info: '通过操作详情搜索',
|
||||
detail: '操作详情',
|
||||
type: '操作类型',
|
||||
status: '操作状态',
|
||||
success: '成功',
|
||||
failed: '失败',
|
||||
user: '操作用户',
|
||||
time: '操作时间',
|
||||
ip: 'IP地址',
|
||||
error_msg: '错误信息'
|
||||
},
|
||||
template_manage: {
|
||||
name: '模板管理',
|
||||
rename: '重命名',
|
||||
edit_template: '编辑模板',
|
||||
import_template: '导入模板',
|
||||
template_name: '模板名称',
|
||||
keywords: '搜索关键字',
|
||||
catalog_name: '分类名称',
|
||||
search_result: '的搜索结果',
|
||||
search_result_unit: '个',
|
||||
selected_count: '已选 {0} 项',
|
||||
select_all_count: '全选 {0} 项',
|
||||
add_catalog: '添加分类',
|
||||
edit_catalog: '修改分类',
|
||||
select_catalog: '选择分类',
|
||||
no_selectable_catalog: '暂无可选分类',
|
||||
please_select_catalog: '请选择分类',
|
||||
no_template: '暂无模板',
|
||||
not_found: '没有找到相关模板',
|
||||
delete_failed_hint: '无法删除分类',
|
||||
delete_failed_tip: '请先移除该分类下所有模板再进行删除分类操作',
|
||||
delete_failed_confirm: '知道了',
|
||||
delete_hint: '确定删除该模板吗?',
|
||||
delete_batch_hint: '确定删除{0}个模板吗?',
|
||||
add_success: '添加成功',
|
||||
edit_success: '修改成功',
|
||||
import_success: '导入成功',
|
||||
cover_success: '覆盖成功',
|
||||
cover_exists_hint: '当前分类存在相同模板名称,是否覆盖?',
|
||||
template_size_hint: '模板大小需小于35MB',
|
||||
hint: '提示',
|
||||
relevant_content_found: '没有找到相关内容',
|
||||
no_catalog: '当前无分类',
|
||||
delete_catalog_hint: '确定删除该分类吗?',
|
||||
delete_catalog_tip: '删除后不可恢复,是否继续?',
|
||||
illegal_name_hint: '不合法命名,请更换!',
|
||||
exists_name_hint: '当前名称已在模版管理中存在,请修改'
|
||||
},
|
||||
work_branch: {
|
||||
recommended_dashboard: '推荐仪表板',
|
||||
template_market_official: '未获取模板下载链接请联系模板市场官方',
|
||||
|
@ -7,13 +7,12 @@
|
||||
:rules="state.templateInfoRules"
|
||||
label-position="top"
|
||||
>
|
||||
<el-form-item :label="'选择分类'" prop="categories" style="margin-top: 16px">
|
||||
<el-select
|
||||
v-model="state.templateInfo.categories"
|
||||
placeholder="可多选"
|
||||
multiple
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-form-item
|
||||
:label="t('template_manage.select_catalog')"
|
||||
prop="categories"
|
||||
style="margin-top: 16px"
|
||||
>
|
||||
<el-select v-model="state.templateInfo.categories" multiple style="width: 100%">
|
||||
<el-option
|
||||
v-for="option in templateCategories"
|
||||
:key="option.id"
|
||||
@ -58,7 +57,7 @@ const state = reactive({
|
||||
categories: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择分类',
|
||||
message: t('template_manage.please_select_catalog'),
|
||||
trigger: 'change'
|
||||
}
|
||||
]
|
||||
@ -86,12 +85,12 @@ const saveChange = () => {
|
||||
categories: state.templateInfo.categories
|
||||
}
|
||||
if (!state.templateInfo.categories.length) {
|
||||
ElMessage.warning('请选择分类')
|
||||
ElMessage.warning(t('template_manage.please_select_catalog'))
|
||||
return false
|
||||
}
|
||||
batchUpdate(params).then(() => {
|
||||
ElMessage({
|
||||
message: '修改成功',
|
||||
message: t('template_manage.edit_success'),
|
||||
type: 'success',
|
||||
showClose: true
|
||||
})
|
||||
|
@ -7,12 +7,16 @@
|
||||
:rules="state.templateInfoRules"
|
||||
label-position="top"
|
||||
>
|
||||
<el-form-item :label="'模板名称'" prop="name">
|
||||
<el-form-item :label="t('template_manage.template_name')" prop="name">
|
||||
<div class="flex-template">
|
||||
<el-input v-model="state.templateInfo.name" placeholder="请输入模板名称" clearable />
|
||||
<el-button style="margin-left: 10px" icon="Upload" secondary @click="goFile"
|
||||
>导入模板</el-button
|
||||
>
|
||||
<el-input
|
||||
v-model="state.templateInfo.name"
|
||||
:placeholder="t('common.inputText') + t('template_manage.template_name')"
|
||||
clearable
|
||||
/>
|
||||
<el-button style="margin-left: 10px" icon="Upload" secondary @click="goFile">
|
||||
{{ t('template_manage.import_template') }}
|
||||
</el-button>
|
||||
<input
|
||||
id="input"
|
||||
ref="filesRef"
|
||||
@ -24,11 +28,14 @@
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-row v-show="!!state.templateInfo.snapshot" class="preview" :style="classBackground" />
|
||||
<el-form-item :label="'选择分类'" prop="categories" style="margin-top: 16px">
|
||||
<el-form-item
|
||||
:label="t('template_manage.select_catalog')"
|
||||
prop="categories"
|
||||
style="margin-top: 16px"
|
||||
>
|
||||
<el-select
|
||||
v-model="state.templateInfo.categories"
|
||||
multiple
|
||||
placeholder="可多选"
|
||||
style="width: 100%"
|
||||
:popper-class="
|
||||
templateCategories.length
|
||||
@ -43,14 +50,14 @@
|
||||
:value="option.id"
|
||||
/>
|
||||
<div class="custom-dropdown__empty">
|
||||
<span>暂无可选分类</span>
|
||||
<span>{{ t('template_manage.no_selectable_catalog') }}</span>
|
||||
</div>
|
||||
<div class="custom-option-line">
|
||||
<div @click="doAddCategory" class="flex-align-center">
|
||||
<el-icon>
|
||||
<Plus></Plus>
|
||||
</el-icon>
|
||||
添加分类
|
||||
{{ t('template_manage.add_catalog') }}
|
||||
</div>
|
||||
</div>
|
||||
</el-select>
|
||||
@ -169,7 +176,7 @@ const saveTemplate = () => {
|
||||
}
|
||||
|
||||
if (!state.templateInfo.categories.length) {
|
||||
ElMessage.warning('请选择分类')
|
||||
ElMessage.warning(t('template_manage.please_select_catalog'))
|
||||
return false
|
||||
}
|
||||
|
||||
@ -191,10 +198,10 @@ const editTemplate = () => {
|
||||
// 全局名称校验
|
||||
nameCheck(nameCheckRequest).then(response => {
|
||||
if (response.data.indexOf('exist') > -1) {
|
||||
ElMessage.warning('当前名称已在模版管理中存在,请修改')
|
||||
ElMessage.warning(t('template_manage.exists_name_hint'))
|
||||
} else {
|
||||
save(state.templateInfo).then(response => {
|
||||
ElMessage.success(t('编辑成功'))
|
||||
ElMessage.success(t('template_manage.edit_success'))
|
||||
emits('refresh', getRefreshPInfo())
|
||||
emits('closeEditTemplateDialog')
|
||||
})
|
||||
@ -226,15 +233,15 @@ const importTemplate = () => {
|
||||
}
|
||||
categoryTemplateNameCheck(nameCheckRequest).then(response => {
|
||||
if (response.data.indexOf('exist') > -1) {
|
||||
ElMessageBox.confirm('提示', {
|
||||
tip: '当前分类存在相同模板名称,是否覆盖?',
|
||||
ElMessageBox.confirm(t('template_manage.hint'), {
|
||||
tip: t('template_manage.cover_exists_hint'),
|
||||
confirmButtonType: 'danger',
|
||||
type: 'warning',
|
||||
autofocus: false,
|
||||
showClose: false
|
||||
}).then(() => {
|
||||
save(state.templateInfo).then(() => {
|
||||
ElMessage.success(t('覆盖成功'))
|
||||
ElMessage.success(t('template_manage.cover_success'))
|
||||
emits('refresh', getRefreshPInfo())
|
||||
emits('closeEditTemplateDialog')
|
||||
})
|
||||
@ -243,10 +250,10 @@ const importTemplate = () => {
|
||||
// 全局名称校验
|
||||
nameCheck(nameCheckRequest).then(response => {
|
||||
if (response.data.indexOf('exist') > -1) {
|
||||
ElMessage.warning('当前名称已在模版管理中存在,请修改')
|
||||
ElMessage.warning(t('template_manage.exists_name_hint'))
|
||||
} else {
|
||||
save(state.templateInfo).then(rsp => {
|
||||
ElMessage.success(t('导入成功'))
|
||||
ElMessage.success(t('template_manage.import_success'))
|
||||
emits('refresh', getRefreshPInfo())
|
||||
emits('closeEditTemplateDialog')
|
||||
})
|
||||
@ -260,7 +267,7 @@ const handleFileChange = e => {
|
||||
const file = e.target.files[0]
|
||||
const reader = new FileReader()
|
||||
if (file.size > maxImageSize) {
|
||||
ElMessage.success('模板大小需小于35MB')
|
||||
ElMessage.success(t('template_manage.template_size_hint'))
|
||||
return
|
||||
}
|
||||
reader.onload = res => {
|
||||
|
@ -22,11 +22,11 @@
|
||||
<slot>
|
||||
<el-dropdown-item command="templateEdit">
|
||||
<el-icon><EditPen /></el-icon>
|
||||
编辑
|
||||
{{ t('commons.edit') }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item command="delete">
|
||||
<el-icon><Delete /></el-icon>
|
||||
{{ $t('chart.delete') }}
|
||||
{{ t('chart.delete') }}
|
||||
</el-dropdown-item>
|
||||
</slot>
|
||||
</el-dropdown-menu>
|
||||
@ -39,8 +39,9 @@
|
||||
<script setup lang="ts">
|
||||
import { imgUrlTrans } from '@/utils/imgUtils'
|
||||
import { computed, toRefs } from 'vue'
|
||||
import { useI18n } from '@/hooks/web/useI18n'
|
||||
const emits = defineEmits(['command'])
|
||||
|
||||
const { t } = useI18n()
|
||||
const props = defineProps({
|
||||
model: {
|
||||
type: Object
|
||||
|
@ -3,12 +3,12 @@
|
||||
<el-empty
|
||||
v-if="!templateListComputed.length && state.templateFilterText === ''"
|
||||
:image="NoneImage"
|
||||
:description="'当前无分类'"
|
||||
:description="t('template_manage.no_catalog')"
|
||||
/>
|
||||
<el-empty
|
||||
v-if="!templateListComputed.length && state.templateFilterText !== ''"
|
||||
:image="NothingImage"
|
||||
:description="'没有找到相关内容'"
|
||||
:description="t('template_manage.relevant_content_found')"
|
||||
/>
|
||||
<ul>
|
||||
<li
|
||||
@ -99,8 +99,8 @@ const nodeClick = ({ id, name }) => {
|
||||
}
|
||||
|
||||
const categoryDelete = template => {
|
||||
ElMessageBox.confirm('确定删除该分类吗?', {
|
||||
tip: '删除后不可恢复,是否继续?',
|
||||
ElMessageBox.confirm(t('template_manage.delete_catalog_hint'), {
|
||||
tip: t('template_manage.delete_catalog_tip'),
|
||||
confirmButtonType: 'danger',
|
||||
confirmButtonText: t('common.delete'),
|
||||
type: 'warning',
|
||||
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="template-head">
|
||||
<p class="router-title">模板管理</p>
|
||||
<p class="router-title">{{ t('template_manage.name') }}</p>
|
||||
<el-button style="float: right" type="primary" @click="templateImport(state.currentTemplateId)">
|
||||
{{ t('visualization.import') }}
|
||||
</el-button>
|
||||
@ -8,17 +8,19 @@
|
||||
style="float: right; margin-right: 12px"
|
||||
@click="showTemplateEditDialog('new', null)"
|
||||
>
|
||||
添加分类
|
||||
{{ t('template_manage.add_catalog') }}
|
||||
</el-button>
|
||||
<el-input
|
||||
v-model="state.templateFilterText"
|
||||
:placeholder="'搜索关键字'"
|
||||
:placeholder="t('template_manage.keywords')"
|
||||
class="template-search-class"
|
||||
clearable
|
||||
>
|
||||
<template #prefix>
|
||||
<el-icon>
|
||||
<Icon name="de-search"><deSearch class="svg-icon" /></Icon>
|
||||
<Icon name="de-search">
|
||||
<deSearch class="svg-icon" />
|
||||
</Icon>
|
||||
</el-icon>
|
||||
</template>
|
||||
</el-input>
|
||||
@ -48,7 +50,11 @@
|
||||
>
|
||||
<span v-show="state.templateFilterText">
|
||||
<span style="color: #3370ff">{{ state.templateFilterText }} </span>
|
||||
<span>的搜索结果 {{ currentTemplateShowListComputed.length }} 个</span>
|
||||
<span
|
||||
>{{ t('template_manage.search_result') }} {{
|
||||
currentTemplateShowListComputed.length
|
||||
}} {{ t('template_manage.search_result_unit') }}</span
|
||||
>
|
||||
</span>
|
||||
</div>
|
||||
<el-row
|
||||
@ -56,10 +62,12 @@
|
||||
v-if="!state.currentTemplateShowList.length && !state.templateFilterText"
|
||||
class="custom-position"
|
||||
>
|
||||
<Icon name="dv-empty"
|
||||
><dvEmpty style="width: 125px; height: 125px" class="svg-icon"
|
||||
/></Icon>
|
||||
<span style="margin-top: 8px; font-size: 14px"> 暂无模板 </span>
|
||||
<Icon name="dv-empty">
|
||||
<dvEmpty style="width: 125px; height: 125px" class="svg-icon" />
|
||||
</Icon>
|
||||
<span style="margin-top: 8px; font-size: 14px">
|
||||
{{ t('template_manage.no_template') }}
|
||||
</span>
|
||||
</el-row>
|
||||
|
||||
<el-row
|
||||
@ -67,10 +75,12 @@
|
||||
v-if="!currentTemplateShowListComputed.length && state.templateFilterText"
|
||||
class="custom-position"
|
||||
>
|
||||
<Icon name="dv-nothing"
|
||||
><dvNothing style="width: 125px; height: 125px" class="svg-icon"
|
||||
/></Icon>
|
||||
<span style="margin-top: 8px; font-size: 14px"> 没有找到相关模板 </span>
|
||||
<Icon name="dv-nothing">
|
||||
<dvNothing style="width: 125px; height: 125px" class="svg-icon" />
|
||||
</Icon>
|
||||
<span style="margin-top: 8px; font-size: 14px">
|
||||
{{ t('template_manage.not_found') }}
|
||||
</span>
|
||||
</el-row>
|
||||
|
||||
<div v-show="state.currentTemplateId !== ''" id="template-box" class="template-box">
|
||||
@ -85,14 +95,20 @@
|
||||
</div>
|
||||
<div v-show="batchState" class="batch-opt-area">
|
||||
<el-button @click="batchUpdate" type="danger" plain style="margin-left: 24px"
|
||||
>修改分类</el-button
|
||||
>
|
||||
<el-button @click="batchPreDelete" type="danger" plain>批量删除</el-button>
|
||||
<span style="margin-left: 24px; font-size: 14px">已选 {{ batchState }} 项</span>
|
||||
<el-button @click="batchFullSelect" style="margin-left: 16px" text
|
||||
>全选 {{ currentTemplateShowListComputed.length }} 项</el-button
|
||||
>
|
||||
<el-button @click="batchClear" text>清空</el-button>
|
||||
>{{ t('template_manage.edit_catalog') }}
|
||||
</el-button>
|
||||
<el-button @click="batchPreDelete" type="danger" plain>{{
|
||||
t('user.batch_del')
|
||||
}}</el-button>
|
||||
<span style="margin-left: 24px; font-size: 14px">
|
||||
{{ t('template_manage.selected_count', [batchState]) }}
|
||||
</span>
|
||||
<el-button @click="batchFullSelect" style="margin-left: 16px" text>
|
||||
{{
|
||||
t('template_manage.select_all_count', [currentTemplateShowListComputed.length])
|
||||
}}
|
||||
</el-button>
|
||||
<el-button @click="batchClear" text>{{ t('commons.clear') }}</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -101,9 +117,9 @@
|
||||
</div>
|
||||
<div class="container-sys-param" v-show="!state.templateCategories.length">
|
||||
<el-row style="height: 100%" class="custom-position">
|
||||
<Icon name="dv-empty"
|
||||
><dvEmpty style="width: 125px; height: 125px" class="svg-icon"
|
||||
/></Icon>
|
||||
<Icon name="dv-empty">
|
||||
<dvEmpty style="width: 125px; height: 125px" class="svg-icon" />
|
||||
</Icon>
|
||||
<span style="margin-top: 8px; font-size: 14px">
|
||||
<el-button
|
||||
style="float: right"
|
||||
@ -116,7 +132,7 @@
|
||||
style="float: right; margin-right: 12px"
|
||||
@click="showTemplateEditDialog('new', null)"
|
||||
>
|
||||
添加分类
|
||||
{{ t('template_manage.add_catalog') }}
|
||||
</el-button>
|
||||
</span>
|
||||
</el-row>
|
||||
@ -136,14 +152,17 @@
|
||||
:rules="state.templateEditFormRules"
|
||||
>
|
||||
<el-form-item :label="state.dialogTitleLabel" prop="name">
|
||||
<el-input :placeholder="'请输入分类名称'" v-model="state.templateEditForm.name" />
|
||||
<el-input
|
||||
:placeholder="t('template_manage.catalog_name')"
|
||||
v-model="state.templateEditForm.name"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button secondary @click="close()">{{ t('commons.cancel') }}</el-button>
|
||||
<el-button type="primary" @click="saveTemplateEdit(state.templateEditForm)"
|
||||
>{{ t('commons.confirm') }}
|
||||
<el-button type="primary" @click="saveTemplateEdit(state.templateEditForm)">
|
||||
{{ t('commons.confirm') }}
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
@ -170,7 +189,7 @@
|
||||
|
||||
<!--导入templateDialog-->
|
||||
<el-dialog
|
||||
:title="'修改分类'"
|
||||
:title="t('template_manage.edit_catalog')"
|
||||
v-model="state.batchOptDialogShow"
|
||||
:show-close="true"
|
||||
:destroy-on-close="true"
|
||||
@ -183,7 +202,7 @@
|
||||
:template-categories="state.templateCategories"
|
||||
@refresh="showCurrentTemplate(state.currentTemplateId, state.currentTemplateLabel)"
|
||||
@closeBatchEditTemplateDialog="closeBatchOptDialog"
|
||||
></de-category-change>
|
||||
/>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
@ -205,6 +224,7 @@ import { computed, nextTick, onMounted, reactive, ref } from 'vue'
|
||||
import { useI18n } from '@/hooks/web/useI18n'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus-secondary'
|
||||
import DeTemplateList from '@/views/template/component/DeTemplateList.vue'
|
||||
|
||||
const { t } = useI18n()
|
||||
const templateEditFormRef = ref(null)
|
||||
const templateListRef = ref(null)
|
||||
@ -279,7 +299,7 @@ const batchUpdate = () => {
|
||||
}
|
||||
|
||||
const batchPreDelete = () => {
|
||||
ElMessageBox.confirm(`确定删除${batchState.value}个模板吗?`, {
|
||||
ElMessageBox.confirm(t('template_manage.delete_batch_hint', [batchState.value]), {
|
||||
confirmButtonType: 'danger',
|
||||
type: 'warning',
|
||||
autofocus: false,
|
||||
@ -396,9 +416,9 @@ const categoryDelete = id => {
|
||||
})
|
||||
getTree()
|
||||
} else {
|
||||
ElMessageBox.confirm('无法删除分类', {
|
||||
tip: '请先移除该分类下所有模板再进行删除分类操作',
|
||||
confirmButtonText: '知道了',
|
||||
ElMessageBox.confirm(t('template_manage.delete_failed_hint'), {
|
||||
tip: t('template_manage.delete_failed_tip'),
|
||||
confirmButtonText: t('template_manage.delete_failed_confirm'),
|
||||
confirmButtonType: 'default',
|
||||
showCancelButton: false,
|
||||
type: 'warning',
|
||||
@ -411,7 +431,7 @@ const categoryDelete = id => {
|
||||
}
|
||||
const templateDeleteInfo = id => {
|
||||
if (id) {
|
||||
ElMessageBox.confirm('确定删除该模板吗?', {
|
||||
ElMessageBox.confirm(t('template_manage.delete_hint'), {
|
||||
tip: '',
|
||||
confirmButtonType: 'danger',
|
||||
type: 'warning',
|
||||
@ -436,7 +456,10 @@ const showTemplateEditDialog = (type, templateInfo) => {
|
||||
state.formType = type
|
||||
if (type === 'edit') {
|
||||
state.templateEditForm = JSON.parse(JSON.stringify(templateInfo))
|
||||
state.dialogTitle = state.templateEditForm['nodeType'] === 'folder' ? '重命名' : '编辑模板'
|
||||
state.dialogTitle =
|
||||
state.templateEditForm['nodeType'] === 'folder'
|
||||
? t('template_manage.rename')
|
||||
: t('template_manage.edit_template')
|
||||
state.originName = state.templateEditForm['label']
|
||||
} else {
|
||||
state.dialogTitle = t('visualization.add_category')
|
||||
@ -447,7 +470,10 @@ const showTemplateEditDialog = (type, templateInfo) => {
|
||||
level: 0
|
||||
}
|
||||
}
|
||||
state.dialogTitleLabel = state.templateEditForm['nodeType'] === 'folder' ? '分类名称' : '模板名称'
|
||||
state.dialogTitleLabel =
|
||||
state.templateEditForm['nodeType'] === 'folder'
|
||||
? t('template_manage.catalog_name')
|
||||
: t('template_manage.template_name')
|
||||
state.editTemplate = true
|
||||
}
|
||||
|
||||
@ -457,15 +483,15 @@ const categoryEdit = templateInfo => {
|
||||
|
||||
const templateEdit = templateInfo => {
|
||||
state.templateDialog.visible = true
|
||||
state.templateDialog.title = '编辑模板'
|
||||
state.templateDialog.title = t('template_manage.edit_template')
|
||||
state.templateDialog.optType = 'update'
|
||||
state.templateDialog.templateId = templateInfo.id
|
||||
}
|
||||
|
||||
const saveTemplateEdit = templateEditForm => {
|
||||
if (templateEditForm.name === '最近使用') {
|
||||
if (templateEditForm.name === t('work_branch.recently_used')) {
|
||||
ElMessage({
|
||||
message: '不合法命名,请更换!',
|
||||
message: t('template_manage.illegal_name_hint'),
|
||||
type: 'error',
|
||||
showClose: true
|
||||
})
|
||||
@ -475,7 +501,7 @@ const saveTemplateEdit = templateEditForm => {
|
||||
if (valid) {
|
||||
save({ ...templateEditForm }).then(() => {
|
||||
ElMessage({
|
||||
message: '添加成功',
|
||||
message: t('template_manage.add_success'),
|
||||
type: 'success',
|
||||
showClose: true
|
||||
})
|
||||
@ -535,7 +561,7 @@ const closeEditTemplateDialog = () => {
|
||||
|
||||
const templateImport = pid => {
|
||||
state.templateDialog.visible = true
|
||||
state.templateDialog.title = '导入模板'
|
||||
state.templateDialog.title = t('template_manage.import_template')
|
||||
state.templateDialog.templateId = null
|
||||
state.templateDialog.optType = 'insert'
|
||||
state.templateDialog.pid = pid
|
||||
@ -559,6 +585,7 @@ onMounted(() => {
|
||||
<style lang="less" scoped>
|
||||
.de-template {
|
||||
height: 100%;
|
||||
|
||||
.tabs-container {
|
||||
height: 100%;
|
||||
overflow-x: auto;
|
||||
@ -581,6 +608,7 @@ onMounted(() => {
|
||||
overflow: hidden;
|
||||
background: rgba(239, 240, 241, 1);
|
||||
position: relative;
|
||||
|
||||
.template-box {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
@ -606,6 +634,7 @@ onMounted(() => {
|
||||
background: #fff;
|
||||
border-bottom: 1px solid rgba(31, 35, 41, 0.15);
|
||||
}
|
||||
|
||||
.batch-opt-area {
|
||||
background-color: #ffffff;
|
||||
position: absolute;
|
||||
@ -628,6 +657,7 @@ onMounted(() => {
|
||||
line-height: 28px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.sys-setting-p {
|
||||
width: 100%;
|
||||
background: #ffffff;
|
||||
@ -635,6 +665,7 @@ onMounted(() => {
|
||||
box-sizing: border-box;
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
.setting-auto-h {
|
||||
height: auto !important;
|
||||
}
|
||||
@ -647,6 +678,7 @@ onMounted(() => {
|
||||
.template-head {
|
||||
height: 32px;
|
||||
}
|
||||
|
||||
.template-search-class {
|
||||
float: right;
|
||||
width: 320px;
|
||||
@ -661,6 +693,7 @@ onMounted(() => {
|
||||
flex-flow: row nowrap;
|
||||
color: #9ea6b2;
|
||||
flex-direction: column;
|
||||
|
||||
span {
|
||||
line-height: 22px;
|
||||
color: #646a73;
|
||||
|
2
de-xpack
2
de-xpack
@ -1 +1 @@
|
||||
Subproject commit 9afdcb94d80d3dc9567547e1a71462cd6ff68062
|
||||
Subproject commit 0c3c81beed9e0229d3989615f8b2886cd1c09493
|
Loading…
Reference in New Issue
Block a user