代码拉取完成,页面将自动刷新
因为vue-antd-admin引入了一些我不太喜欢的玩意 所以使用TS+VUE+ANTD重构了这个版本
router
文件夹下面,children
文件里面配置了所有侧边栏菜单,并作了分组;
使用示例如下:{
group:'opreations',
groupIcon:"info-circle",
title:"操作",
children:[
{
path: '/from',
name: 'From',
meta: {
auth: true,
title: '操作表单',
icon: 'form',
},
component: () => import('@/views/pages/From.vue')
}
]
}
在tools
里面有一个config.ts
有一个语法糖,这里可以配置项目是dev
还是product
,你可以在这里面添加相应的参数,比如连接本地调试时的url
,线上的url
等等。
在tools
中有一个message.ts
这里面有一些通常使用的网络状态,你可以使用他们来为你的项目创建更好的用户交互。
名称 | 依赖 | 功能 |
---|---|---|
g2 | yarn add / npm i / cnpm i @antv/g2 | 图表 |
data-set | yarn add / npm i / cnpm i @antv/data-set | 图表 |
velocity-animate | yarn add / npm i / cnpm i @types/velocity-animate | 动画 |
lodash | yarn add / npm i / cnpm i @types/lodash | 工具库 |
animejs | yarn add / npm i / cnpm i @types/animejs | 动画 |
jsonp | yarn add / npm i / cnpm i @types/jsonp | ajax |
nprogress | yarn add / npm i / cnpm i nprogress | 进度条 |
xlsx | yarn add / npm i / cnpm i xlsx | Execl |
ol | yarn add / npm i / cnpm i ol | openlayer |
axios | yarn add / npm i / cnpm i axios | ajax |
export default class Tools {
// 判断是否是浏览器环境
public inBrowser = typeof window !== 'undefined';
// 获取浏览器ua
public UA = this.inBrowser && window.navigator.userAgent.toLowerCase();
// 当前浏览器是否是ie
public isIE = this.UA && /msie|trident/.test(this.UA);
//当前浏览器是ie9
public isIE9 = this.UA && this.UA.indexOf('msie 9.0') > 0;
// 当前浏览器是edge
public isEdge = this.UA && this.UA.indexOf('edge/') > 0;
//当前浏览器是android
public isAndroid = (this.UA && this.UA.indexOf('android') > 0);
// 当前浏览器是ios
public isIOS = (this.UA && /iphone|ipad|ipod|ios/.test(this.UA));
// 当前浏览器是chrome
public isChrome = this.UA && /chrome\/\d+/.test(this.UA) && !this.isEdge;
// 当前环境是phantomjs
public isPhantomJS = this.UA && /phantomjs/.test(this.UA);
// 当前浏览器是火狐
public isFF = this.UA && this.UA.match(/firefox\/(\d+)/);
// 对象是否存在__proto__
public hasProto = '__proto__' in {};
// 判断变量是否是undefined
public isUndef(v: any) {
return v === undefined || v === null
}
//判断变量是否已经定义
public isDef(v: any) {
return v !== undefined && v !== null
}
// 判断变量是否为真
public isTrue(v: any) {
return v === true
}
// 判断变量是否为假
public isFalse(v: any) {
return v === false
}
// 判断变量是否是对象
public isObject(obj: any) {
return obj !== null && typeof obj === 'object'
}
// 判断变量是否是正则
public isRegExp(v: any) {
return Object.prototype.toString.call(v) === '[object RegExp]'
}
// 判断变量是否是Promise
public isPromise(val: any) {
return (
this.isDef(val) &&
typeof val.then === 'function' &&
typeof val.catch === 'function'
)
}
// 转化number
public toNumber(val: any, type: string) {
if (this.isUndef(type) || type === "float" || type === "double") {
let n = parseFloat(val);
return isNaN(n) ? val : n;
} else {
let n = parseInt(val);
return isNaN(n) ? val : n;
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
1. 开源生态
2. 协作、人、软件
3. 评估模型