feat: 合并1.1.1,升级版本到2.0.8

This commit is contained in:
奔跑的面条
2022-09-27 20:28:47 +08:00
128 changed files with 2438 additions and 28199 deletions
@@ -9,7 +9,7 @@
:icon-size="16"
:indent="18"
@update:value="clickItemHandle"
></n-menu>
></n-menu>
<div class="chart-content-list">
<n-scrollbar>
<charts-item-box :menuOptions="packages.selectOptions"></charts-item-box>
@@ -24,14 +24,12 @@ import { ConfigType } from '@/packages/index.d'
import { useSettingStore } from '@/store/modules/settingStore/settingStore'
import { loadAsyncComponent } from '@/utils'
const ChartsItemBox = loadAsyncComponent(() =>
import('../ChartsItemBox/index.vue')
)
const ChartsItemBox = loadAsyncComponent(() => import('../ChartsItemBox/index.vue'))
const props = defineProps({
selectOptions: {
type: Object,
default: () => []
default: () => {}
}
})
@@ -138,9 +138,11 @@ const filterRes = computed(() => {
try {
const fn = new Function('data', filter.value)
const res = fn(cloneDeep(sourceData.value))
// eslint-disable-next-line vue/no-side-effects-in-computed-properties
errorFlag.value = false
return toString(res)
} catch (error) {
// eslint-disable-next-line vue/no-side-effects-in-computed-properties
errorFlag.value = true
return '过滤函数错误'
}
@@ -73,8 +73,10 @@ import {
imageUrl,
radarUrl,
heatMapUrl,
scatterBasicUrl
scatterBasicUrl,
mapUrl,
wordCloudUrl,
treemapUrl
} from '@/api/mock'
const { HelpOutlineIcon } = icon.ionicons5
@@ -116,6 +118,15 @@ const apiList = [
{
value: `【基础散点图】${scatterBasicUrl}`
},
{
value: `【地图数据】${mapUrl}`
},
{
value: `【词云】${wordCloudUrl}`
},
{
value: `【树图】${treemapUrl}`
},
]
</script>
@@ -102,6 +102,7 @@ const selectTarget = computed(() => {
if (selectId.length !== 1) return undefined
const target = chartEditStore.componentList[chartEditStore.fetchTargetIndex()]
if (target?.isGroup) {
// eslint-disable-next-line vue/no-side-effects-in-computed-properties
tabsSelect.value = TabsEnum.CHART_SETTING
}
return target
@@ -69,6 +69,7 @@ const select = computed(() => {
@include go(shape-box) {
position: absolute;
cursor: move;
/* 锚点 */
.shape-point {
z-index: 1;
@@ -163,7 +163,6 @@ $asideBottom: 70px;
align-items: center;
border-radius: 25px;
border: 1px solid;
mix-blend-mode: luminosity;
@include fetch-border-color('hover-border-color-shallow');
&.aside {
flex-direction: column-reverse;
@@ -248,14 +247,12 @@ $asideBottom: 70px;
height: 0;
padding: 5px;
bottom: $dockMiniBottom;
mix-blend-mode: screen;
}
100% {
height: $dockHeight;
padding: 8px 30px;
bottom: $dockBottom;
border-radius: 25px;
mix-blend-mode: none;
}
}
}
@@ -268,7 +265,6 @@ $asideBottom: 70px;
border-radius: 8px;
cursor: pointer;
border: 0px;
mix-blend-mode: screen;
animation: dock-mini-in 1s ease forwards;
@keyframes dock-mini-in {
0% {
@@ -291,7 +287,6 @@ $asideBottom: 70px;
height: 0;
padding: 5px;
bottom: $dockMiniBottom;
mix-blend-mode: screen;
}
}
.btn-item {
+2 -2
View File
@@ -19,7 +19,7 @@
<!-- 滤镜预览 -->
<div
:style="{
...getFilterStyle(filterShow ? chartEditStore.getEditCanvasConfig : undefined),
...getFilterStyle(chartEditStore.getEditCanvasConfig),
...rangeStyle
}"
>
@@ -54,7 +54,7 @@
:themeColor="themeColor"
:style="{
...useSizeStyle(item.attr),
...getFilterStyle(filterShow ? item.styles : undefined),
...getFilterStyle(item.styles),
...getTransformStyle(item.styles)
}"
></component>
@@ -22,7 +22,7 @@
v-model:value.trim="title"
@keyup.enter="handleBlur"
@blur="handleBlur"
></n-input>
></n-input>
</n-space>
</template>
@@ -50,25 +50,25 @@ watchEffect(() => {
})
const comTitle = computed(() => {
title.value = title.value && title.value.replace(/\s/g, "")
title.value = title.value && title.value.replace(/\s/g, '')
return title.value.length ? title.value : fetchRouteParamsLocation()
})
const handleFocus = () => {
focus.value = true
nextTick(() => {
; (<any>inputInstRef).value.focus()
inputInstRef.value && (inputInstRef.value as any).focus()
})
}
const handleBlur = async () => {
focus.value = false
chartEditStore.setProjectInfo(ProjectInfoEnum.PROJECT_NAME, title.value || '')
const res = await updateProjectApi({
const res = (await updateProjectApi({
id: fetchRouteParamsLocation(),
projectName: title.value,
}) as unknown as MyResponseType
if(res.code === ResultEnum.SUCCESS) {
projectName: title.value
})) as unknown as MyResponseType
if (res.code === ResultEnum.SUCCESS) {
dataSyncUpdate()
} else {
httpErrorHandle()
@@ -1,8 +1,5 @@
<template>
<div
class="go-content-layers-list-item"
:class="{ hover: hover, select: select }"
>
<div class="go-content-layers-list-item" :class="{ hover: hover, select: select }">
<div class="go-flex-center item-content">
<n-image
class="list-img"
@@ -10,7 +7,7 @@
preview-disabled
:src="image"
:fallback-src="requireErrorImg()"
></n-image>
></n-image>
<n-ellipsis>
<n-text class="list-text" :depth="2">
{{ props.componentData.chartConfig.title }}
@@ -43,6 +40,7 @@ const props = defineProps({
}
})
// eslint-disable-next-line vue/no-setup-props-destructure
const { image } = props.componentData.chartConfig
// 计算当前选中目标
@@ -80,7 +78,7 @@ $textSize: 10px;
/* 需要设置最高级,覆盖 hover 的颜色 */
background-color: rgba(0, 0, 0, 0);
.list-img {
border:1px solid v-bind('themeColor')!important;
border: 1px solid v-bind('themeColor') !important;
}
}
.select-modal,
+9 -8
View File
@@ -16,6 +16,7 @@ import { saveProjectApi, fetchProjectApi, uploadFile, updateProjectApi } from '@
import { SyncEnum } from '@/enums/editPageEnum'
import { CreateComponentType, CreateComponentGroupType, ConfigType } from '@/packages/index.d'
import { PublicGroupConfigClass } from '@/packages/public/publicConfig'
import merge from 'lodash/merge'
// 请求处理
export const useSync = () => {
@@ -47,7 +48,7 @@ export const useSync = () => {
}
if (e.isGroup) {
;(e as CreateComponentGroupType).groupList.forEach(groupItem => {
(e as CreateComponentGroupType).groupList.forEach(groupItem => {
intComponent(groupItem)
})
} else {
@@ -68,19 +69,19 @@ export const useSync = () => {
let newComponent: CreateComponentType = await createComponent(_componentInstance.chartConfig)
if (callBack) {
if (changeId) {
callBack(Object.assign(newComponent, { ..._componentInstance, id: getUUID() }))
callBack(merge(newComponent, { ..._componentInstance, id: getUUID() }))
} else {
callBack(Object.assign(newComponent, _componentInstance))
callBack(merge(newComponent, _componentInstance))
}
} else {
if (changeId) {
chartEditStore.addComponentList(
Object.assign(newComponent, { ..._componentInstance, id: getUUID() }),
merge(newComponent, { ..._componentInstance, id: getUUID() }),
false,
true
)
} else {
chartEditStore.addComponentList(Object.assign(newComponent, _componentInstance), false, true)
chartEditStore.addComponentList(merge(newComponent, _componentInstance), false, true)
}
}
}
@@ -89,9 +90,9 @@ export const useSync = () => {
// 创建分组
let groupClass = new PublicGroupConfigClass()
if (changeId) {
groupClass = Object.assign(groupClass, { ...comItem, id: getUUID() })
groupClass = merge(groupClass, { ...comItem, id: getUUID() })
} else {
groupClass = Object.assign(groupClass, comItem)
groupClass = merge(groupClass, comItem)
}
// 注册子应用
@@ -112,7 +113,7 @@ export const useSync = () => {
} else {
// 非组件(顺便排除脏数据)
if (key !== 'editCanvasConfig' && key !== 'requestGlobalConfig') return
Object.assign(chartEditStore[key], projectData[key])
merge(chartEditStore[key], projectData[key])
}
}
}