Merge branch 'develop'

This commit is contained in:
kailong321200875 2022-03-13 10:33:29 +08:00
commit 9e938c3e7b
9 changed files with 404 additions and 375 deletions

View File

@ -27,34 +27,34 @@
}, },
"dependencies": { "dependencies": {
"@iconify/iconify": "^2.1.2", "@iconify/iconify": "^2.1.2",
"@vueuse/core": "^7.7.1", "@vueuse/core": "^8.0.0",
"@wangeditor/editor": "^0.15.11", "@wangeditor/editor": "^0.15.12",
"@wangeditor/editor-for-vue": "^5.1.8-7", "@wangeditor/editor-for-vue": "^5.1.8-7",
"@zxcvbn-ts/core": "^2.0.0", "@zxcvbn-ts/core": "^2.0.0",
"animate.css": "^4.1.1", "animate.css": "^4.1.1",
"axios": "^0.26.0", "axios": "^0.26.1",
"echarts": "^5.3.0", "echarts": "^5.3.1",
"echarts-wordcloud": "^2.0.0", "echarts-wordcloud": "^2.0.0",
"element-plus": "2.0.5", "element-plus": "2.1.0",
"intro.js": "^5.0.0", "intro.js": "^5.0.0",
"lodash-es": "^4.17.21", "lodash-es": "^4.17.21",
"mitt": "^3.0.0", "mitt": "^3.0.0",
"mockjs": "^1.1.0", "mockjs": "^1.1.0",
"nprogress": "^0.2.0", "nprogress": "^0.2.0",
"pinia": "^2.0.11", "pinia": "^2.0.11",
"pinia-plugin-persist": "^0.0.93", "pinia-plugin-persist": "^1.0.0",
"qrcode": "^1.5.0", "qrcode": "^1.5.0",
"qs": "^6.10.3", "qs": "^6.10.3",
"vue": "3.2.31", "vue": "3.2.31",
"vue-i18n": "9.1.9", "vue-i18n": "9.1.9",
"vue-router": "^4.0.13", "vue-router": "^4.0.14",
"vue-types": "^4.1.1", "vue-types": "^4.1.1",
"web-storage-cache": "^1.1.1" "web-storage-cache": "^1.1.1"
}, },
"devDependencies": { "devDependencies": {
"@commitlint/cli": "^16.2.1", "@commitlint/cli": "^16.2.1",
"@commitlint/config-conventional": "^16.2.1", "@commitlint/config-conventional": "^16.2.1",
"@iconify/json": "^2.1.12", "@iconify/json": "^2.1.14",
"@intlify/vite-plugin-vue-i18n": "^3.3.1", "@intlify/vite-plugin-vue-i18n": "^3.3.1",
"@purge-icons/generated": "^0.8.1", "@purge-icons/generated": "^0.8.1",
"@types/intro.js": "^3.0.2", "@types/intro.js": "^3.0.2",
@ -63,13 +63,13 @@
"@types/nprogress": "^0.2.0", "@types/nprogress": "^0.2.0",
"@types/qrcode": "^1.4.2", "@types/qrcode": "^1.4.2",
"@types/qs": "^6.9.7", "@types/qs": "^6.9.7",
"@typescript-eslint/eslint-plugin": "^5.13.0", "@typescript-eslint/eslint-plugin": "^5.14.0",
"@typescript-eslint/parser": "^5.13.0", "@typescript-eslint/parser": "^5.14.0",
"@vitejs/plugin-vue": "^2.2.4", "@vitejs/plugin-vue": "^2.2.4",
"@vitejs/plugin-vue-jsx": "^1.3.8", "@vitejs/plugin-vue-jsx": "^1.3.8",
"autoprefixer": "^10.4.2", "autoprefixer": "^10.4.2",
"commitizen": "^4.2.4", "commitizen": "^4.2.4",
"eslint": "^8.10.0", "eslint": "^8.11.0",
"eslint-config-prettier": "^8.5.0", "eslint-config-prettier": "^8.5.0",
"eslint-define-config": "^1.2.5", "eslint-define-config": "^1.2.5",
"eslint-plugin-prettier": "^4.0.0", "eslint-plugin-prettier": "^4.0.0",
@ -77,7 +77,7 @@
"husky": "^7.0.4", "husky": "^7.0.4",
"less": "^4.1.2", "less": "^4.1.2",
"lint-staged": "^12.3.5", "lint-staged": "^12.3.5",
"postcss": "^8.4.7", "postcss": "^8.4.8",
"postcss-html": "^1.3.0", "postcss-html": "^1.3.0",
"postcss-less": "^6.0.0", "postcss-less": "^6.0.0",
"prettier": "^2.5.1", "prettier": "^2.5.1",

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
import { useCache } from '@/hooks/web/useCache' import { useCache } from '@/hooks/web/useCache'
import zhCn from 'element-plus/lib/locale/lang/zh-cn' import zhCn from 'element-plus/es/locale/lang/zh-cn'
import en from 'element-plus/lib/locale/lang/en' import en from 'element-plus/es/locale/lang/en'
const { wsCache } = useCache() const { wsCache } = useCache()

View File

@ -63,9 +63,9 @@ const rules = reactive({
const { register, elFormRef } = useForm() const { register, elFormRef } = useForm()
const formValidation = () => { const formValidation = () => {
unref(elFormRef) unref(elFormRef)!.validate((isValid) => {
?.validate() console.log(isValid)
?.catch(() => {}) })
} }
</script> </script>

View File

@ -212,9 +212,9 @@ const addItem = () => {
} }
const formValidation = () => { const formValidation = () => {
unref(elFormRef) unref(elFormRef)!.validate((isValid) => {
?.validate() console.log(isValid)
?.catch(() => {}) })
} }
const verifyReset = () => { const verifyReset = () => {

View File

@ -129,23 +129,24 @@ const loading = ref(false)
const save = async () => { const save = async () => {
const write = unref(writeRef) const write = unref(writeRef)
const validate = await write?.elFormRef?.validate()?.catch(() => {}) await write?.elFormRef?.validate(async (isValid) => {
if (validate) { if (isValid) {
loading.value = true loading.value = true
const data = (await write?.getFormData()) as TableData const data = (await write?.getFormData()) as TableData
const res = await saveTableApi({ const res = await saveTableApi({
data data
})
.catch(() => {})
.finally(() => {
loading.value = false
}) })
if (res) { .catch(() => {})
dialogVisible.value = false .finally(() => {
tableObject.currentPage = 1 loading.value = false
getList() })
if (res) {
dialogVisible.value = false
tableObject.currentPage = 1
getList()
}
} }
} })
} }
</script> </script>

View File

@ -21,22 +21,23 @@ const loading = ref(false)
const save = async () => { const save = async () => {
const write = unref(writeRef) const write = unref(writeRef)
const validate = await write?.elFormRef?.validate()?.catch(() => {}) await write?.elFormRef?.validate(async (isValid) => {
if (validate) { if (isValid) {
loading.value = true loading.value = true
const data = (await write?.getFormData()) as TableData const data = (await write?.getFormData()) as TableData
const res = await saveTableApi({ const res = await saveTableApi({
data data
})
.catch(() => {})
.finally(() => {
loading.value = false
}) })
if (res) { .catch(() => {})
emitter.emit('getList', 'add') .finally(() => {
push('/example/example-page') loading.value = false
})
if (res) {
emitter.emit('getList', 'add')
push('/example/example-page')
}
} }
} })
} }
</script> </script>

View File

@ -113,23 +113,24 @@ watch(
// //
const signIn = async () => { const signIn = async () => {
const formRef = unref(elFormRef) const formRef = unref(elFormRef)
const validate = await formRef?.validate()?.catch(() => {}) await formRef?.validate(async (isValid) => {
if (validate) { if (isValid) {
loading.value = true loading.value = true
const { getFormData } = methods const { getFormData } = methods
const formData = await getFormData<UserLoginType>() const formData = await getFormData<UserLoginType>()
const res = await loginApi(formData) const res = await loginApi(formData)
.catch(() => {}) .catch(() => {})
.finally(() => (loading.value = false)) .finally(() => (loading.value = false))
if (res) { if (res) {
const { wsCache } = useCache() const { wsCache } = useCache()
wsCache.set(appStore.getUserInfo, res.data) wsCache.set(appStore.getUserInfo, res.data)
getRole() getRole()
}
} }
} })
} }
// //

View File

@ -134,8 +134,8 @@ export default ({ command, mode }: ConfigEnv): UserConfig => {
'vue', 'vue',
'vue-router', 'vue-router',
'vue-types', 'vue-types',
'element-plus/lib/locale/lang/zh-cn', 'element-plus/es/locale/lang/zh-cn',
'element-plus/lib/locale/lang/en', 'element-plus/es/locale/lang/en',
'@iconify/iconify', '@iconify/iconify',
'@vueuse/core', '@vueuse/core',
'axios', 'axios',