Browse Source

fix: fix tagsview not work

kailong321200875 2 years ago
parent
commit
1bf2d4c772
4 changed files with 297 additions and 336 deletions
  1. 15 15
      package.json
  2. 196 237
      pnpm-lock.yaml
  3. 28 26
      src/components/TagsView/src/TagsView.vue
  4. 58 58
      src/views/Components/Form/DefaultForm.vue

+ 15 - 15
package.json

@@ -35,7 +35,7 @@
     "axios": "^0.27.2",
     "echarts": "^5.3.2",
     "echarts-wordcloud": "^2.0.0",
-    "element-plus": "2.2.4",
+    "element-plus": "2.2.5",
     "intro.js": "^5.1.0",
     "lodash-es": "^4.17.21",
     "mitt": "^3.0.0",
@@ -44,7 +44,7 @@
     "pinia": "^2.0.14",
     "pinia-plugin-persist": "^1.0.0",
     "qrcode": "^1.5.0",
-    "qs": "^6.10.3",
+    "qs": "^6.10.5",
     "url": "^0.11.0",
     "vue": "3.2.37",
     "vue-i18n": "9.1.10",
@@ -55,44 +55,44 @@
   "devDependencies": {
     "@commitlint/cli": "^17.0.2",
     "@commitlint/config-conventional": "^17.0.2",
-    "@iconify/json": "^2.1.57",
+    "@iconify/json": "^2.1.58",
     "@intlify/vite-plugin-vue-i18n": "^3.4.0",
     "@purge-icons/generated": "^0.8.1",
     "@types/intro.js": "^3.0.2",
     "@types/lodash-es": "^4.17.6",
-    "@types/node": "^17.0.40",
+    "@types/node": "^17.0.41",
     "@types/nprogress": "^0.2.0",
     "@types/qrcode": "^1.4.2",
     "@types/qs": "^6.9.7",
-    "@typescript-eslint/eslint-plugin": "^5.27.0",
-    "@typescript-eslint/parser": "^5.27.0",
+    "@typescript-eslint/eslint-plugin": "^5.27.1",
+    "@typescript-eslint/parser": "^5.27.1",
     "@vitejs/plugin-vue": "^2.3.3",
     "@vitejs/plugin-vue-jsx": "^1.3.10",
     "autoprefixer": "^10.4.7",
     "eslint": "^8.17.0",
     "eslint-config-prettier": "^8.5.0",
-    "eslint-define-config": "^1.5.0",
+    "eslint-define-config": "^1.5.1",
     "eslint-plugin-prettier": "^4.0.0",
     "eslint-plugin-vue": "^9.1.0",
     "husky": "^8.0.1",
-    "less": "^4.1.2",
-    "lint-staged": "^13.0.0",
+    "less": "^4.1.3",
+    "lint-staged": "^13.0.1",
     "plop": "^3.1.0",
     "postcss": "^8.4.14",
     "postcss-html": "^1.4.1",
     "postcss-less": "^6.0.0",
     "prettier": "^2.6.2",
     "rimraf": "^3.0.2",
-    "rollup": "^2.75.5",
-    "stylelint": "^14.8.5",
+    "rollup": "^2.75.6",
+    "stylelint": "^14.9.0",
     "stylelint-config-html": "^1.0.0",
     "stylelint-config-prettier": "^9.0.3",
-    "stylelint-config-recommended": "^7.0.0",
-    "stylelint-config-standard": "^25.0.0",
+    "stylelint-config-recommended": "^8.0.0",
+    "stylelint-config-standard": "^26.0.0",
     "stylelint-order": "^5.0.0",
     "typescript": "4.7.3",
     "unplugin-vue-define-options": "^0.6.1",
-    "vite": "2.9.9",
+    "vite": "2.9.10",
     "vite-plugin-eslint": "^1.6.1",
     "vite-plugin-html": "^3.2.0",
     "vite-plugin-mock": "^2.9.6",
@@ -100,7 +100,7 @@
     "vite-plugin-style-import": "^1.4.1",
     "vite-plugin-svg-icons": "^2.0.1",
     "vite-plugin-windicss": "^1.8.4",
-    "vue-tsc": "^0.36.1",
+    "vue-tsc": "^0.37.3",
     "windicss": "^3.5.4",
     "windicss-analysis": "^0.3.5"
   },

File diff suppressed because it is too large
+ 196 - 237
pnpm-lock.yaml


+ 28 - 26
src/components/TagsView/src/TagsView.vue

@@ -347,32 +347,34 @@ watch(
             ]"
             @visible-change="visibleChange"
           >
-            <router-link :ref="tagLinksRefs.set" :to="{ ...item }" custom v-slot="{ navigate }">
-              <div
-                @click="navigate"
-                class="h-full flex justify-center items-center whitespace-nowrap pl-15px"
-              >
-                <Icon
-                  v-if="
-                    item?.matched &&
-                    item?.matched[1] &&
-                    item?.matched[1]?.meta?.icon &&
-                    tagsViewIcon
-                  "
-                  :icon="item?.matched[1]?.meta?.icon"
-                  :size="12"
-                  class="mr-5px"
-                />
-                {{ t(item?.meta?.title as string) }}
-                <Icon
-                  :class="`${prefixCls}__item--close`"
-                  color="#333"
-                  icon="ant-design:close-outlined"
-                  :size="12"
-                  @click.prevent.stop="closeSelectedTag(item)"
-                />
-              </div>
-            </router-link>
+            <div>
+              <router-link :ref="tagLinksRefs.set" :to="{ ...item }" custom v-slot="{ navigate }">
+                <div
+                  @click="navigate"
+                  class="h-full flex justify-center items-center whitespace-nowrap pl-15px"
+                >
+                  <Icon
+                    v-if="
+                      item?.matched &&
+                      item?.matched[1] &&
+                      item?.matched[1]?.meta?.icon &&
+                      tagsViewIcon
+                    "
+                    :icon="item?.matched[1]?.meta?.icon"
+                    :size="12"
+                    class="mr-5px"
+                  />
+                  {{ t(item?.meta?.title as string) }}
+                  <Icon
+                    :class="`${prefixCls}__item--close`"
+                    color="#333"
+                    icon="ant-design:close-outlined"
+                    :size="12"
+                    @click.prevent.stop="closeSelectedTag(item)"
+                  />
+                </div>
+              </router-link>
+            </div>
           </ContextMenu>
         </div>
       </ElScrollbar>

+ 58 - 58
src/views/Components/Form/DefaultForm.vue

@@ -43,26 +43,26 @@ onMounted(() => {
   restaurants.value = loadAll()
 })
 
-// const initials = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']
-// const options = ref<ComponentOptions[]>(
-//   Array.from({ length: 1000 }).map((_, idx) => ({
-//     value: `Option ${idx + 1}`,
-//     label: `${initials[idx % 10]}${idx}`
-//   }))
-// )
-// const options2 = ref<ComponentOptions[]>(
-//   Array.from({ length: 10 }).map((_, idx) => {
-//     const label = idx + 1
-//     return {
-//       value: `Group ${label}`,
-//       label: `Group ${label}`,
-//       options: Array.from({ length: 10 }).map((_, idx) => ({
-//         value: `Option ${idx + 1 + 10 * label}`,
-//         label: `${initials[idx % 10]}${idx + 1 + 10 * label}`
-//       }))
-//     }
-//   })
-// )
+const initials = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']
+const options = ref<ComponentOptions[]>(
+  Array.from({ length: 1000 }).map((_, idx) => ({
+    value: `Option ${idx + 1}`,
+    label: `${initials[idx % 10]}${idx}`
+  }))
+)
+const options2 = ref<ComponentOptions[]>(
+  Array.from({ length: 10 }).map((_, idx) => {
+    const label = idx + 1
+    return {
+      value: `Group ${label}`,
+      label: `Group ${label}`,
+      options: Array.from({ length: 10 }).map((_, idx) => ({
+        value: `Option ${idx + 1 + 10 * label}`,
+        label: `${initials[idx % 10]}${idx + 1 + 10 * label}`
+      }))
+    }
+  })
+)
 
 const options3: ComponentOptions[] = [
   {
@@ -558,44 +558,44 @@ const schema = reactive<FormSchema[]>([
     label: `${t('formDemo.selectV2')}`,
     component: 'Divider'
   },
-  // {
-  //   field: 'field19',
-  //   label: t('formDemo.default'),
-  //   component: 'SelectV2',
-  //   componentProps: {
-  //     options: options.value
-  //   }
-  // }
-  // {
-  //   field: 'field20',
-  //   label: t('formDemo.slot'),
-  //   component: 'SelectV2',
-  //   componentProps: {
-  //     options: options.value,
-  //     slots: {
-  //       default: true
-  //     }
-  //   }
-  // }
-  // {
-  //   field: 'field21',
-  //   label: t('formDemo.selectGroup'),
-  //   component: 'SelectV2',
-  //   componentProps: {
-  //     options: options2.value
-  //   }
-  // },
-  // {
-  //   field: 'field22',
-  //   label: `${t('formDemo.selectGroup')}${t('formDemo.slot')}`,
-  //   component: 'SelectV2',
-  //   componentProps: {
-  //     options: options2.value,
-  //     slots: {
-  //       default: true
-  //     }
-  //   }
-  // },
+  {
+    field: 'field19',
+    label: t('formDemo.default'),
+    component: 'SelectV2',
+    componentProps: {
+      options: options.value
+    }
+  },
+  {
+    field: 'field20',
+    label: t('formDemo.slot'),
+    component: 'SelectV2',
+    componentProps: {
+      options: options.value,
+      slots: {
+        default: true
+      }
+    }
+  },
+  {
+    field: 'field21',
+    label: t('formDemo.selectGroup'),
+    component: 'SelectV2',
+    componentProps: {
+      options: options2.value
+    }
+  },
+  {
+    field: 'field22',
+    label: `${t('formDemo.selectGroup')}${t('formDemo.slot')}`,
+    component: 'SelectV2',
+    componentProps: {
+      options: options2.value,
+      slots: {
+        default: true
+      }
+    }
+  },
   {
     field: 'field23',
     label: t('formDemo.cascader'),

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