fix: 格式

This commit is contained in:
MTrun 2022-02-04 12:19:02 +08:00
parent abaf8f07ad
commit c3096ed486

@ -32,7 +32,7 @@ export const useChartEditStoreStore = defineStore({
height: 1080, height: 1080,
// 偏移量 // 偏移量
offset: 20, offset: 20,
// 系统控制缩放 // 系统控制缩放
scale: 1, scale: 1,
// 用户控制的缩放 // 用户控制的缩放
userScale: 1, userScale: 1,
@ -112,7 +112,7 @@ export const useChartEditStoreStore = defineStore({
* @param chartData * @param chartData
* @param isEnd * @param isEnd
* @param isHistory * @param isHistory
* @returns * @returns
*/ */
addComponentList(chartData: CreateComponentType, isEnd = false, isHistory = false): void { addComponentList(chartData: CreateComponentType, isEnd = false, isHistory = false): void {
if(isHistory) { if(isHistory) {
@ -159,7 +159,7 @@ export const useChartEditStoreStore = defineStore({
try { try {
loadingStart() loadingStart()
const length = this.getComponentList.length const length = this.getComponentList.length
if(length < 2) { if(length < 2) {
loadingFinish() loadingFinish()
return return
} }
@ -167,7 +167,7 @@ export const useChartEditStoreStore = defineStore({
const index = this.fetchTargetIndex() const index = this.fetchTargetIndex()
if (index !== -1) { if (index !== -1) {
// 置底排除最底层, 置顶排除最顶层 // 置底排除最底层, 置顶排除最顶层
if ((isEnd && index === 0) || (!isEnd && index === length - 1 )) { if ((isEnd && index === 0) || (!isEnd && index === length - 1 )) {
loadingFinish() loadingFinish()
return return
} }
@ -195,7 +195,7 @@ export const useChartEditStoreStore = defineStore({
try { try {
loadingStart() loadingStart()
const length = this.getComponentList.length const length = this.getComponentList.length
if (length < 2) { if (length < 2) {
loadingFinish() loadingFinish()
return return
} }
@ -211,7 +211,7 @@ export const useChartEditStoreStore = defineStore({
const swapIndex = isDown ? index - 1 : index + 1 const swapIndex = isDown ? index - 1 : index + 1
const targetItem = this.getComponentList[index] const targetItem = this.getComponentList[index]
const swapItem = this.getComponentList[swapIndex] const swapItem = this.getComponentList[swapIndex]
chartHistoryStoreStore.createLaryerHistory(targetItem) chartHistoryStoreStore.createLaryerHistory(targetItem)
this.updateComponentList(index, swapItem) this.updateComponentList(index, swapItem)
this.updateComponentList(swapIndex, targetItem) this.updateComponentList(swapIndex, targetItem)
@ -294,7 +294,7 @@ export const useChartEditStoreStore = defineStore({
this.setRecordChart(undefined) this.setRecordChart(undefined)
} }
loadingFinish() loadingFinish()
} catch(value) { } catch(value) {
loadingError() loadingError()
} }
}, },
@ -321,12 +321,12 @@ export const useChartEditStoreStore = defineStore({
this.setBackAndSetForwardHandle(e) this.setBackAndSetForwardHandle(e)
}) })
loadingFinish() loadingFinish()
return return
} }
this.setBackAndSetForwardHandle(targetData) this.setBackAndSetForwardHandle(targetData)
loadingFinish() loadingFinish()
} catch(value) { } catch(value) {
loadingError() loadingError()
} }
}, },
@ -345,12 +345,12 @@ export const useChartEditStoreStore = defineStore({
this.setBackAndSetForwardHandle(e, true) this.setBackAndSetForwardHandle(e, true)
}) })
loadingFinish() loadingFinish()
return return
} }
this.setBackAndSetForwardHandle(targetData, true) this.setBackAndSetForwardHandle(targetData, true)
loadingFinish() loadingFinish()
} catch(value) { } catch(value) {
loadingError() loadingError()
} }
}, },