forked from github/dataease
Merge branch 'v1.7' of github.com:dataease/dataease into v1.7
This commit is contained in:
commit
f99e1488f5
@ -1,5 +1,6 @@
|
||||
package io.dataease.service.wizard;
|
||||
|
||||
import io.dataease.commons.utils.HttpClientConfig;
|
||||
import io.dataease.commons.utils.HttpClientUtil;
|
||||
import org.jsoup.Jsoup;
|
||||
import org.jsoup.nodes.Document;
|
||||
@ -23,8 +24,10 @@ public class ReptileService {
|
||||
public List lastActive() {
|
||||
List result = new ArrayList();
|
||||
try {
|
||||
HttpClientConfig config = new HttpClientConfig();
|
||||
config.setCocketTimeout(5000);
|
||||
//爬取最新数据
|
||||
Document doc = Jsoup.parse(HttpClientUtil.get(blogUrl, null));
|
||||
Document doc = Jsoup.parse(HttpClientUtil.get(blogUrl, config));
|
||||
Elements elementsContent = doc.getElementsByAttributeValue("rel", "bookmark");
|
||||
Elements elementsTime = doc.getElementsByTag("time");
|
||||
for(int i = 0;i<infoCount;i++){
|
||||
@ -36,6 +39,7 @@ public class ReptileService {
|
||||
result.add(infoMap);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
//ignore
|
||||
Map<String, String> infoMap = new HashMap();
|
||||
infoMap.put("title","支持移动端展示,数据源新增对DB2的支持,DataEase开源数据可视化分析平台v1.6.0发布");
|
||||
|
@ -32,6 +32,7 @@
|
||||
:search-count="searchCount"
|
||||
:h="config.style.height"
|
||||
:edit-mode="'preview'"
|
||||
:filters="filters"
|
||||
:terminal="terminal"
|
||||
/>
|
||||
</div>
|
||||
@ -74,6 +75,10 @@ export default {
|
||||
terminal: {
|
||||
type: String,
|
||||
default: 'pc'
|
||||
},
|
||||
filters: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
}
|
||||
},
|
||||
data() {
|
||||
|
@ -20,6 +20,7 @@
|
||||
:search-count="searchCount"
|
||||
:in-screen="inScreen"
|
||||
:terminal="terminal"
|
||||
:filters="filterMap[item.propValue && item.propValue.viewId]"
|
||||
/>
|
||||
<!--视图详情-->
|
||||
<el-dialog
|
||||
@ -65,7 +66,7 @@ import UserViewDialog from '@/components/canvas/custom-component/UserViewDialog'
|
||||
import CanvasOptBar from '@/components/canvas/components/Editor/CanvasOptBar'
|
||||
import UserViewMobileDialog from '@/components/canvas/custom-component/UserViewMobileDialog'
|
||||
import bus from '@/utils/bus'
|
||||
|
||||
import { buildFilterMap } from '@/utils/conditionUtil'
|
||||
export default {
|
||||
components: { UserViewMobileDialog, ComponentWrapper, UserViewDialog, CanvasOptBar },
|
||||
model: {
|
||||
@ -193,7 +194,11 @@ export default {
|
||||
'componentData',
|
||||
'canvasStyleData',
|
||||
'componentGap'
|
||||
])
|
||||
]),
|
||||
filterMap() {
|
||||
const map = buildFilterMap(this.componentData)
|
||||
return map
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
componentData: {
|
||||
|
@ -101,6 +101,7 @@
|
||||
:id="'component' + item.id"
|
||||
ref="wrapperChild"
|
||||
class="component"
|
||||
:filters="filterMap[item.propValue.viewId]"
|
||||
:style="getComponentStyleDefault(item.style)"
|
||||
:prop-value="item.propValue"
|
||||
:element="item"
|
||||
@ -191,7 +192,7 @@ import CanvasOptBar from '@/components/canvas/components/Editor/CanvasOptBar'
|
||||
import DragShadow from '@/components/DeDrag/shadow'
|
||||
import bus from '@/utils/bus'
|
||||
import LinkJumpSet from '@/views/panel/LinkJumpSet'
|
||||
|
||||
import { buildFilterMap } from '@/utils/conditionUtil'
|
||||
// 挤占式画布
|
||||
import _ from 'lodash'
|
||||
import $ from 'jquery'
|
||||
@ -930,6 +931,7 @@ export default {
|
||||
dragComponentInfo() {
|
||||
return this.$store.state.dragComponentInfo
|
||||
},
|
||||
|
||||
...mapState([
|
||||
'componentData',
|
||||
'curComponent',
|
||||
@ -941,7 +943,10 @@ export default {
|
||||
'componentGap',
|
||||
'mobileLayoutStatus',
|
||||
'curCanvasScale'
|
||||
])
|
||||
]),
|
||||
filterMap() {
|
||||
return buildFilterMap(this.componentData)
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
customStyle: {
|
||||
|
@ -114,11 +114,15 @@ export default {
|
||||
terminal: {
|
||||
type: String,
|
||||
default: 'pc'
|
||||
},
|
||||
filters: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
filterInit: false, // 标记是否已经通过watch.filters 进行初始化,如果filterInit=true 则create放弃数据初始化防止数据覆盖
|
||||
isFirstLoad: true, // 是否是第一次加载
|
||||
refId: null,
|
||||
chart: BASE_CHART_STRING,
|
||||
requestStatus: 'success',
|
||||
@ -179,7 +183,7 @@ export default {
|
||||
},
|
||||
filter() {
|
||||
const filter = {}
|
||||
filter.filter = this.element.filters
|
||||
filter.filter = this.isFirstLoad ? this.filters : this.cfilters
|
||||
filter.linkageFilters = this.element.linkageFilters
|
||||
filter.drill = this.drillClickDimensionList
|
||||
filter.resultCount = this.resultCount
|
||||
@ -187,7 +191,7 @@ export default {
|
||||
filter.queryFrom = 'panel'
|
||||
return filter
|
||||
},
|
||||
filters() {
|
||||
cfilters() {
|
||||
// 必要 勿删勿该 watch数组,哪怕发生变化 oldValue等于newValue ,深拷贝解决
|
||||
if (!this.element.filters) return []
|
||||
return JSON.parse(JSON.stringify(this.element.filters))
|
||||
@ -242,11 +246,13 @@ export default {
|
||||
},
|
||||
|
||||
watch: {
|
||||
'filters': function(val1, val2) {
|
||||
if (isChange(val1, val2)) {
|
||||
this.filterInit = true
|
||||
this.getData(this.element.propValue.viewId)
|
||||
}
|
||||
'cfilters': {
|
||||
handler: function(val1, val2) {
|
||||
if (isChange(val1, val2) && !this.isFirstLoad) {
|
||||
this.getData(this.element.propValue.viewId)
|
||||
}
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
linkageFilters: {
|
||||
handler(newVal, oldVal) {
|
||||
@ -318,7 +324,8 @@ export default {
|
||||
this.refId = uuid.v1
|
||||
if (this.element && this.element.propValue && this.element.propValue.viewId) {
|
||||
// 如果watch.filters 已经进行数据初始化时候,此处放弃数据初始化
|
||||
!this.filterInit && this.getData(this.element.propValue.viewId, false)
|
||||
|
||||
this.getData(this.element.propValue.viewId, false)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@ -399,6 +406,7 @@ export default {
|
||||
this.requestStatus = 'error'
|
||||
this.message = response.message
|
||||
}
|
||||
this.isFirstLoad = false
|
||||
return true
|
||||
}).catch(err => {
|
||||
this.requestStatus = 'error'
|
||||
@ -413,6 +421,7 @@ export default {
|
||||
this.message = err
|
||||
}
|
||||
}
|
||||
this.isFirstLoad = false
|
||||
return true
|
||||
})
|
||||
}
|
||||
|
@ -58,9 +58,7 @@ export default {
|
||||
state.lastSaveSnapshotIndex = deepCopy(state.snapshotIndex)
|
||||
},
|
||||
recordStyleChange(state) {
|
||||
if (state.curComponent) {
|
||||
state.styleChangeTimes++
|
||||
}
|
||||
state.styleChangeTimes++
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -67,6 +67,39 @@ class NumberRangeServiceImpl extends WidgetService {
|
||||
return field['deType'] === 2 || field['deType'] === 3
|
||||
})
|
||||
}
|
||||
|
||||
getParam(element) {
|
||||
if (element.options.value && element.options.value.length > 0) {
|
||||
const values = this.element.options.value
|
||||
const min = values[0]
|
||||
let max = null
|
||||
if (values.length > 1) {
|
||||
max = values[1]
|
||||
}
|
||||
const param = {
|
||||
component: element,
|
||||
value: [min, max],
|
||||
operator: 'between'
|
||||
}
|
||||
if (min && max) {
|
||||
return param
|
||||
}
|
||||
if (!min && !max) {
|
||||
param.value = []
|
||||
return param
|
||||
}
|
||||
if (min) {
|
||||
param.value = [min]
|
||||
param.operator = 'ge'
|
||||
return param
|
||||
}
|
||||
if (max) {
|
||||
param.value = [max]
|
||||
param.operator = 'le'
|
||||
return param
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
const numberRangeServiceImpl = new NumberRangeServiceImpl()
|
||||
export default numberRangeServiceImpl
|
||||
|
@ -81,6 +81,15 @@ class NumberSelectGridServiceImpl extends WidgetService {
|
||||
}
|
||||
})
|
||||
}
|
||||
getParam(element) {
|
||||
const value = element.options.value
|
||||
const param = {
|
||||
component: element,
|
||||
value: !value ? [] : Array.isArray(value) ? value : value.toString().split(','),
|
||||
operator: element.options.attrs.multiple ? 'in' : 'eq'
|
||||
}
|
||||
return param
|
||||
}
|
||||
}
|
||||
const numberSelectGridServiceImpl = new NumberSelectGridServiceImpl()
|
||||
export default numberSelectGridServiceImpl
|
||||
|
@ -82,6 +82,15 @@ class NumberSelectServiceImpl extends WidgetService {
|
||||
}
|
||||
})
|
||||
}
|
||||
getParam(element) {
|
||||
const value = element.options.value
|
||||
const param = {
|
||||
component: element,
|
||||
value: !value ? [] : Array.isArray(value) ? value : value.toString().split(','),
|
||||
operator: element.options.attrs.multiple ? 'in' : 'eq'
|
||||
}
|
||||
return param
|
||||
}
|
||||
}
|
||||
const numberSelectServiceImpl = new NumberSelectServiceImpl()
|
||||
export default numberSelectServiceImpl
|
||||
|
@ -67,6 +67,15 @@ class TextInputServiceImpl extends WidgetService {
|
||||
return field['deType'] === 0
|
||||
})
|
||||
}
|
||||
getParam(element) {
|
||||
const value = element.options.value
|
||||
const param = {
|
||||
component: element,
|
||||
value: !value ? [] : Array.isArray(value) ? value : [value],
|
||||
operator: 'like'
|
||||
}
|
||||
return param
|
||||
}
|
||||
}
|
||||
const textInputServiceImpl = new TextInputServiceImpl()
|
||||
export default textInputServiceImpl
|
||||
|
@ -81,6 +81,15 @@ class TextSelectGridServiceImpl extends WidgetService {
|
||||
}
|
||||
})
|
||||
}
|
||||
getParam(element) {
|
||||
const value = element.options.value
|
||||
const param = {
|
||||
component: element,
|
||||
value: !value ? [] : Array.isArray(value) ? value : value.toString().split(','),
|
||||
operator: element.options.attrs.multiple ? 'in' : 'eq'
|
||||
}
|
||||
return param
|
||||
}
|
||||
}
|
||||
const textSelectGridServiceImpl = new TextSelectGridServiceImpl()
|
||||
export default textSelectGridServiceImpl
|
||||
|
@ -1,6 +1,5 @@
|
||||
|
||||
import { WidgetService } from '../service/WidgetService'
|
||||
|
||||
const leftPanel = {
|
||||
icon: 'iconfont icon-xialakuang',
|
||||
label: 'detextselect.label',
|
||||
@ -81,6 +80,16 @@ class TextSelectServiceImpl extends WidgetService {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
getParam(element) {
|
||||
const value = element.options.value
|
||||
const param = {
|
||||
component: element,
|
||||
value: !value ? [] : Array.isArray(value) ? value : value.toString().split(','),
|
||||
operator: element.options.attrs.multiple ? 'in' : 'eq'
|
||||
}
|
||||
return param
|
||||
}
|
||||
}
|
||||
const textSelectServiceImpl = new TextSelectServiceImpl()
|
||||
export default textSelectServiceImpl
|
||||
|
@ -1,7 +1,9 @@
|
||||
import {
|
||||
WidgetService
|
||||
} from '../service/WidgetService'
|
||||
|
||||
import {
|
||||
timeSection
|
||||
} from '@/utils'
|
||||
const leftPanel = {
|
||||
icon: 'iconfont icon-riqi',
|
||||
label: 'dedaterange.label',
|
||||
@ -222,6 +224,64 @@ class TimeDateRangeServiceImpl extends WidgetService {
|
||||
return false
|
||||
}
|
||||
}
|
||||
getParam(element) {
|
||||
let timeArr = []
|
||||
if (element.options.attrs.default.isDynamic) {
|
||||
let value = this.dynamicDateFormNow(element)
|
||||
value = this.formatFilterValue(value)
|
||||
timeArr = this.formatValues(value, element)
|
||||
} else {
|
||||
let value = this.fillValueDerfault(element)
|
||||
value = this.formatFilterValue(value)
|
||||
timeArr = this.formatValues(value, element)
|
||||
}
|
||||
const param = {
|
||||
component: element,
|
||||
value: timeArr,
|
||||
operator: 'between'
|
||||
}
|
||||
return param
|
||||
}
|
||||
fillValueDerfault(element) {
|
||||
const defaultV = element.options.value === null ? '' : element.options.value.toString()
|
||||
if (element.options.attrs.type === 'daterange') {
|
||||
if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '' || defaultV ===
|
||||
'[object Object]') {
|
||||
return []
|
||||
}
|
||||
return defaultV.split(',').map(item => parseFloat(item))
|
||||
} else {
|
||||
if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '' || defaultV ===
|
||||
'[object Object]') {
|
||||
return null
|
||||
}
|
||||
return parseFloat(defaultV.split(',')[0])
|
||||
}
|
||||
}
|
||||
formatFilterValue(values) {
|
||||
if (values === null) return []
|
||||
if (Array.isArray(values)) return values
|
||||
return [values]
|
||||
}
|
||||
formatValues(values, element) {
|
||||
if (!values || values.length === 0) {
|
||||
return []
|
||||
}
|
||||
if (element.options.attrs.type === 'daterange') {
|
||||
if (values.length !== 2) {
|
||||
return null
|
||||
}
|
||||
let start = values[0]
|
||||
let end = values[1]
|
||||
start = timeSection(start, 'date')[0]
|
||||
end = timeSection(end, 'date')[1]
|
||||
const results = [start, end]
|
||||
return results
|
||||
} else {
|
||||
const value = values[0]
|
||||
return timeSection(parseFloat(value), element.options.attrs.type)
|
||||
}
|
||||
}
|
||||
}
|
||||
const timeDateRangeServiceImpl = new TimeDateRangeServiceImpl()
|
||||
export default timeDateRangeServiceImpl
|
||||
|
@ -1,7 +1,9 @@
|
||||
import {
|
||||
WidgetService
|
||||
} from '../service/WidgetService'
|
||||
|
||||
import {
|
||||
timeSection
|
||||
} from '@/utils'
|
||||
const leftPanel = {
|
||||
icon: 'iconfont icon-ri',
|
||||
label: 'dedate.label',
|
||||
@ -153,6 +155,64 @@ class TimeDateServiceImpl extends WidgetService {
|
||||
}
|
||||
}
|
||||
}
|
||||
getParam(element) {
|
||||
let timeArr = []
|
||||
if (element.options.attrs.default.isDynamic) {
|
||||
let value = this.dynamicDateFormNow(element)
|
||||
value = this.formatFilterValue(value)
|
||||
timeArr = this.formatValues(value, element)
|
||||
} else {
|
||||
let value = this.fillValueDerfault(element)
|
||||
value = this.formatFilterValue(value)
|
||||
timeArr = this.formatValues(value, element)
|
||||
}
|
||||
const param = {
|
||||
component: element,
|
||||
value: timeArr,
|
||||
operator: 'between'
|
||||
}
|
||||
return param
|
||||
}
|
||||
fillValueDerfault(element) {
|
||||
const defaultV = element.options.value === null ? '' : element.options.value.toString()
|
||||
if (element.options.attrs.type === 'daterange') {
|
||||
if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '' || defaultV ===
|
||||
'[object Object]') {
|
||||
return []
|
||||
}
|
||||
return defaultV.split(',').map(item => parseFloat(item))
|
||||
} else {
|
||||
if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '' || defaultV ===
|
||||
'[object Object]') {
|
||||
return null
|
||||
}
|
||||
return parseFloat(defaultV.split(',')[0])
|
||||
}
|
||||
}
|
||||
formatFilterValue(values) {
|
||||
if (values === null) return []
|
||||
if (Array.isArray(values)) return values
|
||||
return [values]
|
||||
}
|
||||
formatValues(values, element) {
|
||||
if (!values || values.length === 0) {
|
||||
return []
|
||||
}
|
||||
if (element.options.attrs.type === 'daterange') {
|
||||
if (values.length !== 2) {
|
||||
return null
|
||||
}
|
||||
let start = values[0]
|
||||
let end = values[1]
|
||||
start = timeSection(start, 'date')[0]
|
||||
end = timeSection(end, 'date')[1]
|
||||
const results = [start, end]
|
||||
return results
|
||||
} else {
|
||||
const value = values[0]
|
||||
return timeSection(parseFloat(value), element.options.attrs.type)
|
||||
}
|
||||
}
|
||||
}
|
||||
const timeDateServiceImpl = new TimeDateServiceImpl({
|
||||
name: 'timeDateWidget'
|
||||
|
@ -1,5 +1,7 @@
|
||||
import { WidgetService } from '../service/WidgetService'
|
||||
|
||||
import {
|
||||
timeSection
|
||||
} from '@/utils'
|
||||
const leftPanel = {
|
||||
icon: 'iconfont icon-yue',
|
||||
label: 'deyearmonth.label',
|
||||
@ -119,6 +121,64 @@ class TimeMonthServiceImpl extends WidgetService {
|
||||
}
|
||||
}
|
||||
}
|
||||
getParam(element) {
|
||||
let timeArr = []
|
||||
if (element.options.attrs.default.isDynamic) {
|
||||
let value = this.dynamicDateFormNow(element)
|
||||
value = this.formatFilterValue(value)
|
||||
timeArr = this.formatValues(value, element)
|
||||
} else {
|
||||
let value = this.fillValueDerfault(element)
|
||||
value = this.formatFilterValue(value)
|
||||
timeArr = this.formatValues(value, element)
|
||||
}
|
||||
const param = {
|
||||
component: element,
|
||||
value: timeArr,
|
||||
operator: 'between'
|
||||
}
|
||||
return param
|
||||
}
|
||||
fillValueDerfault(element) {
|
||||
const defaultV = element.options.value === null ? '' : element.options.value.toString()
|
||||
if (element.options.attrs.type === 'daterange') {
|
||||
if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '' || defaultV ===
|
||||
'[object Object]') {
|
||||
return []
|
||||
}
|
||||
return defaultV.split(',').map(item => parseFloat(item))
|
||||
} else {
|
||||
if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '' || defaultV ===
|
||||
'[object Object]') {
|
||||
return null
|
||||
}
|
||||
return parseFloat(defaultV.split(',')[0])
|
||||
}
|
||||
}
|
||||
formatFilterValue(values) {
|
||||
if (values === null) return []
|
||||
if (Array.isArray(values)) return values
|
||||
return [values]
|
||||
}
|
||||
formatValues(values, element) {
|
||||
if (!values || values.length === 0) {
|
||||
return []
|
||||
}
|
||||
if (element.options.attrs.type === 'daterange') {
|
||||
if (values.length !== 2) {
|
||||
return null
|
||||
}
|
||||
let start = values[0]
|
||||
let end = values[1]
|
||||
start = timeSection(start, 'date')[0]
|
||||
end = timeSection(end, 'date')[1]
|
||||
const results = [start, end]
|
||||
return results
|
||||
} else {
|
||||
const value = values[0]
|
||||
return timeSection(parseFloat(value), element.options.attrs.type)
|
||||
}
|
||||
}
|
||||
}
|
||||
const timeMonthServiceImpl = new TimeMonthServiceImpl()
|
||||
export default timeMonthServiceImpl
|
||||
|
@ -1,5 +1,7 @@
|
||||
import { WidgetService } from '../service/WidgetService'
|
||||
|
||||
import {
|
||||
timeSection
|
||||
} from '@/utils'
|
||||
const leftPanel = {
|
||||
icon: 'iconfont icon-nian',
|
||||
label: 'deyear.label',
|
||||
@ -110,6 +112,64 @@ class TimeYearServiceImpl extends WidgetService {
|
||||
return new Date(dynamicSuffix === 'before' ? (nowYear - dynamicPrefix) : (nowYear + dynamicPrefix), 0, 1).getTime()
|
||||
}
|
||||
}
|
||||
getParam(element) {
|
||||
let timeArr = []
|
||||
if (element.options.attrs.default.isDynamic) {
|
||||
let value = this.dynamicDateFormNow(element)
|
||||
value = this.formatFilterValue(value)
|
||||
timeArr = this.formatValues(value, element)
|
||||
} else {
|
||||
let value = this.fillValueDerfault(element)
|
||||
value = this.formatFilterValue(value)
|
||||
timeArr = this.formatValues(value, element)
|
||||
}
|
||||
const param = {
|
||||
component: element,
|
||||
value: timeArr,
|
||||
operator: 'between'
|
||||
}
|
||||
return param
|
||||
}
|
||||
fillValueDerfault(element) {
|
||||
const defaultV = element.options.value === null ? '' : element.options.value.toString()
|
||||
if (element.options.attrs.type === 'daterange') {
|
||||
if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '' || defaultV ===
|
||||
'[object Object]') {
|
||||
return []
|
||||
}
|
||||
return defaultV.split(',').map(item => parseFloat(item))
|
||||
} else {
|
||||
if (defaultV === null || typeof defaultV === 'undefined' || defaultV === '' || defaultV ===
|
||||
'[object Object]') {
|
||||
return null
|
||||
}
|
||||
return parseFloat(defaultV.split(',')[0])
|
||||
}
|
||||
}
|
||||
formatFilterValue(values) {
|
||||
if (values === null) return []
|
||||
if (Array.isArray(values)) return values
|
||||
return [values]
|
||||
}
|
||||
formatValues(values, element) {
|
||||
if (!values || values.length === 0) {
|
||||
return []
|
||||
}
|
||||
if (element.options.attrs.type === 'daterange') {
|
||||
if (values.length !== 2) {
|
||||
return null
|
||||
}
|
||||
let start = values[0]
|
||||
let end = values[1]
|
||||
start = timeSection(start, 'date')[0]
|
||||
end = timeSection(end, 'date')[1]
|
||||
const results = [start, end]
|
||||
return results
|
||||
} else {
|
||||
const value = values[0]
|
||||
return timeSection(parseFloat(value), element.options.attrs.type)
|
||||
}
|
||||
}
|
||||
}
|
||||
const timeYearServiceImpl = new TimeYearServiceImpl()
|
||||
export default timeYearServiceImpl
|
||||
|
@ -1,5 +1,7 @@
|
||||
|
||||
import { Condition } from '@/components/widget/bean/Condition'
|
||||
import { ApplicationContext } from '@/utils/ApplicationContext'
|
||||
|
||||
/**
|
||||
* 判断两个conditions数组是否相同
|
||||
* @param {*} conditions1
|
||||
@ -36,3 +38,36 @@ export const formatLinkageCondition = obj => {
|
||||
const condition = new Condition(null, fieldId, operator, value, viewIds)
|
||||
return condition
|
||||
}
|
||||
|
||||
export const buildFilterMap = panelItems => {
|
||||
const viewIdMatch = (viewIds, viewId) => !viewIds || viewIds.length === 0 || viewIds.includes(viewId)
|
||||
const result = {}
|
||||
panelItems.forEach(element => {
|
||||
if (element.type === 'view') {
|
||||
result[element.propValue.viewId] = []
|
||||
}
|
||||
})
|
||||
panelItems.forEach(element => {
|
||||
if (element.type !== 'custom') {
|
||||
return true
|
||||
}
|
||||
const widget = ApplicationContext.getService(element.serviceName)
|
||||
const param = widget.getParam(element)
|
||||
const condition = formatCondition(param)
|
||||
const vValid = valueValid(condition)
|
||||
const filterComponentId = condition.componentId
|
||||
Object.keys(result).forEach(viewId => {
|
||||
const vidMatch = viewIdMatch(condition.viewIds, viewId)
|
||||
const viewFilters = result[viewId]
|
||||
let j = viewFilters.length
|
||||
while (j--) {
|
||||
const filter = viewFilters[j]
|
||||
if (filter.componentId === filterComponentId) {
|
||||
viewFilters.splice(j, 1)
|
||||
}
|
||||
}
|
||||
vidMatch && vValid && viewFilters.push(condition)
|
||||
})
|
||||
})
|
||||
return result
|
||||
}
|
||||
|
@ -1860,29 +1860,29 @@ export default {
|
||||
}
|
||||
},
|
||||
addXaxis(e) {
|
||||
if ((this.view.type === 'map' || this.view.type === 'word-cloud') && this.view.xaxis.length > 1) {
|
||||
this.view.xaxis = [this.view.xaxis[0]]
|
||||
}
|
||||
if (this.view.type !== 'table-info') {
|
||||
this.dragCheckType(this.view.xaxis, 'd')
|
||||
}
|
||||
this.dragMoveDuplicate(this.view.xaxis, e)
|
||||
if ((this.view.type === 'map' || this.view.type === 'word-cloud') && this.view.xaxis.length > 1) {
|
||||
this.view.xaxis = [this.view.xaxis[0]]
|
||||
}
|
||||
this.calcData(true)
|
||||
},
|
||||
addYaxis(e) {
|
||||
this.dragCheckType(this.view.yaxis, 'q')
|
||||
this.dragMoveDuplicate(this.view.yaxis, e)
|
||||
if ((this.view.type === 'map' || this.view.type === 'waterfall' || this.view.type === 'word-cloud') && this.view.yaxis.length > 1) {
|
||||
this.view.yaxis = [this.view.yaxis[0]]
|
||||
}
|
||||
this.dragCheckType(this.view.yaxis, 'q')
|
||||
this.dragMoveDuplicate(this.view.yaxis, e)
|
||||
this.calcData(true)
|
||||
},
|
||||
addYaxisExt(e) {
|
||||
this.dragCheckType(this.view.yaxisExt, 'q')
|
||||
this.dragMoveDuplicate(this.view.yaxisExt, e)
|
||||
if (this.view.type === 'map' && this.view.yaxisExt.length > 1) {
|
||||
this.view.yaxisExt = [this.view.yaxisExt[0]]
|
||||
}
|
||||
this.dragCheckType(this.view.yaxisExt, 'q')
|
||||
this.dragMoveDuplicate(this.view.yaxisExt, e)
|
||||
this.calcData(true)
|
||||
},
|
||||
moveToDimension(e) {
|
||||
|
@ -82,7 +82,7 @@ export default {
|
||||
color: var(--TextPrimary, #6D6D6D);
|
||||
font-size: 12px;
|
||||
position: absolute;
|
||||
bottom: 8px;
|
||||
bottom: 16px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ export default {
|
||||
head: this.$t('wizard.online_document'),
|
||||
content: this.$t('wizard.online_document_hint'),
|
||||
bottom: '',
|
||||
href: 'https://dataease.io/docs/dev_manual/dev_manual/',
|
||||
href: 'https://dataease.io/docs/index.html',
|
||||
component: 'CardDetail'
|
||||
},
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user