Lin Qilong 2 meses atrás
pai
commit
2cbb17bc17
1 arquivos alterados com 15 adições e 42 exclusões
  1. 15 42
      ruoyi-ui/src/views/system/plugin/index.vue

+ 15 - 42
ruoyi-ui/src/views/system/plugin/index.vue

@@ -20,19 +20,13 @@
     </el-row>
     <el-row :gutter="10" class="mb8">
       <el-col :span="1.5">
-        <el-button v-hasPermi="['system:plugin:remove']" type="primary" plain icon="Delete" :disabled="single"
+        <el-button v-hasPermi="['system:plugin:remove']" type="primary" plain icon="Delete" :disabled="multiple"
                    @click="handleLoadPlugin">
           启动插件
         </el-button>
       </el-col>
       <el-col :span="1.5">
-        <el-button v-hasPermi="['system:plugin:remove']" type="primary" plain icon="Delete" :disabled="single"
-                   @click="handlePluginTest">
-          测试插件
-        </el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button v-hasPermi="['system:plugin:remove']" type="danger" plain icon="Delete" :disabled="single"
+        <el-button v-hasPermi="['system:plugin:remove']" type="danger" plain icon="Delete" :disabled="multiple"
                    @click="handleDelete">
           删除
         </el-button>
@@ -60,21 +54,17 @@
       </el-table-column>
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template #default="scope">
-          <el-tooltip v-if="scope.row.state==='DISABLED'" content="启动" placement="top">
-            <el-button v-hasPermi="['system:plugin:start']" link type="primary" @click="handlePluginStart(scope.row)">
-              <svg-icon icon-class="play2"/>
-            </el-button>
-          </el-tooltip>
-          <el-tooltip v-if="scope.row.state==='STARTED'" content="停止" placement="top">
-            <el-button v-hasPermi="['system:plugin:stop']" link type="primary" @click="handlePluginStop(scope.row)">
-              <svg-icon icon-class="stop2"/>
-            </el-button>
-          </el-tooltip>
-          <el-tooltip content="删除" placement="top">
-            <el-button v-hasPermi="['system:plugin:stop']" link type="danger" @click="handlePluginStop(scope.row)"
-                       icon="Delete">
-            </el-button>
-          </el-tooltip>
+          <el-button v-if="scope.row.state==='DISABLED'" v-hasPermi="['system:plugin:start']" link type="primary"
+                     @click="handlePluginStart(scope.row)">
+            启动
+          </el-button>
+          <el-button v-if="scope.row.state==='STARTED'" v-hasPermi="['system:plugin:stop']" link type="primary"
+                     @click="handlePluginStop(scope.row)">
+            停止
+          </el-button>
+          <el-button v-hasPermi="['system:plugin:stop']" link type="danger" @click="handlePluginStop(scope.row)">
+            删除
+          </el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -115,7 +105,7 @@
         <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
         <template #tip>
           <div class="text-center el-upload__tip">
-            <span style="color: red;">仅允许导入jar、zip格式文件。</span>
+            <span style="color: red;">仅允许导入jar格式文件。</span>
           </div>
         </template>
       </el-upload>
@@ -130,16 +120,8 @@
 </template>
 
 <script setup>
-import {
-  pluginDelete,
-  pluginList,
-  pluginReload,
-  pluginStart,
-  pluginStop,
-  pluginTest
-} from '@/api/system/plugin/index.js';
+import {pluginDelete, pluginList, pluginReload, pluginStart, pluginStop} from '@/api/system/plugin/index.js';
 import {getToken} from "@/utils/auth.js";
-import SvgIcon from "@/components/SvgIcon/index.vue";
 
 const router = useRouter();
 const {proxy} = getCurrentInstance();
@@ -332,15 +314,6 @@ const handlePluginStop = async (row) => {
   }
 };
 
-/** 插件【测试】操作 */
-const handlePluginTest = async (row) => {
-  const pluginIds = row?.id || ids.value;
-  pluginTest(pluginIds).then((response) => {
-    getList();
-    proxy.$modal.msgSuccess('测试成功');
-  });
-};
-
 function handleDelete() {
   proxy.$modal.confirm('是否确认删除?').then(() => pluginDelete(ids.value.join(',')))
       .then(() => {