Skip to content

Commit

Permalink
style: 🎨 格式化
Browse files Browse the repository at this point in the history
  • Loading branch information
17359898647 committed Oct 24, 2023
1 parent 109cd48 commit 7b5ad34
Show file tree
Hide file tree
Showing 62 changed files with 352 additions and 351 deletions.
Binary file modified bun.lockb
Binary file not shown.
1 change: 1 addition & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ export default eslint({
'node_modules',
'src/types/*',
],
sortKeysOptions: true,
})
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"axios": "^1.5.1",
"colord": "^2.9.3",
"drauu": "^0.3.7",
"ge-eslint": "0.0.3",
"ge-eslint": "0.0.5",
"lightningcss": "^1.22.0",
"lodash-es": "^4.17.21",
"naive-ui": "^2.35.0",
Expand Down
4 changes: 2 additions & 2 deletions src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import { useRequest } from '@/composables/useRequest'
console.log(import.meta.env.VITE_BASEURL)
const instance = axios.create({
baseURL: import.meta.env.DEV ? '/api' : import.meta.env.VITE_BASEURL,
timeout: 10000,
headers: {
'content-type': 'application/json',
},
timeout: 10000,
withCredentials: false,
})

Expand Down Expand Up @@ -51,7 +51,7 @@ export type dataFormat<T = any> = T

export type requestFn = <T>(options: useRequestParams<dataFormat<T>>) => useRequestReturn<dataFormat<T>>
export const request: requestFn = options => useRequest(instance, {
retry: 3,
resetOnExecute: false,
retry: 3,
...options,
})
14 changes: 7 additions & 7 deletions src/components/CountTo/CountTo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ import { computed, ref, watch, watchEffect } from 'vue'
defineOptions({ name: 'CountTo' })
const props = withDefaults(defineProps<Props>(), {
startValue: 0,
endValue: new Date().getFullYear(),
duration: 1000,
autoplay: true,
decimal: '.',
decimals: 0,
duration: 1000,
endValue: new Date().getFullYear(),
prefix: '',
suffix: '',
separator: ',',
decimal: '.',
useEasing: true,
startValue: 0,
suffix: '',
transition: 'linear',
useEasing: true,
})
const emit = defineEmits<{
Expand Down Expand Up @@ -60,8 +60,8 @@ function run() {
outputValue = useTransition(source, {
disabled,
duration: props.duration,
onStarted: () => emit('started'),
onFinished: () => emit('finished'),
onStarted: () => emit('started'),
...(props.useEasing ? { transition: TransitionPresets[props.transition] } : {}),
})
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/JsonForm/JsonForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ export function JsonFormHelp(JsonOptions: MaybeRefOrGetter<IJsonType[]>) {
scope.stop()
})
return {
model: ref(extract(_JsonOptions)),
JsonOptions: _JsonOptions,
model: ref(extract(_JsonOptions)),
}
}
export const JsonForm = defineComponent({
Expand Down
14 changes: 7 additions & 7 deletions src/components/JsonForm/JsonFormType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,21 @@ export type IJsonType<T extends IComType = IComType> = T extends infer t ? t ext
: never

export const JsonFormProps = {
jsonOptions: {
type: Array as PropType<IJsonType[]>,
default: () => [],
},
formProps: {
type: Object as PropType<FormProps & GridProps>,
default: () => ({}),
type: Object as PropType<FormProps & GridProps>,
},
jsonOptions: {
default: () => [],
type: Array as PropType<IJsonType[]>,
},
model: {
type: Object as PropType<Record<string, any>>,
default: () => ({}),
type: Object as PropType<Record<string, any>>,
},
rules: {
type: Object as PropType<FormRules>,
default: () => ({}),
type: Object as PropType<FormRules>,
},
}
export type IJsonFormProps = ExtractPropTypes<typeof JsonFormProps>
2 changes: 1 addition & 1 deletion src/components/LoadingView/LoadingView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ export const LoadingView = defineComponent({
name: 'AppLoading',
props: {
isTitle: {
type: String,
default: '',
type: String,
},
},
setup(props) {
Expand Down
38 changes: 19 additions & 19 deletions src/components/RippleButton/RippleButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ function getImmobilizationStyle(el: HTMLElement) {
borderBottomRightRadius,
} = getComputedStyle(el)
return {
borderBottomLeftRadius,
borderBottomRightRadius,
borderTopLeftRadius,
borderTopRightRadius,
height,
left,
top,
width,
height,
borderTopLeftRadius,
borderTopRightRadius,
borderBottomLeftRadius,
borderBottomRightRadius,
}
}
function _createRipple<T extends MaybeElement>(el: MaybeComputedElementRef<T>, event: MouseEvent) {
Expand All @@ -58,27 +58,27 @@ function _createRipple<T extends MaybeElement>(el: MaybeComputedElementRef<T>, e
parendDiv.classList.add('ripple')
const childrenDiv = document.createElement('div')
const childrenStyle = {
position: 'absolute',
width: `${radius}px`,
height: `${radius}px`,
borderRadius: '50%',
backgroundColor: 'rgba(255, 255, 255, .4)',
borderRadius: '50%',
height: `${radius}px`,
left: `${x}px`,
pointerEvents: 'none',
position: 'absolute',
top: `${y}px`,
transformOrigin: 'center',
transform: 'translate(-50%, -50%) scale(10)',
pointerEvents: 'none',
transformOrigin: 'center',
width: `${radius}px`,
} as CSSProperties
const parentStyle = {
position: 'absolute',
width: `${width}px`,
borderBottomLeftRadius,
borderBottomRightRadius,
borderTopLeftRadius,
borderTopRightRadius,
height: `${height}px`,
overflow: 'hidden',
pointerEvents: 'none',
borderTopLeftRadius,
borderTopRightRadius,
borderBottomLeftRadius,
borderBottomRightRadius,
position: 'absolute',
width: `${width}px`,
} as CSSProperties
assign(childrenDiv.style, childrenStyle)
assign(parendDiv.style, parentStyle)
Expand All @@ -87,14 +87,14 @@ function _createRipple<T extends MaybeElement>(el: MaybeComputedElementRef<T>, e
// // 动画
const animate = childrenDiv.animate([
{
transform: 'scale(10)',
borderRadius: '50%',
opacity: 1,
transform: 'scale(10)',
},
{
transform: 'scale(300)',
borderRadius: '50%',
opacity: 0,
transform: 'scale(300)',
},
], {
duration: 1000,
Expand Down
2 changes: 1 addition & 1 deletion src/components/SvgIcon/SvgIcon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ interface IProps {
size?: string | number
}
withDefaults(defineProps<IProps>(), {
size: '1rem',
lineIcon: 'icon-material-symbols:disabled-by-default',
size: '1rem',
})
const emits = defineEmits<{
click: [e: MouseEvent]
Expand Down
2 changes: 1 addition & 1 deletion src/composables/useAutoAnimate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ export function useAutoAnimate<T extends HTMLElement>(config: useAutoAnimateOpti
const _element = unrefElement(element)
if (_element instanceof HTMLElement) {
controller = autoAnimate(_element, {
disrespectUserMotionPreference: true,
duration: 300,
easing: 'ease-in-out',
disrespectUserMotionPreference: true,
...options,
})
}
Expand Down
28 changes: 14 additions & 14 deletions src/composables/useDraw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ export function useDraw(
const shiftPressed = ref(false)

const brush = ref<Brush>({
color: 'black',
size: 3,
arrowEnd: false,
color: 'black',
cornerRadius: 0,
dasharray: undefined,
fill: 'transparent',
mode: 'draw',
size: 3,
...options?.brush,
})

Expand Down Expand Up @@ -123,22 +123,22 @@ export function useDraw(
tryOnScopeDispose(() => cleanup())

return {
drauuInstance,

load,
dump,
clear,
cancel,
undo,
redo,
canUndo,
canRedo,
brush,

canRedo,
canUndo,
cancel,
clear,
drauuInstance,
dump,
load,
onCanceled: onCanceledHook.on,
onChanged: onChangedHook.on,

onCommitted: onCommittedHook.on,
onStart: onStartHook.on,
onEnd: onEndHook.on,
onCanceled: onCanceledHook.on,
onStart: onStartHook.on,
redo,
undo,
}
}
18 changes: 9 additions & 9 deletions src/composables/useRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,12 @@ export function useRequest<T = unknown>(instance: AxiosInstance, options: useReq
const _url = transformParams(url, params)
const axiosConfig = computed(() => {
return {
method: toValue(method),
data: toValue(data),
headers: {
// 'Access-Control-Allow-Origin': '*',
...toValue(headers),
},
data: toValue(data),
method: toValue(method),
onDownloadProgress,
onUploadProgress,
} as AxiosRequestConfig
Expand All @@ -144,28 +144,28 @@ export function useRequest<T = unknown>(instance: AxiosInstance, options: useReq
axiosConfig.value,
instance,
{
initialData: toValue(initialData),
resetOnExecute: toValue(resetOnExecute),
shallow: toValue(shallow),
immediate: toValue(immediate),
initialData: toValue(initialData),
onError: (err) => {
if (isNumber(_retry) && _retry-- > 0 && (err as AxiosError).code !== 'ERR_CANCELED') {
_useAxios.execute(_url.value, axiosConfig.value)
return
}
onError?.(err)
},
onSuccess: (data: T) => {
isSuccessful = true
onSuccess?.(data)
},
onFinish: () => {
if (isNumber(_retry) && _retry >= 0 && !isSuccessful)
return
isSuccessful = false
_retry = toValue(retry)
onFinish?.()
},
onSuccess: (data: T) => {
isSuccessful = true
onSuccess?.(data)
},
resetOnExecute: toValue(resetOnExecute),
shallow: toValue(shallow),
},
)
const scope = effectScope()
Expand Down
10 changes: 5 additions & 5 deletions src/composables/useSort.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ export function useSort<T>(el: MaybeRefOrGetter<HTMLElement | null | undefined>,
} = options || {}
const [isDrag, setDrag] = useToggle(false)
useSortable(el, list, {
onStart: (event) => {
setDrag(true)
onStart?.(event)
},
animation,
onEnd: async (event) => {
// await nextTick()
onEnd?.(event)
Expand All @@ -23,7 +20,10 @@ export function useSort<T>(el: MaybeRefOrGetter<HTMLElement | null | undefined>,
setDrag(false)
}, animation)
},
animation,
onStart: (event) => {
setDrag(true)
onStart?.(event)
},
...e,
})
return {
Expand Down
4 changes: 2 additions & 2 deletions src/composables/useTable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ export function useTable<tableData = Record<string, unknown>>(options: useTableO
const _columns = ref(columns) as Ref<HookTableColumn<tableData>[]>

return {
columns: _columns,
data: _data,
isLoading,
execute,
columns: _columns,
isLoading,
}
}
4 changes: 2 additions & 2 deletions src/layout/BreadCrumbs/helps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ export function createDropdownOptions(breadcrumbs: RouteRecordRaw[]): DropdownOp
const { isHidden, lineIcon, localIcon, isTitle } = meta || {}
if (isUndefined(isHidden)) {
result.push({
children: isUndefined(children) ? undefined : createDropdownOptions(children),
icon: () => (
<SvgIcon
lineIcon={lineIcon}
localIcon={localIcon}
/>
),
label: isTitle,
key: String(name) || path,
children: isUndefined(children) ? undefined : createDropdownOptions(children),
label: isTitle,
})
}
})
Expand Down
4 changes: 2 additions & 2 deletions src/layout/ContentView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ const mainStyle = computed(() => {
? isFooterHeight.value + isContentPadding.value
: isContentPadding.value
}px`,
paddingLeft: `${isContentPadding.value}px`,
paddingRight: `${isContentPadding.value}px`,
paddingTop: `${
isFixedHeader.value
? isHeaderHeight.value + isTagViewHeight.value
: 0
}px`,
paddingLeft: `${isContentPadding.value}px`,
paddingRight: `${isContentPadding.value}px`,
} as CSSProperties
})
</script>
Expand Down
2 changes: 1 addition & 1 deletion src/layout/HKeepAlive/useKeepAliveCacheStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const useKeepAliveCacheStore = defineStore('useKeepAliveCacheStore', () =
}
}
return {
exclude,
delCache,
exclude,
}
})
Loading

0 comments on commit 7b5ad34

Please sign in to comment.