forked from github/dataease
Merge pull request #3913 from dataease/pr@dev@fix_dataset
Pr@dev@fix dataset
This commit is contained in:
commit
65be01e479
@ -1011,7 +1011,7 @@ public class ChartDataBuild {
|
|||||||
} else {
|
} else {
|
||||||
switch (columnPermissionItem.getDesensitizationRule().getCustomBuiltInRule()) {
|
switch (columnPermissionItem.getDesensitizationRule().getCustomBuiltInRule()) {
|
||||||
case RetainBeforeMAndAfterN:
|
case RetainBeforeMAndAfterN:
|
||||||
if (StringUtils.isEmpty(originStr) || originStr.length() < columnPermissionItem.getDesensitizationRule().getM() + columnPermissionItem.getDesensitizationRule().getN() + 1) {
|
if (StringUtils.isEmpty(originStr) || originStr.length() <= columnPermissionItem.getDesensitizationRule().getM() + columnPermissionItem.getDesensitizationRule().getN() + 1) {
|
||||||
desensitizationStr = String.join("", Collections.nCopies(columnPermissionItem.getDesensitizationRule().getM(), "X")) + "***" + String.join("", Collections.nCopies(columnPermissionItem.getDesensitizationRule().getN(), "X"));
|
desensitizationStr = String.join("", Collections.nCopies(columnPermissionItem.getDesensitizationRule().getM(), "X")) + "***" + String.join("", Collections.nCopies(columnPermissionItem.getDesensitizationRule().getN(), "X"));
|
||||||
} else {
|
} else {
|
||||||
desensitizationStr = StringUtils.substring(originStr, 0, columnPermissionItem.getDesensitizationRule().getM() - 1) + "***" + StringUtils.substring(originStr, originStr.length() - columnPermissionItem.getDesensitizationRule().getN(), originStr.length() - 1);
|
desensitizationStr = StringUtils.substring(originStr, 0, columnPermissionItem.getDesensitizationRule().getM() - 1) + "***" + StringUtils.substring(originStr, originStr.length() - columnPermissionItem.getDesensitizationRule().getN(), originStr.length() - 1);
|
||||||
|
@ -13,6 +13,7 @@ import io.dataease.plugins.common.dto.chart.ChartCustomFilterItemDTO;
|
|||||||
import io.dataease.plugins.common.dto.chart.ChartFieldCustomFilterDTO;
|
import io.dataease.plugins.common.dto.chart.ChartFieldCustomFilterDTO;
|
||||||
import io.dataease.plugins.config.SpringContextUtil;
|
import io.dataease.plugins.config.SpringContextUtil;
|
||||||
import io.dataease.plugins.xpack.auth.dto.request.*;
|
import io.dataease.plugins.xpack.auth.dto.request.*;
|
||||||
|
import io.dataease.plugins.xpack.auth.dto.response.Item;
|
||||||
import io.dataease.plugins.xpack.auth.service.ColumnPermissionService;
|
import io.dataease.plugins.xpack.auth.service.ColumnPermissionService;
|
||||||
import io.dataease.plugins.xpack.auth.service.RowPermissionService;
|
import io.dataease.plugins.xpack.auth.service.RowPermissionService;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
@ -112,14 +113,14 @@ public class PermissionService {
|
|||||||
}
|
}
|
||||||
if (CollectionUtils.isNotEmpty(fieldRoleColumnPermissionItems)) {
|
if (CollectionUtils.isNotEmpty(fieldRoleColumnPermissionItems)) {
|
||||||
if (fieldRoleColumnPermissionItems.stream().map(ColumnPermissionItem::getOpt).collect(Collectors.toList()).contains(ColumnPermissionConstants.Desensitization)) {
|
if (fieldRoleColumnPermissionItems.stream().map(ColumnPermissionItem::getOpt).collect(Collectors.toList()).contains(ColumnPermissionConstants.Desensitization)) {
|
||||||
desensitizationList.put(field.getDataeaseName(), fieldUserColumnPermissionItems.get(0));
|
desensitizationList.put(field.getDataeaseName(), fieldRoleColumnPermissionItems.get(0));
|
||||||
result.add(field);
|
result.add(field);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (CollectionUtils.isNotEmpty(fieldDeptColumnPermissionItems)) {
|
if (CollectionUtils.isNotEmpty(fieldDeptColumnPermissionItems)) {
|
||||||
if (fieldDeptColumnPermissionItems.stream().map(ColumnPermissionItem::getOpt).collect(Collectors.toList()).contains(ColumnPermissionConstants.Desensitization)) {
|
if (fieldDeptColumnPermissionItems.stream().map(ColumnPermissionItem::getOpt).collect(Collectors.toList()).contains(ColumnPermissionConstants.Desensitization)) {
|
||||||
desensitizationList.put(field.getDataeaseName(), fieldUserColumnPermissionItems.get(0));
|
desensitizationList.put(field.getDataeaseName(), fieldDeptColumnPermissionItems.get(0));
|
||||||
result.add(field);
|
result.add(field);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@ -209,34 +210,46 @@ public class PermissionService {
|
|||||||
dataSetColumnPermissionsDTO.setAuthTargetType("user");
|
dataSetColumnPermissionsDTO.setAuthTargetType("user");
|
||||||
datasetColumnPermissions.addAll(columnPermissionService.searchPermissions(dataSetColumnPermissionsDTO));
|
datasetColumnPermissions.addAll(columnPermissionService.searchPermissions(dataSetColumnPermissionsDTO));
|
||||||
if (CollectionUtils.isNotEmpty(roleIds)) {
|
if (CollectionUtils.isNotEmpty(roleIds)) {
|
||||||
dataSetColumnPermissionsDTO.setAuthTargetIds(roleIds);
|
DataSetColumnPermissionsDTO request = new DataSetColumnPermissionsDTO();
|
||||||
dataSetColumnPermissionsDTO.setAuthTargetType("role");
|
request.setDatasetId(datasetId);
|
||||||
List<DataSetColumnPermissionsDTO> roleColumnPermissionsDTOS = new ArrayList<>();
|
request.setAuthTargetType("role");
|
||||||
for (DataSetColumnPermissionsDTO columnPermissionsDTO : columnPermissionService.searchPermissions(dataSetColumnPermissionsDTO)) {
|
List<Item> items = (List<Item>)columnPermissionService.authObjs(request);
|
||||||
columnPermissionsDTO.getWhiteListUser();
|
roleIds = roleIds.stream().filter(id -> {return items.stream().map(Item::getId).collect(Collectors.toList()).contains(id);}).collect(Collectors.toList());
|
||||||
List<Long> userIdList = new Gson().fromJson(columnPermissionsDTO.getWhiteListUser(), new TypeToken<List<Long>>() {
|
if(CollectionUtils.isNotEmpty(roleIds)){
|
||||||
}.getType());
|
dataSetColumnPermissionsDTO.setAuthTargetIds(roleIds);
|
||||||
if (CollectionUtils.isEmpty(userIdList) || !userIdList.contains(userId)) {
|
dataSetColumnPermissionsDTO.setAuthTargetType("role");
|
||||||
roleColumnPermissionsDTOS.add(columnPermissionsDTO);
|
List<DataSetColumnPermissionsDTO> roleColumnPermissionsDTOS = new ArrayList<>();
|
||||||
|
for (DataSetColumnPermissionsDTO columnPermissionsDTO : columnPermissionService.searchPermissions(dataSetColumnPermissionsDTO)) {
|
||||||
|
columnPermissionsDTO.getWhiteListUser();
|
||||||
|
List<Long> userIdList = new Gson().fromJson(columnPermissionsDTO.getWhiteListUser(), new TypeToken<List<Long>>() {
|
||||||
|
}.getType());
|
||||||
|
if (CollectionUtils.isEmpty(userIdList) || !userIdList.contains(userId)) {
|
||||||
|
roleColumnPermissionsDTOS.add(columnPermissionsDTO);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
datasetColumnPermissions.addAll(roleColumnPermissionsDTOS);
|
||||||
}
|
}
|
||||||
datasetColumnPermissions.addAll(roleColumnPermissionsDTOS);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (deptId != null) {
|
if (deptId != null) {
|
||||||
dataSetColumnPermissionsDTO.setAuthTargetIds(Collections.singletonList(deptId));
|
DataSetColumnPermissionsDTO request = new DataSetColumnPermissionsDTO();
|
||||||
dataSetColumnPermissionsDTO.setAuthTargetType("dept");
|
request.setDatasetId(datasetId);
|
||||||
List<DataSetColumnPermissionsDTO> deptColumnPermissionsDTOS = new ArrayList<>();
|
request.setAuthTargetType("dept");
|
||||||
for (DataSetColumnPermissionsDTO columnPermissionsDTO : columnPermissionService.searchPermissions(dataSetColumnPermissionsDTO)) {
|
List<Item> items = (List<Item>)columnPermissionService.authObjs(request);
|
||||||
List<Long> userIdList = new Gson().fromJson(columnPermissionsDTO.getWhiteListUser(), new TypeToken<List<Long>>() {
|
if(items.stream().map(Item::getId).collect(Collectors.toList()).contains(deptId)){
|
||||||
}.getType());
|
dataSetColumnPermissionsDTO.setAuthTargetIds(Collections.singletonList(deptId));
|
||||||
if (CollectionUtils.isEmpty(userIdList) || !userIdList.contains(userId)) {
|
dataSetColumnPermissionsDTO.setAuthTargetType("dept");
|
||||||
deptColumnPermissionsDTOS.add(columnPermissionsDTO);
|
List<DataSetColumnPermissionsDTO> deptColumnPermissionsDTOS = new ArrayList<>();
|
||||||
|
for (DataSetColumnPermissionsDTO columnPermissionsDTO : columnPermissionService.searchPermissions(dataSetColumnPermissionsDTO)) {
|
||||||
|
List<Long> userIdList = new Gson().fromJson(columnPermissionsDTO.getWhiteListUser(), new TypeToken<List<Long>>() {
|
||||||
|
}.getType());
|
||||||
|
if (CollectionUtils.isEmpty(userIdList) || !userIdList.contains(userId)) {
|
||||||
|
deptColumnPermissionsDTOS.add(columnPermissionsDTO);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
datasetColumnPermissions.addAll(deptColumnPermissionsDTOS);
|
||||||
}
|
}
|
||||||
datasetColumnPermissions.addAll(deptColumnPermissionsDTOS);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return datasetColumnPermissions;
|
return datasetColumnPermissions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,28 +73,7 @@ dataease.sqlinjection.whitelists=/dataset/table/sqlPreview,/dataset/table/update
|
|||||||
server.compression.enabled=true
|
server.compression.enabled=true
|
||||||
server.compression.mime-types=application/javascript,text/css,application/json,application/xml,text/html,text/xml,text/plain
|
server.compression.mime-types=application/javascript,text/css,application/json,application/xml,text/html,text/xml,text/plain
|
||||||
server.compression.min-response-size=1024
|
server.compression.min-response-size=1024
|
||||||
#\u4E0B\u9762\u7684\u914D\u7F6E\u65B0\u589E\u5230/opt/dataease/conf/dataease/properties
|
|
||||||
#\u7F13\u5B58\u7C7B\u578B
|
|
||||||
##spring.cache.type=redis
|
|
||||||
#spring.cache.type=ehcache
|
|
||||||
#redis\u516C\u5171\u914D\u7F6E
|
|
||||||
#spring.redis.timeout=10000
|
|
||||||
#spring.redis.lettuce.pool.max-active=8
|
|
||||||
#spring.redis.lettuce.pool.max-wait=-1
|
|
||||||
#spring.redis.lettuce.pool.max-idle=8
|
|
||||||
#\u5355\u673A\u6A21\u5F0Fredis\u914D\u7F6E
|
|
||||||
#spring.redis.database=0
|
|
||||||
#spring.redis.host=192.168.0.110
|
|
||||||
#spring.redis.port=6379
|
|
||||||
#spring.redis.password=DataEase_ZNB@REDIS
|
|
||||||
#\u54E8\u5175\u6A21\u5F0Fredis\u914D\u7F6E
|
|
||||||
#spring.redis.sentinel.master=mymaster
|
|
||||||
#spring.redis.sentinel.nodes=192.168.0.110:26379,192.168.0.110:26380,192.168.0.110:26381
|
|
||||||
#spring.redis.sentinel.password=
|
|
||||||
#cluster\u6A21\u5F0Fredis\u914D\u7F6E
|
|
||||||
#spring.redis.cluster.nodes=192.168.0.110:7001,192.168.0.110:7002,192.168.0.110:7003,192.168.0.110:7004,192.168.0.110:7005,192.168.0.110:7006
|
|
||||||
#spring.redis.cluster.max-redirects=3
|
|
||||||
#spring.redis.password=DataEase_ZNB@REDIS
|
|
||||||
server.servlet.context-parameters.configurationStrategy=SYSTEM_PROPERTIES
|
server.servlet.context-parameters.configurationStrategy=SYSTEM_PROPERTIES
|
||||||
server.servlet.session.cookie.http-only=true
|
server.servlet.session.cookie.http-only=true
|
||||||
server.servlet.session.tracking-modes=cookie
|
server.servlet.session.tracking-modes=cookie
|
||||||
|
@ -136,7 +136,7 @@
|
|||||||
key="__operation"
|
key="__operation"
|
||||||
:label="$t('commons.operating')"
|
:label="$t('commons.operating')"
|
||||||
fixed="right"
|
fixed="right"
|
||||||
min-width="100"
|
min-width="180"
|
||||||
>
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
@ -147,6 +147,15 @@
|
|||||||
>{{
|
>{{
|
||||||
$t(disableEdit(scope.row) ? 'auth.view' : 'commons.edit')
|
$t(disableEdit(scope.row) ? 'auth.view' : 'commons.edit')
|
||||||
}}</el-button>
|
}}</el-button>
|
||||||
|
|
||||||
|
<el-button
|
||||||
|
class="de-text-btn mar3 mar6"
|
||||||
|
:disabled="disableExec(scope.row)"
|
||||||
|
type="text"
|
||||||
|
@click="execTask(scope.row)"
|
||||||
|
>{{ $t("emailtask.execute_now") }}
|
||||||
|
</el-button>
|
||||||
|
|
||||||
<el-dropdown
|
<el-dropdown
|
||||||
size="medium"
|
size="medium"
|
||||||
trigger="click"
|
trigger="click"
|
||||||
@ -164,12 +173,6 @@
|
|||||||
<template
|
<template
|
||||||
v-if="!['Exec'].includes(scope.row.status)"
|
v-if="!['Exec'].includes(scope.row.status)"
|
||||||
>
|
>
|
||||||
<el-dropdown-item
|
|
||||||
:disabled="disableExec(scope.row)"
|
|
||||||
command="exec"
|
|
||||||
>
|
|
||||||
{{ $t('components.run_once') }}
|
|
||||||
</el-dropdown-item>
|
|
||||||
<el-dropdown-item
|
<el-dropdown-item
|
||||||
v-if="scope.row.status === 'Pending'"
|
v-if="scope.row.status === 'Pending'"
|
||||||
command="continue"
|
command="continue"
|
||||||
@ -858,8 +861,7 @@ export default {
|
|||||||
},
|
},
|
||||||
disableExec(task) {
|
disableExec(task) {
|
||||||
return (
|
return (
|
||||||
task.status === 'Pending' ||
|
task.status === 'Pending' || task.status ==='Exec' || !hasDataPermission('manage', task.privileges)
|
||||||
!hasDataPermission('manage', task.privileges)
|
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
disableDelete(task) {
|
disableDelete(task) {
|
||||||
|
@ -462,11 +462,7 @@ export default {
|
|||||||
|
|
||||||
tabClick() {
|
tabClick() {
|
||||||
if (this.tabActive === 'dataPreview') {
|
if (this.tabActive === 'dataPreview') {
|
||||||
const reload = localStorage.getItem('reloadDsData')
|
this.initTable(this.param.id)
|
||||||
if (reload === 'true') {
|
|
||||||
localStorage.setItem('reloadDsData', 'false')
|
|
||||||
this.initTable(this.param.id)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -385,8 +385,8 @@ export default {
|
|||||||
desc: [
|
desc: [
|
||||||
{
|
{
|
||||||
min: 0,
|
min: 0,
|
||||||
max: 200,
|
max: 50,
|
||||||
message: i18n.t('datasource.input_limit', { num: '0~200' }),
|
message: i18n.t('datasource.input_limit', { num: '0~50' }),
|
||||||
trigger: 'blur'
|
trigger: 'blur'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -6,12 +6,14 @@
|
|||||||
type="primary"
|
type="primary"
|
||||||
icon="el-icon-plus"
|
icon="el-icon-plus"
|
||||||
@click="() => selectDataset()"
|
@click="() => selectDataset()"
|
||||||
>{{ $t("dataset.add_task") }}</deBtn>
|
>{{ $t("dataset.add_task") }}
|
||||||
|
</deBtn>
|
||||||
<deBtn
|
<deBtn
|
||||||
:disabled="!multipleSelection.length"
|
:disabled="!multipleSelection.length"
|
||||||
secondary
|
secondary
|
||||||
@click="confirmDelete"
|
@click="confirmDelete"
|
||||||
>{{ $t("organization.delete") }}</deBtn>
|
>{{ $t("organization.delete") }}
|
||||||
|
</deBtn>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col
|
<el-col
|
||||||
:span="14"
|
:span="14"
|
||||||
@ -33,10 +35,12 @@
|
|||||||
:plain="!!filterTexts.length"
|
:plain="!!filterTexts.length"
|
||||||
icon="iconfont icon-icon-filter"
|
icon="iconfont icon-icon-filter"
|
||||||
@click="filterShow"
|
@click="filterShow"
|
||||||
>{{ $t("user.filter")
|
>{{
|
||||||
}}<template v-if="filterTexts.length">
|
$t("user.filter")
|
||||||
({{ filterTexts.length }})
|
}}
|
||||||
</template>
|
<template v-if="filterTexts.length">
|
||||||
|
({{ filterTexts.length }})
|
||||||
|
</template>
|
||||||
</deBtn>
|
</deBtn>
|
||||||
<el-dropdown
|
<el-dropdown
|
||||||
trigger="click"
|
trigger="click"
|
||||||
@ -45,7 +49,8 @@
|
|||||||
<deBtn
|
<deBtn
|
||||||
secondary
|
secondary
|
||||||
icon="el-icon-setting"
|
icon="el-icon-setting"
|
||||||
>{{ $t("user.list") }}</deBtn>
|
>{{ $t("user.list") }}
|
||||||
|
</deBtn>
|
||||||
<el-dropdown-menu
|
<el-dropdown-menu
|
||||||
slot="dropdown"
|
slot="dropdown"
|
||||||
class="list-columns-select"
|
class="list-columns-select"
|
||||||
@ -55,7 +60,8 @@
|
|||||||
v-model="checkAll"
|
v-model="checkAll"
|
||||||
:indeterminate="isIndeterminate"
|
:indeterminate="isIndeterminate"
|
||||||
@change="handleCheckAllChange"
|
@change="handleCheckAllChange"
|
||||||
>{{ $t("dataset.check_all") }}</el-checkbox>
|
>{{ $t("dataset.check_all") }}
|
||||||
|
</el-checkbox>
|
||||||
<el-checkbox-group
|
<el-checkbox-group
|
||||||
v-model="checkedColumnNames"
|
v-model="checkedColumnNames"
|
||||||
@change="handleCheckedColumnNamesChange"
|
@change="handleCheckedColumnNamesChange"
|
||||||
@ -64,7 +70,8 @@
|
|||||||
v-for="column in columnNames"
|
v-for="column in columnNames"
|
||||||
:key="column.props"
|
:key="column.props"
|
||||||
:label="column.props"
|
:label="column.props"
|
||||||
>{{ $t(column.label) }}</el-checkbox>
|
>{{ $t(column.label) }}
|
||||||
|
</el-checkbox>
|
||||||
</el-checkbox-group>
|
</el-checkbox-group>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
@ -76,7 +83,7 @@
|
|||||||
>
|
>
|
||||||
<span class="sum">{{ paginationConfig.total }}</span>
|
<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 direction="vertical"/>
|
||||||
<i
|
<i
|
||||||
v-if="showScroll"
|
v-if="showScroll"
|
||||||
class="el-icon-arrow-left arrow-filter"
|
class="el-icon-arrow-left arrow-filter"
|
||||||
@ -89,9 +96,9 @@
|
|||||||
class="text"
|
class="text"
|
||||||
>
|
>
|
||||||
{{ ele }} <i
|
{{ ele }} <i
|
||||||
class="el-icon-close"
|
class="el-icon-close"
|
||||||
@click="clearOneFilter(index)"
|
@click="clearOneFilter(index)"
|
||||||
/>
|
/>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<i
|
<i
|
||||||
@ -104,7 +111,8 @@
|
|||||||
class="clear-btn"
|
class="clear-btn"
|
||||||
icon="el-icon-delete"
|
icon="el-icon-delete"
|
||||||
@click="clearFilter"
|
@click="clearFilter"
|
||||||
>{{ $t("user.clear_filter") }}</el-button>
|
>{{ $t("user.clear_filter") }}
|
||||||
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
id="resize-for-filter"
|
id="resize-for-filter"
|
||||||
@ -154,14 +162,14 @@
|
|||||||
>
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span v-if="scope.row.rate === 'SIMPLE'">{{
|
<span v-if="scope.row.rate === 'SIMPLE'">{{
|
||||||
$t("dataset.execute_once")
|
$t("dataset.execute_once")
|
||||||
}}</span>
|
}}</span>
|
||||||
<span v-if="scope.row.rate === 'CRON'">{{
|
<span v-if="scope.row.rate === 'CRON'">{{
|
||||||
$t("dataset.cron_config")
|
$t("dataset.cron_config")
|
||||||
}}</span>
|
}}</span>
|
||||||
<span v-if="scope.row.rate === 'SIMPLE_CRON'">{{
|
<span v-if="scope.row.rate === 'SIMPLE_CRON'">{{
|
||||||
$t("dataset.simple_cron")
|
$t("dataset.simple_cron")
|
||||||
}}</span>
|
}}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
@ -189,8 +197,8 @@
|
|||||||
v-if="scope.row.lastExecStatus"
|
v-if="scope.row.lastExecStatus"
|
||||||
:class="[`de-${scope.row.lastExecStatus}-pre`, 'de-status']"
|
:class="[`de-${scope.row.lastExecStatus}-pre`, 'de-status']"
|
||||||
>{{
|
>{{
|
||||||
$t(`dataset.${scope.row.lastExecStatus.toLocaleLowerCase()}`)
|
$t(`dataset.${scope.row.lastExecStatus.toLocaleLowerCase()}`)
|
||||||
}}
|
}}
|
||||||
<svg-icon
|
<svg-icon
|
||||||
v-if="scope.row.lastExecStatus === 'Error'"
|
v-if="scope.row.lastExecStatus === 'Error'"
|
||||||
style="cursor: pointer;"
|
style="cursor: pointer;"
|
||||||
@ -244,16 +252,22 @@
|
|||||||
key="__operation"
|
key="__operation"
|
||||||
:label="$t('commons.operating')"
|
:label="$t('commons.operating')"
|
||||||
fixed="right"
|
fixed="right"
|
||||||
width="100"
|
width="160"
|
||||||
>
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
class="de-text-btn mar3 mar6"
|
class="de-text-btn mar3 mar6"
|
||||||
type="text"
|
type="text"
|
||||||
@click="selectDataset(scope.row)"
|
@click="selectDataset(scope.row)"
|
||||||
>{{
|
>{{ $t(disableEdit(scope.row) ? "auth.view" : "commons.edit") }}
|
||||||
$t(disableEdit(scope.row) ? "auth.view" : "commons.edit")
|
</el-button>
|
||||||
}}</el-button>
|
<el-button
|
||||||
|
class="de-text-btn mar3 mar6"
|
||||||
|
:disabled="disableExec(scope.row)"
|
||||||
|
type="text"
|
||||||
|
@click="execTask(scope.row)"
|
||||||
|
>{{ $t("emailtask.execute_now") }}
|
||||||
|
</el-button>
|
||||||
<el-dropdown
|
<el-dropdown
|
||||||
size="medium"
|
size="medium"
|
||||||
trigger="click"
|
trigger="click"
|
||||||
@ -270,12 +284,6 @@
|
|||||||
<template
|
<template
|
||||||
v-if="!['Exec'].includes(scope.row.status)"
|
v-if="!['Exec'].includes(scope.row.status)"
|
||||||
>
|
>
|
||||||
<el-dropdown-item
|
|
||||||
:disabled="disableExec(scope.row)"
|
|
||||||
command="exec"
|
|
||||||
>
|
|
||||||
{{ $t("components.run_once") }}
|
|
||||||
</el-dropdown-item>
|
|
||||||
<el-dropdown-item
|
<el-dropdown-item
|
||||||
v-if="scope.row.status === 'Pending'"
|
v-if="scope.row.status === 'Pending'"
|
||||||
command="continue"
|
command="continue"
|
||||||
@ -325,18 +333,18 @@
|
|||||||
secondary
|
secondary
|
||||||
@click="show_error_massage = false"
|
@click="show_error_massage = false"
|
||||||
>{{
|
>{{
|
||||||
$t("dataset.close")
|
$t("dataset.close")
|
||||||
}}</deBtn>
|
}}</deBtn>
|
||||||
</span>
|
</span>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { columnOptions } from './options'
|
import {columnOptions} from './options'
|
||||||
import { formatOrders } from '@/utils/index'
|
import {formatOrders} from '@/utils/index'
|
||||||
import { datasetTaskList, post } from '@/api/dataset/dataset'
|
import {datasetTaskList, post} from '@/api/dataset/dataset'
|
||||||
import { hasDataPermission } from '@/utils/permission'
|
import {hasDataPermission} from '@/utils/permission'
|
||||||
import GridTable from '@/components/gridTable/index.vue'
|
import GridTable from '@/components/gridTable/index.vue'
|
||||||
import filterUser from './FilterUser.vue'
|
import filterUser from './FilterUser.vue'
|
||||||
import msgCfm from '@/components/msgCfm/index'
|
import msgCfm from '@/components/msgCfm/index'
|
||||||
@ -345,12 +353,13 @@ import keyEnter from '@/components/msgCfm/keyEnter.js'
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'DatasetTaskList',
|
name: 'DatasetTaskList',
|
||||||
components: { GridTable, filterUser },
|
components: {GridTable, filterUser},
|
||||||
mixins: [msgCfm, keyEnter],
|
mixins: [msgCfm, keyEnter],
|
||||||
props: {
|
props: {
|
||||||
transCondition: {
|
transCondition: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => {}
|
default: () => {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@ -387,7 +396,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
const { taskId, name } = this.transCondition
|
const {taskId, name} = this.transCondition
|
||||||
if (taskId) {
|
if (taskId) {
|
||||||
this.nickName = name
|
this.nickName = name
|
||||||
}
|
}
|
||||||
@ -418,7 +427,7 @@ export default {
|
|||||||
document.querySelector('#resize-for-filter')
|
document.querySelector('#resize-for-filter')
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
layoutResize: _.debounce(function() {
|
layoutResize: _.debounce(function () {
|
||||||
this.getScrollStatus()
|
this.getScrollStatus()
|
||||||
}, 200),
|
}, 200),
|
||||||
scrollPre() {
|
scrollPre() {
|
||||||
@ -492,7 +501,7 @@ export default {
|
|||||||
this.handleCurrentChange(1)
|
this.handleCurrentChange(1)
|
||||||
},
|
},
|
||||||
search(showLoading = true) {
|
search(showLoading = true) {
|
||||||
const { taskId, name } = this.transCondition
|
const {taskId, name} = this.transCondition
|
||||||
const param = {
|
const param = {
|
||||||
orders: formatOrders(this.orderConditions),
|
orders: formatOrders(this.orderConditions),
|
||||||
conditions: [...this.cacheCondition]
|
conditions: [...this.cacheCondition]
|
||||||
@ -511,7 +520,7 @@ export default {
|
|||||||
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(
|
datasetTaskList(currentPage, pageSize, param, showLoading).then(
|
||||||
(response) => {
|
(response) => {
|
||||||
const multipleSelection = this.multipleSelection.map(ele => ele.id)
|
const multipleSelection = this.multipleSelection.map(ele => ele.id)
|
||||||
@ -559,7 +568,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
changeTaskStatus(task) {
|
changeTaskStatus(task) {
|
||||||
const { status } = task
|
const {status} = task
|
||||||
if (!['Pending', 'Underway'].includes(status)) {
|
if (!['Pending', 'Underway'].includes(status)) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -599,11 +608,12 @@ export default {
|
|||||||
this.initSearch(true)
|
this.initSearch(true)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.catch(() => {})
|
.catch(() => {
|
||||||
|
})
|
||||||
},
|
},
|
||||||
selectDataset(row) {
|
selectDataset(row) {
|
||||||
if (row) {
|
if (row) {
|
||||||
const { datasetName, id, tableId } = row
|
const {datasetName, id, tableId} = row
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
path: '/task-ds-form',
|
path: '/task-ds-form',
|
||||||
query: {
|
query: {
|
||||||
@ -624,9 +634,7 @@ export default {
|
|||||||
)
|
)
|
||||||
},
|
},
|
||||||
disableExec(task) {
|
disableExec(task) {
|
||||||
return (task.status === 'Pending' ||
|
return (task.status === 'Pending' || task.status ==='Exec' || !hasDataPermission('manage', task.privileges))
|
||||||
!hasDataPermission('manage', task.privileges)
|
|
||||||
)
|
|
||||||
},
|
},
|
||||||
disableDelete(task) {
|
disableDelete(task) {
|
||||||
return false
|
return false
|
||||||
@ -661,6 +669,7 @@ export default {
|
|||||||
height: 100px;
|
height: 100px;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.codemirror ::v-deep .CodeMirror-scroll {
|
.codemirror ::v-deep .CodeMirror-scroll {
|
||||||
height: 100px;
|
height: 100px;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
@ -708,6 +717,7 @@ export default {
|
|||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.table-container {
|
.table-container {
|
||||||
height: calc(100% - 50px);
|
height: calc(100% - 50px);
|
||||||
|
|
||||||
@ -744,8 +754,10 @@ export default {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.de-card-dropdown {
|
.de-card-dropdown {
|
||||||
margin-top: 0 !important;
|
margin-top: 0 !important;
|
||||||
|
|
||||||
.popper__arrow {
|
.popper__arrow {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user