增加loding

This commit is contained in:
zouzhibing
2022-04-11 16:18:45 +08:00
parent 5c0a2950bd
commit 0270a7a9e1
36 changed files with 493 additions and 192 deletions

33
.idea/workspace.xml generated
View File

@@ -2,11 +2,16 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="be7958c3-0d1c-4f74-a433-b590462e7034" name="Default Changelist" comment="修改 回显问题">
<change afterPath="$PROJECT_DIR$/uni_modules/zb-table/components/zb-table/components/zb-loading.vue" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pages/index/index.vue" beforeDir="false" afterPath="$PROJECT_DIR$/pages/index/index.vue" afterDir="false" />
<change beforePath="$PROJECT_DIR$/uni_modules/zb-table/changelog.md" beforeDir="false" afterPath="$PROJECT_DIR$/uni_modules/zb-table/changelog.md" afterDir="false" />
<change beforePath="$PROJECT_DIR$/uni_modules/zb-table/components/zb-table/components/table-header-item.vue" beforeDir="false" afterPath="$PROJECT_DIR$/uni_modules/zb-table/components/zb-table/components/table-header-item.vue" afterDir="false" />
<change beforePath="$PROJECT_DIR$/uni_modules/zb-table/components/zb-table/components/table-summary.vue" beforeDir="false" afterPath="$PROJECT_DIR$/uni_modules/zb-table/components/zb-table/components/table-summary.vue" afterDir="false" />
<change beforePath="$PROJECT_DIR$/uni_modules/zb-table/components/zb-table/zb-table.vue" beforeDir="false" afterPath="$PROJECT_DIR$/uni_modules/zb-table/components/zb-table/zb-table.vue" afterDir="false" />
<change beforePath="$PROJECT_DIR$/uni_modules/zb-table/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/uni_modules/zb-table/package.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/uni_modules/zb-table/readme.md" beforeDir="false" afterPath="$PROJECT_DIR$/uni_modules/zb-table/readme.md" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/.sourcemap/mp-weixin/common/runtime.js.map" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/.sourcemap/mp-weixin/common/runtime.js.map" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/.sourcemap/mp-weixin/pages/index/index.js.map" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/.sourcemap/mp-weixin/pages/index/index.js.map" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-card/components/uni-card/uni-card.js.map" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-card/components/uni-card/uni-card.js.map" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/zb-table/components/zb-table/components/table-checkbox.js.map" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/zb-table/components/zb-table/components/table-checkbox.js.map" afterDir="false" />
@@ -15,13 +20,24 @@
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/zb-table/components/zb-table/components/table-summary.js.map" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/zb-table/components/zb-table/components/table-summary.js.map" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/zb-table/components/zb-table/components/zb-load-more.js.map" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/zb-table/components/zb-table/components/zb-load-more.js.map" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/zb-table/components/zb-table/zb-table.js.map" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/zb-table/components/zb-table/zb-table.js.map" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/mp-alipay/.mini-ide/project-ide.json" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/mp-alipay/.mini-ide/project-ide.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/mp-alipay/common/runtime.js" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/mp-alipay/common/runtime.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/mp-alipay/common/vendor.js" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/mp-alipay/common/vendor.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/mp-alipay/pages/index/index.axml" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/mp-alipay/pages/index/index.axml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/mp-alipay/pages/index/index.js" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/mp-alipay/pages/index/index.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/mp-alipay/uni_modules/zb-table/components/zb-table/components/table-summary.axml" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/mp-alipay/uni_modules/zb-table/components/zb-table/components/table-summary.axml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/mp-alipay/uni_modules/zb-table/components/zb-table/zb-table.axml" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/mp-alipay/uni_modules/zb-table/components/zb-table/zb-table.axml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/mp-alipay/uni_modules/zb-table/components/zb-table/zb-table.js" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/mp-alipay/uni_modules/zb-table/components/zb-table/zb-table.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/mp-alipay/uni_modules/zb-table/components/zb-table/zb-table.json" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/mp-alipay/uni_modules/zb-table/components/zb-table/zb-table.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/app.json" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/app.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/common/runtime.js" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/common/runtime.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/common/vendor.js" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/common/vendor.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/pages/index/index.js" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/pages/index/index.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/pages/index/index.wxml" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/pages/index/index.wxml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/project.config.json" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/project.config.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/uni_modules/zb-table/components/zb-table/components/table-summary.wxml" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/uni_modules/zb-table/components/zb-table/components/table-summary.wxml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/uni_modules/zb-table/components/zb-table/zb-table.js" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/uni_modules/zb-table/components/zb-table/zb-table.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/uni_modules/zb-table/components/zb-table/zb-table.json" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/uni_modules/zb-table/components/zb-table/zb-table.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/uni_modules/zb-table/components/zb-table/zb-table.wxml" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/uni_modules/zb-table/components/zb-table/zb-table.wxml" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -86,7 +102,8 @@
<workItem from="1649407132108" duration="11000" />
<workItem from="1649407182292" duration="6875000" />
<workItem from="1649422146482" duration="4615000" />
<workItem from="1649645784017" duration="2125000" />
<workItem from="1649645784017" duration="8788000" />
<workItem from="1649662497062" duration="2467000" />
</task>
<task id="LOCAL-00001" summary="修改 回显问题">
<created>1648190576831</created>
@@ -105,4 +122,16 @@
<MESSAGE value="修改 回显问题" />
<option name="LAST_COMMIT_MESSAGE" value="修改 回显问题" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
<breakpoints>
<line-breakpoint enabled="true" type="javascript">
<url>file://$PROJECT_DIR$/pages/index/index.vue</url>
<line>357</line>
<properties lambdaOrdinal="-1" />
<option name="timeStamp" value="1" />
</line-breakpoint>
</breakpoints>
</breakpoint-manager>
</component>
</project>

View File

@@ -3,6 +3,7 @@
<uni-card title="全部功能" >
<view style="height: 300px">
<zb-table
:isLoading="isLoading"
@sort-change="sortChange"
:pullUpLoading="pullUpLoading"
:isShowLoadMore="true"
@@ -156,6 +157,7 @@
<uni-card title="支持设置单元格样式" >
<view style="height: 300px">
<zb-table
:cell-header-style="cellHeaderStyle"
:cell-style="cellStyle"
:show-header="true"
:columns="column1"
@@ -358,9 +360,10 @@ img:"https://img.pddpic.com/mms-material-img/2020-11-27/84c7fad3-d945-4e71-ab09-
],
data1:[],
flag1:true,
flag2:true,
flag2:true,
num:0,
num1:0,
num1:0,
isLoading:true,
isShowLoadMore:true
}
},
@@ -374,11 +377,8 @@ img:"https://img.pddpic.com/mms-material-img/2020-11-27/84c7fad3-d945-4e71-ab09-
this.data1 = JSON.parse(JSON.stringify(this.data))
let data2 = JSON.parse(JSON.stringify(this.data))
setTimeout(()=>{
// data2.forEach(item=>{
// item.checked = true
// })
// this.data = data2
},3000)
this.isLoading = false
},1500)
},
methods:{
permissionBtn (row,renders,rowIndex){
@@ -389,9 +389,31 @@ img:"https://img.pddpic.com/mms-material-img/2020-11-27/84c7fad3-d945-4e71-ab09-
return renders
},
sortChange(item,sorterMode,index){
uni.showToast({
icon:'none',
duration:3000,
title:'触发自定义排序,通过接口返回排序,不默认排序'
})
console.log('触发排序',item,sorterMode,index)
},
cellHeaderStyle({column,columnIndex}){
if(columnIndex === 1 || columnIndex === 4) {
return{
color:'red'
}
}
// if(column.children){
// for(let item of column.children){
// if(item.name==='province'){
// return{
// color:'red'
// }
// }
// }
// }
},
cellStyle({row, column, rowIndex, columnIndex}){
// console.log('row, column, rowIndex, columnIndex')
if(columnIndex === 1 || columnIndex === 4) {

View File

@@ -1,3 +1,5 @@
## 1.2.42022-04-11
进行优化细节
## 1.2.32022-04-11
优化细节
## 1.2.22022-04-11

View File

@@ -1,23 +1,27 @@
<template>
<view
:style="{
flex:(wrapIndex===transColumns.length-1||(multify.length&&isMulitiLastLength))?1:'none',
flexDirection:multify.length?'column':'row'
}"
class="zb__item-inner"
>
<view
@click.stop="sortAction(item,index)"
class="item-th"
:style="{
:style="[{
width:`${item.width?item.width+'px':'100%'}`,
flex:index===transColumns.length-1?1:'none',
flex:(index===transColumns.length-1)?1:'none',
minWidth:`${item.width?item.width:'100'}px`,
borderRight:`${border?'1px solid #e8e8e8':''}`,
<!-- #ifndef H5 || APP-PLUS -->
borderRight:`${(scrollbarSize&&index===transColumns.length-1)?'':border?'1px solid #e8e8e8':''}`,
<!-- #ifdef H5 || APP-PLUS -->
borderRight:`${(scrollbarSize&&wrapIndex===transColumns.length-1)?'':border?'1px solid #e8e8e8':''}`,
<!-- #endif -->
borderBottom:`${border?'1px solid #e8e8e8':''}`,
justifyContent:textPosition(item)
}"
},getCellStyle(item,wrapIndex)]"
>
<template v-if="item.type==='selection'">
@@ -45,12 +49,15 @@
:item="ite"
@sortAction="sortAction"
:border="border"
wrapIndex=""
@checkboxSelectedAll="checkboxSelectedAll"
:indeterminate="indeterminate"
:checkedAll="checkedAll"
:transColumns="transColumns"
:index='`${i}-1-${index}`'
:key='i'
:multify="multify"
:isMulitiLastLength="(item.children.length-1)===i"
:scrollbarSize="scrollbarSize"
v-for="(ite,i) in item.children"/>
</view>
@@ -67,10 +74,20 @@
TableCheckbox
},
props:{
item:{
type:Object,
default:()=>{}
},
cellHeaderStyle:Function,
multify:{
type:Array,
default:()=>[]
},
isMulitiLastLength:{
type:Boolean,
default:false
},
border:{
type:Boolean,
default:false
@@ -85,7 +102,13 @@
type:Number,
default:0
},
realColumns:{
type:Array,
default:()=>[]
},
index:[Number,String],
wrapIndex:[Number,String],
childIndex:[Number,String],
fixedLeftColumns:{
type:Array,
default:()=>[]
@@ -98,7 +121,16 @@
if(item.align==='left') return 'flex-start'
if(item.align==='center') return 'center'
}
}
},
getCellStyle() {
return (column, columnIndex,childIndex)=>{
const cellStyle = this.cellHeaderStyle;
if(typeof cellStyle==='function'){
return cellStyle({ column, columnIndex})
}
return {}
}
},
},
data(){
return{
@@ -106,6 +138,7 @@
}
},
methods:{
sortAction(item,index){
this.$emit('sortAction',item,index)
},

View File

@@ -1,5 +1,5 @@
<template>
<view class="zb-table-footer" style="height: 40px;">
<view class="zb-table-footer" style="height: 40px;flex-shrink: 0">
<view class="zb-table-fixed" >
<view class="zb-table-thead" style="position: relative;" >
<view class="item-tr">

View File

@@ -0,0 +1,58 @@
<template >
<view class="zb-loading">
<image :src="base64Flower" style="" class="loading-custom-image"></image>
<text>正在加载中...</text>
</view>
</template>
<script>
const base64Flower = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkBAMAAACCzIhnAAAAKlBMVEVHcEzDw8Ovr6+pqamUlJTCwsKenp61tbWxsbGysrLNzc2bm5u5ubmjo6MpovhuAAAACnRSTlMA/P79/sHDhiZS0DxZowAABBBJREFUWMPtl89rE0EUx7ctTXatB3MI1SWnDbUKPUgXqh4ED8Uf7KUVSm3ooVSpSii0Fn/gD4j4o+APiEoVmos9FO2celiqZVgwgaKHPQiCCkv+F99kM7Ozm5kxq1dfD91k9pPve9/3ZjbRNHHok/mKli4eIPNgSuRObuN9SqSEzM20iGnm0yIbqCuV7NSSSIV7uyPM6JMBYdeTOanh/QihJYZsUCSby+VkMj2AvOt0rAeQAwqE3lfKMZVlQCZk1QOCKkkVPadITCfIRNKxfoJI5+0OIFtJx14CMSg1mRSDko7VAfksRQzEbGYqxOJcVTWMCH2I1/IACNW0PWU2M8cmAVHtnH5mM1VRWtwKZjOd5JbF6s1IbaYqaotjNlPHgDAnlAizubTR6ovMYn052g/U5qcmOpi0WL8xTS/3IfSet5m8MEr5ajjF5le6dq/OJpobrdY0t3i9QgefWrxW9/1BLhk0E9m8FeUMhhXal499iD0eQRfDF+ts/tttORRerfp+oV7f4xJj82iUYm1Yzod+ZQEAlS/8mMBwKebVmCVp1f0JLS6zKd17+iwRKTARVg2SHtz3iEbBH+Q+U28zW2Jiza8Tjb1YFoYZMsJyjDqp3M9XBQdSdPLFdxEpvOB37JrHcmR/y9+LgoTlCFGZEa2sc6d4PGlweEa2JSVPoVm+IfGG3ZL037iV9oH+P+Jxc4HGVflNq1M0pivao/EopO4b/ojVCP9GjmiXOeS0DOn1o/iiccT4ORnyvBGF3yUywkQajW4Ti0SGuiy/wVSg/L8w+X/8Q+hvUx8Xd90z4oV5a1i88MbFWHz0WZZ1UrTwBGPX3Rat9AFiXRMRjoMdIdJLEOt2h7jrYOzgOamKZSWSNspOS0X8SAqRYmxRL7sg4eLzYmNehcxh3uoyud/BH2Udux4ywxFTc1xC7Mgf4vMhc5S+kSH3Y7yj+qpwIWSoPTVCOOPVthGx9FbGqrwFw6wSFxJr+17zeKcztt3u+2roAEVgUjDd+AHGuxHy2rZHaa8JMkTHEeyi85ANPO9j9BVuBRD2FY5LDMo/Sz/2hReqGIs/KiFin+CsPsYO/yvM3jL2vE8EbX7/Bf8ejtr2GLN65bioAdgLd8Bis/mD5GmP2qeqyo2ZwQEOtAjRIDH7mBKpUcMoApbZJ5UIxkEwxyMZyMxW/uKFvHCFR3SSmerHyDNQ2dF4JG6zIMpBgLfjSF9x1D6smFcYnGApjmSLICO3ecCDWrQ48geba9DI3STy2i7ax6WIB62fSyIZIiO3GFQqSURp8wCo7GhJBGwuSovJBNjb7kT6FPVnIa9qJ2Ko+l9mefGIdinaMp0yC1URYiwsdfNE45EuA5Cx9EhalfvN5s+UyItm81vaB3p4joniN+SCP7Qc1hblAAAAAElFTkSuQmCC';
export default {
data(){
return{
base64Flower
}
}
}
</script>
<style lang="scss" scoped>
.zb-loading {
width: 100%;
position: absolute;
/* #ifdef H5 || APP-PLUS */
top: 0;
/* #endif */
/* #ifndef H5 || APP-PLUS */
top: 41px;
/* #endif */
bottom: 0;
left: 0;
z-index: 999;
background: white;
display: flex;
height: 100%;
flex-shrink: 0;
align-items: center;
justify-content: center;
.loading-custom-image{
color: #a4a4a4;
margin-right: 8rpx;
width: 24px;
height: 24px;
/* #ifndef APP-NVUE */
animation: loading-circle 1s linear infinite;
/* #endif */
}
@keyframes loading-circle {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
}
</style>

View File

@@ -21,6 +21,10 @@
<table-header-item
:item="item"
:key="index"
:cellHeaderStyle="cellHeaderStyle"
:multify="multify"
:realColumns="transColumns.realColumns"
:wrapIndex ='index'
@sortAction="sortAction"
:border="border"
@checkboxSelectedAll="checkboxSelectedAll"
@@ -41,6 +45,7 @@
<template v-if="!data.length">
<view class="no-data">暂无数据~~</view>
</template>
<scroll-view
class="zb-table-body" ref="tableBody" scroll-x="true" scroll-y="true" id="tableBody"
:lower-threshold="40"
@@ -49,7 +54,9 @@
@scrolltoupper="(e)=>debounce(scrollToLeft)(e)"
@scroll="handleBodyScroll" :scroll-left="bodyTableLeft" :scroll-top="bodyScrollTop"
:style=" `height: calc(100% - ${showSummary?80:40}px)`" >
<view class="zb-table-fixed">
<zb-loading v-if="isLoading"/>
<view class="zb-table-fixed" v-else>
<view class="zb-table-tbody">
<view :class="['item-tr',highlight&&isHighlight(item,index)?'current-row':'']"
@click.stop="rowClick(item,index)"
@@ -114,6 +121,7 @@
</view>
</view>
</view>
</scroll-view>
<table-h5-summary
:scrollbarSize="scrollbarSize"
@@ -227,8 +235,10 @@
<!-- #endif -->
<!-- #ifndef H5 || APP-PLUS -->
<view class="zb-table-applet">
<zb-loading v-if="isLoading"/>
<view class="zb-table-content">
<scroll-view
<!-- #ifdef MP-ALIPAY -->
@scroll="scrollAlipay"
<!-- #endif -->
@@ -242,9 +252,9 @@
<!-- #endif -->
scroll-y="true"
scroll-x="true">
<view class="zb-table-scroll" >
<view class="zb-table-scroll">
<template v-if="showHeader">
<view class="zb-table-header top-header-uni" style="">
<view class="zb-table-header top-header-uni">
<view class="zb-table-fixed thead-calculation" >
<view class="zb-table-thead" style="position: relative;" >
<view class="item-tr">
@@ -257,9 +267,12 @@
v-for="(item,index) in transColumns.columns">
<table-header-item
:item="item"
:cellHeaderStyle="cellHeaderStyle"
@sortAction="sortAction"
:border="border"
:multify="multify"
:realColumns="transColumns.realColumns"
:wrapIndex ='index'
@checkboxSelectedAll="checkboxSelectedAll"
:indeterminate="indeterminate"
:checkedAll="checkedAll"
@@ -278,8 +291,9 @@
<template v-if="!data.length">
<view class="no-data">暂无数据~~</view>
</template>
<view class="zb-table-fixed">
<view class="zb-table-tbody">
<view class="zb-table-fixed" >
<view class="zb-table-tbody" >
<view :class="['item-tr',highlight&&isHighlight(item,index)?'current-row':'']"
@click.stop="rowClick(item,index)"
v-for="(item,index) in transData" :key="item.key" >
@@ -364,12 +378,14 @@ import TableSummary from "./components/table-summary.vue";
import TableSideSummary from "./components/table-side-summary.vue";
import TableH5Summary from './components/table-h5-summary'
import ZbLoadMore from './components/zb-load-more'
import ZbLoading from './components/zb-loading'
import TableHeaderItem from './components/table-header-item'
import AppHeaderItem from './components/app-header-item'
import {getScrollbarSize} from "./js/util";
export default {
components:{
ZbLoading,
TableCheckbox,
TableSummary,
TableSideSummary,
@@ -384,6 +400,10 @@ export default {
type:Boolean,
default:false
},
isLoading:{
type:Boolean,
default:false
},
itemDate:{
type:Object,
default:()=>{}
@@ -427,7 +447,8 @@ export default {
rowKey:[String, Function],
summaryMethod:Function,
pullUpLoading:Function,
cellStyle:Function
cellStyle:Function,
cellHeaderStyle:Function
},
watch:{
columns:{
@@ -540,7 +561,7 @@ export default {
}
item.emptyString = item.emptyString||'--'
})
let realColumns = this.renderRealColumns(JSON.parse(JSON.stringify(this.columns)))
let realColumns = this.renderRealColumns(this.columns)
return {
columns:this.columns,
realColumns:realColumns
@@ -611,6 +632,7 @@ export default {
alipayScrollOldTop:0,
alipayFlag:false,
bodyTableLeft:0,
multify:[],
h5HeaderHeight:'auto',
headerTableLeft:0,
lastScrollLeft:0,
@@ -659,10 +681,11 @@ export default {
renderRealColumns(list=[]){
if(!list.length) return []
let arr = []
function deep(data){
const deep = (data)=>{
data.forEach(item=>{
let { children, ...obj } = item
if(children&&children.length){
this.multify.push(item)
deep(children)
}else {
arr.push({...obj})
@@ -690,7 +713,7 @@ export default {
}
this.alipayFlag = false
this.alipayScrollOldTop = null
},500)
},60)
},
pullLoad(){
if(this.isShowLoadMore){
@@ -844,16 +867,29 @@ export default {
return false
},
sortAction(item,index){
if(!item.sorter){return false}
let obj = item
// #ifndef H5 || APP-PLUS
for(let ite of this.transColumns.columns){
if(item.name===item.name&&item.label===ite.label){
ite.sorterMode = item.sorterMode==='_asc'?'_desc':'_asc'
obj = ite
break
}
}
this.$forceUpdate()
// #endif
// #ifdef H5 || APP-PLUS
this.$set(item,'sorterMode',item.sorterMode==='_asc'?'_desc':'_asc')
// #endif
if(item.sorter==='custom'){
this.$emit('sort-change',item,item.sorterMode.replace('_',''),index)
this.$emit('sort-change',obj,obj.sorterMode.replace('_',''),index)
}else {
this.sortData(item)
}
// #ifndef H5 || APP-PLUS
this.$forceUpdate()
// #endif
},
sortData(item){
let key = item.name

View File

@@ -1,7 +1,7 @@
{
"id": "zb-table",
"displayName": "zb-table多功能表格",
"version": "1.2.3",
"version": "1.2.4",
"description": "表格组件 支持固定表头和首列、上拉加载更多、及固定多列表格自适应内容排序多级表头多选checkbox、可点击删除编辑、合计功能兼容多端",
"keywords": [
"table",

View File

@@ -18,9 +18,11 @@ table 表格 固定表头、固定首列、多列 上拉加载更多、 排序
| data | 显示的数据 | array |-- | -- |必须 |
| column | 显示的列数据 | array |-- | -- |必须 |
| stripe | 是否为斑马纹 table| boolean | - |false | 否 |
| isLoading | 是否显示loading,动态控制 | boolean | - |false | 否 |
| fit | 列的宽度是否自撑开 | boolean |true,false | false |否 |
| show-header | 是否显示表头 | boolean |true,false | true |否 |
| cell-style | 单元格的 style 的回调方法,也可以使用一个固定的 Object 为所有单元格设置一样的 Style。 | Function({row, column, rowIndex, columnIndex})/Object |-- | -- |否 |
| cell-header-style | 头部单元格的 style 的回调方法,也可以使用一个固定的 Object 为所有单元格设置一样的 Style。 | Function({ column, columnIndex})/Object |-- | -- |否 |
| border | 是否带有纵向边框 | boolean |true,false | true |否 |
| highlight | 是否要高亮当前行 | boolean |true,false | false |否 |
| show-summary | 是否在表尾显示合计行 | boolean |true,false | false |否 |

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -105,11 +105,11 @@
/******/
/******/
/******/ // mini-css-extract-plugin CSS loading
/******/ var cssChunks = {"uni_modules/zb-table/components/zb-table/zb-table":1,"uni_modules/uni-card/components/uni-card/uni-card":1,"pages/mul/item":1,"uni_modules/zb-table/components/zb-table/components/table-h5-summary":1,"uni_modules/zb-table/components/zb-table/components/table-side-summary":1,"uni_modules/zb-table/components/zb-table/components/table-summary":1,"uni_modules/zb-table/components/zb-table/components/app-header-item":1,"uni_modules/zb-table/components/zb-table/components/table-checkbox":1,"uni_modules/zb-table/components/zb-table/components/table-header-item":1,"uni_modules/zb-table/components/zb-table/components/zb-load-more":1};
/******/ var cssChunks = {"uni_modules/zb-table/components/zb-table/zb-table":1,"uni_modules/uni-card/components/uni-card/uni-card":1,"pages/mul/item":1,"uni_modules/zb-table/components/zb-table/components/table-h5-summary":1,"uni_modules/zb-table/components/zb-table/components/table-side-summary":1,"uni_modules/zb-table/components/zb-table/components/table-summary":1,"uni_modules/zb-table/components/zb-table/components/app-header-item":1,"uni_modules/zb-table/components/zb-table/components/table-checkbox":1,"uni_modules/zb-table/components/zb-table/components/table-header-item":1,"uni_modules/zb-table/components/zb-table/components/zb-load-more":1,"uni_modules/zb-table/components/zb-table/components/zb-loading":1};
/******/ if(installedCssChunks[chunkId]) promises.push(installedCssChunks[chunkId]);
/******/ else if(installedCssChunks[chunkId] !== 0 && cssChunks[chunkId]) {
/******/ promises.push(installedCssChunks[chunkId] = new Promise(function(resolve, reject) {
/******/ var href = "" + ({"uni_modules/zb-table/components/zb-table/zb-table":"uni_modules/zb-table/components/zb-table/zb-table","uni_modules/uni-card/components/uni-card/uni-card":"uni_modules/uni-card/components/uni-card/uni-card","pages/mul/item":"pages/mul/item","uni_modules/zb-table/components/zb-table/components/table-h5-summary":"uni_modules/zb-table/components/zb-table/components/table-h5-summary","uni_modules/zb-table/components/zb-table/components/table-side-summary":"uni_modules/zb-table/components/zb-table/components/table-side-summary","uni_modules/zb-table/components/zb-table/components/table-summary":"uni_modules/zb-table/components/zb-table/components/table-summary","uni_modules/zb-table/components/zb-table/components/app-header-item":"uni_modules/zb-table/components/zb-table/components/app-header-item","uni_modules/zb-table/components/zb-table/components/table-checkbox":"uni_modules/zb-table/components/zb-table/components/table-checkbox","uni_modules/zb-table/components/zb-table/components/table-header-item":"uni_modules/zb-table/components/zb-table/components/table-header-item","uni_modules/zb-table/components/zb-table/components/zb-load-more":"uni_modules/zb-table/components/zb-table/components/zb-load-more"}[chunkId]||chunkId) + ".acss";
/******/ var href = "" + ({"uni_modules/zb-table/components/zb-table/zb-table":"uni_modules/zb-table/components/zb-table/zb-table","uni_modules/uni-card/components/uni-card/uni-card":"uni_modules/uni-card/components/uni-card/uni-card","pages/mul/item":"pages/mul/item","uni_modules/zb-table/components/zb-table/components/table-h5-summary":"uni_modules/zb-table/components/zb-table/components/table-h5-summary","uni_modules/zb-table/components/zb-table/components/table-side-summary":"uni_modules/zb-table/components/zb-table/components/table-side-summary","uni_modules/zb-table/components/zb-table/components/table-summary":"uni_modules/zb-table/components/zb-table/components/table-summary","uni_modules/zb-table/components/zb-table/components/app-header-item":"uni_modules/zb-table/components/zb-table/components/app-header-item","uni_modules/zb-table/components/zb-table/components/table-checkbox":"uni_modules/zb-table/components/zb-table/components/table-checkbox","uni_modules/zb-table/components/zb-table/components/table-header-item":"uni_modules/zb-table/components/zb-table/components/table-header-item","uni_modules/zb-table/components/zb-table/components/zb-load-more":"uni_modules/zb-table/components/zb-table/components/zb-load-more","uni_modules/zb-table/components/zb-table/components/zb-loading":"uni_modules/zb-table/components/zb-table/components/zb-loading"}[chunkId]||chunkId) + ".acss";
/******/ var fullhref = __webpack_require__.p + href;
/******/ var existingLinkTags = document.getElementsByTagName("link");
/******/ for(var i = 0; i < existingLinkTags.length; i++) {

View File

@@ -1638,7 +1638,7 @@ function initData(vueOptions, context) {
try {
data = data.call(context); // 支持 Vue.prototype 上挂的数据
} catch (e) {
if (Object({"VUE_APP_NAME":"zzb-table","VUE_APP_PLATFORM":"mp-alipay","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
if (Object({"NODE_ENV":"development","VUE_APP_NAME":"zzb-table","VUE_APP_PLATFORM":"mp-alipay","BASE_URL":"/"}).VUE_APP_DEBUG) {
console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
}
}
@@ -8677,7 +8677,7 @@ function type(obj) {
function flushCallbacks$1(vm) {
if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
if (Object({"VUE_APP_NAME":"zzb-table","VUE_APP_PLATFORM":"mp-alipay","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
if (Object({"NODE_ENV":"development","VUE_APP_NAME":"zzb-table","VUE_APP_PLATFORM":"mp-alipay","BASE_URL":"/"}).VUE_APP_DEBUG) {
var mpInstance = vm.$scope;
console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
@@ -8698,14 +8698,14 @@ function nextTick$1(vm, cb) {
//1.nextTick 之前 已 setData 且 setData 还未回调完成
//2.nextTick 之前存在 render watcher
if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
if(Object({"VUE_APP_NAME":"zzb-table","VUE_APP_PLATFORM":"mp-alipay","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
if(Object({"NODE_ENV":"development","VUE_APP_NAME":"zzb-table","VUE_APP_PLATFORM":"mp-alipay","BASE_URL":"/"}).VUE_APP_DEBUG){
var mpInstance = vm.$scope;
console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
']:nextVueTick');
}
return nextTick(cb, vm)
}else{
if(Object({"VUE_APP_NAME":"zzb-table","VUE_APP_PLATFORM":"mp-alipay","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
if(Object({"NODE_ENV":"development","VUE_APP_NAME":"zzb-table","VUE_APP_PLATFORM":"mp-alipay","BASE_URL":"/"}).VUE_APP_DEBUG){
var mpInstance$1 = vm.$scope;
console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
']:nextMPTick');
@@ -8791,7 +8791,7 @@ var patch = function(oldVnode, vnode) {
});
var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
if (Object.keys(diffData).length) {
if (Object({"VUE_APP_NAME":"zzb-table","VUE_APP_PLATFORM":"mp-alipay","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
if (Object({"NODE_ENV":"development","VUE_APP_NAME":"zzb-table","VUE_APP_PLATFORM":"mp-alipay","BASE_URL":"/"}).VUE_APP_DEBUG) {
console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
']差量更新',
JSON.stringify(diffData));

File diff suppressed because one or more lines are too long

View File

@@ -329,6 +329,8 @@ __webpack_require__.r(__webpack_exports__);
@@ -503,12 +505,12 @@ var _all = __webpack_require__(/*! ./all.js */ 16); //
//
//
//
//
//
var that = null;var _default = { components: {}, data: function data() {return { column1: _all.column1, column2: _all.column2, column3: _all.column3, column4: _all.column4, column5: _all.column5, title: 'Hello', column: [{ type: 'selection', fixed: true, width: 60 }, { name: 'name', label: '姓名', fixed: true, width: 80, emptyString: '--' }, { name: 'age', label: '年龄', sorter: 'custom', align: 'right', fixed: false }, { name: 'sex', label: '性别', filters: { 0: '男', 1: '女' } }, { name: 'price', label: '价格' }, { name: 'admin', label: '账号' }, { name: 'address', label: '地址' }, { name: 'date', label: '日期', sorter: true }, { name: 'province', label: '省份' }, { name: 'city', label: '城市' }, { name: 'zip', label: '邮编' }, { name: 'img', label: '图片', type: "img", align: "center" }, { name: 'operation', type: 'operation', label: '操作', renders: [{ name: '编辑', class: 'edit', type: "primary", func: 'edit' // func 代表子元素点击的事件 父元素接收的事件 父元素 @edit
}, { name: '自定义按钮', type: 'custom', // type 为custom的时候自定义按钮
class: "custom", func: 'custom' }, { name: '删除', type: 'warn', // type 为custom的时候自定义按钮
class: "del", func: 'dele' }] }], data: [{ date: '2016-05-02', name: '', price: 0, province: '上海', admin: "admin", sex: '1', checked: true, id: "20", img: "https://img1.baidu.com/it/u=300787145,1214060415&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500", age: 0, city: '普陀区', address: '上海市普上海市普上海市普上海市普', zip: 200333 }, { date: '2016-05-01', name: '王小虎2', province: '上海', sex: '0', price: 0, id: "2", age: 12, city: '普陀区', img: "https://img.pddpic.com/mms-material-img/2020-11-27/84c7fad3-d945-4e71-ab09-7a1ed80f6055.jpeg.a.jpeg", address: '上海市普', zip: 200333 }, { date: '2022-03-25T09:27:42', name: '王小虎3', province: '上海', sex: 1, price: 33, id: "3", age: '15', img: "https://img1.baidu.com/it/u=300787145,1214060415&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500", city: '普陀区', address: '上海市普', zip: 200333555 }, { date: '2016-04-02', name: '王小虎4', province: '上海', sex: 1, age: '11', price: 33, id: "4", img: "https://img1.baidu.com/it/u=300787145,1214060415&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500", city: '普陀区', address: '上海市普', zip: 200333 }, { date: '2016-03-02', name: '王小虎5', province: '上海', price: 0, sex: 1, age: '14', img: "https://img1.baidu.com/it/u=300787145,1214060415&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500", id: "5", city: '普陀区', address: '上海市普', zip: 200333 }, { date: '2014-05-02', name: '王小虎6', province: '上海', price: 33, sex: 1, id: "6", age: '12', img: "https://img1.baidu.com/it/u=300787145,1214060415&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500", city: '普陀区', address: '上海市普', zip: 0 }, { date: '2019-05-02', name: '王小虎7', price: 33, province: '上海', sex: 1, age: 0, id: "7", city: '普陀区', img: "https://img1.baidu.com/it/u=300787145,1214060415&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500", address: '上海市普', zip: 200333 }, { date: '2012-05-02', name: '王小虎8', province: '上海', price: 0, sex: 1, age: '29', id: "8", city: '普陀区', img: "https://img1.baidu.com/it/u=300787145,1214060415&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500", address: '上海市普', zip: 200333 }, { date: '2011-05-02', name: '王小虎91', price: 33, img: "https://img1.baidu.com/it/u=300787145,1214060415&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500", province: '上海', sex: 1, id: "9", age: '30', city: '普陀区', address: '上海市普', zip: 200333 }, { date: '2011-05-02', name: '王小虎10', province: '上海', sex: 1, id: "10", age: '30', img: "https://img1.baidu.com/it/u=300787145,1214060415&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500", city: '普陀区', address: '上海市普', zip: 200333 }, { date: '2011-05-02',
name: '王小虎20',
province: '上海',
class: "del", func: 'dele' }] }], data: [{ date: '2016-05-02', name: '', price: 0, province: '上海', admin: "admin", sex: '1', checked: true, id: "20", img: "https://img1.baidu.com/it/u=300787145,1214060415&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500", age: 0, city: '普陀区', address: '上海市普上海市普上海市普上海市普', zip: 200333 }, { date: '2016-05-01', name: '王小虎2', province: '上海', sex: '0', price: 0, id: "2", age: 12, city: '普陀区', img: "https://img.pddpic.com/mms-material-img/2020-11-27/84c7fad3-d945-4e71-ab09-7a1ed80f6055.jpeg.a.jpeg", address: '上海市普', zip: 200333 }, { date: '2022-03-25T09:27:42', name: '王小虎3', province: '上海', sex: 1, price: 33, id: "3", age: '15', img: "https://img1.baidu.com/it/u=300787145,1214060415&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500", city: '普陀区', address: '上海市普', zip: 200333555 }, { date: '2016-04-02', name: '王小虎4', province: '上海', sex: 1, age: '11', price: 33, id: "4", img: "https://img1.baidu.com/it/u=300787145,1214060415&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500", city: '普陀区', address: '上海市普', zip: 200333 }, { date: '2016-03-02', name: '王小虎5', province: '上海', price: 0, sex: 1, age: '14', img: "https://img1.baidu.com/it/u=300787145,1214060415&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500", id: "5", city: '普陀区', address: '上海市普', zip: 200333 }, { date: '2014-05-02', name: '王小虎6', province: '上海', price: 33, sex: 1, id: "6", age: '12', img: "https://img1.baidu.com/it/u=300787145,1214060415&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500", city: '普陀区', address: '上海市普', zip: 0 }, { date: '2019-05-02', name: '王小虎7', price: 33, province: '上海', sex: 1, age: 0, id: "7", city: '普陀区', img: "https://img1.baidu.com/it/u=300787145,1214060415&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500", address: '上海市普', zip: 200333 }, { date: '2012-05-02', name: '王小虎8', province: '上海', price: 0, sex: 1, age: '29', id: "8", city: '普陀区', img: "https://img1.baidu.com/it/u=300787145,1214060415&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500", address: '上海市普', zip: 200333 }, { date: '2011-05-02', name: '王小虎91', price: 33, img: "https://img1.baidu.com/it/u=300787145,1214060415&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500", province: '上海', sex: 1, id: "9", age: '30', city: '普陀区', address: '上海市普', zip: 200333 }, { date: '2011-05-02', name: '王小虎10', province: '上海', sex: 1, id: "10", age: '30', img: "https://img1.baidu.com/it/u=300787145,1214060415&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500", city: '普陀区', address: '上海市普', zip: 200333 }, { date: '2011-05-02', name: '王小虎20', province: '上海',
sex: 1,
price: 33,
id: "11",
@@ -523,6 +525,7 @@ var that = null;var _default = { components: {}, data: function data() {return {
flag2: true,
num: 0,
num1: 0,
isLoading: true,
isShowLoadMore: true };
},
@@ -532,15 +535,12 @@ var that = null;var _default = { components: {}, data: function data() {return {
created: function created() {
that = this;
},
mounted: function mounted() {
mounted: function mounted() {var _this = this;
this.data1 = JSON.parse(JSON.stringify(this.data));
var data2 = JSON.parse(JSON.stringify(this.data));
setTimeout(function () {
// data2.forEach(item=>{
// item.checked = true
// })
// this.data = data2
}, 3000);
_this.isLoading = false;
}, 1500);
},
methods: {
permissionBtn: function permissionBtn(row, renders, rowIndex) {
@@ -551,10 +551,32 @@ var that = null;var _default = { components: {}, data: function data() {return {
return renders;
},
sortChange: function sortChange(item, sorterMode, index) {
uni.showToast({
icon: 'none',
duration: 3000,
title: '触发自定义排序,通过接口返回排序,不默认排序' });
console.log('触发排序', item, sorterMode, index);
},
cellStyle: function cellStyle(_ref) {var row = _ref.row,column = _ref.column,rowIndex = _ref.rowIndex,columnIndex = _ref.columnIndex;
cellHeaderStyle: function cellHeaderStyle(_ref) {var column = _ref.column,columnIndex = _ref.columnIndex;
if (columnIndex === 1 || columnIndex === 4) {
return {
color: 'red' };
}
// if(column.children){
// for(let item of column.children){
// if(item.name==='province'){
// return{
// color:'red'
// }
// }
// }
// }
},
cellStyle: function cellStyle(_ref2) {var row = _ref2.row,column = _ref2.column,rowIndex = _ref2.rowIndex,columnIndex = _ref2.columnIndex;
// console.log('row, column, rowIndex, columnIndex')
if (columnIndex === 1 || columnIndex === 4) {
return {
@@ -562,40 +584,40 @@ var that = null;var _default = { components: {}, data: function data() {return {
}
},
pullUpLoading: function pullUpLoading(done) {var _this = this;
pullUpLoading: function pullUpLoading(done) {var _this2 = this;
if (!this.flag1) {
return;
}
setTimeout(function () {
_this.data.push({
_this2.data.push({
date: '2011-05-02',
name: '王小虎23',
province: '上海',
sex: 1,
price: 33,
id: 11111 + _this.num,
id: 11111 + _this2.num,
age: '30',
city: '普陀区',
address: '上海市普',
zip: 200333 });
_this.num++;
if (_this.num === 3) {
_this2.num++;
if (_this2.num === 3) {
done('ok');
_this.flag1 = false;
_this2.flag1 = false;
} else {
done();
}
}, 2000);
},
pullUpLoadingAction: function pullUpLoadingAction(done) {var _this2 = this;
pullUpLoadingAction: function pullUpLoadingAction(done) {var _this3 = this;
if (!this.flag2) {
return;
}
setTimeout(function () {
_this2.data.push({
_this3.data.push({
date: '2011-05-02',
name: '王小虎23',
province: '上海',
@@ -608,12 +630,12 @@ var that = null;var _default = { components: {}, data: function data() {return {
zip: 200333 });
_this2.num1++;
if (_this2.num1 === 3) {
_this2.$refs.zbTable.pullUpCompleteLoading('ok');
_this2.flag2 = false;
_this3.num1++;
if (_this3.num1 === 3) {
_this3.$refs.zbTable.pullUpCompleteLoading('ok');
_this3.flag2 = false;
} else {
_this2.$refs.zbTable.pullUpCompleteLoading();
_this3.$refs.zbTable.pullUpCompleteLoading();
}
}, 1000);
},

View File

@@ -1 +1 @@
<view class="zb-table-footer data-v-6a330a4c" style="height:40px;"><view class="zb-table-fixed data-v-6a330a4c"><view class="zb-table-thead data-v-6a330a4c" style="position:relative;"><view class="item-tr data-v-6a330a4c"><view class="{{((('data-v-6a330a4c')+' '+'item-th')+' '+(index<fixedLeftColumns.length&&'zb-stick-side'))}}" style="{{'left:'+(item.left+'px')+';'+('width:'+((item.width?item.width:'100')+'px')+';')+('flex:'+(index===transColumns.length-1?1:'none')+';')+('min-width:'+((item.width?item.width:'100')+'px')+';')+('border-right:'+(''+(border?'1px solid #e8e8e8':''))+';')+('border-top:'+(''+(border?'1px solid #e8e8e8':''))+';')+('text-align:'+(item.align||'left')+';')}}" a:for="{{transColumns}}" a:for-item="item" a:for-index="index" a:key="index">{{''+(sums[index]||item.emptyString)+''}}</view></view></view></view></view>
<view class="zb-table-footer data-v-6a330a4c" style="height:40px;flex-shrink:0;"><view class="zb-table-fixed data-v-6a330a4c"><view class="zb-table-thead data-v-6a330a4c" style="position:relative;"><view class="item-tr data-v-6a330a4c"><view class="{{((('data-v-6a330a4c')+' '+'item-th')+' '+(index<fixedLeftColumns.length&&'zb-stick-side'))}}" style="{{'left:'+(item.left+'px')+';'+('width:'+((item.width?item.width:'100')+'px')+';')+('flex:'+(index===transColumns.length-1?1:'none')+';')+('min-width:'+((item.width?item.width:'100')+'px')+';')+('border-right:'+(''+(border?'1px solid #e8e8e8':''))+';')+('border-top:'+(''+(border?'1px solid #e8e8e8':''))+';')+('text-align:'+(item.align||'left')+';')}}" a:for="{{transColumns}}" a:for-item="item" a:for-index="index" a:key="index">{{''+(sums[index]||item.emptyString)+''}}</view></view></view></view></view>

View File

@@ -1 +1 @@
<view class="zb-table-applet"><view class="zb-table-content"><scroll-view style="height:100%;overflow-x:scroll;" scroll-y="true" scroll-x="true" data-event-opts="{{[['scroll',[['scrollAlipay',['$event']]]],['scrollToLower',[['scrolltolower',['$event']]]]]}}" onScroll="__e" onScrollToLower="__e"><view class="zb-table-scroll"><block a:if="{{showHeader}}"><view class="zb-table-header top-header-uni"><view class="zb-table-fixed thead-calculation"><view class="zb-table-thead" style="position:relative;"><view class="item-tr"><view class="{{(index<fixedLeftColumns.length&&'zb-stick-side')}}" style="{{'left:'+(item.left+'px')+';'}}" a:for="{{transColumns.columns}}" a:for-item="item" a:for-index="index" a:key="index"><table-header-item vue-id="{{'815aed16-1-'+index}}" item="{{item}}" border="{{border}}" indeterminate="{{indeterminate}}" checkedAll="{{checkedAll}}" transColumns="{{transColumns.columns}}" index="{{index}}" fixedLeftColumns="{{fixedLeftColumns}}" scrollbarSize="{{scrollbarSize}}" data-event-opts="{{[['^sortAction',[['sortAction']]],['^checkboxSelectedAll',[['checkboxSelectedAll']]]]}}" onSortAction="__e" onCheckboxSelectedAll="__e" onVueInit="__l"></table-header-item></view></view></view></view></view></block><block a:if="{{!data.length}}"><view class="no-data">暂无数据~~</view></block><view class="zb-table-fixed"><view class="zb-table-tbody"><view data-event-opts="{{[['tap',[['rowClick',['$0',index],[[['transData','key',item.$orig.key]]]]]]]}}" class="{{(('item-tr')+' '+(item.m0?'current-row':''))}}" catchTap="__e" a:for="{{$root.l2}}" a:for-item="item" a:for-index="index" a:key="key"><view class="{{((('item-td')+' '+(i<fixedLeftColumns.length&&'zb-stick-side'))+' '+(stripe?index%2!=0?'odd':'even':''))}}" style="{{ite.s0}}" a:for="{{item.l1}}" a:for-item="ite" a:for-index="i" a:key="i"><block a:if="{{ite.$orig.type==='operation'}}"><view style="display:flex;align-items:center;height:100%;"><view data-event-opts="{{[['tap',[['e0',['$event']]]]]}}" data-event-params="{{({ren,item:item.$orig,index})}}" style="{{'display:'+('flex')+';'+('align-items:'+('center')+';')+('margin-right:'+(ite.$orig.renders.length>1?'8px':'0')+';')}}" onTap="__e" a:for="{{ite.l0}}" a:for-item="ren" a:for-index="ind" a:key="ind"><block a:if="{{ren.type==='custom'}}"><view class="{{(ren.class||'')}}" style="cursor:pointer;">{{''+ren.name+''}}</view></block><block a:else><button class="{{(ren.class||'')}}" type="{{ren.type||'primary'}}" size="{{ren.size||'mini'}}">{{ren.name}}</button></block></view></view></block><block a:else><block a:if="{{ite.$orig.type==='selection'}}"><view class="checkbox-item"><table-checkbox vue-id="{{'815aed16-2-'+index+'-'+i}}" cellData="{{item.$orig}}" checked="{{item.$orig.checked}}" data-event-opts="{{[['^checkboxSelected',[['e1']]]]}}" data-event-params="{{({item:item.$orig})}}" onCheckboxSelected="__e" onVueInit="__l"></table-checkbox></view></block><block a:else><block a:if="{{ite.$orig.type==='img'}}"><block a:if="{{item.$orig[ite.$orig.name]}}"><image style="width:40px;height:30px;" show-menu-by-longpress="{{false}}" src="{{item.$orig[ite.$orig.name]}}" mode="aspectFit" data-event-opts="{{[['tap',[['previewImage',['$0','$1',index],[[['transData','key',item.$orig.key]],[['transData','key',item.$orig.key,''+ite.$orig.name+'']]]]]]]}}" catchTap="__e"></image></block><block a:else><text>{{ite.$orig.emptyString}}</text></block></block><block a:else><block a:if="{{ite.$orig.type==='index'}}">{{''+(index+1)+''}}</block><block a:else>{{''+(ite.$orig.filters?ite.m1:item.$orig[ite.$orig.name]==null||item.$orig[ite.$orig.name]===''?ite.$orig.emptyString:item.$orig[ite.$orig.name])+''}}</block></block></block></block></view></view></view></view><block a:if="{{showSummary}}"><table-summary vue-id="815aed16-3" data="{{data}}" showSummary="{{showSummary}}" fixedLeftColumns="{{fixedLeftColumns}}" transColumns="{{transColumns.columns}}" border="{{border}}" summary-method="{{summaryMethod}}" sumText="{{sumText}}" onVueInit="__l"></table-summary></block></view></scroll-view></view><block a:if="{{isLoadMore&&!completeLoading}}"><zb-load-more vue-id="815aed16-4" onVueInit="__l"></zb-load-more></block></view>
<view class="zb-table-applet"><block a:if="{{isLoading}}"><zb-loading vue-id="815aed16-1" onVueInit="__l"></zb-loading></block><view class="zb-table-content"><scroll-view style="height:100%;overflow-x:scroll;" scroll-y="true" scroll-x="true" data-event-opts="{{[['scroll',[['scrollAlipay',['$event']]]],['scrollToLower',[['scrolltolower',['$event']]]]]}}" onScroll="__e" onScrollToLower="__e"><view class="zb-table-scroll"><block a:if="{{showHeader}}"><view class="zb-table-header top-header-uni"><view class="zb-table-fixed thead-calculation"><view class="zb-table-thead" style="position:relative;"><view class="item-tr"><view class="{{(index<fixedLeftColumns.length&&'zb-stick-side')}}" style="{{'left:'+(item.left+'px')+';'}}" a:for="{{transColumns.columns}}" a:for-item="item" a:for-index="index" a:key="index"><table-header-item vue-id="{{'815aed16-2-'+index}}" item="{{item}}" cellHeaderStyle="{{cellHeaderStyle}}" border="{{border}}" multify="{{multify}}" realColumns="{{transColumns.realColumns}}" wrapIndex="{{index}}" indeterminate="{{indeterminate}}" checkedAll="{{checkedAll}}" transColumns="{{transColumns.columns}}" index="{{index}}" fixedLeftColumns="{{fixedLeftColumns}}" scrollbarSize="{{scrollbarSize}}" data-event-opts="{{[['^sortAction',[['sortAction']]],['^checkboxSelectedAll',[['checkboxSelectedAll']]]]}}" onSortAction="__e" onCheckboxSelectedAll="__e" onVueInit="__l"></table-header-item></view></view></view></view></view></block><block a:if="{{!data.length}}"><view class="no-data">暂无数据~~</view></block><view class="zb-table-fixed"><view class="zb-table-tbody"><view data-event-opts="{{[['tap',[['rowClick',['$0',index],[[['transData','key',item.$orig.key]]]]]]]}}" class="{{(('item-tr')+' '+(item.m0?'current-row':''))}}" catchTap="__e" a:for="{{$root.l2}}" a:for-item="item" a:for-index="index" a:key="key"><view class="{{((('item-td')+' '+(i<fixedLeftColumns.length&&'zb-stick-side'))+' '+(stripe?index%2!=0?'odd':'even':''))}}" style="{{ite.s0}}" a:for="{{item.l1}}" a:for-item="ite" a:for-index="i" a:key="i"><block a:if="{{ite.$orig.type==='operation'}}"><view style="display:flex;align-items:center;height:100%;"><view data-event-opts="{{[['tap',[['e0',['$event']]]]]}}" data-event-params="{{({ren,item:item.$orig,index})}}" style="{{'display:'+('flex')+';'+('align-items:'+('center')+';')+('margin-right:'+(ite.$orig.renders.length>1?'8px':'0')+';')}}" onTap="__e" a:for="{{ite.l0}}" a:for-item="ren" a:for-index="ind" a:key="ind"><block a:if="{{ren.type==='custom'}}"><view class="{{(ren.class||'')}}" style="cursor:pointer;">{{''+ren.name+''}}</view></block><block a:else><button class="{{(ren.class||'')}}" type="{{ren.type||'primary'}}" size="{{ren.size||'mini'}}">{{ren.name}}</button></block></view></view></block><block a:else><block a:if="{{ite.$orig.type==='selection'}}"><view class="checkbox-item"><table-checkbox vue-id="{{'815aed16-3-'+index+'-'+i}}" cellData="{{item.$orig}}" checked="{{item.$orig.checked}}" data-event-opts="{{[['^checkboxSelected',[['e1']]]]}}" data-event-params="{{({item:item.$orig})}}" onCheckboxSelected="__e" onVueInit="__l"></table-checkbox></view></block><block a:else><block a:if="{{ite.$orig.type==='img'}}"><block a:if="{{item.$orig[ite.$orig.name]}}"><image style="width:40px;height:30px;" show-menu-by-longpress="{{false}}" src="{{item.$orig[ite.$orig.name]}}" mode="aspectFit" data-event-opts="{{[['tap',[['previewImage',['$0','$1',index],[[['transData','key',item.$orig.key]],[['transData','key',item.$orig.key,''+ite.$orig.name+'']]]]]]]}}" catchTap="__e"></image></block><block a:else><text>{{ite.$orig.emptyString}}</text></block></block><block a:else><block a:if="{{ite.$orig.type==='index'}}">{{''+(index+1)+''}}</block><block a:else>{{''+(ite.$orig.filters?ite.m1:item.$orig[ite.$orig.name]==null||item.$orig[ite.$orig.name]===''?ite.$orig.emptyString:item.$orig[ite.$orig.name])+''}}</block></block></block></block></view></view></view></view><block a:if="{{showSummary}}"><table-summary vue-id="815aed16-4" data="{{data}}" showSummary="{{showSummary}}" fixedLeftColumns="{{fixedLeftColumns}}" transColumns="{{transColumns.columns}}" border="{{border}}" summary-method="{{summaryMethod}}" sumText="{{sumText}}" onVueInit="__l"></table-summary></block></view></scroll-view></view><block a:if="{{isLoadMore&&!completeLoading}}"><zb-load-more vue-id="815aed16-5" onVueInit="__l"></zb-load-more></block></view>

File diff suppressed because one or more lines are too long

View File

@@ -1,6 +1,7 @@
{
"component": true,
"usingComponents": {
"zb-loading": "/uni_modules/zb-table/components/zb-table/components/zb-loading",
"table-checkbox": "/uni_modules/zb-table/components/zb-table/components/table-checkbox",
"table-summary": "/uni_modules/zb-table/components/zb-table/components/table-summary",
"table-side-summary": "/uni_modules/zb-table/components/zb-table/components/table-side-summary",

View File

@@ -10,5 +10,6 @@
"navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8"
},
"usingComponents": {}
"usingComponents": {},
"sitemapLocation": "sitemap.json"
}

View File

@@ -105,11 +105,11 @@
/******/
/******/
/******/ // mini-css-extract-plugin CSS loading
/******/ var cssChunks = {"uni_modules/zb-table/components/zb-table/zb-table":1,"uni_modules/uni-card/components/uni-card/uni-card":1,"pages/mul/item":1,"uni_modules/zb-table/components/zb-table/components/table-h5-summary":1,"uni_modules/zb-table/components/zb-table/components/table-side-summary":1,"uni_modules/zb-table/components/zb-table/components/table-summary":1,"uni_modules/zb-table/components/zb-table/components/app-header-item":1,"uni_modules/zb-table/components/zb-table/components/table-checkbox":1,"uni_modules/zb-table/components/zb-table/components/table-header-item":1,"uni_modules/zb-table/components/zb-table/components/zb-load-more":1};
/******/ var cssChunks = {"uni_modules/zb-table/components/zb-table/zb-table":1,"uni_modules/uni-card/components/uni-card/uni-card":1,"pages/mul/item":1,"uni_modules/zb-table/components/zb-table/components/table-h5-summary":1,"uni_modules/zb-table/components/zb-table/components/table-side-summary":1,"uni_modules/zb-table/components/zb-table/components/table-summary":1,"uni_modules/zb-table/components/zb-table/components/app-header-item":1,"uni_modules/zb-table/components/zb-table/components/table-checkbox":1,"uni_modules/zb-table/components/zb-table/components/table-header-item":1,"uni_modules/zb-table/components/zb-table/components/zb-load-more":1,"uni_modules/zb-table/components/zb-table/components/zb-loading":1};
/******/ if(installedCssChunks[chunkId]) promises.push(installedCssChunks[chunkId]);
/******/ else if(installedCssChunks[chunkId] !== 0 && cssChunks[chunkId]) {
/******/ promises.push(installedCssChunks[chunkId] = new Promise(function(resolve, reject) {
/******/ var href = "" + ({"uni_modules/zb-table/components/zb-table/zb-table":"uni_modules/zb-table/components/zb-table/zb-table","uni_modules/uni-card/components/uni-card/uni-card":"uni_modules/uni-card/components/uni-card/uni-card","pages/mul/item":"pages/mul/item","uni_modules/zb-table/components/zb-table/components/table-h5-summary":"uni_modules/zb-table/components/zb-table/components/table-h5-summary","uni_modules/zb-table/components/zb-table/components/table-side-summary":"uni_modules/zb-table/components/zb-table/components/table-side-summary","uni_modules/zb-table/components/zb-table/components/table-summary":"uni_modules/zb-table/components/zb-table/components/table-summary","uni_modules/zb-table/components/zb-table/components/app-header-item":"uni_modules/zb-table/components/zb-table/components/app-header-item","uni_modules/zb-table/components/zb-table/components/table-checkbox":"uni_modules/zb-table/components/zb-table/components/table-checkbox","uni_modules/zb-table/components/zb-table/components/table-header-item":"uni_modules/zb-table/components/zb-table/components/table-header-item","uni_modules/zb-table/components/zb-table/components/zb-load-more":"uni_modules/zb-table/components/zb-table/components/zb-load-more"}[chunkId]||chunkId) + ".wxss";
/******/ var href = "" + ({"uni_modules/zb-table/components/zb-table/zb-table":"uni_modules/zb-table/components/zb-table/zb-table","uni_modules/uni-card/components/uni-card/uni-card":"uni_modules/uni-card/components/uni-card/uni-card","pages/mul/item":"pages/mul/item","uni_modules/zb-table/components/zb-table/components/table-h5-summary":"uni_modules/zb-table/components/zb-table/components/table-h5-summary","uni_modules/zb-table/components/zb-table/components/table-side-summary":"uni_modules/zb-table/components/zb-table/components/table-side-summary","uni_modules/zb-table/components/zb-table/components/table-summary":"uni_modules/zb-table/components/zb-table/components/table-summary","uni_modules/zb-table/components/zb-table/components/app-header-item":"uni_modules/zb-table/components/zb-table/components/app-header-item","uni_modules/zb-table/components/zb-table/components/table-checkbox":"uni_modules/zb-table/components/zb-table/components/table-checkbox","uni_modules/zb-table/components/zb-table/components/table-header-item":"uni_modules/zb-table/components/zb-table/components/table-header-item","uni_modules/zb-table/components/zb-table/components/zb-load-more":"uni_modules/zb-table/components/zb-table/components/zb-load-more","uni_modules/zb-table/components/zb-table/components/zb-loading":"uni_modules/zb-table/components/zb-table/components/zb-loading"}[chunkId]||chunkId) + ".wxss";
/******/ var fullhref = __webpack_require__.p + href;
/******/ var existingLinkTags = document.getElementsByTagName("link");
/******/ for(var i = 0; i < existingLinkTags.length; i++) {

View File

@@ -947,7 +947,7 @@ function initData(vueOptions, context) {
try {
data = data.call(context); // 支持 Vue.prototype 上挂的数据
} catch (e) {
if (Object({"VUE_APP_NAME":"zzb-table","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
if (Object({"NODE_ENV":"development","VUE_APP_NAME":"zzb-table","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
}
}
@@ -7724,7 +7724,7 @@ function type(obj) {
function flushCallbacks$1(vm) {
if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
if (Object({"VUE_APP_NAME":"zzb-table","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
if (Object({"NODE_ENV":"development","VUE_APP_NAME":"zzb-table","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
var mpInstance = vm.$scope;
console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
@@ -7745,14 +7745,14 @@ function nextTick$1(vm, cb) {
//1.nextTick 之前 已 setData 且 setData 还未回调完成
//2.nextTick 之前存在 render watcher
if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
if(Object({"VUE_APP_NAME":"zzb-table","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
if(Object({"NODE_ENV":"development","VUE_APP_NAME":"zzb-table","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
var mpInstance = vm.$scope;
console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
']:nextVueTick');
}
return nextTick(cb, vm)
}else{
if(Object({"VUE_APP_NAME":"zzb-table","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
if(Object({"NODE_ENV":"development","VUE_APP_NAME":"zzb-table","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
var mpInstance$1 = vm.$scope;
console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
']:nextMPTick');
@@ -7838,7 +7838,7 @@ var patch = function(oldVnode, vnode) {
});
var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
if (Object.keys(diffData).length) {
if (Object({"VUE_APP_NAME":"zzb-table","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
if (Object({"NODE_ENV":"development","VUE_APP_NAME":"zzb-table","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
']差量更新',
JSON.stringify(diffData));

View File

@@ -329,6 +329,8 @@ __webpack_require__.r(__webpack_exports__);
@@ -503,12 +505,12 @@ var _all = __webpack_require__(/*! ./all.js */ 16); //
//
//
//
//
//
var that = null;var _default = { components: {}, data: function data() {return { column1: _all.column1, column2: _all.column2, column3: _all.column3, column4: _all.column4, column5: _all.column5, title: 'Hello', column: [{ type: 'selection', fixed: true, width: 60 }, { name: 'name', label: '姓名', fixed: true, width: 80, emptyString: '--' }, { name: 'age', label: '年龄', sorter: 'custom', align: 'right', fixed: false }, { name: 'sex', label: '性别', filters: { 0: '男', 1: '女' } }, { name: 'price', label: '价格' }, { name: 'admin', label: '账号' }, { name: 'address', label: '地址' }, { name: 'date', label: '日期', sorter: true }, { name: 'province', label: '省份' }, { name: 'city', label: '城市' }, { name: 'zip', label: '邮编' }, { name: 'img', label: '图片', type: "img", align: "center" }, { name: 'operation', type: 'operation', label: '操作', renders: [{ name: '编辑', class: 'edit', type: "primary", func: 'edit' // func 代表子元素点击的事件 父元素接收的事件 父元素 @edit
}, { name: '自定义按钮', type: 'custom', // type 为custom的时候自定义按钮
class: "custom", func: 'custom' }, { name: '删除', type: 'warn', // type 为custom的时候自定义按钮
class: "del", func: 'dele' }] }], data: [{ date: '2016-05-02', name: '', price: 0, province: '上海', admin: "admin", sex: '1', checked: true, id: "20", img: "https://img1.baidu.com/it/u=300787145,1214060415&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500", age: 0, city: '普陀区', address: '上海市普上海市普上海市普上海市普', zip: 200333 }, { date: '2016-05-01', name: '王小虎2', province: '上海', sex: '0', price: 0, id: "2", age: 12, city: '普陀区', img: "https://img.pddpic.com/mms-material-img/2020-11-27/84c7fad3-d945-4e71-ab09-7a1ed80f6055.jpeg.a.jpeg", address: '上海市普', zip: 200333 }, { date: '2022-03-25T09:27:42', name: '王小虎3', province: '上海', sex: 1, price: 33, id: "3", age: '15', img: "https://img1.baidu.com/it/u=300787145,1214060415&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500", city: '普陀区', address: '上海市普', zip: 200333555 }, { date: '2016-04-02', name: '王小虎4', province: '上海', sex: 1, age: '11', price: 33, id: "4", img: "https://img1.baidu.com/it/u=300787145,1214060415&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500", city: '普陀区', address: '上海市普', zip: 200333 }, { date: '2016-03-02', name: '王小虎5', province: '上海', price: 0, sex: 1, age: '14', img: "https://img1.baidu.com/it/u=300787145,1214060415&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500", id: "5", city: '普陀区', address: '上海市普', zip: 200333 }, { date: '2014-05-02', name: '王小虎6', province: '上海', price: 33, sex: 1, id: "6", age: '12', img: "https://img1.baidu.com/it/u=300787145,1214060415&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500", city: '普陀区', address: '上海市普', zip: 0 }, { date: '2019-05-02', name: '王小虎7', price: 33, province: '上海', sex: 1, age: 0, id: "7", city: '普陀区', img: "https://img1.baidu.com/it/u=300787145,1214060415&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500", address: '上海市普', zip: 200333 }, { date: '2012-05-02', name: '王小虎8', province: '上海', price: 0, sex: 1, age: '29', id: "8", city: '普陀区', img: "https://img1.baidu.com/it/u=300787145,1214060415&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500", address: '上海市普', zip: 200333 }, { date: '2011-05-02', name: '王小虎91', price: 33, img: "https://img1.baidu.com/it/u=300787145,1214060415&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500", province: '上海', sex: 1, id: "9", age: '30', city: '普陀区', address: '上海市普', zip: 200333 }, { date: '2011-05-02', name: '王小虎10', province: '上海', sex: 1, id: "10", age: '30', img: "https://img1.baidu.com/it/u=300787145,1214060415&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500", city: '普陀区', address: '上海市普', zip: 200333 }, { date: '2011-05-02',
name: '王小虎20',
province: '上海',
class: "del", func: 'dele' }] }], data: [{ date: '2016-05-02', name: '', price: 0, province: '上海', admin: "admin", sex: '1', checked: true, id: "20", img: "https://img1.baidu.com/it/u=300787145,1214060415&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500", age: 0, city: '普陀区', address: '上海市普上海市普上海市普上海市普', zip: 200333 }, { date: '2016-05-01', name: '王小虎2', province: '上海', sex: '0', price: 0, id: "2", age: 12, city: '普陀区', img: "https://img.pddpic.com/mms-material-img/2020-11-27/84c7fad3-d945-4e71-ab09-7a1ed80f6055.jpeg.a.jpeg", address: '上海市普', zip: 200333 }, { date: '2022-03-25T09:27:42', name: '王小虎3', province: '上海', sex: 1, price: 33, id: "3", age: '15', img: "https://img1.baidu.com/it/u=300787145,1214060415&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500", city: '普陀区', address: '上海市普', zip: 200333555 }, { date: '2016-04-02', name: '王小虎4', province: '上海', sex: 1, age: '11', price: 33, id: "4", img: "https://img1.baidu.com/it/u=300787145,1214060415&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500", city: '普陀区', address: '上海市普', zip: 200333 }, { date: '2016-03-02', name: '王小虎5', province: '上海', price: 0, sex: 1, age: '14', img: "https://img1.baidu.com/it/u=300787145,1214060415&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500", id: "5", city: '普陀区', address: '上海市普', zip: 200333 }, { date: '2014-05-02', name: '王小虎6', province: '上海', price: 33, sex: 1, id: "6", age: '12', img: "https://img1.baidu.com/it/u=300787145,1214060415&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500", city: '普陀区', address: '上海市普', zip: 0 }, { date: '2019-05-02', name: '王小虎7', price: 33, province: '上海', sex: 1, age: 0, id: "7", city: '普陀区', img: "https://img1.baidu.com/it/u=300787145,1214060415&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500", address: '上海市普', zip: 200333 }, { date: '2012-05-02', name: '王小虎8', province: '上海', price: 0, sex: 1, age: '29', id: "8", city: '普陀区', img: "https://img1.baidu.com/it/u=300787145,1214060415&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500", address: '上海市普', zip: 200333 }, { date: '2011-05-02', name: '王小虎91', price: 33, img: "https://img1.baidu.com/it/u=300787145,1214060415&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500", province: '上海', sex: 1, id: "9", age: '30', city: '普陀区', address: '上海市普', zip: 200333 }, { date: '2011-05-02', name: '王小虎10', province: '上海', sex: 1, id: "10", age: '30', img: "https://img1.baidu.com/it/u=300787145,1214060415&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500", city: '普陀区', address: '上海市普', zip: 200333 }, { date: '2011-05-02', name: '王小虎20', province: '上海',
sex: 1,
price: 33,
id: "11",
@@ -523,6 +525,7 @@ var that = null;var _default = { components: {}, data: function data() {return {
flag2: true,
num: 0,
num1: 0,
isLoading: true,
isShowLoadMore: true };
},
@@ -532,15 +535,12 @@ var that = null;var _default = { components: {}, data: function data() {return {
created: function created() {
that = this;
},
mounted: function mounted() {
mounted: function mounted() {var _this = this;
this.data1 = JSON.parse(JSON.stringify(this.data));
var data2 = JSON.parse(JSON.stringify(this.data));
setTimeout(function () {
// data2.forEach(item=>{
// item.checked = true
// })
// this.data = data2
}, 3000);
_this.isLoading = false;
}, 1500);
},
methods: {
permissionBtn: function permissionBtn(row, renders, rowIndex) {
@@ -551,10 +551,32 @@ var that = null;var _default = { components: {}, data: function data() {return {
return renders;
},
sortChange: function sortChange(item, sorterMode, index) {
uni.showToast({
icon: 'none',
duration: 3000,
title: '触发自定义排序,通过接口返回排序,不默认排序' });
console.log('触发排序', item, sorterMode, index);
},
cellStyle: function cellStyle(_ref) {var row = _ref.row,column = _ref.column,rowIndex = _ref.rowIndex,columnIndex = _ref.columnIndex;
cellHeaderStyle: function cellHeaderStyle(_ref) {var column = _ref.column,columnIndex = _ref.columnIndex;
if (columnIndex === 1 || columnIndex === 4) {
return {
color: 'red' };
}
// if(column.children){
// for(let item of column.children){
// if(item.name==='province'){
// return{
// color:'red'
// }
// }
// }
// }
},
cellStyle: function cellStyle(_ref2) {var row = _ref2.row,column = _ref2.column,rowIndex = _ref2.rowIndex,columnIndex = _ref2.columnIndex;
// console.log('row, column, rowIndex, columnIndex')
if (columnIndex === 1 || columnIndex === 4) {
return {
@@ -562,40 +584,40 @@ var that = null;var _default = { components: {}, data: function data() {return {
}
},
pullUpLoading: function pullUpLoading(done) {var _this = this;
pullUpLoading: function pullUpLoading(done) {var _this2 = this;
if (!this.flag1) {
return;
}
setTimeout(function () {
_this.data.push({
_this2.data.push({
date: '2011-05-02',
name: '王小虎23',
province: '上海',
sex: 1,
price: 33,
id: 11111 + _this.num,
id: 11111 + _this2.num,
age: '30',
city: '普陀区',
address: '上海市普',
zip: 200333 });
_this.num++;
if (_this.num === 3) {
_this2.num++;
if (_this2.num === 3) {
done('ok');
_this.flag1 = false;
_this2.flag1 = false;
} else {
done();
}
}, 2000);
},
pullUpLoadingAction: function pullUpLoadingAction(done) {var _this2 = this;
pullUpLoadingAction: function pullUpLoadingAction(done) {var _this3 = this;
if (!this.flag2) {
return;
}
setTimeout(function () {
_this2.data.push({
_this3.data.push({
date: '2011-05-02',
name: '王小虎23',
province: '上海',
@@ -608,12 +630,12 @@ var that = null;var _default = { components: {}, data: function data() {return {
zip: 200333 });
_this2.num1++;
if (_this2.num1 === 3) {
_this2.$refs.zbTable.pullUpCompleteLoading('ok');
_this2.flag2 = false;
_this3.num1++;
if (_this3.num1 === 3) {
_this3.$refs.zbTable.pullUpCompleteLoading('ok');
_this3.flag2 = false;
} else {
_this2.$refs.zbTable.pullUpCompleteLoading();
_this3.$refs.zbTable.pullUpCompleteLoading();
}
}, 1000);
},

File diff suppressed because one or more lines are too long

View File

@@ -22,9 +22,9 @@
"uploadWithSourceMap": true,
"compileHotReLoad": false,
"lazyloadPlaceholderEnable": false,
"useMultiFrameRuntime": false,
"useApiHook": false,
"useApiHostProcess": false,
"useMultiFrameRuntime": true,
"useApiHook": true,
"useApiHostProcess": true,
"babelSetting": {
"ignore": [],
"disablePlugins": [],

View File

@@ -1 +1 @@
<view class="zb-table-footer data-v-6a330a4c" style="height:40px;"><view class="zb-table-fixed data-v-6a330a4c"><view class="zb-table-thead data-v-6a330a4c" style="position:relative;"><view class="item-tr data-v-6a330a4c"><block wx:for="{{transColumns}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view class="{{['data-v-6a330a4c','item-th',index<fixedLeftColumns.length&&'zb-stick-side']}}" style="{{'left:'+(item.left+'px')+';'+('width:'+((item.width?item.width:'100')+'px')+';')+('flex:'+(index===transColumns.length-1?1:'none')+';')+('min-width:'+((item.width?item.width:'100')+'px')+';')+('border-right:'+(''+(border?'1px solid #e8e8e8':''))+';')+('border-top:'+(''+(border?'1px solid #e8e8e8':''))+';')+('text-align:'+(item.align||'left')+';')}}">{{''+(sums[index]||item.emptyString)+''}}</view></block></view></view></view></view>
<view class="zb-table-footer data-v-6a330a4c" style="height:40px;flex-shrink:0;"><view class="zb-table-fixed data-v-6a330a4c"><view class="zb-table-thead data-v-6a330a4c" style="position:relative;"><view class="item-tr data-v-6a330a4c"><block wx:for="{{transColumns}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view class="{{['data-v-6a330a4c','item-th',index<fixedLeftColumns.length&&'zb-stick-side']}}" style="{{'left:'+(item.left+'px')+';'+('width:'+((item.width?item.width:'100')+'px')+';')+('flex:'+(index===transColumns.length-1?1:'none')+';')+('min-width:'+((item.width?item.width:'100')+'px')+';')+('border-right:'+(''+(border?'1px solid #e8e8e8':''))+';')+('border-top:'+(''+(border?'1px solid #e8e8e8':''))+';')+('text-align:'+(item.align||'left')+';')}}">{{''+(sums[index]||item.emptyString)+''}}</view></block></view></view></view></view>

File diff suppressed because one or more lines are too long

View File

@@ -1,6 +1,7 @@
{
"component": true,
"usingComponents": {
"zb-loading": "/uni_modules/zb-table/components/zb-table/components/zb-loading",
"table-checkbox": "/uni_modules/zb-table/components/zb-table/components/table-checkbox",
"table-summary": "/uni_modules/zb-table/components/zb-table/components/table-summary",
"table-side-summary": "/uni_modules/zb-table/components/zb-table/components/table-side-summary",

View File

@@ -1 +1 @@
<view class="zb-table-applet"><view class="zb-table-content"><scroll-view style="height:100%;" scroll-y="true" scroll-x="true" data-event-opts="{{[['scrolltolower',[['scrolltolower',['$event']]]]]}}" bindscrolltolower="__e"><view class="zb-table-scroll"><block wx:if="{{showHeader}}"><view class="zb-table-header top-header-uni"><view class="zb-table-fixed thead-calculation"><view class="zb-table-thead" style="position:relative;"><view class="item-tr"><block wx:for="{{transColumns.columns}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view class="{{[index<fixedLeftColumns.length&&'zb-stick-side']}}" style="{{'left:'+(item.left+'px')+';'}}"><table-header-item vue-id="{{'8146ecc2-1-'+index}}" item="{{item}}" border="{{border}}" indeterminate="{{indeterminate}}" checkedAll="{{checkedAll}}" transColumns="{{transColumns.columns}}" index="{{index}}" fixedLeftColumns="{{fixedLeftColumns}}" scrollbarSize="{{scrollbarSize}}" data-event-opts="{{[['^sortAction',[['sortAction']]],['^checkboxSelectedAll',[['checkboxSelectedAll']]]]}}" bind:sortAction="__e" bind:checkboxSelectedAll="__e" bind:__l="__l"></table-header-item></view></block></view></view></view></view></block><block wx:if="{{!data.length}}"><view class="no-data">暂无数据~~</view></block><view class="zb-table-fixed"><view class="zb-table-tbody"><block wx:for="{{$root.l2}}" wx:for-item="item" wx:for-index="index" wx:key="key"><view data-event-opts="{{[['tap',[['rowClick',['$0',index],[[['transData','key',item.$orig.key]]]]]]]}}" class="{{['item-tr',item.m0?'current-row':'']}}" catchtap="__e"><block wx:for="{{item.l1}}" wx:for-item="ite" wx:for-index="i" wx:key="i"><view class="{{['item-td',i<fixedLeftColumns.length&&'zb-stick-side',stripe?index%2!=0?'odd':'even':'']}}" style="{{ite.s0}}"><block wx:if="{{ite.$orig.type==='operation'}}"><view style="display:flex;align-items:center;height:100%;"><block wx:for="{{ite.l0}}" wx:for-item="ren" wx:for-index="ind" wx:key="ind"><view data-event-opts="{{[['tap',[['e0',['$event']]]]]}}" data-event-params="{{({ren,item:item.$orig,index})}}" style="{{'display:'+('flex')+';'+('align-items:'+('center')+';')+('margin-right:'+(ite.$orig.renders.length>1?'8px':'0')+';')}}" bindtap="__e"><block wx:if="{{ren.type==='custom'}}"><view class="{{[ren.class||'']}}" style="cursor:pointer;">{{''+ren.name+''}}</view></block><block wx:else><button class="{{[ren.class||'']}}" type="{{ren.type||'primary'}}" size="{{ren.size||'mini'}}">{{ren.name}}</button></block></view></block></view></block><block wx:else><block wx:if="{{ite.$orig.type==='selection'}}"><view class="checkbox-item"><table-checkbox vue-id="{{'8146ecc2-2-'+index+'-'+i}}" cellData="{{item.$orig}}" checked="{{item.$orig.checked}}" data-event-opts="{{[['^checkboxSelected',[['e1']]]]}}" data-event-params="{{({item:item.$orig})}}" bind:checkboxSelected="__e" bind:__l="__l"></table-checkbox></view></block><block wx:else><block wx:if="{{ite.$orig.type==='img'}}"><block wx:if="{{item.$orig[ite.$orig.name]}}"><image style="width:40px;height:30px;" show-menu-by-longpress="{{false}}" src="{{item.$orig[ite.$orig.name]}}" mode="aspectFit" data-event-opts="{{[['tap',[['previewImage',['$0','$1',index],[[['transData','key',item.$orig.key]],[['transData','key',item.$orig.key,''+ite.$orig.name+'']]]]]]]}}" catchtap="__e"></image></block><block wx:else><text>{{ite.$orig.emptyString}}</text></block></block><block wx:else><block wx:if="{{ite.$orig.type==='index'}}">{{''+(index+1)+''}}</block><block wx:else>{{''+(ite.$orig.filters?ite.m1:item.$orig[ite.$orig.name]==null||item.$orig[ite.$orig.name]===''?ite.$orig.emptyString:item.$orig[ite.$orig.name])+''}}</block></block></block></block></view></block></view></block></view></view><block wx:if="{{showSummary}}"><table-summary vue-id="8146ecc2-3" data="{{data}}" showSummary="{{showSummary}}" fixedLeftColumns="{{fixedLeftColumns}}" transColumns="{{transColumns.columns}}" border="{{border}}" summary-method="{{summaryMethod}}" sumText="{{sumText}}" bind:__l="__l"></table-summary></block></view></scroll-view></view><block wx:if="{{isLoadMore&&!completeLoading}}"><zb-load-more vue-id="8146ecc2-4" bind:__l="__l"></zb-load-more></block></view>
<view class="zb-table-applet"><block wx:if="{{isLoading}}"><zb-loading vue-id="8146ecc2-1" bind:__l="__l"></zb-loading></block><view class="zb-table-content"><scroll-view style="height:100%;" scroll-y="true" scroll-x="true" data-event-opts="{{[['scrolltolower',[['scrolltolower',['$event']]]]]}}" bindscrolltolower="__e"><view class="zb-table-scroll"><block wx:if="{{showHeader}}"><view class="zb-table-header top-header-uni"><view class="zb-table-fixed thead-calculation"><view class="zb-table-thead" style="position:relative;"><view class="item-tr"><block wx:for="{{transColumns.columns}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view class="{{[index<fixedLeftColumns.length&&'zb-stick-side']}}" style="{{'left:'+(item.left+'px')+';'}}"><table-header-item vue-id="{{'8146ecc2-2-'+index}}" item="{{item}}" cellHeaderStyle="{{cellHeaderStyle}}" border="{{border}}" multify="{{multify}}" realColumns="{{transColumns.realColumns}}" wrapIndex="{{index}}" indeterminate="{{indeterminate}}" checkedAll="{{checkedAll}}" transColumns="{{transColumns.columns}}" index="{{index}}" fixedLeftColumns="{{fixedLeftColumns}}" scrollbarSize="{{scrollbarSize}}" data-event-opts="{{[['^sortAction',[['sortAction']]],['^checkboxSelectedAll',[['checkboxSelectedAll']]]]}}" bind:sortAction="__e" bind:checkboxSelectedAll="__e" bind:__l="__l"></table-header-item></view></block></view></view></view></view></block><block wx:if="{{!data.length}}"><view class="no-data">暂无数据~~</view></block><view class="zb-table-fixed"><view class="zb-table-tbody"><block wx:for="{{$root.l2}}" wx:for-item="item" wx:for-index="index" wx:key="key"><view data-event-opts="{{[['tap',[['rowClick',['$0',index],[[['transData','key',item.$orig.key]]]]]]]}}" class="{{['item-tr',item.m0?'current-row':'']}}" catchtap="__e"><block wx:for="{{item.l1}}" wx:for-item="ite" wx:for-index="i" wx:key="i"><view class="{{['item-td',i<fixedLeftColumns.length&&'zb-stick-side',stripe?index%2!=0?'odd':'even':'']}}" style="{{ite.s0}}"><block wx:if="{{ite.$orig.type==='operation'}}"><view style="display:flex;align-items:center;height:100%;"><block wx:for="{{ite.l0}}" wx:for-item="ren" wx:for-index="ind" wx:key="ind"><view data-event-opts="{{[['tap',[['e0',['$event']]]]]}}" data-event-params="{{({ren,item:item.$orig,index})}}" style="{{'display:'+('flex')+';'+('align-items:'+('center')+';')+('margin-right:'+(ite.$orig.renders.length>1?'8px':'0')+';')}}" bindtap="__e"><block wx:if="{{ren.type==='custom'}}"><view class="{{[ren.class||'']}}" style="cursor:pointer;">{{''+ren.name+''}}</view></block><block wx:else><button class="{{[ren.class||'']}}" type="{{ren.type||'primary'}}" size="{{ren.size||'mini'}}">{{ren.name}}</button></block></view></block></view></block><block wx:else><block wx:if="{{ite.$orig.type==='selection'}}"><view class="checkbox-item"><table-checkbox vue-id="{{'8146ecc2-3-'+index+'-'+i}}" cellData="{{item.$orig}}" checked="{{item.$orig.checked}}" data-event-opts="{{[['^checkboxSelected',[['e1']]]]}}" data-event-params="{{({item:item.$orig})}}" bind:checkboxSelected="__e" bind:__l="__l"></table-checkbox></view></block><block wx:else><block wx:if="{{ite.$orig.type==='img'}}"><block wx:if="{{item.$orig[ite.$orig.name]}}"><image style="width:40px;height:30px;" show-menu-by-longpress="{{false}}" src="{{item.$orig[ite.$orig.name]}}" mode="aspectFit" data-event-opts="{{[['tap',[['previewImage',['$0','$1',index],[[['transData','key',item.$orig.key]],[['transData','key',item.$orig.key,''+ite.$orig.name+'']]]]]]]}}" catchtap="__e"></image></block><block wx:else><text>{{ite.$orig.emptyString}}</text></block></block><block wx:else><block wx:if="{{ite.$orig.type==='index'}}">{{''+(index+1)+''}}</block><block wx:else>{{''+(ite.$orig.filters?ite.m1:item.$orig[ite.$orig.name]==null||item.$orig[ite.$orig.name]===''?ite.$orig.emptyString:item.$orig[ite.$orig.name])+''}}</block></block></block></block></view></block></view></block></view></view><block wx:if="{{showSummary}}"><table-summary vue-id="8146ecc2-4" data="{{data}}" showSummary="{{showSummary}}" fixedLeftColumns="{{fixedLeftColumns}}" transColumns="{{transColumns.columns}}" border="{{border}}" summary-method="{{summaryMethod}}" sumText="{{sumText}}" bind:__l="__l"></table-summary></block></view></scroll-view></view><block wx:if="{{isLoadMore&&!completeLoading}}"><zb-load-more vue-id="8146ecc2-5" bind:__l="__l"></zb-load-more></block></view>