From ed71f845de767f5743ba8360a6ae7f2484fa09b9 Mon Sep 17 00:00:00 2001 From: taojinlong Date: Tue, 3 Aug 2021 11:08:57 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=99=BB=E5=BD=95=E8=BF=87=E6=9C=9F?= =?UTF-8?q?=E5=BC=B9=E6=A1=86->=E9=87=8D=E6=96=B0=E7=99=BB=E5=BD=95?= =?UTF-8?q?=EF=BC=9B=E4=BC=98=E5=8C=96=E4=BB=BB=E5=8A=A1=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/api/dataset/dataset.js | 2 +- frontend/src/lang/en.js | 3 ++- frontend/src/lang/tw.js | 3 ++- frontend/src/lang/zh.js | 3 ++- frontend/src/utils/request.js | 6 +++++- frontend/src/views/system/task/TaskRecord.vue | 15 +++++++++++++-- 6 files changed, 25 insertions(+), 7 deletions(-) diff --git a/frontend/src/api/dataset/dataset.js b/frontend/src/api/dataset/dataset.js index a91a6c7d06..5813b7611c 100644 --- a/frontend/src/api/dataset/dataset.js +++ b/frontend/src/api/dataset/dataset.js @@ -111,7 +111,7 @@ export function batchEdit(data) { }) } -export function post(url, data, showLoading = true, timeout = 10000) { +export function post(url, data, showLoading = true, timeout = 20000) { return request({ url: url, method: 'post', diff --git a/frontend/src/lang/en.js b/frontend/src/lang/en.js index 6946113d10..d69856e896 100644 --- a/frontend/src/lang/en.js +++ b/frontend/src/lang/en.js @@ -126,7 +126,8 @@ export default { expires: 'Login token expired, please login again', tokenError: 'Token error, please login again', username_error: 'Please enter the correct ID', - password_error: 'The password can not be less than 8 digits' + password_error: 'The password can not be less than 8 digits', + re_login: 'Login again' }, commons: { no_target_permission: 'No permission', diff --git a/frontend/src/lang/tw.js b/frontend/src/lang/tw.js index 5e5fe23dba..21a06c5527 100644 --- a/frontend/src/lang/tw.js +++ b/frontend/src/lang/tw.js @@ -126,7 +126,8 @@ export default { expires: '登陸信息過期,請重新登陸', tokenError: '信息錯誤,請重新登陸', username_error: '請輸入正確的 ID', - password_error: '密碼不小於 8 位' + password_error: '密碼不小於 8 位', + re_login: '重新登陸' }, commons: { no_target_permission: '沒有權限', diff --git a/frontend/src/lang/zh.js b/frontend/src/lang/zh.js index 5ed4798003..b542905147 100644 --- a/frontend/src/lang/zh.js +++ b/frontend/src/lang/zh.js @@ -126,7 +126,8 @@ export default { expires: '登录信息过期,请重新登录', tokenError: '登陆信息错误,请重新登录', username_error: '请输入正确的 ID', - password_error: '密码不小于 8 位' + password_error: '密码不小于 8 位', + re_login: '重新登录' }, commons: { no_target_permission: '没有权限', diff --git a/frontend/src/utils/request.js b/frontend/src/utils/request.js index 6a048824f6..814f8d5030 100644 --- a/frontend/src/utils/request.js +++ b/frontend/src/utils/request.js @@ -52,6 +52,10 @@ service.interceptors.request.use( } ) +const defaultOptions = { + confirmButtonText: i18n.t('login.re_login') +} + const checkAuth = response => { // 请根据实际需求修改 @@ -62,7 +66,7 @@ const checkAuth = response => { store.dispatch('user/logout').then(() => { location.reload() }) - }) + }, defaultOptions) } if (response.headers['authentication-status'] === 'invalid') { diff --git a/frontend/src/views/system/task/TaskRecord.vue b/frontend/src/views/system/task/TaskRecord.vue index 632f812247..5ac4a2dd7a 100644 --- a/frontend/src/views/system/task/TaskRecord.vue +++ b/frontend/src/views/system/task/TaskRecord.vue @@ -56,6 +56,7 @@ import ComplexTable from '@/components/business/complex-table' import { formatCondition, formatQuickCondition, addOrder, formatOrders } from '@/utils/index' import '@riophae/vue-treeselect/dist/vue-treeselect.css' import { post } from '@/api/dataset/dataset' +import {loadMenus} from "@/permission"; export default { name: 'TaskRecord', @@ -116,7 +117,8 @@ export default { last_condition: null, show_error_massage: false, error_massage: '', - matchLogId: null + matchLogId: null, + lastRequestComplete: true } }, computed: { @@ -139,7 +141,7 @@ export default { if (!this.timer) { this.timer = setInterval(() => { this.search(this.last_condition, false) - }, 10000) + }, 1000) } }, destroyTimer() { @@ -167,6 +169,12 @@ export default { select(selection) { }, search(condition, showLoading = true) { + if(!this.lastRequestComplete){ + return; + }else { + this.lastRequestComplete = false; + } + this.last_condition = condition condition = formatQuickCondition(condition, 'dataset_table_task.name') const temp = formatCondition(condition) @@ -175,6 +183,9 @@ export default { post('/dataset/taskLog/list/notexcel/' + this.paginationConfig.currentPage + '/' + this.paginationConfig.pageSize, param, showLoading).then(response => { this.data = response.data.listObject this.paginationConfig.total = response.data.itemCount + this.lastRequestComplete = true; + }).catch(() => { + this.lastRequestComplete = true; }) }, showErrorMassage(massage) {