Merge branch 'dev-v2' of github.com:dataease/dataease into dev-v2

This commit is contained in:
taojinlong 2024-05-31 18:07:33 +08:00
commit 87ba2ed5d6
25 changed files with 97 additions and 149 deletions

View File

@ -69,7 +69,7 @@ const switchValue = computed({
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
padding-right: 8px; padding-right: 10px;
flex-grow: 1; flex-grow: 1;
:deep(.ed-switch.is-checked .ed-switch__core > .ed-switch__action) { :deep(.ed-switch.is-checked .ed-switch__core > .ed-switch__action) {
left: calc(100% - 12px); left: calc(100% - 12px);

View File

@ -10,6 +10,7 @@ import { computed, toRefs } from 'vue'
import { ElDivider } from 'element-plus-secondary' import { ElDivider } from 'element-plus-secondary'
import eventBus from '@/utils/eventBus' import eventBus from '@/utils/eventBus'
import { getCurInfo } from '@/store/modules/data-visualization/common' import { getCurInfo } from '@/store/modules/data-visualization/common'
import { useEmitt } from '@/hooks/web/useEmitt'
const dvMainStore = dvMainStoreWithOut() const dvMainStore = dvMainStoreWithOut()
const copyStore = copyStoreWithOut() const copyStore = copyStoreWithOut()
const lockStore = lockStoreWithOut() const lockStore = lockStoreWithOut()
@ -20,6 +21,7 @@ const composeStore = composeStoreWithOut()
const { areaData } = storeToRefs(composeStore) const { areaData } = storeToRefs(composeStore)
const { curComponent } = storeToRefs(dvMainStore) const { curComponent } = storeToRefs(dvMainStore)
const emit = defineEmits(['close', 'rename']) const emit = defineEmits(['close', 'rename'])
const { emitter } = useEmitt()
const props = defineProps({ const props = defineProps({
activePosition: { activePosition: {
type: String, type: String,
@ -157,6 +159,10 @@ const composeDivider = computed(() => {
const isGroupArea = computed(() => { const isGroupArea = computed(() => {
return curComponent.value?.component === 'GroupArea' return curComponent.value?.component === 'GroupArea'
}) })
const editQueryCriteria = () => {
emitter.emit(`editQueryCriteria${curComponent.value.id}`)
}
</script> </script>
<template> <template>
@ -207,6 +213,8 @@ const isGroupArea = computed(() => {
<el-divider class="custom-divider" v-show="composeDivider" /> <el-divider class="custom-divider" v-show="composeDivider" />
<template v-if="curComponent && !isGroupArea"> <template v-if="curComponent && !isGroupArea">
<template v-if="!curComponent['isLock']"> <template v-if="!curComponent['isLock']">
<li v-if="curComponent.component === 'VQuery'" @click="editQueryCriteria">编辑</li>
<li @click="upComponent">上移一层</li>
<li @click="upComponent">上移一层</li> <li @click="upComponent">上移一层</li>
<li @click="downComponent">下移一层</li> <li @click="downComponent">下移一层</li>
<li @click="topComponent">置于顶层</li> <li @click="topComponent">置于顶层</li>

View File

@ -187,10 +187,10 @@ const textStyle = computed(() => {
} }
@keyframes marqueeAnimation { @keyframes marqueeAnimation {
0% { 0% {
transform: translate(0, 0); transform: translate(100%, 0);
} }
100% { 100% {
transform: translate(-100%, 0); transform: translate(-50%, 0);
} }
} }
</style> </style>

View File

@ -279,10 +279,12 @@ declare interface ChartTableHeaderAttr {
*/ */
tableHeaderSort: boolean tableHeaderSort: boolean
/** /**
* @deprecated since version 2.7.0 由提示统一控制
* 行头鼠标悬浮提示开关 * 行头鼠标悬浮提示开关
*/ */
showRowTooltip: boolean showRowTooltip: boolean
/** /**
* @deprecated since version 2.7.0 由提示统一控制
* 列头鼠标悬浮提示开关 * 列头鼠标悬浮提示开关
*/ */
showColTooltip: boolean showColTooltip: boolean
@ -324,6 +326,7 @@ declare interface ChartTableCellAttr {
*/ */
tableItemSubBgColor: string tableItemSubBgColor: string
/** /**
* @deprecated since version 2.7.0 由提示统一控制
* 鼠标悬浮提示 * 鼠标悬浮提示
*/ */
showTooltip: boolean showTooltip: boolean

View File

@ -29,20 +29,24 @@ router.beforeEach(async (to, from, next) => {
start() start()
loadStart() loadStart()
checkPlatform() checkPlatform()
let isDesktop = wsCache.get('app.desktop')
if (isDesktop === null) {
await appStore.setAppModel()
isDesktop = appStore.getDesktop
}
if (isMobile()) { if (isMobile()) {
done() done()
loadDone() loadDone()
if (to.name === 'link') { if (to.name === 'link') {
window.location.href = window.origin + '/mobile.html#' + to.path window.location.href = window.origin + '/mobile.html#' + to.path
} else if (!isPlatformClient() && !isLarkPlatform()) { } else if (
wsCache.get('user.token') ||
isDesktop ||
(!isPlatformClient() && !isLarkPlatform())
) {
window.location.href = window.origin + '/mobile.html#/index' window.location.href = window.origin + '/mobile.html#/index'
} }
} }
let isDesktop = wsCache.get('app.desktop')
if (isDesktop === null) {
await appStore.setAppModel()
isDesktop = appStore.getDesktop
}
await appearanceStore.setAppearance() await appearanceStore.setAppearance()
if (wsCache.get('user.token') || isDesktop) { if (wsCache.get('user.token') || isDesktop) {
if (!userStore.getUid) { if (!userStore.getUid) {

View File

@ -37,11 +37,6 @@ const { element, chart, commonBackgroundPop } = toRefs(props)
<el-collapse v-model="state.styleActiveNames" class="style-collapse"> <el-collapse v-model="state.styleActiveNames" class="style-collapse">
<el-collapse-item :effect="themes" name="component" :title="t('visualization.module')"> <el-collapse-item :effect="themes" name="component" :title="t('visualization.module')">
<el-form label-position="top"> <el-form label-position="top">
<el-form-item class="form-item margin-bottom-8" :class="'form-item-' + themes">
<el-checkbox :effect="themes" v-model="element.isHang" size="small">
隐藏组件
</el-checkbox>
</el-form-item>
<el-form-item class="form-item margin-bottom-8" :class="'form-item-' + themes"> <el-form-item class="form-item margin-bottom-8" :class="'form-item-' + themes">
<el-checkbox <el-checkbox
:effect="themes" :effect="themes"

View File

@ -142,7 +142,6 @@ onMounted(() => {
:label="t('chart.split_line')" :label="t('chart.split_line')"
class="form-item" class="form-item"
:class="'form-item-' + themes" :class="'form-item-' + themes"
style="padding-right: 4px"
> >
<el-color-picker <el-color-picker
v-model="state.quadrantForm.lineStyle.stroke" v-model="state.quadrantForm.lineStyle.stroke"
@ -189,12 +188,7 @@ onMounted(() => {
</el-form-item> </el-form-item>
</div> </div>
<div style="display: flex"> <div style="display: flex">
<el-form-item <el-form-item class="form-item" label="X 轴恒线" :class="'form-item-' + themes">
class="form-item"
label="X 轴恒线"
:class="'form-item-' + themes"
style="padding-left: 4px"
>
<el-input-number <el-input-number
controls-position="right" controls-position="right"
style="width: 100%" style="width: 100%"
@ -225,7 +219,7 @@ onMounted(() => {
</el-form-item> </el-form-item>
</div> </div>
</template> </template>
<el-tabs v-model="tabActive" class="quadrant-tab-header" :class="{ dark: themes === 'dark' }"> <el-tabs v-model="tabActive" class="tab-header" :class="{ dark: themes === 'dark' }">
<el-tab-pane <el-tab-pane
:name="index + 1" :name="index + 1"
v-for="(l, index) in state.quadrantForm.labels" v-for="(l, index) in state.quadrantForm.labels"
@ -239,7 +233,6 @@ onMounted(() => {
<el-form-item <el-form-item
class="form-item" class="form-item"
:class="'form-item-' + themes" :class="'form-item-' + themes"
style="padding-right: 4px"
:label="t('chart.backgroundColor')" :label="t('chart.backgroundColor')"
> >
<el-color-picker <el-color-picker
@ -290,7 +283,6 @@ onMounted(() => {
<el-form-item <el-form-item
class="form-item" class="form-item"
:class="'form-item-' + themes" :class="'form-item-' + themes"
style="padding-right: 4px"
:label="t('chart.chart_style')" :label="t('chart.chart_style')"
> >
<el-color-picker <el-color-picker
@ -384,48 +376,6 @@ onMounted(() => {
border-color: rgba(235, 235, 235, 0.15); border-color: rgba(235, 235, 235, 0.15);
} }
} }
.quadrant-tab-header {
--ed-tabs-header-height: 34px;
--custom-tab-color: #646a73;
:deep(.ed-tabs__nav-wrap::after) {
background-color: unset;
}
&.dark {
--custom-tab-color: #a6a6a6;
}
height: 100%;
:deep(.ed-tabs__header) {
border-top: solid 1px @side-outline-border-color;
}
:deep(.ed-tabs__item) {
font-weight: 400;
font-size: 12px;
padding: 0 12px !important;
margin-right: 0 !important;
color: var(--custom-tab-color);
}
:deep(.is-active) {
font-weight: 500;
color: var(--ed-color-primary, #3370ff);
}
:deep(.ed-tabs__nav-scroll) {
padding-left: 0 !important;
}
:deep(.ed-tabs__header) {
margin: 0 !important;
}
:deep(.ed-tabs__content) {
height: calc(100% - 33px);
overflow-y: auto;
overflow-x: hidden;
}
}
.padding-tab { .padding-tab {
padding: 0; padding: 0;
height: 100%; height: 100%;

View File

@ -234,20 +234,6 @@ onMounted(() => {
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-form-item
class="form-item"
:class="'form-item-' + themes"
v-if="showProperty('showTooltip')"
>
<el-checkbox
size="small"
:effect="themes"
v-model="state.tableCellForm.showTooltip"
@change="changeTableCell('showTooltip')"
>
{{ t('chart.table_show_cell_tooltip') }}
</el-checkbox>
</el-form-item>
</el-form> </el-form>
</template> </template>

View File

@ -250,38 +250,6 @@ onMounted(() => {
{{ t('chart.table_header_sort') }} {{ t('chart.table_header_sort') }}
</el-checkbox> </el-checkbox>
</el-form-item> </el-form-item>
<el-form-item
class="form-item"
:class="'form-item-' + themes"
v-if="showProperty('showColTooltip')"
>
<el-checkbox
size="small"
:effect="themes"
v-model="state.tableHeaderForm.showColTooltip"
@change="changeTableHeader('showColTooltip')"
>
{{
chart.type === 'table-pivot'
? t('chart.table_show_col_tooltip')
: t('chart.table_show_header_tooltip')
}}
</el-checkbox>
</el-form-item>
<el-form-item
class="form-item"
:class="'form-item-' + themes"
v-if="showProperty('showRowTooltip')"
>
<el-checkbox
size="small"
:effect="themes"
v-model="state.tableHeaderForm.showRowTooltip"
@change="changeTableHeader('showRowTooltip')"
>
{{ t('chart.table_show_row_tooltip') }}
</el-checkbox>
</el-form-item>
</el-form> </el-form>
</template> </template>

View File

@ -3166,7 +3166,7 @@ span {
display: flex; display: flex;
transition: 0.5s; transition: 0.5s;
.padding-lr { .padding-lr {
padding: 0 8px; padding: 0 10px;
&.no-top-border { &.no-top-border {
border-top: none !important; border-top: none !important;
@ -3217,7 +3217,7 @@ span {
} }
:deep(.ed-collapse-item__content) { :deep(.ed-collapse-item__content) {
padding: 16px 8px 0; padding: 16px 10px 0;
border: none; border: none;
:deep(.ed-checkbox) { :deep(.ed-checkbox) {
height: 20px; height: 20px;

View File

@ -46,7 +46,7 @@ export const TABLE_EDITOR_PROPERTY_INNER: EditorPropertyInner = {
'letterSpace', 'letterSpace',
'fontShadow' 'fontShadow'
], ],
'tooltip-selector': ['fontSize', 'color', 'backgroundColor'], 'tooltip-selector': ['fontSize', 'color', 'backgroundColor', 'show'],
'function-cfg': ['emptyDataStrategy'], 'function-cfg': ['emptyDataStrategy'],
threshold: ['tableThreshold'] threshold: ['tableThreshold']
} }

View File

@ -184,14 +184,10 @@ export class TableInfo extends S2ChartView<TableSheet> {
} }
action(param) action(param)
}) })
// tooltip
// hover const { show } = customAttr.tooltip
const { showColTooltip } = customAttr.tableHeader if (show) {
if (showColTooltip) {
newChart.on(S2Event.COL_CELL_HOVER, event => this.showTooltip(newChart, event, meta)) newChart.on(S2Event.COL_CELL_HOVER, event => this.showTooltip(newChart, event, meta))
}
const { showTooltip } = customAttr.tableCell
if (showTooltip) {
newChart.on(S2Event.DATA_CELL_HOVER, event => this.showTooltip(newChart, event, meta)) newChart.on(S2Event.DATA_CELL_HOVER, event => this.showTooltip(newChart, event, meta))
} }
// header resize // header resize

View File

@ -187,13 +187,10 @@ export class TableNormal extends S2ChartView<TableSheet> {
} }
action(param) action(param)
}) })
// hover // tooltip
const { showColTooltip } = customAttr.tableHeader const { show } = customAttr.tooltip
if (showColTooltip) { if (show) {
newChart.on(S2Event.COL_CELL_HOVER, event => this.showTooltip(newChart, event, meta)) newChart.on(S2Event.COL_CELL_HOVER, event => this.showTooltip(newChart, event, meta))
}
const { showTooltip } = customAttr.tableCell
if (showTooltip) {
newChart.on(S2Event.DATA_CELL_HOVER, event => this.showTooltip(newChart, event, meta)) newChart.on(S2Event.DATA_CELL_HOVER, event => this.showTooltip(newChart, event, meta))
} }
// header resize // header resize

View File

@ -200,16 +200,11 @@ export class TablePivot extends S2ChartView<PivotSheet> {
this.configTooltip(chart, s2Options) this.configTooltip(chart, s2Options)
// 开始渲染 // 开始渲染
const s2 = new PivotSheet(containerDom, s2DataConfig, s2Options as unknown as S2Options) const s2 = new PivotSheet(containerDom, s2DataConfig, s2Options as unknown as S2Options)
// hover // tooltip
const { showColTooltip, showRowTooltip } = customAttr.tableHeader const { show } = customAttr.tooltip
if (showColTooltip) { if (show) {
s2.on(S2Event.COL_CELL_HOVER, event => this.showTooltip(s2, event, meta)) s2.on(S2Event.COL_CELL_HOVER, event => this.showTooltip(s2, event, meta))
}
if (showRowTooltip) {
s2.on(S2Event.ROW_CELL_HOVER, event => this.showTooltip(s2, event, meta)) s2.on(S2Event.ROW_CELL_HOVER, event => this.showTooltip(s2, event, meta))
}
const { showTooltip } = customAttr.tableCell
if (showTooltip) {
s2.on(S2Event.DATA_CELL_HOVER, event => this.showTooltip(s2, event, meta)) s2.on(S2Event.DATA_CELL_HOVER, event => this.showTooltip(s2, event, meta))
} }
// click // click

View File

@ -750,7 +750,8 @@ export function configTooltip(chart: Chart, option: S2Options) {
boxShadow: 'rgba(0, 0, 0, 0.1) 0px 4px 8px 0px', boxShadow: 'rgba(0, 0, 0, 0.1) 0px 4px 8px 0px',
borderRadius: '3px', borderRadius: '3px',
padding: '4px 12px', padding: '4px 12px',
opacity: 0.95 opacity: 0.95,
position: 'absolute'
}, },
adjustPosition: ({ event }) => { adjustPosition: ({ event }) => {
return getTooltipPosition(event) return getTooltipPosition(event)
@ -791,7 +792,7 @@ export function copyContent(s2Instance, event, fieldMeta) {
function getTooltipPosition(event) { function getTooltipPosition(event) {
const s2Instance = event.s2Instance const s2Instance = event.s2Instance
const { x, y } = event const { x, y } = event
const result = { x: x + 15, y: y + 10 } const result = { x: x + 15, y }
if (!s2Instance) { if (!s2Instance) {
return result return result
} }
@ -809,8 +810,16 @@ function getTooltipPosition(event) {
if (result.x && result.x + offsetWidth > width) { if (result.x && result.x + offsetWidth > width) {
result.x -= result.x + offsetWidth - width result.x -= result.x + offsetWidth - width
} }
if (result.y && result.y + offsetHeight > height) { if (result.y) {
result.y -= offsetHeight + 15 if (result.y > offsetHeight) {
if (result.y - offsetHeight >= 15) {
result.y -= offsetHeight + 15
} else {
result.y = 0
}
} else {
result.y += 15
}
} }
return result return result
} }

View File

@ -3,7 +3,15 @@ import {
AntVDrawOptions, AntVDrawOptions,
ChartLibraryType ChartLibraryType
} from '@/views/chart/components/js/panel/types' } from '@/views/chart/components/js/panel/types'
import { S2Theme, SpreadSheet, Style, S2Options, Meta, SERIES_NUMBER_FIELD } from '@antv/s2' import {
S2Theme,
SpreadSheet,
Style,
S2Options,
Meta,
SERIES_NUMBER_FIELD,
setTooltipContainerStyle
} from '@antv/s2'
import { import {
configHeaderInteraction, configHeaderInteraction,
configTooltip, configTooltip,
@ -86,6 +94,8 @@ export abstract class S2ChartView<P extends SpreadSheet> extends AntVAbstractCha
return return
} }
event.s2Instance = s2Instance event.s2Instance = s2Instance
const style = s2Instance.options.tooltip.style
setTooltipContainerStyle(s2Instance.tooltip.container, { style })
s2Instance.showTooltip({ s2Instance.showTooltip({
position: { position: {
x: event.clientX, x: event.clientX,

View File

@ -190,7 +190,7 @@ onMounted(async () => {
} }
let deTemplateData let deTemplateData
if (createType === 'template') { if (createType === 'template') {
const templateParamsApply = JSON.parse(decodeURIComponent(Base64.decode(templateParams + ''))) const templateParamsApply = JSON.parse(Base64.decode(decodeURIComponent(templateParams + '')))
await decompressionPre(templateParamsApply, result => { await decompressionPre(templateParamsApply, result => {
deTemplateData = result deTemplateData = result
}) })

View File

@ -1,5 +1,5 @@
<script lang="ts" setup> <script lang="ts" setup>
import { ref, computed, onMounted, watch } from 'vue' import { ref, computed, onMounted, watch, onUnmounted } from 'vue'
import { storeToRefs } from 'pinia' import { storeToRefs } from 'pinia'
import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain' import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
import { useCache } from '@/hooks/web/useCache' import { useCache } from '@/hooks/web/useCache'
@ -160,12 +160,23 @@ const getTree = async () => {
if (nodeData.length && nodeData[0]['id'] === '0' && nodeData[0]['name'] === 'root') { if (nodeData.length && nodeData[0]['id'] === '0' && nodeData[0]['name'] === 'root') {
tableData.value = dfsTableData(nodeData[0]['children'] || []) tableData.value = dfsTableData(nodeData[0]['children'] || [])
rawTableData = cloneDeep(tableData.value) rawTableData = cloneDeep(tableData.value)
setSortType()
return return
} }
tableData.value = dfsTableData(nodeData) tableData.value = dfsTableData(nodeData)
rawTableData = cloneDeep(tableData.value) rawTableData = cloneDeep(tableData.value)
setSortType()
} }
const setSortType = () => {
const type = wsCache.get('mobile-sort-type')
sortTypeChange(type || curSortType.value)
}
onUnmounted(() => {
wsCache.set('mobile-sort-type', curSortType.value)
})
onMounted(() => { onMounted(() => {
getTree() getTree()
activeDirectName.value = wsCache.get('activeDirectName') activeDirectName.value = wsCache.get('activeDirectName')

View File

@ -450,7 +450,7 @@ const apply = template => {
'changeCurrentComponent', 'changeCurrentComponent',
['dataV', 'SCREEN'].includes(state.dvCreateForm.nodeType) ['dataV', 'SCREEN'].includes(state.dvCreateForm.nodeType)
? 'VisualizationEditor' ? 'VisualizationEditor'
: 'Dashboard' : 'DashboardEditor'
) )
return return
} }

@ -1 +1 @@
Subproject commit 8a3233c72c50bf1fcbed274ca833fc72c76f47d6 Subproject commit dac92153509c5e1f4b7eb3b8418bd4ce320726c5

View File

@ -19,6 +19,10 @@ public interface DingtalkApi {
@GetMapping("/info") @GetMapping("/info")
DingtalkInfoVO info(); DingtalkInfoVO info();
@Operation(summary = "查询钉钉二维码信息")
@GetMapping("/qrinfo")
DingtalkInfoVO qrinfo();
@Operation(summary = "保存") @Operation(summary = "保存")
@PostMapping("/create") @PostMapping("/create")
void save(@RequestBody DingtalkSettingCreator creator); void save(@RequestBody DingtalkSettingCreator creator);

View File

@ -20,6 +20,10 @@ public interface LarkApi {
@GetMapping("/info") @GetMapping("/info")
LarkInfoVO info(); LarkInfoVO info();
@Operation(summary = "查询飞书二维码信息")
@GetMapping("/qrinfo")
LarkInfoVO qrinfo();
@Operation(summary = "保存") @Operation(summary = "保存")
@PostMapping("/create") @PostMapping("/create")
void save(@RequestBody LarkSettingCreator creator); void save(@RequestBody LarkSettingCreator creator);

View File

@ -19,6 +19,10 @@ public interface LarksuiteApi {
@GetMapping("/info") @GetMapping("/info")
LarkInfoVO info(); LarkInfoVO info();
@Operation(summary = "查询国际飞书二维码信息")
@GetMapping("/qrinfo")
LarkInfoVO qrinfo();
@Operation(summary = "保存") @Operation(summary = "保存")
@PostMapping("/create") @PostMapping("/create")
void save(@RequestBody LarkSettingCreator creator); void save(@RequestBody LarkSettingCreator creator);

View File

@ -19,6 +19,10 @@ public interface WecomApi {
@GetMapping("/info") @GetMapping("/info")
WecomInfoVO info(); WecomInfoVO info();
@Operation(summary = "查询企微二维码信息")
@GetMapping("/qrinfo")
WecomInfoVO qrinfo();
@Operation(summary = "保存") @Operation(summary = "保存")
@PostMapping("/create") @PostMapping("/create")
void save(@RequestBody WecomCreator creator); void save(@RequestBody WecomCreator creator);

View File

@ -31,13 +31,13 @@ public class WhitelistUtils {
"/doc.html", "/doc.html",
"/panel.html", "/panel.html",
"/mobile.html", "/mobile.html",
"/lark/info", "/lark/qrinfo",
"/lark/token", "/lark/token",
"/larksuite/info", "/larksuite/qrinfo",
"/larksuite/token", "/larksuite/token",
"/dingtalk/info", "/dingtalk/qrinfo",
"/dingtalk/token", "/dingtalk/token",
"/wecom/info", "/wecom/qrinfo",
"/wecom/token", "/wecom/token",
"/sysParameter/requestTimeOut", "/sysParameter/requestTimeOut",
"/setting/authentication/status", "/setting/authentication/status",