├── src ├── views │ ├── promote │ │ ├── adplan │ │ │ ├── GroupList.vue │ │ │ ├── IdeaList.vue │ │ │ ├── AdvertList.vue │ │ │ ├── Main.vue │ │ │ └── AccountList.vue │ │ └── Layout.vue │ ├── create │ │ ├── tencent │ │ │ ├── Plan.vue │ │ │ ├── Campaign.vue │ │ │ ├── Creative.vue │ │ │ └── Main.vue │ │ ├── toutiao │ │ │ ├── Plan.vue │ │ │ ├── Creative.vue │ │ │ ├── Main.vue │ │ │ └── Campaign.vue │ │ └── Layout.vue │ ├── Home.vue │ └── About.vue ├── plugins │ ├── utils.js │ └── table.js ├── assets │ ├── logo.png │ └── styles │ │ ├── index.less │ │ ├── variable.less │ │ ├── mixin.less │ │ ├── create.less │ │ ├── color │ │ ├── colorPalette.less │ │ ├── bezierEasing.less │ │ ├── colors.less │ │ └── tinyColor.less │ │ └── reset.less ├── api │ ├── config.js │ ├── user.model.js │ ├── interceptor.js │ └── request.class.js ├── store.js ├── directives │ ├── index.js │ ├── peach.js │ ├── mark.js │ └── waterMark.js ├── App.vue ├── data │ ├── toutiao │ │ └── modulers.json │ ├── weektime_data.js │ └── city_province.json ├── main.js ├── components │ └── HelloWorld.vue └── router.js ├── .browserslistrc ├── postcss.config.js ├── public ├── favicon.ico ├── index.html └── js │ ├── locale.zh-cn.js │ ├── vuex.min.js │ ├── axios.min.js │ └── vue-router.min.js ├── .editorconfig ├── .gitignore ├── .eslintrc.js ├── babel.config.js ├── LICENSE ├── package.json ├── vue.config.js └── README.md /src/views/promote/adplan/GroupList.vue: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/views/promote/adplan/IdeaList.vue: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/plugins/utils.js: -------------------------------------------------------------------------------- 1 | import 'xe-utils' 2 | -------------------------------------------------------------------------------- /src/views/promote/adplan/AdvertList.vue: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.browserslistrc: -------------------------------------------------------------------------------- 1 | > 1% 2 | last 2 versions 3 | -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | autoprefixer: {} 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiejunping/andt-components/HEAD/public/favicon.ico -------------------------------------------------------------------------------- /src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiejunping/andt-components/HEAD/src/assets/logo.png -------------------------------------------------------------------------------- /src/api/config.js: -------------------------------------------------------------------------------- 1 | // export const HOST_API = 'http://127.0.0.1:7001' 2 | export const HOST_API = 'https://api.jsvue.cn' 3 | 4 | export const RES_CODE = 0 5 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | [*.{js,jsx,ts,tsx,vue,json}] 2 | indent_style = space 3 | indent_size = 2 4 | trim_trailing_whitespace = true 5 | insert_final_newline = true 6 | -------------------------------------------------------------------------------- /src/assets/styles/index.less: -------------------------------------------------------------------------------- 1 | @import '~iview/src/styles/index.less'; // 引入iview样式 2 | 3 | @import './reset.less'; 4 | @import './variable.less'; 5 | @import './mixin.less'; -------------------------------------------------------------------------------- /src/views/promote/Layout.vue: -------------------------------------------------------------------------------- 1 | 6 | 11 | -------------------------------------------------------------------------------- /src/views/promote/adplan/Main.vue: -------------------------------------------------------------------------------- 1 | 6 | 11 | -------------------------------------------------------------------------------- /src/views/create/tencent/Plan.vue: -------------------------------------------------------------------------------- 1 | 6 | 11 | -------------------------------------------------------------------------------- /src/views/promote/adplan/AccountList.vue: -------------------------------------------------------------------------------- 1 | 6 | 11 | -------------------------------------------------------------------------------- /src/views/create/toutiao/Plan.vue: -------------------------------------------------------------------------------- 1 | 6 | 11 | -------------------------------------------------------------------------------- /src/assets/styles/variable.less: -------------------------------------------------------------------------------- 1 | 2 | 3 | @font-family: PingFangSC-Regular, PingFang SC, tahoma, arial, "Hiragino Sans GB", "Microsoft yahei", 'Segoe UI', roboto, 'Helvetica Neue', sans-serif; -------------------------------------------------------------------------------- /src/views/create/tencent/Campaign.vue: -------------------------------------------------------------------------------- 1 | 6 | 11 | -------------------------------------------------------------------------------- /src/views/create/tencent/Creative.vue: -------------------------------------------------------------------------------- 1 | 6 | 11 | -------------------------------------------------------------------------------- /src/views/create/toutiao/Creative.vue: -------------------------------------------------------------------------------- 1 | 6 | 11 | -------------------------------------------------------------------------------- /src/views/create/tencent/Main.vue: -------------------------------------------------------------------------------- 1 | 6 | 11 | -------------------------------------------------------------------------------- /src/store.js: -------------------------------------------------------------------------------- 1 | // import Vue from 'vue' 2 | // import Vuex from 'vuex' 3 | 4 | Vue.use(Vuex) 5 | 6 | export default new Vuex.Store({ 7 | state: { 8 | token: '' 9 | }, 10 | mutations: { 11 | 12 | }, 13 | actions: { 14 | 15 | } 16 | }) 17 | -------------------------------------------------------------------------------- /src/directives/index.js: -------------------------------------------------------------------------------- 1 | import peach from './peach' 2 | import mark from './mark' 3 | 4 | const directives = { 5 | peach, 6 | mark 7 | } 8 | 9 | export default { 10 | install (app) { 11 | Object.keys(directives).forEach((key) => { 12 | app.directive(key, directives[key]) 13 | }) 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | # local env files 6 | .env.local 7 | .env.*.local 8 | 9 | # Log files 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | 14 | # Editor directories and files 15 | .idea 16 | .vscode 17 | *.suo 18 | *.ntvs* 19 | *.njsproj 20 | *.sln 21 | *.sw? 22 | /*.lock 23 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { 4 | node: true 5 | }, 6 | 'extends': [ 7 | 'plugin:vue/essential', 8 | '@vue/standard' 9 | ], 10 | rules: { 11 | 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', 12 | 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off' 13 | }, 14 | parserOptions: { 15 | parser: 'babel-eslint' 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/assets/styles/mixin.less: -------------------------------------------------------------------------------- 1 | .clear() { 2 | &:after { 3 | content: ""; 4 | display: block; 5 | clear: both; 6 | font-size: 0; 7 | } 8 | } 9 | 10 | // 不换行 11 | .no-wrap() { 12 | text-overflow: ellipsis; 13 | overflow: hidden; 14 | white-space: nowrap; 15 | } 16 | 17 | .scroll(@d:y) { 18 | overflow-@{d}: auto; 19 | scrollbar-width: thin; 20 | -webkit-overflow-scrolling: touch; 21 | } 22 | 23 | .round(@n:4) { 24 | border-radius: unit(@n,px); 25 | } 26 | 27 | -------------------------------------------------------------------------------- /src/plugins/table.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import { 3 | Icon, 4 | Table, 5 | Column, 6 | Header, 7 | Footer, 8 | Filter, 9 | Edit, 10 | Menu, 11 | Export, 12 | Keyboard, 13 | Validator 14 | } from 'vxe-table' 15 | 16 | // 表格模块 17 | Vue.use(Icon) 18 | Vue.use(Column) 19 | Vue.use(Header) 20 | Vue.use(Footer) 21 | Vue.use(Filter) 22 | Vue.use(Edit) 23 | Vue.use(Menu) 24 | Vue.use(Export) 25 | Vue.use(Keyboard) 26 | Vue.use(Validator) 27 | // 安装表格 28 | Vue.use(Table) 29 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/app' 4 | ], 5 | plugins: [ 6 | [ 7 | 'import', 8 | { libraryName: 'ant-design-vue', libraryDirectory: 'es', style: true }, 9 | 'ant' 10 | ], 11 | [ 12 | 'import', 13 | { libraryName: 'iview', libraryDirectory: 'src/components' }, 14 | 'iview' 15 | ], 16 | [ 17 | 'import', 18 | { libraryName: 'vxe-table', style: true }, 19 | 'vxe' 20 | ] 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /src/directives/peach.js: -------------------------------------------------------------------------------- 1 | export default { 2 | bind (el, binding) { 3 | const { 4 | value, // 5 | arg // 参数event v-peach:event 6 | } = binding 7 | 8 | /* 9 | modifiers, // 修饰符 10 | */ 11 | 12 | el.addEventListener('click', () => { 13 | if (arg === 'event') { 14 | const { category, action } = value 15 | window._hmt.push(['_trackEvent', category, action]) 16 | } else if (arg === 'pagevt') { 17 | const { category, action } = value 18 | window._hmt.push(['_trackPageview', category, action]) 19 | } 20 | }) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/api/user.model.js: -------------------------------------------------------------------------------- 1 | // import { reqData, reqFormData, reqJson } from './request.class' 2 | import { reqJson, reqData } from './request.class' 3 | 4 | export async function userLogin (data) { 5 | const res = await reqJson({ 6 | url: '/user-center/login', 7 | method: 'POST', 8 | data 9 | }) 10 | return res 11 | } 12 | 13 | export async function userRegister (data) { 14 | const res = await reqData({ 15 | url: '/user-center/register', 16 | method: 'POST', 17 | data, 18 | timeout: 120000 19 | }) 20 | return res 21 | } 22 | 23 | export async function delay (data) { 24 | const res = await reqData({ 25 | url: '/com-api/delay', 26 | data, 27 | timeout: 60000 28 | }) 29 | return res 30 | } 31 | -------------------------------------------------------------------------------- /src/assets/styles/create.less: -------------------------------------------------------------------------------- 1 | .row-item { 2 | margin-bottom: 32px; 3 | .col-item { 4 | text-align: right; 5 | } 6 | i { 7 | margin-right: 4px; 8 | vertical-align: middle; 9 | &.ivu-icon-md-add { 10 | margin: 0; 11 | } 12 | } 13 | .item-field { 14 | font-size: 14px; 15 | padding-right: 12px; 16 | } 17 | .row-item-must { 18 | position: relative; 19 | z-index: 5; 20 | &:after { 21 | content: " "; 22 | display: inline-block; 23 | width: 4px; 24 | height: 4px; 25 | position: absolute; 26 | top: 6px; 27 | right: 0; 28 | background-color: #f45858; 29 | border-radius: 3px; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/views/create/toutiao/Main.vue: -------------------------------------------------------------------------------- 1 | 9 | 23 | 30 | -------------------------------------------------------------------------------- /src/views/create/Layout.vue: -------------------------------------------------------------------------------- 1 | 14 | 25 | 34 | -------------------------------------------------------------------------------- /src/directives/mark.js: -------------------------------------------------------------------------------- 1 | import WaterMark from './waterMark' 2 | 3 | export default { 4 | bind (el, binding) { 5 | const { value } = binding 6 | const waterMark = new WaterMark({ height: 200, aplha: 0.18, angle: 25 }) 7 | const $el = waterMark.creatElementItem(value) 8 | 9 | const markParentElem = document.createElement('div') 10 | // 设置样式 11 | markParentElem.id = 'watt-water' 12 | markParentElem.style.position = 'fixed' 13 | markParentElem.style.top = '30px' 14 | markParentElem.style.left = '40px' 15 | markParentElem.style.right = '40px' 16 | markParentElem.style.bottom = '30px' 17 | markParentElem.style.zIndex = 100 18 | markParentElem.style.pointerEvents = 'none' 19 | markParentElem.style.overflow = 'hidden' 20 | markParentElem.appendChild($el) 21 | el.appendChild(markParentElem) 22 | }, 23 | unbind () { 24 | const elem = document.getElementById('cnhn-water') 25 | elem && elem.remove() 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/App.vue: -------------------------------------------------------------------------------- 1 | 8 | 18 | 49 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 臭皮匠 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/data/toutiao/modulers.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": 1, 4 | "href": "group", 5 | "name": "创建广告组", 6 | "children": [ 7 | { 8 | "id": 6, 9 | "href": "group_creat", 10 | "name": "基础信息" 11 | } 12 | ], 13 | "state": 0 14 | }, 15 | { 16 | "id": 2, 17 | "href": "plan", 18 | "name": "设置广告计划", 19 | "children": [ 20 | { 21 | "id": 7, 22 | "href": "plan_basic", 23 | "name": "基础信息" 24 | }, 25 | { 26 | "id": 8, 27 | "href": "plan_target", 28 | "name": "投放目标" 29 | }, 30 | { 31 | "id": 11, 32 | "href": "plan_client", 33 | "name": "用户定向" 34 | }, 35 | { 36 | "id": 12, 37 | "href": "plan_price", 38 | "name": "预算与出价" 39 | } 40 | ], 41 | "state": 0 42 | }, 43 | { 44 | "id": 3, 45 | "href": "idea", 46 | "name": "设置创意", 47 | "children": [ 48 | { 49 | "id": 13, 50 | "href": "idea_position", 51 | "name": "投放位置" 52 | }, 53 | { 54 | "id": 14, 55 | "href": "idea_media", 56 | "name": "创意素材" 57 | }, 58 | { 59 | "id": 15, 60 | "href": "idea_tags", 61 | "name": "创意分类和标签" 62 | } 63 | ], 64 | "state": 0 65 | } 66 | ] 67 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "andt-components", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "serve": "vue-cli-service serve", 7 | "build": "vue-cli-service build", 8 | "lint": "vue-cli-service lint", 9 | "start": "http-server ./dist" 10 | }, 11 | "dependencies": { 12 | "@riophae/vue-treeselect": "^0.4.0", 13 | "advt-ui": "0.0.9", 14 | "ant-design-vue": "^1.3.16", 15 | "axios": "^0.21.1", 16 | "core-js": "^2.6.5", 17 | "form-data": "^2.5.1", 18 | "iview": "^3.5.0-rc.1", 19 | "moment": "^2.24.0", 20 | "nprogress": "^0.2.0", 21 | "qs": "^6.9.0", 22 | "vue": "^2.6.10", 23 | "vue-router": "^3.0.3", 24 | "vuex": "^3.0.1", 25 | "vxe-table": "^3.1.6", 26 | "xe-utils": "^3.1.8" 27 | }, 28 | "devDependencies": { 29 | "@vue/cli-plugin-babel": "^3.11.0", 30 | "@vue/cli-plugin-eslint": "^3.11.0", 31 | "@vue/cli-service": "^3.11.0", 32 | "@vue/eslint-config-standard": "^4.0.0", 33 | "babel-eslint": "^10.0.1", 34 | "babel-plugin-import": "^1.12.1", 35 | "eslint": "^5.16.0", 36 | "eslint-plugin-vue": "^5.0.0", 37 | "http-server": "^0.11.1", 38 | "less": "^3.10.3", 39 | "less-loader": "^5.0.0", 40 | "stylus": "^0.54.5", 41 | "stylus-loader": "^3.0.2", 42 | "vue-template-compiler": "^2.6.10" 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | andt-components 9 | 18 | 19 | 20 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | // import Vue from 'vue' 2 | // import moment from 'moment' 3 | import App from './App.vue' 4 | import router from './router' 5 | import store from './store' 6 | import Directives from './directives/' 7 | import { 8 | Layout, Row, Col, Button, Icon, AutoComplete, Select, Popover, notification, message, Modal, Input, Checkbox, Radio, Tag, Switch, Popconfirm, DatePicker, Pagination, LocaleProvider, 9 | Form, Steps, Anchor, InputNumber 10 | } from 'ant-design-vue' 11 | import { Spin } from 'iview' 12 | import '@/assets/styles/index.less' 13 | import './plugins/utils' 14 | import './plugins/table' 15 | 16 | import AdvtUI from 'advt-ui' 17 | import 'advt-ui/dist/style.css' 18 | 19 | moment.locale('zh-cn') 20 | 21 | Vue.use(Directives) 22 | Vue.use(Layout) 23 | .use(Row) 24 | .use(Col) 25 | .use(Button) 26 | .use(Icon) 27 | .use(AutoComplete) 28 | .use(Select) 29 | .use(Popover) 30 | .use(Modal) 31 | .use(Spin) 32 | .use(Input) 33 | .use(Checkbox) 34 | .use(Radio) 35 | .use(Tag) 36 | .use(Switch) 37 | .use(Popconfirm) 38 | .use(DatePicker) 39 | .use(Pagination) 40 | .use(LocaleProvider) 41 | .use(Form) 42 | .use(Steps) 43 | .use(Anchor) 44 | .use(InputNumber) 45 | Vue.use(AdvtUI) 46 | 47 | Vue.prototype.$message = message 48 | Vue.prototype.$notification = notification 49 | Vue.prototype.$spin = Spin 50 | Vue.prototype.$info = Modal.info 51 | Vue.prototype.$success = Modal.success 52 | Vue.prototype.$error = Modal.error 53 | Vue.prototype.$warning = Modal.warning 54 | Vue.prototype.$confirm = Modal.confirm 55 | 56 | Vue.config.productionTip = false 57 | 58 | new Vue({ 59 | router, 60 | store, 61 | render: h => h(App) 62 | }).$mount('#app') 63 | -------------------------------------------------------------------------------- /src/data/weektime_data.js: -------------------------------------------------------------------------------- 1 | const formatDate = (date, fmt) => { 2 | let o = { 3 | 'M+': date.getMonth() + 1, 4 | 'd+': date.getDate(), 5 | 'h+': date.getHours(), 6 | 'm+': date.getMinutes(), 7 | 's+': date.getSeconds(), 8 | 'q+': Math.floor((date.getMonth() + 3) / 3), 9 | 'S': date.getMilliseconds() 10 | } 11 | if (/(y+)/.test(fmt)) { 12 | fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length)) 13 | } 14 | for (var k in o) { 15 | if (new RegExp('(' + k + ')').test(fmt)) { 16 | fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length))) 17 | } 18 | } 19 | return fmt 20 | } 21 | 22 | const createArr = len => { 23 | return Array.from(Array(len)).map((ret, id) => id) 24 | } 25 | 26 | const formatWeektime = col => { 27 | const timestamp = 1542384000000 // '2018-11-17 00:00:00' 28 | const beginstamp = timestamp + col * 1800000 // col * 30 * 60 * 1000 29 | const endstamp = beginstamp + 1800000 30 | 31 | const begin = formatDate(new Date(beginstamp), 'hh:mm') 32 | const end = formatDate(new Date(endstamp), 'hh:mm') 33 | return `${begin}~${end}` 34 | } 35 | 36 | const data = ['星期一', '星期二', '星期三', '星期四', '星期五', '星期六', '星期日'].map((ret, index) => { 37 | const children = (ret, row, max) => { 38 | return createArr(max).map((t, col) => { 39 | return { 40 | week: ret, 41 | value: formatWeektime(col), 42 | begin: formatWeektime(col).split('~')[0], 43 | end: formatWeektime(col).split('~')[1], 44 | row: row, 45 | col: col 46 | } 47 | }) 48 | } 49 | return { 50 | value: ret, 51 | row: index, 52 | child: children(ret, index, 48) 53 | } 54 | }) 55 | 56 | export default data 57 | -------------------------------------------------------------------------------- /src/api/interceptor.js: -------------------------------------------------------------------------------- 1 | // import axios from 'axios' 2 | import Qs from 'qs' 3 | import FormData from 'form-data' 4 | import store from '@/store' 5 | import { Spin } from 'iview' 6 | import { HOST_API } from './config' 7 | 8 | function formDate (obj) { 9 | let form = new FormData() 10 | for (const key in obj) { 11 | if ({}.hasOwnProperty.call(obj, key)) { 12 | // 数组处理 13 | if (Object.prototype.toString.call(obj[key]) === '[object Array]') { 14 | obj[key].forEach(ret => { 15 | form.append(key, ret) 16 | }) 17 | } else form.append(key, obj[key]) 18 | } 19 | } 20 | return form 21 | } 22 | 23 | const instance = axios.create({ 24 | baseURL: HOST_API, 25 | transformRequest: [function (data, headers) { 26 | const ContentType = headers.post['Content-Type'] || headers.put['Content-Type'] || headers.patch['Content-Type'] 27 | if (ContentType.includes('json')) data = JSON.stringify(data) 28 | else if (ContentType.includes('form-data')) data = formDate(data) 29 | else data = Qs.stringify(data) 30 | return data 31 | }], 32 | paramsSerializer: function (params) { 33 | return Qs.stringify(params) 34 | }, 35 | timeout: 10000, 36 | headers: { 37 | 'X-Requested-With': 'XMLHttpRequest' 38 | }, 39 | onUploadProgress: function (progressEvent) { 40 | console.log(progressEvent) 41 | Spin.show() 42 | }, 43 | onDownloadProgress: function (progressEvent) { 44 | console.log(progressEvent) 45 | Spin.hide() 46 | }, 47 | maxContentLength: 200000 48 | }) 49 | 50 | if (store.state.token) { 51 | instance.defaults.headers.common['Authorization'] = store.state.token 52 | } 53 | 54 | instance.interceptors.request.use((config) => { 55 | console.log(config) 56 | return config 57 | }) 58 | 59 | export default instance 60 | -------------------------------------------------------------------------------- /vue.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path') 2 | const mode = process.env.NODE_ENV 3 | module.exports = { 4 | publicPath: '/andt-components', 5 | configureWebpack: config => { 6 | config.externals = { 7 | 'vue': 'Vue', 8 | 'vue-router': 'VueRouter', 9 | 'vuex': 'Vuex', 10 | 'axios': 'axios', 11 | 'moment': 'moment' 12 | } 13 | config.resolve = { 14 | extensions: ['.js', '.vue', '.json'], 15 | alias: { 16 | '@': path.resolve(__dirname, './src'), 17 | assets: path.resolve(__dirname, './src/assets') 18 | } 19 | } 20 | config.optimization = { 21 | splitChunks: { 22 | cacheGroups: { 23 | vendors: { 24 | name: 'vendors', 25 | test: /[\\/]node_modules[\\/]/, 26 | chunks: 'initial', 27 | maxSize: 600000, 28 | maxInitialRequests: 20, 29 | priority: 2, 30 | reuseExistingChunk: true, 31 | enforce: true 32 | }, 33 | common: { 34 | name: 'common', 35 | chunks: 'initial', 36 | maxInitialRequests: 5, 37 | minChunks: 2, 38 | reuseExistingChunk: true, 39 | priority: 1, 40 | enforce: true 41 | }, 42 | antdesign: { 43 | name: 'ant-design-vue', 44 | test: /[\\/]node_modules[\\/]ant-design-vue[\\/]/, 45 | chunks: 'initial', 46 | maxSize: 600000, 47 | reuseExistingChunk: true, 48 | priority: 3, 49 | enforce: true 50 | }, 51 | iview: { 52 | name: 'view-ui', 53 | test: /[\\/]node_modules[\\/]iview[\\/]/, 54 | chunks: 'initial', 55 | maxSize: 600000, 56 | reuseExistingChunk: true, 57 | priority: 3, 58 | enforce: true 59 | } 60 | } 61 | } 62 | } 63 | }, 64 | chainWebpack: config => { 65 | config.module 66 | .rule('eslint') 67 | .use('eslint-loader') 68 | .loader('eslint-loader') 69 | .tap(options => { 70 | options.fix = true 71 | return options 72 | }) 73 | }, 74 | css: { 75 | loaderOptions: { 76 | less: { 77 | modifyvars: { 78 | 'font-family': 'PingFangSC-Regular, PingFang SC, tahoma, arial, "Hiragino Sans GB", "Microsoft yahei", "Segoe UI", roboto, "Helvetica Neue", sans-serif' 79 | }, 80 | javascriptEnabled: true 81 | } 82 | } 83 | }, 84 | parallel: require('os').cpus().length > 1 85 | } 86 | -------------------------------------------------------------------------------- /src/assets/styles/color/colorPalette.less: -------------------------------------------------------------------------------- 1 | /* stylelint-disable no-duplicate-selectors */ 2 | @import "bezierEasing"; 3 | @import "tinyColor"; 4 | 5 | // We create a very complex algorithm which take the place of original tint/shade color system 6 | // to make sure no one can understand it 👻 7 | // and create an entire color palette magicly by inputing just a single primary color. 8 | // We are using bezier-curve easing function and some color manipulations like tint/shade/darken/spin 9 | .colorPaletteMixin() { 10 | @functions: ~`(function() { 11 | var hueStep = 2; 12 | var saturationStep = 16; 13 | var saturationStep2 = 5; 14 | var brightnessStep1 = 5; 15 | var brightnessStep2 = 15; 16 | var lightColorCount = 5; 17 | var darkColorCount = 4; 18 | 19 | var getHue = function(hsv, i, isLight) { 20 | var hue; 21 | if (hsv.h >= 60 && hsv.h <= 240) { 22 | hue = isLight ? hsv.h - hueStep * i : hsv.h + hueStep * i; 23 | } else { 24 | hue = isLight ? hsv.h + hueStep * i : hsv.h - hueStep * i; 25 | } 26 | if (hue < 0) { 27 | hue += 360; 28 | } else if (hue >= 360) { 29 | hue -= 360; 30 | } 31 | return Math.round(hue); 32 | }; 33 | var getSaturation = function(hsv, i, isLight) { 34 | var saturation; 35 | if (isLight) { 36 | saturation = Math.round(hsv.s * 100) - saturationStep * i; 37 | } else if (i == darkColorCount) { 38 | saturation = Math.round(hsv.s * 100) + saturationStep; 39 | } else { 40 | saturation = Math.round(hsv.s * 100) + saturationStep2 * i; 41 | } 42 | if (saturation > 100) { 43 | saturation = 100; 44 | } 45 | if (isLight && i === lightColorCount && saturation > 10) { 46 | saturation = 10; 47 | } 48 | if (saturation < 6) { 49 | saturation = 6; 50 | } 51 | return Math.round(saturation); 52 | }; 53 | var getValue = function(hsv, i, isLight) { 54 | if (isLight) { 55 | return Math.round(hsv.v * 100) + brightnessStep1 * i; 56 | } 57 | return Math.round(hsv.v * 100) - brightnessStep2 * i; 58 | }; 59 | 60 | this.colorPalette = function(color, index) { 61 | var isLight = index <= 6; 62 | var hsv = tinycolor(color).toHsv(); 63 | var i = isLight ? lightColorCount + 1 - index : index - lightColorCount - 1; 64 | return tinycolor({ 65 | h: getHue(hsv, i, isLight), 66 | s: getSaturation(hsv, i, isLight), 67 | v: getValue(hsv, i, isLight), 68 | }).toHexString(); 69 | }; 70 | })()`; 71 | } 72 | // It is hacky way to make this function will be compiled preferentially by less 73 | // resolve error: `ReferenceError: colorPalette is not defined` 74 | // https://github.com/ant-design/ant-motion/issues/44 75 | .colorPaletteMixin(); 76 | -------------------------------------------------------------------------------- /src/directives/waterMark.js: -------------------------------------------------------------------------------- 1 | /* 2 | * @description添加水印 3 | * @param {Obj} settings水印配置参数 4 | */ 5 | class WaterMark { 6 | constructor ({ 7 | angle, 8 | pageX, 9 | pageY, 10 | rows, 11 | cols, 12 | color, 13 | aplha, 14 | size, 15 | width, 16 | height, 17 | container 18 | }) { 19 | this.angle = angle || 15 20 | this.pageX = pageX || -10 21 | this.pageY = pageY || 0 22 | this.rows = rows || 10 23 | this.cols = cols || 20 24 | this.color = color || '#E8E8E8' 25 | this.alpha = aplha || 0.25 26 | this.fontSize = size || '16px' 27 | this.width = width || 200 28 | this.height = height || 100 29 | this.container = container 30 | } 31 | 32 | // 插入子集水印 33 | creatElementItem (text) { 34 | let x 35 | let y 36 | const fragment = document.createDocumentFragment() 37 | // 行 38 | for (let i = 0; i < this.rows; i++) { 39 | y = this.pageY + this.height * i 40 | y = isNaN(y) ? 40 : y 41 | // 列 42 | for (let j = 0; j < this.cols; j++) { 43 | const markElement = document.createElement('div') 44 | const markSpan = document.createElement('span') 45 | x = this.pageX + this.width * j 46 | 47 | // 超过内容的右边 48 | if (x + this.width > this.container) continue 49 | 50 | // 设置水印div倾斜显示 51 | markElement.style.webkitTransform = 'rotate(-' + this.angle + 'deg)' 52 | markElement.style.MozTransform = 'rotate(-' + this.angle + 'deg)' 53 | markElement.style.msTransform = 'rotate(-' + this.angle + 'deg)' 54 | markElement.style.OTransform = 'rotate(-' + this.angle + 'deg)' 55 | markElement.style.transform = 'rotate(-' + this.angle + 'deg)' 56 | markElement.style.visibility = '' 57 | markElement.style.position = 'absolute' 58 | markElement.style.left = x + 'px' 59 | markElement.style.top = y + 'px' 60 | markElement.style.overflow = 'hidden' 61 | markElement.style.zIndex = '10' 62 | markElement.style.pointerEvents = 'none' 63 | markElement.style.opacity = this.alpha 64 | markElement.style.fontSize = this.fontSize 65 | markElement.style.color = this.color 66 | markElement.style.textAlign = 'center' 67 | markElement.style.width = this.width + 'px' 68 | markElement.style.height = this.height + 'px' 69 | markElement.style.display = 'block' 70 | markElement.style.filter = 'alpha(opacity=' + this.alpha * 100 + ')' 71 | 72 | // 设置span的样式 73 | // markSpan.style.backgroundColor = '#b8ddff' // #1890FF' 74 | markSpan.style.display = 'inline-block' 75 | markSpan.style.padding = '2px 6px' 76 | markSpan.style.color = '#b8ddff' 77 | markSpan.innerHTML = text 78 | markElement.appendChild(markSpan) 79 | fragment.appendChild(markElement) 80 | } 81 | } 82 | 83 | return fragment 84 | } 85 | } 86 | 87 | export default WaterMark 88 | -------------------------------------------------------------------------------- /src/views/create/toutiao/Campaign.vue: -------------------------------------------------------------------------------- 1 | 52 | 76 | 98 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # andt-components 2 | include ant-design-vue iview admin-front-framework 3 | 4 | 投放组件DEMO演示 [https://free.jsvue.cn/andt-components/#/about](https://free.jsvue.cn/andt-components/#/about) 5 | 6 | ## Project setup 7 | ``` 8 | yarn install 9 | ``` 10 | 11 | ### Compiles and hot-reloads for development 12 | ``` 13 | yarn run serve 14 | ``` 15 | 16 | ### Compiles and minifies for production 17 | ``` 18 | yarn run build --report 19 | ``` 20 | 21 | ### Run your tests 22 | ``` 23 | yarn run test 24 | ``` 25 | 26 | ### Lints and fixes files 27 | ``` 28 | yarn run lint 29 | ``` 30 | 31 | ### Customize configuration 32 | See [Configuration Reference](https://cli.vuejs.org/config/). 33 | 34 | ### 线上演示地址 35 | 36 | DEMO演示 [https://free.jsvue.cn/andt-components](https://free.jsvue.cn/andt-components/) 37 | 38 | 组件已经开发到 vue2的组件库里去了 advt-ui 稳定版 0.0.9 , https://gitee.com/ChuPiJiang/AdvtUI 39 | 40 | 41 | 接下来计划把UI库做大做强,让更多做投放的前端开发能获得解放,也希望能够提更多好的建议,或是参与到维护中来 42 | 43 | ### 项目描述 44 | 这是一个`vue-cli 3.x` 构建的vue框架,按需加载 `andt-design-vue` 和 `iview` 处理了不兼容的问题。 45 | 46 | 47 | andt-design-vue 中的spin的用法很有局限性, 48 | 49 | 不支持相对位置显示 50 | 不支持全局方法显示与关闭 51 | 可以包裹,但不能在子组件中关闭 52 | 53 | ### 字体的替换 54 | 字体顺序不对,查看使用了两种UI框架,默认字体,字体顺序都不一样,怎么办 55 | 56 | - 方案一 单页应用 入口时 App.vue `#app` 这个样式增加字体可以解决一部分 57 | - iview 的主题更改,官方两种方式 58 | - 变量覆盖(推荐) 59 | 60 | 增加一个less 的入口文件 61 | 62 | @import '~iview/src/styles/index.less'; // 引入iview样式 63 | 64 | @import './reset.less'; 65 | @import './variable.less'; 66 | 67 | // Here are the variables to cover, such as: 68 | @primary-color: #8c0776; 69 | 70 | main.js 里面不要引用原来的css 71 | `import 'iview/dist/styles/iview.css';` 72 | 这种方式删除 73 | 74 | 使用下面方式 75 | `import '@/assets/styles/index.less'` 76 | 77 | - andt-design-vue 的主题怎么修改,官方方式一三种 78 | - 变量覆盖 (与iview)一样,但是,如果使用的按需引入,不能使用这种方式 79 | - 配置 less 变量文件 # 80 | 另外一种方式是建立一个单独的 less 变量文件,引入这个文件覆盖 antd.less 里的变量。 81 | ```js 82 | __at__import '~ant-design-vue/dist/antd.less'; // 引入官方提供的 less 样式入口文件 83 | __at__import 'your-theme-file.less'; // 用于覆盖上面定义的变量 84 | ``` 85 | >注意,这种方式已经载入了所有组件的样式,不需要也无法和按需加载插件 babel-plugin-import 的 style 属性一起使用。 86 | 87 | - 在 vue cli 3 中定制主题 # 88 | 项目根目录下新建文件vue.config.js 89 | ```js 90 | 91 | // vue.config.js 92 | module.exports = { 93 | css: { 94 | loaderOptions: { 95 | less: { 96 | modifyVars: { 97 | 'primary-color': '#1DA57A', 98 | 'link-color': '#1DA57A', 99 | 'border-radius-base': '2px', 100 | }, 101 | javascriptEnabled: true 102 | } 103 | } 104 | } 105 | } 106 | ``` 107 | 108 | ### 接口请求 109 | - 优化原有的三种方式的请求 `json`,`x-www-form-urlencoded`,`form-data` 110 | 111 | - 分别对应 `request.class.js` 里的 `reqJson`,`reqData`,`reqFormData` 同时在这次优化请求中增加了`cancelRequest`取消方法,并深度测试了其取消功能,在单接口或是多接口的同时,都可以使用取消机制 112 | >测试取消需配合长延迟接口做实验,代码中增加了`delay`60s,长等待接口,并测试了`axios`的超时限制,浏览器超时限制,`google chrome`的前端超时限制是4分钟。 113 | 114 | - 优化请求全屏遮罩动画,并增加取消按钮功能,在前后端开发的功能中,如出现错误,及接口等待时间过长,用户可手动取消,增加用户的体验度。 115 | 116 | 优化打包模块 117 | 引用一下静态CDN资源、本地资然 118 | 119 | 在 public 增加 js 文件夹 120 | 121 | ## 今日头条媒体 122 | 123 | - 创建广告组 http://localhost:8080/#/create/toutiao/campaign 124 | - 创建广告计划 http://localhost:8080/#/create/toutiao/plan 125 | - 创意创意 http://localhost:8080/#/create/toutiao/creative 126 | 127 | ### 2022 更新 128 | 129 | vue.config.js 中的配置 config.externals 使用 CDN 的引入 后,在项目中都可以使用对应的 window 下对应的变量直接使用,但是eslint可能会报错, 130 | -------------------------------------------------------------------------------- /src/assets/styles/reset.less: -------------------------------------------------------------------------------- 1 | html { 2 | font-family: PingFangSC-Regular, PingFang SC, tahoma, arial, "Hiragino Sans GB", "Microsoft yahei", 'Segoe UI', roboto, 'Helvetica Neue', sans-serif; 3 | font-size: 14px; 4 | -ms-text-size-adjust: 100%; 5 | -webkit-text-size-adjust: 100%; 6 | -moz-osx-font-smoothing: grayscale; 7 | -webkit-font-smoothing: antialiased; 8 | box-sizing: border-box; 9 | } 10 | 11 | html, 12 | body { 13 | overflow-x: hidden; 14 | -webkit-text-size-adjust: 100%; 15 | } 16 | 17 | *, 18 | *:before, 19 | *:after { 20 | box-sizing: border-box; 21 | margin: 0; 22 | } 23 | 24 | body, 25 | div, 26 | dl, 27 | dt, 28 | dd, 29 | ul, 30 | ol, 31 | li, 32 | h1, 33 | h2, 34 | h3, 35 | h4, 36 | h5, 37 | h6, 38 | hr, 39 | pre, 40 | form, 41 | fieldset, 42 | input, 43 | textarea, 44 | blockquote, 45 | p, 46 | del, 47 | dfn, 48 | em, 49 | font, 50 | img, 51 | ins, 52 | kbd, 53 | q, 54 | s, 55 | samp, 56 | small, 57 | strike, 58 | strong, 59 | sub, 60 | sup, 61 | tt, 62 | var, 63 | acronym, 64 | address, 65 | big, 66 | cite, 67 | code, 68 | label, 69 | legend { 70 | margin: 0; 71 | padding: 0; 72 | box-sizing: border-box; 73 | outline: none; 74 | -webkit-font-smoothing: antialiased; /*chrome、safari*/ 75 | -moz-osx-font-smoothing: grayscale; /*firefox抗锯齿渲染 */ 76 | } 77 | 78 | ul, 79 | ol { 80 | list-style: none; 81 | } 82 | 83 | address, 84 | cite, 85 | code, 86 | em, 87 | th { 88 | font-weight: normal; 89 | font-style: normal; 90 | } 91 | 92 | a, 93 | button, 94 | input, 95 | textarea { 96 | border: none; 97 | outline: none; 98 | cursor: pointer; 99 | appearance: none; 100 | -moz-appearance: none; 101 | -webkit-appearance: none; 102 | -webkit-tap-highlight-color: transparent; 103 | &:focus { 104 | outline: none; 105 | outline: 0; 106 | } 107 | } 108 | 109 | textarea { 110 | resize: none; 111 | } 112 | 113 | input::-webkit-input-speech-button { 114 | display: none; 115 | } 116 | 117 | input::-moz-placeholder, 118 | textarea::-moz-placeholder { 119 | color: #d8d8d8; 120 | } 121 | 122 | input:-ms-input-placeholder, 123 | textarea:-ms-input-placeholder { 124 | color: #d8d8d8; 125 | } 126 | 127 | input::-webkit-input-placeholder, 128 | textarea::-webkit-input-placeholder { 129 | color: #d8d8d8; 130 | } 131 | 132 | a { 133 | text-decoration: none; 134 | cursor: pointer; 135 | outline: none; 136 | } 137 | 138 | label { 139 | -webkit-tap-highlight-color: transparent; 140 | } 141 | 142 | ins { 143 | text-decoration: none; 144 | -webkit-tap-highlight-color: transparent; 145 | } 146 | 147 | hr { 148 | margin: 0 auto; 149 | } 150 | 151 | img { 152 | border: 0; 153 | vertical-align: middle; 154 | } 155 | 156 | table { 157 | border-collapse: collapse; 158 | border-spacing: 0; 159 | } 160 | 161 | ::-webkit-scrollbar { 162 | width: 8px; 163 | height: 8px; 164 | } 165 | ::-webkit-scrollbar:horizontal { 166 | height: 10px; 167 | } 168 | ::-webkit-scrollbar-button:end:increment, 169 | ::-webkit-scrollbar-button:start:decrement, 170 | ::-webkit-scrollbar-thumb { 171 | background-color: #dcdee2; 172 | border-radius: 4px; 173 | } 174 | ::-webkit-scrollbar-button:end:increment:hover, 175 | ::-webkit-scrollbar-button:start:decrement:hover, 176 | ::-webkit-scrollbar-thumb:hover { 177 | background-color: #999; 178 | } 179 | ::-webkit-scrollbar-button:end:increment, 180 | ::-webkit-scrollbar-button:start:decrement { 181 | display: none; 182 | } 183 | ::-webkit-scrollbar-track-piece { 184 | background-color: #f8f8f9; 185 | border-radius: 4px; 186 | } 187 | -------------------------------------------------------------------------------- /src/components/HelloWorld.vue: -------------------------------------------------------------------------------- 1 | 40 | 41 | 114 | 115 | 116 | 135 | -------------------------------------------------------------------------------- /src/api/request.class.js: -------------------------------------------------------------------------------- 1 | // import axios from 'axios' 2 | import ReqClient from './interceptor' 3 | import { message } from 'ant-design-vue' 4 | import { RES_CODE } from './config' 5 | import { Spin } from 'iview' 6 | 7 | window.__axiosCannel = [] 8 | 9 | async function fmtResponse (response) { 10 | const { status, data } = response 11 | // HTTP状态码不正确 12 | if (status === 200) { 13 | if (data && data.code === RES_CODE) { 14 | return data.data 15 | } else if (data && data.msg) { 16 | message.error(data.msg, 5) 17 | throw response 18 | } else { 19 | message.error('接口返回的格式错误', 5) 20 | throw response 21 | } 22 | } else { 23 | switch (status) { 24 | case 403: 25 | message.error('服务器拒绝请求!', 5) 26 | break 27 | case 404: 28 | message.error('服务器找不到请求!', 5) 29 | break 30 | case 408: 31 | message.error('网络已超时,请重试!', 5) 32 | break 33 | case 500: 34 | message.error('服务器出错了!', 5) 35 | break 36 | case 503: 37 | message.error('服务器宕机了-_-。sorry!', 5) 38 | break 39 | case 504: 40 | message.error('服务器没有反应了!', 5) 41 | break 42 | default: 43 | message.error('网络错误! 请重试', 5) 44 | break 45 | } 46 | throw response 47 | } 48 | } 49 | 50 | export async function reqJson (config) { 51 | try { 52 | const CancelToken = axios.CancelToken 53 | const source = CancelToken.source() 54 | window.__axiosCannel.push({ source }) 55 | config = Object.assign({}, config, { 56 | headers: { 57 | put: { 'Content-Type': 'application/json' }, 58 | post: { 'Content-Type': 'application/json' }, 59 | patch: { 'Content-Type': 'application/json' } 60 | }, 61 | cancelToken: source.token, 62 | _: Date.now() 63 | }) 64 | const response = await ReqClient.request(config) 65 | return await fmtResponse(response) 66 | } catch (e) { 67 | if (axios.isCancel(e)) { 68 | message.error(e.message) 69 | Spin.hide() 70 | } 71 | return false 72 | } 73 | } 74 | 75 | export async function reqData (config) { 76 | try { 77 | const CancelToken = axios.CancelToken 78 | const source = CancelToken.source() 79 | window.__axiosCannel.push({ source }) 80 | config = Object.assign({}, config, { 81 | cancelToken: source.token, 82 | _: Date.now() 83 | }) 84 | console.log(config, '==config') 85 | const response = await ReqClient.request(config) 86 | console.log(response) 87 | return await fmtResponse(response) 88 | } catch (e) { 89 | if (axios.isCancel(e)) { 90 | message.error(e.message) 91 | Spin.hide() 92 | } 93 | return false 94 | } 95 | } 96 | 97 | export async function reqFormData (config) { 98 | try { 99 | const CancelToken = axios.CancelToken 100 | const source = CancelToken.source() 101 | window.__axiosCannel.push({ source }) 102 | config = Object.assign({}, config, { 103 | headers: { 104 | put: { 'Content-Type': 'multipart/form-data' }, 105 | post: { 'Content-Type': 'multipart/form-data' }, 106 | patch: { 'Content-Type': 'multipart/form-data' } 107 | }, 108 | cancelToken: source.token, 109 | _: Date.now() 110 | }) 111 | const response = await ReqClient.request(config) 112 | return await fmtResponse(response) 113 | } catch (e) { 114 | if (axios.isCancel(e)) { 115 | message.error(e.message) 116 | Spin.hide() 117 | } 118 | return false 119 | } 120 | } 121 | 122 | export function cancelRequest () { 123 | if (window.__axiosCannel.length) { 124 | window.__axiosCannel.forEach((ret, idx) => { 125 | const msg = process.env.NODE_ENV === 'production' ? '' : '请求已被取消' 126 | ret.source.cancel(msg) 127 | delete window.__axiosCannel[idx] 128 | }) 129 | } 130 | } 131 | -------------------------------------------------------------------------------- /public/js/locale.zh-cn.js: -------------------------------------------------------------------------------- 1 | //! moment.js locale configuration 2 | 3 | ;(function (global, factory) { 4 | typeof exports === 'object' && typeof module !== 'undefined' 5 | && typeof require === 'function' ? factory(require('../moment')) : 6 | typeof define === 'function' && define.amd ? define(['../moment'], factory) : 7 | factory(global.moment) 8 | }(this, (function (moment) { 'use strict'; 9 | 10 | 11 | var zhCn = moment.defineLocale('zh-cn', { 12 | months : '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'), 13 | monthsShort : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'), 14 | weekdays : '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'), 15 | weekdaysShort : '周日_周一_周二_周三_周四_周五_周六'.split('_'), 16 | weekdaysMin : '日_一_二_三_四_五_六'.split('_'), 17 | longDateFormat : { 18 | LT : 'HH:mm', 19 | LTS : 'HH:mm:ss', 20 | L : 'YYYY/MM/DD', 21 | LL : 'YYYY年M月D日', 22 | LLL : 'YYYY年M月D日Ah点mm分', 23 | LLLL : 'YYYY年M月D日ddddAh点mm分', 24 | l : 'YYYY/M/D', 25 | ll : 'YYYY年M月D日', 26 | lll : 'YYYY年M月D日 HH:mm', 27 | llll : 'YYYY年M月D日dddd HH:mm' 28 | }, 29 | meridiemParse: /凌晨|早上|上午|中午|下午|晚上/, 30 | meridiemHour: function (hour, meridiem) { 31 | if (hour === 12) { 32 | hour = 0; 33 | } 34 | if (meridiem === '凌晨' || meridiem === '早上' || 35 | meridiem === '上午') { 36 | return hour; 37 | } else if (meridiem === '下午' || meridiem === '晚上') { 38 | return hour + 12; 39 | } else { 40 | // '中午' 41 | return hour >= 11 ? hour : hour + 12; 42 | } 43 | }, 44 | meridiem : function (hour, minute, isLower) { 45 | var hm = hour * 100 + minute; 46 | if (hm < 600) { 47 | return '凌晨'; 48 | } else if (hm < 900) { 49 | return '早上'; 50 | } else if (hm < 1130) { 51 | return '上午'; 52 | } else if (hm < 1230) { 53 | return '中午'; 54 | } else if (hm < 1800) { 55 | return '下午'; 56 | } else { 57 | return '晚上'; 58 | } 59 | }, 60 | calendar : { 61 | sameDay : '[今天]LT', 62 | nextDay : '[明天]LT', 63 | nextWeek : '[下]ddddLT', 64 | lastDay : '[昨天]LT', 65 | lastWeek : '[上]ddddLT', 66 | sameElse : 'L' 67 | }, 68 | dayOfMonthOrdinalParse: /\d{1,2}(日|月|周)/, 69 | ordinal : function (number, period) { 70 | switch (period) { 71 | case 'd': 72 | case 'D': 73 | case 'DDD': 74 | return number + '日'; 75 | case 'M': 76 | return number + '月'; 77 | case 'w': 78 | case 'W': 79 | return number + '周'; 80 | default: 81 | return number; 82 | } 83 | }, 84 | relativeTime : { 85 | future : '%s内', 86 | past : '%s前', 87 | s : '几秒', 88 | ss : '%d 秒', 89 | m : '1 分钟', 90 | mm : '%d 分钟', 91 | h : '1 小时', 92 | hh : '%d 小时', 93 | d : '1 天', 94 | dd : '%d 天', 95 | M : '1 个月', 96 | MM : '%d 个月', 97 | y : '1 年', 98 | yy : '%d 年' 99 | }, 100 | week : { 101 | // GB/T 7408-1994《数据元和交换格式·信息交换·日期和时间表示法》与ISO 8601:1988等效 102 | dow : 1, // Monday is the first day of the week. 103 | doy : 4 // The week that contains Jan 4th is the first week of the year. 104 | } 105 | }); 106 | 107 | return zhCn; 108 | 109 | }))); 110 | -------------------------------------------------------------------------------- /src/assets/styles/color/bezierEasing.less: -------------------------------------------------------------------------------- 1 | /* stylelint-disable declaration-bang-space-before,no-duplicate-selectors */ 2 | .bezierEasingMixin() { 3 | @functions: ~`(function() { 4 | var NEWTON_ITERATIONS = 4; 5 | var NEWTON_MIN_SLOPE = 0.001; 6 | var SUBDIVISION_PRECISION = 0.0000001; 7 | var SUBDIVISION_MAX_ITERATIONS = 10; 8 | 9 | var kSplineTableSize = 11; 10 | var kSampleStepSize = 1.0 / (kSplineTableSize - 1.0); 11 | 12 | var float32ArraySupported = typeof Float32Array === 'function'; 13 | 14 | function A (aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1; } 15 | function B (aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1; } 16 | function C (aA1) { return 3.0 * aA1; } 17 | 18 | // Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2. 19 | function calcBezier (aT, aA1, aA2) { return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT; } 20 | 21 | // Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2. 22 | function getSlope (aT, aA1, aA2) { return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1); } 23 | 24 | function binarySubdivide (aX, aA, aB, mX1, mX2) { 25 | var currentX, currentT, i = 0; 26 | do { 27 | currentT = aA + (aB - aA) / 2.0; 28 | currentX = calcBezier(currentT, mX1, mX2) - aX; 29 | if (currentX > 0.0) { 30 | aB = currentT; 31 | } else { 32 | aA = currentT; 33 | } 34 | } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS); 35 | return currentT; 36 | } 37 | 38 | function newtonRaphsonIterate (aX, aGuessT, mX1, mX2) { 39 | for (var i = 0; i < NEWTON_ITERATIONS; ++i) { 40 | var currentSlope = getSlope(aGuessT, mX1, mX2); 41 | if (currentSlope === 0.0) { 42 | return aGuessT; 43 | } 44 | var currentX = calcBezier(aGuessT, mX1, mX2) - aX; 45 | aGuessT -= currentX / currentSlope; 46 | } 47 | return aGuessT; 48 | } 49 | 50 | var BezierEasing = function (mX1, mY1, mX2, mY2) { 51 | if (!(0 <= mX1 && mX1 <= 1 && 0 <= mX2 && mX2 <= 1)) { 52 | throw new Error('bezier x values must be in [0, 1] range'); 53 | } 54 | 55 | // Precompute samples table 56 | var sampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize); 57 | if (mX1 !== mY1 || mX2 !== mY2) { 58 | for (var i = 0; i < kSplineTableSize; ++i) { 59 | sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2); 60 | } 61 | } 62 | 63 | function getTForX (aX) { 64 | var intervalStart = 0.0; 65 | var currentSample = 1; 66 | var lastSample = kSplineTableSize - 1; 67 | 68 | for (; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) { 69 | intervalStart += kSampleStepSize; 70 | } 71 | --currentSample; 72 | 73 | // Interpolate to provide an initial guess for t 74 | var dist = (aX - sampleValues[currentSample]) / (sampleValues[currentSample + 1] - sampleValues[currentSample]); 75 | var guessForT = intervalStart + dist * kSampleStepSize; 76 | 77 | var initialSlope = getSlope(guessForT, mX1, mX2); 78 | if (initialSlope >= NEWTON_MIN_SLOPE) { 79 | return newtonRaphsonIterate(aX, guessForT, mX1, mX2); 80 | } else if (initialSlope === 0.0) { 81 | return guessForT; 82 | } else { 83 | return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2); 84 | } 85 | } 86 | 87 | return function BezierEasing (x) { 88 | if (mX1 === mY1 && mX2 === mY2) { 89 | return x; // linear 90 | } 91 | // Because JavaScript number are imprecise, we should guarantee the extremes are right. 92 | if (x === 0) { 93 | return 0; 94 | } 95 | if (x === 1) { 96 | return 1; 97 | } 98 | return calcBezier(getTForX(x), mY1, mY2); 99 | }; 100 | }; 101 | 102 | this.colorEasing = BezierEasing(0.26, 0.09, 0.37, 0.18); 103 | // less 3 requires a return 104 | return ''; 105 | })()`; 106 | } 107 | // It is hacky way to make this function will be compiled preferentially by less 108 | // resolve error: `ReferenceError: colorPalette is not defined` 109 | // https://github.com/ant-design/ant-motion/issues/44 110 | .bezierEasingMixin(); 111 | -------------------------------------------------------------------------------- /src/views/Home.vue: -------------------------------------------------------------------------------- 1 | 43 | 44 | 117 | 138 | -------------------------------------------------------------------------------- /src/router.js: -------------------------------------------------------------------------------- 1 | // import Vue from 'vue' 2 | // import VueRouter from 'vue-router' 3 | import NProgress from 'nprogress' 4 | import { cancelRequest } from '@/api/request.class' 5 | import 'nprogress/nprogress.css' 6 | 7 | const isProd = process.env.NODE_ENV === 'production' 8 | Vue.use(VueRouter) 9 | 10 | const router = new VueRouter({ 11 | routes: [ 12 | { 13 | path: '/', 14 | name: 'home', 15 | // redirect: '/create', 16 | component: () => import('./views/Home.vue') 17 | }, 18 | { 19 | path: '/about', 20 | name: 'about', 21 | // route level code-splitting 22 | // this generates a separate chunk (about.[hash].js) for this route 23 | // which is lazy-loaded when the route is visited. 24 | component: () => import(/* webpackChunkName: "about" */ './views/About.vue') 25 | }, 26 | { 27 | path: '/promote', 28 | name: 'promote', 29 | component: () => import(/* webpackChunkName: "promote" */ '@/views/promote/Layout.vue'), 30 | children: [ 31 | { 32 | path: '/adplan', 33 | name: 'adplan', 34 | component: () => import(/* webpackChunkName: "adplan" */ '@/views/promote/adplan/Main.vue'), 35 | children: [ 36 | { 37 | path: 'account', 38 | name: 'account', 39 | component: () => import(/* webpackChunkName: "account" */ '@/views/promote/adplan/AccountList.vue') 40 | }, 41 | { 42 | path: 'group', 43 | name: 'group', 44 | component: () => import(/* webpackChunkName: "group" */ '@/views/promote/adplan/GroupList.vue') 45 | }, 46 | { 47 | path: 'advertise', 48 | name: 'advertise', 49 | component: () => import(/* webpackChunkName: "advertise" */ '@/views/promote/adplan/AdvertList.vue') 50 | }, 51 | { 52 | path: 'idea', 53 | name: 'idea', 54 | component: () => import(/* webpackChunkName: "idea" */ '@/views/promote/adplan/IdeaList.vue') 55 | } 56 | ] 57 | } 58 | ] 59 | }, 60 | { 61 | path: '/create', 62 | name: 'create', 63 | component: () => import(/* webpackChunkName: "create" */ './views/create/Layout.vue'), 64 | children: [ 65 | { 66 | path: 'toutiao', 67 | name: 'toutiao', 68 | component: () => import(/* webpackChunkName: "bytedancemain" */ './views/create/toutiao/Main.vue'), 69 | children: [ 70 | { 71 | path: 'campaign', 72 | name: 'campaign', 73 | component: () => import(/* webpackChunkName: "bytecampaign" */ './views/create/toutiao/Campaign.vue') 74 | }, 75 | { 76 | path: 'plan', 77 | name: 'plan', 78 | component: () => import(/* webpackChunkName: "byteplan" */ './views/create/toutiao/Plan.vue') 79 | }, 80 | { 81 | path: 'creative', 82 | name: 'creative', 83 | component: () => import(/* webpackChunkName: "bytecreative" */ './views/create/toutiao/Creative.vue') 84 | } 85 | ] 86 | }, 87 | { 88 | path: 'tencent', 89 | name: 'tencent', 90 | component: () => import(/* webpackChunkName: "tencentmain" */ './views/create/tencent/Main.vue'), 91 | children: [ 92 | { 93 | path: 'campaign', 94 | name: 'campaign', 95 | component: () => import(/* webpackChunkName: "tencentcampaign" */ './views/create/tencent/Campaign.vue') 96 | }, 97 | { 98 | path: 'plan', 99 | name: 'plan', 100 | component: () => import(/* webpackChunkName: "tencentplan" */ './views/create/tencent/Plan.vue') 101 | }, 102 | { 103 | path: 'creative', 104 | name: 'creative', 105 | component: () => import(/* webpackChunkName: "tencentcreative" */ './views/create/tencent/Creative.vue') 106 | } 107 | ] 108 | } 109 | ] 110 | } 111 | ] 112 | }) 113 | 114 | router.beforeEach((to, from, next) => { 115 | NProgress.start() 116 | next() 117 | }) 118 | 119 | router.afterEach((to) => { 120 | cancelRequest() // 取消请求 121 | NProgress.done() 122 | if (to.fullPath && isProd) { 123 | // 百度统计上报 124 | window._hmt.push(['_setAutoPageview', false]) 125 | window._hmt.push(['_trackPageview', to.fullPath]) 126 | } 127 | }) 128 | 129 | export default router 130 | -------------------------------------------------------------------------------- /src/assets/styles/color/colors.less: -------------------------------------------------------------------------------- 1 | @import 'colorPalette'; 2 | 3 | // color palettes 4 | @blue-1: color(~`colorPalette("@{blue-6}", 1)`); 5 | @blue-2: color(~`colorPalette("@{blue-6}", 2)`); 6 | @blue-3: color(~`colorPalette("@{blue-6}", 3)`); 7 | @blue-4: color(~`colorPalette("@{blue-6}", 4)`); 8 | @blue-5: color(~`colorPalette("@{blue-6}", 5)`); 9 | @blue-6: #1890ff; 10 | @blue-7: color(~`colorPalette("@{blue-6}", 7)`); 11 | @blue-8: color(~`colorPalette("@{blue-6}", 8)`); 12 | @blue-9: color(~`colorPalette("@{blue-6}", 9)`); 13 | @blue-10: color(~`colorPalette("@{blue-6}", 10)`); 14 | 15 | @purple-1: color(~`colorPalette("@{purple-6}", 1)`); 16 | @purple-2: color(~`colorPalette("@{purple-6}", 2)`); 17 | @purple-3: color(~`colorPalette("@{purple-6}", 3)`); 18 | @purple-4: color(~`colorPalette("@{purple-6}", 4)`); 19 | @purple-5: color(~`colorPalette("@{purple-6}", 5)`); 20 | @purple-6: #722ed1; 21 | @purple-7: color(~`colorPalette("@{purple-6}", 7)`); 22 | @purple-8: color(~`colorPalette("@{purple-6}", 8)`); 23 | @purple-9: color(~`colorPalette("@{purple-6}", 9)`); 24 | @purple-10: color(~`colorPalette("@{purple-6}", 10)`); 25 | 26 | @cyan-1: color(~`colorPalette("@{cyan-6}", 1)`); 27 | @cyan-2: color(~`colorPalette("@{cyan-6}", 2)`); 28 | @cyan-3: color(~`colorPalette("@{cyan-6}", 3)`); 29 | @cyan-4: color(~`colorPalette("@{cyan-6}", 4)`); 30 | @cyan-5: color(~`colorPalette("@{cyan-6}", 5)`); 31 | @cyan-6: #13c2c2; 32 | @cyan-7: color(~`colorPalette("@{cyan-6}", 7)`); 33 | @cyan-8: color(~`colorPalette("@{cyan-6}", 8)`); 34 | @cyan-9: color(~`colorPalette("@{cyan-6}", 9)`); 35 | @cyan-10: color(~`colorPalette("@{cyan-6}", 10)`); 36 | 37 | @green-1: color(~`colorPalette("@{green-6}", 1)`); 38 | @green-2: color(~`colorPalette("@{green-6}", 2)`); 39 | @green-3: color(~`colorPalette("@{green-6}", 3)`); 40 | @green-4: color(~`colorPalette("@{green-6}", 4)`); 41 | @green-5: color(~`colorPalette("@{green-6}", 5)`); 42 | @green-6: #52c41a; 43 | @green-7: color(~`colorPalette("@{green-6}", 7)`); 44 | @green-8: color(~`colorPalette("@{green-6}", 8)`); 45 | @green-9: color(~`colorPalette("@{green-6}", 9)`); 46 | @green-10: color(~`colorPalette("@{green-6}", 10)`); 47 | 48 | @magenta-1: color(~`colorPalette("@{magenta-6}", 1)`); 49 | @magenta-2: color(~`colorPalette("@{magenta-6}", 2)`); 50 | @magenta-3: color(~`colorPalette("@{magenta-6}", 3)`); 51 | @magenta-4: color(~`colorPalette("@{magenta-6}", 4)`); 52 | @magenta-5: color(~`colorPalette("@{magenta-6}", 5)`); 53 | @magenta-6: #eb2f96; 54 | @magenta-7: color(~`colorPalette("@{magenta-6}", 7)`); 55 | @magenta-8: color(~`colorPalette("@{magenta-6}", 8)`); 56 | @magenta-9: color(~`colorPalette("@{magenta-6}", 9)`); 57 | @magenta-10: color(~`colorPalette("@{magenta-6}", 10)`); 58 | 59 | // alias of magenta 60 | @pink-1: color(~`colorPalette("@{pink-6}", 1)`); 61 | @pink-2: color(~`colorPalette("@{pink-6}", 2)`); 62 | @pink-3: color(~`colorPalette("@{pink-6}", 3)`); 63 | @pink-4: color(~`colorPalette("@{pink-6}", 4)`); 64 | @pink-5: color(~`colorPalette("@{pink-6}", 5)`); 65 | @pink-6: #eb2f96; 66 | @pink-7: color(~`colorPalette("@{pink-6}", 7)`); 67 | @pink-8: color(~`colorPalette("@{pink-6}", 8)`); 68 | @pink-9: color(~`colorPalette("@{pink-6}", 9)`); 69 | @pink-10: color(~`colorPalette("@{pink-6}", 10)`); 70 | 71 | @red-1: color(~`colorPalette("@{red-6}", 1)`); 72 | @red-2: color(~`colorPalette("@{red-6}", 2)`); 73 | @red-3: color(~`colorPalette("@{red-6}", 3)`); 74 | @red-4: color(~`colorPalette("@{red-6}", 4)`); 75 | @red-5: color(~`colorPalette("@{red-6}", 5)`); 76 | @red-6: #f5222d; 77 | @red-7: color(~`colorPalette("@{red-6}", 7)`); 78 | @red-8: color(~`colorPalette("@{red-6}", 8)`); 79 | @red-9: color(~`colorPalette("@{red-6}", 9)`); 80 | @red-10: color(~`colorPalette("@{red-6}", 10)`); 81 | 82 | @orange-1: color(~`colorPalette("@{orange-6}", 1)`); 83 | @orange-2: color(~`colorPalette("@{orange-6}", 2)`); 84 | @orange-3: color(~`colorPalette("@{orange-6}", 3)`); 85 | @orange-4: color(~`colorPalette("@{orange-6}", 4)`); 86 | @orange-5: color(~`colorPalette("@{orange-6}", 5)`); 87 | @orange-6: #fa8c16; 88 | @orange-7: color(~`colorPalette("@{orange-6}", 7)`); 89 | @orange-8: color(~`colorPalette("@{orange-6}", 8)`); 90 | @orange-9: color(~`colorPalette("@{orange-6}", 9)`); 91 | @orange-10: color(~`colorPalette("@{orange-6}", 10)`); 92 | 93 | @yellow-1: color(~`colorPalette("@{yellow-6}", 1)`); 94 | @yellow-2: color(~`colorPalette("@{yellow-6}", 2)`); 95 | @yellow-3: color(~`colorPalette("@{yellow-6}", 3)`); 96 | @yellow-4: color(~`colorPalette("@{yellow-6}", 4)`); 97 | @yellow-5: color(~`colorPalette("@{yellow-6}", 5)`); 98 | @yellow-6: #fadb14; 99 | @yellow-7: color(~`colorPalette("@{yellow-6}", 7)`); 100 | @yellow-8: color(~`colorPalette("@{yellow-6}", 8)`); 101 | @yellow-9: color(~`colorPalette("@{yellow-6}", 9)`); 102 | @yellow-10: color(~`colorPalette("@{yellow-6}", 10)`); 103 | 104 | @volcano-1: color(~`colorPalette("@{volcano-6}", 1)`); 105 | @volcano-2: color(~`colorPalette("@{volcano-6}", 2)`); 106 | @volcano-3: color(~`colorPalette("@{volcano-6}", 3)`); 107 | @volcano-4: color(~`colorPalette("@{volcano-6}", 4)`); 108 | @volcano-5: color(~`colorPalette("@{volcano-6}", 5)`); 109 | @volcano-6: #fa541c; 110 | @volcano-7: color(~`colorPalette("@{volcano-6}", 7)`); 111 | @volcano-8: color(~`colorPalette("@{volcano-6}", 8)`); 112 | @volcano-9: color(~`colorPalette("@{volcano-6}", 9)`); 113 | @volcano-10: color(~`colorPalette("@{volcano-6}", 10)`); 114 | 115 | @geekblue-1: color(~`colorPalette("@{geekblue-6}", 1)`); 116 | @geekblue-2: color(~`colorPalette("@{geekblue-6}", 2)`); 117 | @geekblue-3: color(~`colorPalette("@{geekblue-6}", 3)`); 118 | @geekblue-4: color(~`colorPalette("@{geekblue-6}", 4)`); 119 | @geekblue-5: color(~`colorPalette("@{geekblue-6}", 5)`); 120 | @geekblue-6: #2f54eb; 121 | @geekblue-7: color(~`colorPalette("@{geekblue-6}", 7)`); 122 | @geekblue-8: color(~`colorPalette("@{geekblue-6}", 8)`); 123 | @geekblue-9: color(~`colorPalette("@{geekblue-6}", 9)`); 124 | @geekblue-10: color(~`colorPalette("@{geekblue-6}", 10)`); 125 | 126 | @lime-1: color(~`colorPalette("@{lime-6}", 1)`); 127 | @lime-2: color(~`colorPalette("@{lime-6}", 2)`); 128 | @lime-3: color(~`colorPalette("@{lime-6}", 3)`); 129 | @lime-4: color(~`colorPalette("@{lime-6}", 4)`); 130 | @lime-5: color(~`colorPalette("@{lime-6}", 5)`); 131 | @lime-6: #a0d911; 132 | @lime-7: color(~`colorPalette("@{lime-6}", 7)`); 133 | @lime-8: color(~`colorPalette("@{lime-6}", 8)`); 134 | @lime-9: color(~`colorPalette("@{lime-6}", 9)`); 135 | @lime-10: color(~`colorPalette("@{lime-6}", 10)`); 136 | 137 | @gold-1: color(~`colorPalette("@{gold-6}", 1)`); 138 | @gold-2: color(~`colorPalette("@{gold-6}", 2)`); 139 | @gold-3: color(~`colorPalette("@{gold-6}", 3)`); 140 | @gold-4: color(~`colorPalette("@{gold-6}", 4)`); 141 | @gold-5: color(~`colorPalette("@{gold-6}", 5)`); 142 | @gold-6: #faad14; 143 | @gold-7: color(~`colorPalette("@{gold-6}", 7)`); 144 | @gold-8: color(~`colorPalette("@{gold-6}", 8)`); 145 | @gold-9: color(~`colorPalette("@{gold-6}", 9)`); 146 | @gold-10: color(~`colorPalette("@{gold-6}", 10)`); 147 | -------------------------------------------------------------------------------- /public/js/vuex.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * vuex v3.1.2 3 | * (c) 2019 Evan You 4 | * @license MIT 5 | */ 6 | !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).Vuex=e()}(this,function(){"use strict";var t=("undefined"!=typeof window?window:"undefined"!=typeof global?global:{}).__VUE_DEVTOOLS_GLOBAL_HOOK__;function e(t,e){Object.keys(t).forEach(function(n){return e(t[n],n)})}function n(t){return null!==t&&"object"==typeof t}var o=function(t,e){this.runtime=e,this._children=Object.create(null),this._rawModule=t;var n=t.state;this.state=("function"==typeof n?n():n)||{}},i={namespaced:{configurable:!0}};i.namespaced.get=function(){return!!this._rawModule.namespaced},o.prototype.addChild=function(t,e){this._children[t]=e},o.prototype.removeChild=function(t){delete this._children[t]},o.prototype.getChild=function(t){return this._children[t]},o.prototype.update=function(t){this._rawModule.namespaced=t.namespaced,t.actions&&(this._rawModule.actions=t.actions),t.mutations&&(this._rawModule.mutations=t.mutations),t.getters&&(this._rawModule.getters=t.getters)},o.prototype.forEachChild=function(t){e(this._children,t)},o.prototype.forEachGetter=function(t){this._rawModule.getters&&e(this._rawModule.getters,t)},o.prototype.forEachAction=function(t){this._rawModule.actions&&e(this._rawModule.actions,t)},o.prototype.forEachMutation=function(t){this._rawModule.mutations&&e(this._rawModule.mutations,t)},Object.defineProperties(o.prototype,i);var r,s=function(t){this.register([],t,!1)};s.prototype.get=function(t){return t.reduce(function(t,e){return t.getChild(e)},this.root)},s.prototype.getNamespace=function(t){var e=this.root;return t.reduce(function(t,n){return t+((e=e.getChild(n)).namespaced?n+"/":"")},"")},s.prototype.update=function(t){!function t(e,n,o){n.update(o);if(o.modules)for(var i in o.modules){if(!n.getChild(i))return;t(e.concat(i),n.getChild(i),o.modules[i])}}([],this.root,t)},s.prototype.register=function(t,n,i){var r=this;void 0===i&&(i=!0);var s=new o(n,i);0===t.length?this.root=s:this.get(t.slice(0,-1)).addChild(t[t.length-1],s);n.modules&&e(n.modules,function(e,n){r.register(t.concat(n),e,i)})},s.prototype.unregister=function(t){var e=this.get(t.slice(0,-1)),n=t[t.length-1];e.getChild(n).runtime&&e.removeChild(n)};var a=function(e){var n=this;void 0===e&&(e={}),!r&&"undefined"!=typeof window&&window.Vue&&m(window.Vue);var o=e.plugins;void 0===o&&(o=[]);var i=e.strict;void 0===i&&(i=!1),this._committing=!1,this._actions=Object.create(null),this._actionSubscribers=[],this._mutations=Object.create(null),this._wrappedGetters=Object.create(null),this._modules=new s(e),this._modulesNamespaceMap=Object.create(null),this._subscribers=[],this._watcherVM=new r,this._makeLocalGettersCache=Object.create(null);var a=this,c=this.dispatch,u=this.commit;this.dispatch=function(t,e){return c.call(a,t,e)},this.commit=function(t,e,n){return u.call(a,t,e,n)},this.strict=i;var f=this._modules.root.state;p(this,f,[],this._modules.root),h(this,f),o.forEach(function(t){return t(n)}),(void 0!==e.devtools?e.devtools:r.config.devtools)&&function(e){t&&(e._devtoolHook=t,t.emit("vuex:init",e),t.on("vuex:travel-to-state",function(t){e.replaceState(t)}),e.subscribe(function(e,n){t.emit("vuex:mutation",e,n)}))}(this)},c={state:{configurable:!0}};function u(t,e){return e.indexOf(t)<0&&e.push(t),function(){var n=e.indexOf(t);n>-1&&e.splice(n,1)}}function f(t,e){t._actions=Object.create(null),t._mutations=Object.create(null),t._wrappedGetters=Object.create(null),t._modulesNamespaceMap=Object.create(null);var n=t.state;p(t,n,[],t._modules.root,!0),h(t,n,e)}function h(t,n,o){var i=t._vm;t.getters={},t._makeLocalGettersCache=Object.create(null);var s=t._wrappedGetters,a={};e(s,function(e,n){a[n]=function(t,e){return function(){return t(e)}}(e,t),Object.defineProperty(t.getters,n,{get:function(){return t._vm[n]},enumerable:!0})});var c=r.config.silent;r.config.silent=!0,t._vm=new r({data:{$$state:n},computed:a}),r.config.silent=c,t.strict&&function(t){t._vm.$watch(function(){return this._data.$$state},function(){},{deep:!0,sync:!0})}(t),i&&(o&&t._withCommit(function(){i._data.$$state=null}),r.nextTick(function(){return i.$destroy()}))}function p(t,e,n,o,i){var s=!n.length,a=t._modules.getNamespace(n);if(o.namespaced&&(t._modulesNamespaceMap[a],t._modulesNamespaceMap[a]=o),!s&&!i){var c=l(e,n.slice(0,-1)),u=n[n.length-1];t._withCommit(function(){r.set(c,u,o.state)})}var f=o.context=function(t,e,n){var o=""===e,i={dispatch:o?t.dispatch:function(n,o,i){var r=d(n,o,i),s=r.payload,a=r.options,c=r.type;return a&&a.root||(c=e+c),t.dispatch(c,s)},commit:o?t.commit:function(n,o,i){var r=d(n,o,i),s=r.payload,a=r.options,c=r.type;a&&a.root||(c=e+c),t.commit(c,s,a)}};return Object.defineProperties(i,{getters:{get:o?function(){return t.getters}:function(){return function(t,e){if(!t._makeLocalGettersCache[e]){var n={},o=e.length;Object.keys(t.getters).forEach(function(i){if(i.slice(0,o)===e){var r=i.slice(o);Object.defineProperty(n,r,{get:function(){return t.getters[i]},enumerable:!0})}}),t._makeLocalGettersCache[e]=n}return t._makeLocalGettersCache[e]}(t,e)}},state:{get:function(){return l(t.state,n)}}}),i}(t,a,n);o.forEachMutation(function(e,n){!function(t,e,n,o){(t._mutations[e]||(t._mutations[e]=[])).push(function(e){n.call(t,o.state,e)})}(t,a+n,e,f)}),o.forEachAction(function(e,n){var o=e.root?n:a+n,i=e.handler||e;!function(t,e,n,o){(t._actions[e]||(t._actions[e]=[])).push(function(e){var i,r=n.call(t,{dispatch:o.dispatch,commit:o.commit,getters:o.getters,state:o.state,rootGetters:t.getters,rootState:t.state},e);return(i=r)&&"function"==typeof i.then||(r=Promise.resolve(r)),t._devtoolHook?r.catch(function(e){throw t._devtoolHook.emit("vuex:error",e),e}):r})}(t,o,i,f)}),o.forEachGetter(function(e,n){!function(t,e,n,o){if(t._wrappedGetters[e])return;t._wrappedGetters[e]=function(t){return n(o.state,o.getters,t.state,t.getters)}}(t,a+n,e,f)}),o.forEachChild(function(o,r){p(t,e,n.concat(r),o,i)})}function l(t,e){return e.length?e.reduce(function(t,e){return t[e]},t):t}function d(t,e,o){return n(t)&&t.type&&(o=e,e=t,t=t.type),{type:t,payload:e,options:o}}function m(t){r&&t===r||function(t){if(Number(t.version.split(".")[0])>=2)t.mixin({beforeCreate:n});else{var e=t.prototype._init;t.prototype._init=function(t){void 0===t&&(t={}),t.init=t.init?[n].concat(t.init):n,e.call(this,t)}}function n(){var t=this.$options;t.store?this.$store="function"==typeof t.store?t.store():t.store:t.parent&&t.parent.$store&&(this.$store=t.parent.$store)}}(r=t)}c.state.get=function(){return this._vm._data.$$state},c.state.set=function(t){},a.prototype.commit=function(t,e,n){var o=this,i=d(t,e,n),r=i.type,s=i.payload,a={type:r,payload:s},c=this._mutations[r];c&&(this._withCommit(function(){c.forEach(function(t){t(s)})}),this._subscribers.forEach(function(t){return t(a,o.state)}))},a.prototype.dispatch=function(t,e){var n=this,o=d(t,e),i=o.type,r=o.payload,s={type:i,payload:r},a=this._actions[i];if(a){try{this._actionSubscribers.filter(function(t){return t.before}).forEach(function(t){return t.before(s,n.state)})}catch(t){}return(a.length>1?Promise.all(a.map(function(t){return t(r)})):a[0](r)).then(function(t){try{n._actionSubscribers.filter(function(t){return t.after}).forEach(function(t){return t.after(s,n.state)})}catch(t){}return t})}},a.prototype.subscribe=function(t){return u(t,this._subscribers)},a.prototype.subscribeAction=function(t){return u("function"==typeof t?{before:t}:t,this._actionSubscribers)},a.prototype.watch=function(t,e,n){var o=this;return this._watcherVM.$watch(function(){return t(o.state,o.getters)},e,n)},a.prototype.replaceState=function(t){var e=this;this._withCommit(function(){e._vm._data.$$state=t})},a.prototype.registerModule=function(t,e,n){void 0===n&&(n={}),"string"==typeof t&&(t=[t]),this._modules.register(t,e),p(this,this.state,t,this._modules.get(t),n.preserveState),h(this,this.state)},a.prototype.unregisterModule=function(t){var e=this;"string"==typeof t&&(t=[t]),this._modules.unregister(t),this._withCommit(function(){var n=l(e.state,t.slice(0,-1));r.delete(n,t[t.length-1])}),f(this)},a.prototype.hotUpdate=function(t){this._modules.update(t),f(this,!0)},a.prototype._withCommit=function(t){var e=this._committing;this._committing=!0,t(),this._committing=e},Object.defineProperties(a.prototype,c);var v=w(function(t,e){var n={};return b(e).forEach(function(e){var o=e.key,i=e.val;n[o]=function(){var e=this.$store.state,n=this.$store.getters;if(t){var o=$(this.$store,"mapState",t);if(!o)return;e=o.context.state,n=o.context.getters}return"function"==typeof i?i.call(this,e,n):e[i]},n[o].vuex=!0}),n}),_=w(function(t,e){var n={};return b(e).forEach(function(e){var o=e.key,i=e.val;n[o]=function(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];var o=this.$store.commit;if(t){var r=$(this.$store,"mapMutations",t);if(!r)return;o=r.context.commit}return"function"==typeof i?i.apply(this,[o].concat(e)):o.apply(this.$store,[i].concat(e))}}),n}),y=w(function(t,e){var n={};return b(e).forEach(function(e){var o=e.key,i=e.val;i=t+i,n[o]=function(){if(!t||$(this.$store,"mapGetters",t))return this.$store.getters[i]},n[o].vuex=!0}),n}),g=w(function(t,e){var n={};return b(e).forEach(function(e){var o=e.key,i=e.val;n[o]=function(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];var o=this.$store.dispatch;if(t){var r=$(this.$store,"mapActions",t);if(!r)return;o=r.context.dispatch}return"function"==typeof i?i.apply(this,[o].concat(e)):o.apply(this.$store,[i].concat(e))}}),n});function b(t){return function(t){return Array.isArray(t)||n(t)}(t)?Array.isArray(t)?t.map(function(t){return{key:t,val:t}}):Object.keys(t).map(function(e){return{key:e,val:t[e]}}):[]}function w(t){return function(e,n){return"string"!=typeof e?(n=e,e=""):"/"!==e.charAt(e.length-1)&&(e+="/"),t(e,n)}}function $(t,e,n){return t._modulesNamespaceMap[n]}return{Store:a,install:m,version:"3.1.2",mapState:v,mapMutations:_,mapGetters:y,mapActions:g,createNamespacedHelpers:function(t){return{mapState:v.bind(null,t),mapGetters:y.bind(null,t),mapMutations:_.bind(null,t),mapActions:g.bind(null,t)}}}}); -------------------------------------------------------------------------------- /src/views/About.vue: -------------------------------------------------------------------------------- 1 | 238 | 317 | 326 | -------------------------------------------------------------------------------- /public/js/axios.min.js: -------------------------------------------------------------------------------- 1 | /* axios v0.19.1 | (c) 2020 by Matt Zabriskie */ 2 | !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.axios=t():e.axios=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){"use strict";function r(e){var t=new s(e),n=i(s.prototype.request,t);return o.extend(n,s.prototype,t),o.extend(n,t),n}var o=n(2),i=n(3),s=n(4),a=n(23),u=n(10),c=r(u);c.Axios=s,c.create=function(e){return r(a(c.defaults,e))},c.Cancel=n(24),c.CancelToken=n(25),c.isCancel=n(9),c.all=function(e){return Promise.all(e)},c.spread=n(26),e.exports=c,e.exports.default=c},function(e,t,n){"use strict";function r(e){return"[object Array]"===C.call(e)}function o(e){return"undefined"==typeof e}function i(e){return null!==e&&!o(e)&&null!==e.constructor&&!o(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function s(e){return"[object ArrayBuffer]"===C.call(e)}function a(e){return"undefined"!=typeof FormData&&e instanceof FormData}function u(e){var t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer}function c(e){return"string"==typeof e}function f(e){return"number"==typeof e}function p(e){return null!==e&&"object"==typeof e}function d(e){return"[object Date]"===C.call(e)}function l(e){return"[object File]"===C.call(e)}function h(e){return"[object Blob]"===C.call(e)}function m(e){return"[object Function]"===C.call(e)}function y(e){return p(e)&&m(e.pipe)}function g(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams}function v(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}function x(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)}function w(e,t){if(null!==e&&"undefined"!=typeof e)if("object"!=typeof e&&(e=[e]),r(e))for(var n=0,o=e.length;n=200&&e<300}};u.headers={common:{Accept:"application/json, text/plain, */*"}},i.forEach(["delete","get","head"],function(e){u.headers[e]={}}),i.forEach(["post","put","patch"],function(e){u.headers[e]=i.merge(a)}),e.exports=u},function(e,t,n){"use strict";var r=n(2);e.exports=function(e,t){r.forEach(e,function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])})}},function(e,t,n){"use strict";var r=n(2),o=n(13),i=n(5),s=n(16),a=n(19),u=n(20),c=n(14);e.exports=function(e){return new Promise(function(t,f){var p=e.data,d=e.headers;r.isFormData(p)&&delete d["Content-Type"];var l=new XMLHttpRequest;if(e.auth){var h=e.auth.username||"",m=e.auth.password||"";d.Authorization="Basic "+btoa(h+":"+m)}var y=s(e.baseURL,e.url);if(l.open(e.method.toUpperCase(),i(y,e.params,e.paramsSerializer),!0),l.timeout=e.timeout,l.onreadystatechange=function(){if(l&&4===l.readyState&&(0!==l.status||l.responseURL&&0===l.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in l?a(l.getAllResponseHeaders()):null,r=e.responseType&&"text"!==e.responseType?l.response:l.responseText,i={data:r,status:l.status,statusText:l.statusText,headers:n,config:e,request:l};o(t,f,i),l=null}},l.onabort=function(){l&&(f(c("Request aborted",e,"ECONNABORTED",l)),l=null)},l.onerror=function(){f(c("Network Error",e,null,l)),l=null},l.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),f(c(t,e,"ECONNABORTED",l)),l=null},r.isStandardBrowserEnv()){var g=n(22),v=(e.withCredentials||u(y))&&e.xsrfCookieName?g.read(e.xsrfCookieName):void 0;v&&(d[e.xsrfHeaderName]=v)}if("setRequestHeader"in l&&r.forEach(d,function(e,t){"undefined"==typeof p&&"content-type"===t.toLowerCase()?delete d[t]:l.setRequestHeader(t,e)}),r.isUndefined(e.withCredentials)||(l.withCredentials=!!e.withCredentials),e.responseType)try{l.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&l.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&l.upload&&l.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then(function(e){l&&(l.abort(),f(e),l=null)}),void 0===p&&(p=null),l.send(p)})}},function(e,t,n){"use strict";var r=n(14);e.exports=function(e,t,n){var o=n.config.validateStatus;!o||o(n.status)?e(n):t(r("Request failed with status code "+n.status,n.config,null,n.request,n))}},function(e,t,n){"use strict";var r=n(15);e.exports=function(e,t,n,o,i){var s=new Error(e);return r(s,t,n,o,i)}},function(e,t){"use strict";e.exports=function(e,t,n,r,o){return e.config=t,n&&(e.code=n),e.request=r,e.response=o,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}},function(e,t,n){"use strict";var r=n(17),o=n(18);e.exports=function(e,t){return e&&!r(t)?o(e,t):t}},function(e,t){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},function(e,t){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t,n){"use strict";var r=n(2),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,n,i,s={};return e?(r.forEach(e.split("\n"),function(e){if(i=e.indexOf(":"),t=r.trim(e.substr(0,i)).toLowerCase(),n=r.trim(e.substr(i+1)),t){if(s[t]&&o.indexOf(t)>=0)return;"set-cookie"===t?s[t]=(s[t]?s[t]:[]).concat([n]):s[t]=s[t]?s[t]+", "+n:n}}),s):s}},function(e,t,n){"use strict";var r=n(2),o=n(21);e.exports=r.isStandardBrowserEnv()?function(){function e(e){var t=e;if(o(e))throw new Error("URL contains XSS injection attempt");return n&&(i.setAttribute("href",t),t=i.href),i.setAttribute("href",t),{href:i.href,protocol:i.protocol?i.protocol.replace(/:$/,""):"",host:i.host,search:i.search?i.search.replace(/^\?/,""):"",hash:i.hash?i.hash.replace(/^#/,""):"",hostname:i.hostname,port:i.port,pathname:"/"===i.pathname.charAt(0)?i.pathname:"/"+i.pathname}}var t,n=/(msie|trident)/i.test(navigator.userAgent),i=document.createElement("a");return t=e(window.location.href),function(n){var o=r.isString(n)?e(n):n;return o.protocol===t.protocol&&o.host===t.host}}():function(){return function(){return!0}}()},function(e,t){"use strict";e.exports=function(e){var t=/(\b)(on\w+)=|javascript|(<\s*)(\/*)script/gi;return t.test(e)}},function(e,t,n){"use strict";var r=n(2);e.exports=r.isStandardBrowserEnv()?function(){return{write:function(e,t,n,o,i,s){var a=[];a.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),r.isString(o)&&a.push("path="+o),r.isString(i)&&a.push("domain="+i),s===!0&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()},function(e,t,n){"use strict";var r=n(2);e.exports=function(e,t){t=t||{};var n={},o=["url","method","params","data"],i=["headers","auth","proxy"],s=["baseURL","url","transformRequest","transformResponse","paramsSerializer","timeout","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","maxContentLength","validateStatus","maxRedirects","httpAgent","httpsAgent","cancelToken","socketPath"];r.forEach(o,function(e){"undefined"!=typeof t[e]&&(n[e]=t[e])}),r.forEach(i,function(o){r.isObject(t[o])?n[o]=r.deepMerge(e[o],t[o]):"undefined"!=typeof t[o]?n[o]=t[o]:r.isObject(e[o])?n[o]=r.deepMerge(e[o]):"undefined"!=typeof e[o]&&(n[o]=e[o])}),r.forEach(s,function(r){"undefined"!=typeof t[r]?n[r]=t[r]:"undefined"!=typeof e[r]&&(n[r]=e[r])});var a=o.concat(i).concat(s),u=Object.keys(t).filter(function(e){return a.indexOf(e)===-1});return r.forEach(u,function(r){"undefined"!=typeof t[r]?n[r]=t[r]:"undefined"!=typeof e[r]&&(n[r]=e[r])}),n}},function(e,t){"use strict";function n(e){this.message=e}n.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},n.prototype.__CANCEL__=!0,e.exports=n},function(e,t,n){"use strict";function r(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(e){t=e});var n=this;e(function(e){n.reason||(n.reason=new o(e),t(n.reason))})}var o=n(24);r.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},r.source=function(){var e,t=new r(function(t){e=t});return{token:t,cancel:e}},e.exports=r},function(e,t){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}}])}); 3 | //# sourceMappingURL=axios.min.map -------------------------------------------------------------------------------- /public/js/vue-router.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * vue-router v3.1.3 3 | * (c) 2019 Evan You 4 | * @license MIT 5 | */ 6 | var t,e;t=this,e=function(){"use strict";function t(t){return Object.prototype.toString.call(t).indexOf("Error")>-1}function e(t,e){return e instanceof t||e&&(e.name===t.name||e._name===t._name)}function r(t,e){for(var r in e)t[r]=e[r];return t}var n={name:"RouterView",functional:!0,props:{name:{type:String,default:"default"}},render:function(t,e){var n=e.props,o=e.children,i=e.parent,a=e.data;a.routerView=!0;for(var c=i.$createElement,u=n.name,s=i.$route,p=i._routerViewCache||(i._routerViewCache={}),f=0,h=!1;i&&i._routerRoot!==i;){var l=i.$vnode&&i.$vnode.data;l&&(l.routerView&&f++,l.keepAlive&&i._inactive&&(h=!0)),i=i.$parent}if(a.routerViewDepth=f,h)return c(p[u],a,o);var d=s.matched[f];if(!d)return p[u]=null,c();var v=p[u]=d.components[u];a.registerRouteInstance=function(t,e){var r=d.instances[u];(e&&r!==t||!e&&r===t)&&(d.instances[u]=e)},(a.hook||(a.hook={})).prepatch=function(t,e){d.instances[u]=e.componentInstance},a.hook.init=function(t){t.data.keepAlive&&t.componentInstance&&t.componentInstance!==d.instances[u]&&(d.instances[u]=t.componentInstance)};var y=a.props=function(t,e){switch(typeof e){case"undefined":return;case"object":return e;case"function":return e(t);case"boolean":return e?t.params:void 0}}(s,d.props&&d.props[u]);if(y){y=a.props=r({},y);var m=a.attrs=a.attrs||{};for(var g in y)v.props&&g in v.props||(m[g]=y[g],delete y[g])}return c(v,a,o)}},o=/[!'()*]/g,i=function(t){return"%"+t.charCodeAt(0).toString(16)},a=/%2C/g,c=function(t){return encodeURIComponent(t).replace(o,i).replace(a,",")},u=decodeURIComponent;function s(t){var e={};return(t=t.trim().replace(/^(\?|#|&)/,""))?(t.split("&").forEach(function(t){var r=t.replace(/\+/g," ").split("="),n=u(r.shift()),o=r.length>0?u(r.join("=")):null;void 0===e[n]?e[n]=o:Array.isArray(e[n])?e[n].push(o):e[n]=[e[n],o]}),e):e}function p(t){var e=t?Object.keys(t).map(function(e){var r=t[e];if(void 0===r)return"";if(null===r)return c(e);if(Array.isArray(r)){var n=[];return r.forEach(function(t){void 0!==t&&(null===t?n.push(c(e)):n.push(c(e)+"="+c(t)))}),n.join("&")}return c(e)+"="+c(r)}).filter(function(t){return t.length>0}).join("&"):null;return e?"?"+e:""}var f=/\/?$/;function h(t,e,r,n){var o=n&&n.options.stringifyQuery,i=e.query||{};try{i=l(i)}catch(t){}var a={name:e.name||t&&t.name,meta:t&&t.meta||{},path:e.path||"/",hash:e.hash||"",query:i,params:e.params||{},fullPath:y(e,o),matched:t?v(t):[]};return r&&(a.redirectedFrom=y(r,o)),Object.freeze(a)}function l(t){if(Array.isArray(t))return t.map(l);if(t&&"object"==typeof t){var e={};for(var r in t)e[r]=l(t[r]);return e}return t}var d=h(null,{path:"/"});function v(t){for(var e=[];t;)e.unshift(t),t=t.parent;return e}function y(t,e){var r=t.path,n=t.query;void 0===n&&(n={});var o=t.hash;return void 0===o&&(o=""),(r||"/")+(e||p)(n)+o}function m(t,e){return e===d?t===e:!!e&&(t.path&&e.path?t.path.replace(f,"")===e.path.replace(f,"")&&t.hash===e.hash&&g(t.query,e.query):!(!t.name||!e.name)&&t.name===e.name&&t.hash===e.hash&&g(t.query,e.query)&&g(t.params,e.params))}function g(t,e){if(void 0===t&&(t={}),void 0===e&&(e={}),!t||!e)return t===e;var r=Object.keys(t),n=Object.keys(e);return r.length===n.length&&r.every(function(r){var n=t[r],o=e[r];return"object"==typeof n&&"object"==typeof o?g(n,o):String(n)===String(o)})}function b(t,e,r){var n=t.charAt(0);if("/"===n)return t;if("?"===n||"#"===n)return e+t;var o=e.split("/");r&&o[o.length-1]||o.pop();for(var i=t.replace(/^\//,"").split("/"),a=0;a=0&&(e=t.slice(n),t=t.slice(0,n));var o=t.indexOf("?");return o>=0&&(r=t.slice(o+1),t=t.slice(0,o)),{path:t,query:r,hash:e}}(i.path||""),p=e&&e.path||"/",f=u.path?b(u.path,p,n||i.append):p,h=function(t,e,r){void 0===e&&(e={});var n,o=r||s;try{n=o(t||"")}catch(t){n={}}for(var i in e)n[i]=e[i];return n}(u.query,i.query,o&&o.options.parseQuery),l=i.hash||u.hash;return l&&"#"!==l.charAt(0)&&(l="#"+l),{_normalized:!0,path:f,query:h,hash:l}}var B,H=[String,Object],z=[String,Array],D=function(){},F={name:"RouterLink",props:{to:{type:H,required:!0},tag:{type:String,default:"a"},exact:Boolean,append:Boolean,replace:Boolean,activeClass:String,exactActiveClass:String,event:{type:z,default:"click"}},render:function(t){var e=this,n=this.$router,o=this.$route,i=n.resolve(this.to,o,this.append),a=i.location,c=i.route,u=i.href,s={},p=n.options.linkActiveClass,l=n.options.linkExactActiveClass,d=null==p?"router-link-active":p,v=null==l?"router-link-exact-active":l,y=null==this.activeClass?d:this.activeClass,g=null==this.exactActiveClass?v:this.exactActiveClass,b=c.redirectedFrom?h(null,V(c.redirectedFrom),null,n):c;s[g]=m(o,b),s[y]=this.exact?s[g]:function(t,e){return 0===t.path.replace(f,"/").indexOf(e.path.replace(f,"/"))&&(!e.hash||t.hash===e.hash)&&function(t,e){for(var r in e)if(!(r in t))return!1;return!0}(t.query,e.query)}(o,b);var w=function(t){N(t)&&(e.replace?n.replace(a,D):n.push(a,D))},x={click:N};Array.isArray(this.event)?this.event.forEach(function(t){x[t]=w}):x[this.event]=w;var k={class:s},R=!this.$scopedSlots.$hasNormal&&this.$scopedSlots.default&&this.$scopedSlots.default({href:u,route:c,navigate:w,isActive:s[y],isExactActive:s[g]});if(R){if(1===R.length)return R[0];if(R.length>1||!R.length)return 0===R.length?t():t("span",{},R)}if("a"===this.tag)k.on=x,k.attrs={href:u};else{var E=function t(e){if(e)for(var r,n=0;n-1&&(c.params[h]=r.params[h]);return c.path=M(p.path,c.params),u(p,c,a)}if(c.path){c.params={};for(var l=0;l=t.length?r():t[o]?e(t[o],function(){n(o+1)}):n(o+1)};n(0)}function yt(e){return function(r,n,o){var i=!1,a=0,c=null;mt(e,function(e,r,n,u){if("function"==typeof e&&void 0===e.cid){i=!0,a++;var s,p=wt(function(t){var r;((r=t).__esModule||bt&&"Module"===r[Symbol.toStringTag])&&(t=t.default),e.resolved="function"==typeof t?t:B.extend(t),n.components[u]=t,--a<=0&&o()}),f=wt(function(e){var r="Failed to resolve async component "+u+": "+e;c||(c=t(e)?e:new Error(r),o(c))});try{s=e(p,f)}catch(t){f(t)}if(s)if("function"==typeof s.then)s.then(p,f);else{var h=s.component;h&&"function"==typeof h.then&&h.then(p,f)}}}),i||o()}}function mt(t,e){return gt(t.map(function(t){return Object.keys(t.components).map(function(r){return e(t.components[r],t.instances[r],t,r)})}))}function gt(t){return Array.prototype.concat.apply([],t)}var bt="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;function wt(t){var e=!1;return function(){for(var r=[],n=arguments.length;n--;)r[n]=arguments[n];if(!e)return e=!0,t.apply(this,r)}}var xt=function(t){function e(e){t.call(this),this.name=this._name="NavigationDuplicated",this.message='Navigating to current location ("'+e.fullPath+'") is not allowed',Object.defineProperty(this,"stack",{value:(new t).stack,writable:!0,configurable:!0})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error);xt._name="NavigationDuplicated";var kt=function(t,e){this.router=t,this.base=function(t){if(!t)if(K){var e=document.querySelector("base");t=(t=e&&e.getAttribute("href")||"/").replace(/^https?:\/\/[^\/]+/,"")}else t="/";return"/"!==t.charAt(0)&&(t="/"+t),t.replace(/\/$/,"")}(e),this.current=d,this.pending=null,this.ready=!1,this.readyCbs=[],this.readyErrorCbs=[],this.errorCbs=[]};function Rt(t,e,r,n){var o=mt(t,function(t,n,o,i){var a=function(t,e){return"function"!=typeof t&&(t=B.extend(t)),t.options[e]}(t,e);if(a)return Array.isArray(a)?a.map(function(t){return r(t,n,o,i)}):r(a,n,o,i)});return gt(n?o.reverse():o)}function Et(t,e){if(e)return function(){return t.apply(e,arguments)}}kt.prototype.listen=function(t){this.cb=t},kt.prototype.onReady=function(t,e){this.ready?t():(this.readyCbs.push(t),e&&this.readyErrorCbs.push(e))},kt.prototype.onError=function(t){this.errorCbs.push(t)},kt.prototype.transitionTo=function(t,e,r){var n=this,o=this.router.match(t,this.current);this.confirmTransition(o,function(){n.updateRoute(o),e&&e(o),n.ensureURL(),n.ready||(n.ready=!0,n.readyCbs.forEach(function(t){t(o)}))},function(t){r&&r(t),t&&!n.ready&&(n.ready=!0,n.readyErrorCbs.forEach(function(e){e(t)}))})},kt.prototype.confirmTransition=function(r,n,o){var i=this,a=this.current,c=function(r){!e(xt,r)&&t(r)&&(i.errorCbs.length?i.errorCbs.forEach(function(t){t(r)}):console.error(r)),o&&o(r)};if(m(r,a)&&r.matched.length===a.matched.length)return this.ensureURL(),c(new xt(r));var u=function(t,e){var r,n=Math.max(t.length,e.length);for(r=0;r-1?decodeURI(t.slice(0,n))+t.slice(n):decodeURI(t)}else r>-1&&(t=decodeURI(t.slice(0,r))+t.slice(r));return t}function St(t){var e=window.location.href,r=e.indexOf("#");return(r>=0?e.slice(0,r):e)+"#"+t}function $t(t){ht?lt(St(t)):window.location.hash=t}function Tt(t){ht?dt(St(t)):window.location.replace(St(t))}var Pt=function(t){function r(e,r){t.call(this,e,r),this.stack=[],this.index=-1}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.push=function(t,e,r){var n=this;this.transitionTo(t,function(t){n.stack=n.stack.slice(0,n.index+1).concat(t),n.index++,e&&e(t)},r)},r.prototype.replace=function(t,e,r){var n=this;this.transitionTo(t,function(t){n.stack=n.stack.slice(0,n.index).concat(t),e&&e(t)},r)},r.prototype.go=function(t){var r=this,n=this.index+t;if(!(n<0||n>=this.stack.length)){var o=this.stack[n];this.confirmTransition(o,function(){r.index=n,r.updateRoute(o)},function(t){e(xt,t)&&(r.index=n)})}},r.prototype.getCurrentLocation=function(){var t=this.stack[this.stack.length-1];return t?t.fullPath:"/"},r.prototype.ensureURL=function(){},r}(kt),Lt=function(t){void 0===t&&(t={}),this.app=null,this.apps=[],this.options=t,this.beforeHooks=[],this.resolveHooks=[],this.afterHooks=[],this.matcher=X(t.routes||[],this);var e=t.mode||"hash";switch(this.fallback="history"===e&&!ht&&!1!==t.fallback,this.fallback&&(e="hash"),K||(e="abstract"),this.mode=e,e){case"history":this.history=new Ot(this,t.base);break;case"hash":this.history=new At(this,t.base,this.fallback);break;case"abstract":this.history=new Pt(this,t.base)}},qt={currentRoute:{configurable:!0}};function Ut(t,e){return t.push(e),function(){var r=t.indexOf(e);r>-1&&t.splice(r,1)}}return Lt.prototype.match=function(t,e,r){return this.matcher.match(t,e,r)},qt.currentRoute.get=function(){return this.history&&this.history.current},Lt.prototype.init=function(t){var e=this;if(this.apps.push(t),t.$once("hook:destroyed",function(){var r=e.apps.indexOf(t);r>-1&&e.apps.splice(r,1),e.app===t&&(e.app=e.apps[0]||null)}),!this.app){this.app=t;var r=this.history;if(r instanceof Ot)r.transitionTo(r.getCurrentLocation());else if(r instanceof At){var n=function(){r.setupListeners()};r.transitionTo(r.getCurrentLocation(),n,n)}r.listen(function(t){e.apps.forEach(function(e){e._route=t})})}},Lt.prototype.beforeEach=function(t){return Ut(this.beforeHooks,t)},Lt.prototype.beforeResolve=function(t){return Ut(this.resolveHooks,t)},Lt.prototype.afterEach=function(t){return Ut(this.afterHooks,t)},Lt.prototype.onReady=function(t,e){this.history.onReady(t,e)},Lt.prototype.onError=function(t){this.history.onError(t)},Lt.prototype.push=function(t,e,r){var n=this;if(!e&&!r&&"undefined"!=typeof Promise)return new Promise(function(e,r){n.history.push(t,e,r)});this.history.push(t,e,r)},Lt.prototype.replace=function(t,e,r){var n=this;if(!e&&!r&&"undefined"!=typeof Promise)return new Promise(function(e,r){n.history.replace(t,e,r)});this.history.replace(t,e,r)},Lt.prototype.go=function(t){this.history.go(t)},Lt.prototype.back=function(){this.go(-1)},Lt.prototype.forward=function(){this.go(1)},Lt.prototype.getMatchedComponents=function(t){var e=t?t.matched?t:this.resolve(t).route:this.currentRoute;return e?[].concat.apply([],e.matched.map(function(t){return Object.keys(t.components).map(function(e){return t.components[e]})})):[]},Lt.prototype.resolve=function(t,e,r){var n=V(t,e=e||this.history.current,r,this),o=this.match(n,e),i=o.redirectedFrom||o.fullPath;return{location:n,route:o,href:function(t,e,r){var n="hash"===r?"#"+e:e;return t?w(t+"/"+n):n}(this.history.base,i,this.mode),normalizedTo:n,resolved:o}},Lt.prototype.addRoutes=function(t){this.matcher.addRoutes(t),this.history.current!==d&&this.history.transitionTo(this.history.getCurrentLocation())},Object.defineProperties(Lt.prototype,qt),Lt.install=function t(e){if(!t.installed||B!==e){t.installed=!0,B=e;var r=function(t){return void 0!==t},o=function(t,e){var n=t.$options._parentVnode;r(n)&&r(n=n.data)&&r(n=n.registerRouteInstance)&&n(t,e)};e.mixin({beforeCreate:function(){r(this.$options.router)?(this._routerRoot=this,this._router=this.$options.router,this._router.init(this),e.util.defineReactive(this,"_route",this._router.history.current)):this._routerRoot=this.$parent&&this.$parent._routerRoot||this,o(this,this)},destroyed:function(){o(this)}}),Object.defineProperty(e.prototype,"$router",{get:function(){return this._routerRoot._router}}),Object.defineProperty(e.prototype,"$route",{get:function(){return this._routerRoot._route}}),e.component("RouterView",n),e.component("RouterLink",F);var i=e.config.optionMergeStrategies;i.beforeRouteEnter=i.beforeRouteLeave=i.beforeRouteUpdate=i.created}},Lt.version="3.1.3",K&&window.Vue&&window.Vue.use(Lt),Lt},"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).VueRouter=e(); -------------------------------------------------------------------------------- /src/assets/styles/color/tinyColor.less: -------------------------------------------------------------------------------- 1 | /* stylelint-disable declaration-bang-space-before,no-duplicate-selectors,string-no-newline */ 2 | .tinyColorMixin() { 3 | @functions: ~`(function() { 4 | // TinyColor v1.4.1 5 | // https://github.com/bgrins/TinyColor 6 | // 2016-07-07, Brian Grinstead, MIT License 7 | var trimLeft = /^\s+/, 8 | trimRight = /\s+$/, 9 | tinyCounter = 0, 10 | mathRound = Math.round, 11 | mathMin = Math.min, 12 | mathMax = Math.max, 13 | mathRandom = Math.random; 14 | 15 | function tinycolor (color, opts) { 16 | 17 | color = (color) ? color : ''; 18 | opts = opts || { }; 19 | 20 | // If input is already a tinycolor, return itself 21 | if (color instanceof tinycolor) { 22 | return color; 23 | } 24 | // If we are called as a function, call using new instead 25 | if (!(this instanceof tinycolor)) { 26 | return new tinycolor(color, opts); 27 | } 28 | 29 | var rgb = inputToRGB(color); 30 | this._originalInput = color, 31 | this._r = rgb.r, 32 | this._g = rgb.g, 33 | this._b = rgb.b, 34 | this._a = rgb.a, 35 | this._roundA = mathRound(100*this._a) / 100, 36 | this._format = opts.format || rgb.format; 37 | this._gradientType = opts.gradientType; 38 | 39 | // Don't let the range of [0,255] come back in [0,1]. 40 | // Potentially lose a little bit of precision here, but will fix issues where 41 | // .5 gets interpreted as half of the total, instead of half of 1 42 | // If it was supposed to be 128, this was already taken care of by inputToRgb 43 | if (this._r < 1) { this._r = mathRound(this._r); } 44 | if (this._g < 1) { this._g = mathRound(this._g); } 45 | if (this._b < 1) { this._b = mathRound(this._b); } 46 | 47 | this._ok = rgb.ok; 48 | this._tc_id = tinyCounter++; 49 | } 50 | 51 | tinycolor.prototype = { 52 | isDark: function() { 53 | return this.getBrightness() < 128; 54 | }, 55 | isLight: function() { 56 | return !this.isDark(); 57 | }, 58 | isValid: function() { 59 | return this._ok; 60 | }, 61 | getOriginalInput: function() { 62 | return this._originalInput; 63 | }, 64 | getFormat: function() { 65 | return this._format; 66 | }, 67 | getAlpha: function() { 68 | return this._a; 69 | }, 70 | getBrightness: function() { 71 | //http://www.w3.org/TR/AERT#color-contrast 72 | var rgb = this.toRgb(); 73 | return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000; 74 | }, 75 | getLuminance: function() { 76 | //http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef 77 | var rgb = this.toRgb(); 78 | var RsRGB, GsRGB, BsRGB, R, G, B; 79 | RsRGB = rgb.r/255; 80 | GsRGB = rgb.g/255; 81 | BsRGB = rgb.b/255; 82 | 83 | if (RsRGB <= 0.03928) {R = RsRGB / 12.92;} else {R = Math.pow(((RsRGB + 0.055) / 1.055), 2.4);} 84 | if (GsRGB <= 0.03928) {G = GsRGB / 12.92;} else {G = Math.pow(((GsRGB + 0.055) / 1.055), 2.4);} 85 | if (BsRGB <= 0.03928) {B = BsRGB / 12.92;} else {B = Math.pow(((BsRGB + 0.055) / 1.055), 2.4);} 86 | return (0.2126 * R) + (0.7152 * G) + (0.0722 * B); 87 | }, 88 | setAlpha: function(value) { 89 | this._a = boundAlpha(value); 90 | this._roundA = mathRound(100*this._a) / 100; 91 | return this; 92 | }, 93 | toHsv: function() { 94 | var hsv = rgbToHsv(this._r, this._g, this._b); 95 | return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: this._a }; 96 | }, 97 | toHsvString: function() { 98 | var hsv = rgbToHsv(this._r, this._g, this._b); 99 | var h = mathRound(hsv.h * 360), s = mathRound(hsv.s * 100), v = mathRound(hsv.v * 100); 100 | return (this._a == 1) ? 101 | "hsv(" + h + ", " + s + "%, " + v + "%)" : 102 | "hsva(" + h + ", " + s + "%, " + v + "%, "+ this._roundA + ")"; 103 | }, 104 | toHsl: function() { 105 | var hsl = rgbToHsl(this._r, this._g, this._b); 106 | return { h: hsl.h * 360, s: hsl.s, l: hsl.l, a: this._a }; 107 | }, 108 | toHslString: function() { 109 | var hsl = rgbToHsl(this._r, this._g, this._b); 110 | var h = mathRound(hsl.h * 360), s = mathRound(hsl.s * 100), l = mathRound(hsl.l * 100); 111 | return (this._a == 1) ? 112 | "hsl(" + h + ", " + s + "%, " + l + "%)" : 113 | "hsla(" + h + ", " + s + "%, " + l + "%, "+ this._roundA + ")"; 114 | }, 115 | toHex: function(allow3Char) { 116 | return rgbToHex(this._r, this._g, this._b, allow3Char); 117 | }, 118 | toHexString: function(allow3Char) { 119 | return '#' + this.toHex(allow3Char); 120 | }, 121 | toHex8: function(allow4Char) { 122 | return rgbaToHex(this._r, this._g, this._b, this._a, allow4Char); 123 | }, 124 | toHex8String: function(allow4Char) { 125 | return '#' + this.toHex8(allow4Char); 126 | }, 127 | toRgb: function() { 128 | return { r: mathRound(this._r), g: mathRound(this._g), b: mathRound(this._b), a: this._a }; 129 | }, 130 | toRgbString: function() { 131 | return (this._a == 1) ? 132 | "rgb(" + mathRound(this._r) + ", " + mathRound(this._g) + ", " + mathRound(this._b) + ")" : 133 | "rgba(" + mathRound(this._r) + ", " + mathRound(this._g) + ", " + mathRound(this._b) + ", " + this._roundA + ")"; 134 | }, 135 | toPercentageRgb: function() { 136 | return { r: mathRound(bound01(this._r, 255) * 100) + "%", g: mathRound(bound01(this._g, 255) * 100) + "%", b: mathRound(bound01(this._b, 255) * 100) + "%", a: this._a }; 137 | }, 138 | toPercentageRgbString: function() { 139 | return (this._a == 1) ? 140 | "rgb(" + mathRound(bound01(this._r, 255) * 100) + "%, " + mathRound(bound01(this._g, 255) * 100) + "%, " + mathRound(bound01(this._b, 255) * 100) + "%)" : 141 | "rgba(" + mathRound(bound01(this._r, 255) * 100) + "%, " + mathRound(bound01(this._g, 255) * 100) + "%, " + mathRound(bound01(this._b, 255) * 100) + "%, " + this._roundA + ")"; 142 | }, 143 | toName: function() { 144 | if (this._a === 0) { 145 | return "transparent"; 146 | } 147 | 148 | if (this._a < 1) { 149 | return false; 150 | } 151 | 152 | return hexNames[rgbToHex(this._r, this._g, this._b, true)] || false; 153 | }, 154 | toFilter: function(secondColor) { 155 | var hex8String = '#' + rgbaToArgbHex(this._r, this._g, this._b, this._a); 156 | var secondHex8String = hex8String; 157 | var gradientType = this._gradientType ? "GradientType = 1, " : ""; 158 | 159 | if (secondColor) { 160 | var s = tinycolor(secondColor); 161 | secondHex8String = '#' + rgbaToArgbHex(s._r, s._g, s._b, s._a); 162 | } 163 | 164 | return "progid:DXImageTransform.Microsoft.gradient("+gradientType+"startColorstr="+hex8String+",endColorstr="+secondHex8String+")"; 165 | }, 166 | toString: function(format) { 167 | var formatSet = !!format; 168 | format = format || this._format; 169 | 170 | var formattedString = false; 171 | var hasAlpha = this._a < 1 && this._a >= 0; 172 | var needsAlphaFormat = !formatSet && hasAlpha && (format === "hex" || format === "hex6" || format === "hex3" || format === "hex4" || format === "hex8" || format === "name"); 173 | 174 | if (needsAlphaFormat) { 175 | // Special case for "transparent", all other non-alpha formats 176 | // will return rgba when there is transparency. 177 | if (format === "name" && this._a === 0) { 178 | return this.toName(); 179 | } 180 | return this.toRgbString(); 181 | } 182 | if (format === "rgb") { 183 | formattedString = this.toRgbString(); 184 | } 185 | if (format === "prgb") { 186 | formattedString = this.toPercentageRgbString(); 187 | } 188 | if (format === "hex" || format === "hex6") { 189 | formattedString = this.toHexString(); 190 | } 191 | if (format === "hex3") { 192 | formattedString = this.toHexString(true); 193 | } 194 | if (format === "hex4") { 195 | formattedString = this.toHex8String(true); 196 | } 197 | if (format === "hex8") { 198 | formattedString = this.toHex8String(); 199 | } 200 | if (format === "name") { 201 | formattedString = this.toName(); 202 | } 203 | if (format === "hsl") { 204 | formattedString = this.toHslString(); 205 | } 206 | if (format === "hsv") { 207 | formattedString = this.toHsvString(); 208 | } 209 | 210 | return formattedString || this.toHexString(); 211 | }, 212 | clone: function() { 213 | return tinycolor(this.toString()); 214 | }, 215 | 216 | _applyModification: function(fn, args) { 217 | var color = fn.apply(null, [this].concat([].slice.call(args))); 218 | this._r = color._r; 219 | this._g = color._g; 220 | this._b = color._b; 221 | this.setAlpha(color._a); 222 | return this; 223 | }, 224 | lighten: function() { 225 | return this._applyModification(lighten, arguments); 226 | }, 227 | brighten: function() { 228 | return this._applyModification(brighten, arguments); 229 | }, 230 | darken: function() { 231 | return this._applyModification(darken, arguments); 232 | }, 233 | desaturate: function() { 234 | return this._applyModification(desaturate, arguments); 235 | }, 236 | saturate: function() { 237 | return this._applyModification(saturate, arguments); 238 | }, 239 | greyscale: function() { 240 | return this._applyModification(greyscale, arguments); 241 | }, 242 | spin: function() { 243 | return this._applyModification(spin, arguments); 244 | }, 245 | 246 | _applyCombination: function(fn, args) { 247 | return fn.apply(null, [this].concat([].slice.call(args))); 248 | }, 249 | analogous: function() { 250 | return this._applyCombination(analogous, arguments); 251 | }, 252 | complement: function() { 253 | return this._applyCombination(complement, arguments); 254 | }, 255 | monochromatic: function() { 256 | return this._applyCombination(monochromatic, arguments); 257 | }, 258 | splitcomplement: function() { 259 | return this._applyCombination(splitcomplement, arguments); 260 | }, 261 | triad: function() { 262 | return this._applyCombination(triad, arguments); 263 | }, 264 | tetrad: function() { 265 | return this._applyCombination(tetrad, arguments); 266 | } 267 | }; 268 | 269 | // If input is an object, force 1 into "1.0" to handle ratios properly 270 | // String input requires "1.0" as input, so 1 will be treated as 1 271 | tinycolor.fromRatio = function(color, opts) { 272 | if (typeof color == "object") { 273 | var newColor = {}; 274 | for (var i in color) { 275 | if (color.hasOwnProperty(i)) { 276 | if (i === "a") { 277 | newColor[i] = color[i]; 278 | } 279 | else { 280 | newColor[i] = convertToPercentage(color[i]); 281 | } 282 | } 283 | } 284 | color = newColor; 285 | } 286 | 287 | return tinycolor(color, opts); 288 | }; 289 | 290 | // Given a string or object, convert that input to RGB 291 | // Possible string inputs: 292 | // 293 | // "red" 294 | // "#f00" or "f00" 295 | // "#ff0000" or "ff0000" 296 | // "#ff000000" or "ff000000" 297 | // "rgb 255 0 0" or "rgb (255, 0, 0)" 298 | // "rgb 1.0 0 0" or "rgb (1, 0, 0)" 299 | // "rgba (255, 0, 0, 1)" or "rgba 255, 0, 0, 1" 300 | // "rgba (1.0, 0, 0, 1)" or "rgba 1.0, 0, 0, 1" 301 | // "hsl(0, 100%, 50%)" or "hsl 0 100% 50%" 302 | // "hsla(0, 100%, 50%, 1)" or "hsla 0 100% 50%, 1" 303 | // "hsv(0, 100%, 100%)" or "hsv 0 100% 100%" 304 | // 305 | function inputToRGB(color) { 306 | 307 | var rgb = { r: 0, g: 0, b: 0 }; 308 | var a = 1; 309 | var s = null; 310 | var v = null; 311 | var l = null; 312 | var ok = false; 313 | var format = false; 314 | 315 | if (typeof color == "string") { 316 | color = stringInputToObject(color); 317 | } 318 | 319 | if (typeof color == "object") { 320 | if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) { 321 | rgb = rgbToRgb(color.r, color.g, color.b); 322 | ok = true; 323 | format = String(color.r).substr(-1) === "%" ? "prgb" : "rgb"; 324 | } 325 | else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) { 326 | s = convertToPercentage(color.s); 327 | v = convertToPercentage(color.v); 328 | rgb = hsvToRgb(color.h, s, v); 329 | ok = true; 330 | format = "hsv"; 331 | } 332 | else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) { 333 | s = convertToPercentage(color.s); 334 | l = convertToPercentage(color.l); 335 | rgb = hslToRgb(color.h, s, l); 336 | ok = true; 337 | format = "hsl"; 338 | } 339 | 340 | if (color.hasOwnProperty("a")) { 341 | a = color.a; 342 | } 343 | } 344 | 345 | a = boundAlpha(a); 346 | 347 | return { 348 | ok: ok, 349 | format: color.format || format, 350 | r: mathMin(255, mathMax(rgb.r, 0)), 351 | g: mathMin(255, mathMax(rgb.g, 0)), 352 | b: mathMin(255, mathMax(rgb.b, 0)), 353 | a: a 354 | }; 355 | } 356 | 357 | // Conversion Functions 358 | // -------------------- 359 | 360 | // rgbToHsl, rgbToHsv, hslToRgb, hsvToRgb modified from: 361 | // 362 | 363 | // rgbToRgb 364 | // Handle bounds / percentage checking to conform to CSS color spec 365 | // 366 | // *Assumes:* r, g, b in [0, 255] or [0, 1] 367 | // *Returns:* { r, g, b } in [0, 255] 368 | function rgbToRgb(r, g, b){ 369 | return { 370 | r: bound01(r, 255) * 255, 371 | g: bound01(g, 255) * 255, 372 | b: bound01(b, 255) * 255 373 | }; 374 | } 375 | 376 | // rgbToHsl 377 | // Converts an RGB color value to HSL. 378 | // *Assumes:* r, g, and b are contained in [0, 255] or [0, 1] 379 | // *Returns:* { h, s, l } in [0,1] 380 | function rgbToHsl(r, g, b) { 381 | 382 | r = bound01(r, 255); 383 | g = bound01(g, 255); 384 | b = bound01(b, 255); 385 | 386 | var max = mathMax(r, g, b), min = mathMin(r, g, b); 387 | var h, s, l = (max + min) / 2; 388 | 389 | if(max == min) { 390 | h = s = 0; // achromatic 391 | } 392 | else { 393 | var d = max - min; 394 | s = l > 0.5 ? d / (2 - max - min) : d / (max + min); 395 | switch(max) { 396 | case r: h = (g - b) / d + (g < b ? 6 : 0); break; 397 | case g: h = (b - r) / d + 2; break; 398 | case b: h = (r - g) / d + 4; break; 399 | } 400 | 401 | h /= 6; 402 | } 403 | 404 | return { h: h, s: s, l: l }; 405 | } 406 | 407 | // hslToRgb 408 | // Converts an HSL color value to RGB. 409 | // *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100] 410 | // *Returns:* { r, g, b } in the set [0, 255] 411 | function hslToRgb(h, s, l) { 412 | var r, g, b; 413 | 414 | h = bound01(h, 360); 415 | s = bound01(s, 100); 416 | l = bound01(l, 100); 417 | 418 | function hue2rgb(p, q, t) { 419 | if(t < 0) t += 1; 420 | if(t > 1) t -= 1; 421 | if(t < 1/6) return p + (q - p) * 6 * t; 422 | if(t < 1/2) return q; 423 | if(t < 2/3) return p + (q - p) * (2/3 - t) * 6; 424 | return p; 425 | } 426 | 427 | if(s === 0) { 428 | r = g = b = l; // achromatic 429 | } 430 | else { 431 | var q = l < 0.5 ? l * (1 + s) : l + s - l * s; 432 | var p = 2 * l - q; 433 | r = hue2rgb(p, q, h + 1/3); 434 | g = hue2rgb(p, q, h); 435 | b = hue2rgb(p, q, h - 1/3); 436 | } 437 | 438 | return { r: r * 255, g: g * 255, b: b * 255 }; 439 | } 440 | 441 | // rgbToHsv 442 | // Converts an RGB color value to HSV 443 | // *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1] 444 | // *Returns:* { h, s, v } in [0,1] 445 | function rgbToHsv(r, g, b) { 446 | 447 | r = bound01(r, 255); 448 | g = bound01(g, 255); 449 | b = bound01(b, 255); 450 | 451 | var max = mathMax(r, g, b), min = mathMin(r, g, b); 452 | var h, s, v = max; 453 | 454 | var d = max - min; 455 | s = max === 0 ? 0 : d / max; 456 | 457 | if(max == min) { 458 | h = 0; // achromatic 459 | } 460 | else { 461 | switch(max) { 462 | case r: h = (g - b) / d + (g < b ? 6 : 0); break; 463 | case g: h = (b - r) / d + 2; break; 464 | case b: h = (r - g) / d + 4; break; 465 | } 466 | h /= 6; 467 | } 468 | return { h: h, s: s, v: v }; 469 | } 470 | 471 | // hsvToRgb 472 | // Converts an HSV color value to RGB. 473 | // *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100] 474 | // *Returns:* { r, g, b } in the set [0, 255] 475 | function hsvToRgb(h, s, v) { 476 | 477 | h = bound01(h, 360) * 6; 478 | s = bound01(s, 100); 479 | v = bound01(v, 100); 480 | 481 | var i = Math.floor(h), 482 | f = h - i, 483 | p = v * (1 - s), 484 | q = v * (1 - f * s), 485 | t = v * (1 - (1 - f) * s), 486 | mod = i % 6, 487 | r = [v, q, p, p, t, v][mod], 488 | g = [t, v, v, q, p, p][mod], 489 | b = [p, p, t, v, v, q][mod]; 490 | 491 | return { r: r * 255, g: g * 255, b: b * 255 }; 492 | } 493 | 494 | // rgbToHex 495 | // Converts an RGB color to hex 496 | // Assumes r, g, and b are contained in the set [0, 255] 497 | // Returns a 3 or 6 character hex 498 | function rgbToHex(r, g, b, allow3Char) { 499 | 500 | var hex = [ 501 | pad2(mathRound(r).toString(16)), 502 | pad2(mathRound(g).toString(16)), 503 | pad2(mathRound(b).toString(16)) 504 | ]; 505 | 506 | // Return a 3 character hex if possible 507 | if (allow3Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1)) { 508 | return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0); 509 | } 510 | 511 | return hex.join(""); 512 | } 513 | 514 | // rgbaToHex 515 | // Converts an RGBA color plus alpha transparency to hex 516 | // Assumes r, g, b are contained in the set [0, 255] and 517 | // a in [0, 1]. Returns a 4 or 8 character rgba hex 518 | function rgbaToHex(r, g, b, a, allow4Char) { 519 | 520 | var hex = [ 521 | pad2(mathRound(r).toString(16)), 522 | pad2(mathRound(g).toString(16)), 523 | pad2(mathRound(b).toString(16)), 524 | pad2(convertDecimalToHex(a)) 525 | ]; 526 | 527 | // Return a 4 character hex if possible 528 | if (allow4Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) && hex[3].charAt(0) == hex[3].charAt(1)) { 529 | return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0); 530 | } 531 | 532 | return hex.join(""); 533 | } 534 | 535 | // rgbaToArgbHex 536 | // Converts an RGBA color to an ARGB Hex8 string 537 | // Rarely used, but required for "toFilter()" 538 | function rgbaToArgbHex(r, g, b, a) { 539 | 540 | var hex = [ 541 | pad2(convertDecimalToHex(a)), 542 | pad2(mathRound(r).toString(16)), 543 | pad2(mathRound(g).toString(16)), 544 | pad2(mathRound(b).toString(16)) 545 | ]; 546 | 547 | return hex.join(""); 548 | } 549 | 550 | // equals 551 | // Can be called with any tinycolor input 552 | tinycolor.equals = function (color1, color2) { 553 | if (!color1 || !color2) { return false; } 554 | return tinycolor(color1).toRgbString() == tinycolor(color2).toRgbString(); 555 | }; 556 | 557 | tinycolor.random = function() { 558 | return tinycolor.fromRatio({ 559 | r: mathRandom(), 560 | g: mathRandom(), 561 | b: mathRandom() 562 | }); 563 | }; 564 | 565 | // Modification Functions 566 | // ---------------------- 567 | // Thanks to less.js for some of the basics here 568 | // 569 | 570 | function desaturate(color, amount) { 571 | amount = (amount === 0) ? 0 : (amount || 10); 572 | var hsl = tinycolor(color).toHsl(); 573 | hsl.s -= amount / 100; 574 | hsl.s = clamp01(hsl.s); 575 | return tinycolor(hsl); 576 | } 577 | 578 | function saturate(color, amount) { 579 | amount = (amount === 0) ? 0 : (amount || 10); 580 | var hsl = tinycolor(color).toHsl(); 581 | hsl.s += amount / 100; 582 | hsl.s = clamp01(hsl.s); 583 | return tinycolor(hsl); 584 | } 585 | 586 | function greyscale(color) { 587 | return tinycolor(color).desaturate(100); 588 | } 589 | 590 | function lighten (color, amount) { 591 | amount = (amount === 0) ? 0 : (amount || 10); 592 | var hsl = tinycolor(color).toHsl(); 593 | hsl.l += amount / 100; 594 | hsl.l = clamp01(hsl.l); 595 | return tinycolor(hsl); 596 | } 597 | 598 | function brighten(color, amount) { 599 | amount = (amount === 0) ? 0 : (amount || 10); 600 | var rgb = tinycolor(color).toRgb(); 601 | rgb.r = mathMax(0, mathMin(255, rgb.r - mathRound(255 * - (amount / 100)))); 602 | rgb.g = mathMax(0, mathMin(255, rgb.g - mathRound(255 * - (amount / 100)))); 603 | rgb.b = mathMax(0, mathMin(255, rgb.b - mathRound(255 * - (amount / 100)))); 604 | return tinycolor(rgb); 605 | } 606 | 607 | function darken (color, amount) { 608 | amount = (amount === 0) ? 0 : (amount || 10); 609 | var hsl = tinycolor(color).toHsl(); 610 | hsl.l -= amount / 100; 611 | hsl.l = clamp01(hsl.l); 612 | return tinycolor(hsl); 613 | } 614 | 615 | // Spin takes a positive or negative amount within [-360, 360] indicating the change of hue. 616 | // Values outside of this range will be wrapped into this range. 617 | function spin(color, amount) { 618 | var hsl = tinycolor(color).toHsl(); 619 | var hue = (hsl.h + amount) % 360; 620 | hsl.h = hue < 0 ? 360 + hue : hue; 621 | return tinycolor(hsl); 622 | } 623 | 624 | // Combination Functions 625 | // --------------------- 626 | // Thanks to jQuery xColor for some of the ideas behind these 627 | // 628 | 629 | function complement(color) { 630 | var hsl = tinycolor(color).toHsl(); 631 | hsl.h = (hsl.h + 180) % 360; 632 | return tinycolor(hsl); 633 | } 634 | 635 | function triad(color) { 636 | var hsl = tinycolor(color).toHsl(); 637 | var h = hsl.h; 638 | return [ 639 | tinycolor(color), 640 | tinycolor({ h: (h + 120) % 360, s: hsl.s, l: hsl.l }), 641 | tinycolor({ h: (h + 240) % 360, s: hsl.s, l: hsl.l }) 642 | ]; 643 | } 644 | 645 | function tetrad(color) { 646 | var hsl = tinycolor(color).toHsl(); 647 | var h = hsl.h; 648 | return [ 649 | tinycolor(color), 650 | tinycolor({ h: (h + 90) % 360, s: hsl.s, l: hsl.l }), 651 | tinycolor({ h: (h + 180) % 360, s: hsl.s, l: hsl.l }), 652 | tinycolor({ h: (h + 270) % 360, s: hsl.s, l: hsl.l }) 653 | ]; 654 | } 655 | 656 | function splitcomplement(color) { 657 | var hsl = tinycolor(color).toHsl(); 658 | var h = hsl.h; 659 | return [ 660 | tinycolor(color), 661 | tinycolor({ h: (h + 72) % 360, s: hsl.s, l: hsl.l}), 662 | tinycolor({ h: (h + 216) % 360, s: hsl.s, l: hsl.l}) 663 | ]; 664 | } 665 | 666 | function analogous(color, results, slices) { 667 | results = results || 6; 668 | slices = slices || 30; 669 | 670 | var hsl = tinycolor(color).toHsl(); 671 | var part = 360 / slices; 672 | var ret = [tinycolor(color)]; 673 | 674 | for (hsl.h = ((hsl.h - (part * results >> 1)) + 720) % 360; --results; ) { 675 | hsl.h = (hsl.h + part) % 360; 676 | ret.push(tinycolor(hsl)); 677 | } 678 | return ret; 679 | } 680 | 681 | function monochromatic(color, results) { 682 | results = results || 6; 683 | var hsv = tinycolor(color).toHsv(); 684 | var h = hsv.h, s = hsv.s, v = hsv.v; 685 | var ret = []; 686 | var modification = 1 / results; 687 | 688 | while (results--) { 689 | ret.push(tinycolor({ h: h, s: s, v: v})); 690 | v = (v + modification) % 1; 691 | } 692 | 693 | return ret; 694 | } 695 | 696 | // Utility Functions 697 | // --------------------- 698 | 699 | tinycolor.mix = function(color1, color2, amount) { 700 | amount = (amount === 0) ? 0 : (amount || 50); 701 | 702 | var rgb1 = tinycolor(color1).toRgb(); 703 | var rgb2 = tinycolor(color2).toRgb(); 704 | 705 | var p = amount / 100; 706 | 707 | var rgba = { 708 | r: ((rgb2.r - rgb1.r) * p) + rgb1.r, 709 | g: ((rgb2.g - rgb1.g) * p) + rgb1.g, 710 | b: ((rgb2.b - rgb1.b) * p) + rgb1.b, 711 | a: ((rgb2.a - rgb1.a) * p) + rgb1.a 712 | }; 713 | 714 | return tinycolor(rgba); 715 | }; 716 | 717 | // Readability Functions 718 | // --------------------- 719 | // false 738 | // tinycolor.isReadable("#000", "#111",{level:"AA",size:"large"}) => false 739 | tinycolor.isReadable = function(color1, color2, wcag2) { 740 | var readability = tinycolor.readability(color1, color2); 741 | var wcag2Parms, out; 742 | 743 | out = false; 744 | 745 | wcag2Parms = validateWCAG2Parms(wcag2); 746 | switch (wcag2Parms.level + wcag2Parms.size) { 747 | case "AAsmall": 748 | case "AAAlarge": 749 | out = readability >= 4.5; 750 | break; 751 | case "AAlarge": 752 | out = readability >= 3; 753 | break; 754 | case "AAAsmall": 755 | out = readability >= 7; 756 | break; 757 | } 758 | return out; 759 | 760 | }; 761 | 762 | // mostReadable 763 | // Given a base color and a list of possible foreground or background 764 | // colors for that base, returns the most readable color. 765 | // Optionally returns Black or White if the most readable color is unreadable. 766 | // *Example* 767 | // tinycolor.mostReadable(tinycolor.mostReadable("#123", ["#124", "#125"],{includeFallbackColors:false}).toHexString(); // "#112255" 768 | // tinycolor.mostReadable(tinycolor.mostReadable("#123", ["#124", "#125"],{includeFallbackColors:true}).toHexString(); // "#ffffff" 769 | // tinycolor.mostReadable("#a8015a", ["#faf3f3"],{includeFallbackColors:true,level:"AAA",size:"large"}).toHexString(); // "#faf3f3" 770 | // tinycolor.mostReadable("#a8015a", ["#faf3f3"],{includeFallbackColors:true,level:"AAA",size:"small"}).toHexString(); // "#ffffff" 771 | tinycolor.mostReadable = function(baseColor, colorList, args) { 772 | var bestColor = null; 773 | var bestScore = 0; 774 | var readability; 775 | var includeFallbackColors, level, size ; 776 | args = args || {}; 777 | includeFallbackColors = args.includeFallbackColors ; 778 | level = args.level; 779 | size = args.size; 780 | 781 | for (var i= 0; i < colorList.length ; i++) { 782 | readability = tinycolor.readability(baseColor, colorList[i]); 783 | if (readability > bestScore) { 784 | bestScore = readability; 785 | bestColor = tinycolor(colorList[i]); 786 | } 787 | } 788 | 789 | if (tinycolor.isReadable(baseColor, bestColor, {"level":level,"size":size}) || !includeFallbackColors) { 790 | return bestColor; 791 | } 792 | else { 793 | args.includeFallbackColors=false; 794 | return tinycolor.mostReadable(baseColor,["#fff", "#000"],args); 795 | } 796 | }; 797 | 798 | // Big List of Colors 799 | // ------------------ 800 | // 801 | var names = tinycolor.names = { 802 | aliceblue: "f0f8ff", 803 | antiquewhite: "faebd7", 804 | aqua: "0ff", 805 | aquamarine: "7fffd4", 806 | azure: "f0ffff", 807 | beige: "f5f5dc", 808 | bisque: "ffe4c4", 809 | black: "000", 810 | blanchedalmond: "ffebcd", 811 | blue: "00f", 812 | blueviolet: "8a2be2", 813 | brown: "a52a2a", 814 | burlywood: "deb887", 815 | burntsienna: "ea7e5d", 816 | cadetblue: "5f9ea0", 817 | chartreuse: "7fff00", 818 | chocolate: "d2691e", 819 | coral: "ff7f50", 820 | cornflowerblue: "6495ed", 821 | cornsilk: "fff8dc", 822 | crimson: "dc143c", 823 | cyan: "0ff", 824 | darkblue: "00008b", 825 | darkcyan: "008b8b", 826 | darkgoldenrod: "b8860b", 827 | darkgray: "a9a9a9", 828 | darkgreen: "006400", 829 | darkgrey: "a9a9a9", 830 | darkkhaki: "bdb76b", 831 | darkmagenta: "8b008b", 832 | darkolivegreen: "556b2f", 833 | darkorange: "ff8c00", 834 | darkorchid: "9932cc", 835 | darkred: "8b0000", 836 | darksalmon: "e9967a", 837 | darkseagreen: "8fbc8f", 838 | darkslateblue: "483d8b", 839 | darkslategray: "2f4f4f", 840 | darkslategrey: "2f4f4f", 841 | darkturquoise: "00ced1", 842 | darkviolet: "9400d3", 843 | deeppink: "ff1493", 844 | deepskyblue: "00bfff", 845 | dimgray: "696969", 846 | dimgrey: "696969", 847 | dodgerblue: "1e90ff", 848 | firebrick: "b22222", 849 | floralwhite: "fffaf0", 850 | forestgreen: "228b22", 851 | fuchsia: "f0f", 852 | gainsboro: "dcdcdc", 853 | ghostwhite: "f8f8ff", 854 | gold: "ffd700", 855 | goldenrod: "daa520", 856 | gray: "808080", 857 | green: "008000", 858 | greenyellow: "adff2f", 859 | grey: "808080", 860 | honeydew: "f0fff0", 861 | hotpink: "ff69b4", 862 | indianred: "cd5c5c", 863 | indigo: "4b0082", 864 | ivory: "fffff0", 865 | khaki: "f0e68c", 866 | lavender: "e6e6fa", 867 | lavenderblush: "fff0f5", 868 | lawngreen: "7cfc00", 869 | lemonchiffon: "fffacd", 870 | lightblue: "add8e6", 871 | lightcoral: "f08080", 872 | lightcyan: "e0ffff", 873 | lightgoldenrodyellow: "fafad2", 874 | lightgray: "d3d3d3", 875 | lightgreen: "90ee90", 876 | lightgrey: "d3d3d3", 877 | lightpink: "ffb6c1", 878 | lightsalmon: "ffa07a", 879 | lightseagreen: "20b2aa", 880 | lightskyblue: "87cefa", 881 | lightslategray: "789", 882 | lightslategrey: "789", 883 | lightsteelblue: "b0c4de", 884 | lightyellow: "ffffe0", 885 | lime: "0f0", 886 | limegreen: "32cd32", 887 | linen: "faf0e6", 888 | magenta: "f0f", 889 | maroon: "800000", 890 | mediumaquamarine: "66cdaa", 891 | mediumblue: "0000cd", 892 | mediumorchid: "ba55d3", 893 | mediumpurple: "9370db", 894 | mediumseagreen: "3cb371", 895 | mediumslateblue: "7b68ee", 896 | mediumspringgreen: "00fa9a", 897 | mediumturquoise: "48d1cc", 898 | mediumvioletred: "c71585", 899 | midnightblue: "191970", 900 | mintcream: "f5fffa", 901 | mistyrose: "ffe4e1", 902 | moccasin: "ffe4b5", 903 | navajowhite: "ffdead", 904 | navy: "000080", 905 | oldlace: "fdf5e6", 906 | olive: "808000", 907 | olivedrab: "6b8e23", 908 | orange: "ffa500", 909 | orangered: "ff4500", 910 | orchid: "da70d6", 911 | palegoldenrod: "eee8aa", 912 | palegreen: "98fb98", 913 | paleturquoise: "afeeee", 914 | palevioletred: "db7093", 915 | papayawhip: "ffefd5", 916 | peachpuff: "ffdab9", 917 | peru: "cd853f", 918 | pink: "ffc0cb", 919 | plum: "dda0dd", 920 | powderblue: "b0e0e6", 921 | purple: "800080", 922 | rebeccapurple: "663399", 923 | red: "f00", 924 | rosybrown: "bc8f8f", 925 | royalblue: "4169e1", 926 | saddlebrown: "8b4513", 927 | salmon: "fa8072", 928 | sandybrown: "f4a460", 929 | seagreen: "2e8b57", 930 | seashell: "fff5ee", 931 | sienna: "a0522d", 932 | silver: "c0c0c0", 933 | skyblue: "87ceeb", 934 | slateblue: "6a5acd", 935 | slategray: "708090", 936 | slategrey: "708090", 937 | snow: "fffafa", 938 | springgreen: "00ff7f", 939 | steelblue: "4682b4", 940 | tan: "d2b48c", 941 | teal: "008080", 942 | thistle: "d8bfd8", 943 | tomato: "ff6347", 944 | turquoise: "40e0d0", 945 | violet: "ee82ee", 946 | wheat: "f5deb3", 947 | white: "fff", 948 | whitesmoke: "f5f5f5", 949 | yellow: "ff0", 950 | yellowgreen: "9acd32" 951 | }; 952 | 953 | // Make it easy to access colors via hexNames[hex] 954 | var hexNames = tinycolor.hexNames = flip(names); 955 | 956 | // Utilities 957 | // --------- 958 | 959 | // { 'name1': 'val1' } becomes { 'val1': 'name1' } 960 | function flip(o) { 961 | var flipped = { }; 962 | for (var i in o) { 963 | if (o.hasOwnProperty(i)) { 964 | flipped[o[i]] = i; 965 | } 966 | } 967 | return flipped; 968 | } 969 | 970 | // Return a valid alpha value [0,1] with all invalid values being set to 1 971 | function boundAlpha(a) { 972 | a = parseFloat(a); 973 | 974 | if (isNaN(a) || a < 0 || a > 1) { 975 | a = 1; 976 | } 977 | 978 | return a; 979 | } 980 | 981 | // Take input from [0, n] and return it as [0, 1] 982 | function bound01(n, max) { 983 | if (isOnePointZero(n)) { n = "100%"; } 984 | 985 | var processPercent = isPercentage(n); 986 | n = mathMin(max, mathMax(0, parseFloat(n))); 987 | 988 | // Automatically convert percentage into number 989 | if (processPercent) { 990 | n = parseInt(n * max, 10) / 100; 991 | } 992 | 993 | // Handle floating point rounding errors 994 | if ((Math.abs(n - max) < 0.000001)) { 995 | return 1; 996 | } 997 | 998 | // Convert into [0, 1] range if it isn't already 999 | return (n % max) / parseFloat(max); 1000 | } 1001 | 1002 | // Force a number between 0 and 1 1003 | function clamp01(val) { 1004 | return mathMin(1, mathMax(0, val)); 1005 | } 1006 | 1007 | // Parse a base-16 hex value into a base-10 integer 1008 | function parseIntFromHex(val) { 1009 | return parseInt(val, 16); 1010 | } 1011 | 1012 | // Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1 1013 | // 1014 | function isOnePointZero(n) { 1015 | return typeof n == "string" && n.indexOf('.') != -1 && parseFloat(n) === 1; 1016 | } 1017 | 1018 | // Check to see if string passed in is a percentage 1019 | function isPercentage(n) { 1020 | return typeof n === "string" && n.indexOf('%') != -1; 1021 | } 1022 | 1023 | // Force a hex value to have 2 characters 1024 | function pad2(c) { 1025 | return c.length == 1 ? '0' + c : '' + c; 1026 | } 1027 | 1028 | // Replace a decimal with it's percentage value 1029 | function convertToPercentage(n) { 1030 | if (n <= 1) { 1031 | n = (n * 100) + "%"; 1032 | } 1033 | 1034 | return n; 1035 | } 1036 | 1037 | // Converts a decimal to a hex value 1038 | function convertDecimalToHex(d) { 1039 | return Math.round(parseFloat(d) * 255).toString(16); 1040 | } 1041 | // Converts a hex value to a decimal 1042 | function convertHexToDecimal(h) { 1043 | return (parseIntFromHex(h) / 255); 1044 | } 1045 | 1046 | var matchers = (function() { 1047 | 1048 | // 1049 | var CSS_INTEGER = "[-\\+]?\\d+%?"; 1050 | 1051 | // 1052 | var CSS_NUMBER = "[-\\+]?\\d*\\.\\d+%?"; 1053 | 1054 | // Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome. 1055 | var CSS_UNIT = "(?:" + CSS_NUMBER + ")|(?:" + CSS_INTEGER + ")"; 1056 | 1057 | // Actual matching. 1058 | // Parentheses and commas are optional, but not required. 1059 | // Whitespace can take the place of commas or opening paren 1060 | var PERMISSIVE_MATCH3 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?"; 1061 | var PERMISSIVE_MATCH4 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?"; 1062 | 1063 | return { 1064 | CSS_UNIT: new RegExp(CSS_UNIT), 1065 | rgb: new RegExp("rgb" + PERMISSIVE_MATCH3), 1066 | rgba: new RegExp("rgba" + PERMISSIVE_MATCH4), 1067 | hsl: new RegExp("hsl" + PERMISSIVE_MATCH3), 1068 | hsla: new RegExp("hsla" + PERMISSIVE_MATCH4), 1069 | hsv: new RegExp("hsv" + PERMISSIVE_MATCH3), 1070 | hsva: new RegExp("hsva" + PERMISSIVE_MATCH4), 1071 | hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, 1072 | hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/, 1073 | hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, 1074 | hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/ 1075 | }; 1076 | })(); 1077 | 1078 | // isValidCSSUnit 1079 | // Take in a single string / number and check to see if it looks like a CSS unit 1080 | // (see matchers above for definition). 1081 | function isValidCSSUnit(color) { 1082 | return !!matchers.CSS_UNIT.exec(color); 1083 | } 1084 | 1085 | // stringInputToObject 1086 | // Permissive string parsing. Take in a number of formats, and output an object 1087 | // based on detected format. Returns { r, g, b } or { h, s, l } or { h, s, v} 1088 | function stringInputToObject(color) { 1089 | 1090 | color = color.replace(trimLeft, '').replace(trimRight, '').toLowerCase(); 1091 | var named = false; 1092 | if (names[color]) { 1093 | color = names[color]; 1094 | named = true; 1095 | } 1096 | else if (color == 'transparent') { 1097 | return { r: 0, g: 0, b: 0, a: 0, format: "name" }; 1098 | } 1099 | 1100 | // Try to match string input using regular expressions. 1101 | // Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360] 1102 | // Just return an object and let the conversion functions handle that. 1103 | // This way the result will be the same whether the tinycolor is initialized with string or object. 1104 | var match; 1105 | if ((match = matchers.rgb.exec(color))) { 1106 | return { r: match[1], g: match[2], b: match[3] }; 1107 | } 1108 | if ((match = matchers.rgba.exec(color))) { 1109 | return { r: match[1], g: match[2], b: match[3], a: match[4] }; 1110 | } 1111 | if ((match = matchers.hsl.exec(color))) { 1112 | return { h: match[1], s: match[2], l: match[3] }; 1113 | } 1114 | if ((match = matchers.hsla.exec(color))) { 1115 | return { h: match[1], s: match[2], l: match[3], a: match[4] }; 1116 | } 1117 | if ((match = matchers.hsv.exec(color))) { 1118 | return { h: match[1], s: match[2], v: match[3] }; 1119 | } 1120 | if ((match = matchers.hsva.exec(color))) { 1121 | return { h: match[1], s: match[2], v: match[3], a: match[4] }; 1122 | } 1123 | if ((match = matchers.hex8.exec(color))) { 1124 | return { 1125 | r: parseIntFromHex(match[1]), 1126 | g: parseIntFromHex(match[2]), 1127 | b: parseIntFromHex(match[3]), 1128 | a: convertHexToDecimal(match[4]), 1129 | format: named ? "name" : "hex8" 1130 | }; 1131 | } 1132 | if ((match = matchers.hex6.exec(color))) { 1133 | return { 1134 | r: parseIntFromHex(match[1]), 1135 | g: parseIntFromHex(match[2]), 1136 | b: parseIntFromHex(match[3]), 1137 | format: named ? "name" : "hex" 1138 | }; 1139 | } 1140 | if ((match = matchers.hex4.exec(color))) { 1141 | return { 1142 | r: parseIntFromHex(match[1] + '' + match[1]), 1143 | g: parseIntFromHex(match[2] + '' + match[2]), 1144 | b: parseIntFromHex(match[3] + '' + match[3]), 1145 | a: convertHexToDecimal(match[4] + '' + match[4]), 1146 | format: named ? "name" : "hex8" 1147 | }; 1148 | } 1149 | if ((match = matchers.hex3.exec(color))) { 1150 | return { 1151 | r: parseIntFromHex(match[1] + '' + match[1]), 1152 | g: parseIntFromHex(match[2] + '' + match[2]), 1153 | b: parseIntFromHex(match[3] + '' + match[3]), 1154 | format: named ? "name" : "hex" 1155 | }; 1156 | } 1157 | 1158 | return false; 1159 | } 1160 | 1161 | function validateWCAG2Parms(parms) { 1162 | // return valid WCAG2 parms for isReadable. 1163 | // If input parms are invalid, return {"level":"AA", "size":"small"} 1164 | var level, size; 1165 | parms = parms || {"level":"AA", "size":"small"}; 1166 | level = (parms.level || "AA").toUpperCase(); 1167 | size = (parms.size || "small").toLowerCase(); 1168 | if (level !== "AA" && level !== "AAA") { 1169 | level = "AA"; 1170 | } 1171 | if (size !== "small" && size !== "large") { 1172 | size = "small"; 1173 | } 1174 | return {"level":level, "size":size}; 1175 | } 1176 | 1177 | this.tinycolor = tinycolor; 1178 | 1179 | })()`; 1180 | } 1181 | // It is hacky way to make this function will be compiled preferentially by less 1182 | // resolve error: `ReferenceError: colorPalette is not defined` 1183 | // https://github.com/ant-design/ant-motion/issues/44 1184 | .tinyColorMixin(); 1185 | -------------------------------------------------------------------------------- /src/data/city_province.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": 1000, 4 | "key": "bj", 5 | "value": "北京" 6 | }, 7 | { 8 | "id": 3000, 9 | "key": "tj", 10 | "value": "天津" 11 | }, 12 | { 13 | "id": 13000, 14 | "key": "hb", 15 | "value": "河北", 16 | "children": [ 17 | { 18 | "id": 13327, 19 | "key": "sjz", 20 | "value": "石家庄" 21 | }, 22 | { 23 | "id": 13329, 24 | "key": "ts", 25 | "value": "唐山" 26 | }, 27 | { 28 | "id": 13325, 29 | "key": "qhd", 30 | "value": "秦皇岛" 31 | }, 32 | { 33 | "id": 13330, 34 | "key": "hd", 35 | "value": "邯郸" 36 | }, 37 | { 38 | "id": 13326, 39 | "key": "xt", 40 | "value": "邢台" 41 | }, 42 | { 43 | "id": 13331, 44 | "key": "zjk", 45 | "value": "张家口" 46 | }, 47 | { 48 | "id": 13306, 49 | "key": "cd", 50 | "value": "承德" 51 | }, 52 | { 53 | "id": 13307, 54 | "key": "lf", 55 | "value": "廊坊" 56 | }, 57 | { 58 | "id": 13332, 59 | "key": "hs", 60 | "value": "衡水" 61 | }, 62 | { 63 | "id": 13305, 64 | "key": "cz", 65 | "value": "沧州" 66 | }, 67 | { 68 | "id": 13304, 69 | "key": "bd", 70 | "value": "保定" 71 | } 72 | ] 73 | }, 74 | { 75 | "id": 26000, 76 | "key": "sx", 77 | "value": "山西", 78 | "children": [ 79 | { 80 | "id": 26214, 81 | "key": "ty", 82 | "value": "太原" 83 | }, 84 | { 85 | "id": 26217, 86 | "key": "dt", 87 | "value": "大同" 88 | }, 89 | { 90 | "id": 26215, 91 | "key": "yq", 92 | "value": "阳泉" 93 | }, 94 | { 95 | "id": 26209, 96 | "key": "cz", 97 | "value": "长治" 98 | }, 99 | { 100 | "id": 26205, 101 | "key": "jz", 102 | "value": "晋城" 103 | }, 104 | { 105 | "id": 26213, 106 | "key": "sz", 107 | "value": "朔州" 108 | }, 109 | { 110 | "id": 26206, 111 | "key": "jz", 112 | "value": "晋中" 113 | }, 114 | { 115 | "id": 26216, 116 | "key": "yc", 117 | "value": "运城" 118 | }, 119 | { 120 | "id": 26212, 121 | "key": "xz", 122 | "value": "忻州" 123 | }, 124 | { 125 | "id": 26211, 126 | "key": "lf", 127 | "value": "临汾" 128 | }, 129 | { 130 | "id": 26210, 131 | "key": "ll", 132 | "value": "吕梁" 133 | } 134 | ] 135 | }, 136 | { 137 | "id": 22000, 138 | "key": "nmg", 139 | "value": "内蒙古", 140 | "children": [ 141 | { 142 | "id": 22167, 143 | "key": "hhkt", 144 | "value": "呼和浩特" 145 | }, 146 | { 147 | "id": 22169, 148 | "key": "bt", 149 | "value": "包头" 150 | }, 151 | { 152 | "id": 22164, 153 | "key": "wk", 154 | "value": "乌海" 155 | }, 156 | { 157 | "id": 22158, 158 | "key": "cf", 159 | "value": "赤峰" 160 | }, 161 | { 162 | "id": 22161, 163 | "key": "tl", 164 | "value": "通辽" 165 | }, 166 | { 167 | "id": 22168, 168 | "key": "eeds", 169 | "value": "鄂尔多斯" 170 | }, 171 | { 172 | "id": 22166, 173 | "key": "hlbe", 174 | "value": "呼伦贝尔" 175 | }, 176 | { 177 | "id": 22163, 178 | "key": "wlcb", 179 | "value": "乌兰察布" 180 | }, 181 | { 182 | "id": 22165, 183 | "key": "xlgl", 184 | "value": "锡林郭勒盟" 185 | }, 186 | { 187 | "id": 22162, 188 | "key": "byze", 189 | "value": "巴彦淖尔" 190 | }, 191 | { 192 | "id": 22159, 193 | "key": "als", 194 | "value": "阿拉善盟" 195 | }, 196 | { 197 | "id": 22160, 198 | "key": "xam", 199 | "value": "兴安盟" 200 | } 201 | ] 202 | }, 203 | { 204 | "id": 18000, 205 | "key": "jl", 206 | "value": "吉林", 207 | "children": [ 208 | { 209 | "id": 18040, 210 | "key": "cc", 211 | "value": "长春" 212 | }, 213 | { 214 | "id": 18038, 215 | "key": "jl", 216 | "value": "吉林" 217 | }, 218 | { 219 | "id": 18043, 220 | "key": "sp", 221 | "value": "四平" 222 | }, 223 | { 224 | "id": 18041, 225 | "key": "ly", 226 | "value": "辽源" 227 | }, 228 | { 229 | "id": 18045, 230 | "key": "th", 231 | "value": "通化" 232 | }, 233 | { 234 | "id": 18042, 235 | "key": "bs", 236 | "value": "白山" 237 | }, 238 | { 239 | "id": 18047, 240 | "key": "yb", 241 | "value": "延边" 242 | }, 243 | { 244 | "id": 18039, 245 | "key": "bc", 246 | "value": "白城" 247 | }, 248 | { 249 | "id": 18044, 250 | "key": "sy", 251 | "value": "松原" 252 | } 253 | ] 254 | }, 255 | { 256 | "id": 21000, 257 | "key": "ll", 258 | "value": "辽宁", 259 | "children": [ 260 | { 261 | "id": 21153, 262 | "key": "sy", 263 | "value": "沈阳" 264 | }, 265 | { 266 | "id": 21155, 267 | "key": "dl", 268 | "value": "大连" 269 | }, 270 | { 271 | "id": 21151, 272 | "key": "as", 273 | "value": "鞍山" 274 | }, 275 | { 276 | "id": 21152, 277 | "key": "fs", 278 | "value": "抚顺" 279 | }, 280 | { 281 | "id": 21145, 282 | "key": "bx", 283 | "value": "本溪" 284 | }, 285 | { 286 | "id": 21144, 287 | "key": "dd", 288 | "value": "丹东" 289 | }, 290 | { 291 | "id": 21146, 292 | "key": "jz", 293 | "value": "锦州" 294 | }, 295 | { 296 | "id": 21157, 297 | "key": "hld", 298 | "value": "葫芦岛" 299 | }, 300 | { 301 | "id": 21156, 302 | "key": "yk", 303 | "value": "营口" 304 | }, 305 | { 306 | "id": 21149, 307 | "key": "pj", 308 | "value": "盘锦" 309 | }, 310 | { 311 | "id": 21150, 312 | "key": "fx", 313 | "value": "阜新" 314 | }, 315 | { 316 | "id": 21148, 317 | "key": "ly", 318 | "value": "辽阳" 319 | }, 320 | { 321 | "id": 21154, 322 | "key": "tl", 323 | "value": "铁岭" 324 | }, 325 | { 326 | "id": 21147, 327 | "key": "zy", 328 | "value": "朝阳" 329 | } 330 | ] 331 | }, 332 | { 333 | "id": 15000, 334 | "key": "hlj", 335 | "value": "黑龙江", 336 | "children": [ 337 | { 338 | "id": 15335, 339 | "key": "heb", 340 | "value": "哈尔滨" 341 | }, 342 | { 343 | "id": 15337, 344 | "key": "qqhe", 345 | "value": "齐齐哈尔" 346 | }, 347 | { 348 | "id": 15344, 349 | "key": "hg", 350 | "value": "鹤岗" 351 | }, 352 | { 353 | "id": 15340, 354 | "key": "sys", 355 | "value": "双鸭山" 356 | }, 357 | { 358 | "id": 15333, 359 | "key": "jx", 360 | "value": "鸡西" 361 | }, 362 | { 363 | "id": 15342, 364 | "key": "dq", 365 | "value": "大庆" 366 | }, 367 | { 368 | "id": 15341, 369 | "key": "yc", 370 | "value": "伊春" 371 | }, 372 | { 373 | "id": 15336, 374 | "key": "mdj", 375 | "value": "牡丹江" 376 | }, 377 | { 378 | "id": 15334, 379 | "key": "jms", 380 | "value": "佳木斯" 381 | }, 382 | { 383 | "id": 15338, 384 | "key": "qth", 385 | "value": "七台河" 386 | }, 387 | { 388 | "id": 15345, 389 | "key": "hh", 390 | "value": "黑河" 391 | }, 392 | { 393 | "id": 15339, 394 | "key": "nh", 395 | "value": "绥化" 396 | }, 397 | { 398 | "id": 15343, 399 | "key": "dxal", 400 | "value": "大兴安岭" 401 | } 402 | ] 403 | }, 404 | { 405 | "id": 2000, 406 | "key": "sh", 407 | "value": "上海" 408 | }, 409 | { 410 | "id": 5000, 411 | "key": "fj", 412 | "value": "福建", 413 | "children": [ 414 | { 415 | "id": 5081, 416 | "key": "fz", 417 | "value": "福州" 418 | }, 419 | { 420 | "id": 5070, 421 | "key": "xm", 422 | "value": "厦门" 423 | }, 424 | { 425 | "id": 5066, 426 | "key": "sm", 427 | "value": "三明" 428 | }, 429 | { 430 | "id": 5048, 431 | "key": "pt", 432 | "value": "莆田" 433 | }, 434 | { 435 | "id": 5052, 436 | "key": "qz", 437 | "value": "泉州" 438 | }, 439 | { 440 | "id": 5080, 441 | "key": "zz", 442 | "value": "漳州" 443 | }, 444 | { 445 | "id": 5049, 446 | "key": "np", 447 | "value": "南平" 448 | }, 449 | { 450 | "id": 5050, 451 | "key": "ly", 452 | "value": "龙岩" 453 | }, 454 | { 455 | "id": 5051, 456 | "key": "nd", 457 | "value": "宁德" 458 | } 459 | ] 460 | }, 461 | { 462 | "id": 9000, 463 | "key": "ah", 464 | "value": "安徽", 465 | "children": [ 466 | { 467 | "id": 9142, 468 | "key": "hf", 469 | "value": "合肥" 470 | }, 471 | { 472 | "id": 9139, 473 | "key": "wh", 474 | "value": "芜湖" 475 | }, 476 | { 477 | "id": 9141, 478 | "key": "bb", 479 | "value": "蚌埠" 480 | }, 481 | { 482 | "id": 9133, 483 | "key": "hn", 484 | "value": "淮南" 485 | }, 486 | { 487 | "id": 9134, 488 | "key": "mas", 489 | "value": "马鞍山" 490 | }, 491 | { 492 | "id": 9127, 493 | "key": "hb", 494 | "value": "淮北" 495 | }, 496 | { 497 | "id": 9138, 498 | "key": "tl", 499 | "value": "铜陵" 500 | }, 501 | { 502 | "id": 9128, 503 | "key": "aq", 504 | "value": "安庆" 505 | }, 506 | { 507 | "id": 9132, 508 | "key": "hs", 509 | "value": "黄山" 510 | }, 511 | { 512 | "id": 9131, 513 | "key": "cz", 514 | "value": "滁州" 515 | }, 516 | { 517 | "id": 9140, 518 | "key": "fy", 519 | "value": "阜阳" 520 | }, 521 | { 522 | "id": 9137, 523 | "key": "sz", 524 | "value": "宿州" 525 | }, 526 | { 527 | "id": 9135, 528 | "key": "la", 529 | "value": "六安" 530 | }, 531 | { 532 | "id": 9143, 533 | "key": "hz", 534 | "value": "亳州" 535 | }, 536 | { 537 | "id": 9130, 538 | "key": "cz", 539 | "value": "池州" 540 | }, 541 | { 542 | "id": 9136, 543 | "key": "xc", 544 | "value": "宣城" 545 | } 546 | ] 547 | }, 548 | { 549 | "id": 19000, 550 | "key": "js", 551 | "value": "江苏", 552 | "children": [ 553 | { 554 | "id": 19055, 555 | "key": "nj", 556 | "value": "南京" 557 | }, 558 | { 559 | "id": 19058, 560 | "key": "xz", 561 | "value": "徐州" 562 | }, 563 | { 564 | "id": 19057, 565 | "key": "lyg", 566 | "value": "连云港" 567 | }, 568 | { 569 | "id": 19053, 570 | "key": "ha", 571 | "value": "淮安" 572 | }, 573 | { 574 | "id": 19060, 575 | "key": "sq", 576 | "value": "宿迁" 577 | }, 578 | { 579 | "id": 19063, 580 | "key": "yc", 581 | "value": "盐城" 582 | }, 583 | { 584 | "id": 19064, 585 | "key": "yz", 586 | "value": "扬州" 587 | }, 588 | { 589 | "id": 19061, 590 | "key": "tz", 591 | "value": "泰州" 592 | }, 593 | { 594 | "id": 19056, 595 | "key": "nt", 596 | "value": "南通" 597 | }, 598 | { 599 | "id": 19065, 600 | "key": "zj", 601 | "value": "镇江" 602 | }, 603 | { 604 | "id": 19054, 605 | "key": "cz", 606 | "value": "常州" 607 | }, 608 | { 609 | "id": 19062, 610 | "key": "wx", 611 | "value": "无锡" 612 | }, 613 | { 614 | "id": 19059, 615 | "key": "sz", 616 | "value": "苏州" 617 | } 618 | ] 619 | }, 620 | { 621 | "id": 20000, 622 | "key": "jx", 623 | "value": "江西", 624 | "children": [ 625 | { 626 | "id": 20072, 627 | "key": "nc", 628 | "value": "南昌" 629 | }, 630 | { 631 | "id": 20069, 632 | "key": "jd", 633 | "value": "景德镇" 634 | }, 635 | { 636 | "id": 20071, 637 | "key": "px", 638 | "value": "萍乡" 639 | }, 640 | { 641 | "id": 20067, 642 | "key": "jj", 643 | "value": "九江" 644 | }, 645 | { 646 | "id": 20073, 647 | "key": "xy", 648 | "value": "新余" 649 | }, 650 | { 651 | "id": 20076, 652 | "key": "yt", 653 | "value": "鹰潭" 654 | }, 655 | { 656 | "id": 20077, 657 | "key": "gz", 658 | "value": "赣州" 659 | }, 660 | { 661 | "id": 20068, 662 | "key": "ja", 663 | "value": "吉安" 664 | }, 665 | { 666 | "id": 20075, 667 | "key": "yc", 668 | "value": "宜春" 669 | }, 670 | { 671 | "id": 20078, 672 | "key": "fz", 673 | "value": "抚州" 674 | }, 675 | { 676 | "id": 20074, 677 | "key": "sr", 678 | "value": "上饶" 679 | } 680 | ] 681 | }, 682 | { 683 | "id": 25000, 684 | "key": "sd", 685 | "value": "山东", 686 | "children": [ 687 | { 688 | "id": 25196, 689 | "key": "jn", 690 | "value": "济南" 691 | }, 692 | { 693 | "id": 25202, 694 | "key": "qd", 695 | "value": "青岛" 696 | }, 697 | { 698 | "id": 25207, 699 | "key": "zb", 700 | "value": "淄博" 701 | }, 702 | { 703 | "id": 25221, 704 | "key": "zz", 705 | "value": "枣庄" 706 | }, 707 | { 708 | "id": 25220, 709 | "key": "dy", 710 | "value": "东营" 711 | }, 712 | { 713 | "id": 25204, 714 | "key": "wf", 715 | "value": "潍坊" 716 | }, 717 | { 718 | "id": 25219, 719 | "key": "yt", 720 | "value": "烟台" 721 | }, 722 | { 723 | "id": 25218, 724 | "key": "wh", 725 | "value": "威海" 726 | }, 727 | { 728 | "id": 25197, 729 | "key": "jn", 730 | "value": "济宁" 731 | }, 732 | { 733 | "id": 25208, 734 | "key": "ta", 735 | "value": "泰安" 736 | }, 737 | { 738 | "id": 25203, 739 | "key": "rz", 740 | "value": "日照" 741 | }, 742 | { 743 | "id": 25198, 744 | "key": "lw", 745 | "value": "莱芜" 746 | }, 747 | { 748 | "id": 25201, 749 | "key": "ly", 750 | "value": "临沂" 751 | }, 752 | { 753 | "id": 25200, 754 | "key": "dz", 755 | "value": "德州" 756 | }, 757 | { 758 | "id": 25199, 759 | "key": "lc", 760 | "value": "聊城" 761 | }, 762 | { 763 | "id": 25223, 764 | "key": "bz", 765 | "value": "滨州" 766 | }, 767 | { 768 | "id": 25222, 769 | "key": "hz", 770 | "value": "菏泽" 771 | } 772 | ] 773 | }, 774 | { 775 | "id": 32000, 776 | "key": "zj", 777 | "value": "浙江", 778 | "children": [ 779 | { 780 | "id": 32280, 781 | "key": "hz", 782 | "value": "杭州" 783 | }, 784 | { 785 | "id": 32276, 786 | "key": "nb", 787 | "value": "宁波" 788 | }, 789 | { 790 | "id": 32278, 791 | "key": "wz", 792 | "value": "温州" 793 | }, 794 | { 795 | "id": 32273, 796 | "key": "jx", 797 | "value": "嘉兴" 798 | }, 799 | { 800 | "id": 32282, 801 | "key": "hz", 802 | "value": "湖州" 803 | }, 804 | { 805 | "id": 32277, 806 | "key": "sx", 807 | "value": "绍兴" 808 | }, 809 | { 810 | "id": 32272, 811 | "key": "jh", 812 | "value": "金华" 813 | }, 814 | { 815 | "id": 32274, 816 | "key": "qz", 817 | "value": "衢州" 818 | }, 819 | { 820 | "id": 32281, 821 | "key": "zs", 822 | "value": "舟山" 823 | }, 824 | { 825 | "id": 32279, 826 | "key": "tz", 827 | "value": "台州" 828 | }, 829 | { 830 | "id": 32275, 831 | "key": "ls", 832 | "value": "丽水" 833 | } 834 | ] 835 | }, 836 | { 837 | "id": 14000, 838 | "key": "hn", 839 | "value": "河南", 840 | "children": [ 841 | { 842 | "id": 14322, 843 | "key": "zz", 844 | "value": "郑州" 845 | }, 846 | { 847 | "id": 14310, 848 | "key": "kf", 849 | "value": "开封" 850 | }, 851 | { 852 | "id": 14311, 853 | "key": "ly", 854 | "value": "洛阳" 855 | }, 856 | { 857 | "id": 14313, 858 | "key": "pds", 859 | "value": "平顶山" 860 | }, 861 | { 862 | "id": 14308, 863 | "key": "jz", 864 | "value": "焦作" 865 | }, 866 | { 867 | "id": 14323, 868 | "key": "hb", 869 | "value": "鹤壁" 870 | }, 871 | { 872 | "id": 14317, 873 | "key": "xx", 874 | "value": "新乡" 875 | }, 876 | { 877 | "id": 14309, 878 | "key": "ay", 879 | "value": "安阳" 880 | }, 881 | { 882 | "id": 14316, 883 | "key": "py", 884 | "value": "濮阳" 885 | }, 886 | { 887 | "id": 14319, 888 | "key": "xc", 889 | "value": "许昌" 890 | }, 891 | { 892 | "id": 14312, 893 | "key": "lh", 894 | "value": "漯河" 895 | }, 896 | { 897 | "id": 14321, 898 | "key": "smx", 899 | "value": "三门峡" 900 | }, 901 | { 902 | "id": 14315, 903 | "key": "ny", 904 | "value": "南阳" 905 | }, 906 | { 907 | "id": 14320, 908 | "key": "sq", 909 | "value": "商丘" 910 | }, 911 | { 912 | "id": 14318, 913 | "key": "xy", 914 | "value": "信阳" 915 | }, 916 | { 917 | "id": 14324, 918 | "key": "zk", 919 | "value": "周口" 920 | }, 921 | { 922 | "id": 14314, 923 | "key": "zmd", 924 | "value": "驻马店" 925 | }, 926 | { 927 | "id": 14476, 928 | "key": "jy", 929 | "value": "济源" 930 | } 931 | ] 932 | }, 933 | { 934 | "id": 16000, 935 | "key": "hb", 936 | "value": "湖北", 937 | "children": [ 938 | { 939 | "id": 16371, 940 | "key": "wh", 941 | "value": "武汉" 942 | }, 943 | { 944 | "id": 16348, 945 | "key": "hs", 946 | "value": "黄石" 947 | }, 948 | { 949 | "id": 16370, 950 | "key": "xy", 951 | "value": "襄阳" 952 | }, 953 | { 954 | "id": 16369, 955 | "key": "sy", 956 | "value": "十堰" 957 | }, 958 | { 959 | "id": 16347, 960 | "key": "jz", 961 | "value": "荆州" 962 | }, 963 | { 964 | "id": 16376, 965 | "key": "yc", 966 | "value": "宜昌" 967 | }, 968 | { 969 | "id": 16346, 970 | "key": "jm", 971 | "value": "荆门" 972 | }, 973 | { 974 | "id": 16377, 975 | "key": "ez", 976 | "value": "鄂州" 977 | }, 978 | { 979 | "id": 16365, 980 | "key": "xg", 981 | "value": "孝感" 982 | }, 983 | { 984 | "id": 16349, 985 | "key": "hg", 986 | "value": "黄冈" 987 | }, 988 | { 989 | "id": 16375, 990 | "key": "xn", 991 | "value": "咸宁" 992 | }, 993 | { 994 | "id": 16367, 995 | "key": "sz", 996 | "value": "随州" 997 | }, 998 | { 999 | "id": 16366, 1000 | "key": "es", 1001 | "value": "恩施" 1002 | }, 1003 | { 1004 | "id": 16372, 1005 | "key": "xt", 1006 | "value": "仙桃" 1007 | }, 1008 | { 1009 | "id": 16373, 1010 | "key": "tm", 1011 | "value": "天门" 1012 | }, 1013 | { 1014 | "id": 16364, 1015 | "key": "qj", 1016 | "value": "潜江" 1017 | }, 1018 | { 1019 | "id": 16368, 1020 | "key": "slj", 1021 | "value": "神农架" 1022 | } 1023 | ] 1024 | }, 1025 | { 1026 | "id": 17000, 1027 | "key": "hn", 1028 | "value": "湖南", 1029 | "children": [ 1030 | { 1031 | "id": 17352, 1032 | "key": "cs", 1033 | "value": "长沙" 1034 | }, 1035 | { 1036 | "id": 17363, 1037 | "key": "zz", 1038 | "value": "株洲" 1039 | }, 1040 | { 1041 | "id": 17356, 1042 | "key": "xt", 1043 | "value": "湘潭" 1044 | }, 1045 | { 1046 | "id": 17360, 1047 | "key": "hy", 1048 | "value": "衡阳" 1049 | }, 1050 | { 1051 | "id": 17355, 1052 | "key": "sy", 1053 | "value": "邵阳" 1054 | }, 1055 | { 1056 | "id": 17361, 1057 | "key": "yy", 1058 | "value": "岳阳" 1059 | }, 1060 | { 1061 | "id": 17351, 1062 | "key": "cd", 1063 | "value": "常德" 1064 | }, 1065 | { 1066 | "id": 17358, 1067 | "key": "zjj", 1068 | "value": "张家界" 1069 | }, 1070 | { 1071 | "id": 17359, 1072 | "key": "yy", 1073 | "value": "益阳" 1074 | }, 1075 | { 1076 | "id": 17353, 1077 | "key": "cz", 1078 | "value": "郴州" 1079 | }, 1080 | { 1081 | "id": 17362, 1082 | "key": "yz", 1083 | "value": "永州" 1084 | }, 1085 | { 1086 | "id": 17350, 1087 | "key": "hh", 1088 | "value": "怀化" 1089 | }, 1090 | { 1091 | "id": 17354, 1092 | "key": "ld", 1093 | "value": "娄底" 1094 | }, 1095 | { 1096 | "id": 17357, 1097 | "key": "xx", 1098 | "value": "湘西" 1099 | } 1100 | ] 1101 | }, 1102 | { 1103 | "id": 4000, 1104 | "key": "gd", 1105 | "value": "广东", 1106 | "children": [ 1107 | { 1108 | "id": 4084, 1109 | "key": "gz", 1110 | "value": "广州" 1111 | }, 1112 | { 1113 | "id": 4093, 1114 | "key": "sz", 1115 | "value": "深圳" 1116 | }, 1117 | { 1118 | "id": 4113, 1119 | "key": "zh", 1120 | "value": "珠海" 1121 | }, 1122 | { 1123 | "id": 4091, 1124 | "key": "st", 1125 | "value": "汕头" 1126 | }, 1127 | { 1128 | "id": 4094, 1129 | "key": "sg", 1130 | "value": "韶关" 1131 | }, 1132 | { 1133 | "id": 4115, 1134 | "key": "hy", 1135 | "value": "河源" 1136 | }, 1137 | { 1138 | "id": 4088, 1139 | "key": "mz", 1140 | "value": "梅州" 1141 | }, 1142 | { 1143 | "id": 4092, 1144 | "key": "sw", 1145 | "value": "汕尾" 1146 | }, 1147 | { 1148 | "id": 4116, 1149 | "key": "dg", 1150 | "value": "东莞" 1151 | }, 1152 | { 1153 | "id": 4112, 1154 | "key": "zs", 1155 | "value": "中山" 1156 | }, 1157 | { 1158 | "id": 4082, 1159 | "key": "jm", 1160 | "value": "江门" 1161 | }, 1162 | { 1163 | "id": 4090, 1164 | "key": "fs", 1165 | "value": "佛山" 1166 | }, 1167 | { 1168 | "id": 4109, 1169 | "key": "yj", 1170 | "value": "阳江" 1171 | }, 1172 | { 1173 | "id": 4110, 1174 | "key": "zj", 1175 | "value": "湛江" 1176 | }, 1177 | { 1178 | "id": 4086, 1179 | "key": "mm", 1180 | "value": "茂名" 1181 | }, 1182 | { 1183 | "id": 4114, 1184 | "key": "zq", 1185 | "value": "肇庆" 1186 | }, 1187 | { 1188 | "id": 4089, 1189 | "key": "qy", 1190 | "value": "清远" 1191 | }, 1192 | { 1193 | "id": 4085, 1194 | "key": "cz", 1195 | "value": "潮州" 1196 | }, 1197 | { 1198 | "id": 4083, 1199 | "key": "jy", 1200 | "value": "揭阳" 1201 | }, 1202 | { 1203 | "id": 4111, 1204 | "key": "yf", 1205 | "value": "云浮" 1206 | }, 1207 | { 1208 | "id": 4117, 1209 | "key": "hz", 1210 | "value": "惠州" 1211 | } 1212 | ] 1213 | }, 1214 | { 1215 | "id": 8000, 1216 | "key": "hn", 1217 | "value": "海南", 1218 | "children": [ 1219 | { 1220 | "id": 8302, 1221 | "key": "hk", 1222 | "value": "海口" 1223 | }, 1224 | { 1225 | "id": 8298, 1226 | "key": "sy", 1227 | "value": "三亚" 1228 | }, 1229 | { 1230 | "id": 8299, 1231 | "key": "wc", 1232 | "value": "文昌" 1233 | }, 1234 | { 1235 | "id": 8297, 1236 | "key": "qh", 1237 | "value": "琼海" 1238 | }, 1239 | { 1240 | "id": 8301, 1241 | "key": "wn", 1242 | "value": "万宁" 1243 | }, 1244 | { 1245 | "id": 9300, 1246 | "key": "wzs", 1247 | "value": "五指山" 1248 | }, 1249 | { 1250 | "id": 8296, 1251 | "key": "df", 1252 | "value": "东方" 1253 | }, 1254 | { 1255 | "id": 8303, 1256 | "key": "zz", 1257 | "value": "儋州" 1258 | }, 1259 | { 1260 | "id": 8491, 1261 | "key": "lg", 1262 | "value": "临高" 1263 | }, 1264 | { 1265 | "id": 8487, 1266 | "key": "cm", 1267 | "value": "澄迈" 1268 | }, 1269 | { 1270 | "id": 8484, 1271 | "key": "da", 1272 | "value": "定安" 1273 | }, 1274 | { 1275 | "id": 8485, 1276 | "key": "tc", 1277 | "value": "屯昌" 1278 | }, 1279 | { 1280 | "id": 8492, 1281 | "key": "cj", 1282 | "value": "昌江" 1283 | }, 1284 | { 1285 | "id": 8493, 1286 | "key": "bs", 1287 | "value": "白沙" 1288 | }, 1289 | { 1290 | "id": 8489, 1291 | "key": "qz", 1292 | "value": "琼中" 1293 | }, 1294 | { 1295 | "id": 8486, 1296 | "key": "ls", 1297 | "value": "陵水" 1298 | }, 1299 | { 1300 | "id": 8488, 1301 | "key": "bt", 1302 | "value": "保亭" 1303 | }, 1304 | { 1305 | "id": 8490, 1306 | "key": "ld", 1307 | "value": "乐东" 1308 | } 1309 | ] 1310 | }, 1311 | { 1312 | "id": 12000, 1313 | "key": "gx", 1314 | "value": "广西", 1315 | "children": [ 1316 | { 1317 | "id": 12099, 1318 | "key": "nn", 1319 | "value": "南宁" 1320 | }, 1321 | { 1322 | "id": 12101, 1323 | "key": "lz", 1324 | "value": "柳州" 1325 | }, 1326 | { 1327 | "id": 12095, 1328 | "key": "gl", 1329 | "value": "桂林" 1330 | }, 1331 | { 1332 | "id": 12103, 1333 | "key": "wz", 1334 | "value": "梧州" 1335 | }, 1336 | { 1337 | "id": 12104, 1338 | "key": "bh", 1339 | "value": "北海" 1340 | }, 1341 | { 1342 | "id": 12098, 1343 | "key": "fcg", 1344 | "value": "防城港" 1345 | }, 1346 | { 1347 | "id": 12102, 1348 | "key": "jz", 1349 | "value": "钦州" 1350 | }, 1351 | { 1352 | "id": 12096, 1353 | "key": "gg", 1354 | "value": "贵港" 1355 | }, 1356 | { 1357 | "id": 12105, 1358 | "key": "yl", 1359 | "value": "玉林" 1360 | }, 1361 | { 1362 | "id": 12108, 1363 | "key": "bs", 1364 | "value": "百色" 1365 | }, 1366 | { 1367 | "id": 12107, 1368 | "key": "hz", 1369 | "value": "贺州" 1370 | }, 1371 | { 1372 | "id": 12106, 1373 | "key": "hc", 1374 | "value": "河池" 1375 | }, 1376 | { 1377 | "id": 12100, 1378 | "key": "lb", 1379 | "value": "来宾" 1380 | }, 1381 | { 1382 | "id": 12478, 1383 | "key": "cz", 1384 | "value": "崇左" 1385 | } 1386 | ] 1387 | }, 1388 | { 1389 | "id": 10000, 1390 | "key": "gz", 1391 | "value": "贵州", 1392 | "children": [ 1393 | { 1394 | "id": 10118, 1395 | "key": "gy", 1396 | "value": "贵阳" 1397 | }, 1398 | { 1399 | "id": 10120, 1400 | "key": "lps", 1401 | "value": "六盘水" 1402 | }, 1403 | { 1404 | "id": 10126, 1405 | "key": "zy", 1406 | "value": "遵义" 1407 | }, 1408 | { 1409 | "id": 10119, 1410 | "key": "as", 1411 | "value": "安顺" 1412 | }, 1413 | { 1414 | "id": 10125, 1415 | "key": "ty", 1416 | "value": "铜仁" 1417 | }, 1418 | { 1419 | "id": 10124, 1420 | "key": "bj", 1421 | "value": "毕节" 1422 | }, 1423 | { 1424 | "id": 10123, 1425 | "key": "qxn", 1426 | "value": "黔西南" 1427 | }, 1428 | { 1429 | "id": 10122, 1430 | "key": "qdn", 1431 | "value": "黔东南" 1432 | }, 1433 | { 1434 | "id": 10121, 1435 | "key": "qn", 1436 | "value": "黔南" 1437 | } 1438 | ] 1439 | }, 1440 | { 1441 | "id": 28000, 1442 | "key": "sc", 1443 | "value": "四川", 1444 | "children": [ 1445 | { 1446 | "id": 28226, 1447 | "key": "cd", 1448 | "value": "成都" 1449 | }, 1450 | { 1451 | "id": 28253, 1452 | "key": "zg", 1453 | "value": "自贡" 1454 | }, 1455 | { 1456 | "id": 28230, 1457 | "key": "fzh", 1458 | "value": "攀枝花" 1459 | }, 1460 | { 1461 | "id": 28234, 1462 | "key": "lz", 1463 | "value": "泸州" 1464 | }, 1465 | { 1466 | "id": 28232, 1467 | "key": "dy", 1468 | "value": "德阳" 1469 | }, 1470 | { 1471 | "id": 28229, 1472 | "key": "my", 1473 | "value": "绵阳" 1474 | }, 1475 | { 1476 | "id": 28225, 1477 | "key": "ggy", 1478 | "value": "广元" 1479 | }, 1480 | { 1481 | "id": 28237, 1482 | "key": "sn", 1483 | "value": "遂宁" 1484 | }, 1485 | { 1486 | "id": 28235, 1487 | "key": "nj", 1488 | "value": "内江" 1489 | }, 1490 | { 1491 | "id": 28233, 1492 | "key": "ls", 1493 | "value": "乐山" 1494 | }, 1495 | { 1496 | "id": 28231, 1497 | "key": "nc", 1498 | "value": "南充" 1499 | }, 1500 | { 1501 | "id": 28254, 1502 | "key": "yn", 1503 | "value": "宜宾" 1504 | }, 1505 | { 1506 | "id": 28224, 1507 | "key": "ga", 1508 | "value": "广安" 1509 | }, 1510 | { 1511 | "id": 28250, 1512 | "key": "dz", 1513 | "value": "达州" 1514 | }, 1515 | { 1516 | "id": 28227, 1517 | "key": "ms", 1518 | "value": "眉山" 1519 | }, 1520 | { 1521 | "id": 28251, 1522 | "key": "ya", 1523 | "value": "雅安" 1524 | }, 1525 | { 1526 | "id": 28247, 1527 | "key": "bz", 1528 | "value": "巴中" 1529 | }, 1530 | { 1531 | "id": 28238, 1532 | "key": "zy", 1533 | "value": "资阳" 1534 | }, 1535 | { 1536 | "id": 28252, 1537 | "key": "an", 1538 | "value": "阿坝" 1539 | }, 1540 | { 1541 | "id": 28236, 1542 | "key": "gz", 1543 | "value": "甘孜" 1544 | }, 1545 | { 1546 | "id": 28228, 1547 | "key": "ls", 1548 | "value": "凉山" 1549 | } 1550 | ] 1551 | }, 1552 | { 1553 | "id": 29000, 1554 | "key": "xz", 1555 | "value": "西藏", 1556 | "children": [ 1557 | { 1558 | "id": 29269, 1559 | "key": "ls", 1560 | "value": "拉萨" 1561 | }, 1562 | { 1563 | "id": 29268, 1564 | "key": "nq", 1565 | "value": "那曲" 1566 | }, 1567 | { 1568 | "id": 29480, 1569 | "key": "cz", 1570 | "value": "昌都" 1571 | }, 1572 | { 1573 | "id": 29497, 1574 | "key": "sn", 1575 | "value": "山南" 1576 | }, 1577 | { 1578 | "id": 29271, 1579 | "key": "rzz", 1580 | "value": "日喀则" 1581 | }, 1582 | { 1583 | "id": 29498, 1584 | "key": "al", 1585 | "value": "阿里" 1586 | }, 1587 | { 1588 | "id": 29270, 1589 | "key": "lz", 1590 | "value": "林芝" 1591 | } 1592 | ] 1593 | }, 1594 | { 1595 | "id": 31000, 1596 | "key": "yn", 1597 | "value": "云南", 1598 | "children": [ 1599 | { 1600 | "id": 31284, 1601 | "key": "hm", 1602 | "value": "昆明" 1603 | }, 1604 | { 1605 | "id": 31288, 1606 | "key": "qj", 1607 | "value": "曲靖" 1608 | }, 1609 | { 1610 | "id": 31295, 1611 | "key": "yx", 1612 | "value": "玉溪" 1613 | }, 1614 | { 1615 | "id": 31289, 1616 | "key": "bs", 1617 | "value": "保山" 1618 | }, 1619 | { 1620 | "id": 31294, 1621 | "key": "st", 1622 | "value": "昭通" 1623 | }, 1624 | { 1625 | "id": 31290, 1626 | "key": "pe", 1627 | "value": "普洱" 1628 | }, 1629 | { 1630 | "id": 31287, 1631 | "key": "lc", 1632 | "value": "临沧" 1633 | }, 1634 | { 1635 | "id": 31285, 1636 | "key": "lj", 1637 | "value": "丽江" 1638 | }, 1639 | { 1640 | "id": 31291, 1641 | "key": "ws", 1642 | "value": "文山" 1643 | }, 1644 | { 1645 | "id": 31293, 1646 | "key": "hh", 1647 | "value": "红河" 1648 | }, 1649 | { 1650 | "id": 31483, 1651 | "key": "xsbn", 1652 | "value": "西双版纳" 1653 | }, 1654 | { 1655 | "id": 31283, 1656 | "key": "cx", 1657 | "value": "楚雄" 1658 | }, 1659 | { 1660 | "id": 31292, 1661 | "key": "dl", 1662 | "value": "大理" 1663 | }, 1664 | { 1665 | "id": 31286, 1666 | "key": "dh", 1667 | "value": "德宏" 1668 | }, 1669 | { 1670 | "id": 31481, 1671 | "key": "nj", 1672 | "value": "怒江" 1673 | }, 1674 | { 1675 | "id": 31482, 1676 | "key": "dq", 1677 | "value": "迪庆" 1678 | } 1679 | ] 1680 | }, 1681 | { 1682 | "id": 33000, 1683 | "key": "cq", 1684 | "value": "重庆" 1685 | }, 1686 | { 1687 | "id": 11000, 1688 | "key": "gs", 1689 | "value": "甘肃", 1690 | "children": [ 1691 | { 1692 | "id": 11258, 1693 | "key": "lz", 1694 | "value": "兰州" 1695 | }, 1696 | { 1697 | "id": 11256, 1698 | "key": "jc", 1699 | "value": "金昌" 1700 | }, 1701 | { 1702 | "id": 11267, 1703 | "key": "by", 1704 | "value": "白银" 1705 | }, 1706 | { 1707 | "id": 11265, 1708 | "key": "ts", 1709 | "value": "天水" 1710 | }, 1711 | { 1712 | "id": 11257, 1713 | "key": "jyg", 1714 | "value": "嘉峪关" 1715 | }, 1716 | { 1717 | "id": 11264, 1718 | "key": "ww", 1719 | "value": "武威" 1720 | }, 1721 | { 1722 | "id": 11266, 1723 | "key": "zy", 1724 | "value": "张掖" 1725 | }, 1726 | { 1727 | "id": 11260, 1728 | "key": "pl", 1729 | "value": "平凉" 1730 | }, 1731 | { 1732 | "id": 11255, 1733 | "key": "jc", 1734 | "value": "酒泉" 1735 | }, 1736 | { 1737 | "id": 11262, 1738 | "key": "qy", 1739 | "value": "庆阳" 1740 | }, 1741 | { 1742 | "id": 11263, 1743 | "key": "dx", 1744 | "value": "定西" 1745 | }, 1746 | { 1747 | "id": 11259, 1748 | "key": "ln", 1749 | "value": "陇南" 1750 | }, 1751 | { 1752 | "id": 11477, 1753 | "key": "gn", 1754 | "value": "甘南" 1755 | }, 1756 | { 1757 | "id": 11261, 1758 | "key": "lx", 1759 | "value": "临夏" 1760 | } 1761 | ] 1762 | }, 1763 | { 1764 | "id": 23000, 1765 | "key": "nx", 1766 | "value": "宁夏", 1767 | "children": [ 1768 | { 1769 | "id": 23174, 1770 | "key": "yc", 1771 | "value": "银川" 1772 | }, 1773 | { 1774 | "id": 23171, 1775 | "key": "szs", 1776 | "value": "石嘴山" 1777 | }, 1778 | { 1779 | "id": 23172, 1780 | "key": "wz", 1781 | "value": "吴忠" 1782 | }, 1783 | { 1784 | "id": 23170, 1785 | "key": "gy", 1786 | "value": "固原" 1787 | }, 1788 | { 1789 | "id": 23173, 1790 | "key": "zw", 1791 | "value": "中卫" 1792 | } 1793 | ] 1794 | }, 1795 | { 1796 | "id": 24000, 1797 | "key": "qh", 1798 | "value": "青海", 1799 | "children": [ 1800 | { 1801 | "id": 24175, 1802 | "key": "xn", 1803 | "value": "西宁" 1804 | }, 1805 | { 1806 | "id": 24176, 1807 | "key": "hd", 1808 | "value": "海东" 1809 | }, 1810 | { 1811 | "id": 24494, 1812 | "key": "hb", 1813 | "value": "海北" 1814 | }, 1815 | { 1816 | "id": 24479, 1817 | "key": "hn", 1818 | "value": "海南" 1819 | }, 1820 | { 1821 | "id": 24496, 1822 | "key": "gl", 1823 | "value": "果洛" 1824 | }, 1825 | { 1826 | "id": 24178, 1827 | "key": "ys", 1828 | "value": "玉树" 1829 | }, 1830 | { 1831 | "id": 24177, 1832 | "key": "hx", 1833 | "value": "海西" 1834 | }, 1835 | { 1836 | "id": 24495, 1837 | "key": "hn", 1838 | "value": "黄南" 1839 | } 1840 | ] 1841 | }, 1842 | { 1843 | "id": 27000, 1844 | "key": "sx", 1845 | "value": "陕西", 1846 | "children": [ 1847 | { 1848 | "id": 27244, 1849 | "key": "xa", 1850 | "value": "西安" 1851 | }, 1852 | { 1853 | "id": 27242, 1854 | "key": "tc", 1855 | "value": "铜川" 1856 | }, 1857 | { 1858 | "id": 27239, 1859 | "key": "bj", 1860 | "value": "宝鸡" 1861 | }, 1862 | { 1863 | "id": 27245, 1864 | "key": "xy", 1865 | "value": "咸阳" 1866 | }, 1867 | { 1868 | "id": 27243, 1869 | "key": "wn", 1870 | "value": "渭南" 1871 | }, 1872 | { 1873 | "id": 27246, 1874 | "key": "ya", 1875 | "value": "延安" 1876 | }, 1877 | { 1878 | "id": 27248, 1879 | "key": "hz", 1880 | "value": "汉中" 1881 | }, 1882 | { 1883 | "id": 27249, 1884 | "key": "yl", 1885 | "value": "榆林" 1886 | }, 1887 | { 1888 | "id": 27240, 1889 | "key": "ak", 1890 | "value": "安康" 1891 | }, 1892 | { 1893 | "id": 27241, 1894 | "key": "sl", 1895 | "value": "商洛" 1896 | } 1897 | ] 1898 | }, 1899 | { 1900 | "id": 30000, 1901 | "key": "xj", 1902 | "value": "新疆", 1903 | "children": [ 1904 | { 1905 | "id": 30192, 1906 | "key": "wlmq", 1907 | "value": "乌鲁木齐" 1908 | }, 1909 | { 1910 | "id": 30184, 1911 | "key": "hlmy", 1912 | "value": "克拉玛依" 1913 | }, 1914 | { 1915 | "id": 30187, 1916 | "key": "shz", 1917 | "value": "石河子" 1918 | }, 1919 | { 1920 | "id": 30499, 1921 | "key": "ale", 1922 | "value": "阿拉尔" 1923 | }, 1924 | { 1925 | "id": 30500, 1926 | "key": "tmsh", 1927 | "value": "图木舒克" 1928 | }, 1929 | { 1930 | "id": 30189, 1931 | "key": "wjc", 1932 | "value": "五家渠" 1933 | }, 1934 | { 1935 | "id": 30190, 1936 | "key": "tlf", 1937 | "value": "吐鲁番" 1938 | }, 1939 | { 1940 | "id": 30179, 1941 | "key": "hm", 1942 | "value": "哈密" 1943 | }, 1944 | { 1945 | "id": 30195, 1946 | "key": "ht", 1947 | "value": "和田" 1948 | }, 1949 | { 1950 | "id": 30185, 1951 | "key": "ahs", 1952 | "value": "阿克苏" 1953 | }, 1954 | { 1955 | "id": 30183, 1956 | "key": "hs", 1957 | "value": "喀什" 1958 | }, 1959 | { 1960 | "id": 30186, 1961 | "key": "hzlsz", 1962 | "value": "克孜勒苏州" 1963 | }, 1964 | { 1965 | "id": 30191, 1966 | "key": "bygl", 1967 | "value": "巴音郭楞" 1968 | }, 1969 | { 1970 | "id": 30181, 1971 | "key": "cj", 1972 | "value": "昌吉" 1973 | }, 1974 | { 1975 | "id": 30180, 1976 | "key": "betl", 1977 | "value": "博尔塔拉" 1978 | }, 1979 | { 1980 | "id": 30193, 1981 | "key": "yl", 1982 | "value": "伊犁" 1983 | }, 1984 | { 1985 | "id": 30188, 1986 | "key": "tc", 1987 | "value": "塔城" 1988 | }, 1989 | { 1990 | "id": 30182, 1991 | "key": "alt", 1992 | "value": "阿勒泰" 1993 | } 1994 | ] 1995 | }, 1996 | { 1997 | "id": 34000, 1998 | "key": "xg", 1999 | "value": "香港" 2000 | }, 2001 | { 2002 | "id": 36000, 2003 | "key": "am", 2004 | "value": "澳门" 2005 | }, 2006 | { 2007 | "id": 35000, 2008 | "key": "tw", 2009 | "value": "台湾" 2010 | } 2011 | ] 2012 | --------------------------------------------------------------------------------