├── src ├── components │ ├── tools │ │ ├── index.js │ │ ├── DetailList.vue │ │ ├── Logo.vue │ │ ├── Breadcrumb.vue │ │ ├── HeadInfo.vue │ │ ├── UserMenu.vue │ │ └── TwoStepCaptcha.vue │ ├── Menu │ │ ├── index.js │ │ └── SideMenu.vue │ ├── IconText │ │ ├── index.js │ │ └── IconText.vue │ ├── Result │ │ ├── index.js │ │ └── Result.vue │ ├── Trend │ │ ├── index.js │ │ ├── index.less │ │ ├── index.md │ │ └── Trend.vue │ ├── Ellipsis │ │ ├── index.js │ │ ├── index.md │ │ └── Ellipsis.vue │ ├── CountDown │ │ ├── index.js │ │ ├── index.md │ │ └── CountDown.vue │ ├── NoticeIcon │ │ └── index.js │ ├── PageHeader │ │ └── index.js │ ├── NumberInfo │ │ ├── index.js │ │ ├── index.md │ │ ├── NumberInfo.vue │ │ └── index.less │ ├── Exception │ │ ├── index.js │ │ ├── type.js │ │ └── ExceptionPage.vue │ ├── GlobalFooter │ │ ├── index.js │ │ └── GlobalFooter.vue │ ├── GlobalHeader │ │ └── index.js │ ├── IconSelector │ │ ├── index.js │ │ ├── README.md │ │ └── IconSelector.vue │ ├── SettingDrawer │ │ ├── index.js │ │ ├── SettingItem.vue │ │ ├── themeColor.js │ │ └── settingConfig.js │ ├── DescriptionList │ │ ├── index.js │ │ └── DescriptionList.vue │ ├── AvatarList │ │ ├── index.js │ │ ├── Item.vue │ │ ├── index.less │ │ ├── index.md │ │ └── List.vue │ ├── MultiTab │ │ ├── index.js │ │ └── index.less │ ├── StandardFormRow │ │ ├── index.js │ │ └── StandardFormRow.vue │ ├── ArticleListContent │ │ ├── index.js │ │ └── ArticleListContent.vue │ ├── FooterToolbar │ │ ├── index.js │ │ ├── index.less │ │ ├── FooterToolBar.vue │ │ └── index.md │ ├── index.less │ ├── Charts │ │ ├── chart.less │ │ ├── smooth.area.less │ │ ├── MiniSmoothArea.vue │ │ ├── MiniBar.vue │ │ ├── MiniArea.vue │ │ ├── TransferBar.vue │ │ ├── Bar.vue │ │ ├── Liquid.vue │ │ ├── Radar.vue │ │ ├── MiniProgress.vue │ │ ├── RankList.vue │ │ ├── Trend.vue │ │ ├── ChartCard.vue │ │ └── TagCloud.vue │ ├── PageLoading │ │ └── index.jsx │ ├── _util │ │ └── util.js │ ├── TagSelect │ │ ├── TagSelectOption.jsx │ │ └── index.jsx │ ├── Editor │ │ ├── WangEditor.vue │ │ └── QuillEditor.vue │ └── index.js ├── assets │ ├── logo.png │ ├── gGlUMYGEIvjDOOw.jpg │ ├── login-bg.0899ffa6.jpg │ ├── logo.svg │ └── icons │ │ └── bx-analyse.svg ├── utils │ ├── permissions.js │ ├── domUtil.js │ ├── treeDataHelper.js │ ├── filter.js │ ├── axios.js │ ├── device.js │ ├── tools.js │ ├── utils.less │ ├── helper │ │ └── permission.js │ ├── arrayToTreeConverter.js │ ├── storage.js │ ├── util.js │ ├── request.js │ └── mixin.js ├── views │ ├── account │ │ ├── center │ │ │ └── page │ │ │ │ ├── index.js │ │ │ │ ├── Article.vue │ │ │ │ ├── Project.vue │ │ │ │ └── App.vue │ │ ├── settings │ │ │ ├── Binding.vue │ │ │ ├── Notification.vue │ │ │ ├── Security.vue │ │ │ └── Custom.vue │ │ ├── register │ │ │ └── RegisterResult.vue │ │ └── noticeIcon │ │ │ └── Index.vue │ ├── 404.vue │ ├── exception │ │ ├── 403.vue │ │ ├── 404.vue │ │ └── 500.vue │ └── admin │ │ ├── organization │ │ ├── index.less │ │ ├── components │ │ │ └── zoom-controller.vue │ │ └── modules │ │ │ └── CreateOrEditForm.vue │ │ └── users │ │ └── modules │ │ └── EditUserPermissions.vue ├── layouts │ ├── BlankLayout.vue │ ├── index.js │ └── RouteView.vue ├── router │ └── index.js ├── core │ ├── precise │ │ ├── utils │ │ │ └── precise.utils.js │ │ ├── auth │ │ │ ├── precise.token.js │ │ │ ├── PermissionChecker.js │ │ │ └── AppAuthService.js │ │ ├── helpers │ │ │ ├── SubdomainTenancyNameFinder.js │ │ │ ├── SignalRHelper.js │ │ │ ├── XmlHttpRequestHelper.js │ │ │ └── UrlHelper.js │ │ ├── AppConsts.js │ │ └── common │ │ │ └── nav │ │ │ └── appUrl.js │ ├── icons.js │ ├── lazy_use.js │ ├── use.js │ ├── directives │ │ └── action.js │ ├── bootstrap.js │ └── lazy_lib │ │ └── components_use.js ├── api │ ├── index.js │ ├── precise │ │ ├── profile.js │ │ ├── permission.js │ │ ├── session.js │ │ ├── role.js │ │ ├── notification.js │ │ ├── tokenAuth.js │ │ ├── user.js │ │ └── organizationUnit.js │ ├── manage.js │ └── login.js ├── App.vue ├── store │ ├── index.js │ ├── getters.js │ ├── mutation-types.js │ └── precise │ │ ├── permission.js │ │ └── notification.js ├── mock │ ├── index.js │ ├── util.js │ └── dataapi │ │ ├── auth.js │ │ └── article.js ├── config │ └── defaultSettings.js ├── main.js └── permission.js ├── .gitattributes ├── .env ├── .env.preview ├── .prettierrc.json ├── public ├── logo.png ├── upload.png ├── avatar2.jpg ├── preview │ ├── login.png │ ├── role.png │ ├── user.png │ ├── edituser.png │ ├── message.png │ ├── workplace.png │ └── organization.png ├── notifications │ ├── error.png │ ├── fatal.png │ ├── info.png │ ├── warn.png │ └── success.png ├── loading │ ├── loading.html │ ├── option2 │ │ ├── loading.css │ │ ├── loading.svg │ │ └── html_code_segment.html │ └── loading.css ├── appconfig.json └── index.html ├── tests └── unit │ └── .eslintrc.js ├── .prettierrc ├── jsconfig.json ├── .gitignore ├── webstorm.config.js ├── babel.config.js ├── jest.config.js ├── .editorconfig └── README.md /src/components/tools/index.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | public/* linguist-vendored -------------------------------------------------------------------------------- /.env: -------------------------------------------------------------------------------- 1 | NODE_ENV=production 2 | VUE_APP_PREVIEW=false 3 | -------------------------------------------------------------------------------- /.env.preview: -------------------------------------------------------------------------------- 1 | NODE_ENV=production 2 | VUE_APP_PREVIEW=true 3 | -------------------------------------------------------------------------------- /.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "semi": false 4 | } -------------------------------------------------------------------------------- /public/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhang8043/abp-vue-antd/HEAD/public/logo.png -------------------------------------------------------------------------------- /src/components/Menu/index.js: -------------------------------------------------------------------------------- 1 | import SMenu from './menu' 2 | export default SMenu 3 | -------------------------------------------------------------------------------- /public/upload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhang8043/abp-vue-antd/HEAD/public/upload.png -------------------------------------------------------------------------------- /tests/unit/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | env: { 3 | jest: true 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 120, 3 | "semi": false, 4 | "singleQuote": true 5 | } 6 | -------------------------------------------------------------------------------- /public/avatar2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhang8043/abp-vue-antd/HEAD/public/avatar2.jpg -------------------------------------------------------------------------------- /src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhang8043/abp-vue-antd/HEAD/src/assets/logo.png -------------------------------------------------------------------------------- /src/components/IconText/index.js: -------------------------------------------------------------------------------- 1 | import IconText from './IconText' 2 | export default IconText 3 | -------------------------------------------------------------------------------- /src/components/Result/index.js: -------------------------------------------------------------------------------- 1 | import Result from './Result.vue' 2 | export default Result 3 | -------------------------------------------------------------------------------- /src/components/Trend/index.js: -------------------------------------------------------------------------------- 1 | import Trend from './Trend.vue' 2 | 3 | export default Trend 4 | -------------------------------------------------------------------------------- /src/components/Ellipsis/index.js: -------------------------------------------------------------------------------- 1 | import Ellipsis from './Ellipsis' 2 | 3 | export default Ellipsis 4 | -------------------------------------------------------------------------------- /public/preview/login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhang8043/abp-vue-antd/HEAD/public/preview/login.png -------------------------------------------------------------------------------- /public/preview/role.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhang8043/abp-vue-antd/HEAD/public/preview/role.png -------------------------------------------------------------------------------- /public/preview/user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhang8043/abp-vue-antd/HEAD/public/preview/user.png -------------------------------------------------------------------------------- /src/components/CountDown/index.js: -------------------------------------------------------------------------------- 1 | import CountDown from './CountDown' 2 | 3 | export default CountDown 4 | -------------------------------------------------------------------------------- /src/components/NoticeIcon/index.js: -------------------------------------------------------------------------------- 1 | import NoticeIcon from './NoticeIcon' 2 | export default NoticeIcon 3 | -------------------------------------------------------------------------------- /src/components/PageHeader/index.js: -------------------------------------------------------------------------------- 1 | import PageHeader from './PageHeader' 2 | export default PageHeader 3 | -------------------------------------------------------------------------------- /public/preview/edituser.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhang8043/abp-vue-antd/HEAD/public/preview/edituser.png -------------------------------------------------------------------------------- /public/preview/message.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhang8043/abp-vue-antd/HEAD/public/preview/message.png -------------------------------------------------------------------------------- /src/components/NumberInfo/index.js: -------------------------------------------------------------------------------- 1 | import NumberInfo from './NumberInfo' 2 | 3 | export default NumberInfo 4 | -------------------------------------------------------------------------------- /public/notifications/error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhang8043/abp-vue-antd/HEAD/public/notifications/error.png -------------------------------------------------------------------------------- /public/notifications/fatal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhang8043/abp-vue-antd/HEAD/public/notifications/fatal.png -------------------------------------------------------------------------------- /public/notifications/info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhang8043/abp-vue-antd/HEAD/public/notifications/info.png -------------------------------------------------------------------------------- /public/notifications/warn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhang8043/abp-vue-antd/HEAD/public/notifications/warn.png -------------------------------------------------------------------------------- /public/preview/workplace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhang8043/abp-vue-antd/HEAD/public/preview/workplace.png -------------------------------------------------------------------------------- /src/assets/gGlUMYGEIvjDOOw.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhang8043/abp-vue-antd/HEAD/src/assets/gGlUMYGEIvjDOOw.jpg -------------------------------------------------------------------------------- /src/components/Exception/index.js: -------------------------------------------------------------------------------- 1 | import ExceptionPage from './ExceptionPage.vue' 2 | export default ExceptionPage 3 | -------------------------------------------------------------------------------- /src/components/GlobalFooter/index.js: -------------------------------------------------------------------------------- 1 | import GlobalFooter from './GlobalFooter' 2 | export default GlobalFooter 3 | -------------------------------------------------------------------------------- /src/components/GlobalHeader/index.js: -------------------------------------------------------------------------------- 1 | import GlobalHeader from './GlobalHeader' 2 | export default GlobalHeader 3 | -------------------------------------------------------------------------------- /src/components/IconSelector/index.js: -------------------------------------------------------------------------------- 1 | import IconSelector from './IconSelector' 2 | export default IconSelector 3 | -------------------------------------------------------------------------------- /src/components/SettingDrawer/index.js: -------------------------------------------------------------------------------- 1 | import SettingDrawer from './SettingDrawer' 2 | export default SettingDrawer 3 | -------------------------------------------------------------------------------- /public/notifications/success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhang8043/abp-vue-antd/HEAD/public/notifications/success.png -------------------------------------------------------------------------------- /public/preview/organization.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhang8043/abp-vue-antd/HEAD/public/preview/organization.png -------------------------------------------------------------------------------- /src/assets/login-bg.0899ffa6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhang8043/abp-vue-antd/HEAD/src/assets/login-bg.0899ffa6.jpg -------------------------------------------------------------------------------- /src/components/DescriptionList/index.js: -------------------------------------------------------------------------------- 1 | import DescriptionList from './DescriptionList' 2 | export default DescriptionList 3 | -------------------------------------------------------------------------------- /src/components/AvatarList/index.js: -------------------------------------------------------------------------------- 1 | import AvatarList from './List' 2 | import './index.less' 3 | 4 | export default AvatarList 5 | -------------------------------------------------------------------------------- /src/components/MultiTab/index.js: -------------------------------------------------------------------------------- 1 | import MultiTab from './MultiTab' 2 | import './index.less' 3 | 4 | export default MultiTab 5 | -------------------------------------------------------------------------------- /src/components/StandardFormRow/index.js: -------------------------------------------------------------------------------- 1 | import StandardFormRow from './StandardFormRow' 2 | 3 | export default StandardFormRow 4 | -------------------------------------------------------------------------------- /src/components/ArticleListContent/index.js: -------------------------------------------------------------------------------- 1 | import ArticleListContent from './ArticleListContent' 2 | 3 | export default ArticleListContent 4 | -------------------------------------------------------------------------------- /src/components/FooterToolbar/index.js: -------------------------------------------------------------------------------- 1 | import FooterToolBar from './FooterToolBar' 2 | import './index.less' 3 | 4 | export default FooterToolBar 5 | -------------------------------------------------------------------------------- /src/components/index.less: -------------------------------------------------------------------------------- 1 | @import "~ant-design-vue/lib/style/index"; 2 | 3 | // The prefix to use on all css classes from ant-pro. 4 | @ant-pro-prefix : ant-pro; -------------------------------------------------------------------------------- /src/components/tools/DetailList.vue: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /src/utils/permissions.js: -------------------------------------------------------------------------------- 1 | export function actionToObject (json) { 2 | try { 3 | return JSON.parse(json) 4 | } catch (e) { 5 | console.log('err', e.message) 6 | } 7 | return [] 8 | } 9 | -------------------------------------------------------------------------------- /src/views/account/center/page/index.js: -------------------------------------------------------------------------------- 1 | import AppPage from './App' 2 | import ArticlePage from './Article' 3 | import ProjectPage from './Project' 4 | 5 | export { AppPage, ArticlePage, ProjectPage } 6 | -------------------------------------------------------------------------------- /public/loading/loading.html: -------------------------------------------------------------------------------- 1 |
Loading
-------------------------------------------------------------------------------- /src/views/404.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 12 | 13 | 16 | -------------------------------------------------------------------------------- /jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es6", 4 | "baseUrl": ".", 5 | "paths": { 6 | "@/*": ["src/*"] 7 | } 8 | }, 9 | "exclude": ["node_modules", "dist"], 10 | "include": ["src/**/*"] 11 | } 12 | -------------------------------------------------------------------------------- /src/layouts/BlankLayout.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 13 | 14 | 17 | -------------------------------------------------------------------------------- /src/components/Charts/chart.less: -------------------------------------------------------------------------------- 1 | .antv-chart-mini { 2 | position: relative; 3 | width: 100%; 4 | 5 | .chart-wrapper { 6 | position: absolute; 7 | bottom: -28px; 8 | width: 100%; 9 | 10 | /* margin: 0 -5px; 11 | overflow: hidden;*/ 12 | } 13 | } -------------------------------------------------------------------------------- /src/components/PageLoading/index.jsx: -------------------------------------------------------------------------------- 1 | import { Spin } from 'ant-design-vue' 2 | 3 | export default { 4 | name: 'PageLoading', 5 | render () { 6 | return (
7 | 8 |
) 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/layouts/index.js: -------------------------------------------------------------------------------- 1 | import UserLayout from './UserLayout' 2 | import BlankLayout from './BlankLayout' 3 | import BasicLayout from './BasicLayout' 4 | import RouteView from './RouteView' 5 | import PageView from './PageView' 6 | 7 | export { UserLayout, BasicLayout, BlankLayout, RouteView, PageView } 8 | -------------------------------------------------------------------------------- /src/views/exception/403.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 14 | 15 | 18 | -------------------------------------------------------------------------------- /src/views/exception/404.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 14 | 15 | 18 | -------------------------------------------------------------------------------- /src/views/exception/500.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 14 | 15 | 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | # local env files 6 | .env.local 7 | .env.*.local 8 | 9 | # Log files 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | 14 | # Editor directories and files 15 | .idea 16 | .vscode 17 | *.suo 18 | *.ntvs* 19 | *.njsproj 20 | *.sln 21 | *.sw* 22 | -------------------------------------------------------------------------------- /public/loading/option2/loading.css: -------------------------------------------------------------------------------- 1 | .preloading-animate{background:#ffffff;width:100%;height:100%;position:fixed;left:0;top:0;z-index:299;}.preloading-animate .preloading-wrapper{position:absolute;width:5rem;height:5rem;left:50%;top:50%;transform:translate(-50%,-50%);}.preloading-animate .preloading-wrapper .preloading-balls{font-size:5rem;} -------------------------------------------------------------------------------- /src/components/Charts/smooth.area.less: -------------------------------------------------------------------------------- 1 | @import "../index"; 2 | 3 | @smoothArea-prefix-cls: ~"@{ant-pro-prefix}-smooth-area"; 4 | 5 | .@{smoothArea-prefix-cls} { 6 | position: relative; 7 | width: 100%; 8 | 9 | .chart-wrapper { 10 | position: absolute; 11 | bottom: -28px; 12 | width: 100%; 13 | } 14 | } -------------------------------------------------------------------------------- /src/router/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Router from 'vue-router' 3 | import { constantRouterMap } from '@/config/router.config' 4 | 5 | Vue.use(Router) 6 | 7 | export default new Router({ 8 | mode: 'history', 9 | base: process.env.BASE_URL, 10 | scrollBehavior: () => ({ y: 0 }), 11 | routes: constantRouterMap 12 | }) 13 | -------------------------------------------------------------------------------- /src/core/precise/utils/precise.utils.js: -------------------------------------------------------------------------------- 1 | export default { 2 | getCookieValue (key) { 3 | return abp.utils.getCookieValue(key) 4 | }, 5 | setCookieValue (key, value, expireDate, path) { 6 | abp.utils.setCookieValue(key, value, expireDate, path) 7 | }, 8 | deleteCookie (key, path) { 9 | abp.utils.deleteCookie(key, path) 10 | } 11 | } -------------------------------------------------------------------------------- /src/api/index.js: -------------------------------------------------------------------------------- 1 | const api = { 2 | Login: '/auth/login', 3 | Logout: '/auth/logout', 4 | ForgePassword: '/auth/forge-password', 5 | Register: '/auth/register', 6 | twoStepCode: '/auth/2step-code', 7 | SendSms: '/account/sms', 8 | SendSmsErr: '/account/sms_err', 9 | // get my info 10 | UserInfo: '/user/info' 11 | } 12 | export default api 13 | -------------------------------------------------------------------------------- /src/api/precise/profile.js: -------------------------------------------------------------------------------- 1 | import { axios } from '@/utils/request' 2 | import AppConsts from '@/core/precise/AppConsts' 3 | 4 | export function getProfilePictureById (parameter) { 5 | return axios({ 6 | url: AppConsts.remoteServiceBaseUrl + '/api/services/app/Profile/GetProfilePictureById', 7 | method: 'get', 8 | params: parameter 9 | }) 10 | } -------------------------------------------------------------------------------- /src/core/icons.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Custom icon list 3 | * All icons are loaded here for easy management 4 | * @see https://vue.ant.design/components/icon/#Custom-Font-Icon 5 | * 6 | * 自定义图标加载表 7 | * 所有图标均从这里加载,方便管理 8 | */ 9 | import bxAnaalyse from '@/assets/icons/bx-analyse.svg?inline' // path to your '*.svg?inline' file. 10 | 11 | export { bxAnaalyse } 12 | -------------------------------------------------------------------------------- /src/core/precise/auth/precise.token.js: -------------------------------------------------------------------------------- 1 | export default { 2 | getToken () { 3 | return abp.auth.getToken() 4 | }, 5 | getTokenCookieName () { 6 | return abp.auth.tokenCookieName 7 | }, 8 | clearToken () { 9 | abp.auth.clearToken() 10 | }, 11 | setToken (authToken, expireDate) { 12 | abp.auth.setToken(authToken, expireDate) 13 | } 14 | } -------------------------------------------------------------------------------- /webstorm.config.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const path = require('path') 3 | 4 | function resolve (dir) { 5 | return path.join(__dirname, '.', dir) 6 | } 7 | 8 | module.exports = { 9 | context: path.resolve(__dirname, './'), 10 | resolve: { 11 | extensions: ['.js', '.vue', '.json'], 12 | alias: { 13 | '@': resolve('src') 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/views/account/settings/Binding.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 22 | 23 | 26 | -------------------------------------------------------------------------------- /src/views/account/settings/Notification.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 22 | 23 | 26 | -------------------------------------------------------------------------------- /src/api/precise/permission.js: -------------------------------------------------------------------------------- 1 | import { axios } from '@/utils/request' 2 | import AppConsts from '@/core/precise/AppConsts' 3 | 4 | export function getAllPermissions () { 5 | return axios({ 6 | url: AppConsts.remoteServiceBaseUrl + '/api/services/app/Permission/GetAllPermissions', 7 | method: 'get', 8 | headers: { 9 | 'Content-Type': 'application/json;charset=UTF-8' 10 | } 11 | }) 12 | } -------------------------------------------------------------------------------- /src/core/precise/auth/PermissionChecker.js: -------------------------------------------------------------------------------- 1 | 2 | export default { 3 | isGranted (permissionName) { 4 | return abp.auth.isGranted(permissionName) 5 | }, 6 | isGrantedAny (...permissions) { 7 | if (!permissions) { 8 | return false 9 | } 10 | for (const permission of permissions) { 11 | if (this.isGranted(permission)) { 12 | return true 13 | } 14 | } 15 | return false 16 | } 17 | } -------------------------------------------------------------------------------- /src/components/IconText/IconText.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 23 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/app', 4 | [ 5 | '@babel/preset-env', 6 | { 7 | 'useBuiltIns': 'entry' 8 | } 9 | ] 10 | ] 11 | // if your use import on Demand, Use this code 12 | // , 13 | // plugins: [ 14 | // [ 'import', { 15 | // 'libraryName': 'ant-design-vue', 16 | // 'libraryDirectory': 'es', 17 | // 'style': true // `style: true` 会加载 less 文件 18 | // } ] 19 | // ] 20 | } 21 | -------------------------------------------------------------------------------- /src/components/FooterToolbar/index.less: -------------------------------------------------------------------------------- 1 | @import "../index"; 2 | 3 | @footer-toolbar-prefix-cls: ~"@{ant-pro-prefix}-footer-toolbar"; 4 | 5 | .@{footer-toolbar-prefix-cls} { 6 | position: fixed; 7 | width: 100%; 8 | bottom: 0; 9 | right: 0; 10 | height: 56px; 11 | line-height: 56px; 12 | box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.03); 13 | background: #fff; 14 | border-top: 1px solid #e8e8e8; 15 | padding: 0 24px; 16 | z-index: 9; 17 | 18 | &:after { 19 | content: ""; 20 | display: block; 21 | clear: both; 22 | } 23 | } -------------------------------------------------------------------------------- /src/components/Exception/type.js: -------------------------------------------------------------------------------- 1 | const types = { 2 | 403: { 3 | img: 'https://gw.alipayobjects.com/zos/rmsportal/wZcnGqRDyhPOEYFcZDnb.svg', 4 | title: '403', 5 | desc: '抱歉,你无权访问该页面' 6 | }, 7 | 404: { 8 | img: 'https://gw.alipayobjects.com/zos/rmsportal/KpnpchXsobRgLElEozzI.svg', 9 | title: '404', 10 | desc: '抱歉,你访问的页面不存在或仍在开发中' 11 | }, 12 | 500: { 13 | img: 'https://gw.alipayobjects.com/zos/rmsportal/RVRUAYdCGeYNBWoKiIwB.svg', 14 | title: '500', 15 | desc: '抱歉,服务器出错了' 16 | } 17 | } 18 | 19 | export default types 20 | -------------------------------------------------------------------------------- /src/App.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 25 | 30 | -------------------------------------------------------------------------------- /src/core/lazy_use.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import VueStorage from 'vue-ls' 3 | import config from '@/config/defaultSettings' 4 | 5 | // base library 6 | import '@/core/lazy_lib/components_use' 7 | import Viser from 'viser-vue' 8 | 9 | // ext library 10 | import VueClipboard from 'vue-clipboard2' 11 | import PermissionHelper from '@/utils/helper/permission' 12 | import './directives/action' 13 | 14 | VueClipboard.config.autoSetContainer = true 15 | 16 | Vue.use(Viser) 17 | 18 | Vue.use(VueStorage, config.storageOptions) 19 | Vue.use(VueClipboard) 20 | Vue.use(PermissionHelper) 21 | -------------------------------------------------------------------------------- /src/store/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Vuex from 'vuex' 3 | 4 | import notification from './precise/notification' 5 | import permission from './precise/permission' 6 | import session from './precise/session' 7 | import tokenAuth from './precise/tokenAuth' 8 | 9 | import getters from './getters' 10 | 11 | Vue.use(Vuex) 12 | 13 | export default new Vuex.Store({ 14 | modules: { 15 | notification, 16 | permission, 17 | session, 18 | tokenAuth 19 | }, 20 | state: { 21 | 22 | }, 23 | mutations: { 24 | 25 | }, 26 | actions: { 27 | 28 | }, 29 | getters 30 | }) 31 | -------------------------------------------------------------------------------- /src/utils/domUtil.js: -------------------------------------------------------------------------------- 1 | export const setDocumentTitle = function (title) { 2 | document.title = title 3 | const ua = navigator.userAgent 4 | // eslint-disable-next-line 5 | const regex = /\bMicroMessenger\/([\d\.]+)/ 6 | if (regex.test(ua) && /ip(hone|od|ad)/i.test(ua)) { 7 | const i = document.createElement('iframe') 8 | i.src = '/favicon.ico' 9 | i.style.display = 'none' 10 | i.onload = function () { 11 | setTimeout(function () { 12 | i.remove() 13 | }, 9) 14 | } 15 | document.body.appendChild(i) 16 | } 17 | } 18 | 19 | export const domTitle = 'abp-vue-antd' 20 | -------------------------------------------------------------------------------- /src/utils/treeDataHelper.js: -------------------------------------------------------------------------------- 1 | import * as _ from 'lodash' 2 | 3 | export function findNode (data, selector) { 4 | var nodes = _.filter(data, selector) 5 | if (nodes && nodes.length === 1) { 6 | return nodes[0] 7 | } 8 | 9 | var foundNode = null 10 | 11 | _.forEach(data, d => { 12 | if (!foundNode) { 13 | foundNode = findNode(d.children, selector) 14 | } 15 | }) 16 | 17 | return foundNode 18 | } 19 | 20 | export function findParent (data, nodeSelector) { 21 | var node = findNode(data, nodeSelector) 22 | if (!node) { 23 | return null 24 | } 25 | 26 | return node.parent 27 | } -------------------------------------------------------------------------------- /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|svg|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 | -------------------------------------------------------------------------------- /src/mock/index.js: -------------------------------------------------------------------------------- 1 | import Mock from 'mockjs2' 2 | 3 | // 判断环境不是 prod 或者 preview 是 true 时,加载 mock 服务 4 | if (process.env.NODE_ENV !== 'production' || process.env.VUE_APP_PREVIEW === 'true') { 5 | // 使用同步加载依赖 6 | // 防止 vuex 中的 GetInfo 早于 mock 运行,导致无法 mock 请求返回结果 7 | console.log('mock mounting') 8 | require('./dataapi/auth') 9 | require('./dataapi/user') 10 | require('./dataapi/manage') 11 | require('./dataapi/other') 12 | require('./dataapi/tagCloud') 13 | require('./dataapi/article') 14 | 15 | Mock.setup({ 16 | timeout: 800 // setter delay time 17 | }) 18 | console.log('mock mounted') 19 | } 20 | -------------------------------------------------------------------------------- /src/utils/filter.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import moment from 'moment' 3 | import 'moment/locale/zh-cn' 4 | moment.locale('zh-cn') 5 | 6 | Vue.filter('NumberFormat', function (value) { 7 | if (!value) { 8 | return '0' 9 | } 10 | const intPartFormat = value.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') // 将整数部分逢三一断 11 | return intPartFormat 12 | }) 13 | 14 | Vue.filter('dayjs', function (dataStr, pattern = 'YYYY-MM-DD HH:mm:ss') { 15 | return moment(dataStr).format(pattern) 16 | }) 17 | 18 | Vue.filter('moment', function (dataStr, pattern = 'YYYY-MM-DD HH:mm:ss') { 19 | return moment(dataStr).format(pattern) 20 | }) 21 | -------------------------------------------------------------------------------- /src/components/FooterToolbar/FooterToolBar.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 27 | 28 | 31 | -------------------------------------------------------------------------------- /src/components/MultiTab/index.less: -------------------------------------------------------------------------------- 1 | @import '../index'; 2 | 3 | @multi-tab-prefix-cls: ~"@{ant-pro-prefix}-multi-tab"; 4 | @multi-tab-wrapper-prefix-cls: ~"@{ant-pro-prefix}-multi-tab-wrapper"; 5 | 6 | /* 7 | .topmenu .@{multi-tab-prefix-cls} { 8 | max-width: 1200px; 9 | margin: -23px auto 24px auto; 10 | } 11 | */ 12 | .@{multi-tab-prefix-cls} { 13 | margin: -23px -24px 24px -24px; 14 | background: #fff; 15 | } 16 | 17 | .topmenu .@{multi-tab-wrapper-prefix-cls} { 18 | max-width: 1200px; 19 | margin: 0 auto; 20 | } 21 | 22 | .topmenu.content-width-Fluid .@{multi-tab-wrapper-prefix-cls} { 23 | max-width: 100%; 24 | margin: 0 auto; 25 | } 26 | -------------------------------------------------------------------------------- /src/components/tools/Logo.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 32 | -------------------------------------------------------------------------------- /src/core/precise/helpers/SubdomainTenancyNameFinder.js: -------------------------------------------------------------------------------- 1 | import AppConsts from '@/core/precise/AppConsts' 2 | import FormattedStringValueExtracter from './FormattedStringValueExtracter' 3 | 4 | export function getCurrentTenancyNameOrNull(rootAddress) { 5 | if (rootAddress.indexOf(AppConsts.tenancyNamePlaceHolderInUrl) < 0) { 6 | // 网站不支持子域名租户名称 7 | return null 8 | } 9 | const currentRootAddress = document.location.href 10 | const formattedStringValueExtracter = new FormattedStringValueExtracter() 11 | const values = formattedStringValueExtracter.IsMatch(currentRootAddress, rootAddress) 12 | if (!values.length) { 13 | return null 14 | } 15 | return values[0] 16 | } -------------------------------------------------------------------------------- /src/components/CountDown/index.md: -------------------------------------------------------------------------------- 1 | # CountDown 倒计时 2 | 3 | 倒计时组件。 4 | 5 | 6 | 7 | 引用方式: 8 | 9 | ```javascript 10 | import CountDown from '@/components/CountDown/CountDown' 11 | 12 | export default { 13 | components: { 14 | CountDown 15 | } 16 | } 17 | ``` 18 | 19 | 20 | 21 | ## 代码演示 [demo](https://pro.loacg.com/test/home) 22 | 23 | ```html 24 | 25 | ``` 26 | 27 | 28 | 29 | ## API 30 | 31 | | 参数 | 说明 | 类型 | 默认值 | 32 | |----------|------------------------------------------|-------------|-------| 33 | | target | 目标时间 | Date | - | 34 | | onEnd | 倒计时结束回调 | funtion | -| 35 | -------------------------------------------------------------------------------- /src/api/precise/session.js: -------------------------------------------------------------------------------- 1 | import { axios } from '@/utils/request' 2 | import AppConsts from '@/core/precise/AppConsts' 3 | 4 | export function getCurrentLoginInformations () { 5 | return axios({ 6 | url: AppConsts.remoteServiceBaseUrl + '/api/services/app/Session/GetCurrentLoginInformations', 7 | method: 'get', 8 | headers: { 9 | 'Content-Type': 'application/json;charset=UTF-8' 10 | } 11 | }) 12 | } 13 | 14 | export function updateUserSignInToken () { 15 | return axios({ 16 | url: AppConsts.remoteServiceBaseUrl + '/api/services/app/Session/UpdateUserSignInToken', 17 | method: 'put', 18 | headers: { 19 | 'Content-Type': 'application/json;charset=UTF-8' 20 | } 21 | }) 22 | } -------------------------------------------------------------------------------- /src/utils/axios.js: -------------------------------------------------------------------------------- 1 | const VueAxios = { 2 | vm: {}, 3 | // eslint-disable-next-line no-unused-vars 4 | install (Vue, instance) { 5 | if (this.installed) { 6 | return 7 | } 8 | this.installed = true 9 | 10 | if (!instance) { 11 | // eslint-disable-next-line no-console 12 | console.error('You have to install axios') 13 | return 14 | } 15 | 16 | Vue.axios = instance 17 | 18 | Object.defineProperties(Vue.prototype, { 19 | axios: { 20 | get: function get () { 21 | return instance 22 | } 23 | }, 24 | $http: { 25 | get: function get () { 26 | return instance 27 | } 28 | } 29 | }) 30 | } 31 | } 32 | 33 | export { 34 | VueAxios 35 | } 36 | -------------------------------------------------------------------------------- /src/store/getters.js: -------------------------------------------------------------------------------- 1 | const getters = { 2 | //session 3 | device: state => state.session.device,//设备 4 | theme: state => state.session.theme,//主题 5 | color: state => state.session.color,//主题颜色 6 | multiTab: state => state.session.multiTab,//多标签 7 | appSession:state => state.session.appSession, 8 | welcome: state => state.session.welcome,//欢迎信息 9 | avatar: state => state.session.appSession.user.profilePictureId ? state.session.appSession.user.profilePictureId : '/avatar2.jpg', 10 | nickname: state => state.session.appSession.user.name + state.session.appSession.user.surname, 11 | //tokenAuth 12 | token: state => state.tokenAuth.token,//Token 13 | //permission 14 | addRouters: state => state.permission.addRouters,//权限路由 15 | 16 | 17 | 18 | } 19 | 20 | export default getters 21 | -------------------------------------------------------------------------------- /src/components/Trend/index.less: -------------------------------------------------------------------------------- 1 | @import "../index"; 2 | 3 | @trend-prefix-cls: ~"@{ant-pro-prefix}-trend"; 4 | 5 | .@{trend-prefix-cls} { 6 | display: inline-block; 7 | font-size: @font-size-base; 8 | line-height: 22px; 9 | 10 | .up, 11 | .down { 12 | margin-left: 4px; 13 | position: relative; 14 | top: 1px; 15 | 16 | i { 17 | font-size: 12px; 18 | transform: scale(0.83); 19 | } 20 | } 21 | 22 | .item-text { 23 | display: inline-block; 24 | margin-left: 8px; 25 | color: rgba(0,0,0,.85); 26 | } 27 | 28 | .up { 29 | color: @red-6; 30 | } 31 | .down { 32 | color: @green-6; 33 | top: -1px; 34 | } 35 | 36 | &.reverse-color .up { 37 | color: @green-6; 38 | } 39 | &.reverse-color .down { 40 | color: @red-6; 41 | } 42 | } -------------------------------------------------------------------------------- /src/store/mutation-types.js: -------------------------------------------------------------------------------- 1 | export const ACCESS_TOKEN = 'Access-Token' 2 | export const SIDEBAR_TYPE = 'SIDEBAR_TYPE' 3 | export const DEFAULT_THEME = 'DEFAULT_THEME' 4 | export const DEFAULT_LAYOUT_MODE = 'DEFAULT_LAYOUT_MODE' 5 | export const DEFAULT_COLOR = 'DEFAULT_COLOR' 6 | export const DEFAULT_COLOR_WEAK = 'DEFAULT_COLOR_WEAK' 7 | export const DEFAULT_FIXED_HEADER = 'DEFAULT_FIXED_HEADER' 8 | export const DEFAULT_FIXED_SIDEMENU = 'DEFAULT_FIXED_SIDEMENU' 9 | export const DEFAULT_FIXED_HEADER_HIDDEN = 'DEFAULT_FIXED_HEADER_HIDDEN' 10 | export const DEFAULT_CONTENT_WIDTH_TYPE = 'DEFAULT_CONTENT_WIDTH_TYPE' 11 | export const DEFAULT_MULTI_TAB = 'DEFAULT_MULTI_TAB' 12 | export const PRECISE_APPSESSION = 'PRECISE_APPSESSION' 13 | 14 | export const CONTENT_WIDTH_TYPE = { 15 | Fluid: 'Fluid', 16 | Fixed: 'Fixed' 17 | } 18 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | [*] 2 | charset=utf-8 3 | end_of_line=lf 4 | insert_final_newline=false 5 | indent_style=space 6 | indent_size=2 7 | 8 | [{*.ng,*.sht,*.html,*.shtm,*.shtml,*.htm}] 9 | indent_style=space 10 | indent_size=2 11 | 12 | [{*.jhm,*.xslt,*.xul,*.rng,*.xsl,*.xsd,*.ant,*.tld,*.fxml,*.jrxml,*.xml,*.jnlp,*.wsdl}] 13 | indent_style=space 14 | indent_size=2 15 | 16 | [{.babelrc,.stylelintrc,jest.config,.eslintrc,.prettierrc,*.json,*.jsb3,*.jsb2,*.bowerrc}] 17 | indent_style=space 18 | indent_size=2 19 | 20 | [*.svg] 21 | indent_style=space 22 | indent_size=2 23 | 24 | [*.js.map] 25 | indent_style=space 26 | indent_size=2 27 | 28 | [*.less] 29 | indent_style=space 30 | indent_size=2 31 | 32 | [*.vue] 33 | indent_style=space 34 | indent_size=2 35 | 36 | [{.analysis_options,*.yml,*.yaml}] 37 | indent_style=space 38 | indent_size=2 39 | 40 | -------------------------------------------------------------------------------- /src/components/SettingDrawer/SettingItem.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 24 | 25 | 39 | -------------------------------------------------------------------------------- /src/core/use.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import VueStorage from 'vue-ls' 3 | import config from '@/config/defaultSettings' 4 | 5 | // base library 6 | import Antd from 'ant-design-vue' 7 | import Viser from 'viser-vue' 8 | import VueCropper from 'vue-cropper' 9 | import 'ant-design-vue/dist/antd.less' 10 | 11 | // ext library 12 | import VueClipboard from 'vue-clipboard2' 13 | import PermissionHelper from '@/utils/helper/permission' 14 | // import '@/components/use' 15 | import './directives/action' 16 | 17 | // org-tree 18 | import VOrgTree from 'v-org-tree' 19 | import 'v-org-tree/dist/v-org-tree.css' 20 | 21 | VueClipboard.config.autoSetContainer = true 22 | 23 | Vue.use(Antd) 24 | Vue.use(Viser) 25 | 26 | Vue.use(VueStorage, config.storageOptions) 27 | Vue.use(VueClipboard) 28 | Vue.use(PermissionHelper) 29 | Vue.use(VueCropper) 30 | Vue.use(VOrgTree) 31 | -------------------------------------------------------------------------------- /src/layouts/RouteView.vue: -------------------------------------------------------------------------------- 1 | 34 | -------------------------------------------------------------------------------- /public/appconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "remoteServiceBaseUrl": "http://localhost:50538", 3 | "appBaseUrl": "http://localhost:8000", 4 | "localeMappings": { 5 | "angular": [ 6 | { 7 | "from": "pt-BR", 8 | "to": "pt" 9 | }, 10 | { 11 | "from": "zh-CN", 12 | "to": "zh" 13 | }, 14 | { 15 | "from": "he-IL", 16 | "to": "he" 17 | }, 18 | { 19 | "from": "es-MX", 20 | "to": "es" 21 | }, 22 | { 23 | "from": "vi", 24 | "to": "en" 25 | } 26 | ], 27 | "moment": [ 28 | { 29 | "from": "es-MX", 30 | "to": "es" 31 | }, 32 | { 33 | "from": "zh-Hans", 34 | "to": "zh-cn" 35 | }, 36 | { 37 | "from": "vi", 38 | "to": "en-gb" 39 | } 40 | ] 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/components/Ellipsis/index.md: -------------------------------------------------------------------------------- 1 | # Ellipsis 文本自动省略号 2 | 3 | 文本过长自动处理省略号,支持按照文本长度和最大行数两种方式截取。 4 | 5 | 6 | 7 | 引用方式: 8 | 9 | ```javascript 10 | import Ellipsis from '@/components/Ellipsis' 11 | 12 | export default { 13 | components: { 14 | Ellipsis 15 | } 16 | } 17 | ``` 18 | 19 | 20 | 21 | ## 代码演示 [demo](https://pro.loacg.com/test/home) 22 | 23 | ```html 24 | 25 | There were injuries alleged in three cases in 2015, and a 26 | fourth incident in September, according to the safety recall report. After meeting with US regulators in October, the firm decided to issue a voluntary recall. 27 | 28 | ``` 29 | 30 | 31 | 32 | ## API 33 | 34 | 35 | 参数 | 说明 | 类型 | 默认值 36 | ----|------|-----|------ 37 | tooltip | 移动到文本展示完整内容的提示 | boolean | - 38 | length | 在按照长度截取下的文本最大字符数,超过则截取省略 | number | - -------------------------------------------------------------------------------- /src/components/Trend/index.md: -------------------------------------------------------------------------------- 1 | # Trend 趋势标记 2 | 3 | 趋势符号,标记上升和下降趋势。通常用绿色代表“好”,红色代表“不好”,股票涨跌场景除外。 4 | 5 | 6 | 7 | 引用方式: 8 | 9 | ```javascript 10 | import Trend from '@/components/Trend' 11 | 12 | export default { 13 | components: { 14 | Trend 15 | } 16 | } 17 | ``` 18 | 19 | 20 | 21 | ## 代码演示 [demo](https://pro.loacg.com/test/home) 22 | 23 | ```html 24 | 5% 25 | ``` 26 | 或 27 | ```html 28 | 29 | 工资 30 | 5% 31 | 32 | ``` 33 | 或 34 | ```html 35 | 5% 36 | ``` 37 | 38 | 39 | ## API 40 | 41 | | 参数 | 说明 | 类型 | 默认值 | 42 | |----------|------------------------------------------|-------------|-------| 43 | | flag | 上升下降标识:`up|down` | string | - | 44 | | reverseColor | 颜色反转 | Boolean | false | 45 | 46 | -------------------------------------------------------------------------------- /src/components/FooterToolbar/index.md: -------------------------------------------------------------------------------- 1 | # FooterToolbar 底部工具栏 2 | 3 | 固定在底部的工具栏。 4 | 5 | 6 | 7 | ## 何时使用 8 | 9 | 固定在内容区域的底部,不随滚动条移动,常用于长页面的数据搜集和提交工作。 10 | 11 | 12 | 13 | 引用方式: 14 | 15 | ```javascript 16 | import FooterToolBar from '@/components/FooterToolbar' 17 | 18 | export default { 19 | components: { 20 | FooterToolBar 21 | } 22 | } 23 | ``` 24 | 25 | 26 | 27 | ## 代码演示 28 | 29 | ```html 30 | 31 | 提交 32 | 33 | ``` 34 | 或 35 | ```html 36 | 37 | 提交 38 | 39 | ``` 40 | 41 | 42 | ## API 43 | 44 | 参数 | 说明 | 类型 | 默认值 45 | ----|------|-----|------ 46 | children (slot) | 工具栏内容,向右对齐 | - | - 47 | extra | 额外信息,向左对齐 | String, Object | - 48 | 49 | -------------------------------------------------------------------------------- /src/components/Trend/Trend.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 38 | 39 | 42 | -------------------------------------------------------------------------------- /src/utils/device.js: -------------------------------------------------------------------------------- 1 | import enquireJs from 'enquire.js' 2 | 3 | export const DEVICE_TYPE = { 4 | DESKTOP: 'desktop', 5 | TABLET: 'tablet', 6 | MOBILE: 'mobile' 7 | } 8 | 9 | export const deviceEnquire = function (callback) { 10 | const matchDesktop = { 11 | match: () => { 12 | callback && callback(DEVICE_TYPE.DESKTOP) 13 | } 14 | } 15 | 16 | const matchLablet = { 17 | match: () => { 18 | callback && callback(DEVICE_TYPE.TABLET) 19 | } 20 | } 21 | 22 | const matchMobile = { 23 | match: () => { 24 | callback && callback(DEVICE_TYPE.MOBILE) 25 | } 26 | } 27 | 28 | // screen and (max-width: 1087.99px) 29 | enquireJs 30 | .register('screen and (max-width: 576px)', matchMobile) 31 | .register('screen and (min-width: 576px) and (max-width: 1199px)', matchLablet) 32 | .register('screen and (min-width: 1200px)', matchDesktop) 33 | } 34 | -------------------------------------------------------------------------------- /src/components/NumberInfo/index.md: -------------------------------------------------------------------------------- 1 | # NumberInfo 数据文本 2 | 3 | 常用在数据卡片中,用于突出展示某个业务数据。 4 | 5 | 6 | 7 | 引用方式: 8 | 9 | ```javascript 10 | import NumberInfo from '@/components/NumberInfo' 11 | 12 | export default { 13 | components: { 14 | NumberInfo 15 | } 16 | } 17 | ``` 18 | 19 | 20 | 21 | ## 代码演示 [demo](https://pro.loacg.com/test/home) 22 | 23 | ```html 24 | 29 | ``` 30 | 31 | 32 | 33 | ## API 34 | 35 | 参数 | 说明 | 类型 | 默认值 36 | ----|------|-----|------ 37 | title | 标题 | ReactNode\|string | - 38 | subTitle | 子标题 | ReactNode\|string | - 39 | total | 总量 | ReactNode\|string | - 40 | subTotal | 子总量 | ReactNode\|string | - 41 | status | 增加状态 | 'up \| down' | - 42 | theme | 状态样式 | string | 'light' 43 | gap | 设置数字和描述之间的间距(像素)| number | 8 44 | -------------------------------------------------------------------------------- /src/components/IconSelector/README.md: -------------------------------------------------------------------------------- 1 | IconSelector 2 | ==== 3 | 4 | > 图标选择组件,常用于为某一个数据设定一个图标时使用 5 | > eg: 设定菜单列表时,为每个菜单设定一个图标 6 | 7 | 该组件由 [@Saraka](https://github.com/saraka-tsukai) 封装 8 | 9 | 10 | 11 | ### 使用方式 12 | 13 | ```vue 14 | 19 | 20 | 39 | ``` 40 | 41 | 42 | 43 | ### 事件 44 | 45 | 46 | | 名称 | 说明 | 类型 | 默认值 | 47 | | ------ | -------------------------- | ------ | ------ | 48 | | change | 当改变了 `icon` 选中项触发 | String | - | 49 | -------------------------------------------------------------------------------- /src/core/precise/helpers/SignalRHelper.js: -------------------------------------------------------------------------------- 1 | import AppConsts from '@/core/precise/AppConsts' 2 | import preciseUtils from '@/core/precise/utils/precise.utils' 3 | 4 | export default class SignalRHelper { 5 | static initSignalR (callback) { 6 | const encryptedAuthToken = preciseUtils.getCookieValue(AppConsts.authorization.encrptedAuthTokenName) 7 | abp.signalr = { 8 | autoConnect: true, 9 | connect: undefined, 10 | hubs: undefined, 11 | qs: AppConsts.authorization.encrptedAuthTokenName + '=' + encodeURIComponent(encryptedAuthToken), 12 | remoteServiceBaseUrl: AppConsts.remoteServiceBaseUrl, 13 | startConnection: undefined, 14 | url: '/signalr' 15 | } 16 | 17 | const script = document.createElement('script') 18 | script.onload = () => { 19 | callback() 20 | } 21 | 22 | script.src = AppConsts.appBaseUrl + '/dist/abp.signalr-client.js' 23 | document.head.appendChild(script) 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/components/Charts/MiniSmoothArea.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 37 | 38 | 41 | -------------------------------------------------------------------------------- /src/core/precise/auth/AppAuthService.js: -------------------------------------------------------------------------------- 1 | 2 | import AppConsts from '@/core/precise/AppConsts' 3 | import { axios } from '@/utils/request' 4 | const AppAuthService = { 5 | logout (reload, returnUrl) { 6 | axios({ 7 | url: AppConsts.remoteServiceBaseUrl + '/api/TokenAuth/LogOut', 8 | method: 'GET', 9 | params: { 10 | 'Abp.TenantId': abp.multiTenancy.getTenantIdCookie(), 11 | 'Authorization': 'Bearer ' + abp.auth.getToken() 12 | } 13 | }).then((result) => { 14 | abp.auth.clearToken() 15 | abp.utils.setCookieValue(AppConsts.authorization.encrptedAuthTokenName, undefined, undefined, abp.appPath) 16 | if (reload !== false) { 17 | if (returnUrl) { 18 | location.href = returnUrl 19 | } 20 | else { 21 | location.href = '' 22 | } 23 | } 24 | }) 25 | .catch(err => { 26 | this.$message.error(err.message) 27 | }) 28 | } 29 | } 30 | export default AppAuthService -------------------------------------------------------------------------------- /src/api/precise/role.js: -------------------------------------------------------------------------------- 1 | import { axios } from '@/utils/request' 2 | import AppConsts from '@/core/precise/AppConsts' 3 | 4 | export function getRoles (parameter) { 5 | return axios({ 6 | url: AppConsts.remoteServiceBaseUrl + '/api/services/app/Role/GetRoles', 7 | method: 'get', 8 | params: parameter 9 | }) 10 | } 11 | 12 | export function getRoleForEdit (parameter) { 13 | return axios({ 14 | url: AppConsts.remoteServiceBaseUrl + '/api/services/app/Role/GetRoleForEdit', 15 | method: 'get', 16 | params: parameter 17 | }) 18 | } 19 | 20 | export function createOrUpdateRole (parameter) { 21 | return axios({ 22 | url: AppConsts.remoteServiceBaseUrl + '/api/services/app/Role/CreateOrUpdateRole', 23 | method: 'post', 24 | data: parameter 25 | }) 26 | } 27 | 28 | export function deleteRole (parameter) { 29 | return axios({ 30 | url: AppConsts.remoteServiceBaseUrl + '/api/services/app/Role/DeleteRole', 31 | method: 'delete', 32 | params: parameter 33 | }) 34 | } -------------------------------------------------------------------------------- /src/components/AvatarList/Item.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 47 | -------------------------------------------------------------------------------- /src/core/directives/action.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import store from '@/store' 3 | 4 | /** 5 | * Action 权限指令 6 | * 指令用法: 7 | * - 在需要控制 action 级别权限的组件上使用 v-action:[method] , 如下: 8 | * 添加用户 9 | * 删除用户 10 | * 修改 11 | * 12 | * - 当前用户没有权限时,组件上使用了该指令则会被隐藏 13 | * - 当后台权限跟 pro 提供的模式不同时,只需要针对这里的权限过滤进行修改即可 14 | * 15 | * @see https://github.com/sendya/ant-design-pro-vue/pull/53 16 | */ 17 | const action = Vue.directive('action', { 18 | inserted: function (el, binding, vnode) { 19 | const actionName = binding.arg 20 | const elVal = vnode.context.$route.meta.permission 21 | const permissionId = elVal instanceof String && [elVal] || elVal 22 | if (!abp.auth.isAnyGranted(permissionId)) { 23 | return 24 | } 25 | if (!abp.auth.isGranted(actionName)) { 26 | el.parentNode && el.parentNode.removeChild(el) || (el.style.display = 'none') 27 | } 28 | } 29 | }) 30 | 31 | export default action 32 | -------------------------------------------------------------------------------- /src/utils/tools.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 绑定事件 on(element, event, handler) 3 | */ 4 | export const on = (function () { 5 | if (document.addEventListener) { 6 | return function (element, event, handler) { 7 | if (element && event && handler) { 8 | element.addEventListener(event, handler, false) 9 | } 10 | } 11 | } else { 12 | return function (element, event, handler) { 13 | if (element && event && handler) { 14 | element.attachEvent('on' + event, handler) 15 | } 16 | } 17 | } 18 | })() 19 | 20 | /** 21 | * @description 解绑事件 off(element, event, handler) 22 | */ 23 | export const off = (function () { 24 | if (document.removeEventListener) { 25 | return function (element, event, handler) { 26 | if (element && event) { 27 | element.removeEventListener(event, handler, false) 28 | } 29 | } 30 | } else { 31 | return function (element, event, handler) { 32 | if (element && event) { 33 | element.detachEvent('on' + event, handler) 34 | } 35 | } 36 | } 37 | })() -------------------------------------------------------------------------------- /src/core/precise/helpers/XmlHttpRequestHelper.js: -------------------------------------------------------------------------------- 1 | export class XmlHttpRequestHelper { 2 | static ajax (type, url, customHeaders, data, success) { 3 | const xhr = new XMLHttpRequest() 4 | xhr.onreadystatechange = () => { 5 | if (xhr.readyState === XMLHttpRequest.DONE) { 6 | if (xhr.status === 200) { 7 | const result = JSON.parse(xhr.responseText) 8 | success(result) 9 | } 10 | else if (xhr.status !== 0) { 11 | alert(abp.localization.localize('InternalServerError', 'AbpWeb')) 12 | } 13 | } 14 | } 15 | url += (url.indexOf('?') >= 0 ? '&' : '?') + 'd=' + new Date().getTime() 16 | xhr.open(type, url, true) 17 | for (const property in customHeaders) { 18 | if (customHeaders.hasOwnProperty(property)) { 19 | xhr.setRequestHeader(property, customHeaders[property]) 20 | } 21 | } 22 | xhr.setRequestHeader('Content-type', 'application/json') 23 | if (data) { 24 | xhr.send(data) 25 | } 26 | else { 27 | xhr.send() 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/utils/utils.less: -------------------------------------------------------------------------------- 1 | .textOverflow() { 2 | overflow: hidden; 3 | white-space: nowrap; 4 | text-overflow: ellipsis; 5 | word-break: break-all; 6 | } 7 | 8 | .textOverflowMulti(@line: 3, @bg: #fff) { 9 | position: relative; 10 | max-height: @line * 1.5em; 11 | margin-right: -1em; 12 | padding-right: 1em; 13 | overflow: hidden; 14 | line-height: 1.5em; 15 | text-align: justify; 16 | &::before { 17 | position: absolute; 18 | right: 14px; 19 | bottom: 0; 20 | padding: 0 1px; 21 | background: @bg; 22 | content: '...'; 23 | } 24 | &::after { 25 | position: absolute; 26 | right: 14px; 27 | width: 1em; 28 | height: 1em; 29 | margin-top: 0.2em; 30 | background: white; 31 | content: ''; 32 | } 33 | } 34 | 35 | // mixins for clearfix 36 | // ------------------------ 37 | .clearfix() { 38 | zoom: 1; 39 | &::before, 40 | &::after { 41 | display: table; 42 | content: ' '; 43 | } 44 | &::after { 45 | clear: both; 46 | height: 0; 47 | font-size: 0; 48 | visibility: hidden; 49 | } 50 | } -------------------------------------------------------------------------------- /src/components/SettingDrawer/themeColor.js: -------------------------------------------------------------------------------- 1 | import client from 'webpack-theme-color-replacer/client' 2 | import generate from '@ant-design/colors/lib/generate' 3 | 4 | export default { 5 | primaryColor: '#1890ff', // TODO 需要处理的暗坑 6 | getAntdSerials (color) { 7 | // 淡化(即less的tint) 8 | const lightens = new Array(9).fill().map((t, i) => { 9 | return client.varyColor.lighten(color, i / 10) 10 | }) 11 | // colorPalette变换得到颜色值 12 | const colorPalettes = generate(color) 13 | return lightens.concat(colorPalettes) 14 | }, 15 | changeColor (newColor) { 16 | var lastColor = this.lastColor || this.primaryColor 17 | var options = { 18 | cssUrl: '/css/theme-colors.css', // TODO 需要处理的暗坑 19 | oldColors: this.getAntdSerials(lastColor), // current colors array. The same as `matchColors` 20 | newColors: this.getAntdSerials(newColor) // new colors array, one-to-one corresponde with `oldColors` 21 | } 22 | var promise = client.changer.changeColor(options, Promise) 23 | this.lastColor = lastColor 24 | return promise 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ASP.NET Boilerplate + Vue + Ant Design Pro 2 | 3 | # 开发步骤 4 | 5 | * 项目下载完成,准备配置项目 6 | 7 | ## 前端解决方案初始化配置 8 | >* 进入项目中的abp-vue-antd目录 9 | ``` 10 | $ yarn 或 npm install 11 | ``` 12 | 13 | >* 运行项目 14 | >记得先启动后台 15 | ``` 16 | $ npm run serve 17 | ``` 18 | >* 启动调试,访问 http://localhost:8000 查看效果。 19 | 20 | >* 构建和部署 21 | ``` 22 | $ build 23 | ``` 24 | >该命令会将所有文件编译到 `dist` 目录下 25 | 26 | # 截图 27 | 28 | ![登录页](https://github.com/zhang8043/abp-vue-antd/blob/master/public/preview/login.png) 29 | ![工作台](https://github.com/zhang8043/abp-vue-antd/blob/master/public/preview/workplace.png) 30 | ![消息中心](https://github.com/zhang8043/abp-vue-antd/blob/master/public/preview/message.png) 31 | ![组织机构管理](https://github.com/zhang8043/abp-vue-antd/blob/master/public/preview/organization.png) 32 | ![角色管理](https://github.com/zhang8043/abp-vue-antd/blob/master/public/preview/role.png) 33 | ![用户管理](https://github.com/zhang8043/abp-vue-antd/blob/master/public/preview/user.png) 34 | ![修改用户](https://github.com/zhang8043/abp-vue-antd/blob/master/public/preview/edituser.png) 35 | -------------------------------------------------------------------------------- /src/mock/util.js: -------------------------------------------------------------------------------- 1 | const responseBody = { 2 | message: '', 3 | timestamp: 0, 4 | result: null, 5 | code: 0 6 | } 7 | 8 | export const builder = (data, message, code = 0, headers = {}) => { 9 | responseBody.result = data 10 | if (message !== undefined && message !== null) { 11 | responseBody.message = message 12 | } 13 | if (code !== undefined && code !== 0) { 14 | responseBody.code = code 15 | responseBody._status = code 16 | } 17 | if (headers !== null && typeof headers === 'object' && Object.keys(headers).length > 0) { 18 | responseBody._headers = headers 19 | } 20 | responseBody.timestamp = new Date().getTime() 21 | return responseBody 22 | } 23 | 24 | export const getQueryParameters = (options) => { 25 | const url = options.url 26 | const search = url.split('?')[1] 27 | if (!search) { 28 | return {} 29 | } 30 | return JSON.parse('{"' + decodeURIComponent(search) 31 | .replace(/"/g, '\\"') 32 | .replace(/&/g, '","') 33 | .replace(/=/g, '":"') + '"}') 34 | } 35 | 36 | export const getBody = (options) => { 37 | return options.body && JSON.parse(options.body) 38 | } 39 | -------------------------------------------------------------------------------- /src/components/_util/util.js: -------------------------------------------------------------------------------- 1 | /** 2 | * components util 3 | */ 4 | 5 | /** 6 | * 清理空值,对象 7 | * @param children 8 | * @returns {*[]} 9 | */ 10 | export function filterEmpty (children = []) { 11 | return children.filter(c => c.tag || (c.text && c.text.trim() !== '')) 12 | } 13 | 14 | /** 15 | * 获取字符串长度,英文字符 长度1,中文字符长度2 16 | * @param {*} str 17 | */ 18 | export const getStrFullLength = (str = '') => 19 | str.split('').reduce((pre, cur) => { 20 | const charCode = cur.charCodeAt(0) 21 | if (charCode >= 0 && charCode <= 128) { 22 | return pre + 1 23 | } 24 | return pre + 2 25 | }, 0) 26 | 27 | /** 28 | * 截取字符串,根据 maxLength 截取后返回 29 | * @param {*} str 30 | * @param {*} maxLength 31 | */ 32 | export const cutStrByFullLength = (str = '', maxLength) => { 33 | let showLength = 0 34 | return str.split('').reduce((pre, cur) => { 35 | const charCode = cur.charCodeAt(0) 36 | if (charCode >= 0 && charCode <= 128) { 37 | showLength += 1 38 | } else { 39 | showLength += 2 40 | } 41 | if (showLength <= maxLength) { 42 | return pre + cur 43 | } 44 | return pre 45 | }, '') 46 | } 47 | -------------------------------------------------------------------------------- /src/views/account/register/RegisterResult.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 47 | 48 | 51 | -------------------------------------------------------------------------------- /src/components/TagSelect/TagSelectOption.jsx: -------------------------------------------------------------------------------- 1 | import { Tag } from 'ant-design-vue' 2 | const { CheckableTag } = Tag 3 | 4 | export default { 5 | name: 'TagSelectOption', 6 | props: { 7 | prefixCls: { 8 | type: String, 9 | default: 'ant-pro-tag-select-option' 10 | }, 11 | value: { 12 | type: [String, Number, Object], 13 | default: '' 14 | }, 15 | checked: { 16 | type: Boolean, 17 | default: false 18 | } 19 | }, 20 | data () { 21 | return { 22 | localChecked: this.checked || false 23 | } 24 | }, 25 | watch: { 26 | 'checked' (val) { 27 | this.localChecked = val 28 | }, 29 | '$parent.items': { 30 | handler: function (val) { 31 | this.value && val.hasOwnProperty(this.value) && (this.localChecked = val[this.value]) 32 | }, 33 | deep: true 34 | } 35 | }, 36 | render () { 37 | const { $slots, value } = this 38 | const onChange = (checked) => { 39 | this.$emit('change', { value, checked }) 40 | } 41 | return ( 42 | {$slots.default} 43 | ) 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/components/tools/Breadcrumb.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 43 | 44 | 46 | -------------------------------------------------------------------------------- /src/components/Charts/MiniBar.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 54 | 55 | 58 | -------------------------------------------------------------------------------- /src/assets/logo.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/components/Charts/MiniArea.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 53 | 54 | 57 | -------------------------------------------------------------------------------- /src/components/NumberInfo/NumberInfo.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 51 | 52 | 55 | -------------------------------------------------------------------------------- /src/utils/helper/permission.js: -------------------------------------------------------------------------------- 1 | const PERMISSION_ENUM = { 2 | 'add': { key: 'add', label: '新增' }, 3 | 'delete': { key: 'delete', label: '删除' }, 4 | 'edit': { key: 'edit', label: '修改' }, 5 | 'query': { key: 'query', label: '查询' }, 6 | 'get': { key: 'get', label: '详情' }, 7 | 'enable': { key: 'enable', label: '启用' }, 8 | 'disable': { key: 'disable', label: '禁用' }, 9 | 'import': { key: 'import', label: '导入' }, 10 | 'export': { key: 'export', label: '导出' } 11 | } 12 | 13 | function plugin (Vue) { 14 | if (plugin.installed) { 15 | return 16 | } 17 | 18 | !Vue.prototype.$auth && Object.defineProperties(Vue.prototype, { 19 | $auth: { 20 | get () { 21 | return (permissions) => { 22 | return abp.auth.isAnyGranted(permissions) 23 | } 24 | } 25 | }, 26 | }) 27 | 28 | !Vue.prototype.$enum && Object.defineProperties(Vue.prototype, { 29 | $enum: { 30 | get () { 31 | // const _this = this; 32 | return (val) => { 33 | let result = PERMISSION_ENUM 34 | val && val.split('.').forEach(v => { 35 | result = result && result[v] || null 36 | }) 37 | return result 38 | } 39 | } 40 | } 41 | }) 42 | } 43 | 44 | export default plugin 45 | -------------------------------------------------------------------------------- /src/utils/arrayToTreeConverter.js: -------------------------------------------------------------------------------- 1 | import * as _ from 'lodash' 2 | 3 | export function createTree (array, parentIdProperty, idProperty, parentIdValue, childrenProperty, fieldMappings) { 4 | const tree = [] 5 | const nodes = _.filter(array, [parentIdProperty, parentIdValue]) 6 | _.forEach(nodes, node => { 7 | const newNode = { 8 | data: node 9 | } 10 | mapFields(node, newNode, fieldMappings) 11 | newNode[childrenProperty] = createTree( 12 | array, 13 | parentIdProperty, 14 | idProperty, 15 | node[idProperty], 16 | childrenProperty, 17 | fieldMappings 18 | ) 19 | 20 | tree.push(newNode) 21 | }) 22 | return tree 23 | } 24 | 25 | export function mapFields (node, newNode, fieldMappings) { 26 | _.forEach(fieldMappings, fieldMapping => { 27 | if (!fieldMapping['target']) { 28 | return 29 | } 30 | 31 | if (fieldMapping.hasOwnProperty('value')) { 32 | newNode[fieldMapping['target']] = fieldMapping['value'] 33 | } else if (fieldMapping['source']) { 34 | newNode[fieldMapping['target']] = node[fieldMapping['source']] 35 | } else if (fieldMapping['targetFunction']) { 36 | newNode[fieldMapping['target']] = fieldMapping['targetFunction'](node) 37 | } 38 | }) 39 | } 40 | 41 | -------------------------------------------------------------------------------- /src/components/Editor/WangEditor.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 50 | 51 | 58 | -------------------------------------------------------------------------------- /src/components/IconSelector/IconSelector.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 34 | 35 | 54 | -------------------------------------------------------------------------------- /src/components/AvatarList/index.less: -------------------------------------------------------------------------------- 1 | @import "../index"; 2 | 3 | @avatar-list-prefix-cls: ~"@{ant-pro-prefix}-avatar-list"; 4 | @avatar-list-item-prefix-cls: ~"@{ant-pro-prefix}-avatar-list-item"; 5 | 6 | .@{avatar-list-prefix-cls} { 7 | display: inline-block; 8 | 9 | ul { 10 | list-style: none; 11 | display: inline-block; 12 | padding: 0; 13 | margin: 0 0 0 8px; 14 | font-size: 0; 15 | } 16 | } 17 | 18 | .@{avatar-list-item-prefix-cls} { 19 | display: inline-block; 20 | font-size: @font-size-base; 21 | margin-left: -8px; 22 | width: @avatar-size-base; 23 | height: @avatar-size-base; 24 | 25 | :global { 26 | .ant-avatar { 27 | border: 1px solid #fff; 28 | cursor: pointer; 29 | } 30 | } 31 | 32 | &.large { 33 | width: @avatar-size-lg; 34 | height: @avatar-size-lg; 35 | } 36 | 37 | &.small { 38 | width: @avatar-size-sm; 39 | height: @avatar-size-sm; 40 | } 41 | 42 | &.mini { 43 | width: 20px; 44 | height: 20px; 45 | 46 | :global { 47 | .ant-avatar { 48 | width: 20px; 49 | height: 20px; 50 | line-height: 20px; 51 | 52 | .ant-avatar-string { 53 | font-size: 12px; 54 | line-height: 18px; 55 | } 56 | } 57 | } 58 | } 59 | } 60 | 61 | -------------------------------------------------------------------------------- /src/components/Charts/TransferBar.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 65 | -------------------------------------------------------------------------------- /src/config/defaultSettings.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 项目默认配置项 3 | * primaryColor - 默认主题色, 如果修改颜色不生效,请清理 localStorage 4 | * navTheme - sidebar theme ['dark', 'light'] 两种主题 5 | * colorWeak - 色盲模式 6 | * layout - 整体布局方式 ['sidemenu', 'topmenu'] 两种布局 7 | * fixedHeader - 固定 Header : boolean 8 | * fixSiderbar - 固定左侧菜单栏 : boolean 9 | * autoHideHeader - 向下滚动时,隐藏 Header : boolean 10 | * contentWidth - 内容区布局: 流式 | 固定 11 | * 12 | * storageOptions: {} - Vue-ls 插件配置项 (localStorage/sessionStorage) 13 | * 14 | */ 15 | 16 | export default { 17 | primaryColor: '#52C41A', // primary color of ant design 18 | navTheme: 'dark', // theme for nav menu 19 | layout: 'sidemenu', // nav menu position: sidemenu or topmenu 20 | contentWidth: 'Fixed', // layout of content: Fluid or Fixed, only works when layout is topmenu 21 | fixedHeader: false, // sticky header 22 | fixSiderbar: false, // sticky siderbar 23 | autoHideHeader: false, // auto hide header 24 | colorWeak: false, 25 | multiTab: false, 26 | production: process.env.NODE_ENV === 'production' && process.env.VUE_APP_PREVIEW !== 'true', 27 | // vue-ls options 28 | storageOptions: { 29 | namespace: 'pro__', // key prefix 30 | name: 'ls', // name variable Vue.[ls] or this.[$ls], 31 | storage: 'local' // storage name session, local, memory 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/core/precise/AppConsts.js: -------------------------------------------------------------------------------- 1 | const AppConsts = { 2 | userManagement: { 3 | defaultAdminUserName: 'admin', 4 | }, 5 | localization: { 6 | defaultLocalizationSourceName: 'Precise', 7 | }, 8 | authorization: { 9 | encrptedAuthTokenName: 'enc_auth_token', 10 | }, 11 | appBaseUrlFormat: '', 12 | remoteServiceBaseUrlFormat: '', 13 | appBaseUrl: 'http://localhost:8000', 14 | remoteServiceBaseUrl: 'http://localhost:50538', 15 | localeMappings: [ 16 | 17 | ], 18 | tenancyNamePlaceHolderInUrl: '{TENANCY_NAME}' 19 | } 20 | export default AppConsts 21 | 22 | // const AppConstss = { 23 | // tenancyNamePlaceHolderInUrl: '{TENANCY_NAME}', 24 | // remoteServiceBaseUrl: 'string', 25 | // remoteServiceBaseUrlFormat: 'string', 26 | // appBaseUrl: 'string', 27 | // appBaseHref: 'string', 28 | // appBaseUrlFormat: 'string', 29 | // recaptchaSiteKey: 'string', 30 | // subscriptionExpireNootifyDayCount: 'number', 31 | // localeMappings: [], 32 | // userManagement: { 33 | // defaultAdminUserName: 'admin' 34 | // }, 35 | // localization: { 36 | // defaultLocalizationSourceName: 'AbpZeroTemplate' 37 | // }, 38 | // authorization: { 39 | // encrptedAuthTokenName: 'enc_auth_token' 40 | // }, 41 | // grid: { 42 | // defaultPageSize: 10 43 | // } 44 | // } 45 | -------------------------------------------------------------------------------- /src/components/Charts/Bar.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 63 | -------------------------------------------------------------------------------- /src/components/NumberInfo/index.less: -------------------------------------------------------------------------------- 1 | @import "../index"; 2 | 3 | @numberInfo-prefix-cls: ~"@{ant-pro-prefix}-number-info"; 4 | 5 | .@{numberInfo-prefix-cls} { 6 | 7 | .ant-pro-number-info-subtitle { 8 | color: @text-color-secondary; 9 | font-size: @font-size-base; 10 | height: 22px; 11 | line-height: 22px; 12 | overflow: hidden; 13 | text-overflow: ellipsis; 14 | word-break: break-all; 15 | white-space: nowrap; 16 | } 17 | 18 | .number-info-value { 19 | margin-top: 4px; 20 | font-size: 0; 21 | overflow: hidden; 22 | text-overflow: ellipsis; 23 | word-break: break-all; 24 | white-space: nowrap; 25 | 26 | & > span { 27 | color: @heading-color; 28 | display: inline-block; 29 | line-height: 32px; 30 | height: 32px; 31 | font-size: 24px; 32 | margin-right: 32px; 33 | } 34 | 35 | .sub-total { 36 | color: @text-color-secondary; 37 | font-size: @font-size-lg; 38 | vertical-align: top; 39 | margin-right: 0; 40 | i { 41 | font-size: 12px; 42 | transform: scale(0.82); 43 | margin-left: 4px; 44 | } 45 | :global { 46 | .anticon-caret-up { 47 | color: @red-6; 48 | } 49 | .anticon-caret-down { 50 | color: @green-6; 51 | } 52 | } 53 | } 54 | } 55 | } -------------------------------------------------------------------------------- /src/api/manage.js: -------------------------------------------------------------------------------- 1 | import { axios } from '@/utils/request' 2 | 3 | const api = { 4 | user: '/user', 5 | role: '/role', 6 | service: '/mockservice', 7 | permission: '/permission', 8 | permissionNoPager: '/permission/no-pager', 9 | orgTree: '/org/tree' 10 | } 11 | 12 | export default api 13 | 14 | export function getUserList (parameter) { 15 | return axios({ 16 | url: api.user, 17 | method: 'get', 18 | params: parameter 19 | }) 20 | } 21 | 22 | export function getRoleList (parameter) { 23 | return axios({ 24 | url: api.role, 25 | method: 'get', 26 | params: parameter 27 | }) 28 | } 29 | 30 | export function getServiceList (parameter) { 31 | return axios({ 32 | url: api.service, 33 | method: 'get', 34 | params: parameter 35 | }) 36 | } 37 | 38 | export function getPermissions (parameter) { 39 | return axios({ 40 | url: api.permissionNoPager, 41 | method: 'get', 42 | params: parameter 43 | }) 44 | } 45 | 46 | export function getOrgTree (parameter) { 47 | return axios({ 48 | url: api.orgTree, 49 | method: 'get', 50 | params: parameter 51 | }) 52 | } 53 | 54 | // id == 0 add post 55 | // id != 0 update put 56 | export function saveService (parameter) { 57 | return axios({ 58 | url: api.service, 59 | method: parameter.id === 0 ? 'post' : 'put', 60 | data: parameter 61 | }) 62 | } 63 | -------------------------------------------------------------------------------- /src/components/tools/HeadInfo.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 32 | 33 | 68 | -------------------------------------------------------------------------------- /src/components/Menu/SideMenu.vue: -------------------------------------------------------------------------------- 1 | 19 | 20 | 62 | -------------------------------------------------------------------------------- /src/components/GlobalFooter/GlobalFooter.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 38 | 39 | 66 | -------------------------------------------------------------------------------- /src/core/bootstrap.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import store from '@/store/' 3 | import { 4 | ACCESS_TOKEN, 5 | DEFAULT_COLOR, 6 | DEFAULT_THEME, 7 | DEFAULT_LAYOUT_MODE, 8 | DEFAULT_COLOR_WEAK, 9 | SIDEBAR_TYPE, 10 | DEFAULT_FIXED_HEADER, 11 | DEFAULT_FIXED_HEADER_HIDDEN, 12 | DEFAULT_FIXED_SIDEMENU, 13 | DEFAULT_CONTENT_WIDTH_TYPE, 14 | DEFAULT_MULTI_TAB, 15 | } from '@/store/mutation-types' 16 | import config from '@/config/defaultSettings' 17 | 18 | export default function Initializer () { 19 | store.commit('SET_SIDEBAR_TYPE', Vue.ls.get(SIDEBAR_TYPE, true)) 20 | store.commit('TOGGLE_THEME', Vue.ls.get(DEFAULT_THEME, config.navTheme)) 21 | store.commit('TOGGLE_LAYOUT_MODE', Vue.ls.get(DEFAULT_LAYOUT_MODE, config.layout)) 22 | store.commit('TOGGLE_FIXED_HEADER', Vue.ls.get(DEFAULT_FIXED_HEADER, config.fixedHeader)) 23 | store.commit('TOGGLE_FIXED_SIDERBAR', Vue.ls.get(DEFAULT_FIXED_SIDEMENU, config.fixSiderbar)) 24 | store.commit('TOGGLE_CONTENT_WIDTH', Vue.ls.get(DEFAULT_CONTENT_WIDTH_TYPE, config.contentWidth)) 25 | store.commit('TOGGLE_FIXED_HEADER_HIDDEN', Vue.ls.get(DEFAULT_FIXED_HEADER_HIDDEN, config.autoHideHeader)) 26 | store.commit('TOGGLE_WEAK', Vue.ls.get(DEFAULT_COLOR_WEAK, config.colorWeak)) 27 | store.commit('TOGGLE_COLOR', Vue.ls.get(DEFAULT_COLOR, config.primaryColor)) 28 | store.commit('TOGGLE_MULTI_TAB', Vue.ls.get(DEFAULT_MULTI_TAB, config.multiTab)) 29 | store.commit('SET_TOKEN', Vue.ls.get(ACCESS_TOKEN)) 30 | 31 | // last step 32 | } 33 | -------------------------------------------------------------------------------- /src/components/Charts/Liquid.vue: -------------------------------------------------------------------------------- 1 | 48 | 49 | 64 | 65 | 68 | -------------------------------------------------------------------------------- /src/api/login.js: -------------------------------------------------------------------------------- 1 | import api from './index' 2 | import { axios } from '@/utils/request' 3 | 4 | /** 5 | * login func 6 | * parameter: { 7 | * username: '', 8 | * password: '', 9 | * remember_me: true, 10 | * captcha: '12345' 11 | * } 12 | * @param parameter 13 | * @returns {*} 14 | */ 15 | export function login (parameter) { 16 | return axios({ 17 | url: 'http://127.0.0.1:50538/api/TokenAuth/Authenticate', 18 | method: 'post', 19 | data: parameter 20 | }) 21 | } 22 | 23 | export function logins (parameter) { 24 | return axios({ 25 | url: '/auth/login', 26 | method: 'post', 27 | data: parameter 28 | }) 29 | } 30 | 31 | export function getSmsCaptcha (parameter) { 32 | return axios({ 33 | url: api.SendSms, 34 | method: 'post', 35 | data: parameter 36 | }) 37 | } 38 | 39 | export function getInfo () { 40 | return axios({ 41 | url: '/account/info', 42 | method: 'get', 43 | headers: { 44 | 'Content-Type': 'application/json;charset=UTF-8' 45 | } 46 | }) 47 | } 48 | 49 | export function logout () { 50 | return axios({ 51 | url: '/auth/logout', 52 | method: 'post', 53 | headers: { 54 | 'Content-Type': 'application/json;charset=UTF-8' 55 | } 56 | }) 57 | } 58 | 59 | /** 60 | * get user 2step code open? 61 | * @param parameter {*} 62 | */ 63 | export function get2step (parameter) { 64 | return axios({ 65 | url: api.twoStepCode, 66 | method: 'post', 67 | data: parameter 68 | }) 69 | } 70 | -------------------------------------------------------------------------------- /src/core/precise/helpers/UrlHelper.js: -------------------------------------------------------------------------------- 1 | export default { 2 | initialUrl: location.href, 3 | getQueryParameters () { 4 | return this.getQueryParametersUsingParameters(document.location.search) 5 | }, 6 | getQueryParametersUsingParameters (search) { 7 | return search.replace(/(^\?)/, '').split('&').map(function (n) { return n = n.split('='), this[n[0]] = n[1], this }.bind({}))[0] 8 | }, 9 | getQueryParametersUsingHash () { 10 | return document.location.hash.substr(1, document.location.hash.length - 1).replace(/(^\?)/, '').split('&').map(function (n) { return n = n.split('='), this[n[0]] = n[1], this }.bind({}))[0] 11 | }, 12 | getInitialUrlParameters () { 13 | const questionMarkIndex = this.initialUrl.indexOf('?') 14 | if (questionMarkIndex >= 0) { 15 | return this.initialUrl.substr(questionMarkIndex, this.initialUrl.length - questionMarkIndex) 16 | } 17 | return '' 18 | }, 19 | getReturnUrl () { 20 | const queryStringObj = this.getQueryParametersUsingParameters(this.getInitialUrlParameters()) 21 | if (queryStringObj.returnUrl) { 22 | return decodeURIComponent(queryStringObj.returnUrl) 23 | } 24 | return null 25 | }, 26 | getSingleSignIn () { 27 | const queryStringObj = this.getQueryParametersUsingParameters(this.getInitialUrlParameters()) 28 | if (queryStringObj.ss) { 29 | return queryStringObj.ss 30 | } 31 | return false 32 | }, 33 | isInstallUrl (url) { 34 | return url && url.indexOf('app/admin/install') >= 0 35 | } 36 | } -------------------------------------------------------------------------------- /src/api/precise/notification.js: -------------------------------------------------------------------------------- 1 | import { axios } from '@/utils/request' 2 | import AppConsts from '@/core/precise/AppConsts' 3 | 4 | export function getUserNotifications (parameter) { 5 | return axios({ 6 | url: AppConsts.remoteServiceBaseUrl + '/api/services/app/Notification/GetUserNotifications', 7 | method: 'get', 8 | params: parameter 9 | }) 10 | } 11 | 12 | export function setAllNotificationsAsRead () { 13 | return axios({ 14 | url: AppConsts.remoteServiceBaseUrl + '/api/services/app/Notification/SetAllNotificationsAsRead', 15 | method: 'post', 16 | }) 17 | } 18 | 19 | export function setNotificationAsRead (parameter) { 20 | return axios({ 21 | url: AppConsts.remoteServiceBaseUrl + '/api/services/app/Notification/SetNotificationAsRead', 22 | method: 'post', 23 | data: parameter 24 | }) 25 | } 26 | 27 | export function getNotificationSettings () { 28 | return axios({ 29 | url: AppConsts.remoteServiceBaseUrl + '/api/services/app/Notification/GetNotificationSettings', 30 | method: 'get', 31 | }) 32 | } 33 | 34 | export function updateNotificationSettings (parameter) { 35 | return axios({ 36 | url: AppConsts.remoteServiceBaseUrl + '/api/services/app/Notification/UpdateNotificationSettings', 37 | method: 'put', 38 | data: parameter 39 | }) 40 | } 41 | 42 | export function deleteNotification (parameter) { 43 | return axios({ 44 | url: AppConsts.remoteServiceBaseUrl + '/api/services/app/Notification/DeleteNotification', 45 | method: 'delete', 46 | data: parameter 47 | }) 48 | } -------------------------------------------------------------------------------- /public/loading/loading.css: -------------------------------------------------------------------------------- 1 | #preloadingAnimation{position:fixed;left:0;top:0;height:100%;width:100%;background:#ffffff;user-select:none;z-index: 9999;overflow: hidden}.lds-roller{display:inline-block;position:relative;left:50%;top:50%;transform:translate(-50%,-50%);width:64px;height:64px;}.lds-roller div{animation:lds-roller 1.2s cubic-bezier(0.5,0,0.5,1) infinite;transform-origin:32px 32px;}.lds-roller div:after{content:" ";display:block;position:absolute;width:6px;height:6px;border-radius:50%;background:#13c2c2;margin:-3px 0 0 -3px;}.lds-roller div:nth-child(1){animation-delay:-0.036s;}.lds-roller div:nth-child(1):after{top:50px;left:50px;}.lds-roller div:nth-child(2){animation-delay:-0.072s;}.lds-roller div:nth-child(2):after{top:54px;left:45px;}.lds-roller div:nth-child(3){animation-delay:-0.108s;}.lds-roller div:nth-child(3):after{top:57px;left:39px;}.lds-roller div:nth-child(4){animation-delay:-0.144s;}.lds-roller div:nth-child(4):after{top:58px;left:32px;}.lds-roller div:nth-child(5){animation-delay:-0.18s;}.lds-roller div:nth-child(5):after{top:57px;left:25px;}.lds-roller div:nth-child(6){animation-delay:-0.216s;}.lds-roller div:nth-child(6):after{top:54px;left:19px;}.lds-roller div:nth-child(7){animation-delay:-0.252s;}.lds-roller div:nth-child(7):after{top:50px;left:14px;}.lds-roller div:nth-child(8){animation-delay:-0.288s;}.lds-roller div:nth-child(8):after{top:45px;left:10px;}#preloadingAnimation .load-tips{color: #13c2c2;font-size:2rem;position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);margin-top:80px;text-align:center;width:400px;height:64px;} @keyframes lds-roller{0%{transform:rotate(0deg);} 100%{transform:rotate(360deg);}} -------------------------------------------------------------------------------- /src/components/Charts/Radar.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 65 | 66 | 69 | -------------------------------------------------------------------------------- /src/mock/dataapi/auth.js: -------------------------------------------------------------------------------- 1 | import Mock from 'mockjs2' 2 | import { builder, getBody } from '../util' 3 | 4 | const username = ['admin', 'user', 'super'] 5 | const password = ['21232f297a57a5a743894a0e4a801fc3', '8914de686ab28dc22f30d3d8e107ff6c'] // admin, ant.design 6 | 7 | const login = (options) => { 8 | const body = getBody(options) 9 | console.log('mock: body', body) 10 | if (!username.includes(body.username) || !password.includes(body.password)) { 11 | return builder({ isLogin: true }, '账户或密码错误', 401) 12 | } 13 | 14 | return builder({ 15 | 'id': Mock.mock('@guid'), 16 | 'name': Mock.mock('@name'), 17 | 'username': 'admin', 18 | 'password': '', 19 | 'avatar': 'https://gw.alipayobjects.com/zos/rmsportal/jZUIxmJycoymBprLOUbT.png', 20 | 'status': 1, 21 | 'telephone': '', 22 | 'lastLoginIp': '27.154.74.117', 23 | 'lastLoginTime': 1534837621348, 24 | 'creatorId': 'admin', 25 | 'createTime': 1497160610259, 26 | 'deleted': 0, 27 | 'roleId': 'admin', 28 | 'lang': 'zh-CN', 29 | 'token': '4291d7da9005377ec9aec4a71ea837f' 30 | }, '', 200, { 'Custom-Header': Mock.mock('@guid') }) 31 | } 32 | 33 | const logout = () => { 34 | return builder({}, '[测试接口] 注销成功') 35 | } 36 | 37 | const smsCaptcha = () => { 38 | return builder({ captcha: Mock.mock('@integer(10000, 99999)') }) 39 | } 40 | 41 | const twofactor = () => { 42 | return builder({ stepCode: Mock.mock('@integer(0, 1)') }) 43 | } 44 | 45 | Mock.mock(/\/auth\/login/, 'post', login) 46 | Mock.mock(/\/auth\/logout/, 'post', logout) 47 | Mock.mock(/\/account\/sms/, 'post', smsCaptcha) 48 | Mock.mock(/\/auth\/2step-code/, 'post', twofactor) 49 | -------------------------------------------------------------------------------- /src/utils/storage.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Set storage 3 | * 4 | * @param name 5 | * @param content 6 | * @param maxAge 7 | */ 8 | export const setStore = (name, content, maxAge = null) => { 9 | if (!global.window || !name) { 10 | return 11 | } 12 | 13 | if (typeof content !== 'string') { 14 | content = JSON.stringify(content) 15 | } 16 | 17 | const storage = global.window.localStorage 18 | 19 | storage.setItem(name, content) 20 | if (maxAge && !isNaN(parseInt(maxAge))) { 21 | const timeout = parseInt(new Date().getTime() / 1000) 22 | storage.setItem(`${name}_expire`, timeout + maxAge) 23 | } 24 | } 25 | 26 | /** 27 | * Get storage 28 | * 29 | * @param name 30 | * @returns {*} 31 | */ 32 | export const getStore = name => { 33 | if (!global.window || !name) { 34 | return 35 | } 36 | 37 | const content = window.localStorage.getItem(name) 38 | const _expire = window.localStorage.getItem(`${name}_expire`) 39 | 40 | if (_expire) { 41 | const now = parseInt(new Date().getTime() / 1000) 42 | if (now > _expire) { 43 | return 44 | } 45 | } 46 | 47 | try { 48 | return JSON.parse(content) 49 | } catch (e) { 50 | return content 51 | } 52 | } 53 | 54 | /** 55 | * Clear storage 56 | * 57 | * @param name 58 | */ 59 | export const clearStore = name => { 60 | if (!global.window || !name) { 61 | return 62 | } 63 | 64 | window.localStorage.removeItem(name) 65 | window.localStorage.removeItem(`${name}_expire`) 66 | } 67 | 68 | /** 69 | * Clear all storage 70 | */ 71 | export const clearAll = () => { 72 | if (!global.window || !name) { 73 | return 74 | } 75 | 76 | window.localStorage.clear() 77 | } 78 | -------------------------------------------------------------------------------- /src/utils/util.js: -------------------------------------------------------------------------------- 1 | export function timeFix () { 2 | const time = new Date() 3 | const hour = time.getHours() 4 | return hour < 9 ? '早上好' : hour <= 11 ? '上午好' : hour <= 13 ? '中午好' : hour < 20 ? '下午好' : '晚上好' 5 | } 6 | 7 | export function welcome () { 8 | const arr = ['休息一会儿吧', '准备吃什么呢?', '要不要打一把 DOTA', '我猜你可能累了'] 9 | const index = Math.floor(Math.random() * arr.length) 10 | return arr[index] 11 | } 12 | 13 | /** 14 | * 触发 window.resize 15 | */ 16 | export function triggerWindowResizeEvent () { 17 | const event = document.createEvent('HTMLEvents') 18 | event.initEvent('resize', true, true) 19 | event.eventType = 'message' 20 | window.dispatchEvent(event) 21 | } 22 | 23 | export function handleScrollHeader (callback) { 24 | let timer = 0 25 | 26 | let beforeScrollTop = window.pageYOffset 27 | callback = callback || function () {} 28 | window.addEventListener( 29 | 'scroll', 30 | event => { 31 | clearTimeout(timer) 32 | timer = setTimeout(() => { 33 | let direction = 'up' 34 | const afterScrollTop = window.pageYOffset 35 | const delta = afterScrollTop - beforeScrollTop 36 | if (delta === 0) { 37 | return false 38 | } 39 | direction = delta > 0 ? 'down' : 'up' 40 | callback(direction) 41 | beforeScrollTop = afterScrollTop 42 | }, 50) 43 | }, 44 | false 45 | ) 46 | } 47 | 48 | /** 49 | * Remove loading animate 50 | * @param id parent element id or class 51 | * @param timeout 52 | */ 53 | export function removeLoadingAnimate (id = '', timeout = 1500) { 54 | if (id === '') { 55 | return 56 | } 57 | setTimeout(() => { 58 | document.body.removeChild(document.getElementById(id)) 59 | }, timeout) 60 | } 61 | -------------------------------------------------------------------------------- /src/components/Ellipsis/Ellipsis.vue: -------------------------------------------------------------------------------- 1 | 65 | -------------------------------------------------------------------------------- /src/components/Charts/MiniProgress.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 36 | 37 | 76 | -------------------------------------------------------------------------------- /src/components/Charts/RankList.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 30 | 31 | 78 | -------------------------------------------------------------------------------- /src/views/account/settings/Security.vue: -------------------------------------------------------------------------------- 1 | 22 | 23 | 38 | 39 | 42 | -------------------------------------------------------------------------------- /src/assets/icons/bx-analyse.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/components/Charts/Trend.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 52 | 53 | 83 | -------------------------------------------------------------------------------- /src/api/precise/tokenAuth.js: -------------------------------------------------------------------------------- 1 | import { axios } from '@/utils/request' 2 | import AppConsts from '@/core/precise/AppConsts' 3 | 4 | export function authenticate (parameter) { 5 | return axios({ 6 | url: AppConsts.remoteServiceBaseUrl + '/api/TokenAuth/Authenticate', 7 | method: 'post', 8 | data: parameter 9 | }) 10 | } 11 | 12 | export function logOut () { 13 | return axios({ 14 | url: AppConsts.remoteServiceBaseUrl + '/api/TokenAuth/LogOut', 15 | method: 'get', 16 | }) 17 | } 18 | 19 | export function sendTwoFactorAuthCode (parameter) { 20 | return axios({ 21 | url: AppConsts.remoteServiceBaseUrl + '/api/TokenAuth/SendTwoFactorAuthCode', 22 | method: 'post', 23 | data: parameter 24 | }) 25 | } 26 | 27 | export function impersonatedAuthenticate (parameter) { 28 | return axios({ 29 | url: AppConsts.remoteServiceBaseUrl + '/api/TokenAuth/ImpersonatedAuthenticate', 30 | method: 'post', 31 | data: parameter 32 | }) 33 | } 34 | 35 | export function linkedAccountAuthenticate (parameter) { 36 | return axios({ 37 | url: AppConsts.remoteServiceBaseUrl + '/api/TokenAuth/LinkedAccountAuthenticate', 38 | method: 'post', 39 | data: parameter 40 | }) 41 | } 42 | 43 | export function getExternalAuthenticationProviders () { 44 | return axios({ 45 | url: AppConsts.remoteServiceBaseUrl + '/api/TokenAuth/GetExternalAuthenticationProviders', 46 | method: 'get', 47 | }) 48 | } 49 | 50 | export function externalAuthenticate (parameter) { 51 | return axios({ 52 | url: AppConsts.remoteServiceBaseUrl + '/api/TokenAuth/ExternalAuthenticate', 53 | method: 'post', 54 | data: parameter 55 | }) 56 | } 57 | 58 | export function testNotification (parameter) { 59 | return axios({ 60 | url: AppConsts.remoteServiceBaseUrl + '/api/TokenAuth/TestNotification', 61 | method: 'get', 62 | params: parameter 63 | }) 64 | } -------------------------------------------------------------------------------- /src/utils/request.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import axios from 'axios' 3 | import store from '@/store' 4 | import { 5 | VueAxios 6 | } from './axios' 7 | import notification from 'ant-design-vue/es/notification' 8 | import { 9 | ACCESS_TOKEN 10 | } from '@/store/mutation-types' 11 | 12 | const service = axios.create({ 13 | baseURL: '/api', // api base_url 14 | timeout: 6000 // 请求超时时间 15 | }) 16 | 17 | const err = (error) => { 18 | if (error.response) { 19 | const data = error.response.data 20 | const token = Vue.ls.get(ACCESS_TOKEN) 21 | if (error.response.status === 403) { 22 | notification.error({ 23 | message: 'Forbidden', 24 | description: data.message 25 | }) 26 | } 27 | if (error.response.status === 401 && !(data.result && data.result.isLogin)) { 28 | notification.error({ 29 | message: 'Unauthorized', 30 | description: 'Authorization verification failed' 31 | }) 32 | if (token) { 33 | store.dispatch('Logout').then(() => { 34 | setTimeout(() => { 35 | window.location.reload() 36 | }, 1500) 37 | }) 38 | } 39 | } 40 | } 41 | return Promise.reject(error) 42 | } 43 | 44 | // request interceptor 45 | service.interceptors.request.use(config => { 46 | const token = Vue.ls.get(ACCESS_TOKEN) 47 | if (token) { 48 | config.headers['Authorization'] = 'Bearer ' + token // 让每个请求携带自定义 token 请根据实际情况自行修改 49 | // config.headers['Access-Token'] = token // 让每个请求携带自定义 token 请根据实际情况自行修改 50 | } 51 | return config 52 | }, err) 53 | 54 | // response interceptor 55 | service.interceptors.response.use((response) => { 56 | return response.data 57 | }, err) 58 | 59 | const installer = { 60 | vm: {}, 61 | install (Vue) { 62 | Vue.use(VueAxios, service) 63 | } 64 | } 65 | 66 | export { 67 | installer as VueAxios, 68 | service as axios 69 | } 70 | -------------------------------------------------------------------------------- /src/core/precise/common/nav/appUrl.js: -------------------------------------------------------------------------------- 1 | import AppConsts from '@/core/precise/AppConsts' 2 | import store from '@/store' 3 | 4 | const tenancyNamePlaceHolder = '{TENANCY_NAME}' 5 | 6 | export default class AppUrl { 7 | 8 | static appRootUrl () { 9 | if (store.getters.appSession.tenant) { 10 | return this.getAppRootUrlOfTenant(store.getters.appSession.tenant.tenancyName) 11 | } else { 12 | return this.getAppRootUrlOfTenant(null) 13 | } 14 | } 15 | 16 | static getAppRootUrlOfTenant (tenancyName) { 17 | var baseUrl = this.ensureEndsWith(AppConsts.appBaseUrlFormat, '/') 18 | 19 | //Add base href if it is not configured in appconfig.json 20 | if (baseUrl.indexOf(AppConsts.appBaseHref) < 0) { 21 | if (this.removeFromStart(AppConsts.appBaseHref, '/') != undefined) 22 | baseUrl = baseUrl + this.removeFromStart(AppConsts.appBaseHref, '/') 23 | } 24 | 25 | if (baseUrl.indexOf(tenancyNamePlaceHolder) < 0) { 26 | return baseUrl 27 | } 28 | 29 | if (baseUrl.indexOf(tenancyNamePlaceHolder + '.') >= 0) { 30 | baseUrl = baseUrl.replace(tenancyNamePlaceHolder + '.', tenancyNamePlaceHolder) 31 | if (tenancyName) { 32 | tenancyName = tenancyName + '.' 33 | } 34 | } 35 | 36 | if (!tenancyName) { 37 | return baseUrl.replace(tenancyNamePlaceHolder, '') 38 | } 39 | 40 | 41 | return baseUrl.replace(tenancyNamePlaceHolder, tenancyName) 42 | } 43 | 44 | static ensureEndsWith (str, c) { 45 | if (str + ''.charAt(str.length - 1) !== c) { 46 | str = str + c 47 | } 48 | 49 | return str 50 | } 51 | 52 | static removeFromEnd (str, c) { 53 | if (str + ''.charAt(str.length - 1) === c) { 54 | str = str.substr(0, str.length - 1) 55 | } 56 | 57 | return str 58 | } 59 | 60 | static removeFromStart (str, c) { 61 | if (str + ''.charAt(0) === c) { 62 | str = str.substr(1, str.length - 1) 63 | } 64 | 65 | return str 66 | } 67 | } -------------------------------------------------------------------------------- /src/views/admin/organization/index.less: -------------------------------------------------------------------------------- 1 | @wrapper: ~'department'; 2 | .percent-100 { 3 | width: 100%; 4 | height: 100%; 5 | } 6 | .@{wrapper}-outer { 7 | .percent-100; 8 | overflow: hidden; 9 | .tip-box{ 10 | position: absolute; 11 | left: 20px; 12 | top: 20px; 13 | z-index: 12; 14 | } 15 | .zoom-box { 16 | position: absolute; 17 | right: 30px; 18 | bottom: 30px; 19 | z-index: 2; 20 | } 21 | .view-box { 22 | position: absolute; 23 | top: 0; 24 | bottom: 0; 25 | left: 0; 26 | right: 0; 27 | z-index: 1; 28 | cursor: move; 29 | .org-tree-drag-wrapper { 30 | width: 100%; 31 | height: 100%; 32 | } 33 | .org-tree-wrapper { 34 | display: inline-block; 35 | position: absolute; 36 | left: 50%; 37 | top: 50%; 38 | transition: transform 0.2s ease-out; 39 | .org-tree-node-label { 40 | box-shadow: 0px 2px 12px 0px rgba(143, 154, 165, 0.4); 41 | border-radius: 4px; 42 | .org-tree-node-label-inner { 43 | padding: 0; 44 | .custom-org-node { 45 | padding: 14px 41px; 46 | background: #738699; 47 | user-select: none; 48 | word-wrap: none; 49 | white-space: nowrap; 50 | border-radius: 4px; 51 | color: #ffffff; 52 | font-size: 14px; 53 | font-weight: 500; 54 | line-height: 20px; 55 | transition: background 0.1s ease-in; 56 | cursor: default; 57 | &:hover { 58 | background: #5d6c7b; 59 | transition: background 0.1s ease-in; 60 | } 61 | &.has-children-label { 62 | cursor: pointer; 63 | } 64 | .context-menu{ 65 | position: absolute; 66 | right: -10px; 67 | bottom: 20px; 68 | z-index: 10; 69 | } 70 | } 71 | } 72 | } 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /src/views/admin/organization/components/zoom-controller.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 45 | 46 | 79 | -------------------------------------------------------------------------------- /src/views/account/settings/Custom.vue: -------------------------------------------------------------------------------- 1 | 72 | 73 | 76 | -------------------------------------------------------------------------------- /src/components/Editor/QuillEditor.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 69 | 70 | 83 | -------------------------------------------------------------------------------- /src/components/index.js: -------------------------------------------------------------------------------- 1 | // chart 2 | import Bar from '@/components/Charts/Bar' 3 | import ChartCard from '@/components/Charts/ChartCard' 4 | import Liquid from '@/components/Charts/Liquid' 5 | import MiniArea from '@/components/Charts/MiniArea' 6 | import MiniSmoothArea from '@/components/Charts/MiniSmoothArea' 7 | import MiniBar from '@/components/Charts/MiniBar' 8 | import MiniProgress from '@/components/Charts/MiniProgress' 9 | import Radar from '@/components/Charts/Radar' 10 | import RankList from '@/components/Charts/RankList' 11 | import TransferBar from '@/components/Charts/TransferBar' 12 | import TagCloud from '@/components/Charts/TagCloud' 13 | 14 | // pro components 15 | import AvatarList from '@/components/AvatarList' 16 | import CountDown from '@/components/CountDown' 17 | import Ellipsis from '@/components/Ellipsis' 18 | import FooterToolbar from '@/components/FooterToolbar' 19 | import NumberInfo from '@/components/NumberInfo' 20 | import DescriptionList from '@/components/DescriptionList' 21 | import Tree from '@/components/Tree/Tree' 22 | import Trend from '@/components/Trend' 23 | import STable from '@/components/Table' 24 | import MultiTab from '@/components/MultiTab' 25 | import Result from '@/components/Result' 26 | import IconSelector from '@/components/IconSelector' 27 | import TagSelect from '@/components/TagSelect' 28 | import ExceptionPage from '@/components/Exception' 29 | import StandardFormRow from '@/components/StandardFormRow' 30 | import ArticleListContent from '@/components/ArticleListContent' 31 | 32 | export { 33 | AvatarList, 34 | Bar, 35 | ChartCard, 36 | Liquid, 37 | MiniArea, 38 | MiniSmoothArea, 39 | MiniBar, 40 | MiniProgress, 41 | Radar, 42 | TagCloud, 43 | RankList, 44 | TransferBar, 45 | Trend, 46 | CountDown, 47 | Ellipsis, 48 | FooterToolbar, 49 | NumberInfo, 50 | DescriptionList, 51 | // 兼容写法,请勿继续使用 52 | DescriptionList as DetailList, 53 | Tree, 54 | STable, 55 | MultiTab, 56 | Result, 57 | ExceptionPage, 58 | IconSelector, 59 | TagSelect, 60 | StandardFormRow, 61 | ArticleListContent 62 | } 63 | -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | // ie polyfill 2 | import '@babel/polyfill' 3 | 4 | import Vue from 'vue' 5 | import App from './App.vue' 6 | import router from './router' 7 | import store from './store' 8 | import { VueAxios } from './utils/request' 9 | import AppPreBootstrap from '@/core/precise/AppPreBootstrap' 10 | import UrlHelper from '@/core/precise/helpers/UrlHelper' 11 | import AppAuthService from '@/core/precise/auth/AppAuthService' 12 | import SignalRHelper from '@/core/precise/helpers/SignalRHelper' 13 | import { ACCESS_TOKEN } from '@/store/mutation-types' 14 | // mock 15 | import './mock' 16 | 17 | import bootstrap from './core/bootstrap' 18 | import './core/use' 19 | import './permission' // permission control 20 | import './utils/filter' // global filter 21 | 22 | Vue.config.productionTip = false 23 | 24 | // mount axios Vue.$http and this.$http 25 | Vue.use(VueAxios) 26 | 27 | AppPreBootstrap.run(getDocumentOrigin(), () => { 28 | handleLogoutRequest(AppAuthService) 29 | if (Vue.ls.get(ACCESS_TOKEN)) { 30 | SignalRHelper.initSignalR(() => { }) 31 | new Vue({ 32 | router, 33 | store, 34 | created () { 35 | bootstrap() 36 | }, 37 | render: h => h(App) 38 | }).$mount('#app') 39 | } else { 40 | store 41 | .dispatch('GetCurrentLoginInformations') 42 | .then(res => { 43 | new Vue({ 44 | router, 45 | store, 46 | created () { 47 | bootstrap() 48 | }, 49 | render: h => h(App) 50 | }).$mount('#app') 51 | }) 52 | } 53 | }) 54 | 55 | function handleLogoutRequest (authService) { 56 | const currentUrl = UrlHelper.initialUrl 57 | const returnUrl = UrlHelper.getReturnUrl() 58 | if (currentUrl.indexOf(('account/logout')) >= 0 && returnUrl) { 59 | authService.logout(true, returnUrl) 60 | } 61 | } 62 | 63 | function getDocumentOrigin () { 64 | if (!document.location.origin) { 65 | return document.location.protocol + '//' + document.location.hostname + (document.location.port ? ':' + document.location.port : '') 66 | } 67 | return document.location.origin 68 | } -------------------------------------------------------------------------------- /src/core/lazy_lib/components_use.js: -------------------------------------------------------------------------------- 1 | 2 | /* eslint-disable */ 3 | /** 4 | * 该文件是为了按需加载,剔除掉了一些不需要的框架组件。 5 | * 减少了编译支持库包大小 6 | * 7 | * 当需要更多组件依赖时,在该文件加入即可 8 | */ 9 | import Vue from 'vue' 10 | import { 11 | LocaleProvider, 12 | Layout, 13 | Input, 14 | InputNumber, 15 | Button, 16 | Switch, 17 | Radio, 18 | Checkbox, 19 | Select, 20 | Card, 21 | Form, 22 | Row, 23 | Col, 24 | Modal, 25 | Table, 26 | Tabs, 27 | Icon, 28 | Badge, 29 | Popover, 30 | Dropdown, 31 | List, 32 | Avatar, 33 | Breadcrumb, 34 | Steps, 35 | Spin, 36 | Menu, 37 | Drawer, 38 | Tooltip, 39 | Alert, 40 | Tag, 41 | Divider, 42 | DatePicker, 43 | TimePicker, 44 | Upload, 45 | Progress, 46 | Skeleton, 47 | Popconfirm, 48 | message, 49 | notification, 50 | Tree 51 | } from 'ant-design-vue' 52 | // import VueCropper from 'vue-cropper' 53 | 54 | Vue.use(LocaleProvider) 55 | Vue.use(Layout) 56 | Vue.use(Input) 57 | Vue.use(InputNumber) 58 | Vue.use(Button) 59 | Vue.use(Switch) 60 | Vue.use(Radio) 61 | Vue.use(Checkbox) 62 | Vue.use(Select) 63 | Vue.use(Card) 64 | Vue.use(Form) 65 | Vue.use(Row) 66 | Vue.use(Col) 67 | Vue.use(Modal) 68 | Vue.use(Table) 69 | Vue.use(Tabs) 70 | Vue.use(Icon) 71 | Vue.use(Badge) 72 | Vue.use(Popover) 73 | Vue.use(Dropdown) 74 | Vue.use(List) 75 | Vue.use(Avatar) 76 | Vue.use(Breadcrumb) 77 | Vue.use(Steps) 78 | Vue.use(Spin) 79 | Vue.use(Menu) 80 | Vue.use(Drawer) 81 | Vue.use(Tooltip) 82 | Vue.use(Alert) 83 | Vue.use(Tag) 84 | Vue.use(Divider) 85 | Vue.use(DatePicker) 86 | Vue.use(TimePicker) 87 | Vue.use(Upload) 88 | Vue.use(Progress) 89 | Vue.use(Skeleton) 90 | Vue.use(Popconfirm) 91 | // Vue.use(VueCropper) 92 | Vue.use(notification) 93 | Vue.use(Tree) 94 | 95 | Vue.prototype.$confirm = Modal.confirm 96 | Vue.prototype.$message = message 97 | Vue.prototype.$notification = notification 98 | Vue.prototype.$info = Modal.info 99 | Vue.prototype.$success = Modal.success 100 | Vue.prototype.$error = Modal.error 101 | Vue.prototype.$warning = Modal.warning -------------------------------------------------------------------------------- /public/loading/option2/loading.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/components/ArticleListContent/ArticleListContent.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 47 | 48 | 90 | -------------------------------------------------------------------------------- /src/store/precise/permission.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import { 3 | getAllPermissions 4 | } from '@/api/precise/permission' 5 | import { asyncRouterMap, constantRouterMap } from '@/config/router.config' 6 | 7 | function isGrantedAny (...permissions) { 8 | if (!permissions) { 9 | return true 10 | } 11 | for (const permission of permissions) { 12 | if (abp.auth.isGranted(permission)) { 13 | return true 14 | } 15 | } 16 | return false 17 | } 18 | 19 | /** 20 | * 过滤账户是否拥有某一个权限,并将菜单从加载列表移除 21 | * 22 | * @param route 23 | * @returns {boolean} 24 | */ 25 | function hasPermission (route) { 26 | if (route.meta && route.meta.permission) { 27 | return isGrantedAny(route.meta.permission) 28 | } 29 | return true 30 | } 31 | 32 | function filterAsyncRouter (routerMap) { 33 | const accessedRouters = routerMap.filter(route => { 34 | if (hasPermission(route)) { 35 | if (route.children && route.children.length) { 36 | route.children = filterAsyncRouter(route.children) 37 | } 38 | return true 39 | } 40 | return false 41 | }) 42 | return accessedRouters 43 | } 44 | 45 | const permission = { 46 | state: { 47 | routers: constantRouterMap, 48 | addRouters: [] 49 | }, 50 | mutations: { 51 | SET_ROUTERS: (state, routers) => { 52 | state.addRouters = routers 53 | state.routers = constantRouterMap.concat(routers) 54 | } 55 | }, 56 | 57 | actions: { 58 | // 获得所有权限 59 | GetAllPermissions ({ commit }, payload) { 60 | return new Promise((resolve, reject) => { 61 | getAllPermissions(payload).then(response => { 62 | const result = response.result 63 | console.log(result) 64 | resolve() 65 | }).catch(() => { 66 | reject() 67 | }) 68 | }) 69 | }, 70 | // 生成路由 71 | GenerateRoutes ({ commit }) { 72 | return new Promise(resolve => { 73 | const accessedRouters = filterAsyncRouter(asyncRouterMap) 74 | commit('SET_ROUTERS', accessedRouters) 75 | resolve() 76 | }) 77 | } 78 | } 79 | } 80 | 81 | export default permission 82 | -------------------------------------------------------------------------------- /src/api/precise/user.js: -------------------------------------------------------------------------------- 1 | import { axios } from '@/utils/request' 2 | import AppConsts from '@/core/precise/AppConsts' 3 | 4 | export function getUsers (parameter) { 5 | return axios({ 6 | url: AppConsts.remoteServiceBaseUrl + '/api/services/app/User/GetUsers', 7 | method: 'get', 8 | params: parameter 9 | }) 10 | } 11 | 12 | export function getUsersToExcel () { 13 | return axios({ 14 | url: AppConsts.remoteServiceBaseUrl + '/api/services/app/User/GetUsersToExcel', 15 | method: 'get', 16 | }) 17 | } 18 | 19 | export function getUserForEdit (parameter) { 20 | return axios({ 21 | url: AppConsts.remoteServiceBaseUrl + '/api/services/app/User/GetUserForEdit', 22 | method: 'get', 23 | params: parameter 24 | }) 25 | } 26 | 27 | export function getUserPermissionsForEdit (parameter) { 28 | return axios({ 29 | url: AppConsts.remoteServiceBaseUrl + '/api/services/app/User/GetUserPermissionsForEdit', 30 | method: 'get', 31 | params: parameter 32 | }) 33 | } 34 | 35 | export function resetUserSpecificPermissions (parameter) { 36 | return axios({ 37 | url: AppConsts.remoteServiceBaseUrl + '/api/services/app/User/ResetUserSpecificPermissions', 38 | method: 'post', 39 | data: parameter 40 | }) 41 | } 42 | 43 | export function updateUserPermissions (parameter) { 44 | return axios({ 45 | url: AppConsts.remoteServiceBaseUrl + '/api/services/app/User/UpdateUserPermissions', 46 | method: 'put', 47 | data: parameter 48 | }) 49 | } 50 | 51 | export function createOrUpdateUser (parameter) { 52 | return axios({ 53 | url: AppConsts.remoteServiceBaseUrl + '/api/services/app/User/CreateOrUpdateUser', 54 | method: 'post', 55 | data: parameter 56 | }) 57 | } 58 | 59 | export function deleteUser (parameter) { 60 | return axios({ 61 | url: AppConsts.remoteServiceBaseUrl + '/api/services/app/User/DeleteUser', 62 | method: 'delete', 63 | params: parameter 64 | }) 65 | } 66 | 67 | export function unlockUser (parameter) { 68 | return axios({ 69 | url: AppConsts.remoteServiceBaseUrl + '/api/services/app/User/UnlockUser', 70 | method: 'post', 71 | data: parameter 72 | }) 73 | } -------------------------------------------------------------------------------- /public/loading/option2/html_code_segment.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 4 |
5 |
-------------------------------------------------------------------------------- /src/views/account/center/page/Article.vue: -------------------------------------------------------------------------------- 1 | 32 | 33 | 72 | 73 | 76 | -------------------------------------------------------------------------------- /src/utils/mixin.js: -------------------------------------------------------------------------------- 1 | // import Vue from 'vue' 2 | import { deviceEnquire, DEVICE_TYPE } from '@/utils/device' 3 | import { mapState } from 'vuex' 4 | 5 | // const mixinsComputed = Vue.config.optionMergeStrategies.computed 6 | // const mixinsMethods = Vue.config.optionMergeStrategies.methods 7 | 8 | const mixin = { 9 | computed: { 10 | ...mapState({ 11 | layoutMode: state => state.session.layout, 12 | navTheme: state => state.session.theme, 13 | primaryColor: state => state.session.color, 14 | colorWeak: state => state.session.weak, 15 | fixedHeader: state => state.session.fixedHeader, 16 | fixSiderbar: state => state.session.fixSiderbar, 17 | fixSidebar: state => state.session.fixSiderbar, 18 | contentWidth: state => state.session.contentWidth, 19 | autoHideHeader: state => state.session.autoHideHeader, 20 | sidebarOpened: state => state.session.sidebar, 21 | multiTab: state => state.session.multiTab 22 | }) 23 | }, 24 | methods: { 25 | isTopMenu () { 26 | return this.layoutMode === 'topmenu' 27 | }, 28 | isSideMenu () { 29 | return !this.isTopMenu() 30 | } 31 | } 32 | } 33 | 34 | const mixinDevice = { 35 | computed: { 36 | ...mapState({ 37 | device: state => state.session.device 38 | }) 39 | }, 40 | methods: { 41 | isMobile () { 42 | return this.device === DEVICE_TYPE.MOBILE 43 | }, 44 | isDesktop () { 45 | return this.device === DEVICE_TYPE.DESKTOP 46 | }, 47 | isTablet () { 48 | return this.device === DEVICE_TYPE.TABLET 49 | } 50 | } 51 | } 52 | 53 | const AppDeviceEnquire = { 54 | mounted () { 55 | const { $store } = this 56 | deviceEnquire(deviceType => { 57 | switch (deviceType) { 58 | case DEVICE_TYPE.DESKTOP: 59 | $store.commit('TOGGLE_DEVICE', 'desktop') 60 | $store.dispatch('setSidebar', true) 61 | break 62 | case DEVICE_TYPE.TABLET: 63 | $store.commit('TOGGLE_DEVICE', 'tablet') 64 | $store.dispatch('setSidebar', false) 65 | break 66 | case DEVICE_TYPE.MOBILE: 67 | default: 68 | $store.commit('TOGGLE_DEVICE', 'mobile') 69 | $store.dispatch('setSidebar', true) 70 | break 71 | } 72 | }) 73 | } 74 | } 75 | 76 | export { mixin, AppDeviceEnquire, mixinDevice } 77 | -------------------------------------------------------------------------------- /src/api/precise/organizationUnit.js: -------------------------------------------------------------------------------- 1 | import { axios } from '@/utils/request' 2 | import AppConsts from '@/core/precise/AppConsts' 3 | 4 | export function getOrganizationUnits () { 5 | return axios({ 6 | url: AppConsts.remoteServiceBaseUrl + '/api/services/app/OrganizationUnit/GetOrganizationUnits', 7 | method: 'get', 8 | }) 9 | } 10 | 11 | export function getOrganizationUnitUsers (parameter) { 12 | return axios({ 13 | url: AppConsts.remoteServiceBaseUrl + '/api/services/app/OrganizationUnit/getOrganizationUnitUsers', 14 | method: 'get', 15 | params: parameter 16 | }) 17 | } 18 | 19 | export function createOrganizationUnit (parameter) { 20 | return axios({ 21 | url: AppConsts.remoteServiceBaseUrl + '/api/services/app/OrganizationUnit/CreateOrganizationUnit', 22 | method: 'post', 23 | data: parameter 24 | }) 25 | } 26 | 27 | export function updateOrganizationUnit (parameter) { 28 | return axios({ 29 | url: AppConsts.remoteServiceBaseUrl + '/api/services/app/OrganizationUnit/UpdateOrganizationUnit', 30 | method: 'put', 31 | data: parameter 32 | }) 33 | } 34 | 35 | export function moveOrganizationUnit (parameter) { 36 | return axios({ 37 | url: AppConsts.remoteServiceBaseUrl + '/api/services/app/OrganizationUnit/MoveOrganizationUnit', 38 | method: 'post', 39 | data: parameter 40 | }) 41 | } 42 | 43 | export function deleteOrganizationUnit (parameter) { 44 | return axios({ 45 | url: AppConsts.remoteServiceBaseUrl + '/api/services/app/OrganizationUnit/DeleteOrganizationUnit', 46 | method: 'delete', 47 | params: parameter 48 | }) 49 | } 50 | 51 | export function removeUserFromOrganizationUnit (parameter) { 52 | return axios({ 53 | url: AppConsts.remoteServiceBaseUrl + '/api/services/app/OrganizationUnit/RemoveUserFromOrganizationUnit', 54 | method: 'delete', 55 | params: parameter 56 | }) 57 | } 58 | 59 | export function addUsersToOrganizationUnit (parameter) { 60 | return axios({ 61 | url: AppConsts.remoteServiceBaseUrl + '/api/services/app/OrganizationUnit/AddUsersToOrganizationUnit', 62 | method: 'post', 63 | data: parameter 64 | }) 65 | } 66 | 67 | export function findUsers (parameter) { 68 | return axios({ 69 | url: AppConsts.remoteServiceBaseUrl + '/api/services/app/OrganizationUnit/FindUsers', 70 | method: 'post', 71 | data: parameter 72 | }) 73 | } -------------------------------------------------------------------------------- /src/components/AvatarList/index.md: -------------------------------------------------------------------------------- 1 | # AvatarList 用户头像列表 2 | 3 | 4 | 一组用户头像,常用在项目/团队成员列表。可通过设置 `size` 属性来指定头像大小。 5 | 6 | 7 | 8 | 引用方式: 9 | 10 | ```javascript 11 | import AvatarList from '@/components/AvatarList' 12 | const AvatarListItem = AvatarList.AvatarItem 13 | 14 | export default { 15 | components: { 16 | AvatarList, 17 | AvatarListItem 18 | } 19 | } 20 | ``` 21 | 22 | 23 | 24 | ## 代码演示 [demo](https://pro.loacg.com/test/home) 25 | 26 | ```html 27 | 28 | 29 | 30 | 31 | 32 | ``` 33 | 或 34 | ```html 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | ``` 45 | 46 | 47 | 48 | ## API 49 | 50 | ### AvatarList 51 | 52 | | 参数 | 说明 | 类型 | 默认值 | 53 | | ---------------- | -------- | ---------------------------------- | --------- | 54 | | size | 头像大小 | `large`、`small` 、`mini`, `default` | `default` | 55 | | maxLength | 要显示的最大项目 | number | - | 56 | | excessItemsStyle | 多余的项目风格 | CSSProperties | - | 57 | 58 | ### AvatarList.Item 59 | 60 | | 参数 | 说明 | 类型 | 默认值 | 61 | | ---- | ------ | --------- | --- | 62 | | tips | 头像展示文案 | string | - | 63 | | src | 头像图片连接 | string | - | 64 | 65 | -------------------------------------------------------------------------------- /src/components/tools/UserMenu.vue: -------------------------------------------------------------------------------- 1 | 44 | 45 | 81 | -------------------------------------------------------------------------------- /src/store/precise/notification.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import { 3 | getUserNotifications, 4 | setAllNotificationsAsRead, 5 | setNotificationAsRead, 6 | getNotificationSettings, 7 | updateNotificationSettings, 8 | deleteNotification 9 | } from '@/api/precise/notification' 10 | 11 | const notification = { 12 | state: { 13 | }, 14 | mutations: { 15 | }, 16 | 17 | actions: { 18 | // 获取用户通知 19 | GetUserNotifications ({ commit }, payload) { 20 | return new Promise((resolve, reject) => { 21 | getUserNotifications(payload).then(response => { 22 | const result = response.result 23 | 24 | resolve() 25 | }).catch(() => { 26 | reject() 27 | }) 28 | }) 29 | }, 30 | // 将所有通知设置为已读 31 | SetAllNotificationsAsRead ({ commit }) { 32 | return new Promise((resolve, reject) => { 33 | setAllNotificationsAsRead().then(response => { 34 | const result = response.result 35 | 36 | resolve() 37 | }).catch(() => { 38 | reject() 39 | }) 40 | }) 41 | }, 42 | // 将通知设置为已读 43 | SetNotificationAsRead ({ commit }, payload) { 44 | return new Promise((resolve, reject) => { 45 | setNotificationAsRead(payload).then(response => { 46 | const result = response.result 47 | 48 | resolve() 49 | }).catch(() => { 50 | reject() 51 | }) 52 | }) 53 | }, 54 | // 获取通知设置 55 | GetNotificationSettings ({ commit }) { 56 | return new Promise((resolve, reject) => { 57 | getNotificationSettings().then(response => { 58 | const result = response.result 59 | 60 | resolve() 61 | }).catch(() => { 62 | reject() 63 | }) 64 | }) 65 | }, 66 | // 更新通知设置 67 | UpdateNotificationSettings ({ commit }, payload) { 68 | return new Promise((resolve, reject) => { 69 | updateNotificationSettings(payload).then(response => { 70 | const result = response.result 71 | 72 | resolve() 73 | }).catch(() => { 74 | reject() 75 | }) 76 | }) 77 | }, 78 | // 删除通知 79 | DeleteNotification ({ commit }, payload) { 80 | return new Promise((resolve, reject) => { 81 | deleteNotification(payload).then(response => { 82 | const result = response.result 83 | 84 | resolve() 85 | }).catch(() => { 86 | reject() 87 | }) 88 | }) 89 | }, 90 | } 91 | } 92 | 93 | export default notification 94 | -------------------------------------------------------------------------------- /src/permission.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import router from './router' 3 | import store from './store' 4 | 5 | import NProgress from 'nprogress' // progress bar 6 | import 'nprogress/nprogress.css' // progress bar style 7 | import notification from 'ant-design-vue/es/notification' 8 | import { setDocumentTitle, domTitle } from '@/utils/domUtil' 9 | import { ACCESS_TOKEN } from '@/store/mutation-types' 10 | 11 | NProgress.configure({ showSpinner: false }) // NProgress Configuration 12 | 13 | const whiteList = ['login', 'register', 'registerResult'] // no redirect whitelist 14 | 15 | router.beforeEach((to, from, next) => { 16 | NProgress.start() // start progress bar 17 | to.meta && (typeof to.meta.title !== 'undefined' && setDocumentTitle(`${to.meta.title} - ${domTitle}`)) 18 | if (Vue.ls.get(ACCESS_TOKEN)) { 19 | /* has token */ 20 | if (to.path === '/account/login') { 21 | next({ path: '/dashboard/workplace' }) 22 | NProgress.done() 23 | } else { 24 | if (store.getters.appSession.user === undefined) { 25 | store 26 | .dispatch('GetCurrentLoginInformations') 27 | .then(res => { 28 | store.dispatch('GenerateRoutes').then(() => { 29 | // 动态添加可访问路由表 30 | router.addRoutes(store.getters.addRouters) 31 | const redirect = decodeURIComponent(from.query.redirect || to.path) 32 | if (to.path === redirect) { 33 | // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record 34 | next({ ...to, replace: true }) 35 | } else { 36 | // 跳转到目的路由 37 | next({ path: redirect }) 38 | } 39 | }) 40 | }) 41 | .catch(() => { 42 | notification.error({ 43 | message: '错误', 44 | description: '请求用户信息失败,请重试' 45 | }) 46 | store.dispatch('Logout').then(() => { 47 | next({ path: '/account/login', query: { redirect: to.fullPath } }) 48 | }) 49 | }) 50 | } else { 51 | next() 52 | } 53 | } 54 | } else { 55 | if (whiteList.includes(to.name)) { 56 | // 在免登录白名单,直接进入 57 | next() 58 | } else { 59 | next({ path: '/account/login', query: { redirect: to.fullPath } }) 60 | NProgress.done() // if current page is login will not trigger afterEach hook, so manually handle it 61 | } 62 | } 63 | }) 64 | 65 | router.afterEach(() => { 66 | NProgress.done() // finish progress bar 67 | }) 68 | -------------------------------------------------------------------------------- /src/components/Result/Result.vue: -------------------------------------------------------------------------------- 1 | 24 | 25 | 59 | 60 | 110 | -------------------------------------------------------------------------------- /src/components/CountDown/CountDown.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 99 | 100 | 103 | -------------------------------------------------------------------------------- /src/components/tools/TwoStepCaptcha.vue: -------------------------------------------------------------------------------- 1 | 40 | 41 | 83 | 90 | -------------------------------------------------------------------------------- /src/components/AvatarList/List.vue: -------------------------------------------------------------------------------- 1 | 17 | 18 | 100 | -------------------------------------------------------------------------------- /src/views/account/noticeIcon/Index.vue: -------------------------------------------------------------------------------- 1 | 22 | 23 | 85 | 86 | 88 | -------------------------------------------------------------------------------- /src/components/Charts/ChartCard.vue: -------------------------------------------------------------------------------- 1 | 32 | 33 | 53 | 54 | 121 | -------------------------------------------------------------------------------- /src/components/Exception/ExceptionPage.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 40 | 131 | -------------------------------------------------------------------------------- /src/views/admin/organization/modules/CreateOrEditForm.vue: -------------------------------------------------------------------------------- 1 | 25 | 26 | -------------------------------------------------------------------------------- /src/components/TagSelect/index.jsx: -------------------------------------------------------------------------------- 1 | import PropTypes from 'ant-design-vue/es/_util/vue-types' 2 | import Option from './TagSelectOption.jsx' 3 | import { filterEmpty } from '@/components/_util/util' 4 | 5 | export default { 6 | Option, 7 | name: 'TagSelect', 8 | model: { 9 | prop: 'checked', 10 | event: 'change' 11 | }, 12 | props: { 13 | prefixCls: { 14 | type: String, 15 | default: 'ant-pro-tag-select' 16 | }, 17 | defaultValue: { 18 | type: PropTypes.array, 19 | default: null 20 | }, 21 | value: { 22 | type: PropTypes.array, 23 | default: null 24 | }, 25 | expandable: { 26 | type: Boolean, 27 | default: false 28 | }, 29 | hideCheckAll: { 30 | type: Boolean, 31 | default: false 32 | } 33 | }, 34 | data () { 35 | return { 36 | expand: false, 37 | localCheckAll: false, 38 | items: this.getItemsKey(filterEmpty(this.$slots.default)), 39 | val: this.value || this.defaultValue || [] 40 | } 41 | }, 42 | methods: { 43 | onChange (checked) { 44 | const key = Object.keys(this.items).filter(key => key === checked.value) 45 | this.items[key] = checked.checked 46 | const bool = Object.values(this.items).lastIndexOf(false) 47 | if (bool === -1) { 48 | this.localCheckAll = true 49 | } else { 50 | this.localCheckAll = false 51 | } 52 | }, 53 | onCheckAll (checked) { 54 | Object.keys(this.items).forEach(v => { 55 | this.items[v] = checked.checked 56 | }) 57 | this.localCheckAll = checked.checked 58 | }, 59 | getItemsKey (items) { 60 | const totalItem = {} 61 | items.forEach(item => { 62 | totalItem[item.componentOptions.propsData && item.componentOptions.propsData.value] = false 63 | }) 64 | return totalItem 65 | }, 66 | // CheckAll Button 67 | renderCheckAll () { 68 | return !this.hideCheckAll && () || null 69 | }, 70 | // expandable 71 | renderExpandable () { 72 | 73 | }, 74 | // render option 75 | renderTags (items) { 76 | const listeners = { 77 | change: (checked) => { 78 | this.onChange(checked) 79 | this.$emit('change', checked) 80 | } 81 | } 82 | 83 | return items.map(vnode => { 84 | const options = vnode.componentOptions 85 | options.listeners = listeners 86 | return vnode 87 | }) 88 | } 89 | }, 90 | render () { 91 | const { $props: { prefixCls } } = this 92 | const classString = { 93 | [`${prefixCls}`]: true 94 | } 95 | const tagItems = filterEmpty(this.$slots.default) 96 | return ( 97 |
98 | {this.renderCheckAll()} 99 | {this.renderTags(tagItems)} 100 |
101 | ) 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /src/components/SettingDrawer/settingConfig.js: -------------------------------------------------------------------------------- 1 | import { message } from 'ant-design-vue/es' 2 | // import defaultSettings from '../defaultSettings'; 3 | import themeColor from './themeColor.js' 4 | 5 | // let lessNodesAppended 6 | 7 | const colorList = [ 8 | { 9 | key: '薄暮', color: '#F5222D' 10 | }, 11 | { 12 | key: '火山', color: '#FA541C' 13 | }, 14 | { 15 | key: '日暮', color: '#FAAD14' 16 | }, 17 | { 18 | key: '明青', color: '#13C2C2' 19 | }, 20 | { 21 | key: '极光绿', color: '#52C41A' 22 | }, 23 | { 24 | key: '拂晓蓝(默认)', color: '#1890FF' 25 | }, 26 | { 27 | key: '极客蓝', color: '#2F54EB' 28 | }, 29 | { 30 | key: '酱紫', color: '#722ED1' 31 | } 32 | ] 33 | 34 | const updateTheme = newPrimaryColor => { 35 | const hideMessage = message.loading('正在切换主题!', 0) 36 | themeColor.changeColor(newPrimaryColor).finally(t => { 37 | hideMessage() 38 | }) 39 | } 40 | 41 | /* 42 | const updateTheme = primaryColor => { 43 | // Don't compile less in production! 44 | /* if (process.env.NODE_ENV === 'production') { 45 | return; 46 | } * / 47 | // Determine if the component is remounted 48 | if (!primaryColor) { 49 | return 50 | } 51 | const hideMessage = message.loading('正在编译主题!', 0) 52 | function buildIt () { 53 | if (!window.less) { 54 | return 55 | } 56 | setTimeout(() => { 57 | window.less 58 | .modifyVars({ 59 | '@primary-color': primaryColor 60 | }) 61 | .then(() => { 62 | hideMessage() 63 | }) 64 | .catch(() => { 65 | message.error('Failed to update theme') 66 | hideMessage() 67 | }) 68 | }, 200) 69 | } 70 | if (!lessNodesAppended) { 71 | // insert less.js and color.less 72 | const lessStyleNode = document.createElement('link') 73 | const lessConfigNode = document.createElement('script') 74 | const lessScriptNode = document.createElement('script') 75 | lessStyleNode.setAttribute('rel', 'stylesheet/less') 76 | lessStyleNode.setAttribute('href', '/color.less') 77 | lessConfigNode.innerHTML = ` 78 | window.less = { 79 | async: true, 80 | env: 'production', 81 | javascriptEnabled: true 82 | }; 83 | ` 84 | lessScriptNode.src = 'https://gw.alipayobjects.com/os/lib/less.js/3.8.1/less.min.js' 85 | lessScriptNode.async = true 86 | lessScriptNode.onload = () => { 87 | buildIt() 88 | lessScriptNode.onload = null 89 | } 90 | document.body.appendChild(lessStyleNode) 91 | document.body.appendChild(lessConfigNode) 92 | document.body.appendChild(lessScriptNode) 93 | lessNodesAppended = true 94 | } else { 95 | buildIt() 96 | } 97 | } 98 | */ 99 | 100 | const updateColorWeak = colorWeak => { 101 | // document.body.className = colorWeak ? 'colorWeak' : ''; 102 | colorWeak ? document.body.classList.add('colorWeak') : document.body.classList.remove('colorWeak') 103 | } 104 | 105 | export { updateTheme, colorList, updateColorWeak } 106 | -------------------------------------------------------------------------------- /src/mock/dataapi/article.js: -------------------------------------------------------------------------------- 1 | import Mock from 'mockjs2' 2 | import { builder, getQueryParameters } from '../util' 3 | 4 | const titles = [ 5 | 'Alipay', 6 | 'Angular', 7 | 'Ant Design', 8 | 'Ant Design Pro', 9 | 'Bootstrap', 10 | 'React', 11 | 'Vue', 12 | 'Webpack' 13 | ] 14 | 15 | const avatar = ['https://gw.alipayobjects.com/zos/rmsportal/WdGqmHpayyMjiEhcKoVE.png', 16 | 'https://gw.alipayobjects.com/zos/rmsportal/zOsKZmFRdUtvpqCImOVY.png', 17 | 'https://gw.alipayobjects.com/zos/rmsportal/dURIMkkrRFpPgTuzkwnB.png', 18 | 'https://gw.alipayobjects.com/zos/rmsportal/sfjbOqnsXXJgNCjCzDBL.png', 19 | 'https://gw.alipayobjects.com/zos/rmsportal/siCrBXXhmvTQGWPNLBow.png' 20 | ] 21 | 22 | const covers = [ 23 | 'https://gw.alipayobjects.com/zos/rmsportal/uMfMFlvUuceEyPpotzlq.png', 24 | 'https://gw.alipayobjects.com/zos/rmsportal/iZBVOIhGJiAnhplqjvZW.png', 25 | 'https://gw.alipayobjects.com/zos/rmsportal/iXjVmWVHbCJAyqvDxdtx.png', 26 | 'https://gw.alipayobjects.com/zos/rmsportal/gLaIAoVWTtLbBWZNYEMg.png' 27 | ] 28 | 29 | const owner = [ 30 | '付小小', 31 | '吴加好', 32 | '周星星', 33 | '林东东', 34 | '曲丽丽' 35 | ] 36 | 37 | const content = '段落示意:蚂蚁金服设计平台 ant.design,用最小的工作量,无缝接入蚂蚁金服生态,提供跨越设计与开发的体验解决方案。蚂蚁金服设计平台 ant.design,用最小的工作量,无缝接入蚂蚁金服生态,提供跨越设计与开发的体验解决方案。' 38 | const description = '在中台产品的研发过程中,会出现不同的设计规范和实现方式,但其中往往存在很多类似的页面和组件,这些类似的组件会被抽离成一套标准规范。' 39 | const href = 'https://ant.design' 40 | 41 | const article = (options) => { 42 | const queryParameters = getQueryParameters(options) 43 | console.log('queryParameters', queryParameters) 44 | if (queryParameters && !queryParameters.count) { 45 | queryParameters.count = 5 46 | } 47 | const data = [] 48 | for (let i = 0; i < queryParameters.count; i++) { 49 | const tmpKey = i + 1 50 | const num = parseInt(Math.random() * (4 + 1), 10) 51 | data.push({ 52 | id: tmpKey, 53 | avatar: avatar[num], 54 | owner: owner[num], 55 | content: content, 56 | star: Mock.mock('@integer(1, 999)'), 57 | percent: Mock.mock('@integer(1, 999)'), 58 | like: Mock.mock('@integer(1, 999)'), 59 | message: Mock.mock('@integer(1, 999)'), 60 | description: description, 61 | href: href, 62 | title: titles[ i % 8 ], 63 | updatedAt: Mock.mock('@datetime'), 64 | members: [ 65 | { 66 | avatar: 'https://gw.alipayobjects.com/zos/rmsportal/ZiESqWwCXBRQoaPONSJe.png', 67 | name: '曲丽丽', 68 | id: 'member1' 69 | }, 70 | { 71 | avatar: 'https://gw.alipayobjects.com/zos/rmsportal/tBOxZPlITHqwlGjsJWaF.png', 72 | name: '王昭君', 73 | id: 'member2' 74 | }, 75 | { 76 | avatar: 'https://gw.alipayobjects.com/zos/rmsportal/sBxjgqiuHMGRkIjqlQCd.png', 77 | name: '董娜娜', 78 | id: 'member3' 79 | } 80 | ], 81 | activeUser: Math.ceil(Math.random() * 100000) + 100000, 82 | newUser: Math.ceil(Math.random() * 1000) + 1000, 83 | cover: parseInt(i / 4, 10) % 2 === 0 ? covers[i % 4] : covers[3 - (i % 4)] 84 | }) 85 | } 86 | return builder(data) 87 | } 88 | 89 | Mock.mock(/\/list\/article/, 'get', article) 90 | -------------------------------------------------------------------------------- /src/components/Charts/TagCloud.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 114 | -------------------------------------------------------------------------------- /src/views/account/center/page/Project.vue: -------------------------------------------------------------------------------- 1 | 30 | 31 | 76 | 77 | 110 | -------------------------------------------------------------------------------- /src/components/StandardFormRow/StandardFormRow.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 52 | 53 | 123 | -------------------------------------------------------------------------------- /src/views/account/center/page/App.vue: -------------------------------------------------------------------------------- 1 | 59 | 60 | 81 | 82 | 114 | -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | abp-vue-antd 12 | 108 | 109 | 110 | 111 | 115 |
116 |
117 |
118 | 119 |
120 |
121 |
122 | 123 | 124 | 125 | -------------------------------------------------------------------------------- /src/views/admin/users/modules/EditUserPermissions.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 100 | -------------------------------------------------------------------------------- /src/components/DescriptionList/DescriptionList.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 79 | 80 | 154 | --------------------------------------------------------------------------------