Merge branch 'dev' into v1.18
This commit is contained in:
commit
9a9321424b
@ -8,5 +8,5 @@ referer = "referer"
|
||||
keynode = "keynode"
|
||||
|
||||
[files]
|
||||
extend-exclude = ["public/", "amap-wx/", "m-icon/", "uni-card/", "uni-col/", "uni-link/", "uni-list/", "uni-list-item/", "uni-row/", "migration/", "mapFiles/"]
|
||||
extend-exclude = ["public/", "amap-wx/", "m-icon/", "uni-card/", "uni-col/", "uni-link/", "uni-list/", "uni-list-item/", "uni-row/", "migration/", "mapFiles/", "frontend/src/views/chart/components/table/TableNormal.vue"]
|
||||
|
||||
|
||||
@ -146,6 +146,7 @@ public class PanelGroupController {
|
||||
|
||||
@ApiOperation("站内导出仪表板视图明细")
|
||||
@PostMapping("/innerExportDetails")
|
||||
@DePermissionProxy(value = "proxy")
|
||||
@I18n
|
||||
public void innerExportDetails(@RequestBody PanelViewDetailsRequest request, HttpServletResponse response) throws IOException {
|
||||
panelGroupService.exportPanelViewDetails(request, response);
|
||||
|
||||
@ -54,8 +54,8 @@ public interface LinkApi {
|
||||
boolean validatePwd(PasswordRequest request) throws Exception;
|
||||
|
||||
@ApiOperation("资源详细信息")
|
||||
@GetMapping("/resourceDetail/{resourceId}")
|
||||
Object resourceDetail(@PathVariable String resourceId);
|
||||
@GetMapping("/resourceDetail/{resourceId}/{userId}")
|
||||
Object resourceDetail(@PathVariable String resourceId,@PathVariable String userId);
|
||||
|
||||
@ApiOperation("视图详细信息")
|
||||
@PostMapping("/viewDetail/{viewId}/{panelId}")
|
||||
|
||||
@ -94,8 +94,8 @@ public class LinkServer implements LinkApi {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object resourceDetail(@PathVariable String resourceId) {
|
||||
return panelLinkService.resourceInfo(resourceId);
|
||||
public Object resourceDetail(@PathVariable String resourceId,@PathVariable String userId) {
|
||||
return panelLinkService.resourceInfo(resourceId,userId);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -125,7 +125,7 @@ public class LinkServer implements LinkApi {
|
||||
operateType = SysLogConstants.OPERATE_TYPE.MB_VIEW;
|
||||
}
|
||||
if (ObjectUtils.isEmpty(userId)) return;
|
||||
PanelGroupWithBLOBs panelGroupWithBLOBs = panelLinkService.resourceInfo(panelId);
|
||||
PanelGroupWithBLOBs panelGroupWithBLOBs = panelLinkService.resourceInfo(panelId,String.valueOf(userId));
|
||||
String pid = panelGroupWithBLOBs.getPid();
|
||||
DeLogUtils.save(operateType, SysLogConstants.SOURCE_TYPE.LINK, panelId, pid, userId, SysLogConstants.SOURCE_TYPE.USER);
|
||||
}
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
package io.dataease.controller.request.panel;
|
||||
|
||||
import io.dataease.controller.request.chart.ChartExtRequest;
|
||||
import io.dataease.dto.PermissionProxy;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
@ -35,4 +37,7 @@ public class PanelViewDetailsRequest {
|
||||
|
||||
private List<String> excelHeaderKeys;
|
||||
|
||||
@ApiModelProperty(hidden = true)
|
||||
private PermissionProxy proxy;
|
||||
|
||||
}
|
||||
|
||||
@ -777,6 +777,14 @@ public class JdbcProvider extends DefaultJdbcProvider {
|
||||
case StarRocks:
|
||||
MysqlConfiguration mysqlConfiguration = new Gson().fromJson(datasource.getConfiguration(), MysqlConfiguration.class);
|
||||
mysqlConfiguration.getJdbc();
|
||||
case redshift:
|
||||
RedshiftConfiguration redshiftConfiguration = new Gson().fromJson(datasource.getConfiguration(), RedshiftConfiguration.class);
|
||||
if(redshiftConfiguration.getDataBase().length() > 64 || redshiftConfiguration.getDataBase().length() < 1){
|
||||
throw new Exception("Invalid database name");
|
||||
}
|
||||
if(!redshiftConfiguration.getDataBase().matches("\"^[a-z][a-z0-9_+.@-]*$\"")){
|
||||
throw new Exception("Invalid database name");
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@ -1328,4 +1328,9 @@ public class EsQueryProvider extends QueryProvider {
|
||||
public String getResultCount(boolean isTable, String sql, List<ChartViewFieldDTO> xAxis, List<ChartFieldCustomFilterDTO> fieldCustomFilter, List<DataSetRowPermissionsTreeDTO> rowPermissionsTree, List<ChartExtFilterRequest> extFilterRequestList, Datasource ds, ChartViewWithBLOBs view) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String sqlForPreview(String table, Datasource ds) {
|
||||
return "SELECT * FROM " + String.format(EsSqlLConstants.KEYWORD_TABLE, table);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1154,6 +1154,7 @@ public class ImpalaQueryProvider extends QueryProvider {
|
||||
String format = transDateFormat(x.getDateStyle(), x.getDatePattern());
|
||||
if (x.getDeExtractType() == DeTypeConstants.DE_STRING) {
|
||||
fieldName = String.format(ImpalaConstants.STR_TO_DATE, originField, StringUtils.isNotEmpty(x.getDateFormat()) ? x.getDateFormat() : ImpalaConstants.DEFAULT_DATE_FORMAT ,ImpalaConstants.DEFAULT_DATE_FORMAT);
|
||||
fieldName = String.format(ImpalaConstants.DATE_FORMAT, fieldName, format);
|
||||
} else {
|
||||
String cast = String.format(ImpalaConstants.CAST, originField, ImpalaConstants.DEFAULT_INT_FORMAT) + "/1000";
|
||||
String from_unixtime = String.format(ImpalaConstants.FROM_UNIXTIME, cast, ImpalaConstants.DEFAULT_DATE_FORMAT);
|
||||
|
||||
@ -11,6 +11,7 @@ import io.dataease.controller.request.panel.link.OverTimeRequest;
|
||||
import io.dataease.controller.request.panel.link.PasswordRequest;
|
||||
import io.dataease.dto.panel.PanelGroupDTO;
|
||||
import io.dataease.dto.panel.link.GenerateDto;
|
||||
import io.dataease.ext.ExtPanelGroupMapper;
|
||||
import io.dataease.ext.ExtPanelLinkMapper;
|
||||
import io.dataease.plugins.common.base.domain.*;
|
||||
import io.dataease.plugins.common.base.mapper.PanelGroupMapper;
|
||||
@ -49,6 +50,8 @@ public class PanelLinkService {
|
||||
private PanelLinkMappingMapper panelLinkMappingMapper;
|
||||
@Resource
|
||||
private PanelWatermarkMapper panelWatermarkMapper;
|
||||
@Resource
|
||||
private ExtPanelGroupMapper extPanelGroupMapper;
|
||||
|
||||
@Transactional
|
||||
public void changeValid(LinkRequest request) {
|
||||
@ -234,12 +237,10 @@ public class PanelLinkService {
|
||||
return pass;
|
||||
}
|
||||
|
||||
public PanelGroupDTO resourceInfo(String resourceId) {
|
||||
PanelGroupWithBLOBs result = panelGroupMapper.selectByPrimaryKey(resourceId);
|
||||
PanelGroupDTO panelGroupDTO = new PanelGroupDTO();
|
||||
BeanUtils.copyBean(panelGroupDTO, result);
|
||||
panelGroupDTO.setWatermarkInfo(panelWatermarkMapper.selectByPrimaryKey("system_default"));
|
||||
return panelGroupDTO;
|
||||
public PanelGroupDTO resourceInfo(String resourceId,String userId) {
|
||||
PanelGroupDTO result = extPanelGroupMapper.findOneWithPrivileges(resourceId,userId);
|
||||
result.setWatermarkInfo(panelWatermarkMapper.selectByPrimaryKey("system_default"));
|
||||
return result;
|
||||
}
|
||||
|
||||
public String getShortUrl(String resourceId) {
|
||||
|
||||
@ -2,3 +2,54 @@ UPDATE `my_plugin`
|
||||
SET `version` = '1.18.5'
|
||||
where `plugin_id` > 0
|
||||
and `version` = '1.18.4';
|
||||
|
||||
|
||||
DROP FUNCTION IF EXISTS `get_auths`;
|
||||
delimiter ;;
|
||||
CREATE FUNCTION `get_auths`(authSource varchar(255),modelType varchar(255),userId varchar(255))
|
||||
RETURNS longtext CHARSET utf8mb4
|
||||
READS SQL DATA
|
||||
BEGIN
|
||||
|
||||
DECLARE oTemp longtext;
|
||||
|
||||
DECLARE isAdmin int;
|
||||
|
||||
select sys_user.is_admin INTO isAdmin from sys_user where user_id =userId;
|
||||
IF isAdmin = 1 THEN
|
||||
return 'ignore';
|
||||
ELSE
|
||||
SELECT
|
||||
group_concat( DISTINCT sys_auth_detail.privilege_extend) into oTemp
|
||||
FROM
|
||||
(
|
||||
`sys_auth`
|
||||
LEFT JOIN `sys_auth_detail` ON ((
|
||||
`sys_auth`.`id` = `sys_auth_detail`.`auth_id`
|
||||
)))
|
||||
where sys_auth_detail.privilege_value =1
|
||||
and sys_auth.auth_source=authSource
|
||||
AND (
|
||||
(
|
||||
sys_auth.auth_target_type = 'dept'
|
||||
AND sys_auth.auth_target in ( SELECT dept_id FROM sys_user WHERE user_id = userId )
|
||||
)
|
||||
OR (
|
||||
sys_auth.auth_target_type = 'user'
|
||||
AND sys_auth.auth_target = userId
|
||||
)
|
||||
OR (
|
||||
sys_auth.auth_target_type = 'role'
|
||||
AND sys_auth.auth_target in ( SELECT role_id FROM sys_users_roles WHERE user_id = userId )
|
||||
)
|
||||
)
|
||||
GROUP BY
|
||||
`sys_auth`.`auth_source`,
|
||||
`sys_auth`.`auth_source_type`;
|
||||
RETURN oTemp;
|
||||
|
||||
END if;
|
||||
|
||||
END
|
||||
;;
|
||||
delimiter ;
|
||||
@ -66,9 +66,9 @@ export function loadGenerate(resourceId) {
|
||||
})
|
||||
}
|
||||
|
||||
export function loadResource(resourceId) {
|
||||
export function loadResource(resourceId,userId) {
|
||||
return request({
|
||||
url: 'api/link/resourceDetail/' + resourceId,
|
||||
url: 'api/link/resourceDetail/' + resourceId+'/'+ userId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
@ -124,6 +124,9 @@ export default {
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
panelInfo() {
|
||||
return this.$store.state.panel.panelInfo
|
||||
},
|
||||
isAbsoluteContainer() {
|
||||
return this.showChartCanvas && this.chart.type === 'symbol-map'
|
||||
},
|
||||
@ -288,6 +291,7 @@ export default {
|
||||
})
|
||||
}
|
||||
const request = {
|
||||
proxy:null,
|
||||
viewId: this.chart.id,
|
||||
viewName: excelName,
|
||||
header: excelHeader,
|
||||
@ -306,6 +310,10 @@ export default {
|
||||
if (!token && linkToken) {
|
||||
method = exportDetails
|
||||
}
|
||||
|
||||
if (this.panelInfo.proxy) {
|
||||
request.proxy = { userId: this.panelInfo.proxy }
|
||||
}
|
||||
method(request).then((res) => {
|
||||
const blob = new Blob([res], { type: 'application/vnd.ms-excel' })
|
||||
const link = document.createElement('a')
|
||||
|
||||
@ -1516,7 +1516,10 @@ export default {
|
||||
p_right: 'Right',
|
||||
p_top: 'Top',
|
||||
p_bottom: 'Bottom',
|
||||
p_center: 'Center'
|
||||
p_center: 'Center',
|
||||
table_auto_break_line: 'Auto Line Feed',
|
||||
table_break_line_tip: 'If open this option,the table item height will disabled.',
|
||||
step: 'Step(px)'
|
||||
},
|
||||
dataset: {
|
||||
scope_edit: 'Effective only when editing',
|
||||
|
||||
@ -1510,7 +1510,10 @@ export default {
|
||||
p_right: '右對齊',
|
||||
p_top: '上對齊',
|
||||
p_bottom: '下對齊',
|
||||
p_center: '居中'
|
||||
p_center: '居中',
|
||||
table_auto_break_line: '自動換行',
|
||||
table_break_line_tip: '開啟自動換行,表格行高設置將失效',
|
||||
step: '步長(px)'
|
||||
},
|
||||
dataset: {
|
||||
scope_edit: '僅編輯時生效',
|
||||
|
||||
@ -1509,7 +1509,10 @@ export default {
|
||||
p_right: '右对齐',
|
||||
p_top: '上对齐',
|
||||
p_bottom: '下对齐',
|
||||
p_center: '居中'
|
||||
p_center: '居中',
|
||||
table_auto_break_line: '自动换行',
|
||||
table_break_line_tip: '开启自动换行,表格行高设置将失效',
|
||||
step: '步长(px)'
|
||||
},
|
||||
dataset: {
|
||||
scope_edit: '仅编辑时生效',
|
||||
|
||||
@ -113,7 +113,7 @@ Vue.use(VueVideoPlayer)
|
||||
Vue.use(proportion)
|
||||
|
||||
Vue.prototype.hasDataPermission = function(pTarget, pSource) {
|
||||
if (this.$store.state.user.user.isAdmin) {
|
||||
if (this.$store.state.user.user.isAdmin || pSource === 'ignore') {
|
||||
return true
|
||||
}
|
||||
if (pSource && pTarget) {
|
||||
|
||||
@ -9,7 +9,7 @@ export function checkPermission(pers) {
|
||||
}
|
||||
|
||||
export function hasDataPermission(pTarget, pSource) {
|
||||
if (store.state.user.user.isAdmin) {
|
||||
if (store.state.user.user.isAdmin || pSource === 'ignore') {
|
||||
return true
|
||||
}
|
||||
if (pSource && pTarget) {
|
||||
|
||||
@ -77,6 +77,7 @@ export const DEFAULT_SIZE = {
|
||||
tableColumnWidth: 100,
|
||||
tableHeaderAlign: 'left',
|
||||
tableItemAlign: 'right',
|
||||
tableAutoBreakLine: false,
|
||||
gaugeMinType: 'fix', // fix or dynamic
|
||||
gaugeMinField: {
|
||||
id: '',
|
||||
@ -462,7 +463,8 @@ export const DEFAULT_THRESHOLD = {
|
||||
export const DEFAULT_SCROLL = {
|
||||
open: false,
|
||||
row: 1,
|
||||
interval: 2000
|
||||
interval: 2000,
|
||||
step: 50
|
||||
}
|
||||
// chart config
|
||||
export const BASE_BAR = {
|
||||
|
||||
@ -1847,6 +1847,7 @@ export const TYPE_CONFIGS = [
|
||||
'tableItemBgColor',
|
||||
'tableHeaderFontColor',
|
||||
'tableFontColor',
|
||||
'tableBorderColor',
|
||||
'tableScrollBarColor',
|
||||
'alpha'
|
||||
],
|
||||
@ -1857,7 +1858,8 @@ export const TYPE_CONFIGS = [
|
||||
'tableItemHeight',
|
||||
'tableColumnWidth',
|
||||
'showIndex',
|
||||
'indexLabel'
|
||||
'indexLabel',
|
||||
'tableAutoBreakLine'
|
||||
],
|
||||
'title-selector': [
|
||||
'show',
|
||||
@ -1887,6 +1889,7 @@ export const TYPE_CONFIGS = [
|
||||
'tableItemBgColor',
|
||||
'tableHeaderFontColor',
|
||||
'tableFontColor',
|
||||
'tableBorderColor',
|
||||
'tableScrollBarColor',
|
||||
'alpha'
|
||||
],
|
||||
@ -1899,7 +1902,8 @@ export const TYPE_CONFIGS = [
|
||||
'tableItemHeight',
|
||||
'tableColumnWidth',
|
||||
'showIndex',
|
||||
'indexLabel'
|
||||
'indexLabel',
|
||||
'tableAutoBreakLine'
|
||||
],
|
||||
'title-selector': [
|
||||
'show',
|
||||
|
||||
@ -31,6 +31,7 @@
|
||||
</el-form-item>
|
||||
<span v-show="scrollForm.open">
|
||||
<el-form-item
|
||||
v-show="!isAutoBreakLine"
|
||||
:label="$t('chart.row')"
|
||||
class="form-item"
|
||||
>
|
||||
@ -43,6 +44,20 @@
|
||||
@change="changeScrollCfg"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-show="isAutoBreakLine"
|
||||
:label="$t('chart.step')"
|
||||
class="form-item"
|
||||
>
|
||||
<el-input-number
|
||||
v-model="scrollForm.step"
|
||||
:min="1"
|
||||
:max="10000"
|
||||
:precision="0"
|
||||
size="mini"
|
||||
@change="changeScrollCfg"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
:label="$t('chart.interval') + '(ms)'"
|
||||
class="form-item"
|
||||
@ -63,7 +78,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { DEFAULT_SCROLL } from '@/views/chart/chart/chart'
|
||||
import { DEFAULT_SCROLL, DEFAULT_SIZE } from '@/views/chart/chart/chart'
|
||||
|
||||
export default {
|
||||
name: 'ScrollCfg',
|
||||
@ -75,7 +90,8 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
scrollForm: JSON.parse(JSON.stringify(DEFAULT_SCROLL))
|
||||
scrollForm: JSON.parse(JSON.stringify(DEFAULT_SCROLL)),
|
||||
isAutoBreakLine: false
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@ -100,10 +116,26 @@ export default {
|
||||
}
|
||||
if (senior.scrollCfg) {
|
||||
this.scrollForm = senior.scrollCfg
|
||||
this.scrollForm.step = senior.scrollCfg.step ? senior.scrollCfg.step : DEFAULT_SCROLL.step
|
||||
} else {
|
||||
this.scrollForm = JSON.parse(JSON.stringify(DEFAULT_SCROLL))
|
||||
}
|
||||
}
|
||||
if (chart.customAttr) {
|
||||
let customAttr = null
|
||||
if (Object.prototype.toString.call(chart.customAttr) === '[object Object]') {
|
||||
customAttr = JSON.parse(JSON.stringify(chart.customAttr))
|
||||
} else {
|
||||
customAttr = JSON.parse(chart.customAttr)
|
||||
}
|
||||
if (customAttr.size) {
|
||||
if (this.chart.render === 'antv') {
|
||||
this.isAutoBreakLine = false
|
||||
} else {
|
||||
this.isAutoBreakLine = customAttr.size.tableAutoBreakLine ? customAttr.size.tableAutoBreakLine : DEFAULT_SIZE.tableAutoBreakLine
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
changeScrollCfg() {
|
||||
this.$emit('onScrollCfgChange', this.scrollForm)
|
||||
|
||||
@ -283,6 +283,30 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-show="showProperty('tableAutoBreakLine')"
|
||||
label-width="100px"
|
||||
:label="$t('chart.table_auto_break_line')"
|
||||
class="form-item"
|
||||
>
|
||||
<el-checkbox
|
||||
v-model="sizeForm.tableAutoBreakLine"
|
||||
@change="changeBarSizeCase('tableAutoBreakLine')"
|
||||
>{{ $t('chart.open') }}</el-checkbox>
|
||||
<el-tooltip
|
||||
class="item"
|
||||
effect="dark"
|
||||
placement="bottom"
|
||||
>
|
||||
<div slot="content">
|
||||
{{ $t('chart.table_break_line_tip') }}
|
||||
</div>
|
||||
<i
|
||||
class="el-icon-info"
|
||||
style="cursor: pointer;color: gray;font-size: 12px;"
|
||||
/>
|
||||
</el-tooltip>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-show="showProperty('tableTitleFontSize')"
|
||||
label-width="100px"
|
||||
@ -345,6 +369,7 @@
|
||||
>
|
||||
<el-slider
|
||||
v-model="sizeForm.tableItemHeight"
|
||||
:disabled="sizeForm.tableAutoBreakLine"
|
||||
:min="36"
|
||||
:max="100"
|
||||
show-input
|
||||
@ -1127,6 +1152,8 @@ export default {
|
||||
|
||||
this.sizeForm.hPosition = this.sizeForm.hPosition ? this.sizeForm.hPosition : DEFAULT_SIZE.hPosition
|
||||
this.sizeForm.vPosition = this.sizeForm.vPosition ? this.sizeForm.vPosition : DEFAULT_SIZE.vPosition
|
||||
|
||||
this.sizeForm.tableAutoBreakLine = this.sizeForm.tableAutoBreakLine ? this.sizeForm.tableAutoBreakLine : DEFAULT_SIZE.tableAutoBreakLine
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@ -4,7 +4,10 @@
|
||||
:style="bg_class"
|
||||
style="padding: 8px;width: 100%;height: 100%;overflow: hidden;"
|
||||
>
|
||||
<el-row style="height: 100%;">
|
||||
<el-row
|
||||
style="height: 100%;"
|
||||
:style="cssVars"
|
||||
>
|
||||
<p
|
||||
v-show="title_show"
|
||||
ref="title"
|
||||
@ -93,7 +96,7 @@
|
||||
<script>
|
||||
import { hexColorToRGBA } from '../../chart/util'
|
||||
import eventBus from '@/components/canvas/utils/eventBus'
|
||||
import { DEFAULT_COLOR_CASE, DEFAULT_SIZE, NOT_SUPPORT_PAGE_DATASET } from '@/views/chart/chart/chart'
|
||||
import { DEFAULT_COLOR_CASE, DEFAULT_SCROLL, DEFAULT_SIZE, NOT_SUPPORT_PAGE_DATASET } from '@/views/chart/chart/chart'
|
||||
import { mapState } from 'vuex'
|
||||
import DePagination from '@/components/deCustomCm/pagination.js'
|
||||
|
||||
@ -178,7 +181,13 @@ export default {
|
||||
color: '#606266'
|
||||
},
|
||||
not_support_page_dataset: NOT_SUPPORT_PAGE_DATASET,
|
||||
mergeCells: []
|
||||
mergeCells: [],
|
||||
cssStyleParams: {
|
||||
borderColor: DEFAULT_COLOR_CASE.tableBorderColor,
|
||||
overflow: 'hidden',
|
||||
textOverflow: 'ellipsis',
|
||||
whiteSpace: 'nowrap'
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@ -208,7 +217,16 @@ export default {
|
||||
},
|
||||
...mapState([
|
||||
'previewCanvasScale'
|
||||
])
|
||||
]),
|
||||
cssVars() {
|
||||
return {
|
||||
'--color': this.cssStyleParams.borderColor,
|
||||
'--overflow': this.cssStyleParams.overflow,
|
||||
'--text-overflow': this.cssStyleParams.textOverflow,
|
||||
'--white-space': this.cssStyleParams.whiteSpace
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
watch: {
|
||||
chart: function() {
|
||||
@ -329,6 +347,7 @@ export default {
|
||||
calcHeightRightNow() {
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.tableContainer) {
|
||||
const attr = JSON.parse(this.chart.customAttr)
|
||||
let pageHeight = 0
|
||||
if (this.showPage) {
|
||||
pageHeight = 36
|
||||
@ -338,24 +357,33 @@ export default {
|
||||
let tableHeight
|
||||
if (this.chart.data) {
|
||||
if (this.chart.type === 'table-info') {
|
||||
tableHeight = (this.currentPage.pageSize + 2) * 36 - pageHeight
|
||||
if (this.showPage) {
|
||||
tableHeight = this.currentPage.pageSize * attr.size.tableItemHeight + attr.size.tableTitleHeight
|
||||
} else {
|
||||
tableHeight = this.chart.data.tableRow.length * attr.size.tableItemHeight + attr.size.tableTitleHeight
|
||||
}
|
||||
} else if (this.chart.data.detailFields?.length) {
|
||||
let rowLength = 0
|
||||
this.chart.data.tableRow.forEach(row => {
|
||||
rowLength += (row?.details?.length || 1)
|
||||
})
|
||||
tableHeight = (rowLength + 2) * 36 - pageHeight
|
||||
tableHeight = rowLength * attr.size.tableItemHeight + 2 * attr.size.tableTitleHeight
|
||||
} else {
|
||||
tableHeight = (this.chart.data.tableRow.length + 2) * 36 - pageHeight
|
||||
tableHeight = this.chart.data.tableRow.length * attr.size.tableItemHeight + 2 * attr.size.tableTitleHeight
|
||||
}
|
||||
} else {
|
||||
tableHeight = 0
|
||||
}
|
||||
const breakLine = attr.size.tableAutoBreakLine ? attr.size.tableAutoBreakLine : DEFAULT_SIZE.tableAutoBreakLine
|
||||
if (breakLine) {
|
||||
this.height = tableMaxHeight + 'px'
|
||||
} else {
|
||||
if (tableHeight > tableMaxHeight) {
|
||||
this.height = tableMaxHeight + 'px'
|
||||
} else {
|
||||
this.height = 'auto'
|
||||
}
|
||||
}
|
||||
|
||||
if (this.enableScroll) {
|
||||
this.$nextTick(() => {
|
||||
@ -379,6 +407,7 @@ export default {
|
||||
this.table_item_class.color = customAttr.color.tableFontColor
|
||||
this.table_item_class.background = hexColorToRGBA(customAttr.color.tableItemBgColor, customAttr.color.alpha)
|
||||
this.scrollBarColor = customAttr.color.tableScrollBarColor ? customAttr.color.tableScrollBarColor : DEFAULT_COLOR_CASE.tableScrollBarColor
|
||||
this.cssStyleParams.borderColor = customAttr.color.tableBorderColor ? customAttr.color.tableBorderColor : DEFAULT_COLOR_CASE.tableBorderColor
|
||||
}
|
||||
if (customAttr.size) {
|
||||
this.table_header_class.fontSize = customAttr.size.tableTitleFontSize + 'px'
|
||||
@ -400,6 +429,17 @@ export default {
|
||||
} else {
|
||||
this.indexLabel = customAttr.size.indexLabel
|
||||
}
|
||||
|
||||
const autoBreakLine = customAttr.size.tableAutoBreakLine ? customAttr.size.tableAutoBreakLine : DEFAULT_SIZE.tableAutoBreakLine
|
||||
if (autoBreakLine) {
|
||||
this.cssStyleParams.overflow = 'hidden'
|
||||
this.cssStyleParams.textOverflow = 'auto'
|
||||
this.cssStyleParams.whiteSpace = 'normal'
|
||||
} else {
|
||||
this.cssStyleParams.overflow = 'hidden'
|
||||
this.cssStyleParams.textOverflow = 'ellipsis'
|
||||
this.cssStyleParams.whiteSpace = 'nowrap'
|
||||
}
|
||||
}
|
||||
this.table_item_class_stripe = JSON.parse(JSON.stringify(this.table_item_class))
|
||||
// 暂不支持斑马纹
|
||||
@ -552,8 +592,18 @@ export default {
|
||||
if (rowHeight < 36) {
|
||||
rowHeight = 36
|
||||
}
|
||||
|
||||
const attr = JSON.parse(this.chart.customAttr)
|
||||
const breakLine = attr.size.tableAutoBreakLine ? attr.size.tableAutoBreakLine : DEFAULT_SIZE.tableAutoBreakLine
|
||||
|
||||
this.scrollTimer = setInterval(() => {
|
||||
const top = rowHeight * senior.scrollCfg.row
|
||||
let top = 0
|
||||
if (breakLine) {
|
||||
top = senior.scrollCfg.step ? senior.scrollCfg.step : DEFAULT_SCROLL.step
|
||||
} else {
|
||||
top = rowHeight * senior.scrollCfg.row
|
||||
}
|
||||
|
||||
if (scrollContainer.clientHeight + scrollContainer.scrollTop < scrollContainer.scrollHeight) {
|
||||
this.scrollTop += top
|
||||
} else {
|
||||
@ -628,4 +678,32 @@ export default {
|
||||
.table-class{
|
||||
scrollbar-color: var(--scroll-bar-color) transparent;
|
||||
}
|
||||
|
||||
.table-class {
|
||||
::v-deep .elx-table.border--full .elx-body--column,
|
||||
::v-deep .elx-table.border--full .elx-footer--column,
|
||||
::v-deep .elx-table.border--full .elx-header--column {
|
||||
background-image: linear-gradient(var(--color, #e8eaec), var(--color, #e8eaec)), linear-gradient(var(--color, #e8eaec), var(--color, #e8eaec)) !important;
|
||||
}
|
||||
::v-deep .elx-table--border-line {
|
||||
border: 1px solid var(--color, #e8eaec) !important;
|
||||
}
|
||||
::v-deep .elx-table .elx-table--header-wrapper .elx-table--header-border-line {
|
||||
border-bottom: 1px solid var(--color, #e8eaec) !important;
|
||||
}
|
||||
::v-deep .elx-table .elx-table--footer-wrapper {
|
||||
border-top: 1px solid var(--color, #e8eaec) !important;
|
||||
}
|
||||
::v-deep .elx-checkbox .elx-checkbox--label,
|
||||
::v-deep .elx-radio .elx-radio--label,
|
||||
::v-deep .elx-radio-button .elx-radio--label,
|
||||
::v-deep .elx-table .elx-body--column.col--ellipsis:not(.col--actived) > .elx-cell,
|
||||
::v-deep .elx-table .elx-footer--column.col--ellipsis:not(.col--actived) > .elx-cell,
|
||||
::v-deep .elx-table .elx-header--column.col--ellipsis:not(.col--actived) > .elx-cell{
|
||||
overflow: var(--overflow, 'hidden');
|
||||
text-overflow: var(--text-overflow, 'ellipsis');
|
||||
white-space: var(--white-space, 'nowrap');
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
@ -77,7 +77,7 @@ export default {
|
||||
})
|
||||
},
|
||||
setPanelInfo() {
|
||||
loadResource(this.resourceId).then(res => {
|
||||
loadResource(this.resourceId,this.user).then(res => {
|
||||
this.show = false
|
||||
let loadingCount = 0
|
||||
const watermarkInfo = {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user