diff --git a/src/api/axios.ts b/src/api/axios.ts
index 65ff033c..07860458 100644
--- a/src/api/axios.ts
+++ b/src/api/axios.ts
@@ -1,4 +1,4 @@
-import axios, { AxiosResponse, AxiosRequestConfig } from 'axios'
+import axios, { AxiosResponse, InternalAxiosRequestConfig, AxiosError } from 'axios'
import { ResultEnum } from "@/enums/httpEnum"
import { ErrorPageNameMap } from "@/enums/pageEnum"
import { redirectErrorPage } from '@/utils'
@@ -9,10 +9,10 @@ const axiosInstance = axios.create({
})
axiosInstance.interceptors.request.use(
- (config: AxiosRequestConfig) => {
+ (config: InternalAxiosRequestConfig) => {
return config
},
- (error: AxiosRequestConfig) => {
+ (error: AxiosError) => {
Promise.reject(error)
}
)
diff --git a/src/api/http.ts b/src/api/http.ts
index 0588049d..5da44856 100644
--- a/src/api/http.ts
+++ b/src/api/http.ts
@@ -163,7 +163,6 @@ export const customizeHttp = (targetParams: RequestConfigType, globalParams: Req
params = translateStr(params)
// form 类型处理
let formData: FormData = new FormData()
- formData.set('default', 'defaultData')
// 类型处理
switch (requestParamsBodyType) {
diff --git a/src/components/Pages/ChartItemSetting/GlobalSetting.vue b/src/components/Pages/ChartItemSetting/GlobalSetting.vue
index 81f9d3d7..68e3fb00 100644
--- a/src/components/Pages/ChartItemSetting/GlobalSetting.vue
+++ b/src/components/Pages/ChartItemSetting/GlobalSetting.vue
@@ -391,8 +391,12 @@ const visualMap = computed(() => {
// 监听legend color颜色改变type = scroll的颜色
watch(() => legend.value && legend.value.textStyle.color, (newVal) => {
if (legend.value && newVal) {
- legend.value.pageTextStyle.color = newVal
- }
+ if (!legend.value.pageTextStyle) {
+ legend.value.pageTextStyle = { color: newVal }
+ } else {
+ legend.value.pageTextStyle.color = newVal
+ }
+ }
}, {
immediate: true,
deep: true,
diff --git a/src/components/Pages/ChartItemSetting/StylesSetting.vue b/src/components/Pages/ChartItemSetting/StylesSetting.vue
index 27275449..efb1d653 100644
--- a/src/components/Pages/ChartItemSetting/StylesSetting.vue
+++ b/src/components/Pages/ChartItemSetting/StylesSetting.vue
@@ -69,6 +69,22 @@
+
+
+ (chartStyles.hueRotate = item.hueRotate)"
+ >
+
+
@@ -149,10 +165,12 @@
-
+
diff --git a/src/hooks/useChartDataFetch.hook.ts b/src/hooks/useChartDataFetch.hook.ts
index c39cc34e..91271e8d 100644
--- a/src/hooks/useChartDataFetch.hook.ts
+++ b/src/hooks/useChartDataFetch.hook.ts
@@ -90,12 +90,12 @@ export const useChartDataFetch = (
// 普通初始化与组件交互处理监听
watch(
- () => targetComponent.request,
+ () => targetComponent.request.requestParams,
() => {
fetchFn()
},
{
- immediate: true,
+ immediate: false,
deep: true
}
)
@@ -105,7 +105,11 @@ export const useChartDataFetch = (
// 单位
const unit = targetInterval && targetInterval.value ? targetUnit.value : globalUnit.value
// 开启轮询
- if (time) fetchInterval = setInterval(fetchFn, intervalUnitHandle(time, unit))
+ if (time) {
+ fetchInterval = setInterval(fetchFn, intervalUnitHandle(time, unit))
+ } else {
+ fetchFn()
+ }
}
// eslint-disable-next-line no-empty
} catch (error) {
@@ -114,10 +118,11 @@ export const useChartDataFetch = (
}
if (isPreview()) {
- // 判断是否是数据池类型
targetComponent.request.requestDataType === RequestDataTypeEnum.Pond
? addGlobalDataInterface(targetComponent, useChartEditStore, updateCallback || echartsUpdateHandle)
: requestIntervalFn()
+ } else {
+ requestIntervalFn()
}
return { vChartRef }
}
diff --git a/src/hooks/useChartDataPondFetch.hook.ts b/src/hooks/useChartDataPondFetch.hook.ts
index 24ac7660..a506f274 100644
--- a/src/hooks/useChartDataPondFetch.hook.ts
+++ b/src/hooks/useChartDataPondFetch.hook.ts
@@ -1,4 +1,4 @@
-import { toRaw } from 'vue'
+import { toRaw, watch, computed, ComputedRef } from 'vue'
import { customizeHttp } from '@/api/http'
import { CreateComponentType } from '@/packages/index.d'
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
@@ -20,7 +20,7 @@ const mittDataPondMap = new Map()
// 创建单个数据项轮询接口
const newPondItemInterval = (
requestGlobalConfig: RequestGlobalConfigType,
- requestDataPondItem: RequestDataPondItemType,
+ requestDataPondItem: ComputedRef,
dataPondMapItem?: DataPondMapType[]
) => {
if (!dataPondMapItem) return
@@ -31,8 +31,7 @@ const newPondItemInterval = (
// 请求
const fetchFn = async () => {
try {
- const res = await customizeHttp(toRaw(requestDataPondItem.dataPondRequestConfig), toRaw(requestGlobalConfig))
-
+ const res = await customizeHttp(toRaw(requestDataPondItem.value.dataPondRequestConfig), toRaw(requestGlobalConfig))
if (res) {
try {
// 遍历更新回调函数
@@ -49,19 +48,32 @@ const newPondItemInterval = (
}
}
+ watch(
+ () => requestDataPondItem.value.dataPondRequestConfig.requestParams.Params,
+ () => {
+ fetchFn()
+ },
+ {
+ immediate: false,
+ deep: true
+ }
+ )
+
+
// 立即调用
fetchFn()
- const targetInterval = requestDataPondItem.dataPondRequestConfig.requestInterval
- const targetUnit = requestDataPondItem.dataPondRequestConfig.requestIntervalUnit
+
+ const targetInterval = requestDataPondItem.value.dataPondRequestConfig.requestInterval
+ const targetUnit = requestDataPondItem.value.dataPondRequestConfig.requestIntervalUnit
const globalRequestInterval = requestGlobalConfig.requestInterval
const globalUnit = requestGlobalConfig.requestIntervalUnit
// 定时时间
- const time = targetInterval ? targetInterval : globalRequestInterval
+ const time = targetInterval ? targetInterval : globalRequestInterval
// 单位
- const unit = targetInterval ? targetUnit : globalUnit
+ const unit = targetInterval ? targetUnit : globalUnit
// 开启轮询
if (time) fetchInterval = setInterval(fetchFn, intervalUnitHandle(time, unit))
}
@@ -96,13 +108,16 @@ export const useChartDataPondFetch = () => {
}
// 初始化数据池
- const initDataPond = (requestGlobalConfig: RequestGlobalConfigType) => {
- const { requestDataPond } = requestGlobalConfig
+ const initDataPond = (useChartEditStore: ChartEditStoreType) => {
+ const { requestGlobalConfig } = useChartEditStore()
+ const chartEditStore = useChartEditStore()
// 根据 mapId 查找对应的数据池配置
for (let pondKey of mittDataPondMap.keys()) {
- const requestDataPondItem = requestDataPond.find(item => item.dataPondId === pondKey)
+ const requestDataPondItem = computed(() => {
+ return requestGlobalConfig.requestDataPond.find(item => item.dataPondId === pondKey)
+ }) as ComputedRef
if (requestDataPondItem) {
- newPondItemInterval(requestGlobalConfig, requestDataPondItem, mittDataPondMap.get(pondKey))
+ newPondItemInterval(chartEditStore.requestGlobalConfig, requestDataPondItem, mittDataPondMap.get(pondKey))
}
}
}
diff --git a/src/hooks/useChartInteract.hook.ts b/src/hooks/useChartInteract.hook.ts
index efa2ae73..dce0d25b 100644
--- a/src/hooks/useChartInteract.hook.ts
+++ b/src/hooks/useChartInteract.hook.ts
@@ -1,4 +1,5 @@
import { toRefs } from 'vue'
+import { isPreview } from '@/utils'
import { CreateComponentType } from '@/packages/index.d'
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
@@ -12,6 +13,7 @@ export const useChartInteract = (
param: { [T: string]: any },
interactEventOn: string
) => {
+ if (!isPreview()) return
const chartEditStore = useChartEditStore()
const { interactEvents } = chartConfig.events
const fnOnEvent = interactEvents.filter(item => {
@@ -20,20 +22,37 @@ export const useChartInteract = (
if (fnOnEvent.length === 0) return
fnOnEvent.forEach(item => {
- const index = chartEditStore.fetchTargetIndex(item.interactComponentId)
- if (index === -1) return
- const { Params, Header } = toRefs(chartEditStore.componentList[index].request.requestParams)
- Object.keys(item.interactFn).forEach(key => {
- if (Params.value[key]) {
- Params.value[key] = param[item.interactFn[key]]
- }
- if (Header.value[key]) {
- Header.value[key] = param[item.interactFn[key]]
- }
- })
+
+ const globalConfigPindAprndex = chartEditStore.requestGlobalConfig.requestDataPond.findIndex(cItem =>
+ cItem.dataPondId === item.interactComponentId
+ )
+ if (globalConfigPindAprndex !== -1) {
+ const { Params, Header } = toRefs(chartEditStore.requestGlobalConfig.requestDataPond[globalConfigPindAprndex].dataPondRequestConfig.requestParams)
+
+ Object.keys(item.interactFn).forEach(key => {
+ if (key in Params.value) {
+ Params.value[key] = param[item.interactFn[key]]
+ }
+ if (key in Header.value) {
+ Header.value[key] = param[item.interactFn[key]]
+ }
+ })
+ } else {
+ const index = chartEditStore.fetchTargetIndex(item.interactComponentId)
+ if (index === -1) return
+ const { Params, Header } = toRefs(chartEditStore.componentList[index].request.requestParams)
+
+ Object.keys(item.interactFn).forEach(key => {
+ if (key in Params.value) {
+ Params.value[key] = param[item.interactFn[key]]
+ }
+ if (key in Header.value) {
+ Header.value[key] = param[item.interactFn[key]]
+ }
+ })
+ }
})
}
-
// 联动事件触发的 type 变更时,清除当前绑定内容
export const clearInteractEvent = (chartConfig: CreateComponentType) => {
diff --git a/src/hooks/usePreviewScale.hook.ts b/src/hooks/usePreviewScale.hook.ts
index 066f6b66..9d8bcb78 100644
--- a/src/hooks/usePreviewScale.hook.ts
+++ b/src/hooks/usePreviewScale.hook.ts
@@ -1,218 +1,218 @@
-import throttle from 'lodash/throttle'
-
-// 拆出来是为了更好的分离单独复用
-
-// * 屏幕缩放适配(两边留白)
-export const usePreviewFitScale = (
- width: number,
- height: number,
- scaleDom: HTMLElement | null,
- callback?: (scale: {
- width: number;
- height: number;
- }) => void
-) => {
- // * 画布尺寸(px)
- const baseWidth = width
- const baseHeight = height
-
- // * 默认缩放值
- const scale = {
- width: 1,
- height: 1,
- }
-
- // * 需保持的比例
- const baseProportion = parseFloat((baseWidth / baseHeight).toFixed(5))
- const calcRate = () => {
- // 当前屏幕宽高比
- const currentRate = parseFloat(
- (window.innerWidth / window.innerHeight).toFixed(5)
- )
- if (scaleDom) {
- if (currentRate > baseProportion) {
- // 表示更宽
- scale.width = parseFloat(((window.innerHeight * baseProportion) / baseWidth).toFixed(5))
- scale.height = parseFloat((window.innerHeight / baseHeight).toFixed(5))
- scaleDom.style.transform = `scale(${scale.width}, ${scale.height})`
- } else {
- // 表示更高
- scale.height = parseFloat(((window.innerWidth / baseProportion) / baseHeight).toFixed(5))
- scale.width = parseFloat((window.innerWidth / baseWidth).toFixed(5))
- scaleDom.style.transform = `scale(${scale.width}, ${scale.height})`
- }
- if (callback) callback(scale)
- }
- }
-
- const resize = throttle(() => {
- calcRate()
- }, 200)
-
- // * 改变窗口大小重新绘制
- const windowResize = () => {
- window.addEventListener('resize', resize)
- }
-
- // * 改变窗口大小重新绘制
- const unWindowResize = () => {
- window.removeEventListener('resize', resize)
- }
-
- return {
- calcRate,
- windowResize,
- unWindowResize,
- }
-}
-
-// * X轴撑满,Y轴滚动条
-export const usePreviewScrollYScale = (
- width: number,
- height: number,
- scaleDom: HTMLElement | null,
- callback?: (scale: {
- width: number;
- height: number;
- }) => void
-) => {
- // * 画布尺寸(px)
- const baseWidth = width
- const baseHeight = height
-
- // * 默认缩放值
- const scale = {
- width: 1,
- height: 1,
- }
-
- // * 需保持的比例
- const baseProportion = parseFloat((baseWidth / baseHeight).toFixed(5))
- const calcRate = () => {
- if (scaleDom) {
- scale.height = parseFloat(((window.innerWidth / baseProportion) / baseHeight).toFixed(5))
- scale.width = parseFloat((window.innerWidth / baseWidth).toFixed(5))
- scaleDom.style.transform = `scale(${scale.width}, ${scale.height})`
- if (callback) callback(scale)
- }
- }
-
- const resize = throttle(() => {
- calcRate()
- }, 200)
-
- // * 改变窗口大小重新绘制
- const windowResize = () => {
- window.addEventListener('resize', resize)
- }
-
- // * 改变窗口大小重新绘制
- const unWindowResize = () => {
- window.removeEventListener('resize', resize)
- }
-
- return {
- calcRate,
- windowResize,
- unWindowResize,
- }
-}
-
-// * Y轴撑满,X轴滚动条
-export const usePreviewScrollXScale = (
- width: number,
- height: number,
- scaleDom: HTMLElement | null,
- callback?: (scale: {
- width: number;
- height: number;
- }) => void
-) => {
- // * 画布尺寸(px)
- const baseWidth = width
- const baseHeight = height
-
- // * 默认缩放值
- const scale = {
- height: 1,
- width: 1,
- }
-
- // * 需保持的比例
- const baseProportion = parseFloat((baseWidth / baseHeight).toFixed(5))
- const calcRate = () => {
- if (scaleDom) {
- scale.width = parseFloat(((window.innerHeight * baseProportion) / baseWidth).toFixed(5))
- scale.height = parseFloat((window.innerHeight / baseHeight).toFixed(5))
- scaleDom.style.transform = `scale(${scale.width}, ${scale.height})`
- if (callback) callback(scale)
- }
- }
-
- const resize = throttle(() => {
- calcRate()
- }, 200)
-
- // * 改变窗口大小重新绘制
- const windowResize = () => {
- window.addEventListener('resize', resize)
- }
-
- // * 改变窗口大小重新绘制
- const unWindowResize = () => {
- window.removeEventListener('resize', resize)
- }
-
- return {
- calcRate,
- windowResize,
- unWindowResize,
- }
-}
-
-// * 变形内容,宽高铺满
-export const usePreviewFullScale = (
- width: number,
- height: number,
- scaleDom: HTMLElement | null,
- callback?: (scale: {
- width: number;
- height: number;
- }) => void
-) => {
-
- // * 默认缩放值
- const scale = {
- width: 1,
- height: 1,
- }
-
- const calcRate = () => {
- if (scaleDom) {
- scale.width = parseFloat((window.innerWidth / width).toFixed(5))
- scale.height = parseFloat((window.innerHeight / height).toFixed(5))
- scaleDom.style.transform = `scale(${scale.width}, ${scale.height})`
- if (callback) callback(scale)
- }
- }
-
- const resize = throttle(() => {
- calcRate()
- }, 200)
-
- // * 改变窗口大小重新绘制
- const windowResize = () => {
- window.addEventListener('resize', resize)
- }
-
- // * 改变窗口大小重新绘制
- const unWindowResize = () => {
- window.removeEventListener('resize', resize)
- }
-
- return {
- calcRate,
- windowResize,
- unWindowResize,
- }
+import throttle from 'lodash/throttle'
+
+// 拆出来是为了更好的分离单独复用
+
+// * 屏幕缩放适配(两边留白)
+export const usePreviewFitScale = (
+ width: number,
+ height: number,
+ scaleDom: HTMLElement | null,
+ callback?: (scale: {
+ width: number;
+ height: number;
+ }) => void
+) => {
+ // * 画布尺寸(px)
+ const baseWidth = width
+ const baseHeight = height
+
+ // * 默认缩放值
+ const scale = {
+ width: 1,
+ height: 1,
+ }
+
+ // * 需保持的比例
+ const baseProportion = parseFloat((baseWidth / baseHeight).toFixed(5))
+ const calcRate = () => {
+ // 当前屏幕宽高比
+ const currentRate = parseFloat(
+ (window.innerWidth / window.innerHeight).toFixed(5)
+ )
+ if (scaleDom) {
+ if (currentRate > baseProportion) {
+ // 表示更宽
+ scale.width = parseFloat(((window.innerHeight * baseProportion) / baseWidth).toFixed(5))
+ scale.height = parseFloat((window.innerHeight / baseHeight).toFixed(5))
+ scaleDom.style.transform = `scale(${scale.width}, ${scale.height})`
+ } else {
+ // 表示更高
+ scale.height = parseFloat(((window.innerWidth / baseProportion) / baseHeight).toFixed(5))
+ scale.width = parseFloat((window.innerWidth / baseWidth).toFixed(5))
+ scaleDom.style.transform = `scale(${scale.width}, ${scale.height})`
+ }
+ if (callback) callback(scale)
+ }
+ }
+
+ const resize = throttle(() => {
+ calcRate()
+ }, 200)
+
+ // * 改变窗口大小重新绘制
+ const windowResize = () => {
+ window.addEventListener('resize', resize)
+ }
+
+ // * 卸载监听
+ const unWindowResize = () => {
+ window.removeEventListener('resize', resize)
+ }
+
+ return {
+ calcRate,
+ windowResize,
+ unWindowResize,
+ }
+}
+
+// * X轴撑满,Y轴滚动条
+export const usePreviewScrollYScale = (
+ width: number,
+ height: number,
+ scaleDom: HTMLElement | null,
+ callback?: (scale: {
+ width: number;
+ height: number;
+ }) => void
+) => {
+ // * 画布尺寸(px)
+ const baseWidth = width
+ const baseHeight = height
+
+ // * 默认缩放值
+ const scale = {
+ width: 1,
+ height: 1,
+ }
+
+ // * 需保持的比例
+ const baseProportion = parseFloat((baseWidth / baseHeight).toFixed(5))
+ const calcRate = () => {
+ if (scaleDom) {
+ scale.height = parseFloat(((window.innerWidth / baseProportion) / baseHeight).toFixed(5))
+ scale.width = parseFloat((window.innerWidth / baseWidth).toFixed(5))
+ scaleDom.style.transform = `scale(${scale.width}, ${scale.height})`
+ if (callback) callback(scale)
+ }
+ }
+
+ const resize = throttle(() => {
+ calcRate()
+ }, 200)
+
+ // * 改变窗口大小重新绘制
+ const windowResize = () => {
+ window.addEventListener('resize', resize)
+ }
+
+ // * 卸载监听
+ const unWindowResize = () => {
+ window.removeEventListener('resize', resize)
+ }
+
+ return {
+ calcRate,
+ windowResize,
+ unWindowResize,
+ }
+}
+
+// * Y轴撑满,X轴滚动条
+export const usePreviewScrollXScale = (
+ width: number,
+ height: number,
+ scaleDom: HTMLElement | null,
+ callback?: (scale: {
+ width: number;
+ height: number;
+ }) => void
+) => {
+ // * 画布尺寸(px)
+ const baseWidth = width
+ const baseHeight = height
+
+ // * 默认缩放值
+ const scale = {
+ height: 1,
+ width: 1,
+ }
+
+ // * 需保持的比例
+ const baseProportion = parseFloat((baseWidth / baseHeight).toFixed(5))
+ const calcRate = () => {
+ if (scaleDom) {
+ scale.width = parseFloat(((window.innerHeight * baseProportion) / baseWidth).toFixed(5))
+ scale.height = parseFloat((window.innerHeight / baseHeight).toFixed(5))
+ scaleDom.style.transform = `scale(${scale.width}, ${scale.height})`
+ if (callback) callback(scale)
+ }
+ }
+
+ const resize = throttle(() => {
+ calcRate()
+ }, 200)
+
+ // * 改变窗口大小重新绘制
+ const windowResize = () => {
+ window.addEventListener('resize', resize)
+ }
+
+ // * 卸载监听
+ const unWindowResize = () => {
+ window.removeEventListener('resize', resize)
+ }
+
+ return {
+ calcRate,
+ windowResize,
+ unWindowResize,
+ }
+}
+
+// * 变形内容,宽高铺满
+export const usePreviewFullScale = (
+ width: number,
+ height: number,
+ scaleDom: HTMLElement | null,
+ callback?: (scale: {
+ width: number;
+ height: number;
+ }) => void
+) => {
+
+ // * 默认缩放值
+ const scale = {
+ width: 1,
+ height: 1,
+ }
+
+ const calcRate = () => {
+ if (scaleDom) {
+ scale.width = parseFloat((window.innerWidth / width).toFixed(5))
+ scale.height = parseFloat((window.innerHeight / height).toFixed(5))
+ scaleDom.style.transform = `scale(${scale.width}, ${scale.height})`
+ if (callback) callback(scale)
+ }
+ }
+
+ const resize = throttle(() => {
+ calcRate()
+ }, 200)
+
+ // * 改变窗口大小重新绘制
+ const windowResize = () => {
+ window.addEventListener('resize', resize)
+ }
+
+ // * 卸载监听
+ const unWindowResize = () => {
+ window.removeEventListener('resize', resize)
+ }
+
+ return {
+ calcRate,
+ windowResize,
+ unWindowResize,
+ }
}
\ No newline at end of file
diff --git a/src/i18n/en/project.ts b/src/i18n/en/project.ts
index 3b7d367b..6695cd5e 100644
--- a/src/i18n/en/project.ts
+++ b/src/i18n/en/project.ts
@@ -1,5 +1,5 @@
export default {
- create_btn: 'Creat',
+ create_btn: 'Create',
create_tip: 'Please select a content for development',
project: 'Project',
my: 'My',
diff --git a/src/packages/components/Charts/Pies/PieCircle/config.vue b/src/packages/components/Charts/Pies/PieCircle/config.vue
index a3206946..f343aa23 100644
--- a/src/packages/components/Charts/Pies/PieCircle/config.vue
+++ b/src/packages/components/Charts/Pies/PieCircle/config.vue
@@ -7,6 +7,22 @@
+
+
+
+
+
+
+
+
+
+
@@ -31,24 +47,8 @@
>
-
-
-
-
-
-
-
-
-
-
-
+
@@ -69,6 +69,18 @@
v-model:value="item.data[1].itemStyle.shadowColor"
>
+
+
+
diff --git a/src/packages/components/Charts/Pies/PieCircle/index.vue b/src/packages/components/Charts/Pies/PieCircle/index.vue
index 26bda2a7..bf6250cd 100644
--- a/src/packages/components/Charts/Pies/PieCircle/index.vue
+++ b/src/packages/components/Charts/Pies/PieCircle/index.vue
@@ -41,7 +41,7 @@ const option = reactive({
const dataHandle = (newData: any) => {
const d = parseFloat(`${newData}`) * 100
let config = props.chartConfig.option
- config.title.text = d.toFixed(2) + '%'
+ config.title.text = `${+d.toFixed(2)}%`
config.series[0].data[0].value[0] = d
config.series[0].data[1].value[0] = 100 - d
option.value = mergeTheme(props.chartConfig.option, props.themeSetting, includes)
@@ -68,7 +68,7 @@ watch(
useChartDataFetch(props.chartConfig, useChartEditStore, (resData: number) => {
let d = parseFloat(`${resData}`) * 100
// @ts-ignore
- option.value.title.text = d.toFixed(2) + '%'
+ option.value.title.text = `${+d.toFixed(2)}%`
// @ts-ignore
option.value.series[0].data[0].value[0] = d
// @ts-ignore
diff --git a/src/packages/components/Decorates/Mores/FlipperNumber/index.vue b/src/packages/components/Decorates/Mores/FlipperNumber/index.vue
index 9e5c0ca2..0c4ae010 100644
--- a/src/packages/components/Decorates/Mores/FlipperNumber/index.vue
+++ b/src/packages/components/Decorates/Mores/FlipperNumber/index.vue
@@ -63,7 +63,7 @@ watch(
() => props.chartConfig.option,
newVal => {
try {
- updateDatasetHandler((newVal as OptionType).dataset)
+ updateDatasetHandler((newVal as any as OptionType).dataset)
} catch (error) {
console.log(error)
}
diff --git a/src/packages/components/Informations/Inputs/InputsDate/config.ts b/src/packages/components/Informations/Inputs/InputsDate/config.ts
old mode 100644
new mode 100755
index e8f1d233..02b639c6
--- a/src/packages/components/Informations/Inputs/InputsDate/config.ts
+++ b/src/packages/components/Informations/Inputs/InputsDate/config.ts
@@ -4,7 +4,7 @@ import { PublicConfigClass } from '@/packages/public'
import { CreateComponentType } from '@/packages/index.d'
import { chartInitConfig } from '@/settings/designSetting'
import { COMPONENT_INTERACT_EVENT_KET } from '@/enums/eventEnum'
-import { interactActions, ComponentInteractEventEnum } from './interact'
+import { interactActions, ComponentInteractEventEnum, DefaultTypeEnum, DifferUnitEnum } from './interact'
import { InputsDateConfig } from './index'
export const option = {
@@ -12,9 +12,14 @@ export const option = {
[COMPONENT_INTERACT_EVENT_KET]: ComponentInteractEventEnum.DATE,
// 下拉展示
isPanel: 0,
- dataset: dayjs().valueOf(),
- differValue: 0
-
+ // 默认值
+ dataset: dayjs().valueOf() as number | number[] | null,
+ // 默认值类型
+ defaultType: DefaultTypeEnum.STATIC,
+ // 动态默认值偏移单位
+ differUnit: [DifferUnitEnum.DAY, DifferUnitEnum.DAY],
+ // 动态默认值偏移值
+ differValue: [0, 0]
}
export default class Config extends PublicConfigClass implements CreateComponentType {
diff --git a/src/packages/components/Informations/Inputs/InputsDate/config.vue b/src/packages/components/Informations/Inputs/InputsDate/config.vue
old mode 100644
new mode 100755
index 0d806518..228fa494
--- a/src/packages/components/Informations/Inputs/InputsDate/config.vue
+++ b/src/packages/components/Informations/Inputs/InputsDate/config.vue
@@ -8,39 +8,67 @@
-
+
-
-
-
+
+
+
+
-
+
+
+
+
+
+
+
- 动态
+
- 动态值不为0时,默认值:取当天时间相加当前值
+ 打开页面时浏览器操作系统的系统时间+偏移量(单位)
-
- 天
-
+
+
+
+ {{DifferUnitObject[optionData.differUnit[0]]}}
+
+
+
+
+
+
+
+
+
+ {{DifferUnitObject[optionData.differUnit[1]]}}
+
+
+
+
+
+
+
diff --git a/src/packages/components/Informations/Inputs/InputsDate/index.vue b/src/packages/components/Informations/Inputs/InputsDate/index.vue
old mode 100644
new mode 100755
index 3800590f..a8e16bc1
--- a/src/packages/components/Informations/Inputs/InputsDate/index.vue
+++ b/src/packages/components/Informations/Inputs/InputsDate/index.vue
@@ -1,6 +1,7 @@