@smallwei/avue 3.8.4 → 3.8.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -2
- package/dist/avue.js +26330 -36253
- package/dist/avue.js.map +1 -1
- package/dist/avue.min.js +2 -6
- package/dist/index.css +1 -1
- package/es/_virtual/_commonjsHelpers.mjs +6 -0
- package/es/_virtual/dayjs.min.mjs +8 -0
- package/es/_virtual/dayjs.min2.mjs +4 -0
- package/es/index.css +1 -0
- package/es/index.mjs +2 -127
- package/es/node_modules/.pnpm/dayjs@1.11.13/node_modules/dayjs/dayjs.min.mjs +17 -0
- package/es/packages/core/common/event.mjs +7 -3
- package/es/packages/core/common/init.mjs +8 -4
- package/es/packages/core/common/props.mjs +7 -3
- package/es/packages/core/components/dialog-form/index.mjs +8 -29
- package/es/packages/core/components/dialog-form/index2.mjs +34 -0
- package/es/packages/core/components/dialog-form/index3.mjs +80 -0
- package/es/packages/core/components/dialog-form/index4.mjs +67 -0
- package/es/packages/core/components/form/custom.mjs +4 -1
- package/es/packages/core/components/form/index.mjs +8 -0
- package/es/packages/core/components/form/index2.mjs +119 -0
- package/es/packages/core/components/form/index3.mjs +91 -0
- package/es/packages/core/components/icon/index.mjs +8 -0
- package/es/packages/core/components/icon/index2.mjs +18 -0
- package/es/packages/core/components/icon/index3.mjs +41 -0
- package/es/packages/core/components/image-preview/index.mjs +8 -34
- package/es/packages/core/components/image-preview/index2.mjs +39 -0
- package/es/packages/core/components/image-preview/index3.mjs +143 -0
- package/es/packages/core/components/image-preview/index4.mjs +160 -0
- package/es/packages/core/directive/contextmenu.mjs +4 -1
- package/es/packages/core/directive/permission.mjs +4 -1
- package/es/packages/data/box/index.mjs +8 -0
- package/es/packages/data/box/index2.mjs +35 -0
- package/es/packages/data/box/index3.mjs +66 -0
- package/es/packages/data/card/index.mjs +8 -0
- package/es/packages/data/card/index2.mjs +38 -0
- package/es/packages/data/card/index3.mjs +57 -0
- package/es/packages/data/cardText/index.mjs +8 -0
- package/es/packages/data/cardText/index2.mjs +31 -0
- package/es/packages/data/cardText/index3.mjs +50 -0
- package/es/packages/data/countdown/index.mjs +8 -0
- package/es/packages/data/countdown/index2.mjs +45 -0
- package/es/packages/data/countdown/index3.mjs +95 -0
- package/es/packages/data/dashboard/index.mjs +8 -0
- package/es/packages/data/dashboard/index2.mjs +38 -0
- package/es/packages/data/dashboard/index3.mjs +100 -0
- package/es/packages/data/display/index.mjs +8 -0
- package/es/packages/data/display/index2.mjs +36 -0
- package/es/packages/data/display/index3.mjs +56 -0
- package/es/packages/data/icons/index.mjs +8 -0
- package/es/packages/data/icons/index2.mjs +37 -0
- package/es/packages/data/icons/index3.mjs +66 -0
- package/es/packages/data/imgText/index.mjs +8 -0
- package/es/packages/data/imgText/index2.mjs +30 -0
- package/es/packages/data/imgText/index3.mjs +87 -0
- package/es/packages/data/list/index.mjs +8 -0
- package/es/packages/data/list/index2.mjs +31 -0
- package/es/packages/data/list/index3.mjs +134 -0
- package/es/packages/data/notice/index.mjs +8 -0
- package/es/packages/data/notice/index2.mjs +42 -0
- package/es/packages/data/notice/index3.mjs +59 -0
- package/es/packages/data/operaText/index.mjs +8 -0
- package/es/packages/data/operaText/index2.mjs +27 -0
- package/es/packages/data/operaText/index3.mjs +74 -0
- package/es/packages/data/panel/index.mjs +8 -0
- package/es/packages/data/panel/index2.mjs +33 -0
- package/es/packages/data/panel/index3.mjs +64 -0
- package/es/packages/data/pay/index.mjs +8 -0
- package/es/packages/data/pay/index2.mjs +28 -0
- package/es/packages/data/pay/index3.mjs +128 -0
- package/es/packages/data/price/index.mjs +8 -0
- package/es/packages/data/price/index2.mjs +25 -0
- package/es/packages/data/price/index3.mjs +56 -0
- package/es/packages/data/product/index.mjs +8 -0
- package/es/packages/data/product/index2.mjs +55 -0
- package/es/packages/data/product/index3.mjs +158 -0
- package/es/packages/data/profile/index.mjs +8 -0
- package/es/packages/data/profile/index2.mjs +38 -0
- package/es/packages/data/profile/index3.mjs +166 -0
- package/es/packages/data/progress/index.mjs +8 -0
- package/es/packages/data/progress/index2.mjs +35 -0
- package/es/packages/data/progress/index3.mjs +63 -0
- package/es/packages/data/rank/index.mjs +8 -0
- package/es/packages/data/rank/index2.mjs +56 -0
- package/es/packages/data/rank/index3.mjs +99 -0
- package/es/packages/data/rotate/index.mjs +8 -0
- package/es/packages/data/rotate/index2.mjs +37 -0
- package/es/packages/data/rotate/index3.mjs +75 -0
- package/es/packages/data/statistic/index.mjs +8 -0
- package/es/packages/data/statistic/index2.mjs +36 -0
- package/es/packages/data/statistic/index3.mjs +100 -0
- package/es/packages/data/tabs/index.mjs +8 -0
- package/es/packages/data/tabs/index2.mjs +31 -0
- package/es/packages/data/tabs/index3.mjs +65 -0
- package/es/packages/data/task/index.mjs +8 -0
- package/es/packages/data/task/index2.mjs +54 -0
- package/es/packages/data/task/index3.mjs +82 -0
- package/es/packages/data/weather/index.mjs +8 -0
- package/es/packages/data/weather/index2.mjs +67 -0
- package/es/packages/data/weather/index3.mjs +80 -0
- package/es/packages/element-plus/array/index.mjs +8 -0
- package/es/packages/element-plus/array/index2.mjs +62 -0
- package/es/packages/element-plus/array/index3.mjs +102 -0
- package/es/packages/element-plus/article/index.mjs +8 -0
- package/es/packages/element-plus/article/index2.mjs +55 -0
- package/es/packages/element-plus/article/index3.mjs +48 -0
- package/es/packages/element-plus/card/index.mjs +8 -0
- package/es/packages/element-plus/card/index2.mjs +65 -0
- package/es/packages/element-plus/card/index3.mjs +94 -0
- package/es/packages/element-plus/cascader/index.mjs +8 -0
- package/es/packages/element-plus/cascader/index2.mjs +102 -0
- package/es/packages/element-plus/cascader/index3.mjs +47 -0
- package/es/packages/element-plus/chat/index.mjs +8 -0
- package/es/packages/element-plus/chat/index2.mjs +320 -0
- package/es/packages/element-plus/chat/index3.mjs +394 -0
- package/es/packages/element-plus/checkbox/index.mjs +8 -0
- package/es/packages/element-plus/checkbox/index2.mjs +55 -0
- package/es/packages/element-plus/checkbox/index3.mjs +61 -0
- package/es/packages/element-plus/comment/index.mjs +8 -0
- package/es/packages/element-plus/comment/index2.mjs +58 -0
- package/es/packages/element-plus/comment/index3.mjs +43 -0
- package/es/packages/element-plus/count-up/index.mjs +8 -0
- package/es/packages/element-plus/count-up/index2.mjs +105 -0
- package/es/packages/element-plus/count-up/index3.mjs +8 -0
- package/es/packages/element-plus/crud/column/column-default.mjs +8 -0
- package/es/packages/element-plus/crud/column/column-default2.mjs +85 -0
- package/es/packages/element-plus/crud/column/column-default3.mjs +62 -0
- package/es/packages/element-plus/crud/column/column-dynamic.mjs +8 -0
- package/es/packages/element-plus/crud/column/column-dynamic2.mjs +25 -0
- package/es/packages/element-plus/crud/column/column-dynamic3.mjs +86 -0
- package/es/packages/element-plus/crud/column/column-menu.mjs +8 -0
- package/es/packages/element-plus/crud/column/column-menu2.mjs +56 -0
- package/es/packages/element-plus/crud/column/column-menu3.mjs +326 -0
- package/es/packages/element-plus/crud/column/column-slot.mjs +8 -0
- package/es/packages/element-plus/crud/column/column-slot2.mjs +162 -0
- package/es/packages/element-plus/crud/column/column-slot3.mjs +236 -0
- package/es/packages/element-plus/crud/column/column.mjs +8 -0
- package/es/packages/element-plus/crud/column/column2.mjs +97 -0
- package/es/packages/element-plus/crud/column/column3.mjs +49 -0
- package/es/packages/element-plus/crud/column/menu.mjs +8 -0
- package/es/packages/element-plus/crud/column/menu2.mjs +53 -0
- package/es/packages/element-plus/crud/column/menu3.mjs +57 -0
- package/es/packages/element-plus/crud/config.mjs +4 -1
- package/es/packages/element-plus/crud/dialog/dialog-column.mjs +8 -0
- package/es/packages/element-plus/crud/dialog/dialog-column2.mjs +65 -0
- package/es/packages/element-plus/crud/dialog/dialog-column3.mjs +71 -0
- package/es/packages/element-plus/crud/dialog/dialog-excel.mjs +8 -0
- package/es/packages/element-plus/crud/dialog/dialog-excel2.mjs +182 -0
- package/es/packages/element-plus/crud/dialog/dialog-excel3.mjs +59 -0
- package/es/packages/element-plus/crud/dialog/dialog-filter.mjs +8 -0
- package/es/packages/element-plus/crud/dialog/dialog-filter2.mjs +98 -0
- package/es/packages/element-plus/crud/dialog/dialog-filter3.mjs +146 -0
- package/es/packages/element-plus/crud/dialog/dialog-form.mjs +8 -0
- package/es/packages/element-plus/crud/dialog/dialog-form2.mjs +255 -0
- package/es/packages/element-plus/crud/dialog/dialog-form3.mjs +141 -0
- package/es/packages/element-plus/crud/grid/index.mjs +8 -0
- package/es/packages/element-plus/crud/grid/index2.mjs +180 -0
- package/es/packages/element-plus/crud/grid/index3.mjs +127 -0
- package/es/packages/element-plus/crud/grid/item.mjs +8 -0
- package/es/packages/element-plus/crud/grid/item2.mjs +36 -0
- package/es/packages/element-plus/crud/grid/item3.mjs +6 -0
- package/es/packages/element-plus/crud/index.mjs +8 -0
- package/es/packages/element-plus/crud/index2.mjs +841 -0
- package/es/packages/element-plus/crud/index3.mjs +287 -0
- package/es/packages/element-plus/crud/menu/header-menu.mjs +8 -0
- package/es/packages/element-plus/crud/menu/header-menu2.mjs +83 -0
- package/es/packages/element-plus/crud/menu/header-menu3.mjs +171 -0
- package/es/packages/element-plus/crud/menu/header-search.mjs +8 -0
- package/es/packages/element-plus/crud/menu/header-search2.mjs +187 -0
- package/es/packages/element-plus/crud/menu/header-search3.mjs +84 -0
- package/es/packages/element-plus/crud/menu/table-page.mjs +8 -0
- package/es/packages/element-plus/crud/menu/table-page2.mjs +88 -0
- package/es/packages/element-plus/crud/menu/table-page3.mjs +40 -0
- package/es/packages/element-plus/date/index.mjs +8 -0
- package/es/packages/element-plus/date/index2.mjs +39 -0
- package/es/packages/element-plus/date/index3.mjs +62 -0
- package/es/packages/element-plus/draggable/index.mjs +8 -0
- package/es/packages/element-plus/draggable/index2.mjs +402 -0
- package/es/packages/element-plus/draggable/index3.mjs +83 -0
- package/es/packages/element-plus/dynamic/index.mjs +8 -0
- package/es/packages/element-plus/dynamic/index2.mjs +268 -0
- package/es/packages/element-plus/dynamic/index3.mjs +137 -0
- package/es/packages/element-plus/flow/index.mjs +8 -0
- package/es/packages/element-plus/flow/index2.mjs +312 -0
- package/es/packages/element-plus/flow/index3.mjs +45 -0
- package/es/packages/element-plus/flow/node.mjs +8 -0
- package/es/packages/element-plus/flow/node2.mjs +56 -0
- package/es/packages/element-plus/flow/node3.mjs +47 -0
- package/es/packages/element-plus/form/config.mjs +4 -1
- package/es/packages/element-plus/form/index.mjs +8 -0
- package/es/packages/element-plus/form/index2.mjs +705 -0
- package/es/packages/element-plus/form/index3.mjs +337 -0
- package/es/packages/element-plus/form/menu.mjs +8 -0
- package/es/packages/element-plus/form/menu2.mjs +27 -0
- package/es/packages/element-plus/form/menu3.mjs +91 -0
- package/es/packages/element-plus/group/index.mjs +8 -0
- package/es/packages/element-plus/group/index2.mjs +63 -0
- package/es/packages/element-plus/group/index3.mjs +73 -0
- package/es/packages/element-plus/input/index.mjs +8 -0
- package/es/packages/element-plus/input/index2.mjs +1071 -0
- package/es/packages/element-plus/input/index3.mjs +316 -0
- package/es/packages/element-plus/input-color/index.mjs +8 -0
- package/es/packages/element-plus/input-color/index2.mjs +44 -0
- package/es/packages/element-plus/input-color/index3.mjs +42 -0
- package/es/packages/element-plus/input-cron/index.mjs +8 -0
- package/es/packages/element-plus/input-cron/index2.mjs +292 -0
- package/es/packages/element-plus/input-cron/index3.mjs +214 -0
- package/es/packages/element-plus/input-icon/index.mjs +8 -0
- package/es/packages/element-plus/input-icon/index2.mjs +89 -0
- package/es/packages/element-plus/input-icon/index3.mjs +96 -0
- package/es/packages/element-plus/input-map/index.mjs +8 -0
- package/es/packages/element-plus/input-map/index2.mjs +250 -0
- package/es/packages/element-plus/input-map/index3.mjs +99 -0
- package/es/packages/element-plus/input-number/index.mjs +8 -0
- package/es/packages/element-plus/input-number/index2.mjs +62 -0
- package/es/packages/element-plus/input-number/index3.mjs +54 -0
- package/es/packages/element-plus/input-table/index.mjs +8 -0
- package/es/packages/element-plus/input-table/index2.mjs +225 -0
- package/es/packages/element-plus/input-table/index3.mjs +77 -0
- package/es/packages/element-plus/input-tag/index.mjs +8 -0
- package/es/packages/element-plus/input-tag/index2.mjs +51 -0
- package/es/packages/element-plus/input-tag/index3.mjs +61 -0
- package/es/packages/element-plus/input-tree/index.mjs +8 -0
- package/es/packages/element-plus/input-tree/index2.mjs +141 -0
- package/es/packages/element-plus/input-tree/index3.mjs +75 -0
- package/es/packages/element-plus/license/index.mjs +8 -0
- package/es/packages/element-plus/license/index2.mjs +145 -0
- package/es/packages/element-plus/license/index3.mjs +19 -0
- package/es/packages/element-plus/login/index.mjs +8 -0
- package/es/packages/element-plus/login/index2.mjs +128 -0
- package/es/packages/element-plus/login/index3.mjs +165 -0
- package/es/packages/element-plus/mention/index.mjs +8 -0
- package/es/packages/element-plus/mention/index2.mjs +83 -0
- package/es/packages/element-plus/mention/index3.mjs +66 -0
- package/es/packages/element-plus/radio/index.mjs +8 -0
- package/es/packages/element-plus/radio/index2.mjs +23 -0
- package/es/packages/element-plus/radio/index3.mjs +38 -0
- package/es/packages/element-plus/rate/index.mjs +8 -0
- package/es/packages/element-plus/rate/index2.mjs +40 -0
- package/es/packages/element-plus/rate/index3.mjs +22 -0
- package/es/packages/element-plus/search/index.mjs +8 -0
- package/es/packages/element-plus/search/index2.mjs +108 -0
- package/es/packages/element-plus/search/index3.mjs +50 -0
- package/es/packages/element-plus/select/index.mjs +8 -0
- package/es/packages/element-plus/select/index2.mjs +168 -0
- package/es/packages/element-plus/select/index3.mjs +160 -0
- package/es/packages/element-plus/sign/index.mjs +8 -0
- package/es/packages/element-plus/sign/index2.mjs +223 -0
- package/es/packages/element-plus/sign/index3.mjs +19 -0
- package/es/packages/element-plus/slider/index.mjs +8 -0
- package/es/packages/element-plus/slider/index2.mjs +52 -0
- package/es/packages/element-plus/slider/index3.mjs +25 -0
- package/es/packages/element-plus/switch/index.mjs +8 -0
- package/es/packages/element-plus/switch/index2.mjs +53 -0
- package/es/packages/element-plus/switch/index3.mjs +29 -0
- package/es/packages/element-plus/tabs/index.mjs +8 -0
- package/es/packages/element-plus/tabs/index2.mjs +42 -0
- package/es/packages/element-plus/tabs/index3.mjs +39 -0
- package/es/packages/element-plus/text-ellipsis/index.mjs +8 -0
- package/es/packages/element-plus/text-ellipsis/index2.mjs +82 -0
- package/es/packages/element-plus/text-ellipsis/index3.mjs +42 -0
- package/es/packages/element-plus/time/index.mjs +8 -0
- package/es/packages/element-plus/time/index2.mjs +50 -0
- package/es/packages/element-plus/time/index3.mjs +40 -0
- package/es/packages/element-plus/title/index.mjs +8 -0
- package/es/packages/element-plus/title/index2.mjs +25 -0
- package/es/packages/element-plus/title/index3.mjs +14 -0
- package/es/packages/element-plus/tree/index.mjs +8 -0
- package/es/packages/element-plus/tree/index2.mjs +357 -0
- package/es/packages/element-plus/tree/index3.mjs +186 -0
- package/es/packages/element-plus/upload/index.mjs +8 -0
- package/es/packages/element-plus/upload/index2.mjs +517 -0
- package/es/packages/element-plus/upload/index3.mjs +373 -0
- package/es/packages/element-plus/verify/index.mjs +8 -0
- package/es/packages/element-plus/verify/index2.mjs +52 -0
- package/es/packages/element-plus/verify/index3.mjs +18 -0
- package/es/packages/element-plus/video/index.mjs +8 -0
- package/es/packages/element-plus/video/index2.mjs +72 -0
- package/es/packages/element-plus/video/index3.mjs +41 -0
- package/es/src/core/create.mjs +12 -0
- package/es/src/core/dataformat.mjs +188 -0
- package/es/src/core/detail.mjs +78 -0
- package/es/src/core/dic.mjs +216 -0
- package/es/src/core/locale.mjs +12 -0
- package/es/src/core/packages.mjs +65 -0
- package/es/src/core/slot.mjs +35 -0
- package/es/src/global/variable.mjs +83 -0
- package/es/src/icon.mjs +13 -0
- package/es/src/index.mjs +130 -0
- package/es/src/locale/index.mjs +145 -0
- package/es/src/locale/lang/en.mjs +285 -0
- package/es/src/locale/lang/zh-cn.mjs +285 -0
- package/es/src/locale/lang/zh.mjs +285 -0
- package/es/src/plugin/ali/index.mjs +7 -0
- package/es/src/plugin/clipboard/index.mjs +64 -0
- package/es/src/plugin/export/_blob.mjs +151 -0
- package/es/src/plugin/export/_export2Excel.mjs +143 -0
- package/es/src/plugin/export/index.mjs +267 -0
- package/es/src/plugin/logs/index.mjs +46 -0
- package/es/src/plugin/print/index.mjs +147 -0
- package/es/src/plugin/qiniu/index.mjs +69 -0
- package/es/src/plugin/screenshot/index.mjs +12 -0
- package/es/src/plugin/video/index.mjs +55 -0
- package/es/src/plugin/watermark/index.mjs +118 -0
- package/es/src/plugin/watermark/watermark.mjs +112 -0
- package/es/src/ui/data/index.mjs +75 -0
- package/es/src/ui/element-plus/index.mjs +132 -0
- package/es/src/ui/index.mjs +7 -0
- package/es/src/utils/bem.mjs +32 -0
- package/es/src/utils/mock.mjs +141 -0
- package/es/src/utils/util.mjs +374 -0
- package/es/src/utils/validate.mjs +21 -0
- package/es/src/version.mjs +4 -0
- package/lib/_virtual/_commonjsHelpers.js +8 -0
- package/lib/_virtual/dayjs.min.js +12 -0
- package/lib/_virtual/dayjs.min2.js +6 -0
- package/lib/avue.js +1 -11
- package/lib/avue.min.js +1 -11
- package/lib/index.css +1 -1
- package/lib/index.js +11 -134
- package/lib/node_modules/.pnpm/dayjs@1.11.13/node_modules/dayjs/dayjs.min.js +19 -0
- package/lib/packages/core/common/event.js +13 -8
- package/lib/packages/core/common/init.js +18 -16
- package/lib/packages/core/common/props.js +17 -15
- package/lib/packages/core/components/dialog-form/index.js +12 -35
- package/lib/packages/core/components/dialog-form/index2.js +38 -0
- package/lib/packages/core/components/dialog-form/index3.js +84 -0
- package/lib/packages/core/components/dialog-form/index4.js +69 -0
- package/lib/packages/core/components/form/custom.js +8 -3
- package/lib/packages/core/components/form/index.js +12 -0
- package/lib/packages/core/components/form/index2.js +123 -0
- package/lib/packages/core/components/form/index3.js +93 -0
- package/lib/packages/core/components/icon/index.js +12 -0
- package/lib/packages/core/components/icon/index2.js +22 -0
- package/lib/packages/core/components/icon/index3.js +43 -0
- package/lib/packages/core/components/image-preview/index.js +12 -40
- package/lib/packages/core/components/image-preview/index2.js +43 -0
- package/lib/packages/core/components/image-preview/index3.js +147 -0
- package/lib/packages/core/components/image-preview/index4.js +162 -0
- package/lib/packages/core/directive/contextmenu.js +8 -3
- package/lib/packages/core/directive/permission.js +8 -3
- package/lib/packages/data/box/index.js +12 -0
- package/lib/packages/data/box/index2.js +39 -0
- package/lib/packages/data/box/index3.js +68 -0
- package/lib/packages/data/card/index.js +12 -0
- package/lib/packages/data/card/index2.js +42 -0
- package/lib/packages/data/card/index3.js +59 -0
- package/lib/packages/data/cardText/index.js +12 -0
- package/lib/packages/data/cardText/index2.js +35 -0
- package/lib/packages/data/cardText/index3.js +52 -0
- package/lib/packages/data/countdown/index.js +12 -0
- package/lib/packages/data/countdown/index2.js +49 -0
- package/lib/packages/data/countdown/index3.js +97 -0
- package/lib/packages/data/dashboard/index.js +12 -0
- package/lib/packages/data/dashboard/index2.js +42 -0
- package/lib/packages/data/dashboard/index3.js +102 -0
- package/lib/packages/data/display/index.js +12 -0
- package/lib/packages/data/display/index2.js +40 -0
- package/lib/packages/data/display/index3.js +58 -0
- package/lib/packages/data/icons/index.js +12 -0
- package/lib/packages/data/icons/index2.js +41 -0
- package/lib/packages/data/icons/index3.js +68 -0
- package/lib/packages/data/imgText/index.js +12 -0
- package/lib/packages/data/imgText/index2.js +34 -0
- package/lib/packages/data/imgText/index3.js +89 -0
- package/lib/packages/data/list/index.js +12 -0
- package/lib/packages/data/list/index2.js +35 -0
- package/lib/packages/data/list/index3.js +136 -0
- package/lib/packages/data/notice/index.js +12 -0
- package/lib/packages/data/notice/index2.js +46 -0
- package/lib/packages/data/notice/index3.js +61 -0
- package/lib/packages/data/operaText/index.js +12 -0
- package/lib/packages/data/operaText/index2.js +31 -0
- package/lib/packages/data/operaText/index3.js +76 -0
- package/lib/packages/data/panel/index.js +12 -0
- package/lib/packages/data/panel/index2.js +37 -0
- package/lib/packages/data/panel/index3.js +66 -0
- package/lib/packages/data/pay/index.js +12 -0
- package/lib/packages/data/pay/index2.js +32 -0
- package/lib/packages/data/pay/index3.js +130 -0
- package/lib/packages/data/price/index.js +12 -0
- package/lib/packages/data/price/index2.js +29 -0
- package/lib/packages/data/price/index3.js +58 -0
- package/lib/packages/data/product/index.js +12 -0
- package/lib/packages/data/product/index2.js +59 -0
- package/lib/packages/data/product/index3.js +160 -0
- package/lib/packages/data/profile/index.js +12 -0
- package/lib/packages/data/profile/index2.js +42 -0
- package/lib/packages/data/profile/index3.js +168 -0
- package/lib/packages/data/progress/index.js +12 -0
- package/lib/packages/data/progress/index2.js +39 -0
- package/lib/packages/data/progress/index3.js +65 -0
- package/lib/packages/data/rank/index.js +12 -0
- package/lib/packages/data/rank/index2.js +60 -0
- package/lib/packages/data/rank/index3.js +101 -0
- package/lib/packages/data/rotate/index.js +12 -0
- package/lib/packages/data/rotate/index2.js +41 -0
- package/lib/packages/data/rotate/index3.js +77 -0
- package/lib/packages/data/statistic/index.js +12 -0
- package/lib/packages/data/statistic/index2.js +40 -0
- package/lib/packages/data/statistic/index3.js +102 -0
- package/lib/packages/data/tabs/index.js +12 -0
- package/lib/packages/data/tabs/index2.js +35 -0
- package/lib/packages/data/tabs/index3.js +67 -0
- package/lib/packages/data/task/index.js +12 -0
- package/lib/packages/data/task/index2.js +58 -0
- package/lib/packages/data/task/index3.js +84 -0
- package/lib/packages/data/weather/index.js +12 -0
- package/lib/packages/data/weather/index2.js +71 -0
- package/lib/packages/data/weather/index3.js +82 -0
- package/lib/packages/element-plus/array/index.js +12 -0
- package/lib/packages/element-plus/array/index2.js +66 -0
- package/lib/packages/element-plus/array/index3.js +104 -0
- package/lib/packages/element-plus/article/index.js +12 -0
- package/lib/packages/element-plus/article/index2.js +59 -0
- package/lib/packages/element-plus/article/index3.js +50 -0
- package/lib/packages/element-plus/card/index.js +12 -0
- package/lib/packages/element-plus/card/index2.js +69 -0
- package/lib/packages/element-plus/card/index3.js +96 -0
- package/lib/packages/element-plus/cascader/index.js +12 -0
- package/lib/packages/element-plus/cascader/index2.js +106 -0
- package/lib/packages/element-plus/cascader/index3.js +49 -0
- package/lib/packages/element-plus/chat/index.js +12 -0
- package/lib/packages/element-plus/chat/index2.js +324 -0
- package/lib/packages/element-plus/chat/index3.js +396 -0
- package/lib/packages/element-plus/checkbox/index.js +12 -0
- package/lib/packages/element-plus/checkbox/index2.js +59 -0
- package/lib/packages/element-plus/checkbox/index3.js +63 -0
- package/lib/packages/element-plus/comment/index.js +12 -0
- package/lib/packages/element-plus/comment/index2.js +62 -0
- package/lib/packages/element-plus/comment/index3.js +45 -0
- package/lib/packages/element-plus/count-up/index.js +12 -0
- package/lib/packages/element-plus/count-up/index2.js +113 -0
- package/lib/packages/element-plus/count-up/index3.js +10 -0
- package/lib/packages/element-plus/crud/column/column-default.js +12 -0
- package/lib/packages/element-plus/crud/column/column-default2.js +89 -0
- package/lib/packages/element-plus/crud/column/column-default3.js +64 -0
- package/lib/packages/element-plus/crud/column/column-dynamic.js +12 -0
- package/lib/packages/element-plus/crud/column/column-dynamic2.js +29 -0
- package/lib/packages/element-plus/crud/column/column-dynamic3.js +88 -0
- package/lib/packages/element-plus/crud/column/column-menu.js +12 -0
- package/lib/packages/element-plus/crud/column/column-menu2.js +60 -0
- package/lib/packages/element-plus/crud/column/column-menu3.js +328 -0
- package/lib/packages/element-plus/crud/column/column-slot.js +12 -0
- package/lib/packages/element-plus/crud/column/column-slot2.js +166 -0
- package/lib/packages/element-plus/crud/column/column-slot3.js +238 -0
- package/lib/packages/element-plus/crud/column/column.js +12 -0
- package/lib/packages/element-plus/crud/column/column2.js +101 -0
- package/lib/packages/element-plus/crud/column/column3.js +51 -0
- package/lib/packages/element-plus/crud/column/menu.js +12 -0
- package/lib/packages/element-plus/crud/column/menu2.js +57 -0
- package/lib/packages/element-plus/crud/column/menu3.js +59 -0
- package/lib/packages/element-plus/crud/config.js +8 -3
- package/lib/packages/element-plus/crud/dialog/dialog-column.js +12 -0
- package/lib/packages/element-plus/crud/dialog/dialog-column2.js +69 -0
- package/lib/packages/element-plus/crud/dialog/dialog-column3.js +73 -0
- package/lib/packages/element-plus/crud/dialog/dialog-excel.js +12 -0
- package/lib/packages/element-plus/crud/dialog/dialog-excel2.js +186 -0
- package/lib/packages/element-plus/crud/dialog/dialog-excel3.js +61 -0
- package/lib/packages/element-plus/crud/dialog/dialog-filter.js +12 -0
- package/lib/packages/element-plus/crud/dialog/dialog-filter2.js +102 -0
- package/lib/packages/element-plus/crud/dialog/dialog-filter3.js +148 -0
- package/lib/packages/element-plus/crud/dialog/dialog-form.js +12 -0
- package/lib/packages/element-plus/crud/dialog/dialog-form2.js +259 -0
- package/lib/packages/element-plus/crud/dialog/dialog-form3.js +143 -0
- package/lib/packages/element-plus/crud/grid/index.js +12 -0
- package/lib/packages/element-plus/crud/grid/index2.js +184 -0
- package/lib/packages/element-plus/crud/grid/index3.js +129 -0
- package/lib/packages/element-plus/crud/grid/item.js +12 -0
- package/lib/packages/element-plus/crud/grid/item2.js +40 -0
- package/lib/packages/element-plus/crud/grid/item3.js +8 -0
- package/lib/packages/element-plus/crud/index.js +12 -0
- package/lib/packages/element-plus/crud/index2.js +845 -0
- package/lib/packages/element-plus/crud/index3.js +289 -0
- package/lib/packages/element-plus/crud/menu/header-menu.js +12 -0
- package/lib/packages/element-plus/crud/menu/header-menu2.js +87 -0
- package/lib/packages/element-plus/crud/menu/header-menu3.js +173 -0
- package/lib/packages/element-plus/crud/menu/header-search.js +12 -0
- package/lib/packages/element-plus/crud/menu/header-search2.js +191 -0
- package/lib/packages/element-plus/crud/menu/header-search3.js +86 -0
- package/lib/packages/element-plus/crud/menu/table-page.js +12 -0
- package/lib/packages/element-plus/crud/menu/table-page2.js +92 -0
- package/lib/packages/element-plus/crud/menu/table-page3.js +42 -0
- package/lib/packages/element-plus/date/index.js +12 -0
- package/lib/packages/element-plus/date/index2.js +43 -0
- package/lib/packages/element-plus/date/index3.js +64 -0
- package/lib/packages/element-plus/draggable/index.js +12 -0
- package/lib/packages/element-plus/draggable/index2.js +406 -0
- package/lib/packages/element-plus/draggable/index3.js +85 -0
- package/lib/packages/element-plus/dynamic/index.js +12 -0
- package/lib/packages/element-plus/dynamic/index2.js +272 -0
- package/lib/packages/element-plus/dynamic/index3.js +139 -0
- package/lib/packages/element-plus/flow/index.js +12 -0
- package/lib/packages/element-plus/flow/index2.js +316 -0
- package/lib/packages/element-plus/flow/index3.js +47 -0
- package/lib/packages/element-plus/flow/node.js +12 -0
- package/lib/packages/element-plus/flow/node2.js +60 -0
- package/lib/packages/element-plus/flow/node3.js +49 -0
- package/lib/packages/element-plus/form/config.js +8 -3
- package/lib/packages/element-plus/form/index.js +12 -0
- package/lib/packages/element-plus/form/index2.js +709 -0
- package/lib/packages/element-plus/form/index3.js +339 -0
- package/lib/packages/element-plus/form/menu.js +12 -0
- package/lib/packages/element-plus/form/menu2.js +31 -0
- package/lib/packages/element-plus/form/menu3.js +93 -0
- package/lib/packages/element-plus/group/index.js +12 -0
- package/lib/packages/element-plus/group/index2.js +67 -0
- package/lib/packages/element-plus/group/index3.js +75 -0
- package/lib/packages/element-plus/input/index.js +12 -0
- package/lib/packages/element-plus/input/index2.js +1075 -0
- package/lib/packages/element-plus/input/index3.js +318 -0
- package/lib/packages/element-plus/input-color/index.js +12 -0
- package/lib/packages/element-plus/input-color/index2.js +48 -0
- package/lib/packages/element-plus/input-color/index3.js +44 -0
- package/lib/packages/element-plus/input-cron/index.js +12 -0
- package/lib/packages/element-plus/input-cron/index2.js +296 -0
- package/lib/packages/element-plus/input-cron/index3.js +216 -0
- package/lib/packages/element-plus/input-icon/index.js +12 -0
- package/lib/packages/element-plus/input-icon/index2.js +93 -0
- package/lib/packages/element-plus/input-icon/index3.js +98 -0
- package/lib/packages/element-plus/input-map/index.js +12 -0
- package/lib/packages/element-plus/input-map/index2.js +254 -0
- package/lib/packages/element-plus/input-map/index3.js +101 -0
- package/lib/packages/element-plus/input-number/index.js +12 -0
- package/lib/packages/element-plus/input-number/index2.js +66 -0
- package/lib/packages/element-plus/input-number/index3.js +56 -0
- package/lib/packages/element-plus/input-table/index.js +12 -0
- package/lib/packages/element-plus/input-table/index2.js +229 -0
- package/lib/packages/element-plus/input-table/index3.js +79 -0
- package/lib/packages/element-plus/input-tag/index.js +12 -0
- package/lib/packages/element-plus/input-tag/index2.js +55 -0
- package/lib/packages/element-plus/input-tag/index3.js +63 -0
- package/lib/packages/element-plus/input-tree/index.js +12 -0
- package/lib/packages/element-plus/input-tree/index2.js +145 -0
- package/lib/packages/element-plus/input-tree/index3.js +77 -0
- package/lib/packages/element-plus/license/index.js +12 -0
- package/lib/packages/element-plus/license/index2.js +149 -0
- package/lib/packages/element-plus/license/index3.js +21 -0
- package/lib/packages/element-plus/login/index.js +12 -0
- package/lib/packages/element-plus/login/index2.js +132 -0
- package/lib/packages/element-plus/login/index3.js +167 -0
- package/lib/packages/element-plus/mention/index.js +12 -0
- package/lib/packages/element-plus/mention/index2.js +87 -0
- package/lib/packages/element-plus/mention/index3.js +68 -0
- package/lib/packages/element-plus/radio/index.js +12 -0
- package/lib/packages/element-plus/radio/index2.js +27 -0
- package/lib/packages/element-plus/radio/index3.js +40 -0
- package/lib/packages/element-plus/rate/index.js +12 -0
- package/lib/packages/element-plus/rate/index2.js +44 -0
- package/lib/packages/element-plus/rate/index3.js +24 -0
- package/lib/packages/element-plus/search/index.js +12 -0
- package/lib/packages/element-plus/search/index2.js +112 -0
- package/lib/packages/element-plus/search/index3.js +52 -0
- package/lib/packages/element-plus/select/index.js +12 -0
- package/lib/packages/element-plus/select/index2.js +172 -0
- package/lib/packages/element-plus/select/index3.js +162 -0
- package/lib/packages/element-plus/sign/index.js +12 -0
- package/lib/packages/element-plus/sign/index2.js +227 -0
- package/lib/packages/element-plus/sign/index3.js +21 -0
- package/lib/packages/element-plus/slider/index.js +12 -0
- package/lib/packages/element-plus/slider/index2.js +56 -0
- package/lib/packages/element-plus/slider/index3.js +27 -0
- package/lib/packages/element-plus/switch/index.js +12 -0
- package/lib/packages/element-plus/switch/index2.js +57 -0
- package/lib/packages/element-plus/switch/index3.js +31 -0
- package/lib/packages/element-plus/tabs/index.js +12 -0
- package/lib/packages/element-plus/tabs/index2.js +46 -0
- package/lib/packages/element-plus/tabs/index3.js +41 -0
- package/lib/packages/element-plus/text-ellipsis/index.js +12 -0
- package/lib/packages/element-plus/text-ellipsis/index2.js +86 -0
- package/lib/packages/element-plus/text-ellipsis/index3.js +44 -0
- package/lib/packages/element-plus/time/index.js +12 -0
- package/lib/packages/element-plus/time/index2.js +54 -0
- package/lib/packages/element-plus/time/index3.js +42 -0
- package/lib/packages/element-plus/title/index.js +12 -0
- package/lib/packages/element-plus/title/index2.js +29 -0
- package/lib/packages/element-plus/title/index3.js +16 -0
- package/lib/packages/element-plus/tree/index.js +12 -0
- package/lib/packages/element-plus/tree/index2.js +361 -0
- package/lib/packages/element-plus/tree/index3.js +188 -0
- package/lib/packages/element-plus/upload/index.js +12 -0
- package/lib/packages/element-plus/upload/index2.js +521 -0
- package/lib/packages/element-plus/upload/index3.js +375 -0
- package/lib/packages/element-plus/verify/index.js +12 -0
- package/lib/packages/element-plus/verify/index2.js +56 -0
- package/lib/packages/element-plus/verify/index3.js +20 -0
- package/lib/packages/element-plus/video/index.js +12 -0
- package/lib/packages/element-plus/video/index2.js +76 -0
- package/lib/packages/element-plus/video/index3.js +43 -0
- package/lib/src/core/create.js +16 -0
- package/lib/src/core/dataformat.js +196 -0
- package/lib/src/core/detail.js +80 -0
- package/lib/src/core/dic.js +221 -0
- package/lib/src/core/locale.js +16 -0
- package/lib/src/core/packages.js +69 -0
- package/lib/src/core/slot.js +39 -0
- package/lib/src/global/variable.js +99 -0
- package/lib/src/icon.js +37 -0
- package/lib/src/index.js +139 -0
- package/lib/src/locale/index.js +159 -0
- package/lib/src/locale/lang/en.js +289 -0
- package/lib/src/locale/lang/zh-cn.js +289 -0
- package/lib/src/locale/lang/zh.js +289 -0
- package/lib/src/plugin/ali/index.js +9 -0
- package/lib/src/plugin/clipboard/index.js +68 -0
- package/lib/src/plugin/export/_blob.js +153 -0
- package/lib/src/plugin/export/_export2Excel.js +146 -0
- package/lib/src/plugin/export/index.js +271 -0
- package/lib/src/plugin/logs/index.js +50 -0
- package/lib/src/plugin/print/index.js +151 -0
- package/lib/src/plugin/qiniu/index.js +71 -0
- package/lib/src/plugin/screenshot/index.js +16 -0
- package/lib/src/plugin/video/index.js +59 -0
- package/lib/src/plugin/watermark/index.js +123 -0
- package/lib/src/plugin/watermark/watermark.js +116 -0
- package/lib/src/ui/data/index.js +79 -0
- package/lib/src/ui/element-plus/index.js +136 -0
- package/lib/src/ui/index.js +11 -0
- package/lib/src/utils/bem.js +36 -0
- package/lib/src/utils/mock.js +145 -0
- package/lib/src/utils/util.js +408 -0
- package/lib/src/utils/validate.js +23 -0
- package/lib/src/version.js +6 -0
- package/package.json +85 -89
- package/types/index.d.ts +139 -139
- package/types/shims-aliases.d.ts +4 -4
- package/dist/avue.min.mjs +0 -2
- package/dist/avue.mjs +0 -2
- package/es/avue.min.ts +0 -2
- package/es/avue.ts +0 -2
- package/es/core/create.mjs +0 -8
- package/es/core/create.ts +0 -16
- package/es/core/dataformat.mjs +0 -184
- package/es/core/dataformat.ts +0 -190
- package/es/core/detail.mjs +0 -74
- package/es/core/detail.ts +0 -81
- package/es/core/dic.mjs +0 -213
- package/es/core/dic.ts +0 -235
- package/es/core/locale.mjs +0 -8
- package/es/core/locale.ts +0 -9
- package/es/core/packages.mjs +0 -61
- package/es/core/packages.ts +0 -62
- package/es/core/slot.mjs +0 -32
- package/es/core/slot.ts +0 -30
- package/es/global/variable.mjs +0 -80
- package/es/global/variable.ts +0 -84
- package/es/icon.mjs +0 -9
- package/es/icon.ts +0 -11
- package/es/index.ts +0 -177
- package/es/locale/index.mjs +0 -141
- package/es/locale/index.ts +0 -196
- package/es/locale/lang/en.mjs +0 -282
- package/es/locale/lang/en.ts +0 -282
- package/es/locale/lang/zh-cn.mjs +0 -282
- package/es/locale/lang/zh-cn.ts +0 -282
- package/es/locale/lang/zh.mjs +0 -282
- package/es/locale/lang/zh.ts +0 -282
- package/es/packages/core/common/event.ts +0 -56
- package/es/packages/core/common/init.ts +0 -133
- package/es/packages/core/common/props.ts +0 -240
- package/es/packages/core/components/dialog-form/index.ts +0 -29
- package/es/packages/core/components/dialog-form/index.vue +0 -108
- package/es/packages/core/components/form/custom.ts +0 -41
- package/es/packages/core/components/form/index.vue +0 -176
- package/es/packages/core/components/icon/index.vue +0 -37
- package/es/packages/core/components/image-preview/index.ts +0 -37
- package/es/packages/core/components/image-preview/index.vue +0 -215
- package/es/packages/core/directive/contextmenu.ts +0 -103
- package/es/packages/core/directive/permission.ts +0 -18
- package/es/packages/data/box/index.vue +0 -66
- package/es/packages/data/card/index.vue +0 -62
- package/es/packages/data/cardText/index.vue +0 -56
- package/es/packages/data/countdown/index.vue +0 -81
- package/es/packages/data/dashboard/index.vue +0 -72
- package/es/packages/data/display/index.vue +0 -63
- package/es/packages/data/icons/index.vue +0 -68
- package/es/packages/data/imgText/index.vue +0 -72
- package/es/packages/data/list/index.vue +0 -69
- package/es/packages/data/notice/index.vue +0 -63
- package/es/packages/data/operaText/index.vue +0 -62
- package/es/packages/data/panel/index.vue +0 -62
- package/es/packages/data/pay/index.vue +0 -92
- package/es/packages/data/price/index.vue +0 -55
- package/es/packages/data/product/index.vue +0 -106
- package/es/packages/data/profile/index.vue +0 -91
- package/es/packages/data/progress/index.vue +0 -64
- package/es/packages/data/rank/index.vue +0 -92
- package/es/packages/data/rotate/index.vue +0 -69
- package/es/packages/data/statistic/index.vue +0 -71
- package/es/packages/data/tabs/index.vue +0 -64
- package/es/packages/data/task/index.vue +0 -82
- package/es/packages/data/weather/index.vue +0 -103
- package/es/packages/element-plus/array/index.vue +0 -115
- package/es/packages/element-plus/article/index.vue +0 -73
- package/es/packages/element-plus/card/index.vue +0 -103
- package/es/packages/element-plus/cascader/index.vue +0 -132
- package/es/packages/element-plus/chat/index.vue +0 -513
- package/es/packages/element-plus/checkbox/index.vue +0 -84
- package/es/packages/element-plus/comment/index.vue +0 -76
- package/es/packages/element-plus/count-up/index.vue +0 -109
- package/es/packages/element-plus/crud/column/column-default.vue +0 -128
- package/es/packages/element-plus/crud/column/column-dynamic.vue +0 -86
- package/es/packages/element-plus/crud/column/column-menu.vue +0 -267
- package/es/packages/element-plus/crud/column/column-slot.vue +0 -348
- package/es/packages/element-plus/crud/column/column.vue +0 -119
- package/es/packages/element-plus/crud/column/menu.vue +0 -78
- package/es/packages/element-plus/crud/config.ts +0 -74
- package/es/packages/element-plus/crud/dialog/dialog-column.vue +0 -102
- package/es/packages/element-plus/crud/dialog/dialog-excel.vue +0 -204
- package/es/packages/element-plus/crud/dialog/dialog-filter.vue +0 -159
- package/es/packages/element-plus/crud/dialog/dialog-form.vue +0 -352
- package/es/packages/element-plus/crud/grid/index.vue +0 -271
- package/es/packages/element-plus/crud/grid/item.vue +0 -39
- package/es/packages/element-plus/crud/index.vue +0 -1018
- package/es/packages/element-plus/crud/menu/header-menu.vue +0 -175
- package/es/packages/element-plus/crud/menu/header-search.vue +0 -228
- package/es/packages/element-plus/crud/menu/table-page.vue +0 -108
- package/es/packages/element-plus/date/index.vue +0 -81
- package/es/packages/element-plus/draggable/index.vue +0 -444
- package/es/packages/element-plus/dynamic/index.vue +0 -353
- package/es/packages/element-plus/flow/index.vue +0 -339
- package/es/packages/element-plus/flow/node.vue +0 -84
- package/es/packages/element-plus/form/config.ts +0 -6
- package/es/packages/element-plus/form/index.vue +0 -954
- package/es/packages/element-plus/form/menu.vue +0 -63
- package/es/packages/element-plus/group/index.vue +0 -90
- package/es/packages/element-plus/input/index.vue +0 -1264
- package/es/packages/element-plus/input-color/index.vue +0 -70
- package/es/packages/element-plus/input-cron/index.vue +0 -363
- package/es/packages/element-plus/input-icon/index.vue +0 -143
- package/es/packages/element-plus/input-map/index.vue +0 -311
- package/es/packages/element-plus/input-number/index.vue +0 -91
- package/es/packages/element-plus/input-table/index.vue +0 -279
- package/es/packages/element-plus/input-tag/index.vue +0 -79
- package/es/packages/element-plus/input-tree/index.vue +0 -194
- package/es/packages/element-plus/license/index.vue +0 -155
- package/es/packages/element-plus/login/index.vue +0 -203
- package/es/packages/element-plus/mention/index.vue +0 -117
- package/es/packages/element-plus/radio/index.vue +0 -38
- package/es/packages/element-plus/rate/index.vue +0 -51
- package/es/packages/element-plus/search/index.vue +0 -129
- package/es/packages/element-plus/select/index.vue +0 -292
- package/es/packages/element-plus/sign/index.vue +0 -230
- package/es/packages/element-plus/slider/index.vue +0 -66
- package/es/packages/element-plus/switch/index.vue +0 -72
- package/es/packages/element-plus/tabs/index.vue +0 -62
- package/es/packages/element-plus/text-ellipsis/index.vue +0 -104
- package/es/packages/element-plus/time/index.vue +0 -81
- package/es/packages/element-plus/title/index.vue +0 -30
- package/es/packages/element-plus/tree/index.vue +0 -460
- package/es/packages/element-plus/upload/index.vue +0 -728
- package/es/packages/element-plus/verify/index.vue +0 -62
- package/es/packages/element-plus/video/index.vue +0 -90
- package/es/plugin/ali/index.mjs +0 -4
- package/es/plugin/ali/index.ts +0 -6
- package/es/plugin/clipboard/index.mjs +0 -61
- package/es/plugin/clipboard/index.ts +0 -67
- package/es/plugin/export/_blob.mjs +0 -151
- package/es/plugin/export/_blob.ts +0 -176
- package/es/plugin/export/_export2Excel.mjs +0 -141
- package/es/plugin/export/_export2Excel.ts +0 -166
- package/es/plugin/export/index.mjs +0 -263
- package/es/plugin/export/index.ts +0 -274
- package/es/plugin/logs/index.mjs +0 -46
- package/es/plugin/logs/index.ts +0 -66
- package/es/plugin/print/index.mjs +0 -145
- package/es/plugin/print/index.ts +0 -155
- package/es/plugin/qiniu/index.mjs +0 -78
- package/es/plugin/qiniu/index.ts +0 -88
- package/es/plugin/screenshot/index.mjs +0 -8
- package/es/plugin/screenshot/index.ts +0 -9
- package/es/plugin/video/index.mjs +0 -52
- package/es/plugin/video/index.ts +0 -60
- package/es/plugin/watermark/index.mjs +0 -114
- package/es/plugin/watermark/index.ts +0 -127
- package/es/plugin/watermark/watermark.mjs +0 -109
- package/es/plugin/watermark/watermark.ts +0 -121
- package/es/ui/data/index.mjs +0 -49
- package/es/ui/data/index.ts +0 -51
- package/es/ui/element-plus/index.mjs +0 -87
- package/es/ui/element-plus/index.ts +0 -89
- package/es/ui/index.mjs +0 -4
- package/es/ui/index.ts +0 -6
- package/es/utils/bem.mjs +0 -29
- package/es/utils/bem.ts +0 -36
- package/es/utils/mock.mjs +0 -137
- package/es/utils/mock.ts +0 -151
- package/es/utils/util.mjs +0 -370
- package/es/utils/util.ts +0 -392
- package/es/utils/validate.mjs +0 -18
- package/es/utils/validate.ts +0 -23
- package/es/version.mjs +0 -1
- package/es/version.ts +0 -1
- package/lib/avue.min.ts +0 -2
- package/lib/avue.ts +0 -2
- package/lib/core/create.js +0 -14
- package/lib/core/create.ts +0 -16
- package/lib/core/dataformat.js +0 -194
- package/lib/core/dataformat.ts +0 -190
- package/lib/core/detail.js +0 -81
- package/lib/core/detail.ts +0 -81
- package/lib/core/dic.js +0 -220
- package/lib/core/dic.ts +0 -235
- package/lib/core/locale.js +0 -10
- package/lib/core/locale.ts +0 -9
- package/lib/core/packages.js +0 -66
- package/lib/core/packages.ts +0 -62
- package/lib/core/slot.js +0 -34
- package/lib/core/slot.ts +0 -30
- package/lib/global/variable.js +0 -83
- package/lib/global/variable.ts +0 -84
- package/lib/icon.js +0 -44
- package/lib/icon.ts +0 -11
- package/lib/index.ts +0 -177
- package/lib/locale/index.js +0 -153
- package/lib/locale/index.ts +0 -196
- package/lib/locale/lang/en.js +0 -284
- package/lib/locale/lang/en.ts +0 -282
- package/lib/locale/lang/zh-cn.js +0 -284
- package/lib/locale/lang/zh-cn.ts +0 -282
- package/lib/locale/lang/zh.js +0 -284
- package/lib/locale/lang/zh.ts +0 -282
- package/lib/packages/core/common/event.ts +0 -56
- package/lib/packages/core/common/init.ts +0 -133
- package/lib/packages/core/common/props.ts +0 -240
- package/lib/packages/core/components/dialog-form/index.ts +0 -29
- package/lib/packages/core/components/dialog-form/index.vue +0 -108
- package/lib/packages/core/components/form/custom.ts +0 -41
- package/lib/packages/core/components/form/index.vue +0 -176
- package/lib/packages/core/components/icon/index.vue +0 -37
- package/lib/packages/core/components/image-preview/index.ts +0 -37
- package/lib/packages/core/components/image-preview/index.vue +0 -215
- package/lib/packages/core/directive/contextmenu.ts +0 -103
- package/lib/packages/core/directive/permission.ts +0 -18
- package/lib/packages/data/box/index.vue +0 -66
- package/lib/packages/data/card/index.vue +0 -62
- package/lib/packages/data/cardText/index.vue +0 -56
- package/lib/packages/data/countdown/index.vue +0 -81
- package/lib/packages/data/dashboard/index.vue +0 -72
- package/lib/packages/data/display/index.vue +0 -63
- package/lib/packages/data/icons/index.vue +0 -68
- package/lib/packages/data/imgText/index.vue +0 -72
- package/lib/packages/data/list/index.vue +0 -69
- package/lib/packages/data/notice/index.vue +0 -63
- package/lib/packages/data/operaText/index.vue +0 -62
- package/lib/packages/data/panel/index.vue +0 -62
- package/lib/packages/data/pay/index.vue +0 -92
- package/lib/packages/data/price/index.vue +0 -55
- package/lib/packages/data/product/index.vue +0 -106
- package/lib/packages/data/profile/index.vue +0 -91
- package/lib/packages/data/progress/index.vue +0 -64
- package/lib/packages/data/rank/index.vue +0 -92
- package/lib/packages/data/rotate/index.vue +0 -69
- package/lib/packages/data/statistic/index.vue +0 -71
- package/lib/packages/data/tabs/index.vue +0 -64
- package/lib/packages/data/task/index.vue +0 -82
- package/lib/packages/data/weather/index.vue +0 -103
- package/lib/packages/element-plus/array/index.vue +0 -115
- package/lib/packages/element-plus/article/index.vue +0 -73
- package/lib/packages/element-plus/card/index.vue +0 -103
- package/lib/packages/element-plus/cascader/index.vue +0 -132
- package/lib/packages/element-plus/chat/index.vue +0 -513
- package/lib/packages/element-plus/checkbox/index.vue +0 -84
- package/lib/packages/element-plus/comment/index.vue +0 -76
- package/lib/packages/element-plus/count-up/index.vue +0 -109
- package/lib/packages/element-plus/crud/column/column-default.vue +0 -128
- package/lib/packages/element-plus/crud/column/column-dynamic.vue +0 -86
- package/lib/packages/element-plus/crud/column/column-menu.vue +0 -267
- package/lib/packages/element-plus/crud/column/column-slot.vue +0 -348
- package/lib/packages/element-plus/crud/column/column.vue +0 -119
- package/lib/packages/element-plus/crud/column/menu.vue +0 -78
- package/lib/packages/element-plus/crud/config.ts +0 -74
- package/lib/packages/element-plus/crud/dialog/dialog-column.vue +0 -102
- package/lib/packages/element-plus/crud/dialog/dialog-excel.vue +0 -204
- package/lib/packages/element-plus/crud/dialog/dialog-filter.vue +0 -159
- package/lib/packages/element-plus/crud/dialog/dialog-form.vue +0 -352
- package/lib/packages/element-plus/crud/grid/index.vue +0 -271
- package/lib/packages/element-plus/crud/grid/item.vue +0 -39
- package/lib/packages/element-plus/crud/index.vue +0 -1018
- package/lib/packages/element-plus/crud/menu/header-menu.vue +0 -175
- package/lib/packages/element-plus/crud/menu/header-search.vue +0 -228
- package/lib/packages/element-plus/crud/menu/table-page.vue +0 -108
- package/lib/packages/element-plus/date/index.vue +0 -81
- package/lib/packages/element-plus/draggable/index.vue +0 -444
- package/lib/packages/element-plus/dynamic/index.vue +0 -353
- package/lib/packages/element-plus/flow/index.vue +0 -339
- package/lib/packages/element-plus/flow/node.vue +0 -84
- package/lib/packages/element-plus/form/config.ts +0 -6
- package/lib/packages/element-plus/form/index.vue +0 -954
- package/lib/packages/element-plus/form/menu.vue +0 -63
- package/lib/packages/element-plus/group/index.vue +0 -90
- package/lib/packages/element-plus/input/index.vue +0 -1264
- package/lib/packages/element-plus/input-color/index.vue +0 -70
- package/lib/packages/element-plus/input-cron/index.vue +0 -363
- package/lib/packages/element-plus/input-icon/index.vue +0 -143
- package/lib/packages/element-plus/input-map/index.vue +0 -311
- package/lib/packages/element-plus/input-number/index.vue +0 -91
- package/lib/packages/element-plus/input-table/index.vue +0 -279
- package/lib/packages/element-plus/input-tag/index.vue +0 -79
- package/lib/packages/element-plus/input-tree/index.vue +0 -194
- package/lib/packages/element-plus/license/index.vue +0 -155
- package/lib/packages/element-plus/login/index.vue +0 -203
- package/lib/packages/element-plus/mention/index.vue +0 -117
- package/lib/packages/element-plus/radio/index.vue +0 -38
- package/lib/packages/element-plus/rate/index.vue +0 -51
- package/lib/packages/element-plus/search/index.vue +0 -129
- package/lib/packages/element-plus/select/index.vue +0 -292
- package/lib/packages/element-plus/sign/index.vue +0 -230
- package/lib/packages/element-plus/slider/index.vue +0 -66
- package/lib/packages/element-plus/switch/index.vue +0 -72
- package/lib/packages/element-plus/tabs/index.vue +0 -62
- package/lib/packages/element-plus/text-ellipsis/index.vue +0 -104
- package/lib/packages/element-plus/time/index.vue +0 -81
- package/lib/packages/element-plus/title/index.vue +0 -30
- package/lib/packages/element-plus/tree/index.vue +0 -460
- package/lib/packages/element-plus/upload/index.vue +0 -728
- package/lib/packages/element-plus/verify/index.vue +0 -62
- package/lib/packages/element-plus/video/index.vue +0 -90
- package/lib/plugin/ali/index.js +0 -8
- package/lib/plugin/ali/index.ts +0 -6
- package/lib/plugin/clipboard/index.js +0 -64
- package/lib/plugin/clipboard/index.ts +0 -67
- package/lib/plugin/export/_blob.js +0 -151
- package/lib/plugin/export/_blob.ts +0 -176
- package/lib/plugin/export/_export2Excel.js +0 -145
- package/lib/plugin/export/_export2Excel.ts +0 -166
- package/lib/plugin/export/index.js +0 -268
- package/lib/plugin/export/index.ts +0 -274
- package/lib/plugin/logs/index.js +0 -48
- package/lib/plugin/logs/index.ts +0 -66
- package/lib/plugin/print/index.js +0 -147
- package/lib/plugin/print/index.ts +0 -155
- package/lib/plugin/qiniu/index.js +0 -82
- package/lib/plugin/qiniu/index.ts +0 -88
- package/lib/plugin/screenshot/index.js +0 -14
- package/lib/plugin/screenshot/index.ts +0 -9
- package/lib/plugin/video/index.js +0 -55
- package/lib/plugin/video/index.ts +0 -60
- package/lib/plugin/watermark/index.js +0 -121
- package/lib/plugin/watermark/index.ts +0 -127
- package/lib/plugin/watermark/watermark.js +0 -111
- package/lib/plugin/watermark/watermark.ts +0 -121
- package/lib/ui/data/index.js +0 -54
- package/lib/ui/data/index.ts +0 -51
- package/lib/ui/element-plus/index.js +0 -92
- package/lib/ui/element-plus/index.ts +0 -89
- package/lib/ui/index.js +0 -9
- package/lib/ui/index.ts +0 -6
- package/lib/utils/bem.js +0 -31
- package/lib/utils/bem.ts +0 -36
- package/lib/utils/mock.js +0 -142
- package/lib/utils/mock.ts +0 -151
- package/lib/utils/util.js +0 -403
- package/lib/utils/util.ts +0 -392
- package/lib/utils/validate.js +0 -21
- package/lib/utils/validate.ts +0 -23
- package/lib/version.js +0 -4
- package/lib/version.ts +0 -1
|
@@ -0,0 +1,1071 @@
|
|
|
1
|
+
/*! Avue.js v3.8.6 | (c) 2017-2026 Smallwei | Released under the MIT License. */
|
|
2
|
+
import create from '../../../src/core/create.mjs';
|
|
3
|
+
import props from '../../core/common/props.mjs';
|
|
4
|
+
import event from '../../core/common/event.mjs';
|
|
5
|
+
import locale from '../../../src/core/locale.mjs';
|
|
6
|
+
|
|
7
|
+
const defaultPhoneCodeOptions = [
|
|
8
|
+
{ code: '+86', flag: '🇨🇳', nameKey: 'input.countries.cn' },
|
|
9
|
+
{ code: '+852', flag: '🇭🇰', nameKey: 'input.countries.hk' },
|
|
10
|
+
{ code: '+853', flag: '🇲🇴', nameKey: 'input.countries.mo' },
|
|
11
|
+
{ code: '+886', flag: '🇹🇼', nameKey: 'input.countries.tw' },
|
|
12
|
+
{ code: '+1', flag: '🇺🇸', nameKey: 'input.countries.usca' },
|
|
13
|
+
{ code: '+44', flag: '🇬🇧', nameKey: 'input.countries.uk' },
|
|
14
|
+
{ code: '+81', flag: '🇯🇵', nameKey: 'input.countries.jp' },
|
|
15
|
+
{ code: '+82', flag: '🇰🇷', nameKey: 'input.countries.kr' },
|
|
16
|
+
{ code: '+65', flag: '🇸🇬', nameKey: 'input.countries.sg' },
|
|
17
|
+
{ code: '+61', flag: '🇦🇺', nameKey: 'input.countries.au' },
|
|
18
|
+
{ code: '+49', flag: '🇩🇪', nameKey: 'input.countries.de' },
|
|
19
|
+
{ code: '+33', flag: '🇫🇷', nameKey: 'input.countries.fr' },
|
|
20
|
+
{ code: '+39', flag: '🇮🇹', nameKey: 'input.countries.it' },
|
|
21
|
+
{ code: '+7', flag: '🇷🇺', nameKey: 'input.countries.ru' },
|
|
22
|
+
{ code: '+91', flag: '🇮🇳', nameKey: 'input.countries.in' },
|
|
23
|
+
{ code: '+55', flag: '🇧🇷', nameKey: 'input.countries.br' },
|
|
24
|
+
{ code: '+34', flag: '🇪🇸', nameKey: 'input.countries.es' },
|
|
25
|
+
{ code: '+31', flag: '🇳🇱', nameKey: 'input.countries.nl' },
|
|
26
|
+
{ code: '+41', flag: '🇨🇭', nameKey: 'input.countries.ch' },
|
|
27
|
+
{ code: '+46', flag: '🇸🇪', nameKey: 'input.countries.se' },
|
|
28
|
+
{ code: '+60', flag: '🇲🇾', nameKey: 'input.countries.my' },
|
|
29
|
+
{ code: '+66', flag: '🇹🇭', nameKey: 'input.countries.th' },
|
|
30
|
+
{ code: '+84', flag: '🇻🇳', nameKey: 'input.countries.vn' },
|
|
31
|
+
{ code: '+62', flag: '🇮🇩', nameKey: 'input.countries.id' },
|
|
32
|
+
{ code: '+63', flag: '🇵🇭', nameKey: 'input.countries.ph' }
|
|
33
|
+
];
|
|
34
|
+
|
|
35
|
+
// 货币符号映射
|
|
36
|
+
const currencySymbols = {
|
|
37
|
+
CNY: '¥',
|
|
38
|
+
USD: '$',
|
|
39
|
+
EUR: '€',
|
|
40
|
+
GBP: '£',
|
|
41
|
+
JPY: '¥',
|
|
42
|
+
HKD: 'HK$',
|
|
43
|
+
KRW: '₩',
|
|
44
|
+
SGD: 'S$',
|
|
45
|
+
AUD: 'A$',
|
|
46
|
+
CAD: 'C$'
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
var script = create({
|
|
50
|
+
name: "input",
|
|
51
|
+
mixins: [props(), event(), locale],
|
|
52
|
+
emits: ['update:modelValue', 'click', 'focus', 'blur', 'change', 'id-card-valid', 'code-complete', 'uscc-valid'],
|
|
53
|
+
data() {
|
|
54
|
+
return {
|
|
55
|
+
// 手机号相关
|
|
56
|
+
phoneCode: '+86',
|
|
57
|
+
phoneNumber: '',
|
|
58
|
+
// 货币相关
|
|
59
|
+
currencyDisplay: '',
|
|
60
|
+
currencyEditing: false,
|
|
61
|
+
// 银行卡相关
|
|
62
|
+
bankCardDisplay: '',
|
|
63
|
+
bankCardType: '',
|
|
64
|
+
// 身份证相关
|
|
65
|
+
idCardDisplay: '',
|
|
66
|
+
idCardValid: null,
|
|
67
|
+
idCardInfo: null,
|
|
68
|
+
// 邮箱相关
|
|
69
|
+
emailDisplay: '',
|
|
70
|
+
emailValid: null,
|
|
71
|
+
showEmailSuggestions: false,
|
|
72
|
+
// 验证码相关
|
|
73
|
+
codeValues: [],
|
|
74
|
+
codeRefs: [],
|
|
75
|
+
// 车牌号相关
|
|
76
|
+
plateProvince: '',
|
|
77
|
+
plateNumber: '',
|
|
78
|
+
// IP地址相关
|
|
79
|
+
ipSegments: ['', '', '', ''],
|
|
80
|
+
ipRefs: [],
|
|
81
|
+
// MAC地址相关
|
|
82
|
+
macSegments: ['', '', '', '', '', ''],
|
|
83
|
+
macRefs: [],
|
|
84
|
+
// 社会信用代码相关
|
|
85
|
+
usccDisplay: '',
|
|
86
|
+
usccValid: null
|
|
87
|
+
};
|
|
88
|
+
},
|
|
89
|
+
props: {
|
|
90
|
+
showPassword: {
|
|
91
|
+
type: Boolean,
|
|
92
|
+
default: true
|
|
93
|
+
},
|
|
94
|
+
showWordLimit: {
|
|
95
|
+
type: Boolean,
|
|
96
|
+
default: false
|
|
97
|
+
},
|
|
98
|
+
target: {
|
|
99
|
+
type: String,
|
|
100
|
+
default: ' _blank'
|
|
101
|
+
},
|
|
102
|
+
prefixIcon: {
|
|
103
|
+
type: String
|
|
104
|
+
},
|
|
105
|
+
suffixIcon: {
|
|
106
|
+
type: String
|
|
107
|
+
},
|
|
108
|
+
prependClick: {
|
|
109
|
+
type: Function
|
|
110
|
+
},
|
|
111
|
+
prepend: {
|
|
112
|
+
type: String
|
|
113
|
+
},
|
|
114
|
+
appendClick: {
|
|
115
|
+
type: Function
|
|
116
|
+
},
|
|
117
|
+
formatters: {
|
|
118
|
+
type: Function
|
|
119
|
+
},
|
|
120
|
+
parser: {
|
|
121
|
+
type: Function
|
|
122
|
+
},
|
|
123
|
+
append: {
|
|
124
|
+
type: String
|
|
125
|
+
},
|
|
126
|
+
minlength: [String, Number],
|
|
127
|
+
maxlength: [String, Number],
|
|
128
|
+
rows: Number,
|
|
129
|
+
minRows: {
|
|
130
|
+
type: Number,
|
|
131
|
+
default: 5
|
|
132
|
+
},
|
|
133
|
+
maxRows: {
|
|
134
|
+
type: Number,
|
|
135
|
+
default: 10
|
|
136
|
+
},
|
|
137
|
+
autocomplete: {
|
|
138
|
+
type: String
|
|
139
|
+
},
|
|
140
|
+
// ========== 手机号相关配置 ==========
|
|
141
|
+
// 默认区号
|
|
142
|
+
defaultPhoneCode: {
|
|
143
|
+
type: String,
|
|
144
|
+
default: '+86'
|
|
145
|
+
},
|
|
146
|
+
// 区号列表
|
|
147
|
+
phoneCodeOptions: {
|
|
148
|
+
type: Array,
|
|
149
|
+
default: () => []
|
|
150
|
+
},
|
|
151
|
+
// 手机号最大长度
|
|
152
|
+
phoneMaxLength: {
|
|
153
|
+
type: Number,
|
|
154
|
+
default: 11
|
|
155
|
+
},
|
|
156
|
+
// 区号选择器占位符
|
|
157
|
+
phoneCodePlaceholder: {
|
|
158
|
+
type: String,
|
|
159
|
+
default: ''
|
|
160
|
+
},
|
|
161
|
+
// 手机号输入框占位符
|
|
162
|
+
phonePlaceholder: {
|
|
163
|
+
type: String,
|
|
164
|
+
default: ''
|
|
165
|
+
},
|
|
166
|
+
|
|
167
|
+
// ========== 货币相关配置 ==========
|
|
168
|
+
// 货币类型
|
|
169
|
+
currency: {
|
|
170
|
+
type: String,
|
|
171
|
+
default: 'CNY'
|
|
172
|
+
},
|
|
173
|
+
// 自定义货币符号
|
|
174
|
+
currencySymbolCustom: {
|
|
175
|
+
type: String,
|
|
176
|
+
default: ''
|
|
177
|
+
},
|
|
178
|
+
// 货币单位(如:元、万元)
|
|
179
|
+
currencyUnit: {
|
|
180
|
+
type: String,
|
|
181
|
+
default: ''
|
|
182
|
+
},
|
|
183
|
+
// 小数位数
|
|
184
|
+
currencyPrecision: {
|
|
185
|
+
type: Number,
|
|
186
|
+
default: 2
|
|
187
|
+
},
|
|
188
|
+
// 货币占位符
|
|
189
|
+
currencyPlaceholder: {
|
|
190
|
+
type: String,
|
|
191
|
+
default: ''
|
|
192
|
+
},
|
|
193
|
+
// 最小值
|
|
194
|
+
currencyMin: {
|
|
195
|
+
type: Number,
|
|
196
|
+
default: undefined
|
|
197
|
+
},
|
|
198
|
+
// 最大值
|
|
199
|
+
currencyMax: {
|
|
200
|
+
type: Number,
|
|
201
|
+
default: undefined
|
|
202
|
+
},
|
|
203
|
+
|
|
204
|
+
// ========== 银行卡相关配置 ==========
|
|
205
|
+
// 分隔符
|
|
206
|
+
bankCardSeparator: {
|
|
207
|
+
type: String,
|
|
208
|
+
default: ' '
|
|
209
|
+
},
|
|
210
|
+
// 分段长度
|
|
211
|
+
bankCardSegment: {
|
|
212
|
+
type: Number,
|
|
213
|
+
default: 4
|
|
214
|
+
},
|
|
215
|
+
// 银行卡最大长度(不含分隔符)
|
|
216
|
+
bankCardMaxDigits: {
|
|
217
|
+
type: Number,
|
|
218
|
+
default: 19
|
|
219
|
+
},
|
|
220
|
+
// 银行卡占位符
|
|
221
|
+
bankCardPlaceholder: {
|
|
222
|
+
type: String,
|
|
223
|
+
default: ''
|
|
224
|
+
},
|
|
225
|
+
// 是否显示银行卡类型
|
|
226
|
+
showBankCardType: {
|
|
227
|
+
type: Boolean,
|
|
228
|
+
default: true
|
|
229
|
+
},
|
|
230
|
+
|
|
231
|
+
// ========== 身份证相关配置 ==========
|
|
232
|
+
// 身份证占位符
|
|
233
|
+
idCardPlaceholder: {
|
|
234
|
+
type: String,
|
|
235
|
+
default: ''
|
|
236
|
+
},
|
|
237
|
+
// 是否显示身份证信息
|
|
238
|
+
showIdCardInfo: {
|
|
239
|
+
type: Boolean,
|
|
240
|
+
default: true
|
|
241
|
+
},
|
|
242
|
+
// 是否实时校验
|
|
243
|
+
idCardRealtimeValidate: {
|
|
244
|
+
type: Boolean,
|
|
245
|
+
default: true
|
|
246
|
+
},
|
|
247
|
+
|
|
248
|
+
// ========== 邮箱相关配置 ==========
|
|
249
|
+
emailPlaceholder: {
|
|
250
|
+
type: String,
|
|
251
|
+
default: ''
|
|
252
|
+
},
|
|
253
|
+
// 邮箱后缀建议列表
|
|
254
|
+
emailSuffixes: {
|
|
255
|
+
type: Array,
|
|
256
|
+
default: () => ['@qq.com', '@163.com', '@126.com', '@gmail.com', '@outlook.com', '@hotmail.com', '@sina.com', '@sohu.com', '@foxmail.com', '@icloud.com']
|
|
257
|
+
},
|
|
258
|
+
// 是否显示邮箱建议
|
|
259
|
+
showEmailSuffix: {
|
|
260
|
+
type: Boolean,
|
|
261
|
+
default: true
|
|
262
|
+
},
|
|
263
|
+
|
|
264
|
+
// ========== 验证码相关配置 ==========
|
|
265
|
+
codePlaceholder: {
|
|
266
|
+
type: String,
|
|
267
|
+
default: ''
|
|
268
|
+
},
|
|
269
|
+
// 验证码长度
|
|
270
|
+
codeLength: {
|
|
271
|
+
type: Number,
|
|
272
|
+
default: 6
|
|
273
|
+
},
|
|
274
|
+
// 验证码分隔符
|
|
275
|
+
codeSeparator: {
|
|
276
|
+
type: String,
|
|
277
|
+
default: ''
|
|
278
|
+
},
|
|
279
|
+
|
|
280
|
+
// ========== 车牌号相关配置 ==========
|
|
281
|
+
platePlaceholder: {
|
|
282
|
+
type: String,
|
|
283
|
+
default: ''
|
|
284
|
+
},
|
|
285
|
+
// 默认省份
|
|
286
|
+
defaultPlateProvince: {
|
|
287
|
+
type: String,
|
|
288
|
+
default: ''
|
|
289
|
+
},
|
|
290
|
+
// 省份列表
|
|
291
|
+
plateProvinceList: {
|
|
292
|
+
type: Array,
|
|
293
|
+
default: () => []
|
|
294
|
+
},
|
|
295
|
+
|
|
296
|
+
// ========== IP地址相关配置 ==========
|
|
297
|
+
ipPlaceholder: {
|
|
298
|
+
type: String,
|
|
299
|
+
default: ''
|
|
300
|
+
},
|
|
301
|
+
// IP版本 (4 或 6)
|
|
302
|
+
ipVersion: {
|
|
303
|
+
type: Number,
|
|
304
|
+
default: 4
|
|
305
|
+
},
|
|
306
|
+
|
|
307
|
+
// ========== MAC地址相关配置 ==========
|
|
308
|
+
macPlaceholder: {
|
|
309
|
+
type: String,
|
|
310
|
+
default: ''
|
|
311
|
+
},
|
|
312
|
+
// MAC分隔符
|
|
313
|
+
macSeparator: {
|
|
314
|
+
type: String,
|
|
315
|
+
default: ':'
|
|
316
|
+
},
|
|
317
|
+
|
|
318
|
+
// ========== 社会信用代码相关配置 ==========
|
|
319
|
+
usccPlaceholder: {
|
|
320
|
+
type: String,
|
|
321
|
+
default: ''
|
|
322
|
+
},
|
|
323
|
+
// 是否实时校验
|
|
324
|
+
usccRealtimeValidate: {
|
|
325
|
+
type: Boolean,
|
|
326
|
+
default: true
|
|
327
|
+
}
|
|
328
|
+
},
|
|
329
|
+
computed: {
|
|
330
|
+
isSearch() {
|
|
331
|
+
return this.type === 'search';
|
|
332
|
+
},
|
|
333
|
+
isPhone() {
|
|
334
|
+
return this.type === 'phone';
|
|
335
|
+
},
|
|
336
|
+
isCurrency() {
|
|
337
|
+
return this.type === 'currency';
|
|
338
|
+
},
|
|
339
|
+
isBankCard() {
|
|
340
|
+
return this.type === 'bankCard' || this.type === 'bank-card';
|
|
341
|
+
},
|
|
342
|
+
isIdCard() {
|
|
343
|
+
return this.type === 'idCard' || this.type === 'id-card';
|
|
344
|
+
},
|
|
345
|
+
isEmail() {
|
|
346
|
+
return this.type === 'email';
|
|
347
|
+
},
|
|
348
|
+
isCode() {
|
|
349
|
+
return this.type === 'code';
|
|
350
|
+
},
|
|
351
|
+
isPlate() {
|
|
352
|
+
return this.type === 'plate';
|
|
353
|
+
},
|
|
354
|
+
isIp() {
|
|
355
|
+
return this.type === 'ip';
|
|
356
|
+
},
|
|
357
|
+
isMac() {
|
|
358
|
+
return this.type === 'mac';
|
|
359
|
+
},
|
|
360
|
+
isUscc() {
|
|
361
|
+
return this.type === 'uscc';
|
|
362
|
+
},
|
|
363
|
+
isDefault() {
|
|
364
|
+
return !this.isPhone && !this.isCurrency && !this.isBankCard && !this.isIdCard &&
|
|
365
|
+
!this.isEmail && !this.isCode && !this.isPlate && !this.isIp && !this.isMac && !this.isUscc;
|
|
366
|
+
},
|
|
367
|
+
typeParam() {
|
|
368
|
+
if (this.type === "textarea") {
|
|
369
|
+
return "textarea";
|
|
370
|
+
} else if (this.type === "password") {
|
|
371
|
+
return "password";
|
|
372
|
+
} else {
|
|
373
|
+
return "text";
|
|
374
|
+
}
|
|
375
|
+
},
|
|
376
|
+
// ========== 统一输入框计算属性 ==========
|
|
377
|
+
inputClass() {
|
|
378
|
+
if (this.isCurrency) return this.b('currency');
|
|
379
|
+
if (this.isBankCard) return this.b('bank-card');
|
|
380
|
+
if (this.isIdCard) return [this.b('id-card'), this.idCardValid === false ? this.b('id-card--invalid') : ''];
|
|
381
|
+
return '';
|
|
382
|
+
},
|
|
383
|
+
inputValue: {
|
|
384
|
+
get() {
|
|
385
|
+
if (this.isCurrency) return this.currencyDisplay;
|
|
386
|
+
if (this.isBankCard) return this.bankCardDisplay;
|
|
387
|
+
if (this.isIdCard) return this.idCardDisplay;
|
|
388
|
+
if (this.isEmail) return this.emailDisplay;
|
|
389
|
+
if (this.isUscc) return this.usccDisplay;
|
|
390
|
+
return this.text;
|
|
391
|
+
},
|
|
392
|
+
set(val) {
|
|
393
|
+
if (this.isCurrency) this.currencyDisplay = val;
|
|
394
|
+
else if (this.isBankCard) this.bankCardDisplay = val;
|
|
395
|
+
else if (this.isIdCard) this.idCardDisplay = val;
|
|
396
|
+
else if (this.isEmail) this.emailDisplay = val;
|
|
397
|
+
else if (this.isUscc) this.usccDisplay = val;
|
|
398
|
+
else this.text = val;
|
|
399
|
+
}
|
|
400
|
+
},
|
|
401
|
+
inputType() {
|
|
402
|
+
if (this.isEmail) return 'email';
|
|
403
|
+
return this.isDefault ? this.typeParam : 'text';
|
|
404
|
+
},
|
|
405
|
+
inputMaxlength() {
|
|
406
|
+
if (this.isBankCard) return this.bankCardMaxLength;
|
|
407
|
+
if (this.isIdCard) return 18;
|
|
408
|
+
if (this.isUscc) return 18;
|
|
409
|
+
return this.maxlength;
|
|
410
|
+
},
|
|
411
|
+
inputPrefixIcon() {
|
|
412
|
+
return this.prefixIcon;
|
|
413
|
+
},
|
|
414
|
+
inputSuffixIcon() {
|
|
415
|
+
if (this.isIdCard) return this.idCardSuffixIcon;
|
|
416
|
+
return this.suffixIcon;
|
|
417
|
+
},
|
|
418
|
+
inputPlaceholder() {
|
|
419
|
+
if (this.isCurrency) return this.currencyPlaceholder || this.t('input.currencyPlaceholder');
|
|
420
|
+
if (this.isBankCard) return this.bankCardPlaceholder || this.t('input.bankCardPlaceholder');
|
|
421
|
+
if (this.isIdCard) return this.idCardPlaceholder || this.t('input.idCardPlaceholder');
|
|
422
|
+
if (this.isEmail) return this.emailPlaceholder || this.t('input.emailPlaceholder');
|
|
423
|
+
if (this.isUscc) return this.usccPlaceholder || this.t('input.usccPlaceholder');
|
|
424
|
+
return this.placeholder;
|
|
425
|
+
},
|
|
426
|
+
phoneCodePlaceholderText() {
|
|
427
|
+
return this.phoneCodePlaceholder || this.t('input.phoneCodePlaceholder');
|
|
428
|
+
},
|
|
429
|
+
phonePlaceholderText() {
|
|
430
|
+
return this.phonePlaceholder || this.t('input.phonePlaceholder');
|
|
431
|
+
},
|
|
432
|
+
platePlaceholderText() {
|
|
433
|
+
return this.platePlaceholder || this.t('input.platePlaceholder');
|
|
434
|
+
},
|
|
435
|
+
showPrepend() {
|
|
436
|
+
if (this.isCurrency) return !!this.currencySymbol;
|
|
437
|
+
return !!this.prepend;
|
|
438
|
+
},
|
|
439
|
+
prependText() {
|
|
440
|
+
if (this.isCurrency) return this.currencySymbol;
|
|
441
|
+
return this.prepend;
|
|
442
|
+
},
|
|
443
|
+
showAppend() {
|
|
444
|
+
if (this.isCurrency) return !!this.currencyUnit;
|
|
445
|
+
return !!this.append;
|
|
446
|
+
},
|
|
447
|
+
appendText() {
|
|
448
|
+
if (this.isCurrency) return this.currencyUnit;
|
|
449
|
+
return this.append;
|
|
450
|
+
},
|
|
451
|
+
showSuffix() {
|
|
452
|
+
return (this.isBankCard && this.showBankCardType && this.bankCardType) ||
|
|
453
|
+
(this.isIdCard && this.showIdCardInfo && this.idCardInfo) ||
|
|
454
|
+
(this.isEmail && this.emailValid !== null) ||
|
|
455
|
+
(this.isUscc && this.usccValid !== null);
|
|
456
|
+
},
|
|
457
|
+
// ========== 原有计算属性 ==========
|
|
458
|
+
// 手机区号列表
|
|
459
|
+
phoneCodeList() {
|
|
460
|
+
const list = this.phoneCodeOptions.length > 0 ? this.phoneCodeOptions : defaultPhoneCodeOptions;
|
|
461
|
+
return list.map((item) => {
|
|
462
|
+
const flag = item.flag || '';
|
|
463
|
+
const name = item.name || (item.nameKey ? this.t(item.nameKey) : item.code);
|
|
464
|
+
return {
|
|
465
|
+
...item,
|
|
466
|
+
name,
|
|
467
|
+
label: item.label || [flag, item.code].filter(Boolean).join(' ')
|
|
468
|
+
};
|
|
469
|
+
});
|
|
470
|
+
},
|
|
471
|
+
localizedPlateProvinces() {
|
|
472
|
+
const provinces = this.t('input.plateProvinces');
|
|
473
|
+
return Array.isArray(provinces) ? provinces : [];
|
|
474
|
+
},
|
|
475
|
+
resolvedPlateProvinceList() {
|
|
476
|
+
return this.plateProvinceList.length > 0 ? this.plateProvinceList : this.localizedPlateProvinces;
|
|
477
|
+
},
|
|
478
|
+
resolvedDefaultPlateProvince() {
|
|
479
|
+
return this.defaultPlateProvince || this.resolvedPlateProvinceList[0] || '';
|
|
480
|
+
},
|
|
481
|
+
// 货币符号
|
|
482
|
+
currencySymbol() {
|
|
483
|
+
if (this.currencySymbolCustom) {
|
|
484
|
+
return this.currencySymbolCustom;
|
|
485
|
+
}
|
|
486
|
+
return currencySymbols[this.currency] || '¥';
|
|
487
|
+
},
|
|
488
|
+
// 银行卡最大长度(含分隔符)
|
|
489
|
+
bankCardMaxLength() {
|
|
490
|
+
const digits = this.bankCardMaxDigits;
|
|
491
|
+
const separatorCount = Math.floor((digits - 1) / this.bankCardSegment);
|
|
492
|
+
return digits + separatorCount;
|
|
493
|
+
},
|
|
494
|
+
// 身份证后缀图标
|
|
495
|
+
idCardSuffixIcon() {
|
|
496
|
+
if (this.suffixIcon) return this.suffixIcon;
|
|
497
|
+
if (this.idCardValid === true) return 'el-icon-success';
|
|
498
|
+
if (this.idCardValid === false) return 'el-icon-warning';
|
|
499
|
+
return '';
|
|
500
|
+
},
|
|
501
|
+
// 身份证信息文本
|
|
502
|
+
idCardInfoText() {
|
|
503
|
+
if (!this.idCardInfo) return '';
|
|
504
|
+
return `${this.idCardInfo.region} | ${this.idCardInfo.birthday} | ${this.idCardInfo.gender}`;
|
|
505
|
+
}
|
|
506
|
+
},
|
|
507
|
+
watch: {
|
|
508
|
+
modelValue: {
|
|
509
|
+
immediate: true,
|
|
510
|
+
handler(val) {
|
|
511
|
+
this.initSpecialValue(val);
|
|
512
|
+
}
|
|
513
|
+
},
|
|
514
|
+
phoneCode(val) {
|
|
515
|
+
this.updatePhoneValue();
|
|
516
|
+
},
|
|
517
|
+
phoneNumber(val) {
|
|
518
|
+
// 只允许数字
|
|
519
|
+
this.phoneNumber = val.replace(/\D/g, '');
|
|
520
|
+
this.updatePhoneValue();
|
|
521
|
+
},
|
|
522
|
+
defaultPhoneCode: {
|
|
523
|
+
immediate: true,
|
|
524
|
+
handler(val) {
|
|
525
|
+
if (!this.modelValue) {
|
|
526
|
+
this.phoneCode = val;
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
},
|
|
531
|
+
methods: {
|
|
532
|
+
// ========== 统一事件处理 ==========
|
|
533
|
+
onFocus(event) {
|
|
534
|
+
if (this.isCurrency) {
|
|
535
|
+
this.handleCurrencyFocus(event);
|
|
536
|
+
} else {
|
|
537
|
+
this.handleFocus(event);
|
|
538
|
+
}
|
|
539
|
+
},
|
|
540
|
+
onBlur(event) {
|
|
541
|
+
if (this.isCurrency) {
|
|
542
|
+
this.handleCurrencyBlur(event);
|
|
543
|
+
} else if (this.isIdCard) {
|
|
544
|
+
this.handleIdCardBlur(event);
|
|
545
|
+
} else if (this.isEmail) {
|
|
546
|
+
this.handleEmailBlur(event);
|
|
547
|
+
} else if (this.isUscc) {
|
|
548
|
+
this.handleUsccBlur(event);
|
|
549
|
+
} else {
|
|
550
|
+
this.handleBlur(event);
|
|
551
|
+
}
|
|
552
|
+
},
|
|
553
|
+
onInput(val) {
|
|
554
|
+
if (this.isCurrency) {
|
|
555
|
+
this.handleCurrencyInput(val);
|
|
556
|
+
} else if (this.isBankCard) {
|
|
557
|
+
this.handleBankCardInput(val);
|
|
558
|
+
} else if (this.isIdCard) {
|
|
559
|
+
this.handleIdCardInput(val);
|
|
560
|
+
} else if (this.isEmail) {
|
|
561
|
+
this.handleEmailInput(val);
|
|
562
|
+
} else if (this.isUscc) {
|
|
563
|
+
this.handleUsccInput(val);
|
|
564
|
+
}
|
|
565
|
+
},
|
|
566
|
+
// 初始化特殊类型的值
|
|
567
|
+
initSpecialValue(val) {
|
|
568
|
+
if (this.isPhone) {
|
|
569
|
+
this.initPhoneValue(val);
|
|
570
|
+
} else if (this.isCurrency) {
|
|
571
|
+
this.initCurrencyValue(val);
|
|
572
|
+
} else if (this.isBankCard) {
|
|
573
|
+
this.initBankCardValue(val);
|
|
574
|
+
} else if (this.isIdCard) {
|
|
575
|
+
this.initIdCardValue(val);
|
|
576
|
+
} else if (this.isEmail) {
|
|
577
|
+
this.initEmailValue(val);
|
|
578
|
+
} else if (this.isCode) {
|
|
579
|
+
this.initCodeValue(val);
|
|
580
|
+
} else if (this.isPlate) {
|
|
581
|
+
this.initPlateValue(val);
|
|
582
|
+
} else if (this.isIp) {
|
|
583
|
+
this.initIpValue(val);
|
|
584
|
+
} else if (this.isMac) {
|
|
585
|
+
this.initMacValue(val);
|
|
586
|
+
} else if (this.isUscc) {
|
|
587
|
+
this.initUsccValue(val);
|
|
588
|
+
}
|
|
589
|
+
},
|
|
590
|
+
|
|
591
|
+
// ========== 手机号相关方法 ==========
|
|
592
|
+
initPhoneValue(val) {
|
|
593
|
+
if (!val) {
|
|
594
|
+
this.phoneCode = this.defaultPhoneCode;
|
|
595
|
+
this.phoneNumber = '';
|
|
596
|
+
return;
|
|
597
|
+
}
|
|
598
|
+
// 支持格式:+86-13800138000 或 +8613800138000 或纯手机号
|
|
599
|
+
const str = String(val);
|
|
600
|
+
const match = str.match(/^(\+\d+)[-\s]?(\d+)$/);
|
|
601
|
+
if (match) {
|
|
602
|
+
this.phoneCode = match[1];
|
|
603
|
+
this.phoneNumber = match[2];
|
|
604
|
+
} else {
|
|
605
|
+
this.phoneNumber = str.replace(/\D/g, '');
|
|
606
|
+
}
|
|
607
|
+
},
|
|
608
|
+
updatePhoneValue() {
|
|
609
|
+
const value = this.phoneNumber ? `${this.phoneCode}-${this.phoneNumber}` : '';
|
|
610
|
+
this.text = value;
|
|
611
|
+
|
|
612
|
+
},
|
|
613
|
+
handlePhoneBlur(event) {
|
|
614
|
+
this.handleBlur(event);
|
|
615
|
+
},
|
|
616
|
+
|
|
617
|
+
// ========== 货币相关方法 ==========
|
|
618
|
+
initCurrencyValue(val) {
|
|
619
|
+
if (val === undefined || val === null || val === '') {
|
|
620
|
+
this.currencyDisplay = '';
|
|
621
|
+
return;
|
|
622
|
+
}
|
|
623
|
+
const num = parseFloat(val);
|
|
624
|
+
if (!isNaN(num)) {
|
|
625
|
+
this.currencyDisplay = this.formatCurrency(num);
|
|
626
|
+
}
|
|
627
|
+
},
|
|
628
|
+
formatCurrency(value) {
|
|
629
|
+
if (value === undefined || value === null || value === '') return '';
|
|
630
|
+
const num = parseFloat(value);
|
|
631
|
+
if (isNaN(num)) return '';
|
|
632
|
+
// 格式化为千分位
|
|
633
|
+
const fixed = num.toFixed(this.currencyPrecision);
|
|
634
|
+
const parts = fixed.split('.');
|
|
635
|
+
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',');
|
|
636
|
+
return parts.join('.');
|
|
637
|
+
},
|
|
638
|
+
parseCurrency(value) {
|
|
639
|
+
if (!value) return '';
|
|
640
|
+
// 移除千分位分隔符
|
|
641
|
+
return value.replace(/,/g, '');
|
|
642
|
+
},
|
|
643
|
+
handleCurrencyFocus(event) {
|
|
644
|
+
this.currencyEditing = true;
|
|
645
|
+
// 编辑时显示原始数字
|
|
646
|
+
if (this.text) {
|
|
647
|
+
this.currencyDisplay = this.text;
|
|
648
|
+
}
|
|
649
|
+
this.handleFocus(event);
|
|
650
|
+
},
|
|
651
|
+
handleCurrencyBlur(event) {
|
|
652
|
+
this.currencyEditing = false;
|
|
653
|
+
const rawValue = this.parseCurrency(this.currencyDisplay);
|
|
654
|
+
let num = parseFloat(rawValue);
|
|
655
|
+
|
|
656
|
+
// 范围限制
|
|
657
|
+
if (!isNaN(num)) {
|
|
658
|
+
if (this.currencyMin !== undefined && num < this.currencyMin) {
|
|
659
|
+
num = this.currencyMin;
|
|
660
|
+
}
|
|
661
|
+
if (this.currencyMax !== undefined && num > this.currencyMax) {
|
|
662
|
+
num = this.currencyMax;
|
|
663
|
+
}
|
|
664
|
+
this.text = num.toFixed(this.currencyPrecision);
|
|
665
|
+
this.currencyDisplay = this.formatCurrency(num);
|
|
666
|
+
} else {
|
|
667
|
+
this.text = '';
|
|
668
|
+
this.currencyDisplay = '';
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
|
|
672
|
+
this.handleBlur(event);
|
|
673
|
+
},
|
|
674
|
+
handleCurrencyInput(val) {
|
|
675
|
+
// 只允许数字、小数点和逗号
|
|
676
|
+
this.currencyDisplay = val.replace(/[^\d.,]/g, '');
|
|
677
|
+
},
|
|
678
|
+
|
|
679
|
+
// ========== 银行卡相关方法 ==========
|
|
680
|
+
initBankCardValue(val) {
|
|
681
|
+
if (!val) {
|
|
682
|
+
this.bankCardDisplay = '';
|
|
683
|
+
this.bankCardType = '';
|
|
684
|
+
return;
|
|
685
|
+
}
|
|
686
|
+
const digits = String(val).replace(/\D/g, '');
|
|
687
|
+
this.bankCardDisplay = this.formatBankCard(digits);
|
|
688
|
+
this.detectBankCardType(digits);
|
|
689
|
+
},
|
|
690
|
+
formatBankCard(value) {
|
|
691
|
+
if (!value) return '';
|
|
692
|
+
const digits = value.replace(/\D/g, '');
|
|
693
|
+
const chunks = [];
|
|
694
|
+
for (let i = 0; i < digits.length; i += this.bankCardSegment) {
|
|
695
|
+
chunks.push(digits.slice(i, i + this.bankCardSegment));
|
|
696
|
+
}
|
|
697
|
+
return chunks.join(this.bankCardSeparator);
|
|
698
|
+
},
|
|
699
|
+
handleBankCardInput(val) {
|
|
700
|
+
// 只允许数字和分隔符
|
|
701
|
+
const digits = val.replace(/\D/g, '').slice(0, this.bankCardMaxDigits);
|
|
702
|
+
this.bankCardDisplay = this.formatBankCard(digits);
|
|
703
|
+
this.text = digits;
|
|
704
|
+
this.detectBankCardType(digits);
|
|
705
|
+
this.$emit('bank-card-change', { value: digits, display: this.bankCardDisplay, type: this.bankCardType });
|
|
706
|
+
},
|
|
707
|
+
detectBankCardType(cardNumber) {
|
|
708
|
+
if (!cardNumber || cardNumber.length < 6) {
|
|
709
|
+
this.bankCardType = '';
|
|
710
|
+
return;
|
|
711
|
+
}
|
|
712
|
+
// 根据 BIN 码判断银行卡类型(简化版)
|
|
713
|
+
const bin = cardNumber.slice(0, 6);
|
|
714
|
+
cardNumber.slice(0, 4);
|
|
715
|
+
|
|
716
|
+
// 常见银行卡 BIN 码判断
|
|
717
|
+
if (/^62/.test(bin)) {
|
|
718
|
+
this.bankCardType = this.t('input.bankCardTypes.unionpay');
|
|
719
|
+
} else if (/^4/.test(bin)) {
|
|
720
|
+
this.bankCardType = 'VISA';
|
|
721
|
+
} else if (/^5[1-5]/.test(bin) || /^2[2-7]/.test(bin)) {
|
|
722
|
+
this.bankCardType = 'MasterCard';
|
|
723
|
+
} else if (/^3[47]/.test(bin)) {
|
|
724
|
+
this.bankCardType = 'American Express';
|
|
725
|
+
} else if (/^35/.test(bin)) {
|
|
726
|
+
this.bankCardType = 'JCB';
|
|
727
|
+
} else if (/^6011|65/.test(bin)) {
|
|
728
|
+
this.bankCardType = 'Discover';
|
|
729
|
+
} else {
|
|
730
|
+
this.bankCardType = '';
|
|
731
|
+
}
|
|
732
|
+
},
|
|
733
|
+
|
|
734
|
+
// ========== 身份证相关方法 ==========
|
|
735
|
+
initIdCardValue(val) {
|
|
736
|
+
if (!val) {
|
|
737
|
+
this.idCardDisplay = '';
|
|
738
|
+
this.idCardValid = null;
|
|
739
|
+
this.idCardInfo = null;
|
|
740
|
+
return;
|
|
741
|
+
}
|
|
742
|
+
this.idCardDisplay = String(val).toUpperCase();
|
|
743
|
+
if (this.idCardRealtimeValidate) {
|
|
744
|
+
this.validateIdCard(this.idCardDisplay);
|
|
745
|
+
}
|
|
746
|
+
},
|
|
747
|
+
handleIdCardInput(val) {
|
|
748
|
+
// 只允许数字和 X
|
|
749
|
+
this.idCardDisplay = val.replace(/[^\dXx]/g, '').toUpperCase().slice(0, 18);
|
|
750
|
+
this.text = this.idCardDisplay;
|
|
751
|
+
|
|
752
|
+
if (this.idCardRealtimeValidate && this.idCardDisplay.length === 18) {
|
|
753
|
+
this.validateIdCard(this.idCardDisplay);
|
|
754
|
+
} else {
|
|
755
|
+
this.idCardValid = null;
|
|
756
|
+
this.idCardInfo = null;
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
this.$emit('id-card-change', {
|
|
760
|
+
value: this.idCardDisplay,
|
|
761
|
+
valid: this.idCardValid,
|
|
762
|
+
info: this.idCardInfo
|
|
763
|
+
});
|
|
764
|
+
},
|
|
765
|
+
handleIdCardBlur(event) {
|
|
766
|
+
if (this.idCardDisplay && this.idCardDisplay.length === 18) {
|
|
767
|
+
this.validateIdCard(this.idCardDisplay);
|
|
768
|
+
}
|
|
769
|
+
this.$emit('id-card-valid', { valid: this.idCardValid, info: this.idCardInfo });
|
|
770
|
+
this.handleBlur(event);
|
|
771
|
+
},
|
|
772
|
+
validateIdCard(idCard) {
|
|
773
|
+
if (!idCard || idCard.length !== 18) {
|
|
774
|
+
this.idCardValid = false;
|
|
775
|
+
this.idCardInfo = null;
|
|
776
|
+
return false;
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
// 加权因子
|
|
780
|
+
const weights = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2];
|
|
781
|
+
// 校验码对照表
|
|
782
|
+
const checkCodes = ['1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2'];
|
|
783
|
+
|
|
784
|
+
// 计算校验和
|
|
785
|
+
let sum = 0;
|
|
786
|
+
for (let i = 0; i < 17; i++) {
|
|
787
|
+
const digit = parseInt(idCard.charAt(i), 10);
|
|
788
|
+
if (isNaN(digit)) {
|
|
789
|
+
this.idCardValid = false;
|
|
790
|
+
this.idCardInfo = null;
|
|
791
|
+
return false;
|
|
792
|
+
}
|
|
793
|
+
sum += digit * weights[i];
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
// 验证校验码
|
|
797
|
+
const checkCode = checkCodes[sum % 11];
|
|
798
|
+
const valid = idCard.charAt(17).toUpperCase() === checkCode;
|
|
799
|
+
|
|
800
|
+
this.idCardValid = valid;
|
|
801
|
+
|
|
802
|
+
if (valid) {
|
|
803
|
+
// 解析身份证信息
|
|
804
|
+
const regionCode = idCard.slice(0, 6);
|
|
805
|
+
const birthYear = idCard.slice(6, 10);
|
|
806
|
+
const birthMonth = idCard.slice(10, 12);
|
|
807
|
+
const birthDay = idCard.slice(12, 14);
|
|
808
|
+
const genderCode = parseInt(idCard.charAt(16), 10);
|
|
809
|
+
|
|
810
|
+
this.idCardInfo = {
|
|
811
|
+
region: this.getRegionName(regionCode),
|
|
812
|
+
birthday: `${birthYear}-${birthMonth}-${birthDay}`,
|
|
813
|
+
gender: genderCode % 2 === 0 ? this.t('input.genders.female') : this.t('input.genders.male'),
|
|
814
|
+
age: this.calculateAge(birthYear, birthMonth, birthDay)
|
|
815
|
+
};
|
|
816
|
+
} else {
|
|
817
|
+
this.idCardInfo = null;
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
return valid;
|
|
821
|
+
},
|
|
822
|
+
getRegionName(code) {
|
|
823
|
+
const regions = this.t('input.regions');
|
|
824
|
+
const provinceCode = code.slice(0, 2);
|
|
825
|
+
return (regions && regions[provinceCode]) || this.t('input.unknownRegion');
|
|
826
|
+
},
|
|
827
|
+
calculateAge(year, month, day) {
|
|
828
|
+
const birthDate = new Date(year, month - 1, day);
|
|
829
|
+
const today = new Date();
|
|
830
|
+
let age = today.getFullYear() - birthDate.getFullYear();
|
|
831
|
+
const monthDiff = today.getMonth() - birthDate.getMonth();
|
|
832
|
+
if (monthDiff < 0 || (monthDiff === 0 && today.getDate() < birthDate.getDate())) {
|
|
833
|
+
age--;
|
|
834
|
+
}
|
|
835
|
+
return age;
|
|
836
|
+
},
|
|
837
|
+
|
|
838
|
+
// ========== 邮箱相关方法 ==========
|
|
839
|
+
initEmailValue(val) {
|
|
840
|
+
this.emailDisplay = val || '';
|
|
841
|
+
if (val) {
|
|
842
|
+
this.emailValid = this.validateEmail(val);
|
|
843
|
+
}
|
|
844
|
+
},
|
|
845
|
+
handleEmailInput(val) {
|
|
846
|
+
this.emailDisplay = val;
|
|
847
|
+
this.text = val;
|
|
848
|
+
this.emailValid = val ? this.validateEmail(val) : null;
|
|
849
|
+
|
|
850
|
+
},
|
|
851
|
+
handleEmailBlur(event) {
|
|
852
|
+
this.emailValid = this.emailDisplay ? this.validateEmail(this.emailDisplay) : null;
|
|
853
|
+
this.handleBlur(event);
|
|
854
|
+
},
|
|
855
|
+
validateEmail(email) {
|
|
856
|
+
const regex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
|
|
857
|
+
return regex.test(email);
|
|
858
|
+
},
|
|
859
|
+
|
|
860
|
+
// ========== 验证码相关方法 ==========
|
|
861
|
+
initCodeValue(val) {
|
|
862
|
+
const str = String(val || '');
|
|
863
|
+
this.codeValues = Array(this.codeLength).fill('').map((_, i) => str[i] || '');
|
|
864
|
+
},
|
|
865
|
+
handleCodeInput(event, index) {
|
|
866
|
+
const val = event.target.value.replace(/\D/g, '');
|
|
867
|
+
this.codeValues[index] = val.slice(-1);
|
|
868
|
+
this.updateCodeValue();
|
|
869
|
+
// 自动跳转下一格
|
|
870
|
+
if (val && index < this.codeLength - 1) {
|
|
871
|
+
this.$nextTick(() => {
|
|
872
|
+
if (this.codeRefs[index + 1]) {
|
|
873
|
+
this.codeRefs[index + 1].focus();
|
|
874
|
+
}
|
|
875
|
+
});
|
|
876
|
+
}
|
|
877
|
+
},
|
|
878
|
+
handleCodeKeydown(event, index) {
|
|
879
|
+
// 退格键处理
|
|
880
|
+
if (event.key === 'Backspace' && !this.codeValues[index] && index > 0) {
|
|
881
|
+
this.$nextTick(() => {
|
|
882
|
+
if (this.codeRefs[index - 1]) {
|
|
883
|
+
this.codeRefs[index - 1].focus();
|
|
884
|
+
}
|
|
885
|
+
});
|
|
886
|
+
}
|
|
887
|
+
},
|
|
888
|
+
handleCodePaste(event) {
|
|
889
|
+
event.preventDefault();
|
|
890
|
+
const paste = (event.clipboardData || window.clipboardData).getData('text').replace(/\D/g, '');
|
|
891
|
+
const chars = paste.slice(0, this.codeLength).split('');
|
|
892
|
+
chars.forEach((char, i) => {
|
|
893
|
+
this.codeValues[i] = char;
|
|
894
|
+
});
|
|
895
|
+
this.updateCodeValue();
|
|
896
|
+
// 聚焦到最后一个填入的位置
|
|
897
|
+
const focusIndex = Math.min(chars.length, this.codeLength - 1);
|
|
898
|
+
this.$nextTick(() => {
|
|
899
|
+
if (this.codeRefs[focusIndex]) {
|
|
900
|
+
this.codeRefs[focusIndex].focus();
|
|
901
|
+
}
|
|
902
|
+
});
|
|
903
|
+
},
|
|
904
|
+
updateCodeValue() {
|
|
905
|
+
this.codeValues.join(this.codeSeparator);
|
|
906
|
+
this.text = this.codeValues.join('');
|
|
907
|
+
|
|
908
|
+
if (this.codeValues.every(v => v)) {
|
|
909
|
+
this.$emit('code-complete', { value: this.text });
|
|
910
|
+
}
|
|
911
|
+
},
|
|
912
|
+
|
|
913
|
+
// ========== 车牌号相关方法 ==========
|
|
914
|
+
initPlateValue(val) {
|
|
915
|
+
if (!val) {
|
|
916
|
+
this.plateProvince = this.resolvedDefaultPlateProvince;
|
|
917
|
+
this.plateNumber = '';
|
|
918
|
+
return;
|
|
919
|
+
}
|
|
920
|
+
const str = String(val);
|
|
921
|
+
if (str.length > 0) {
|
|
922
|
+
this.plateProvince = str[0];
|
|
923
|
+
this.plateNumber = str.slice(1).toUpperCase();
|
|
924
|
+
}
|
|
925
|
+
},
|
|
926
|
+
handlePlateInput(val) {
|
|
927
|
+
this.plateNumber = val.toUpperCase().replace(/[^A-Z0-9]/g, '');
|
|
928
|
+
this.updatePlateValue();
|
|
929
|
+
},
|
|
930
|
+
handlePlateBlur(event) {
|
|
931
|
+
this.updatePlateValue();
|
|
932
|
+
this.handleBlur(event);
|
|
933
|
+
},
|
|
934
|
+
updatePlateValue() {
|
|
935
|
+
const value = this.plateProvince + this.plateNumber;
|
|
936
|
+
this.text = value;
|
|
937
|
+
|
|
938
|
+
},
|
|
939
|
+
|
|
940
|
+
// ========== IP地址相关方法 ==========
|
|
941
|
+
initIpValue(val) {
|
|
942
|
+
if (!val) {
|
|
943
|
+
this.ipSegments = ['', '', '', ''];
|
|
944
|
+
return;
|
|
945
|
+
}
|
|
946
|
+
const parts = String(val).split('.');
|
|
947
|
+
this.ipSegments = parts.slice(0, 4).map(p => p || '');
|
|
948
|
+
while (this.ipSegments.length < 4) {
|
|
949
|
+
this.ipSegments.push('');
|
|
950
|
+
}
|
|
951
|
+
},
|
|
952
|
+
handleIpInput(event, index) {
|
|
953
|
+
let val = event.target.value.replace(/\D/g, '');
|
|
954
|
+
// 限制范围 0-255
|
|
955
|
+
if (val !== '' && parseInt(val, 10) > 255) {
|
|
956
|
+
val = '255';
|
|
957
|
+
}
|
|
958
|
+
this.ipSegments[index] = val;
|
|
959
|
+
this.updateIpValue();
|
|
960
|
+
// 自动跳转
|
|
961
|
+
if (val.length === 3 || (val.length > 0 && parseInt(val, 10) >= 26)) {
|
|
962
|
+
if (index < 3 && this.ipRefs[index + 1]) {
|
|
963
|
+
this.$nextTick(() => this.ipRefs[index + 1].focus());
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
},
|
|
967
|
+
handleIpKeydown(event, index) {
|
|
968
|
+
if (event.key === '.' && index < 3) {
|
|
969
|
+
event.preventDefault();
|
|
970
|
+
if (this.ipRefs[index + 1]) {
|
|
971
|
+
this.ipRefs[index + 1].focus();
|
|
972
|
+
}
|
|
973
|
+
}
|
|
974
|
+
if (event.key === 'Backspace' && !this.ipSegments[index] && index > 0) {
|
|
975
|
+
if (this.ipRefs[index - 1]) {
|
|
976
|
+
this.ipRefs[index - 1].focus();
|
|
977
|
+
}
|
|
978
|
+
}
|
|
979
|
+
},
|
|
980
|
+
updateIpValue() {
|
|
981
|
+
const value = this.ipSegments.join('.');
|
|
982
|
+
this.text = value;
|
|
983
|
+
|
|
984
|
+
},
|
|
985
|
+
|
|
986
|
+
// ========== MAC地址相关方法 ==========
|
|
987
|
+
initMacValue(val) {
|
|
988
|
+
if (!val) {
|
|
989
|
+
this.macSegments = ['', '', '', '', '', ''];
|
|
990
|
+
return;
|
|
991
|
+
}
|
|
992
|
+
const str = String(val).replace(/[^A-Fa-f0-9]/g, '');
|
|
993
|
+
this.macSegments = [];
|
|
994
|
+
for (let i = 0; i < 6; i++) {
|
|
995
|
+
this.macSegments.push(str.slice(i * 2, i * 2 + 2).toUpperCase());
|
|
996
|
+
}
|
|
997
|
+
},
|
|
998
|
+
handleMacInput(event, index) {
|
|
999
|
+
let val = event.target.value.replace(/[^A-Fa-f0-9]/g, '').toUpperCase();
|
|
1000
|
+
this.macSegments[index] = val.slice(0, 2);
|
|
1001
|
+
this.updateMacValue();
|
|
1002
|
+
// 自动跳转
|
|
1003
|
+
if (val.length >= 2 && index < 5) {
|
|
1004
|
+
this.$nextTick(() => {
|
|
1005
|
+
if (this.macRefs[index + 1]) {
|
|
1006
|
+
this.macRefs[index + 1].focus();
|
|
1007
|
+
}
|
|
1008
|
+
});
|
|
1009
|
+
}
|
|
1010
|
+
},
|
|
1011
|
+
handleMacKeydown(event, index) {
|
|
1012
|
+
if ((event.key === ':' || event.key === '-') && index < 5) {
|
|
1013
|
+
event.preventDefault();
|
|
1014
|
+
if (this.macRefs[index + 1]) {
|
|
1015
|
+
this.macRefs[index + 1].focus();
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
1018
|
+
if (event.key === 'Backspace' && !this.macSegments[index] && index > 0) {
|
|
1019
|
+
if (this.macRefs[index - 1]) {
|
|
1020
|
+
this.macRefs[index - 1].focus();
|
|
1021
|
+
}
|
|
1022
|
+
}
|
|
1023
|
+
},
|
|
1024
|
+
updateMacValue() {
|
|
1025
|
+
this.macSegments.join(this.macSeparator);
|
|
1026
|
+
this.text = this.macSegments.join('');
|
|
1027
|
+
|
|
1028
|
+
},
|
|
1029
|
+
|
|
1030
|
+
// ========== 社会信用代码相关方法 ==========
|
|
1031
|
+
initUsccValue(val) {
|
|
1032
|
+
this.usccDisplay = val || '';
|
|
1033
|
+
if (val && String(val).length === 18) {
|
|
1034
|
+
this.usccValid = this.validateUscc(val);
|
|
1035
|
+
}
|
|
1036
|
+
},
|
|
1037
|
+
handleUsccInput(val) {
|
|
1038
|
+
this.usccDisplay = val.toUpperCase().replace(/[^A-Z0-9]/g, '').slice(0, 18);
|
|
1039
|
+
this.text = this.usccDisplay;
|
|
1040
|
+
if (this.usccRealtimeValidate && this.usccDisplay.length === 18) {
|
|
1041
|
+
this.usccValid = this.validateUscc(this.usccDisplay);
|
|
1042
|
+
} else {
|
|
1043
|
+
this.usccValid = null;
|
|
1044
|
+
}
|
|
1045
|
+
|
|
1046
|
+
},
|
|
1047
|
+
handleUsccBlur(event) {
|
|
1048
|
+
if (this.usccDisplay && this.usccDisplay.length === 18) {
|
|
1049
|
+
this.usccValid = this.validateUscc(this.usccDisplay);
|
|
1050
|
+
this.$emit('uscc-valid', { valid: this.usccValid });
|
|
1051
|
+
}
|
|
1052
|
+
this.handleBlur(event);
|
|
1053
|
+
},
|
|
1054
|
+
validateUscc(code) {
|
|
1055
|
+
if (!code || code.length !== 18) return false;
|
|
1056
|
+
// 统一社会信用代码校验规则
|
|
1057
|
+
const chars = '0123456789ABCDEFGHJKLMNPQRTUWXY';
|
|
1058
|
+
const weights = [1, 3, 9, 27, 19, 26, 16, 17, 20, 29, 25, 13, 8, 24, 10, 30, 28];
|
|
1059
|
+
let sum = 0;
|
|
1060
|
+
for (let i = 0; i < 17; i++) {
|
|
1061
|
+
const charIndex = chars.indexOf(code[i]);
|
|
1062
|
+
if (charIndex === -1) return false;
|
|
1063
|
+
sum += charIndex * weights[i];
|
|
1064
|
+
}
|
|
1065
|
+
const checkIndex = (31 - (sum % 31)) % 31;
|
|
1066
|
+
return chars[checkIndex] === code[17];
|
|
1067
|
+
}
|
|
1068
|
+
}
|
|
1069
|
+
});
|
|
1070
|
+
|
|
1071
|
+
export { script as default };
|