提交 25e25abd 编写于 作者: VK1688's avatar VK1688

1.7.3

上级 7f36d57b
* 1、【升级】`vk-unicloud-admin-ui` 包升级至 `1.7.5`
* 2、【修复】`万能表单` `tree-select` 点击清除按钮会报错的问题
* 1、【升级】`vk-unicloud-admin-ui` 包升级至 `1.7.6`
* 2、【优化】`万能表单` `radio` `checkbox` `select` `cascader` `tree-select``data` 静态模式数据源 支持 `function` 模式 [点击查看](https://vkdoc.fsq.pub/admin/components/9%E3%80%81select.html#%E9%9D%99%E6%80%81%E6%95%B0%E6%8D%AE%E6%96%B9%E5%BC%8F2)
* 3、【修复】`万能表单` `tree-select` 点击清除按钮可能会报错的问题。
##### 框架更新步骤 [点击查看](https://vkdoc.fsq.pub/admin/1/update.html)
##### 框架学习Q群:`22466457` 欢迎萌新和大佬来使用和共同改进框架
......
## 1.7.3(2021-11-09)
* 1、【升级】`vk-unicloud-admin-ui` 包升级至 `1.7.6`
* 2、【优化】`万能表单` `radio` `checkbox` `select` `cascader` `tree-select``data` 静态模式数据源 支持 `function` 模式 [点击查看](https://vkdoc.fsq.pub/admin/components/9%E3%80%81select.html#%E9%9D%99%E6%80%81%E6%95%B0%E6%8D%AE%E6%96%B9%E5%BC%8F2)
* 3、【修复】`万能表单` `tree-select` 点击清除按钮可能会报错的问题。
##### 框架更新步骤 [点击查看](https://vkdoc.fsq.pub/admin/1/update.html)
##### 框架学习Q群:`22466457` 欢迎萌新和大佬来使用和共同改进框架
##### 如果你觉得框架对你有用,可以在下方进行评论,也可以进行赞赏。
## 1.7.2(2021-11-02)
* 1、【升级】`vk-unicloud-admin-ui` 包升级至 `1.7.4`
* 2、【优化】美化默认滚动条样式 [点击查看](https://vkdoc.fsq.pub/admin/question/question.html#%E5%A6%82%E4%BD%95%E7%BE%8E%E5%8C%96%E9%BB%98%E8%AE%A4%E6%BB%9A%E5%8A%A8%E6%9D%A1)
......
{
"name": "vk-unicloud-admin",
"version": "1.7.1",
"version": "1.7.2",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
......@@ -104,9 +104,9 @@
}
},
"vk-unicloud-admin-ui": {
"version": "1.7.4",
"resolved": "https://registry.npmjs.org/vk-unicloud-admin-ui/-/vk-unicloud-admin-ui-1.7.4.tgz",
"integrity": "sha512-Vu+BvhQ20wSVmH2GPla9uiI29sCU6QsuEzinfEv252VIqq6853kYfZPUMYFJ5SeqeSa1eO6/h/dHRKW/jQRxRw=="
"version": "1.7.6",
"resolved": "https://registry.npmjs.org/vk-unicloud-admin-ui/-/vk-unicloud-admin-ui-1.7.6.tgz",
"integrity": "sha512-R6VOH+3ERzpqBK9+j+nH0GX+8QRUML7Unr4d5YQ2NzBVjbE9OdT56Gbnjj+7C7hiZggXaA/7YXjBqpLhxJbO0g=="
},
"vuedraggable": {
"version": "2.24.3",
......
{
"id": "vk-unicloud-admin",
"name": "vk-unicloud-admin",
"version": "1.7.2",
"version": "1.7.3",
"displayName": "【开箱即用】vk-unicloud-admin-快速开发框架-打造unicloud最好用的admin",
"description": "vk-unicloud-admin是基于unicloud+uni-id+element+vk-unicloud-router的一套快速PC admin完整开发框架。小白几分钟即可完成一个页面CRUD。",
"keywords": [
......@@ -22,7 +22,7 @@
"dependencies": {
"element-ui": "^2.15.6",
"umy-ui": "^1.1.6",
"vk-unicloud-admin-ui": "^1.7.5"
"vk-unicloud-admin-ui": "^1.7.6"
},
"engines": {
"HBuilderX": "^3.1.10"
......
## 2.5.3(2021-11-09)
* 1、【优化】`vk.pubfn.base64ToFile` 支持 APP 环境执行
* 2、【优化】`vk.pubfn.fileToBase64` 支持 APP 环境执行
* 3、【修复】`vk.baseDao.selects``localKey``a.b.c` 这样的形式时会报错的问题。
* 完整框架项目地址:`https://ext.dcloud.net.cn/plugin?id=2204`[点击查看](https://ext.dcloud.net.cn/plugin?id=2204)
## 2.5.2(2021-11-03)
* 1、【修复】`vk.baseDao.adds` 无返回值的问题。
* 完整框架项目地址:`https://ext.dcloud.net.cn/plugin?id=2204`[点击查看](https://ext.dcloud.net.cn/plugin?id=2204)
## 2.5.1(2021-11-02)
* 1、【新增】`vk.h5` 前端API接口(H5专用的一些接口,只有H5环境时,才有该对象,不会增大小程序的包体积)
* 2、【新增】`vk.h5.wx`(wx为公众号js_sdk接口) [微信小程序环境内js_sdk文档](https://developers.weixin.qq.com/miniprogram/dev/component/web-view.html) [微信公众号环境内js_sdk文档](https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/JS-SDK.html)
......
{
"id": "vk-unicloud",
"displayName": "vk-unicloud-router开发框架核心库 - 已集成uni-id 框架内置了众多API。",
"version": "2.5.1",
"version": "2.5.3",
"description": "此为vk-unicloud-router框架核心库(新手建议下载完整框架项目)已集成uni-id支持云函数url化。众多现成API,内置小白也能轻松上手的数据库API。使你项目刚起步进度就是百分之50",
"keywords": [
"vk-unicloud-router",
......
{
"name": "vk-unicloud",
"version": "2.5.0",
"version": "2.5.3",
"description": "【云函数端SDK】VK云函数路由模式uniCloud开发框架,在router目录下执行 npm i vk-unicloud 进行安装和升级",
"main": "index.js",
"homepage": "https://gitee.com/vk-uni/vk-uni-cloud-router.git",
......
......@@ -1722,11 +1722,20 @@ pubfn.getCurrentPageRoute = function(removeSlash) {
};
/**
* 文件转base64
方式一
vk.pubfn.fileToBase64({
file:res.tempFiles[0],
success:function(base64){
}
});
方式二
vk.pubfn.fileToBase64({ file }).then(base64 => {
});
*/
pubfn.fileToBase64 = function(obj = {}) {
......@@ -1750,7 +1759,7 @@ pubfn.fileToBase64 = function(obj = {}) {
reject(err);
};
// #endif
// #ifndef H5
// #ifdef MP
uni.getFileSystemManager().readFile({
filePath: file.path,
encoding: "base64",
......@@ -1760,6 +1769,7 @@ pubfn.fileToBase64 = function(obj = {}) {
base64 = "data:image/jpeg;base64," + base64;
}
if (obj.success) obj.success(base64);
if (obj.complete) obj.complete(base64);
resolve(base64);
},
fail: function(err) {
......@@ -1773,23 +1783,63 @@ pubfn.fileToBase64 = function(obj = {}) {
// if(obj.complete) obj.complete(base64);
// resolve(base64);
// #endif
// #ifdef APP-PLUS
plus.io.resolveLocalFileSystemURL(pubfn.getLocalFilePath(file.path), function(entry) {
entry.file(function(file) {
let fileReader = new plus.io.FileReader();
fileReader.onload = function(data) {
if (obj.success) obj.success(data.target.result);
if (obj.complete) obj.complete(data.target.result);
resolve(data.target.result);
}
fileReader.onerror = function(err) {
if (obj.fail) obj.fail(err);
reject(err);
}
fileReader.readAsDataURL(file)
}, function(err) {
if (obj.fail) obj.fail(err);
reject(err);
})
}, function(err) {
if (obj.fail) obj.fail(err);
reject(err);
})
// #endif
});
};
/**
* base64转文件
方式一
vk.pubfn.base64ToFile({
base64:base64,
success:function(file){
}
});
方式二
vk.pubfn.base64ToFile({ base64 }).then(file => {
});
*/
pubfn.base64ToFile = function(obj = {}) {
let {
base64 = "",
filePath = new Date().getTime() + '.png'
filePath
} = obj;
let extName = base64.split(',')[0].match(/data\:\S+\/(\S+);/);
if (extName) {
extName = extName[1];
} else {
reject(new Error('base64 error'));
}
if (!filePath) {
filePath = pubfn.random(32, "abcdefghijklmnopqrstuvwxyz0123456789") + '.' + extName;
}
let index = base64.indexOf("base64,");
let base64Data = base64;
if (index > -1) {
......@@ -1797,7 +1847,7 @@ pubfn.base64ToFile = function(obj = {}) {
}
let savePath;
return new Promise(function(resolve, reject) {
// #ifndef H5
// #ifdef MP
savePath = wx.env.USER_DATA_PATH + '/' + filePath;
let fs = uni.getFileSystemManager();
fs.writeFile({
......@@ -1828,6 +1878,34 @@ pubfn.base64ToFile = function(obj = {}) {
if (obj.complete) obj.complete(file);
resolve(file);
// #endif
// #ifdef APP-PLUS
let fileName = filePath;
let basePath = '_user_resources';
let dirPath = 'vk_temp';
savePath = basePath + '/' + dirPath + '/' + fileName;
let bitmap = new plus.nativeObj.Bitmap(fileName);
bitmap.loadBase64Data(base64, function() {
bitmap.save(savePath, {}, function() {
bitmap.clear();
let file = {
path: savePath,
lastModifiedDate: new Date(),
name: filePath
};
if (obj.success) obj.success(file);
if (obj.complete) obj.complete(file);
resolve(file);
}, function(error) {
bitmap.clear();
if (obj.fail) obj.fail(error);
reject(error);
})
}, function(error) {
bitmap.clear();
if (obj.fail) obj.fail(error);
reject(error);
})
// #endif
});
};
/**
......@@ -1908,7 +1986,45 @@ pubfn.checkLogin = function(obj = {}) {
// #endif
}
};
/**
* 获取文件本地路径
* @param {Object} path
*/
pubfn.getLocalFilePath = function(path) {
if (path.indexOf('_www') === 0 || path.indexOf('_doc') === 0 || path.indexOf('_documents') === 0 || path.indexOf('_downloads') === 0) {
return path
}
if (path.indexOf('file://') === 0) {
return path
}
if (path.indexOf('/storage/emulated/0/') === 0) {
return path
}
if (path.indexOf('/') === 0 && typeof plus !== "undefined") {
let localFilePath = plus.io.convertAbsoluteFileSystem(path)
if (localFilePath !== path) {
return localFilePath
} else {
path = path.substr(1)
}
}
return '_www/' + path
};
function biggerThan(v1, v2) {
let v1Array = v1.split('.')
let v2Array = v2.split('.')
let update = false
for (let index = 0; index < v2Array.length; index++) {
let diff = v1Array[index] - v2Array[index]
if (diff !== 0) {
update = diff > 0
break
}
}
return update
}
// 前端专属结束 -----------------------------------------------------------
export default pubfn;
......@@ -5,11 +5,12 @@
* 此函数参考uView
*/
function queryParams(data = {}, isPrefix = true, arrayFormat = 'brackets') {
let newData = JSON.parse(JSON.stringify(data));
let prefix = isPrefix ? '?' : ''
let _result = []
if (['indices', 'brackets', 'repeat', 'comma'].indexOf(arrayFormat) == -1) arrayFormat = 'brackets';
for (let key in data) {
let value = data[key]
for (let key in newData) {
let value = newData[key]
// 去掉为空的参数
if (['', undefined, null].indexOf(value) >= 0) {
continue;
......
......@@ -46,7 +46,9 @@ vk.request({
header:{
"content-type": "application/x-www-form-urlencoded",
},
data,
data:{
},
success: function(data){
},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册