├── .vscode └── extensions.json ├── public └── favicon.ico ├── src ├── assets │ └── logo.png ├── components │ ├── base │ │ ├── menu │ │ │ ├── src │ │ │ │ ├── menu.scss │ │ │ │ ├── types.ts │ │ │ │ ├── index.vue │ │ │ │ └── menu.tsx │ │ │ └── index.ts │ │ ├── table │ │ │ ├── README.md │ │ │ ├── index.ts │ │ │ └── src │ │ │ │ ├── types.ts │ │ │ │ └── index.vue │ │ ├── list │ │ │ ├── index.ts │ │ │ └── src │ │ │ │ ├── types.ts │ │ │ │ └── index.vue │ │ ├── form │ │ │ ├── index.ts │ │ │ ├── README.md │ │ │ └── src │ │ │ │ ├── types │ │ │ │ ├── types.ts │ │ │ │ └── rules.ts │ │ │ │ └── index.vue │ │ ├── trend │ │ │ ├── index.ts │ │ │ └── src │ │ │ │ └── index.vue │ │ ├── progress │ │ │ ├── index.ts │ │ │ └── src │ │ │ │ └── index.vue │ │ ├── calendar │ │ │ ├── index.ts │ │ │ └── src │ │ │ │ ├── types.ts │ │ │ │ └── index.vue │ │ ├── modelForm │ │ │ ├── index.ts │ │ │ └── src │ │ │ │ └── index.vue │ │ ├── chooseArea │ │ │ ├── index.ts │ │ │ └── src │ │ │ │ └── index.vue │ │ ├── chooseCity │ │ │ ├── index.ts │ │ │ ├── src │ │ │ │ ├── types.ts │ │ │ │ └── index.vue │ │ │ └── lib │ │ │ │ └── province.json │ │ ├── chooseDate │ │ │ ├── index.ts │ │ │ └── src │ │ │ │ └── index.vue │ │ ├── chooseIcon │ │ │ ├── index.ts │ │ │ └── src │ │ │ │ └── index.vue │ │ ├── chooseTime │ │ │ ├── index.ts │ │ │ └── src │ │ │ │ └── index.vue │ │ ├── notification │ │ │ ├── index.ts │ │ │ └── src │ │ │ │ └── index.vue │ │ ├── chooseAreaFour │ │ │ ├── index.ts │ │ │ └── src │ │ │ │ └── index.vue │ │ └── index.ts │ └── layout │ │ ├── navHeader.vue │ │ ├── index.vue │ │ └── sideBar.vue ├── views │ ├── Setting.vue │ ├── chooseCity │ │ └── index.vue │ ├── trend │ │ └── index.vue │ ├── Home.vue │ ├── About.vue │ ├── chooseTime │ │ └── index.vue │ ├── notification │ │ ├── index.vue │ │ └── data.ts │ ├── progress │ │ └── index.vue │ ├── calendar │ │ └── index.vue │ ├── menu │ │ └── index.vue │ ├── table │ │ └── index.vue │ ├── modelForm │ │ └── index.vue │ └── form │ │ └── index.vue ├── App.vue ├── env.d.ts ├── main.ts ├── mock │ └── index.ts └── router │ └── index.ts ├── packages ├── menu │ ├── src │ │ ├── menu.scss │ │ ├── types.ts │ │ ├── index.vue │ │ └── menu.tsx │ └── index.ts ├── table │ ├── README.md │ ├── index.ts │ └── src │ │ ├── types.ts │ │ └── index.vue ├── list │ ├── index.ts │ └── src │ │ ├── types.ts │ │ └── index.vue ├── form │ ├── index.ts │ ├── README.md │ └── src │ │ ├── types │ │ ├── types.ts │ │ └── rules.ts │ │ └── index.vue ├── trend │ ├── index.ts │ └── src │ │ └── index.vue ├── progress │ ├── index.ts │ └── src │ │ └── index.vue ├── calendar │ ├── index.ts │ └── src │ │ ├── types.ts │ │ └── index.vue ├── modelForm │ ├── index.ts │ └── src │ │ └── index.vue ├── chooseArea │ ├── index.ts │ └── src │ │ └── index.vue ├── chooseCity │ ├── index.ts │ ├── src │ │ ├── types.ts │ │ └── index.vue │ └── lib │ │ └── province.json ├── chooseDate │ ├── index.ts │ └── src │ │ └── index.vue ├── chooseIcon │ ├── index.ts │ └── src │ │ └── index.vue ├── chooseTime │ ├── index.ts │ └── src │ │ └── index.vue ├── notification │ ├── index.ts │ └── src │ │ └── index.vue ├── chooseAreaFour │ ├── index.ts │ └── src │ │ └── index.vue ├── vue.d.ts └── index.ts ├── tsconfig.node.json ├── vite.config.ts ├── .gitignore ├── index.html ├── tsconfig.json ├── package.json ├── command └── build.js └── README.md /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": ["johnsoncodehk.volar"] 3 | } 4 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jlnvv-tom/Secondary-development-component/HEAD/public/favicon.ico -------------------------------------------------------------------------------- /src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jlnvv-tom/Secondary-development-component/HEAD/src/assets/logo.png -------------------------------------------------------------------------------- /packages/menu/src/menu.scss: -------------------------------------------------------------------------------- 1 | .menu-icon-svg { 2 | svg { 3 | margin-right: 4px; 4 | width: 1em; 5 | height: 1em; 6 | } 7 | } -------------------------------------------------------------------------------- /src/components/base/menu/src/menu.scss: -------------------------------------------------------------------------------- 1 | .menu-icon-svg { 2 | svg { 3 | margin-right: 4px; 4 | width: 1em; 5 | height: 1em; 6 | } 7 | } -------------------------------------------------------------------------------- /packages/table/README.md: -------------------------------------------------------------------------------- 1 | ## 功能 2 | 1. 可配置型, 可维护 3 | 2. 具备`element-plus` 原有表格的所有功能 4 | 3. 可以自行拓展更多的功能 5 | 6 | ## 目的 7 | 1. 简单好用 8 | 2. 拓展性强 9 | 3. 可维护性强 -------------------------------------------------------------------------------- /src/components/base/table/README.md: -------------------------------------------------------------------------------- 1 | ## 功能 2 | 1. 可配置型, 可维护 3 | 2. 具备`element-plus` 原有表格的所有功能 4 | 3. 可以自行拓展更多的功能 5 | 6 | ## 目的 7 | 1. 简单好用 8 | 2. 拓展性强 9 | 3. 可维护性强 -------------------------------------------------------------------------------- /packages/list/index.ts: -------------------------------------------------------------------------------- 1 | import { App } from 'vue' 2 | import list from './src/index.vue'; 3 | export default { 4 | install(app: App) { 5 | app.component('w-list',list) 6 | } 7 | } -------------------------------------------------------------------------------- /packages/form/index.ts: -------------------------------------------------------------------------------- 1 | import { App } from 'vue' 2 | import wForm from './src/index.vue'; 3 | export default { 4 | install(app: App) { 5 | app.component('w-form',wForm) 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /packages/trend/index.ts: -------------------------------------------------------------------------------- 1 | import { App } from 'vue' 2 | import trend from './src/index.vue'; 3 | export default { 4 | install(app: App) { 5 | app.component('w-trend',trend) 6 | } 7 | } -------------------------------------------------------------------------------- /tsconfig.node.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "composite": true, 4 | "module": "esnext", 5 | "moduleResolution": "node" 6 | }, 7 | "include": ["vite.config.ts"] 8 | } 9 | -------------------------------------------------------------------------------- /packages/menu/src/types.ts: -------------------------------------------------------------------------------- 1 | export interface MenuItem { 2 | icon?: string; // 图标 3 | i?: any; // 4 | name: string; // 导航名字 5 | index: string; // 标识 6 | children?: MenuItem[]; // 子菜单 7 | } -------------------------------------------------------------------------------- /packages/table/index.ts: -------------------------------------------------------------------------------- 1 | import { App } from 'vue' 2 | import wTable from './src/index.vue'; 3 | export default { 4 | install(app: App) { 5 | app.component('w-table',wTable) 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/components/base/list/index.ts: -------------------------------------------------------------------------------- 1 | import { App } from 'vue' 2 | import list from './src/index.vue'; 3 | export default { 4 | install(app: App) { 5 | app.component('w-list',list) 6 | } 7 | } -------------------------------------------------------------------------------- /packages/progress/index.ts: -------------------------------------------------------------------------------- 1 | import { App } from 'vue' 2 | import progress from './src/index.vue'; 3 | export default { 4 | install(app: App) { 5 | app.component('w-progress',progress) 6 | } 7 | } -------------------------------------------------------------------------------- /src/components/base/form/index.ts: -------------------------------------------------------------------------------- 1 | import { App } from 'vue' 2 | import wForm from './src/index.vue'; 3 | export default { 4 | install(app: App) { 5 | app.component('w-form',wForm) 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/components/base/trend/index.ts: -------------------------------------------------------------------------------- 1 | import { App } from 'vue' 2 | import trend from './src/index.vue'; 3 | export default { 4 | install(app: App) { 5 | app.component('w-trend',trend) 6 | } 7 | } -------------------------------------------------------------------------------- /packages/calendar/index.ts: -------------------------------------------------------------------------------- 1 | import { App } from 'vue' 2 | import calendar from './src/index.vue' 3 | 4 | export default { 5 | install(app: App) { 6 | app.component('w-calendar', calendar) 7 | } 8 | } -------------------------------------------------------------------------------- /packages/modelForm/index.ts: -------------------------------------------------------------------------------- 1 | import { App } from 'vue' 2 | import modelForm from './src/index.vue'; 3 | export default { 4 | install(app: App) { 5 | app.component('w-model-form',modelForm) 6 | } 7 | } -------------------------------------------------------------------------------- /src/components/base/menu/src/types.ts: -------------------------------------------------------------------------------- 1 | export interface MenuItem { 2 | icon?: string; // 图标 3 | i?: any; // 4 | name: string; // 导航名字 5 | index: string; // 标识 6 | children?: MenuItem[]; // 子菜单 7 | } -------------------------------------------------------------------------------- /src/components/base/table/index.ts: -------------------------------------------------------------------------------- 1 | import { App } from 'vue' 2 | import wTable from './src/index.vue'; 3 | export default { 4 | install(app: App) { 5 | app.component('w-table',wTable) 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /packages/chooseArea/index.ts: -------------------------------------------------------------------------------- 1 | import { App } from 'vue' 2 | import chooseArea from './src/index.vue'; 3 | export default { 4 | install(app: App) { 5 | app.component('w-choose-area',chooseArea) 6 | } 7 | } -------------------------------------------------------------------------------- /packages/chooseCity/index.ts: -------------------------------------------------------------------------------- 1 | import { App } from 'vue' 2 | import chooseCity from './src/index.vue'; 3 | export default { 4 | install(app: App) { 5 | app.component('w-choose-city',chooseCity) 6 | } 7 | } -------------------------------------------------------------------------------- /packages/chooseDate/index.ts: -------------------------------------------------------------------------------- 1 | import { App } from 'vue' 2 | import chooseDate from './src/index.vue'; 3 | export default { 4 | install(app: App) { 5 | app.component('w-choose-date',chooseDate) 6 | } 7 | } -------------------------------------------------------------------------------- /packages/chooseIcon/index.ts: -------------------------------------------------------------------------------- 1 | import { App } from 'vue' 2 | import chooseIcon from './src/index.vue'; 3 | export default { 4 | install(app: App) { 5 | app.component('w-choose-icon',chooseIcon) 6 | } 7 | } -------------------------------------------------------------------------------- /packages/chooseTime/index.ts: -------------------------------------------------------------------------------- 1 | import { App } from 'vue' 2 | import chooseTime from './src/index.vue'; 3 | export default { 4 | install(app: App) { 5 | app.component('w-choose-time',chooseTime) 6 | } 7 | } -------------------------------------------------------------------------------- /src/components/base/progress/index.ts: -------------------------------------------------------------------------------- 1 | import { App } from 'vue' 2 | import progress from './src/index.vue'; 3 | export default { 4 | install(app: App) { 5 | app.component('w-progress',progress) 6 | } 7 | } -------------------------------------------------------------------------------- /packages/notification/index.ts: -------------------------------------------------------------------------------- 1 | import { App } from 'vue' 2 | import notification from './src/index.vue'; 3 | export default { 4 | install(app: App) { 5 | app.component('w-notification',notification) 6 | } 7 | } -------------------------------------------------------------------------------- /src/components/base/calendar/index.ts: -------------------------------------------------------------------------------- 1 | import { App } from 'vue' 2 | import calendar from './src/index.vue' 3 | 4 | export default { 5 | install(app: App) { 6 | app.component('w-calendar', calendar) 7 | } 8 | } -------------------------------------------------------------------------------- /src/components/base/modelForm/index.ts: -------------------------------------------------------------------------------- 1 | import { App } from 'vue' 2 | import modelForm from './src/index.vue'; 3 | export default { 4 | install(app: App) { 5 | app.component('w-model-form',modelForm) 6 | } 7 | } -------------------------------------------------------------------------------- /packages/calendar/src/types.ts: -------------------------------------------------------------------------------- 1 | export interface EventItem { 2 | // 事件标题 3 | title: string, 4 | // 开始时间 5 | start: string, 6 | // 结束时间 7 | end: string, 8 | // 是否可拖动编辑 9 | editable?: boolean 10 | } -------------------------------------------------------------------------------- /src/components/base/chooseArea/index.ts: -------------------------------------------------------------------------------- 1 | import { App } from 'vue' 2 | import chooseArea from './src/index.vue'; 3 | export default { 4 | install(app: App) { 5 | app.component('w-choose-area',chooseArea) 6 | } 7 | } -------------------------------------------------------------------------------- /src/components/base/chooseCity/index.ts: -------------------------------------------------------------------------------- 1 | import { App } from 'vue' 2 | import chooseCity from './src/index.vue'; 3 | export default { 4 | install(app: App) { 5 | app.component('w-choose-city',chooseCity) 6 | } 7 | } -------------------------------------------------------------------------------- /src/components/base/chooseDate/index.ts: -------------------------------------------------------------------------------- 1 | import { App } from 'vue' 2 | import chooseDate from './src/index.vue'; 3 | export default { 4 | install(app: App) { 5 | app.component('w-choose-date',chooseDate) 6 | } 7 | } -------------------------------------------------------------------------------- /src/components/base/chooseIcon/index.ts: -------------------------------------------------------------------------------- 1 | import { App } from 'vue' 2 | import chooseIcon from './src/index.vue'; 3 | export default { 4 | install(app: App) { 5 | app.component('w-choose-icon',chooseIcon) 6 | } 7 | } -------------------------------------------------------------------------------- /src/components/base/chooseTime/index.ts: -------------------------------------------------------------------------------- 1 | import { App } from 'vue' 2 | import chooseTime from './src/index.vue'; 3 | export default { 4 | install(app: App) { 5 | app.component('w-choose-time',chooseTime) 6 | } 7 | } -------------------------------------------------------------------------------- /src/components/base/notification/index.ts: -------------------------------------------------------------------------------- 1 | import { App } from 'vue' 2 | import notification from './src/index.vue'; 3 | export default { 4 | install(app: App) { 5 | app.component('w-notification',notification) 6 | } 7 | } -------------------------------------------------------------------------------- /src/components/base/calendar/src/types.ts: -------------------------------------------------------------------------------- 1 | export interface EventItem { 2 | // 事件标题 3 | title: string, 4 | // 开始时间 5 | start: string, 6 | // 结束时间 7 | end: string, 8 | // 是否可拖动编辑 9 | editable?: boolean 10 | } -------------------------------------------------------------------------------- /packages/chooseAreaFour/index.ts: -------------------------------------------------------------------------------- 1 | // 四级联动区域选择组件 2 | import { App } from 'vue' 3 | import chooseAreaFour from './src/index.vue'; 4 | export default { 5 | install(app: App) { 6 | app.component('w-choose-areafour',chooseAreaFour) 7 | } 8 | } -------------------------------------------------------------------------------- /src/views/Setting.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 11 | 12 | -------------------------------------------------------------------------------- /src/components/base/chooseAreaFour/index.ts: -------------------------------------------------------------------------------- 1 | // 四级联动区域选择组件 2 | import { App } from 'vue' 3 | import chooseAreaFour from './src/index.vue'; 4 | export default { 5 | install(app: App) { 6 | app.component('w-choose-areafour',chooseAreaFour) 7 | } 8 | } -------------------------------------------------------------------------------- /packages/chooseCity/src/types.ts: -------------------------------------------------------------------------------- 1 | export interface City { 2 | id: number, 3 | // 拼音 4 | spell: string, 5 | // 名字 6 | name: string 7 | } 8 | 9 | export interface Province { 10 | name: string, 11 | data: string[], 12 | id?: string 13 | } -------------------------------------------------------------------------------- /src/views/chooseCity/index.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 11 | 12 | -------------------------------------------------------------------------------- /src/components/base/chooseCity/src/types.ts: -------------------------------------------------------------------------------- 1 | export interface City { 2 | id: number, 3 | // 拼音 4 | spell: string, 5 | // 名字 6 | name: string 7 | } 8 | 9 | export interface Province { 10 | name: string, 11 | data: string[], 12 | id?: string 13 | } -------------------------------------------------------------------------------- /src/App.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 18 | -------------------------------------------------------------------------------- /packages/menu/index.ts: -------------------------------------------------------------------------------- 1 | import { App } from 'vue' 2 | import menu from './src/index.vue'; 3 | import infiniteMenu from './src/menu' 4 | export default { 5 | install(app: App) { 6 | app.component('w-menu',menu) 7 | app.component('w-infinite-menu',infiniteMenu) 8 | } 9 | } -------------------------------------------------------------------------------- /src/components/base/menu/index.ts: -------------------------------------------------------------------------------- 1 | import { App } from 'vue' 2 | import menu from './src/index.vue'; 3 | import infiniteMenu from './src/menu' 4 | export default { 5 | install(app: App) { 6 | app.component('w-menu',menu) 7 | app.component('w-infinite-menu',infiniteMenu) 8 | } 9 | } -------------------------------------------------------------------------------- /packages/table/src/types.ts: -------------------------------------------------------------------------------- 1 | export interface TableOptions { 2 | label: string, // 表头 3 | prop: string, // 字段名称 4 | width?: string | number, // 列宽 5 | align?: 'left' | 'center' | 'right', 6 | slot?: string, // 自定义列表名称 7 | action?: boolean, // 是否代表操作项 8 | editable?: boolean, // 是否可编辑 9 | } -------------------------------------------------------------------------------- /src/components/base/table/src/types.ts: -------------------------------------------------------------------------------- 1 | export interface TableOptions { 2 | label: string, // 表头 3 | prop: string, // 字段名称 4 | width?: string | number, // 列宽 5 | align?: 'left' | 'center' | 'right', 6 | slot?: string, // 自定义列表名称 7 | action?: boolean, // 是否代表操作项 8 | editable?: boolean, // 是否可编辑 9 | } -------------------------------------------------------------------------------- /src/env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | declare module '*.vue' { 4 | import type { DefineComponent } from 'vue' 5 | // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types 6 | const component: DefineComponent<{}, {}, any> 7 | export default component 8 | } 9 | -------------------------------------------------------------------------------- /packages/vue.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | declare module '*.vue' { 4 | import type { DefineComponent } from 'vue' 5 | // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types 6 | const component: DefineComponent<{}, {}, any> 7 | export default component 8 | } 9 | -------------------------------------------------------------------------------- /vite.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | import vue from '@vitejs/plugin-vue' 3 | import vueJsx from '@vitejs/plugin-vue-jsx' 4 | 5 | // https://vitejs.dev/config/ 6 | export default defineConfig({ 7 | plugins: [vue(), vueJsx()], 8 | server: { 9 | port: 8080, // 自定义端口号,一般3000以后 10 | open: true, // 是否自动浏览器打开 11 | } 12 | }) 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | lib 14 | *.local 15 | 16 | # Editor directories and files 17 | .vscode/* 18 | !.vscode/extensions.json 19 | .idea 20 | .DS_Store 21 | *.suo 22 | *.ntvs* 23 | *.njsproj 24 | *.sln 25 | *.sw? 26 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Vite App 8 | 9 | 10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/views/trend/index.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 12 | 13 | -------------------------------------------------------------------------------- /src/views/Home.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 14 | 15 | -------------------------------------------------------------------------------- /packages/form/README.md: -------------------------------------------------------------------------------- 1 | ## 功能 2 | 1. 可配置型的表单,通过json对象的方式自动生成表单 3 | 2. 具备完善的功能, 表单验证, 动态删减表单,集成第三方插件 4 | 3. 用法简单,扩展性好,便于维护 5 | 4. 多场景,如: 弹框嵌套表单 6 | 7 | ## 准备 8 | 1. 分析`element-plus`表单能够用在哪些方面做优化 9 | 2. 完善类型,支持ts 10 | 3. 具备原有的`element-plus`表单功能 11 | 4. 集成第三方插件: markdown编辑器,富文本编辑器等等。 12 | 13 | ## 资料 14 | `element-plus`使用的表单校验插件是async-validator这个库, 15 | 16 | [async-validator地址](https://github.com/yiminghe/async-validator/blob/master/src/interface.ts) -------------------------------------------------------------------------------- /packages/list/src/types.ts: -------------------------------------------------------------------------------- 1 | export interface ListItem { 2 | avatar?: string; 3 | title?: string; 4 | desc?: string; 5 | time?: string; 6 | tag?: string; // 标签内容 7 | tagType?: "" | "success" | "info" | "warning" | "danger"; 8 | } 9 | 10 | // 列表 11 | export interface ListOptions { 12 | title: string; 13 | content: ListItem[]; 14 | } 15 | 16 | // 操作选项 17 | export interface ActionOptions { 18 | text: string; 19 | icon?: string; 20 | } 21 | -------------------------------------------------------------------------------- /src/components/base/form/README.md: -------------------------------------------------------------------------------- 1 | ## 功能 2 | 1. 可配置型的表单,通过json对象的方式自动生成表单 3 | 2. 具备完善的功能, 表单验证, 动态删减表单,集成第三方插件 4 | 3. 用法简单,扩展性好,便于维护 5 | 4. 多场景,如: 弹框嵌套表单 6 | 7 | ## 准备 8 | 1. 分析`element-plus`表单能够用在哪些方面做优化 9 | 2. 完善类型,支持ts 10 | 3. 具备原有的`element-plus`表单功能 11 | 4. 集成第三方插件: markdown编辑器,富文本编辑器等等。 12 | 13 | ## 资料 14 | `element-plus`使用的表单校验插件是async-validator这个库, 15 | 16 | [async-validator地址](https://github.com/yiminghe/async-validator/blob/master/src/interface.ts) -------------------------------------------------------------------------------- /src/components/base/list/src/types.ts: -------------------------------------------------------------------------------- 1 | export interface ListItem { 2 | avatar?: string; 3 | title?: string; 4 | desc?: string; 5 | time?: string; 6 | tag?: string; // 标签内容 7 | tagType?: "" | "success" | "info" | "warning" | "danger"; 8 | } 9 | 10 | // 列表 11 | export interface ListOptions { 12 | title: string; 13 | content: ListItem[]; 14 | } 15 | 16 | // 操作选项 17 | export interface ActionOptions { 18 | text: string; 19 | icon?: string; 20 | } 21 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "esnext", 4 | "useDefineForClassFields": true, 5 | "module": "esnext", 6 | "moduleResolution": "node", 7 | "strict": true, 8 | "jsx": "preserve", 9 | "sourceMap": true, 10 | "resolveJsonModule": true, 11 | "isolatedModules": false, 12 | "esModuleInterop": true, 13 | "lib": ["esnext", "dom"], 14 | "skipLibCheck": true 15 | }, 16 | "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"], 17 | "references": [{ "path": "./tsconfig.node.json" }] 18 | } 19 | -------------------------------------------------------------------------------- /src/views/About.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 26 | 27 | -------------------------------------------------------------------------------- /src/components/layout/navHeader.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 22 | 23 | -------------------------------------------------------------------------------- /src/main.ts: -------------------------------------------------------------------------------- 1 | import { createApp } from 'vue' 2 | import App from './App.vue' 3 | import router from './router/index' 4 | import ElementPlus from 'element-plus' 5 | import 'element-plus/dist/index.css' 6 | import * as Icons from '@element-plus/icons-vue' 7 | // import WComponents from './components/base'; 8 | 9 | import WComponents from '../lib/wjh-element-component.es.js'; 10 | import '../lib/style.css' 11 | 12 | // 单组件引入 13 | // import chooseIcon from '../lib/chooseIcon/index.es' 14 | // import '../lib/chooseIcon/style.css'; 15 | 16 | import './mock' 17 | 18 | const app = createApp(App) 19 | 20 | // 遍历注册全局icon 21 | for(let icon in Icons) { 22 | app.component(icon, (Icons as any)[icon]) 23 | } 24 | 25 | app.use(router).use(ElementPlus).use(WComponents) 26 | app.mount('#app') 27 | -------------------------------------------------------------------------------- /src/components/layout/index.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 25 | 26 | 34 | -------------------------------------------------------------------------------- /src/views/chooseTime/index.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /packages/notification/src/index.vue: -------------------------------------------------------------------------------- 1 | 19 | 20 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /src/views/notification/index.vue: -------------------------------------------------------------------------------- 1 | 23 | 24 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /src/views/progress/index.vue: -------------------------------------------------------------------------------- 1 | 24 | 25 | 29 | 30 | -------------------------------------------------------------------------------- /src/components/base/notification/src/index.vue: -------------------------------------------------------------------------------- 1 | 19 | 20 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /packages/progress/src/index.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /src/components/base/progress/src/index.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /packages/index.ts: -------------------------------------------------------------------------------- 1 | import {App} from 'vue' 2 | import chooseIcon from './chooseIcon' 3 | import chooseArea from './chooseArea' 4 | import chooseAreaFour from './chooseAreaFour' 5 | import wForm from './form' 6 | import modelForm from './modelForm'; 7 | import wTable from './table'; 8 | import wTrend from './trend'; 9 | import wNotification from './notification'; 10 | import wList from './list'; 11 | import wMenu from './menu'; 12 | import wProgress from './progress'; 13 | import chooseTime from './chooseTime' 14 | import chooseDate from './chooseDate' 15 | import chooseCity from './chooseCity' 16 | import calendar from './calendar' 17 | 18 | const components =[ 19 | chooseIcon, 20 | chooseArea, 21 | chooseAreaFour, 22 | chooseTime, 23 | chooseDate, 24 | chooseCity, 25 | wForm, 26 | modelForm, 27 | wTable, 28 | wTrend, 29 | wNotification, 30 | wList, 31 | wMenu, 32 | wProgress, 33 | calendar 34 | ] 35 | 36 | export default { 37 | install(app: App) { 38 | components.map(item => { 39 | app.use(item) 40 | }) 41 | } 42 | } -------------------------------------------------------------------------------- /src/components/base/index.ts: -------------------------------------------------------------------------------- 1 | import {App} from 'vue' 2 | import chooseIcon from './chooseIcon' 3 | import chooseArea from './chooseArea' 4 | import chooseAreaFour from './chooseAreaFour' 5 | import wForm from './form' 6 | import modelForm from './modelForm'; 7 | import wTable from './table'; 8 | import wTrend from './trend'; 9 | import wNotification from './notification'; 10 | import wList from './list'; 11 | import wMenu from './menu'; 12 | import wProgress from './progress'; 13 | import chooseTime from './chooseTime' 14 | import chooseDate from './chooseDate' 15 | import chooseCity from './chooseCity' 16 | import calendar from './calendar' 17 | 18 | const components =[ 19 | chooseIcon, 20 | chooseArea, 21 | chooseAreaFour, 22 | chooseTime, 23 | chooseDate, 24 | chooseCity, 25 | wForm, 26 | modelForm, 27 | wTable, 28 | wTrend, 29 | wNotification, 30 | wList, 31 | wMenu, 32 | wProgress, 33 | calendar 34 | ] 35 | 36 | export default { 37 | install(app: App) { 38 | components.map(item => { 39 | app.use(item) 40 | }) 41 | } 42 | } -------------------------------------------------------------------------------- /src/mock/index.ts: -------------------------------------------------------------------------------- 1 | //mock.js 文件 2 | import Mock from 'mockjs' // 引入mockjs 3 | const Random = Mock.Random // Mock.Random 是一个工具类,用于生成各种随机数据 4 | 5 | interface DataList { 6 | date: string, 7 | name: string, 8 | address: string 9 | } 10 | 11 | const dataList: DataList[] = [] // 用于接受生成数据的数组 12 | for (let i = 0; i < 100; i++) { // 可自定义生成的个数 13 | const template = { 14 | date: Random.date(), // 生成一个随机日期,可加参数定义日期格式 15 | name: Random.name(), // 生成姓名 16 | address: Random.province() // 生成地址 17 | } 18 | dataList.push(template) 19 | } 20 | // list 分页接口() 21 | 22 | Mock.mock('/api/list', 'post', (params: any) => { 23 | let info = JSON.parse(params.body) 24 | let [index, size, total] = [info.current, info.pageSize, dataList.length] 25 | let len = total / size 26 | let totalPages = len - parseInt(String(len)) > 0 ? parseInt(String(len)) + 1 : len 27 | let newDataList = dataList.slice(index * size, (index + 1) * size) 28 | return { 29 | 'code': '200', 30 | 'message': '获取成功', 31 | 'data': { 32 | 'current': index, 33 | 'pageSize': size, 34 | 'rows': newDataList, 35 | 'total': total, 36 | 'totalPages': totalPages 37 | } 38 | } 39 | }) 40 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "wjh-components", 3 | "private": true, 4 | "version": "0.0.0", 5 | "scripts": { 6 | "dev": "vite", 7 | "build": "vue-tsc --noEmit && vite build", 8 | "preview": "vite preview", 9 | "build:components": "node ./command/build.js", 10 | "lib": "npm run build:components", 11 | "lib2": "npm run build:components && copy package.json" 12 | }, 13 | "dependencies": { 14 | "@element-plus/icons-vue": "^1.1.4", 15 | "@fullcalendar/core": "^5.11.0", 16 | "@fullcalendar/daygrid": "^5.11.0", 17 | "@fullcalendar/interaction": "^5.11.0", 18 | "@types/lodash": "^4.14.182", 19 | "@wangeditor/editor": "^5.0.1", 20 | "element-plus": "^2.1.10", 21 | "lodash": "^4.17.21", 22 | "vue": "^3.2.25", 23 | "vue-router": "^4.0.14" 24 | }, 25 | "devDependencies": { 26 | "@types/mockjs": "^1.0.6", 27 | "@vitejs/plugin-vue": "^2.3.1", 28 | "@vitejs/plugin-vue-jsx": "^1.3.10", 29 | "axios": "^0.27.2", 30 | "fs-extra": "^10.1.0", 31 | "mockjs": "^1.1.0", 32 | "sass": "^1.50.1", 33 | "sass-loader": "^12.6.0", 34 | "typescript": "^4.5.4", 35 | "vite": "^2.9.5", 36 | "vue-tsc": "^0.34.7" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /packages/menu/src/index.vue: -------------------------------------------------------------------------------- 1 | 33 | 34 | 55 | 56 | 62 | -------------------------------------------------------------------------------- /src/views/calendar/index.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /src/components/base/menu/src/index.vue: -------------------------------------------------------------------------------- 1 | 33 | 34 | 55 | 56 | 62 | -------------------------------------------------------------------------------- /packages/trend/src/index.vue: -------------------------------------------------------------------------------- 1 | 17 | 18 | 71 | 72 | 83 | -------------------------------------------------------------------------------- /src/components/base/trend/src/index.vue: -------------------------------------------------------------------------------- 1 | 17 | 18 | 71 | 72 | 83 | -------------------------------------------------------------------------------- /packages/modelForm/src/index.vue: -------------------------------------------------------------------------------- 1 | 32 | 33 | 87 | 88 | -------------------------------------------------------------------------------- /src/components/base/modelForm/src/index.vue: -------------------------------------------------------------------------------- 1 | 32 | 33 | 87 | 88 | -------------------------------------------------------------------------------- /src/views/menu/index.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 87 | 88 | 94 | -------------------------------------------------------------------------------- /packages/chooseDate/src/index.vue: -------------------------------------------------------------------------------- 1 | 21 | 22 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /src/views/notification/data.ts: -------------------------------------------------------------------------------- 1 | export const list = [ 2 | { 3 | title: '通知', 4 | content: [ 5 | { 6 | title: '蒂姆·库克回复了你的邮件', 7 | time: '2019-05-08 14:33:18', 8 | avatar: 'https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png' 9 | }, 10 | { 11 | title: '乔纳森·伊夫邀请你参加会议', 12 | time: '2019-05-08 14:33:18', 13 | avatar: 'https://gw.alipayobjects.com/zos/rmsportal/OKJXDXrmkNshAMvwtvhu.png' 14 | }, 15 | { 16 | title: '斯蒂夫·沃兹尼亚克已批准了你的休假申请', 17 | time: '2019-05-08 14:33:18', 18 | avatar: 'https://gw.alipayobjects.com/zos/rmsportal/kISTdvpyTAhtGxpovNWd.png' 19 | } 20 | 21 | ], 22 | }, 23 | { 24 | title: '关注', 25 | content: [ 26 | { 27 | avatar: 'https://gw.alipayobjects.com/zos/rmsportal/fcHMVNCjPOsbUGdEduuv.jpeg', 28 | title: '曲丽丽 评论了你', 29 | desc: '描述信息描述信息描述信息', 30 | time: '3小时前' 31 | }, 32 | { 33 | avatar: 'https://gw.alipayobjects.com/zos/rmsportal/fcHMVNCjPOsbUGdEduuv.jpeg', 34 | title: '曲丽丽 评论了你', 35 | desc: '描述信息描述信息描述信息', 36 | time: '3小时前' 37 | }, 38 | { 39 | avatar: 'https://gw.alipayobjects.com/zos/rmsportal/fcHMVNCjPOsbUGdEduuv.jpeg', 40 | title: '曲丽丽 评论了你', 41 | desc: '描述信息描述信息描述信息', 42 | time: '3小时前' 43 | } 44 | ] 45 | }, 46 | { 47 | title: '代办', 48 | content: [ 49 | { 50 | title: '任务名称', 51 | desc: '任务需要在 2017-01-12 20:00 前启动', 52 | tag: '未开始', 53 | tagType: '' 54 | }, 55 | { 56 | title: '第三方紧急代码变更', 57 | desc: '冠霖提交于 2017-01-06,需在 2017-01-07 前完成代码变更任务', 58 | tag: '马上到期', 59 | tagType: 'danger' 60 | }, 61 | { 62 | title: '信息安全考试', 63 | desc: '指派竹尔于 2017-01-09 前完成更新并发布', 64 | tag: '已耗时8天', 65 | tagType: 'warning' 66 | } 67 | ] 68 | }, 69 | ] 70 | export const actions = [ 71 | { 72 | text: '清空代办', 73 | icon: 'delete' 74 | }, 75 | { 76 | text: '查看更多', 77 | icon: 'edit' 78 | }, 79 | ] -------------------------------------------------------------------------------- /src/components/base/chooseDate/src/index.vue: -------------------------------------------------------------------------------- 1 | 21 | 22 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /packages/chooseTime/src/index.vue: -------------------------------------------------------------------------------- 1 | 23 | 24 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /src/components/base/chooseTime/src/index.vue: -------------------------------------------------------------------------------- 1 | 23 | 24 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /src/router/index.ts: -------------------------------------------------------------------------------- 1 | import { createRouter, createWebHistory, RouteRecordRaw } from "vue-router"; 2 | import Home from "../views/Home.vue"; 3 | import Layout from "../components/layout/index.vue"; 4 | 5 | const routes: RouteRecordRaw[] = [ 6 | { 7 | path: "/", 8 | component: Layout, 9 | children: [ 10 | { 11 | path: "/", 12 | component: Home, 13 | }, 14 | { 15 | path: '/about', 16 | name: 'About', 17 | component: () => import('../views/About.vue') 18 | }, 19 | { 20 | path: '/setting', 21 | name: 'Setting', 22 | component: () => import('../views/Setting.vue') 23 | }, 24 | { 25 | path: '/form', 26 | name: 'Form', 27 | component: () => import('../views/form/index.vue') 28 | }, 29 | { 30 | path: '/modelForm', 31 | name: 'ModelForm', 32 | component: () => import('../views/modelForm/index.vue') 33 | }, 34 | { 35 | path: '/wTable', 36 | name: 'wTable', 37 | component: () => import('../views/table/index.vue') 38 | }, 39 | { 40 | path: '/wTrend', 41 | name: 'wTrend', 42 | component: () => import('../views/trend/index.vue') 43 | }, 44 | { 45 | path: '/wNotification', 46 | name: 'wNotification', 47 | component: () => import('../views/notification/index.vue') 48 | }, 49 | { 50 | path: '/wMenu', 51 | name: 'wMenu', 52 | component: () => import('../views/menu/index.vue') 53 | }, 54 | { 55 | path: '/wProgress', 56 | name: 'wProgress', 57 | component: () => import('../views/progress/index.vue') 58 | }, 59 | { 60 | path: '/chooseTime', 61 | name: 'chooseTime', 62 | component: () => import('../views/chooseTime/index.vue') 63 | }, 64 | { 65 | path: '/chooseCity', 66 | name: 'chooseCity', 67 | component: () => import('../views/chooseCity/index.vue') 68 | }, 69 | { 70 | path: '/calendar', 71 | name: 'calendar', 72 | component: () => import('../views/calendar/index.vue') 73 | }, 74 | ], 75 | }, 76 | ]; 77 | 78 | const router = createRouter({ 79 | routes, 80 | history: createWebHistory(), 81 | }); 82 | 83 | export default router; 84 | -------------------------------------------------------------------------------- /packages/chooseIcon/src/index.vue: -------------------------------------------------------------------------------- 1 | 24 | 25 | 68 | 69 | -------------------------------------------------------------------------------- /src/components/base/chooseIcon/src/index.vue: -------------------------------------------------------------------------------- 1 | 24 | 25 | 68 | 69 | -------------------------------------------------------------------------------- /packages/form/src/types/types.ts: -------------------------------------------------------------------------------- 1 | import { CSSProperties } from 'vue' 2 | import { RuleItem } from './rules' 3 | import { ValidateFieldsError } from 'async-validator' 4 | 5 | interface Callback { 6 | (isValid: boolean, invalidFields?: ValidateFieldsError): void 7 | } 8 | 9 | // 表单每一项的配置选项 10 | export interface FormOptions { 11 | // 表单项显示的元素 12 | type: 'cascader' | 'checkbox' | 'checkbox-group' | 'checkbox-button' | 'color-picker' | 13 | 'date-picker' | 'input' | 'input-number' | 'radio' | 'radio-group' | 'radio-button' | 'rate' | 14 | 'select' | 'option' | 'slider' | 'switch' | 'time-picker' | 'time-select' | 15 | 'transfer' | 'upload' | 'editor', 16 | 17 | value?: any, // 表单项的值 18 | label?: string, // 表单项label 19 | prop?: string, // 表单项的标识 20 | rules?: RuleItem[], // 表单项验证规则 21 | placeholder?: string, // 占位符 22 | // 表单元素特有的属性 23 | attrs?: { 24 | clearable?: boolean, 25 | showPassword?: boolean, 26 | disabled?: boolean, 27 | // CSS 样式属性 28 | style?: CSSProperties, 29 | } 30 | // 表单项的子元素 31 | children?: FormOptions[], 32 | // 处理上传组件的属性和方法 33 | uploadAttrs?: { 34 | action: string, 35 | header?: string, 36 | method?: 'post' | 'put' | 'patch', 37 | multiple?: boolean, 38 | data?: any, 39 | name?: string, 40 | withCreadentials?: boolean, 41 | howFileList?: boolean, 42 | drag?: boolean, 43 | accept?:string, 44 | thumbnailMode?: boolean, 45 | listType?: 'text' | 'picture' | 'picture-card', 46 | autoUpload?: boolean, 47 | limit?:number, 48 | } 49 | } 50 | 51 | export interface ValidateFieldCallback { 52 | (message: string, invalidFields?: ValidateFieldsError): void 53 | } 54 | 55 | 56 | export interface FormInstance { 57 | registerLabelWidth(width: number, oldWidth: number): void, 58 | deregisterLabelWidth(width: number): void, 59 | autoLabelWidth: string | undefined, 60 | emit: (evt: string, ...args: any[]) => void, 61 | labelSuffix: string, 62 | inline?: boolean, 63 | model?: Record, 64 | size?: string, 65 | showMessage?: boolean, 66 | labelPosition?: string, 67 | labelWidth?: string, 68 | rules?: Record, 69 | statusIcon?: boolean, 70 | hideRequiredAsterisk?: boolean, 71 | disabled?: boolean, 72 | validate: (callback?: Callback) => Promise, 73 | resetFields: () => void, 74 | clearValidate: (props?: string | string[]) => void, 75 | validateField: (props: string | string[], cb: ValidateFieldCallback) => void, 76 | } -------------------------------------------------------------------------------- /src/components/base/form/src/types/types.ts: -------------------------------------------------------------------------------- 1 | import { CSSProperties } from 'vue' 2 | import { RuleItem } from './rules' 3 | import { ValidateFieldsError } from 'async-validator' 4 | 5 | interface Callback { 6 | (isValid: boolean, invalidFields?: ValidateFieldsError): void 7 | } 8 | 9 | // 表单每一项的配置选项 10 | export interface FormOptions { 11 | // 表单项显示的元素 12 | type: 'cascader' | 'checkbox' | 'checkbox-group' | 'checkbox-button' | 'color-picker' | 13 | 'date-picker' | 'input' | 'input-number' | 'radio' | 'radio-group' | 'radio-button' | 'rate' | 14 | 'select' | 'option' | 'slider' | 'switch' | 'time-picker' | 'time-select' | 15 | 'transfer' | 'upload' | 'editor', 16 | 17 | value?: any, // 表单项的值 18 | label?: string, // 表单项label 19 | prop?: string, // 表单项的标识 20 | rules?: RuleItem[], // 表单项验证规则 21 | placeholder?: string, // 占位符 22 | // 表单元素特有的属性 23 | attrs?: { 24 | clearable?: boolean, 25 | showPassword?: boolean, 26 | disabled?: boolean, 27 | // CSS 样式属性 28 | style?: CSSProperties, 29 | } 30 | // 表单项的子元素 31 | children?: FormOptions[], 32 | // 处理上传组件的属性和方法 33 | uploadAttrs?: { 34 | action: string, 35 | header?: string, 36 | method?: 'post' | 'put' | 'patch', 37 | multiple?: boolean, 38 | data?: any, 39 | name?: string, 40 | withCreadentials?: boolean, 41 | howFileList?: boolean, 42 | drag?: boolean, 43 | accept?:string, 44 | thumbnailMode?: boolean, 45 | listType?: 'text' | 'picture' | 'picture-card', 46 | autoUpload?: boolean, 47 | limit?:number, 48 | } 49 | } 50 | 51 | export interface ValidateFieldCallback { 52 | (message: string, invalidFields?: ValidateFieldsError): void 53 | } 54 | 55 | 56 | export interface FormInstance { 57 | registerLabelWidth(width: number, oldWidth: number): void, 58 | deregisterLabelWidth(width: number): void, 59 | autoLabelWidth: string | undefined, 60 | emit: (evt: string, ...args: any[]) => void, 61 | labelSuffix: string, 62 | inline?: boolean, 63 | model?: Record, 64 | size?: string, 65 | showMessage?: boolean, 66 | labelPosition?: string, 67 | labelWidth?: string, 68 | rules?: Record, 69 | statusIcon?: boolean, 70 | hideRequiredAsterisk?: boolean, 71 | disabled?: boolean, 72 | validate: (callback?: Callback) => Promise, 73 | resetFields: () => void, 74 | clearValidate: (props?: string | string[]) => void, 75 | validateField: (props: string | string[], cb: ValidateFieldCallback) => void, 76 | } -------------------------------------------------------------------------------- /command/build.js: -------------------------------------------------------------------------------- 1 | const { defineConfig, build } = require('vite') 2 | const vue = require('@vitejs/plugin-vue') 3 | const vueJsx = require('@vitejs/plugin-vue-jsx') 4 | const path = require('path') 5 | const fsExtra = require('fs-extra') 6 | const fs = require('fs') 7 | 8 | // 打包入口文件夹 9 | const entryDir = path.resolve(__dirname, '../packages') 10 | 11 | // 出口 12 | const outDir = path.resolve(__dirname, '../lib') 13 | 14 | // vite基础配置 15 | const baseConfig = defineConfig({ 16 | configFile: false, 17 | publicDir: false, 18 | plugins: [vue(), vueJsx()] 19 | }) 20 | 21 | // rollup 配置 22 | const rollupOptions = { 23 | external: ['vue', 'vue-router'], 24 | output: { 25 | globals: { 26 | vue: 'Vue' 27 | } 28 | } 29 | } 30 | 31 | // 全量打包构建 32 | const buildAll = async () => { 33 | await build({ 34 | ...baseConfig, 35 | build: { 36 | rollupOptions, 37 | lib: { 38 | entry: path.resolve(entryDir, 'index.ts'), 39 | name: 'wjh-element-component', 40 | fileName: 'wjh-element-component', 41 | formats: ['es', 'umd'] 42 | }, 43 | outDir 44 | } 45 | }) 46 | } 47 | 48 | // 单组件打包构建 49 | /** 50 | * @param {*} name 组件名称 51 | */ 52 | const buildSingle = async (name) => { 53 | await build({ 54 | ...baseConfig, 55 | build: { 56 | rollupOptions, 57 | lib: { 58 | entry: path.resolve(entryDir, name), 59 | name: 'index', 60 | fileName: 'index', 61 | formats: ['es', 'umd'] 62 | }, 63 | outDir: path.resolve(outDir, name) 64 | } 65 | }) 66 | } 67 | 68 | // 每个组件生成pagkage.json 69 | const ceratePackageJson = (name) => { 70 | const fileStr = ` 71 | { 72 | "name": "${name}", 73 | "main": "index.umd.js", 74 | "module": "index.es.js", 75 | "style": "styles.css" 76 | } 77 | ` 78 | // 输出 79 | fsExtra.outputFile( 80 | path.resolve(outDir, `${name}/package.json`), 81 | fileStr, 82 | 'utf-8' 83 | ) 84 | } 85 | 86 | // 打包成库 87 | const buildLib = async () => { 88 | await buildAll() 89 | 90 | // 获取组件名称组成的数组 91 | const components = fs.readdirSync(entryDir).filter(name => { 92 | const componentDir = path.resolve(entryDir, name) 93 | const isDir = fs.lstatSync(componentDir).isDirectory() 94 | return isDir && fs.readdirSync(componentDir).includes('index.ts') 95 | }) 96 | 97 | // 循环构建组件 98 | for (const name of components) { 99 | await buildSingle(name) 100 | ceratePackageJson(name) 101 | } 102 | } 103 | 104 | buildLib() -------------------------------------------------------------------------------- /packages/menu/src/menu.tsx: -------------------------------------------------------------------------------- 1 | // tsx jsx 的组件对应递归比较合适 2 | import { defineComponent, PropType, useAttrs } from "vue"; 3 | import { MenuItem } from "./types"; 4 | import * as Icons from '@element-plus/icons-vue' 5 | import './menu.scss' 6 | export default defineComponent({ 7 | props: { 8 | data: { 9 | type: Array as PropType, 10 | required: true, 11 | }, 12 | // 默认选中菜单 13 | defaultActive: { 14 | type: String, 15 | default: "", 16 | }, 17 | // 是否是路由模式 18 | router: { 19 | type: Boolean, 20 | default: false, 21 | }, 22 | // 匹配后端的字段, 在不知道组件将会使用什么字段名的情况,可以使用组件的时候再传值 23 | // 例如: 24 | // // 菜单标题的键名 25 | // name: { 26 | // type: String, 27 | // default: 'name' 28 | // }, 29 | // // 菜单标识的键名 30 | // index: { 31 | // type: String, 32 | // default: 'index' 33 | // }, 34 | // // 菜单图标的键名 35 | // icon: { 36 | // type: String, 37 | // default: 'icon' 38 | // }, 39 | // // 菜单子菜单的键名 40 | // children: { 41 | // type: String, 42 | // default: 'children' 43 | // }, 44 | }, 45 | 46 | setup(props, ctx) { 47 | // console.log(props.data,'data'); 48 | 49 | // 封装渲染无限层级菜单的方法 50 | let renderMenu = (data: MenuItem[]) => { 51 | return data.map((item: MenuItem) => { 52 | // 每个菜单的图标 53 | // item.i = item.icon; 54 | item.i = (Icons as any)[item.icon!] 55 | // 处理sub-menu的插槽 56 | let slots = { 57 | title: () => { 58 | return ( 59 | <> 60 | 61 | {item.name} 62 | 63 | ); 64 | }, 65 | }; 66 | 67 | // 递归渲染children 68 | if (item.children && item.children.length) { 69 | return ( 70 | 71 | {renderMenu(item.children)} 72 | 73 | ); 74 | } 75 | 76 | // 正常渲染普通菜单 77 | return ( 78 | 79 | 80 | {item.name} 81 | 82 | ); 83 | }); 84 | }; 85 | 86 | let attrs = useAttrs() 87 | 88 | return () => { 89 | return ( 90 | 96 | {renderMenu(props.data)} 97 | 98 | ) 99 | }; 100 | }, 101 | }); 102 | -------------------------------------------------------------------------------- /src/components/base/menu/src/menu.tsx: -------------------------------------------------------------------------------- 1 | // tsx jsx 的组件对应递归比较合适 2 | import { defineComponent, PropType, useAttrs } from "vue"; 3 | import { MenuItem } from "./types"; 4 | import * as Icons from '@element-plus/icons-vue' 5 | import './menu.scss' 6 | export default defineComponent({ 7 | props: { 8 | data: { 9 | type: Array as PropType, 10 | required: true, 11 | }, 12 | // 默认选中菜单 13 | defaultActive: { 14 | type: String, 15 | default: "", 16 | }, 17 | // 是否是路由模式 18 | router: { 19 | type: Boolean, 20 | default: false, 21 | }, 22 | // 匹配后端的字段, 在不知道组件将会使用什么字段名的情况,可以使用组件的时候再传值 23 | // 例如: 24 | // // 菜单标题的键名 25 | // name: { 26 | // type: String, 27 | // default: 'name' 28 | // }, 29 | // // 菜单标识的键名 30 | // index: { 31 | // type: String, 32 | // default: 'index' 33 | // }, 34 | // // 菜单图标的键名 35 | // icon: { 36 | // type: String, 37 | // default: 'icon' 38 | // }, 39 | // // 菜单子菜单的键名 40 | // children: { 41 | // type: String, 42 | // default: 'children' 43 | // }, 44 | }, 45 | 46 | setup(props, ctx) { 47 | // console.log(props.data,'data'); 48 | 49 | // 封装渲染无限层级菜单的方法 50 | let renderMenu = (data: MenuItem[]) => { 51 | return data.map((item: MenuItem) => { 52 | // 每个菜单的图标 53 | // item.i = item.icon; 54 | item.i = (Icons as any)[item.icon!] 55 | // 处理sub-menu的插槽 56 | let slots = { 57 | title: () => { 58 | return ( 59 | <> 60 | 61 | {item.name} 62 | 63 | ); 64 | }, 65 | }; 66 | 67 | // 递归渲染children 68 | if (item.children && item.children.length) { 69 | return ( 70 | 71 | {renderMenu(item.children)} 72 | 73 | ); 74 | } 75 | 76 | // 正常渲染普通菜单 77 | return ( 78 | 79 | 80 | {item.name} 81 | 82 | ); 83 | }); 84 | }; 85 | 86 | let attrs = useAttrs() 87 | 88 | return () => { 89 | return ( 90 | 96 | {renderMenu(props.data)} 97 | 98 | ) 99 | }; 100 | }, 101 | }); 102 | -------------------------------------------------------------------------------- /packages/chooseArea/src/index.vue: -------------------------------------------------------------------------------- 1 | 34 | 35 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /src/components/base/chooseArea/src/index.vue: -------------------------------------------------------------------------------- 1 | 34 | 35 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /packages/calendar/src/index.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 131 | 132 | 138 | -------------------------------------------------------------------------------- /src/components/base/calendar/src/index.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 131 | 132 | 138 | -------------------------------------------------------------------------------- /packages/list/src/index.vue: -------------------------------------------------------------------------------- 1 | 49 | 50 | 77 | 78 | 127 | -------------------------------------------------------------------------------- /src/components/base/list/src/index.vue: -------------------------------------------------------------------------------- 1 | 49 | 50 | 77 | 78 | 127 | -------------------------------------------------------------------------------- /packages/chooseAreaFour/src/index.vue: -------------------------------------------------------------------------------- 1 | 42 | 43 | 121 | 122 | 123 | -------------------------------------------------------------------------------- /src/components/base/chooseAreaFour/src/index.vue: -------------------------------------------------------------------------------- 1 | 42 | 43 | 121 | 122 | 123 | -------------------------------------------------------------------------------- /src/components/layout/sideBar.vue: -------------------------------------------------------------------------------- 1 | 63 | 64 | 145 | 146 | 153 | -------------------------------------------------------------------------------- /src/views/table/index.vue: -------------------------------------------------------------------------------- 1 | 53 | 54 | 174 | 175 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Vue 3 + TypeScript + Vite 2 | 3 | This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 ` 244 | 245 | -------------------------------------------------------------------------------- /src/views/form/index.vue: -------------------------------------------------------------------------------- 1 | 30 | 31 | 273 | 274 | -------------------------------------------------------------------------------- /packages/form/src/index.vue: -------------------------------------------------------------------------------- 1 | 73 | 74 | 227 | 228 | -------------------------------------------------------------------------------- /src/components/base/form/src/index.vue: -------------------------------------------------------------------------------- 1 | 73 | 74 | 227 | 228 | -------------------------------------------------------------------------------- /packages/form/src/types/rules.ts: -------------------------------------------------------------------------------- 1 | // >>>>> Rule 2 | // Modified from https://github.com/yiminghe/async-validator/blob/0d51d60086a127b21db76f44dff28ae18c165c47/src/index.d.ts 3 | export type RuleType = 4 | | 'string' 5 | | 'number' 6 | | 'boolean' 7 | | 'method' 8 | | 'regexp' 9 | | 'integer' 10 | | 'float' 11 | | 'array' 12 | | 'object' 13 | | 'enum' 14 | | 'date' 15 | | 'url' 16 | | 'hex' 17 | | 'email' 18 | | 'pattern' 19 | | 'any'; 20 | 21 | export interface ValidateOption { 22 | // whether to suppress internal warning 23 | suppressWarning?: boolean; 24 | 25 | // when the first validation rule generates an error stop processed 26 | first?: boolean; 27 | 28 | // when the first validation rule of the specified field generates an error stop the field processed, 'true' means all fields. 29 | firstFields?: boolean | string[]; 30 | 31 | messages?: Partial; 32 | 33 | /** The name of rules need to be trigger. Will validate all rules if leave empty */ 34 | keys?: string[]; 35 | 36 | error?: (rule: InternalRuleItem, message: string) => ValidateError; 37 | } 38 | 39 | export type SyncErrorType = Error | string; 40 | export type SyncValidateResult = boolean | SyncErrorType | SyncErrorType[]; 41 | export type ValidateResult = void | Promise | SyncValidateResult; 42 | 43 | export interface RuleItem { 44 | type?: RuleType; // default type is 'string' 45 | required?: boolean; 46 | pattern?: RegExp | string; 47 | min?: number; // Range of type 'string' and 'array' 48 | max?: number; // Range of type 'string' and 'array' 49 | len?: number; // Length of type 'string' and 'array' 50 | enum?: Array; // possible values of type 'enum' 51 | whitespace?: boolean; 52 | trigger?: string | string[]; 53 | fields?: Record; // ignore when without required 54 | options?: ValidateOption; 55 | defaultField?: Rule; // 'object' or 'array' containing validation rules 56 | transform?: (value: Value) => Value; 57 | message?: string | ((a?: string) => string); 58 | asyncValidator?: ( 59 | rule: InternalRuleItem, 60 | value: Value, 61 | callback: (error?: string | Error) => void, 62 | source: Values, 63 | options: ValidateOption, 64 | ) => void | Promise; 65 | validator?: ( 66 | rule: InternalRuleItem, 67 | value: Value, 68 | callback: (error?: string | Error) => void, 69 | source: Values, 70 | options: ValidateOption, 71 | ) => SyncValidateResult | void; 72 | } 73 | 74 | export type Rule = RuleItem | RuleItem[]; 75 | 76 | export type Rules = Record; 77 | 78 | /** 79 | * Rule for validating a value exists in an enumerable list. 80 | * 81 | * @param rule The validation rule. 82 | * @param value The value of the field on the source object. 83 | * @param source The source object being validated. 84 | * @param errors An array of errors that this rule may add 85 | * validation errors to. 86 | * @param options The validation options. 87 | * @param options.messages The validation messages. 88 | * @param type Rule type 89 | */ 90 | export type ExecuteRule = ( 91 | rule: InternalRuleItem, 92 | value: Value, 93 | source: Values, 94 | errors: string[], 95 | options: ValidateOption, 96 | type?: string, 97 | ) => void; 98 | 99 | /** 100 | * Performs validation for any type. 101 | * 102 | * @param rule The validation rule. 103 | * @param value The value of the field on the source object. 104 | * @param callback The callback function. 105 | * @param source The source object being validated. 106 | * @param options The validation options. 107 | * @param options.messages The validation messages. 108 | */ 109 | export type ExecuteValidator = ( 110 | rule: InternalRuleItem, 111 | value: Value, 112 | callback: (error?: string[]) => void, 113 | source: Values, 114 | options: ValidateOption, 115 | ) => void; 116 | 117 | // >>>>> Message 118 | type ValidateMessage = 119 | | string 120 | | ((...args: T) => string); 121 | type FullField = string | undefined; 122 | type EnumString = string | undefined; 123 | type Pattern = string | RegExp | undefined; 124 | type Range = number | undefined; 125 | type Type = string | undefined; 126 | 127 | export interface ValidateMessages { 128 | default?: ValidateMessage; 129 | required?: ValidateMessage<[FullField]>; 130 | enum?: ValidateMessage<[FullField, EnumString]>; 131 | whitespace?: ValidateMessage<[FullField]>; 132 | date?: { 133 | format?: ValidateMessage; 134 | parse?: ValidateMessage; 135 | invalid?: ValidateMessage; 136 | }; 137 | types?: { 138 | string?: ValidateMessage<[FullField, Type]>; 139 | method?: ValidateMessage<[FullField, Type]>; 140 | array?: ValidateMessage<[FullField, Type]>; 141 | object?: ValidateMessage<[FullField, Type]>; 142 | number?: ValidateMessage<[FullField, Type]>; 143 | date?: ValidateMessage<[FullField, Type]>; 144 | boolean?: ValidateMessage<[FullField, Type]>; 145 | integer?: ValidateMessage<[FullField, Type]>; 146 | float?: ValidateMessage<[FullField, Type]>; 147 | regexp?: ValidateMessage<[FullField, Type]>; 148 | email?: ValidateMessage<[FullField, Type]>; 149 | url?: ValidateMessage<[FullField, Type]>; 150 | hex?: ValidateMessage<[FullField, Type]>; 151 | }; 152 | string?: { 153 | len?: ValidateMessage<[FullField, Range]>; 154 | min?: ValidateMessage<[FullField, Range]>; 155 | max?: ValidateMessage<[FullField, Range]>; 156 | range?: ValidateMessage<[FullField, Range, Range]>; 157 | }; 158 | number?: { 159 | len?: ValidateMessage<[FullField, Range]>; 160 | min?: ValidateMessage<[FullField, Range]>; 161 | max?: ValidateMessage<[FullField, Range]>; 162 | range?: ValidateMessage<[FullField, Range, Range]>; 163 | }; 164 | array?: { 165 | len?: ValidateMessage<[FullField, Range]>; 166 | min?: ValidateMessage<[FullField, Range]>; 167 | max?: ValidateMessage<[FullField, Range]>; 168 | range?: ValidateMessage<[FullField, Range, Range]>; 169 | }; 170 | pattern?: { 171 | mismatch?: ValidateMessage<[FullField, Value, Pattern]>; 172 | }; 173 | } 174 | 175 | export interface InternalValidateMessages extends ValidateMessages { 176 | clone: () => InternalValidateMessages; 177 | } 178 | 179 | // >>>>> Values 180 | export type Value = any; 181 | export type Values = Record; 182 | 183 | // >>>>> Validate 184 | export interface ValidateError { 185 | message?: string; 186 | fieldValue?: Value; 187 | field?: string; 188 | } 189 | 190 | export type ValidateFieldsError = Record; 191 | 192 | export type ValidateCallback = ( 193 | errors: ValidateError[] | null, 194 | fields: ValidateFieldsError | Values, 195 | ) => void; 196 | 197 | export interface RuleValuePackage { 198 | rule: InternalRuleItem; 199 | value: Value; 200 | source: Values; 201 | field: string; 202 | } 203 | 204 | export interface InternalRuleItem extends Omit { 205 | field?: string; 206 | fullField?: string; 207 | fullFields?: string[]; 208 | validator?: RuleItem['validator'] | ExecuteValidator; 209 | } -------------------------------------------------------------------------------- /src/components/base/form/src/types/rules.ts: -------------------------------------------------------------------------------- 1 | // >>>>> Rule 2 | // Modified from https://github.com/yiminghe/async-validator/blob/0d51d60086a127b21db76f44dff28ae18c165c47/src/index.d.ts 3 | export type RuleType = 4 | | 'string' 5 | | 'number' 6 | | 'boolean' 7 | | 'method' 8 | | 'regexp' 9 | | 'integer' 10 | | 'float' 11 | | 'array' 12 | | 'object' 13 | | 'enum' 14 | | 'date' 15 | | 'url' 16 | | 'hex' 17 | | 'email' 18 | | 'pattern' 19 | | 'any'; 20 | 21 | export interface ValidateOption { 22 | // whether to suppress internal warning 23 | suppressWarning?: boolean; 24 | 25 | // when the first validation rule generates an error stop processed 26 | first?: boolean; 27 | 28 | // when the first validation rule of the specified field generates an error stop the field processed, 'true' means all fields. 29 | firstFields?: boolean | string[]; 30 | 31 | messages?: Partial; 32 | 33 | /** The name of rules need to be trigger. Will validate all rules if leave empty */ 34 | keys?: string[]; 35 | 36 | error?: (rule: InternalRuleItem, message: string) => ValidateError; 37 | } 38 | 39 | export type SyncErrorType = Error | string; 40 | export type SyncValidateResult = boolean | SyncErrorType | SyncErrorType[]; 41 | export type ValidateResult = void | Promise | SyncValidateResult; 42 | 43 | export interface RuleItem { 44 | type?: RuleType; // default type is 'string' 45 | required?: boolean; 46 | pattern?: RegExp | string; 47 | min?: number; // Range of type 'string' and 'array' 48 | max?: number; // Range of type 'string' and 'array' 49 | len?: number; // Length of type 'string' and 'array' 50 | enum?: Array; // possible values of type 'enum' 51 | whitespace?: boolean; 52 | trigger?: string | string[]; 53 | fields?: Record; // ignore when without required 54 | options?: ValidateOption; 55 | defaultField?: Rule; // 'object' or 'array' containing validation rules 56 | transform?: (value: Value) => Value; 57 | message?: string | ((a?: string) => string); 58 | asyncValidator?: ( 59 | rule: InternalRuleItem, 60 | value: Value, 61 | callback: (error?: string | Error) => void, 62 | source: Values, 63 | options: ValidateOption, 64 | ) => void | Promise; 65 | validator?: ( 66 | rule: InternalRuleItem, 67 | value: Value, 68 | callback: (error?: string | Error) => void, 69 | source: Values, 70 | options: ValidateOption, 71 | ) => SyncValidateResult | void; 72 | } 73 | 74 | export type Rule = RuleItem | RuleItem[]; 75 | 76 | export type Rules = Record; 77 | 78 | /** 79 | * Rule for validating a value exists in an enumerable list. 80 | * 81 | * @param rule The validation rule. 82 | * @param value The value of the field on the source object. 83 | * @param source The source object being validated. 84 | * @param errors An array of errors that this rule may add 85 | * validation errors to. 86 | * @param options The validation options. 87 | * @param options.messages The validation messages. 88 | * @param type Rule type 89 | */ 90 | export type ExecuteRule = ( 91 | rule: InternalRuleItem, 92 | value: Value, 93 | source: Values, 94 | errors: string[], 95 | options: ValidateOption, 96 | type?: string, 97 | ) => void; 98 | 99 | /** 100 | * Performs validation for any type. 101 | * 102 | * @param rule The validation rule. 103 | * @param value The value of the field on the source object. 104 | * @param callback The callback function. 105 | * @param source The source object being validated. 106 | * @param options The validation options. 107 | * @param options.messages The validation messages. 108 | */ 109 | export type ExecuteValidator = ( 110 | rule: InternalRuleItem, 111 | value: Value, 112 | callback: (error?: string[]) => void, 113 | source: Values, 114 | options: ValidateOption, 115 | ) => void; 116 | 117 | // >>>>> Message 118 | type ValidateMessage = 119 | | string 120 | | ((...args: T) => string); 121 | type FullField = string | undefined; 122 | type EnumString = string | undefined; 123 | type Pattern = string | RegExp | undefined; 124 | type Range = number | undefined; 125 | type Type = string | undefined; 126 | 127 | export interface ValidateMessages { 128 | default?: ValidateMessage; 129 | required?: ValidateMessage<[FullField]>; 130 | enum?: ValidateMessage<[FullField, EnumString]>; 131 | whitespace?: ValidateMessage<[FullField]>; 132 | date?: { 133 | format?: ValidateMessage; 134 | parse?: ValidateMessage; 135 | invalid?: ValidateMessage; 136 | }; 137 | types?: { 138 | string?: ValidateMessage<[FullField, Type]>; 139 | method?: ValidateMessage<[FullField, Type]>; 140 | array?: ValidateMessage<[FullField, Type]>; 141 | object?: ValidateMessage<[FullField, Type]>; 142 | number?: ValidateMessage<[FullField, Type]>; 143 | date?: ValidateMessage<[FullField, Type]>; 144 | boolean?: ValidateMessage<[FullField, Type]>; 145 | integer?: ValidateMessage<[FullField, Type]>; 146 | float?: ValidateMessage<[FullField, Type]>; 147 | regexp?: ValidateMessage<[FullField, Type]>; 148 | email?: ValidateMessage<[FullField, Type]>; 149 | url?: ValidateMessage<[FullField, Type]>; 150 | hex?: ValidateMessage<[FullField, Type]>; 151 | }; 152 | string?: { 153 | len?: ValidateMessage<[FullField, Range]>; 154 | min?: ValidateMessage<[FullField, Range]>; 155 | max?: ValidateMessage<[FullField, Range]>; 156 | range?: ValidateMessage<[FullField, Range, Range]>; 157 | }; 158 | number?: { 159 | len?: ValidateMessage<[FullField, Range]>; 160 | min?: ValidateMessage<[FullField, Range]>; 161 | max?: ValidateMessage<[FullField, Range]>; 162 | range?: ValidateMessage<[FullField, Range, Range]>; 163 | }; 164 | array?: { 165 | len?: ValidateMessage<[FullField, Range]>; 166 | min?: ValidateMessage<[FullField, Range]>; 167 | max?: ValidateMessage<[FullField, Range]>; 168 | range?: ValidateMessage<[FullField, Range, Range]>; 169 | }; 170 | pattern?: { 171 | mismatch?: ValidateMessage<[FullField, Value, Pattern]>; 172 | }; 173 | } 174 | 175 | export interface InternalValidateMessages extends ValidateMessages { 176 | clone: () => InternalValidateMessages; 177 | } 178 | 179 | // >>>>> Values 180 | export type Value = any; 181 | export type Values = Record; 182 | 183 | // >>>>> Validate 184 | export interface ValidateError { 185 | message?: string; 186 | fieldValue?: Value; 187 | field?: string; 188 | } 189 | 190 | export type ValidateFieldsError = Record; 191 | 192 | export type ValidateCallback = ( 193 | errors: ValidateError[] | null, 194 | fields: ValidateFieldsError | Values, 195 | ) => void; 196 | 197 | export interface RuleValuePackage { 198 | rule: InternalRuleItem; 199 | value: Value; 200 | source: Values; 201 | field: string; 202 | } 203 | 204 | export interface InternalRuleItem extends Omit { 205 | field?: string; 206 | fullField?: string; 207 | fullFields?: string[]; 208 | validator?: RuleItem['validator'] | ExecuteValidator; 209 | } -------------------------------------------------------------------------------- /packages/chooseCity/src/index.vue: -------------------------------------------------------------------------------- 1 | 107 | 108 | 191 | 192 | 241 | -------------------------------------------------------------------------------- /src/components/base/chooseCity/src/index.vue: -------------------------------------------------------------------------------- 1 | 107 | 108 | 191 | 192 | 241 | -------------------------------------------------------------------------------- /packages/table/src/index.vue: -------------------------------------------------------------------------------- 1 | 82 | 83 | 263 | 264 | -------------------------------------------------------------------------------- /src/components/base/table/src/index.vue: -------------------------------------------------------------------------------- 1 | 82 | 83 | 263 | 264 | -------------------------------------------------------------------------------- /packages/chooseCity/lib/province.json: -------------------------------------------------------------------------------- 1 | { 2 | "A": [{ 3 | "name": "安徽", 4 | "id": "A", 5 | "data": [ 6 | "合肥", 7 | "芜湖", 8 | "蚌埠", 9 | "淮南", 10 | "马鞍山", 11 | "淮北", 12 | "铜陵", 13 | "安庆", 14 | "黄山", 15 | "滁州", 16 | "阜阳", 17 | "宿州", 18 | "六安", 19 | "亳州", 20 | "池州", 21 | "宣城" 22 | ] 23 | }], 24 | "C": [{ 25 | "name": "重庆", 26 | "id": "C", 27 | "data": [ 28 | "万州", 29 | "涪陵", 30 | "渝中", 31 | "大渡口", 32 | "江北", 33 | "沙坪坝", 34 | "九龙坡", 35 | "南岸", 36 | "北碚", 37 | "綦江", 38 | "大足", 39 | "渝北", 40 | "巴南", 41 | "黔江", 42 | "长寿", 43 | "江津", 44 | "合川", 45 | "永川", 46 | "南川", 47 | "璧山", 48 | "铜梁", 49 | "潼南", 50 | "荣昌", 51 | "开州", 52 | "梁平", 53 | "武隆", 54 | "城口县", 55 | "丰都县", 56 | "垫江县", 57 | "忠县", 58 | "云阳县", 59 | "奉节县", 60 | "巫山县", 61 | "巫溪县", 62 | "石柱土家族自治县", 63 | "秀山土家族苗族自治县", 64 | "酉阳土家族苗族自治县", 65 | "彭水苗族土家族自治县" 66 | ] 67 | }], 68 | "F": [{ 69 | "name": "福建", 70 | "id": "F", 71 | "data": [ 72 | "福州", 73 | "厦门", 74 | "莆田", 75 | "三明", 76 | "泉州", 77 | "漳州", 78 | "南平", 79 | "龙岩", 80 | "宁德" 81 | ] 82 | }], 83 | "G": [{ 84 | "name": "广东", 85 | "id": "G", 86 | "data": [ 87 | "广州", 88 | "韶关", 89 | "深圳", 90 | "珠海", 91 | "汕头", 92 | "佛山", 93 | "江门", 94 | "湛江", 95 | "茂名", 96 | "肇庆", 97 | "惠州", 98 | "梅州", 99 | "汕尾", 100 | "河源", 101 | "阳江", 102 | "清远", 103 | "东莞", 104 | "中山", 105 | "潮州", 106 | "揭阳", 107 | "云浮" 108 | ] 109 | }, 110 | { 111 | "name": "广西", 112 | "data": [ 113 | "南宁", 114 | "柳州", 115 | "桂林", 116 | "梧州", 117 | "北海", 118 | "防城港", 119 | "钦州", 120 | "贵港", 121 | "玉林", 122 | "百色", 123 | "贺州", 124 | "河池", 125 | "来宾", 126 | "崇左" 127 | ] 128 | }, 129 | { 130 | "name": "贵州", 131 | "data": [ 132 | "贵阳", 133 | "六盘水", 134 | "遵义", 135 | "安顺", 136 | "毕节", 137 | "铜仁", 138 | "黔西南布依族苗族自治州", 139 | "黔东南苗族侗族自治州", 140 | "黔南布依族苗族自治州" 141 | ] 142 | }, 143 | { 144 | "name": "甘肃", 145 | "data": [ 146 | "兰州", 147 | "嘉峪关", 148 | "金昌", 149 | "白银", 150 | "天水", 151 | "武威", 152 | "张掖", 153 | "平凉", 154 | "酒泉", 155 | "庆阳", 156 | "定西", 157 | "陇南", 158 | "临夏回族自治州", 159 | "甘南藏族自治州" 160 | ] 161 | } 162 | ], 163 | "H": [{ 164 | "name": "河北", 165 | "id": "H", 166 | "data": [ 167 | "石家庄", 168 | "唐山", 169 | "秦皇岛", 170 | "邯郸", 171 | "邢台", 172 | "保定", 173 | "张家口", 174 | "承德", 175 | "沧州", 176 | "廊坊", 177 | "衡水" 178 | ] 179 | }, 180 | { 181 | "name": "黑龙江", 182 | "data": [ 183 | "哈尔滨", 184 | "齐齐哈尔", 185 | "鸡西", 186 | "鹤岗", 187 | "双鸭山", 188 | "大庆", 189 | "伊春", 190 | "佳木斯", 191 | "七台河", 192 | "牡丹江", 193 | "黑河", 194 | "绥化", 195 | "大兴安岭地" 196 | ] 197 | }, 198 | { 199 | "name": "河南", 200 | "data": [ 201 | "郑州", 202 | "开封", 203 | "洛阳", 204 | "平顶山", 205 | "安阳", 206 | "鹤壁", 207 | "新乡", 208 | "焦作", 209 | "濮阳", 210 | "许昌", 211 | "漯河", 212 | "三门峡", 213 | "南阳", 214 | "商丘", 215 | "信阳", 216 | "周口", 217 | "驻马店", 218 | "济源" 219 | ] 220 | }, 221 | { 222 | "name": "湖北", 223 | "data": [ 224 | "武汉", 225 | "黄石", 226 | "十堰", 227 | "宜昌", 228 | "襄阳", 229 | "鄂州", 230 | "荆门", 231 | "孝感", 232 | "荆州", 233 | "黄冈", 234 | "咸宁", 235 | "随州", 236 | "恩施土家族苗族自治州", 237 | "仙桃", 238 | "潜江", 239 | "天门", 240 | "神农架林" 241 | ] 242 | }, 243 | { 244 | "name": "湖南", 245 | "data": [ 246 | "长沙", 247 | "株洲", 248 | "湘潭", 249 | "衡阳", 250 | "邵阳", 251 | "岳阳", 252 | "常德", 253 | "张家界", 254 | "益阳", 255 | "郴州", 256 | "永州", 257 | "怀化", 258 | "娄底", 259 | "湘西土家族苗族自治州" 260 | ] 261 | }, 262 | { 263 | "name": "海南", 264 | "data": [ 265 | "海口", 266 | "三亚", 267 | "三沙", 268 | "儋州", 269 | "五指山", 270 | "琼海", 271 | "文昌", 272 | "万宁", 273 | "东方", 274 | "定安县", 275 | "屯昌县", 276 | "澄迈县", 277 | "临高县", 278 | "白沙黎族自治县", 279 | "昌江黎族自治县", 280 | "乐东黎族自治县", 281 | "陵水黎族自治县", 282 | "保亭黎族苗族自治县", 283 | "琼中黎族苗族自治县" 284 | ] 285 | } 286 | ], 287 | "J": [{ 288 | "name": "吉林", 289 | "id": "J", 290 | "data": [ 291 | "长春", 292 | "吉林", 293 | "四平", 294 | "辽源", 295 | "通化", 296 | "白山", 297 | "松原", 298 | "白城", 299 | "延边朝鲜族自治州" 300 | ] 301 | }, 302 | { 303 | "name": "江苏", 304 | "data": [ 305 | "南京", 306 | "无锡", 307 | "徐州", 308 | "常州", 309 | "苏州", 310 | "南通", 311 | "连云港", 312 | "淮安", 313 | "盐城", 314 | "扬州", 315 | "镇江", 316 | "泰州", 317 | "宿迁" 318 | ] 319 | }, 320 | { 321 | "name": "江西", 322 | "data": [ 323 | "南昌", 324 | "景德镇", 325 | "萍乡", 326 | "九江", 327 | "新余", 328 | "鹰潭", 329 | "赣州", 330 | "吉安", 331 | "宜春", 332 | "抚州", 333 | "上饶" 334 | ] 335 | } 336 | ], 337 | "L": [{ 338 | "name": "辽宁", 339 | "id": "L", 340 | "data": [ 341 | "沈阳", 342 | "大连", 343 | "鞍山", 344 | "抚顺", 345 | "本溪", 346 | "丹东", 347 | "锦州", 348 | "营口", 349 | "阜新", 350 | "辽阳", 351 | "盘锦", 352 | "铁岭", 353 | "朝阳", 354 | "葫芦岛" 355 | ] 356 | }], 357 | "N": [{ 358 | "name": "内蒙古", 359 | "id": "N", 360 | "data": [ 361 | "呼和浩特", 362 | "包头", 363 | "乌海", 364 | "赤峰", 365 | "通辽", 366 | "鄂尔多斯", 367 | "呼伦贝尔", 368 | "巴彦淖尔", 369 | "乌兰察布", 370 | "兴安盟", 371 | "锡林郭勒盟", 372 | "阿拉善盟" 373 | ] 374 | }, { 375 | "name": "宁夏", 376 | "data": [ 377 | "银川", 378 | "石嘴山", 379 | "吴忠", 380 | "固原", 381 | "中卫" 382 | ] 383 | }], 384 | "Q": [{ 385 | "name": "青海", 386 | "id": "Q", 387 | "data": [ 388 | "西宁", 389 | "海东", 390 | "海北藏族自治州", 391 | "黄南藏族自治州", 392 | "海南藏族自治州", 393 | "果洛藏族自治州", 394 | "玉树藏族自治州", 395 | "海西蒙古族藏族自治州" 396 | ] 397 | }], 398 | "S": [{ 399 | "name": "山西", 400 | "id": "S", 401 | "data": [ 402 | "太原", 403 | "大同", 404 | "阳泉", 405 | "长治", 406 | "晋城", 407 | "朔州", 408 | "晋中", 409 | "运城", 410 | "忻州", 411 | "临汾", 412 | "吕梁" 413 | ] 414 | }, 415 | { 416 | "name": "上海", 417 | "data": [ 418 | "黄浦", 419 | "徐汇", 420 | "长宁", 421 | "静安", 422 | "普陀", 423 | "虹口", 424 | "杨浦", 425 | "闵行", 426 | "宝山", 427 | "嘉定", 428 | "浦东新", 429 | "金山", 430 | "松江", 431 | "青浦", 432 | "奉贤", 433 | "崇明" 434 | ] 435 | }, 436 | { 437 | "name": "山东", 438 | "data": [ 439 | "济南", 440 | "青岛", 441 | "淄博", 442 | "枣庄", 443 | "东营", 444 | "烟台", 445 | "潍坊", 446 | "济宁", 447 | "泰安", 448 | "威海", 449 | "日照", 450 | "临沂", 451 | "德州", 452 | "聊城", 453 | "滨州", 454 | "菏泽" 455 | ] 456 | }, 457 | { 458 | "name": "四川", 459 | "data": [ 460 | "成都", 461 | "自贡", 462 | "攀枝花", 463 | "泸州", 464 | "德阳", 465 | "绵阳", 466 | "广元", 467 | "遂宁", 468 | "内江", 469 | "乐山", 470 | "南充", 471 | "眉山", 472 | "宜宾", 473 | "广安", 474 | "达州", 475 | "雅安", 476 | "巴中", 477 | "资阳", 478 | "阿坝藏族羌族自治州", 479 | "甘孜藏族自治州", 480 | "凉山彝族自治州" 481 | ] 482 | }, 483 | { 484 | "name": "陕西", 485 | "data": [ 486 | "西安", 487 | "铜川", 488 | "宝鸡", 489 | "咸阳", 490 | "渭南", 491 | "延安", 492 | "汉中", 493 | "榆林", 494 | "安康", 495 | "商洛" 496 | ] 497 | } 498 | ], 499 | "T": [{ 500 | "name": "天津", 501 | "id": "T", 502 | "data": [ 503 | "和平", 504 | "河东", 505 | "河西", 506 | "南开", 507 | "河北", 508 | "红桥", 509 | "东丽", 510 | "西青", 511 | "津南", 512 | "北辰", 513 | "武清", 514 | "宝坻", 515 | "滨海新", 516 | "宁河", 517 | "静海", 518 | "蓟州" 519 | ] 520 | }], 521 | "X": [{ 522 | "name": "西藏", 523 | "id": "X", 524 | "data": [ 525 | "拉萨", 526 | "日喀则", 527 | "昌都", 528 | "林芝", 529 | "山南", 530 | "那曲", 531 | "阿里地" 532 | ] 533 | }, 534 | { 535 | "name": "新疆", 536 | "data": [ 537 | "乌鲁木齐", 538 | "克拉玛依", 539 | "吐鲁番", 540 | "哈密", 541 | "昌吉回族自治州", 542 | "博尔塔拉蒙古自治州", 543 | "巴音郭楞蒙古自治州", 544 | "阿克苏地", 545 | "克孜勒苏柯尔克孜自治州", 546 | "喀什地", 547 | "和田地", 548 | "伊犁哈萨克自治州", 549 | "塔城地", 550 | "阿勒泰地", 551 | "石河子", 552 | "阿拉尔", 553 | "图木舒克", 554 | "五家渠", 555 | "北屯", 556 | "铁门关", 557 | "双河", 558 | "可克达拉", 559 | "昆玉", 560 | "胡杨河" 561 | ] 562 | } 563 | ], 564 | "Y": [{ 565 | "name": "云南", 566 | "id": "Y", 567 | "data": [ 568 | "昆明", 569 | "曲靖", 570 | "玉溪", 571 | "保山", 572 | "昭通", 573 | "丽江", 574 | "普洱", 575 | "临沧", 576 | "楚雄彝族自治州", 577 | "红河哈尼族彝族自治州", 578 | "文山壮族苗族自治州", 579 | "西双版纳傣族自治州", 580 | "大理白族自治州", 581 | "德宏傣族景颇族自治州", 582 | "怒江傈僳族自治州", 583 | "迪庆藏族自治州" 584 | ] 585 | }], 586 | "Z": [{ 587 | "name": "浙江", 588 | "id": "Z", 589 | "data": [ 590 | "杭州", 591 | "宁波", 592 | "温州", 593 | "嘉兴", 594 | "湖州", 595 | "绍兴", 596 | "金华", 597 | "衢州", 598 | "舟山", 599 | "台州", 600 | "丽水" 601 | ] 602 | }], 603 | "直辖市": [{ 604 | "name": "直辖市", 605 | "id": "直辖市", 606 | "data": [ 607 | "北京", 608 | "天津", 609 | "上海", 610 | "重庆" 611 | ] 612 | }], 613 | "港澳": [{ 614 | "name": "港澳", 615 | "id": "港澳", 616 | "data": [ 617 | "香港", 618 | "澳门" 619 | ] 620 | }] 621 | } -------------------------------------------------------------------------------- /src/components/base/chooseCity/lib/province.json: -------------------------------------------------------------------------------- 1 | { 2 | "A": [{ 3 | "name": "安徽", 4 | "id": "A", 5 | "data": [ 6 | "合肥", 7 | "芜湖", 8 | "蚌埠", 9 | "淮南", 10 | "马鞍山", 11 | "淮北", 12 | "铜陵", 13 | "安庆", 14 | "黄山", 15 | "滁州", 16 | "阜阳", 17 | "宿州", 18 | "六安", 19 | "亳州", 20 | "池州", 21 | "宣城" 22 | ] 23 | }], 24 | "C": [{ 25 | "name": "重庆", 26 | "id": "C", 27 | "data": [ 28 | "万州", 29 | "涪陵", 30 | "渝中", 31 | "大渡口", 32 | "江北", 33 | "沙坪坝", 34 | "九龙坡", 35 | "南岸", 36 | "北碚", 37 | "綦江", 38 | "大足", 39 | "渝北", 40 | "巴南", 41 | "黔江", 42 | "长寿", 43 | "江津", 44 | "合川", 45 | "永川", 46 | "南川", 47 | "璧山", 48 | "铜梁", 49 | "潼南", 50 | "荣昌", 51 | "开州", 52 | "梁平", 53 | "武隆", 54 | "城口县", 55 | "丰都县", 56 | "垫江县", 57 | "忠县", 58 | "云阳县", 59 | "奉节县", 60 | "巫山县", 61 | "巫溪县", 62 | "石柱土家族自治县", 63 | "秀山土家族苗族自治县", 64 | "酉阳土家族苗族自治县", 65 | "彭水苗族土家族自治县" 66 | ] 67 | }], 68 | "F": [{ 69 | "name": "福建", 70 | "id": "F", 71 | "data": [ 72 | "福州", 73 | "厦门", 74 | "莆田", 75 | "三明", 76 | "泉州", 77 | "漳州", 78 | "南平", 79 | "龙岩", 80 | "宁德" 81 | ] 82 | }], 83 | "G": [{ 84 | "name": "广东", 85 | "id": "G", 86 | "data": [ 87 | "广州", 88 | "韶关", 89 | "深圳", 90 | "珠海", 91 | "汕头", 92 | "佛山", 93 | "江门", 94 | "湛江", 95 | "茂名", 96 | "肇庆", 97 | "惠州", 98 | "梅州", 99 | "汕尾", 100 | "河源", 101 | "阳江", 102 | "清远", 103 | "东莞", 104 | "中山", 105 | "潮州", 106 | "揭阳", 107 | "云浮" 108 | ] 109 | }, 110 | { 111 | "name": "广西", 112 | "data": [ 113 | "南宁", 114 | "柳州", 115 | "桂林", 116 | "梧州", 117 | "北海", 118 | "防城港", 119 | "钦州", 120 | "贵港", 121 | "玉林", 122 | "百色", 123 | "贺州", 124 | "河池", 125 | "来宾", 126 | "崇左" 127 | ] 128 | }, 129 | { 130 | "name": "贵州", 131 | "data": [ 132 | "贵阳", 133 | "六盘水", 134 | "遵义", 135 | "安顺", 136 | "毕节", 137 | "铜仁", 138 | "黔西南布依族苗族自治州", 139 | "黔东南苗族侗族自治州", 140 | "黔南布依族苗族自治州" 141 | ] 142 | }, 143 | { 144 | "name": "甘肃", 145 | "data": [ 146 | "兰州", 147 | "嘉峪关", 148 | "金昌", 149 | "白银", 150 | "天水", 151 | "武威", 152 | "张掖", 153 | "平凉", 154 | "酒泉", 155 | "庆阳", 156 | "定西", 157 | "陇南", 158 | "临夏回族自治州", 159 | "甘南藏族自治州" 160 | ] 161 | } 162 | ], 163 | "H": [{ 164 | "name": "河北", 165 | "id": "H", 166 | "data": [ 167 | "石家庄", 168 | "唐山", 169 | "秦皇岛", 170 | "邯郸", 171 | "邢台", 172 | "保定", 173 | "张家口", 174 | "承德", 175 | "沧州", 176 | "廊坊", 177 | "衡水" 178 | ] 179 | }, 180 | { 181 | "name": "黑龙江", 182 | "data": [ 183 | "哈尔滨", 184 | "齐齐哈尔", 185 | "鸡西", 186 | "鹤岗", 187 | "双鸭山", 188 | "大庆", 189 | "伊春", 190 | "佳木斯", 191 | "七台河", 192 | "牡丹江", 193 | "黑河", 194 | "绥化", 195 | "大兴安岭地" 196 | ] 197 | }, 198 | { 199 | "name": "河南", 200 | "data": [ 201 | "郑州", 202 | "开封", 203 | "洛阳", 204 | "平顶山", 205 | "安阳", 206 | "鹤壁", 207 | "新乡", 208 | "焦作", 209 | "濮阳", 210 | "许昌", 211 | "漯河", 212 | "三门峡", 213 | "南阳", 214 | "商丘", 215 | "信阳", 216 | "周口", 217 | "驻马店", 218 | "济源" 219 | ] 220 | }, 221 | { 222 | "name": "湖北", 223 | "data": [ 224 | "武汉", 225 | "黄石", 226 | "十堰", 227 | "宜昌", 228 | "襄阳", 229 | "鄂州", 230 | "荆门", 231 | "孝感", 232 | "荆州", 233 | "黄冈", 234 | "咸宁", 235 | "随州", 236 | "恩施土家族苗族自治州", 237 | "仙桃", 238 | "潜江", 239 | "天门", 240 | "神农架林" 241 | ] 242 | }, 243 | { 244 | "name": "湖南", 245 | "data": [ 246 | "长沙", 247 | "株洲", 248 | "湘潭", 249 | "衡阳", 250 | "邵阳", 251 | "岳阳", 252 | "常德", 253 | "张家界", 254 | "益阳", 255 | "郴州", 256 | "永州", 257 | "怀化", 258 | "娄底", 259 | "湘西土家族苗族自治州" 260 | ] 261 | }, 262 | { 263 | "name": "海南", 264 | "data": [ 265 | "海口", 266 | "三亚", 267 | "三沙", 268 | "儋州", 269 | "五指山", 270 | "琼海", 271 | "文昌", 272 | "万宁", 273 | "东方", 274 | "定安县", 275 | "屯昌县", 276 | "澄迈县", 277 | "临高县", 278 | "白沙黎族自治县", 279 | "昌江黎族自治县", 280 | "乐东黎族自治县", 281 | "陵水黎族自治县", 282 | "保亭黎族苗族自治县", 283 | "琼中黎族苗族自治县" 284 | ] 285 | } 286 | ], 287 | "J": [{ 288 | "name": "吉林", 289 | "id": "J", 290 | "data": [ 291 | "长春", 292 | "吉林", 293 | "四平", 294 | "辽源", 295 | "通化", 296 | "白山", 297 | "松原", 298 | "白城", 299 | "延边朝鲜族自治州" 300 | ] 301 | }, 302 | { 303 | "name": "江苏", 304 | "data": [ 305 | "南京", 306 | "无锡", 307 | "徐州", 308 | "常州", 309 | "苏州", 310 | "南通", 311 | "连云港", 312 | "淮安", 313 | "盐城", 314 | "扬州", 315 | "镇江", 316 | "泰州", 317 | "宿迁" 318 | ] 319 | }, 320 | { 321 | "name": "江西", 322 | "data": [ 323 | "南昌", 324 | "景德镇", 325 | "萍乡", 326 | "九江", 327 | "新余", 328 | "鹰潭", 329 | "赣州", 330 | "吉安", 331 | "宜春", 332 | "抚州", 333 | "上饶" 334 | ] 335 | } 336 | ], 337 | "L": [{ 338 | "name": "辽宁", 339 | "id": "L", 340 | "data": [ 341 | "沈阳", 342 | "大连", 343 | "鞍山", 344 | "抚顺", 345 | "本溪", 346 | "丹东", 347 | "锦州", 348 | "营口", 349 | "阜新", 350 | "辽阳", 351 | "盘锦", 352 | "铁岭", 353 | "朝阳", 354 | "葫芦岛" 355 | ] 356 | }], 357 | "N": [{ 358 | "name": "内蒙古", 359 | "id": "N", 360 | "data": [ 361 | "呼和浩特", 362 | "包头", 363 | "乌海", 364 | "赤峰", 365 | "通辽", 366 | "鄂尔多斯", 367 | "呼伦贝尔", 368 | "巴彦淖尔", 369 | "乌兰察布", 370 | "兴安盟", 371 | "锡林郭勒盟", 372 | "阿拉善盟" 373 | ] 374 | }, { 375 | "name": "宁夏", 376 | "data": [ 377 | "银川", 378 | "石嘴山", 379 | "吴忠", 380 | "固原", 381 | "中卫" 382 | ] 383 | }], 384 | "Q": [{ 385 | "name": "青海", 386 | "id": "Q", 387 | "data": [ 388 | "西宁", 389 | "海东", 390 | "海北藏族自治州", 391 | "黄南藏族自治州", 392 | "海南藏族自治州", 393 | "果洛藏族自治州", 394 | "玉树藏族自治州", 395 | "海西蒙古族藏族自治州" 396 | ] 397 | }], 398 | "S": [{ 399 | "name": "山西", 400 | "id": "S", 401 | "data": [ 402 | "太原", 403 | "大同", 404 | "阳泉", 405 | "长治", 406 | "晋城", 407 | "朔州", 408 | "晋中", 409 | "运城", 410 | "忻州", 411 | "临汾", 412 | "吕梁" 413 | ] 414 | }, 415 | { 416 | "name": "上海", 417 | "data": [ 418 | "黄浦", 419 | "徐汇", 420 | "长宁", 421 | "静安", 422 | "普陀", 423 | "虹口", 424 | "杨浦", 425 | "闵行", 426 | "宝山", 427 | "嘉定", 428 | "浦东新", 429 | "金山", 430 | "松江", 431 | "青浦", 432 | "奉贤", 433 | "崇明" 434 | ] 435 | }, 436 | { 437 | "name": "山东", 438 | "data": [ 439 | "济南", 440 | "青岛", 441 | "淄博", 442 | "枣庄", 443 | "东营", 444 | "烟台", 445 | "潍坊", 446 | "济宁", 447 | "泰安", 448 | "威海", 449 | "日照", 450 | "临沂", 451 | "德州", 452 | "聊城", 453 | "滨州", 454 | "菏泽" 455 | ] 456 | }, 457 | { 458 | "name": "四川", 459 | "data": [ 460 | "成都", 461 | "自贡", 462 | "攀枝花", 463 | "泸州", 464 | "德阳", 465 | "绵阳", 466 | "广元", 467 | "遂宁", 468 | "内江", 469 | "乐山", 470 | "南充", 471 | "眉山", 472 | "宜宾", 473 | "广安", 474 | "达州", 475 | "雅安", 476 | "巴中", 477 | "资阳", 478 | "阿坝藏族羌族自治州", 479 | "甘孜藏族自治州", 480 | "凉山彝族自治州" 481 | ] 482 | }, 483 | { 484 | "name": "陕西", 485 | "data": [ 486 | "西安", 487 | "铜川", 488 | "宝鸡", 489 | "咸阳", 490 | "渭南", 491 | "延安", 492 | "汉中", 493 | "榆林", 494 | "安康", 495 | "商洛" 496 | ] 497 | } 498 | ], 499 | "T": [{ 500 | "name": "天津", 501 | "id": "T", 502 | "data": [ 503 | "和平", 504 | "河东", 505 | "河西", 506 | "南开", 507 | "河北", 508 | "红桥", 509 | "东丽", 510 | "西青", 511 | "津南", 512 | "北辰", 513 | "武清", 514 | "宝坻", 515 | "滨海新", 516 | "宁河", 517 | "静海", 518 | "蓟州" 519 | ] 520 | }], 521 | "X": [{ 522 | "name": "西藏", 523 | "id": "X", 524 | "data": [ 525 | "拉萨", 526 | "日喀则", 527 | "昌都", 528 | "林芝", 529 | "山南", 530 | "那曲", 531 | "阿里地" 532 | ] 533 | }, 534 | { 535 | "name": "新疆", 536 | "data": [ 537 | "乌鲁木齐", 538 | "克拉玛依", 539 | "吐鲁番", 540 | "哈密", 541 | "昌吉回族自治州", 542 | "博尔塔拉蒙古自治州", 543 | "巴音郭楞蒙古自治州", 544 | "阿克苏地", 545 | "克孜勒苏柯尔克孜自治州", 546 | "喀什地", 547 | "和田地", 548 | "伊犁哈萨克自治州", 549 | "塔城地", 550 | "阿勒泰地", 551 | "石河子", 552 | "阿拉尔", 553 | "图木舒克", 554 | "五家渠", 555 | "北屯", 556 | "铁门关", 557 | "双河", 558 | "可克达拉", 559 | "昆玉", 560 | "胡杨河" 561 | ] 562 | } 563 | ], 564 | "Y": [{ 565 | "name": "云南", 566 | "id": "Y", 567 | "data": [ 568 | "昆明", 569 | "曲靖", 570 | "玉溪", 571 | "保山", 572 | "昭通", 573 | "丽江", 574 | "普洱", 575 | "临沧", 576 | "楚雄彝族自治州", 577 | "红河哈尼族彝族自治州", 578 | "文山壮族苗族自治州", 579 | "西双版纳傣族自治州", 580 | "大理白族自治州", 581 | "德宏傣族景颇族自治州", 582 | "怒江傈僳族自治州", 583 | "迪庆藏族自治州" 584 | ] 585 | }], 586 | "Z": [{ 587 | "name": "浙江", 588 | "id": "Z", 589 | "data": [ 590 | "杭州", 591 | "宁波", 592 | "温州", 593 | "嘉兴", 594 | "湖州", 595 | "绍兴", 596 | "金华", 597 | "衢州", 598 | "舟山", 599 | "台州", 600 | "丽水" 601 | ] 602 | }], 603 | "直辖市": [{ 604 | "name": "直辖市", 605 | "id": "直辖市", 606 | "data": [ 607 | "北京", 608 | "天津", 609 | "上海", 610 | "重庆" 611 | ] 612 | }], 613 | "港澳": [{ 614 | "name": "港澳", 615 | "id": "港澳", 616 | "data": [ 617 | "香港", 618 | "澳门" 619 | ] 620 | }] 621 | } --------------------------------------------------------------------------------