forked from github/dataease
Merge remote-tracking branch 'origin/dev-v2' into dev-v2
This commit is contained in:
commit
cc9d363294
@ -219,6 +219,10 @@ public class DatasetTableFieldManage {
|
||||
wrapper.eq("checked", true);
|
||||
wrapper.eq("ext_field", 0);
|
||||
List<DatasetTableFieldDTO> list = transDTO(coreDatasetTableFieldMapper.selectList(wrapper));
|
||||
|
||||
Map<String, ColumnPermissionItem> desensitizationList = new HashMap<>();
|
||||
list = permissionManage.filterColumnPermissions(list, desensitizationList, id, null);
|
||||
|
||||
List<DatasetTableFieldDTO> dimensionList = list.stream().filter(ele -> StringUtils.equalsIgnoreCase(ele.getGroupType(), "d")).collect(Collectors.toList());
|
||||
List<DatasetTableFieldDTO> quotaList = list.stream().filter(ele -> StringUtils.equalsIgnoreCase(ele.getGroupType(), "q")).collect(Collectors.toList());
|
||||
Map<String, List<DatasetTableFieldDTO>> map = new LinkedHashMap<>();
|
||||
|
@ -195,15 +195,22 @@ public class PermissionManage {
|
||||
DatasetRowPermissionsTreeObj tree = JsonUtil.parseObject(record.getExpressionTree(), DatasetRowPermissionsTreeObj.class);
|
||||
List<DatasetRowPermissionsTreeItem> items = new ArrayList<>();
|
||||
for (DatasetRowPermissionsTreeItem datasetRowPermissionsTreeItem : tree.getItems()) {
|
||||
if (StringUtils.isNotEmpty(userEntity.getAccount()) && datasetRowPermissionsTreeItem.getValue().equalsIgnoreCase("\\$\\{sysParams\\.userId}")) {
|
||||
if (StringUtils.isNotEmpty(userEntity.getAccount()) && datasetRowPermissionsTreeItem.getValue().equalsIgnoreCase("${sysParams.userId}")) {
|
||||
datasetRowPermissionsTreeItem.setValue(userEntity.getAccount());
|
||||
items.add(datasetRowPermissionsTreeItem);
|
||||
continue;
|
||||
}
|
||||
if (StringUtils.isNotEmpty(userEntity.getEmail()) && datasetRowPermissionsTreeItem.getValue().equalsIgnoreCase("\\$\\{sysParams\\.userEmail}")) {
|
||||
if (StringUtils.isNotEmpty(userEntity.getEmail()) && datasetRowPermissionsTreeItem.getValue().equalsIgnoreCase("${sysParams.userEmail}")) {
|
||||
datasetRowPermissionsTreeItem.setValue(userEntity.getEmail());
|
||||
items.add(datasetRowPermissionsTreeItem);
|
||||
continue;
|
||||
}
|
||||
if (StringUtils.isNotEmpty(userEntity.getName()) && datasetRowPermissionsTreeItem.getValue().equalsIgnoreCase("\\$\\{sysParams\\.userName}")) {
|
||||
if (StringUtils.isNotEmpty(userEntity.getName()) && datasetRowPermissionsTreeItem.getValue().equalsIgnoreCase("${sysParams.userName}")) {
|
||||
datasetRowPermissionsTreeItem.setValue(userEntity.getName());
|
||||
items.add(datasetRowPermissionsTreeItem);
|
||||
continue;
|
||||
}
|
||||
|
||||
String value = handleSysVariable(userEntity, datasetRowPermissionsTreeItem.getValue());
|
||||
if (value == null) {
|
||||
continue;
|
||||
|
@ -0,0 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
</template>
|
||||
|
||||
<style scoped lang="less">
|
||||
|
||||
</style>
|
@ -113,11 +113,12 @@ onMounted(() => {
|
||||
})
|
||||
|
||||
const onClick = () => {
|
||||
const events = config.value.events
|
||||
Object.keys(events).forEach(event => {
|
||||
currentInstance.ctx[event](events[event])
|
||||
})
|
||||
eventBus.emit('v-click', config.value.id)
|
||||
// do event click
|
||||
// const events = config.value.events
|
||||
// Object.keys(events).forEach(event => {
|
||||
// currentInstance.ctx[event](events[event])
|
||||
// })
|
||||
// eventBus.emit('v-click', config.value.id)
|
||||
}
|
||||
|
||||
const getComponentStyleDefault = style => {
|
||||
|
@ -80,7 +80,12 @@ const show = () => {
|
||||
layerStore.showComponent()
|
||||
menuOpt('show')
|
||||
}
|
||||
|
||||
const categoryChange = type => {
|
||||
if (curComponent.value) {
|
||||
snapshotStore.recordSnapshotCache()
|
||||
curComponent.value['category'] = type
|
||||
}
|
||||
}
|
||||
const rename = () => {
|
||||
emit('rename')
|
||||
menuOpt('rename')
|
||||
@ -222,6 +227,12 @@ const editQueryCriteria = () => {
|
||||
<el-divider class="custom-divider" />
|
||||
<li @click="hide" v-show="curComponent['isShow']">隐藏</li>
|
||||
<li @click="show" v-show="!curComponent['isShow']">取消隐藏</li>
|
||||
<li @click="categoryChange('hidden')" v-show="curComponent['category'] === 'base'">
|
||||
转为隐藏组件
|
||||
</li>
|
||||
<li @click="categoryChange('base')" v-show="curComponent['category'] === 'hidden'">
|
||||
转为基础组件
|
||||
</li>
|
||||
<li @click="lock">锁定</li>
|
||||
<el-divider class="custom-divider" />
|
||||
<li v-if="activePosition === 'aside'" @click="rename">重命名</li>
|
||||
|
@ -9,6 +9,7 @@ import { useI18n } from '@/hooks/web/useI18n'
|
||||
import elementResizeDetectorMaker from 'element-resize-detector'
|
||||
import { snapshotStoreWithOut } from '@/store/modules/data-visualization/snapshot'
|
||||
import CommonStyleSet from '@/custom-component/common/CommonStyleSet.vue'
|
||||
import CommonEvent from '@/custom-component/common/CommonEvent.vue'
|
||||
const snapshotStore = snapshotStoreWithOut()
|
||||
|
||||
const { t } = useI18n()
|
||||
@ -87,6 +88,10 @@ const colorPickerWidth = computed(() => {
|
||||
}
|
||||
})
|
||||
|
||||
const eventsShow = computed(() => {
|
||||
return !dashboardActive.value && ['Picture'].includes(element.value.component)
|
||||
})
|
||||
|
||||
const backgroundCustomShow = computed(() => {
|
||||
return (
|
||||
dashboardActive.value ||
|
||||
@ -149,6 +154,15 @@ const stopEvent = e => {
|
||||
:element="element"
|
||||
></common-style-set>
|
||||
</el-collapse-item>
|
||||
<el-collapse-item
|
||||
v-if="element && element.events && eventsShow"
|
||||
:effect="themes"
|
||||
title="事件"
|
||||
name="style"
|
||||
class="common-style-area"
|
||||
>
|
||||
<common-event :themes="themes" :element="element"></common-event>
|
||||
</el-collapse-item>
|
||||
</el-collapse>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -0,0 +1,56 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, toRefs } from 'vue'
|
||||
import { ElFormItem } from 'element-plus-secondary'
|
||||
import { snapshotStoreWithOut } from '@/store/modules/data-visualization/snapshot'
|
||||
|
||||
const snapshotStore = snapshotStoreWithOut()
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
themes?: EditorTheme
|
||||
element: any
|
||||
}>(),
|
||||
{
|
||||
themes: 'dark'
|
||||
}
|
||||
)
|
||||
const { themes, element } = toRefs(props)
|
||||
|
||||
const eventsInfo = computed(() => {
|
||||
return element.value.events
|
||||
})
|
||||
|
||||
const onEventChange = () => {
|
||||
snapshotStore.recordSnapshotCache('renderChart')
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<el-row class="custom-row">
|
||||
<el-form label-position="top">
|
||||
<el-form-item class="form-item" :class="'form-item-' + themes">
|
||||
<el-checkbox
|
||||
:effect="themes"
|
||||
size="small"
|
||||
v-model="eventsInfo.checked"
|
||||
@change="onEventChange"
|
||||
>开启事件绑定</el-checkbox
|
||||
>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item class="form-item" :class="'form-item-' + themes" style="margin-bottom: 8px">
|
||||
<el-radio-group
|
||||
:effect="themes"
|
||||
v-model="eventsInfo.type"
|
||||
class="radio-span"
|
||||
@change="onEventChange"
|
||||
>
|
||||
<el-radio label="displayChange" :effect="themes"> 开启隐藏组件 </el-radio>
|
||||
<el-radio label="jump" :effect="themes"> 跳转 </el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<style scoped lang="less"></style>
|
@ -8,6 +8,18 @@ export const commonStyle = {
|
||||
opacity: 1
|
||||
}
|
||||
|
||||
export const BASE_EVENTS = {
|
||||
checked: false,
|
||||
type: 'displayChange', // openHidden jump
|
||||
jump: {
|
||||
value: null
|
||||
},
|
||||
displayChange: {
|
||||
value: true, // 事件当前值 false
|
||||
target: 'all'
|
||||
}
|
||||
}
|
||||
|
||||
// 流媒体视频信息配置
|
||||
export const STREAMMEDIALINKS = {
|
||||
videoType: 'flv',
|
||||
@ -159,12 +171,13 @@ export const COMMON_COMPONENT_BACKGROUND_MAP = {
|
||||
export const commonAttr = {
|
||||
animations: [],
|
||||
canvasId: 'canvas-main',
|
||||
events: {},
|
||||
events: BASE_EVENTS,
|
||||
groupStyle: {}, // 当一个组件成为 Group 的子组件时使用
|
||||
isLock: false, // 是否锁定组件
|
||||
maintainRadio: false, // 布局时保持宽高比例
|
||||
aspectRatio: 1, // 锁定时的宽高比例
|
||||
isShow: true, // 是否显示组件
|
||||
category: 'base', //组件类型 base 基础组件 hidden隐藏组件
|
||||
// 当前组件动作
|
||||
dragging: false,
|
||||
resizing: false,
|
||||
|
@ -4,7 +4,7 @@ import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import CanvasGroup from '@/custom-component/common/CanvasGroup.vue'
|
||||
import { deepCopy } from '@/utils/utils'
|
||||
import { DEFAULT_CANVAS_STYLE_DATA_DARK } from '@/views/chart/components/editor/util/dataVisualiztion'
|
||||
import { DEFAULT_CANVAS_STYLE_DATA_DARK } from '@/views/chart/components/editor/util/dataVisualization'
|
||||
import { groupSizeStyleAdaptor } from '@/utils/style'
|
||||
const dvMainStore = dvMainStoreWithOut()
|
||||
const { canvasStyleData, curComponent } = storeToRefs(dvMainStore)
|
||||
|
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="pic-main">
|
||||
<div class="pic-main" @click="onPictureClick">
|
||||
<img
|
||||
draggable="false"
|
||||
v-if="propValue['url']"
|
||||
@ -20,6 +20,8 @@
|
||||
import { CSSProperties, computed, nextTick, toRefs } from 'vue'
|
||||
import { imgUrlTrans } from '@/utils/imgUtils'
|
||||
import eventBus from '@/utils/eventBus'
|
||||
import { eventStoreWithOut } from '@/store/modules/data-visualization/event'
|
||||
const eventStore = eventStoreWithOut()
|
||||
const props = defineProps({
|
||||
propValue: {
|
||||
type: String,
|
||||
@ -52,7 +54,14 @@ const imageAdapter = computed(() => {
|
||||
}
|
||||
return style as CSSProperties
|
||||
})
|
||||
|
||||
const onPictureClick = e => {
|
||||
if (element.value.events && element.value.events.checked) {
|
||||
if (element.value.events.type === 'displayChange') {
|
||||
// 打开隐藏组件
|
||||
eventStore.displayEventChange(element.value)
|
||||
}
|
||||
}
|
||||
}
|
||||
const uploadImg = () => {
|
||||
nextTick(() => {
|
||||
eventBus.emit('uploadImg')
|
||||
|
@ -11,7 +11,7 @@ import {
|
||||
DEFAULT_CANVAS_STYLE_DATA_DARK,
|
||||
DEFAULT_CANVAS_STYLE_DATA_LIGHT,
|
||||
DEFAULT_CANVAS_STYLE_DATA_SCREEN_DARK
|
||||
} from '@/views/chart/components/editor/util/dataVisualiztion'
|
||||
} from '@/views/chart/components/editor/util/dataVisualization'
|
||||
import { useEmitt } from '@/hooks/web/useEmitt'
|
||||
import chartViewManager from '@/views/chart/components/js/panel'
|
||||
import {
|
||||
|
@ -3,7 +3,7 @@ import { store } from '../../index'
|
||||
import { dvMainStoreWithOut } from './dvMain'
|
||||
|
||||
const dvMainStore = dvMainStoreWithOut()
|
||||
const { curComponent } = storeToRefs(dvMainStore)
|
||||
const { curComponent, componentData } = storeToRefs(dvMainStore)
|
||||
|
||||
export const eventStore = defineStore('event', {
|
||||
actions: {
|
||||
@ -13,6 +13,15 @@ export const eventStore = defineStore('event', {
|
||||
|
||||
removeEvent(event) {
|
||||
delete curComponent.value.events[event]
|
||||
},
|
||||
|
||||
displayEventChange(component) {
|
||||
component.events.displayChange.value = !component.events.displayChange.value
|
||||
componentData.value.forEach(item => {
|
||||
if (item.category === 'hidden') {
|
||||
item.isShow = component.events.displayChange.value
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
|
@ -2,7 +2,7 @@ import { defineStore, storeToRefs } from 'pinia'
|
||||
import { store } from '../../index'
|
||||
import { dvMainStoreWithOut } from './dvMain'
|
||||
import { deepCopy } from '@/utils/utils'
|
||||
import { BASE_THEMES } from '@/views/chart/components/editor/util/dataVisualiztion'
|
||||
import { BASE_THEMES } from '@/views/chart/components/editor/util/dataVisualization'
|
||||
import eventBus from '@/utils/eventBus'
|
||||
import { useEmitt } from '@/hooks/web/useEmitt'
|
||||
import { useCache } from '@/hooks/web/useCache'
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { cloneDeep } from 'lodash-es'
|
||||
import componentList, {
|
||||
ACTION_SELECTION,
|
||||
BASE_EVENTS,
|
||||
COMMON_COMPONENT_BACKGROUND_DARK,
|
||||
COMMON_COMPONENT_BACKGROUND_LIGHT
|
||||
} from '@/custom-component/component-list'
|
||||
@ -153,6 +154,12 @@ export function historyAdaptor(
|
||||
if ((!canvasVersion || canvasVersion === 2) && canvasInfo.type === 'dashboard') {
|
||||
matrixAdaptor(componentItem)
|
||||
}
|
||||
// 组件事件适配
|
||||
componentItem.events =
|
||||
componentItem.events && componentItem.events.checked !== undefined
|
||||
? componentItem.events
|
||||
: deepCopy(BASE_EVENTS)
|
||||
componentItem['category'] = componentItem['category'] || 'base'
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -842,8 +842,8 @@ function getTooltipPosition(event) {
|
||||
return result
|
||||
}
|
||||
|
||||
export async function exportPivotExcel(instancce: PivotSheet, chart: ChartObj) {
|
||||
const { meta, fields } = instancce.dataCfg
|
||||
export async function exportPivotExcel(instance: PivotSheet, chart: ChartObj) {
|
||||
const { meta, fields } = instance.dataCfg
|
||||
const rowLength = fields?.rows?.length || 0
|
||||
const colLength = fields?.columns?.length || 0
|
||||
const valueLength = fields?.values?.length || 0
|
||||
@ -873,7 +873,7 @@ export async function exportPivotExcel(instancce: PivotSheet, chart: ChartObj) {
|
||||
cell.value = metaMap[row]?.name ?? row
|
||||
cell.alignment = { vertical: 'middle', horizontal: 'center' }
|
||||
})
|
||||
const { layoutResult } = instancce.facet
|
||||
const { layoutResult } = instance.facet
|
||||
// 行头
|
||||
const { rowLeafNodes, rowsHierarchy, rowNodes } = layoutResult
|
||||
const maxColIndex = rowsHierarchy.maxLevel + 1
|
||||
|
@ -4,7 +4,7 @@ import { equalsAny, includesAny } from '../editor/util/StringUtils'
|
||||
import { FeatureCollection } from '@antv/l7plot/dist/esm/plots/choropleth/types'
|
||||
import { useMapStoreWithOut } from '@/store/modules/map'
|
||||
import { getGeoJson } from '@/api/map'
|
||||
import { toRaw } from 'vue'
|
||||
import { computed, toRaw } from 'vue'
|
||||
import { Options } from '@antv/g2plot/esm'
|
||||
import { PickOptions } from '@antv/g2plot/esm/core/plot'
|
||||
import { innerExportDetails } from '@/api/chart'
|
||||
@ -12,6 +12,8 @@ import { ElMessage } from 'element-plus-secondary'
|
||||
import { useI18n } from '@/hooks/web/useI18n'
|
||||
import { useLinkStoreWithOut } from '@/store/modules/link'
|
||||
|
||||
const isDataEaseBi = computed(() => appStore.getIsDataEaseBi)
|
||||
|
||||
const { t } = useI18n()
|
||||
// 同时支持将hex和rgb,转换成rgba
|
||||
export function hexColorToRGBA(hex, alpha) {
|
||||
@ -511,7 +513,7 @@ export const exportExcelDownload = (chart, callBack?) => {
|
||||
|
||||
innerExportDetails(request)
|
||||
.then(res => {
|
||||
if (linkStore.getLinkToken) {
|
||||
if (linkStore.getLinkToken || isDataEaseBi.value) {
|
||||
const blob = new Blob([res.data], { type: 'application/vnd.ms-excel' })
|
||||
const link = document.createElement('a')
|
||||
link.style.display = 'none'
|
||||
|
@ -32,7 +32,7 @@ import treeSort from '@/utils/treeSortUtils'
|
||||
import {
|
||||
DEFAULT_CANVAS_STYLE_DATA_LIGHT,
|
||||
DEFAULT_CANVAS_STYLE_DATA_SCREEN_DARK
|
||||
} from '@/views/chart/components/editor/util/dataVisualiztion'
|
||||
} from '@/views/chart/components/editor/util/dataVisualization'
|
||||
import type { TabPaneName } from 'element-plus-secondary'
|
||||
import { timestampFormatDate } from './form/util'
|
||||
import { interactiveStoreWithOut } from '@/store/modules/interactive'
|
||||
|
2
de-xpack
2
de-xpack
@ -1 +1 @@
|
||||
Subproject commit d56a37a7307c202176e9cfd26c03f2cbed0cf515
|
||||
Subproject commit 9695ff58484674dc2e1ba81d564224fc12dad9eb
|
@ -32,10 +32,7 @@ import java.io.ByteArrayOutputStream;
|
||||
import java.io.InputStream;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.cert.X509Certificate;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
import static io.dataease.result.ResultCode.SYSTEM_INNER_ERROR;
|
||||
|
||||
@ -222,6 +219,41 @@ public class HttpClientUtil {
|
||||
}
|
||||
}
|
||||
|
||||
public static HttpResponse postWithHeaders(String url, String json, HttpClientConfig config) {
|
||||
CloseableHttpClient httpClient = null;
|
||||
try {
|
||||
httpClient = buildHttpClient(url);
|
||||
HttpPost httpPost = new HttpPost(url);
|
||||
if (config == null) {
|
||||
config = new HttpClientConfig();
|
||||
}
|
||||
httpPost.setConfig(config.buildRequestConfig());
|
||||
Map<String, String> header = config.getHeader();
|
||||
for (String key : header.keySet()) {
|
||||
httpPost.addHeader(key, header.get(key));
|
||||
}
|
||||
EntityBuilder entityBuilder = EntityBuilder.create();
|
||||
entityBuilder.setText(json);
|
||||
entityBuilder.setContentType(ContentType.APPLICATION_JSON);
|
||||
HttpEntity requestEntity = entityBuilder.build();
|
||||
httpPost.setEntity(requestEntity);
|
||||
|
||||
HttpResponse response = httpClient.execute(httpPost);
|
||||
return response;
|
||||
} catch (Exception e) {
|
||||
logger.error("HttpClient查询失败", e);
|
||||
throw new DEException(SYSTEM_INNER_ERROR.code(), "HttpClient查询失败: " + e.getMessage());
|
||||
} finally {
|
||||
try {
|
||||
if (httpClient != null) {
|
||||
httpClient.close();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("HttpClient关闭连接失败", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static String put(String url, String json, HttpClientConfig config) {
|
||||
CloseableHttpClient httpClient = null;
|
||||
try {
|
||||
|
Loading…
Reference in New Issue
Block a user