diff --git a/backend/src/main/java/io/dataease/commons/utils/DeFileUtils.java b/backend/src/main/java/io/dataease/commons/utils/DeFileUtils.java index 9106a22998..4f89d7e4a2 100644 --- a/backend/src/main/java/io/dataease/commons/utils/DeFileUtils.java +++ b/backend/src/main/java/io/dataease/commons/utils/DeFileUtils.java @@ -35,6 +35,12 @@ public class DeFileUtils { } return filename; } + + public static void validateExist(String path) { + File dir = new File(path); + if (dir.exists()) return ; + dir.mkdirs(); + } /** * 将文件名解析成文件的上传路径 */ @@ -42,6 +48,7 @@ public class DeFileUtils { String name = getFileNameNoEx(file.getOriginalFilename()); String suffix = getExtensionName(file.getOriginalFilename()); try { + validateExist(filePath); String fileName = name + "." + suffix; String path = filePath + fileName; // getCanonicalFile 可解析正确各种路径 diff --git a/backend/src/main/java/io/dataease/service/sys/PluginService.java b/backend/src/main/java/io/dataease/service/sys/PluginService.java index e14056867a..282f3fe68f 100644 --- a/backend/src/main/java/io/dataease/service/sys/PluginService.java +++ b/backend/src/main/java/io/dataease/service/sys/PluginService.java @@ -175,6 +175,7 @@ public class PluginService { MyPlugin result = new MyPlugin(); try { org.apache.commons.beanutils.BeanUtils.populate(result, myPlugin); + result.setInstallTime(System.currentTimeMillis()); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (InvocationTargetException e) { diff --git a/backend/src/main/resources/db/migration/V33__1.9.sql b/backend/src/main/resources/db/migration/V33__1.9.sql index 921ab185c5..fd5d222e0b 100644 --- a/backend/src/main/resources/db/migration/V33__1.9.sql +++ b/backend/src/main/resources/db/migration/V33__1.9.sql @@ -251,3 +251,8 @@ INSERT INTO `my_plugin`(`plugin_id`, `name`, `store`, `free`, `cost`, `category` ALTER TABLE `panel_link_jump_info` ADD COLUMN `attach_params` tinyint(1) NULL COMMENT '是否附加点击参数' AFTER `checked`; + + +update `sys_menu` set menu_id = 100 where title = '首页'; + +INSERT INTO `sys_menu` VALUES (101, 1, 4, 1, '插件管理', 'system-plugin', 'system/plugin/index', 1002, 'peoples', 'plugin', b'0', b'0', b'0', 'plugin:read', NULL, NULL, NULL, 1620281952752); diff --git a/backend/src/main/resources/i18n/messages_en_US.properties b/backend/src/main/resources/i18n/messages_en_US.properties index a791bd0bcb..a07ed2d8c2 100644 --- a/backend/src/main/resources/i18n/messages_en_US.properties +++ b/backend/src/main/resources/i18n/messages_en_US.properties @@ -122,3 +122,4 @@ theme_name_repeat=name of theme has been existed theme_name_empty=name can not be empty i18n_public_chart=【Public Chart】 i18n_class_blue=Blue Tone +插件管理=Plugins diff --git a/backend/src/main/resources/i18n/messages_zh_CN.properties b/backend/src/main/resources/i18n/messages_zh_CN.properties index 12f05d2d9d..73b2ec6ac2 100644 --- a/backend/src/main/resources/i18n/messages_zh_CN.properties +++ b/backend/src/main/resources/i18n/messages_zh_CN.properties @@ -121,4 +121,5 @@ theme_name_repeat=名称已存在 theme_name_empty=名称不能为空 i18n_public_chart=【存量视图】 i18n_class_blue=蓝色调 +插件管理=插件管理 diff --git a/backend/src/main/resources/i18n/messages_zh_TW.properties b/backend/src/main/resources/i18n/messages_zh_TW.properties index 530efcead4..0e8f1ca77b 100644 --- a/backend/src/main/resources/i18n/messages_zh_TW.properties +++ b/backend/src/main/resources/i18n/messages_zh_TW.properties @@ -122,3 +122,4 @@ theme_name_repeat=名稱已存在 theme_name_empty=名稱不能為空 i18n_public_chart=【存量视图】 i18n_class_blue=蓝色调 +插件管理=插件管理 diff --git a/frontend/src/views/system/plugin/index.vue b/frontend/src/views/system/plugin/index.vue index d5713dfb74..99c08b8f62 100644 --- a/frontend/src/views/system/plugin/index.vue +++ b/frontend/src/views/system/plugin/index.vue @@ -30,7 +30,11 @@ </template> <el-table-column prop="name" :label="$t('plugin.name')" /> - <el-table-column prop="free" :label="$t('plugin.free')" /> + <!-- <el-table-column prop="free" :label="$t('plugin.free')"> + <template v-slot:default="scope"> + <span>{{ scope.row.free ? '是' : '否' }}</span> + </template> + </el-table-column> --> <el-table-column prop="cost" :label="$t('plugin.cost')" /> <el-table-column :show-overflow-tooltip="true" prop="descript" :label="$t('plugin.descript')" /> @@ -42,7 +46,7 @@ <span>{{ scope.row.installTime | timestampFormatDate }}</span> </template> </el-table-column> - <fu-table-operations :buttons="buttons" label="操作" fix /> + <!-- <fu-table-operations :buttons="buttons" label="操作" fix /> --> </complex-table> </layout-content> @@ -53,7 +57,7 @@ import LayoutContent from '@/components/business/LayoutContent' import ComplexTable from '@/components/business/complex-table' // import { checkPermission } from '@/utils/permission' -import { formatCondition } from '@/utils/index' +import { formatCondition, formatQuickCondition } from '@/utils/index' import { pluginLists, uninstall } from '@/api/system/plugin' import { getToken } from '@/utils/auth' export default { @@ -70,21 +74,10 @@ export default { // } ], searchConfig: { - useQuickSearch: false, + useQuickSearch: true, quickPlaceholder: this.$t('role.search_by_name'), components: [ - { field: 'name', label: this.$t('plugin.name'), component: 'FuComplexInput' } - - // { - // field: 'u.enabled', - // label: '状态', - // component: 'FuComplexSelect', - // options: [ - // { label: '启用', value: '1' }, - // { label: '禁用', value: '0' } - // ], - // multiple: false - // } + { field: 'name', label: this.$t('plugin.name'), component: 'DeComplexInput' } ] }, paginationConfig: { @@ -107,6 +100,7 @@ export default { methods: { search(condition) { + condition = formatQuickCondition(condition, 'name') const temp = formatCondition(condition) const param = temp || {} const { currentPage, pageSize } = this.paginationConfig