diff --git a/.gitignore b/.gitignore index a28af86e43..0c403a5842 100644 --- a/.gitignore +++ b/.gitignore @@ -48,3 +48,5 @@ core/core-frontend/src/assets/fsSvg.html /sdk/dataease-plugin-filter/ /sdk/dataease-plugin-interface/ /sdk/dataease-plugin-view/ +/extensions/ +.vite/ diff --git a/core/core-backend/src/main/resources/i18n/core_zh_CN.properties b/core/core-backend/src/main/resources/i18n/core_zh_CN.properties index 6ff9d226b4..36a4670dde 100644 --- a/core/core-backend/src/main/resources/i18n/core_zh_CN.properties +++ b/core/core-backend/src/main/resources/i18n/core_zh_CN.properties @@ -53,3 +53,4 @@ i18n_schema_is_empty=schema \u4E3A\u7A7A\uFF01 i18n_table_name_repeat=\u540D\u79F0\u91CD\u590D: i18n_sql_not_empty=sql \u4E0D\u80FD\u4E3A\u7A7A i18n_menu.parameter=\u7CFB\u7EDF\u53C2\u6570 +i18n_user_old_pwd_error=\u539F\u59CB\u5BC6\u7801\u9519\u8BEF diff --git a/core/core-frontend/src/assets/svg/top-doc-default.svg b/core/core-frontend/src/assets/svg/top-doc-default.svg new file mode 100644 index 0000000000..92f4c2c23c --- /dev/null +++ b/core/core-frontend/src/assets/svg/top-doc-default.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/core/core-frontend/src/assets/svg/top-enterprise-trial.svg b/core/core-frontend/src/assets/svg/top-enterprise-trial.svg new file mode 100644 index 0000000000..810340f42a --- /dev/null +++ b/core/core-frontend/src/assets/svg/top-enterprise-trial.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/core/core-frontend/src/assets/svg/top-help-doc.svg b/core/core-frontend/src/assets/svg/top-help-doc.svg new file mode 100644 index 0000000000..1be5f64387 --- /dev/null +++ b/core/core-frontend/src/assets/svg/top-help-doc.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/core/core-frontend/src/assets/svg/top-product-bbs.svg b/core/core-frontend/src/assets/svg/top-product-bbs.svg new file mode 100644 index 0000000000..542e257f10 --- /dev/null +++ b/core/core-frontend/src/assets/svg/top-product-bbs.svg @@ -0,0 +1,4 @@ + + + + diff --git a/core/core-frontend/src/assets/svg/top-tech-video.svg b/core/core-frontend/src/assets/svg/top-tech-video.svg new file mode 100644 index 0000000000..c184dcb7e3 --- /dev/null +++ b/core/core-frontend/src/assets/svg/top-tech-video.svg @@ -0,0 +1,3 @@ + + + diff --git a/core/core-frontend/src/assets/svg/top-technology.svg b/core/core-frontend/src/assets/svg/top-technology.svg new file mode 100644 index 0000000000..f9ae658e95 --- /dev/null +++ b/core/core-frontend/src/assets/svg/top-technology.svg @@ -0,0 +1,4 @@ + + + + diff --git a/core/core-frontend/src/components/dashboard/subject-setting/dashboard-style/FilterStyleSimpleSelector.vue b/core/core-frontend/src/components/dashboard/subject-setting/dashboard-style/FilterStyleSimpleSelector.vue index 00b5fc13ab..d35c5b1d87 100644 --- a/core/core-frontend/src/components/dashboard/subject-setting/dashboard-style/FilterStyleSimpleSelector.vue +++ b/core/core-frontend/src/components/dashboard/subject-setting/dashboard-style/FilterStyleSimpleSelector.vue @@ -158,7 +158,6 @@ const { t } = useI18n() const dvMainStore = dvMainStoreWithOut() const snapshotStore = snapshotStoreWithOut() const filterStyle = computed(() => { - console.log('filterStyle==' + JSON.stringify(dvMainStore.canvasStyleData.component.filterStyle)) return dvMainStore.canvasStyleData.component.filterStyle }) diff --git a/core/core-frontend/src/layout/components/TopDoc.vue b/core/core-frontend/src/layout/components/TopDoc.vue index 0de4a2681b..c1c0764f2d 100644 --- a/core/core-frontend/src/layout/components/TopDoc.vue +++ b/core/core-frontend/src/layout/components/TopDoc.vue @@ -1,20 +1,48 @@ + + diff --git a/core/core-frontend/src/layout/components/TopDocCard.vue b/core/core-frontend/src/layout/components/TopDocCard.vue new file mode 100644 index 0000000000..e9b70fe549 --- /dev/null +++ b/core/core-frontend/src/layout/components/TopDocCard.vue @@ -0,0 +1,63 @@ + + + + + diff --git a/core/core-frontend/src/locales/zh-CN.ts b/core/core-frontend/src/locales/zh-CN.ts index 673cd3d007..65515fa7a5 100644 --- a/core/core-frontend/src/locales/zh-CN.ts +++ b/core/core-frontend/src/locales/zh-CN.ts @@ -230,6 +230,7 @@ export default { manage: '管理', auth: '授权', resource_name: '资源名称', + menu_name: '菜单名称', from_role: '继承自以下角色:', auth_alone: '单独授权', org_role_empty: '组织管理员已拥有所有资源的权限,无需再授权', diff --git a/core/core-frontend/src/models/chart/editor.d.ts b/core/core-frontend/src/models/chart/editor.d.ts index 3fde51f928..74d63c7833 100644 --- a/core/core-frontend/src/models/chart/editor.d.ts +++ b/core/core-frontend/src/models/chart/editor.d.ts @@ -86,4 +86,25 @@ declare interface ChartEditorForm { * 是否渲染图表 */ render: boolean + /** + * 子属性 + */ + prop?: string +} +/** + * 轴编辑表单 + */ +declare interface AxisEditForm { + /** + * 轴类型 + */ + axisType: AxisType + /** + * 变更内容 + */ + axis: Axis[] + /** + * 变更类型 + */ + editType: 'add' | 'remove' | 'update' } diff --git a/core/core-frontend/src/store/modules/permission.ts b/core/core-frontend/src/store/modules/permission.ts index 8686ec61ee..5aca217d58 100644 --- a/core/core-frontend/src/store/modules/permission.ts +++ b/core/core-frontend/src/store/modules/permission.ts @@ -95,6 +95,9 @@ export const pathValid = path => { * @returns */ const hasCurrentRouter = (locations, routers, index) => { + if (!routers?.length) { + return false + } const location = locations[index] let kids = [] const isvalid = routers.some(router => { diff --git a/core/core-frontend/src/views/chart/components/editor/editor-style/components/TooltipSelector.vue b/core/core-frontend/src/views/chart/components/editor/editor-style/components/TooltipSelector.vue index a20a6ae292..2b74219b3b 100644 --- a/core/core-frontend/src/views/chart/components/editor/editor-style/components/TooltipSelector.vue +++ b/core/core-frontend/src/views/chart/components/editor/editor-style/components/TooltipSelector.vue @@ -7,10 +7,11 @@ import cloneDeep from 'lodash-es/cloneDeep' import defaultsDeep from 'lodash-es/defaultsDeep' import { formatterType, unitType } from '../../../js/formatter' import { fieldType } from '@/utils/attr' -import { differenceBy, partition } from 'lodash-es' +import { partition } from 'lodash-es' import chartViewManager from '../../../js/panel' import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain' import { storeToRefs } from 'pinia' +import { useEmitt } from '@/hooks/web/useEmitt' const { t } = useI18n() @@ -34,11 +35,10 @@ const toolTip = computed(() => { return props.themes === 'dark' ? 'ndark' : 'dark' }) const emit = defineEmits(['onTooltipChange', 'onExtTooltipChange']) - const curSeriesFormatter = ref>({}) const quotaData = ref(inject('quotaData')) const showSeriesTooltipFormatter = computed(() => { - return showProperty('seriesTooltipFormatter') && !batchOptStatus.value + return showProperty('seriesTooltipFormatter') && !batchOptStatus.value && props.chart.id }) // 初始化系列提示 const initSeriesTooltip = () => { @@ -90,84 +90,15 @@ const initSeriesTooltip = () => { } curSeriesFormatter.value = axisMap[curSeriesFormatter.value.seriesId] } -// 更新系列提示 -const updateSeriesTooltip = (newAxis?: SeriesFormatter[], oldAxis?: SeriesFormatter[]) => { - if ( - !showSeriesTooltipFormatter.value || - !state.tooltipForm.seriesTooltipFormatter.length || - !quotaData.value?.length - ) { - return - } - const axisMap: Record = newAxis?.reduce((pre, next) => { - pre[next.seriesId] = next - return pre - }, {}) - // 新增 - const addedAxisMap = differenceBy(newAxis, oldAxis, 'seriesId').reduce((pre, next) => { - pre[next.id] = next - return pre - }, {}) as Record - // 删除 - const removedAxisMap = differenceBy(oldAxis, newAxis, 'seriesId').reduce((pre, next) => { - pre[next.seriesId] = next - return pre - }, {}) as Record - const quotaIds = quotaData.value?.map(i => i.id) - state.tooltipForm.seriesTooltipFormatter = state.tooltipForm.seriesTooltipFormatter?.filter(i => - quotaIds?.includes(i.id) - ) - const dupAxis: SeriesFormatter[] = [] - state.tooltipForm.seriesTooltipFormatter?.forEach(ele => { - if (addedAxisMap[ele.id]) { - // 数据集中的字段 - ele.show = true - if (ele.seriesId === ele.id) { - ele.seriesId = addedAxisMap[ele.id].seriesId - ele.axisType = addedAxisMap[ele.id].axisType - } else { - // 其他轴已有的字段 - const tmp = cloneDeep(addedAxisMap[ele.id]) - tmp.show = true - dupAxis.push(tmp) - } - } - if (removedAxisMap[ele.seriesId]) { - ele.show = false - ele.seriesId = ele.id - } - ele.chartShowName = axisMap[ele.seriesId]?.chartShowName - ele.summary = axisMap[ele.seriesId]?.summary ?? ele.summary - }) - // 重新排序 - state.tooltipForm.seriesTooltipFormatter = - state.tooltipForm.seriesTooltipFormatter.concat(dupAxis) - state.tooltipForm.seriesTooltipFormatter = partition( - state.tooltipForm.seriesTooltipFormatter, - ele => axisMap[ele.seriesId] - ).flat() - if (removedAxisMap[curSeriesFormatter.value?.seriesId]) { - curSeriesFormatter.value = state.tooltipForm.seriesTooltipFormatter?.[0] - } - if (!newAxis.length) { - curSeriesFormatter.value = {} - } - emit('onTooltipChange', { data: state.tooltipForm, render: false }) - emit('onExtTooltipChange', extTooltip.value) -} +const AXIS_PROP: AxisType[] = ['yAxis', 'yAxisExt', 'extBubble'] const quotaAxis = computed(() => { let result = [] - const axisProp: AxisType[] = ['yAxis', 'yAxisExt', 'extBubble'] - axisProp.forEach(prop => { + AXIS_PROP.forEach(prop => { if (!chartViewInstance.value?.axis?.includes(prop)) { return } const axis = props.chart[prop] - axis?.forEach(item => { - item.axisType = prop - item.seriesId = `${item.id}-${prop}` - result.push(item) - }) + axis?.forEach(item => result.push(item)) }) return result }) @@ -205,13 +136,6 @@ const AGGREGATION_TYPE = [ { name: t('chart.count'), value: 'count' }, { name: t('chart.count_distinct'), value: 'count_distinct' } ] -watch( - () => cloneDeep(quotaAxis.value), - (newVal, oldVal) => { - updateSeriesTooltip(newVal, oldVal) - }, - { deep: true } -) watch( [() => props.chart.customAttr.tooltip, () => props.chart.customAttr.tooltip.show], () => { @@ -262,7 +186,15 @@ const init = () => { if (customAttr.tooltip) { state.tooltipForm = defaultsDeep(customAttr.tooltip, cloneDeep(DEFAULT_TOOLTIP)) formatterSelector.value?.blur() + // 新增视图 const formatter = state.tooltipForm.seriesTooltipFormatter + if (!quotaAxis.value?.length) { + if (!formatter.length) { + quotaData.value?.forEach(i => formatter.push({ ...i, seriesId: i.id, show: false })) + } + curSeriesFormatter.value = {} + return + } const seriesAxisMap = formatter.reduce((pre, next) => { next.seriesId = next.seriesId ?? next.id pre[next.seriesId] = next @@ -278,9 +210,131 @@ const init = () => { } const showProperty = prop => props.propertyInner?.includes(prop) - +const updateSeriesTooltipFormatter = (form: AxisEditForm) => { + const { axisType, editType } = form + if ( + !showSeriesTooltipFormatter.value || + !state.tooltipForm.seriesTooltipFormatter.length || + !quotaData.value?.length || + !AXIS_PROP.includes(axisType) + ) { + return + } + switch (editType) { + case 'add': + addAxis(form) + break + case 'remove': + removeAxis(form) + break + case 'update': + updateAxis(form) + break + default: + break + } + emit('onTooltipChange', { data: state.tooltipForm, render: false }, 'seriesTooltipFormatter') + emit('onExtTooltipChange', extTooltip.value) +} +const addAxis = (form: AxisEditForm) => { + const { axis, axisType } = form + const axisMap = axis.reduce((pre, next) => { + next.axisType = axisType + next.seriesId = `${next.id}-${axisType}` + pre[next.id] = next + return pre + }, {}) + const dupAxis = [] + state.tooltipForm.seriesTooltipFormatter.forEach(ele => { + if (axisMap[ele.id]) { + // 数据集中的字段 + ele.show = true + if (ele.seriesId === ele.id) { + ele.seriesId = axisMap[ele.id].seriesId + ele.axisType = axisMap[ele.id].axisType + ele.summary = axisMap[ele.id].summary + ele.chartShowName = axisMap[ele.id].chartShowName + } else { + // 其他轴已有的字段 + const tmp = cloneDeep(axisMap[ele.id]) + tmp.show = true + dupAxis.push(tmp) + } + } + }) + state.tooltipForm.seriesTooltipFormatter = + state.tooltipForm.seriesTooltipFormatter.concat(dupAxis) + state.tooltipForm.seriesTooltipFormatter = partition( + state.tooltipForm.seriesTooltipFormatter, + ele => quotaAxis.value.findIndex(item => item.id === ele.id) !== -1 + ).flat() +} +const removeAxis = (form: AxisEditForm) => { + const { axis, axisType } = form + const axisMap = axis.reduce((pre, next) => { + if (!next) { + return pre + } + next.axisType = axisType + next.seriesId = `${next.id}-${axisType}` + pre[next.seriesId] = next + return pre + }, {}) + const quotaIds = quotaData.value?.map(i => i.id) + const formatterDupMap = state.tooltipForm.seriesTooltipFormatter.reduce((pre, next) => { + if (pre[next.id] !== undefined) { + pre[`${next.id}-${axisType}`] = true + } else { + pre[next.id] = false + } + return pre + }, {}) + state.tooltipForm.seriesTooltipFormatter = state.tooltipForm.seriesTooltipFormatter?.filter( + i => quotaIds?.includes(i.id) && !formatterDupMap[i.seriesId] + ) + state.tooltipForm.seriesTooltipFormatter.forEach(ele => { + if (axisMap[ele.seriesId]) { + // 数据集中的字段 + ele.show = false + ele.seriesId = ele.id + ele.summary = 'sum' + } + }) + state.tooltipForm.seriesTooltipFormatter = partition( + state.tooltipForm.seriesTooltipFormatter, + ele => quotaAxis.value.findIndex(item => item.id === ele.id) !== -1 + ).flat() + if (!quotaAxis.value?.length) { + curSeriesFormatter.value = {} + return + } + if (axisMap[curSeriesFormatter.value?.seriesId]) { + curSeriesFormatter.value = state.tooltipForm.seriesTooltipFormatter?.[0] + } +} +const updateAxis = (form: AxisEditForm) => { + const { axis, axisType } = form + const axisMap = axis.reduce((pre, next) => { + if (!next) { + return pre + } + next.axisType = axisType + next.seriesId = `${next.id}-${axisType}` + pre[next.seriesId] = next + return pre + }, {}) + state.tooltipForm.seriesTooltipFormatter.forEach(ele => { + if (axisMap[ele.seriesId]) { + ele.chartShowName = axisMap[ele.seriesId]?.chartShowName + ele.summary = axisMap[ele.seriesId]?.summary ?? ele.summary + } + }) +} onMounted(() => { init() + useEmitt({ name: 'addAxis', callback: updateSeriesTooltipFormatter }) + useEmitt({ name: 'removeAxis', callback: updateSeriesTooltipFormatter }) + useEmitt({ name: 'updateAxis', callback: updateSeriesTooltipFormatter }) }) @@ -482,10 +536,11 @@ onMounted(() => {