更新
This commit is contained in:
@@ -2,47 +2,85 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2022-08-22 14:57:51
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-01-06 09:44:17
|
||||
* @LastEditTime: 2023-05-12 12:46:50
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<nav class="aui-navbar" :class="`aui-navbar--${$store.state.navbarLayoutType}`">
|
||||
<div class="aui-navbar__header">
|
||||
<h1 class="aui-navbar__brand" @click="$router.push({ name: 'home' })">
|
||||
<a class="aui-navbar__brand-lg" href="javascript:;">{{ $t('brand.lg') }}</a>
|
||||
<a class="aui-navbar__brand-mini" href="javascript:;">{{ $t('brand.mini') }}</a>
|
||||
<a class="aui-navbar__brand-lg" href="javascript:;">{{ $t("brand.lg") }}</a>
|
||||
<a class="aui-navbar__brand-mini" href="javascript:;">{{ $t("brand.mini") }}</a>
|
||||
</h1>
|
||||
</div>
|
||||
<div class="aui-navbar__body">
|
||||
<el-menu class="aui-navbar__menu mr-auto" mode="horizontal">
|
||||
<el-menu-item index="1" @click="$store.state.sidebarFold = !$store.state.sidebarFold">
|
||||
<svg class="icon-svg aui-navbar__icon-menu aui-navbar__icon-menu--switch" aria-hidden="true"><use xlink:href="#icon-outdent"></use></svg>
|
||||
<svg
|
||||
class="icon-svg aui-navbar__icon-menu aui-navbar__icon-menu--switch"
|
||||
aria-hidden="true"
|
||||
>
|
||||
<use xlink:href="#icon-outdent"></use>
|
||||
</svg>
|
||||
</el-menu-item>
|
||||
<el-menu-item index="2" @click="refresh()">
|
||||
<svg class="icon-svg aui-navbar__icon-menu aui-navbar__icon-menu--refresh" aria-hidden="true"><use xlink:href="#icon-sync"></use></svg>
|
||||
<svg
|
||||
class="icon-svg aui-navbar__icon-menu aui-navbar__icon-menu--refresh"
|
||||
aria-hidden="true"
|
||||
>
|
||||
<use xlink:href="#icon-sync"></use>
|
||||
</svg>
|
||||
</el-menu-item>
|
||||
</el-menu>
|
||||
<el-menu class="aui-navbar__menu" mode="horizontal">
|
||||
<el-menu-item index="6" @click="$router.push({ name: 'home' })">
|
||||
<svg class="icon-svg aui-navbar__icon-menu" aria-hidden="true"><use xlink:href="#icon-home"></use></svg>
|
||||
|
||||
<el-menu-item index="6" @click="$router.push({ name: 'home' })">
|
||||
<svg class="icon-svg aui-navbar__icon-menu" aria-hidden="true">
|
||||
<use xlink:href="#icon-home"></use>
|
||||
</svg>
|
||||
</el-menu-item>
|
||||
<el-menu-item index="7">
|
||||
<el-dropdown trigger="click" class="international" @command="handleSetLanguage">
|
||||
<div>
|
||||
<svg class="icon-svg aui-navbar__icon-menu" aria-hidden="true">
|
||||
<use xlink:href="#中英"></use>
|
||||
</svg>
|
||||
</div>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item :disabled="language === 'zh-CN'" command="zh-CN">
|
||||
中文
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item :disabled="language === 'en'" command="en">
|
||||
English
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</el-menu-item>
|
||||
<el-menu-item index="4" @click="fullscreenHandle()">
|
||||
<svg class="icon-svg aui-navbar__icon-menu" aria-hidden="true"><use xlink:href="#icon-fullscreen"></use></svg>
|
||||
<svg class="icon-svg aui-navbar__icon-menu" aria-hidden="true">
|
||||
<use xlink:href="#icon-fullscreen"></use>
|
||||
</svg>
|
||||
</el-menu-item>
|
||||
<el-menu-item index="5" class="aui-navbar__avatar">
|
||||
<el-dropdown placement="bottom" :show-timeout="0">
|
||||
<span class="el-dropdown-link">
|
||||
<img src="~@/assets/img/avatar.png">
|
||||
<img src="~@/assets/img/avatar.png" />
|
||||
<span>{{ $store.state.user.name }}</span>
|
||||
<i class="el-icon-arrow-down"></i>
|
||||
</span>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item @click.native="updatePasswordHandle()">
|
||||
<svg class="icon-svg aui-content--tabs-icon-nav" aria-hidden="true"><use xlink:href="#修改密码"></use></svg>
|
||||
{{ $t('updatePassword.title') }}</el-dropdown-item>
|
||||
<svg class="icon-svg aui-content--tabs-icon-nav" aria-hidden="true">
|
||||
<use xlink:href="#修改密码"></use>
|
||||
</svg>
|
||||
{{ $t("updatePassword.title") }}</el-dropdown-item
|
||||
>
|
||||
<el-dropdown-item @click.native="logoutHandle()">
|
||||
<svg class="icon-svg aui-content--tabs-icon-nav" aria-hidden="true"><use xlink:href="#tuichu"></use></svg>
|
||||
{{ $t('logout') }}</el-dropdown-item>
|
||||
<svg class="icon-svg aui-content--tabs-icon-nav" aria-hidden="true">
|
||||
<use xlink:href="#tuichu"></use>
|
||||
</svg>
|
||||
{{ $t("logout") }}</el-dropdown-item
|
||||
>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</el-menu-item>
|
||||
@@ -53,55 +91,77 @@
|
||||
</nav>
|
||||
</template>
|
||||
<script>
|
||||
import screenfull from 'screenfull'
|
||||
import UpdatePassword from './main-navbar-update-password'
|
||||
import { clearLoginInfo } from '@/utils'
|
||||
import screenfull from "screenfull";
|
||||
import UpdatePassword from "./main-navbar-update-password";
|
||||
import { clearLoginInfo } from "@/utils";
|
||||
import { messages } from '@/i18n'
|
||||
import Cookies from "js-cookie";
|
||||
export default {
|
||||
inject: ['refresh'],
|
||||
data () {
|
||||
inject: ["refresh"],
|
||||
data() {
|
||||
return {
|
||||
updatePasswordVisible: false,
|
||||
messageTip: false
|
||||
}
|
||||
messageTip: false,
|
||||
};
|
||||
},
|
||||
components: {
|
||||
UpdatePassword
|
||||
UpdatePassword,
|
||||
},
|
||||
computed: {
|
||||
language() {
|
||||
return Cookies.get("language");
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
methods: {
|
||||
handleSetLanguage(val) {
|
||||
Cookies.set("language", val);
|
||||
document.querySelector("html").setAttribute("lang", val);
|
||||
document.title = messages[val].brand.lg;
|
||||
window.location.reload();
|
||||
},
|
||||
// 全屏
|
||||
fullscreenHandle () {
|
||||
fullscreenHandle() {
|
||||
if (!screenfull.enabled) {
|
||||
return this.$message({
|
||||
message: this.$t('fullscreen.prompt'),
|
||||
type: 'warning',
|
||||
duration: 500
|
||||
})
|
||||
message: this.$t("fullscreen.prompt"),
|
||||
type: "warning",
|
||||
duration: 500,
|
||||
});
|
||||
}
|
||||
screenfull.toggle()
|
||||
screenfull.toggle();
|
||||
},
|
||||
// 修改密码
|
||||
updatePasswordHandle () {
|
||||
this.updatePasswordVisible = true
|
||||
updatePasswordHandle() {
|
||||
this.updatePasswordVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.updatePassword.init()
|
||||
})
|
||||
this.$refs.updatePassword.init();
|
||||
});
|
||||
},
|
||||
// 退出
|
||||
logoutHandle () {
|
||||
this.$confirm(this.$t('prompt.info', { 'handle': this.$t('logout') }), this.$t('prompt.title'), {
|
||||
confirmButtonText: this.$t('confirm'),
|
||||
cancelButtonText: this.$t('cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$http.post('/logout').then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
clearLoginInfo()
|
||||
this.$router.push({ name: 'login' })
|
||||
}).catch(() => {})
|
||||
}).catch(() => {})
|
||||
}
|
||||
}
|
||||
}
|
||||
logoutHandle() {
|
||||
this.$confirm(
|
||||
this.$t("prompt.info", { handle: this.$t("logout") }),
|
||||
this.$t("prompt.title"),
|
||||
{
|
||||
confirmButtonText: this.$t("confirm"),
|
||||
cancelButtonText: this.$t("cancel"),
|
||||
type: "warning",
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
this.$http
|
||||
.post("/logout")
|
||||
.then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg);
|
||||
}
|
||||
clearLoginInfo();
|
||||
this.$router.push({ name: "login" });
|
||||
})
|
||||
.catch(() => {});
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<template>
|
||||
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
|
||||
<el-form-item prop="beanName" :label="$t('schedule.beanName')">
|
||||
<el-input v-model="dataForm.beanName" :placeholder="$t('schedule.beanNameTips')"></el-input>
|
||||
@@ -17,20 +16,21 @@
|
||||
<el-input v-model="dataForm.remark" :placeholder="$t('schedule.remark')"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template slot="footer">
|
||||
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script>
|
||||
import basicAdd from '@/mixins/basic-add'
|
||||
import debounce from 'lodash/debounce'
|
||||
import { cron } from 'vue-cron'
|
||||
export default {
|
||||
export default {
|
||||
mixins: [basicAdd],
|
||||
data () {
|
||||
return {
|
||||
visible: false,
|
||||
visible: false,
|
||||
urlOptions: {
|
||||
submitURL: '/sys/schedule/',
|
||||
infoURL: '/sys/schedule'
|
||||
},
|
||||
dataForm: {
|
||||
id: '',
|
||||
beanName: '',
|
||||
@@ -57,8 +57,9 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init () {
|
||||
methods: {
|
||||
init (id) {
|
||||
this.dataForm.id = id || "";
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
@@ -94,8 +95,8 @@ export default {
|
||||
type: 'success',
|
||||
duration: 500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList')
|
||||
this.visible = false
|
||||
this.$emit('successSubmit')
|
||||
}
|
||||
})
|
||||
}).catch(() => {})
|
||||
|
||||
@@ -1,71 +1,39 @@
|
||||
<template>
|
||||
<el-card shadow="never" class="aui-card--fill">
|
||||
<div class="mod-job__schedule">
|
||||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
|
||||
<el-form-item>
|
||||
<el-input v-model="dataForm.beanName" :placeholder="$t('schedule.beanName')" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="getDataList()">{{ $t('query') }}</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button v-if="$hasPermission('sys:schedule:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button v-if="$hasPermission('sys:schedule:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button v-if="$hasPermission('sys:schedule:pause')" type="danger" @click="pauseHandle()">{{ $t('schedule.pauseBatch') }}</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button v-if="$hasPermission('sys:schedule:resume')" type="danger" @click="resumeHandle()">{{ $t('schedule.resumeBatch') }}</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button v-if="$hasPermission('sys:schedule:run')" type="danger" @click="runHandle()">{{ $t('schedule.runBatch') }}</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button v-if="$hasPermission('sys:schedule:log')" type="success" @click="logHandle()">{{ $t('schedule.log') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
v-loading="dataListLoading"
|
||||
:data="dataList"
|
||||
border
|
||||
@selection-change="dataListSelectionChangeHandle"
|
||||
@sort-change="dataListSortChangeHandle"
|
||||
style="width: 100%;">
|
||||
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
|
||||
<el-table-column prop="beanName" :label="$t('schedule.beanName')" header-align="center" align="center"></el-table-column>
|
||||
<el-table-column prop="params" :label="$t('schedule.params')" header-align="center" align="center"></el-table-column>
|
||||
<el-table-column prop="cronExpression" :label="$t('schedule.cronExpression')" header-align="center" align="center"></el-table-column>
|
||||
<el-table-column prop="remark" :label="$t('schedule.remark')" header-align="center" align="center"></el-table-column>
|
||||
<el-table-column prop="status" :label="$t('schedule.status')" sortable="custom" header-align="center" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.status === 1" size="small">{{ $t('schedule.status1') }}</el-tag>
|
||||
<el-tag v-else size="small" type="danger">{{ $t('schedule.status0') }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-if="$hasPermission('sys:schedule:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
|
||||
<el-button v-if="$hasPermission('sys:schedule:pause')" type="text" size="small" @click="pauseHandle(scope.row.id)">{{ $t('schedule.pause') }}</el-button>
|
||||
<el-button v-if="$hasPermission('sys:schedule:resume')" type="text" size="small" @click="resumeHandle(scope.row.id)">{{ $t('schedule.resume') }}</el-button>
|
||||
<el-button v-if="$hasPermission('sys:schedule:run')" type="text" size="small" @click="runHandle(scope.row.id)">{{ $t('schedule.run') }}</el-button>
|
||||
<el-button v-if="$hasPermission('sys:schedule:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
:current-page="page"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="limit"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="pageSizeChangeHandle"
|
||||
@current-change="pageCurrentChangeHandle">
|
||||
</el-pagination>
|
||||
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
|
||||
|
||||
<base-table
|
||||
:table-props="tableProps"
|
||||
:page="listQuery.page"
|
||||
:limit="listQuery.limit"
|
||||
:table-data="tableData"
|
||||
>
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="200"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick"
|
||||
/>
|
||||
</base-table>
|
||||
<pagination
|
||||
:limit.sync="listQuery.limit"
|
||||
:page.sync="listQuery.page"
|
||||
:total="listQuery.total"
|
||||
@pagination="getDataList"
|
||||
/>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
|
||||
<base-dialog
|
||||
:dialogTitle="addOrEditTitle"
|
||||
:dialogVisible="addOrUpdateVisible"
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
>
|
||||
<add-or-update ref="addOrUpdate" @successSubmit="successSubmit"></add-or-update>
|
||||
</base-dialog>
|
||||
<!-- 弹窗, 日志列表 -->
|
||||
<log v-if="logVisible" ref="log"></log>
|
||||
</div>
|
||||
@@ -73,124 +41,255 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import mixinViewModule from '@/mixins/view-module'
|
||||
import AddOrUpdate from './schedule-add-or-update'
|
||||
import Log from './schedule-log'
|
||||
import basicPage from "@/mixins/basic-page";
|
||||
import AddOrUpdate from "./schedule-add-or-update";
|
||||
import Log from "./schedule-log";
|
||||
import i18n from "@/i18n";
|
||||
import sysFilter from "@/filters/sys-filter";
|
||||
const tableProps = [
|
||||
{
|
||||
prop: "beanName",
|
||||
label: i18n.t("schedule.beanName"),
|
||||
},
|
||||
{
|
||||
prop: "params",
|
||||
label: i18n.t("schedule.params"),
|
||||
},
|
||||
{
|
||||
prop: "cronExpression",
|
||||
label: i18n.t("schedule.cronExpression"),
|
||||
},
|
||||
{
|
||||
prop: "remark",
|
||||
label: i18n.t("schedule.remark"),
|
||||
},
|
||||
{
|
||||
prop: "status",
|
||||
label: i18n.t("schedule.status"),
|
||||
filter: sysFilter("scheduleStatus"),
|
||||
},
|
||||
];
|
||||
const tableBtn = [
|
||||
{
|
||||
type: "edit",
|
||||
btnName: "编辑",
|
||||
},
|
||||
{
|
||||
type: "pause",
|
||||
btnName: "暂停",
|
||||
},
|
||||
{
|
||||
type: "restore",
|
||||
btnName: "恢复",
|
||||
},
|
||||
{
|
||||
type: "run",
|
||||
btnName: "执行",
|
||||
},
|
||||
{
|
||||
type: "delete",
|
||||
btnName: "删除",
|
||||
},
|
||||
];
|
||||
export default {
|
||||
mixins: [mixinViewModule],
|
||||
data () {
|
||||
mixins: [basicPage],
|
||||
data() {
|
||||
return {
|
||||
mixinViewModuleOptions: {
|
||||
getDataListURL: '/sys/schedule/page',
|
||||
getDataListIsPage: true,
|
||||
deleteURL: '/sys/schedule',
|
||||
deleteIsBatch: true
|
||||
urlOptions: {
|
||||
getDataListURL: "/sys/schedule/page",
|
||||
deleteURL: "/sys/schedule",
|
||||
},
|
||||
dataForm: {
|
||||
beanName: ''
|
||||
beanName: "",
|
||||
},
|
||||
logVisible: false
|
||||
}
|
||||
tableProps,
|
||||
tableBtn,
|
||||
addDeleteURL: true,
|
||||
logVisible: false,
|
||||
formConfig: [
|
||||
{
|
||||
type: "input",
|
||||
label: i18n.t("schedule.beanName"),
|
||||
placeholder: i18n.t("schedule.beanName"),
|
||||
param: "beanName",
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
btnName: "查询",
|
||||
name: "search",
|
||||
color: "primary",
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
btnName: "新增",
|
||||
name: "add",
|
||||
color: "primary",
|
||||
plain: true,
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
btnName: "日志",
|
||||
name: "log",
|
||||
color: "success",
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate,
|
||||
Log
|
||||
Log,
|
||||
},
|
||||
methods: {
|
||||
//search-bar点击
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case "search":
|
||||
this.listQuery.beanName = val.beanName;
|
||||
this.listQuery.page = 1;
|
||||
this.getDataList();
|
||||
break;
|
||||
case "add":
|
||||
this.addOrEditTitle = "新增";
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrUpdateHandle();
|
||||
break;
|
||||
case "log":
|
||||
this.logHandle();
|
||||
break;
|
||||
default:
|
||||
console.log(val);
|
||||
}
|
||||
},
|
||||
btnFun(val) {
|
||||
if (val.type === "pause") {
|
||||
this.pauseHandle(val.data.id);
|
||||
} else if (val.type === "restore") {
|
||||
this.resumeHandle(val.data.id);
|
||||
} else {
|
||||
this.runHandle(val.data.id);
|
||||
}
|
||||
},
|
||||
// 暂停
|
||||
pauseHandle (id) {
|
||||
pauseHandle(id) {
|
||||
if (!id && this.dataListSelections.length <= 0) {
|
||||
return this.$message({
|
||||
message: this.$t('prompt.deleteBatch'),
|
||||
type: 'warning',
|
||||
duration: 500
|
||||
})
|
||||
message: this.$t("prompt.deleteBatch"),
|
||||
type: "warning",
|
||||
duration: 500,
|
||||
});
|
||||
}
|
||||
this.$confirm(this.$t('prompt.info', { 'handle': this.$t('schedule.pause') }), this.$t('prompt.title'), {
|
||||
confirmButtonText: this.$t('confirm'),
|
||||
cancelButtonText: this.$t('cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$http.put('/sys/schedule/pause', id ? [id] : this.dataListSelections.map(item => item.id)).then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
this.$message({
|
||||
message: this.$t('prompt.success'),
|
||||
type: 'success',
|
||||
duration: 500,
|
||||
onClose: () => {
|
||||
this.getDataList()
|
||||
}
|
||||
})
|
||||
}).catch(() => {})
|
||||
}).catch(() => {})
|
||||
this.$confirm(
|
||||
this.$t("prompt.info", { handle: this.$t("schedule.pause") }),
|
||||
this.$t("prompt.title"),
|
||||
{
|
||||
confirmButtonText: this.$t("confirm"),
|
||||
cancelButtonText: this.$t("cancel"),
|
||||
type: "warning",
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
this.$http
|
||||
.put("/sys/schedule/pause", id ? [id] : this.dataListSelections.map((item) => item.id))
|
||||
.then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg);
|
||||
}
|
||||
this.$message({
|
||||
message: this.$t("prompt.success"),
|
||||
type: "success",
|
||||
duration: 500,
|
||||
onClose: () => {
|
||||
this.getDataList();
|
||||
},
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
// 恢复
|
||||
resumeHandle (id) {
|
||||
resumeHandle(id) {
|
||||
if (!id && this.dataListSelections.length <= 0) {
|
||||
return this.$message({
|
||||
message: this.$t('prompt.deleteBatch'),
|
||||
type: 'warning',
|
||||
duration: 500
|
||||
})
|
||||
message: this.$t("prompt.deleteBatch"),
|
||||
type: "warning",
|
||||
duration: 500,
|
||||
});
|
||||
}
|
||||
this.$confirm(this.$t('prompt.info', { 'handle': this.$t('schedule.resume') }), this.$t('prompt.title'), {
|
||||
confirmButtonText: this.$t('confirm'),
|
||||
cancelButtonText: this.$t('cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$http.put('/sys/schedule/resume', id ? [id] : this.dataListSelections.map(item => item.id)).then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
this.$message({
|
||||
message: this.$t('prompt.success'),
|
||||
type: 'success',
|
||||
duration: 500,
|
||||
onClose: () => {
|
||||
this.getDataList()
|
||||
}
|
||||
})
|
||||
}).catch(() => {})
|
||||
}).catch(() => {})
|
||||
this.$confirm(
|
||||
this.$t("prompt.info", { handle: this.$t("schedule.resume") }),
|
||||
this.$t("prompt.title"),
|
||||
{
|
||||
confirmButtonText: this.$t("confirm"),
|
||||
cancelButtonText: this.$t("cancel"),
|
||||
type: "warning",
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
this.$http
|
||||
.put("/sys/schedule/resume", id ? [id] : this.dataListSelections.map((item) => item.id))
|
||||
.then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg);
|
||||
}
|
||||
this.$message({
|
||||
message: this.$t("prompt.success"),
|
||||
type: "success",
|
||||
duration: 500,
|
||||
onClose: () => {
|
||||
this.getDataList();
|
||||
},
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
// 执行
|
||||
runHandle (id) {
|
||||
runHandle(id) {
|
||||
if (!id && this.dataListSelections.length <= 0) {
|
||||
return this.$message({
|
||||
message: this.$t('prompt.deleteBatch'),
|
||||
type: 'warning',
|
||||
duration: 500
|
||||
})
|
||||
message: this.$t("prompt.deleteBatch"),
|
||||
type: "warning",
|
||||
duration: 500,
|
||||
});
|
||||
}
|
||||
this.$confirm(this.$t('prompt.info', { 'handle': this.$t('schedule.run') }), this.$t('prompt.title'), {
|
||||
confirmButtonText: this.$t('confirm'),
|
||||
cancelButtonText: this.$t('cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$http.put('/sys/schedule/run', id ? [id] : this.dataListSelections.map(item => item.id)).then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
this.$message({
|
||||
message: this.$t('prompt.success'),
|
||||
type: 'success',
|
||||
duration: 500,
|
||||
onClose: () => {
|
||||
this.getDataList()
|
||||
}
|
||||
})
|
||||
}).catch(() => {})
|
||||
}).catch(() => {})
|
||||
this.$confirm(
|
||||
this.$t("prompt.info", { handle: this.$t("schedule.run") }),
|
||||
this.$t("prompt.title"),
|
||||
{
|
||||
confirmButtonText: this.$t("confirm"),
|
||||
cancelButtonText: this.$t("cancel"),
|
||||
type: "warning",
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
this.$http
|
||||
.put("/sys/schedule/run", id ? [id] : this.dataListSelections.map((item) => item.id))
|
||||
.then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg);
|
||||
}
|
||||
this.$message({
|
||||
message: this.$t("prompt.success"),
|
||||
type: "success",
|
||||
duration: 500,
|
||||
onClose: () => {
|
||||
this.getDataList();
|
||||
},
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
// 日志列表
|
||||
logHandle () {
|
||||
this.logVisible = true
|
||||
logHandle() {
|
||||
this.logVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.log.init()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
this.$refs.log.init();
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -116,8 +116,8 @@ export default {
|
||||
this.$refs.deptListTree.setCheckedKeys(this.dataForm.deptIdList)
|
||||
}).catch(() => {})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmitHandle: debounce(function () {
|
||||
// 表单提交
|
||||
dataFormSubmit: debounce(function () {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (!valid) {
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user