forked from github/dataease
Merge branch 'dev' into pr@dev_memory_component
This commit is contained in:
commit
939588f510
@ -19,7 +19,6 @@ import io.dataease.plugins.common.base.domain.Datasource;
|
|||||||
import io.dataease.service.datasource.DatasourceService;
|
import io.dataease.service.datasource.DatasourceService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
@ -19,6 +19,7 @@ public class DatasourceDTO extends Datasource {
|
|||||||
@ApiModelProperty("权限")
|
@ApiModelProperty("权限")
|
||||||
private String privileges;
|
private String privileges;
|
||||||
private List<ApiDefinition> apiConfiguration;
|
private List<ApiDefinition> apiConfiguration;
|
||||||
|
private String apiConfigurationStr;
|
||||||
private String typeDesc;
|
private String typeDesc;
|
||||||
private DatasourceCalculationMode calculationMode;
|
private DatasourceCalculationMode calculationMode;
|
||||||
}
|
}
|
||||||
|
@ -608,6 +608,7 @@
|
|||||||
id,
|
id,
|
||||||
table_id,
|
table_id,
|
||||||
chart_id,
|
chart_id,
|
||||||
|
origin_name,
|
||||||
`name`,
|
`name`,
|
||||||
dataease_name,
|
dataease_name,
|
||||||
group_type,
|
group_type,
|
||||||
@ -624,6 +625,7 @@
|
|||||||
uuid() AS id,
|
uuid() AS id,
|
||||||
chart_view_field.table_id,
|
chart_view_field.table_id,
|
||||||
chart_view_field.pv_copy.chart_view_id AS chart_id,
|
chart_view_field.pv_copy.chart_view_id AS chart_id,
|
||||||
|
chart_view_field.origin_name,
|
||||||
chart_view_field.`name`,
|
chart_view_field.`name`,
|
||||||
chart_view_field.dataease_name,
|
chart_view_field.dataease_name,
|
||||||
chart_view_field.group_type,
|
chart_view_field.group_type,
|
||||||
|
@ -1014,7 +1014,7 @@ public class ChartDataBuild {
|
|||||||
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()) + "***" + StringUtils.substring(originStr, originStr.length() - columnPermissionItem.getDesensitizationRule().getN() - 1, originStr.length() - 1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case RetainMToN:
|
case RetainMToN:
|
||||||
|
@ -108,7 +108,7 @@ public class DatasourceService {
|
|||||||
if (!types().stream().map(DataSourceType::getType).collect(Collectors.toList()).contains(datasource.getType())) {
|
if (!types().stream().map(DataSourceType::getType).collect(Collectors.toList()).contains(datasource.getType())) {
|
||||||
throw new Exception("Datasource type not supported.");
|
throw new Exception("Datasource type not supported.");
|
||||||
}
|
}
|
||||||
|
datasource.setConfiguration(new String(java.util.Base64.getDecoder().decode(datasource.getConfiguration())));
|
||||||
Provider datasourceProvider = ProviderFactory.getProvider(datasource.getType());
|
Provider datasourceProvider = ProviderFactory.getProvider(datasource.getType());
|
||||||
datasourceProvider.checkConfiguration(datasource);
|
datasourceProvider.checkConfiguration(datasource);
|
||||||
|
|
||||||
@ -212,6 +212,14 @@ public class DatasourceService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(StringUtils.isNotEmpty(datasourceDTO.getConfiguration())){
|
||||||
|
datasourceDTO.setConfiguration(new String(java.util.Base64.getEncoder().encode(datasourceDTO.getConfiguration().getBytes())));
|
||||||
|
}
|
||||||
|
if(CollectionUtils.isNotEmpty(datasourceDTO.getApiConfiguration())){
|
||||||
|
String config = new Gson().toJson(datasourceDTO.getApiConfiguration());
|
||||||
|
datasourceDTO.setApiConfigurationStr(new String(java.util.Base64.getEncoder().encode(config.getBytes())));
|
||||||
|
datasourceDTO.setApiConfiguration(null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public DatasourceDTO getDataSourceDetails(String datasourceId){
|
public DatasourceDTO getDataSourceDetails(String datasourceId){
|
||||||
@ -253,6 +261,7 @@ public class DatasourceService {
|
|||||||
if (!types().stream().map(DataSourceType::getType).collect(Collectors.toList()).contains(updataDsRequest.getType())) {
|
if (!types().stream().map(DataSourceType::getType).collect(Collectors.toList()).contains(updataDsRequest.getType())) {
|
||||||
throw new Exception("Datasource type not supported.");
|
throw new Exception("Datasource type not supported.");
|
||||||
}
|
}
|
||||||
|
updataDsRequest.setConfiguration(new String(java.util.Base64.getDecoder().decode(updataDsRequest.getConfiguration())));
|
||||||
checkName(updataDsRequest.getName(), updataDsRequest.getType(), updataDsRequest.getId());
|
checkName(updataDsRequest.getName(), updataDsRequest.getType(), updataDsRequest.getId());
|
||||||
Datasource datasource = new Datasource();
|
Datasource datasource = new Datasource();
|
||||||
datasource.setName(updataDsRequest.getName());
|
datasource.setName(updataDsRequest.getName());
|
||||||
@ -284,6 +293,7 @@ public class DatasourceService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public ResultHolder validate(Datasource datasource) throws Exception {
|
public ResultHolder validate(Datasource datasource) throws Exception {
|
||||||
|
datasource.setConfiguration(new String(java.util.Base64.getDecoder().decode(datasource.getConfiguration())));
|
||||||
DatasourceDTO datasourceDTO = new DatasourceDTO();
|
DatasourceDTO datasourceDTO = new DatasourceDTO();
|
||||||
BeanUtils.copyBean(datasourceDTO, datasource);
|
BeanUtils.copyBean(datasourceDTO, datasource);
|
||||||
try {
|
try {
|
||||||
@ -372,6 +382,7 @@ public class DatasourceService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public List<String> getSchema(Datasource datasource) throws Exception {
|
public List<String> getSchema(Datasource datasource) throws Exception {
|
||||||
|
datasource.setConfiguration(new String(java.util.Base64.getDecoder().decode(datasource.getConfiguration())));
|
||||||
Provider datasourceProvider = ProviderFactory.getProvider(datasource.getType());
|
Provider datasourceProvider = ProviderFactory.getProvider(datasource.getType());
|
||||||
DatasourceRequest datasourceRequest = new DatasourceRequest();
|
DatasourceRequest datasourceRequest = new DatasourceRequest();
|
||||||
datasourceRequest.setDatasource(datasource);
|
datasourceRequest.setDatasource(datasource);
|
||||||
|
@ -8,11 +8,12 @@ export function post(url, data, loading = false) {
|
|||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function tableField(id) {
|
export function tableField(id) {
|
||||||
return request({
|
return request({
|
||||||
url: '/dataset/table/getWithPermission/' + id,
|
url: '/dataset/table/getWithPermission/' + id,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
loading: true,
|
loading: false,
|
||||||
hideMsg: true,
|
hideMsg: true,
|
||||||
timeout: 60000
|
timeout: 60000
|
||||||
})
|
})
|
||||||
@ -34,6 +35,7 @@ export function chartCopy(id, panelId) {
|
|||||||
loading: false
|
loading: false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function chartBatchCopy(params, panelId) {
|
export function chartBatchCopy(params, panelId) {
|
||||||
return request({
|
return request({
|
||||||
url: '/chart/view/chartBatchCopy/' + panelId,
|
url: '/chart/view/chartBatchCopy/' + panelId,
|
||||||
@ -42,6 +44,7 @@ export function chartBatchCopy(params, panelId) {
|
|||||||
loading: false
|
loading: false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function chartGroupTree(data) {
|
export function chartGroupTree(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/chart/group/tree',
|
url: '/chart/group/tree',
|
||||||
@ -116,6 +119,7 @@ export function resetViewCacheCallBack(viewId, panelId, callback) {
|
|||||||
callback(rep)
|
callback(rep)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function resetViewCache(viewId, panelId) {
|
export function resetViewCache(viewId, panelId) {
|
||||||
return request({
|
return request({
|
||||||
url: '/chart/view/resetViewCache/' + viewId + '/' + panelId,
|
url: '/chart/view/resetViewCache/' + viewId + '/' + panelId,
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
@scroll="canvasScroll"
|
@scroll="canvasScroll"
|
||||||
>
|
>
|
||||||
<canvas-opt-bar
|
<canvas-opt-bar
|
||||||
|
v-if="canvasId==='canvas-main'"
|
||||||
ref="canvas-opt-bar"
|
ref="canvas-opt-bar"
|
||||||
:canvas-style-data="canvasStyleData"
|
:canvas-style-data="canvasStyleData"
|
||||||
@link-export-pdf="downloadAsPDF"
|
@link-export-pdf="downloadAsPDF"
|
||||||
@ -155,7 +156,7 @@ import bus from '@/utils/bus'
|
|||||||
import { buildFilterMap, buildViewKeyMap, formatCondition, valueValid, viewIdMatch } from '@/utils/conditionUtil'
|
import { buildFilterMap, buildViewKeyMap, formatCondition, valueValid, viewIdMatch } from '@/utils/conditionUtil'
|
||||||
import { hasDataPermission } from '@/utils/permission'
|
import { hasDataPermission } from '@/utils/permission'
|
||||||
import { activeWatermark } from '@/components/canvas/tools/watermark'
|
import { activeWatermark } from '@/components/canvas/tools/watermark'
|
||||||
import { userLoginInfo } from '@/api/systemInfo/userLogin'
|
import { proxyUserLoginInfo, userLoginInfo } from '@/api/systemInfo/userLogin'
|
||||||
import html2canvas from 'html2canvasde'
|
import html2canvas from 'html2canvasde'
|
||||||
import { queryAll } from '@/api/panel/pdfTemplate'
|
import { queryAll } from '@/api/panel/pdfTemplate'
|
||||||
import PDFPreExport from '@/views/panel/export/PDFPreExport'
|
import PDFPreExport from '@/views/panel/export/PDFPreExport'
|
||||||
@ -456,7 +457,8 @@ export default {
|
|||||||
if (this.userInfo) {
|
if (this.userInfo) {
|
||||||
activeWatermark(this.panelInfo.watermarkInfo.settingContent, this.userInfo, waterDomId, this.canvasId, this.panelInfo.watermarkOpen)
|
activeWatermark(this.panelInfo.watermarkInfo.settingContent, this.userInfo, waterDomId, this.canvasId, this.panelInfo.watermarkOpen)
|
||||||
} else {
|
} else {
|
||||||
userLoginInfo().then(res => {
|
const method = this.userId ? proxyUserLoginInfo : userLoginInfo
|
||||||
|
method(this.userId).then(res => {
|
||||||
this.userInfo = res.data
|
this.userInfo = res.data
|
||||||
activeWatermark(this.panelInfo.watermarkInfo.settingContent, this.userInfo, waterDomId, this.canvasId, this.panelInfo.watermarkOpen)
|
activeWatermark(this.panelInfo.watermarkInfo.settingContent, this.userInfo, waterDomId, this.canvasId, this.panelInfo.watermarkOpen)
|
||||||
})
|
})
|
||||||
|
@ -17,8 +17,8 @@
|
|||||||
},
|
},
|
||||||
className
|
className
|
||||||
]"
|
]"
|
||||||
@mousedown="elementMouseDown"
|
|
||||||
@touchstart="elementTouchDown"
|
@touchstart="elementTouchDown"
|
||||||
|
@mousedown="outerElementMouseDown"
|
||||||
@mouseenter="enter"
|
@mouseenter="enter"
|
||||||
@mouseleave="leave"
|
@mouseleave="leave"
|
||||||
>
|
>
|
||||||
@ -66,20 +66,24 @@
|
|||||||
@mousedown.stop.prevent="handleDown(handlei, $event)"
|
@mousedown.stop.prevent="handleDown(handlei, $event)"
|
||||||
@touchstart.stop.prevent="handleTouchDown(handlei, $event)"
|
@touchstart.stop.prevent="handleTouchDown(handlei, $event)"
|
||||||
>
|
>
|
||||||
<slot :name="handlei" />
|
<slot :name="handlei"/>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
:id="componentCanvasId"
|
:id="componentCanvasId"
|
||||||
:style="mainSlotStyleInner"
|
:style="mainSlotStyleInner"
|
||||||
class="main-background"
|
class="main-background"
|
||||||
>
|
>
|
||||||
|
<div @mousedown="elementMouseDown" class="de-drag-area de-drag-top"></div>
|
||||||
|
<div @mousedown="elementMouseDown" class="de-drag-area de-drag-right"></div>
|
||||||
|
<div @mousedown="elementMouseDown" class="de-drag-area de-drag-bottom"></div>
|
||||||
|
<div @mousedown="elementMouseDown" class="de-drag-area de-drag-left"></div>
|
||||||
<svg-icon
|
<svg-icon
|
||||||
v-if="svgInnerEnable"
|
v-if="svgInnerEnable"
|
||||||
:style="{'color':element.commonBackground.innerImageColor}"
|
:style="{'color':element.commonBackground.innerImageColor}"
|
||||||
class="svg-background"
|
class="svg-background"
|
||||||
:icon-class="mainSlotSvgInner"
|
:icon-class="mainSlotSvgInner"
|
||||||
/>
|
/>
|
||||||
<slot />
|
<slot/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -863,6 +867,18 @@ export default {
|
|||||||
eventsFor = events.touch
|
eventsFor = events.touch
|
||||||
this.elementDown(e)
|
this.elementDown(e)
|
||||||
},
|
},
|
||||||
|
outerElementMouseDown(e) {
|
||||||
|
// private 设置当前组件数据及状态
|
||||||
|
this.$store.commit('setClickComponentStatus', true)
|
||||||
|
if (this.element.component !== 'user-view' && this.element.component !== 'de-frame' && this.element.component !== 'v-text' && this.element.component !== 'de-rich-text' && this.element.component !== 'rect-shape' && this.element.component !== 'de-input-search' && this.element.component !== 'de-select-grid' && this.element.component !== 'de-number-range' && this.element.component !== 'de-date') {
|
||||||
|
e.preventDefault()
|
||||||
|
}
|
||||||
|
// 阻止冒泡事件
|
||||||
|
e.stopPropagation()
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$store.commit('setCurComponent', { component: this.element, index: this.index })
|
||||||
|
})
|
||||||
|
},
|
||||||
elementMouseDown(e) {
|
elementMouseDown(e) {
|
||||||
// private 设置当前组件数据及状态
|
// private 设置当前组件数据及状态
|
||||||
this.$store.commit('setClickComponentStatus', true)
|
this.$store.commit('setClickComponentStatus', true)
|
||||||
@ -2131,4 +2147,42 @@ export default {
|
|||||||
.drag-on-tab-collision {
|
.drag-on-tab-collision {
|
||||||
z-index: 1000 !important;
|
z-index: 1000 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.de-drag-area {
|
||||||
|
position: absolute;
|
||||||
|
z-index: 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
.de-drag-area:hover {
|
||||||
|
cursor: move;
|
||||||
|
}
|
||||||
|
|
||||||
|
.de-drag-top {
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
height: 12px;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.de-drag-right {
|
||||||
|
right: 0;
|
||||||
|
top: 0;
|
||||||
|
width: 16px;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.de-drag-bottom {
|
||||||
|
left: 0;
|
||||||
|
bottom: 0;
|
||||||
|
height: 12px;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.de-drag-left {
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
width: 16px;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -79,7 +79,7 @@
|
|||||||
:canvas-style-data="canvasStyleData"
|
:canvas-style-data="canvasStyleData"
|
||||||
:canvas-id="element.id+'-'+item.name"
|
:canvas-id="element.id+'-'+item.name"
|
||||||
:panel-info="panelInfo"
|
:panel-info="panelInfo"
|
||||||
:in-screen="true"
|
:in-screen="inScreen"
|
||||||
:show-position="showPosition"
|
:show-position="showPosition"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@ -232,6 +232,11 @@ export default {
|
|||||||
name: 'DeTabs',
|
name: 'DeTabs',
|
||||||
components: { TextAttr, Preview, DeCanvasTab, TabUseList, ViewSelect, DataeaseTabs },
|
components: { TextAttr, Preview, DeCanvasTab, TabUseList, ViewSelect, DataeaseTabs },
|
||||||
props: {
|
props: {
|
||||||
|
inScreen: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
canvasId: {
|
canvasId: {
|
||||||
type: String,
|
type: String,
|
||||||
default: 'canvas-main'
|
default: 'canvas-main'
|
||||||
|
@ -1932,6 +1932,7 @@ export default {
|
|||||||
back_parent: 'Back to previous'
|
back_parent: 'Back to previous'
|
||||||
},
|
},
|
||||||
panel: {
|
panel: {
|
||||||
|
unpublished_tips: 'After unpublishing, the panel cannot be viewed. Are you sure you want to cancel publishing? ',
|
||||||
position_adjust_component: 'Position adjust',
|
position_adjust_component: 'Position adjust',
|
||||||
active_font_size: 'Selected font size',
|
active_font_size: 'Selected font size',
|
||||||
carousel: 'Carousel',
|
carousel: 'Carousel',
|
||||||
|
@ -1926,6 +1926,7 @@ export default {
|
|||||||
back_parent: '返回上一級'
|
back_parent: '返回上一級'
|
||||||
},
|
},
|
||||||
panel: {
|
panel: {
|
||||||
|
unpublished_tips: '取消發布後,該儀表板不能被查看。確定要取消發布?',
|
||||||
position_adjust_component: '位置調整',
|
position_adjust_component: '位置調整',
|
||||||
active_font_size: '选中字體大小',
|
active_font_size: '选中字體大小',
|
||||||
carousel: '輪播',
|
carousel: '輪播',
|
||||||
|
@ -1926,6 +1926,7 @@ export default {
|
|||||||
back_parent: '返回上一级'
|
back_parent: '返回上一级'
|
||||||
},
|
},
|
||||||
panel: {
|
panel: {
|
||||||
|
unpublished_tips: '取消发布后,该仪表板不能被查看。确定要取消发布?',
|
||||||
position_adjust_component: '位置调整',
|
position_adjust_component: '位置调整',
|
||||||
active_font_size: '选中字体大小',
|
active_font_size: '选中字体大小',
|
||||||
carousel: '轮播',
|
carousel: '轮播',
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
import { Condition } from '@/components/widget/bean/Condition'
|
import { Condition } from '@/components/widget/bean/Condition'
|
||||||
import { ApplicationContext } from '@/utils/ApplicationContext'
|
import { ApplicationContext } from '@/utils/ApplicationContext'
|
||||||
|
import store from '@/store'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 判断两个conditions数组是否相同
|
* 判断两个conditions数组是否相同
|
||||||
@ -70,7 +70,11 @@ export const buildViewKeyMap = panelItems => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const buildViewKeyFilters = (panelItems, result) => {
|
export const buildViewKeyFilters = (panelItems, result) => {
|
||||||
panelItems.forEach((element, index) => {
|
if (!(panelItems && panelItems.length > 0)) {
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
const buildItems = panelItems[0].canvasId === 'canvas-main' ? panelItems : store.state.componentData
|
||||||
|
buildItems.forEach((element, index) => {
|
||||||
if (element.type !== 'custom') {
|
if (element.type !== 'custom') {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
@ -449,7 +449,8 @@ export const DEFAULT_FUNCTION_CFG = {
|
|||||||
export const DEFAULT_THRESHOLD = {
|
export const DEFAULT_THRESHOLD = {
|
||||||
gaugeThreshold: '',
|
gaugeThreshold: '',
|
||||||
labelThreshold: [],
|
labelThreshold: [],
|
||||||
tableThreshold: []
|
tableThreshold: [],
|
||||||
|
textLabelThreshold: []
|
||||||
}
|
}
|
||||||
export const DEFAULT_SCROLL = {
|
export const DEFAULT_SCROLL = {
|
||||||
open: false,
|
open: false,
|
||||||
|
@ -69,3 +69,15 @@ export function getOriginFieldName(dimensionList, quotaList, field) {
|
|||||||
}
|
}
|
||||||
return originName
|
return originName
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function resetValueFormatter(item) {
|
||||||
|
if (item) {
|
||||||
|
item.formatterCfg = {
|
||||||
|
type: 'auto', // auto,value,percent
|
||||||
|
unit: 1, // 换算单位
|
||||||
|
suffix: '', // 单位后缀
|
||||||
|
decimalCount: 2, // 小数位数
|
||||||
|
thousandSeparator: true// 千分符
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -157,7 +157,7 @@ export default {
|
|||||||
this.$nextTick(function() {
|
this.$nextTick(function() {
|
||||||
if (that.$refs.tableContainer) {
|
if (that.$refs.tableContainer) {
|
||||||
const currentHeight = that.$refs.tableContainer.offsetHeight
|
const currentHeight = that.$refs.tableContainer.offsetHeight
|
||||||
const contentHeight = currentHeight - that.$refs.title.offsetHeight - 16
|
const contentHeight = currentHeight - that.$refs.title.offsetHeight - 8
|
||||||
that.height = contentHeight + 'px'
|
that.height = contentHeight + 'px'
|
||||||
that.content_class.height = that.height
|
that.content_class.height = that.height
|
||||||
}
|
}
|
||||||
|
@ -184,7 +184,7 @@ export default {
|
|||||||
this.$nextTick(function() {
|
this.$nextTick(function() {
|
||||||
if (that.$refs.tableContainer) {
|
if (that.$refs.tableContainer) {
|
||||||
const currentHeight = that.$refs.tableContainer.offsetHeight
|
const currentHeight = that.$refs.tableContainer.offsetHeight
|
||||||
const contentHeight = currentHeight - that.$refs.title.offsetHeight - 16
|
const contentHeight = currentHeight - that.$refs.title.offsetHeight - 8
|
||||||
that.height = contentHeight + 'px'
|
that.height = contentHeight + 'px'
|
||||||
that.content_class.height = that.height
|
that.content_class.height = that.height
|
||||||
}
|
}
|
||||||
@ -195,7 +195,8 @@ export default {
|
|||||||
const customAttr = JSON.parse(this.chart.customAttr)
|
const customAttr = JSON.parse(this.chart.customAttr)
|
||||||
if (customAttr.color) {
|
if (customAttr.color) {
|
||||||
this.label_class.color = customAttr.color.dimensionColor
|
this.label_class.color = customAttr.color.dimensionColor
|
||||||
this.label_content_class.color = customAttr.color.quotaColor
|
// color threshold
|
||||||
|
this.colorThreshold(customAttr.color.quotaColor)
|
||||||
}
|
}
|
||||||
if (customAttr.size) {
|
if (customAttr.size) {
|
||||||
this.dimensionShow = customAttr.size.dimensionShow
|
this.dimensionShow = customAttr.size.dimensionShow
|
||||||
@ -303,6 +304,57 @@ export default {
|
|||||||
},
|
},
|
||||||
initRemark() {
|
initRemark() {
|
||||||
this.remarkCfg = getRemark(this.chart)
|
this.remarkCfg = getRemark(this.chart)
|
||||||
|
},
|
||||||
|
colorThreshold(valueColor) {
|
||||||
|
if (this.chart.senior) {
|
||||||
|
const senior = JSON.parse(this.chart.senior)
|
||||||
|
if (senior.threshold && senior.threshold.textLabelThreshold && senior.threshold.textLabelThreshold.length > 0) {
|
||||||
|
const value = this.chart.data.series[0].data[0]
|
||||||
|
for (let i = 0; i < senior.threshold.textLabelThreshold.length; i++) {
|
||||||
|
let flag = false
|
||||||
|
const t = senior.threshold.textLabelThreshold[i]
|
||||||
|
const tv = t.value
|
||||||
|
if (t.term === 'eq') {
|
||||||
|
if (value === tv) {
|
||||||
|
this.label_content_class.color = t.color
|
||||||
|
flag = true
|
||||||
|
}
|
||||||
|
} else if (t.term === 'not_eq') {
|
||||||
|
if (value !== tv) {
|
||||||
|
this.label_content_class.color = t.color
|
||||||
|
flag = true
|
||||||
|
}
|
||||||
|
} else if (t.term === 'like') {
|
||||||
|
if (value.includes(tv)) {
|
||||||
|
this.label_content_class.color = t.color
|
||||||
|
flag = true
|
||||||
|
}
|
||||||
|
} else if (t.term === 'not like') {
|
||||||
|
if (!value.includes(tv)) {
|
||||||
|
this.label_content_class.color = t.color
|
||||||
|
flag = true
|
||||||
|
}
|
||||||
|
} else if (t.term === 'null') {
|
||||||
|
if (value === null || value === undefined || value === '') {
|
||||||
|
this.label_content_class.color = t.color
|
||||||
|
flag = true
|
||||||
|
}
|
||||||
|
} else if (t.term === 'not_null') {
|
||||||
|
if (value !== null && value !== undefined && value !== '') {
|
||||||
|
this.label_content_class.color = t.color
|
||||||
|
flag = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (flag) {
|
||||||
|
break
|
||||||
|
} else if (i === senior.threshold.textLabelThreshold.length - 1) {
|
||||||
|
this.label_content_class.color = valueColor
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.label_content_class.color = valueColor
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -41,6 +41,64 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
|
<!--文本卡-->
|
||||||
|
<el-col v-if="chart.type && chart.type === 'label'">
|
||||||
|
<el-col>
|
||||||
|
<el-button
|
||||||
|
:title="$t('chart.edit')"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
type="text"
|
||||||
|
size="small"
|
||||||
|
style="width: 24px;margin-left: 4px;"
|
||||||
|
@click="editTextLabelThreshold"
|
||||||
|
/>
|
||||||
|
<el-col style="padding: 0 18px;">
|
||||||
|
<el-row
|
||||||
|
v-for="(item,index) in thresholdForm.textLabelThreshold"
|
||||||
|
:key="index"
|
||||||
|
class="line-style"
|
||||||
|
>
|
||||||
|
<el-col :span="6">
|
||||||
|
<span
|
||||||
|
v-if="item.term === 'eq'"
|
||||||
|
:title="$t('chart.filter_eq')"
|
||||||
|
>{{ $t('chart.filter_eq') }}</span>
|
||||||
|
<span
|
||||||
|
v-else-if="item.term === 'not_eq'"
|
||||||
|
:title="$t('chart.filter_not_eq')"
|
||||||
|
>{{ $t('chart.filter_not_eq') }}</span>
|
||||||
|
<span
|
||||||
|
v-else-if="item.term === 'like'"
|
||||||
|
:title="$t('chart.filter_like')"
|
||||||
|
>{{ $t('chart.filter_like') }}</span>
|
||||||
|
<span
|
||||||
|
v-else-if="item.term === 'not like'"
|
||||||
|
:title="$t('chart.filter_not_like')"
|
||||||
|
>{{ $t('chart.filter_not_like') }}</span>
|
||||||
|
<span
|
||||||
|
v-else-if="item.term === 'null'"
|
||||||
|
:title="$t('chart.filter_null')"
|
||||||
|
>{{ $t('chart.filter_null') }}</span>
|
||||||
|
<span
|
||||||
|
v-else-if="item.term === 'not_null'"
|
||||||
|
:title="$t('chart.filter_not_null')"
|
||||||
|
>{{ $t('chart.filter_not_null') }}</span>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<span
|
||||||
|
v-if="!item.term.includes('null')"
|
||||||
|
:title="item.value"
|
||||||
|
>{{ item.value }}</span>
|
||||||
|
<span v-else> </span>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<span :style="{width:'14px', height:'14px', backgroundColor: item.color, border: 'solid 1px #e1e4e8'}" />
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-col>
|
||||||
|
</el-col>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
<!--指标卡-->
|
<!--指标卡-->
|
||||||
<el-col v-if="chart.type && chart.type === 'text'">
|
<el-col v-if="chart.type && chart.type === 'text'">
|
||||||
<el-col>
|
<el-col>
|
||||||
@ -236,6 +294,37 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
|
<!--编辑文本卡阈值-->
|
||||||
|
<el-dialog
|
||||||
|
v-if="editTextLabelThresholdDialog"
|
||||||
|
v-dialogDrag
|
||||||
|
:title="$t('chart.threshold')"
|
||||||
|
:visible="editTextLabelThresholdDialog"
|
||||||
|
:show-close="false"
|
||||||
|
width="800px"
|
||||||
|
class="dialog-css"
|
||||||
|
append-to-body
|
||||||
|
>
|
||||||
|
<text-label-threshold-edit
|
||||||
|
:threshold="thresholdForm.textLabelThreshold"
|
||||||
|
@onTextLabelThresholdChange="thresholdTextChange"
|
||||||
|
/>
|
||||||
|
<div
|
||||||
|
slot="footer"
|
||||||
|
class="dialog-footer"
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
@click="closeTextLabelThreshold"
|
||||||
|
>{{ $t('chart.cancel') }}</el-button>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
size="mini"
|
||||||
|
@click="changeTextLabelThreshold"
|
||||||
|
>{{ $t('chart.confirm') }}</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
<!--编辑指标卡阈值-->
|
<!--编辑指标卡阈值-->
|
||||||
<el-dialog
|
<el-dialog
|
||||||
v-if="editLabelThresholdDialog"
|
v-if="editLabelThresholdDialog"
|
||||||
@ -306,10 +395,11 @@
|
|||||||
import { DEFAULT_THRESHOLD } from '@/views/chart/chart/chart'
|
import { DEFAULT_THRESHOLD } from '@/views/chart/chart/chart'
|
||||||
import TextThresholdEdit from '@/views/chart/components/senior/dialog/TextThresholdEdit'
|
import TextThresholdEdit from '@/views/chart/components/senior/dialog/TextThresholdEdit'
|
||||||
import TableThresholdEdit from '@/views/chart/components/senior/dialog/TableThresholdEdit'
|
import TableThresholdEdit from '@/views/chart/components/senior/dialog/TableThresholdEdit'
|
||||||
|
import TextLabelThresholdEdit from '@/views/chart/components/senior/dialog/TextLabelThresholdEdit'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Threshold',
|
name: 'Threshold',
|
||||||
components: { TableThresholdEdit, TextThresholdEdit },
|
components: { TextLabelThresholdEdit, TableThresholdEdit, TextThresholdEdit },
|
||||||
props: {
|
props: {
|
||||||
chart: {
|
chart: {
|
||||||
type: Object,
|
type: Object,
|
||||||
@ -319,6 +409,8 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
thresholdForm: JSON.parse(JSON.stringify(DEFAULT_THRESHOLD)),
|
thresholdForm: JSON.parse(JSON.stringify(DEFAULT_THRESHOLD)),
|
||||||
|
editTextLabelThresholdDialog: false,
|
||||||
|
textThresholdArr: [],
|
||||||
editLabelThresholdDialog: false,
|
editLabelThresholdDialog: false,
|
||||||
thresholdArr: [],
|
thresholdArr: [],
|
||||||
editTableThresholdDialog: false,
|
editTableThresholdDialog: false,
|
||||||
@ -347,6 +439,9 @@ export default {
|
|||||||
}
|
}
|
||||||
if (senior.threshold) {
|
if (senior.threshold) {
|
||||||
this.thresholdForm = senior.threshold
|
this.thresholdForm = senior.threshold
|
||||||
|
if (!this.thresholdForm.textLabelThreshold) {
|
||||||
|
this.thresholdForm.textLabelThreshold = []
|
||||||
|
}
|
||||||
if (!this.thresholdForm.labelThreshold) {
|
if (!this.thresholdForm.labelThreshold) {
|
||||||
this.thresholdForm.labelThreshold = []
|
this.thresholdForm.labelThreshold = []
|
||||||
}
|
}
|
||||||
@ -356,6 +451,7 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
this.thresholdForm = JSON.parse(JSON.stringify(DEFAULT_THRESHOLD))
|
this.thresholdForm = JSON.parse(JSON.stringify(DEFAULT_THRESHOLD))
|
||||||
}
|
}
|
||||||
|
this.textThresholdArr = JSON.parse(JSON.stringify(this.thresholdForm.textLabelThreshold))
|
||||||
this.thresholdArr = JSON.parse(JSON.stringify(this.thresholdForm.labelThreshold))
|
this.thresholdArr = JSON.parse(JSON.stringify(this.thresholdForm.labelThreshold))
|
||||||
this.tableThresholdArr = JSON.parse(JSON.stringify(this.thresholdForm.tableThreshold))
|
this.tableThresholdArr = JSON.parse(JSON.stringify(this.thresholdForm.tableThreshold))
|
||||||
}
|
}
|
||||||
@ -452,10 +548,45 @@ export default {
|
|||||||
thresholdChange(val) {
|
thresholdChange(val) {
|
||||||
this.thresholdArr = val
|
this.thresholdArr = val
|
||||||
},
|
},
|
||||||
|
|
||||||
|
editTextLabelThreshold() {
|
||||||
|
this.editTextLabelThresholdDialog = true
|
||||||
|
},
|
||||||
|
closeTextLabelThreshold() {
|
||||||
|
this.editTextLabelThresholdDialog = false
|
||||||
|
},
|
||||||
|
changeTextLabelThreshold() {
|
||||||
|
// check line config
|
||||||
|
for (let i = 0; i < this.textThresholdArr.length; i++) {
|
||||||
|
const ele = this.textThresholdArr[i]
|
||||||
|
if (!ele.term || ele.term === '') {
|
||||||
|
this.$message({
|
||||||
|
message: this.$t('chart.exp_can_not_empty'),
|
||||||
|
type: 'error',
|
||||||
|
showClose: true
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!ele.value) {
|
||||||
|
this.$message({
|
||||||
|
message: this.$t('chart.value_can_not_empty'),
|
||||||
|
type: 'error',
|
||||||
|
showClose: true
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.thresholdForm.textLabelThreshold = JSON.parse(JSON.stringify(this.textThresholdArr))
|
||||||
|
this.changeThreshold()
|
||||||
|
this.closeTextLabelThreshold()
|
||||||
|
},
|
||||||
|
thresholdTextChange(val) {
|
||||||
|
this.textThresholdArr = val
|
||||||
|
},
|
||||||
|
|
||||||
tableThresholdChange(val) {
|
tableThresholdChange(val) {
|
||||||
this.tableThresholdArr = val
|
this.tableThresholdArr = val
|
||||||
},
|
},
|
||||||
|
|
||||||
editTableThreshold() {
|
editTableThreshold() {
|
||||||
this.editTableThresholdDialog = true
|
this.editTableThresholdDialog = true
|
||||||
},
|
},
|
||||||
|
@ -0,0 +1,209 @@
|
|||||||
|
<template>
|
||||||
|
<el-col>
|
||||||
|
<el-button
|
||||||
|
icon="el-icon-plus"
|
||||||
|
circle
|
||||||
|
size="mini"
|
||||||
|
style="margin-bottom: 10px;"
|
||||||
|
@click="addThreshold"
|
||||||
|
/>
|
||||||
|
<div style="max-height: 50vh;overflow-y: auto;">
|
||||||
|
<el-row
|
||||||
|
v-for="(item,index) in thresholdArr"
|
||||||
|
:key="index"
|
||||||
|
class="line-item"
|
||||||
|
>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-select
|
||||||
|
v-model="item.term"
|
||||||
|
size="mini"
|
||||||
|
@change="changeThreshold"
|
||||||
|
>
|
||||||
|
<el-option-group
|
||||||
|
v-for="(group,idx) in textOptions"
|
||||||
|
:key="idx"
|
||||||
|
:label="group.label"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="opt in group.options"
|
||||||
|
:key="opt.value"
|
||||||
|
:label="opt.label"
|
||||||
|
:value="opt.value"
|
||||||
|
/>
|
||||||
|
</el-option-group>
|
||||||
|
</el-select>
|
||||||
|
</el-col>
|
||||||
|
<el-col
|
||||||
|
:span="14"
|
||||||
|
style="text-align: center;"
|
||||||
|
>
|
||||||
|
<el-input
|
||||||
|
v-if="!item.term.includes('null')"
|
||||||
|
v-model="item.value"
|
||||||
|
class="value-item"
|
||||||
|
:placeholder="$t('chart.drag_block_label_value')"
|
||||||
|
size="mini"
|
||||||
|
clearable
|
||||||
|
@change="changeThreshold"
|
||||||
|
/>
|
||||||
|
</el-col>
|
||||||
|
<el-col
|
||||||
|
:span="2"
|
||||||
|
style="text-align: center;"
|
||||||
|
>
|
||||||
|
<el-color-picker
|
||||||
|
v-model="item.color"
|
||||||
|
show-alpha
|
||||||
|
class="color-picker-style"
|
||||||
|
:predefine="predefineColors"
|
||||||
|
@change="changeThreshold"
|
||||||
|
/>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="2">
|
||||||
|
<el-button
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
circle
|
||||||
|
style="float: right"
|
||||||
|
@click="removeThreshold(index)"
|
||||||
|
/>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { COLOR_PANEL } from '@/views/chart/chart/chart'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'TextLabelThresholdEdit',
|
||||||
|
props: {
|
||||||
|
threshold: {
|
||||||
|
type: Array,
|
||||||
|
required: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
thresholdArr: [],
|
||||||
|
thresholdObj: {
|
||||||
|
term: 'eq',
|
||||||
|
field: '0',
|
||||||
|
value: '',
|
||||||
|
color: '#ff0000ff'
|
||||||
|
},
|
||||||
|
textOptions: [
|
||||||
|
{
|
||||||
|
label: '',
|
||||||
|
options: [{
|
||||||
|
value: 'eq',
|
||||||
|
label: this.$t('chart.filter_eq')
|
||||||
|
}, {
|
||||||
|
value: 'not_eq',
|
||||||
|
label: this.$t('chart.filter_not_eq')
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '',
|
||||||
|
options: [{
|
||||||
|
value: 'like',
|
||||||
|
label: this.$t('chart.filter_like')
|
||||||
|
}, {
|
||||||
|
value: 'not like',
|
||||||
|
label: this.$t('chart.filter_not_like')
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '',
|
||||||
|
options: [{
|
||||||
|
value: 'null',
|
||||||
|
label: this.$t('chart.filter_null')
|
||||||
|
}, {
|
||||||
|
value: 'not_null',
|
||||||
|
label: this.$t('chart.filter_not_null')
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
predefineColors: COLOR_PANEL
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.init()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
init() {
|
||||||
|
this.thresholdArr = JSON.parse(JSON.stringify(this.threshold))
|
||||||
|
},
|
||||||
|
addThreshold() {
|
||||||
|
this.thresholdArr.push(JSON.parse(JSON.stringify(this.thresholdObj)))
|
||||||
|
this.changeThreshold()
|
||||||
|
},
|
||||||
|
removeThreshold(index) {
|
||||||
|
this.thresholdArr.splice(index, 1)
|
||||||
|
this.changeThreshold()
|
||||||
|
},
|
||||||
|
|
||||||
|
changeThreshold() {
|
||||||
|
this.$emit('onTextLabelThresholdChange', this.thresholdArr)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.line-item {
|
||||||
|
width: 100%;
|
||||||
|
border-radius: 4px;
|
||||||
|
border: 1px solid #DCDFE6;
|
||||||
|
padding: 4px 14px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: left;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-item ::v-deep .el-form-item__label {
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
span {
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.value-item {
|
||||||
|
position: relative;
|
||||||
|
display: inline-block;
|
||||||
|
width: 200px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.between-item {
|
||||||
|
position: relative;
|
||||||
|
display: inline-block;
|
||||||
|
width: 100px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select-item {
|
||||||
|
position: relative;
|
||||||
|
display: inline-block;
|
||||||
|
width: 100px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-select-dropdown__item {
|
||||||
|
padding: 0 20px;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.color-picker-style{
|
||||||
|
cursor: pointer;
|
||||||
|
z-index: 1003;
|
||||||
|
width: 28px;
|
||||||
|
height: 28px;
|
||||||
|
margin-top: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.color-picker-style ::v-deep .el-color-picker__trigger{
|
||||||
|
width: 28px;
|
||||||
|
height: 28px;
|
||||||
|
}
|
||||||
|
</style>
|
@ -998,7 +998,7 @@
|
|||||||
>
|
>
|
||||||
<el-row class="view-panel">
|
<el-row class="view-panel">
|
||||||
<div
|
<div
|
||||||
v-if="view.type && (view.type.includes('bar') || view.type.includes('line') || view.type.includes('area') || view.type.includes('mix') || view.type.includes('gauge') || view.type === 'text' || view.type.includes('table') || view.type === 'map' || view.type === 'buddle-map')"
|
v-if="view.type && (view.type.includes('bar') || view.type.includes('line') || view.type.includes('area') || view.type.includes('mix') || view.type.includes('gauge') || view.type === 'text' || view.type === 'label' || view.type.includes('table') || view.type === 'map' || view.type === 'buddle-map')"
|
||||||
style="overflow:auto;border-right: 1px solid #e6e6e6;height: 100%;width: 100%;"
|
style="overflow:auto;border-right: 1px solid #e6e6e6;height: 100%;width: 100%;"
|
||||||
class="attr-style theme-border-class"
|
class="attr-style theme-border-class"
|
||||||
>
|
>
|
||||||
@ -1037,7 +1037,7 @@
|
|||||||
</el-collapse>
|
</el-collapse>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row
|
<el-row
|
||||||
v-if="view.type && (view.type.includes('bar') || view.type.includes('line') || view.type.includes('area') || view.type.includes('mix') || view.type.includes('gauge') || view.type === 'text' || (view.render === 'antv' && view.type.includes('table')))"
|
v-if="view.type && (view.type.includes('bar') || view.type.includes('line') || view.type.includes('area') || view.type.includes('mix') || view.type.includes('gauge') || view.type === 'text' || view.type === 'label' || (view.render === 'antv' && view.type.includes('table')))"
|
||||||
>
|
>
|
||||||
<span class="padding-lr">{{ $t('chart.analyse_cfg') }}</span>
|
<span class="padding-lr">{{ $t('chart.analyse_cfg') }}</span>
|
||||||
<el-collapse
|
<el-collapse
|
||||||
@ -1058,7 +1058,7 @@
|
|||||||
/>
|
/>
|
||||||
</el-collapse-item>
|
</el-collapse-item>
|
||||||
<el-collapse-item
|
<el-collapse-item
|
||||||
v-if="view.type && (view.type.includes('gauge') || view.type === 'text' || (view.render === 'antv' && view.type.includes('table')))"
|
v-if="view.type && (view.type.includes('gauge') || view.type === 'text' || view.type === 'label' || (view.render === 'antv' && view.type.includes('table')))"
|
||||||
name="threshold"
|
name="threshold"
|
||||||
:title="$t('chart.threshold')"
|
:title="$t('chart.threshold')"
|
||||||
>
|
>
|
||||||
|
@ -165,12 +165,12 @@
|
|||||||
v-show=" show &&showIndex===1"
|
v-show=" show &&showIndex===1"
|
||||||
:canvas-id="canvasId"
|
:canvas-id="canvasId"
|
||||||
/>
|
/>
|
||||||
<subject-setting v-show=" show &&showIndex===2" />
|
<subject-setting v-show=" show &&showIndex===2"/>
|
||||||
<assist-component v-show=" show &&showIndex===3" />
|
<assist-component v-show=" show &&showIndex===3"/>
|
||||||
</div>
|
</div>
|
||||||
</el-drawer>
|
</el-drawer>
|
||||||
<!--PC端画布区域-->
|
<!--PC端画布区域-->
|
||||||
<canvas-opt-bar v-if="!previewVisible&&!mobileLayoutStatus" />
|
<canvas-opt-bar v-if="!previewVisible&&!mobileLayoutStatus"/>
|
||||||
<de-canvas
|
<de-canvas
|
||||||
v-if="!previewVisible&&!mobileLayoutStatus"
|
v-if="!previewVisible&&!mobileLayoutStatus"
|
||||||
ref="canvasMainRef"
|
ref="canvasMainRef"
|
||||||
@ -196,7 +196,7 @@
|
|||||||
:style="customCanvasMobileStyle"
|
:style="customCanvasMobileStyle"
|
||||||
class="this_mobile_canvas"
|
class="this_mobile_canvas"
|
||||||
>
|
>
|
||||||
<el-row class="this_mobile_canvas_top" />
|
<el-row class="this_mobile_canvas_top"/>
|
||||||
<el-row class="this_mobile_canvas_inner_top">
|
<el-row class="this_mobile_canvas_inner_top">
|
||||||
{{ panelInfo.name }}
|
{{ panelInfo.name }}
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -205,7 +205,7 @@
|
|||||||
class="this_mobile_canvas_main"
|
class="this_mobile_canvas_main"
|
||||||
:style="mobileCanvasStyle"
|
:style="mobileCanvasStyle"
|
||||||
>
|
>
|
||||||
<canvas-opt-bar v-if="!previewVisible&&mobileLayoutStatus" />
|
<canvas-opt-bar v-if="!previewVisible&&mobileLayoutStatus"/>
|
||||||
<de-canvas
|
<de-canvas
|
||||||
v-if="!previewVisible&&mobileLayoutStatus"
|
v-if="!previewVisible&&mobileLayoutStatus"
|
||||||
ref="canvasMainRef"
|
ref="canvasMainRef"
|
||||||
@ -243,14 +243,14 @@
|
|||||||
/>
|
/>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row class="this_mobile_canvas_bottom" />
|
<el-row class="this_mobile_canvas_bottom"/>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col
|
<el-col
|
||||||
:span="16"
|
:span="16"
|
||||||
class="this_mobile_canvas_cell this_mobile_canvas_wait_cell"
|
class="this_mobile_canvas_cell this_mobile_canvas_wait_cell"
|
||||||
>
|
>
|
||||||
<component-wait />
|
<component-wait/>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</de-main-container>
|
</de-main-container>
|
||||||
@ -268,7 +268,7 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="showBatchViewToolsAside">
|
<div v-if="showBatchViewToolsAside">
|
||||||
<chart-style-batch-set />
|
<chart-style-batch-set/>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="!showViewToolsAside&&!showBatchViewToolsAside">
|
<div v-if="!showViewToolsAside&&!showBatchViewToolsAside">
|
||||||
<el-row style="height: 40px">
|
<el-row style="height: 40px">
|
||||||
@ -287,7 +287,7 @@
|
|||||||
>{{ $t('panel.position_adjust') }}</span>
|
>{{ $t('panel.position_adjust') }}</span>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<position-adjust v-if="curComponent&&!curComponent.auxiliaryMatrix" />
|
<position-adjust v-if="curComponent&&!curComponent.auxiliaryMatrix"/>
|
||||||
<div
|
<div
|
||||||
v-else
|
v-else
|
||||||
class="view-selected-message-class"
|
class="view-selected-message-class"
|
||||||
@ -565,6 +565,7 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
userInfo: null,
|
||||||
canvasId: 'canvas-main',
|
canvasId: 'canvas-main',
|
||||||
panelCacheExist: false,
|
panelCacheExist: false,
|
||||||
viewData: [],
|
viewData: [],
|
||||||
@ -798,6 +799,18 @@ export default {
|
|||||||
this.initWatermark()
|
this.initWatermark()
|
||||||
},
|
},
|
||||||
deep: true
|
deep: true
|
||||||
|
},
|
||||||
|
rightDrawOpen: {
|
||||||
|
handler(newVal, oldVla) {
|
||||||
|
this.initWatermark()
|
||||||
|
},
|
||||||
|
deep: true
|
||||||
|
},
|
||||||
|
outStyle: {
|
||||||
|
handler(newVal, oldVla) {
|
||||||
|
this.initWatermark()
|
||||||
|
},
|
||||||
|
deep: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@ -831,9 +844,15 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
initWatermark() {
|
initWatermark() {
|
||||||
if (this.panelInfo.watermarkInfo) {
|
if (this.panelInfo.watermarkInfo) {
|
||||||
userLoginInfo().then(res => {
|
this.$nextTick(() => {
|
||||||
const userInfo = res.data
|
if (this.userInfo) {
|
||||||
activeWatermark(this.panelInfo.watermarkInfo.settingContent, userInfo, 'canvasInfo-main', this.canvasId, this.panelInfo.watermarkOpen)
|
activeWatermark(this.panelInfo.watermarkInfo.settingContent, this.userInfo, 'canvasInfo-main', this.canvasId, this.panelInfo.watermarkOpen)
|
||||||
|
} else {
|
||||||
|
userLoginInfo().then(res => {
|
||||||
|
this.userInfo = res.data
|
||||||
|
activeWatermark(this.panelInfo.watermarkInfo.settingContent, this.userInfo, 'canvasInfo-main', this.canvasId, this.panelInfo.watermarkOpen)
|
||||||
|
})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -328,10 +328,13 @@ export default {
|
|||||||
|
|
||||||
created() {
|
created() {
|
||||||
this.attrs = this.controlAttrs
|
this.attrs = this.controlAttrs
|
||||||
if (this.widget.isTimeWidget && this.widget.isTimeWidget()) {
|
if (this.widget.isTimeWidget) {
|
||||||
this.showParams = true
|
this.showParams = true
|
||||||
this.isRangeParamWidget = this.widget.isRangeParamWidget && this.widget.isRangeParamWidget()
|
this.isRangeParamWidget = this.widget.isRangeParamWidget && this.widget.isRangeParamWidget()
|
||||||
}
|
}
|
||||||
|
if ('timeYearWidget,timeMonthWidget,timeDateWidget,textSelectWidget,numberSelectWidget'.indexOf(this.widget.name) !== -1) {
|
||||||
|
this.showParams = true
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
changeDynamicParams(val, name) {
|
changeDynamicParams(val, name) {
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
style="border-bottom: 1px solid;border-bottom-color:#E6E6E6;"
|
style="border-bottom: 1px solid;border-bottom-color:#E6E6E6;"
|
||||||
>
|
>
|
||||||
<div style="height: 100%;">
|
<div style="height: 100%;">
|
||||||
<share-head />
|
<share-head/>
|
||||||
</div>
|
</div>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row
|
<el-row
|
||||||
@ -45,7 +45,7 @@
|
|||||||
width="400"
|
width="400"
|
||||||
trigger="click"
|
trigger="click"
|
||||||
>
|
>
|
||||||
<panel-detail-info />
|
<panel-detail-info/>
|
||||||
<i
|
<i
|
||||||
slot="reference"
|
slot="reference"
|
||||||
class="el-icon-warning icon-class"
|
class="el-icon-warning icon-class"
|
||||||
@ -371,8 +371,10 @@ import { findResourceAsBase64 } from '@/api/staticResource/staticResource'
|
|||||||
import PanelDetailInfo from '@/views/panel/list/common/PanelDetailInfo'
|
import PanelDetailInfo from '@/views/panel/list/common/PanelDetailInfo'
|
||||||
import AppExportForm from '@/views/panel/list/AppExportForm'
|
import AppExportForm from '@/views/panel/list/AppExportForm'
|
||||||
import GrantAuth from '../grantAuth'
|
import GrantAuth from '../grantAuth'
|
||||||
|
import msgCfm from '@/components/msgCfm/index'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
mixins: [msgCfm],
|
||||||
name: 'PanelViewShow',
|
name: 'PanelViewShow',
|
||||||
components: { AppExportForm, PanelDetailInfo, Preview, SaveToTemplate, PDFPreExport, ShareHead, GrantAuth },
|
components: { AppExportForm, PanelDetailInfo, Preview, SaveToTemplate, PDFPreExport, ShareHead, GrantAuth },
|
||||||
props: {
|
props: {
|
||||||
@ -743,10 +745,18 @@ export default {
|
|||||||
},
|
},
|
||||||
changePublishState() {
|
changePublishState() {
|
||||||
if (this.panelInfo.status === 'publish') {
|
if (this.panelInfo.status === 'publish') {
|
||||||
this.panelInfo.status = 'unpublished'
|
const options = {
|
||||||
|
title: this.$t('panel.unpublished_tips'),
|
||||||
|
type: 'primary',
|
||||||
|
cb: () => this.updatePublishStatus('unpublished')
|
||||||
|
}
|
||||||
|
this.handlerConfirm(options, this.$t('commons.confirm'))
|
||||||
} else {
|
} else {
|
||||||
this.panelInfo.status = 'publish'
|
this.updatePublishStatus('publish')
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
updatePublishStatus(newStatus) {
|
||||||
|
this.panelInfo.status = newStatus
|
||||||
updatePanelStatus(this.panelInfo.id, { 'status': this.panelInfo.status })
|
updatePanelStatus(this.panelInfo.id, { 'status': this.panelInfo.status })
|
||||||
this.$emit('editPanelBashInfo', {
|
this.$emit('editPanelBashInfo', {
|
||||||
'operation': 'status',
|
'operation': 'status',
|
||||||
|
@ -216,6 +216,7 @@ import PluginCom from '@/views/system/plugin/PluginCom'
|
|||||||
import { groupTree, appApply } from '@/api/panel/panel'
|
import { groupTree, appApply } from '@/api/panel/panel'
|
||||||
import { dsGroupTree } from '@/api/dataset/dataset'
|
import { dsGroupTree } from '@/api/dataset/dataset'
|
||||||
import { deepCopy } from '@/components/canvas/utils/utils'
|
import { deepCopy } from '@/components/canvas/utils/utils'
|
||||||
|
import { Base64 } from 'js-base64'
|
||||||
export default {
|
export default {
|
||||||
name: 'DsForm',
|
name: 'DsForm',
|
||||||
components: {
|
components: {
|
||||||
@ -707,9 +708,9 @@ export default {
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
const data = JSON.parse(JSON.stringify(this.form))
|
const data = JSON.parse(JSON.stringify(this.form))
|
||||||
if (data.type === 'api') {
|
if (data.type === 'api') {
|
||||||
data.configuration = JSON.stringify(data.apiConfiguration)
|
data.configuration = Base64.encode(JSON.stringify(data.apiConfiguration))
|
||||||
} else {
|
} else {
|
||||||
data.configuration = JSON.stringify(data.configuration)
|
data.configuration = Base64.encode(JSON.stringify(data.configuration))
|
||||||
}
|
}
|
||||||
if (data.showModel === 'show' && !this.canEdit) {
|
if (data.showModel === 'show' && !this.canEdit) {
|
||||||
validateDsById(data.id).then(res => {
|
validateDsById(data.id).then(res => {
|
||||||
|
@ -226,10 +226,7 @@
|
|||||||
>{{ $t('commons.cancel') }}
|
>{{ $t('commons.cancel') }}
|
||||||
</deBtn>
|
</deBtn>
|
||||||
<deBtn
|
<deBtn
|
||||||
v-if="
|
v-if="formType === 'add' || hasDataPermission('manage', params.privileges)"
|
||||||
formType === 'add' ||
|
|
||||||
hasDataPermission('manage', params.privileges)
|
|
||||||
"
|
|
||||||
secondary
|
secondary
|
||||||
@click="validaDatasource"
|
@click="validaDatasource"
|
||||||
>{{ $t('commons.validate') }}
|
>{{ $t('commons.validate') }}
|
||||||
@ -307,6 +304,7 @@ import { dsGroupTree } from '@/api/dataset/dataset'
|
|||||||
import { appApply, appEdit, groupTree } from '@/api/panel/panel'
|
import { appApply, appEdit, groupTree } from '@/api/panel/panel'
|
||||||
import { deepCopy } from '@/components/canvas/utils/utils'
|
import { deepCopy } from '@/components/canvas/utils/utils'
|
||||||
import { hasDataPermission } from '@/utils/permission'
|
import { hasDataPermission } from '@/utils/permission'
|
||||||
|
import { Base64 } from 'js-base64'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'DsForm',
|
name: 'DsForm',
|
||||||
@ -710,6 +708,12 @@ export default {
|
|||||||
getDatasourceDetail(id, showModel) {
|
getDatasourceDetail(id, showModel) {
|
||||||
this.$emit('update:formLoading', true)
|
this.$emit('update:formLoading', true)
|
||||||
return getDatasourceDetail(id).then((res) => {
|
return getDatasourceDetail(id).then((res) => {
|
||||||
|
if(res.data.configuration){
|
||||||
|
res.data.configuration = Base64.decode(res.data.configuration)
|
||||||
|
}
|
||||||
|
if(res.data.apiConfigurationStr){
|
||||||
|
res.data.apiConfiguration = JSON.parse(Base64.decode(res.data.apiConfigurationStr))
|
||||||
|
}
|
||||||
this.params = { ...res.data, showModel }
|
this.params = { ...res.data, showModel }
|
||||||
this.$emit('setParams', { ...this.params })
|
this.$emit('setParams', { ...this.params })
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
@ -729,6 +733,12 @@ export default {
|
|||||||
const newArr = []
|
const newArr = []
|
||||||
for (let index = 0; index < array.length; index++) {
|
for (let index = 0; index < array.length; index++) {
|
||||||
const element = array[index]
|
const element = array[index]
|
||||||
|
if(element.configuration){
|
||||||
|
element.configuration = Base64.decode(element.configuration)
|
||||||
|
}
|
||||||
|
if(element.apiConfigurationStr){
|
||||||
|
element.apiConfiguration = Base64.decode(element.apiConfigurationStr)
|
||||||
|
}
|
||||||
if (this.msgNodeId) {
|
if (this.msgNodeId) {
|
||||||
if (element.id === this.msgNodeId) {
|
if (element.id === this.msgNodeId) {
|
||||||
element.msgNode = true
|
element.msgNode = true
|
||||||
@ -967,9 +977,9 @@ export default {
|
|||||||
form.apiConfiguration.forEach((item) => {
|
form.apiConfiguration.forEach((item) => {
|
||||||
delete item.status
|
delete item.status
|
||||||
})
|
})
|
||||||
form.configuration = JSON.stringify(form.apiConfiguration)
|
form.configuration = Base64.encode(JSON.stringify(form.apiConfiguration))
|
||||||
} else {
|
} else {
|
||||||
form.configuration = JSON.stringify(form.configuration)
|
form.configuration = Base64.encode(JSON.stringify(form.configuration))
|
||||||
}
|
}
|
||||||
const isAppMarket = this.positionCheck('appMarket')
|
const isAppMarket = this.positionCheck('appMarket')
|
||||||
let appApplyForm
|
let appApplyForm
|
||||||
@ -1051,7 +1061,7 @@ export default {
|
|||||||
this.$refs.dsForm.validate((valid) => {
|
this.$refs.dsForm.validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
const data = JSON.parse(JSON.stringify(this.form))
|
const data = JSON.parse(JSON.stringify(this.form))
|
||||||
data.configuration = JSON.stringify(data.configuration)
|
data.configuration = Base64.encode(JSON.stringify(data.configuration))
|
||||||
getSchema(data).then((res) => {
|
getSchema(data).then((res) => {
|
||||||
this.schemas = res.data
|
this.schemas = res.data
|
||||||
this.openMessageSuccess('commons.success')
|
this.openMessageSuccess('commons.success')
|
||||||
@ -1102,9 +1112,9 @@ export default {
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
const data = JSON.parse(JSON.stringify(this.form))
|
const data = JSON.parse(JSON.stringify(this.form))
|
||||||
if (data.type === 'api') {
|
if (data.type === 'api') {
|
||||||
data.configuration = JSON.stringify(data.apiConfiguration)
|
data.configuration = Base64.encode(JSON.stringify(data.apiConfiguration))
|
||||||
} else {
|
} else {
|
||||||
data.configuration = JSON.stringify(data.configuration)
|
data.configuration = Base64.encode(JSON.stringify(data.configuration))
|
||||||
}
|
}
|
||||||
if (data.showModel === 'show' && !this.canEdit) {
|
if (data.showModel === 'show' && !this.canEdit) {
|
||||||
validateDsById(data.id).then((res) => {
|
validateDsById(data.id).then((res) => {
|
||||||
|
@ -316,6 +316,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import { mapGetters } from 'vuex'
|
import { mapGetters } from 'vuex'
|
||||||
import i18n from '@/lang'
|
import i18n from '@/lang'
|
||||||
|
import { Base64 } from 'js-base64'
|
||||||
import {
|
import {
|
||||||
listDatasource,
|
listDatasource,
|
||||||
listDatasourceByType,
|
listDatasourceByType,
|
||||||
@ -502,8 +503,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
refreshType(datasource) {
|
refreshType(datasource) {
|
||||||
const method =
|
const method = this.showView === 'Datasource' ? listDatasourceByType : listDriverByType
|
||||||
this.showView === 'Datasource' ? listDatasourceByType : listDriverByType
|
|
||||||
let typeData = []
|
let typeData = []
|
||||||
method(datasource.type).then((res) => {
|
method(datasource.type).then((res) => {
|
||||||
typeData = this.buildTree(res.data)
|
typeData = this.buildTree(res.data)
|
||||||
@ -538,6 +538,12 @@ export default {
|
|||||||
const newArr = []
|
const newArr = []
|
||||||
for (let index = 0; index < array.length; index++) {
|
for (let index = 0; index < array.length; index++) {
|
||||||
const element = array[index]
|
const element = array[index]
|
||||||
|
if(element.configuration){
|
||||||
|
element.configuration = Base64.decode(element.configuration)
|
||||||
|
}
|
||||||
|
if(element.apiConfigurationStr){
|
||||||
|
element.apiConfiguration = JSON.parse(Base64.decode(element.apiConfigurationStr))
|
||||||
|
}
|
||||||
if (this.msgNodeId) {
|
if (this.msgNodeId) {
|
||||||
if (element.id === this.msgNodeId) {
|
if (element.id === this.msgNodeId) {
|
||||||
element.msgNode = true
|
element.msgNode = true
|
||||||
|
Loading…
Reference in New Issue
Block a user