| | |
| | | </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>
|
| | |
| | | <el-col :span="1.5">
|
| | | <el-button
|
| | | type="primary"
|
| | | plain
|
| | | icon="el-icon-plus"
|
| | | size="mini"
|
| | | @click="handleAdd"
|
| | |
| | | <el-col :span="1.5">
|
| | | <el-button
|
| | | type="success"
|
| | | plain
|
| | | icon="el-icon-edit"
|
| | | size="mini"
|
| | | :disabled="single"
|
| | |
| | | <el-col :span="1.5">
|
| | | <el-button
|
| | | type="danger"
|
| | | plain
|
| | | icon="el-icon-delete"
|
| | | size="mini"
|
| | | :disabled="multiple"
|
| | |
| | | <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>
|
| | |
| | | <el-col :span="1.5">
|
| | | <el-button
|
| | | type="info"
|
| | | plain
|
| | | icon="el-icon-s-operation"
|
| | | size="mini"
|
| | | @click="handleJobLog"
|
| | | v-hasPermi="['monitor:job:query']"
|
| | | >日志</el-button>
|
| | | </el-col>
|
| | | <table-tools-ext :showSearch.sync="showSearch" @queryTable="getList"></table-tools-ext>
|
| | | <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
| | | </el-row>
|
| | |
|
| | | <el-table v-loading="loading" :data="jobList" @selection-change="handleSelectionChange">
|
| | |
| | | <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>
|
| | |
| | | return {
|
| | | // 遮罩层
|
| | | loading: true,
|
| | | // 导出遮罩层
|
| | | exportLoading: false,
|
| | | // 选中数组
|
| | | ids: [],
|
| | | // 非单个禁用
|
| | |
| | | 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" ? "启用" : "停用";
|
| | |
| | | return runJob(row.jobId, row.jobGroup);
|
| | | }).then(() => {
|
| | | this.msgSuccess("执行成功");
|
| | | }).catch(function() {});
|
| | | }).catch(() => {});
|
| | | },
|
| | | /** 任务详细信息 */
|
| | | handleView(row) {
|
| | |
| | | });
|
| | | },
|
| | | /** 任务日志列表查询 */
|
| | | 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() {
|
| | |
| | | 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();
|
| | | });
|
| | | }
|
| | | }
|
| | |
| | | }).then(() => {
|
| | | this.getList();
|
| | | this.msgSuccess("删除成功");
|
| | | }).catch(function() {});
|
| | | }).catch(() => {});
|
| | | },
|
| | | /** 导出按钮操作 */
|
| | | handleExport() {
|
| | |
| | | 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(() => {});
|
| | | }
|
| | | }
|
| | | };
|