Merge branch 'dev' into pr@dev_dataset_source

This commit is contained in:
dataeaseShu 2022-09-28 16:42:01 +08:00
commit 3fbfc1bdce
29 changed files with 841 additions and 727 deletions

View File

@ -258,7 +258,7 @@ public class SysUserController {
}
@PostMapping("/unbindAssist/{type}")
public void unbindAssist(String type) {
public void unbindAssist(@PathVariable("type") String type) {
Boolean valid = StringUtils.equals(WECOM, type) || StringUtils.equals(DINGTALK, type) || StringUtils.equals(LARK, type);
if (!valid) {
@ -275,6 +275,9 @@ public class SysUserController {
if (StringUtils.equals(LARK, type)) {
sysUserAssist.setLarkId(null);
}
if (StringUtils.isBlank(sysUserAssist.getWecomId()) && StringUtils.isBlank(sysUserAssist.getDingtalkId()) && StringUtils.isBlank(sysUserAssist.getLarkId())) {
sysUserService.changeUserFrom(userId, 0);
}
sysUserService.saveAssist(userId, sysUserAssist.getWecomId(), sysUserAssist.getDingtalkId(), sysUserAssist.getLarkId());
}

View File

@ -159,10 +159,12 @@ public class XDingtalkServer {
SysUserEntity userEntity = authUserService.getUserById(Long.parseLong(state));
if (ObjectUtils.isEmpty(userEntity)) {
bindError(response, url, "绑定用户不存在");
return;
}
SysUserAssist sysUserAssist = sysUserService.assistInfo(Long.parseLong(state));
if (ObjectUtils.isNotEmpty(sysUserAssist) && StringUtils.isNotBlank(sysUserAssist.getWecomId())) {
if (ObjectUtils.isNotEmpty(sysUserAssist) && StringUtils.isNotBlank(sysUserAssist.getDingtalkId())) {
bindError(response, url, "目标用户已绑定其他钉钉账号");
return;
}
Boolean isOpen = authUserService.supportDingtalk();
if (!isOpen) {
@ -177,6 +179,7 @@ public class XDingtalkServer {
SysUserEntity sysUserEntity = authUserService.getUserByDingtalkId(userId);
if (null != sysUserEntity) {
bindError(response, url, "当前钉钉账号已绑定其他DE用户");
return;
}
if (ObjectUtils.isEmpty(sysUserAssist)) {
sysUserAssist = new SysUserAssist();

View File

@ -158,10 +158,12 @@ public class XLarkServer {
SysUserEntity userEntity = authUserService.getUserById(Long.parseLong(state));
if (ObjectUtils.isEmpty(userEntity)) {
bindError(response, url, "绑定用户不存在");
return;
}
SysUserAssist sysUserAssist = sysUserService.assistInfo(Long.parseLong(state));
if (ObjectUtils.isNotEmpty(sysUserAssist) && StringUtils.isNotBlank(sysUserAssist.getWecomId())) {
if (ObjectUtils.isNotEmpty(sysUserAssist) && StringUtils.isNotBlank(sysUserAssist.getLarkId())) {
bindError(response, url, "目标用户已绑定其他飞书账号");
return;
}
Boolean isOpen = authUserService.supportLark();
@ -176,6 +178,7 @@ public class XLarkServer {
SysUserEntity sysUserEntity = authUserService.getUserByLarkId(userId);
if (null != sysUserEntity) {
bindError(response, url, "当前飞书账号已绑定其他DE用户");
return;
}
if (ObjectUtils.isEmpty(sysUserAssist)) {

View File

@ -165,15 +165,18 @@ public class XWecomServer {
SysUserEntity userEntity = authUserService.getUserById(Long.parseLong(state));
if (ObjectUtils.isEmpty(userEntity)) {
bindError(response, url, "绑定用户不存在");
return;
}
SysUserAssist sysUserAssist = sysUserService.assistInfo(Long.parseLong(state));
if (ObjectUtils.isNotEmpty(sysUserAssist) && StringUtils.isNotBlank(sysUserAssist.getWecomId())) {
bindError(response, url, "目标用户已绑定其他企业微信账号");
return;
}
Boolean supportWecom = authUserService.supportWecom();
if (!supportWecom) {
DEException.throwException("未开启企业微信");
return;
}
wecomXpackService = SpringContextUtil.getBean(WecomXpackService.class);
WecomAuthResult authResult = wecomXpackService.auth(code);
@ -183,6 +186,7 @@ public class XWecomServer {
SysUserEntity sysUserEntity = authUserService.getUserByWecomId(userId);
if (null != sysUserEntity) {
bindError(response, url, "当前企业微信账号已绑定其他DE用户");
return;
}
if (ObjectUtils.isEmpty(sysUserAssist)) {
sysUserAssist = new SysUserAssist();

View File

@ -204,6 +204,19 @@ public class DataSetTableService {
excelSheetData.setData(null);
excelSheetData.setJsonArray(null);
});
}
for (String s : map.keySet()) {
DataSetTableRequest sheetTable = new DataSetTableRequest();
BeanUtils.copyBean(sheetTable, datasetTable);
sheetTable.setId(UUID.randomUUID().toString());
sheetTable.setCreateBy(AuthUtils.getUser().getUsername());
sheetTable.setCreateTime(System.currentTimeMillis());
List<ExcelSheetData> excelSheetDataList = map.get(s);
sheetTable.setName(excelSheetDataList.get(0).getDatasetName());
excelSheetDataList.forEach(excelSheetData -> {
excelSheetData.setData(null);
excelSheetData.setJsonArray(null);
});
DataTableInfoDTO info = new DataTableInfoDTO();
info.setExcelSheetDataList(excelSheetDataList);
sheetTable.setInfo(new Gson().toJson(info));
@ -225,6 +238,9 @@ public class DataSetTableService {
if (checkIsRepeat(fieldArray)) {
DataEaseException.throwException(Translator.get("i18n_excel_field_repeat"));
}
}
for (ExcelSheetData sheet : datasetTable.getSheets()) {
DataSetTableRequest sheetTable = new DataSetTableRequest();
BeanUtils.copyBean(sheetTable, datasetTable);
sheetTable.setId(UUID.randomUUID().toString());

View File

@ -529,7 +529,7 @@ public class SysUserService {
public boolean needPwdNoti(Long userId) {
SysUserAssist userAssist = sysUserAssistMapper.selectByPrimaryKey(userId);
return ObjectUtils.isEmpty(userAssist) || userAssist.getNeedFirstNoti();
return ObjectUtils.isEmpty(userAssist) || ObjectUtils.isEmpty(userAssist.getNeedFirstNoti()) || userAssist.getNeedFirstNoti();
}
public void saveUserAssist(Boolean noti) {
@ -567,4 +567,11 @@ public class SysUserService {
return sysUserAssistMapper.selectByPrimaryKey(userId);
}
public void changeUserFrom(Long userId, Integer from) {
SysUser sysUser = new SysUser();
sysUser.setUserId(userId);
sysUser.setFrom(from);
sysUserMapper.updateByPrimaryKeySelective(sysUser);
}
}

View File

@ -193,6 +193,7 @@ export default {
])
},
created() {
eventBus.$on('editPanelInitReady', this.editPanelInit)
eventBus.$on('preview', this.preview)
eventBus.$on('save', this.save)
eventBus.$on('clearCanvas', this.clearCanvas)
@ -205,10 +206,14 @@ export default {
eventBus.$off('preview', this.preview)
eventBus.$off('save', this.save)
eventBus.$off('clearCanvas', this.clearCanvas)
eventBus.$off('editPanelInitReady', this.editPanelInit)
clearInterval(this.timer)
this.timer = null
},
methods: {
editPanelInit(){
this.showGridSwitch = this.canvasStyleData.aidedDesign.showGrid
},
close() {
//
this.$store.commit('initCanvasBase')

View File

@ -1,6 +1,7 @@
import { sin, cos } from '@/components/canvas/utils/translate'
import store from '@/store'
import Vue from 'vue'
export const LIGHT_THEME_COLOR_MAIN = '#000000'
export const LIGHT_THEME_COLOR_SLAVE1 = '#CCCCCC'
export const LIGHT_THEME_PANEL_BACKGROUND = '#F1F3F5'
@ -35,6 +36,9 @@ export function getStyle(style, filter = []) {
if (key === 'backgroundColor') {
result[key] = colorRgb(style[key], style.opacity)
}
if (key === 'fontSize' && result[key] < 12) {
result[key] = 12
}
if (needUnit.includes(key)) {
result[key] += 'px'
}

View File

@ -1,4 +1 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M4.83301 1.33301C5.10915 1.33301 5.33301 1.55687 5.33301 1.83301V1.99967H10.6663V1.83301C10.6663 1.55687 10.8902 1.33301 11.1663 1.33301H11.4997C11.7758 1.33301 11.9997 1.55687 11.9997 1.83301V1.99967H13.9997C14.3679 1.99967 14.6663 2.29815 14.6663 2.66634V13.9997C14.6663 14.3679 14.3679 14.6663 13.9997 14.6663H1.99967C1.63148 14.6663 1.33301 14.3679 1.33301 13.9997L1.33301 2.66634C1.33301 2.29815 1.63148 1.99967 1.99967 1.99967H3.99967V1.83301C3.99967 1.55687 4.22353 1.33301 4.49967 1.33301H4.83301ZM10.6663 3.33301H5.33301V3.49967C5.33301 3.77582 5.10915 3.99967 4.83301 3.99967H4.49967C4.22353 3.99967 3.99967 3.77582 3.99967 3.49967V3.33301H2.66634V13.333H13.333V3.33301H11.9997V3.49967C11.9997 3.77582 11.7758 3.99967 11.4997 3.99967H11.1663C10.8902 3.99967 10.6663 3.77582 10.6663 3.49967V3.33301ZM5.99967 6.83301C5.99967 6.55687 5.77582 6.33301 5.49967 6.33301H4.49967C4.22353 6.33301 3.99967 6.55687 3.99967 6.83301V7.83301C3.99967 8.10915 4.22353 8.33301 4.49967 8.33301H5.49967C5.77582 8.33301 5.99967 8.10915 5.99967 7.83301V6.83301ZM6.99967 6.83301C6.99967 6.55687 7.22353 6.33301 7.49967 6.33301H8.49967C8.77582 6.33301 8.99967 6.55687 8.99967 6.83301V7.83301C8.99967 8.10915 8.77582 8.33301 8.49967 8.33301H7.49967C7.22353 8.33301 6.99967 8.10915 6.99967 7.83301V6.83301ZM5.99967 9.83301C5.99967 9.55687 5.77582 9.33301 5.49967 9.33301H4.49967C4.22353 9.33301 3.99967 9.55687 3.99967 9.83301V10.833C3.99967 11.1092 4.22353 11.333 4.49967 11.333H5.49967C5.77582 11.333 5.99967 11.1092 5.99967 10.833V9.83301ZM6.99967 9.83301C6.99967 9.55687 7.22353 9.33301 7.49967 9.33301H8.49967C8.77582 9.33301 8.99967 9.55687 8.99967 9.83301V10.833C8.99967 11.1092 8.77582 11.333 8.49967 11.333H7.49967C7.22353 11.333 6.99967 11.1092 6.99967 10.833V9.83301ZM11.9997 6.83301C11.9997 6.55687 11.7758 6.33301 11.4997 6.33301H10.4997C10.2235 6.33301 9.99967 6.55687 9.99967 6.83301V7.83301C9.99967 8.10915 10.2235 8.33301 10.4997 8.33301H11.4997C11.7758 8.33301 11.9997 8.10915 11.9997 7.83301V6.83301Z" fill="#3370FF"/>
<path d="M11.9997 9.83301C11.9997 9.55687 11.7758 9.33301 11.4997 9.33301H10.4997C10.2235 9.33301 9.99967 9.55687 9.99967 9.83301V10.833C9.99967 11.1092 10.2235 11.333 10.4997 11.333H11.4997C11.7758 11.333 11.9997 11.1092 11.9997 10.833V9.83301Z" fill="#3370FF"/>
</svg>
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1664337058571" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1356" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M309.312 85.312a32 32 0 0 1 32 32V128h341.312v-10.688a32 32 0 0 1 32-32h21.376a32 32 0 0 1 32 32V128h128c23.552 0 42.624 19.072 42.624 42.624V896a42.688 42.688 0 0 1-42.624 42.624H128A42.688 42.688 0 0 1 85.312 896V170.624C85.312 147.072 104.384 128 128 128h128v-10.688a32 32 0 0 1 32-32h21.312z m373.312 128H341.312V224a32 32 0 0 1-32 32H288a32 32 0 0 1-32-32v-10.688H170.624v640h682.688v-640H768V224a32 32 0 0 1-32 32h-21.376a32 32 0 0 1-32-32v-10.688zM384 437.312a32 32 0 0 0-32-32h-64a32 32 0 0 0-32 32v64a32 32 0 0 0 32 32h64a32 32 0 0 0 32-32v-64z m64 0a32 32 0 0 1 32-32h64a32 32 0 0 1 32 32v64a32 32 0 0 1-32 32h-64a32 32 0 0 1-32-32v-64z m-64 192a32 32 0 0 0-32-32h-64a32 32 0 0 0-32 32v64a32 32 0 0 0 32 32h64a32 32 0 0 0 32-32v-64z m64 0a32 32 0 0 1 32-32h64a32 32 0 0 1 32 32v64a32 32 0 0 1-32 32h-64a32 32 0 0 1-32-32v-64z m320-192a32 32 0 0 0-32-32h-64a32 32 0 0 0-32 32v64a32 32 0 0 0 32 32h64a32 32 0 0 0 32-32v-64z" p-id="1357"></path><path d="M768 629.312a32 32 0 0 0-32-32h-64a32 32 0 0 0-32 32v64a32 32 0 0 0 32 32h64a32 32 0 0 0 32-32v-64z" p-id="1358"></path></svg>

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -1656,7 +1656,11 @@ export default {
sql_ds_union_error: 'Direct connect SQL dataset can not be union',
api_data: 'API dataset',
copy: 'Copy',
sync_log: 'Sync log'
sync_log: 'Sync log',
field_edit_name: 'Field Name',
input_edit_name: 'Input field name',
edit_search: 'Search by name',
na: 'None'
},
driver: {
driver: 'Driver',

View File

@ -1656,7 +1656,11 @@ export default {
sql_ds_union_error: '直連模式下SQL數據集不支持關聯',
api_data: 'API 數據集',
copy: '復製',
sync_log: '同步日誌'
sync_log: '同步日誌',
field_edit_name: '字段名稱',
input_edit_name: '請輸入字段名稱',
edit_search: '通過名稱搜索',
na: '暫無'
},
driver: {
driver: '驅動',

View File

@ -1655,7 +1655,11 @@ export default {
sql_ds_union_error: '直连模式下SQL数据集不支持关联',
api_data: 'API 数据集',
copy: '复制',
sync_log: '同步日志'
sync_log: '同步日志',
field_edit_name: '字段名称',
input_edit_name: '请输入字段名称',
edit_search: '通过名称搜索',
na: '暂无'
},
driver: {
driver: '驱动',

View File

@ -302,7 +302,7 @@ div:focus {
.field-icon-time {
@extend %field-icon;
color: #faaa39;
color: #3370FF;
}
.field-icon-value {
@ -322,6 +322,14 @@ div:focus {
margin: 0 2px 1px 0;
}
.field-icon-dimension{
color: #3370FF!important;
}
.field-icon-quota{
color: #04B49C!important;
}
.ds-icon-pdf {
width: 20px;
height: 20px;

View File

@ -274,9 +274,11 @@ export function seniorCfg(chart_option, chart) {
}
}
// begin mark line settings
chart_option.series[0].markLine = {
symbol: 'none',
data: []
if (chart_option.series && chart_option.series.length > 0) {
chart_option.series[0].markLine = {
symbol: 'none',
data: []
}
}
if (senior.assistLine && senior.assistLine.length > 0) {
if (chart_option.series && chart_option.series.length > 0) {

View File

@ -124,7 +124,7 @@ export default {
addLine() {
const obj = { ...this.lineObj,
curField: this.quotaData ? this.quotaData[0] : null,
fieldId: this.quotaData ? this.quotaData[0].id : null
fieldId: this.quotaData ? this.quotaData[0]?.id : null
}
this.lineArr.push(JSON.parse(JSON.stringify(obj)))
this.changeAssistLine()

View File

@ -2,8 +2,8 @@
<el-row>
<el-form ref="form" :model="fieldForm" size="mini" class="row-style">
<el-form-item>
<span style="width: 80px;font-size: 12px">{{ $t('dataset.field_name') }}</span>
<el-input v-model="fieldForm.name" style="width: 80%;" size="mini" :placeholder="$t('dataset.input_name')" />
<span style="width: 80px;font-size: 12px">{{ $t('dataset.field_edit_name') }}</span>
<el-input v-model="fieldForm.name" style="width: 80%;" size="mini" :placeholder="$t('dataset.input_edit_name')" />
</el-form-item>
</el-form>
@ -94,13 +94,14 @@
<el-input
v-model="searchField"
size="mini"
:placeholder="$t('dataset.search')"
:placeholder="$t('dataset.edit_search')"
prefix-icon="el-icon-search"
clearable
/>
<div class="field-height">
<span>{{ $t('chart.dimension') }}</span>
<draggable
v-if="dimensionData && dimensionData.length > 0"
v-model="dimensionData"
:options="{group:{name: 'drag',pull:'clone'},sort: true}"
animation="300"
@ -127,10 +128,12 @@
</span>
</transition-group>
</draggable>
<div v-else class="class-na">{{ $t('dataset.na') }}</div>
</div>
<div class="field-height">
<span>{{ $t('chart.quota') }}</span>
<draggable
v-if="quotaData && quotaData.length > 0"
v-model="quotaData"
:options="{group:{name: 'drag',pull:'clone'},sort: true}"
animation="300"
@ -157,6 +160,7 @@
</span>
</transition-group>
</draggable>
<div v-else class="class-na">{{ $t('dataset.na') }}</div>
</div>
</el-col>
<el-col :span="12" style="height: 100%" class="padding-lr">
@ -176,7 +180,7 @@
<el-input
v-model="searchFunction"
size="mini"
:placeholder="$t('dataset.search')"
:placeholder="$t('dataset.edit_search')"
prefix-icon="el-icon-search"
clearable
/>
@ -670,4 +674,11 @@ span {
float: right;
margin-top: 10px;
}
.class-na {
margin-top: 8px;
text-align: center;
font-size: 14px;
color: var(--deTextDisable);
}
</style>

View File

@ -1,11 +1,11 @@
<template>
<div class="calcu-feild">
<el-form ref="form" :model="fieldForm" class="de-form-item">
<el-form-item :label="$t('dataset.field_name')">
<el-form-item :label="$t('dataset.field_edit_name')">
<el-input
v-model="fieldForm.name"
size="small"
:placeholder="$t('dataset.input_name')"
:placeholder="$t('dataset.input_edit_name')"
/>
</el-form-item>
</el-form>
@ -19,7 +19,7 @@
<el-tooltip class="item" effect="dark" placement="bottom">
<div slot="content">
表达式语法请遵循该数据源对应的数据库语法
<br />
<br>
数据集中不支持聚合运算
</div>
<i class="el-icon-info" style="cursor: pointer" />
@ -51,8 +51,7 @@
:key="item.value"
v-model="fieldForm.deType"
:label="item.value"
>{{ item.label }}</el-radio
>
>{{ item.label }}</el-radio>
</el-form-item>
</el-form>
</el-row>
@ -64,9 +63,9 @@
<el-tooltip class="item" effect="dark" placement="bottom">
<div slot="content">
引用字段以 "[" 开始 "]" 结束
<br />
<br>
请勿修改引用内容否则将引用失败
<br />
<br>
若输入与引用字段相同格式的内容将被当作引用字段处理
</div>
<i class="el-icon-info" style="cursor: pointer" />
@ -75,7 +74,7 @@
<el-input
v-model="searchField"
size="small"
:placeholder="$t('dataset.search')"
:placeholder="$t('dataset.edit_search')"
prefix-icon="el-icon-search"
style="margin-bottom: 12px"
clearable
@ -83,6 +82,7 @@
<div class="field-height">
<span>{{ $t('chart.dimension') }}</span>
<draggable
v-if="dimensionData && dimensionData.length > 0"
v-model="dimensionData"
:options="{ group: { name: 'drag', pull: 'clone' }, sort: true }"
animation="300"
@ -121,10 +121,12 @@
</span>
</transition-group>
</draggable>
<div v-else class="class-na">{{ $t('dataset.na') }}</div>
</div>
<div class="field-height">
<span>{{ $t('chart.quota') }}</span>
<draggable
v-if="quotaData && quotaData.length > 0"
v-model="quotaData"
:options="{ group: { name: 'drag', pull: 'clone' }, sort: true }"
animation="300"
@ -163,6 +165,7 @@
</span>
</transition-group>
</draggable>
<div v-else class="class-na">{{ $t('dataset.na') }}</div>
</div>
</div>
<div class="padding-lr">
@ -171,9 +174,9 @@
<el-tooltip class="item" effect="dark" placement="bottom">
<div slot="content">
使用数据集对应数据库类型所支持的函数语法同对应数据库
<br />
<br>
如日期格式化MySQL使用DATE_FORMAT(date,format)Oracle使用TO_DATE(X,[,fmt])
<br />
<br>
非直连模式数据集使用Doris数据库函数可参考Doris官网
https://doris.apache.org/zh-CN/
</div>
@ -184,7 +187,7 @@
v-model="searchFunction"
size="small"
style="margin-bottom: 12px"
:placeholder="$t('dataset.search')"
:placeholder="$t('dataset.edit_search')"
prefix-icon="el-icon-search"
clearable
/>
@ -205,8 +208,7 @@
slot="reference"
class="function-style"
@click="insertParamToCodeMirror(item.func)"
>{{ item.func }}</span
>
>{{ item.func }}</span>
</el-popover>
</el-row>
</div>
@ -221,8 +223,7 @@
:loading="loading"
type="primary"
@click="saveCalcField"
>{{ $t('dataset.confirm') }}</deBtn
>
>{{ $t('dataset.confirm') }}</deBtn>
</div>
</div>
</template>
@ -326,16 +327,16 @@ export default {
}
},
watch: {
param: function () {
param: function() {
this.initFunctions()
},
field: {
handler: function () {
handler: function() {
this.initField()
},
deep: true
},
tableFields: function () {
tableFields: function() {
this.dimensionData = JSON.parse(
JSON.stringify(this.tableFields.dimensionList)
).filter((ele) => ele.extField === 0)
@ -343,7 +344,7 @@ export default {
JSON.stringify(this.tableFields.quotaList)
).filter((ele) => ele.extField === 0)
},
searchField: function (val) {
searchField: function(val) {
if (val && val !== '') {
this.dimensionData = JSON.parse(
JSON.stringify(
@ -374,7 +375,7 @@ export default {
).filter((ele) => ele.extField === 0)
}
},
searchFunction: function (val) {
searchFunction: function(val) {
if (val && val !== '') {
this.functionData = JSON.parse(
JSON.stringify(
@ -563,10 +564,10 @@ export default {
box-sizing: border-box;
margin-left: 12px;
width: 214px;
overflow-y: auto;
overflow-y: hidden;
}
.field-height {
height: calc(50% - 25px);
height: calc(50% - 41px);
margin-top: 4px;
}
.drag-list {
@ -673,7 +674,7 @@ export default {
background: var(--ContentBG);
}
.function-height {
height: calc(100% - 50px);
height: calc(100% - 21px - 32px - 4px - 24px);
overflow: auto;
margin-top: 4px;
}
@ -689,6 +690,13 @@ export default {
margin: 6px 0 0 0;
font-size: 10px;
}
.class-na {
margin-top: 8px;
text-align: center;
font-size: 14px;
color: var(--deTextDisable);
}
</style>
<style lang="scss">
@ -714,4 +722,4 @@ export default {
display: inline-block;
}
}
</style>
</style>

View File

@ -146,22 +146,22 @@
<svg-icon
v-if="item.value === 0"
icon-class="field_text"
class="field-icon-text"
class="field-icon-text field-icon-dimension"
/>
<svg-icon
v-if="item.value === 1"
icon-class="field_time"
class="field-icon-time"
class="field-icon-time field-icon-dimension"
/>
<svg-icon
v-if="item.value === 2 || item.value === 3"
icon-class="field_value"
class="field-icon-value"
class="field-icon-value field-icon-dimension"
/>
<svg-icon
v-if="item.value === 5"
icon-class="field_location"
class="field-icon-location"
class="field-icon-location field-icon-dimension"
/>
</span>
<span style="float: left; color: #8492a6; font-size: 12px">{{
@ -174,28 +174,28 @@
<svg-icon
v-if="scope.row.deType === 0 || scope.row.deType === 6"
icon-class="field_text"
class="field-icon-text"
class="field-icon-text field-icon-dimension"
/>
</span>
<span v-if="scope.row.deType === 1">
<svg-icon
v-if="scope.row.deType === 1"
icon-class="field_time"
class="field-icon-time"
class="field-icon-time field-icon-dimension"
/>
</span>
<span v-if="scope.row.deType === 2 || scope.row.deType === 3">
<svg-icon
v-if="scope.row.deType === 2 || scope.row.deType === 3"
icon-class="field_value"
class="field-icon-value"
class="field-icon-value field-icon-dimension"
/>
</span>
<span v-if="scope.row.deType === 5">
<svg-icon
v-if="scope.row.deType === 5"
icon-class="field_location"
class="field-icon-location"
class="field-icon-location field-icon-dimension"
/>
</span>
</span>
@ -220,7 +220,7 @@
scope.row.deExtractType === 6
"
icon-class="field_text"
class="field-icon-text"
class="field-icon-text field-icon-dimension"
/>
<span class="field-class">{{ $t('dataset.text') }}</span>
</span>
@ -228,7 +228,7 @@
<svg-icon
v-if="scope.row.deExtractType === 1"
icon-class="field_time"
class="field-icon-time"
class="field-icon-time field-icon-dimension"
/>
<span class="field-class">{{ $t('dataset.time') }}</span>
</span>
@ -246,7 +246,7 @@
scope.row.deExtractType === 4
"
icon-class="field_value"
class="field-icon-value"
class="field-icon-value field-icon-dimension"
/>
<span
v-if="
@ -268,7 +268,7 @@
<svg-icon
v-if="scope.row.deExtractType === 5"
icon-class="field_location"
class="field-icon-location"
class="field-icon-location field-icon-dimension"
/>
<span class="field-class">{{ $t('dataset.location') }}</span>
</span>
@ -464,22 +464,22 @@
<svg-icon
v-if="item.value === 0"
icon-class="field_text"
class="field-icon-text"
class="field-icon-text field-icon-quota"
/>
<svg-icon
v-if="item.value === 1"
icon-class="field_time"
class="field-icon-time"
class="field-icon-time field-icon-quota"
/>
<svg-icon
v-if="item.value === 2 || item.value === 3"
icon-class="field_value"
class="field-icon-value"
class="field-icon-value field-icon-quota"
/>
<svg-icon
v-if="item.value === 5"
icon-class="field_location"
class="field-icon-location"
class="field-icon-location field-icon-quota"
/>
</span>
<span style="float: left; color: #8492a6; font-size: 12px">{{
@ -492,28 +492,28 @@
<svg-icon
v-if="scope.row.deType === 0"
icon-class="field_text"
class="field-icon-text"
class="field-icon-text field-icon-quota"
/>
</span>
<span v-if="scope.row.deType === 1">
<svg-icon
v-if="scope.row.deType === 1"
icon-class="field_time"
class="field-icon-time"
class="field-icon-time field-icon-quota"
/>
</span>
<span v-if="scope.row.deType === 2 || scope.row.deType === 3">
<svg-icon
v-if="scope.row.deType === 2 || scope.row.deType === 3"
icon-class="field_value"
class="field-icon-value"
class="field-icon-value field-icon-quota"
/>
</span>
<span v-if="scope.row.deType === 5">
<svg-icon
v-if="scope.row.deType === 5"
icon-class="field_location"
class="field-icon-location"
class="field-icon-location field-icon-quota"
/>
</span>
</span>
@ -530,7 +530,7 @@
<svg-icon
v-if="scope.row.deExtractType === 0"
icon-class="field_text"
class="field-icon-text"
class="field-icon-text field-icon-quota"
/>
<span class="field-class">{{ $t('dataset.text') }}</span>
</span>
@ -538,7 +538,7 @@
<svg-icon
v-if="scope.row.deExtractType === 1"
icon-class="field_time"
class="field-icon-time"
class="field-icon-time field-icon-quota"
/>
<span class="field-class">{{ $t('dataset.time') }}</span>
</span>
@ -556,7 +556,7 @@
scope.row.deExtractType === 4
"
icon-class="field_value"
class="field-icon-value"
class="field-icon-value field-icon-quota"
/>
<span
v-if="
@ -578,7 +578,7 @@
<svg-icon
v-if="scope.row.deExtractType === 5"
icon-class="field_location"
class="field-icon-location"
class="field-icon-location field-icon-quota"
/>
<span class="field-class">{{ $t('dataset.location') }}</span>
</span>
@ -1098,4 +1098,4 @@ span {
transform: translate(-50%, -50%);
}
}
</style>
</style>

View File

@ -2,74 +2,73 @@
<el-row style="text-align: left">
<el-row class="top-operate">
<el-col :span="12">
<el-button v-show="position==='templateLog'"
<el-button
v-show="position==='templateLog'"
class="btn"
type="primary"
icon="el-icon-plus"
@click="applyNew()"
>{{$t('commons.create')}}</el-button>
>{{ $t('commons.create') }}</el-button>
<span>&nbsp;</span>
</el-col>
<el-col :span="12" class="right-user">
<el-input
ref="search"
v-model="nickName"
:placeholder="$t('app_template.search_by_keyword')"
prefix-icon="el-icon-search"
class="name-email-search"
size="small"
clearable
ref="search"
v-model="nikeName"
@blur="initSearch"
@clear="initSearch"
>
</el-input>
/>
<deBtn
:secondary="!cacheCondition.length"
:plain="!!cacheCondition.length"
icon="iconfont icon-icon-filter"
@click="filterShow"
>{{ $t("user.filter")
}}<template v-if="filterTexts.length">
({{ cacheCondition.length }})
</template>
>{{ $t("user.filter")
}}<template v-if="filterTexts.length">
({{ cacheCondition.length }})
</template>
</deBtn>
</el-col>
</el-row>
<div class="filter-texts" v-if="filterTexts.length">
<div v-if="filterTexts.length" class="filter-texts">
<span class="sum">{{ paginationConfig.total }}</span>
<span class="title">{{ $t("user.result_one") }}</span>
<el-divider direction="vertical"></el-divider>
<el-divider direction="vertical" />
<i
@click="scrollPre"
v-if="showScroll"
class="el-icon-arrow-left arrow-filter"
></i>
@click="scrollPre"
/>
<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 v-for="(ele, index) in filterTexts" :key="ele" class="text">
{{ ele }} <i class="el-icon-close" @click="clearOneFilter(index)" />
</p>
</div>
<i
@click="scrollNext"
v-if="showScroll"
class="el-icon-arrow-right arrow-filter"
></i>
@click="scrollNext"
/>
<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
class="table-container"
id="resize-for-filter"
class="table-container"
:class="[filterTexts.length ? 'table-container-filter' : '']"
>
<grid-table
v-loading="$store.getters.loadingMap[$store.getters.currentPath]"
:tableData="data"
:table-data="data"
:columns="[]"
:pagination="paginationConfig"
@sort-change="sortChange"
@ -113,22 +112,22 @@
</grid-table>
</div>
<keep-alive>
<filterUser ref="filterUser" @search="filterDraw"></filterUser>
</keep-alive>
<filterUser ref="filterUser" @search="filterDraw" />
</keep-alive>
</el-row>
</template>
<script>
import DeLayoutContent from "@/components/business/DeLayoutContent";
import GridTable from "@/components/gridTable/index.vue";
import filterUser from './filterUser';
import _ from 'lodash';
import DeLayoutContent from '@/components/business/DeLayoutContent'
import GridTable from '@/components/gridTable/index.vue'
import filterUser from './filterUser'
import _ from 'lodash'
import keyEnter from '@/components/msgCfm/keyEnter.js'
import {
addOrder,
formatOrders,
} from "@/utils/index";
import { logGrid } from "@/api/appTemplateMarket/log";
formatOrders
} from '@/utils/index'
import { logGrid } from '@/api/appTemplateMarket/log'
export default {
name: 'AppTemplateLog',
components: { GridTable, DeLayoutContent, filterUser },
@ -150,133 +149,133 @@ export default {
paginationConfig: {
currentPage: 1,
pageSize: 10,
total: 0,
total: 0
},
data: [],
orderConditions: [],
nikeName: "",
nickName: '',
showScroll: false,
filterTexts: [],
cacheCondition: [],
};
cacheCondition: []
}
},
watch: {
filterTexts: {
handler() {
this.getScrollStatus();
this.getScrollStatus()
},
deep: true,
deep: true
},
appTemplateId:{
appTemplateId: {
handler() {
this.search()
},
}
}
},
mounted() {
this.search();
this.resizeObserver();
this.search()
this.resizeObserver()
},
methods: {
applyNew(){
applyNew() {
this.$emit('applyNew')
},
sortChange({ column, prop, order }) {
this.orderConditions = [];
this.orderConditions = []
if (!order) {
this.initSearch();
return;
this.initSearch()
return
}
this.orderConditions = [];
addOrder({ field: prop, value: order }, this.orderConditions);
this.initSearch();
this.orderConditions = []
addOrder({ field: prop, value: order }, this.orderConditions)
this.initSearch()
},
getScrollStatus() {
this.$nextTick(() => {
const dom = document.querySelector(".filter-texts-container");
this.showScroll = dom && dom.scrollWidth > dom.offsetWidth;
});
const dom = document.querySelector('.filter-texts-container')
this.showScroll = dom && dom.scrollWidth > dom.offsetWidth
})
},
resizeObserver() {
this.resizeForFilter = new ResizeObserver((entries) => {
if (!this.filterTexts.length) return;
this.layoutResize();
});
if (!this.filterTexts.length) return
this.layoutResize()
})
this.resizeForFilter.observe(
document.querySelector("#resize-for-filter")
);
document.querySelector('#resize-for-filter')
)
},
layoutResize: _.debounce(function () {
this.getScrollStatus();
layoutResize: _.debounce(function() {
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
}
},
handleSizeChange(pageSize) {
this.paginationConfig.currentPage = 1;
this.paginationConfig.pageSize = pageSize;
this.search();
this.paginationConfig.currentPage = 1
this.paginationConfig.pageSize = pageSize
this.search()
},
handleCurrentChange(currentPage) {
this.paginationConfig.currentPage = currentPage;
this.search();
this.paginationConfig.currentPage = currentPage
this.search()
},
initSearch() {
this.handleCurrentChange(1);
this.handleCurrentChange(1)
},
clearFilter() {
this.$refs.filterUser.clearFilter();
this.$refs.filterUser.clearFilter()
},
clearOneFilter(index) {
this.$refs.filterUser.clearOneFilter(index);
this.$refs.filterUser.search();
this.$refs.filterUser.clearOneFilter(index)
this.$refs.filterUser.search()
},
filterDraw(condition, filterTexts = []) {
this.cacheCondition = condition;
this.filterTexts = filterTexts;
this.initSearch();
this.cacheCondition = condition
this.filterTexts = filterTexts
this.initSearch()
},
filterShow() {
this.$refs.filterUser.init();
this.$refs.filterUser.init()
},
search() {
if(this.position==='templateLog'&&!this.appTemplateId){
if (this.position === 'templateLog' && !this.appTemplateId) {
return
}
const param = {
orders: formatOrders(this.orderConditions),
conditions: [...this.cacheCondition],
};
if (this.nikeName) {
param.keyWord = this.nikeName;
conditions: [...this.cacheCondition]
}
if(this.appTemplateId){
if (this.nickName) {
param.keyWord = this.nickName
}
if (this.appTemplateId) {
param.conditions.push({
field: "app_template_id",
operator: "eq",
value: this.appTemplateId,
field: 'app_template_id',
operator: 'eq',
value: this.appTemplateId
})
}
const { currentPage, pageSize } = this.paginationConfig;
const { currentPage, pageSize } = this.paginationConfig
logGrid(currentPage, pageSize, param).then((response) => {
this.data = response.data.listObject;
this.paginationConfig.total = response.data.itemCount;
});
},
},
};
this.data = response.data.listObject
this.paginationConfig.total = response.data.itemCount
})
}
}
}
</script>
<style lang="scss" scoped>
.table-container {

View File

@ -429,6 +429,7 @@ import ChartStyleBatchSet from '@/views/chart/view/ChartStyleBatchSet'
import Multiplexing from '@/views/panel/ViewSelect/multiplexing'
import { listenGlobalKeyDown } from '@/components/canvas/utils/shortcutKey'
import { adaptCurThemeCommonStyle } from '@/components/canvas/utils/style'
import eventBus from '@/components/canvas/utils/eventBus'
export default {
name: 'PanelEdit',
components: {
@ -794,6 +795,7 @@ export default {
} else {
_this.$store.commit('refreshSaveStatus')
}
eventBus.$emit('editPanelInitReady')
}, 500)
})
},

View File

@ -25,7 +25,7 @@
width="400"
trigger="click"
>
<panel-detail-info></panel-detail-info>
<panel-detail-info />
<i
slot="reference"
class="el-icon-warning icon-class"
@ -164,15 +164,15 @@ import { starStatus, saveEnshrine, deleteEnshrine } from '@/api/panel/enshrine'
import bus from '@/utils/bus'
import { queryAll } from '@/api/panel/pdfTemplate'
import ShareHead from '@/views/panel/GrantAuth/ShareHead'
import {export2AppCheck, initPanelData, updatePanelStatus} from '@/api/panel/panel'
import { export2AppCheck, initPanelData, updatePanelStatus } from '@/api/panel/panel'
import { proxyInitPanelData } from '@/api/panel/shareProxy'
import { dataURLToBlob } from '@/components/canvas/utils/utils'
import { findResourceAsBase64 } from '@/api/staticResource/staticResource'
import PanelDetailInfo from "@/views/panel/list/common/PanelDetailInfo";
import PanelDetailInfo from '@/views/panel/list/common/PanelDetailInfo'
export default {
name: 'PanelViewShow',
components: {PanelDetailInfo, Preview, SaveToTemplate, PDFPreExport, ShareHead },
components: { PanelDetailInfo, Preview, SaveToTemplate, PDFPreExport, ShareHead },
props: {
activeTab: {
type: String,
@ -354,12 +354,12 @@ export default {
_this.dataLoading = false
}
},
downLoadToApp(){
downLoadToApp() {
this.dataLoading = true
export2AppCheck(this.$store.state.panel.panelInfo.id).then(rsp=>{
if(rsp.data.checkStatus){
export2AppCheck(this.$store.state.panel.panelInfo.id).then(rsp => {
if (rsp.data.checkStatus) {
this.saveAppFile(rsp.data)
}else{
} else {
this.dataLoading = false
this.$message({
message: rsp.data.checkMes,
@ -496,7 +496,7 @@ export default {
if (this.showType === 1 && this.shareUserId !== null) {
const param = { userId: this.shareUserId }
proxyInitPanelData(this.panelInfo.id, param, null)
} else { initPanelData(this.panelInfo.id,false) }
} else { initPanelData(this.panelInfo.id, false) }
},
changePublishState() {
if (this.panelInfo.status === 'publish') {

View File

@ -47,7 +47,7 @@
</el-form-item>
<el-form-item :label="$t('system_parameter_setting.ds_check_time')">
<el-form :inline="true" :disabled="show">
<el-form :inline="true" :disabled="show" class="demo-form-inline-ds">
<el-form-item>
<el-input v-model="formInline.dsCheckInterval" size="mini" type="number" min="1" @change="onSimpleCronChange()" />
@ -374,6 +374,13 @@ export default {
width: 156px;
}
}
.demo-form-inline-ds {
.el-form-item {
margin-bottom: 0px !important;
}
}
</style>
<style lang="scss">
.de-i118 {

View File

@ -441,7 +441,7 @@
<span>{{ $t('datasource.base_info') }}</span>
</div>
<el-form-item :label="$t('commons.name')" prop="name">
<el-input :placeholder="$t('commons.input_name')" v-model="apiItem.name" autocomplete="off" />
<el-input v-model="apiItem.name" :placeholder="$t('commons.input_name')" autocomplete="off" />
</el-form-item>
<el-form-item :label="$t('datasource.request')" prop="url">
@ -591,8 +591,8 @@
<span>{{ $t('dataset.data_preview') }}</span>
</div>
<el-empty
size="125"
v-if="showEmpty"
size="125"
:image="noneImg"
style="margin-top: 24px"
:description="$t('暂无数据,请在数据结构勾选字段')"
@ -1193,9 +1193,11 @@ export default {
this.apiItem.fields[i].value[j]
)
}
this.$refs.plxTable.reloadData(datas)
this.showEmpty = !!datas.length
this.$nextTick(() => {
this.$refs.plxTable?.reloadData(datas)
})
}
this.showEmpty = this.apiItem.fields.length === 0
},
handleCheckChange(node) {
if (node.children !== undefined) {

View File

@ -6,17 +6,16 @@
</el-col>
<el-col :span="14" class="right-user">
<el-input
ref="search"
v-model="nickName"
:placeholder="$t('system_parameter_setting.search_keywords')"
prefix-icon="el-icon-search"
class="name-email-search"
size="small"
clearable
ref="search"
v-model="nikeName"
@blur="initSearch"
@clear="initSearch"
>
</el-input>
/>
</el-col>
</el-row>
<div class="table-container">
@ -37,11 +36,11 @@
>
<template slot-scope="scope">
<el-button
@click="selectDataset(scope.row)"
class="de-text-btn mar3"
type="text"
>{{ $t("dataset.detail") }}</el-button
>
@click="selectDataset(scope.row)"
>{{ $t("dataset.detail") }}
</el-button>
</template>
</el-table-column>
</el-table>
@ -71,75 +70,92 @@
</el-col>
</el-row>
<el-table
:data="dsTableData"
stripe
style="width: 100%">
<el-table-column
prop="fieldName"
:label="$t('panel.column_name')">
</el-table-column>
<el-table-column
prop="fieldType"
:label="$t('dataset.field_type')">
</el-table-column>
<el-table-column
prop="remarks"
:label="$t('datasource.field_description')">
</el-table-column>
</el-table>
:data="dsTableData"
stripe
style="width: 100%"
>
<el-table-column
prop="fieldName"
:label="$t('panel.column_name')"
/>
<el-table-column
prop="fieldType"
:label="$t('dataset.field_type')"
>
<template v-if="params.type==='api'" slot-scope="scope">
<span v-if="scope.row.fieldType === '0'">{{
$t("dataset.text")
}}</span>
<span v-if="scope.row.fieldType === '2'">{{
$t("dataset.value")
}}</span>
<span v-if="scope.row.fieldType === '3'">{{
$t("dataset.value") + '(' + $t("dataset.float") + ')'
}}</span>
</template>
</el-table-column>
<el-table-column
prop="remarks"
:label="$t('datasource.field_description')"
/>
</el-table>
</el-dialog>
</div>
</template>
<script>
import keyEnter from "@/components/msgCfm/keyEnter.js";
import {dsTable, post} from "@/api/dataset/dataset";
import keyEnter from '@/components/msgCfm/keyEnter.js'
import { dsTable, post } from '@/api/dataset/dataset'
export default {
mixins: [keyEnter],
props: {
params: {
type: Object,
default: () => {},
},
default: () => {
}
}
},
data() {
return {
userDrawer: false,
dsTableDetail: {},
nikeName: "",
nickName: '',
loading: false,
dsTableData: [],
tableData: [],
filterTable: []
};
}
},
created() {
this.search()
},
methods: {
initSearch() {
this.filterTable = this.tableData.filter(ele => ele.name.includes(this.nikeName))
this.filterTable = this.tableData.filter(ele => ele.name.includes(this.nickName))
},
selectDataset(row) {
this.dsTableDetail = row;
this.userDrawer = true;
var table = {dataSourceId: this.params.id}
table.info = JSON.stringify({table: row.name})
this.dsTableDetail = row
this.userDrawer = true
var table = { dataSourceId: this.params.id }
table.info = JSON.stringify({ table: row.name })
post('/dataset/table/getFields', table).then((response) => {
this.dsTableData = response.data
})
},
search() {
this.loading = true;
this.loading = true
post('/datasource/getTables/' + this.params.id, {}).then((response) => {
this.tableData = response.data
this.initSearch()
}).finally(() => {
this.loading = false;
this.loading = false
})
},
},
};
}
}
}
</script>
<style lang="scss">
@ -151,21 +167,26 @@ export default {
font-weight: 400;
margin: 0;
}
.table-name {
color: var(--deTextSecondary, #646a73);
}
.table-value {
margin: 4px 0 24px 0;
color: var(--deTextPrimary, #1f2329);
}
}
.ds-table {
height: 100%;
padding: 10px 14px;
box-sizing: border-box;
.mar3 {
margin-left: -5px;
}
.table-name-top {
font-family: PingFang SC;
font-size: 16px;
@ -173,11 +194,13 @@ export default {
line-height: 24px;
color: var(--deTextPrimary, #1f2329);
}
.table-container {
height: calc(100% - 50px);
}
.el-table__fixed-right::before {
background: transparent;
}
}
</style>
</style>

View File

@ -9,64 +9,62 @@
</el-col>
<el-col :span="12" class="right-user">
<el-input
ref="search"
v-model="nickName"
:placeholder="$t('system_parameter_setting.by_event_details')"
prefix-icon="el-icon-search"
class="name-email-search"
size="small"
clearable
ref="search"
v-model="nikeName"
@blur="initSearch"
@clear="initSearch"
>
</el-input>
/>
<deBtn
:secondary="!cacheCondition.length"
:plain="!!cacheCondition.length"
icon="iconfont icon-icon-filter"
@click="filterShow"
>{{ $t("user.filter")
}}<template v-if="filterTexts.length">
({{ cacheCondition.length }})
</template>
>{{ $t("user.filter")
}}<template v-if="filterTexts.length">
({{ cacheCondition.length }})
</template>
</deBtn>
</el-col>
</el-row>
<div class="filter-texts" v-if="filterTexts.length">
<div v-if="filterTexts.length" class="filter-texts">
<span class="sum">{{ paginationConfig.total }}</span>
<span class="title">{{ $t("user.result_one") }}</span>
<el-divider direction="vertical"></el-divider>
<el-divider direction="vertical" />
<i
@click="scrollPre"
v-if="showScroll"
class="el-icon-arrow-left arrow-filter"
></i>
@click="scrollPre"
/>
<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 v-for="(ele, index) in filterTexts" :key="ele" class="text">
{{ ele }} <i class="el-icon-close" @click="clearOneFilter(index)" />
</p>
</div>
<i
@click="scrollNext"
v-if="showScroll"
class="el-icon-arrow-right arrow-filter"
></i>
@click="scrollNext"
/>
<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
class="table-container"
id="resize-for-filter"
class="table-container"
:class="[filterTexts.length ? 'table-container-filter' : '']"
>
<grid-table
v-loading="$store.getters.loadingMap[$store.getters.currentPath]"
:tableData="data"
:table-data="data"
:columns="[]"
:pagination="paginationConfig"
@sort-change="sortChange"
@ -108,22 +106,22 @@
</grid-table>
</div>
<keep-alive>
<filterUser ref="filterUser" @search="filterDraw"></filterUser>
</keep-alive>
<filterUser ref="filterUser" @search="filterDraw" />
</keep-alive>
</de-layout-content>
</template>
<script>
import DeLayoutContent from "@/components/business/DeLayoutContent";
import GridTable from "@/components/gridTable/index.vue";
import filterUser from './filterUser';
import _ from 'lodash';
import DeLayoutContent from '@/components/business/DeLayoutContent'
import GridTable from '@/components/gridTable/index.vue'
import filterUser from './filterUser'
import _ from 'lodash'
import keyEnter from '@/components/msgCfm/keyEnter.js'
import {
addOrder,
formatOrders,
} from "@/utils/index";
import { logGrid, exportExcel } from "@/api/system/log";
formatOrders
} from '@/utils/index'
import { logGrid, exportExcel } from '@/api/system/log'
export default {
components: { GridTable, DeLayoutContent, filterUser },
mixins: [keyEnter],
@ -133,150 +131,150 @@ export default {
paginationConfig: {
currentPage: 1,
pageSize: 10,
total: 0,
total: 0
},
data: [],
orderConditions: [],
nikeName: "",
nickName: '',
showScroll: false,
filterTexts: [],
cacheCondition: [],
};
cacheCondition: []
}
},
watch: {
filterTexts: {
handler() {
this.getScrollStatus();
this.getScrollStatus()
},
deep: true,
},
deep: true
}
},
mounted() {
this.search();
this.resizeObserver();
this.search()
this.resizeObserver()
},
methods: {
exportConfirm() {
this.$confirm(this.$t("log.confirm"), "", {
confirmButtonText: this.$t("commons.confirm"),
cancelButtonText: this.$t("commons.cancel"),
type: "warning",
this.$confirm(this.$t('log.confirm'), '', {
confirmButtonText: this.$t('commons.confirm'),
cancelButtonText: this.$t('commons.cancel'),
type: 'warning'
})
.then(() => {
this.exportData();
this.exportData()
})
.catch(() => {
// this.$info(this.$t('commons.delete_cancel'))
});
})
},
exportData() {
const param = {
orders: formatOrders(this.orderConditions),
conditions: [...this.cacheCondition],
};
if (this.nikeName) {
param.keyWord = this.nikeName;
conditions: [...this.cacheCondition]
}
if (this.nickName) {
param.keyWord = this.nickName
}
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操作日志.xls"; //
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
});
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操作日志.xls' //
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
})
},
sortChange({ column, prop, order }) {
this.orderConditions = [];
this.orderConditions = []
if (!order) {
this.initSearch();
return;
this.initSearch()
return
}
this.orderConditions = [];
addOrder({ field: prop, value: order }, this.orderConditions);
this.initSearch();
this.orderConditions = []
addOrder({ field: prop, value: order }, this.orderConditions)
this.initSearch()
},
getScrollStatus() {
this.$nextTick(() => {
const dom = document.querySelector(".filter-texts-container");
this.showScroll = dom && dom.scrollWidth > dom.offsetWidth;
});
const dom = document.querySelector('.filter-texts-container')
this.showScroll = dom && dom.scrollWidth > dom.offsetWidth
})
},
resizeObserver() {
this.resizeForFilter = new ResizeObserver((entries) => {
if (!this.filterTexts.length) return;
this.layoutResize();
});
if (!this.filterTexts.length) return
this.layoutResize()
})
this.resizeForFilter.observe(
document.querySelector("#resize-for-filter")
);
document.querySelector('#resize-for-filter')
)
},
layoutResize: _.debounce(function () {
this.getScrollStatus();
layoutResize: _.debounce(function() {
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
}
},
handleSizeChange(pageSize) {
this.paginationConfig.currentPage = 1;
this.paginationConfig.pageSize = pageSize;
this.search();
this.paginationConfig.currentPage = 1
this.paginationConfig.pageSize = pageSize
this.search()
},
handleCurrentChange(currentPage) {
this.paginationConfig.currentPage = currentPage;
this.search();
this.paginationConfig.currentPage = currentPage
this.search()
},
initSearch() {
this.handleCurrentChange(1);
this.handleCurrentChange(1)
},
clearFilter() {
this.$refs.filterUser.clearFilter();
this.$refs.filterUser.clearFilter()
},
clearOneFilter(index) {
this.$refs.filterUser.clearOneFilter(index);
this.$refs.filterUser.search();
this.$refs.filterUser.clearOneFilter(index)
this.$refs.filterUser.search()
},
filterDraw(condition, filterTexts = []) {
this.cacheCondition = condition;
this.filterTexts = filterTexts;
this.initSearch();
this.cacheCondition = condition
this.filterTexts = filterTexts
this.initSearch()
},
filterShow() {
this.$refs.filterUser.init();
this.$refs.filterUser.init()
},
search() {
const param = {
orders: formatOrders(this.orderConditions),
conditions: [...this.cacheCondition],
};
if (this.nikeName) {
param.keyWord = this.nikeName;
conditions: [...this.cacheCondition]
}
const { currentPage, pageSize } = this.paginationConfig;
if (this.nickName) {
param.keyWord = this.nickName
}
const { currentPage, pageSize } = this.paginationConfig
logGrid(currentPage, pageSize, param).then((response) => {
this.data = response.data.listObject;
this.paginationConfig.total = response.data.itemCount;
});
},
},
};
this.data = response.data.listObject
this.paginationConfig.total = response.data.itemCount
})
}
}
}
</script>
<style lang="scss" scoped>
.table-container {

View File

@ -6,110 +6,104 @@
type="primary"
icon="el-icon-circle-plus-outline"
@click="() => selectDataset()"
>{{ $t("dataset.add_task") }}</deBtn
>
>{{ $t("dataset.add_task") }}</deBtn>
<deBtn
:disabled="!multipleSelection.length"
secondary
@click="confirmDelete"
>{{ $t("organization.delete") }}</deBtn
>
>{{ $t("organization.delete") }}</deBtn>
</el-col>
<el-col :span="14" class="right-user">
<el-input
ref="search"
v-model="nickName"
:placeholder="$t('components.by_task_name')"
prefix-icon="el-icon-search"
class="name-email-search"
size="small"
clearable
ref="search"
v-model="nikeName"
@blur="initSearch"
@clear="initSearch"
>
</el-input>
/>
<deBtn
:secondary="!filterTexts.length"
:plain="!!filterTexts.length"
icon="iconfont icon-icon-filter"
@click="filterShow"
>{{ $t("user.filter")
}}<template v-if="filterTexts.length">
({{ filterTexts.length }})
</template>
>{{ $t("user.filter")
}}<template v-if="filterTexts.length">
({{ filterTexts.length }})
</template>
</deBtn>
<el-dropdown trigger="click" :hide-on-click="false">
<deBtn secondary icon="el-icon-setting">{{ $t("user.list") }}</deBtn>
<el-dropdown-menu class="list-colums-slect" slot="dropdown">
<el-dropdown-menu slot="dropdown" class="list-colums-slect">
<p class="title">{{ $t("user.list_info") }}</p>
<el-checkbox
:indeterminate="isIndeterminate"
v-model="checkAll"
:indeterminate="isIndeterminate"
@change="handleCheckAllChange"
>{{ $t("dataset.check_all") }}</el-checkbox
>
>{{ $t("dataset.check_all") }}</el-checkbox>
<el-checkbox-group
v-model="checkedColumnNames"
@change="handleCheckedColumnNamesChange"
>
<el-checkbox
v-for="column in columnNames"
:label="column.props"
:key="column.props"
>{{ $t(column.label) }}</el-checkbox
>
:label="column.props"
>{{ $t(column.label) }}</el-checkbox>
</el-checkbox-group>
</el-dropdown-menu>
</el-dropdown>
</el-col>
</el-row>
<div class="filter-texts" v-if="filterTexts.length">
<div v-if="filterTexts.length" class="filter-texts">
<span class="sum">{{ paginationConfig.total }}</span>
<span class="title">{{ $t("user.result_one") }}</span>
<el-divider direction="vertical"></el-divider>
<el-divider direction="vertical" />
<i
@click="scrollPre"
v-if="showScroll"
class="el-icon-arrow-left arrow-filter"
></i>
@click="scrollPre"
/>
<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 v-for="(ele, index) in filterTexts" :key="ele" class="text">
{{ ele }} <i class="el-icon-close" @click="clearOneFilter(index)" />
</p>
</div>
<i
@click="scrollNext"
v-if="showScroll"
class="el-icon-arrow-right arrow-filter"
></i>
@click="scrollNext"
/>
<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
class="table-container"
id="resize-for-filter"
class="table-container"
:class="[filterTexts.length ? 'table-container-filter' : '']"
>
<grid-table
ref="multipleTable"
v-loading="$store.getters.loadingMap[$store.getters.currentPath]"
:tableData="data"
:table-data="data"
:columns="checkedColumnNames"
:multipleSelection="multipleSelection"
:multiple-selection="multipleSelection"
:pagination="paginationConfig"
@selection-change="handleSelectionChange"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
ref="multipleTable"
>
<el-table-column type="selection" width="55" />
<el-table-column
min-width="178"
key="name"
min-width="178"
prop="name"
:label="$t('dataset.task_name')"
>
@ -117,20 +111,19 @@
<span>
<el-link
@click="jumpTaskRecord(scope.row)"
>{{ scope.row.name }}</el-link
>
>{{ scope.row.name }}</el-link>
</span>
</template>
</el-table-column>
<el-table-column
min-width="178"
key="datasetName"
min-width="178"
prop="datasetName"
:label="$t('dataset.task.dataset')"
/>
<el-table-column
min-width="100"
key="rate"
min-width="100"
prop="rate"
:label="$t('dataset.execute_rate')"
>
@ -148,8 +141,8 @@
</el-table-column>
<el-table-column
prop="lastExecTime"
key="lastExecTime"
prop="lastExecTime"
min-width="178"
:label="$t('dataset.task.last_exec_time')"
>
@ -161,8 +154,8 @@
</el-table-column>
<el-table-column
prop="lastExecStatus"
key="lastExecStatus"
prop="lastExecStatus"
min-width="140"
:label="$t('dataset.task.last_exec_status')"
>
@ -180,8 +173,8 @@
</el-table-column>
<el-table-column
prop="nextExecTime"
key="nextExecTime"
prop="nextExecTime"
min-width="178"
:label="$t('dataset.task.next_exec_time')"
>
@ -189,22 +182,22 @@
<span
v-if="
scope.row.nextExecTime &&
scope.row.nextExecTime !== -1 &&
scope.row.rate !== 'SIMPLE' &&
scope.row.status !== 'Pending'
scope.row.nextExecTime !== -1 &&
scope.row.rate !== 'SIMPLE' &&
scope.row.status !== 'Pending'
"
>
{{ scope.row.nextExecTime | timestampFormatDate }}
</span>
<span v-if="!scope.row.nextExecTime || scope.row.rate === 'SIMPLE'"
>-</span
>
<span
v-if="!scope.row.nextExecTime || scope.row.rate === 'SIMPLE'"
>-</span>
</template>
</el-table-column>
<el-table-column
min-width="120"
key="status"
min-width="120"
prop="status"
:label="$t('dataset.task.task_status')"
>
@ -216,27 +209,26 @@
</el-table-column>
<el-table-column
slot="__operation"
:label="$t('commons.operating')"
key="__operation"
:label="$t('commons.operating')"
fixed="right"
width="84"
>
<template slot-scope="scope">
<el-button
@click="selectDataset(scope.row)"
class="text-btn mar3 mar6"
type="text"
>{{
$t(disableEdit(scope.row) ? "auth.view" : "commons.edit")
}}</el-button
>
@click="selectDataset(scope.row)"
>{{
$t(disableEdit(scope.row) ? "auth.view" : "commons.edit")
}}</el-button>
<el-dropdown
size="medium"
trigger="click"
@command="(type) => handleCommand(type, scope.row)"
>
<i @click.stop class="el-icon-more"></i>
<el-dropdown-menu class="de-card-dropdown" slot="dropdown">
<i class="el-icon-more" @click.stop />
<el-dropdown-menu slot="dropdown" class="de-card-dropdown">
<template
v-if="!['Stopped', 'Exec'].includes(scope.row.status)"
>
@ -273,7 +265,7 @@
</div>
<keep-alive>
<filterUser ref="filterUser" @search="filterDraw"></filterUser>
<filterUser ref="filterUser" @search="filterDraw" />
</keep-alive>
<el-dialog
@ -296,58 +288,58 @@
<script>
const columnOptions = [
{
label: "dataset.task_name",
props: "name",
label: 'dataset.task_name',
props: 'name'
},
{
label: "dataset.task.dataset",
props: "datasetName",
label: 'dataset.task.dataset',
props: 'datasetName'
},
{
label: "dataset.execute_rate",
props: "rate",
label: 'dataset.execute_rate',
props: 'rate'
},
{
label: "dataset.task.last_exec_time",
props: "lastExecTime",
label: 'dataset.task.last_exec_time',
props: 'lastExecTime'
},
{
label: "dataset.task.last_exec_status",
props: "lastExecStatus",
label: 'dataset.task.last_exec_status',
props: 'lastExecStatus'
},
{
label: "dataset.task.next_exec_time",
props: "nextExecTime",
label: 'dataset.task.next_exec_time',
props: 'nextExecTime'
},
{
label: "dataset.task.task_status",
props: "status",
},
];
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";
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";
label: 'dataset.task.task_status',
props: 'status'
}
]
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'
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 keyEnter from '@/components/msgCfm/keyEnter.js'
export default {
name: "DatasetTaskList",
name: 'DatasetTaskList',
components: { GridTable, cron, filterUser, TableSelector },
mixins: [msgCfm, keyEnter],
props: {
transCondition: {
type: Object,
default: () => {},
},
default: () => {}
}
},
data() {
return {
nikeName: "",
nickName: '',
showScroll: false,
checkAll: true,
multipleSelection: [],
@ -358,7 +350,7 @@ export default {
paginationConfig: {
currentPage: 1,
pageSize: 10,
total: 0,
total: 0
},
cacheCondition: [],
data: [],
@ -366,290 +358,290 @@ export default {
selectDatasetFlag: false,
table: {},
show_error_massage: false,
error_massage: "",
customType: ["db", "sql", "api"],
};
error_massage: '',
customType: ['db', 'sql', 'api']
}
},
watch: {
filterTexts: {
handler() {
this.getScrollStatus();
this.getScrollStatus()
},
deep: true,
},
deep: true
}
},
created() {
const { taskId, name } = this.transCondition;
const { taskId, name } = this.transCondition
if (taskId) {
this.nikeName = name;
this.nickName = name
}
this.search();
this.search()
this.timer = setInterval(() => {
this.search(false);
}, 10000);
this.search(false)
}, 10000)
},
beforeDestroy() {
clearInterval(this.timer);
clearInterval(this.timer)
},
mounted() {
this.resizeObserver();
this.resizeObserver()
},
methods: {
getScrollStatus() {
this.$nextTick(() => {
const dom = document.querySelector(".filter-texts-container");
this.showScroll = dom && dom.scrollWidth > dom.offsetWidth;
});
const dom = document.querySelector('.filter-texts-container')
this.showScroll = dom && dom.scrollWidth > dom.offsetWidth
})
},
resizeObserver() {
this.resizeForFilter = new ResizeObserver((entries) => {
if (!this.filterTexts.length) return;
this.layoutResize();
});
if (!this.filterTexts.length) return
this.layoutResize()
})
this.resizeForFilter.observe(
document.querySelector("#resize-for-filter")
);
document.querySelector('#resize-for-filter')
)
},
layoutResize: _.debounce(function () {
this.getScrollStatus();
layoutResize: _.debounce(function() {
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() {
this.$refs.filterUser.clearFilter();
this.$refs.filterUser.clearFilter()
},
clearOneFilter(index) {
this.$refs.filterUser.clearOneFilter(index);
this.$refs.filterUser.search();
this.$refs.filterUser.clearOneFilter(index)
this.$refs.filterUser.search()
},
filterDraw(condition, filterTexts = []) {
this.cacheCondition = condition;
this.filterTexts = filterTexts;
this.initSearch();
this.cacheCondition = condition
this.filterTexts = filterTexts
this.initSearch()
},
filterShow() {
this.$refs.filterUser.init();
this.$refs.filterUser.init()
},
handleCommand(key, row) {
switch (key) {
case "exec":
this.execTask(row);
return;
break;
case "delete":
this.deleteTask(row);
return;
break;
case 'exec':
this.execTask(row)
return
break
case 'delete':
this.deleteTask(row)
return
break
default:
break;
break
}
this.changeTaskStatus(row);
this.changeTaskStatus(row)
},
handleSelectionChange(val) {
this.multipleSelection = val;
this.multipleSelection = val
},
handleCheckAllChange(val) {
this.checkedColumnNames = val
? columnOptions.map((ele) => ele.props)
: [];
this.isIndeterminate = false;
: []
this.isIndeterminate = false
},
handleCheckedColumnNamesChange(value) {
let checkedCount = value.length;
this.checkAll = checkedCount === this.columnNames.length;
const checkedCount = value.length
this.checkAll = checkedCount === this.columnNames.length
this.isIndeterminate =
checkedCount > 0 && checkedCount < this.columnNames.length;
checkedCount > 0 && checkedCount < this.columnNames.length
},
handleSizeChange(pageSize) {
this.paginationConfig.currentPage = 1;
this.paginationConfig.pageSize = pageSize;
this.search();
this.paginationConfig.currentPage = 1
this.paginationConfig.pageSize = pageSize
this.search()
},
handleCurrentChange(currentPage) {
this.paginationConfig.currentPage = currentPage;
this.search();
this.paginationConfig.currentPage = currentPage
this.search()
},
initSearch() {
this.handleCurrentChange(1);
this.handleCurrentChange(1)
},
search(showLoading = true) {
const { taskId, name } = this.transCondition;
const { taskId, name } = this.transCondition
const param = {
orders: formatOrders(this.orderConditions),
conditions: [...this.cacheCondition],
};
if (this.nikeName) {
conditions: [...this.cacheCondition]
}
if (this.nickName) {
param.conditions.push({
field: `dataset_table_task.name`,
operator: "like",
value: this.nikeName,
});
operator: 'like',
value: this.nickName
})
}
if (taskId && this.nikeName === name) {
if (taskId && this.nickName === name) {
param.conditions.push({
operator: "eq",
operator: 'eq',
value: taskId,
field: "dataset_table_task.id",
});
field: 'dataset_table_task.id'
})
}
const { currentPage, pageSize } = this.paginationConfig;
const { currentPage, pageSize } = this.paginationConfig
datasetTaskList(currentPage, pageSize, param, showLoading).then(
(response) => {
const multipleSelection = this.multipleSelection.map(ele => ele.id)
this.data = response.data.listObject;
this.paginationConfig.total = response.data.itemCount;
this.data = response.data.listObject
this.paginationConfig.total = response.data.itemCount
if (multipleSelection.length) {
this.$nextTick(() => {
this.data.forEach(row => {
if (multipleSelection.includes(row.id)) {
this.$refs.multipleTable.toggleRowSelection(row);
this.$refs.multipleTable.toggleRowSelection(row)
}
});
})
})
}
}
);
)
},
batchDelete() {
post(
"/dataset/task/batchDelete",
'/dataset/task/batchDelete',
this.multipleSelection.map((ele) => ele.id),
false
).then(() => {
this.initSearch();
this.openMessageSuccess("commons.delete_success");
});
this.initSearch()
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) => {
post('/dataset/task/lastExecStatus', item, false).then((response) => {
if (!item.lastExecStatus) {
item.lastExecStatus = response.data.lastExecStatus;
item.lastExecStatus = response.data.lastExecStatus
}
if (!item.lastExecTime) {
item.lastExecTime = response.data.lastExecTime;
item.lastExecTime = response.data.lastExecTime
}
item.msg = response.data.msg;
});
item.msg = response.data.msg
})
},
changeTaskStatus(task) {
const { status } = task;
if (!["Pending", "Underway"].includes(status)) {
return;
const { status } = task
if (!['Pending', 'Underway'].includes(status)) {
return
}
const param = {
...task,
status: status === "Underway" ? "Pending" : "Underway",
};
post("/dataset/task/updateStatus", param)
status: status === 'Underway' ? 'Pending' : 'Underway'
}
post('/dataset/task/updateStatus', param)
.then((response) => {
if (response.success) {
task.status = param.status;
task.status = param.status
this.$message({
message: this.$t("dataset.task.change_success"),
type: "success",
showClose: true,
});
message: this.$t('dataset.task.change_success'),
type: 'success',
showClose: true
})
} else {
this.initSearch(false);
this.initSearch(false)
}
})
.catch(() => {
this.initSearch(false);
});
this.initSearch(false)
})
},
execTask(task) {
this.$confirm(
this.$t("dataset.task.confirm_exec"),
this.$t("dataset.tips"),
this.$t('dataset.task.confirm_exec'),
this.$t('dataset.tips'),
{
confirmButtonText: this.$t("dataset.confirm"),
cancelButtonText: this.$t("dataset.cancel"),
type: "warning",
confirmButtonText: this.$t('dataset.confirm'),
cancelButtonText: this.$t('dataset.cancel'),
type: 'warning'
}
)
.then(() => {
post("/dataset/task/execTask", task).then((response) => {
this.initSearch(true);
});
post('/dataset/task/execTask', task).then((response) => {
this.initSearch(true)
})
})
.catch(() => {});
.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,
},
});
id
}
})
} else {
this.$router.push("/task-ds-form");
this.$router.push('/task-ds-form')
}
},
disableEdit(task) {
return (
task.rate === "SIMPLE" ||
task.status === "Stopped" ||
!hasDataPermission("manage", task.privileges)
);
task.rate === 'SIMPLE' ||
task.status === 'Stopped' ||
!hasDataPermission('manage', task.privileges)
)
},
disableExec(task) {
return (
task.status === "Stopped" ||
task.status === "Pending" ||
task.rate === "SIMPLE" ||
!hasDataPermission("manage", task.privileges)
);
task.status === 'Stopped' ||
task.status === 'Pending' ||
task.rate === 'SIMPLE' ||
!hasDataPermission('manage', task.privileges)
)
},
disableDelete(task) {
return false;
return false
// !hasDataPermission('manage',task.privileges)
},
deleteTask(task) {
const options = {
title: "确定删除该任务吗?",
type: "primary",
title: '确定删除该任务吗?',
type: 'primary',
cb: () => {
post("/dataset/task/delete/" + task.id, null).then((response) => {
this.openMessageSuccess("commons.delete_success");
this.initSearch();
});
},
};
this.handlerConfirm(options);
post('/dataset/task/delete/' + task.id, null).then((response) => {
this.openMessageSuccess('commons.delete_success')
this.initSearch()
})
}
}
this.handlerConfirm(options)
},
showErrorMassage(massage) {
this.show_error_massage = true;
this.error_massage = massage;
this.show_error_massage = true
this.error_massage = massage
},
jumpTaskRecord(item) {
this.$emit("jumpTaskRecord", item);
},
},
};
this.$emit('jumpTaskRecord', item)
}
}
}
</script>
<style scoped>
@ -865,4 +857,4 @@ export default {
display: none !important;
}
}
</style>
</style>

View File

@ -6,60 +6,58 @@
</el-col>
<el-col :span="14" class="right-user">
<el-input
ref="search"
v-model="nickName"
:placeholder="$t('components.by_task_name')"
prefix-icon="el-icon-search"
class="name-email-search"
size="small"
clearable
ref="search"
v-model="nikeName"
@blur="initSearch"
@clear="initSearch"
>
</el-input>
/>
<deBtn
:secondary="!cacheCondition.length"
:plain="!!cacheCondition.length"
icon="iconfont icon-icon-filter"
@click="filterShow"
>{{ $t("user.filter")
}}<template v-if="filterTexts.length">
({{ cacheCondition.length }})
</template>
>{{ $t("user.filter")
}}<template v-if="filterTexts.length">
({{ cacheCondition.length }})
</template>
</deBtn>
</el-col>
</el-row>
<div class="filter-texts" v-if="filterTexts.length">
<div v-if="filterTexts.length" class="filter-texts">
<span class="sum">{{ paginationConfig.total }}</span>
<span class="title">{{ $t("user.result_one") }}</span>
<el-divider direction="vertical"></el-divider>
<el-divider direction="vertical" />
<i
@click="scrollPre"
v-if="showScroll"
class="el-icon-arrow-left arrow-filter"
></i>
@click="scrollPre"
/>
<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 v-for="(ele, index) in filterTexts" :key="ele" class="text">
{{ ele }} <i class="el-icon-close" @click="clearOneFilter(index)" />
</p>
</div>
<i
@click="scrollNext"
v-if="showScroll"
class="el-icon-arrow-right arrow-filter"
></i>
@click="scrollNext"
/>
<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">
<grid-table
v-loading="$store.getters.loadingMap[$store.getters.currentPath]"
:tableData="data"
:table-data="data"
:columns="[]"
:pagination="paginationConfig"
@size-change="handleSizeChange"
@ -74,8 +72,7 @@
"
style="font-size: 12px"
@click="jumpTask(scope.row)"
>{{ scope.row.name }}</el-link
>
>{{ scope.row.name }}</el-link>
</span>
</template>
</el-table-column>
@ -107,7 +104,7 @@
</el-table-column>
</grid-table>
<keep-alive>
<filterUser ref="filterUser" @search="filterDraw"></filterUser>
<filterUser ref="filterUser" @search="filterDraw" />
</keep-alive>
</div>
<el-dialog
@ -131,284 +128,284 @@
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";
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 keyEnter from '@/components/msgCfm/keyEnter.js'
export default {
name: "TaskRecord",
name: 'TaskRecord',
components: { GridTable, filterUser },
mixins: [keyEnter],
props: {
param: {
type: Object,
default: () => {},
default: () => {}
},
transCondition: {
type: Object,
default: () => {},
},
default: () => {}
}
},
data() {
return {
columns: [],
nikeName: "",
nickName: '',
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,
};
},
created() {
const { taskId: id, name: label } = this.transCondition;
if (id) {
this.nikeName = label;
lastRequestComplete: true
}
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();
},
watch: {
filterTexts: {
handler() {
this.getScrollStatus();
this.getScrollStatus()
},
deep: true,
},
deep: true
}
},
created() {
const { taskId: id, name: label } = this.transCondition
if (id) {
this.nickName = label
}
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.nickName = name
}
this.createTimer()
},
mounted() {
this.resizeObserver()
},
beforeDestroy() {
this.destroyTimer();
this.destroyTimer()
},
methods: {
exportConfirm() {
this.$confirm(this.$t("log.confirm"), "", {
confirmButtonText: this.$t("commons.confirm"),
cancelButtonText: this.$t("commons.cancel"),
type: "warning",
this.$confirm(this.$t('log.confirm'), '', {
confirmButtonText: this.$t('commons.confirm'),
cancelButtonText: this.$t('commons.cancel'),
type: 'warning'
})
.then(() => {
this.exportData();
this.exportData()
})
.catch(() => {
// this.$info(this.$t('commons.delete_cancel'))
});
})
},
exportData() {
const { taskId, name } = this.transCondition;
const { taskId, name } = this.transCondition
const param = {
orders: formatOrders(this.orderConditions),
conditions: [...this.cacheCondition],
};
if (this.nikeName) {
conditions: [...this.cacheCondition]
}
if (this.nickName) {
param.conditions.push({
field: `dataset_table_task.name`,
operator: "like",
value: this.nikeName,
});
operator: 'like',
value: this.nickName
})
}
if (taskId && this.nikeName === name) {
if (taskId && this.nickName === name) {
param.conditions.push({
operator: "eq",
operator: 'eq',
value: taskId,
field: "dataset_table_task.id",
});
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);
});
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(() => {
const dom = document.querySelector(".filter-texts-container");
this.showScroll = dom && dom.scrollWidth > dom.offsetWidth;
});
const dom = document.querySelector('.filter-texts-container')
this.showScroll = dom && dom.scrollWidth > dom.offsetWidth
})
},
resizeObserver() {
this.resizeForFilter = new ResizeObserver((entries) => {
if (!this.filterTexts.length) return;
this.layoutResize();
});
if (!this.filterTexts.length) return
this.layoutResize()
})
this.resizeForFilter.observe(
document.querySelector("#resize-for-filter")
);
document.querySelector('#resize-for-filter')
)
},
layoutResize: _.debounce(function () {
this.getScrollStatus();
layoutResize: _.debounce(function() {
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() {
this.$refs.filterUser.clearFilter();
this.$refs.filterUser.clearFilter()
},
clearOneFilter(index) {
this.$refs.filterUser.clearOneFilter(index);
this.$refs.filterUser.search();
this.$refs.filterUser.clearOneFilter(index)
this.$refs.filterUser.search()
},
filterDraw(condition, filterTexts = []) {
this.cacheCondition = condition;
this.filterTexts = filterTexts;
this.initSearch();
this.cacheCondition = condition
this.filterTexts = filterTexts
this.initSearch()
},
filterShow() {
this.$refs.filterUser.init();
this.$refs.filterUser.init()
},
createTimer() {
this.initSearch();
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) {
this.paginationConfig.currentPage = 1;
this.paginationConfig.pageSize = pageSize;
this.search();
this.paginationConfig.currentPage = 1
this.paginationConfig.pageSize = pageSize
this.search()
},
handleCurrentChange(currentPage) {
this.paginationConfig.currentPage = currentPage;
this.search();
this.paginationConfig.currentPage = currentPage
this.search()
},
initSearch() {
this.handleCurrentChange(1);
this.handleCurrentChange(1)
},
timerSearch(showLoading = true) {
if (!this.lastRequestComplete) {
return;
return
} else {
this.lastRequestComplete = false;
this.lastRequestComplete = false
}
const { taskId, name } = this.transCondition;
const { taskId, name } = this.transCondition
const param = {
orders: formatOrders(this.orderConditions),
conditions: [...this.cacheCondition],
};
if (this.nikeName) {
conditions: [...this.cacheCondition]
}
if (this.nickName) {
param.conditions.push({
field: `dataset_table_task.name`,
operator: "like",
value: this.nikeName,
});
operator: 'like',
value: this.nickName
})
}
if (taskId && this.nikeName === name) {
if (taskId && this.nickName === name) {
param.conditions.push({
operator: "eq",
operator: 'eq',
value: taskId,
field: "dataset_table_task.id",
});
field: 'dataset_table_task.id'
})
}
post(
"/dataset/taskLog/list/notexcel/" +
'/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;
this.data = response.data.listObject
this.paginationConfig.total = response.data.itemCount
this.lastRequestComplete = true
})
.catch(() => {
this.lastRequestComplete = true;
});
this.lastRequestComplete = true
})
},
search(condition, showLoading = true) {
const { taskId, name } = this.transCondition;
const { taskId, name } = this.transCondition
const param = {
orders: formatOrders(this.orderConditions),
conditions: [...this.cacheCondition],
};
if (this.nikeName) {
conditions: [...this.cacheCondition]
}
if (this.nickName) {
param.conditions.push({
field: `dataset_table_task.name`,
operator: "like",
value: this.nikeName,
});
operator: 'like',
value: this.nickName
})
}
if (taskId && this.nikeName === name) {
if (taskId && this.nickName === name) {
param.conditions.push({
operator: "eq",
operator: 'eq',
value: taskId,
field: "dataset_table_task.id",
});
field: 'dataset_table_task.id'
})
}
post(
"/dataset/taskLog/list/notexcel/" +
'/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.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>

View File

@ -16,7 +16,7 @@
<el-col :span="12" class="right-user">
<el-input
ref="search"
v-model="nikeName"
v-model="nickName"
:placeholder="$t('role.search_by_name_email')"
prefix-icon="el-icon-search"
class="name-email-search"
@ -151,13 +151,13 @@
prop="roles"
:label="$t('commons.role')"
>
<template slot-scope="scope">
<el-tooltip popper-class="de-table-tooltips" class="item" effect="dark" placement="top">
<!-- // {{}} HTML -->
<div v-html="filterRoles(scope.row.roles)" slot="content"></div>
<div class="de-one-line">{{ filterRoles(scope.row.roles) }}</div>
</el-tooltip>
</template>
<template slot-scope="scope">
<el-tooltip popper-class="de-table-tooltips" class="item" effect="dark" placement="top">
<!-- // {{}} HTML -->
<div slot="content" v-html="filterRoles(scope.row.roles)" />
<div class="de-one-line">{{ filterRoles(scope.row.roles) }}</div>
</el-tooltip>
</template>
</el-table-column>
<el-table-column
@ -366,7 +366,7 @@ export default {
cacheCondition: [],
depts: null,
roles: [],
nikeName: '',
nickName: '',
userRoles: [],
orderConditions: [],
isPluginLoaded: false,
@ -540,11 +540,11 @@ export default {
orders: formatOrders(this.orderConditions),
conditions: [...this.cacheCondition]
}
if (this.nikeName) {
if (this.nickName) {
param.conditions.push({
field: `concat(nick_name, ',' , email)`,
operator: 'like',
value: this.nikeName
value: this.nickName
})
}
const { currentPage, pageSize } = this.paginationConfig

View File

@ -91,6 +91,7 @@ import { allRoles } from '@/api/system/user'
import { updatePerson, personInfo } from '@/api/system/user'
import { pluginLoaded } from '@/api/user'
import PluginCom from '@/views/system/plugin/PluginCom'
import Cookies from 'js-cookie'
export default {
components: { LayoutContent, Treeselect, PluginCom },
@ -173,6 +174,7 @@ export default {
},
created() {
this.$store.dispatch('app/toggleSideBarHide', true)
this.showError()
this.queryPerson()
this.initRoles()
},
@ -183,7 +185,16 @@ export default {
})
},
methods: {
showError() {
const errKeys = ['WecomError', 'DingtalkError', 'LarkError']
errKeys.forEach(key => {
const msg = Cookies.get(key)
if (msg) {
this.$error(msg)
Cookies.remove(key)
}
})
},
queryPerson() {
personInfo().then(res => {
const info = res.data