Merge pull request #667 from dataease/dev

Dev
This commit is contained in:
fit2cloudrd 2021-08-19 14:01:03 +08:00 committed by GitHub
commit 474c7cc2af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
22 changed files with 313 additions and 79 deletions

View File

@ -34,7 +34,7 @@ public class DataSetTableFieldsService {
datasetTableField.setId(UUID.randomUUID().toString());
// 若dataeasename为空则用MD5(id)作为dataeasename
if (StringUtils.isEmpty(datasetTableField.getDataeaseName())) {
datasetTableField.setDataeaseName(DorisTableUtils.dorisFieldName(datasetTableField.getId()));
datasetTableField.setDataeaseName(DorisTableUtils.columnName(datasetTableField.getId()));
}
if (ObjectUtils.isEmpty(datasetTableField.getLastSyncTime())) {
datasetTableField.setLastSyncTime(System.currentTimeMillis());

View File

@ -1183,7 +1183,7 @@ public class DataSetTableService {
if (StringUtils.isNotEmpty(tableId) && editType == 1 ) {
List<DatasetTableField> datasetTableFields = dataSetTableFieldsService.getFieldsByTableId(tableId);
datasetTableFields.stream().filter(datasetTableField -> datasetTableField.getName().startsWith("C_")).collect(Collectors.toList());
datasetTableFields.stream().filter(datasetTableField -> datasetTableField.getExtField() == 0).collect(Collectors.toList());
datasetTableFields.sort((o1, o2) -> {
if (o1.getColumnIndex() == null) {
return -1;

View File

@ -33,6 +33,7 @@ public class DatasetFunctionService {
if (StringUtils.isNotEmpty(datasetTableFunction.getDbType())) {
criteria.andDbTypeEqualTo(datasetTableFunction.getDbType());
}
datasetTableFunctionExample.setOrderByClause("name asc");
return datasetTableFunctionMapper.selectByExampleWithBLOBs(datasetTableFunctionExample);
}

View File

@ -164,7 +164,7 @@ public class ExtractDataService {
if(datasetTableFields == null){
datasetTableFields = dataSetTableFieldsService.list(DatasetTableField.builder().tableId(datasetTable.getId()).build());
}
datasetTableFields = datasetTableFields.stream().filter(datasetTableField -> datasetTableField.getName().startsWith("C_")).collect(Collectors.toList());
datasetTableFields = datasetTableFields.stream().filter(datasetTableField -> datasetTableField.getExtField() == 0).collect(Collectors.toList());
datasetTableFields.sort((o1, o2) -> {
if (o1.getColumnIndex() == null) {
return -1;
@ -274,7 +274,7 @@ public class ExtractDataService {
datasource.setType(datasetTable.getType());
}
List<DatasetTableField> datasetTableFields = dataSetTableFieldsService.list(DatasetTableField.builder().tableId(datasetTable.getId()).build());
datasetTableFields = datasetTableFields.stream().filter(datasetTableField -> datasetTableField.getName().startsWith("C_")).collect(Collectors.toList());
datasetTableFields = datasetTableFields.stream().filter(datasetTableField -> datasetTableField.getExtField() == 0).collect(Collectors.toList());
datasetTableFields.sort((o1, o2) -> {
if (o1.getColumnIndex() == null) {
return -1;

View File

@ -6,6 +6,7 @@
<div class="fu-operator-component__operator">
<el-select
v-model="value"
:disabled="disabled"
class="search-operator"
:placeholder="$t('fu.search_bar.please_select')"
:size="configSize"
@ -35,7 +36,11 @@ export default {
// eslint-disable-next-line vue/require-default-prop
operator: String,
// eslint-disable-next-line vue/require-default-prop
operators: Array
operators: Array,
disabled: {
type: Boolean,
default: false
}
},
data() {
return {

View File

@ -0,0 +1,101 @@
<template>
<de-complex-operator v-model="operator" :label="label" :operators="operators" :size="configSize" disabled>
<el-select
v-model="value"
class="fu-complex-select"
:placeholder="$t('fu.search_bar.please_select')"
:size="configSize"
clearable
v-bind="$attrs"
>
<el-option v-for="o in options" :key="o.value" :label="o.label" :value="o.value" />
</el-select>
</de-complex-operator>
</template>
<script>
import { ComplexCondition } from 'fit2cloud-ui/src/components/search-bar/model'
import DeComplexOperator from './DeComplexOperator.vue'
import Cookies from 'js-cookie'
const MULTIPLE_OPERATORS = [
{
label: 'fu.search_bar.in',
value: 'in'
}, {
label: 'fu.search_bar.not_in',
value: 'not in'
}
]
const OPERATORS = [
{
label: 'fu.search_bar.eq',
value: 'eq'
}, {
label: 'fu.search_bar.ne',
value: 'ne'
}
]
export default {
name: 'DeComplexSelect',
components: { DeComplexOperator },
props: {
// eslint-disable-next-line vue/require-default-prop
field: String,
// eslint-disable-next-line vue/require-default-prop
label: String,
// eslint-disable-next-line vue/require-default-prop
defaultOperator: String,
// eslint-disable-next-line vue/require-default-prop
options: Array
},
data() {
return {
operator: '',
value: ''
}
},
computed: {
isMultiple() {
const { multiple } = this.$attrs
return multiple !== undefined && multiple !== false
},
operators() {
return this.isMultiple ? MULTIPLE_OPERATORS : OPERATORS
},
valueLabel() {
if (this.isMultiple) {
const values = []
this.value.forEach(v => {
values.push(this.getValueLabel(v))
})
return values.join(', ')
}
return this.getValueLabel(this.value)
},
configSize() {
return Cookies.get('size') || 'medium'
}
},
methods: {
getValueLabel(value) {
for (const o of this.options) {
if (o.value === value) {
return o.label
}
}
return value
},
getCondition() {
if (!this.value) return
const { field, label, operator, operatorLabel, value, valueLabel } = this
return new ComplexCondition({ field, label, operator, operatorLabel, value, valueLabel })
},
init() {
this.operator = this.defaultOperator || this.operators[0].value
this.value = ''
}
}
}
</script>

View File

@ -7,11 +7,19 @@
</div>
<div v-else-if="!linkageSettingStatus">
<setting-menu v-if="activeModel==='edit'" style="float: right;height: 24px!important;">
<i slot="icon" class="icon iconfont icon-shezhi" />
<span slot="icon" :title="$t('panel.setting')">
<i class="icon iconfont icon-shezhi" style="margin-top:2px" />
</span>
</setting-menu>
<span :title="$t('panel.edit')">
<i v-if="activeModel==='edit'&&curComponent&&editFilter.includes(curComponent.type)" class="icon iconfont icon-edit" @click.stop="edit" />
</span>
<span :title="$t('panel.details')">
<i v-if="curComponent.type==='view'" class="icon iconfont icon-fangda" @click.stop="showViewDetails" />
</span>
<span :title="$t('panel.cancel_linkage')">
<i v-if="curComponent.type==='view'&&existLinkage" class="icon iconfont icon-quxiaoliandong" @click.stop="clearLinkage" />
</span>
</div>
</div>

View File

@ -3,6 +3,7 @@
<el-popover
width="400"
trigger="click"
style="max-height: 400px;overflow-y: auto"
>
<el-row>
<el-col :span="11">
@ -13,6 +14,8 @@
</el-col>
</el-row>
<el-row style="height: 120px;overflow-y: auto">
<el-row v-for="(item, index) in linkageInfo.linkageFields" :key="index">
<el-col :span="11">
<div class="select-filed">
@ -60,6 +63,7 @@
</div>
</el-col>
</el-row>
</el-row>
<el-row class="bottom">
<el-button size="mini" type="success" icon="el-icon-plus" round @click="addLinkageField">追加联动依赖字段</el-button>
@ -67,7 +71,6 @@
<!-- <el-button slot="reference">T</el-button>-->
<i slot="reference" class="icon iconfont icon-edit slot-class" />
</el-popover>
</template>
@ -183,5 +186,9 @@ export default {
height: 35px;
border-radius: 3px;
}
>>>.el-popover{
height: 200px;
overflow: auto;
}
</style>

View File

@ -320,6 +320,38 @@ export default {
this.close()
},
saveLinkage() {
//
// let checkCount = 0
for (const key in this.targetLinkageInfo) {
let subCheckCount = 0
const linkageInfo = this.targetLinkageInfo[key]
const linkageFields = linkageInfo['linkageFields']
if (linkageFields) {
linkageFields.forEach(function(linkage) {
if (!(linkage.sourceField && linkage.targetField)) {
subCheckCount++
}
})
}
if (subCheckCount > 0) {
this.$message({
message: this.$t('chart.datalist') + '【' + linkageInfo.targetViewName + '】' + this.$t('panel.exit_un_march_linkage_field'),
type: 'error',
showClose: true
})
return
}
}
// if (checkCount > 0) {
// this.$message({
// message: this.$t('panel.exit_un_march_linkage_field'),
// type: 'error',
// showClose: true
// })
// return
// }
const request = {
panelId: this.$store.state.panel.panelInfo.id,
sourceViewId: this.curLinkageView.propValue.viewId,

View File

@ -113,7 +113,7 @@ export default {
linkageFilters() {
// watch oldValuenewValue
if (!this.element.linkageFilters) return []
console.log('linkageFilters:' + JSON.stringify(this.element.linkageFilters))
// console.log('linkageFilters:' + JSON.stringify(this.element.linkageFilters))
return JSON.parse(JSON.stringify(this.element.linkageFilters))
},
trackMenu() {
@ -127,7 +127,7 @@ export default {
})
linkageCount && trackMenuInfo.push('linkage')
this.drillFields.length && trackMenuInfo.push('drill')
console.log('trackMenuInfo' + JSON.stringify(trackMenuInfo))
// console.log('trackMenuInfo' + JSON.stringify(trackMenuInfo))
return trackMenuInfo
},
chartType() {

View File

@ -77,7 +77,11 @@ export default {
const titleWidth = this.$refs.deTitle.offsetWidth
const deContentContainer = this.$refs.deContentContainer
this.$nextTick(() => {
if (height < 75) {
let min = 75
if (this.element.component === 'de-number-range') {
min = 105
}
if (height < min) {
// console.log(titleWidth)
this.mainClass = 'condition-main-line'
deContentContainer && (deContentContainer.style.inset = '0 0 0 ' + (titleWidth + 15) + 'px')
@ -121,6 +125,8 @@ export default {
.condition-title-absolute {
inset: 0px 0px;
position: absolute;
top: 15px;
left: 4px;
}
.span-container {

View File

@ -1212,7 +1212,10 @@ export default {
drill: 'drill',
linkage: 'linkage',
cancel_linkage: 'Cancel Linkage',
remove_all_linkage: 'Remove All Linkage'
remove_all_linkage: 'Remove All Linkage',
exit_un_march_linkage_field: 'Exit Un March Linkage Field',
details: 'Details',
setting: 'Setting'
},
plugin: {
local_install: 'Local installation',

View File

@ -1211,7 +1211,10 @@ export default {
drill: '下钻',
linkage: '联动',
cancel_linkage: '取消联动',
remove_all_linkage: '清除所有联动'
remove_all_linkage: '清除所有联动',
exit_un_march_linkage_field: '存在未匹配联动关系的字段',
details: '详情',
setting: '设置'
},
plugin: {
local_install: '本地安裝',

View File

@ -1213,7 +1213,10 @@ export default {
drill: '下钻',
linkage: '联动',
cancel_linkage: '取消联动',
remove_all_linkage: '清除所有联动'
remove_all_linkage: '清除所有联动',
exit_un_march_linkage_field: '存在未匹配联动关系的字段',
details: '详情',
setting: '设置'
},
plugin: {
local_install: '本地安装',

View File

@ -21,7 +21,7 @@ import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import './utils/dialog'
import DeComplexInput from '@/components/business/condition-table/DeComplexInput'
import DeComplexSelect from '@/components/business/condition-table/DeComplexSelect'
import '@/components/canvas/custom-component' // 注册自定义组件
Vue.config.productionTip = false
Vue.use(VueClipboard)
@ -74,6 +74,7 @@ Vue.use(directives)
Vue.use(message)
Vue.component('Treeselect', Treeselect)
Vue.component('DeComplexInput', DeComplexInput)
Vue.component('DeComplexSelect', DeComplexSelect)
Vue.config.productionTip = false
Vue.prototype.hasDataPermission = function(pTarget, pSource) {

View File

@ -656,7 +656,8 @@ export const BASE_SCATTER = {
data: []
},
xAxis: {
data: []
data: [],
boundaryGap: false
},
yAxis: {
type: 'value'
@ -715,6 +716,12 @@ export const BASE_TREEMAP = {
{
// name: '',
type: 'treemap',
itemStyle: {
gapWidth: 2
},
breadcrumb: {
show: false
},
// radius: ['0%', '60%'],
// avoidLabelOverlap: false,
// emphasis: {

View File

@ -58,6 +58,9 @@ export function componentStyle(chart_option, chart) {
chart_option.xAxis.axisLabel = customStyle.xAxis.axisLabel
chart_option.xAxis.splitLine = customStyle.xAxis.splitLine
chart_option.xAxis.nameTextStyle = customStyle.xAxis.nameTextStyle
chart_option.xAxis.axisLabel.showMaxLabel = true
chart_option.xAxis.axisLabel.showMinLabel = true
}
if (customStyle.yAxis && (chart.type.includes('bar') || chart.type.includes('line') || chart.type.includes('scatter'))) {
chart_option.yAxis.show = customStyle.yAxis.show
@ -66,6 +69,9 @@ export function componentStyle(chart_option, chart) {
chart_option.yAxis.axisLabel = customStyle.yAxis.axisLabel
chart_option.yAxis.splitLine = customStyle.yAxis.splitLine
chart_option.yAxis.nameTextStyle = customStyle.yAxis.nameTextStyle
chart_option.xAxis.axisLabel.showMaxLabel = true
chart_option.xAxis.axisLabel.showMinLabel = true
}
if (customStyle.split && chart.type.includes('radar')) {
chart_option.radar.name = customStyle.split.name

View File

@ -1,6 +1,8 @@
import { hexColorToRGBA } from '@/views/chart/chart/util'
import { componentStyle } from '../common/common'
let bubbleArray = []
export function baseScatterOption(chart_option, chart) {
// 处理shape attr
let customAttr = {}
@ -21,6 +23,7 @@ export function baseScatterOption(chart_option, chart) {
if (chart.data) {
chart_option.title.text = chart.title
chart_option.xAxis.data = chart.data.x
bubbleArray = []
for (let i = 0; i < chart.data.series.length; i++) {
const y = chart.data.series[i]
// color
@ -33,6 +36,9 @@ export function baseScatterOption(chart_option, chart) {
const extBubble = JSON.parse(chart.extBubble)
if (extBubble && extBubble.length > 0) {
y.data.forEach(ele => {
bubbleArray.push(ele.value[2])
})
y.symbolSize = funcSize
} else {
y.symbolSize = customAttr.size.scatterSymbolSize ? customAttr.size.scatterSymbolSize : 20
@ -53,5 +59,7 @@ export function baseScatterOption(chart_option, chart) {
}
const funcSize = function(data) {
return data[2]
const k = 80
const max = Math.max(...bubbleArray)
return (data[2] / max) * k
}

View File

@ -28,9 +28,17 @@ export function baseTreemapOption(chart_option, chart) {
chart_option.series[0].height = (customAttr.size.treemapHeight ? customAttr.size.treemapHeight : 80) + '%'
}
// label
// if (customAttr.label) {
if (customAttr.label) {
// chart_option.series[0].label = customAttr.label
// }
const l = {
show: true,
position: customAttr.label.position,
color: customAttr.label.color,
fontSize: customAttr.label.fontSize,
formatter: customAttr.label.show ? customAttr.label.formatter : ''
}
chart_option.series[0].label = l
}
const valueArr = chart.data.series[0].data
for (let i = 0; i < valueArr.length; i++) {
// const y = {

View File

@ -338,6 +338,12 @@
<span>{{ $t('chart.bubble_size') }}</span>
/
<span>{{ $t('chart.quota') }}</span>
<el-tooltip class="item" effect="dark" placement="bottom">
<div slot="content">
该指标生效时样式大小中的气泡大小属性将失效
</div>
<i class="el-icon-info" style="cursor: pointer;color: #606266;" />
</el-tooltip>
</span>
<draggable
v-model="view.extBubble"
@ -430,7 +436,7 @@
<el-collapse-item v-show="chart.type !== 'map'" name="size" :title="$t('chart.size')">
<size-selector :param="param" class="attr-selector" :chart="chart" @onSizeChange="onSizeChange" />
</el-collapse-item>
<el-collapse-item v-show="!view.type.includes('table') && !view.type.includes('text') && view.type !== 'treemap'" name="label" :title="$t('chart.label')">
<el-collapse-item v-show="!view.type.includes('table') && !view.type.includes('text')" name="label" :title="$t('chart.label')">
<label-selector :param="param" class="attr-selector" :chart="chart" @onLabelChange="onLabelChange" />
</el-collapse-item>
<el-collapse-item v-show="!view.type.includes('table') && !view.type.includes('text')" name="tooltip" :title="$t('chart.tooltip')">

View File

@ -56,7 +56,19 @@
</el-col>
<el-col :span="10" style="height: 100%;border-left: 1px solid #E6E6E6;">
<el-col :span="12" style="height: 100%" class="padding-lr">
<span>{{ $t('dataset.click_ref_field') }}</span>
<span>
{{ $t('dataset.click_ref_field') }}
<el-tooltip class="item" effect="dark" placement="bottom">
<div slot="content">
引用字段以 "[" 开始 "]" 结束
<br>
请勿修改引用内容否则将引用失败
<br>
若输入与引用字段相同格式的内容将被当作引用字段处理
</div>
<i class="el-icon-info" style="cursor: pointer;" />
</el-tooltip>
</span>
<el-input
v-model="searchField"
size="mini"
@ -106,7 +118,19 @@
</div>
</el-col>
<el-col :span="12" style="height: 100%" class="padding-lr">
<span>{{ $t('dataset.click_ref_function') }}</span>
<span>
{{ $t('dataset.click_ref_function') }}
<el-tooltip class="item" effect="dark" placement="bottom">
<div slot="content">
使用数据集对应数据库类型所支持的函数语法同对应数据库
<br>
如日期格式化MySQL使用DATE_FORMAT(date,format)Oracle使用TO_DATE(X,[,fmt])
<br>
非直连模式数据集使用Doris数据库函数可参考Doris官网 http://doris.apache.org/master/zh-CN/
</div>
<i class="el-icon-info" style="cursor: pointer;" />
</el-tooltip>
</span>
<el-input
v-model="searchFunction"
size="mini"
@ -127,7 +151,7 @@
<p class="pop-title">{{ item.name }}</p>
<p class="pop-info">{{ item.func }}</p>
<p class="pop-info">{{ item.desc }}</p>
<span slot="reference" class="function-style" :title="item.func" @click="insertParamToCodeMirror(item.func)">{{ item.func }}</span>
<span slot="reference" class="function-style" @click="insertParamToCodeMirror(item.func)">{{ item.func }}</span>
</el-popover>
</el-row>
</el-col>
@ -444,9 +468,13 @@ export default {
padding: 2px 4px;
cursor: pointer;
margin: 4px 0;
overflow-x: hidden;
white-space: nowrap;
text-overflow: ellipsis;
word-break: break-word;
border: solid 1px #eee;
}
.function-style:hover {
background: #e8f4ff;
border-color: #a3d3ff;
cursor: pointer;
}
.function-height{
height: calc(100% - 50px);

View File

@ -191,10 +191,11 @@ export default {
}, {
label: this.$t('member.edit_password'), icon: 'el-icon-s-tools', type: 'success', click: this.editPassword,
show: this.checkPermission(['user:editPwd'])
}, {
label: '权限查看', icon: 'el-icon-lock', type: 'warning', click: this.showAuth,
show: this.checkPermission(['user:editPwd'])
}
// , {
// label: '', icon: 'el-icon-lock', type: 'warning', click: this.showAuth,
// show: this.checkPermission(['user:editPwd'])
// }
],
searchConfig: {
useQuickSearch: true,
@ -205,7 +206,7 @@ export default {
{
field: 'u.enabled',
label: this.$t('commons.status'),
component: 'FuComplexSelect',
component: 'DeComplexSelect',
options: [
{ label: this.$t('commons.enable'), value: '1' },
{ label: this.$t('commons.disable'), value: '0' }