Merge pull request #2267 from dataease/pr@dev@refactor_template-manage

refactor: 模版管理优化,系统模板的管理需要授权
This commit is contained in:
王嘉豪 2022-05-17 14:42:52 +08:00 committed by GitHub
commit d50ba72714
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 8 deletions

View File

@ -1,2 +1,5 @@
ALTER TABLE `panel_group`
ADD COLUMN `status` varchar(255) NULL DEFAULT 'publish' COMMENT '1.publish--发布 2.unpublished--未发布' AFTER `mobile_layout`;
UPDATE `sys_menu` SET `sub_count` = 1 WHERE `menu_id` = 40;
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (401, 40, 0, 2, '查看系统模板', NULL, NULL, 999, NULL, NULL, 0, 0, 0, 'sys-template:read', NULL, NULL, 1614930862373, 1614930862373);

View File

@ -2,10 +2,11 @@
<de-container>
<de-aside-container>
<el-tabs v-model="currentTemplateType" @tab-click="handleClick">
<el-tab-pane name="system">
<span slot="label"><i class="el-icon-document tablepanel-i" /> {{ $t('panel.sys_template') }}</span>
<el-tab-pane name="self">
<span slot="label"><i class="el-icon-star-off tablepanel-i" />{{ $t('panel.user_template') }}</span>
<!--v-if 重新渲染 强制刷新首行高亮属性-->
<template-list
v-if="currentTemplateType==='system'"
v-if="currentTemplateType==='self'"
:template-type="currentTemplateType"
:template-list="templateList"
@templateDelete="templateDelete"
@ -15,11 +16,10 @@
@showTemplateEditDialog="showTemplateEditDialog"
/>
</el-tab-pane>
<el-tab-pane name="self">
<span slot="label"><i class="el-icon-star-off tablepanel-i" />{{ $t('panel.user_template') }}</span>
<!--v-if 重新渲染 强制刷新首行高亮属性-->
<el-tab-pane v-permission="['sys-template:read']" name="system">
<span slot="label" v-permission="['sys-template:read']"><i class="el-icon-document tablepanel-i" /> {{ $t('panel.sys_template') }}</span>
<template-list
v-if="currentTemplateType==='self'"
v-if="currentTemplateType==='system'"
:template-type="currentTemplateType"
:template-list="templateList"
@templateDelete="templateDelete"
@ -81,7 +81,7 @@ export default {
showShare: false,
currentTemplateShowList: [],
currentPid: '',
currentTemplateType: 'system',
currentTemplateType: 'self',
templateEditFormRules: {
name: [
{ required: true, message: this.$t('commons.input_content'), trigger: 'change' },