0.1.2 • Published 8 months ago

zpub_bas v0.1.2

Weekly downloads
2
License
ISC
Repository
-
Last release
8 months ago

/// 导入常用封装的对象 import zb from 'zpub_bas/zb.js' window.zb = zb; 使用 !zb.TextUtil.isEmpty(this.data.srcs)

// 动态加载,异步处理保留扩展性 // const mods = require('@/' + filePath) const mods = await import('/src/' + filePath)

isNaN(item.subtime)

#注意事项 1:Framwork层只存放Util相关工具类和slot层和manager,constant,method通用层:适合于react和vue和uniapp以及web端,可以弃用uniapp

2:注意:不需要依赖第三方库

3:注意:即使是添加工具类也不需要依赖第三方库,含有第三方库封装的工具类在其他模块中添加

4:注意:添加类时需要包含头部注释,方法注释,参数注释,每个方法需要经过测试过才可添加

5:注意:zpub_base的添加适用A类型项目,B类型项目,C类型项目 即不同类型的项目通用的类

6:注意:适用于react和vue和web端

7:删除 node_modules 安装 rimraf npm install rimraf -g // 使用命令删除 rimraf node_modules // 也可以删除其它文件夹或文件

8:考虑web,移动端,小程序,react

9:考虑和web端进行融合去使用,大量的工作用他们的东西就可以,节省我们app的人力

10:融合web上的三维上的东西

#使用方法 npm install zpub_bas

#上传方法 1:npm login

Username: zhengchaojun Password: Email: (this IS public) zhengchaojun@whzbcx.com

2:npm publish :如果报错则换个名称

// #ifdef H5 || APP-PLUS uni.downloadFile({ url: 'https://www.camining.net/dm_image/QRCode.png', //下载地址,后端接口获取的链接 success: (data) => {

},
fail: (err) => {
	 
},

}); // #endif // #ifdef MP-WEIXIN || APP-PLUS let path = /pages/index/index?save=true; // #endif

其他:

1.改变展示顺序 2.加上登录注册页面 3.加上意见反馈功能 4.提供一个二维码,供PC端扫码后进入登录 5.在每个word和pdf文件下加入免责的一个声明 6.权限的管理,添加页面需要审核,未登录状态下只能浏览(已经模拟了) 7、打包微信小程序 8、属性能够动态生成 9、声明成全局变量

? /**

  • 解析缓存数据
  • @static
  • @method
  • @param {Array} data 数据 */ static parseCache(data) { let key, objs, obj, data2, cols2, type2

    //缓存数据 for (key in data) { obj = datakey data2 = obj.data cols2 = obj.cols type2 = obj.types

    if (data2 && cols2 && type2)
    {
      data[key] = this.parseData(data2, cols2, type2)
      delete obj.cols
      delete obj.types
    }

    }

    //权限数据 if (data.access) { if (data.access.compress) { cols2 = data.access.compress.cols type2 = data.access.compress.types objs = data.access.obj for (key in objs) { obj = objskey if (obj && obj.length > 0 && typeof obj0 === 'string') objskey = this.parseData(objskey, cols2, type2) } } } }

    /**

  • 解析缓存数据

  • @static
  • @method
  • @param {Array} data 数据
  • @param {String} cols 列名
  • @param {String} types 类型数据
  • @returns {Array} 返回解析后的数据 */ static parseData(data, cols, types) { let ret = [] let obj, jsonTem let arrtype, arrcol, arrdata, value let i, il, j, jl

    arrtype = types.split(',') arrcol = cols.split(',') jl = arrtype.length for (i = 0, il = data.length; i < il; i++) { arrdata = datai.split(';') obj = {} for (j = 0; j < jl; j++) { value = arrdataj switch (arrtypej) { case 'i': obj[arrcolj] = value === '' ? 0 : parseInt(value) break case 'r': obj[arrcolj] = value === '' ? 0 : parseFloat(value) break case 's': try { jsonTem = JSON.parse(value) if (typeof jsonTem == 'object' && jsonTem) obj[arrcolj] = jsonTem else obj[arrcolj] = value } catch (e) { obj[arrcolj] = value } break default: obj[arrcolj] = value break } } ret.push(obj) }

    return ret } /**

  • 解析缓存数据

  • @static
  • @method
  • @param {Array} data 数据 */ static parseCache(data) { let key, objs, obj, data2, cols2, type2

    //缓存数据 for (key in data) { obj = datakey data2 = obj.data cols2 = obj.cols type2 = obj.types

    if (data2 && cols2 && type2)
    {
      data[key] = this.parseData(data2, cols2, type2)
      delete obj.cols
      delete obj.types
    }

    }

    //权限数据 if (data.access) { if (data.access.compress) { cols2 = data.access.compress.cols type2 = data.access.compress.types objs = data.access.obj for (key in objs) { obj = objskey if (obj && obj.length > 0 && typeof obj0 === 'string') objskey = this.parseData(objskey, cols2, type2) } } } }

    /**

  • 解析缓存数据

  • @static
  • @method
  • @param {Array} data 数据
  • @param {String} cols 列名
  • @param {String} types 类型数据
  • @returns {Array} 返回解析后的数据 */ static parseData(data, cols, types) { let ret = [] let obj, jsonTem let arrtype, arrcol, arrdata, value let i, il, j, jl

    arrtype = types.split(',') arrcol = cols.split(',') jl = arrtype.length for (i = 0, il = data.length; i < il; i++) { arrdata = datai.split(';') obj = {} for (j = 0; j < jl; j++) { value = arrdataj switch (arrtypej) { case 'i': obj[arrcolj] = value === '' ? 0 : parseInt(value) break case 'r': obj[arrcolj] = value === '' ? 0 : parseFloat(value) break case 's': try { jsonTem = JSON.parse(value) if (typeof jsonTem == 'object' && jsonTem) obj[arrcolj] = jsonTem else obj[arrcolj] = value } catch (e) { obj[arrcolj] = value } break default: obj[arrcolj] = value break } } ret.push(obj) }

    return ret }

0.1.2

8 months ago

0.1.1

2 years ago

0.1.0

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago