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

1.5.4

上级 e38c8b78
#### vk-unicloud-admin 框架研究Q群:`22466457` 如有问题或建议可以在群内讨论。
#### 更新内容
* 1、【升级】`vk-unicloud-admin-ui` 包升级至 `1.5.13`
* 2、【优化】使用帮助/代码快捷提示/javascript代码块提示.json 新增新加的几个api的代码提示,同时输入`qw`可以快捷输出常用过滤器代码。
* 3、【优化】`万能表格` 支持展开行 [点击查看](https://vkdoc.fsq.pub/admin/2/table.html#http%E8%AF%B7%E6%B1%82%E6%A8%A1%E5%BC%8F)
* 4、【修复】`万能表格` 树形结构展示的bug
##### 框架更新步骤 [点击查看](https://vkdoc.fsq.pub/admin/1/update.html)
##### 框架学习Q群:`22466457` 欢迎萌新和大佬来使用和共同改进框架
#### 如果你觉得框架对你有用,可以在下方进行评论,也可以进行赞赏。
#### vk-unicloud-admin 框架研究Q群:`22466457` 如有问题或建议可以在群内讨论。
#### 更新内容
* 1、【升级】`vk-unicloud-admin-ui` 包升级至 `1.5.13`
* 2、【优化】使用帮助/代码快捷提示/javascript代码块提示.json 新增新加的几个api的代码提示,同时输入`qw`可以快捷输出常用过滤器代码。
* 3、【优化】`万能表格` 支持展开行 [点击查看](https://vkdoc.fsq.pub/admin/2/table.html#http%E8%AF%B7%E6%B1%82%E6%A8%A1%E5%BC%8F)
* 4、【修复】`万能表格` 树形结构展示的bug
##### 框架更新步骤 [点击查看](https://vkdoc.fsq.pub/admin/1/update.html)
##### 框架学习Q群:`22466457` 欢迎萌新和大佬来使用和共同改进框架
#### 如果你觉得框架对你有用,可以在下方进行评论,也可以进行赞赏。
const debug = process.env.NODE_ENV !== 'production';
var menus;
var devMenus;
try {
// 开发环境和正式环境中都会显示的静态菜单
menus = require('./static_menu/menu.json');
// 只在开发环境中显示的静态菜单
devMenus = require('./static_menu/menu-dev.json');
if(debug && devMenus){
menus = menus.concat(devMenus);
}
} catch (err) {}
module.exports = menus;
const debug = process.env.NODE_ENV !== 'production';
// 开发环境和正式环境中都会显示的静态菜单
import menus from './static_menu/menu.json'
// 只在开发环境中显示的静态菜单
import devMenus from './static_menu/menu-dev.json'
var menusList = [];
if (debug && devMenus) {
menusList = menus.concat(devMenus);
} else {
menusList = menus;
}
export default menusList;
## 1.5.4(2021-08-26)
#### vk-unicloud-admin 框架研究Q群:`22466457` 如有问题或建议可以在群内讨论。
#### 更新内容
* 1、【升级】`vk-unicloud-admin-ui` 包升级至 `1.5.13`
* 2、【优化】使用帮助/代码快捷提示/javascript代码块提示.json 新增新加的几个api的代码提示,同时输入`qw`可以快捷输出常用过滤器代码。
* 3、【优化】`万能表格` 支持展开行 [点击查看](https://vkdoc.fsq.pub/admin/2/table.html#http%E8%AF%B7%E6%B1%82%E6%A8%A1%E5%BC%8F)
* 4、【修复】`万能表格` 树形结构展示的bug
##### 框架更新步骤 [点击查看](https://vkdoc.fsq.pub/admin/1/update.html)
##### 框架学习Q群:`22466457` 欢迎萌新和大佬来使用和共同改进框架
#### 如果你觉得框架对你有用,可以在下方进行评论,也可以进行赞赏。
## 1.5.3(2021-08-26)
#### vk-unicloud-admin 框架研究Q群:`22466457` 如有问题或建议可以在群内讨论。
#### 更新内容
* 1、【升级】`vk-unicloud-admin-ui` 包升级至 `1.5.13`
* 2、【优化】使用帮助/代码快捷提示/javascript代码块提示.json 新增新加的几个api的代码提示,同时输入`qw`可以快捷输出常用过滤器代码。
* 3、【优化】`万能表格` 支持展开行 [点击查看](https://vkdoc.fsq.pub/admin/2/table.html#http%E8%AF%B7%E6%B1%82%E6%A8%A1%E5%BC%8F)
* 4、【修复】`万能表格` 树形结构展示的bug
##### 框架更新步骤 [点击查看](https://vkdoc.fsq.pub/admin/1/update.html)
##### 框架学习Q群:`22466457` 欢迎萌新和大佬来使用和共同改进框架
#### 如果你觉得框架对你有用,可以在下方进行评论,也可以进行赞赏。
## 1.5.2(2021-08-24)
### vk-unicloud-admin 框架研究Q群:`22466457` 如有问题或建议可以在群内讨论。
### 更新内容
......
/* 这里是你自己写的全局css样式 */
/* 滚动条美化方案开始 去掉下方css的注释即可 */
/*
::-webkit-scrollbar {
width: 10px;
height: 10px;
}
::-webkit-scrollbar-thumb {
background: rgba(135,135,135,0.4);
}
::-webkit-scrollbar-thumb {
background: transparent;
border-radius: 6px;
}
::-webkit-scrollbar-track {
background: rgba(135,135,135,0.1);
}
::-webkit-scrollbar-thumb {
background: rgba(135,135,135,0.5);
border-radius: 6px;
}
*/
/* 滚动条美化方案结束 */
@font-face {
font-family: uni-icons;
src: url('~@/uni_modules/uni-icons/components/uni-icons/uni.ttf') format('truetype');
font-weight: 400;
font-display: "auto";
font-style: normal
}
[class*=" uni-icons-"],
[class^=uni-icons-] {
font-family: uni-icons !important;
speak: none;
font-style: normal;
font-weight: 400;
font-variant: normal;
text-transform: none;
line-height: 1;
vertical-align: baseline;
display: inline-block;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale
}
.uni-icons-shop:before {
content: "\e609";
}
.uni-icons-headphones:before {
content: "\e8bf";
}
.uni-icons-pulldown:before {
content: "\e588";
}
.uni-icons-scan:before {
content: "\e612";
}
.uni-icons-back:before {
content: "\e471";
}
.uni-icons-forward:before {
content: "\e470";
}
.uni-icons-refreshempty:before {
content: "\e461";
}
.uni-icons-checkbox-filled:before {
content: "\e442";
}
.uni-icons-checkbox:before {
content: "\e7fa";
}
.uni-icons-loop:before {
content: "\e565";
}
.uni-icons-arrowthindown:before {
content: "\e585";
}
.uni-icons-arrowthinleft:before {
content: "\e586";
}
.uni-icons-arrowthinright:before {
content: "\e587";
}
.uni-icons-arrowthinup:before {
content: "\e584";
}
.uni-icons-bars:before {
content: "\e563";
}
.uni-icons-cart-filled:before {
content: "\e7f4";
}
.uni-icons-cart:before {
content: "\e7f5";
}
.uni-icons-arrowleft:before {
content: "\e582";
}
.uni-icons-arrowdown:before {
content: "\e581";
}
.uni-icons-arrowright:before {
content: "\e583";
}
.uni-icons-arrowup:before {
content: "\e580";
}
.uni-icons-eye-filled:before {
content: "\e568";
}
.uni-icons-eye-slash-filled:before {
content: "\e822";
}
.uni-icons-eye-slash:before {
content: "\e823";
}
.uni-icons-eye:before {
content: "\e824";
}
.uni-icons-reload:before {
content: "\e462";
}
.uni-icons-hand-thumbsdown-filled:before {
content: "\e83b";
}
.uni-icons-hand-thumbsdown:before {
content: "\e83c";
}
.uni-icons-hand-thumbsup-filled:before {
content: "\e83d";
}
.uni-icons-heart-filled:before {
content: "\e83e";
}
.uni-icons-hand-thumbsup:before {
content: "\e83f";
}
.uni-icons-heart:before {
content: "\e840";
}
.uni-icons-mail-open-filled:before {
content: "\e84d";
}
.uni-icons-mail-open:before {
content: "\e84e";
}
.uni-icons-list:before {
content: "\e562";
}
.uni-icons-map-pin:before {
content: "\e85e";
}
.uni-icons-map-pin-ellipse:before {
content: "\e864";
}
.uni-icons-paperclip:before {
content: "\e567";
}
.uni-icons-images-filled:before {
content: "\e87a";
}
.uni-icons-images:before {
content: "\e87b";
}
.uni-icons-search:before {
content: "\e466";
}
.uni-icons-settings:before {
content: "\e560";
}
.uni-icons-cloud-download:before {
content: "\e8e4";
}
.uni-icons-cloud-upload-filled:before {
content: "\e8e5";
}
.uni-icons-cloud-upload:before {
content: "\e8e6";
}
.uni-icons-cloud-download-filled:before {
content: "\e8e9";
}
.uni-icons-more:before {
content: "\e507";
}
.uni-icons-more-filled:before {
content: "\e537";
}
.uni-icons-refresh:before {
content: "\e407";
}
.uni-icons-refresh-filled:before {
content: "\e437";
}
.uni-icons-undo-filled:before {
content: "\e7d6";
}
.uni-icons-undo:before {
content: "\e406";
}
.uni-icons-redo:before {
content: "\e405";
}
.uni-icons-redo-filled:before {
content: "\e7d9";
}
.uni-icons-camera:before {
content: "\e301";
}
.uni-icons-camera-filled:before {
content: "\e7ef";
}
.uni-icons-smallcircle-filled:before {
content: "\e801";
}
.uni-icons-circle:before {
content: "\e411";
}
.uni-icons-flag-filled:before {
content: "\e825";
}
.uni-icons-flag:before {
content: "\e508";
}
.uni-icons-gear-filled:before {
content: "\e532";
}
.uni-icons-gear:before {
content: "\e502";
}
.uni-icons-home:before {
content: "\e500";
}
.uni-icons-info:before {
content: "\e504";
}
.uni-icons-home-filled:before {
content: "\e530";
}
.uni-icons-info-filled:before {
content: "\e534";
}
.uni-icons-circle-filled:before {
content: "\e441";
}
.uni-icons-chat-filled:before {
content: "\e847";
}
.uni-icons-chat:before {
content: "\e263";
}
.uni-icons-checkmarkempty:before {
content: "\e472";
}
.uni-icons-locked-filled:before {
content: "\e856";
}
.uni-icons-locked:before {
content: "\e506";
}
.uni-icons-map-filled:before {
content: "\e85c";
}
.uni-icons-map:before {
content: "\e364";
}
.uni-icons-minus-filled:before {
content: "\e440";
}
.uni-icons-mic-filled:before {
content: "\e332";
}
.uni-icons-minus:before {
content: "\e410";
}
.uni-icons-micoff:before {
content: "\e360";
}
.uni-icons-mic:before {
content: "\e302";
}
.uni-icons-clear:before {
content: "\e434";
}
.uni-icons-smallcircle:before {
content: "\e868";
}
.uni-icons-close:before {
content: "\e404";
}
.uni-icons-closeempty:before {
content: "\e460";
}
.uni-icons-paperplane:before {
content: "\e503";
}
.uni-icons-paperplane-filled:before {
content: "\e86e";
}
.uni-icons-image:before {
content: "\e363";
}
.uni-icons-image-filled:before {
content: "\e877";
}
.uni-icons-location-filled:before {
content: "\e333";
}
.uni-icons-location:before {
content: "\e303";
}
.uni-icons-plus-filled:before {
content: "\e439";
}
.uni-icons-plus:before {
content: "\e409";
}
.uni-icons-plusempty:before {
content: "\e468";
}
.uni-icons-help-filled:before {
content: "\e535";
}
.uni-icons-help:before {
content: "\e505";
}
.uni-icons-navigate-filled:before {
content: "\e884";
}
.uni-icons-navigate:before {
content: "\e501";
}
.uni-icons-mic-slash-filled:before {
content: "\e892";
}
.uni-icons-sound:before {
content: "\e590";
}
.uni-icons-sound-filled:before {
content: "\e8a1";
}
.uni-icons-spinner-cycle:before {
content: "\e465";
}
.uni-icons-download-filled:before {
content: "\e8a4";
}
.uni-icons-videocam-filled:before {
content: "\e8af";
}
.uni-icons-upload:before {
content: "\e402";
}
.uni-icons-upload-filled:before {
content: "\e8b1";
}
.uni-icons-starhalf:before {
content: "\e463";
}
.uni-icons-star-filled:before {
content: "\e438";
}
.uni-icons-star:before {
content: "\e408";
}
.uni-icons-trash:before {
content: "\e401";
}
.uni-icons-compose:before {
content: "\e400";
}
.uni-icons-videocam:before {
content: "\e300";
}
.uni-icons-trash-filled:before {
content: "\e8dc";
}
.uni-icons-download:before {
content: "\e403";
}
.uni-icons-qq:before {
content: "\e264";
}
.uni-icons-weibo:before {
content: "\e260";
}
.uni-icons-weixin:before {
content: "\e261";
}
.uni-icons-pengyouquan:before {
content: "\e262";
}
.uni-icons-chatboxes:before {
content: "\e203";
}
.uni-icons-chatboxes-filled:before {
content: "\e233";
}
.uni-icons-email-filled:before {
content: "\e231";
}
.uni-icons-email:before {
content: "\e201";
}
.uni-icons-person-filled:before {
content: "\e131";
}
.uni-icons-contact-filled:before {
content: "\e130";
}
.uni-icons-person:before {
content: "\e101";
}
.uni-icons-contact:before {
content: "\e100";
}
.uni-icons-phone:before {
content: "\e200";
}
.uni-icons-personadd-filled:before {
content: "\e132";
}
.uni-icons-personadd:before {
content: "\e102";
}
.uni-icons-phone-filled:before {
content: "\e230";
}
.uni-icons-chatbubble-filled:before {
content: "\e232";
}
.uni-icons-chatbubble:before {
content: "\e202";
}
/* 全局公共样式 */
body,
html {
-webkit-user-select: auto;
user-select: auto;
font: menu;
font-size: 16px;
}
/* #ifdef H5 */
.uni-app--showleftwindow uni-main {
position: relative;
background-color: #f5f5f5;
}
.uni-mask+.uni-left-window,
.uni-mask+.uni-right-window {
position: fixed;
}
.uni-app--showleftwindow uni-page-head .uni-page-head {
color: #333 !important;
/* margin-right: 15px; */
}
uni-page-head .uni-btn-icon {
color: #333 !important;
}
.uni-app--showleftwindow uni-page-head[uni-page-head-type=default]~uni-page-wrapper {
height: auto;
padding-top: 59px;
}
.uni-app--showleftwindow uni-page-head~uni-page-wrapper uni-page-body {
/* padding-top: 44px; */
}
.uni-app--showleftwindow uni-page-wrapper {
position: absolute;
width: 100%;
top: 0;
bottom: 0;
padding: 15px;
overflow-y: auto;
box-sizing: border-box;
background-color: #F5F5F5;
}
.uni-app--showleftwindow uni-page-body {
width: 100%;
min-height: 100%;
box-sizing: border-box;
border-radius: 5px;
box-shadow: -1px -1px 5px 0 rgba(0, 0, 0, .1);
background-color: #fff;
}
.uni-app--showleftwindow .uni-container .uni-forms {
padding: 15px;
max-width: 460px;
}
/* #endif */
/* #ifndef H5 */
.uni-nav-menu {
height: 100vh;
}
/* #endif */
.pointer {
cursor: pointer;
}
.uni-top-window {
z-index: 998;
overflow: visible;
}
.uni-tips {
font-size: 12px;
color: #666;
}
/* 容器 */
.uni-container {
padding: 15px;
box-sizing: border-box;
}
/* 标题栏 */
.uni-header {
padding: 0 15px;
display: flex;
height: 55px;
align-items: center;
justify-content: space-between;
border-bottom: 1px #f5f5f5 solid;
}
.uni-title {
margin-right: 10px;
font-size: 16px;
font-weight: 500;
color: #333;
}
.uni-sub-title {
margin-top: 3px;
font-size: 14px;
color: #999;
}
.uni-link {
color: #3A8EE6;
cursor: pointer;
text-decoration: underline;
}
.uni-group {
display: flex;
align-items: center;
justify-content: center;
word-break: keep-all;
}
/* 按钮样式 */
.uni-button-group {
margin-top: 30px;
display: flex;
align-items: center;
justify-content: center;
}
.uni-button {
padding: 10px 20px;
font-size: 14px;
border-radius: 4px;
line-height: 1;
margin: 0;
box-sizing: border-box;
overflow: initial;
}
.uni-group .uni-button {
margin-left: 10px;
}
.uni-group>.uni-button:first-child {
margin-left: 0;
}
.uni-button:hover,
.uni-button:focus {
opacity: 0.9;
}
.uni-button:active {
opacity: 1;
}
.uni-button-full {
width: 100%;
}
/* 搜索框样式 */
.uni-search {
height: 28px;
line-height: 28px;
font-size: 12px;
color: #606266;
padding: 0 10px;
border: 1px #dcdfe6 solid;
/* margin-right: 10px; */
border-radius: 3px;
}
/* 分页容器 */
.uni-pagination-box {
margin-top: 20px;
}
.uni-input-border,
.uni-textarea-border {
width: 100%;
font-size: 14px;
color: #666;
border: 1px #e5e5e5 solid;
border-radius: 5px;
box-sizing: border-box;
}
.uni-input-border {
padding: 0 10px;
height: 35px;
}
.uni-textarea-border {
padding: 10px;
height: 80px;
}
.uni-disabled {
background-color: #F5F7FA;
color: #C0C4CC;
}
.uni-icon-password-eye {
position: absolute;
right: 8px;
top: 6px;
font-family: uniicons;
font-size: 20px;
font-weight: normal;
font-style: normal;
width: 24px;
height: 24px;
line-height: 24px;
color: #999999;
}
.uni-eye-active {
color: #007AFF;
}
.uni-tabs__header {
position: relative;
background-color: #f5f7fa;
border-bottom: 1px solid #e4e7ed;
}
.uni-tabs__nav-wrap {
overflow: hidden;
margin-bottom: -1px;
position: relative;
}
.uni-tabs__nav-scroll {
overflow: hidden;
}
.uni-tabs__nav {
position: relative;
white-space: nowrap;
}
.uni-tabs__item {
position: relative;
padding: 0 20px;
height: 40px;
box-sizing: border-box;
line-height: 40px;
display: inline-block;
list-style: none;
font-size: 14px;
font-weight: 500;
color: #909399;
margin-top: -1px;
margin-left: -1px;
border: 1px solid transparent;
cursor: pointer;
}
.uni-tabs__item.is-active {
color: #007aff;
background-color: #fff;
border-right-color: #dcdfe6;
border-left-color: #dcdfe6;
}
.uni-form-item-tips {
color: #999;
font-size: 12px;
margin-top: 3px;
position: absolute;
top: 40px;
}
.uni-form-item-empty {
color: #999;
min-height: 36px;
line-height: 36px;
}
/* #ifdef H5 */
@media screen and (max-width: 450px) {
.hide-on-phone {
display: none;
}
}
@media screen and (min-width: 450px) {
.table-pc {
min-height: 600px;
border: 1px #ebeef5 solid;
box-sizing: border-box;
}
}
/* #endif */
/* #ifndef H5 */
.fix-top-window {
margin-top: 85px;
}
/* #endif */
::v-deep .uni-forms-item__label .label-text {
color: #606266 !important;
}
::v-deep .flex-center-x .uni-forms-item__content {
display: flex;
align-items: center;
flex-wrap: wrap;
}
.link-btn {
color: #007AFF;
text-decoration: underline;
cursor: pointer;
}
/* button 重置样式 */
::v-deep button[size=mini] {
line-height: 2.4;
font-size: 12px;
border-radius: 3px;
}
button {
background: #fff;
border: 1px solid #dcdfe6;
color: #606266;
box-sizing: border-box;
}
button[type=primary] {
background-color: #409EFF;
border-color: #409EFF;
border-width: 0;
}
button[type=warn] {
background-color: #f56c6c;
border-color: #f56c6c;
border-width: 0;
}
button[type=default] {
background: #fff;
border: 1px solid #dcdfe6;
color: #606266;
box-sizing: border-box;
}
button[type=primary][plain] {
border-color: #409EFF;
color: #409EFF;
}
button[type=warn][plain] {
border-color: #f56c6c;
color: #f56c6c;
}
button[type=default][plain] {
border-color: #dcdfe6;
color: #606266;
}
button[plain] {
border-color: #dcdfe6;
color: #606266;
}
button:after {
border-width: 0;
}
.uni-input-placeholder {
color: #999;
}
/* #ifdef H5 */
@media screen and (min-width: 500px) and (min-height: 500px) {
/* #ifndef VUE3 */
::v-deep .uni-picker-container .uni-picker-custom {
width: 100px;
margin-left: 100px;
}
/* #endif */
/* #ifdef VUE3 */
:deep(.uni-picker-container .uni-picker-custom) {
width: 100px;
margin-left: 100px;
}
/* #endif */
}
/* #endif */
.uni-pagination-box {
display: flex;
align-items: center;
justify-content: center;
}
.select-picker {
margin-right: 20px;
}
.select-picker button {
margin-top: 5px;
line-height: 29px;
font-size: 14px;
}
.select-picker button text {
color: #999;
}
.select-picker-icon {
margin-left: 8px;
}
### 此目录为 `unicloud-admin` 官方模板的一些样式文件
* 如果你需要引入 `unicloud-admin` 官方的一些插件,如[升级中心](https://ext.dcloud.net.cn/plugin?id=4470)
* 你可能会碰到样式错乱的问题,那是因为 `vk-unicloud-admin` 并没有引入 `unicloud-admin` 的公共样式
* 但框架已经帮你整理好了公共样式的文件,就在 `common/unicloud-admin` 目录内
### 在 `App.vue` 中引入 `unicloud-admin` 的公共样式
```html
<style lang="scss">
@import '@/common/unicloud-admin/css/uni.css';
@import '@/common/unicloud-admin/css/uni-icons.css';
</style>
```
### 同时官方的插件一般是不通过`云函数`获取数据的,而是通过`clientDB`操作数据库(前端操作数据库)
* 因此,你需要上传一些数据库的`schema.json`文件
### 如`升级中心`需要上传以下两个`schema.json`文件
* opendb-app-list.schema.json
* opendb-app-versions.schema.json
#### 这些`schema.json`文件一般在插件包里就有,直接右键点击对应的文件即可上传。
* 如升级中心的`schema.json` 目录在`uni_modules/uni-upgrade-center/uniCloud/database/opendb-app-list.schema.json`
* 同时一般插件还会有一个自己的`db_init.json`文件 如 `uni_modules/uni-upgrade-center/uniCloud/database/db_init.json` (也是右键上传)
\ No newline at end of file
{
"name" : "【开箱即用】vk-unicloud-admin - 快速开发框架 更容易上手的admin框架",
"appid" : "",
"appid" : "__UNI__570A7FB",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : "100",
......@@ -82,7 +82,8 @@
"base" : "/admin/"
},
"devServer" : {
"disableHostCheck" : true
"disableHostCheck" : true
}
}
},
"vueVersion" : "2"
}
{
"name": "vk-unicloud-admin",
"version": "1.5.1",
"version": "1.5.2",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
......@@ -104,9 +104,9 @@
}
},
"vk-unicloud-admin-ui": {
"version": "1.5.11",
"resolved": "https://registry.npmjs.org/vk-unicloud-admin-ui/-/vk-unicloud-admin-ui-1.5.11.tgz",
"integrity": "sha512-L3yMIuvMgx4xPI3y5P1lEDdIwnIYRWD8EXvgDJmSE00r8ciux1jeytfunwuPPlXFOozBhnBVQkpVhmRWQVB1oA=="
"version": "1.5.13",
"resolved": "https://registry.npmjs.org/vk-unicloud-admin-ui/-/vk-unicloud-admin-ui-1.5.13.tgz",
"integrity": "sha512-wMcqc/fdi9Kg6BYw0A+5yFhkVnR7PQqUfUZBaiR+tLnbSEy2vOoDkyLAhNDS5oDZDvdvoxCFx1bHfaGeF++oIg=="
},
"vuedraggable": {
"version": "2.24.3",
......
{
"id": "vk-unicloud-admin",
"name": "vk-unicloud-admin",
"version": "1.5.2",
"version": "1.5.4",
"displayName": "【开箱即用】vk-unicloud-admin - 快速开发框架 - 几分钟即可完成一个页面CRUD",
"description": "vk-unicloud-admin是基于unicloud+uni-id+element+vk-unicloud-router的一套快速PC admin完整开发框架。丰富的API可以让你开发事半功倍。",
"keywords": [
......@@ -22,7 +22,7 @@
"dependencies": {
"element-ui": "^2.15.5",
"umy-ui": "^1.1.6",
"vk-unicloud-admin-ui": "^1.5.11"
"vk-unicloud-admin-ui": "^1.5.13"
},
"engines": {
"HBuilderX": "^3.1.10"
......
......@@ -7,6 +7,7 @@
{ "path": "table/table-basic" },
{ "path": "table/table-easy" },
{ "path": "table/table-query" },
{ "path": "table/table-expand" },
{ "path": "form/form-array-object" },
{ "path": "form/form-basic" },
{ "path": "form/form-inline" },
......
......@@ -40,6 +40,7 @@
{ "path": "table/table-basic" },
{ "path": "table/table-easy" },
{ "path": "table/table-query" },
{ "path": "table/table-expand" },
{ "path": "form/form-array-object" },
{ "path": "form/form-basic" },
{ "path": "form/form-inline" },
......
<template>
<view class="page-body">
<!-- 页面内容开始 -->
<!-- 表格搜索组件开始 -->
<vk-data-table-query
v-model="queryForm1.formData"
:columns="queryForm1.columns"
@search="search"
></vk-data-table-query>
<!-- 表格搜索组件结束 -->
<!-- 自定义按钮区域开始 -->
<view>
<el-row>
<el-button type="success" size="small" icon="el-icon-circle-plus-outline" @click="addBtn">添加</el-button>
<!-- 批量操作 -->
<el-dropdown v-if="table1.multipleSelection" :split-button="false" trigger="click" @command="batchBtn">
<el-button type="danger" size="small" style="margin-left: 20rpx;"
:disabled="table1.multipleSelection.length === 0"
>
批量操作<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="1">批量操作1</el-dropdown-item>
<el-dropdown-item :command="2">批量操作2</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-button type="success" size="small" icon="el-icon-edit-outline"
style="margin-left: 20rpx;"
@click="exportExcel"
>
订单导出xls
</el-button>
</el-row>
</view>
<!-- 自定义按钮区域结束 -->
<!-- 表格组件开始 -->
<vk-data-table
ref="table1"
:action="table1.action"
:columns="table1.columns"
:query-form-param="queryForm1"
:right-btns="['detail_auto','update','delete','more']"
:right-btns-more="table1.rightBtnsMore"
:selection="true"
:row-no="true"
:pagination="true"
:expand="true"
@update="updateBtn"
@delete="deleteBtn"
@current-change="currentChange"
@selection-change="selectionChange"
></vk-data-table>
<!-- 表格组件结束 -->
<!-- 添加或编辑的弹窗开始 -->
<vk-data-dialog
v-model="form1.props.show"
:title="form1.props.title"
width="500px"
mode="form"
:close-on-click-modal="false"
>
<vk-data-form
v-model="form1.data"
:rules="form1.props.rules"
:action="form1.props.action"
:form-type="form1.props.formType"
:columns='form1.props.columns'
label-width="80px"
@success="form1.props.show = false;refresh();"
></vk-data-form>
</vk-data-dialog>
<!-- 添加或编辑的弹窗结束 -->
<!-- 页面内容结束 -->
</view>
</template>
<script>
var that; // 当前页面对象
var vk = uni.vk; // vk实例
var originalForms = {}; // 表单初始化数据
export default {
data() {
// 页面数据变量
return {
// 页面是否请求中或加载中
loading:false,
// init请求返回的数据
data:{
},
// 表格相关开始 -----------------------------------------------------------
table1:{
// 表格数据请求地址
action:"template/db_api/sys/getList",
// 表格字段显示规则
columns:[
{ key:"_id", title:"id", type:"text", width:220, show:["expand","detail"] },
{ key:"money", title:"金额", type:"money", width:80, sortable:"custom" },
{ key:"remark", title:"备注", type:"text", width:80, show:["expand","detail"] },
{ key:"_add_time", title:"添加时间", type:"time", width:160, sortable:"custom", valueFormat:"yyyy-MM-dd hh:mm:ss" },
{ key:"_add_time", title:"距离现在", type:"dateDiff", width:120 },
],
// 多选框选中的值
multipleSelection:[],
// 当前高亮的记录
selectItem:"",
rightBtnsMore:[
{
title:'按钮1',
onClick:function(item){
vk.toast(`${item._id}-按钮1`);
}
},
{
title:'按钮2',
onClick:function(item){
vk.toast(`${item._id}-按钮2`);
}
}
]
},
// 表格相关结束 -----------------------------------------------------------
// 表单相关开始 -----------------------------------------------------------
// 查询表单请求数据
queryForm1:{
// 查询表单数据源,可在此设置默认值
formData:{
},
// 查询表单的字段规则 fieldName:指定数据库字段名,不填默认等于key
columns:[
{ key:"money_1", type:"money", title:"金额范围", width:160, placeholder:"请输入最小金额",
mode:">=", fieldName:"money"
},
{ key:"money_2", type:"money", title:"-", width:160, placeholder:"请输入最大金额",
mode:"<=" , fieldName:"money"
},
{ key:"remark", title:"备注", type:"text", width:160, mode:"%%" },
{ key:"_add_time", title:"添加时间", type:"datetimerange", width:400, mode:"[]" },
]
},
form1:{
// 表单请求数据,此处可以设置默认值
data: {
},
// 表单属性
props: {
// 表单请求地址
action:"",
// 表单字段显示规则
columns:[
{
key: "user_id", title: "选择用户", type: "table-select", placeholder:"选择",
action:"admin/system/user/sys/getList",
columns:[
{ key:"nickname", title:"用户昵称", type:"text", nameKey:true },
{ key:"_id", title:"用户标识", type:"text", idKey:true },
{ key:"mobile", title:"手机号", type:"text", defaultValue:"" },
]
},
{ key:"money", title:"金额", type:"money", placeholder:"请输入金额" },
{ key:"remark", title:"备注", type:"text", placeholder:"请输入备注" },
],
// 表单验证规则
rules:{
user_id:[
{ required:true, message: "请选择用户", trigger:"change" }
],
money:[
{ required:true, message:"金额不能为空", trigger:"blur" },
{ type:"number", message:"金额必须是数字", trigger:"blur" },
],
},
// add 代表添加 update 代表修改
formType:"",
// 是否显示表单的弹窗
show:false
}
},
formDatas:{}
// 表单相关结束 -----------------------------------------------------------
};
},
// 监听 - 页面每次【加载时】执行(如:前进)
onLoad(options = {}) {
that = this;
vk = that.vk;
that.options = options;
that.init(options);
},
// 监听 - 页面【首次渲染完成时】执行。注意如果渲染速度快,会在页面进入动画完成前触发
onReady() {},
// 监听 - 页面每次【显示时】执行(如:前进和返回) (页面每次出现在屏幕上都触发,包括从下级页面点返回露出当前页面)
onShow() {},
// 监听 - 页面每次【隐藏时】执行(如:返回)
onHide() {},
// 函数
methods: {
// 页面数据初始化函数
init(options) {
originalForms["form1"] = vk.pubfn.copyObject(that.form1);
},
// 页面跳转
pageTo(path) {
vk.navigateTo(path);
},
// 页面返回
pageBack(path){
const pages = getCurrentPages();
if (pages.length>1 && pages[0].route !== that.$page.route) {
vk.navigateBack();
} else if(path) {
vk.navigateTo(path);
}
},
// 表单重置
resetForm(){
vk.pubfn.resetForm(originalForms, that);
},
// 搜索
search(){
that.$refs.table1.search();
},
// 刷新
refresh(){
that.$refs.table1.refresh();
},
// 获取当前选中的行的数据
getCurrentRow(){
return that.$refs.table1.getCurrentRow();
},
// 监听 - 行的选中高亮事件
currentChange(val){
that.table1.selectItem = val;
},
// 当选择项发生变化时会触发该事件
selectionChange(list) {
that.table1.multipleSelection = list;
},
// 显示添加页面
addBtn(){
that.resetForm();
that.form1.props.action = 'template/db_api/sys/add';
that.form1.props.formType = 'add';
that.form1.props.title = '添加';
that.form1.props.show = true;
},
// 显示修改页面
updateBtn({ item }){
that.form1.props.action = 'template/db_api/sys/update';
that.form1.props.formType = 'update';
that.form1.props.title = '编辑';
that.form1.props.show = true;
that.form1.data = item;
},
// 删除按钮
deleteBtn({ item, deleteFn }){
deleteFn({
action: "template/db_api/sys/delete",
data:{
_id: item._id
},
refresh: true
});
},
// 监听 - 批量操作的按钮点击事件
batchBtn(index){
switch(index){
case 1: vk.toast("批量操作按钮1"); break;
case 2: vk.toast("批量操作按钮2"); break;
default : break;
}
},
// 导出xls表格文件
exportExcel(){
that.$refs.table1.exportExcel();
}
},
// 监听属性
watch: {
},
// 过滤器
filters: {
},
// 计算属性
computed: {
}
};
</script>
<style lang="scss" scoped>
.page-body {
}
</style>
......@@ -38,7 +38,19 @@
"name": "综合用法",
"icon": "",
"url": "/pages_template/components/table/table-easy"
}
},
{
"menu_id": "vk-data-table-query",
"name": "搜索折叠",
"icon": "",
"url": "/pages_template/components/table/table-query"
},
{
"menu_id": "vk-data-table-expand",
"name": "表格行展开",
"icon": "",
"url": "/pages_template/components/table/table-expand"
}
]
},
{
......
......@@ -5,6 +5,8 @@ import config from '@/app.config.js'
let lifeData = uni.getStorageSync('lifeData') || {};
let $app = lifeData.$app || {};
export default {
// 通过添加 namespaced: true 的方式使其成为带命名空间的模块
namespaced: true,
......@@ -21,26 +23,26 @@ export default {
* js更新示例
* vk.setVuex('$app.inited', true);
*/
inited: lifeData.$app.inited || false,
inited: $app.inited || false,
config:{
...config
},
// 左侧菜单列表(树形结构) vk.getVuex('$app.navMenu');
navMenu: lifeData.$app.navMenu || [],
navMenu: $app.navMenu || [],
// 左侧菜单列表(数组形式) vk.getVuex('$app.menuList');
menuList: lifeData.$app.menuList || [],
menuList: $app.menuList || [],
// 菜单地图 vk.getVuex('$app.menuMap');
menuMap: lifeData.$app.menuMap || [],
menuMap: $app.menuMap || [],
// 当前打开的页面路由信息 vk.getVuex('$app.route'); vk.setVuex('$app.route', route);
route: lifeData.$app.route || {},
route: $app.route || {},
// 系统后台名称
appName: process.env.VUE_APP_NAME || '',
// 屏幕宽度
width: lifeData.$app.width || '',
width: $app.width || '',
// 屏幕高度
height: lifeData.$app.height || '',
height: $app.height || '',
// 是否是PC
isPC: lifeData.$app.isPC || true,
isPC: $app.isPC || true,
},
/**
* 从基本数据(state)派生的数据,相当于state的计算属性
......
......@@ -3,6 +3,8 @@
*/
let lifeData = uni.getStorageSync('lifeData') || {};
let $user = lifeData.$user || {};
export default {
// 通过添加 namespaced: true 的方式使其成为带命名空间的模块
namespaced: true,
......@@ -20,9 +22,9 @@ export default {
* js更新示例
* vk.setVuex('$user.userInfo.avatar', avatar);
*/
userInfo: lifeData.$user.userInfo || {},
permission:lifeData.$user.permission || [],
login:lifeData.$user.login || {},
userInfo: $user.userInfo || {},
permission:$user.permission || [],
login:$user.login || {},
},
/**
* 从基本数据(state)派生的数据,相当于state的计算属性
......
@import "common/css/uni.scss";
\ No newline at end of file
@import "@/common/css/uni.scss";
\ No newline at end of file
## 2.3.20(2021-08-26)
* 1、【新增】`app.config.js` 新增参数 `globalErrorCode` 可以修改全局异常的提示信息 [点击查看](https://vkdoc.fsq.pub/client/pages/config.html)
* 2、【新增】`javascript代码块提示.json` 最近新增的api的代码提示 [点击查看](https://vkdoc.fsq.pub/client/codeTips.html)
* 完整框架项目地址:`https://ext.dcloud.net.cn/plugin?id=2204`[点击查看](https://ext.dcloud.net.cn/plugin?id=2204)
## 2.3.19(2021-08-26)
* 1、【新增】`app.config.js` 新增参数 `globalErrorCode` 可以修改全局异常的提示信息 [点击查看](https://vkdoc.fsq.pub/client/pages/config.html)
* 2、【新增】`javascript代码块提示.json` 最近新增的api的代码提示 [点击查看](https://vkdoc.fsq.pub/client/codeTips.html)
* 完整框架项目地址:`https://ext.dcloud.net.cn/plugin?id=2204`[点击查看](https://ext.dcloud.net.cn/plugin?id=2204)
## 2.3.18(2021-08-24)
* 1、【修复】腾讯云的图片上传无法回显图片的问题。
* 2、【优化】一些细节
* 完整框架项目地址:`https://ext.dcloud.net.cn/plugin?id=2204`[点击查看](https://ext.dcloud.net.cn/plugin?id=2204)
## 2.3.17(2021-08-24)
* 【优化】一些细节
* 完整框架项目地址:`https://ext.dcloud.net.cn/plugin?id=2204`[点击查看](https://ext.dcloud.net.cn/plugin?id=2204)
## 2.3.16(2021-08-24)
* 【优化】一些细节
* 完整框架项目地址:`https://ext.dcloud.net.cn/plugin?id=2204`[点击查看](https://ext.dcloud.net.cn/plugin?id=2204)
## 2.3.15(2021-08-24)
* 【优化】一些细节
* 完整框架项目地址:`https://ext.dcloud.net.cn/plugin?id=2204`[点击查看](https://ext.dcloud.net.cn/plugin?id=2204)
......
{
"id": "vk-unicloud",
"displayName": "vk-unicloud-router开发框架核心库 - 已集成uni-id 框架内置了众多API。",
"version": "2.3.15",
"version": "2.3.20",
"description": "此为vk-unicloud-router框架核心库(新手建议下载完整框架项目)已集成uni-id支持云函数url化。众多现成API,内置小白也能轻松上手的数据库API。使你项目刚起步进度就是百分之50",
"keywords": [
"vk-unicloud-router",
......
{
"name": "vk-unicloud",
"version": "2.3.8",
"description": "在router目录下执行 npm i vk-unicloud 进行安装和升级",
"version": "2.3.9",
"description": "【云函数端SDK】VK云函数路由模式uniCloud开发框架,在router目录下执行 npm i vk-unicloud 进行安装和升级",
"main": "index.js",
"homepage": "https://gitee.com/vk-uni/vk-uni-cloud-router.git",
"repository": {
"type": "git",
"url": "git+https://gitee.com/vk-uni/vk-uni-cloud-router.git"
},
"author": "",
"author": "VK",
"license": "Apache-2.0"
}
\ No newline at end of file
var requestUtil = {};
requestUtil.config = {
// 请求配置
request: {
......@@ -213,18 +215,33 @@ function requestFail(obj = {}) {
sysErr = true;
errMsg = "请求超时,请重试!";
}
if (needAlert && vk.pubfn.isNotNull(errMsg)) {
if (sysErr) {
vk.toast("网络开小差了!", "none");
} else {
vk.alert(errMsg);
}
}
if (config.debug) Logger.error = res;
if (title) vk.hideLoading();
if (loading) vk.setLoading(false, loading);
if (config.debug) Logger.error = res;
if (typeof fail === "function") fail(res);
if (typeof reject === "function") reject(res);
let runKey = true;
// 自定义拦截器开始-----------------------------------------------------------
let { interceptor={} } = vk.callFunctionUtil.getConfig();
if (interceptor.request && typeof interceptor.request.fail == "function") {
runKey = interceptor.request.fail({
vk,
res: res,
params: params
});
if (runKey === undefined) runKey = true;
}
// 自定义拦截器结束-----------------------------------------------------------
if (runKey) {
if (needAlert && vk.pubfn.isNotNull(errMsg)) {
if (sysErr) {
vk.toast("网络开小差了!", "none");
} else {
vk.alert(errMsg);
}
}
if (typeof fail === "function") fail(res);
if (typeof reject === "function") reject(res);
}
}
// 请求完成回调
......
......@@ -275,6 +275,7 @@ class CallFunctionUtil {
vk = customConfig[key];
} else if (key === "interceptor") {
this.interceptor = Object.assign(this.interceptor, customConfig[key]);
this.config.interceptor = customConfig[key];
} else if (key === "myfn") {
vk.myfn = customConfig[key];
} else if (key === "loginPagePath") {
......@@ -604,6 +605,7 @@ class CallFunctionUtil {
callFunctionFail(obj) {
let that = this;
let config = that.config;
let { globalErrorCode={} } = config;
let {
res = {},
params,
......@@ -642,16 +644,19 @@ class CallFunctionUtil {
}
if (errMsg.indexOf("fail timeout") > -1) {
sysErr = true;
errMsg = "请求超时,请重试!";
errMsg = globalErrorCode["cloudfunction-timeout"] || "请求超时,请重试!";
}
if (res.code >= 90001 && errMsg.indexOf("数据库") > -1) {
sysErr = true;
} else if ([404, 500].indexOf(res.code) > -1 && errMsg.indexOf("云函数") > -1) {
sysErr = true;
} else if (res.code === "SYS_ERR" && errMsg.indexOf(": request:ok") > -1) {
errMsg = globalErrorCode["cloudfunction-unusual-timeout"] || "请求超时,但请求还在执行,请重新进入页面。";
}
let runKey = true;
if (typeof that.interceptor.fail == "function") {
runKey = that.interceptor.fail({
vk,
res: res,
params: params
});
......@@ -662,7 +667,8 @@ class CallFunctionUtil {
if (errorToast) vk.toast(errMsg, "none");
if (needAlert && vk.pubfn.isNotNull(errMsg)) {
if (sysErr) {
vk.toast("网络开小差了!", "none");
let toastMsg = globalErrorCode["cloudfunction-system-error"] || "网络开小差了!";
vk.toast(toastMsg, "none");
} else {
vk.alert(errMsg);
}
......
......@@ -397,6 +397,182 @@
"triggerAssist": false,
"description": "打开弹窗"
},
"vk.pubfn.sleep": {
"prefix": "vk.pubfn.sleep",
"body": [
"await vk.pubfn.sleep(1000);"
],
"triggerAssist": false,
"description": "进程强制等待,休眠"
},
"vk.pubfn.getDayOffsetStartAndEnd": {
"prefix": "vk.pubfn.getDayOffsetStartAndEnd",
"body": [
"let dayTime = vk.pubfn.getDayOffsetStartAndEnd(0);"
],
"triggerAssist": false,
"description": "获得相对当前时间的偏移 count 天的起止日期"
},
"vk.pubfn.getMonthOffsetStartAndEnd": {
"prefix": "vk.pubfn.getMonthOffsetStartAndEnd",
"body": [
"let monthTime = vk.pubfn.getMonthOffsetStartAndEnd(0);"
],
"triggerAssist": false,
"description": "获得相对当前时间的偏移 count 月的起止日期"
},
"vk.pubfn.getYearOffsetStartAndEnd": {
"prefix": "vk.pubfn.getYearOffsetStartAndEnd",
"body": [
"let yearTime = vk.pubfn.getYearOffsetStartAndEnd(0);"
],
"triggerAssist": false,
"description": "获得相对当前时间的偏移 count 年的起止日期"
},
"vk.pubfn.priceFilter": {
"prefix": "vk.pubfn.priceFilter",
"body": [
"vk.pubfn.priceFilter(${0})"
],
"triggerAssist": false,
"description": "金额过滤器"
},
"vk.pubfn.timeFormat": {
"prefix": "vk.pubfn.timeFormat",
"body": [
"vk.pubfn.timeFormat(${0})"
],
"triggerAssist": false,
"description": "时间过滤器,第二个参数支持yyyy-MM-dd HH:mm:ss"
},
"vk.pubfn.dateDiff": {
"prefix": "vk.pubfn.dateDiff",
"body": [
"vk.pubfn.dateDiff(${0})"
],
"triggerAssist": false,
"description": "将时间显示成1秒前、1天前"
},
"vk.pubfn.dateDiff2": {
"prefix": "vk.pubfn.dateDiff2",
"body": [
"vk.pubfn.dateDiff2(${0})"
],
"triggerAssist": false,
"description": "将时间显示成当前时间距离time剩余时间为:3天"
},
"vk.pubfn.numStr": {
"prefix": "vk.pubfn.numStr",
"body": [
"vk.pubfn.numStr(${0})"
],
"triggerAssist": false,
"description": "将大数字转中文,如15234120转成1千万"
},
"vk.pubfn.percentageFilter": {
"prefix": "vk.pubfn.percentageFilter",
"body": [
"vk.pubfn.percentageFilter(${0})"
],
"triggerAssist": false,
"description": "百分比过滤器"
},
"vk.pubfn.calcSize": {
"prefix": "vk.pubfn.calcSize",
"body": [
"vk.pubfn.calcSize(${0}value,['B','KB','MB','GB'],1024,3).title"
],
"triggerAssist": false,
"description": "计量单位过滤器"
},
"vk.pubfn.priceLeftFilter": {
"prefix": "vk.pubfn.priceLeftFilter",
"body": [
"vk.pubfn.priceLeftFilter(${0})"
],
"triggerAssist": false,
"description": "金额过滤器 - 只显示小数点左边"
},
"vk.pubfn.priceRightFilter": {
"prefix": "vk.pubfn.priceRightFilter",
"body": [
"vk.pubfn.priceRightFilter(${0})"
],
"triggerAssist": false,
"description": "金额过滤器 - 只显示小数点右边"
},
"金额过滤器": {
"prefix": "qw",
"body": [
"vk.pubfn.priceFilter(${0})"
],
"triggerAssist": false,
"description": "金额过滤器"
},
"时间过滤器": {
"prefix": "qw",
"body": [
"vk.pubfn.timeFormat(${0})"
],
"triggerAssist": false,
"description": "时间过滤器,第二个参数支持yyyy-MM-dd HH:mm:ss"
},
"将时间显示成1秒前、1天前": {
"prefix": "qw",
"body": [
"vk.pubfn.dateDiff(${0})"
],
"triggerAssist": false,
"description": "将时间显示成1秒前、1天前"
},
"将时间显示成当前时间距离time剩余时间为:3天": {
"prefix": "qw",
"body": [
"vk.pubfn.dateDiff2(${0})"
],
"triggerAssist": false,
"description": "将时间显示成当前时间距离time剩余时间为:3天"
},
"将大数字转中文": {
"prefix": "qw",
"body": [
"vk.pubfn.numStr(${0})"
],
"triggerAssist": false,
"description": "将大数字转中文,如15234120转成1千万"
},
"百分比过滤器": {
"prefix": "qw",
"body": [
"vk.pubfn.percentageFilter(${0})"
],
"triggerAssist": false,
"description": "百分比过滤器"
},
"计量单位过滤器": {
"prefix": "qw",
"body": [
"vk.pubfn.calcSize(${0}value,['B','KB','MB','GB'],1024,3).title"
],
"triggerAssist": false,
"description": "计量单位过滤器"
},
"金额过滤器 - 只显示小数点左边": {
"prefix": "qw",
"body": [
"vk.pubfn.priceLeftFilter(${0})"
],
"triggerAssist": false,
"description": "金额过滤器 - 只显示小数点左边"
},
"金额过滤器 - 只显示小数点右边": {
"prefix": "qw",
"body": [
"vk.pubfn.priceRightFilter(${0})"
],
"triggerAssist": false,
"description": "金额过滤器 - 只显示小数点右边"
},
"userDao.findById": {
"prefix": "dao.",
"body": [
......@@ -445,6 +621,14 @@
"triggerAssist": false,
"description": "数组删除"
},
"保留两位小数": {
"prefix": "qq.",
"body": [
"parseFloat(${0}).toFixed(2);"
],
"triggerAssist": false,
"description": "保留两位小数,并舍去最后的0"
},
"try{...} catch(err){...}": {
"prefix": "try",
"body": [
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册