diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 576eaa3..7fcb48a 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -8,5 +8,10 @@ jobs: MAIN_PULL_REQUEST: runs-on: ubuntu-latest steps: - - uses: actions/install-dep@develop - - run: npm run lint + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: '14' + - run: npm install + shell: bash + - run: npm run lint \ No newline at end of file diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index b0a5ec9..8236c69 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -1,19 +1,27 @@ name: All_ON_PUSH on: push + jobs: All_ON_PUSH: runs-on: ubuntu-latest steps: - - uses: actions/install-dep@develop - - run: echo '${{ github.ref }} ... ${{ github.sha }}'' - - name: build + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: '14' + - run: npm install + shell: bash + - run: echo '${{ github.ref }} ... ${{ github.sha }}' + - name: build-site run: npm run build - - name: upload surge service + - name: upload surge service and generate preview URL id: deploy run: | - export DEPLOY_DOMAIN=https://preview-${{ github.ref }}-tdesign-vue.surge.sh - npx surge --project dist --domain $DEPLOY_DOMAIN --token ${{ secrets.SURGE_TOKEN }} - - run: echo 'https://preview-${{ github.ref }}-tdesign-vue.surge.sh' + export GITHUB_SHA=${{ github.sha }} + export GITHUB_SHA_SUB=${GITHUB_SHA: 0: 7 } + export DEPLOY_DOMAIN=https://preview-$GITHUB_SHA_SUB-tdesign-vue-next-starter.surge.sh + npx surge --project ./dist --domain $DEPLOY_DOMAIN --token ${{ secrets.SURGE_TOKEN }} + echo the preview URL is $DEPLOY_DOMAIN if: ${{ success() }} - - run: echo "🍏 This job's status is ${{ job.status }}." + - run: echo "🚀 This job's status is ${{ job.status }}." \ No newline at end of file diff --git a/globals.d.ts b/globals.d.ts index 4533b3f..743a703 100644 --- a/globals.d.ts +++ b/globals.d.ts @@ -5,7 +5,8 @@ declare interface ImportMeta { env: { MODE: 'mock' | 'development' | 'test' | 'release'; }; - glob: (url: string) => {}; + // eslint-disable-next-line no-unused-vars + glob: (url: string) => { url }; } declare module '*.svg' { diff --git a/package.json b/package.json index 078cded..265a3de 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "start:mock": "vite --open --mode mock", "start": "vite --open --mode development", "build:test": "vite build --mode test", - "build": "vue-tsc --noEmit && vite build", + "build": "vue-tsc --noEmit && vite build --mode release", "preview": "vite preview", "lint": "eslint --ext .vue,.js,.jsx,.ts,.tsx ./ --max-warnings 0", "lint:fix": "eslint --ext .vue,.js,jsx,.ts,.tsx ./ --max-warnings 0 --fix", diff --git a/src/interface.ts b/src/interface.ts index 3a8056d..1fdb229 100644 --- a/src/interface.ts +++ b/src/interface.ts @@ -19,5 +19,5 @@ export type SettingType = typeof STYLE_CONFIG; export type ClassName = { [className: string]: any } | ClassName[] | string; export type CommonObjType = { - [key: string]: string | number -} \ No newline at end of file + [key: string]: string | number; +}; diff --git a/src/pages/dashboard/base/index.ts b/src/pages/dashboard/base/index.ts index d04d79c..6e98dfa 100644 --- a/src/pages/dashboard/base/index.ts +++ b/src/pages/dashboard/base/index.ts @@ -3,6 +3,7 @@ import * as echarts from 'echarts/core'; import { getBrandColor } from '@/config/color'; import store from '@/store'; import { CommonObjType } from '@/interface'; + const { state } = store; /** @@ -177,9 +178,11 @@ export function constructInitDataset(dateTime: Array = []) { // console.log('dateAbsTime..', dateAbsTime, enhandTime); timeArray.push(dayjs(enhandTime).format('YYYY-MM-DD')); } else { - timeArray.push(dayjs() - .subtract(divideNum - i, 'day') - .format('YYYY-MM-DD')); + timeArray.push( + dayjs() + .subtract(divideNum - i, 'day') + .format('YYYY-MM-DD'), + ); } inArray.push(getRandomArray().toString()); diff --git a/src/pages/list/card/components/DialogForm.vue b/src/pages/list/card/components/DialogForm.vue index 223d4d7..ed70baf 100644 --- a/src/pages/list/card/components/DialogForm.vue +++ b/src/pages/list/card/components/DialogForm.vue @@ -59,7 +59,12 @@ export default defineComponent({ type: Boolean, default: false, }, - data: Object, + data: { + type: Object, + default: () => { + return {}; + }, + }, }, setup(props, ctx) { const formVisible = ref(false); diff --git a/src/pages/login/helper.ts b/src/pages/login/helper.ts index 0a52e6e..468c7e0 100644 --- a/src/pages/login/helper.ts +++ b/src/pages/login/helper.ts @@ -6,7 +6,7 @@ export const passwordValidator = (val) => { return { result: false, message: '需包含下划线_', type: 'warning' }; } return { result: true }; -} +}; export const getEmails = (search) => [ { @@ -37,5 +37,5 @@ export const getEmails = (search) => [ export default { passwordValidator, - getEmails -} + getEmails, +}; diff --git a/src/store/modules/notification.ts b/src/store/modules/notification.ts index e986d4f..f4c1659 100644 --- a/src/store/modules/notification.ts +++ b/src/store/modules/notification.ts @@ -1,5 +1,5 @@ // 定义的state初始值 -import { NotificationItem } from '../interface' +import { NotificationItem } from '../interface'; const state = { msgData: [ diff --git a/src/utils/date.ts b/src/utils/date.ts index 7a7581f..bbfa47a 100644 --- a/src/utils/date.ts +++ b/src/utils/date.ts @@ -1,6 +1,12 @@ // 获取常用时间 import dayjs from 'dayjs'; -export const LAST_7_DAYS = [dayjs().subtract(7, 'day').format('YYYY-MM-DD'), dayjs().subtract(1, 'day').format('YYYY-MM-DD')]; +export const LAST_7_DAYS = [ + dayjs().subtract(7, 'day').format('YYYY-MM-DD'), + dayjs().subtract(1, 'day').format('YYYY-MM-DD'), +]; -export const LAST_30_DAYS = [dayjs().subtract(30, 'day').format('YYYY-MM-DD'), dayjs().subtract(1, 'day').format('YYYY-MM-DD')]; +export const LAST_30_DAYS = [ + dayjs().subtract(30, 'day').format('YYYY-MM-DD'), + dayjs().subtract(1, 'day').format('YYYY-MM-DD'), +]; diff --git a/src/utils/hooks.ts b/src/utils/hooks.ts index 2c247d1..90c2b1c 100644 --- a/src/utils/hooks.ts +++ b/src/utils/hooks.ts @@ -38,7 +38,7 @@ export const useChart = (domId: string): Ref => { * @returns */ export const useCounter = (duration = 60): [Ref, () => void] => { - let intervalTimer: NodeJS.Timer; + let intervalTimer; onUnmounted(() => { clearInterval(intervalTimer); }); diff --git a/vite.config.ts b/vite.config.ts index d1ab1c6..dd48b03 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -14,7 +14,6 @@ export default defineConfig({ }, }, - plugins: [ createVuePlugin(), vueJsx(),