forked from github/dataease
refactor: 解决冲突
This commit is contained in:
commit
bbc5f2ddf0
@ -72,11 +72,12 @@ public class DataSetTableController {
|
||||
}, logical = Logical.AND)
|
||||
@ApiOperation("更新")
|
||||
@PostMapping("update")
|
||||
public List<DatasetTable> save(@RequestBody DataSetTableRequest datasetTable) throws Exception {
|
||||
public List<VAuthModelDTO> save(@RequestBody DataSetTableRequest datasetTable) throws Exception {
|
||||
if (datasetTable.getType().equalsIgnoreCase("excel")) {
|
||||
return dataSetTableService.saveExcel(datasetTable);
|
||||
List<String> ids = dataSetTableService.saveExcel(datasetTable).stream().map(DatasetTable::getId).collect(Collectors.toList());
|
||||
return vAuthModelService.queryAuthModelByIds("dataset", ids);
|
||||
} else {
|
||||
return Collections.singletonList(dataSetTableService.save(datasetTable));
|
||||
return vAuthModelService.queryAuthModelByIds("dataset", Collections.singletonList(dataSetTableService.save(datasetTable).getId()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -529,6 +529,9 @@ public class ChartViewService {
|
||||
xAxisForRequest.addAll(xAxis);
|
||||
xAxisForRequest.addAll(extStack);
|
||||
datasourceRequest.setXAxis(xAxisForRequest);
|
||||
List<ChartViewFieldDTO> yAxisForRequest = new ArrayList<>();
|
||||
yAxisForRequest.addAll(yAxis);
|
||||
datasourceRequest.setYAxis(yAxisForRequest);
|
||||
data = datasourceProvider.getData(datasourceRequest);
|
||||
} else if (table.getMode() == 1) {// 抽取
|
||||
datasourceRequest.setDatasource(ds);
|
||||
@ -1037,6 +1040,7 @@ public class ChartViewService {
|
||||
}
|
||||
if (StringUtils.isNotEmpty(totalPageSql) && StringUtils.equalsIgnoreCase((String) mapSize.get("tablePageMode"), "page")) {
|
||||
datasourceRequest.setQuery(totalPageSql);
|
||||
datasourceRequest.setTotalPageFlag(true);
|
||||
java.util.List<java.lang.String[]> tmpData = datasourceProvider.getData(datasourceRequest);
|
||||
totalItems = CollectionUtils.isEmpty(tmpData) ? 0 : Long.valueOf(tmpData.get(0)[0]);
|
||||
totalPage = (totalItems / pageInfo.getPageSize()) + (totalItems % pageInfo.getPageSize() > 0 ? 1 : 0);
|
||||
@ -1047,6 +1051,10 @@ public class ChartViewService {
|
||||
xAxisForRequest.addAll(xAxis);
|
||||
xAxisForRequest.addAll(extStack);
|
||||
datasourceRequest.setXAxis(xAxisForRequest);
|
||||
List<ChartViewFieldDTO> yAxisForRequest = new ArrayList<>();
|
||||
yAxisForRequest.addAll(yAxis);
|
||||
datasourceRequest.setYAxis(yAxisForRequest);
|
||||
datasourceRequest.setTotalPageFlag(false);
|
||||
data = datasourceProvider.getData(datasourceRequest);
|
||||
if (CollectionUtils.isNotEmpty(assistFields)) {
|
||||
datasourceAssistRequest.setQuery(assistSQL(datasourceRequest.getQuery(), assistFields));
|
||||
|
@ -34,6 +34,7 @@ import io.dataease.plugins.common.base.mapper.*;
|
||||
import io.dataease.plugins.common.constants.DatasetType;
|
||||
import io.dataease.plugins.common.constants.DatasourceTypes;
|
||||
import io.dataease.plugins.common.constants.DeTypeConstants;
|
||||
import io.dataease.plugins.common.dto.chart.ChartViewFieldDTO;
|
||||
import io.dataease.plugins.common.dto.dataset.SqlVariableDetails;
|
||||
import io.dataease.plugins.common.dto.datasource.DataSourceType;
|
||||
import io.dataease.plugins.common.dto.datasource.TableField;
|
||||
@ -712,6 +713,7 @@ public class DataSetTableService {
|
||||
datasourceRequest.setPreviewData(true);
|
||||
try {
|
||||
datasourceRequest.setPageable(true);
|
||||
datasourceRequest.setPermissionFields(fields);
|
||||
data.addAll(datasourceProvider.getData(datasourceRequest));
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getMessage());
|
||||
|
@ -195,6 +195,7 @@ public class DirectFieldService implements DataSetFieldService {
|
||||
datasourceRequest.setQuery(qp.createQuerySQL(tableName, permissionFields, !needSort, null, customFilter, rowPermissionsTree, deSortFields));
|
||||
}
|
||||
LogUtil.info(datasourceRequest.getQuery());
|
||||
datasourceRequest.setPermissionFields(permissionFields);
|
||||
List<String[]> rows = datasourceProvider.getData(datasourceRequest);
|
||||
if (!needMapping) {
|
||||
List<Object> results = rows.stream().map(row -> row[0]).distinct().collect(Collectors.toList());
|
||||
|
@ -5,7 +5,7 @@
|
||||
class="title-text"
|
||||
>
|
||||
<span style="line-height: 26px;">
|
||||
{{ param.tableId?$t('dataset.edit_custom_table'):$t('dataset.add_custom_table') }}
|
||||
{{ param.tableId ? $t('dataset.edit_custom_table') : $t('dataset.add_custom_table') }}
|
||||
</span>
|
||||
<el-row style="float: right">
|
||||
<el-button
|
||||
@ -24,7 +24,7 @@
|
||||
</el-button>
|
||||
</el-row>
|
||||
</el-row>
|
||||
<el-divider />
|
||||
<el-divider/>
|
||||
<el-row>
|
||||
<el-form :inline="true">
|
||||
<el-form-item
|
||||
@ -105,9 +105,10 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { post, getTable } from '@/api/dataset/dataset'
|
||||
import { getTable, post } from '@/api/dataset/dataset'
|
||||
import DatasetGroupSelector from '../common/DatasetGroupSelector'
|
||||
import DatasetCustomField from '../common/DatasetCustomField'
|
||||
import { updateCacheTree } from '@/components/canvas/utils/utils'
|
||||
|
||||
export default {
|
||||
name: 'AddCustom',
|
||||
@ -252,6 +253,12 @@ export default {
|
||||
}
|
||||
post('/dataset/table/update', table).then(response => {
|
||||
// this.$store.dispatch('dataset/setSceneData', new Date().getTime())
|
||||
if (table.id) {
|
||||
const renameNode = { id: table.id, name: table.name, label: table.name }
|
||||
updateCacheTree('rename', 'dataset-tree', renameNode, JSON.parse(localStorage.getItem('dataset-tree')))
|
||||
} else {
|
||||
updateCacheTree('batchNew', 'dataset-tree', response.data, JSON.parse(localStorage.getItem('dataset-tree')))
|
||||
}
|
||||
this.$emit('saveSuccess', table)
|
||||
this.cancel()
|
||||
})
|
||||
@ -296,49 +303,50 @@ export default {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-divider--horizontal {
|
||||
margin: 12px 0;
|
||||
}
|
||||
.el-divider--horizontal {
|
||||
margin: 12px 0;
|
||||
}
|
||||
|
||||
.form-item {
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
.form-item {
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
.el-checkbox {
|
||||
margin-bottom: 14px;
|
||||
margin-left: 0;
|
||||
margin-right: 14px;
|
||||
}
|
||||
.el-checkbox {
|
||||
margin-bottom: 14px;
|
||||
margin-left: 0;
|
||||
margin-right: 14px;
|
||||
}
|
||||
|
||||
.el-checkbox.is-bordered + .el-checkbox.is-bordered {
|
||||
margin-left: 0;
|
||||
}
|
||||
.el-checkbox.is-bordered + .el-checkbox.is-bordered {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.dataPreview ::v-deep .el-card__header{
|
||||
padding: 0 8px 12px;
|
||||
}
|
||||
.dataPreview ::v-deep .el-card__header {
|
||||
padding: 0 8px 12px;
|
||||
}
|
||||
|
||||
.dataPreview ::v-deep .el-card__body{
|
||||
padding:10px;
|
||||
}
|
||||
.dataPreview ::v-deep .el-card__body {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
span{
|
||||
font-size: 14px;
|
||||
}
|
||||
span {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.panel-height{
|
||||
height: calc(100vh - 56px - 15px - 26px - 25px - 43px);
|
||||
}
|
||||
.panel-height {
|
||||
height: calc(100vh - 56px - 15px - 26px - 25px - 43px);
|
||||
}
|
||||
|
||||
.blackTheme .panel-height{
|
||||
height: calc(100vh - 56px - 15px - 26px - 25px - 43px);
|
||||
border-color: var(--TableBorderColor) !important;
|
||||
}
|
||||
.blackTheme .panel-height {
|
||||
height: calc(100vh - 56px - 15px - 26px - 25px - 43px);
|
||||
border-color: var(--TableBorderColor) !important;
|
||||
}
|
||||
|
||||
.span-number{
|
||||
color: #0a7be0;
|
||||
}
|
||||
.table-count{
|
||||
color: #606266;
|
||||
}
|
||||
.span-number {
|
||||
color: #0a7be0;
|
||||
}
|
||||
|
||||
.table-count {
|
||||
color: #606266;
|
||||
}
|
||||
</style>
|
||||
|
@ -8,7 +8,7 @@
|
||||
class="arrow-right"
|
||||
@click="showLeft = true"
|
||||
>
|
||||
<i class="el-icon-d-arrow-right" />
|
||||
<i class="el-icon-d-arrow-right"/>
|
||||
</p>
|
||||
<div
|
||||
v-show="showLeft"
|
||||
@ -21,16 +21,16 @@
|
||||
effect="dark"
|
||||
placement="right"
|
||||
>
|
||||
<div slot="content">
|
||||
{{ $t('dataset.excel_info_1') }}<br>
|
||||
{{ $t('dataset.excel_info_2') }}<br>
|
||||
{{ $t('dataset.excel_info_3') }}
|
||||
</div>
|
||||
<i class="el-icon-warning-outline" /> </el-tooltip></span>
|
||||
<i
|
||||
class="el-icon-d-arrow-left"
|
||||
@click="showLeft = false"
|
||||
/>
|
||||
<div slot="content">
|
||||
{{ $t('dataset.excel_info_1') }}<br>
|
||||
{{ $t('dataset.excel_info_2') }}<br>
|
||||
{{ $t('dataset.excel_info_3') }}
|
||||
</div>
|
||||
<i class="el-icon-warning-outline"/> </el-tooltip></span>
|
||||
<i
|
||||
class="el-icon-d-arrow-left"
|
||||
@click="showLeft = false"
|
||||
/>
|
||||
</p>
|
||||
<el-upload
|
||||
:action="baseUrl + 'dataset/table/excel/upload'"
|
||||
@ -160,7 +160,7 @@
|
||||
:key="field.fieldName + field.fieldType"
|
||||
@command="(type) => handleCommand(type, field)"
|
||||
>
|
||||
<span class="type-switch">
|
||||
<span class="type-switch">
|
||||
<svg-icon
|
||||
v-if="field.fieldType === 'TEXT'"
|
||||
icon-class="field_text"
|
||||
@ -179,7 +179,7 @@
|
||||
icon-class="field_value"
|
||||
class="field-icon-value"
|
||||
/>
|
||||
<i class="el-icon-arrow-down el-icon--right" /></span>
|
||||
<i class="el-icon-arrow-down el-icon--right"/></span>
|
||||
<el-dropdown-menu
|
||||
slot="dropdown"
|
||||
style="width: 178px"
|
||||
@ -238,6 +238,7 @@ import store from '@/store'
|
||||
import msgCfm from '@/components/msgCfm/index'
|
||||
import cancelMix from './cancelMix'
|
||||
import Config from "@/settings";
|
||||
import { updateCacheTree } from '@/components/canvas/utils/utils'
|
||||
|
||||
const token = getToken()
|
||||
const RefreshTokenKey = Config.RefreshTokenKey
|
||||
@ -577,6 +578,9 @@ export default {
|
||||
table.mergeSheet = false
|
||||
post('/dataset/table/update', table)
|
||||
.then((response) => {
|
||||
if (!table.id) {
|
||||
updateCacheTree('batchNew', 'dataset-tree', response.data, JSON.parse(localStorage.getItem('dataset-tree')))
|
||||
}
|
||||
this.openMessageSuccess('deDataset.set_saved_successfully')
|
||||
this.cancel(response.data)
|
||||
})
|
||||
@ -590,6 +594,9 @@ export default {
|
||||
this.loading = true
|
||||
post('/dataset/table/update', table)
|
||||
.then((response) => {
|
||||
if (!table.id) {
|
||||
updateCacheTree('batchNew', 'dataset-tree', response.data, JSON.parse(localStorage.getItem('dataset-tree')))
|
||||
}
|
||||
this.openMessageSuccess('deDataset.set_saved_successfully')
|
||||
this.cancel(response.data)
|
||||
})
|
||||
@ -645,10 +652,12 @@ export default {
|
||||
border-top-right-radius: 13px;
|
||||
border-bottom-right-radius: 13px;
|
||||
}
|
||||
|
||||
.table-list {
|
||||
p {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
height: 100%;
|
||||
width: 240px;
|
||||
padding: 16px 12px;
|
||||
@ -661,6 +670,7 @@ export default {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
color: var(--deTextPrimary, #1f2329);
|
||||
|
||||
i {
|
||||
font-size: 14px;
|
||||
color: var(--deTextPlaceholder, #8f959e);
|
||||
@ -674,10 +684,12 @@ export default {
|
||||
.table-checkbox-list {
|
||||
height: calc(100% - 100px);
|
||||
overflow-y: auto;
|
||||
|
||||
.custom-tree-node {
|
||||
position: relative;
|
||||
width: 80%;
|
||||
display: flex;
|
||||
|
||||
.label {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
@ -685,11 +697,13 @@ export default {
|
||||
width: 85%;
|
||||
}
|
||||
}
|
||||
|
||||
.error-name-exist {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.item {
|
||||
height: 40px;
|
||||
width: 215px;
|
||||
@ -727,6 +741,7 @@ export default {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
|
||||
.name {
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
@ -757,10 +772,12 @@ export default {
|
||||
padding: 2px 1.5px;
|
||||
display: inline-block;
|
||||
cursor: pointer;
|
||||
|
||||
i {
|
||||
margin-left: 4px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background: rgba(31, 35, 41, 0.1);
|
||||
border-radius: 4px;
|
||||
|
@ -70,7 +70,7 @@
|
||||
class="de-text-btn"
|
||||
@click="dataReference = true"
|
||||
>
|
||||
<svg-icon icon-class="data-reference" />
|
||||
<svg-icon icon-class="data-reference"/>
|
||||
{{ $t('deDataset.data_reference') }}
|
||||
</el-button>
|
||||
<el-button
|
||||
@ -80,17 +80,17 @@
|
||||
class="de-text-btn"
|
||||
@click="variableMgm"
|
||||
>
|
||||
<svg-icon icon-class="reference-setting" />
|
||||
<svg-icon icon-class="reference-setting"/>
|
||||
{{ $t('sql_variable.variable_mgm') }}
|
||||
</el-button>
|
||||
<el-divider direction="vertical" />
|
||||
<el-divider direction="vertical"/>
|
||||
<el-button
|
||||
class="de-text-btn"
|
||||
type="text"
|
||||
size="small"
|
||||
@click="getSQLPreview"
|
||||
>
|
||||
<svg-icon icon-class="reference-play" />
|
||||
<svg-icon icon-class="reference-play"/>
|
||||
{{ $t('deDataset.run_a_query') }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
@ -111,7 +111,7 @@
|
||||
dataTable = ''
|
||||
;keywords = ''
|
||||
"
|
||||
><i class="el-icon-arrow-left" /> {{ $t('chart.back') }}</span>
|
||||
><i class="el-icon-arrow-left"/> {{ $t('chart.back') }}</span>
|
||||
<span v-else>{{ $t('deDataset.data_reference') }}</span>
|
||||
<i
|
||||
style="cursor: pointer"
|
||||
@ -131,7 +131,7 @@
|
||||
:title="(showTable && dataTable) || selectedDatasource.name"
|
||||
class="grey-name"
|
||||
>
|
||||
<svg-icon icon-class="db-de" />
|
||||
<svg-icon icon-class="db-de"/>
|
||||
{{ (showTable && dataTable) || selectedDatasource.name }}
|
||||
</span>
|
||||
<span class="grey">
|
||||
@ -146,59 +146,61 @@
|
||||
v-if="!dataSource"
|
||||
class="no-select-datasource"
|
||||
>{{
|
||||
$t('deDataset.to_start_using')
|
||||
}}</span>
|
||||
$t('deDataset.to_start_using')
|
||||
}}</span>
|
||||
<template v-else>
|
||||
<el-input :placeholder="$t('fu.search_bar.please_input')" style="padding: 5px" size="small" v-model="keywords"></el-input>
|
||||
<el-input :placeholder="$t('fu.search_bar.please_input')" style="padding: 5px" size="small"
|
||||
v-model="keywords"
|
||||
></el-input>
|
||||
<div
|
||||
v-if="dataSource && !dataTable"
|
||||
v-loading="tableLoading"
|
||||
class="item-list"
|
||||
>
|
||||
<div
|
||||
v-for="ele in tableDataCopy"
|
||||
:key="ele.name"
|
||||
class="table-or-field"
|
||||
@click="typeSwitch(ele)"
|
||||
v-if="dataSource && !dataTable"
|
||||
v-loading="tableLoading"
|
||||
class="item-list"
|
||||
>
|
||||
<div
|
||||
v-for="ele in tableDataCopy"
|
||||
:key="ele.name"
|
||||
class="table-or-field"
|
||||
@click="typeSwitch(ele)"
|
||||
>
|
||||
<span
|
||||
:title="ele.remark"
|
||||
class="name"
|
||||
>{{ ele.name }}</span>
|
||||
<i
|
||||
v-clipboard:copy="ele.name"
|
||||
v-clipboard:success="onCopy"
|
||||
v-clipboard:error="onError"
|
||||
class="el-icon-document-copy"
|
||||
@click.stop
|
||||
/>
|
||||
<i
|
||||
v-clipboard:copy="ele.name"
|
||||
v-clipboard:success="onCopy"
|
||||
v-clipboard:error="onError"
|
||||
class="el-icon-document-copy"
|
||||
@click.stop
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
v-else-if="dataSource && dataTable"
|
||||
v-loading="tableLoading"
|
||||
class="item-list"
|
||||
>
|
||||
<div
|
||||
v-for="ele in fieldDataCopy"
|
||||
:key="ele.fieldName"
|
||||
class="table-or-field field"
|
||||
v-else-if="dataSource && dataTable"
|
||||
v-loading="tableLoading"
|
||||
class="item-list"
|
||||
>
|
||||
<div
|
||||
v-for="ele in fieldDataCopy"
|
||||
:key="ele.fieldName"
|
||||
class="table-or-field field"
|
||||
>
|
||||
<span
|
||||
:title="ele.remarks"
|
||||
class="name"
|
||||
>{{ ele.fieldName }}</span>
|
||||
<i
|
||||
v-clipboard:copy="ele.fieldName"
|
||||
v-clipboard:success="onCopy"
|
||||
v-clipboard:error="onError"
|
||||
class="el-icon-document-copy"
|
||||
@click.stop
|
||||
/>
|
||||
<i
|
||||
v-clipboard:copy="ele.fieldName"
|
||||
v-clipboard:success="onCopy"
|
||||
v-clipboard:error="onError"
|
||||
class="el-icon-document-copy"
|
||||
@click.stop
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="sql-table">
|
||||
<div
|
||||
@ -229,10 +231,10 @@
|
||||
v-if="tabActive === 'result'"
|
||||
class="result-num"
|
||||
>{{
|
||||
`(${$t('dataset.preview_show')} 1000 ${$t(
|
||||
'dataset.preview_item'
|
||||
)})`
|
||||
}}</span>
|
||||
`(${$t('dataset.preview_show')} 1000 ${$t(
|
||||
'dataset.preview_item'
|
||||
)})`
|
||||
}}</span>
|
||||
|
||||
<span
|
||||
class="drag"
|
||||
@ -269,7 +271,8 @@
|
||||
:image-size="60"
|
||||
:image="errImg"
|
||||
:description="$t('deDataset.run_failed')"
|
||||
>{{ errMsgCont }}</el-empty>
|
||||
>{{ errMsgCont }}
|
||||
</el-empty>
|
||||
<el-table
|
||||
v-else
|
||||
:data="plxTableData"
|
||||
@ -365,7 +368,7 @@
|
||||
direction="rtl"
|
||||
>
|
||||
<div class="content">
|
||||
<i class="el-icon-info" />
|
||||
<i class="el-icon-info"/>
|
||||
{{ $t('dataset.sql_variable_limit_1') }}<br>
|
||||
{{ $t('dataset.sql_variable_limit_2') }}<br>
|
||||
</div>
|
||||
@ -451,7 +454,7 @@
|
||||
:content="$t('commons.parameter_effect')"
|
||||
placement="top"
|
||||
>
|
||||
<i class="el-icon-warning" />
|
||||
<i class="el-icon-warning"/>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
@ -519,14 +522,16 @@
|
||||
secondary
|
||||
@click="closeVariableMgm"
|
||||
>{{
|
||||
$t('dataset.cancel')
|
||||
}}</deBtn>
|
||||
$t('dataset.cancel')
|
||||
}}
|
||||
</deBtn>
|
||||
<deBtn
|
||||
type="primary"
|
||||
@click="saveVariable()"
|
||||
>{{
|
||||
$t('dataset.confirm')
|
||||
}}</deBtn>
|
||||
$t('dataset.confirm')
|
||||
}}
|
||||
</deBtn>
|
||||
</div>
|
||||
</el-drawer>
|
||||
</div>
|
||||
@ -536,9 +541,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { post, listDatasource, isKettleRunning } from '@/api/dataset/dataset'
|
||||
import { getTable, isKettleRunning, listDatasource, post } from '@/api/dataset/dataset'
|
||||
import { codemirror } from 'vue-codemirror'
|
||||
import { getTable } from '@/api/dataset/dataset'
|
||||
import { Base64 } from 'js-base64'
|
||||
// 核心样式
|
||||
import 'codemirror/lib/codemirror.css'
|
||||
@ -568,6 +572,8 @@ import cancelMix from './cancelMix'
|
||||
import { pySort } from './util'
|
||||
import _ from 'lodash'
|
||||
import GridTable from '@/components/gridTable/index.vue'
|
||||
import { updateCacheTree } from '@/components/canvas/utils/utils'
|
||||
|
||||
export default {
|
||||
name: 'AddSQL',
|
||||
components: { codemirror, GridTable },
|
||||
@ -575,7 +581,8 @@ export default {
|
||||
props: {
|
||||
param: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
default: () => {
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@ -762,7 +769,7 @@ export default {
|
||||
this.fieldData = res.data
|
||||
this.fieldDataCopy = this.arrSort([...this.fieldData])
|
||||
})
|
||||
.finally(() => {
|
||||
.finally(() => {
|
||||
this.tableLoading = false
|
||||
})
|
||||
},
|
||||
@ -827,8 +834,8 @@ export default {
|
||||
},
|
||||
arrSort(arr = [], field = 'fieldName') {
|
||||
arr.sort((a, b) => {
|
||||
return a[field][0].toLowerCase().charCodeAt() - b[field][0].toLowerCase().charCodeAt()
|
||||
})
|
||||
return a[field][0].toLowerCase().charCodeAt() - b[field][0].toLowerCase().charCodeAt()
|
||||
})
|
||||
|
||||
return arr
|
||||
},
|
||||
@ -923,16 +930,17 @@ export default {
|
||||
listSqlLog() {
|
||||
post(
|
||||
'/dataset/table/sqlLog/' +
|
||||
this.paginationConfig.currentPage +
|
||||
'/' +
|
||||
this.paginationConfig.pageSize,
|
||||
this.paginationConfig.currentPage +
|
||||
'/' +
|
||||
this.paginationConfig.pageSize,
|
||||
{ id: this.param.tableId, dataSourceId: this.dataSource }
|
||||
)
|
||||
.then((response) => {
|
||||
this.sqlData = response.data.listObject
|
||||
this.paginationConfig.total = response.data.itemCount
|
||||
})
|
||||
.catch(() => {})
|
||||
.catch(() => {
|
||||
})
|
||||
},
|
||||
save() {
|
||||
if (!this.dataSource || this.datasource === '') {
|
||||
@ -965,6 +973,12 @@ export default {
|
||||
}
|
||||
post('/dataset/table/update', table)
|
||||
.then((response) => {
|
||||
if (table.id) {
|
||||
const renameNode = { id: table.id, name: table.name, label: table.name }
|
||||
updateCacheTree('rename', 'dataset-tree', renameNode, JSON.parse(localStorage.getItem('dataset-tree')))
|
||||
} else {
|
||||
updateCacheTree('batchNew', 'dataset-tree', response.data, JSON.parse(localStorage.getItem('dataset-tree')))
|
||||
}
|
||||
this.openMessageSuccess('deDataset.set_saved_successfully')
|
||||
this.cancel(response.data)
|
||||
})
|
||||
@ -975,14 +989,16 @@ export default {
|
||||
onCopy(e) {
|
||||
this.openMessageSuccess('commons.copy_success')
|
||||
},
|
||||
onError(e) {},
|
||||
onError(e) {
|
||||
},
|
||||
showSQL(val) {
|
||||
this.sql = val || ''
|
||||
},
|
||||
onCmReady(cm) {
|
||||
this.codemirror.setSize('-webkit-fill-available', 'auto')
|
||||
},
|
||||
onCmFocus(cm) {},
|
||||
onCmFocus(cm) {
|
||||
},
|
||||
onCmCodeChange(newCode) {
|
||||
this.sql = newCode
|
||||
this.$emit('codeChange', this.sql)
|
||||
@ -1068,6 +1084,7 @@ export default {
|
||||
|
||||
.select-type {
|
||||
width: 180px;
|
||||
|
||||
.el-input__inner {
|
||||
padding-left: 32px;
|
||||
}
|
||||
@ -1079,6 +1096,7 @@ export default {
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
|
||||
.content {
|
||||
height: 62px;
|
||||
width: 822px;
|
||||
@ -1097,14 +1115,17 @@ export default {
|
||||
font-size: 14px;
|
||||
color: var(--primary, #3370ff);
|
||||
}
|
||||
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
.dataset-sql {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.sql-editer {
|
||||
background: #f5f6f7;
|
||||
padding: 16px 24px;
|
||||
@ -1115,11 +1136,13 @@ export default {
|
||||
display: flex;
|
||||
flex-direction: row-reverse;
|
||||
overflow: hidden;
|
||||
|
||||
.data-reference {
|
||||
width: 280px;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
border-left: 1px solid var(--deCardStrokeColor, #dee0e3);
|
||||
|
||||
.no-select-datasource {
|
||||
font-family: PingFang SC;
|
||||
font-size: 14px;
|
||||
@ -1129,6 +1152,7 @@ export default {
|
||||
width: 100%;
|
||||
padding: 16px 12px;
|
||||
}
|
||||
|
||||
.table-database-name {
|
||||
font-family: PingFang SC;
|
||||
font-size: 16px;
|
||||
@ -1136,6 +1160,7 @@ export default {
|
||||
color: var(--deTextPrimary, #1f2329);
|
||||
padding: 16px 12px;
|
||||
border-bottom: 1px solid var(--deCardStrokeColor, #dee0e3);
|
||||
|
||||
p {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@ -1161,6 +1186,7 @@ export default {
|
||||
padding: 16px 8px;
|
||||
height: calc(100vh - 242px);
|
||||
overflow: auto;
|
||||
|
||||
.table-or-field {
|
||||
height: 40px;
|
||||
width: 100%;
|
||||
@ -1203,34 +1229,40 @@ export default {
|
||||
i {
|
||||
display: block;
|
||||
}
|
||||
|
||||
background: rgba(31, 35, 41, 0.1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.sql-table {
|
||||
flex: 1;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
|
||||
.code-container {
|
||||
background: #f5f6f7;
|
||||
box-sizing: border-box;
|
||||
min-height: 248px;
|
||||
color: var(--deTextPrimary, #1f2329);
|
||||
|
||||
.CodeMirror {
|
||||
height: 100% !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.sql-result {
|
||||
font-family: PingFang SC;
|
||||
font-size: 14px;
|
||||
overflow-y: auto;
|
||||
box-sizing: border-box;
|
||||
flex: 1;
|
||||
|
||||
.sql-title {
|
||||
user-select: none;
|
||||
height: 54px;
|
||||
@ -1247,6 +1279,7 @@ export default {
|
||||
color: var(--deTextSecondary, #646a73);
|
||||
margin-left: 12px;
|
||||
}
|
||||
|
||||
.drag {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
@ -1271,6 +1304,7 @@ export default {
|
||||
padding: 0 25px 18px 25px;
|
||||
overflow-y: auto;
|
||||
box-sizing: border-box;
|
||||
|
||||
.el-empty__bottom,
|
||||
.el-empty__description p {
|
||||
font-family: PingFang SC;
|
||||
@ -1281,16 +1315,20 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.table-container {
|
||||
height: calc(100% - 125px);
|
||||
padding: 0 24px;
|
||||
|
||||
.mar6 {
|
||||
margin-right: 6px;
|
||||
}
|
||||
|
||||
.mar3 {
|
||||
margin-left: -3px;
|
||||
}
|
||||
}
|
||||
|
||||
.table-container-filter {
|
||||
height: calc(100% - 110px);
|
||||
}
|
||||
|
@ -53,8 +53,8 @@
|
||||
<div class="sql-title">
|
||||
{{ $t('deDataset.data_preview') }}
|
||||
<span class="result-num">{{
|
||||
`(${$t('dataset.preview_show')} 1000 ${$t('dataset.preview_item')})`
|
||||
}}</span>
|
||||
`(${$t('dataset.preview_show')} 1000 ${$t('dataset.preview_item')})`
|
||||
}}</span>
|
||||
<span
|
||||
class="drag"
|
||||
@mousedown="mousedownDrag"
|
||||
@ -96,13 +96,15 @@
|
||||
secondary
|
||||
@click="closeSelectDs()"
|
||||
>{{
|
||||
$t('dataset.cancel')
|
||||
}}</deBtn>
|
||||
$t('dataset.cancel')
|
||||
}}
|
||||
</deBtn>
|
||||
<deBtn
|
||||
:disabled="!tempDs.id"
|
||||
type="primary"
|
||||
@click="confirmSelectDs()"
|
||||
>{{ $t('dataset.confirm') }}</deBtn>
|
||||
>{{ $t('dataset.confirm') }}
|
||||
</deBtn>
|
||||
</div>
|
||||
</el-drawer>
|
||||
|
||||
@ -120,20 +122,22 @@
|
||||
size="840px"
|
||||
direction="rtl"
|
||||
>
|
||||
<union-edit :union-param="unionParam" />
|
||||
<union-edit :union-param="unionParam"/>
|
||||
<div class="de-foot">
|
||||
<deBtn
|
||||
secondary
|
||||
@click="closeEditUnion()"
|
||||
>{{
|
||||
$t('dataset.cancel')
|
||||
}}</deBtn>
|
||||
$t('dataset.cancel')
|
||||
}}
|
||||
</deBtn>
|
||||
<deBtn
|
||||
type="primary"
|
||||
@click="confirmEditUnion()"
|
||||
>{{
|
||||
$t('dataset.confirm')
|
||||
}}</deBtn>
|
||||
$t('dataset.confirm')
|
||||
}}
|
||||
</deBtn>
|
||||
</div>
|
||||
</el-drawer>
|
||||
</div>
|
||||
@ -148,6 +152,8 @@ import { post } from '@/api/dataset/dataset'
|
||||
import UnionPreview from '@/views/dataset/add/union/UnionPreview'
|
||||
import cancelMix from './cancelMix'
|
||||
import msgCfm from '@/components/msgCfm/index'
|
||||
import { updateCacheTree } from '@/components/canvas/utils/utils'
|
||||
|
||||
export default {
|
||||
name: 'AddUnion',
|
||||
components: {
|
||||
@ -267,6 +273,12 @@ export default {
|
||||
}
|
||||
post('/dataset/table/update', table)
|
||||
.then((response) => {
|
||||
if (table.id) {
|
||||
const renameNode = { id: table.id, name: table.name, label: table.name }
|
||||
updateCacheTree('rename', 'dataset-tree', renameNode, JSON.parse(localStorage.getItem('dataset-tree')))
|
||||
} else {
|
||||
updateCacheTree('batchNew', 'dataset-tree', response.data, JSON.parse(localStorage.getItem('dataset-tree')))
|
||||
}
|
||||
this.$emit('saveSuccess', table)
|
||||
this.cancel(response.data)
|
||||
})
|
||||
@ -413,6 +425,7 @@ export default {
|
||||
overflow-y: auto;
|
||||
box-sizing: border-box;
|
||||
flex: 1;
|
||||
|
||||
.sql-title {
|
||||
user-select: none;
|
||||
height: 54px;
|
||||
@ -437,6 +450,7 @@ export default {
|
||||
color: var(--deTextSecondary, #646a73);
|
||||
margin-left: 12px;
|
||||
}
|
||||
|
||||
.drag {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
|
Loading…
Reference in New Issue
Block a user