From d1ef19f08a2cf9faa202f330798c7e6f822bb722 Mon Sep 17 00:00:00 2001 From: RuoYi <yzz_ivy@163.com> Date: 星期五, 20 八月 2021 17:57:44 +0800 Subject: [PATCH] 自定义可拖动弹窗高度指令 --- ruoyi-ui/src/views/monitor/job/index.vue | 84 ++++++++++++++++++++++++++++++------------ 1 files changed, 60 insertions(+), 24 deletions(-) diff --git a/ruoyi-ui/src/views/monitor/job/index.vue b/ruoyi-ui/src/views/monitor/job/index.vue index be92199..53cfb32 100644 --- a/ruoyi-ui/src/views/monitor/job/index.vue +++ b/ruoyi-ui/src/views/monitor/job/index.vue @@ -31,7 +31,7 @@ </el-select> </el-form-item> <el-form-item> - <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">鎼滅储</el-button> + <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">鎼滅储</el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">閲嶇疆</el-button> </el-form-item> </el-form> @@ -40,6 +40,7 @@ <el-col :span="1.5"> <el-button type="primary" + plain icon="el-icon-plus" size="mini" @click="handleAdd" @@ -49,6 +50,7 @@ <el-col :span="1.5"> <el-button type="success" + plain icon="el-icon-edit" size="mini" :disabled="single" @@ -59,6 +61,7 @@ <el-col :span="1.5"> <el-button type="danger" + plain icon="el-icon-delete" size="mini" :disabled="multiple" @@ -69,8 +72,10 @@ <el-col :span="1.5"> <el-button type="warning" + plain icon="el-icon-download" size="mini" + :loading="exportLoading" @click="handleExport" v-hasPermi="['monitor:job:export']" >瀵煎嚭</el-button> @@ -78,6 +83,7 @@ <el-col :span="1.5"> <el-button type="info" + plain icon="el-icon-s-operation" size="mini" @click="handleJobLog" @@ -109,17 +115,30 @@ <el-button size="mini" type="text" - icon="el-icon-caret-right" - @click="handleRun(scope.row)" + icon="el-icon-edit" + @click="handleUpdate(scope.row)" v-hasPermi="['monitor:job:edit']" - >鎵ц涓�娆�</el-button> + >淇敼</el-button> <el-button size="mini" type="text" - icon="el-icon-view" - @click="handleView(scope.row)" - v-hasPermi="['monitor:job:query']" - >璇︾粏</el-button> + icon="el-icon-delete" + @click="handleDelete(scope.row)" + v-hasPermi="['monitor:job:remove']" + >鍒犻櫎</el-button> + <el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)" v-hasPermi="['monitor:job:changeStatus', 'monitor:job:query']"> + <span class="el-dropdown-link"> + <i class="el-icon-d-arrow-right el-icon--right"></i>鏇村 + </span> + <el-dropdown-menu slot="dropdown"> + <el-dropdown-item command="handleRun" icon="el-icon-caret-right" + v-hasPermi="['monitor:job:changeStatus']">鎵ц涓�娆�</el-dropdown-item> + <el-dropdown-item command="handleView" icon="el-icon-view" + v-hasPermi="['monitor:job:query']">浠诲姟璇︾粏</el-dropdown-item> + <el-dropdown-item command="handleJobLog" icon="el-icon-s-operation" + v-hasPermi="['monitor:job:query']">璋冨害鏃ュ織</el-dropdown-item> + </el-dropdown-menu> + </el-dropdown> </template> </el-table-column> </el-table> @@ -269,6 +288,8 @@ return { // 閬僵灞� loading: true, + // 瀵煎嚭閬僵灞� + exportLoading: false, // 閫変腑鏁扮粍 ids: [], // 闈炲崟涓鐢� @@ -377,6 +398,22 @@ this.single = selection.length != 1; this.multiple = !selection.length; }, + // 鏇村鎿嶄綔瑙﹀彂 + handleCommand(command, row) { + switch (command) { + case "handleRun": + this.handleRun(row); + break; + case "handleView": + this.handleView(row); + break; + case "handleJobLog": + this.handleJobLog(row); + break; + default: + break; + } + }, // 浠诲姟鐘舵�佷慨鏀� handleStatusChange(row) { let text = row.status === "0" ? "鍚敤" : "鍋滅敤"; @@ -402,7 +439,7 @@ return runJob(row.jobId, row.jobGroup); }).then(() => { this.msgSuccess("鎵ц鎴愬姛"); - }).catch(function() {}); + }).catch(() => {}); }, /** 浠诲姟璇︾粏淇℃伅 */ handleView(row) { @@ -412,8 +449,9 @@ }); }, /** 浠诲姟鏃ュ織鍒楄〃鏌ヨ */ - handleJobLog() { - this.$router.push("/job/log"); + handleJobLog(row) { + const jobId = row.jobId || 0; + this.$router.push({ path: '/monitor/job-log/index', query: { jobId: jobId } }) }, /** 鏂板鎸夐挳鎿嶄綔 */ handleAdd() { @@ -437,19 +475,15 @@ if (valid) { if (this.form.jobId != undefined) { updateJob(this.form).then(response => { - if (response.code === 200) { - this.msgSuccess("淇敼鎴愬姛"); - this.open = false; - this.getList(); - } + this.msgSuccess("淇敼鎴愬姛"); + this.open = false; + this.getList(); }); } else { addJob(this.form).then(response => { - if (response.code === 200) { - this.msgSuccess("鏂板鎴愬姛"); - this.open = false; - this.getList(); - } + this.msgSuccess("鏂板鎴愬姛"); + this.open = false; + this.getList(); }); } } @@ -467,7 +501,7 @@ }).then(() => { this.getList(); this.msgSuccess("鍒犻櫎鎴愬姛"); - }).catch(function() {}); + }).catch(() => {}); }, /** 瀵煎嚭鎸夐挳鎿嶄綔 */ handleExport() { @@ -476,11 +510,13 @@ confirmButtonText: "纭畾", cancelButtonText: "鍙栨秷", type: "warning" - }).then(function() { + }).then(() => { + this.exportLoading = true; return exportJob(queryParams); }).then(response => { this.download(response.msg); - }).catch(function() {}); + this.exportLoading = false; + }).catch(() => {}); } } }; -- Gitblit v1.9.3