This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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>`, |
NewerOlder