Browse Source

Merge branch 'develop'

kailong321200875 3 years ago
parent
commit
9e938c3e7b

+ 12 - 12
package.json

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

File diff suppressed because it is too large
+ 257 - 221
pnpm-lock.yaml


+ 2 - 2
src/config/locale.ts

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

+ 3 - 3
src/views/Components/Descriptions.vue

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

+ 3 - 3
src/views/Components/Form/UseFormDemo.vue

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

+ 16 - 15
src/views/Example/Dialog/ExampleDialog.vue

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

+ 15 - 14
src/views/Example/Page/ExampleAdd.vue

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

+ 17 - 16
src/views/Login/components/LoginForm.vue

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

+ 2 - 2
vite.config.ts

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

Some files were not shown because too many files changed in this diff