fix/githubaction/config (#14)

* fix: githubactions config

* fix: update build env

* fix: remove cache

Co-authored-by: ivringpeng <pengyue970725@gmail.com>
This commit is contained in:
PY 2021-12-06 22:53:37 +08:00 committed by GitHub
parent 4e0b787829
commit 86f73de893
12 changed files with 53 additions and 26 deletions

View File

@ -8,5 +8,10 @@ jobs:
MAIN_PULL_REQUEST:
runs-on: ubuntu-latest
steps:
- uses: actions/install-dep@develop
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
- run: npm install
shell: bash
- run: npm run lint

View File

@ -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 }}."

3
globals.d.ts vendored
View File

@ -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' {

View File

@ -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",

View File

@ -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
}
[key: string]: string | number;
};

View File

@ -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<string> = []) {
// console.log('dateAbsTime..', dateAbsTime, enhandTime);
timeArray.push(dayjs(enhandTime).format('YYYY-MM-DD'));
} else {
timeArray.push(dayjs()
timeArray.push(
dayjs()
.subtract(divideNum - i, 'day')
.format('YYYY-MM-DD'));
.format('YYYY-MM-DD'),
);
}
inArray.push(getRandomArray().toString());

View File

@ -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);

View File

@ -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,
};

View File

@ -1,5 +1,5 @@
// 定义的state初始值
import { NotificationItem } from '../interface'
import { NotificationItem } from '../interface';
const state = {
msgData: [

View File

@ -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'),
];

View File

@ -38,7 +38,7 @@ export const useChart = (domId: string): Ref<echarts.ECharts> => {
* @returns
*/
export const useCounter = (duration = 60): [Ref<number>, () => void] => {
let intervalTimer: NodeJS.Timer;
let intervalTimer;
onUnmounted(() => {
clearInterval(intervalTimer);
});

View File

@ -14,7 +14,6 @@ export default defineConfig({
},
},
plugins: [
createVuePlugin(),
vueJsx(),