Merge branch 'pr@dev@fix_dataset' of github.com:dataease/dataease into pr@dev@fix_dataset

This commit is contained in:
taojinlong 2022-11-30 15:18:45 +08:00
commit 39266ea6d1
14 changed files with 122 additions and 48 deletions

View File

@ -13,6 +13,7 @@
:canvas-id="canvasId"
:chart="chart"
:show-position="showPosition"
:series-id-map="seriesIdMap"
@showViewDetails="showViewDetails"
/>
<div
@ -149,7 +150,10 @@ export default {
data() {
return {
previewVisible: false,
chart: null
chart: null,
seriesIdMap: {
id: ''
}
}
},
computed: {
@ -274,7 +278,7 @@ export default {
} else {
return {
...
getStyle(style, ['top', 'left', 'width', 'height', 'rotate']),
getStyle(style, ['top', 'left', 'width', 'height', 'rotate']),
position: 'relative'
}
}

View File

@ -137,13 +137,14 @@
:target="curComponent.hyperlinks.openMode "
:href="curComponent.hyperlinks.content "
>
<i class="icon iconfont icon-com-jump"/>
<i class="icon iconfont icon-com-jump" />
</a>
</span>
<map-layer-controller
v-if="chart && showMapLayerController"
:chart="chart"
:series-id-map="seriesIdMap"
/>
</div>
@ -239,6 +240,14 @@ export default {
chart: {
type: Object,
default: null
},
seriesIdMap: {
type: Object,
default: () => {
return {
id: ''
}
}
}
},
data() {

View File

@ -40,6 +40,7 @@
:canvas-id="canvasId"
:element="element"
:chart="chart"
:series-id-map="seriesIdMap"
@showViewDetails="showViewDetails"
@amRemoveItem="amRemoveItem"
@amAddItem="amAddItem"
@ -65,7 +66,7 @@
@mousedown.stop.prevent="handleDown(handlei, $event)"
@touchstart.stop.prevent="handleTouchDown(handlei, $event)"
>
<slot :name="handlei"/>
<slot :name="handlei" />
</div>
<div
:id="componentCanvasId"
@ -78,7 +79,7 @@
class="svg-background"
:icon-class="mainSlotSvgInner"
/>
<slot/>
<slot />
</div>
</div>
</div>
@ -431,7 +432,10 @@ export default {
// snapshot
hasMove: false,
//
latestMoveY: 0
latestMoveY: 0,
seriesIdMap: {
id: ''
}
}
},
computed: {

View File

@ -202,9 +202,7 @@
</el-dialog>
<text-attr
v-if="showAttr && curComponent.canvasId === activeCanvasId"
&&
is-edit
v-if="showAttr && curComponent.canvasId === activeCanvasId && isEdit"
:canvas-id="curComponent.canvasId"
:scroll-left="scrollLeft"
:scroll-top="scrollTop"
@ -466,15 +464,20 @@ export default {
}
},
initCarousel() {
this.timer && clearInterval(this.timer)
if (this.element.style.carouselEnable) {
const switchTime = (this.element.style.switchTime || 5) * 1000
const _this = this
_this.timer && clearInterval(_this.timer)
if (_this.element.style.carouselEnable) {
const switchTime = (_this.element.style.switchTime || 5) * 1000
let switchCount = 1
//
this.timer = setInterval(() => {
const nowIndex = switchCount % this.element.options.tabList.length
_this.timer = setInterval(() => {
const nowIndex = switchCount % _this.element.options.tabList.length
switchCount++
this.activeTabName = this.element.options.tabList[nowIndex].name
_this.activeTabName = _this.element.options.tabList[nowIndex].name
const targetRef = _this.$refs['canvasTabRef-' + _this.activeTabName]
if (targetRef) {
targetRef[0].restore()
}
}, switchTime)
}
},
@ -705,21 +708,27 @@ export default {
}
::v-deep .el-tabs__nav {
width: 100%;
display: flex;
}
::v-deep .el-tabs__nav-prev {
line-height: 25px;
}
::v-deep .el-tabs__nav-next {
line-height: 25px;
}
.tab-head-left ::v-deep .el-tabs__nav {
width: 100%;
display: flex;
text-align: left;
}
.tab-head-right ::v-deep .el-tabs__nav {
width: 100%;
display: flex;
text-align: right;
}
.tab-head-center ::v-deep .el-tabs__nav {
width: 100%;
display: flex;
text-align: center;
}

View File

@ -531,7 +531,10 @@ export default {
set_saved_successfully: 'Data set saved successfully',
to_start_using: 'Browse the contents of your database, tables and columns. Choose a database to get started.',
to_run_query: 'Click to run query',
the_running_results: 'You can view the running results'
the_running_results: 'You can view the running results',
item: 'item',
logic_filter: 'Condition Filter',
enum_filter: 'Enum Filter'
},
detabs: {
custom_sort: 'Custom Sort',
@ -655,6 +658,7 @@ export default {
input_password: 'Please input a password',
input_phone: 'Please enter the phone number',
input_roles: 'Please select role',
select_users: 'Please select user',
user_name_pattern_error: 'IDs can only contain alphanumeric and ._- and start with a letter!',
special_characters_are_not_supported: 'Special characters are not supported',
mobile_number_format_is_incorrect: 'Incorrect format of mobile phone number',
@ -1722,7 +1726,17 @@ export default {
export_dataset: 'Export',
filename: 'Filename',
export_filter: 'Filter',
pls_input_filename: 'Please input filename'
pls_input_filename: 'Please input filename',
calc_tips: {
tip1: 'The expression syntax should follow the database syntax corresponding to the data source.',
tip2: 'Aggregation operation is not supported in the dataset.',
tip3: 'The reference field starts with "[" and ends with "]"',
tip4: 'Do not modify the reference content, otherwise the reference will fail',
tip5: 'If you enter content in the same format as the reference field, it will be treated as a reference field',
tip6: 'Use the functions supported by the database type corresponding to the dataset. The syntax is the same as that of the corresponding database',
tip7: 'For example, date format: MySQL uses DATE_ FORMAT(date,format) Oracle uses TO_ DATE(X,[,fmt])',
tip8: 'Non direct connection mode data set, use Doris database functions, refer to Doris official website'
}
},
driver: {
driver: 'Driver',
@ -1758,7 +1772,7 @@ export default {
http_port: 'Http Port',
port: 'Port',
datasource_url: 'URL address',
please_input_datasource_url: 'Please enter Elasticsearch 地址e.g: http://es_host:es_port',
please_input_datasource_url: 'Please enter Elasticsearch URL addresse.g: http://es_host:es_port',
please_input_data_base: 'Please enter the database name',
please_select_oracle_type: 'Select connection type',
please_input_user_name: 'Please enter user name',

View File

@ -531,7 +531,10 @@ export default {
set_saved_successfully: '數據集保存成功',
to_start_using: '瀏覽您的數據庫,表和列的內容。 選擇一個數據庫即可開始使用。',
to_run_query: '點擊運行査詢',
the_running_results: '即可查看運行結果'
the_running_results: '即可查看運行結果',
item: '項',
logic_filter: '條件篩選',
enum_filter: '枚舉篩選'
},
detabs: {
custom_sort: '自定義排序',
@ -1722,7 +1725,17 @@ export default {
export_dataset: '數據集導出',
filename: '文件名稱',
export_filter: '篩選條件',
pls_input_filename: '請輸入文件名稱'
pls_input_filename: '請輸入文件名稱',
calc_tips: {
tip1: '表達式語法請遵循該數據源對應的數據庫語法。',
tip2: '數據集中不支持聚合運算。',
tip3: '引用字段以 "[" 開始, "]" 結束',
tip4: '請勿修改引用內容,否則將引用失敗',
tip5: '若輸入與引用字段相同格式的內容,將被當作引用字段處理',
tip6: '使用數據集對應數據庫類型所支持的函數,語法同對應數據庫',
tip7: '如日期格式化MySQL使用DATE_FORMAT(date,format)Oracle使用TO_DATE(X,[,fmt])',
tip8: '非直連模式數據集使用Doris數據庫函數可參考Doris官網'
}
},
driver: {
driver: '驅動',

View File

@ -530,7 +530,10 @@ export default {
set_saved_successfully: '数据集保存成功',
to_start_using: '浏览您的数据库,表和列的内容。 选择一个数据库即可开始使用。',
to_run_query: '点击运行查询',
the_running_results: '即可查看运行结果'
the_running_results: '即可查看运行结果',
item: '项',
logic_filter: '条件筛选',
enum_filter: '枚举筛选'
},
detabs: {
custom_sort: '自定义排序',
@ -1721,7 +1724,17 @@ export default {
export_dataset: '数据集导出',
filename: '文件名称',
export_filter: '筛选条件',
pls_input_filename: '请输入文件名称'
pls_input_filename: '请输入文件名称',
calc_tips: {
tip1: '表达式语法请遵循该数据源对应的数据库语法。',
tip2: '数据集中不支持聚合运算。',
tip3: '引用字段以 "[" 开始, "]" 结束',
tip4: '请勿修改引用内容,否则将引用失败',
tip5: '若输入与引用字段相同格式的内容,将被当作引用字段处理',
tip6: '使用数据集对应数据库类型所支持的函数,语法同对应数据库',
tip7: '如日期格式化MySQL使用DATE_FORMAT(date,format)Oracle使用TO_DATE(X,[,fmt])',
tip8: '非直连模式数据集使用Doris数据库函数可参考Doris官网'
}
},
driver: {
driver: '驱动',

View File

@ -42,6 +42,14 @@ export default {
chart: {
type: Object,
required: true
},
seriesIdMap: {
type: Object,
default: () => {
return {
id: ''
}
}
}
},
data() {
@ -79,11 +87,12 @@ export default {
id: this.chart.id,
seriesId: this.currentSeriesId
}
this.seriesIdMap.id = this.currentSeriesId
bus.$emit('change-series-id', param)
},
init() {
this.currentSeriesId = this.customAttr.currentSeriesId
this.currentSeriesId = this.seriesIdMap?.id || this.customAttr.currentSeriesId
}
}
}

View File

@ -32,9 +32,9 @@
placement="bottom"
>
<div slot="content">
表达式语法请遵循该数据源对应的数据库语法
{{ $t('dataset.calc_tips.tip1') }}
<br>
字段类型将使用原始类型如有需要请在表达式中自行转换
{{ $t('dataset.calc_tips.tip2') }}
</div>
<i
class="el-icon-info"
@ -112,11 +112,11 @@
placement="bottom"
>
<div slot="content">
引用字段以 "[" 开始 "]" 结束
{{ $t('dataset.calc_tips.tip3') }}
<br>
请勿修改引用内容否则将引用失败
{{ $t('dataset.calc_tips.tip4') }}
<br>
若输入与引用字段相同格式的内容将被当作引用字段处理
{{ $t('dataset.calc_tips.tip5') }}
</div>
<i
class="el-icon-info"
@ -239,11 +239,11 @@
placement="bottom"
>
<div slot="content">
使用数据集对应数据库类型所支持的函数语法同对应数据库
{{ $t('dataset.calc_tips.tip6') }}
<br>
如日期格式化MySQL使用DATE_FORMAT(date,format)Oracle使用TO_DATE(X,[,fmt])
{{ $t('dataset.calc_tips.tip7') }}
<br>
非直连模式数据集使用Doris数据库函数可参考Doris官网 https://doris.apache.org/zh-CN/
{{ $t('dataset.calc_tips.tip8') }} https://doris.apache.org/zh-CN/
</div>
<i
class="el-icon-info"

View File

@ -39,7 +39,7 @@
v-if="['db', 'excel', 'api'].includes(datasetType)"
class="table-num"
>{{ $t('deDataset.selected') }} {{ tableNum }}
{{ ['excel'].includes(datasetType) ? $t('deDataset.table') : '项' }}</span>
{{ ['excel'].includes(datasetType) ? $t('deDataset.table') : $t('deDataset.item') }}</span>
<deBtn
:disabled="['db', 'excel', 'api'].includes(datasetType) && !tableNum"
type="primary"

View File

@ -29,9 +29,9 @@
placement="bottom"
>
<div slot="content">
表达式语法请遵循该数据源对应的数据库语法
{{ $t('dataset.calc_tips.tip1') }}
<br>
数据集中不支持聚合运算
{{ $t('dataset.calc_tips.tip2') }}
</div>
<i
class="el-icon-info"
@ -90,11 +90,11 @@
placement="bottom"
>
<div slot="content">
引用字段以 "[" 开始 "]" 结束
{{ $t('dataset.calc_tips.tip3') }}
<br>
请勿修改引用内容否则将引用失败
{{ $t('dataset.calc_tips.tip4') }}
<br>
若输入与引用字段相同格式的内容将被当作引用字段处理
{{ $t('dataset.calc_tips.tip5') }}
</div>
<i
class="el-icon-info"
@ -214,11 +214,11 @@
placement="bottom"
>
<div slot="content">
使用数据集对应数据库类型所支持的函数语法同对应数据库
{{ $t('dataset.calc_tips.tip6') }}
<br>
如日期格式化MySQL使用DATE_FORMAT(date,format)Oracle使用TO_DATE(X,[,fmt])
{{ $t('dataset.calc_tips.tip7') }}
<br>
非直连模式数据集使用Doris数据库函数可参考Doris官网
{{ $t('dataset.calc_tips.tip8') }}
https://doris.apache.org/zh-CN/
</div>
<i

View File

@ -398,11 +398,11 @@ export default {
this.filterList = [
{
value: 'logic',
label: '条件筛选'
label: this.$t('deDataset.logic_filter')
},
{
value: 'enum',
label: '枚举筛选'
label: this.$t('deDataset.enum_filter')
}
]
if ([1, 2, 3].includes(deType)) {

View File

@ -729,7 +729,6 @@ export default {
optType: 'rename',
titlePre: this.$t('commons.edit'),
panelInfo: {
pid: param.data.pid,
id: param.data.id,
name: param.data.name,
nodeType: param.type

View File

@ -155,7 +155,7 @@
<el-input
v-model="form.name"
autocomplete="off"
:placeholder="$t('commons.input_name')"
:placeholder="$t('datasource.input_name')"
/>
</el-form-item>
<el-form-item