kailong321200875 1 year ago
parent
commit
03d5e13014
3 changed files with 46 additions and 41 deletions
  1. 27 27
      package.json
  2. 4 0
      src/components/Form/src/Form.vue
  3. 15 14
      src/components/IconPicker/src/IconPicker.vue

+ 27 - 27
package.json

@@ -29,59 +29,59 @@
   "dependencies": {
     "@iconify/iconify": "^3.1.1",
     "@iconify/vue": "^4.1.1",
-    "@vueuse/core": "^10.4.1",
+    "@vueuse/core": "^10.5.0",
     "@wangeditor/editor": "^5.1.23",
     "@wangeditor/editor-for-vue": "^5.1.10",
     "@zxcvbn-ts/core": "^3.0.4",
     "animate.css": "^4.1.1",
-    "axios": "^1.5.0",
+    "axios": "^1.5.1",
     "dayjs": "^1.11.10",
     "driver.js": "^1.3.0",
     "echarts": "^5.4.3",
     "echarts-wordcloud": "^2.1.0",
-    "element-plus": "^2.3.14",
+    "element-plus": "^2.4.0",
     "lodash-es": "^4.17.21",
     "mitt": "^3.0.1",
     "mockjs": "^1.1.0",
     "nprogress": "^0.2.0",
-    "pinia": "^2.1.6",
+    "pinia": "^2.1.7",
     "pinia-plugin-persist": "^1.0.0",
     "qrcode": "^1.5.3",
     "qs": "^6.11.2",
     "url": "^0.11.3",
     "vue": "3.3.4",
-    "vue-i18n": "9.4.1",
+    "vue-i18n": "9.5.0",
     "vue-json-pretty": "^2.2.4",
     "vue-router": "^4.2.5",
     "vue-types": "^5.1.1"
   },
   "devDependencies": {
-    "@commitlint/cli": "^17.7.1",
+    "@commitlint/cli": "^17.7.2",
     "@commitlint/config-conventional": "^17.7.0",
-    "@iconify/json": "^2.2.119",
-    "@intlify/unplugin-vue-i18n": "^1.2.0",
+    "@iconify/json": "^2.2.128",
+    "@intlify/unplugin-vue-i18n": "^1.4.0",
     "@purge-icons/generated": "^0.9.0",
     "@types/fs-extra": "^11.0.2",
-    "@types/inquirer": "^9.0.3",
+    "@types/inquirer": "^9.0.4",
     "@types/lodash-es": "^4.17.9",
-    "@types/node": "^20.6.5",
+    "@types/node": "^20.8.6",
     "@types/nprogress": "^0.2.1",
     "@types/qrcode": "^1.5.2",
     "@types/qs": "^6.9.8",
-    "@types/sortablejs": "^1.15.2",
-    "@typescript-eslint/eslint-plugin": "^6.7.2",
-    "@typescript-eslint/parser": "^6.7.2",
-    "@unocss/transformer-variant-group": "^0.56.1",
+    "@types/sortablejs": "^1.15.3",
+    "@typescript-eslint/eslint-plugin": "^6.7.5",
+    "@typescript-eslint/parser": "^6.7.5",
+    "@unocss/transformer-variant-group": "^0.56.5",
     "@vitejs/plugin-legacy": "^4.1.1",
-    "@vitejs/plugin-vue": "^4.3.4",
+    "@vitejs/plugin-vue": "^4.4.0",
     "@vitejs/plugin-vue-jsx": "^3.0.2",
     "autoprefixer": "^10.4.16",
     "chalk": "^5.3.0",
     "consola": "^3.2.3",
-    "eslint": "^8.50.0",
+    "eslint": "^8.51.0",
     "eslint-config-prettier": "^9.0.0",
-    "eslint-define-config": "^1.23.0",
-    "eslint-plugin-prettier": "^5.0.0",
+    "eslint-define-config": "^1.24.1",
+    "eslint-plugin-prettier": "^5.0.1",
     "eslint-plugin-vue": "^9.17.0",
     "esno": "^0.17.0",
     "fs-extra": "^11.1.1",
@@ -90,32 +90,32 @@
     "less": "^4.2.0",
     "lint-staged": "^14.0.1",
     "plop": "^4.0.0",
-    "postcss": "^8.4.30",
+    "postcss": "^8.4.31",
     "postcss-html": "^1.5.0",
     "postcss-less": "^6.0.0",
     "prettier": "^3.0.3",
-    "rimraf": "^5.0.1",
-    "rollup": "^3.29.3",
+    "rimraf": "^5.0.5",
+    "rollup": "^4.0.2",
     "stylelint": "^15.10.3",
     "stylelint-config-html": "^1.1.0",
     "stylelint-config-recommended": "^13.0.0",
     "stylelint-config-standard": "^34.0.0",
     "stylelint-order": "^6.0.3",
-    "terser": "^5.20.0",
+    "terser": "^5.21.0",
     "typescript": "5.2.2",
-    "unocss": "^0.56.1",
-    "vite": "4.4.9",
+    "unocss": "^0.56.5",
+    "vite": "4.4.11",
     "vite-plugin-ejs": "^1.6.4",
     "vite-plugin-eslint": "^1.8.1",
-    "vite-plugin-mock": "~2.9.6",
+    "vite-plugin-mock": "2.9.6",
     "vite-plugin-progress": "^0.0.7",
     "vite-plugin-purge-icons": "^0.9.2",
     "vite-plugin-style-import": "2.0.0",
     "vite-plugin-svg-icons": "^2.0.1",
-    "vue-tsc": "^1.8.13"
+    "vue-tsc": "^1.8.19"
   },
   "engines": {
-    "node": ">= 14.18.0"
+    "node": ">= 16.13.0"
   },
   "license": "MIT",
   "repository": {

+ 4 - 0
src/components/Form/src/Form.vue

@@ -401,4 +401,8 @@ export default defineComponent({
   margin-right: 0 !important;
   margin-left: 0 !important;
 }
+
+.@{elNamespace}-form--inline .@{elNamespace}-input {
+  width: 245px;
+}
 </style>

+ 15 - 14
src/components/IconPicker/src/IconPicker.vue

@@ -8,6 +8,18 @@ import { useAppStore } from '@/store/modules/app'
 import { computed, CSSProperties, ref, unref, watch } from 'vue'
 import { nextTick } from 'vue'
 
+const init = async (icon?: string) => {
+  if (!icon) return
+  const iconInfo = icon.split(':')
+  iconName.value = iconInfo[0]
+  const wrapIndex = icons.findIndex((item) => item.prefix === iconInfo[0])
+  // 查询当前icon的索引
+  const index = filterItemIcons(icons[wrapIndex].icons).findIndex((item) => item === icon)
+  // 计算当前icon的页码
+  await nextTick()
+  currentPage.value = Math.ceil((index + 1) / unref(pageSize))
+}
+
 const modelValue = defineModel<string>()
 
 const appStore = useAppStore()
@@ -64,26 +76,15 @@ const filterIcons = (icons: string[]) => {
 
 watch(
   () => modelValue.value,
-  (val) => {
-    init(val)
+  async (val) => {
+    await nextTick()
+    val && init(val)
   },
   {
     immediate: true
   }
 )
 
-async function init(icon?: string) {
-  if (!icon) return
-  const iconInfo = icon.split(':')
-  iconName.value = iconInfo[0]
-  const wrapIndex = icons.findIndex((item) => item.prefix === iconInfo[0])
-  // 查询当前icon的索引
-  const index = filterItemIcons(icons[wrapIndex].icons).findIndex((item) => item === icon)
-  // 计算当前icon的页码
-  await nextTick()
-  currentPage.value = Math.ceil((index + 1) / unref(pageSize))
-}
-
 const popoverShow = () => {
   init(unref(modelValue))
 }