Merge branch 'dev' into pr@dev_memory_component

This commit is contained in:
dataeaseShu 2022-12-12 18:14:27 +08:00
commit 939588f510
26 changed files with 590 additions and 51 deletions

View File

@ -19,7 +19,6 @@ import io.dataease.plugins.common.base.domain.Datasource;
import io.dataease.service.datasource.DatasourceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.web.bind.annotation.*;

View File

@ -19,6 +19,7 @@ public class DatasourceDTO extends Datasource {
@ApiModelProperty("权限")
private String privileges;
private List<ApiDefinition> apiConfiguration;
private String apiConfigurationStr;
private String typeDesc;
private DatasourceCalculationMode calculationMode;
}

View File

@ -608,6 +608,7 @@
id,
table_id,
chart_id,
origin_name,
`name`,
dataease_name,
group_type,
@ -624,6 +625,7 @@
uuid() AS id,
chart_view_field.table_id,
chart_view_field.pv_copy.chart_view_id AS chart_id,
chart_view_field.origin_name,
chart_view_field.`name`,
chart_view_field.dataease_name,
chart_view_field.group_type,

View File

@ -1014,7 +1014,7 @@ public class ChartDataBuild {
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"));
} 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;
case RetainMToN:

View File

@ -108,7 +108,7 @@ public class DatasourceService {
if (!types().stream().map(DataSourceType::getType).collect(Collectors.toList()).contains(datasource.getType())) {
throw new Exception("Datasource type not supported.");
}
datasource.setConfiguration(new String(java.util.Base64.getDecoder().decode(datasource.getConfiguration())));
Provider datasourceProvider = ProviderFactory.getProvider(datasource.getType());
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){
@ -253,6 +261,7 @@ public class DatasourceService {
if (!types().stream().map(DataSourceType::getType).collect(Collectors.toList()).contains(updataDsRequest.getType())) {
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());
Datasource datasource = new Datasource();
datasource.setName(updataDsRequest.getName());
@ -284,6 +293,7 @@ public class DatasourceService {
}
public ResultHolder validate(Datasource datasource) throws Exception {
datasource.setConfiguration(new String(java.util.Base64.getDecoder().decode(datasource.getConfiguration())));
DatasourceDTO datasourceDTO = new DatasourceDTO();
BeanUtils.copyBean(datasourceDTO, datasource);
try {
@ -372,6 +382,7 @@ public class DatasourceService {
}
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());
DatasourceRequest datasourceRequest = new DatasourceRequest();
datasourceRequest.setDatasource(datasource);

View File

@ -8,11 +8,12 @@ export function post(url, data, loading = false) {
data
})
}
export function tableField(id) {
return request({
url: '/dataset/table/getWithPermission/' + id,
method: 'post',
loading: true,
loading: false,
hideMsg: true,
timeout: 60000
})
@ -34,6 +35,7 @@ export function chartCopy(id, panelId) {
loading: false
})
}
export function chartBatchCopy(params, panelId) {
return request({
url: '/chart/view/chartBatchCopy/' + panelId,
@ -42,6 +44,7 @@ export function chartBatchCopy(params, panelId) {
loading: false
})
}
export function chartGroupTree(data) {
return request({
url: '/chart/group/tree',
@ -116,6 +119,7 @@ export function resetViewCacheCallBack(viewId, panelId, callback) {
callback(rep)
})
}
export function resetViewCache(viewId, panelId) {
return request({
url: '/chart/view/resetViewCache/' + viewId + '/' + panelId,

View File

@ -6,6 +6,7 @@
@scroll="canvasScroll"
>
<canvas-opt-bar
v-if="canvasId==='canvas-main'"
ref="canvas-opt-bar"
:canvas-style-data="canvasStyleData"
@link-export-pdf="downloadAsPDF"
@ -155,7 +156,7 @@ import bus from '@/utils/bus'
import { buildFilterMap, buildViewKeyMap, formatCondition, valueValid, viewIdMatch } from '@/utils/conditionUtil'
import { hasDataPermission } from '@/utils/permission'
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 { queryAll } from '@/api/panel/pdfTemplate'
import PDFPreExport from '@/views/panel/export/PDFPreExport'
@ -456,7 +457,8 @@ export default {
if (this.userInfo) {
activeWatermark(this.panelInfo.watermarkInfo.settingContent, this.userInfo, waterDomId, this.canvasId, this.panelInfo.watermarkOpen)
} else {
userLoginInfo().then(res => {
const method = this.userId ? proxyUserLoginInfo : userLoginInfo
method(this.userId).then(res => {
this.userInfo = res.data
activeWatermark(this.panelInfo.watermarkInfo.settingContent, this.userInfo, waterDomId, this.canvasId, this.panelInfo.watermarkOpen)
})

View File

@ -17,8 +17,8 @@
},
className
]"
@mousedown="elementMouseDown"
@touchstart="elementTouchDown"
@mousedown="outerElementMouseDown"
@mouseenter="enter"
@mouseleave="leave"
>
@ -66,20 +66,24 @@
@mousedown.stop.prevent="handleDown(handlei, $event)"
@touchstart.stop.prevent="handleTouchDown(handlei, $event)"
>
<slot :name="handlei" />
<slot :name="handlei"/>
</div>
<div
:id="componentCanvasId"
:style="mainSlotStyleInner"
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
v-if="svgInnerEnable"
:style="{'color':element.commonBackground.innerImageColor}"
class="svg-background"
:icon-class="mainSlotSvgInner"
/>
<slot />
<slot/>
</div>
</div>
</div>
@ -863,6 +867,18 @@ export default {
eventsFor = events.touch
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) {
// private
this.$store.commit('setClickComponentStatus', true)
@ -2131,4 +2147,42 @@ export default {
.drag-on-tab-collision {
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>

View File

@ -79,7 +79,7 @@
:canvas-style-data="canvasStyleData"
:canvas-id="element.id+'-'+item.name"
:panel-info="panelInfo"
:in-screen="true"
:in-screen="inScreen"
:show-position="showPosition"
/>
</div>
@ -232,6 +232,11 @@ export default {
name: 'DeTabs',
components: { TextAttr, Preview, DeCanvasTab, TabUseList, ViewSelect, DataeaseTabs },
props: {
inScreen: {
type: Boolean,
required: false,
default: true
},
canvasId: {
type: String,
default: 'canvas-main'

View File

@ -1932,6 +1932,7 @@ export default {
back_parent: 'Back to previous'
},
panel: {
unpublished_tips: 'After unpublishing, the panel cannot be viewed. Are you sure you want to cancel publishing? ',
position_adjust_component: 'Position adjust',
active_font_size: 'Selected font size',
carousel: 'Carousel',

View File

@ -1926,6 +1926,7 @@ export default {
back_parent: '返回上一級'
},
panel: {
unpublished_tips: '取消發布後,該儀表板不能被查看。確定要取消發布?',
position_adjust_component: '位置調整',
active_font_size: '选中字體大小',
carousel: '輪播',

View File

@ -1926,6 +1926,7 @@ export default {
back_parent: '返回上一级'
},
panel: {
unpublished_tips: '取消发布后,该仪表板不能被查看。确定要取消发布?',
position_adjust_component: '位置调整',
active_font_size: '选中字体大小',
carousel: '轮播',

View File

@ -1,6 +1,6 @@
import { Condition } from '@/components/widget/bean/Condition'
import { ApplicationContext } from '@/utils/ApplicationContext'
import store from '@/store'
/**
* 判断两个conditions数组是否相同
@ -70,7 +70,11 @@ export const buildViewKeyMap = panelItems => {
}
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') {
return true
}

View File

@ -449,7 +449,8 @@ export const DEFAULT_FUNCTION_CFG = {
export const DEFAULT_THRESHOLD = {
gaugeThreshold: '',
labelThreshold: [],
tableThreshold: []
tableThreshold: [],
textLabelThreshold: []
}
export const DEFAULT_SCROLL = {
open: false,

View File

@ -69,3 +69,15 @@ export function getOriginFieldName(dimensionList, quotaList, field) {
}
return originName
}
export function resetValueFormatter(item) {
if (item) {
item.formatterCfg = {
type: 'auto', // auto,value,percent
unit: 1, // 换算单位
suffix: '', // 单位后缀
decimalCount: 2, // 小数位数
thousandSeparator: true// 千分符
}
}
}

View File

@ -157,7 +157,7 @@ export default {
this.$nextTick(function() {
if (that.$refs.tableContainer) {
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.content_class.height = that.height
}

View File

@ -184,7 +184,7 @@ export default {
this.$nextTick(function() {
if (that.$refs.tableContainer) {
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.content_class.height = that.height
}
@ -195,7 +195,8 @@ export default {
const customAttr = JSON.parse(this.chart.customAttr)
if (customAttr.color) {
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) {
this.dimensionShow = customAttr.size.dimensionShow
@ -303,6 +304,57 @@ export default {
},
initRemark() {
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
}
}
}
}
}

View File

@ -41,6 +41,64 @@
</el-form>
</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>&nbsp;</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>
@ -236,6 +294,37 @@
</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
v-if="editLabelThresholdDialog"
@ -306,10 +395,11 @@
import { DEFAULT_THRESHOLD } from '@/views/chart/chart/chart'
import TextThresholdEdit from '@/views/chart/components/senior/dialog/TextThresholdEdit'
import TableThresholdEdit from '@/views/chart/components/senior/dialog/TableThresholdEdit'
import TextLabelThresholdEdit from '@/views/chart/components/senior/dialog/TextLabelThresholdEdit'
export default {
name: 'Threshold',
components: { TableThresholdEdit, TextThresholdEdit },
components: { TextLabelThresholdEdit, TableThresholdEdit, TextThresholdEdit },
props: {
chart: {
type: Object,
@ -319,6 +409,8 @@ export default {
data() {
return {
thresholdForm: JSON.parse(JSON.stringify(DEFAULT_THRESHOLD)),
editTextLabelThresholdDialog: false,
textThresholdArr: [],
editLabelThresholdDialog: false,
thresholdArr: [],
editTableThresholdDialog: false,
@ -347,6 +439,9 @@ export default {
}
if (senior.threshold) {
this.thresholdForm = senior.threshold
if (!this.thresholdForm.textLabelThreshold) {
this.thresholdForm.textLabelThreshold = []
}
if (!this.thresholdForm.labelThreshold) {
this.thresholdForm.labelThreshold = []
}
@ -356,6 +451,7 @@ export default {
} else {
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.tableThresholdArr = JSON.parse(JSON.stringify(this.thresholdForm.tableThreshold))
}
@ -452,10 +548,45 @@ export default {
thresholdChange(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) {
this.tableThresholdArr = val
},
editTableThreshold() {
this.editTableThresholdDialog = true
},

View File

@ -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>

View File

@ -998,7 +998,7 @@
>
<el-row class="view-panel">
<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%;"
class="attr-style theme-border-class"
>
@ -1037,7 +1037,7 @@
</el-collapse>
</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>
<el-collapse
@ -1058,7 +1058,7 @@
/>
</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"
:title="$t('chart.threshold')"
>

View File

@ -165,12 +165,12 @@
v-show=" show &&showIndex===1"
:canvas-id="canvasId"
/>
<subject-setting v-show=" show &&showIndex===2" />
<assist-component v-show=" show &&showIndex===3" />
<subject-setting v-show=" show &&showIndex===2"/>
<assist-component v-show=" show &&showIndex===3"/>
</div>
</el-drawer>
<!--PC端画布区域-->
<canvas-opt-bar v-if="!previewVisible&&!mobileLayoutStatus" />
<canvas-opt-bar v-if="!previewVisible&&!mobileLayoutStatus"/>
<de-canvas
v-if="!previewVisible&&!mobileLayoutStatus"
ref="canvasMainRef"
@ -196,7 +196,7 @@
:style="customCanvasMobileStyle"
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">
{{ panelInfo.name }}
</el-row>
@ -205,7 +205,7 @@
class="this_mobile_canvas_main"
:style="mobileCanvasStyle"
>
<canvas-opt-bar v-if="!previewVisible&&mobileLayoutStatus" />
<canvas-opt-bar v-if="!previewVisible&&mobileLayoutStatus"/>
<de-canvas
v-if="!previewVisible&&mobileLayoutStatus"
ref="canvasMainRef"
@ -243,14 +243,14 @@
/>
</el-col>
</el-row>
<el-row class="this_mobile_canvas_bottom" />
<el-row class="this_mobile_canvas_bottom"/>
</div>
</el-col>
<el-col
:span="16"
class="this_mobile_canvas_cell this_mobile_canvas_wait_cell"
>
<component-wait />
<component-wait/>
</el-col>
</el-row>
</de-main-container>
@ -268,7 +268,7 @@
/>
</div>
<div v-if="showBatchViewToolsAside">
<chart-style-batch-set />
<chart-style-batch-set/>
</div>
<div v-if="!showViewToolsAside&&!showBatchViewToolsAside">
<el-row style="height: 40px">
@ -287,7 +287,7 @@
>{{ $t('panel.position_adjust') }}</span>
</el-row>
<el-row>
<position-adjust v-if="curComponent&&!curComponent.auxiliaryMatrix" />
<position-adjust v-if="curComponent&&!curComponent.auxiliaryMatrix"/>
<div
v-else
class="view-selected-message-class"
@ -565,6 +565,7 @@ export default {
},
data() {
return {
userInfo: null,
canvasId: 'canvas-main',
panelCacheExist: false,
viewData: [],
@ -798,6 +799,18 @@ export default {
this.initWatermark()
},
deep: true
},
rightDrawOpen: {
handler(newVal, oldVla) {
this.initWatermark()
},
deep: true
},
outStyle: {
handler(newVal, oldVla) {
this.initWatermark()
},
deep: true
}
},
created() {
@ -831,9 +844,15 @@ export default {
methods: {
initWatermark() {
if (this.panelInfo.watermarkInfo) {
userLoginInfo().then(res => {
const userInfo = res.data
activeWatermark(this.panelInfo.watermarkInfo.settingContent, userInfo, 'canvasInfo-main', this.canvasId, this.panelInfo.watermarkOpen)
this.$nextTick(() => {
if (this.userInfo) {
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)
})
}
})
}
},

View File

@ -328,10 +328,13 @@ export default {
created() {
this.attrs = this.controlAttrs
if (this.widget.isTimeWidget && this.widget.isTimeWidget()) {
if (this.widget.isTimeWidget) {
this.showParams = true
this.isRangeParamWidget = this.widget.isRangeParamWidget && this.widget.isRangeParamWidget()
}
if ('timeYearWidget,timeMonthWidget,timeDateWidget,textSelectWidget,numberSelectWidget'.indexOf(this.widget.name) !== -1) {
this.showParams = true
}
},
methods: {
changeDynamicParams(val, name) {

View File

@ -17,7 +17,7 @@
style="border-bottom: 1px solid;border-bottom-color:#E6E6E6;"
>
<div style="height: 100%;">
<share-head />
<share-head/>
</div>
</el-row>
<el-row
@ -45,7 +45,7 @@
width="400"
trigger="click"
>
<panel-detail-info />
<panel-detail-info/>
<i
slot="reference"
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 AppExportForm from '@/views/panel/list/AppExportForm'
import GrantAuth from '../grantAuth'
import msgCfm from '@/components/msgCfm/index'
export default {
mixins: [msgCfm],
name: 'PanelViewShow',
components: { AppExportForm, PanelDetailInfo, Preview, SaveToTemplate, PDFPreExport, ShareHead, GrantAuth },
props: {
@ -743,10 +745,18 @@ export default {
},
changePublishState() {
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 {
this.panelInfo.status = 'publish'
this.updatePublishStatus('publish')
}
},
updatePublishStatus(newStatus) {
this.panelInfo.status = newStatus
updatePanelStatus(this.panelInfo.id, { 'status': this.panelInfo.status })
this.$emit('editPanelBashInfo', {
'operation': 'status',

View File

@ -216,6 +216,7 @@ import PluginCom from '@/views/system/plugin/PluginCom'
import { groupTree, appApply } from '@/api/panel/panel'
import { dsGroupTree } from '@/api/dataset/dataset'
import { deepCopy } from '@/components/canvas/utils/utils'
import { Base64 } from 'js-base64'
export default {
name: 'DsForm',
components: {
@ -707,9 +708,9 @@ export default {
if (valid) {
const data = JSON.parse(JSON.stringify(this.form))
if (data.type === 'api') {
data.configuration = JSON.stringify(data.apiConfiguration)
data.configuration = Base64.encode(JSON.stringify(data.apiConfiguration))
} else {
data.configuration = JSON.stringify(data.configuration)
data.configuration = Base64.encode(JSON.stringify(data.configuration))
}
if (data.showModel === 'show' && !this.canEdit) {
validateDsById(data.id).then(res => {

View File

@ -226,10 +226,7 @@
>{{ $t('commons.cancel') }}
</deBtn>
<deBtn
v-if="
formType === 'add' ||
hasDataPermission('manage', params.privileges)
"
v-if="formType === 'add' || hasDataPermission('manage', params.privileges)"
secondary
@click="validaDatasource"
>{{ $t('commons.validate') }}
@ -307,6 +304,7 @@ import { dsGroupTree } from '@/api/dataset/dataset'
import { appApply, appEdit, groupTree } from '@/api/panel/panel'
import { deepCopy } from '@/components/canvas/utils/utils'
import { hasDataPermission } from '@/utils/permission'
import { Base64 } from 'js-base64'
export default {
name: 'DsForm',
@ -710,6 +708,12 @@ export default {
getDatasourceDetail(id, showModel) {
this.$emit('update:formLoading', true)
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.$emit('setParams', { ...this.params })
}).finally(() => {
@ -729,6 +733,12 @@ export default {
const newArr = []
for (let index = 0; index < array.length; 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 (element.id === this.msgNodeId) {
element.msgNode = true
@ -967,9 +977,9 @@ export default {
form.apiConfiguration.forEach((item) => {
delete item.status
})
form.configuration = JSON.stringify(form.apiConfiguration)
form.configuration = Base64.encode(JSON.stringify(form.apiConfiguration))
} else {
form.configuration = JSON.stringify(form.configuration)
form.configuration = Base64.encode(JSON.stringify(form.configuration))
}
const isAppMarket = this.positionCheck('appMarket')
let appApplyForm
@ -1051,7 +1061,7 @@ export default {
this.$refs.dsForm.validate((valid) => {
if (valid) {
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) => {
this.schemas = res.data
this.openMessageSuccess('commons.success')
@ -1102,9 +1112,9 @@ export default {
if (valid) {
const data = JSON.parse(JSON.stringify(this.form))
if (data.type === 'api') {
data.configuration = JSON.stringify(data.apiConfiguration)
data.configuration = Base64.encode(JSON.stringify(data.apiConfiguration))
} else {
data.configuration = JSON.stringify(data.configuration)
data.configuration = Base64.encode(JSON.stringify(data.configuration))
}
if (data.showModel === 'show' && !this.canEdit) {
validateDsById(data.id).then((res) => {

View File

@ -316,6 +316,7 @@
<script>
import { mapGetters } from 'vuex'
import i18n from '@/lang'
import { Base64 } from 'js-base64'
import {
listDatasource,
listDatasourceByType,
@ -502,8 +503,7 @@ export default {
})
},
refreshType(datasource) {
const method =
this.showView === 'Datasource' ? listDatasourceByType : listDriverByType
const method = this.showView === 'Datasource' ? listDatasourceByType : listDriverByType
let typeData = []
method(datasource.type).then((res) => {
typeData = this.buildTree(res.data)
@ -538,6 +538,12 @@ export default {
const newArr = []
for (let index = 0; index < array.length; 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 (element.id === this.msgNodeId) {
element.msgNode = true