提交
This commit is contained in:
26
pages.json
26
pages.json
@@ -5,12 +5,6 @@
|
||||
"style": {
|
||||
"navigationBarTitleText": "uni-app"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/table/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "table"
|
||||
}
|
||||
}
|
||||
],
|
||||
"globalStyle": {
|
||||
@@ -18,25 +12,5 @@
|
||||
"navigationBarTitleText": "uni-app",
|
||||
"navigationBarBackgroundColor": "#F8F8F8",
|
||||
"backgroundColor": "#F8F8F8"
|
||||
},
|
||||
"tabBar": {
|
||||
"color": "#7A7E83",
|
||||
"selectedColor": "#007AFF",
|
||||
"borderStyle": "black",
|
||||
"backgroundColor": "#F8F8F8",
|
||||
"list": [
|
||||
{
|
||||
"pagePath": "pages/index/index",
|
||||
"iconPath": "static/home.png",
|
||||
"selectedIconPath": "static/home-active.png",
|
||||
"text": "主页"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/table/index",
|
||||
"iconPath": "static/component.png",
|
||||
"selectedIconPath": "static/componentHL.png",
|
||||
"text": "表格组件"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
export const column1 = [
|
||||
{ type:'index', width:60 },
|
||||
{ name: 'name', label: '姓名',width:80,emptyString:'--' },
|
||||
{ name: 'age', label: '年纪',},
|
||||
{ name: 'sex', label: '性别',filters:{0:'男',1:'女'}},
|
||||
{ name: 'address', label: '地址' },
|
||||
{ name: 'date', label: '日期', },
|
||||
{ name: 'province', label: '省份' },
|
||||
{ name: 'city', label: '城市' },
|
||||
{ name: 'zip', label: '邮编' },
|
||||
]
|
||||
export const column2 = [
|
||||
{ type:'selection', width:50 },
|
||||
{ name: 'name', label: '姓名',width:80,emptyString:'--' },
|
||||
{ name: 'age', label: '年纪',},
|
||||
{ name: 'sex', label: '性别',filters:{0:'男',1:'女'}},
|
||||
{ name: 'address', label: '地址' },
|
||||
{ name: 'date', label: '日期', },
|
||||
{ name: 'province', label: '省份' },
|
||||
{ name: 'city', label: '城市' },
|
||||
{ name: 'zip', label: '邮编' },
|
||||
]
|
||||
|
||||
export const column3 = [
|
||||
{ type:'selection', fixed:true,width:50 },
|
||||
{ name: 'name', label: '姓名',fixed:true,width:80,emptyString:'--' },
|
||||
{ name: 'age', label: '年纪',},
|
||||
{ name: 'sex', label: '性别',filters:{0:'男',1:'女'}},
|
||||
{ name: 'address', label: '地址' },
|
||||
{ name: 'date', label: '日期', },
|
||||
{ name: 'province', label: '省份' },
|
||||
{ name: 'city', label: '城市' },
|
||||
{ name: 'zip', label: '邮编' },
|
||||
]
|
||||
|
||||
export const column4 = [
|
||||
{ type:'selection', fixed:true,width:50 },
|
||||
{ name: 'name', label: '姓名',fixed:true,width:80,emptyString:'--' },
|
||||
{ name: 'age', label: '年纪',sorter:true},
|
||||
{ name: 'sex', label: '性别',filters:{0:'男',1:'女'}},
|
||||
{ name: 'address', label: '地址' },
|
||||
{ name: 'date', label: '日期',sorter:true },
|
||||
{ name: 'province', label: '省份' },
|
||||
{ name: 'city', label: '城市' },
|
||||
{ name: 'zip', label: '邮编' },
|
||||
]
|
||||
|
||||
|
||||
@@ -1,538 +0,0 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<uni-card title="全部功能" >
|
||||
<view style="height: 300px">
|
||||
<zb-table
|
||||
@sort-change="sortChange"
|
||||
:pullUpLoading="pullUpLoading"
|
||||
:isShowLoadMore="true"
|
||||
:highlight="true"
|
||||
:show-header="true"
|
||||
:columns="column"
|
||||
:fit="false"
|
||||
row-key="id"
|
||||
@rowClick="rowClick"
|
||||
@toggleRowSelection="toggleRowSelection"
|
||||
@toggleAllSelection="toggleAllSelection"
|
||||
:border="true"
|
||||
@custom="custom"
|
||||
@edit="buttonEdit"
|
||||
@dele="dele"
|
||||
:data="data"></zb-table>
|
||||
</view>
|
||||
</uni-card>
|
||||
<uni-card title="普通表格" >
|
||||
<view style="height: 200px">
|
||||
<zb-table
|
||||
:columns="column1"
|
||||
:stripe="true"
|
||||
@rowClick="rowClick"
|
||||
:data="data"></zb-table>
|
||||
</view>
|
||||
</uni-card>
|
||||
<uni-card title="带边框表格" >
|
||||
<view style="height: 200px">
|
||||
<zb-table
|
||||
:columns="column1"
|
||||
:stripe="true"
|
||||
@rowClick="rowClick"
|
||||
:border="true"
|
||||
:data="data"></zb-table>
|
||||
</view>
|
||||
</uni-card>
|
||||
<uni-card title="多选,多行数据时使用 Checkbox" >
|
||||
<view style="height: 200px">
|
||||
<zb-table
|
||||
:columns="column2"
|
||||
:stripe="true"
|
||||
@rowClick="rowClick"
|
||||
@toggleRowSelection="toggleRowSelection"
|
||||
@toggleAllSelection="toggleAllSelection"
|
||||
:border="true"
|
||||
@edit="buttonEdit"
|
||||
@dele="dele"
|
||||
:data="data"></zb-table>
|
||||
</view>
|
||||
</uni-card>
|
||||
<uni-card title="固定多列和表头" >
|
||||
<view style="height: 200px">
|
||||
<zb-table
|
||||
:columns="column3"
|
||||
:stripe="true"
|
||||
@rowClick="rowClick"
|
||||
@toggleRowSelection="toggleRowSelection"
|
||||
@toggleAllSelection="toggleAllSelection"
|
||||
:border="true"
|
||||
@edit="buttonEdit"
|
||||
@dele="dele"
|
||||
:data="data"></zb-table>
|
||||
</view>
|
||||
</uni-card>
|
||||
<uni-card title="年纪、日期排序" >
|
||||
<view style="height: 200px">
|
||||
<zb-table
|
||||
:show-header="true"
|
||||
:columns="column4"
|
||||
:stripe="true"
|
||||
:fit="false"
|
||||
@rowClick="rowClick"
|
||||
@toggleRowSelection="toggleRowSelection"
|
||||
@toggleAllSelection="toggleAllSelection"
|
||||
:border="true"
|
||||
@edit="buttonEdit"
|
||||
@dele="dele"
|
||||
:data="data"></zb-table>
|
||||
</view>
|
||||
</uni-card>
|
||||
|
||||
<uni-card title="表尾合计" >
|
||||
<view style="height: 300px">
|
||||
<zb-table
|
||||
:show-header="true"
|
||||
:columns="column"
|
||||
:fit="false"
|
||||
:show-summary="true"
|
||||
:summary-method="getSummaries"
|
||||
@rowClick="rowClick"
|
||||
@toggleRowSelection="toggleRowSelection"
|
||||
@toggleAllSelection="toggleAllSelection"
|
||||
:border="true"
|
||||
@edit="buttonEdit"
|
||||
@dele="dele"
|
||||
:data="data1"></zb-table>
|
||||
</view>
|
||||
</uni-card>
|
||||
|
||||
<uni-card title="上拉加载" >
|
||||
<view style="height: 300px">
|
||||
<zb-table
|
||||
:show-header="true"
|
||||
:columns="column"
|
||||
:isShowLoadMore="true"
|
||||
ref="zbTable"
|
||||
@pullUpLoading="pullUpLoadingAction"
|
||||
:summary-method="getSummaries"
|
||||
@rowClick="rowClick"
|
||||
@toggleRowSelection="toggleRowSelection"
|
||||
@toggleAllSelection="toggleAllSelection"
|
||||
:border="true"
|
||||
@edit="buttonEdit"
|
||||
@dele="dele"
|
||||
:data="data"></zb-table>
|
||||
</view>
|
||||
</uni-card>
|
||||
|
||||
|
||||
<uni-card title="选择单行数据时使用色块表示" >
|
||||
<view style="height: 300px">
|
||||
<zb-table
|
||||
:show-header="true"
|
||||
:columns="column1"
|
||||
@currentChange="currentChange"
|
||||
:highlight="true"
|
||||
:border="true"
|
||||
:data="data"></zb-table>
|
||||
</view>
|
||||
</uni-card>
|
||||
|
||||
<uni-card title="支持设置单元格样式" >
|
||||
<view style="height: 300px">
|
||||
<zb-table
|
||||
:cell-style="cellStyle"
|
||||
:show-header="true"
|
||||
:columns="column1"
|
||||
@currentChange="currentChange"
|
||||
:highlight="true"
|
||||
:border="true"
|
||||
:data="data"></zb-table>
|
||||
</view>
|
||||
</uni-card>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {column1,column2,column3,column4} from './all.js'
|
||||
let that = null
|
||||
export default {
|
||||
components:{
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
column1,
|
||||
column2,
|
||||
column3,
|
||||
column4,
|
||||
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: '上海',
|
||||
sex:1,
|
||||
price: 33,
|
||||
id:"11",
|
||||
age:'30',
|
||||
city: '普陀区',
|
||||
address: '上海市普',
|
||||
zip: 200333
|
||||
}
|
||||
],
|
||||
data1:[],
|
||||
flag1:true,
|
||||
flag2:true,
|
||||
num:0,
|
||||
num1:0,
|
||||
isShowLoadMore:true
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
|
||||
},
|
||||
created(){
|
||||
that = this
|
||||
},
|
||||
mounted(){
|
||||
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)
|
||||
},
|
||||
methods:{
|
||||
sortChange(item,sorterMode,index){
|
||||
|
||||
console.log('触发排序',item,sorterMode,index)
|
||||
},
|
||||
cellStyle({row, column, rowIndex, columnIndex}){
|
||||
// console.log('row, column, rowIndex, columnIndex')
|
||||
if(columnIndex === 1 || columnIndex === 4) {
|
||||
return{
|
||||
color:'red'
|
||||
}
|
||||
}
|
||||
},
|
||||
pullUpLoading(done){
|
||||
if(!this.flag1){
|
||||
return
|
||||
}
|
||||
setTimeout(()=>{
|
||||
this.data.push({
|
||||
date: '2011-05-02',
|
||||
name: '王小虎23',
|
||||
province: '上海',
|
||||
sex:1,
|
||||
price: 33,
|
||||
id:11111+this.num,
|
||||
age:'30',
|
||||
city: '普陀区',
|
||||
address: '上海市普',
|
||||
zip: 200333
|
||||
})
|
||||
|
||||
this.num ++
|
||||
if(this.num===3){
|
||||
done('ok')
|
||||
this.flag1 = false
|
||||
}else {
|
||||
done()
|
||||
}
|
||||
},2000)
|
||||
},
|
||||
|
||||
pullUpLoadingAction(done){
|
||||
if(!this.flag2){
|
||||
return
|
||||
}
|
||||
setTimeout(()=>{
|
||||
this.data.push({
|
||||
date: '2011-05-02',
|
||||
name: '王小虎23',
|
||||
province: '上海',
|
||||
sex:1,
|
||||
price: 33,
|
||||
id:"11111",
|
||||
age:'30',
|
||||
city: '普陀区',
|
||||
address: '上海市普',
|
||||
zip: 200333
|
||||
})
|
||||
|
||||
this.num1 ++
|
||||
if(this.num1===3){
|
||||
this.$refs.zbTable.pullUpCompleteLoading('ok')
|
||||
this.flag2 = false
|
||||
}else {
|
||||
this.$refs.zbTable.pullUpCompleteLoading()
|
||||
}
|
||||
},1000)
|
||||
},
|
||||
buttonEdit(ite,index){
|
||||
uni.showToast({
|
||||
icon:'none',
|
||||
duration:3000,
|
||||
title:'点击编辑'
|
||||
})
|
||||
console.log(ite,index)
|
||||
},
|
||||
dele(ite,index){
|
||||
uni.showToast({
|
||||
icon:'none',
|
||||
duration:3000,
|
||||
title:'点击删除'
|
||||
})
|
||||
// alert('点击删除')
|
||||
console.log(ite,index)
|
||||
},
|
||||
custom(){
|
||||
uni.showToast({
|
||||
icon:'none',
|
||||
duration:3000,
|
||||
title:'点击自定义'
|
||||
})
|
||||
},
|
||||
toggleAllSelection(checked,arr){
|
||||
uni.showToast({
|
||||
icon:'none',
|
||||
duration:3000,
|
||||
title:'点击全选'
|
||||
})
|
||||
console.log('全选',checked,arr)
|
||||
},
|
||||
toggleRowSelection(checked,arr){
|
||||
uni.showToast({
|
||||
icon:'none',
|
||||
duration:3000,
|
||||
title:'点击单选'
|
||||
})
|
||||
console.log('单选',checked,arr)
|
||||
},
|
||||
currentChange(row,index){
|
||||
uni.showToast({
|
||||
icon:'none',
|
||||
duration:3000,
|
||||
title:'选中当前一行'
|
||||
})
|
||||
console.log('单选',row,index)
|
||||
},
|
||||
rowClick(row,index){
|
||||
uni.showToast({
|
||||
icon:'none',
|
||||
duration:3000,
|
||||
title:'单击某行'
|
||||
})
|
||||
console.log('单击某行',row,index)
|
||||
},
|
||||
getSummaries(param){
|
||||
const { columns, data } = param;
|
||||
const sums = [];
|
||||
columns.forEach((column, index) => {
|
||||
if (index === 0) {
|
||||
sums[index] = '总价';
|
||||
return;
|
||||
}
|
||||
if(column.name==='price'){
|
||||
const values = data.map(item => Number(item[column.name]));
|
||||
if (!values.every(value => isNaN(value))) {
|
||||
sums[index] = values.reduce((prev, curr) => {
|
||||
const value = Number(curr);
|
||||
if (!isNaN(value)) {
|
||||
return prev + curr;
|
||||
} else {
|
||||
return prev;
|
||||
}
|
||||
}, 0);
|
||||
sums[index] += ' 元';
|
||||
}
|
||||
}else{
|
||||
sums[index] = 'N/A';
|
||||
}
|
||||
});
|
||||
return sums;
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
::v-deep{
|
||||
.uni-card{
|
||||
margin: 8px!important;
|
||||
padding: 0!important;
|
||||
.uni-card__content{
|
||||
padding: 0!important;
|
||||
}
|
||||
}
|
||||
}
|
||||
.content{
|
||||
//height: 600rpx;
|
||||
//.title{
|
||||
// font-weight: bold;
|
||||
// padding: 20rpx 0;
|
||||
//}
|
||||
}
|
||||
|
||||
</style>
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
|
||||
## qq群 731805264
|
||||
## -- github 永远保持最新,有啥想法的可以提PR,共同开发 [地址](https://github.com/zouzhibin/vue-admin-perfect)
|
||||
## -- github 永远保持最新,有啥想法的可以提PR,共同开发 [地址](https://github.com/zouzhibin/zb-table.git)
|
||||
|
||||
## drawer属性
|
||||
| 参数 | 说明 | 类型 | 可选值 | 默认值 |是否必须|
|
||||
@@ -15,3 +15,14 @@
|
||||
| show-close | 是否显示关闭按钮 | boolean | -- | true|否|
|
||||
| title | Drawer 的标题,也可通过具名 slot (见下表)传入 | string | -- | --|否|
|
||||
| visible | 是否显示 Drawer,支持 .sync 修饰符 | boolean | -- | false|否|
|
||||
|
||||
## 示例
|
||||
```
|
||||
<zb-drawer
|
||||
:mode="mode"
|
||||
width="80%"
|
||||
:visible.sync="isShow1" >
|
||||
<view class="top-content"></view>
|
||||
</zb-drawer>
|
||||
```
|
||||
|
||||
|
||||
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
22
unpackage/dist/dev/mp-alipay/app.json
vendored
22
unpackage/dist/dev/mp-alipay/app.json
vendored
@@ -1,7 +1,6 @@
|
||||
{
|
||||
"pages": [
|
||||
"pages/index/index",
|
||||
"pages/table/index"
|
||||
"pages/index/index"
|
||||
],
|
||||
"subPackages": [],
|
||||
"window": {
|
||||
@@ -9,24 +8,5 @@
|
||||
"titleBarColor": "#F8F8F8",
|
||||
"backgroundColor": "#F8F8F8"
|
||||
},
|
||||
"tabBar": {
|
||||
"textColor": "#7A7E83",
|
||||
"selectedColor": "#007AFF",
|
||||
"backgroundColor": "#F8F8F8",
|
||||
"items": [
|
||||
{
|
||||
"pagePath": "pages/index/index",
|
||||
"name": "主页",
|
||||
"icon": "static/home.png",
|
||||
"activeIcon": "static/home-active.png"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/table/index",
|
||||
"name": "表格组件",
|
||||
"icon": "static/component.png",
|
||||
"activeIcon": "static/componentHL.png"
|
||||
}
|
||||
]
|
||||
},
|
||||
"usingComponents": {}
|
||||
}
|
||||
115
unpackage/dist/dev/mp-alipay/common/runtime.js
vendored
115
unpackage/dist/dev/mp-alipay/common/runtime.js
vendored
@@ -55,11 +55,6 @@
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // object to store loaded CSS chunks
|
||||
/******/ var installedCssChunks = {
|
||||
/******/ "common/runtime": 0
|
||||
/******/ }
|
||||
/******/
|
||||
/******/ // object to store loaded and loading chunks
|
||||
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
|
||||
/******/ // Promise = chunk loading, 0 = chunk loaded
|
||||
@@ -69,11 +64,6 @@
|
||||
/******/
|
||||
/******/ var deferredModules = [];
|
||||
/******/
|
||||
/******/ // script path function
|
||||
/******/ function jsonpScriptSrc(chunkId) {
|
||||
/******/ return __webpack_require__.p + "" + chunkId + ".js"
|
||||
/******/ }
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
@@ -98,108 +88,6 @@
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/ // This file contains only the entry chunk.
|
||||
/******/ // The chunk loading function for additional chunks
|
||||
/******/ __webpack_require__.e = function requireEnsure(chunkId) {
|
||||
/******/ var promises = [];
|
||||
/******/
|
||||
/******/
|
||||
/******/ // mini-css-extract-plugin CSS loading
|
||||
/******/ var cssChunks = {"uni_modules/zb-drawer/components/zb-drawer/zb-drawer":1,"uni_modules/zb-table/components/zb-table/zb-table":1,"uni_modules/uni-card/components/uni-card/uni-card":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/table-checkbox":1,"uni_modules/zb-table/components/zb-table/components/zb-load-more":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-drawer/components/zb-drawer/zb-drawer":"uni_modules/zb-drawer/components/zb-drawer/zb-drawer","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","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/table-checkbox":"uni_modules/zb-table/components/zb-table/components/table-checkbox","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 fullhref = __webpack_require__.p + href;
|
||||
/******/ var existingLinkTags = document.getElementsByTagName("link");
|
||||
/******/ for(var i = 0; i < existingLinkTags.length; i++) {
|
||||
/******/ var tag = existingLinkTags[i];
|
||||
/******/ var dataHref = tag.getAttribute("data-href") || tag.getAttribute("href");
|
||||
/******/ if(tag.rel === "stylesheet" && (dataHref === href || dataHref === fullhref)) return resolve();
|
||||
/******/ }
|
||||
/******/ var existingStyleTags = document.getElementsByTagName("style");
|
||||
/******/ for(var i = 0; i < existingStyleTags.length; i++) {
|
||||
/******/ var tag = existingStyleTags[i];
|
||||
/******/ var dataHref = tag.getAttribute("data-href");
|
||||
/******/ if(dataHref === href || dataHref === fullhref) return resolve();
|
||||
/******/ }
|
||||
/******/ var linkTag = document.createElement("link");
|
||||
/******/ linkTag.rel = "stylesheet";
|
||||
/******/ linkTag.type = "text/css";
|
||||
/******/ linkTag.onload = resolve;
|
||||
/******/ linkTag.onerror = function(event) {
|
||||
/******/ var request = event && event.target && event.target.src || fullhref;
|
||||
/******/ var err = new Error("Loading CSS chunk " + chunkId + " failed.\n(" + request + ")");
|
||||
/******/ err.code = "CSS_CHUNK_LOAD_FAILED";
|
||||
/******/ err.request = request;
|
||||
/******/ delete installedCssChunks[chunkId]
|
||||
/******/ linkTag.parentNode.removeChild(linkTag)
|
||||
/******/ reject(err);
|
||||
/******/ };
|
||||
/******/ linkTag.href = fullhref;
|
||||
/******/
|
||||
/******/ var head = document.getElementsByTagName("head")[0];
|
||||
/******/ head.appendChild(linkTag);
|
||||
/******/ }).then(function() {
|
||||
/******/ installedCssChunks[chunkId] = 0;
|
||||
/******/ }));
|
||||
/******/ }
|
||||
/******/
|
||||
/******/ // JSONP chunk loading for javascript
|
||||
/******/
|
||||
/******/ var installedChunkData = installedChunks[chunkId];
|
||||
/******/ if(installedChunkData !== 0) { // 0 means "already installed".
|
||||
/******/
|
||||
/******/ // a Promise means "currently loading".
|
||||
/******/ if(installedChunkData) {
|
||||
/******/ promises.push(installedChunkData[2]);
|
||||
/******/ } else {
|
||||
/******/ // setup Promise in chunk cache
|
||||
/******/ var promise = new Promise(function(resolve, reject) {
|
||||
/******/ installedChunkData = installedChunks[chunkId] = [resolve, reject];
|
||||
/******/ });
|
||||
/******/ promises.push(installedChunkData[2] = promise);
|
||||
/******/
|
||||
/******/ // start chunk loading
|
||||
/******/ var script = document.createElement('script');
|
||||
/******/ var onScriptComplete;
|
||||
/******/
|
||||
/******/ script.charset = 'utf-8';
|
||||
/******/ script.timeout = 120;
|
||||
/******/ if (__webpack_require__.nc) {
|
||||
/******/ script.setAttribute("nonce", __webpack_require__.nc);
|
||||
/******/ }
|
||||
/******/ script.src = jsonpScriptSrc(chunkId);
|
||||
/******/
|
||||
/******/ // create error before stack unwound to get useful stacktrace later
|
||||
/******/ var error = new Error();
|
||||
/******/ onScriptComplete = function (event) {
|
||||
/******/ // avoid mem leaks in IE.
|
||||
/******/ script.onerror = script.onload = null;
|
||||
/******/ clearTimeout(timeout);
|
||||
/******/ var chunk = installedChunks[chunkId];
|
||||
/******/ if(chunk !== 0) {
|
||||
/******/ if(chunk) {
|
||||
/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type);
|
||||
/******/ var realSrc = event && event.target && event.target.src;
|
||||
/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')';
|
||||
/******/ error.name = 'ChunkLoadError';
|
||||
/******/ error.type = errorType;
|
||||
/******/ error.request = realSrc;
|
||||
/******/ chunk[1](error);
|
||||
/******/ }
|
||||
/******/ installedChunks[chunkId] = undefined;
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/ var timeout = setTimeout(function(){
|
||||
/******/ onScriptComplete({ type: 'timeout', target: script });
|
||||
/******/ }, 120000);
|
||||
/******/ script.onerror = script.onload = onScriptComplete;
|
||||
/******/ document.head.appendChild(script);
|
||||
/******/ }
|
||||
/******/ }
|
||||
/******/ return Promise.all(promises);
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
@@ -253,9 +141,6 @@
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "/";
|
||||
/******/
|
||||
/******/ // on error function for async loading
|
||||
/******/ __webpack_require__.oe = function(err) { console.error(err); throw err; };
|
||||
/******/
|
||||
/******/ var jsonpArray = my["webpackJsonp"] = my["webpackJsonp"] || [];
|
||||
/******/ var oldJsonpFunction = jsonpArray.push.bind(jsonpArray);
|
||||
/******/ jsonpArray.push = webpackJsonpCallback;
|
||||
|
||||
1032
unpackage/dist/dev/mp-alipay/common/vendor.js
vendored
1032
unpackage/dist/dev/mp-alipay/common/vendor.js
vendored
File diff suppressed because it is too large
Load Diff
@@ -124,29 +124,6 @@ __webpack_require__.r(__webpack_exports__);
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "recyclableRender", function() { return recyclableRender; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "components", function() { return components; });
|
||||
var components
|
||||
try {
|
||||
components = {
|
||||
zbDrawer: function() {
|
||||
return Promise.all(/*! import() | uni_modules/zb-drawer/components/zb-drawer/zb-drawer */[__webpack_require__.e("common/vendor"), __webpack_require__.e("uni_modules/zb-drawer/components/zb-drawer/zb-drawer")]).then(__webpack_require__.bind(null, /*! @/uni_modules/zb-drawer/components/zb-drawer/zb-drawer.vue */ 29))
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
if (
|
||||
e.message.indexOf("Cannot find module") !== -1 &&
|
||||
e.message.indexOf(".vue") !== -1
|
||||
) {
|
||||
console.error(e.message)
|
||||
console.error("1. 排查组件名称拼写是否正确")
|
||||
console.error(
|
||||
"2. 排查组件是否符合 easycom 规范,文档:https://uniapp.dcloud.net.cn/collocation/pages?id=easycom"
|
||||
)
|
||||
console.error(
|
||||
"3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件"
|
||||
)
|
||||
} else {
|
||||
throw e
|
||||
}
|
||||
}
|
||||
var render = function() {
|
||||
var _vm = this
|
||||
var _h = _vm.$createElement
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
{
|
||||
"defaultTitle": "uni-app",
|
||||
"usingComponents": {
|
||||
"zb-drawer": "/uni_modules/zb-drawer/components/zb-drawer/zb-drawer"
|
||||
}
|
||||
"usingComponents": {}
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"component": true
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"component": true
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"component": true
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"component": true
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"component": true
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"component": true
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"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",
|
||||
"table-h5-summary": "/uni_modules/zb-table/components/zb-table/components/table-h5-summary",
|
||||
"zb-load-more": "/uni_modules/zb-table/components/zb-table/components/zb-load-more"
|
||||
}
|
||||
}
|
||||
23
unpackage/dist/dev/mp-weixin/app.json
vendored
23
unpackage/dist/dev/mp-weixin/app.json
vendored
@@ -1,7 +1,6 @@
|
||||
{
|
||||
"pages": [
|
||||
"pages/index/index",
|
||||
"pages/table/index"
|
||||
"pages/index/index"
|
||||
],
|
||||
"subPackages": [],
|
||||
"window": {
|
||||
@@ -10,25 +9,5 @@
|
||||
"navigationBarBackgroundColor": "#F8F8F8",
|
||||
"backgroundColor": "#F8F8F8"
|
||||
},
|
||||
"tabBar": {
|
||||
"color": "#7A7E83",
|
||||
"selectedColor": "#007AFF",
|
||||
"borderStyle": "black",
|
||||
"backgroundColor": "#F8F8F8",
|
||||
"list": [
|
||||
{
|
||||
"pagePath": "pages/index/index",
|
||||
"iconPath": "static/home.png",
|
||||
"selectedIconPath": "static/home-active.png",
|
||||
"text": "主页"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/table/index",
|
||||
"iconPath": "static/component.png",
|
||||
"selectedIconPath": "static/componentHL.png",
|
||||
"text": "表格组件"
|
||||
}
|
||||
]
|
||||
},
|
||||
"usingComponents": {}
|
||||
}
|
||||
@@ -105,11 +105,11 @@
|
||||
/******/
|
||||
/******/
|
||||
/******/ // mini-css-extract-plugin CSS loading
|
||||
/******/ var cssChunks = {"uni_modules/zb-drawer/components/zb-drawer/zb-drawer":1,"uni_modules/zb-table/components/zb-table/zb-table":1,"uni_modules/uni-card/components/uni-card/uni-card":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/table-checkbox":1,"uni_modules/zb-table/components/zb-table/components/zb-load-more":1};
|
||||
/******/ var cssChunks = {"uni_modules/zb-drawer/components/zb-drawer/zb-drawer":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-drawer/components/zb-drawer/zb-drawer":"uni_modules/zb-drawer/components/zb-drawer/zb-drawer","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","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/table-checkbox":"uni_modules/zb-table/components/zb-table/components/table-checkbox","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-drawer/components/zb-drawer/zb-drawer":"uni_modules/zb-drawer/components/zb-drawer/zb-drawer"}[chunkId]||chunkId) + ".wxss";
|
||||
/******/ var fullhref = __webpack_require__.p + href;
|
||||
/******/ var existingLinkTags = document.getElementsByTagName("link");
|
||||
/******/ for(var i = 0; i < existingLinkTags.length; i++) {
|
||||
|
||||
214
unpackage/dist/dev/mp-weixin/common/vendor.js
vendored
214
unpackage/dist/dev/mp-weixin/common/vendor.js
vendored
@@ -2120,62 +2120,6 @@ try {
|
||||
module.exports = g;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 26:
|
||||
/*!*************************************************!*\
|
||||
!*** E:/dingw/pr2/zzb-table/pages/table/all.js ***!
|
||||
\*************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });exports.column4 = exports.column3 = exports.column2 = exports.column1 = void 0;var column1 = [
|
||||
{ type: 'index', width: 60 },
|
||||
{ name: 'name', label: '姓名', width: 80, emptyString: '--' },
|
||||
{ name: 'age', label: '年纪' },
|
||||
{ name: 'sex', label: '性别', filters: { 0: '男', 1: '女' } },
|
||||
{ name: 'address', label: '地址' },
|
||||
{ name: 'date', label: '日期' },
|
||||
{ name: 'province', label: '省份' },
|
||||
{ name: 'city', label: '城市' },
|
||||
{ name: 'zip', label: '邮编' }];exports.column1 = column1;
|
||||
|
||||
var column2 = [
|
||||
{ type: 'selection', width: 50 },
|
||||
{ name: 'name', label: '姓名', width: 80, emptyString: '--' },
|
||||
{ name: 'age', label: '年纪' },
|
||||
{ name: 'sex', label: '性别', filters: { 0: '男', 1: '女' } },
|
||||
{ name: 'address', label: '地址' },
|
||||
{ name: 'date', label: '日期' },
|
||||
{ name: 'province', label: '省份' },
|
||||
{ name: 'city', label: '城市' },
|
||||
{ name: 'zip', label: '邮编' }];exports.column2 = column2;
|
||||
|
||||
|
||||
var column3 = [
|
||||
{ type: 'selection', fixed: true, width: 50 },
|
||||
{ name: 'name', label: '姓名', fixed: true, width: 80, emptyString: '--' },
|
||||
{ name: 'age', label: '年纪' },
|
||||
{ name: 'sex', label: '性别', filters: { 0: '男', 1: '女' } },
|
||||
{ name: 'address', label: '地址' },
|
||||
{ name: 'date', label: '日期' },
|
||||
{ name: 'province', label: '省份' },
|
||||
{ name: 'city', label: '城市' },
|
||||
{ name: 'zip', label: '邮编' }];exports.column3 = column3;
|
||||
|
||||
|
||||
var column4 = [
|
||||
{ type: 'selection', fixed: true, width: 50 },
|
||||
{ name: 'name', label: '姓名', fixed: true, width: 80, emptyString: '--' },
|
||||
{ name: 'age', label: '年纪', sorter: true },
|
||||
{ name: 'sex', label: '性别', filters: { 0: '男', 1: '女' } },
|
||||
{ name: 'address', label: '地址' },
|
||||
{ name: 'date', label: '日期', sorter: true },
|
||||
{ name: 'province', label: '省份' },
|
||||
{ name: 'city', label: '城市' },
|
||||
{ name: 'zip', label: '邮编' }];exports.column4 = column4;
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 3:
|
||||
@@ -9494,164 +9438,6 @@ function resolveLocaleChain(locale) {
|
||||
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 51:
|
||||
/*!**********************************************************************************!*\
|
||||
!*** E:/dingw/pr2/zzb-table/uni_modules/zb-table/components/zb-table/js/util.js ***!
|
||||
\**********************************************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });exports.getScrollbarSize = void 0; /**
|
||||
* 获取滚动条宽度
|
||||
*/
|
||||
var cached = undefined;
|
||||
|
||||
var getScrollbarSize = function getScrollbarSize(fresh) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return cached;
|
||||
};exports.getScrollbarSize = getScrollbarSize;
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 68:
|
||||
/*!*************************************************************************************!*\
|
||||
!*** E:/dingw/pr2/zzb-table/uni_modules/zb-table/components/zb-table/js/summary.js ***!
|
||||
\*************************************************************************************/
|
||||
/*! no static exports found */
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default2 = {
|
||||
props: {
|
||||
scrollbarSize: {
|
||||
type: Number,
|
||||
default: 0 },
|
||||
|
||||
fixedLeftColumns: {
|
||||
type: Array,
|
||||
default: function _default() {return [];} },
|
||||
|
||||
data: {
|
||||
type: Array,
|
||||
default: function _default() {return [];} },
|
||||
|
||||
transColumns: {
|
||||
type: Array,
|
||||
default: function _default() {return [];} },
|
||||
|
||||
border: {
|
||||
type: Boolean,
|
||||
default: false },
|
||||
|
||||
showSummary: {
|
||||
type: Boolean,
|
||||
default: false },
|
||||
|
||||
summaryMethod: {
|
||||
type: Function },
|
||||
|
||||
sumText: {
|
||||
type: String,
|
||||
default: '合计' },
|
||||
|
||||
headerFooterTableLeft: {
|
||||
type: Number,
|
||||
default: 0 },
|
||||
|
||||
handleFooterTableScrollLeft: Function },
|
||||
|
||||
data: function data() {
|
||||
return {
|
||||
sums: [] };
|
||||
|
||||
},
|
||||
watch: {
|
||||
'data': {
|
||||
deep: true,
|
||||
immediate: true,
|
||||
handler: function handler(newValue, oldValue) {var _this = this;
|
||||
var sums = [];
|
||||
if (this.summaryMethod) {
|
||||
sums = this.summaryMethod({ columns: this.transColumns, data: this.data });
|
||||
} else {
|
||||
this.transColumns.forEach(function (column, index) {
|
||||
if (index === 0) {
|
||||
sums[index] = _this.sumText;
|
||||
return;
|
||||
}
|
||||
var values = _this.data.map(function (item) {return Number(item[column.name]);});
|
||||
var precisions = [];
|
||||
var notNumber = true;
|
||||
values.forEach(function (value) {
|
||||
if (!isNaN(value)) {
|
||||
notNumber = false;
|
||||
var decimal = ('' + value).split('.')[1];
|
||||
precisions.push(decimal ? decimal.length : 0);
|
||||
}
|
||||
});
|
||||
var precision = Math.max.apply(null, precisions);
|
||||
if (!notNumber) {
|
||||
sums[index] = values.reduce(function (prev, curr) {
|
||||
var value = Number(curr);
|
||||
if (!isNaN(value)) {
|
||||
return parseFloat((prev + curr).toFixed(Math.min(precision, 20)));
|
||||
} else {
|
||||
return prev;
|
||||
}
|
||||
}, 0);
|
||||
} else {
|
||||
sums[index] = '';
|
||||
}
|
||||
});
|
||||
}
|
||||
this.sums = sums;
|
||||
} } } };exports.default = _default2;
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 9:
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"component": true
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"component": true
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"component": true
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"component": true
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"component": true
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"usingComponents": {},
|
||||
"component": true
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"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",
|
||||
"table-h5-summary": "/uni_modules/zb-table/components/zb-table/components/table-h5-summary",
|
||||
"zb-load-more": "/uni_modules/zb-table/components/zb-table/components/zb-load-more"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user