forked from github/dataease
Merge pull request #1994 from dataease/pr@dev@feat_plugin_manage
feat: 新增插件管理功能
This commit is contained in:
commit
038ba17b05
@ -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 可解析正确各种路径
|
||||
|
@ -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) {
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
@ -121,4 +121,5 @@ theme_name_repeat=名称已存在
|
||||
theme_name_empty=名称不能为空
|
||||
i18n_public_chart=【存量视图】
|
||||
i18n_class_blue=蓝色调
|
||||
插件管理=插件管理
|
||||
|
||||
|
@ -122,3 +122,4 @@ theme_name_repeat=名稱已存在
|
||||
theme_name_empty=名稱不能為空
|
||||
i18n_public_chart=【存量视图】
|
||||
i18n_class_blue=蓝色调
|
||||
插件管理=插件管理
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user