Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
wangjiahao 2022-08-26 11:32:19 +08:00
commit 495fe81801
25 changed files with 450 additions and 251 deletions

View File

@ -3,9 +3,9 @@
## Create pull request
PR are always welcome, even if they only contain small fixes like typos or a few lines of code. If there will be a significant effort, please document it as an issue and get a discussion going before starting to work on it.
Please submit a PR broken down into small changes bit by bit. A PR consisting of a lot features and code changes may be hard to review. It is recommended to submit PRs in an incremental fashion.
Please submit a PR broken down into small changes' bit by bit. A PR consisting of a lot of features and code changes may be hard to review. It is recommended to submit PRs in an incremental fashion.
This [development guideline](https://dataease.io/docs/dev_manual/dev_manual/) contains information about repository structure, how to setup development environment, how to run it, and more.
This [development guideline](https://dataease.io/docs/dev_manual/dev_manual/) contains information about repository structure, how to set up development environment, how to run it, and more.
Note: If you split your pull request to small changes, please make sure any of the changes goes to master will not break anything. Otherwise, it can not be merged until this feature complete.
@ -21,5 +21,5 @@ When reporting issues, always include:
* Steps to reproduce the issue.
* Snapshots or log files if needed
Because the issues are open to the public, when submitting files, be sure to remove any sensitive information, e.g. user name, password, IP address, and company name. You can
Because the issues are open to the public, when submitting files, be sure to remove any sensitive information, e.g. username, password, IP address, and company name. You can
replace those parts with "REDACTED" or other strings like "****".

View File

@ -72,8 +72,8 @@ DataEase 是开源的数据可视化分析工具,帮助用户快速分析数
仅需两步快速安装 DataEase
1. 准备一台不小于 8 G内存的 64位 Linux 主机;
2. 以 root 用户执行如下命令一键安装 DataEase。
1. 准备一台不小于 8 G内存的 64位 Linux 主机;
2. 以 root 用户执行如下命令一键安装 DataEase。
```sh
curl -sSL https://github.com/dataease/dataease/releases/latest/download/quick_start.sh | sh

View File

@ -16,4 +16,4 @@ All security bugs should be reported to the contact as below:
- support@fit2cloud.com
- 400-052-0755
Thanks for you support!
Thanks for your support!

View File

@ -2594,38 +2594,62 @@ public class DataSetTableService {
visitBinaryExpr(andExpression, "AND");
}
@Override
public void visit(Between between) {
if(hasVarible(between.getBetweenExpressionStart().toString()) || hasVarible(between.getBetweenExpressionEnd().toString())){
getBuffer().append(SubstitutedSql);
}else {
getBuffer().append(between.getLeftExpression()).append(" BETWEEN ").append(between.getBetweenExpressionStart()).append(" AND ").append(between.getBetweenExpressionEnd());
}
}
@Override
public void visit(MinorThan minorThan) {
if(hasVarible(minorThan.getLeftExpression().toString()) || hasVarible(minorThan.getRightExpression().toString())){
getBuffer().append(SubstitutedSql);
return;
}
getBuffer().append(minorThan.getLeftExpression());
getBuffer().append(" < ");
getBuffer().append(minorThan.getRightExpression());
getBuffer().append( minorThan.getRightExpression());
}
@Override
public void visit(MinorThanEquals minorThan) {
if(hasVarible(minorThan.getLeftExpression().toString()) || hasVarible(minorThan.getRightExpression().toString())){
getBuffer().append(SubstitutedSql);
return;
}
getBuffer().append(minorThan.getLeftExpression());
getBuffer().append(" <= ");
getBuffer().append(minorThan.getRightExpression());
getBuffer().append( minorThan.getRightExpression());
}
@Override
public void visit(GreaterThanEquals minorThan) {
if(hasVarible(minorThan.getLeftExpression().toString()) || hasVarible(minorThan.getRightExpression().toString())){
getBuffer().append(SubstitutedSql);
return;
}
getBuffer().append(minorThan.getLeftExpression());
getBuffer().append(" >= ");
getBuffer().append(minorThan.getRightExpression());
getBuffer().append( minorThan.getRightExpression());
}
@Override
public void visit(GreaterThan minorThan) {
getBuffer().append(minorThan.getLeftExpression());
public void visit(GreaterThan greaterThan) {
if(hasVarible(greaterThan.getLeftExpression().toString()) || hasVarible(greaterThan.getRightExpression().toString())){
getBuffer().append(SubstitutedSql);
return;
}
getBuffer().append(greaterThan.getLeftExpression());
getBuffer().append(" > ");
getBuffer().append(minorThan.getRightExpression());
getBuffer().append( greaterThan.getRightExpression());
}
@Override
public void visit(ExpressionList expressionList) {
for (Iterator<Expression> iter = expressionList.getExpressions().iterator(); iter.hasNext(); ) {
for (Iterator<Expression> iter = expressionList.getExpressions().iterator(); iter.hasNext();) {
Expression expression = iter.next();
expression.accept(this);
if (iter.hasNext()) {
@ -2634,15 +2658,6 @@ public class DataSetTableService {
}
}
@Override
public void visit(Between between) {
if (hasVarible(between.getBetweenExpressionStart().toString()) || hasVarible(between.getBetweenExpressionEnd().toString())) {
getBuffer().append(SubstitutedSql);
} else {
getBuffer().append(between.getLeftExpression()).append(" BETWEEN ").append(between.getBetweenExpressionStart()).append(" AND ").append(between.getBetweenExpressionEnd());
}
}
@Override
public void visit(LikeExpression likeExpression) {
if (hasVarible(likeExpression.toString())) {
@ -2706,33 +2721,29 @@ public class DataSetTableService {
private void visitBinaryExpr(BinaryExpression expr, String operator) {
boolean hasBinaryExpression = false;
boolean hasSubBinaryExpression = false;
try {
BinaryExpression leftBinaryExpression = (BinaryExpression) expr.getLeftExpression();
hasBinaryExpression = leftBinaryExpression.getLeftExpression() instanceof BinaryExpression;
} catch (Exception e) {
}
hasSubBinaryExpression = leftBinaryExpression.getLeftExpression() instanceof Expression;
} catch (Exception e) {e.printStackTrace();}
if (expr.getLeftExpression() instanceof BinaryExpression && !hasBinaryExpression && hasVarible(expr.getLeftExpression().toString())) {
if (expr.getLeftExpression() instanceof BinaryExpression && !hasSubBinaryExpression && hasVarible(expr.getLeftExpression().toString())) {
getBuffer().append(SubstitutedSql);
} else {
expr.getLeftExpression().accept(this);
}
getBuffer().append(" " + operator + " ");
hasBinaryExpression = false;
hasSubBinaryExpression = false;
try {
BinaryExpression rightBinaryExpression = (BinaryExpression) expr.getRightExpression();
hasBinaryExpression = rightBinaryExpression.getRightExpression() instanceof BinaryExpression;
hasSubBinaryExpression = rightBinaryExpression.getRightExpression() instanceof BinaryExpression;
} catch (Exception e) {
}
if (expr.getRightExpression() instanceof BinaryExpression && !hasBinaryExpression && hasVarible(expr.getRightExpression().toString())) {
if (expr.getRightExpression() instanceof BinaryExpression && !hasSubBinaryExpression && hasVarible(expr.getRightExpression().toString())) {
getBuffer().append(SubstitutedSql);
} else if (expr.getRightExpression() instanceof InExpression && !hasBinaryExpression && hasVarible(expr.getRightExpression().toString())) {
getBuffer().append(SubstitutedSql);
} else {
} else {
expr.getRightExpression().accept(this);
}
}

View File

@ -168,7 +168,10 @@ public class DatasourceService {
JsonObject apiItemStatuses = JsonParser.parseString(datasourceDTO.getStatus()).getAsJsonObject();
for (int i = 0; i < apiDefinitionList.size(); i++) {
String status = apiItemStatuses.get(apiDefinitionList.get(i).getName()).getAsString();
String status = null;
if(apiItemStatuses.get(apiDefinitionList.get(i).getName()) != null){
status = apiItemStatuses.get(apiDefinitionList.get(i).getName()).getAsString();
}
apiDefinitionList.get(i).setStatus(status);
apiDefinitionList.get(i).setSerialNumber(i);
apiDefinitionListWithStatus.add(apiDefinitionList.get(i));

View File

@ -196,7 +196,7 @@ public class SysUserService {
}
/**
* 修改用户密码清缓存
* 修改用户密码清缓存
*
* @param request
* @return

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@ -10,7 +10,7 @@
:collapse-tags="showNumber"
class="el-tree-select-input"
:disabled="disabled"
popper-class="select-option"
popper-class="de-select-option"
v-bind="selectParams"
:popper-append-to-body="popperAppendToBody"
:filterable="false"
@ -531,7 +531,7 @@ export default {
}
</script>
<style>
.el-tree-select .select-option {
.el-tree-select .de-select-option {
display: none !important;
}
.tree-select-all {

View File

@ -114,7 +114,6 @@ export default {
}]
},
value_() {
console.log(9, this.weekVal, this.dVal, this.value)
if (!this.dVal && !this.weekVal) {
return ''
}

View File

@ -1412,7 +1412,7 @@ export default {
edit_field: 'Edit Field',
preview_100_data: 'Show 100 lines data',
invalid_table_check: 'Please sync data first.',
parse_error: 'Parse failed,please check.Referencehttps://dataease.io/docs/faq/dataset_faq/',
parse_error: 'Parse failed,please check.Referencehttps://dataease.io/docs/user_manual/dataset_configuration/dataset_Excel',
origin_field_type: 'Origin Type',
edit_excel_table: 'Edit Excel Dataset',
edit_excel: 'Edit Excel',
@ -1641,6 +1641,7 @@ export default {
has_repeat_name: 'Duplicate API data table name',
has_repeat_field_name: 'The field name is duplicate, please modify it before selecting',
api_field_not_empty: 'Field cannot be empty',
success_copy: 'Copy succeeded',
valid: 'Valid',
invalid: 'Invalid',
api_step_1: 'Connection API',
@ -2341,7 +2342,7 @@ export default {
teaching_video_bottom_hint: 'More videos',
enterprise_edition_hint1: 'Provide enterprise application scenario X-Pack enhancement package',
enterprise_edition_hint2: 'Provide high-level original factory service support',
enterprise_edition_hint3: 'Provide DateEase best practice recommendations',
enterprise_edition_hint3: 'Provide DataEase best practice recommendations',
open_source_community: 'Open source community',
click_show: 'Click To View',
show_more: 'Show More',

View File

@ -1411,7 +1411,7 @@ export default {
edit_field: '編輯字段',
preview_100_data: '顯示前100行數據',
invalid_table_check: '非直連數據集請先完成數據同步',
parse_error: 'Excel解析失敗請檢查格式、字段等信息。具體參考https://dataease.io/docs/faq/dataset_faq/',
parse_error: 'Excel解析失敗請檢查格式、字段等信息。具體參考https://dataease.io/docs/user_manual/dataset_configuration/dataset_Excel',
origin_field_type: '原始類型',
edit_excel_table: '編輯Excel數據集',
edit_excel: '編輯Excel',
@ -1641,6 +1641,7 @@ export default {
has_repeat_name: 'API 數據表名稱重複',
has_repeat_field_name: '欄位名重複,請修改後再選擇',
api_field_not_empty: '欄位不能為空',
success_copy: '複製成功',
valid: '有效',
invalid: '無效',
api_step_1: '連接API',

View File

@ -1412,7 +1412,7 @@ export default {
edit_field: '编辑字段',
preview_100_data: '显示前100行数据',
invalid_table_check: '非直连数据集请先完成数据同步',
parse_error: 'Excel解析失败请检查格式、字段等信息。具体参考https://dataease.io/docs/faq/dataset_faq/',
parse_error: 'Excel解析失败请检查格式、字段等信息。具体参考https://dataease.io/docs/user_manual/dataset_configuration/dataset_Excel',
origin_field_type: '原始类型',
edit_excel_table: '编辑Excel数据集',
edit_excel: '编辑Excel',
@ -1649,6 +1649,7 @@ export default {
has_repeat_name: 'API 数据表名称重复',
has_repeat_field_name: '字段名重复,请修改后再选择',
api_field_not_empty: '字段不能为空',
success_copy: '复制成功',
valid: '有效',
invalid: '无效',
api_step_1: '连接API',

View File

@ -853,7 +853,9 @@ div:focus {
.view-select-option {
display: none !important;
}
.de-select-option {
display: none !important;
}
.el-checkbox__input.is-checked:not(.is-disabled) + .el-checkbox__label {
color: #1F2329 !important;
}

View File

@ -147,6 +147,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')
@ -155,6 +156,7 @@ export default {
} else {
save(this.templateInfo).then((response) => {
this.openMessageSuccess("system_parameter_setting.import_succeeded");
this.$emit("refresh");
this.$emit("closeEditTemplateDialog");
});
}

View File

@ -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;

View File

@ -33,7 +33,9 @@
</div>
<div class="de-tabs-right">
<div v-if="currentTemplateLabel" class="active-template">
{{ currentTemplateLabel }}&nbsp;&nbsp;({{ currentTemplateShowList.length }})
{{ currentTemplateLabel }}&nbsp;&nbsp;({{
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;

View File

@ -1010,8 +1010,21 @@ export default {
copyItem(item){
var newItem = JSON.parse(JSON.stringify(item))
newItem.serialNumber = this.form.apiConfiguration[this.form.apiConfiguration.length - 1].serialNumber + 1
newItem.name = item.name + '_copy'
var reg = new RegExp(item.name + '_copy_' + '([0-9]*)', "gim");
var number = 0
for(var i =1;i<this.form.apiConfiguration.length;i++){
var match = this.form.apiConfiguration[i].name.match(reg);
if (match !== null) {
var num = match[0].substring(this.form.apiConfiguration[i].name.length + 5, match[0].length - 1)
if( parseInt(num) != NaN && parseInt(num) > number){
number = parseInt(num)
}
}
}
number = number + 1
newItem.name = item.name + '_copy_' + number
this.form.apiConfiguration.push(newItem)
this.$message.success(i18n.t('datasource.success_copy'))
},
addApiItem(item) {
if (item) {
@ -1021,7 +1034,7 @@ export default {
} else {
this.add_api_item = true;
this.apiItem = JSON.parse(JSON.stringify(this.defaultApiItem));
this.apiItem.serialNumber = this.form.apiConfiguration[this.form.apiConfiguration.length - 1].serialNumber + 1
this.apiItem.serialNumber = this.form.apiConfiguration.length > 0 ? this.form.apiConfiguration[this.form.apiConfiguration.length - 1].serialNumber + 1 : 0
this.api_table_title = this.$t("datasource.add_api_table");
}
this.active = 1;

View File

@ -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;

View File

@ -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;

View File

@ -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;
}
}

View File

@ -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) {

View File

@ -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 {

View File

@ -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 {