mirror of
https://github.com/dataease/dataease.git
synced 2025-02-25 20:42:55 +08:00
fix: 任务管理 bug修复
This commit is contained in:
parent
89fc43c1d4
commit
58f4ab3ff4
BIN
frontend/src/assets/None.png
Normal file
BIN
frontend/src/assets/None.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.5 KiB |
BIN
frontend/src/assets/None_Select.png
Normal file
BIN
frontend/src/assets/None_Select.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.3 KiB |
BIN
frontend/src/assets/nothing.png
Normal file
BIN
frontend/src/assets/nothing.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.0 KiB |
@ -114,7 +114,6 @@ export default {
|
||||
}]
|
||||
},
|
||||
value_() {
|
||||
console.log(9, this.weekVal, this.dVal, this.value)
|
||||
if (!this.dVal && !this.weekVal) {
|
||||
return ''
|
||||
}
|
||||
|
@ -146,6 +146,7 @@ export default {
|
||||
type: "primary",
|
||||
cb: () => save(this.templateInfo).then((response) => {
|
||||
this.openMessageSuccess("system_parameter_setting.import_succeeded");
|
||||
this.$emit("refresh");
|
||||
this.$emit("closeEditTemplateDialog");
|
||||
}),
|
||||
confirmButtonText: this.$t('template.override')
|
||||
@ -154,6 +155,7 @@ export default {
|
||||
} else {
|
||||
save(this.templateInfo).then((response) => {
|
||||
this.openMessageSuccess("system_parameter_setting.import_succeeded");
|
||||
this.$emit("refresh");
|
||||
this.$emit("closeEditTemplateDialog");
|
||||
});
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ export default {
|
||||
background: #ffffff;
|
||||
border: 1px solid var(--deCardStrokeColor, #dee0e3);
|
||||
border-radius: 4px;
|
||||
margin: 0 25px 25px 0;
|
||||
margin: 0 12.5px 25px 12.5px;
|
||||
.card-img-model {
|
||||
border-bottom: 1px solid var(--deCardStrokeColor, #dee0e3);
|
||||
height: 144px;
|
||||
|
@ -33,7 +33,9 @@
|
||||
</div>
|
||||
<div class="de-tabs-right">
|
||||
<div v-if="currentTemplateLabel" class="active-template">
|
||||
{{ currentTemplateLabel }} ({{ currentTemplateShowList.length }})
|
||||
{{ currentTemplateLabel }} ({{
|
||||
currentTemplateShowList.length
|
||||
}})
|
||||
<deBtn
|
||||
type="primary"
|
||||
@click="templateImport(currentTemplateId)"
|
||||
@ -46,11 +48,15 @@
|
||||
v-if="!currentTemplateShowList.length"
|
||||
description="暂无模版"
|
||||
></el-empty>
|
||||
<div id="template-box" v-show="currentTemplateId !== ''" class="template-box">
|
||||
<div
|
||||
id="template-box"
|
||||
v-show="currentTemplateId !== ''"
|
||||
class="template-box"
|
||||
>
|
||||
<template-item
|
||||
v-for="item in currentTemplateShowList"
|
||||
:key="item.id"
|
||||
:width="templateCurWidth"
|
||||
:width="templateCurWidth"
|
||||
:model="item"
|
||||
@command="(key) => handleCommand(key, item)"
|
||||
/>
|
||||
@ -60,7 +66,7 @@
|
||||
</div>
|
||||
<el-dialog
|
||||
:title="dialogTitle"
|
||||
:visible="editTemplate"
|
||||
:visible.sync="editTemplate"
|
||||
append-to-body
|
||||
class="de-dialog-form"
|
||||
width="600px"
|
||||
@ -71,10 +77,7 @@
|
||||
:model="templateEditForm"
|
||||
:rules="templateEditFormRules"
|
||||
>
|
||||
<el-form-item
|
||||
:label="dialogTitleLabel"
|
||||
prop="name"
|
||||
>
|
||||
<el-form-item :label="dialogTitleLabel" prop="name">
|
||||
<el-input v-model="templateEditForm.name" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@ -97,6 +100,8 @@
|
||||
<template-import
|
||||
v-if="templateDialog.visible"
|
||||
:pid="templateDialog.pid"
|
||||
@refresh="showCurrentTemplate(currentTemplateId,
|
||||
currentTemplateLabel)"
|
||||
@closeEditTemplateDialog="closeEditTemplateDialog"
|
||||
/>
|
||||
</el-dialog>
|
||||
@ -109,10 +114,10 @@ import TemplateList from "./component/TemplateList";
|
||||
import TemplateItem from "./component/TemplateItem";
|
||||
import TemplateImport from "./component/TemplateImport";
|
||||
import { save, templateDelete, find } from "@/api/system/template";
|
||||
import elementResizeDetectorMaker from 'element-resize-detector'
|
||||
import elementResizeDetectorMaker from "element-resize-detector";
|
||||
|
||||
import msgCfm from "@/components/msgCfm/index";
|
||||
import { log } from '@antv/g2plot/lib/utils';
|
||||
import { log } from "@antv/g2plot/lib/utils";
|
||||
export default {
|
||||
name: "PanelMain",
|
||||
mixins: [msgCfm],
|
||||
@ -129,7 +134,7 @@ export default {
|
||||
{
|
||||
required: true,
|
||||
message: this.$t("commons.input_content"),
|
||||
trigger: "change",
|
||||
trigger: "blur",
|
||||
},
|
||||
{
|
||||
max: 50,
|
||||
@ -171,17 +176,20 @@ export default {
|
||||
},
|
||||
mounted() {
|
||||
this.getTree();
|
||||
const _this = this
|
||||
const erd = elementResizeDetectorMaker()
|
||||
const templateMainDom = document.getElementById('template-box')
|
||||
const _this = this;
|
||||
const erd = elementResizeDetectorMaker();
|
||||
const templateMainDom = document.getElementById("template-box");
|
||||
// 监听div变动事件
|
||||
erd.listenTo(templateMainDom, element => {
|
||||
erd.listenTo(templateMainDom, (element) => {
|
||||
_this.$nextTick(() => {
|
||||
const curSeparator = Math.trunc(templateMainDom.offsetWidth / _this.templateMiniWidth)
|
||||
console.log(1, curSeparator)
|
||||
_this.templateCurWidth = Math.trunc(templateMainDom.offsetWidth / curSeparator) - 50
|
||||
})
|
||||
})
|
||||
const curSeparator = Math.trunc(
|
||||
templateMainDom.offsetWidth / _this.templateMiniWidth
|
||||
);
|
||||
console.log(1, curSeparator);
|
||||
_this.templateCurWidth =
|
||||
Math.trunc(templateMainDom.offsetWidth / curSeparator) - 50;
|
||||
});
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
roleValidator(rule, value, callback) {
|
||||
@ -226,11 +234,11 @@ export default {
|
||||
},
|
||||
templateDeleteConfirm(template) {
|
||||
const options = {
|
||||
title: 'system_parameter_setting.delete_this_template',
|
||||
type: "primary",
|
||||
cb: () => this.templateDelete(template.id),
|
||||
};
|
||||
this.handlerConfirm(options);
|
||||
title: "system_parameter_setting.delete_this_template",
|
||||
type: "primary",
|
||||
cb: () => this.templateDelete(template.id),
|
||||
};
|
||||
this.handlerConfirm(options);
|
||||
},
|
||||
handleClick(tab, event) {
|
||||
this.getTree();
|
||||
@ -247,7 +255,7 @@ export default {
|
||||
templateDelete(id) {
|
||||
if (id) {
|
||||
templateDelete(id).then((response) => {
|
||||
this.openMessageSuccess('commons.delete_success');
|
||||
this.openMessageSuccess("commons.delete_success");
|
||||
this.getTree();
|
||||
});
|
||||
}
|
||||
@ -257,7 +265,13 @@ export default {
|
||||
this.formType = type;
|
||||
if (type === "edit") {
|
||||
this.templateEditForm = JSON.parse(JSON.stringify(templateInfo));
|
||||
this.dialogTitle = this.$t(`system_parameter_setting.${"folder" === this.templateEditForm.nodeType ? 'edit_classification' : 'edit_template'}`);
|
||||
this.dialogTitle = this.$t(
|
||||
`system_parameter_setting.${
|
||||
"folder" === this.templateEditForm.nodeType
|
||||
? "edit_classification"
|
||||
: "edit_template"
|
||||
}`
|
||||
);
|
||||
this.originName = this.templateEditForm.label;
|
||||
} else {
|
||||
this.dialogTitle = this.$t("panel.add_category");
|
||||
@ -268,7 +282,13 @@ export default {
|
||||
level: 0,
|
||||
};
|
||||
}
|
||||
this.dialogTitleLabel = this.$t(`system_parameter_setting.${ "folder" === this.templateEditForm.nodeType ? 'classification_name' : 'template_name'}`)
|
||||
this.dialogTitleLabel = this.$t(
|
||||
`system_parameter_setting.${
|
||||
"folder" === this.templateEditForm.nodeType
|
||||
? "classification_name"
|
||||
: "template_name"
|
||||
}`
|
||||
);
|
||||
this.editTemplate = true;
|
||||
},
|
||||
templateEdit(templateInfo) {
|
||||
@ -365,7 +385,7 @@ export default {
|
||||
.de-tabs-right {
|
||||
flex: 1;
|
||||
background: #fff;
|
||||
padding: 24px;
|
||||
padding: 24px 12px 24px 12px;
|
||||
overflow: hidden;
|
||||
|
||||
.template-box {
|
||||
@ -373,6 +393,7 @@ export default {
|
||||
flex-wrap: wrap;
|
||||
overflow-y: auto;
|
||||
box-sizing: border-box;
|
||||
align-content: flex-start;
|
||||
height: calc(100% - 10px);
|
||||
width: 100%;
|
||||
padding-bottom: 24px;
|
||||
|
@ -78,7 +78,7 @@
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-method">
|
||||
<div class="card-method" :class="`btn-${numPlugin}`">
|
||||
<el-upload
|
||||
v-permission="['plugin:upload']"
|
||||
:action="baseUrl + 'api/plugin/update/' + ele.pluginId"
|
||||
@ -96,7 +96,7 @@
|
||||
<i class="el-icon-more"></i>更新
|
||||
</div>
|
||||
</el-upload>
|
||||
<el-divider direction="vertical"></el-divider>
|
||||
<el-divider v-if="numPlugin === 2" direction="vertical"></el-divider>
|
||||
<el-tooltip
|
||||
class="item"
|
||||
effect="dark"
|
||||
@ -134,6 +134,7 @@ import { formatCondition, formatQuickCondition } from "@/utils/index";
|
||||
import { pluginLists, uninstall } from "@/api/system/plugin";
|
||||
import { getToken } from "@/utils/auth";
|
||||
import msgCfm from "@/components/msgCfm/index";
|
||||
import { log } from '@antv/g2plot/lib/utils';
|
||||
export default {
|
||||
components: { DeLayoutContent },
|
||||
mixins: [msgCfm],
|
||||
@ -147,17 +148,22 @@ export default {
|
||||
uploading: false,
|
||||
baseUrl: process.env.VUE_APP_BASE_API,
|
||||
fileList: [],
|
||||
numPlugin: 0,
|
||||
headers: { Authorization: getToken() },
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.search();
|
||||
this.bindKey();
|
||||
this.authValidate()
|
||||
},
|
||||
destroyed() {
|
||||
this.unBindKey();
|
||||
},
|
||||
methods: {
|
||||
authValidate() {
|
||||
this.numPlugin = Number(checkPermission(['plugin:uninstall'])) + Number(checkPermission(['plugin:upload']))
|
||||
},
|
||||
entryKey(event) {
|
||||
const keyCode = event.keyCode;
|
||||
if (keyCode === 13) {
|
||||
@ -264,10 +270,11 @@ export default {
|
||||
flex-wrap: wrap;
|
||||
background-color: var(--MainBG, #f5f6f7);
|
||||
overflow-y: auto;
|
||||
align-content: flex-start;
|
||||
}
|
||||
.de-card-plugin {
|
||||
width: 270px;
|
||||
height: 230px;
|
||||
min-height: 188px;
|
||||
background: #ffffff;
|
||||
border: 1px solid #dee0e3;
|
||||
border-radius: 4px;
|
||||
@ -320,6 +327,10 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
.btn-0 {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.card-info {
|
||||
width: 100%;
|
||||
height: 188px;
|
||||
|
@ -90,9 +90,11 @@
|
||||
>{{ $t("user.clear_filter") }}</el-button
|
||||
>
|
||||
</div>
|
||||
<div class="table-container"
|
||||
<div
|
||||
class="table-container"
|
||||
id="resize-for-filter"
|
||||
:class="[filterTexts.length ? 'table-container-filter' : '']">
|
||||
:class="[filterTexts.length ? 'table-container-filter' : '']"
|
||||
>
|
||||
<grid-table
|
||||
v-loading="$store.getters.loadingMap[$store.getters.currentPath]"
|
||||
:tableData="data"
|
||||
@ -160,7 +162,9 @@
|
||||
:label="$t('dataset.task.last_exec_status')"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span :class="[`de-${scope.row.lastExecStatus}`, 'de-status']"
|
||||
<span
|
||||
v-if="scope.row.lastExecStatus"
|
||||
:class="[`de-${scope.row.lastExecStatus}`, 'de-status']"
|
||||
>{{
|
||||
$t(`dataset.${scope.row.lastExecStatus.toLocaleLowerCase()}`)
|
||||
}}
|
||||
@ -170,6 +174,7 @@
|
||||
@click="showErrorMassage(scope.row.msg)"
|
||||
></i>
|
||||
</span>
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
@ -263,7 +268,6 @@
|
||||
</grid-table>
|
||||
</div>
|
||||
|
||||
|
||||
<keep-alive>
|
||||
<filterUser ref="filterUser" @search="filterDraw"></filterUser>
|
||||
</keep-alive>
|
||||
@ -316,9 +320,7 @@ const columnOptions = [
|
||||
props: "status",
|
||||
},
|
||||
];
|
||||
import {
|
||||
formatOrders,
|
||||
} from "@/utils/index";
|
||||
import { formatOrders } from "@/utils/index";
|
||||
import { datasetTaskList, post } from "@/api/dataset/dataset";
|
||||
import cron from "@/components/cron/cron";
|
||||
import TableSelector from "@/views/chart/view/TableSelector";
|
||||
@ -326,12 +328,18 @@ import { hasDataPermission } from "@/utils/permission";
|
||||
import GridTable from "@/components/gridTable/index.vue";
|
||||
import filterUser from "./filterUser.vue";
|
||||
import msgCfm from "@/components/msgCfm/index";
|
||||
import _ from 'lodash';
|
||||
import _ from "lodash";
|
||||
|
||||
export default {
|
||||
name: "DatasetTaskList",
|
||||
components: { GridTable, cron, filterUser, TableSelector },
|
||||
mixins: [msgCfm],
|
||||
props: {
|
||||
transCondition: {
|
||||
type: Object,
|
||||
default: () => {},
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
nikeName: "",
|
||||
@ -366,7 +374,11 @@ export default {
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.initSearch();
|
||||
const { taskId, name } = this.transCondition;
|
||||
if (taskId) {
|
||||
this.nikeName = name;
|
||||
}
|
||||
this.search();
|
||||
this.timer = setInterval(() => {
|
||||
this.search(false);
|
||||
}, 10000);
|
||||
@ -385,28 +397,30 @@ export default {
|
||||
});
|
||||
},
|
||||
resizeObserver() {
|
||||
this.resizeForFilter = new ResizeObserver(entries => {
|
||||
this.resizeForFilter = new ResizeObserver((entries) => {
|
||||
if (!this.filterTexts.length) return;
|
||||
this.layoutResize();
|
||||
});
|
||||
this.resizeForFilter.observe(document.querySelector('#resize-for-filter'));
|
||||
this.resizeForFilter.observe(
|
||||
document.querySelector("#resize-for-filter")
|
||||
);
|
||||
},
|
||||
layoutResize: _.debounce(function () {
|
||||
this.getScrollStatus()
|
||||
this.getScrollStatus();
|
||||
}, 200),
|
||||
scrollPre() {
|
||||
const dom = document.querySelector('.filter-texts-container');
|
||||
dom.scrollLeft -= 10
|
||||
const dom = document.querySelector(".filter-texts-container");
|
||||
dom.scrollLeft -= 10;
|
||||
if (dom.scrollLeft <= 0) {
|
||||
dom.scrollLeft = 0
|
||||
dom.scrollLeft = 0;
|
||||
}
|
||||
},
|
||||
scrollNext() {
|
||||
const dom = document.querySelector('.filter-texts-container');
|
||||
dom.scrollLeft += 10
|
||||
const width = dom.scrollWidth - dom.offsetWidth
|
||||
const dom = document.querySelector(".filter-texts-container");
|
||||
dom.scrollLeft += 10;
|
||||
const width = dom.scrollWidth - dom.offsetWidth;
|
||||
if (dom.scrollLeft > width) {
|
||||
dom.scrollLeft = width
|
||||
dom.scrollLeft = width;
|
||||
}
|
||||
},
|
||||
clearFilter() {
|
||||
@ -467,6 +481,7 @@ export default {
|
||||
this.handleCurrentChange(1);
|
||||
},
|
||||
search(showLoading = true) {
|
||||
const { taskId, name } = this.transCondition;
|
||||
const param = {
|
||||
orders: formatOrders(this.orderConditions),
|
||||
conditions: [...this.cacheCondition],
|
||||
@ -478,6 +493,13 @@ export default {
|
||||
value: this.nikeName,
|
||||
});
|
||||
}
|
||||
if (taskId && this.nikeName === name) {
|
||||
param.conditions.push({
|
||||
operator: "eq",
|
||||
value: taskId,
|
||||
field: "dataset_table_task.id",
|
||||
});
|
||||
}
|
||||
const { currentPage, pageSize } = this.paginationConfig;
|
||||
datasetTaskList(currentPage, pageSize, param, showLoading).then(
|
||||
(response) => {
|
||||
@ -490,18 +512,22 @@ export default {
|
||||
);
|
||||
},
|
||||
batchDelete() {
|
||||
post("/dataset/task/batchDelete", this.multipleSelection.map(ele => ele.id), false).then(() => {
|
||||
post(
|
||||
"/dataset/task/batchDelete",
|
||||
this.multipleSelection.map((ele) => ele.id),
|
||||
false
|
||||
).then(() => {
|
||||
this.initSearch();
|
||||
this.openMessageSuccess('commons.delete_success');
|
||||
this.openMessageSuccess("commons.delete_success");
|
||||
});
|
||||
},
|
||||
confirmDelete() {
|
||||
const options = {
|
||||
title: '确定删除该任务吗?',
|
||||
type: "primary",
|
||||
cb: this.batchDelete,
|
||||
};
|
||||
this.handlerConfirm(options);
|
||||
title: "确定删除该任务吗?",
|
||||
type: "primary",
|
||||
cb: this.batchDelete,
|
||||
};
|
||||
this.handlerConfirm(options);
|
||||
},
|
||||
taskStatus(item) {
|
||||
post("/dataset/task/lastExecStatus", item, false).then((response) => {
|
||||
@ -552,23 +578,23 @@ export default {
|
||||
)
|
||||
.then(() => {
|
||||
post("/dataset/task/execTask", task).then((response) => {
|
||||
this.initSearch( true);
|
||||
this.initSearch(true);
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
selectDataset(row) {
|
||||
if (row) {
|
||||
const { datasetName, id } = row;
|
||||
const { datasetName, id } = row;
|
||||
this.$router.push({
|
||||
path: '/task-ds-form',
|
||||
path: "/task-ds-form",
|
||||
query: {
|
||||
datasetName,
|
||||
id,
|
||||
}
|
||||
})
|
||||
},
|
||||
});
|
||||
} else {
|
||||
this.$router.push('/task-ds-form')
|
||||
this.$router.push("/task-ds-form");
|
||||
}
|
||||
},
|
||||
disableEdit(task) {
|
||||
@ -592,16 +618,16 @@ export default {
|
||||
},
|
||||
deleteTask(task) {
|
||||
const options = {
|
||||
title: '确定删除该任务吗?',
|
||||
type: "primary",
|
||||
cb: () => {
|
||||
post("/dataset/task/delete/" + task.id, null).then((response) => {
|
||||
this.openMessageSuccess('commons.delete_success');
|
||||
title: "确定删除该任务吗?",
|
||||
type: "primary",
|
||||
cb: () => {
|
||||
post("/dataset/task/delete/" + task.id, null).then((response) => {
|
||||
this.openMessageSuccess("commons.delete_success");
|
||||
this.initSearch();
|
||||
});
|
||||
},
|
||||
};
|
||||
this.handlerConfirm(options);
|
||||
},
|
||||
};
|
||||
this.handlerConfirm(options);
|
||||
},
|
||||
showErrorMassage(massage) {
|
||||
this.show_error_massage = true;
|
||||
@ -694,7 +720,7 @@ span {
|
||||
}
|
||||
|
||||
.mar3 {
|
||||
margin-left: -3px;
|
||||
margin-left: -3px;
|
||||
}
|
||||
}
|
||||
|
||||
@ -750,14 +776,16 @@ span {
|
||||
color: #3370ff;
|
||||
}
|
||||
|
||||
.filter-texts-container::-webkit-scrollbar { display: none; }
|
||||
.filter-texts-container::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.arrow-filter {
|
||||
font-size: 16px;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
cursor: pointer;
|
||||
color: #646A73;
|
||||
color: #646a73;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<div class="dataset-on-time">
|
||||
<div class="dataset-on-time">
|
||||
<el-row class="top-operate">
|
||||
<el-col :span="10">
|
||||
<deBtn secondary @click="exportConfirm" >{{ $t("zip.export") }}</deBtn>
|
||||
<deBtn secondary @click="exportConfirm">{{ $t("zip.export") }}</deBtn>
|
||||
</el-col>
|
||||
<el-col :span="14" class="right-user">
|
||||
<el-input
|
||||
@ -13,8 +13,8 @@
|
||||
clearable
|
||||
ref="search"
|
||||
v-model="nikeName"
|
||||
@blur="initSearch"
|
||||
@clear="initSearch"
|
||||
@blur="clearSearch"
|
||||
@clear="clearSearch"
|
||||
>
|
||||
</el-input>
|
||||
<deBtn
|
||||
@ -31,21 +31,29 @@
|
||||
</el-row>
|
||||
<div class="filter-texts" v-if="filterTexts.length">
|
||||
<span class="sum">{{ paginationConfig.total }}</span>
|
||||
<span class="title">{{$t('user.result_one')}}</span>
|
||||
<span class="title">{{ $t("user.result_one") }}</span>
|
||||
<el-divider direction="vertical"></el-divider>
|
||||
<i @click="scrollPre" v-if="showScroll" class="el-icon-arrow-left arrow-filter"></i>
|
||||
<i
|
||||
@click="scrollPre"
|
||||
v-if="showScroll"
|
||||
class="el-icon-arrow-left arrow-filter"
|
||||
></i>
|
||||
<div class="filter-texts-container">
|
||||
<p class="text" v-for="(ele, index) in filterTexts" :key="ele">
|
||||
{{ ele }} <i @click="clearOneFilter(index)" class="el-icon-close"></i>
|
||||
</p>
|
||||
</div>
|
||||
<i @click="scrollNext" v-if="showScroll" class="el-icon-arrow-right arrow-filter"></i>
|
||||
<i
|
||||
@click="scrollNext"
|
||||
v-if="showScroll"
|
||||
class="el-icon-arrow-right arrow-filter"
|
||||
></i>
|
||||
<el-button
|
||||
type="text"
|
||||
class="clear-btn"
|
||||
icon="el-icon-delete"
|
||||
@click="clearFilter"
|
||||
>{{$t('user.clear_filter')}}</el-button
|
||||
>{{ $t("user.clear_filter") }}</el-button
|
||||
>
|
||||
</div>
|
||||
<div id="resize-for-filter" class="table-container">
|
||||
@ -57,14 +65,24 @@
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
>
|
||||
<el-table-column prop="name" :label="$t('dataset.task_name')">
|
||||
<el-table-column prop="name" :label="$t('dataset.task_name')">
|
||||
<template slot-scope="scope">
|
||||
<span>
|
||||
<el-link :type="matchLogId && scope.row.id === matchLogId ? 'danger': ''" style="font-size: 12px" @click="jumpTask(scope.row)">{{ scope.row.name }}</el-link>
|
||||
<el-link
|
||||
:type="
|
||||
matchLogId && scope.row.id === matchLogId ? 'danger' : ''
|
||||
"
|
||||
style="font-size: 12px"
|
||||
@click="jumpTask(scope.row)"
|
||||
>{{ scope.row.name }}</el-link
|
||||
>
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="datasetName" :label="$t('dataset.task.dataset')" />
|
||||
<el-table-column
|
||||
prop="datasetName"
|
||||
:label="$t('dataset.task.dataset')"
|
||||
/>
|
||||
<el-table-column prop="startTime" :label="$t('dataset.start_time')">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.startTime | timestampFormatDate }}</span>
|
||||
@ -78,22 +96,23 @@
|
||||
|
||||
<el-table-column prop="status" :label="$t('dataset.status')">
|
||||
<template slot-scope="scope">
|
||||
<span :class="[`de-${scope.row.status}`, 'de-status']"
|
||||
>{{
|
||||
$t(`dataset.${scope.row.status.toLocaleLowerCase()}`)
|
||||
}}
|
||||
<span
|
||||
v-if="scope.row.status"
|
||||
:class="[`de-${scope.row.status}`, 'de-status']"
|
||||
>{{ $t(`dataset.${scope.row.status.toLocaleLowerCase()}`) }}
|
||||
<i
|
||||
v-if="scope.row.status === 'Error'"
|
||||
class="el-icon-question"
|
||||
@click="showErrorMassage(scope.row.msg)"
|
||||
></i>
|
||||
</span>
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</grid-table>
|
||||
<keep-alive>
|
||||
<filterUser ref="filterUser" @search="filterDraw"></filterUser>
|
||||
</keep-alive>
|
||||
<filterUser ref="filterUser" @search="filterDraw"></filterUser>
|
||||
</keep-alive>
|
||||
</div>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
@ -104,63 +123,71 @@
|
||||
>
|
||||
<span class="err-msg">{{ error_massage }}</span>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<deBtn secondary @click="show_error_massage = false">{{ $t('dataset.close') }}</deBtn>
|
||||
<deBtn secondary @click="show_error_massage = false">{{
|
||||
$t("dataset.close")
|
||||
}}</deBtn>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {formatCondition, formatOrders, formatQuickCondition} from '@/utils/index'
|
||||
import {exportExcel, post} from '@/api/dataset/dataset'
|
||||
import {
|
||||
formatCondition,
|
||||
formatOrders,
|
||||
formatQuickCondition,
|
||||
} from "@/utils/index";
|
||||
import { exportExcel, post } from "@/api/dataset/dataset";
|
||||
import GridTable from "@/components/gridTable/index.vue";
|
||||
import filterUser from "./filterUserRecord.vue";
|
||||
import _ from 'lodash';
|
||||
import _ from "lodash";
|
||||
|
||||
export default {
|
||||
name: 'TaskRecord',
|
||||
name: "TaskRecord",
|
||||
components: { GridTable, filterUser },
|
||||
props: {
|
||||
param: {
|
||||
type: Object,
|
||||
default: null
|
||||
default: () => {},
|
||||
},
|
||||
transCondition: {
|
||||
type: Object,
|
||||
default: null
|
||||
}
|
||||
default: () => {},
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
columns: [],
|
||||
nikeName: '',
|
||||
nikeName: "",
|
||||
showScroll: false,
|
||||
filterTexts: [],
|
||||
cacheCondition: [],
|
||||
paginationConfig: {
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 0
|
||||
total: 0,
|
||||
},
|
||||
data: [],
|
||||
orderConditions: [],
|
||||
show_error_massage: false,
|
||||
error_massage: '',
|
||||
error_massage: "",
|
||||
matchLogId: null,
|
||||
lastRequestComplete: true
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
lastRequestComplete: true,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
if (this.param !== null && this.param.taskId) {
|
||||
this.matchLogId = this.param.logId || this.matchLogId
|
||||
this.transCondition['dataset_table_task.id'] = {
|
||||
operator: 'eq',
|
||||
value: this.param.taskId
|
||||
}
|
||||
const { taskId: id, name: label } = this.transCondition;
|
||||
if (id) {
|
||||
this.nikeName = label;
|
||||
}
|
||||
this.createTimer()
|
||||
const { taskId, name, logId } = (this.param || {});
|
||||
if (this.param !== null && taskId) {
|
||||
this.matchLogId = logId || this.matchLogId;
|
||||
this.transCondition.taskId = taskId;
|
||||
this.transCondition.name = name;
|
||||
this.nikeName = name;
|
||||
}
|
||||
this.createTimer();
|
||||
},
|
||||
mounted() {
|
||||
this.resizeObserver();
|
||||
@ -174,21 +201,29 @@ export default {
|
||||
},
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.destroyTimer()
|
||||
this.destroyTimer();
|
||||
},
|
||||
methods: {
|
||||
clearSearch() {
|
||||
this.cachId = "";
|
||||
this.$emit("reset");
|
||||
this.initSearch();
|
||||
},
|
||||
exportConfirm() {
|
||||
this.$confirm(this.$t('log.confirm'), '', {
|
||||
confirmButtonText: this.$t('commons.confirm'),
|
||||
cancelButtonText: this.$t('commons.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.exportData()
|
||||
}).catch(() => {
|
||||
// this.$info(this.$t('commons.delete_cancel'))
|
||||
this.$confirm(this.$t("log.confirm"), "", {
|
||||
confirmButtonText: this.$t("commons.confirm"),
|
||||
cancelButtonText: this.$t("commons.cancel"),
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
this.exportData();
|
||||
})
|
||||
.catch(() => {
|
||||
// this.$info(this.$t('commons.delete_cancel'))
|
||||
});
|
||||
},
|
||||
exportData() {
|
||||
const { taskId, name } = this.transCondition;
|
||||
const param = {
|
||||
orders: formatOrders(this.orderConditions),
|
||||
conditions: [...this.cacheCondition],
|
||||
@ -200,16 +235,23 @@ export default {
|
||||
value: this.nikeName,
|
||||
});
|
||||
}
|
||||
exportExcel( param).then(res => {
|
||||
const blob = new Blob([res], { type: 'application/vnd.ms-excel' })
|
||||
const link = document.createElement('a')
|
||||
link.style.display = 'none'
|
||||
link.href = URL.createObjectURL(blob)
|
||||
link.download = 'DataEase' + this.$t('dataset.sync_log') + '.xls'
|
||||
document.body.appendChild(link)
|
||||
link.click()
|
||||
document.body.removeChild(link)
|
||||
})
|
||||
if (taskId && this.nikeName === name) {
|
||||
param.conditions.push({
|
||||
operator: "eq",
|
||||
value: taskId,
|
||||
field: "dataset_table_task.id",
|
||||
});
|
||||
}
|
||||
exportExcel(param).then((res) => {
|
||||
const blob = new Blob([res], { type: "application/vnd.ms-excel" });
|
||||
const link = document.createElement("a");
|
||||
link.style.display = "none";
|
||||
link.href = URL.createObjectURL(blob);
|
||||
link.download = "DataEase" + this.$t("dataset.sync_log") + ".xls";
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
});
|
||||
},
|
||||
getScrollStatus() {
|
||||
this.$nextTick(() => {
|
||||
@ -218,28 +260,30 @@ export default {
|
||||
});
|
||||
},
|
||||
resizeObserver() {
|
||||
this.resizeForFilter = new ResizeObserver(entries => {
|
||||
this.resizeForFilter = new ResizeObserver((entries) => {
|
||||
if (!this.filterTexts.length) return;
|
||||
this.layoutResize();
|
||||
});
|
||||
this.resizeForFilter.observe(document.querySelector('#resize-for-filter'));
|
||||
this.resizeForFilter.observe(
|
||||
document.querySelector("#resize-for-filter")
|
||||
);
|
||||
},
|
||||
layoutResize: _.debounce(function () {
|
||||
this.getScrollStatus()
|
||||
this.getScrollStatus();
|
||||
}, 200),
|
||||
scrollPre() {
|
||||
const dom = document.querySelector('.filter-texts-container');
|
||||
dom.scrollLeft -= 10
|
||||
const dom = document.querySelector(".filter-texts-container");
|
||||
dom.scrollLeft -= 10;
|
||||
if (dom.scrollLeft <= 0) {
|
||||
dom.scrollLeft = 0
|
||||
dom.scrollLeft = 0;
|
||||
}
|
||||
},
|
||||
scrollNext() {
|
||||
const dom = document.querySelector('.filter-texts-container');
|
||||
dom.scrollLeft += 10
|
||||
const width = dom.scrollWidth - dom.offsetWidth
|
||||
const dom = document.querySelector(".filter-texts-container");
|
||||
dom.scrollLeft += 10;
|
||||
const width = dom.scrollWidth - dom.offsetWidth;
|
||||
if (dom.scrollLeft > width) {
|
||||
dom.scrollLeft = width
|
||||
dom.scrollLeft = width;
|
||||
}
|
||||
},
|
||||
clearFilter() {
|
||||
@ -261,14 +305,14 @@ export default {
|
||||
this.initSearch();
|
||||
if (!this.timer) {
|
||||
this.timer = setInterval(() => {
|
||||
this.timerSearch(false)
|
||||
}, 15000)
|
||||
this.timerSearch(false);
|
||||
}, 15000);
|
||||
}
|
||||
},
|
||||
destroyTimer() {
|
||||
if (this.timer) {
|
||||
clearInterval(this.timer)
|
||||
this.timer = null
|
||||
clearInterval(this.timer);
|
||||
this.timer = null;
|
||||
}
|
||||
},
|
||||
handleSizeChange(pageSize) {
|
||||
@ -285,11 +329,11 @@ export default {
|
||||
},
|
||||
timerSearch(showLoading = true) {
|
||||
if (!this.lastRequestComplete) {
|
||||
return
|
||||
return;
|
||||
} else {
|
||||
this.lastRequestComplete = false
|
||||
this.lastRequestComplete = false;
|
||||
}
|
||||
|
||||
const { taskId, name } = this.transCondition;
|
||||
const param = {
|
||||
orders: formatOrders(this.orderConditions),
|
||||
conditions: [...this.cacheCondition],
|
||||
@ -301,15 +345,32 @@ export default {
|
||||
value: this.nikeName,
|
||||
});
|
||||
}
|
||||
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
|
||||
})
|
||||
if (taskId && this.nikeName === name) {
|
||||
param.conditions.push({
|
||||
operator: "eq",
|
||||
value: taskId,
|
||||
field: "dataset_table_task.id",
|
||||
});
|
||||
}
|
||||
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;
|
||||
});
|
||||
},
|
||||
search(condition, showLoading = true) {
|
||||
const { taskId, name } = this.transCondition;
|
||||
const param = {
|
||||
orders: formatOrders(this.orderConditions),
|
||||
conditions: [...this.cacheCondition],
|
||||
@ -321,26 +382,40 @@ export default {
|
||||
value: this.nikeName,
|
||||
});
|
||||
}
|
||||
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
|
||||
})
|
||||
if (taskId && this.nikeName === name) {
|
||||
param.conditions.push({
|
||||
operator: "eq",
|
||||
value: taskId,
|
||||
field: "dataset_table_task.id",
|
||||
});
|
||||
}
|
||||
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;
|
||||
});
|
||||
},
|
||||
showErrorMassage(massage) {
|
||||
this.show_error_massage = true
|
||||
this.error_massage = massage
|
||||
this.show_error_massage = true;
|
||||
this.error_massage = massage;
|
||||
},
|
||||
jumpTask(item) {
|
||||
this.$emit('jumpTask', item)
|
||||
this.$emit("jumpTask", item);
|
||||
},
|
||||
rowClassMethod({ row, rowIndex }) {
|
||||
if (this.matchLogId && this.matchLogId === row.id) {
|
||||
return 'row-match-class'
|
||||
return "row-match-class";
|
||||
}
|
||||
return ''
|
||||
}
|
||||
}
|
||||
}
|
||||
return "";
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
@ -348,10 +423,10 @@ export default {
|
||||
margin: 12px 0;
|
||||
}
|
||||
|
||||
.el-radio{
|
||||
.el-radio {
|
||||
margin-right: 10px;
|
||||
}
|
||||
.el-radio ::v-deep .el-radio__label{
|
||||
.el-radio ::v-deep .el-radio__label {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
@ -367,20 +442,19 @@ export default {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.err-msg{
|
||||
.err-msg {
|
||||
font-size: 12px;
|
||||
word-break:normal;
|
||||
width:auto;
|
||||
display:block;
|
||||
white-space:pre-wrap;
|
||||
word-wrap : break-word ;
|
||||
overflow: hidden ;
|
||||
word-break: normal;
|
||||
width: auto;
|
||||
display: block;
|
||||
white-space: pre-wrap;
|
||||
word-wrap: break-word;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
span{
|
||||
span {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
</style>
|
||||
<style lang="scss" scoped>
|
||||
.dataset-on-time {
|
||||
@ -415,7 +489,7 @@ span{
|
||||
}
|
||||
|
||||
.mar3 {
|
||||
margin-left: -3px;
|
||||
margin-left: -3px;
|
||||
}
|
||||
}
|
||||
|
||||
@ -471,14 +545,16 @@ span{
|
||||
color: #3370ff;
|
||||
}
|
||||
|
||||
.filter-texts-container::-webkit-scrollbar { display: none; }
|
||||
.filter-texts-container::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.arrow-filter {
|
||||
font-size: 16px;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
cursor: pointer;
|
||||
color: #646A73;
|
||||
color: #646a73;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
@ -576,7 +652,7 @@ span{
|
||||
}
|
||||
|
||||
.el-icon-question {
|
||||
color: #646A73;
|
||||
color: #646a73;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
@ -65,18 +65,12 @@ export default {
|
||||
this.task = null;
|
||||
this.transCondition = {};
|
||||
},
|
||||
jumpTaskRecord(task) {
|
||||
this.transCondition["dataset_table_task.id"] = {
|
||||
operator: "eq",
|
||||
value: task.id,
|
||||
};
|
||||
jumpTaskRecord({ id: taskId, name}) {
|
||||
this.transCondition = { taskId, name };
|
||||
this.tabActive = "TaskRecord";
|
||||
},
|
||||
jumpTask(taskRecord) {
|
||||
this.transCondition["dataset_table_task.id"] = {
|
||||
operator: "eq",
|
||||
value: taskRecord.taskId,
|
||||
};
|
||||
jumpTask({ taskId, name }) {
|
||||
this.transCondition = { taskId, name };
|
||||
this.tabActive = "DatasetTaskList";
|
||||
},
|
||||
toMsgShare(routerParam) {
|
||||
|
@ -2,11 +2,12 @@
|
||||
<el-drawer
|
||||
:title="$t('user.filter_method')"
|
||||
:visible.sync="userDrawer"
|
||||
custom-class="user-drawer"
|
||||
custom-class="user-drawer-task"
|
||||
size="680px"
|
||||
v-closePress
|
||||
direction="rtl"
|
||||
>
|
||||
<div class="el-drawer__body-cont">
|
||||
<div class="filter">
|
||||
<span>{{ $t("dataset.datalist") }}</span>
|
||||
<div class="filter-item">
|
||||
@ -125,6 +126,7 @@
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="foot">
|
||||
<el-button class="btn normal" @click="reset">{{
|
||||
$t("commons.reset")
|
||||
@ -205,6 +207,7 @@ export default {
|
||||
this.selectDatasets = [];
|
||||
this.datasetCahe = [];
|
||||
this.selectDatasetsCahe = [];
|
||||
this.$refs.datasetTreeRef.filter();
|
||||
this.$emit("search", [], []);
|
||||
},
|
||||
clearOneFilter(index) {
|
||||
@ -216,6 +219,9 @@ export default {
|
||||
} else {
|
||||
this[ele] = [];
|
||||
}
|
||||
if (ele === 'activeDataset') {
|
||||
this.$refs.datasetTreeRef.filter();
|
||||
}
|
||||
});
|
||||
},
|
||||
statusChange(value, type) {
|
||||
@ -340,7 +346,15 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.user-drawer {
|
||||
.user-drawer-task {
|
||||
|
||||
.el-drawer__body-cont {
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
width: 100%;
|
||||
padding-bottom: 80px;
|
||||
}
|
||||
.el-drawer__header {
|
||||
padding: 16px 24px;
|
||||
margin: 0;
|
||||
@ -439,9 +453,14 @@ export default {
|
||||
|
||||
.foot {
|
||||
position: absolute;
|
||||
right: 24px;
|
||||
bottom: 24px;
|
||||
height: 80px;
|
||||
width: 100%;
|
||||
padding: 24px;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
text-align: right;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0px -1px 4px rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
}
|
||||
.user-popper {
|
||||
|
@ -2,11 +2,13 @@
|
||||
<el-drawer
|
||||
:title="$t('user.filter_method')"
|
||||
:visible.sync="userDrawer"
|
||||
custom-class="user-drawer"
|
||||
custom-class="user-drawer-task"
|
||||
size="680px"
|
||||
v-closePress
|
||||
direction="rtl"
|
||||
>
|
||||
<div class="el-drawer__body-cont">
|
||||
|
||||
<div class="filter">
|
||||
<span>{{ $t("dataset.datalist") }}</span>
|
||||
<div class="filter-item">
|
||||
@ -125,6 +127,7 @@
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="foot">
|
||||
<el-button class="btn normal" @click="reset">{{
|
||||
$t("commons.reset")
|
||||
@ -332,7 +335,16 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.user-drawer {
|
||||
.user-drawer-task {
|
||||
|
||||
.el-drawer__body-cont {
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
width: 100%;
|
||||
padding-bottom: 80px;
|
||||
}
|
||||
|
||||
.el-drawer__header {
|
||||
padding: 16px 24px;
|
||||
margin: 0;
|
||||
@ -431,9 +443,14 @@ export default {
|
||||
|
||||
.foot {
|
||||
position: absolute;
|
||||
right: 24px;
|
||||
bottom: 24px;
|
||||
height: 80px;
|
||||
width: 100%;
|
||||
padding: 24px;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
text-align: right;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0px -1px 4px rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
}
|
||||
.user-popper {
|
||||
|
Loading…
Reference in New Issue
Block a user