This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Created by giscafer on 2017/3/15. | |
*/ | |
import {Component} from '@angular/core'; | |
import {UIChart} from 'primeng/primeng'; | |
@Component({ | |
selector: 'cool-chart', | |
template:`<p-chart type="bar" [data]="data" [options]="options"></p-chart>`, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Created by giscafer on 2017/4/15. | |
* 复制源码修改覆盖 | |
* 添加事件延迟,支持中文输入 | |
*/ | |
import { | |
NgModule, | |
Component, | |
ViewChild, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* let formData = new FormData(); | |
* for (let i = 0; i < this.files.length; i++) { | |
formData.append("file", this.files[i], this.files[i].name); | |
} | |
*/ | |
uploadPic(formData){ | |
let jwt = localStorage["jwt"]; | |
/*let headers = new Headers({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 删除图片 | |
* @param args | |
*/ | |
exports.onPictureDelete = function (args) { | |
var result = [], flag = false; | |
var imgId = args.object.imgId; | |
var imageItems = list_view.bindingContext.imageItems; | |
var pickImgArr = [model.UPLOAD_BTN_IMG]; | |
if (imageItems.length == signPicNumber && maxPicture) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* base64 转 二进制文件 | |
* dataURL to blob, ref to https://gist.github.com/fupslot/5015897 | |
* @param dataURI | |
* @returns {Blob} | |
*/ | |
export function dataURItoBlob(dataURI) { | |
var byteString = atob(dataURI.split(',')[1]); | |
var mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0]; | |
var ab = new ArrayBuffer(byteString.length); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Created by giscafer on 2017/5/6. | |
*/ | |
/** | |
* 相册图片单选 | |
*/ | |
var imagepicker = require("nativescript-imagepicker"); | |
var fs = require('file-system'); | |
var dialogs = require("ui/dialogs"); | |
var enums = require("ui/enums"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 父子关系的原始数据格式化成树形结构数据 | |
* @param {Array<Object>} data 原始数据 | |
* @return {Array<Object>} 树形结构数据 | |
*/ | |
export function dataToTree(data) { | |
/*tslint:disable*/ | |
let pos = {}, | |
tree = [], | |
i = 0, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var geoCoordMap = { | |
'广州': [113.5107,23.2196], | |
'北京': [116.4551,40.2539], | |
'天津': [117.4219,39.4189], | |
'上海': [121.4648,31.2891], | |
'重庆': [106.557165,29.563206], | |
'河北': [114.508958,38.066606], | |
'河南': [113.673367,34.748062], | |
'云南': [102.721896,25.047632], | |
'辽宁': [123.445621,41.806698], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var currying = function(fn) { | |
var _weight = 0; | |
var _args = []; | |
return function() { | |
if (!arguments.length) { | |
return fn.apply(this, _args); | |
} else { | |
Array.prototype.push.apply(_args, arguments); | |
return arguments.callee; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 类的封装和信息的隐藏 | |
* | |
* 本例子使用闭包来实现静态变量熟悉和方法,通过创建一个受保护的变量空间,可以实现公用、私用和特权成员,以及 | |
* 静态成员和常量。 | |
* | |
* 概念: | |
* 1、特权方法(privileged method) 指有权访问私有变量和私有函数的公有方法 | |
* 2、非特权方法(non-privileged method) 指无需(或没有权限)访问私有变量和私有函数的公有方法 | |
* |
OlderNewer