feat(系统设置): 系统_插件管理

This commit is contained in:
xinxin.wu 2023-07-10 18:11:09 +08:00 committed by fit2-zhao
parent 951eb65841
commit f664481ca3
24 changed files with 691 additions and 7 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

BIN
frontend/.DS_Store vendored Normal file

Binary file not shown.

BIN
frontend/src/.DS_Store vendored Normal file

Binary file not shown.

View File

@ -0,0 +1,9 @@
import MSR from '@/api/http/index';
import { GetPluginListUrl } from '@/api/requrls/system/plugin';
import type { PluginList } from '@/models/system/plugin';
import type { TableQueryParams } from '@/models/common';
// eslint-disable-next-line import/prefer-default-export
export function getPluginList(data: TableQueryParams) {
return MSR.post<PluginList>({ url: GetPluginListUrl, data });
}

View File

@ -0,0 +1,2 @@
export const GetPluginListUrl = '/plugin/page';
export const UplodaPluginUrl = '/member/add';

BIN
frontend/src/assets/.DS_Store vendored Normal file

Binary file not shown.

BIN
frontend/src/assets/svg/.DS_Store vendored Normal file

Binary file not shown.

View File

@ -0,0 +1,74 @@
<svg width="64" height="46" viewBox="0 0 64 46" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="64" height="46" rx="4" fill="url(#paint0_linear_1946_243856)"/>
<g opacity="0.3" filter="url(#filter0_f_1946_243856)">
<rect x="20" y="39" width="24" height="2" rx="1" fill="#811FA3"/>
</g>
<g filter="url(#filter1_d_1946_243856)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M19.3335 6.33344C18.2289 6.33344 17.3335 7.22887 17.3335 8.33344V33.6668C17.3335 34.7713 18.2289 35.6668 19.3335 35.6668H44.6668C45.7714 35.6668 46.6668 34.7713 46.6668 33.6668L46.6668 15.6668L37.3335 6.33344H19.3335Z" fill="#811FA3"/>
<g filter="url(#filter2_i_1946_243856)">
<path d="M17.333 23C17.333 21.8954 18.2284 21 19.333 21H44.6663C45.7709 21 46.6663 21.8954 46.6663 23V33.6667C46.6663 34.7712 45.7709 35.6667 44.6663 35.6667H19.333C18.2284 35.6667 17.333 34.7712 17.333 33.6667V23Z" fill="url(#paint1_linear_1946_243856)"/>
</g>
<g filter="url(#filter3_d_1946_243856)">
<rect x="27" y="30" width="10" height="2.66667" rx="1.33333" fill="white"/>
</g>
<g filter="url(#filter4_d_1946_243856)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M20.3665 23.3665C20.8551 22.8778 21.6473 22.8778 22.1359 23.3665L25.8847 27.1153C26.3733 27.6039 26.3733 28.3961 25.8847 28.8847L22.1359 32.6335C21.6473 33.1222 20.8551 33.1222 20.3665 32.6335C19.8778 32.1449 19.8778 31.3527 20.3665 30.8641L21.8164 29.4142C22.5974 28.6332 22.5974 27.3668 21.8164 26.5858L20.3665 25.1359C19.8778 24.6473 19.8778 23.8551 20.3665 23.3665Z" fill="white"/>
</g>
<path fill-rule="evenodd" clip-rule="evenodd" d="M36.6976 10.7622C37.1007 10.3591 37.1007 9.70546 36.6976 9.30234C36.2945 8.89922 35.6409 8.89922 35.2378 9.30234L33.9387 10.6014C33.0853 10.1082 32.1713 10.0297 31.3856 10.1487C30.3931 10.2991 29.5065 10.7755 29.0442 11.2378L29.0442 11.2379L27.8829 12.3991C27.4798 12.8023 27.4798 13.4558 27.8829 13.859L32.141 18.117C32.3346 18.3106 32.5971 18.4194 32.8709 18.4194C33.1447 18.4194 33.4072 18.3106 33.6008 18.117L34.7621 16.9557L34.7621 16.9557C35.2244 16.4934 35.7008 15.6068 35.8512 14.6143C35.9702 13.8286 35.8917 12.9147 35.3986 12.0612L36.6976 10.7622ZM28.1815 16.5686C28.5846 16.1655 28.5846 15.5119 28.1815 15.1088C27.7783 14.7057 27.1248 14.7057 26.7216 15.1088L25.9031 15.9273L25.8588 15.8829C25.6652 15.6894 25.4026 15.5806 25.1289 15.5806C24.8551 15.5806 24.5925 15.6894 24.399 15.8829L23.2376 17.0443C22.7754 17.5066 22.299 18.3931 22.1486 19.3857C22.0725 19.8878 22.0771 20.4423 22.2191 21H30.4111C30.4494 20.6946 30.3513 20.3755 30.1169 20.141L30.0726 20.0968L30.8911 19.2783C31.2943 18.8752 31.2943 18.2216 30.8911 17.8185C30.488 17.4153 29.8344 17.4153 29.4313 17.8185L28.6128 18.637L27.363 17.3871L28.1815 16.5686Z" fill="white"/>
</g>
<defs>
<filter id="filter0_f_1946_243856" x="16" y="35" width="32" height="10" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
<feGaussianBlur stdDeviation="2" result="effect1_foregroundBlur_1946_243856"/>
</filter>
<filter id="filter1_d_1946_243856" x="16.333" y="6.33344" width="31.334" height="31.3333" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dy="1"/>
<feGaussianBlur stdDeviation="0.5"/>
<feComposite in2="hardAlpha" operator="out"/>
<feColorMatrix type="matrix" values="0 0 0 0 0.505882 0 0 0 0 0.121569 0 0 0 0 0.639216 0 0 0 0.15 0"/>
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1946_243856"/>
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1946_243856" result="shape"/>
</filter>
<filter id="filter2_i_1946_243856" x="17.333" y="21" width="29.3335" height="14.6667" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset/>
<feGaussianBlur stdDeviation="0.5"/>
<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>
<feColorMatrix type="matrix" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0"/>
<feBlend mode="normal" in2="shape" result="effect1_innerShadow_1946_243856"/>
</filter>
<filter id="filter3_d_1946_243856" x="26" y="30" width="12" height="4.66669" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dy="1"/>
<feGaussianBlur stdDeviation="0.5"/>
<feComposite in2="hardAlpha" operator="out"/>
<feColorMatrix type="matrix" values="0 0 0 0 0.505882 0 0 0 0 0.121569 0 0 0 0 0.639216 0 0 0 0.24 0"/>
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1946_243856"/>
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1946_243856" result="shape"/>
</filter>
<filter id="filter4_d_1946_243856" x="19" y="23" width="8.25098" height="12" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dy="1"/>
<feGaussianBlur stdDeviation="0.5"/>
<feComposite in2="hardAlpha" operator="out"/>
<feColorMatrix type="matrix" values="0 0 0 0 0.505882 0 0 0 0 0.121569 0 0 0 0 0.639216 0 0 0 0.24 0"/>
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1946_243856"/>
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1946_243856" result="shape"/>
</filter>
<linearGradient id="paint0_linear_1946_243856" x1="62.4941" y1="1.50001" x2="-31.3204" y2="32.2514" gradientUnits="userSpaceOnUse">
<stop stop-color="#F2E9F6"/>
<stop offset="1" stop-color="#F9F4FA" stop-opacity="0.12"/>
</linearGradient>
<linearGradient id="paint1_linear_1946_243856" x1="32.6663" y1="35.6667" x2="32.6663" y2="21" gradientUnits="userSpaceOnUse">
<stop stop-color="white"/>
<stop offset="1" stop-color="white" stop-opacity="0.8"/>
</linearGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 6.3 KiB

View File

@ -0,0 +1,49 @@
<svg width="64" height="46" viewBox="0 0 64 46" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="64" height="46" rx="4" fill="url(#paint0_linear_1946_243871)"/>
<g opacity="0.3" filter="url(#filter0_f_1946_243871)">
<rect x="20" y="39" width="24" height="2" rx="1" fill="#811FA3"/>
</g>
<path fill-rule="evenodd" clip-rule="evenodd" d="M20.6667 7C19.1939 7 18 8.16406 18 9.6V32.4C18 33.836 19.1939 35 20.6667 35H41.3333C42.8061 35 44 33.836 44 32.4V13.5C44 12.064 42.8061 10.9 41.3333 10.9H32.6245L29.691 7.46776C29.4376 7.17137 29.0624 7 28.6667 7H20.6667Z" fill="#811FA3"/>
<path d="M22.6341 15.5368C22.8486 14.6358 23.6536 14 24.5797 14H46.4679C47.7598 14 48.7127 15.2065 48.4135 16.4632L44.3659 33.4632C44.1514 34.3642 43.3464 35 42.4203 35H20.5321C19.2402 35 18.2873 33.7935 18.5865 32.5368L22.6341 15.5368Z" fill="#811FA3"/>
<g filter="url(#filter1_i_1946_243871)">
<path d="M22.6341 15.5368C22.8486 14.6358 23.6536 14 24.5797 14H46.4679C47.7598 14 48.7127 15.2065 48.4135 16.4632L44.3659 33.4632C44.1514 34.3642 43.3464 35 42.4203 35H20.5321C19.2402 35 18.2873 33.7935 18.5865 32.5368L22.6341 15.5368Z" fill="url(#paint1_linear_1946_243871)"/>
</g>
<g filter="url(#filter2_d_1946_243871)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M29.8206 26.6147C29.8206 27.2358 29.7735 27.975 30.2878 28.3234C30.3402 28.3589 30.3934 28.3935 30.4472 28.4272C31.1044 28.8382 31.9182 28.2969 32.6418 28.0186C32.8156 27.9518 33.0044 27.9151 33.2018 27.9151C33.3992 27.9151 33.588 27.9518 33.7619 28.0186C34.4854 28.2969 35.2992 28.8382 35.9565 28.4271C36.0103 28.3935 36.0634 28.3589 36.1158 28.3234C36.6301 27.975 36.583 27.2358 36.583 26.6147V26.6147C36.583 25.7528 37.2817 25.0541 38.1435 25.0541V25.0541C38.2315 25.0541 38.3117 24.9963 38.3268 24.9096C38.3773 24.6186 38.4036 24.3193 38.4036 24.0138C38.4036 23.4777 38.3225 22.9606 38.1719 22.474C38.1681 22.4615 38.1565 22.4531 38.1435 22.4532V22.4532C37.2817 22.4532 36.583 21.7545 36.583 20.8927V20.8927C36.583 20.469 36.5354 19.998 36.1888 19.7545C36.0601 19.664 35.927 19.5793 35.7901 19.5006C35.1335 19.1232 34.3431 19.599 33.6123 19.7978C33.4815 19.8333 33.3439 19.8523 33.2018 19.8523C33.0597 19.8523 32.9221 19.8333 32.7913 19.7978C32.0605 19.599 31.2701 19.1232 30.6135 19.5006C30.4766 19.5793 30.3436 19.664 30.2148 19.7545C29.8682 19.998 29.8206 20.469 29.8206 20.8927V20.8927C29.8206 21.7545 29.122 22.4532 28.2601 22.4532V22.4532C28.2471 22.4531 28.2355 22.4615 28.2317 22.474C28.0811 22.9606 28 23.4777 28 24.0138C28 24.3193 28.0263 24.6186 28.0769 24.9096C28.0919 24.9963 28.1721 25.0541 28.2601 25.0541V25.0541C29.122 25.0541 29.8206 25.7528 29.8206 26.6147V26.6147ZM35.0226 24.0137C35.0226 25.0192 34.2074 25.8344 33.2019 25.8344C32.1964 25.8344 31.3813 25.0192 31.3813 24.0137C31.3813 23.0082 32.1964 22.1931 33.2019 22.1931C34.2074 22.1931 35.0226 23.0082 35.0226 24.0137Z" fill="white"/>
</g>
<defs>
<filter id="filter0_f_1946_243871" x="16" y="35" width="32" height="10" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
<feGaussianBlur stdDeviation="2" result="effect1_foregroundBlur_1946_243871"/>
</filter>
<filter id="filter1_i_1946_243871" x="18.5312" y="14" width="29.9375" height="21" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset/>
<feGaussianBlur stdDeviation="0.5"/>
<feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/>
<feColorMatrix type="matrix" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0"/>
<feBlend mode="normal" in2="shape" result="effect1_innerShadow_1946_243871"/>
</filter>
<filter id="filter2_d_1946_243871" x="27" y="19.3593" width="12.4038" height="11.2167" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dy="1"/>
<feGaussianBlur stdDeviation="0.5"/>
<feComposite in2="hardAlpha" operator="out"/>
<feColorMatrix type="matrix" values="0 0 0 0 0.505882 0 0 0 0 0.121569 0 0 0 0 0.639216 0 0 0 0.24 0"/>
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1946_243871"/>
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1946_243871" result="shape"/>
</filter>
<linearGradient id="paint0_linear_1946_243871" x1="62.4941" y1="1.50001" x2="-31.3204" y2="32.2514" gradientUnits="userSpaceOnUse">
<stop stop-color="#F2E9F6"/>
<stop offset="1" stop-color="#F9F4FA" stop-opacity="0.12"/>
</linearGradient>
<linearGradient id="paint1_linear_1946_243871" x1="34.2045" y1="35" x2="34.2045" y2="14" gradientUnits="userSpaceOnUse">
<stop stop-color="white"/>
<stop offset="1" stop-color="white" stop-opacity="0.8"/>
</linearGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 5.0 KiB

View File

@ -0,0 +1,31 @@
<template>
<a-alert v-bind="attrs" class="p-4" :class="`arco-alert-${type}`">
<span class="float-left mr-3" :class="`arco-icon-${type}`"><icon-info-circle-fill /></span>
<div>
<slot name="content"></slot>
</div>
</a-alert>
</template>
<script setup lang="ts">
import { useAttrs } from 'vue';
const attrs = useAttrs();
defineProps<{
type: string;
}>();
</script>
<style scoped>
.arco-alert-primary {
border-color: rgb(var(--primary-5));
/* stylelint-disable-next-line color-function-notation */
background-color: rgba(var(--primary-5), 0.1);
}
.arco-icon-primary {
color: rgb(var(--primary-5));
}
.arco-icon-error {
color: rgb(rgb(var(--danger-6)));
}
</style>

View File

@ -0,0 +1,5 @@
export interface SlotContent {
title: string;
slotName: string;
}
export type SlotContentlist = SlotContent[];

View File

@ -23,6 +23,7 @@ export default {
'menu.settings.organization': 'Organization',
'menu.settings.organization.member': 'Member',
'menu.settings.system.usergroup': 'User Group',
'menu.settings.system.pluginmanger': 'Plugin Manger',
'menu.settings.system.user': 'User',
'menu.settings.system.organizationAndProject': 'Org & Project',
'menu.settings.system.resourcePool': 'Resource Pool',

View File

@ -24,6 +24,7 @@ export default {
'menu.settings.organization.member': '成员',
'menu.settings.system.user': '用户',
'menu.settings.system.usergroup': '用户组',
'menu.settings.system.pluginmanger': '插件管理',
'menu.settings.system.organizationAndProject': '组织与项目',
'menu.settings.system.resourcePool': '资源池',
'menu.settings.system.resourcePoolDetail': '添加资源池',

View File

@ -7,6 +7,7 @@ import './system/user';
import './system/project';
import './system/resourcePool';
import './system/member';
import './system/pluginManger';
Mock.setup({
timeout: '600-1000',

View File

@ -0,0 +1,71 @@
import Mock from 'mockjs';
import setupMock, { successTableResponseWrap } from '@/utils/setup-mock';
const getPluginList = () => {
return [
{
id: '1-1',
name: '插件一',
describe: '插件一',
enable: true,
createTime: 'number',
updateTime: 'number',
jarPackage: 'string',
version: 'string',
applicationScene: 'string',
createUser: 'string',
updateUser: 'string',
children: [
{
id: '1-1-1',
name: '插件1-1',
describe: '插件1-1',
enable: true,
createTime: 'number',
updateTime: 'number',
jarPackage: 'string',
version: 'string',
applicationScene: 'string',
createUser: 'string',
updateUser: 'string',
},
],
},
{
id: '2-1',
name: '插件一',
describe: '插件一',
enable: true,
createTime: 'number',
updateTime: 'number',
jarPackage: 'string',
version: 'string',
applicationScene: 'string',
createUser: 'string',
updateUser: 'string',
children: [
{
id: '2-1-1',
name: '插件2-1',
describe: '插件2-1',
enable: true,
createTime: 'number',
updateTime: 'number',
jarPackage: 'string',
version: 'string',
applicationScene: 'string',
createUser: 'string',
updateUser: 'string',
},
],
},
];
};
setupMock({
setup: () => {
Mock.mock(new RegExp('/plugin/page'), () => {
return successTableResponseWrap(getPluginList());
});
},
});

View File

@ -0,0 +1,30 @@
export interface PluginItem {
id: string;
name: string;
describe: string;
enable: boolean;
createTime: number;
updateTime: number;
jarPackage: string;
version: string;
applicationScene: string;
createUser: string;
updateUser: string;
children?: PluginItem[];
}
export type PluginList = PluginItem[];
export interface StepItem {
name: string;
title: string;
status: boolean;
}
export type StepList = StepItem[];
export interface SceneItem {
name: string;
description: string;
isSelected: boolean;
svg: string;
}
export type SceneList = SceneItem[];

View File

@ -47,15 +47,9 @@ const System: AppRouteRecordRaw = {
name: 'settingSystemResourcePool',
component: () => import('@/views/system/resourcePool/index.vue'),
meta: {
locale: 'menu.settings.system.resourcePool',
locale: 'menu.settings.system.pluginmanger',
roles: ['*'],
isTopMenu: true,
breadcrumbs: [
{
name: 'settingSystemResourcePool',
locale: 'menu.settings.system.resourcePool',
},
],
},
},
{
@ -79,6 +73,22 @@ const System: AppRouteRecordRaw = {
],
},
},
{
path: 'pluginmanger',
name: 'settingSystemPluginManger',
component: () => import('@/views/system/pluginManager/index.vue'),
meta: {
locale: 'menu.settings.system.pluginmanger',
roles: ['*'],
isTopMenu: true,
breadcrumbs: [
{
name: 'settingSystemResourcePool',
locale: 'menu.settings.system.pluginmanger',
},
],
},
},
],
},
{

View File

@ -0,0 +1,67 @@
<template>
<div class="mt-6 flex flex-col">
<div
v-for="(item, index) in sceneList"
:key="index"
class="ms-ls-row my-2"
:class="{ 'ms-ls-row--active': item.isSelected }"
@click="selectHandler(item)"
>
<div class="ms-icon-list ml-4 mr-5" :class="`ms-icon-list--${item.svg}`"></div>
<div class="flex flex-col justify-center">
<div class="mb-1 font-medium">{{ t(item.name) }}</div>
<div class="text-sm">{{ t(item.description) }}</div>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { ref } from 'vue';
import type { SceneItem, SceneList } from '@/models/system/plugin';
import { useI18n } from '@/hooks/useI18n';
const { t } = useI18n();
const sceneList = ref<SceneList>([
{
name: 'system.plugin.interfaceTest',
description: 'system.plugin.interfaceTestDescribe',
isSelected: true,
svg: 'api',
},
{
name: 'system.plugin.projectManger',
description: 'system.plugin.projectMangerDescribe',
isSelected: false,
svg: 'project',
},
]);
const selectHandler = (currentItem: SceneItem) => {
sceneList.value.forEach((item: SceneItem) => {
item.isSelected = false;
});
currentItem.isSelected = true;
};
</script>
<style scoped lang="less">
.ms-icon-list {
width: 48px;
height: 48px;
&--api {
background-image: url('@/assets/svg/icons/apitest.svg');
}
&--project {
background-image: url('@/assets/svg/icons/promanger.svg');
}
}
.ms-ls-row {
border-width: 1px;
@apply flex flex-row items-center rounded border-solid py-2;
&--active {
/* stylelint-disable-next-line color-function-notation */
background-color: rgba(var(--primary-5), 0.1);
}
}
</style>

View File

@ -0,0 +1,122 @@
<!-- eslint-disable vue/valid-v-for -->
<template>
<div>
<div class="mb-4">
<a-row class="grid-demo" :gutter="24">
<a-col :span="5">
<a-button class="mr-3" type="primary" @click="uploadPlugin">{{ t('system.plugin.uploadPlugin') }}</a-button>
</a-col>
<a-col :span="5" :offset="9">
<a-select v-model="scene" allow-clear>
<a-option v-for="item of sceneList" :key-="item.value" :value="item.value">{{ item.label }}</a-option>
</a-select>
</a-col>
<a-col :span="5">
<a-input-search :placeholder="t('system.plugin.searchPlugin')" @search="searchPlugin"></a-input-search>
</a-col>
</a-row>
</div>
<ms-base-table v-bind="propsRes" v-on="propsEvent">
<template #action="{ record }">
<MsButton>{{ t('system.plugin.edit') }}</MsButton>
<MsButton>{{ t('system.plugin.ChangeScene') }}</MsButton>
<MsTableMoreAction :list="tableActions" @select="handleSelect($event, record)"></MsTableMoreAction>
</template>
</ms-base-table>
<uploadModel :visible="uploadVisible" @cancel="uploadVisible = false" />
</div>
</template>
<script setup lang="ts">
import { ref, onMounted } from 'vue';
import { useI18n } from '@/hooks/useI18n';
import MsBaseTable from '@/components/pure/ms-table/base-table.vue';
import useTable from '@/components/pure/ms-table/useTable';
import MsTableMoreAction from '@/components/pure/ms-table-more-action/index.vue';
import type { MsTableColumn } from '@/components/pure/ms-table/type';
import type { ActionsItem } from '@/components/pure/ms-table-more-action/types';
import { getPluginList } from '@/api/modules/system/pluginManger';
import MsButton from '@/components/pure/ms-button/index.vue';
import uploadModel from './uploadModel.vue';
const { t } = useI18n();
const columns: MsTableColumn = [
{
title: 'system.plugin.tableColunmName',
dataIndex: 'name',
width: 200,
},
{
title: 'system.plugin.tableColunmDescription',
dataIndex: 'describe',
},
{
title: 'system.plugin.tableColunmJarPackage',
dataIndex: 'jarPackage',
},
{
title: 'system.plugin.tableColunmVersion',
dataIndex: 'version',
},
{
title: 'system.plugin.tableColunmApplicationScene',
dataIndex: 'applicationScene',
},
{
title: 'system.plugin.tableColunmActions',
slotName: 'action',
fixed: 'right',
width: 150,
},
];
const tableActions: ActionsItem[] = [
{
label: 'system.plugin.delete',
eventTag: 'delete',
danger: true,
},
];
const { propsRes, propsEvent, loadList, setKeyword } = useTable(getPluginList, {
columns,
scroll: { y: 'auto' },
selectable: false,
showSelectAll: false,
});
const keyword = ref('');
const scene = ref('1');
const sceneList = ref([
{
label: '全部应用场景',
value: '1',
},
]);
const uploadVisible = ref<boolean>(false);
onMounted(async () => {
setKeyword(keyword.value);
await loadList();
});
async function searchPlugin() {
setKeyword(keyword.value);
await loadList();
}
function deletePlugin() {}
/**
* 处理表格更多按钮事件
* @param item
*/
function handleSelect(item: ActionsItem, record: any) {
switch (item.eventTag) {
case 'delete':
deletePlugin();
break;
default:
break;
}
}
function uploadPlugin() {
uploadVisible.value = true;
}
</script>
<style scoped></style>

View File

@ -0,0 +1,33 @@
<template>
<a-steps v-bind="attrs" @change="changeCurrent">
<a-step v-for="item of stepList" :key="item.title">{{ t(item.title) }}</a-step>
</a-steps>
</template>
<script setup lang="ts">
import { ref, useAttrs } from 'vue';
import { useI18n } from '@/hooks/useI18n';
import type { StepList } from '@/models/system/plugin';
const { t } = useI18n();
const props = defineProps<{
current: number;
stepList: StepList;
setCurrent: (step: number) => void;
}>();
const attrs = useAttrs();
const changeCurrent = (step: number) => {
props.setCurrent(step);
};
</script>
<style scoped lang="less">
:deep(.arco-steps-icon) {
width: 20px;
height: 20px;
line-height: 19px;
}
:deep(.arco-modal-body) {
padding: 10px;
}
</style>

View File

@ -0,0 +1,61 @@
<template>
<a-modal
v-model:visible="pluginVisible"
title-align="start"
width="500px"
:footer="false"
@ok="handleOk"
@cancel="handleCancel"
>
<template #title> {{ t('system.plugin.uploadPlugin') }} </template>
<div>
<StepProgress :step-list="stepList" :current="currentStep" small :set-current="setCurrent" changeable />
<SceneList />
</div>
</a-modal>
</template>
<script setup lang="ts">
import { ref, watchEffect } from 'vue';
import { useI18n } from '@/hooks/useI18n';
import type { StepList } from '@/models/system/plugin';
import StepProgress from './stepProgress.vue';
import SceneList from './SceneList.vue';
const { t } = useI18n();
const currentStep = ref<number>(1);
const stepList = ref<StepList>([
{
name: '选择应用场景',
title: 'system.plugin.SelectApplicationScene',
status: true,
},
{
name: '上传插件',
title: 'system.plugin.uploadPlugin',
status: true,
},
]);
const pluginVisible = ref(false);
const emit = defineEmits<{
(e: 'cancel'): void;
}>();
const props = defineProps<{
visible: boolean;
}>();
watchEffect(() => {
pluginVisible.value = props.visible;
});
const handleCancel = () => {
emit('cancel');
};
const handleOk = () => {
handleCancel();
};
const setCurrent = (step: number) => {
currentStep.value = step;
};
</script>
<style scoped></style>

View File

@ -0,0 +1,32 @@
/* stylelint-disable order/properties-order */
<template>
<div>
<MSAlert :closable="isClose" :show-icon="showIcon" type="primary">
<template #content>
<div>
MeterSphereV2.10LTS版本支持DevOpsAPI导入请求项目管理协议类型的插件具体支持插件请
<a class="mx-1" href="javascript:;">查看表格</a>更多开源插件请在此下载
<a class="mx-1" href="javascript:;">去下载 </a>
</div>
</template>
</MSAlert>
<div class="mt-4">
<pluginTable />
</div>
</div>
</template>
<script setup lang="ts">
import { ref } from 'vue';
import MSAlert from '@/components/pure/ms-alert/index.vue';
import pluginTable from './components/pluginTable.vue';
const isClose = ref<boolean>(true);
const showIcon = ref<boolean>(false);
</script>
<style scoped>
a {
color: rgb(var(--primary-5));
}
</style>

View File

@ -0,0 +1,43 @@
export default {
'system.plugin.uploadPlugin': 'Upload Plugin',
'system.plugin.searchPlugin': 'Search by name',
'system.plugin.delete': 'Delete',
'system.resourcePool.tableEnable': 'Enable',
'system.resourcePool.tableDisable': 'Disable',
'system.plugin.edit': 'Edit',
'system.plugin.tableColunmName': 'Name',
'system.plugin.tableColunmJarPackage': 'Jar Package',
'system.plugin.tableColunmDescription': 'Description',
'system.plugin.tableColunmVersion': 'Type',
'system.plugin.tableColunmCreateTime': 'CreateTime',
'system.plugin.tableColunmUpdateTime': 'UpdateTime',
'system.plugin.tableColunmApplicationScene': 'ApplicationScene',
'system.plugin.tableColunmActions': 'Actions',
'system.plugin.ChangeScene': 'Change Scene',
'system.plugin.SelectApplicationScene': 'Select Application Scene',
'system.plugin.interfaceTest': 'Interface Test',
'system.plugin.projectManger': 'Project Manger',
'system.plugin.interfaceTestDescribe': 'Plug-ins for protocol classes recommend choosing an interface test',
'system.plugin.projectMangerDescribe': 'The project management platform class recommends choosing project management',
'system.resourcePool.disablePoolConfirm': 'Confirm',
'system.resourcePool.disablePoolCancel': 'Cancel',
'system.resourcePool.disablePoolSuccess': 'Disabled successfully',
'system.resourcePool.deletePoolTip': 'Are you sure to delete the `{name}` resource?',
'system.resourcePool.deletePoolContentUsed':
'This resource pool has been used, and related tests will stop immediately after deletion, please operate with caution!',
'system.resourcePool.deletePoolContentUnuse': 'This resource pool is not in use. Are you sure to delete it?',
'system.resourcePool.deletePoolConfirm': 'Confirm',
'system.resourcePool.deletePoolCancel': 'Cancel',
'system.resourcePool.deletePoolSuccess': 'Deleted successfully',
'system.resourcePool.detailDesc': 'Description',
'system.resourcePool.detailUrl': 'Current site URL',
'system.resourcePool.detailRange': 'Available range',
'system.resourcePool.detailUse': 'Use',
'system.resourcePool.detailMirror': 'Mirror',
'system.resourcePool.detailJMHeap': 'JMeter HEAP',
'system.resourcePool.detailType': 'Type',
'system.resourcePool.detailResources': 'Added resource',
'system.resourcePool.usePerformance': 'Performance test',
'system.resourcePool.useAPI': 'API test',
'system.resourcePool.useUI': ' UI test',
};

View File

@ -0,0 +1,42 @@
export default {
'system.plugin.uploadPlugin': '上传插件',
'system.plugin.searchPlugin': '通过名称搜索',
'system.plugin.delete': '删除',
'system.plugin.tableEnable': '启用',
'system.plugin.tableDisable': '禁用',
'system.plugin.edit': '编辑',
'system.plugin.tableColunmName': '名称',
'system.plugin.tableColunmJarPackage': 'jar包',
'system.plugin.tableColunmDescription': '描述',
'system.plugin.tableColunmVersion': '版本',
'system.plugin.tableColunmCreateTime': '创建时间',
'system.plugin.tableColunmUpdateTime': '更新时间',
'system.plugin.tableColunmApplicationScene': '应用场景',
'system.plugin.tableColunmActions': '操作',
'system.plugin.ChangeScene': '场景变更',
'system.plugin.SelectApplicationScene': '选择应用场景',
'system.plugin.interfaceTest': '接口测试',
'system.plugin.projectManger': '项目管理',
'system.plugin.interfaceTestDescribe': '协议类的插件建议选择接口测试',
'system.plugin.projectMangerDescribe': '项目管理平台类建议选择项目管理',
'system.resourcePool.disablePoolConfirm': '确认禁用',
'system.resourcePool.disablePoolCancel': '取消',
'system.resourcePool.disablePoolSuccess': '禁用成功',
'system.resourcePool.deletePoolTip': '确认删除 `{name}` 这个资源吗?',
'system.resourcePool.deletePoolContentUsed': '该资源池已被使用,删除后相关测试会立即停止,请谨慎操作!',
'system.resourcePool.deletePoolContentUnuse': '该资源池未被使用,是否确认删除?',
'system.resourcePool.deletePoolConfirm': '确认删除',
'system.resourcePool.deletePoolCancel': '取消',
'system.resourcePool.deletePoolSuccess': '删除成功',
'system.resourcePool.detailDesc': '描述',
'system.resourcePool.detailUrl': '当前站点 URL',
'system.resourcePool.detailRange': '可用范围',
'system.resourcePool.detailUse': '用途',
'system.resourcePool.detailMirror': '镜像',
'system.resourcePool.detailJMHeap': 'JMeter HEAP',
'system.resourcePool.detailType': '类型',
'system.resourcePool.detailResources': '已添加资源',
'system.resourcePool.usePerformance': '性能测试',
'system.resourcePool.useAPI': '接口测试',
'system.resourcePool.useUI': ' UI 测试',
};