Skip to content

Commit

Permalink
refactor: code reformatted
Browse files Browse the repository at this point in the history
  • Loading branch information
tikazyq committed Jun 18, 2024
1 parent c1f00d9 commit 45720bd
Show file tree
Hide file tree
Showing 538 changed files with 8,198 additions and 6,505 deletions.
12 changes: 12 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"semi": true,
"trailingComma": "es5",
"singleQuote": true,
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"bracketSpacing": true,
"jsxBracketSameLine": false,
"arrowParens": "avoid",
"endOfLine": "lf"
}
8 changes: 0 additions & 8 deletions .prettierrc.js

This file was deleted.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@
"jest": "^28.1.1",
"klaw-sync": "^6.0.0",
"node-sass": "^8.0.0",
"prettier": "^3.3.2",
"rd": "^2.0.1",
"rollup-plugin-external-globals": "^0.8.0",
"rollup-plugin-visualizer": "^5.9.2",
Expand Down
12 changes: 11 additions & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 18 additions & 14 deletions src/admin/umeng.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import useRequest from '@/services/request';

const {
get,
} = useRequest();
const { get } = useRequest();

export const initUmeng = async () => {
// import umeng.js
Expand All @@ -11,23 +9,25 @@ export const initUmeng = async () => {
if (localStorage.getItem('useStats') !== '0') {
const res = await get('/version');
const version = res.data;
const {aplus_queue} = window;
const { aplus_queue } = window;

// set meta info
aplus_queue.push({
action: 'aplus.setMetaInfo',
arguments: ['globalproperty', {version}, 'OVERWRITE'],
arguments: ['globalproperty', { version }, 'OVERWRITE'],
});

// send pv
window.aplus_queue.push({
action: 'aplus.sendPV',
arguments: [{is_auto: true}, {}]
arguments: [{ is_auto: true }, {}],
});
}
};

export const getEventParamsWrapped = (eventParams?: TrackEventParams): TrackEventParamsWrapped => {
export const getEventParamsWrapped = (
eventParams?: TrackEventParams
): TrackEventParamsWrapped => {
if (!eventParams) return {};
const res: TrackEventParamsWrapped = {};
Object.keys(eventParams).forEach(key => {
Expand All @@ -41,19 +41,23 @@ export const getEventParamsWrapped = (eventParams?: TrackEventParams): TrackEven
return res;
};

export const sendEvent = (eventCode: string, eventParams?: TrackEventParams, eventType?: TrackEventType) => {
export const sendEvent = (
eventCode: string,
eventParams?: TrackEventParams,
eventType?: TrackEventType
) => {
window.aplus_queue?.push({
action: 'aplus.record',
arguments: [eventCode, eventType || 'CLK', getEventParamsWrapped(eventParams)],
arguments: [
eventCode,
eventType || 'CLK',
getEventParamsWrapped(eventParams),
],
});
};

export const wrapTrack = (payload: TrackSendEventPayload, func: Function) => {
const {
eventCode,
eventParams,
eventType,
} = payload;
const { eventCode, eventParams, eventType } = payload;
sendEvent(eventCode, eventParams, eventType);
func();
};
17 changes: 12 additions & 5 deletions src/assets/js/clarity.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
(function(c,l,a,r,i,t,y){
c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
})(window, document, "clarity", "script", "htjm67dldb");
(function (c, l, a, r, i, t, y) {
c[a] =
c[a] ||
function () {
(c[a].q = c[a].q || []).push(arguments);
};
t = l.createElement(r);
t.async = 1;
t.src = 'https://www.clarity.ms/tag/' + i;
y = l.getElementsByTagName(r)[0];
y.parentNode.insertBefore(t, y);
})(window, document, 'clarity', 'script', 'htjm67dldb');
2 changes: 1 addition & 1 deletion src/assets/js/svg/logo-icon-white.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/assets/js/svg/logo-icon.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/assets/js/svg/logo-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/assets/js/svg/logo-white.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/assets/js/svg/logo.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 10 additions & 9 deletions src/assets/js/umeng.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
(function (w, d, s, q, i) {
w[q] = w[q] || []
var f = d.getElementsByTagName(s)[0], j = d.createElement(s)
j.async = true
j.id = 'beacon-aplus'
j.src = 'https://d.alicdn.com/alilog/mlog/aplus/' + i + '.js'
f.parentNode.insertBefore(j, f)
w[q] = w[q] || [];
var f = d.getElementsByTagName(s)[0],
j = d.createElement(s);
j.async = true;
j.id = 'beacon-aplus';
j.src = 'https://d.alicdn.com/alilog/mlog/aplus/' + i + '.js';
f.parentNode.insertBefore(j, f);
})(window, document, 'script', 'aplus_queue', '203467608');

(async function () {
window.aplus_queue.push({
action: 'aplus.setMetaInfo',
arguments: ['appKey', '617b5871e014255fcb618f6f']
})
})()
arguments: ['appKey', '617b5871e014255fcb618f6f'],
});
})();
17 changes: 5 additions & 12 deletions src/components/button/Button.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
<template>
<el-tooltip :content="tooltip" :disabled="!tooltip">
<span
:id="id"
:class="cls"
>
<span :id="id" :class="cls">
<el-button
:circle="circle"
:disabled="disabled"
Expand All @@ -22,7 +19,7 @@
</template>

<script lang="ts">
import {computed, defineComponent, PropType} from 'vue';
import { computed, defineComponent, PropType } from 'vue';
export const buttonProps = {
tooltip: {
Expand Down Expand Up @@ -89,15 +86,11 @@ export const buttonProps = {
export default defineComponent({
name: 'Button',
props: buttonProps,
emits: [
'click',
],
emits: ['click'],
setup(props: ButtonProps) {
const cls = computed<string>(() => {
const {noMargin, className, isIcon} = props;
const classes = [
'button-wrapper',
];
const { noMargin, className, isIcon } = props;
const classes = ['button-wrapper'];
if (noMargin) classes.push('no-margin');
if (isIcon) classes.push('icon-button');
if (className) classes.push(className);
Expand Down
18 changes: 7 additions & 11 deletions src/components/button/FaIconButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@
:class-name="cls"
@click="() => $emit('click')"
>
<font-awesome-icon :icon="icon" :spin="spin"/>
<font-awesome-icon :icon="icon" :spin="spin" />
<div v-if="badgeIcon" class="badge-icon">
<font-awesome-icon :icon="badgeIcon"/>
<font-awesome-icon :icon="badgeIcon" />
</div>
</cl-button>
</template>

<script lang="ts">
import {computed, defineComponent, PropType} from 'vue';
import {buttonProps} from './Button.vue';
import { computed, defineComponent, PropType } from 'vue';
import { buttonProps } from './Button.vue';
export const faIconButtonProps = {
icon: {
Expand All @@ -42,15 +42,11 @@ export const faIconButtonProps = {
export default defineComponent({
name: 'FaIconButton',
props: faIconButtonProps,
emits: [
'click',
],
emits: ['click'],
setup(props: FaIconButtonProps) {
const cls = computed<string>(() => {
const {className} = props;
const classes = [
'fa-icon-button',
];
const { className } = props;
const classes = ['fa-icon-button'];
if (className) classes.push(className);
return classes.join(' ');
});
Expand Down
12 changes: 4 additions & 8 deletions src/components/button/IconButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
</template>

<script lang="ts">
import {defineComponent} from 'vue';
import {buttonProps} from '@/components/button/Button.vue';
import { defineComponent } from 'vue';
import { buttonProps } from '@/components/button/Button.vue';
export const iconButtonProps = {
icon: {
Expand All @@ -33,15 +33,11 @@ export const iconButtonProps = {
export default defineComponent({
name: 'IconButton',
props: iconButtonProps,
emits: [
'click',
],
emits: ['click'],
setup() {
return {};
},
});
</script>

<style lang="scss" scoped>
</style>
<style lang="scss" scoped></style>
17 changes: 7 additions & 10 deletions src/components/button/LabelButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
:loading="loading"
@click="() => $emit('click')"
>
<font-awesome-icon v-if="icon" :icon="icon" class="icon"/>
<font-awesome-icon v-if="icon" :icon="icon" class="icon" />
{{ label }}
</cl-button>
</template>

<script lang="ts">
import {defineComponent, PropType} from 'vue';
import {buttonProps} from '@/components/button/Button.vue';
import { defineComponent, PropType } from 'vue';
import { buttonProps } from '@/components/button/Button.vue';
export default defineComponent({
name: 'LabelButton',
Expand All @@ -32,16 +32,13 @@ export default defineComponent({
type: String,
required: true,
},
...buttonProps
...buttonProps,
},
emits: [
'click',
],
setup(props: LabelButtonProps, {emit}) {
emits: ['click'],
setup(props: LabelButtonProps, { emit }) {
return {};
},
});
</script>

<style lang="scss" scoped>
</style>
<style lang="scss" scoped></style>
Loading

0 comments on commit 45720bd

Please sign in to comment.