├── .editorconfig ├── .eslintignore ├── .eslintrc.js ├── .github └── workflows │ └── ci.yml ├── .gitignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── blocks ├── BarChart │ ├── README.md │ ├── package.json │ └── src │ │ ├── BarChart.vue │ │ └── index.js ├── BasicException │ ├── README.md │ ├── package.json │ └── src │ │ ├── BasicException.vue │ │ └── index.js ├── BasicForm │ ├── README.md │ ├── package.json │ └── src │ │ ├── BasicForm.vue │ │ └── index.js ├── BasicNotFound │ ├── README.md │ ├── package.json │ └── src │ │ ├── BasicNotFound.vue │ │ └── index.js ├── BasicTable │ ├── README.md │ ├── package.json │ └── src │ │ ├── BasicTable.vue │ │ └── index.js ├── D2Crud │ ├── README.md │ ├── package.json │ └── src │ │ ├── D2Crud.vue │ │ └── index.js ├── D2CrudSimple │ ├── README.md │ ├── package.json │ └── src │ │ ├── D2Crud.vue │ │ └── index.js ├── DataDisplay │ ├── README.md │ ├── package.json │ └── src │ │ ├── DataDisplay.scss │ │ ├── DataDisplay.vue │ │ └── index.js ├── DiyToggleChart │ ├── README.md │ ├── package.json │ └── src │ │ ├── DiyToggleChart.vue │ │ └── index.js ├── EmptyContent │ ├── README.md │ ├── package.json │ └── src │ │ ├── EmptyContent.vue │ │ └── index.js ├── FixedTable │ ├── README.md │ ├── package.json │ └── src │ │ ├── FixedTable.vue │ │ └── index.js ├── FunnelChart │ ├── README.md │ ├── package.json │ └── src │ │ ├── FunnelChart.vue │ │ └── index.js ├── GaugeChart │ ├── README.md │ ├── package.json │ └── src │ │ ├── GaugeChart.vue │ │ └── index.js ├── HeatmapChart │ ├── README.md │ ├── package.json │ └── src │ │ ├── HeatmapChart.vue │ │ └── index.js ├── HistogramChart │ ├── README.md │ ├── package.json │ └── src │ │ ├── HistogramChart.vue │ │ └── index.js ├── LineChart │ ├── README.md │ ├── package.json │ └── src │ │ ├── LineChart.vue │ │ └── index.js ├── MapToggleChart │ ├── README.md │ ├── package.json │ └── src │ │ ├── MapToggleChart.vue │ │ └── index.js ├── NormalToggleChart │ ├── README.md │ ├── package.json │ └── src │ │ ├── NormalToggleChart.vue │ │ └── index.js ├── NotPermission │ ├── README.md │ ├── package.json │ └── src │ │ ├── NotPermission.vue │ │ └── index.js ├── PieChart │ ├── README.md │ ├── package.json │ └── src │ │ ├── PieChart.vue │ │ └── index.js ├── RadarChart │ ├── README.md │ ├── package.json │ └── src │ │ ├── RadarChart.vue │ │ └── index.js ├── RingChart │ ├── README.md │ ├── package.json │ └── src │ │ ├── RingChart.vue │ │ └── index.js ├── ScatterChart │ ├── README.md │ ├── package.json │ └── src │ │ ├── ScatterChart.vue │ │ └── index.js ├── SelectTable │ ├── README.md │ ├── package.json │ └── src │ │ ├── SelectTable.vue │ │ └── index.js ├── SimpleFooter │ ├── README.md │ ├── package.json │ └── src │ │ ├── SimpleFooter.vue │ │ └── index.js ├── TabTable │ ├── README.md │ ├── package.json │ └── src │ │ ├── TabTable.vue │ │ ├── components │ │ ├── DeleteBalloon.vue │ │ └── EditDialog.vue │ │ ├── index.js │ │ └── tab-table.json ├── TagMessageList │ ├── README.md │ ├── package.json │ └── src │ │ ├── TagMessageList.vue │ │ └── index.js ├── UserLogin │ ├── README.md │ ├── package.json │ └── src │ │ ├── UserLogin.scss │ │ ├── UserLogin.vue │ │ └── index.js └── WaterfallChart │ ├── README.md │ ├── package.json │ └── src │ ├── WaterfallChart.vue │ └── index.js ├── components └── BasicContainer │ ├── README.md │ ├── index.js │ ├── package.json │ └── src │ ├── BasicContainer.vue │ └── index.js ├── package.json ├── scaffolds ├── admin-lite │ ├── .babelrc │ ├── .postcssrc │ ├── README.md │ ├── _gitignore │ ├── package.json │ ├── public │ │ ├── favicon.ico │ │ └── index.html │ ├── src │ │ ├── App.vue │ │ ├── assets │ │ │ ├── 404.png │ │ │ ├── 404_cloud.png │ │ │ └── logo.png │ │ ├── components │ │ │ └── .gitkeep │ │ ├── config │ │ │ ├── menu.js │ │ │ └── routes.js │ │ ├── layouts │ │ │ └── HeaderAsideLayout │ │ │ │ ├── Layout.vue │ │ │ │ ├── components │ │ │ │ ├── AppMain.vue │ │ │ │ ├── NavBar.vue │ │ │ │ ├── ScrollBar.vue │ │ │ │ ├── SideBar.vue │ │ │ │ └── index.js │ │ │ │ └── index.js │ │ ├── main.js │ │ ├── pages │ │ │ ├── Dashboard │ │ │ │ ├── Dashboard.vue │ │ │ │ └── index.js │ │ │ └── NotFound │ │ │ │ ├── NotFound.vue │ │ │ │ └── index.js │ │ ├── router.js │ │ └── styles │ │ │ └── index.scss │ └── vue.config.js ├── d2-admin-ice │ ├── .browserslistrc │ ├── .env │ ├── .env.development │ ├── .env.nomock │ ├── .env.travis │ ├── .eslintignore │ ├── .eslintrc.js │ ├── .gitignore │ ├── .postcssrc.js │ ├── LICENSE │ ├── README.md │ ├── babel.config.js │ ├── jest.config.js │ ├── package.json │ ├── public │ │ ├── icon.ico │ │ ├── image │ │ │ ├── loading │ │ │ │ └── loading-spin.svg │ │ │ └── theme │ │ │ │ ├── d2 │ │ │ │ ├── logo │ │ │ │ │ ├── all.png │ │ │ │ │ └── icon-only.png │ │ │ │ └── preview@2x.png │ │ │ │ ├── line │ │ │ │ ├── bg.jpg │ │ │ │ ├── logo │ │ │ │ │ ├── all.png │ │ │ │ │ └── icon-only.png │ │ │ │ └── preview@2x.png │ │ │ │ ├── star │ │ │ │ ├── bg.jpg │ │ │ │ ├── logo │ │ │ │ │ ├── all.png │ │ │ │ │ └── icon-only.png │ │ │ │ └── preview@2x.png │ │ │ │ ├── tomorrow-night-blue │ │ │ │ ├── logo │ │ │ │ │ ├── all.png │ │ │ │ │ └── icon-only.png │ │ │ │ └── preview@2x.png │ │ │ │ └── violet │ │ │ │ ├── logo │ │ │ │ ├── all.png │ │ │ │ └── icon-only.png │ │ │ │ └── preview@2x.png │ │ └── index.html │ ├── src │ │ ├── App.vue │ │ ├── api │ │ │ └── sys.login.js │ │ ├── assets │ │ │ ├── style │ │ │ │ ├── animate │ │ │ │ │ └── vue-transition.scss │ │ │ │ ├── fixed │ │ │ │ │ ├── base.scss │ │ │ │ │ ├── element.scss │ │ │ │ │ └── n-progress.scss │ │ │ │ ├── public-class.scss │ │ │ │ ├── public.scss │ │ │ │ ├── theme │ │ │ │ │ ├── d2 │ │ │ │ │ │ ├── index.scss │ │ │ │ │ │ └── setting.scss │ │ │ │ │ ├── line │ │ │ │ │ │ ├── index.scss │ │ │ │ │ │ └── setting.scss │ │ │ │ │ ├── register.scss │ │ │ │ │ ├── star │ │ │ │ │ │ ├── index.scss │ │ │ │ │ │ └── setting.scss │ │ │ │ │ ├── theme-base.scss │ │ │ │ │ ├── theme.scss │ │ │ │ │ ├── tomorrow-night-blue │ │ │ │ │ │ ├── index.scss │ │ │ │ │ │ └── setting.scss │ │ │ │ │ └── violet │ │ │ │ │ │ ├── index.scss │ │ │ │ │ │ └── setting.scss │ │ │ │ └── unit │ │ │ │ │ └── color.scss │ │ │ └── svg-icons │ │ │ │ ├── icons │ │ │ │ ├── d2-admin-text.svg │ │ │ │ └── d2-admin.svg │ │ │ │ └── index.js │ │ ├── components │ │ │ ├── d2-container │ │ │ │ ├── components │ │ │ │ │ ├── d2-container-card-bs.vue │ │ │ │ │ ├── d2-container-card.vue │ │ │ │ │ ├── d2-container-full-bs.vue │ │ │ │ │ ├── d2-container-full.vue │ │ │ │ │ ├── d2-container-ghost-bs.vue │ │ │ │ │ ├── d2-container-ghost.vue │ │ │ │ │ ├── d2-source.vue │ │ │ │ │ └── mixins │ │ │ │ │ │ ├── bs.js │ │ │ │ │ │ └── normal.js │ │ │ │ └── index.js │ │ │ ├── d2-icon-svg │ │ │ │ └── index.vue │ │ │ ├── d2-icon │ │ │ │ ├── font-awesome-4.7.0 │ │ │ │ │ ├── css │ │ │ │ │ │ └── font-awesome.min.css │ │ │ │ │ └── fonts │ │ │ │ │ │ ├── FontAwesome.otf │ │ │ │ │ │ ├── fontawesome-webfont.eot │ │ │ │ │ │ ├── fontawesome-webfont.svg │ │ │ │ │ │ ├── fontawesome-webfont.ttf │ │ │ │ │ │ ├── fontawesome-webfont.woff │ │ │ │ │ │ └── fontawesome-webfont.woff2 │ │ │ │ └── index.vue │ │ │ └── index.js │ │ ├── config │ │ │ ├── menu.js │ │ │ └── routes.js │ │ ├── i18n │ │ │ ├── index.js │ │ │ └── lang │ │ │ │ ├── cn │ │ │ │ └── index.js │ │ │ │ ├── en │ │ │ │ └── index.js │ │ │ │ └── ja │ │ │ │ └── index.js │ │ ├── layouts │ │ │ └── HeaderAside │ │ │ │ ├── components │ │ │ │ ├── components │ │ │ │ │ ├── menu-item │ │ │ │ │ │ └── index.vue │ │ │ │ │ └── menu-sub │ │ │ │ │ │ └── index.vue │ │ │ │ ├── contextmenu │ │ │ │ │ ├── components │ │ │ │ │ │ └── contentmenuList │ │ │ │ │ │ │ └── index.vue │ │ │ │ │ └── index.vue │ │ │ │ ├── header-fullscreen │ │ │ │ │ └── index.vue │ │ │ │ ├── header-log │ │ │ │ │ └── index.vue │ │ │ │ ├── header-search │ │ │ │ │ └── index.vue │ │ │ │ ├── header-size │ │ │ │ │ └── index.vue │ │ │ │ ├── header-theme │ │ │ │ │ ├── components │ │ │ │ │ │ └── d2-theme-list │ │ │ │ │ │ │ └── index.vue │ │ │ │ │ └── index.vue │ │ │ │ ├── header-user │ │ │ │ │ └── index.vue │ │ │ │ ├── menu-header │ │ │ │ │ └── index.vue │ │ │ │ ├── menu-side │ │ │ │ │ └── index.vue │ │ │ │ ├── mixin │ │ │ │ │ └── menu.js │ │ │ │ ├── panel-search │ │ │ │ │ ├── components │ │ │ │ │ │ └── panel-search-item │ │ │ │ │ │ │ └── index.vue │ │ │ │ │ └── index.vue │ │ │ │ └── tabs │ │ │ │ │ └── index.vue │ │ │ │ ├── index.js │ │ │ │ ├── layout.vue │ │ │ │ └── mixins │ │ │ │ └── search.js │ │ ├── libs │ │ │ ├── util.cookies.js │ │ │ ├── util.db.js │ │ │ ├── util.ice.js │ │ │ ├── util.js │ │ │ └── util.log.js │ │ ├── main.js │ │ ├── mock │ │ │ ├── api │ │ │ │ └── sys.login.js │ │ │ ├── d2-mock │ │ │ │ ├── index.js │ │ │ │ └── patch │ │ │ │ │ └── withCredentials.js │ │ │ └── index.js │ │ ├── pages │ │ │ ├── Demo1 │ │ │ │ ├── Demo1.vue │ │ │ │ ├── componnets │ │ │ │ │ ├── FooterLink │ │ │ │ │ │ ├── FooterLink.vue │ │ │ │ │ │ └── index.js │ │ │ │ │ └── RouteInfo │ │ │ │ │ │ ├── RouteInfo.vue │ │ │ │ │ │ └── index.js │ │ │ │ └── index.js │ │ │ ├── Demo2 │ │ │ │ ├── Demo2.vue │ │ │ │ ├── componnets │ │ │ │ │ ├── FooterLink │ │ │ │ │ │ ├── FooterLink.vue │ │ │ │ │ │ └── index.js │ │ │ │ │ └── RouteInfo │ │ │ │ │ │ ├── RouteInfo.vue │ │ │ │ │ │ └── index.js │ │ │ │ └── index.js │ │ │ ├── Error404 │ │ │ │ ├── index.js │ │ │ │ └── page.vue │ │ │ ├── Index │ │ │ │ ├── components │ │ │ │ │ ├── d2-badge │ │ │ │ │ │ └── index.vue │ │ │ │ │ ├── d2-help-btn │ │ │ │ │ │ ├── image │ │ │ │ │ │ │ ├── d2-help-button@2x.png │ │ │ │ │ │ │ ├── qq.jpg │ │ │ │ │ │ │ └── we.jpg │ │ │ │ │ │ └── index.vue │ │ │ │ │ └── d2-page-cover │ │ │ │ │ │ ├── image │ │ │ │ │ │ └── darkblue@2x.png │ │ │ │ │ │ └── index.vue │ │ │ │ ├── image │ │ │ │ │ └── qr@2x.png │ │ │ │ ├── index.js │ │ │ │ └── page.vue │ │ │ └── Login │ │ │ │ ├── image │ │ │ │ ├── login-code.png │ │ │ │ └── logo@2x.png │ │ │ │ ├── index.js │ │ │ │ └── page.vue │ │ ├── plugin │ │ │ ├── axios │ │ │ │ └── index.js │ │ │ ├── d2admin │ │ │ │ └── index.js │ │ │ ├── error │ │ │ │ └── index.js │ │ │ ├── log │ │ │ │ └── index.js │ │ │ └── open │ │ │ │ └── index.js │ │ ├── router │ │ │ └── index.js │ │ ├── setting.js │ │ └── store │ │ │ ├── index.js │ │ │ └── modules │ │ │ └── d2admin │ │ │ ├── index.js │ │ │ └── modules │ │ │ ├── account.js │ │ │ ├── db.js │ │ │ ├── fullscreen.js │ │ │ ├── gray.js │ │ │ ├── log.js │ │ │ ├── menu.js │ │ │ ├── page.js │ │ │ ├── releases.js │ │ │ ├── search.js │ │ │ ├── size.js │ │ │ ├── theme.js │ │ │ ├── transition.js │ │ │ ├── ua.js │ │ │ └── user.js │ ├── tests │ │ └── unit │ │ │ ├── .eslintrc.js │ │ │ └── HelloWorld.spec.js │ ├── tools │ │ └── vue-filename-injector │ │ │ ├── README.md │ │ │ ├── index.js │ │ │ └── src │ │ │ ├── index.js │ │ │ └── lib │ │ │ ├── config.js │ │ │ ├── injector.js │ │ │ └── loader.js │ └── vue.config.js ├── icestark-child-app │ ├── README.md │ ├── _gitignore │ ├── index.html │ ├── package.json │ ├── public │ │ └── favicon.ico │ ├── src │ │ ├── App.vue │ │ ├── assets │ │ │ └── logo.png │ │ ├── components │ │ │ ├── 404.vue │ │ │ ├── Detail.vue │ │ │ ├── HelloWorld.vue │ │ │ └── List.vue │ │ ├── env.d.ts │ │ ├── main.ts │ │ └── routes.ts │ ├── tsconfig.json │ └── vite.config.ts └── icestark-framework-app │ ├── README.md │ ├── _gitignore │ ├── index.html │ ├── package.json │ ├── public │ └── favicon.ico │ ├── src │ ├── App.vue │ ├── assets │ │ └── logo.png │ ├── components │ │ ├── HelloWorld.vue │ │ └── List.vue │ ├── env.d.ts │ ├── layouts │ │ └── BasicLayout.vue │ ├── main.ts │ ├── pages │ │ ├── About.vue │ │ ├── Home.vue │ │ ├── Login.vue │ │ └── NotFound.vue │ └── router.ts │ ├── tsconfig.json │ └── vite.config.ts ├── scripts ├── publish-packages.ts ├── upload-oss.js └── utils │ ├── checkVersionExist.ts │ └── generateBetaVersion.ts └── tsconfig.json /.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = space 6 | indent_size = 2 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | 14 | [makefile] 15 | indent_style = tab 16 | indent_size = 4 17 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | # 忽略目录 2 | build/ 3 | node_modules/ 4 | dist/ 5 | 6 | # node 覆盖率文件 7 | coverage/ 8 | 9 | # 忽略文件 10 | **/*-min.js 11 | **/*.min.js 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | const { getESLintConfig } = require('@iceworks/spec'); 2 | 3 | // https://www.npmjs.com/package/@iceworks/spec 4 | module.exports = getESLintConfig('vue'); 5 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: ci 2 | 3 | on: [push] 4 | 5 | jobs: 6 | build-and-publish: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@v1 10 | - run: echo >>$GITHUB_ENV BRANCH_NAME=${GITHUB_REF#refs/heads/} 11 | - uses: actions/setup-node@v1 12 | with: 13 | node-version: 12 14 | registry-url: https://registry.npmjs.org/ 15 | - run: npm i 16 | - run: npm run lint 17 | - run: npm run publish:packages 18 | env: 19 | NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} 20 | GIT_COMMIT_MESSAGE: ${{github.event.commits[0].message}} 21 | 22 | - name: 'depoly' 23 | run: npm run deploy 24 | env: 25 | ACCESS_KEY_ID: ${{ secrets.ACCESS_KEY_ID }} 26 | ACCESS_KEY_SECRET: ${{ secrets.ACCESS_KEY_SECRET }} 27 | GIT_COMMIT_MESSAGE: ${{github.event.commits[0].message}} 28 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | lerna-debug.log 4 | npm-debug.log 5 | mochawesome-report 6 | .happypack 7 | package-lock.json 8 | yarn.lock 9 | yarn-error.log 10 | tempDir 11 | coverage/ 12 | 13 | blocks/**/lib/ 14 | components/**/lib/ 15 | screenshot.png 16 | 17 | .eslintcache 18 | build 19 | .vscode/ 20 | .tmp/ 21 | dist 22 | .vercel/ 23 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## 1.0.2 4 | 5 | - [scaffolds-icestark-child-app@3.0.2] re-generate `history` for history is cached when excuting twice. 6 | 7 | ## 1.0.1 8 | 9 | - [scaffolds-icestark-framwork-child@3.0.1] fix missing file `vite.config.ts`. 10 | - [scaffolds-icestark-child-app@3.0.1] fix missing file `vite.config.ts`. 11 | 12 | ## 1.0.0 13 | 14 | - [scaffolds-icestark-framwork-child@3.0.0] new scaffold using vite and vue3. 15 | - [scaffolds-icestark-child-app@3.0.0] new scaffold using vite and vue3. 16 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT LICENSE 2 | 3 | Copyright (c) 2018-present Alibaba Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Vue Materials 2 | 3 | ICE official Vue materials, based on [Vue CLI](https://cli.vuejs.org) build tool and [Element](https://element.eleme.io/#/zh-CN) components. 4 | 5 | ## Quick Start 6 | 7 | We recommend you to use vue materials by [Iceworks](https://marketplace.visualstudio.com/items?itemName=iceworks-team.iceworks). Click [here](https://ice.work/docs/iceworks/quick-start) to learn more about how to install Iceworks. 8 | 9 | ### Use Vue Scaffolds 10 | 11 | Open a empty workspace in your VS Code and click the Iceworks Icon in the activity bar, the application creator panel will be started up. Click the **Vue Materials** material source and then select a vue scaffold to create a application. 12 | 13 | ![use-vue-scaffolds](https://img.alicdn.com/tfs/TB1GBS8mRBh1e4jSZFhXXcC9VXa-1089-768.png) 14 | 15 | ### Use Vue Blocks and Components 16 | 17 | Create a vue page by vue blocks materials. 18 | 19 | ![use-blocks-to-create-page](https://img.alicdn.com/tfs/TB1OySIWeL2gK0jSZPhXXahvXXa-1440-809.png) 20 | 21 | For more detail, you can see [docs](https://ice.work/docs/iceworks/guide/visual-construction). 22 | 23 | 24 | ## How to deplopy it to [vercel](https://vercel.com) manually 25 | 26 | 1. Install [vercel-cli](https://github.com/vercel/vercel/tree/main/packages/cli) globally 27 | 28 | ```shell 29 | $ npm i -g vercel 30 | ``` 31 | 32 | 2. Run vercel at corresponding directory 33 | 34 | For example: 35 | 36 | ```shell 37 | $ cd scaffolds/icestark-child-app 38 | $ vercel 39 | ``` 40 | 41 | 3. Link to existing project on vercel 42 | 43 | ```shell 44 | ? Link to existing project? [y/N] y 45 | ? What’s the name of your existing project? icestark-vite-vue 46 | ``` 47 | 48 | + `scafflods/icestark-child-app` -> `icestark-vite-vue` 49 | + `scafflods/icestark-framework-app` -> `icestark-framework-vue3-x` 50 | 51 | 52 | 4. If you don't have access, ask [@maoxiaoke](https://github.com/maoxiaoke) for help. 53 | 54 | ## License 55 | 56 | [MIT](LICENSE) -------------------------------------------------------------------------------- /blocks/BarChart/README.md: -------------------------------------------------------------------------------- 1 | # bar-chart-block 2 | 3 | 简介:条形图 4 | 5 | ![截图](https://img.alicdn.com/tfs/TB1gSTgpKuSBuNjy1XcXXcYjFXa-2016-876.png) 6 | -------------------------------------------------------------------------------- /blocks/BarChart/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vue-materials/bar-chart-block", 3 | "version": "1.0.0", 4 | "description": "v-charts 条形图", 5 | "author": "ice-admin@alibaba-inc.com", 6 | "files": [ 7 | "src/", 8 | "lib/" 9 | ], 10 | "repository": { 11 | "type": "git", 12 | "url": "https://github.com/ice-lab/vue-materials/tree/master/blocks/BarChart" 13 | }, 14 | "license": "MIT", 15 | "keywords": [ 16 | "ice", 17 | "ice-block" 18 | ], 19 | "publishConfig": { 20 | "access": "public", 21 | "registry": "http://registry.npmjs.com" 22 | }, 23 | "dependencies": { 24 | "echarts": "^4.0.4", 25 | "@vue-materials/basic-container": "^1.0.0", 26 | "v-charts": "^1.16.10", 27 | "vue": "^2.5.16" 28 | }, 29 | "blockConfig": { 30 | "name": "bar-chart", 31 | "title": "条形图", 32 | "categories": [ 33 | "图表" 34 | ], 35 | "screenshot": "https://img.alicdn.com/tfs/TB1gSTgpKuSBuNjy1XcXXcYjFXa-2016-876.png" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /blocks/BarChart/src/BarChart.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 46 | 47 | 52 | -------------------------------------------------------------------------------- /blocks/BarChart/src/index.js: -------------------------------------------------------------------------------- 1 | import BarChart from './BarChart'; 2 | 3 | export default BarChart; 4 | -------------------------------------------------------------------------------- /blocks/BasicException/README.md: -------------------------------------------------------------------------------- 1 | # basic-exception 2 | 3 | 简介:基础异常报错 4 | 5 | 基于element-ui组件的基础异常报错 6 | 7 | ![BasicException](https://user-images.githubusercontent.com/18508817/40156388-bf1a1b92-59cb-11e8-913c-b31886149263.png) 8 | -------------------------------------------------------------------------------- /blocks/BasicException/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vue-materials/basic-exception-block", 3 | "version": "1.0.1", 4 | "description": "基于element-ui组件的基础异常报错", 5 | "author": "mowatermelon ", 6 | "files": ["src/", "lib/"], 7 | "repository": { 8 | "type": "git", 9 | "url": "https://github.com/ice-lab/vue-materials/tree/master/blocks/BasicException" 10 | }, 11 | "license": "MIT", 12 | "keywords": ["ice", "vue", "block"], 13 | "publishConfig": { 14 | "access": "public", 15 | "registry": "http://registry.npmjs.com" 16 | }, 17 | "dependencies": { 18 | "@vue-materials/basic-container": "^1.0.0", 19 | "vue": "^2.5.16" 20 | }, 21 | "blockConfig": { 22 | "name": "basic-exception", 23 | "title": "基础异常报错", 24 | "categories": ["异常"], 25 | "screenshot": 26 | "https://user-images.githubusercontent.com/18508817/40156388-bf1a1b92-59cb-11e8-913c-b31886149263.png" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /blocks/BasicException/src/index.js: -------------------------------------------------------------------------------- 1 | import BasicException from './BasicException'; 2 | 3 | export default BasicException; 4 | -------------------------------------------------------------------------------- /blocks/BasicForm/README.md: -------------------------------------------------------------------------------- 1 | # basic-form-block 2 | 3 | 简介:基础表单 4 | 5 | ![截图](https://img.alicdn.com/tfs/TB13E09pMmTBuNjy1XbXXaMrVXa-2014-1148.png) 6 | -------------------------------------------------------------------------------- /blocks/BasicForm/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vue-materials/basic-form-block", 3 | "version": "1.0.0", 4 | "description": "基础表单", 5 | "author": "ice-admin@alibaba-inc.com", 6 | "files": [ 7 | "src/", 8 | "lib/" 9 | ], 10 | "repository": { 11 | "type": "git", 12 | "url": "https://github.com/ice-lab/vue-materials/tree/master/blocks/BasicForm" 13 | }, 14 | "license": "MIT", 15 | "keywords": [ 16 | "ice", 17 | "ice-block" 18 | ], 19 | "publishConfig": { 20 | "access": "public", 21 | "registry": "http://registry.npmjs.com" 22 | }, 23 | "dependencies": { 24 | "@vue-materials/basic-container": "^1.0.0", 25 | "vue": "^2.5.16" 26 | }, 27 | "blockConfig": { 28 | "name": "basic-form", 29 | "title": "基础表单", 30 | "categories": ["表单"], 31 | "screenshot": "https://img.alicdn.com/tfs/TB13E09pMmTBuNjy1XbXXaMrVXa-2014-1148.png" 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /blocks/BasicForm/src/index.js: -------------------------------------------------------------------------------- 1 | import BasicForm from './BasicForm'; 2 | 3 | export default BasicForm; 4 | -------------------------------------------------------------------------------- /blocks/BasicNotFound/README.md: -------------------------------------------------------------------------------- 1 | # basic-not-found 2 | 3 | 简介:404 报错提示 4 | 5 | 基于element-ui组件的404 报错提示 6 | 7 | ![BasicNotFound](https://user-images.githubusercontent.com/18508817/40071509-8a83af2a-58a3-11e8-926a-42a70c06bc71.png) 8 | -------------------------------------------------------------------------------- /blocks/BasicNotFound/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vue-materials/basic-not-found-block", 3 | "version": "1.0.1", 4 | "description": "基于element-ui组件的404 报错提示", 5 | "author": "mowatermelon ", 6 | "files": ["src/", "lib/"], 7 | "repository": { 8 | "type": "git", 9 | "url": "https://github.com/ice-lab/vue-materials/tree/master/blocks/BasicNotFound" 10 | }, 11 | "license": "MIT", 12 | "keywords": ["ice", "vue", "block"], 13 | "publishConfig": { 14 | "access": "public", 15 | "registry": "http://registry.npmjs.com" 16 | }, 17 | "dependencies": { 18 | "@vue-materials/basic-container": "^1.0.0", 19 | "vue": "^2.5.16" 20 | }, 21 | "blockConfig": { 22 | "name": "basic-not-found", 23 | "title": "404 报错提示", 24 | "categories": ["异常"], 25 | "screenshot": 26 | "https://user-images.githubusercontent.com/18508817/40071509-8a83af2a-58a3-11e8-926a-42a70c06bc71.png" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /blocks/BasicNotFound/src/index.js: -------------------------------------------------------------------------------- 1 | import BasicNotFound from './BasicNotFound'; 2 | 3 | export default BasicNotFound; 4 | -------------------------------------------------------------------------------- /blocks/BasicTable/README.md: -------------------------------------------------------------------------------- 1 | # basic-table-block 2 | 3 | 简介:基础表格 4 | 5 | ![截图](https://img.alicdn.com/tfs/TB1BvzBpGmWBuNjy1XaXXXCbXXa-2004-1018.png) 6 | -------------------------------------------------------------------------------- /blocks/BasicTable/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vue-materials/basic-table-block", 3 | "version": "1.0.0", 4 | "description": "基础表格", 5 | "author": "ice-admin@alibaba-inc.com", 6 | "files": [ 7 | "src/", 8 | "lib/" 9 | ], 10 | "repository": { 11 | "type": "git", 12 | "url": "https://github.com/ice-lab/vue-materials/tree/master/blocks/BasicTable" 13 | }, 14 | "license": "MIT", 15 | "keywords": [ 16 | "ice", 17 | "ice-block" 18 | ], 19 | "publishConfig": { 20 | "access": "public", 21 | "registry": "http://registry.npmjs.com" 22 | }, 23 | "dependencies": { 24 | "@vue-materials/basic-container": "^1.0.0", 25 | "vue": "^2.5.16" 26 | }, 27 | "blockConfig": { 28 | "name": "basic-table", 29 | "title": "基础表格", 30 | "categories": [ 31 | "表格" 32 | ], 33 | "screenshot": "https://img.alicdn.com/tfs/TB1BvzBpGmWBuNjy1XaXXXCbXXa-2004-1018.png" 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /blocks/BasicTable/src/BasicTable.vue: -------------------------------------------------------------------------------- 1 | 25 | 26 | 72 | 73 | 78 | -------------------------------------------------------------------------------- /blocks/BasicTable/src/index.js: -------------------------------------------------------------------------------- 1 | import BasicTable from './BasicTable'; 2 | 3 | export default BasicTable; 4 | -------------------------------------------------------------------------------- /blocks/D2Crud/README.md: -------------------------------------------------------------------------------- 1 | # d2-crud 2 | 3 | 简介:d2-crud 4 | 5 | d2-crud 6 | 7 | ![截图](https://qiniucdn.fairyever.com/20180907163652.png) 8 | -------------------------------------------------------------------------------- /blocks/D2Crud/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@d2-projects/d2-crud-ice-block", 3 | "version": "1.0.0", 4 | "description": "基于Element的表格封装复杂示例", 5 | "author": "孙昊翔 <673686754@qq.com>", 6 | "files": [ 7 | "src/", 8 | "lib/" 9 | ], 10 | "repository": { 11 | "type": "git", 12 | "url": "https://github.com/ice-lab/vue-materials/tree/master/blocks/D2Crud" 13 | }, 14 | "license": "MIT", 15 | "keywords": [ 16 | "ice", 17 | "vue", 18 | "block" 19 | ], 20 | "dependencies": { 21 | "@d2-projects/d2-crud": "^1.1.0", 22 | "vue": "^2.5.16" 23 | }, 24 | "blockConfig": { 25 | "name": "d2-crud", 26 | "title": "D2Crud复杂示例", 27 | "categories": [ 28 | "表格" 29 | ], 30 | "screenshot": "http://qiniucdn.fairyever.com/20180907163652.png" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /blocks/D2Crud/src/index.js: -------------------------------------------------------------------------------- 1 | import D2Crud from './D2Crud'; 2 | 3 | export default D2Crud; 4 | -------------------------------------------------------------------------------- /blocks/D2CrudSimple/README.md: -------------------------------------------------------------------------------- 1 | # d2-crud 2 | 3 | 简介:d2-crud 4 | 5 | d2-crud 6 | 7 | ![截图](https://qiniucdn.fairyever.com/20180907163636.png) 8 | -------------------------------------------------------------------------------- /blocks/D2CrudSimple/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@d2-projects/d2-crud-ice-block-simple", 3 | "version": "1.0.0", 4 | "description": "基于Element的表格封装简单示例", 5 | "author": "孙昊翔 <673686754@qq.com>", 6 | "files": [ 7 | "src/", 8 | "lib/" 9 | ], 10 | "repository": { 11 | "type": "git", 12 | "url": "https://github.com/ice-lab/vue-materials/tree/master/blocks/D2CrudSimple" 13 | }, 14 | "license": "MIT", 15 | "keywords": [ 16 | "ice", 17 | "vue", 18 | "block" 19 | ], 20 | "dependencies": { 21 | "@d2-projects/d2-crud": "^1.1.0", 22 | "vue": "^2.5.16" 23 | }, 24 | "blockConfig": { 25 | "name": "d2-crud", 26 | "title": "D2Crud简单示例", 27 | "categories": [ 28 | "表格" 29 | ], 30 | "screenshot": "http://qiniucdn.fairyever.com/20180907163636.png" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /blocks/D2CrudSimple/src/D2Crud.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 65 | -------------------------------------------------------------------------------- /blocks/D2CrudSimple/src/index.js: -------------------------------------------------------------------------------- 1 | import D2Crud from './D2Crud'; 2 | 3 | export default D2Crud; 4 | -------------------------------------------------------------------------------- /blocks/DataDisplay/README.md: -------------------------------------------------------------------------------- 1 | # data-display 2 | 3 | 简介:数据展示 4 | 5 | 用于简单数据的模板展示 6 | 7 | ![截图](https://img.alicdn.com/tfs/TB1IKT9jfDH8KJjy1XcXXcpdXXa-1892-324.png) 8 | 9 | 数据格式: 10 | 11 | ~~~ 12 | export default { 13 | span: 8, 14 | color: '#15A0FF', 15 | data: [{ 16 | count: 100, 17 | title: '日活跃数', 18 | }, 19 | { 20 | count: '3,000', 21 | title: '月活跃数', 22 | }, 23 | { 24 | count: '20,000', 25 | title: '年活跃数', 26 | } 27 | ] 28 | } 29 | ~~~ 30 | #### option属性 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 |
参数详细解释类型可选值默认值
span格栅String / Number8
color颜色String#15A0FF
54 | 55 | #### data属性 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 |
参数详细解释类型可选值默认值
title标题String / Number
count数字String / Number
-------------------------------------------------------------------------------- /blocks/DataDisplay/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vue-materials/data-display-block", 3 | "version": "1.0.0", 4 | "description": "用于简单数据的模板展示", 5 | "author": "smallwei <1634566606@qq.com>", 6 | "files": [ 7 | "src/", 8 | "lib/" 9 | ], 10 | "repository": { 11 | "type": "git", 12 | "url": "https://github.com/ice-lab/vue-materials/tree/master/blocks/DataDisplay" 13 | }, 14 | "license": "MIT", 15 | "keywords": [ 16 | "ice", 17 | "vue", 18 | "block" 19 | ], 20 | "publishConfig": { 21 | "access": "public", 22 | "registry": "http://registry.npmjs.com" 23 | }, 24 | "dependencies": { 25 | "@vue-materials/basic-container": "^1.0.0", 26 | "normalize.css": "^8.0.0", 27 | "vue": "^2.5.16" 28 | }, 29 | "blockConfig": { 30 | "name": "data-display", 31 | "title": "数据展示", 32 | "categories": [ 33 | "数据展示" 34 | ], 35 | "screenshot": "https://img.alicdn.com/tfs/TB1IKT9jfDH8KJjy1XcXXcpdXXa-1892-324.png" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /blocks/DataDisplay/src/DataDisplay.scss: -------------------------------------------------------------------------------- 1 | @import '~normalize.css/normalize.css'; 2 | .item { 3 | display: flex; 4 | flex-direction: column; 5 | margin: 5px 0; 6 | text-align: center; 7 | } 8 | 9 | .count { 10 | margin: 12px 0; 11 | font-weight: bold; 12 | font-size: 32px; 13 | color: #15A0FF; 14 | } 15 | 16 | .title { 17 | color: #999; 18 | } 19 | 20 | .splitLine { 21 | display: block; 22 | margin: 0 auto; 23 | width: 24px; 24 | height: 1px; 25 | background: #9B9B9B; 26 | } 27 | -------------------------------------------------------------------------------- /blocks/DataDisplay/src/DataDisplay.vue: -------------------------------------------------------------------------------- 1 | 17 | 18 | 49 | 52 | 53 | -------------------------------------------------------------------------------- /blocks/DataDisplay/src/index.js: -------------------------------------------------------------------------------- 1 | import DataDisplay from './DataDisplay.vue'; 2 | 3 | export default DataDisplay; 4 | -------------------------------------------------------------------------------- /blocks/DiyToggleChart/README.md: -------------------------------------------------------------------------------- 1 | # diy-toggle-chart 2 | 3 | 简介:diy-toggle-chart 4 | 5 | v-chart 自定义图表类型切换,支持Line、Histogram、Bar、Pie、Ring、Waterfall和Funnel,七种图表类型切换 6 | 7 | ![DiyToggleChart-Line](https://user-images.githubusercontent.com/18508817/40872239-78c74606-667d-11e8-855d-efd7ed7d6d9e.png) 8 | 9 | ![DiyToggleChart-Ring](https://user-images.githubusercontent.com/18508817/40873801-bf4a596c-6699-11e8-8839-a625e52212fd.png) 10 | 11 | ![DiyToggleChart-Funnel](https://user-images.githubusercontent.com/18508817/40877732-653f6038-66b8-11e8-8248-b5c084d430c0.png) 12 | -------------------------------------------------------------------------------- /blocks/DiyToggleChart/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vue-materials/diy-toggle-chart-block", 3 | "version": "1.0.0", 4 | "description": "v-chart 自定义图表类型切换,支持七种图表类型切换", 5 | "author": "mowatermelon ", 6 | "files": [ 7 | "src/", 8 | "lib/" 9 | ], 10 | "repository": { 11 | "type": "git", 12 | "url": "https://github.com/ice-lab/vue-materials/tree/master/blocks/DiyToggleChart" 13 | }, 14 | "license": "MIT", 15 | "keywords": [ 16 | "ice", 17 | "vue", 18 | "block" 19 | ], 20 | "publishConfig": { 21 | "access": "public", 22 | "registry": "http://registry.npmjs.com" 23 | }, 24 | "dependencies": { 25 | "echarts": "^4.0.4", 26 | "@vue-materials/basic-container": "^1.0.0", 27 | "v-charts": "^1.16.10", 28 | "vue": "^2.5.16" 29 | }, 30 | "blockConfig": { 31 | "name": "diy-toggle-chart", 32 | "title": "diy-toggle-chart", 33 | "categories": [ 34 | "图表" 35 | ], 36 | "screenshot": "https://user-images.githubusercontent.com/18508817/40873801-bf4a596c-6699-11e8-8839-a625e52212fd.png" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /blocks/DiyToggleChart/src/index.js: -------------------------------------------------------------------------------- 1 | import DiyToggleChart from './DiyToggleChart'; 2 | 3 | export default DiyToggleChart; 4 | -------------------------------------------------------------------------------- /blocks/EmptyContent/README.md: -------------------------------------------------------------------------------- 1 | # empty-content 2 | 3 | 简介:无权限提示 4 | 5 | 基于 element-ui 组件的无权限提示 6 | 7 | ![EmptyContent](https://img.alicdn.com/tfs/TB161Wer1uSBuNjy1XcXXcYjFXa-2528-1266.png) 8 | -------------------------------------------------------------------------------- /blocks/EmptyContent/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vue-materials/empty-content-block", 3 | "version": "1.0.1", 4 | "description": "基于element-ui组件的空内容提示", 5 | "author": "mowatermelon ", 6 | "files": ["src/", "lib/"], 7 | "repository": { 8 | "type": "git", 9 | "url": "https://github.com/ice-lab/vue-materials/tree/master/blocks/EmptyContent" 10 | }, 11 | "license": "MIT", 12 | "keywords": ["ice", "vue", "block"], 13 | "publishConfig": { 14 | "access": "public", 15 | "registry": "http://registry.npmjs.com" 16 | }, 17 | "dependencies": { 18 | "@vue-materials/basic-container": "^1.0.0", 19 | "vue": "^2.5.16" 20 | }, 21 | "blockConfig": { 22 | "name": "empty-content", 23 | "title": "空内容提示", 24 | "categories": ["异常"], 25 | "screenshot": 26 | "https://img.alicdn.com/tfs/TB161Wer1uSBuNjy1XcXXcYjFXa-2528-1266.png" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /blocks/EmptyContent/src/index.js: -------------------------------------------------------------------------------- 1 | import EmptyContent from './EmptyContent'; 2 | 3 | export default EmptyContent; 4 | -------------------------------------------------------------------------------- /blocks/FixedTable/README.md: -------------------------------------------------------------------------------- 1 | # fixed-table-block 2 | 3 | 简介:固定表格 4 | 5 | ![截图](https://img.alicdn.com/tfs/TB15b7.pTtYBeNjy1XdXXXXyVXa-1964-660.png) 6 | -------------------------------------------------------------------------------- /blocks/FixedTable/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vue-materials/fixed-table-block", 3 | "version": "1.0.0", 4 | "description": "固定列和表头的表格", 5 | "author": "ice-admin@alibaba-inc.com", 6 | "files": [ 7 | "src/", 8 | "lib/" 9 | ], 10 | "repository": { 11 | "type": "git", 12 | "url": "https://github.com/ice-lab/vue-materials/tree/master/blocks/FixedTable" 13 | }, 14 | "license": "MIT", 15 | "keywords": [ 16 | "ice", 17 | "ice-block" 18 | ], 19 | "publishConfig": { 20 | "access": "public", 21 | "registry": "http://registry.npmjs.com" 22 | }, 23 | "dependencies": { 24 | "@vue-materials/basic-container": "^1.0.0", 25 | "vue": "^2.5.16" 26 | }, 27 | "blockConfig": { 28 | "name": "fixed-table", 29 | "title": "固定表格", 30 | "categories": [ 31 | "表格" 32 | ], 33 | "screenshot": "https://img.alicdn.com/tfs/TB15b7.pTtYBeNjy1XdXXXXyVXa-1964-660.png" 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /blocks/FixedTable/src/index.js: -------------------------------------------------------------------------------- 1 | import FixedTable from './FixedTable'; 2 | 3 | export default FixedTable; 4 | -------------------------------------------------------------------------------- /blocks/FunnelChart/README.md: -------------------------------------------------------------------------------- 1 | # funnel-chart 2 | 3 | 简介:funnel-chart 4 | 5 | v-chart 漏斗图 6 | 7 | ![FunnelChart](https://user-images.githubusercontent.com/18508817/40873590-ae08fab8-6695-11e8-90dd-c600d8f413c6.png) 8 | 9 | # settings 配置项 10 | 11 | | 配置项 | 简介 | 类型 | 备注 | 12 | | --- | --- | --- | --- | 13 | | dimension | 维度 | string | 默认columns第一项为维度 | 14 | | metrics | 指标 | string | 默认columns第二项为指标 | 15 | | dataType | 数据类型 | string | 可选值: KMB, normal, percent | 16 | | sequence | 数据显示顺序 | array | 默认按照数据大小顺序 | 17 | | ascending | 是否显示为金字塔 | boolean | 默认为false | 18 | | digit | 设置数据类型为percent时保留的位数 | number | 默认为2 | 19 | | label | 设置文本标签样式 | object | 内容参考[文档](http://echarts.baidu.com/option.html#series-funnel.label) | 20 | | labelLine | 设置标签的视觉引导线样式 | object | 内容参考[文档](http://echarts.baidu.com/option.html#series-funnel.labelLine) | 21 | | itemStyle | 设置图形样式 | object | 内容参考[文档](http://echarts.baidu.com/option.html#series-funnel.itemStyle) | -------------------------------------------------------------------------------- /blocks/FunnelChart/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vue-materials/funnel-chart-block", 3 | "version": "1.0.0", 4 | "description": "v-chart 漏斗图", 5 | "author": "mowatermelon ", 6 | "files": [ 7 | "src/", 8 | "lib/" 9 | ], 10 | "repository": { 11 | "type": "git", 12 | "url": "https://github.com/ice-lab/vue-materials/tree/master/blocks/FunnelChart" 13 | }, 14 | "license": "MIT", 15 | "keywords": [ 16 | "ice", 17 | "vue", 18 | "block" 19 | ], 20 | "publishConfig": { 21 | "access": "public", 22 | "registry": "http://registry.npmjs.com" 23 | }, 24 | "dependencies": { 25 | "echarts": "^4.0.4", 26 | "@vue-materials/basic-container": "^1.0.0", 27 | "v-charts": "^1.16.10", 28 | "vue": "^2.5.16" 29 | }, 30 | "blockConfig": { 31 | "name": "funnel-chart", 32 | "title": "funnel-chart", 33 | "categories": [ 34 | "图表" 35 | ], 36 | "screenshot": "https://user-images.githubusercontent.com/18508817/40873590-ae08fab8-6695-11e8-90dd-c600d8f413c6.png" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /blocks/FunnelChart/src/FunnelChart.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 33 | 34 | 39 | -------------------------------------------------------------------------------- /blocks/FunnelChart/src/index.js: -------------------------------------------------------------------------------- 1 | import FunnelChart from './FunnelChart'; 2 | 3 | export default FunnelChart; 4 | -------------------------------------------------------------------------------- /blocks/GaugeChart/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vue-materials/gauge-chart-block", 3 | "version": "1.0.0", 4 | "description": "v-chart 仪表盘", 5 | "author": "mowatermelon ", 6 | "files": [ 7 | "src/", 8 | "lib/" 9 | ], 10 | "repository": { 11 | "type": "git", 12 | "url": "https://github.com/ice-lab/vue-materials/tree/master/blocks/GaugeChart" 13 | }, 14 | "license": "MIT", 15 | "keywords": [ 16 | "ice", 17 | "vue", 18 | "block" 19 | ], 20 | "publishConfig": { 21 | "access": "public", 22 | "registry": "http://registry.npmjs.com" 23 | }, 24 | "dependencies": { 25 | "echarts": "^4.0.4", 26 | "@vue-materials/basic-container": "^1.0.0", 27 | "v-charts": "^1.16.10", 28 | "vue": "^2.5.16" 29 | }, 30 | "blockConfig": { 31 | "name": "gauge-chart", 32 | "title": "gauge-chart", 33 | "categories": [ 34 | "图表" 35 | ], 36 | "screenshot": "https://user-images.githubusercontent.com/18508817/40871938-b23c73da-6677-11e8-8944-d85dfbc9de92.png" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /blocks/GaugeChart/src/GaugeChart.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 53 | 54 | 58 | -------------------------------------------------------------------------------- /blocks/GaugeChart/src/index.js: -------------------------------------------------------------------------------- 1 | import GaugeChart from './GaugeChart'; 2 | 3 | export default GaugeChart; 4 | -------------------------------------------------------------------------------- /blocks/HeatmapChart/README.md: -------------------------------------------------------------------------------- 1 | # heatmap-chart 2 | 3 | 简介:heatmap-chart 4 | 5 | v-chart 高德地图热力图 6 | 7 | ![HeatmapChart](https://user-images.githubusercontent.com/18508817/40877885-8890d22c-66ba-11e8-86bd-f1ea0806f2fd.png) 8 | 9 | # settings 配置项 10 | 11 | | 配置项 | 简介 | 类型 | 备注 | 12 | | --- | --- | --- | --- | 13 | | type | 热力图的类型 | string | 可选值:`cartesian`(默认值,直角坐标系), `map`(地图),`bmap`(百度地图) | 14 | | xAxisList | x 轴数据 | array | 默认取数据中的数据中的第一维度的数据 | 15 | | yAxisList | y 轴数据 | array | 默认取数据中的数据中的第二维度的数据 | 16 | | dimension | 维度 | array | 默认为 [columns[0], columns[1]] | 17 | | metrics | 指标 | string | 默认为 columns[2] | 18 | | dataType | 数据类型 | string | 可选值: KMB, normal, percent | 19 | | min | visualMap 中的最小值 | number | 默认取指标中最小的数据 | 20 | | max | visualMap 中的最大值 | number | 默认取指标中最大的数据 | 21 | | digit | 设置数据类型为percent时保留的位数 | number | 默认为2 | 22 | | key | 百度地图 access_key | string | 可[由此](http://lbsyun.baidu.com/apiconsole/key)获取 | 23 | | bmap | 百度地图配置项 | object | 参考[文档](https://github.com/ecomfe/echarts/tree/master/extension/bmap#使用)配置 | 24 | | geo | 地图配置项 | object | 参考[文档](http://echarts.baidu.com/option.html#geo) | 25 | | position | 地图类型 | string | 默认为 `'china'` | 26 | | positionJsonLink | 地图数据源 | string | - | 27 | | beforeRegisterMap | 地图数据注册前执行的函数 | Function | 参数为地图数据,需返回地图数据 | 28 | | beforeRegisterMapOnce | 地图数据注册前执行的函数(仅执行一次) | Function | 参数为地图数据,需返回地图数据 | 29 | | specialAreas | 地图中的位置配置 | object | 将地图中的部分区域缩放到合适的位置,可以使得整个地图的显示更加好看, 用法参考[文档](http://echarts.baidu.com/api.html#echarts.registerMap) | 30 | | mapURLProfix | 位置请求的 URL 前缀 | string | 默认为 `https://unpkg.com/echarts@3.6.2/map/json/` | 31 | | pointSize | 点大小 | number | 默认为 10 | 32 | | blurSize | 模糊大小 | number | 默认为 5 | 33 | | heatColor | visualMap 中的最大值颜色区间 | array | - | 34 | | yAxisName | y 轴名称 | string | - | 35 | | xAxisName | x 轴名称 | string | - | 36 | 37 | > 备注:当不指定指标时,指标的值默认为1。 38 | -------------------------------------------------------------------------------- /blocks/HeatmapChart/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vue-materials/heatmap-chart-block", 3 | "version": "1.0.0", 4 | "description": "v-chart 高德地图热力图", 5 | "author": "mowatermelon ", 6 | "files": [ 7 | "src/", 8 | "lib/" 9 | ], 10 | "repository": { 11 | "type": "git", 12 | "url": "https://github.com/ice-lab/vue-materials/tree/master/blocks/HeatmapChart" 13 | }, 14 | "license": "MIT", 15 | "keywords": [ 16 | "ice", 17 | "vue", 18 | "block" 19 | ], 20 | "publishConfig": { 21 | "access": "public", 22 | "registry": "http://registry.npmjs.com" 23 | }, 24 | "dependencies": { 25 | "echarts": "^4.0.4", 26 | "@vue-materials/basic-container": "^1.0.0", 27 | "v-charts": "^1.16.10", 28 | "vue": "^2.5.16" 29 | }, 30 | "blockConfig": { 31 | "name": "heatmap-chart", 32 | "title": "heatmap-chart", 33 | "categories": [ 34 | "图表" 35 | ], 36 | "screenshot": "https://user-images.githubusercontent.com/18508817/40877885-8890d22c-66ba-11e8-86bd-f1ea0806f2fd.png" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /blocks/HeatmapChart/src/HeatmapChart.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 48 | 49 | 53 | -------------------------------------------------------------------------------- /blocks/HeatmapChart/src/index.js: -------------------------------------------------------------------------------- 1 | import HeatmapChart from './HeatmapChart'; 2 | 3 | export default HeatmapChart; 4 | -------------------------------------------------------------------------------- /blocks/HistogramChart/README.md: -------------------------------------------------------------------------------- 1 | # histogram-chart-block 2 | 3 | 简介:柱状图 4 | 5 | ![截图](https://img.alicdn.com/tfs/TB1Gfs.pTtYBeNjy1XdXXXXyVXa-1944-848.png) 6 | -------------------------------------------------------------------------------- /blocks/HistogramChart/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vue-materials/histogram-chart-block", 3 | "version": "1.0.0", 4 | "description": "v-charts 柱状图", 5 | "author": "ice-admin@alibaba-inc.com", 6 | "files": [ 7 | "src/", 8 | "lib/" 9 | ], 10 | "repository": { 11 | "type": "git", 12 | "url": "https://github.com/ice-lab/vue-materials/tree/master/blocks/HistogramChart" 13 | }, 14 | "license": "MIT", 15 | "keywords": [ 16 | "ice", 17 | "ice-block" 18 | ], 19 | "publishConfig": { 20 | "access": "public", 21 | "registry": "http://registry.npmjs.com" 22 | }, 23 | "dependencies": { 24 | "echarts": "^4.0.4", 25 | "@vue-materials/basic-container": "^1.0.0", 26 | "v-charts": "^1.16.10", 27 | "vue": "^2.5.16" 28 | }, 29 | "blockConfig": { 30 | "name": "histogram-chart", 31 | "title": "柱状图", 32 | "categories": [ 33 | "图表" 34 | ], 35 | "screenshot": "https://img.alicdn.com/tfs/TB1Gfs.pTtYBeNjy1XdXXXXyVXa-1944-848.png" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /blocks/HistogramChart/src/HistogramChart.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 32 | 33 | 38 | -------------------------------------------------------------------------------- /blocks/HistogramChart/src/index.js: -------------------------------------------------------------------------------- 1 | import HistogramChart from './HistogramChart'; 2 | 3 | export default HistogramChart; 4 | -------------------------------------------------------------------------------- /blocks/LineChart/README.md: -------------------------------------------------------------------------------- 1 | # line-chart-block 2 | 3 | 简介:折线图 4 | 5 | ![截图](https://img.alicdn.com/tfs/TB1V0S2pQyWBuNjy0FpXXassXXa-1964-842.png) 6 | -------------------------------------------------------------------------------- /blocks/LineChart/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vue-materials/line-chart-block", 3 | "version": "1.0.0", 4 | "description": "v-charts 折线图", 5 | "author": "ice-admin@alibaba-inc.com", 6 | "files": [ 7 | "src/", 8 | "lib/" 9 | ], 10 | "repository": { 11 | "type": "git", 12 | "url": "https://github.com/ice-lab/vue-materials/tree/master/blocks/LineChart" 13 | }, 14 | "license": "MIT", 15 | "keywords": [ 16 | "ice", 17 | "ice-block" 18 | ], 19 | "publishConfig": { 20 | "access": "public", 21 | "registry": "http://registry.npmjs.com" 22 | }, 23 | "dependencies": { 24 | "echarts": "^4.0.4", 25 | "@vue-materials/basic-container": "^1.0.0", 26 | "v-charts": "^1.16.10", 27 | "vue": "^2.5.16" 28 | }, 29 | "blockConfig": { 30 | "name": "line-chart", 31 | "title": "折线图", 32 | "categories": [ 33 | "图表" 34 | ], 35 | "screenshot": "https://img.alicdn.com/tfs/TB1V0S2pQyWBuNjy0FpXXassXXa-1964-842.png" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /blocks/LineChart/src/LineChart.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 39 | 40 | 45 | -------------------------------------------------------------------------------- /blocks/LineChart/src/index.js: -------------------------------------------------------------------------------- 1 | import LineChart from './LineChart'; 2 | 3 | export default LineChart; 4 | -------------------------------------------------------------------------------- /blocks/MapToggleChart/README.md: -------------------------------------------------------------------------------- 1 | # map-toggle-chart 2 | 3 | 简介:map-toggle-chart 4 | 5 | 基于v-chart 地图类型切换,amap支持主题类型切换,bmap支持底图切换。 6 | 7 | ![MapToggleChart-AMap-01](https://user-images.githubusercontent.com/18508817/40878035-7d88664e-66bd-11e8-8dd3-0b997f3f3800.png) 8 | 9 | ![MapToggleChart-AMap-02](https://user-images.githubusercontent.com/18508817/40878048-b260eecc-66bd-11e8-80ff-2dc0bfc5d800.png) 10 | 11 | ![MapToggleChart-BMap-01](https://user-images.githubusercontent.com/18508817/40877954-fed6a212-66bb-11e8-8e14-9081bc598cd2.png) 12 | -------------------------------------------------------------------------------- /blocks/MapToggleChart/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vue-materials/map-toggle-chart-block", 3 | "version": "1.0.0", 4 | "description": "基于v-chart 地图类型切换,amap支持主题类型切换,bmap支持底图切换", 5 | "author": "mowatermelon ", 6 | "files": [ 7 | "src/", 8 | "lib/" 9 | ], 10 | "repository": { 11 | "type": "git", 12 | "url": "https://github.com/ice-lab/vue-materials/tree/master/blocks/MapToggleChart" 13 | }, 14 | "license": "MIT", 15 | "keywords": [ 16 | "ice", 17 | "vue", 18 | "block" 19 | ], 20 | "publishConfig": { 21 | "access": "public", 22 | "registry": "http://registry.npmjs.com" 23 | }, 24 | "dependencies": { 25 | "echarts": "^4.0.4", 26 | "@vue-materials/basic-container": "^1.0.0", 27 | "v-charts": "^1.16.10", 28 | "vue": "^2.5.16" 29 | }, 30 | "blockConfig": { 31 | "name": "map-toggle-chart", 32 | "title": "map-toggle-chart", 33 | "categories": [ 34 | "图表" 35 | ], 36 | "screenshot": "https://user-images.githubusercontent.com/18508817/40878048-b260eecc-66bd-11e8-80ff-2dc0bfc5d800.png" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /blocks/MapToggleChart/src/index.js: -------------------------------------------------------------------------------- 1 | import MapToggleChart from './MapToggleChart'; 2 | 3 | export default MapToggleChart; 4 | -------------------------------------------------------------------------------- /blocks/NormalToggleChart/README.md: -------------------------------------------------------------------------------- 1 | # normal-toggle-chart 2 | 3 | 简介:normal-toggle-chart 4 | 5 | v-chart 自带的图表切换 6 | 7 | ![NormalToggleChart-Line](https://user-images.githubusercontent.com/18508817/40877809-61862066-66b9-11e8-964f-ef44f96f499b.png) 8 | 9 | ![NormalToggleChart-Bar](https://user-images.githubusercontent.com/18508817/40877799-2d529a0e-66b9-11e8-8d78-81c072c61dc7.png) -------------------------------------------------------------------------------- /blocks/NormalToggleChart/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vue-materials/normal-toggle-chart-block", 3 | "version": "1.0.0", 4 | "description": "v-chart 自带的图表切换", 5 | "author": "mowatermelon ", 6 | "files": [ 7 | "src/", 8 | "lib/" 9 | ], 10 | "repository": { 11 | "type": "git", 12 | "url": "https://github.com/ice-lab/vue-materials/tree/master/blocks/NormalToggleChart" 13 | }, 14 | "license": "MIT", 15 | "keywords": [ 16 | "ice", 17 | "vue", 18 | "block" 19 | ], 20 | "publishConfig": { 21 | "access": "public", 22 | "registry": "http://registry.npmjs.com" 23 | }, 24 | "dependencies": { 25 | "echarts": "^4.0.4", 26 | "@vue-materials/basic-container": "^1.0.0", 27 | "v-charts": "^1.16.10", 28 | "vue": "^2.5.16" 29 | }, 30 | "blockConfig": { 31 | "name": "normal-toggle-chart", 32 | "title": "normal-toggle-chart", 33 | "categories": [ 34 | "图表" 35 | ], 36 | "screenshot": "https://user-images.githubusercontent.com/18508817/40877809-61862066-66b9-11e8-964f-ef44f96f499b.png" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /blocks/NormalToggleChart/src/NormalToggleChart.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 45 | 46 | 51 | -------------------------------------------------------------------------------- /blocks/NormalToggleChart/src/index.js: -------------------------------------------------------------------------------- 1 | import NormalToggleChart from './NormalToggleChart'; 2 | 3 | export default NormalToggleChart; 4 | -------------------------------------------------------------------------------- /blocks/NotPermission/README.md: -------------------------------------------------------------------------------- 1 | # not-permission 2 | 3 | 简介:无权限提示 4 | 5 | 基于element-ui组件的无权限提示 6 | 7 | ![NotPermission](https://user-images.githubusercontent.com/18508817/40156536-aa55aa7c-59cc-11e8-971a-ecc339655041.png) 8 | -------------------------------------------------------------------------------- /blocks/NotPermission/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vue-materials/not-permission-block", 3 | "version": "1.0.1", 4 | "description": "基于element-ui组件的无权限提示", 5 | "author": "mowatermelon ", 6 | "files": ["src/", "lib/"], 7 | "repository": { 8 | "type": "git", 9 | "url": "https://github.com/ice-lab/vue-materials/tree/master/blocks/NotPermission" 10 | }, 11 | "license": "MIT", 12 | "keywords": ["ice", "vue", "block"], 13 | "publishConfig": { 14 | "access": "public", 15 | "registry": "http://registry.npmjs.com" 16 | }, 17 | "dependencies": { 18 | "@vue-materials/basic-container": "^1.0.0", 19 | "vue": "^2.5.16" 20 | }, 21 | "blockConfig": { 22 | "name": "not-permission", 23 | "title": "无权限提示", 24 | "categories": ["异常"], 25 | "screenshot": 26 | "https://user-images.githubusercontent.com/18508817/40156536-aa55aa7c-59cc-11e8-971a-ecc339655041.png" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /blocks/NotPermission/src/index.js: -------------------------------------------------------------------------------- 1 | import NotPermission from './NotPermission'; 2 | 3 | export default NotPermission; 4 | -------------------------------------------------------------------------------- /blocks/PieChart/README.md: -------------------------------------------------------------------------------- 1 | # pie-chart 2 | 3 | 简介:pie-chart 4 | 5 | v-chart 饼图 6 | 7 | ![PieChart](https://user-images.githubusercontent.com/18508817/40873980-252d4850-669c-11e8-9e46-b44212c6f073.png) 8 | 9 | # settings 配置项 10 | 11 | | 配置项 | 简介 | 类型 | 备注 | 12 | | --- | --- | --- | --- | 13 | | dimension | 维度 | string | 默认columns第一项为维度 | 14 | | metrics | 指标 | string | 默认columns第二项为指标 | 15 | | dataType | 数据类型 | string | 可选值: KMB, normal, percent | 16 | | legendLimit | legend显示数量限制 | number | legend数量过多会导致饼图样式错误,限制legend最大值并且当超过此值时,隐藏legend可以解决这个问题 | 17 | | selectedMode | 选中模式 | string | 可选值:single, multiple,默认为false | 18 | | hoverAnimation | 是否开启 hover 在扇区上的放大动画效果 | boolean | 默认值为true | 19 | | radius | 饼图半径 | number | - | 20 | | offsetY | 纵向偏移量 | number | - | 21 | | digit | 设置数据类型为percent时保留的位数 | number | 默认为2 | 22 | | roseType | 显示为南丁格尔玫瑰图 | string | 默认不展示为南丁格尔玫瑰图,可设置为`'radius', 'area'` | 23 | | label | 饼图图形上的文本标签 | object | 内容参考[文档](http://echarts.baidu.com/option.html#series-pie.label) | 24 | | labelLine | 标签的视觉引导线样式 | object | 内容参考[文档](http://echarts.baidu.com/option.html#series-pie.labelLine) | 25 | | itemStyle | 图形样式 | object | 内容参考[文档](http://echarts.baidu.com/option.html#series-pie.itemStyle)| 26 | | level | 多圆饼图时设置 | array | - | 27 | | limitShowNum | 设置超过此数字时使用‘其他’代替 | number | 此时数据会按照由大到小顺序显示 | 28 | 29 | > 备注1. level 的值接受二维数组,例如:`[['a', 'b'], ['c', 'd']]`, 表示的含义是内层展示的是维度中的`'a', 'b'`的指标加在一起组成的饼图,外层为`'c', 'd'`的指标加在一起组成的环图。 -------------------------------------------------------------------------------- /blocks/PieChart/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vue-materials/pie-chart-block", 3 | "version": "1.0.0", 4 | "description": "v-chart 饼图", 5 | "author": "mowatermelon ", 6 | "files": [ 7 | "src/", 8 | "lib/" 9 | ], 10 | "repository": { 11 | "type": "git", 12 | "url": "https://github.com/ice-lab/vue-materials/tree/master/blocks/PieChart" 13 | }, 14 | "license": "MIT", 15 | "keywords": [ 16 | "ice", 17 | "vue", 18 | "block" 19 | ], 20 | "publishConfig": { 21 | "access": "public", 22 | "registry": "http://registry.npmjs.com" 23 | }, 24 | "dependencies": { 25 | "echarts": "^4.0.4", 26 | "@vue-materials/basic-container": "^1.0.0", 27 | "v-charts": "^1.16.10", 28 | "vue": "^2.5.16" 29 | }, 30 | "blockConfig": { 31 | "name": "pie-chart", 32 | "title": "pie-chart", 33 | "categories": [ 34 | "图表" 35 | ], 36 | "screenshot": "https://user-images.githubusercontent.com/18508817/40873980-252d4850-669c-11e8-9e46-b44212c6f073.png" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /blocks/PieChart/src/PieChart.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 39 | 40 | 44 | -------------------------------------------------------------------------------- /blocks/PieChart/src/index.js: -------------------------------------------------------------------------------- 1 | import PieChart from './PieChart'; 2 | 3 | export default PieChart; 4 | -------------------------------------------------------------------------------- /blocks/RadarChart/README.md: -------------------------------------------------------------------------------- 1 | # radar-chart 2 | 3 | 简介:radar-chart 4 | 5 | v-chart 雷达图 6 | 7 | ![RadarChart](https://user-images.githubusercontent.com/18508817/40873504-a9e4cf68-6693-11e8-8ee4-93ba91958204.png) 8 | 9 | # settings 配置项 10 | 11 | | 配置项 | 简介 | 类型 | 备注 | 12 | | --- | --- | --- | --- | 13 | | dimension | 维度 | string | 默认columns第一项为维度 | 14 | | metrics | 指标 | array | 默认columns第二项起为指标 | 15 | | dataType | 数据类型 | object | 可选值: KMB, normal, percent | 16 | | digit | 设置数据类型为percent时保留的位数 | number | 默认为2 | 17 | | label | 图形上的文本标签 | object | 内容参考[文档](http://echarts.baidu.com/option.html#series-radar.label) | 18 | | itemStyle | 折线拐点标志的样式 | object | 内容参考[文档](http://echarts.baidu.com/option.html#series-radar.itemStyle) | 19 | | lineStyle | 线条样式 | object | 内容参考[文档](http://echarts.baidu.com/option.html#series-radar.lineStyle) | 20 | | areaStyle | 区域填充样式 | object | 内容参考[文档](http://echarts.baidu.com/option.html#series-radar.areaStyle) | 21 | 22 | > 备注:dataType中直接设置对应维度的数据类型,例如示例的`{ '占比': 'percent' }`,即将占比数据设置为百分比类型 -------------------------------------------------------------------------------- /blocks/RadarChart/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vue-materials/radar-chart-block", 3 | "version": "1.0.0", 4 | "description": "v-chart 雷达图", 5 | "author": "mowatermelon ", 6 | "files": [ 7 | "src/", 8 | "lib/" 9 | ], 10 | "repository": { 11 | "type": "git", 12 | "url": "https://github.com/ice-lab/vue-materials/tree/master/blocks/RadarChart" 13 | }, 14 | "license": "MIT", 15 | "keywords": [ 16 | "ice", 17 | "vue", 18 | "block" 19 | ], 20 | "publishConfig": { 21 | "access": "public", 22 | "registry": "http://registry.npmjs.com" 23 | }, 24 | "dependencies": { 25 | "echarts": "^4.0.4", 26 | "@vue-materials/basic-container": "^1.0.0", 27 | "v-charts": "^1.16.10", 28 | "vue": "^2.5.16" 29 | }, 30 | "blockConfig": { 31 | "name": "radar-chart", 32 | "title": "radar-chart", 33 | "categories": [ 34 | "图表" 35 | ], 36 | "screenshot": "https://user-images.githubusercontent.com/18508817/40873504-a9e4cf68-6693-11e8-8ee4-93ba91958204.png" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /blocks/RadarChart/src/RadarChart.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 41 | 42 | 46 | -------------------------------------------------------------------------------- /blocks/RadarChart/src/index.js: -------------------------------------------------------------------------------- 1 | import RadarChart from './RadarChart'; 2 | 3 | export default RadarChart; 4 | -------------------------------------------------------------------------------- /blocks/RingChart/README.md: -------------------------------------------------------------------------------- 1 | # ring-chart 2 | 3 | 简介:ring-chart 4 | 5 | v-chart 环图 6 | 7 | ![RingChart](https://user-images.githubusercontent.com/18508817/40873835-5823c2fe-669a-11e8-9c25-d8e749884b21.png) 8 | 9 | # settings 配置项 10 | 11 | | 配置项 | 简介 | 类型 | 备注 | 12 | | --- | --- | --- | --- | 13 | | dimension | 维度 | string | 默认columns第一项为维度 | 14 | | metrics | 指标 | string | 默认columns第二项为指标 | 15 | | dataType | 数据类型 | string | 可选值: KMB, normal, percent | 16 | | legendLimit | legend显示数量限制 | number | legend数量过多会导致环图样式错误,限制legend最大值并且当超过此值时,隐藏legend可以解决这个问题 | 17 | | selectedMode | 选中模式 | string | 可选值:single, multiple,默认为false | 18 | | hoverAnimation | 是否开启 hover 在扇区上的放大动画效果 | boolean | 默认值为true | 19 | | radius | 环图外半径与内半径 | array | - | 20 | | offsetY | 纵向偏移量 | number | - | 21 | | digit | 设置数据类型为percent时保留的位数 | number | 默认为2 | 22 | | roseType | 显示为南丁格尔玫瑰图 | string | 默认不展示为南丁格尔玫瑰图,可设置为`'radius', 'area'` | 23 | | label | 环图图形上的文本标签 | object | 内容参考[文档](http://echarts.baidu.com/option.html#series-pie.label) | 24 | | labelLine | 标签的视觉引导线样式 | object | 内容参考[文档](http://echarts.baidu.com/option.html#series-pie.labelLine) | 25 | | itemStyle | 图形样式 | object | 内容参考[文档](http://echarts.baidu.com/option.html#series-pie.itemStyle)| 26 | | limitShowNum | 设置超过此数字时使用‘其他’代替 | number | 此时数据会按照由大到小顺序显示 | -------------------------------------------------------------------------------- /blocks/RingChart/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vue-materials/ring-chart-block", 3 | "version": "1.0.0", 4 | "description": "v-chart 环图", 5 | "author": "mowatermelon ", 6 | "files": [ 7 | "src/", 8 | "lib/" 9 | ], 10 | "repository": { 11 | "type": "git", 12 | "url": "https://github.com/ice-lab/vue-materials/tree/master/blocks/RingChart" 13 | }, 14 | "license": "MIT", 15 | "keywords": [ 16 | "ice", 17 | "vue", 18 | "block" 19 | ], 20 | "publishConfig": { 21 | "access": "public", 22 | "registry": "http://registry.npmjs.com" 23 | }, 24 | "dependencies": { 25 | "echarts": "^4.0.4", 26 | "@vue-materials/basic-container": "^1.0.0", 27 | "v-charts": "^1.16.10", 28 | "vue": "^2.5.16" 29 | }, 30 | "blockConfig": { 31 | "name": "ring-chart", 32 | "title": "ring-chart", 33 | "categories": [ 34 | "图表" 35 | ], 36 | "screenshot": "https://user-images.githubusercontent.com/18508817/40873835-5823c2fe-669a-11e8-9c25-d8e749884b21.png" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /blocks/RingChart/src/RingChart.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 37 | 38 | 42 | -------------------------------------------------------------------------------- /blocks/RingChart/src/index.js: -------------------------------------------------------------------------------- 1 | import RingChart from './RingChart'; 2 | 3 | export default RingChart; 4 | -------------------------------------------------------------------------------- /blocks/ScatterChart/README.md: -------------------------------------------------------------------------------- 1 | # scatter-chart 2 | 3 | 简介:scatter-chart 4 | 5 | v-chart 散点图 6 | 7 | ![ScatterChart](https://user-images.githubusercontent.com/18508817/40872375-eca28c00-667f-11e8-9af9-d925384e3553.png) 8 | 9 | # settings 配置项 10 | 11 | | 配置项 | 简介 | 类型 | 备注 | 12 | | --- | --- | --- | --- | 13 | | dimension | 维度 | string | 默认 columns[0] | 14 | | metrics | 指标 | array | 默认 [columns[0], columns[1]] | 15 | | dataType | 数据类型 | object | - | 16 | | xAxisType | x轴类型 | string | 可选值: category, value, time, log | 17 | | xAxisName | x轴标题 | string | - | 18 | | yAxisName | y轴标题 | string | - | 19 | | digit | 设置数据类型为percent时保留的位数 | number | 默认为2 | 20 | | labelMap | 设置指标的别名 | object | - | 21 | | legendName | 设置图表上方图例的别名 | object | - | 22 | | tooltipTrigger | 提示框的触发方式 | string | 可选值: item, axis | 23 | | axisVisible | 是否显示坐标轴 | boolean | - | 24 | | symbolSizeMax | 气泡最大值 | number | 默认为50 | 25 | | symbol | 标记的图形 | string | 内容参考[文档](http://echarts.baidu.com/option.html#series-scatter.symbol) | 26 | | symbolSize | 标记的大小 | number, array, Function | 内容参考[文档](http://echarts.baidu.com/option.html#series-scatter.symbolSize) | 27 | | symbolRotate | 标记的旋转角度 | number | 内容参考[文档](http://echarts.baidu.com/option.html#series-scatter.symbolRotate) | 28 | | symbolOffset | 标记相对于原本位置的偏移 | array | 内容参考[文档](http://echarts.baidu.com/option.html#series-scatter.symbolOffset) | 29 | | cursor | 鼠标悬浮时在图形元素上时鼠标的样式 | string | 内容参考[文档](http://echarts.baidu.com/option.html#series-scatter.cursor) | 30 | | scale | 是否是脱离 0 值比例 | boolean | - | 31 | | min | y轴最小值 | number | - | 32 | | max | y轴最大值 | number | - | 33 | -------------------------------------------------------------------------------- /blocks/ScatterChart/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vue-materials/scatter-chart-block", 3 | "version": "1.0.0", 4 | "description": "v-chart 散点图", 5 | "author": "mowatermelon ", 6 | "files": [ 7 | "src/", 8 | "lib/" 9 | ], 10 | "repository": { 11 | "type": "git", 12 | "url": "https://github.com/ice-lab/vue-materials/tree/master/blocks/ScatterChart" 13 | }, 14 | "license": "MIT", 15 | "keywords": [ 16 | "ice", 17 | "vue", 18 | "block" 19 | ], 20 | "publishConfig": { 21 | "access": "public", 22 | "registry": "http://registry.npmjs.com" 23 | }, 24 | "dependencies": { 25 | "echarts": "^4.0.4", 26 | "@vue-materials/basic-container": "^1.0.0", 27 | "v-charts": "^1.16.10", 28 | "vue": "^2.5.16" 29 | }, 30 | "blockConfig": { 31 | "name": "scatter-chart", 32 | "title": "scatter-chart", 33 | "categories": [ 34 | "图表" 35 | ], 36 | "screenshot": "https://user-images.githubusercontent.com/18508817/40872375-eca28c00-667f-11e8-9af9-d925384e3553.png" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /blocks/ScatterChart/src/ScatterChart.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 33 | 34 | 38 | -------------------------------------------------------------------------------- /blocks/ScatterChart/src/index.js: -------------------------------------------------------------------------------- 1 | import ScatterChart from './ScatterChart'; 2 | 3 | export default ScatterChart; 4 | -------------------------------------------------------------------------------- /blocks/SelectTable/README.md: -------------------------------------------------------------------------------- 1 | # select-table 2 | 3 | 简介:多选表格 4 | 5 | 多选表格与批量操作 6 | 7 | ![SelectTable](https://user-images.githubusercontent.com/6414178/44146037-6cf5df18-a0c0-11e8-824b-b8d12eddeeaa.png) 8 | -------------------------------------------------------------------------------- /blocks/SelectTable/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vue-materials/select-table-block", 3 | "version": "1.0.0", 4 | "description": "多选表格", 5 | "author": "Yuan Fu ", 6 | "files": [ 7 | "src/", 8 | "lib/" 9 | ], 10 | "repository": { 11 | "type": "git", 12 | "url": "https://github.com/ice-lab/vue-materials/tree/master/blocks/SelectTable" 13 | }, 14 | "license": "MIT", 15 | "keywords": [ 16 | "ice", 17 | "vue", 18 | "block" 19 | ], 20 | "publishConfig": { 21 | "access": "public", 22 | "registry": "http://registry.npmjs.com" 23 | }, 24 | "dependencies": { 25 | "@vue-materials/basic-container": "^1.0.0", 26 | "vue": "^2.5.16" 27 | }, 28 | "blockConfig": { 29 | "name": "select-table", 30 | "title": "多选表格", 31 | "categories": [ 32 | "表格" 33 | ], 34 | "screenshot": "https://user-images.githubusercontent.com/6414178/44146037-6cf5df18-a0c0-11e8-824b-b8d12eddeeaa.png" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /blocks/SelectTable/src/index.js: -------------------------------------------------------------------------------- 1 | import SelectTable from './SelectTable'; 2 | 3 | export default SelectTable; 4 | -------------------------------------------------------------------------------- /blocks/SimpleFooter/README.md: -------------------------------------------------------------------------------- 1 | # simple-footer 2 | 3 | 简介:简单页脚 4 | 5 | LOGO和导航组合的页脚 6 | 7 | ![截图](https://img.alicdn.com/tfs/TB1rnmNouuSBuNjy1XcXXcYjFXa-2390-170.png) 8 | -------------------------------------------------------------------------------- /blocks/SimpleFooter/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vue-materials/simple-footer-block", 3 | "version": "0.1.0", 4 | "description": "LOGO和导航组合的页脚", 5 | "author": "savokiss ", 6 | "files": [ 7 | "src/", 8 | "lib/" 9 | ], 10 | "repository": { 11 | "type": "git", 12 | "url": "https://github.com/ice-lab/vue-materials/tree/master/blocks/SimpleFooter" 13 | }, 14 | "license": "MIT", 15 | "keywords": [ 16 | "ice", 17 | "vue", 18 | "block" 19 | ], 20 | "publishConfig": { 21 | "access": "public", 22 | "registry": "http://registry.npmjs.com" 23 | }, 24 | "dependencies": { 25 | "@vue-materials/basic-container": "^1.0.0", 26 | "normalize.css": "^8.0.0", 27 | "vue": "^2.5.16" 28 | }, 29 | "blockConfig": { 30 | "name": "simple-footer", 31 | "title": "简单页脚", 32 | "categories": [ 33 | "其他" 34 | ], 35 | "screenshot": "https://img.alicdn.com/tfs/TB1rnmNouuSBuNjy1XcXXcYjFXa-2390-170.png" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /blocks/SimpleFooter/src/index.js: -------------------------------------------------------------------------------- 1 | import SimpleFooter from './SimpleFooter'; 2 | 3 | export default SimpleFooter; 4 | -------------------------------------------------------------------------------- /blocks/TabTable/README.md: -------------------------------------------------------------------------------- 1 | # tab-table 2 | 3 | 简介:基于element的标签页表格组合 4 | 5 | 基于element的标签页表格组合 6 | 7 | ![截图](https://img.alicdn.com/tfs/TB1IYWRXeuSBuNjy1XcXXcYjFXa-1902-906.png) 8 | -------------------------------------------------------------------------------- /blocks/TabTable/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vue-materials/tab-table-block", 3 | "version": "1.0.0", 4 | "description": "基于element的标签页表格组合", 5 | "author": "james-cain ", 6 | "files": [ 7 | "src/", 8 | "lib/" 9 | ], 10 | "repository": { 11 | "type": "git", 12 | "url": "https://github.com/ice-lab/vue-materials/tree/master/blocks/TabTable" 13 | }, 14 | "license": "MIT", 15 | "keywords": [ 16 | "ice", 17 | "vue", 18 | "block" 19 | ], 20 | "publishConfig": { 21 | "access": "public", 22 | "registry": "http://registry.npmjs.com" 23 | }, 24 | "dependencies": { 25 | "@vue-materials/basic-container": "^1.0.0", 26 | "vue": "^2.5.16" 27 | }, 28 | "blockConfig": { 29 | "name": "tab-table", 30 | "title": "基于element的标签页表格组合", 31 | "categories": [ 32 | "表格" 33 | ], 34 | "screenshot": "https://img.alicdn.com/tfs/TB1IYWRXeuSBuNjy1XcXXcYjFXa-1902-906.png" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /blocks/TabTable/src/components/DeleteBalloon.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 46 | -------------------------------------------------------------------------------- /blocks/TabTable/src/index.js: -------------------------------------------------------------------------------- 1 | import TabTable from './TabTable'; 2 | 3 | export default TabTable; 4 | -------------------------------------------------------------------------------- /blocks/TagMessageList/README.md: -------------------------------------------------------------------------------- 1 | # tag-message-list 2 | 3 | 简介:标签消息列表 4 | 5 | 标签消息列表 6 | 7 | ![截图](https://user-images.githubusercontent.com/1523060/39664002-246a6496-50af-11e8-996f-ed203d7ad564.png) 8 | -------------------------------------------------------------------------------- /blocks/TagMessageList/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vue-materials/tag-message-list-block", 3 | "version": "1.0.0", 4 | "description": "标签消息列表", 5 | "author": { 6 | "name": "sjy", 7 | "email": "shijianyue47@gmail.com" 8 | }, 9 | "files": [ 10 | "src/", 11 | "lib/" 12 | ], 13 | "repository": { 14 | "type": "git", 15 | "url": "https://github.com/ice-lab/vue-materials/tree/master/blocks/TagMessageList" 16 | }, 17 | "license": "MIT", 18 | "keywords": [ 19 | "ice", 20 | "vue", 21 | "block" 22 | ], 23 | "publishConfig": { 24 | "access": "public", 25 | "registry": "http://registry.npmjs.com" 26 | }, 27 | "dependencies": { 28 | "@vue-materials/basic-container": "^1.0.0", 29 | "normalize.css": "^8.0.0", 30 | "vue": "^2.5.16" 31 | }, 32 | "blockConfig": { 33 | "name": "tag-message-list", 34 | "title": "标签消息列表", 35 | "categories": [ 36 | "列表" 37 | ], 38 | "screenshot": "https://user-images.githubusercontent.com/1523060/39664002-246a6496-50af-11e8-996f-ed203d7ad564.png" 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /blocks/TagMessageList/src/index.js: -------------------------------------------------------------------------------- 1 | import TagMessageList from './TagMessageList'; 2 | 3 | export default TagMessageList; 4 | -------------------------------------------------------------------------------- /blocks/UserLogin/README.md: -------------------------------------------------------------------------------- 1 | # user-login 2 | 3 | 简介:登录页 4 | 5 | ![截图](https://img.alicdn.com/tfs/TB1WlGbXMmTBuNjy1XbXXaMrVXa-2868-1602.png) -------------------------------------------------------------------------------- /blocks/UserLogin/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vue-materials/user-login-block", 3 | "version": "1.0.1", 4 | "description": "基于element-ui组件的用户登录界面", 5 | "author": "smallwei <1634566606@qq.com>", 6 | "files": [ 7 | "src/", 8 | "lib/" 9 | ], 10 | "repository": { 11 | "type": "git", 12 | "url": "https://github.com/ice-lab/vue-materials/tree/master/blocks/UserLogin" 13 | }, 14 | "license": "MIT", 15 | "keywords": [ 16 | "ice", 17 | "ice-block" 18 | ], 19 | "publishConfig": { 20 | "access": "public", 21 | "registry": "http://registry.npmjs.com" 22 | }, 23 | "dependencies": { 24 | "@vue-materials/basic-container": "^1.0.0", 25 | "normalize.css": "^8.0.0", 26 | "vue": "^2.5.16" 27 | }, 28 | "blockConfig": { 29 | "name": "user-login", 30 | "title": "登录页", 31 | "categories": [ 32 | "登录页" 33 | ], 34 | "screenshot": "https://img.alicdn.com/tfs/TB1WlGbXMmTBuNjy1XbXXaMrVXa-2868-1602.png" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /blocks/UserLogin/src/index.js: -------------------------------------------------------------------------------- 1 | import UserLogin from './UserLogin'; 2 | 3 | export default UserLogin; 4 | -------------------------------------------------------------------------------- /blocks/WaterfallChart/README.md: -------------------------------------------------------------------------------- 1 | # waterfall-chart 2 | 3 | 简介:waterfall-chart 4 | 5 | v-chart 瀑布图 6 | 7 | ![WaterfallChart](https://user-images.githubusercontent.com/6414178/44137279-61c8508a-a0a2-11e8-9a66-28f15c6038a6.png) 8 | 9 | # settings 配置项 10 | 11 | | 配置项 | 简介 | 类型 | 备注 | 12 | | --- | --- | --- | --- | 13 | | dimension | 维度 | string | 默认columns第一项为维度 | 14 | | metrics | 指标 | string | 默认columns第二项为指标 | 15 | | dataType | 数据类型 | string | 可选值: KMB, normal, percent | 16 | | totalNum | 总量 | number | 默认瀑布图总量为所有数据的和 | 17 | | totalName | 总量的显示文案 | string | 默认显示总计 | 18 | | remainName | 剩余的显示文案 | string | 默认显示其他 | 19 | | digit | 设置数据类型为percent时保留的位数 | number | 默认为2 | 20 | -------------------------------------------------------------------------------- /blocks/WaterfallChart/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vue-materials/waterfall-chart-block", 3 | "version": "1.0.0", 4 | "description": "v-chart 瀑布图", 5 | "author": "Yuan Fu ", 6 | "files": [ 7 | "src/", 8 | "lib/" 9 | ], 10 | "repository": { 11 | "type": "git", 12 | "url": "https://github.com/ice-lab/vue-materials/tree/master/blocks/WaterfallChart" 13 | }, 14 | "license": "MIT", 15 | "keywords": [ 16 | "ice", 17 | "vue", 18 | "block" 19 | ], 20 | "publishConfig": { 21 | "access": "public", 22 | "registry": "http://registry.npmjs.com" 23 | }, 24 | "dependencies": { 25 | "echarts": "^4.0.4", 26 | "@vue-materials/basic-container": "^1.0.0", 27 | "v-charts": "^1.16.10", 28 | "vue": "^2.5.16" 29 | }, 30 | "blockConfig": { 31 | "name": "waterfall-chart", 32 | "title": "waterfall-chart", 33 | "categories": [ 34 | "图表" 35 | ], 36 | "screenshot": "https://user-images.githubusercontent.com/6414178/44137279-61c8508a-a0a2-11e8-9a66-28f15c6038a6.png" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /blocks/WaterfallChart/src/WaterfallChart.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 38 | 39 | 43 | -------------------------------------------------------------------------------- /blocks/WaterfallChart/src/index.js: -------------------------------------------------------------------------------- 1 | import WaterfallChart from './WaterfallChart'; 2 | 3 | export default WaterfallChart; 4 | -------------------------------------------------------------------------------- /components/BasicContainer/README.md: -------------------------------------------------------------------------------- 1 | # basic-container 2 | 3 | 简介:区块容器组件 4 | 5 | ![截图](https://img.alicdn.com/tfs/TB1fCIGnxSYBuNjSspjXXX73VXa-1960-716.png) 6 | -------------------------------------------------------------------------------- /components/BasicContainer/index.js: -------------------------------------------------------------------------------- 1 | import BasicContainer from './src'; 2 | 3 | export default BasicContainer; 4 | -------------------------------------------------------------------------------- /components/BasicContainer/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vue-materials/basic-container", 3 | "version": "1.0.0", 4 | "description": "", 5 | "author": "ice-admin@alibaba-inc.com", 6 | "main": "index.js", 7 | "repository": { 8 | "type": "git", 9 | "url": "https://github.com/ice-lab/vue-materials/tree/master/components/BasicContainer" 10 | }, 11 | "license": "MIT", 12 | "keywords": [ 13 | "ice", 14 | "component" 15 | ], 16 | "publishConfig": { 17 | "access": "public", 18 | "registry": "http://registry.npmjs.com" 19 | }, 20 | "dependencies": { 21 | "vue": "^2.5.16" 22 | }, 23 | "componentConfig": { 24 | "name": "basic-container", 25 | "title": "基础容器" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /components/BasicContainer/src/BasicContainer.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 12 | 13 | 21 | -------------------------------------------------------------------------------- /components/BasicContainer/src/index.js: -------------------------------------------------------------------------------- 1 | import BasicContainer from './BasicContainer'; 2 | 3 | export default BasicContainer; 4 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "version": "1.0.2", 4 | "kitVersion": "3.x", 5 | "scripts": { 6 | "upload-oss": "node scripts/upload-oss.js", 7 | "generate": "iceworks generate", 8 | "publish:packages": "ts-node ./scripts/publish-packages.ts", 9 | "generate:ci": "LOG_LEVEL=verbose REGISTRY=https://registry.npmjs.org iceworks generate", 10 | "lint": "eslint --cache --ext .js ./", 11 | "deploy": "iceworks -V && npm run generate:ci && npm run upload-oss", 12 | "prepublishOnly": "npm run generate" 13 | }, 14 | "dependencies": { 15 | "@iceworks/spec": "^1.4.2", 16 | "@vue/cli-service": "^3.5.3", 17 | "@vue/eslint-config-airbnb": "^4.0.0", 18 | "@vue/eslint-config-standard": "^4.0.0", 19 | "ali-oss": "^6.1.0", 20 | "axios": "^0.21.4", 21 | "babel-eslint": "^8.1.2", 22 | "eslint": "^7", 23 | "eslint-plugin-vue": "^5.2.2", 24 | "fs-extra": "^10.0.0", 25 | "globby": "^11.0.4", 26 | "ice-npm-utils": "^2.1.2", 27 | "iceworks": "^3.1.2", 28 | "request": "^2.88.0", 29 | "ts-node": "^10.2.1", 30 | "typescript": "^4.4.3", 31 | "vue-template-compiler": "^2.6.10" 32 | }, 33 | "materialConfig": { 34 | "type": "vue" 35 | }, 36 | "devDependencies": { 37 | "@types/fs-extra": "^9.0.13" 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /scaffolds/admin-lite/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | [ 4 | "@babel/preset-env", 5 | { 6 | "targets": { 7 | "browsers": [ 8 | "> 5%", 9 | "last 2 versions", 10 | "not ie <= 8" 11 | ] 12 | }, 13 | "modules": false, 14 | "exclude": [ 15 | "transform-regenerator" 16 | ] 17 | } 18 | ] 19 | ], 20 | "plugins": [ 21 | "@babel/plugin-syntax-dynamic-import", 22 | "@babel/plugin-syntax-import-meta", 23 | "@babel/plugin-proposal-class-properties", 24 | "@babel/plugin-proposal-json-strings", 25 | [ 26 | "@babel/plugin-proposal-decorators", 27 | { 28 | "legacy": true 29 | } 30 | ], 31 | "@babel/plugin-proposal-function-sent", 32 | "@babel/plugin-proposal-export-namespace-from", 33 | "@babel/plugin-proposal-numeric-separator", 34 | "@babel/plugin-proposal-throw-expressions" 35 | ] 36 | } 37 | -------------------------------------------------------------------------------- /scaffolds/admin-lite/.postcssrc: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": { 3 | "autoprefixer": {} 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /scaffolds/admin-lite/README.md: -------------------------------------------------------------------------------- 1 | # Admin Lite 2 | > 该模板适用于从 0 到 1 开始搭建项目,内置基础的页面,路由和菜单展示。 3 | -------------------------------------------------------------------------------- /scaffolds/admin-lite/_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 | -------------------------------------------------------------------------------- /scaffolds/admin-lite/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ice-lab/vue-materials/3e5dd77d4a9a05c49081831abce91ae720aad5aa/scaffolds/admin-lite/public/favicon.ico -------------------------------------------------------------------------------- /scaffolds/admin-lite/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | ADMIN LITE 10 | 11 | 12 | 13 | 16 |
17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /scaffolds/admin-lite/src/App.vue: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /scaffolds/admin-lite/src/assets/404.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ice-lab/vue-materials/3e5dd77d4a9a05c49081831abce91ae720aad5aa/scaffolds/admin-lite/src/assets/404.png -------------------------------------------------------------------------------- /scaffolds/admin-lite/src/assets/404_cloud.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ice-lab/vue-materials/3e5dd77d4a9a05c49081831abce91ae720aad5aa/scaffolds/admin-lite/src/assets/404_cloud.png -------------------------------------------------------------------------------- /scaffolds/admin-lite/src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ice-lab/vue-materials/3e5dd77d4a9a05c49081831abce91ae720aad5aa/scaffolds/admin-lite/src/assets/logo.png -------------------------------------------------------------------------------- /scaffolds/admin-lite/src/components/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ice-lab/vue-materials/3e5dd77d4a9a05c49081831abce91ae720aad5aa/scaffolds/admin-lite/src/components/.gitkeep -------------------------------------------------------------------------------- /scaffolds/admin-lite/src/config/routes.js: -------------------------------------------------------------------------------- 1 | import HeaderAsideLayout from '@/layouts/HeaderAsideLayout'; 2 | import NotFound from '@/pages/NotFound'; 3 | import Dashboard from '@/pages/Dashboard'; 4 | 5 | const routerConfig = [ 6 | { 7 | path: '/table', 8 | component: HeaderAsideLayout, 9 | children: [ 10 | { path: '/table/basic', component: NotFound }, 11 | { path: '/table/fixed', component: NotFound }, 12 | ], 13 | }, 14 | { 15 | path: '/form', 16 | component: HeaderAsideLayout, 17 | children: [ 18 | { path: '/form/basic', component: NotFound }, 19 | { path: '/form/signup', component: NotFound }, 20 | ], 21 | }, 22 | { 23 | path: '/charts', 24 | component: HeaderAsideLayout, 25 | children: [ 26 | { path: '/charts/line', component: NotFound }, 27 | { path: '/charts/histogram', component: NotFound }, 28 | { path: '/charts/bar', component: NotFound }, 29 | ], 30 | }, 31 | { 32 | path: '/profile', 33 | component: HeaderAsideLayout, 34 | children: [ 35 | { path: '/profile/success', component: NotFound }, 36 | { path: '/profile/fail', component: NotFound }, 37 | ], 38 | }, 39 | { 40 | path: '/result', 41 | component: HeaderAsideLayout, 42 | children: [ 43 | { path: '/result/success', component: NotFound }, 44 | { path: '/result/fail', component: NotFound }, 45 | ], 46 | }, 47 | { 48 | path: '/', 49 | component: HeaderAsideLayout, 50 | children: [ 51 | { path: '/dashboard/analysis', component: Dashboard }, 52 | { path: '/dashboard/monitor', component: NotFound }, 53 | { path: '/dashboard/workplace', component: NotFound }, 54 | ], 55 | }, 56 | { path: '*', component: NotFound }, 57 | ]; 58 | 59 | export default routerConfig; 60 | -------------------------------------------------------------------------------- /scaffolds/admin-lite/src/layouts/HeaderAsideLayout/Layout.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 23 | 24 | 43 | -------------------------------------------------------------------------------- /scaffolds/admin-lite/src/layouts/HeaderAsideLayout/components/AppMain.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 17 | -------------------------------------------------------------------------------- /scaffolds/admin-lite/src/layouts/HeaderAsideLayout/components/ScrollBar.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 50 | 51 | 62 | -------------------------------------------------------------------------------- /scaffolds/admin-lite/src/layouts/HeaderAsideLayout/components/index.js: -------------------------------------------------------------------------------- 1 | export { default as NavBar } from './NavBar'; 2 | export { default as SideBar } from './SideBar'; 3 | export { default as AppMain } from './AppMain'; 4 | -------------------------------------------------------------------------------- /scaffolds/admin-lite/src/layouts/HeaderAsideLayout/index.js: -------------------------------------------------------------------------------- 1 | import Layout from './Layout'; 2 | 3 | export default Layout; 4 | -------------------------------------------------------------------------------- /scaffolds/admin-lite/src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import ElementUI from 'element-ui'; 3 | import 'element-ui/lib/theme-chalk/index.css'; 4 | import 'normalize.css/normalize.css'; 5 | import './styles/index.scss'; 6 | import App from './App.vue'; 7 | import router from './router'; 8 | 9 | Vue.use(ElementUI); 10 | 11 | Vue.config.productionTip = false; 12 | 13 | new Vue({ 14 | router, 15 | render: h => h(App), 16 | }).$mount('#app'); 17 | -------------------------------------------------------------------------------- /scaffolds/admin-lite/src/pages/Dashboard/Dashboard.vue: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /scaffolds/admin-lite/src/pages/Dashboard/index.js: -------------------------------------------------------------------------------- 1 | import Dashboard from './Dashboard.vue'; 2 | 3 | export default Dashboard; 4 | -------------------------------------------------------------------------------- /scaffolds/admin-lite/src/pages/NotFound/index.js: -------------------------------------------------------------------------------- 1 | import NotFound from './NotFound.vue'; 2 | 3 | export default NotFound; 4 | -------------------------------------------------------------------------------- /scaffolds/admin-lite/src/router.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import Router from 'vue-router'; 3 | import routerConfig from '@/config/routes'; 4 | 5 | Vue.use(Router); 6 | 7 | export default new Router({ 8 | routes: routerConfig, 9 | }); 10 | -------------------------------------------------------------------------------- /scaffolds/admin-lite/src/styles/index.scss: -------------------------------------------------------------------------------- 1 | body { 2 | -moz-osx-font-smoothing: grayscale; 3 | -webkit-font-smoothing: antialiased; 4 | text-rendering: optimizeLegibility; 5 | font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif; 6 | } 7 | 8 | *, 9 | *:before, 10 | *:after { 11 | box-sizing: inherit; 12 | } 13 | 14 | div:focus{ 15 | outline: none; 16 | } 17 | 18 | a:focus, 19 | a:active { 20 | outline: none; 21 | } 22 | 23 | a, 24 | a:focus, 25 | a:hover { 26 | cursor: pointer; 27 | color: inherit; 28 | text-decoration: none; 29 | } 30 | 31 | .clearfix { 32 | &:after { 33 | visibility: hidden; 34 | display: block; 35 | font-size: 0; 36 | content: " "; 37 | clear: both; 38 | height: 0; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /scaffolds/admin-lite/vue.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | 3 | module.exports = { 4 | publicPath: './', 5 | lintOnSave: false, 6 | configureWebpack: { 7 | resolve: { 8 | extensions: ['.js', '.json', '.vue'], 9 | alias: { 10 | '@': path.resolve(__dirname, 'src/'), 11 | }, 12 | }, 13 | }, 14 | }; 15 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/.browserslistrc: -------------------------------------------------------------------------------- 1 | > 1% 2 | last 2 versions 3 | not ie <= 8 4 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/.env: -------------------------------------------------------------------------------- 1 | # 所有环境默认 2 | 3 | # 页面 title 前缀 4 | VUE_APP_TITLE=D2Admin 5 | 6 | # 网络请求公用地址 7 | VUE_APP_API=/api/ 8 | 9 | # 仓库地址 10 | VUE_APP_REPO=https://github.com/ice-lab/vue-materials/blob/master/scaffolds/d2-admin-ice/ 11 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/.env.development: -------------------------------------------------------------------------------- 1 | # 开发环境 2 | 3 | # 页面 title 前缀 4 | VUE_APP_TITLE=D2Admin Dev 5 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/.env.nomock: -------------------------------------------------------------------------------- 1 | # No Mock 构建 2 | 3 | # 指定构建模式 4 | NODE_ENV=production 5 | 6 | # 标记当前是 No Mock 构建 7 | VUE_APP_BUILD_MODE=nomock 8 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/.env.travis: -------------------------------------------------------------------------------- 1 | # preview 2 | 3 | # 指定构建模式 4 | NODE_ENV=production 5 | 6 | # 标记当前是构建预览网站 7 | VUE_APP_BUILD_MODE=preview 8 | 9 | # 部署路径 10 | VUE_APP_PUBLIC_PATH=/d2-admin-ice/preview/ 11 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/.eslintignore: -------------------------------------------------------------------------------- 1 | # 忽略目录 2 | build/ 3 | tests/ 4 | node_modules/ 5 | 6 | # node 覆盖率文件 7 | coverage/ 8 | 9 | # 忽略文件 10 | **/*-min.js 11 | **/*.min.js 12 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/.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 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | # Log files 6 | npm-debug.log* 7 | yarn-debug.log* 8 | yarn-error.log* 9 | 10 | # Editor directories and files 11 | .idea 12 | .vscode 13 | *.suo 14 | *.ntvs* 15 | *.njsproj 16 | *.sln 17 | *.sw* -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/.postcssrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | autoprefixer: {} 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 李杨 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 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/app' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | moduleFileExtensions: [ 3 | 'js', 4 | 'jsx', 5 | 'json', 6 | 'vue' 7 | ], 8 | transform: { 9 | '^.+\\.vue$': 'vue-jest', 10 | '.+\\.(css|styl|less|sass|scss|png|jpg|ttf|woff|woff2)$': 'jest-transform-stub', 11 | '^.+\\.jsx?$': 'babel-jest' 12 | }, 13 | moduleNameMapper: { 14 | '^@/(.*)$': '/src/$1' 15 | }, 16 | snapshotSerializers: [ 17 | 'jest-serializer-vue' 18 | ], 19 | testMatch: [ 20 | '**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)' 21 | ], 22 | testURL: 'http://localhost/' 23 | } 24 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/public/icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ice-lab/vue-materials/3e5dd77d4a9a05c49081831abce91ae720aad5aa/scaffolds/d2-admin-ice/public/icon.ico -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/public/image/loading/loading-spin.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/public/image/theme/d2/logo/all.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ice-lab/vue-materials/3e5dd77d4a9a05c49081831abce91ae720aad5aa/scaffolds/d2-admin-ice/public/image/theme/d2/logo/all.png -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/public/image/theme/d2/logo/icon-only.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ice-lab/vue-materials/3e5dd77d4a9a05c49081831abce91ae720aad5aa/scaffolds/d2-admin-ice/public/image/theme/d2/logo/icon-only.png -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/public/image/theme/d2/preview@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ice-lab/vue-materials/3e5dd77d4a9a05c49081831abce91ae720aad5aa/scaffolds/d2-admin-ice/public/image/theme/d2/preview@2x.png -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/public/image/theme/line/bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ice-lab/vue-materials/3e5dd77d4a9a05c49081831abce91ae720aad5aa/scaffolds/d2-admin-ice/public/image/theme/line/bg.jpg -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/public/image/theme/line/logo/all.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ice-lab/vue-materials/3e5dd77d4a9a05c49081831abce91ae720aad5aa/scaffolds/d2-admin-ice/public/image/theme/line/logo/all.png -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/public/image/theme/line/logo/icon-only.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ice-lab/vue-materials/3e5dd77d4a9a05c49081831abce91ae720aad5aa/scaffolds/d2-admin-ice/public/image/theme/line/logo/icon-only.png -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/public/image/theme/line/preview@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ice-lab/vue-materials/3e5dd77d4a9a05c49081831abce91ae720aad5aa/scaffolds/d2-admin-ice/public/image/theme/line/preview@2x.png -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/public/image/theme/star/bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ice-lab/vue-materials/3e5dd77d4a9a05c49081831abce91ae720aad5aa/scaffolds/d2-admin-ice/public/image/theme/star/bg.jpg -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/public/image/theme/star/logo/all.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ice-lab/vue-materials/3e5dd77d4a9a05c49081831abce91ae720aad5aa/scaffolds/d2-admin-ice/public/image/theme/star/logo/all.png -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/public/image/theme/star/logo/icon-only.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ice-lab/vue-materials/3e5dd77d4a9a05c49081831abce91ae720aad5aa/scaffolds/d2-admin-ice/public/image/theme/star/logo/icon-only.png -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/public/image/theme/star/preview@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ice-lab/vue-materials/3e5dd77d4a9a05c49081831abce91ae720aad5aa/scaffolds/d2-admin-ice/public/image/theme/star/preview@2x.png -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/public/image/theme/tomorrow-night-blue/logo/all.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ice-lab/vue-materials/3e5dd77d4a9a05c49081831abce91ae720aad5aa/scaffolds/d2-admin-ice/public/image/theme/tomorrow-night-blue/logo/all.png -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/public/image/theme/tomorrow-night-blue/logo/icon-only.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ice-lab/vue-materials/3e5dd77d4a9a05c49081831abce91ae720aad5aa/scaffolds/d2-admin-ice/public/image/theme/tomorrow-night-blue/logo/icon-only.png -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/public/image/theme/tomorrow-night-blue/preview@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ice-lab/vue-materials/3e5dd77d4a9a05c49081831abce91ae720aad5aa/scaffolds/d2-admin-ice/public/image/theme/tomorrow-night-blue/preview@2x.png -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/public/image/theme/violet/logo/all.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ice-lab/vue-materials/3e5dd77d4a9a05c49081831abce91ae720aad5aa/scaffolds/d2-admin-ice/public/image/theme/violet/logo/all.png -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/public/image/theme/violet/logo/icon-only.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ice-lab/vue-materials/3e5dd77d4a9a05c49081831abce91ae720aad5aa/scaffolds/d2-admin-ice/public/image/theme/violet/logo/icon-only.png -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/public/image/theme/violet/preview@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ice-lab/vue-materials/3e5dd77d4a9a05c49081831abce91ae720aad5aa/scaffolds/d2-admin-ice/public/image/theme/violet/preview@2x.png -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/App.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 12 | 13 | 16 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/api/sys.login.js: -------------------------------------------------------------------------------- 1 | import request from '@/plugin/axios' 2 | 3 | export function AccountLogin (data) { 4 | return request({ 5 | url: '/login', 6 | method: 'post', 7 | data 8 | }) 9 | } 10 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/assets/style/animate/vue-transition.scss: -------------------------------------------------------------------------------- 1 | // 过渡动画 横向渐变 2 | .fade-transverse-leave-active, 3 | .fade-transverse-enter-active { 4 | transition: all .5s; 5 | } 6 | .fade-transverse-enter { 7 | opacity: 0; 8 | transform: translateX(-30px); 9 | } 10 | .fade-transverse-leave-to { 11 | opacity: 0; 12 | transform: translateX(30px); 13 | } 14 | 15 | // 过渡动画 缩放渐变 16 | .fade-scale-leave-active, 17 | .fade-scale-enter-active { 18 | transition: all .3s; 19 | } 20 | .fade-scale-enter { 21 | opacity: 0; 22 | transform: scale(1.2); 23 | } 24 | .fade-scale-leave-to { 25 | opacity: 0; 26 | transform: scale(0.8); 27 | } 28 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/assets/style/fixed/base.scss: -------------------------------------------------------------------------------- 1 | // 优化显示 2 | html, body { 3 | margin: 0px; 4 | height: 100%; 5 | font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif; 6 | #app { 7 | @extend %full; 8 | a { 9 | text-decoration: none; 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/assets/style/fixed/element.scss: -------------------------------------------------------------------------------- 1 | // element 样式补丁 2 | .el-card { 3 | &.is-always-shadow { 4 | box-shadow: 0 0 8px 0 rgba(232,237,250,.6), 0 2px 4px 0 rgba(232,237,250,.5); 5 | } 6 | &.is-hover-shadow { 7 | &:hover { 8 | box-shadow: 0 0 8px 0 rgba(232,237,250,.6), 0 2px 4px 0 rgba(232,237,250,.5); 9 | } 10 | } 11 | } 12 | 13 | .el-menu--horizontal { 14 | border-bottom: none !important; 15 | } 16 | 17 | .el-tabs__item:focus.is-active.is-focus:not(:active) { 18 | box-shadow: none !important; 19 | } -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/assets/style/fixed/n-progress.scss: -------------------------------------------------------------------------------- 1 | #nprogress { 2 | .bar { 3 | background: $color-primary !important; 4 | } 5 | .peg { 6 | box-shadow: 0 0 10px $color-primary, 0 0 5px $color-primary !important; 7 | } 8 | } -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/assets/style/public.scss: -------------------------------------------------------------------------------- 1 | @import '~@/assets/style/unit/color.scss'; 2 | 3 | // 工具类名统一前缀 4 | $prefix: d2; 5 | 6 | // 禁止用户选中 鼠标变为手形 7 | %unable-select { 8 | user-select: none; 9 | cursor: pointer; 10 | } 11 | 12 | // 填满父元素 13 | // 组要父元素 position: relative | absolute; 14 | %full { 15 | position: absolute; 16 | top: 0px; 17 | right: 0px; 18 | bottom: 0px; 19 | left: 0px; 20 | } 21 | 22 | // flex 垂直水平居中 23 | %flex-center-row { 24 | display: flex; 25 | justify-content: center; 26 | align-items: center; 27 | flex-direction: row; 28 | } 29 | %flex-center-col { 30 | display: flex; 31 | justify-content: center; 32 | align-items: center; 33 | flex-direction: column; 34 | } 35 | 36 | // 将元素模拟成卡片外观 37 | %card { 38 | border: 1px solid #dddee1; 39 | border-color: #e9eaec; 40 | background: #fff; 41 | border-radius: 4px; 42 | font-size: 14px; 43 | position: relative; 44 | } -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/assets/style/theme/d2/index.scss: -------------------------------------------------------------------------------- 1 | @import './setting.scss'; 2 | @import '../theme.scss'; 3 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/assets/style/theme/line/index.scss: -------------------------------------------------------------------------------- 1 | @import './setting.scss'; 2 | @import '../theme.scss'; 3 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/assets/style/theme/register.scss: -------------------------------------------------------------------------------- 1 | @import '~@/assets/style/theme/theme-base.scss'; 2 | 3 | @import '~@/assets/style/theme/d2/index.scss'; 4 | @import '~@/assets/style/theme/line/index.scss'; 5 | @import '~@/assets/style/theme/star/index.scss'; 6 | @import '~@/assets/style/theme/tomorrow-night-blue/index.scss'; 7 | @import '~@/assets/style/theme/violet/index.scss'; -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/assets/style/theme/star/index.scss: -------------------------------------------------------------------------------- 1 | @import './setting.scss'; 2 | @import '../theme.scss'; 3 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/assets/style/theme/tomorrow-night-blue/index.scss: -------------------------------------------------------------------------------- 1 | @import './setting.scss'; 2 | @import '../theme.scss'; 3 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/assets/style/theme/violet/index.scss: -------------------------------------------------------------------------------- 1 | @import './setting.scss'; 2 | @import '../theme.scss'; 3 | 4 | .theme-#{$theme-name} { 5 | .d2-layout-header-aside-group { 6 | background: #bc00e3; 7 | background: linear-gradient(120deg, #bc00e3 0%, #4EFFFB 100%); 8 | } 9 | } -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/assets/style/unit/color.scss: -------------------------------------------------------------------------------- 1 | // 主色 2 | $color-primary: #409EFF; 3 | 4 | // 辅助色 5 | $color-info: #909399; 6 | $color-success: #67C23A; 7 | $color-warning: #E6A23C; 8 | $color-danger: #F56C6C; 9 | 10 | // 文字 11 | $color-text-main: #303133; 12 | $color-text-normal: #606266; 13 | $color-text-sub: #909399; 14 | $color-text-placehoder: #C0C4CC; 15 | 16 | // 边框 17 | $color-border-1: #DCDFE6; 18 | $color-border-2: #E4E7ED; 19 | $color-border-3: #EBEEF5; 20 | $color-border-4: #F2F6FC; 21 | 22 | // 背景 23 | $color-bg: #f8f8f9; -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/assets/svg-icons/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | 3 | const requireAll = requireContext => requireContext.keys().map(requireContext) 4 | const req = require.context('./icons', false, /\.svg$/) 5 | const iconMap = requireAll(req) 6 | 7 | Vue.prototype.$IconSvg = iconMap.map(e => e.default.id.slice(3)) 8 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/components/d2-container/components/d2-container-card-bs.vue: -------------------------------------------------------------------------------- 1 | 18 | 19 | 28 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/components/d2-container/components/d2-container-card.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 34 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/components/d2-container/components/d2-container-full-bs.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 26 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/components/d2-container/components/d2-container-full.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 32 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/components/d2-container/components/d2-container-ghost-bs.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 26 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/components/d2-container/components/d2-container-ghost.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 32 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/components/d2-container/components/d2-source.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 47 | 48 | 80 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/components/d2-container/components/mixins/bs.js: -------------------------------------------------------------------------------- 1 | import BScroll from 'better-scroll' 2 | export default { 3 | props: { 4 | // 滚动优化的选项 5 | betterScrollOptions: { 6 | type: Object, 7 | required: false, 8 | default: () => ({}) 9 | } 10 | }, 11 | data () { 12 | return { 13 | BS: null 14 | } 15 | }, 16 | mounted () { 17 | this.scrollInit() 18 | }, 19 | beforeDestroy () { 20 | this.scrollDestroy() 21 | }, 22 | methods: { 23 | scrollInit () { 24 | // 初始化 bs 25 | this.BS = new BScroll(this.$refs.wrapper, Object.assign({ 26 | mouseWheel: true, 27 | click: true, 28 | scrollbar: { 29 | fade: true, 30 | interactive: false 31 | } 32 | }, this.betterScrollOptions)) 33 | // 滚动时发出事件 并且统一返回的数据格式 34 | this.BS.on('scroll', ({ x, y }) => this.$emit('scroll', { 35 | x: -x, 36 | y: -y 37 | })) 38 | }, 39 | scrollDestroy () { 40 | // https://github.com/d2-projects/d2-admin/issues/75 41 | try { 42 | this.BS.destroy() 43 | } catch (e) { 44 | delete this.BS 45 | this.BS = null 46 | } 47 | }, 48 | // 外部调用的方法 返回顶部 49 | scrollToTop () { 50 | if (this.BS) this.BS.scrollTo(0, 0, 300) 51 | }, 52 | // 手动发出滚动事件 53 | scroll () { 54 | if (this.BS) { 55 | this.$emit('scroll', { 56 | x: -this.BS.x, 57 | y: -this.BS.y 58 | }) 59 | } 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/components/d2-container/components/mixins/normal.js: -------------------------------------------------------------------------------- 1 | // 提供滚动方面的功能 2 | // 非滚动优化模式通用 3 | 4 | import { throttle } from 'lodash' 5 | 6 | // 生成滚动事件的 handler 7 | function handleMaker (wait) { 8 | return throttle(e => { 9 | this.$emit('scroll', { 10 | x: e.target.scrollLeft, 11 | y: e.target.scrollTop 12 | }) 13 | }, wait) 14 | } 15 | 16 | export default { 17 | props: { 18 | // 滚动事件节流间隔 19 | scrollDelay: { 20 | type: Number, 21 | required: false, 22 | default: 10 23 | } 24 | }, 25 | data () { 26 | return { 27 | handleScroll: null 28 | } 29 | }, 30 | watch: { 31 | scrollDelay (val) { 32 | // 移除旧的监听 33 | this.removeScrollListener() 34 | // 生成新的 handle 方法 35 | this.handleScroll = handleMaker.call(this, val) 36 | // 添加新的监听 37 | this.addScrollListener() 38 | } 39 | }, 40 | methods: { 41 | // 增加滚动事件监听 42 | addScrollListener () { 43 | if (typeof this.handleScroll !== 'function') { 44 | // mounted 生命周期内调用这个方法的时候会进入这里的判断 45 | this.handleScroll = handleMaker.call(this, this.scrollDelay) 46 | } 47 | // 添加监听 48 | this.$refs.body.addEventListener('scroll', this.handleScroll) 49 | }, 50 | // 移除滚动事件监听 51 | removeScrollListener () { 52 | this.$refs.body.removeEventListener('scroll', this.handleScroll) 53 | }, 54 | // 外部调用的方法 返回顶部 55 | scrollToTop () { 56 | const smoothscroll = () => { 57 | const body = this.$refs.body 58 | const currentScroll = body.scrollTop 59 | if (currentScroll > 0) { 60 | window.requestAnimationFrame(smoothscroll) 61 | body.scrollTo(0, currentScroll - (currentScroll / 5)) 62 | } 63 | } 64 | smoothscroll() 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/components/d2-icon-svg/index.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 23 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/components/d2-icon/font-awesome-4.7.0/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ice-lab/vue-materials/3e5dd77d4a9a05c49081831abce91ae720aad5aa/scaffolds/d2-admin-ice/src/components/d2-icon/font-awesome-4.7.0/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/components/d2-icon/font-awesome-4.7.0/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ice-lab/vue-materials/3e5dd77d4a9a05c49081831abce91ae720aad5aa/scaffolds/d2-admin-ice/src/components/d2-icon/font-awesome-4.7.0/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/components/d2-icon/font-awesome-4.7.0/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ice-lab/vue-materials/3e5dd77d4a9a05c49081831abce91ae720aad5aa/scaffolds/d2-admin-ice/src/components/d2-icon/font-awesome-4.7.0/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/components/d2-icon/font-awesome-4.7.0/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ice-lab/vue-materials/3e5dd77d4a9a05c49081831abce91ae720aad5aa/scaffolds/d2-admin-ice/src/components/d2-icon/font-awesome-4.7.0/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/components/d2-icon/font-awesome-4.7.0/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ice-lab/vue-materials/3e5dd77d4a9a05c49081831abce91ae720aad5aa/scaffolds/d2-admin-ice/src/components/d2-icon/font-awesome-4.7.0/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/components/d2-icon/index.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 18 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/components/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | 3 | import d2Container from './d2-container' 4 | 5 | // 注意 有些组件使用异步加载会有影响 6 | Vue.component('d2-container', d2Container) 7 | Vue.component('d2-icon', () => import('./d2-icon')) 8 | Vue.component('d2-icon-svg', () => import('./d2-icon-svg/index.vue')) 9 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/config/menu.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | 3 | import util from '@/libs/util.ice'; 4 | 5 | // 菜单配置 6 | 7 | // 侧栏菜单配置 8 | // ice 会在新建页面的时候 push 数据 9 | // ice 自动添加的菜单记录是以下格式:(不会有嵌套) 10 | // { 11 | // name: 'Nav', 12 | // path: '/page', 13 | // icon: 'home', 14 | // }, 15 | 16 | const asideMenuConfig = [ 17 | { 18 | name: '演示页面', 19 | icon: 'folder-o', 20 | children: [ 21 | { name: '演示 1', path: '/demo1' }, 22 | { name: '演示 2', path: '/demo2' }, 23 | ], 24 | }, 25 | ]; 26 | 27 | // 顶栏菜单配置 28 | // ice 不会修改 headerMenuConfig 29 | // 如果你需要功能开发之前就配置出菜单原型,可以只设置 name 字段 30 | // D2Admin 会自动添加不重复 id 生成菜单,并在点击时提示这是一个临时菜单 31 | const headerMenuConfig = [ 32 | { 33 | name: '空菜单', 34 | icon: 'flask', 35 | children: [ 36 | { 37 | name: 'menu 1', 38 | children: [ 39 | { 40 | name: 'menu 1-1', 41 | children: [{ name: 'menu 1-1-1' }, { name: 'menu 1-1-2' }], 42 | }, 43 | 44 | { name: 'menu 1-2' }, 45 | ], 46 | }, 47 | 48 | { name: 'menu 2' }, 49 | { name: 'menu 3' }, 50 | ], 51 | }, 52 | 53 | { 54 | name: '演示页面', 55 | icon: 'folder-o', 56 | children: [ 57 | { 58 | name: '演示 1', 59 | path: '/demo1', 60 | }, 61 | 62 | { 63 | name: '演示 2', 64 | path: '/demo2', 65 | }, 66 | ], 67 | }, 68 | ]; 69 | 70 | // 请根据自身业务逻辑修改导出设置,并在合适的位置赋给对应的菜单 71 | 72 | // 参考 73 | // 设置顶栏菜单的方法 (vuex) 74 | // $store.commit('d2adminMenuHeaderSet', menus) 75 | // 设置侧边栏菜单的方法 (vuex) 76 | // $store.commit('d2adminMenuAsideSet', menus) 77 | // 你可以在任何地方使用上述方法修改顶栏和侧边栏菜单 78 | 79 | // 导出顶栏菜单 80 | export const menuHeader = util.recursiveMenuConfig(headerMenuConfig); 81 | 82 | // 导出侧边栏菜单 83 | export const menuAside = util.recursiveMenuConfig(asideMenuConfig); 84 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/i18n/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import VueI18n from 'vue-i18n' 3 | 4 | import cn from './lang/cn' 5 | import ja from './lang/ja' 6 | import en from './lang/en' 7 | 8 | Vue.use(VueI18n) 9 | 10 | export default new VueI18n({ 11 | locale: 'cn', 12 | messages: { 13 | cn, 14 | ja, 15 | en 16 | } 17 | }) 18 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/i18n/lang/cn/index.js: -------------------------------------------------------------------------------- 1 | export default {} 2 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/i18n/lang/en/index.js: -------------------------------------------------------------------------------- 1 | export default {} 2 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/i18n/lang/ja/index.js: -------------------------------------------------------------------------------- 1 | export default {} 2 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/layouts/HeaderAside/components/components/menu-item/index.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 28 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/layouts/HeaderAside/components/components/menu-sub/index.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 40 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/layouts/HeaderAside/components/contextmenu/components/contentmenuList/index.vue: -------------------------------------------------------------------------------- 1 | 22 | 23 | 43 | 44 | 62 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/layouts/HeaderAside/components/contextmenu/index.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 60 | 61 | 72 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/layouts/HeaderAside/components/header-fullscreen/index.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 28 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/layouts/HeaderAside/components/header-log/index.vue: -------------------------------------------------------------------------------- 1 | 26 | 27 | 55 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/layouts/HeaderAside/components/header-search/index.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 16 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/layouts/HeaderAside/components/header-theme/components/d2-theme-list/index.vue: -------------------------------------------------------------------------------- 1 | 41 | 42 | 70 | 71 | 80 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/layouts/HeaderAside/components/header-theme/index.vue: -------------------------------------------------------------------------------- 1 | 25 | 26 | 39 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/layouts/HeaderAside/components/header-user/index.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 36 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/layouts/HeaderAside/components/mixin/menu.js: -------------------------------------------------------------------------------- 1 | import util from '@/libs/util.js' 2 | 3 | export default { 4 | methods: { 5 | handleMenuSelect (index, indexPath) { 6 | if (/^d2-menu-empty-\d+$/.test(index) || index === undefined) { 7 | this.$message.warning('临时菜单') 8 | } else if (/^https:\/\/|http:\/\//.test(index)) { 9 | util.open(index) 10 | } else { 11 | this.$router.push({ 12 | path: index 13 | }) 14 | } 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/layouts/HeaderAside/index.js: -------------------------------------------------------------------------------- 1 | import layout from './layout' 2 | 3 | export default layout 4 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/layouts/HeaderAside/mixins/search.js: -------------------------------------------------------------------------------- 1 | import { mapState, mapMutations } from 'vuex' 2 | 3 | import hotkeys from 'hotkeys-js' 4 | 5 | export default { 6 | components: { 7 | 'd2-panel-search': () => import('../components/panel-search') 8 | }, 9 | mounted () { 10 | // 绑定搜索功能快捷键 [ 打开 ] 11 | hotkeys(this.searchHotkey.open, event => { 12 | event.preventDefault() 13 | this.searchPanelOpen() 14 | }) 15 | // 绑定搜索功能快捷键 [ 关闭 ] 16 | hotkeys(this.searchHotkey.close, event => { 17 | event.preventDefault() 18 | this.searchPanelClose() 19 | }) 20 | }, 21 | beforeDestroy () { 22 | hotkeys.unbind(this.searchHotkey.open) 23 | hotkeys.unbind(this.searchHotkey.close) 24 | }, 25 | computed: { 26 | ...mapState('d2admin', { 27 | searchActive: state => state.search.active, 28 | searchHotkey: state => state.search.hotkey 29 | }) 30 | }, 31 | methods: { 32 | ...mapMutations({ 33 | searchToggle: 'd2admin/search/toggle', 34 | searchSet: 'd2admin/search/set' 35 | }), 36 | /** 37 | * 接收点击搜索按钮 38 | */ 39 | handleSearchClick () { 40 | this.searchToggle() 41 | if (this.searchActive) { 42 | setTimeout(() => { 43 | if (this.$refs.panelSearch) { 44 | this.$refs.panelSearch.focus() 45 | } 46 | }, 500) 47 | } 48 | }, 49 | searchPanelOpen () { 50 | if (!this.searchActive) { 51 | this.searchSet(true) 52 | setTimeout(() => { 53 | if (this.$refs.panelSearch) { 54 | this.$refs.panelSearch.focus() 55 | } 56 | }, 500) 57 | } 58 | }, 59 | // 关闭搜索面板 60 | searchPanelClose () { 61 | if (this.searchActive) { 62 | this.searchSet(false) 63 | } 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/libs/util.cookies.js: -------------------------------------------------------------------------------- 1 | import Cookies from 'js-cookie' 2 | 3 | const cookies = {} 4 | 5 | /** 6 | * @description 存储 cookie 值 7 | * @param {String} name cookie name 8 | * @param {String} value cookie value 9 | * @param {Object} setting cookie setting 10 | */ 11 | cookies.set = function (name = 'default', value = '', cookieSetting = {}) { 12 | let currentCookieSetting = { 13 | expires: 1 14 | } 15 | Object.assign(currentCookieSetting, cookieSetting) 16 | Cookies.set(`d2admin-${process.env.VUE_APP_VERSION}-${name}`, value, currentCookieSetting) 17 | } 18 | 19 | /** 20 | * @description 拿到 cookie 值 21 | * @param {String} name cookie name 22 | */ 23 | cookies.get = function (name = 'default') { 24 | return Cookies.get(`d2admin-${process.env.VUE_APP_VERSION}-${name}`) 25 | } 26 | 27 | /** 28 | * @description 拿到 cookie 全部的值 29 | */ 30 | cookies.getAll = function () { 31 | return Cookies.get() 32 | } 33 | 34 | /** 35 | * @description 删除 cookie 36 | * @param {String} name cookie name 37 | */ 38 | cookies.remove = function (name = 'default') { 39 | return Cookies.remove(`d2admin-${process.env.VUE_APP_VERSION}-${name}`) 40 | } 41 | 42 | export default cookies 43 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/libs/util.db.js: -------------------------------------------------------------------------------- 1 | import low from 'lowdb' 2 | import LocalStorage from 'lowdb/adapters/LocalStorage' 3 | 4 | const adapter = new LocalStorage(`d2admin-${process.env.VUE_APP_VERSION}`) 5 | const db = low(adapter) 6 | 7 | db 8 | .defaults({ 9 | sys: {}, 10 | database: {} 11 | }) 12 | .write() 13 | 14 | export default db 15 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/libs/util.ice.js: -------------------------------------------------------------------------------- 1 | const util = {} 2 | 3 | /** 4 | * @description 路由配置扁平化 5 | * @param {Array} config 层级路由设置 6 | */ 7 | util.recursiveRouterConfig = function recursiveRouterConfig (config = []) { 8 | /** 9 | * path -> name 10 | * @param {String} path path 11 | */ 12 | function path2name (path = '') { 13 | return path.split('/').filter(e => e).join('-') 14 | }; 15 | 16 | /** 17 | * routeItem 18 | * @param {Array} con config 19 | */ 20 | function routeItem (config) { 21 | return { 22 | ...config, 23 | name: config.name || path2name(config.path), 24 | // meta 设置和默认值合并 25 | meta: Object.assign({ 26 | auth: true, 27 | title: path2name(config.path) 28 | }, config.meta) 29 | } 30 | } 31 | 32 | /** 33 | * recursive 34 | * @param {Array} con config 35 | */ 36 | function recursive (con) { 37 | const routerMap = con.map(item => { 38 | let route = routeItem(item) 39 | 40 | if (item.children) { 41 | const newChildren = item.children.map(child => { 42 | return routeItem(child) 43 | }) 44 | route.children = newChildren 45 | } 46 | 47 | return route 48 | }) 49 | 50 | return routerMap 51 | } 52 | 53 | return recursive(config) 54 | } 55 | 56 | /** 57 | * @description 转换菜单数据 58 | * @param {Array} arr menu config 59 | */ 60 | util.recursiveMenuConfig = function recursiveMenuConfig (arr) { 61 | const res = [] 62 | /** 63 | * 转换每个菜单对象上的 name 为 title 64 | * @param {Object} obj menu 65 | */ 66 | function convert (obj) { 67 | const { 68 | name, path, icon, children 69 | } = obj 70 | return { 71 | title: name, 72 | icon, 73 | path, 74 | ...children ? { children: children.map(convert) } : {} 75 | } 76 | } 77 | arr.forEach((menu) => { 78 | res.push(convert(menu)) 79 | }) 80 | return res 81 | } 82 | 83 | export default util 84 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/libs/util.js: -------------------------------------------------------------------------------- 1 | import cookies from './util.cookies' 2 | import db from './util.db' 3 | import log from './util.log' 4 | 5 | const util = { 6 | cookies, 7 | db, 8 | log 9 | } 10 | 11 | /** 12 | * @description 更新标题 13 | * @param {String} title 标题 14 | */ 15 | util.title = function (titleText) { 16 | const processTitle = process.env.VUE_APP_TITLE || 'D2Admin' 17 | window.document.title = `${processTitle}${titleText ? ` | ${titleText}` : ''}` 18 | } 19 | 20 | /** 21 | * @description 打开新页面 22 | * @param {String} url 地址 23 | */ 24 | util.open = function (url) { 25 | var a = document.createElement('a') 26 | a.setAttribute('href', url) 27 | a.setAttribute('target', '_blank') 28 | a.setAttribute('id', 'd2admin-link-temp') 29 | document.body.appendChild(a) 30 | a.click() 31 | document.body.removeChild(document.getElementById('d2admin-link-temp')) 32 | } 33 | 34 | export default util 35 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/main.js: -------------------------------------------------------------------------------- 1 | // Vue 2 | import Vue from 'vue' 3 | import App from './App' 4 | // store 5 | import store from '@/store/index' 6 | // 模拟数据 7 | import '@/mock' 8 | // 多国语 9 | import i18n from './i18n' 10 | // 核心插件 11 | import d2Admin from '@/plugin/d2admin' 12 | 13 | // 菜单和路由设置 14 | import router from './router' 15 | import { menuHeader, menuAside } from '@/config/menu' 16 | import { frameInRoutes } from '@/config/routes' 17 | 18 | console.log('frameInRoutes', frameInRoutes) 19 | 20 | // 核心插件 21 | Vue.use(d2Admin) 22 | 23 | new Vue({ 24 | router, 25 | store, 26 | i18n, 27 | render: h => h(App), 28 | created () { 29 | // 处理路由 得到每一级的路由设置 30 | this.$store.commit('d2admin/page/init', frameInRoutes) 31 | // 设置顶栏菜单 32 | this.$store.commit('d2admin/menu/headerSet', menuHeader) 33 | // 设置侧边栏菜单 34 | this.$store.commit('d2admin/menu/asideSet', menuAside) 35 | // 初始化菜单搜索功能 36 | this.$store.commit('d2admin/search/init', menuHeader) 37 | }, 38 | mounted () { 39 | // 展示系统信息 40 | this.$store.commit('d2admin/releases/versionShow') 41 | // 用户登录后从数据库加载一系列的设置 42 | this.$store.dispatch('d2admin/account/load') 43 | // 获取并记录用户 UA 44 | this.$store.commit('d2admin/ua/get') 45 | // 初始化全屏监听 46 | this.$store.dispatch('d2admin/fullscreen/listen') 47 | } 48 | }).$mount('#app') 49 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/mock/api/sys.login.js: -------------------------------------------------------------------------------- 1 | const userDB = [ 2 | { username: 'admin', password: 'admin', uuid: 'admin-uuid', name: '管理员' }, 3 | { username: 'editor', password: 'editor', uuid: 'editor-uuid', name: '编辑' }, 4 | { username: 'user1', password: 'user1', uuid: 'user1-uuid', name: '用户1' } 5 | ] 6 | 7 | export default [ 8 | { 9 | path: '/api/login', 10 | method: 'post', 11 | handle ({ body }) { 12 | const user = userDB.find(e => e.username === body.username && e.password === body.password) 13 | if (user) { 14 | return { 15 | code: 0, 16 | msg: '登录成功', 17 | data: { 18 | ...user, 19 | token: '8dfhassad0asdjwoeiruty' 20 | } 21 | } 22 | } else { 23 | return { 24 | code: 401, 25 | msg: '用户名或密码错误', 26 | data: {} 27 | } 28 | } 29 | } 30 | } 31 | ] 32 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/mock/d2-mock/index.js: -------------------------------------------------------------------------------- 1 | import Mock from 'mockjs' 2 | import qs from 'qs' 3 | import withCredentials from './patch/withCredentials' 4 | 5 | /* 补丁 */ 6 | withCredentials(Mock) 7 | 8 | /* Mock 默认配置 */ 9 | Mock.setup({ timeout: '200-300' }) 10 | 11 | /* 扩展 [生成器] */ 12 | const Generator = (prop, template) => { 13 | const obj = {} 14 | obj[prop] = [template] 15 | return Mock.mock(obj) 16 | } 17 | 18 | /* 扩展 [循环] */ 19 | const Repeat = (num, itemTemplate) => Generator(`data|${num}`, itemTemplate).data 20 | 21 | const CustomExtends = { 22 | Generator, 23 | Repeat, 24 | Mock, 25 | Random: Mock.Random 26 | } 27 | 28 | const extend = (prop, value) => { 29 | CustomExtends[prop] = value 30 | } 31 | 32 | /* 装配配置组 */ 33 | const wired = ({ url, type, body }) => ({ 34 | method: type, 35 | params: qs.parse(url.split('?').length > 1 ? url.split('?')[1] : ''), 36 | body: JSON.parse(body), 37 | url: qs.parse(url.split('?')[0]), 38 | ...CustomExtends 39 | }) 40 | 41 | const setup = (path, method, handle) => { 42 | Mock.mock( 43 | RegExp(path), 44 | method, 45 | typeof handle === 'function' ? o => handle(wired(o)) : handle 46 | ) 47 | } 48 | 49 | const load = (collection) => { 50 | collection.map(({ path, method, handle }) => { 51 | if (method === '*') { 52 | method = [ 53 | 'get', 54 | 'head', 55 | 'post', 56 | 'put', 57 | 'delete', 58 | 'connect', 59 | 'options', 60 | 'trace', 61 | 'patch' 62 | ] 63 | } 64 | if (typeof method === 'string' && method.indexOf('|') > -1) method = method.split('|') 65 | if (method instanceof Array) { 66 | method.map(item => setup(path, item, handle)) 67 | } else { 68 | setup(path, method, handle) 69 | } 70 | }) 71 | } 72 | 73 | export default { setup, load, extend } 74 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/mock/d2-mock/patch/withCredentials.js: -------------------------------------------------------------------------------- 1 | export default function (Mock) { 2 | // http://cnine.me/note/FrontEnd/mock-lose-cookies-dbg.html 3 | Mock.XHR.prototype.__send = Mock.XHR.prototype.send 4 | Mock.XHR.prototype.send = function () { 5 | if (this.custom.xhr) { 6 | this.custom.xhr.withCredentials = this.withCredentials || false 7 | this.custom.xhr.responseType = this.responseType 8 | } 9 | this.__send.apply(this, arguments) 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/mock/index.js: -------------------------------------------------------------------------------- 1 | import d2Mock from './d2-mock' 2 | 3 | const req = context => context.keys().map(context) 4 | const options = req(require.context('./api/', true, /\.js$/)) 5 | .filter(e => e.default) 6 | .map(e => e.default) 7 | 8 | options.forEach(option => { 9 | d2Mock.load(option) 10 | }) 11 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/pages/Demo1/Demo1.vue: -------------------------------------------------------------------------------- 1 | 18 | 19 | 32 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/pages/Demo1/componnets/FooterLink/FooterLink.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 17 | 18 | 26 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/pages/Demo1/componnets/FooterLink/index.js: -------------------------------------------------------------------------------- 1 | import FooterLink from './FooterLink' 2 | 3 | export default FooterLink 4 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/pages/Demo1/componnets/RouteInfo/RouteInfo.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 31 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/pages/Demo1/componnets/RouteInfo/index.js: -------------------------------------------------------------------------------- 1 | import RouteInfo from './RouteInfo' 2 | 3 | export default RouteInfo 4 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/pages/Demo1/index.js: -------------------------------------------------------------------------------- 1 | import Demo1 from './Demo1' 2 | 3 | export default Demo1 4 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/pages/Demo2/Demo2.vue: -------------------------------------------------------------------------------- 1 | 18 | 19 | 32 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/pages/Demo2/componnets/FooterLink/FooterLink.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 17 | 18 | 26 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/pages/Demo2/componnets/FooterLink/index.js: -------------------------------------------------------------------------------- 1 | import FooterLink from './FooterLink' 2 | 3 | export default FooterLink 4 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/pages/Demo2/componnets/RouteInfo/RouteInfo.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 31 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/pages/Demo2/componnets/RouteInfo/index.js: -------------------------------------------------------------------------------- 1 | import RouteInfo from './RouteInfo' 2 | 3 | export default RouteInfo 4 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/pages/Demo2/index.js: -------------------------------------------------------------------------------- 1 | import Demo2 from './Demo2' 2 | 3 | export default Demo2 4 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/pages/Error404/index.js: -------------------------------------------------------------------------------- 1 | import page from './page' 2 | 3 | export default page 4 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/pages/Error404/page.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 25 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/pages/Index/components/d2-badge/index.vue: -------------------------------------------------------------------------------- 1 | 20 | 21 | 37 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/pages/Index/components/d2-help-btn/image/d2-help-button@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ice-lab/vue-materials/3e5dd77d4a9a05c49081831abce91ae720aad5aa/scaffolds/d2-admin-ice/src/pages/Index/components/d2-help-btn/image/d2-help-button@2x.png -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/pages/Index/components/d2-help-btn/image/qq.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ice-lab/vue-materials/3e5dd77d4a9a05c49081831abce91ae720aad5aa/scaffolds/d2-admin-ice/src/pages/Index/components/d2-help-btn/image/qq.jpg -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/pages/Index/components/d2-help-btn/image/we.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ice-lab/vue-materials/3e5dd77d4a9a05c49081831abce91ae720aad5aa/scaffolds/d2-admin-ice/src/pages/Index/components/d2-help-btn/image/we.jpg -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/pages/Index/components/d2-page-cover/image/darkblue@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ice-lab/vue-materials/3e5dd77d4a9a05c49081831abce91ae720aad5aa/scaffolds/d2-admin-ice/src/pages/Index/components/d2-page-cover/image/darkblue@2x.png -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/pages/Index/components/d2-page-cover/index.vue: -------------------------------------------------------------------------------- 1 | 18 | 19 | 51 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/pages/Index/image/qr@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ice-lab/vue-materials/3e5dd77d4a9a05c49081831abce91ae720aad5aa/scaffolds/d2-admin-ice/src/pages/Index/image/qr@2x.png -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/pages/Index/index.js: -------------------------------------------------------------------------------- 1 | import page from './page' 2 | 3 | export default page 4 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/pages/Login/image/login-code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ice-lab/vue-materials/3e5dd77d4a9a05c49081831abce91ae720aad5aa/scaffolds/d2-admin-ice/src/pages/Login/image/login-code.png -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/pages/Login/image/logo@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ice-lab/vue-materials/3e5dd77d4a9a05c49081831abce91ae720aad5aa/scaffolds/d2-admin-ice/src/pages/Login/image/logo@2x.png -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/pages/Login/index.js: -------------------------------------------------------------------------------- 1 | import page from './page' 2 | 3 | export default page 4 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/plugin/d2admin/index.js: -------------------------------------------------------------------------------- 1 | // Element 2 | import ElementUI from 'element-ui' 3 | import 'element-ui/lib/theme-chalk/index.css' 4 | // flex 布局库 5 | import 'flex.css' 6 | // 组件 7 | import '@/components' 8 | // svg 图标 9 | import '@/assets/svg-icons' 10 | 11 | // 功能插件 12 | import pluginError from '@/plugin/error' 13 | import pluginLog from '@/plugin/log' 14 | import pluginOpen from '@/plugin/open' 15 | 16 | export default { 17 | async install (Vue, options) { 18 | // 设置为 false 以阻止 vue 在启动时生成生产提示 19 | // https://cn.vuejs.org/v2/api/#productionTip 20 | Vue.config.productionTip = false 21 | // 当前环境 22 | Vue.prototype.$env = process.env.NODE_ENV 23 | // 当前的 baseUrl 24 | Vue.prototype.$baseUrl = process.env.BASE_URL 25 | // 当前版本 26 | Vue.prototype.$version = process.env.VUE_APP_VERSION 27 | // 构建时间 28 | Vue.prototype.$buildTime = process.env.VUE_APP_BUILD_TIME 29 | // Element 30 | Vue.use(ElementUI) 31 | // 插件 32 | Vue.use(pluginError) 33 | Vue.use(pluginLog) 34 | Vue.use(pluginOpen) 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/plugin/error/index.js: -------------------------------------------------------------------------------- 1 | import store from '@/store' 2 | import util from '@/libs/util' 3 | 4 | export default { 5 | install (Vue, options) { 6 | Vue.config.errorHandler = function (error, instance, info) { 7 | Vue.nextTick(() => { 8 | // store 追加 log 9 | store.dispatch('d2admin/log/push', { 10 | message: `${info}: ${error.message}`, 11 | type: 'danger', 12 | meta: { 13 | error, 14 | instance 15 | } 16 | }) 17 | // 只在开发模式下打印 log 18 | if (process.env.NODE_ENV === 'development') { 19 | util.log.capsule('D2Admin', 'ErrorHandler', 'danger') 20 | util.log.danger('>>>>>> 错误信息 >>>>>>') 21 | console.log(info) 22 | util.log.danger('>>>>>> Vue 实例 >>>>>>') 23 | console.log(instance) 24 | util.log.danger('>>>>>> Error >>>>>>') 25 | console.log(error) 26 | } 27 | }) 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/plugin/log/index.js: -------------------------------------------------------------------------------- 1 | import store from '@/store' 2 | import util from '@/libs/util' 3 | 4 | export default { 5 | install (Vue, options) { 6 | // 快速打印 log 7 | Vue.prototype.$log = { 8 | ...util.log, 9 | push (data) { 10 | if (typeof data === 'string') { 11 | // 如果传递来的数据是字符串 12 | // 赋值给 message 字段 13 | // 为了方便使用 14 | // eg: this.$log.push('foo text') 15 | store.dispatch('d2admin/log/push', { 16 | message: data 17 | }) 18 | } else if (typeof data === 'object') { 19 | // 如果传递来的数据是对象 20 | store.dispatch('d2admin/log/push', data) 21 | } 22 | } 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/plugin/open/index.js: -------------------------------------------------------------------------------- 1 | import util from '@/libs/util' 2 | 3 | export default { 4 | install (Vue, options) { 5 | Vue.prototype.$open = util.open 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/router/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import VueRouter from 'vue-router' 3 | 4 | // 进度条 5 | import NProgress from 'nprogress' 6 | import 'nprogress/nprogress.css' 7 | 8 | import store from '@/store/index' 9 | 10 | import util from '@/libs/util.js' 11 | 12 | // 路由数据 13 | import routes from '@/config/routes' 14 | 15 | Vue.use(VueRouter) 16 | 17 | // 导出路由 在 main.js 里使用 18 | const router = new VueRouter({ 19 | routes 20 | }) 21 | 22 | /** 23 | * 路由拦截 24 | * 权限验证 25 | */ 26 | router.beforeEach((to, from, next) => { 27 | // 进度条 28 | NProgress.start() 29 | // 关闭搜索面板 30 | store.commit('d2admin/search/set', false) 31 | // 验证当前路由所有的匹配中是否需要有登录验证的 32 | if (to.matched.some(r => r.meta.auth)) { 33 | // 这里暂时将cookie里是否存有token作为验证是否登录的条件 34 | // 请根据自身业务需要修改 35 | const token = util.cookies.get('token') 36 | if (token && token !== 'undefined') { 37 | next() 38 | } else { 39 | // 没有登录的时候跳转到登录界面 40 | // 携带上登陆成功之后需要跳转的页面完整路径 41 | next({ 42 | name: 'login', 43 | query: { 44 | redirect: to.fullPath 45 | } 46 | }) 47 | // https://github.com/d2-projects/d2-admin/issues/138 48 | NProgress.done() 49 | } 50 | } else { 51 | // 不需要身份校验 直接通过 52 | next() 53 | } 54 | }) 55 | 56 | router.afterEach(to => { 57 | // 进度条 58 | NProgress.done() 59 | // 多页控制 打开新的页面 60 | store.dispatch('d2admin/page/open', to) 61 | // 更改标题 62 | util.title(to.meta.title) 63 | }) 64 | 65 | export default router 66 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/setting.js: -------------------------------------------------------------------------------- 1 | export default { 2 | // 快捷键 3 | // 支持快捷键 例如 ctrl+shift+s 4 | hotkey: { 5 | search: { 6 | open: 's', 7 | close: 'esc' 8 | } 9 | }, 10 | // 侧边栏默认折叠状态 11 | menu: { 12 | asideCollapse: false 13 | }, 14 | // 在读取持久化数据失败时默认页面 15 | page: { 16 | opened: [ 17 | { 18 | name: 'index', 19 | fullPath: '/', 20 | meta: { 21 | title: '首页', 22 | auth: false 23 | } 24 | } 25 | ] 26 | }, 27 | // 菜单搜索 28 | search: { 29 | enable: true 30 | }, 31 | // 注册的主题 32 | theme: { 33 | list: [ 34 | { 35 | title: 'd2admin 经典', 36 | name: 'd2', 37 | preview: 'image/theme/d2/preview@2x.png' 38 | }, 39 | { 40 | title: '紫罗兰', 41 | name: 'violet', 42 | preview: 'image/theme/violet/preview@2x.png' 43 | }, 44 | { 45 | title: '简约线条', 46 | name: 'line', 47 | backgroundImage: 'image/theme/line/bg.jpg', 48 | preview: 'image/theme/line/preview@2x.png' 49 | }, 50 | { 51 | title: '流星', 52 | name: 'star', 53 | backgroundImage: 'image/theme/star/bg.jpg', 54 | preview: 'image/theme/star/preview@2x.png' 55 | }, 56 | { 57 | title: 'Tomorrow Night Blue (vsCode)', 58 | name: 'tomorrow-night-blue', 59 | preview: 'image/theme/tomorrow-night-blue/preview@2x.png' 60 | } 61 | ] 62 | }, 63 | // 是否默认开启页面切换动画 64 | transition: { 65 | active: true 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/store/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Vuex from 'vuex' 3 | 4 | import d2admin from './modules/d2admin' 5 | 6 | Vue.use(Vuex) 7 | 8 | export default new Vuex.Store({ 9 | modules: { 10 | d2admin 11 | } 12 | }) 13 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/store/modules/d2admin/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * The file enables `@/store/index.js` to import all vuex modules 3 | * in a one-shot manner. There should not be any reason to edit this file. 4 | */ 5 | 6 | const files = require.context('./modules', false, /\.js$/) 7 | const modules = {} 8 | 9 | files.keys().forEach(key => { 10 | modules[key.replace(/(\.\/|\.js)/g, '')] = files(key).default 11 | }) 12 | 13 | export default { 14 | namespaced: true, 15 | modules 16 | } 17 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/store/modules/d2admin/modules/fullscreen.js: -------------------------------------------------------------------------------- 1 | import screenfull from 'screenfull' 2 | 3 | export default { 4 | namespaced: true, 5 | state: { 6 | // 全屏激活 7 | active: false 8 | }, 9 | actions: { 10 | /** 11 | * @description 初始化监听 12 | */ 13 | listen ({ commit }) { 14 | return new Promise(resolve => { 15 | if (screenfull.enabled) { 16 | screenfull.on('change', () => { 17 | console.log('1') 18 | if (!screenfull.isFullscreen) { 19 | commit('set', false) 20 | } 21 | }) 22 | } 23 | // end 24 | resolve() 25 | }) 26 | }, 27 | /** 28 | * @description 切换全屏 29 | */ 30 | toggle ({ commit }) { 31 | return new Promise(resolve => { 32 | if (screenfull.isFullscreen) { 33 | screenfull.exit() 34 | commit('set', false) 35 | } else { 36 | screenfull.request() 37 | commit('set', true) 38 | } 39 | // end 40 | resolve() 41 | }) 42 | } 43 | }, 44 | mutations: { 45 | /** 46 | * @description 设置 store 里的全屏状态 47 | * @param {Object} state vuex state 48 | * @param {Boolean} active active 49 | */ 50 | set (state, active) { 51 | state.active = active 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/store/modules/d2admin/modules/gray.js: -------------------------------------------------------------------------------- 1 | export default { 2 | namespaced: true, 3 | state: { 4 | // 灰度 5 | active: false 6 | }, 7 | mutations: { 8 | /** 9 | * @description 切换灰度状态 10 | * @param {Object} state vuex state 11 | */ 12 | toggle (state) { 13 | state.active = !state.active 14 | }, 15 | /** 16 | * @description 设置灰度模式 17 | * @param {Object} state vuex state 18 | * @param {Boolean} active active 19 | */ 20 | set (state, active) { 21 | state.active = active 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/store/modules/d2admin/modules/releases.js: -------------------------------------------------------------------------------- 1 | import util from '@/libs/util.js' 2 | 3 | export default { 4 | namespaced: true, 5 | mutations: { 6 | /** 7 | * @description 显示版本信息 8 | * @param {Object} state vuex state 9 | */ 10 | versionShow () { 11 | util.log.capsule('D2Admin', `v${process.env.VUE_APP_VERSION}`) 12 | console.log('D2 Admin https://github.com/d2-projects/d2-admin') 13 | console.log('D2 Crud https://github.com/d2-projects/d2-crud') 14 | console.log('Document https://fairyever.com/d2-admin/doc/zh/') 15 | console.log('请不要吝啬您的 star,谢谢 ~') 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/store/modules/d2admin/modules/search.js: -------------------------------------------------------------------------------- 1 | import setting from '@/setting.js' 2 | 3 | export default { 4 | namespaced: true, 5 | state: { 6 | // 搜索面板激活状态 7 | active: false, 8 | // 快捷键 9 | hotkey: { 10 | open: setting.hotkey.search.open, 11 | close: setting.hotkey.search.close 12 | }, 13 | // 所有可以搜索的页面 14 | pool: [] 15 | }, 16 | mutations: { 17 | /** 18 | * @description 切换激活状态 19 | * @param {Object} state vuex state 20 | */ 21 | toggle (state) { 22 | state.active = !state.active 23 | }, 24 | /** 25 | * @description 设置激活模式 26 | * @param {Object} state vuex state 27 | * @param {Boolean} active active 28 | */ 29 | set (state, active) { 30 | state.active = active 31 | }, 32 | /** 33 | * @description 初始化 34 | * @param {Object} state vuex state 35 | * @param {Array} menu menu 36 | */ 37 | init (state, menu) { 38 | const pool = [] 39 | const push = function (menu, titlePrefix = []) { 40 | menu.forEach(m => { 41 | if (m.children) { 42 | push(m.children, [ ...titlePrefix, m.title ]) 43 | } else { 44 | pool.push({ 45 | ...m, 46 | fullTitle: [ ...titlePrefix, m.title ].join(' / ') 47 | }) 48 | } 49 | }) 50 | } 51 | push(menu) 52 | state.pool = pool 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/store/modules/d2admin/modules/size.js: -------------------------------------------------------------------------------- 1 | export default { 2 | namespaced: true, 3 | state: { 4 | // 尺寸 5 | value: '' // medium small mini 6 | }, 7 | actions: { 8 | /** 9 | * @description 设置尺寸 10 | * @param {Object} state vuex state 11 | * @param {String} size 尺寸 12 | */ 13 | set ({ state, dispatch }, size) { 14 | return new Promise(async resolve => { 15 | // store 赋值 16 | state.value = size 17 | // 持久化 18 | await dispatch('d2admin/db/set', { 19 | dbName: 'sys', 20 | path: 'size.value', 21 | value: state.value, 22 | user: true 23 | }, { root: true }) 24 | // end 25 | resolve() 26 | }) 27 | }, 28 | /** 29 | * @description 从持久化数据读取尺寸设置 30 | * @param {Object} state vuex state 31 | */ 32 | load ({ state, dispatch }) { 33 | return new Promise(async resolve => { 34 | // store 赋值 35 | state.value = await dispatch('d2admin/db/get', { 36 | dbName: 'sys', 37 | path: 'size.value', 38 | defaultValue: 'default', 39 | user: true 40 | }, { root: true }) 41 | // end 42 | resolve() 43 | }) 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/store/modules/d2admin/modules/transition.js: -------------------------------------------------------------------------------- 1 | // 设置文件 2 | import setting from '@/setting.js' 3 | 4 | export default { 5 | namespaced: true, 6 | state: { 7 | // 是否开启页面过度动画 8 | active: setting.transition.active 9 | }, 10 | actions: { 11 | /** 12 | * @description 设置开启状态 13 | * @param {Object} state vuex state 14 | * @param {Boolean} active 新的状态 15 | */ 16 | set ({ state, dispatch }, active) { 17 | return new Promise(async resolve => { 18 | // store 赋值 19 | state.active = active 20 | // 持久化 21 | await dispatch('d2admin/db/set', { 22 | dbName: 'sys', 23 | path: 'transition.active', 24 | value: state.active, 25 | user: true 26 | }, { root: true }) 27 | // end 28 | resolve() 29 | }) 30 | }, 31 | /** 32 | * 从数据库读取页面过渡动画设置 33 | * @param {Object} state vuex state 34 | */ 35 | load ({ state, dispatch }) { 36 | return new Promise(async resolve => { 37 | // store 赋值 38 | state.active = await dispatch('d2admin/db/get', { 39 | dbName: 'sys', 40 | path: 'transition.active', 41 | defaultValue: setting.transition.active, 42 | user: true 43 | }, { root: true }) 44 | // end 45 | resolve() 46 | }) 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/store/modules/d2admin/modules/ua.js: -------------------------------------------------------------------------------- 1 | import UaParser from 'ua-parser-js' 2 | 3 | export default { 4 | namespaced: true, 5 | state: { 6 | // 用户 UA 7 | data: {} 8 | }, 9 | mutations: { 10 | /** 11 | * @description 记录 UA 12 | * @param {Object} state vuex state 13 | */ 14 | get (state) { 15 | state.data = new UaParser().getResult() 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/src/store/modules/d2admin/modules/user.js: -------------------------------------------------------------------------------- 1 | export default { 2 | namespaced: true, 3 | state: { 4 | // 用户信息 5 | info: {} 6 | }, 7 | actions: { 8 | /** 9 | * @description 设置用户数据 10 | * @param {Object} state vuex state 11 | * @param {*} info info 12 | */ 13 | set ({ state, dispatch }, info) { 14 | return new Promise(async resolve => { 15 | // store 赋值 16 | state.info = info 17 | // 持久化 18 | await dispatch('d2admin/db/set', { 19 | dbName: 'sys', 20 | path: 'user.info', 21 | value: info, 22 | user: true 23 | }, { root: true }) 24 | // end 25 | resolve() 26 | }) 27 | }, 28 | /** 29 | * @description 从数据库取用户数据 30 | * @param {Object} state vuex state 31 | */ 32 | load ({ state, dispatch }) { 33 | return new Promise(async resolve => { 34 | // store 赋值 35 | state.info = await dispatch('d2admin/db/get', { 36 | dbName: 'sys', 37 | path: 'user.info', 38 | defaultValue: {}, 39 | user: true 40 | }, { root: true }) 41 | // end 42 | resolve() 43 | }) 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/tests/unit/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | env: { 3 | jest: true 4 | }, 5 | rules: { 6 | 'import/no-extraneous-dependencies': 'off' 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/tests/unit/HelloWorld.spec.js: -------------------------------------------------------------------------------- 1 | // 暂时 D2 没有单元测试代码 此文件为自动生成 2 | 3 | import { shallowMount } from '@vue/test-utils' 4 | import HelloWorld from '@/components/HelloWorld.vue' 5 | 6 | describe('HelloWorld.vue', () => { 7 | it('renders props.msg when passed', () => { 8 | const msg = 'new message' 9 | const wrapper = shallowMount(HelloWorld, { 10 | propsData: { msg } 11 | }) 12 | expect(wrapper.text()).toMatch(msg) 13 | }) 14 | }) 15 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/tools/vue-filename-injector/README.md: -------------------------------------------------------------------------------- 1 | # Vue Filename Injector 2 | 3 | Inject the file path of the `.vue` on `this.$options.__source`. 4 | 5 | ## Usage 6 | 7 | `vue.config.js`: 8 | 9 | ``` js 10 | const VueFilenameInjector = require('./path/to/vue-filename-injector') 11 | 12 | module.exports = { 13 | 14 | chainWebpack: config => { 15 | // only with chainWebpack 16 | VueFilenameInjector(config, { 17 | propName: '__source' // default 18 | }) 19 | } 20 | } 21 | ``` 22 | 23 | ## Relevant 24 | 25 | https://github.com/neutrinojs/webpack-chain 26 | https://vue-loader.vuejs.org/guide/custom-blocks.html 27 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/tools/vue-filename-injector/index.js: -------------------------------------------------------------------------------- 1 | const all = require('./src/index.js') 2 | module.exports = all 3 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/tools/vue-filename-injector/src/index.js: -------------------------------------------------------------------------------- 1 | const { blockName } = require('./lib/config.js') 2 | 3 | // for chainWebpack 4 | module.exports = function (config, options) { 5 | config.module 6 | .rule('vue') 7 | .use('vue-filename-injector') 8 | .loader(require.resolve('./lib/injector.js')) 9 | .options(options) 10 | .after('vue-loader') 11 | .end() 12 | config.module 13 | .rule('') 14 | .resourceQuery(new RegExp(`blockType=${blockName}`)) 15 | .use('vue-filename-injector-loader') 16 | .loader(require.resolve('./lib/loader.js')) 17 | .end() 18 | } 19 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/tools/vue-filename-injector/src/lib/config.js: -------------------------------------------------------------------------------- 1 | const defaultPropName = '__source' 2 | const blockName = 'vue-filename-injector' 3 | 4 | module.exports = { 5 | defaultPropName, 6 | blockName 7 | } 8 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/tools/vue-filename-injector/src/lib/injector.js: -------------------------------------------------------------------------------- 1 | const path = require('path') 2 | const loaderUtils = require('loader-utils') 3 | 4 | const { blockName, defaultPropName } = require('./config.js') 5 | 6 | module.exports = function (content /*, map, meta */) { 7 | const loaderContext = this 8 | 9 | const { 10 | rootContext, 11 | resourcePath 12 | } = loaderContext 13 | 14 | const context = rootContext || process.cwd() 15 | const options = loaderUtils.getOptions(loaderContext) || {} 16 | const rawShortFilePath = path 17 | .relative(context, resourcePath) 18 | .replace(/^(\.\.[/\\])+/, '') 19 | 20 | const propName = options.propName || defaultPropName 21 | 22 | content += ` 23 | <${blockName}> 24 | export default function (Component) { 25 | Component.options.${propName} = ${JSON.stringify(rawShortFilePath.replace(/\\/g, '/'))} 26 | } 27 | 28 | ` 29 | return content 30 | } 31 | -------------------------------------------------------------------------------- /scaffolds/d2-admin-ice/tools/vue-filename-injector/src/lib/loader.js: -------------------------------------------------------------------------------- 1 | module.exports = function (source, map) { 2 | this.callback(null, source, map) 3 | } 4 | -------------------------------------------------------------------------------- /scaffolds/icestark-child-app/README.md: -------------------------------------------------------------------------------- 1 | # Vite + icestark + vue3 Demo 2 | 3 | Demo for building icestark micro applications created by Vite. 4 | 5 | ## Online 6 | 7 | https://icestark-vite-vue.vercel.app/ 8 | -------------------------------------------------------------------------------- /scaffolds/icestark-child-app/_gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | dist 4 | dist-ssr 5 | *.local 6 | -------------------------------------------------------------------------------- /scaffolds/icestark-child-app/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | icestark + vite + vue3 8 | 9 | 10 |
11 | 12 | 13 | -------------------------------------------------------------------------------- /scaffolds/icestark-child-app/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vue-materials/icestark-child-app", 3 | "version": "3.0.2", 4 | "description": "icestark 基于 Vue 的子应用模板", 5 | "homepage": "https://icestark-vite-vue.vercel.app/", 6 | "scripts": { 7 | "dev": "vite", 8 | "build": "vue-tsc --noEmit && vite build", 9 | "serve": "vite preview" 10 | }, 11 | "files": [ 12 | "src/", 13 | "dist/", 14 | "public/", 15 | "_gitignore", 16 | "index.html", 17 | "README.md", 18 | "vite.config.ts", 19 | "tsconfig.json" 20 | ], 21 | "dependencies": { 22 | "@ice/stark-app": "^1.4.1", 23 | "vue": "^3.2.16", 24 | "vue-router": "^4.0.11" 25 | }, 26 | "devDependencies": { 27 | "@vitejs/plugin-vue": "^1.9.2", 28 | "typescript": "^4.4.3", 29 | "vite": "^2.6.0", 30 | "vite-plugin-index-html": "^2.0.0", 31 | "vue-tsc": "^0.3.0" 32 | }, 33 | "repository": { 34 | "type": "git", 35 | "url": "https://github.com/ice-lab/vue-materials/tree/master/scaffolds/icestark-child-app" 36 | }, 37 | "license": "MIT", 38 | "keywords": [ 39 | "ice", 40 | "ice-scaffold" 41 | ], 42 | "publishConfig": { 43 | "access": "public" 44 | }, 45 | "scaffoldConfig": { 46 | "name": "icestark-child-app", 47 | "title": "icestark Vue 子应用", 48 | "screenshot": "https://img.alicdn.com/tfs/TB1X5.paYr1gK0jSZFDXXb9yVXa-2480-1200.png", 49 | "categories": [ 50 | "icestark" 51 | ] 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /scaffolds/icestark-child-app/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ice-lab/vue-materials/3e5dd77d4a9a05c49081831abce91ae720aad5aa/scaffolds/icestark-child-app/public/favicon.ico -------------------------------------------------------------------------------- /scaffolds/icestark-child-app/src/App.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 27 | 28 | 38 | -------------------------------------------------------------------------------- /scaffolds/icestark-child-app/src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ice-lab/vue-materials/3e5dd77d4a9a05c49081831abce91ae720aad5aa/scaffolds/icestark-child-app/src/assets/logo.png -------------------------------------------------------------------------------- /scaffolds/icestark-child-app/src/components/404.vue: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /scaffolds/icestark-child-app/src/components/Detail.vue: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /scaffolds/icestark-child-app/src/components/HelloWorld.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 25 | 26 | 43 | -------------------------------------------------------------------------------- /scaffolds/icestark-child-app/src/components/List.vue: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /scaffolds/icestark-child-app/src/env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | declare module '*.vue' { 4 | import { DefineComponent } from 'vue' 5 | // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types 6 | const component: DefineComponent<{}, {}, any> 7 | export default component 8 | } 9 | -------------------------------------------------------------------------------- /scaffolds/icestark-child-app/src/main.ts: -------------------------------------------------------------------------------- 1 | import { createApp } from 'vue'; 2 | import type { App as Root } from 'vue'; 3 | import { createWebHistory, createRouter } from 'vue-router'; 4 | import isInIcestark from '@ice/stark-app/lib/isInIcestark'; 5 | import getBasename from '@ice/stark-app/lib/getBasename'; 6 | import App from './App.vue'; 7 | import routes from './routes'; 8 | 9 | 10 | let vue: Root | null = null; 11 | 12 | const runApp = (container: Element | string) => { 13 | const history = createWebHistory(isInIcestark() ? getBasename() : '/'); 14 | const router = createRouter({ 15 | history, 16 | routes, 17 | }); 18 | vue = createApp(App); 19 | vue.use(router); 20 | vue.mount(container); 21 | }; 22 | 23 | if (!isInIcestark()) { 24 | runApp('#app'); 25 | } 26 | 27 | export function mount({ container }: { container: Element}) { 28 | runApp(container); 29 | } 30 | 31 | export function unmount() { 32 | if (vue) { 33 | vue.unmount(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /scaffolds/icestark-child-app/src/routes.ts: -------------------------------------------------------------------------------- 1 | import HelloWorld from './components/HelloWorld.vue'; 2 | import List from './components/List.vue'; 3 | import Detail from './components/Detail.vue'; 4 | import NotFound from './components/404.vue'; 5 | import isInIcestark from '@ice/stark-app/lib/isInIcestark'; 6 | import renderNotFound from '@ice/stark-app/lib/renderNotFound'; 7 | 8 | const renderNotFoundPromise = () => new Promise((resolve) => { 9 | renderNotFound(); 10 | resolve(true); 11 | }); 12 | 13 | const routes = [ 14 | { 15 | path: '/', 16 | component: HelloWorld, 17 | }, 18 | { 19 | path: '/list', 20 | component: List, 21 | }, 22 | { 23 | path: '/detail', 24 | component: Detail, 25 | }, 26 | { 27 | path: '/:pathMatch(.*)', 28 | component: isInIcestark() ? () => renderNotFoundPromise() : NotFound, 29 | }, 30 | ]; 31 | 32 | export default routes; 33 | -------------------------------------------------------------------------------- /scaffolds/icestark-child-app/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "esnext", 4 | "useDefineForClassFields": true, 5 | "module": "esnext", 6 | "moduleResolution": "node", 7 | "strict": true, 8 | "jsx": "preserve", 9 | "sourceMap": true, 10 | "resolveJsonModule": true, 11 | "esModuleInterop": true, 12 | "lib": ["esnext", "dom"], 13 | "skipLibCheck": true 14 | }, 15 | "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"] 16 | } 17 | -------------------------------------------------------------------------------- /scaffolds/icestark-child-app/vite.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite'; 2 | import vue from '@vitejs/plugin-vue'; 3 | import htmlPlugin from 'vite-plugin-index-html'; 4 | 5 | // https://vitejs.dev/config/ 6 | export default defineConfig({ 7 | plugins: [vue(), htmlPlugin({ 8 | input: './src/main.ts', 9 | preserveEntrySignatures: 'exports-only', 10 | })], 11 | base: './', 12 | }); 13 | -------------------------------------------------------------------------------- /scaffolds/icestark-framework-app/README.md: -------------------------------------------------------------------------------- 1 | # Vite + icestark + vue3 框架应用 2 | 3 | Demo for building icestark framework application created by Vite. 4 | 5 | ## Online 6 | 7 | https://icestark-framework-vue3-x.vercel.app/ 8 | 9 | -------------------------------------------------------------------------------- /scaffolds/icestark-framework-app/_gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | dist 4 | dist-ssr 5 | *.local 6 | -------------------------------------------------------------------------------- /scaffolds/icestark-framework-app/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | icestark framework + vue3 8 | 9 | 10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /scaffolds/icestark-framework-app/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vue-materials/icestark-layout-app", 3 | "version": "1.0.1", 4 | "description": "icestark 基于 Vue 的主应用模板", 5 | "homepage": "https://icestark-framework-vue3-x.vercel.app/", 6 | "scripts": { 7 | "dev": "vite", 8 | "build": "vue-tsc --noEmit && vite build", 9 | "serve": "vite preview" 10 | }, 11 | "files": [ 12 | "src/", 13 | "dist/", 14 | "public/", 15 | "_gitignore", 16 | "index.html", 17 | "README.md", 18 | "vite.config.ts", 19 | "tsconfig.json" 20 | ], 21 | "dependencies": { 22 | "@element-plus/icons-vue": "^0.2.4", 23 | "@ice/stark": "^2.6.1", 24 | "element-plus": "^1.2.0-beta.6", 25 | "vue": "^3.2.16", 26 | "vue-router": "^4.0.11" 27 | }, 28 | "devDependencies": { 29 | "@vitejs/plugin-vue": "^1.9.2", 30 | "typescript": "^4.4.3", 31 | "vite": "^2.6.0", 32 | "vite-plugin-index-html": "^0.1.0", 33 | "vue-tsc": "^0.3.0" 34 | }, 35 | "repository": { 36 | "type": "git", 37 | "url": "https://github.com/ice-lab/vue-materials/tree/master/scaffolds/icestark-framework-app" 38 | }, 39 | "license": "MIT", 40 | "keywords": [ 41 | "ice", 42 | "ice-scaffold" 43 | ], 44 | "publishConfig": { 45 | "access": "public" 46 | }, 47 | "scaffoldConfig": { 48 | "name": "icestark-framework-app", 49 | "title": "icestark Vue 主应用", 50 | "screenshot": "https://img.alicdn.com/imgextra/i4/O1CN01viScHq1xQC8KtFTIH_!!6000000006437-2-tps-1811-904.png", 51 | "categories": [ 52 | "icestark" 53 | ] 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /scaffolds/icestark-framework-app/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ice-lab/vue-materials/3e5dd77d4a9a05c49081831abce91ae720aad5aa/scaffolds/icestark-framework-app/public/favicon.ico -------------------------------------------------------------------------------- /scaffolds/icestark-framework-app/src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ice-lab/vue-materials/3e5dd77d4a9a05c49081831abce91ae720aad5aa/scaffolds/icestark-framework-app/src/assets/logo.png -------------------------------------------------------------------------------- /scaffolds/icestark-framework-app/src/components/HelloWorld.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 35 | 36 | 53 | -------------------------------------------------------------------------------- /scaffolds/icestark-framework-app/src/components/List.vue: -------------------------------------------------------------------------------- 1 | 5 | -------------------------------------------------------------------------------- /scaffolds/icestark-framework-app/src/env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | declare module '*.vue' { 4 | import { DefineComponent } from 'vue' 5 | // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types 6 | const component: DefineComponent<{}, {}, any> 7 | export default component 8 | } 9 | -------------------------------------------------------------------------------- /scaffolds/icestark-framework-app/src/main.ts: -------------------------------------------------------------------------------- 1 | import { createApp } from 'vue'; 2 | import App from './App.vue'; 3 | import ElementPlus from 'element-plus'; 4 | import router from './router'; 5 | import 'element-plus/dist/index.css'; 6 | 7 | const vue = createApp(App); 8 | vue.use(router); 9 | // @ts-ignore 10 | vue.use(ElementPlus); 11 | 12 | vue.mount('#app'); 13 | -------------------------------------------------------------------------------- /scaffolds/icestark-framework-app/src/pages/About.vue: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /scaffolds/icestark-framework-app/src/pages/Home.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 24 | -------------------------------------------------------------------------------- /scaffolds/icestark-framework-app/src/pages/Login.vue: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /scaffolds/icestark-framework-app/src/pages/NotFound.vue: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /scaffolds/icestark-framework-app/src/router.ts: -------------------------------------------------------------------------------- 1 | import { createRouter, createWebHistory } from 'vue-router'; 2 | import Home from './pages/Home.vue'; 3 | import About from './pages/About.vue'; 4 | import Login from './pages/Login.vue'; 5 | import NotFound from './pages/NotFound.vue'; 6 | 7 | const routerHistory = createWebHistory(); 8 | 9 | const router = createRouter({ 10 | history: routerHistory, 11 | routes: [ 12 | { 13 | path: '/', 14 | name: 'home', 15 | component: Home, 16 | }, 17 | { 18 | path: '/about', 19 | name: 'about', 20 | component: About, 21 | }, 22 | { 23 | path: '/login', 24 | name: 'login', 25 | component: Login, 26 | }, 27 | { 28 | path: '/:pathMatch(.*)', 29 | name: 'notfound', 30 | component: NotFound, 31 | }, 32 | ], 33 | }); 34 | 35 | export default router; 36 | -------------------------------------------------------------------------------- /scaffolds/icestark-framework-app/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "esnext", 4 | "useDefineForClassFields": true, 5 | "module": "esnext", 6 | "moduleResolution": "node", 7 | "strict": true, 8 | "jsx": "preserve", 9 | "sourceMap": true, 10 | "resolveJsonModule": true, 11 | "esModuleInterop": true, 12 | "lib": ["esnext", "dom"], 13 | "skipLibCheck": true 14 | }, 15 | "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"] 16 | } 17 | -------------------------------------------------------------------------------- /scaffolds/icestark-framework-app/vite.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite'; 2 | import vue from '@vitejs/plugin-vue'; 3 | 4 | // https://vitejs.dev/config/ 5 | export default defineConfig({ 6 | plugins: [vue()], 7 | }); 8 | -------------------------------------------------------------------------------- /scripts/upload-oss.js: -------------------------------------------------------------------------------- 1 | /* eslint arrow-body-style:0 */ 2 | const oss = require('ali-oss'); 3 | const path = require('path'); 4 | const fs = require('fs'); 5 | const util = require('util'); 6 | const pkgData = require('../package.json'); 7 | 8 | const bucket = 'iceworks'; 9 | const accessKeyId = process.env.ACCESS_KEY_ID; 10 | const accessKeySecret = process.env.ACCESS_KEY_SECRET; 11 | const branch = process.env.BRANCH_NAME; 12 | const dirPath = pkgData.kitVersion === '3.x' ? 'materials/' : '/'; 13 | let assetsPath; 14 | 15 | if (['master', 'stable/kit-2.x'].indexOf(branch) === -1) { 16 | assetsPath = 'pre-assets'; 17 | } else { 18 | assetsPath = 'assets'; 19 | } 20 | 21 | const ossClient = oss({ 22 | bucket, 23 | endpoint: 'oss-cn-hangzhou.aliyuncs.com', 24 | accessKeyId, 25 | accessKeySecret, 26 | time: '120s', 27 | }); 28 | 29 | const materialPath = path.resolve(__dirname, '../build/materials.json'); 30 | const toPath = path.join(assetsPath, dirPath, 'vue-materials.json'); 31 | 32 | /** 33 | * 按照下载量进行排序推荐 34 | */ 35 | function sortScaffoldMaterials() { 36 | return util.promisify(fs.readFile)(materialPath, 'utf-8') 37 | .then(JSON.parse) 38 | .then((materialsData) => { 39 | return util.promisify(fs.writeFile)( 40 | materialPath, 41 | JSON.stringify(materialsData, null, 2), 42 | 'utf-8', 43 | ); 44 | }); 45 | } 46 | 47 | console.log('start upload oss', materialPath, toPath); 48 | 49 | sortScaffoldMaterials() 50 | .then(() => { 51 | return ossClient.put(toPath, materialPath); 52 | }) 53 | .then((result) => { 54 | console.log('upload success', result); 55 | }); 56 | -------------------------------------------------------------------------------- /scripts/utils/checkVersionExist.ts: -------------------------------------------------------------------------------- 1 | import { getVersions } from 'ice-npm-utils'; 2 | 3 | export default async function checkVersionExit(name: string, version: string, registry?: string): Promise { 4 | try { 5 | const versions = await getVersions(name, registry); 6 | return versions.indexOf(version) !== -1; 7 | } catch (err) { 8 | console.error('checkVersionExit error', err); 9 | return false; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /scripts/utils/generateBetaVersion.ts: -------------------------------------------------------------------------------- 1 | import axios from 'axios'; 2 | 3 | const registry = 'https://registry.npmjs.org/'; 4 | 5 | export default async function generateBetaVersion(name, version) { 6 | try { 7 | const response = await axios.get(`${registry}${name}`); 8 | const { data } = response; 9 | const betaVersion = data['dist-tags'] && data['dist-tags'].beta; 10 | 11 | // 不存在 beta 版本或者不存在该正式版本的 beta 版本,以0为初始版本号 12 | if (!betaVersion || !new RegExp(`^${version}`).test(betaVersion)) { 13 | return `${version}-beta.0`; 14 | } 15 | 16 | // 匹配到 beta 数字版本,版本号 + 1 17 | const matchBeta = betaVersion.match(/\d+\.\d+\.\d+-beta\.(\d+)/); 18 | if (matchBeta) { 19 | return `${version}-beta.${parseInt(matchBeta[1], 10) + 1}`; 20 | } 21 | 22 | // 获取版本无法匹配 beta,走时间戳形式版本号进行兜底 23 | return `${version}-beta.${parseInt(String((new Date()).getTime() / 1000), 10)}`; 24 | } catch (err) { 25 | // 有可能是包还未发过 26 | console.error(err); 27 | return `${version}-beta.0`; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "jsx": "react", 5 | "experimentalDecorators": true, 6 | "declaration": true, 7 | "esModuleInterop": true, 8 | "skipLibCheck": false, 9 | "lib": ["es5", "dom"] 10 | } 11 | } --------------------------------------------------------------------------------