Merge pull request #1994 from dataease/pr@dev@feat_plugin_manage

feat: 新增插件管理功能
This commit is contained in:
fit2cloud-chenyw 2022-03-29 16:11:30 +08:00 committed by GitHub
commit 038ba17b05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 26 additions and 16 deletions

View File

@ -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 可解析正确各种路径

View File

@ -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) {

View File

@ -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);

View File

@ -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

View File

@ -121,4 +121,5 @@ theme_name_repeat=名称已存在
theme_name_empty=名称不能为空
i18n_public_chart=【存量视图】
i18n_class_blue=蓝色调
插件管理=插件管理

View File

@ -122,3 +122,4 @@ theme_name_repeat=名稱已存在
theme_name_empty=名稱不能為空
i18n_public_chart=【存量视图】
i18n_class_blue=蓝色调
插件管理=插件管理

View File

@ -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