Skip to content

Commit

Permalink
element-plus to 2.0.1 release version
Browse files Browse the repository at this point in the history
  • Loading branch information
jzfai committed Feb 7, 2022
1 parent 6c8d4f2 commit b2c9481
Show file tree
Hide file tree
Showing 31 changed files with 754 additions and 236 deletions.
65 changes: 65 additions & 0 deletions .eslintrc-auto-import.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"globals": {
"axiosReq": true,
"computed": true,
"createApp": true,
"createLogger": true,
"createNamespacedHelpers": true,
"createStore": true,
"customRef": true,
"defineAsyncComponent": true,
"defineComponent": true,
"effectScope": true,
"EffectScope": true,
"getCurrentInstance": true,
"getCurrentScope": true,
"h": true,
"inject": true,
"isReadonly": true,
"isRef": true,
"mapActions": true,
"mapGetters": true,
"mapMutations": true,
"mapState": true,
"markRaw": true,
"nextTick": true,
"onActivated": true,
"onBeforeMount": true,
"onBeforeUnmount": true,
"onBeforeUpdate": true,
"onDeactivated": true,
"onErrorCaptured": true,
"onMounted": true,
"onRenderTracked": true,
"onRenderTriggered": true,
"onScopeDispose": true,
"onServerPrefetch": true,
"onUnmounted": true,
"onUpdated": true,
"provide": true,
"reactive": true,
"readonly": true,
"ref": true,
"resolveComponent": true,
"shallowReactive": true,
"shallowReadonly": true,
"shallowRef": true,
"toRaw": true,
"toRef": true,
"toRefs": true,
"triggerRef": true,
"unref": true,
"useAttrs": true,
"useCommon": true,
"useCssModule": true,
"useCssVars": true,
"useElement": true,
"useRoute": true,
"useRouter": true,
"useSlots": true,
"useStore": true,
"useVueRouter": true,
"watch": true,
"watchEffect": true
}
}
14 changes: 10 additions & 4 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,17 @@ module.exports = {
GLOBAL_VAR: true,
window: true,
defineProps: true,
defineExpose: true
defineExpose: true,
$ref: true
},
plugins: ['@typescript-eslint', 'prettier', 'import'],
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'plugin:vue/vue3-recommended', 'prettier'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:vue/vue3-recommended',
'prettier',
'./.eslintrc-auto-import.json'
],
parserOptions: {
parser: '@typescript-eslint/parser',
sourceType: 'module',
Expand All @@ -28,8 +35,7 @@ module.exports = {
}
},
rules: {
'no-undef': [1],
'prefer-const': [1],
//close lf error
'import/no-unresolved': [0],
'vue/multi-word-component-names': 'off',
'vue/no-deprecated-router-link-tag-prop': 'off',
Expand Down
23 changes: 23 additions & 0 deletions .pnpm-debug.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"0 debug pnpm:scope": {
"selected": 1
},
"1 info pnpm": {
"err": {
"name": "Error",
"message": "not found: io",
"code": "ENOENT",
"stack": "Error: not found: io\n at getNotFoundError (D:\\nodejs\\v16\\node_modules\\pnpm\\dist\\pnpm.cjs:41440:51)\n at Function.whichSync [as sync] (D:\\nodejs\\v16\\node_modules\\pnpm\\dist\\pnpm.cjs:41517:13)\n at getCommandAbsolutePathSync (D:\\nodejs\\v16\\node_modules\\pnpm\\dist\\pnpm.cjs:43082:44)\n at default_1 (D:\\nodejs\\v16\\node_modules\\pnpm\\dist\\pnpm.cjs:43091:32)\n at D:\\nodejs\\v16\\node_modules\\pnpm\\dist\\pnpm.cjs:179675:39"
}
},
"2 error pnpm": {
"code": "ERR_PNPM_RECURSIVE_EXEC_FIRST_FAIL",
"prefix": "D:\\construct\\vue3-admin-ts",
"err": {
"name": "pnpm",
"message": "not found: io",
"code": "ERR_PNPM_RECURSIVE_EXEC_FIRST_FAIL",
"stack": "Error: not found: io\n at getNotFoundError (D:\\nodejs\\v16\\node_modules\\pnpm\\dist\\pnpm.cjs:41440:51)\n at Function.whichSync [as sync] (D:\\nodejs\\v16\\node_modules\\pnpm\\dist\\pnpm.cjs:41517:13)\n at getCommandAbsolutePathSync (D:\\nodejs\\v16\\node_modules\\pnpm\\dist\\pnpm.cjs:43082:44)\n at default_1 (D:\\nodejs\\v16\\node_modules\\pnpm\\dist\\pnpm.cjs:43091:32)\n at D:\\nodejs\\v16\\node_modules\\pnpm\\dist\\pnpm.cjs:179675:39"
}
}
}
66 changes: 66 additions & 0 deletions auto-imports.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
// Generated by 'unplugin-auto-import'
// We suggest you to commit this file into source control
declare global {
const axiosReq: typeof import('@/utils/axiosReq')['axiosReq']
const computed: typeof import('vue')['computed']
const createApp: typeof import('vue')['createApp']
const createLogger: typeof import('vuex')['createLogger']
const createNamespacedHelpers: typeof import('vuex')['createNamespacedHelpers']
const createStore: typeof import('vuex')['createStore']
const customRef: typeof import('vue')['customRef']
const defineAsyncComponent: typeof import('vue')['defineAsyncComponent']
const defineComponent: typeof import('vue')['defineComponent']
const effectScope: typeof import('vue')['effectScope']
const EffectScope: typeof import('vue')['EffectScope']
const getCurrentInstance: typeof import('vue')['getCurrentInstance']
const getCurrentScope: typeof import('vue')['getCurrentScope']
const h: typeof import('vue')['h']
const inject: typeof import('vue')['inject']
const isReadonly: typeof import('vue')['isReadonly']
const isRef: typeof import('vue')['isRef']
const mapActions: typeof import('vuex')['mapActions']
const mapGetters: typeof import('vuex')['mapGetters']
const mapMutations: typeof import('vuex')['mapMutations']
const mapState: typeof import('vuex')['mapState']
const markRaw: typeof import('vue')['markRaw']
const nextTick: typeof import('vue')['nextTick']
const onActivated: typeof import('vue')['onActivated']
const onBeforeMount: typeof import('vue')['onBeforeMount']
const onBeforeUnmount: typeof import('vue')['onBeforeUnmount']
const onBeforeUpdate: typeof import('vue')['onBeforeUpdate']
const onDeactivated: typeof import('vue')['onDeactivated']
const onErrorCaptured: typeof import('vue')['onErrorCaptured']
const onMounted: typeof import('vue')['onMounted']
const onRenderTracked: typeof import('vue')['onRenderTracked']
const onRenderTriggered: typeof import('vue')['onRenderTriggered']
const onScopeDispose: typeof import('vue')['onScopeDispose']
const onServerPrefetch: typeof import('vue')['onServerPrefetch']
const onUnmounted: typeof import('vue')['onUnmounted']
const onUpdated: typeof import('vue')['onUpdated']
const provide: typeof import('vue')['provide']
const reactive: typeof import('vue')['reactive']
const readonly: typeof import('vue')['readonly']
const ref: typeof import('vue')['ref']
const resolveComponent: typeof import('vue')['resolveComponent']
const shallowReactive: typeof import('vue')['shallowReactive']
const shallowReadonly: typeof import('vue')['shallowReadonly']
const shallowRef: typeof import('vue')['shallowRef']
const toRaw: typeof import('vue')['toRaw']
const toRef: typeof import('vue')['toRef']
const toRefs: typeof import('vue')['toRefs']
const triggerRef: typeof import('vue')['triggerRef']
const unref: typeof import('vue')['unref']
const useAttrs: typeof import('vue')['useAttrs']
const useCommon: typeof import('@/hooks/global/useCommon')['useCommon']
const useCssModule: typeof import('vue')['useCssModule']
const useCssVars: typeof import('vue')['useCssVars']
const useElement: typeof import('@/hooks/global/useElement')['useElement']
const useRoute: typeof import('vue-router')['useRoute']
const useRouter: typeof import('vue-router')['useRouter']
const useSlots: typeof import('vue')['useSlots']
const useStore: typeof import('vuex')['useStore']
const useVueRouter: typeof import('@/hooks/global/useVueRouter')['useVueRouter']
const watch: typeof import('vue')['watch']
const watchEffect: typeof import('vue')['watchEffect']
}
export {}
19 changes: 11 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue3-admin-ts",
"version": "1.3.6",
"version": "1.4.0",
"license": "ISC",
"author": "kuanghua([email protected])",
"scripts": {
Expand All @@ -20,7 +20,7 @@
"@element-plus/icons-vue": "0.2.4",
"axios": "0.21.3",
"echarts": "4.2.1",
"element-plus": "1.3.0-beta.7",
"element-plus": "2.0.1",
"mitt": "3.0.0",
"moment-mini": "^2.22.1",
"nprogress": "0.2.0",
Expand All @@ -36,11 +36,11 @@
"@types/echarts": "4.9.7",
"@types/mockjs": "1.0.3",
"@types/node": "15.0.1",
"@typescript-eslint/eslint-plugin": "5.5.0",
"@typescript-eslint/parser": "5.5.0",
"@vitejs/plugin-legacy": "1.6.4",
"@vitejs/plugin-vue": "1.10.2",
"@vitejs/plugin-vue-jsx": "1.3.1",
"@typescript-eslint/eslint-plugin": "5.5.0",
"@typescript-eslint/parser": "5.5.0",
"eslint": "7.32.0",
"eslint-config-prettier": "8.3.0",
"eslint-define-config": "1.2.0",
Expand All @@ -54,18 +54,21 @@
"scss": "0.2.4",
"svg-sprite-loader": "6.0.11",
"typescript": "4.3.2",
"unplugin-auto-import": "^0.5.11",
"unplugin-vue-components": "^0.17.14",
"vite": "2.7.13",
"vite-plugin-mock": "^2.9.6",
"vite-plugin-style-import": "1.2.1",
"vite-plugin-svg-icons": "1.0.5",
"vite-plugin-vue-setup-extend": "^0.4.0",
"vue-tsc": "0.28.1"
},
"engines": {
"node": ">= 14"
},
"browserslist": [
"> 1%",
"not ie 11",
"not op_mini all"
]
],
"engines": {
"node": ">= 14"
}
}
74 changes: 74 additions & 0 deletions src/hooks/global/useCommon.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import { getToken } from '@/utils/auth'
import momentMini from 'moment-mini'
import { ObjTy } from '~/common'
export const useCommonExample = () => {
const state: any = reactive({
totalPage: 0,
searchForm: {},
/* 文件上传相关*/
fileList: [],
chooseFileName: '',
/* 多环境配置及token信息*/
commonValue: '',
modalShowTitle: '',
VITE_APP_IMAGE_URL_PRE: '', // 图片前缀地址
VITE_APP_BASE_URL: '', // 请求的url地址
VITE_APP_BASE_WS_URL: '', // 请求的url地址
accessToken: '', // 请求头的token
userBaseInfo: {}, // 用户信息
/* 时间点相关*/
todayTime: '',
currentTime: '',
todayTimeLast: '',
yesterdayTime: null,
beforeThreeDateTime: ''
})
// 读取.env 多坏境里的数据
state.VITE_APP_IMAGE_URL_PRE = import.meta.env.VITE_APP_BASE_URL
state.VITE_APP_BASE_URL = import.meta.env.VITE_APP_BASE_URL
// 获取token和个人基本信息
state.accessToken = getToken()
/* 获取时间点*/
state.todayTime = momentMini().startOf('day').format('YYYY-MM-DD HH:mm:ss')
state.currentTime = momentMini(new Date()).format('YYYY-MM-DD HH:mm:ss')
state.todayTimeLast = momentMini().endOf('day').format('YYYY-MM-DD HH:mm:ss')
state.beforeThreeDateTime = momentMini().add(-3, 'days').format('YYYY-MM-DD HH:mm:ss')
state.yesterdayTime = momentMini().add(-1, 'days').format('YYYY-MM-DD HH:mm:ss')

/*
* 清空空的参数项
* objParam:传入的参数
* */
const clearParamsIsNull = (objParam: ObjTy) => {
const obj = Object.keys(objParam)
obj.forEach((fItem) => {
if (objParam[fItem] === '' || objParam[fItem] === null || objParam[fItem] === undefined) delete objParam[fItem]
})
return objParam
}

/*文件上传*/
const handleChange = (fileList: Array<string | ObjTy>) => {
state.fileList = fileList
}

const sleep = (time: number) => {
return new Promise((resolve) => {
const timer = setTimeout(() => {
clearTimeout(timer)
resolve(null)
}, time)
})
}

return {
clearParamsIsNull,
handleChange,
sleep,
...toRefs(state)
}
}

export const useCommon = useCommonExample

export default useCommonExample
Loading

0 comments on commit b2c9481

Please sign in to comment.