增加单元格的 设置颜色
This commit is contained in:
24
.idea/workspace.xml
generated
24
.idea/workspace.xml
generated
@@ -4,10 +4,7 @@
|
||||
<list default="true" id="a358e186-f57e-4b90-864b-956058800d13" name="Default Changelist" comment="">
|
||||
<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$/readme.md" beforeDir="false" afterPath="$PROJECT_DIR$/readme.md" 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/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/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" />
|
||||
@@ -20,17 +17,12 @@
|
||||
<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-checkbox.js" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/mp-alipay/uni_modules/zb-table/components/zb-table/components/table-checkbox.js" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/mp-alipay/uni_modules/zb-table/components/zb-table/components/table-h5-summary.js" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/mp-alipay/uni_modules/zb-table/components/zb-table/components/table-h5-summary.js" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/mp-alipay/uni_modules/zb-table/components/zb-table/components/table-side-summary.js" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/mp-alipay/uni_modules/zb-table/components/zb-table/components/table-side-summary.js" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/mp-alipay/uni_modules/zb-table/components/zb-table/components/table-summary.js" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/mp-alipay/uni_modules/zb-table/components/zb-table/components/table-summary.js" 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/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/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.wxss" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/uni_modules/zb-table/components/zb-table/zb-table.wxss" 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" />
|
||||
@@ -40,7 +32,7 @@
|
||||
<component name="Git.Settings">
|
||||
<option name="RECENT_BRANCH_BY_REPOSITORY">
|
||||
<map>
|
||||
<entry key="$PROJECT_DIR$" value="master" />
|
||||
<entry key="$PROJECT_DIR$" value="loadmore" />
|
||||
</map>
|
||||
</option>
|
||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||
@@ -119,7 +111,8 @@
|
||||
<workItem from="1647999056170" duration="961000" />
|
||||
<workItem from="1648000462160" duration="241000" />
|
||||
<workItem from="1648001048491" duration="9707000" />
|
||||
<workItem from="1648117033147" duration="222000" />
|
||||
<workItem from="1648117033147" duration="944000" />
|
||||
<workItem from="1648118132004" duration="4559000" />
|
||||
</task>
|
||||
<task id="LOCAL-00006" summary="修改一些bug">
|
||||
<created>1647597737855</created>
|
||||
@@ -128,7 +121,14 @@
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1647597737855</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="7" />
|
||||
<task id="LOCAL-00007" summary="修改一些bug">
|
||||
<created>1648117283424</created>
|
||||
<option name="number" value="00007" />
|
||||
<option name="presentableId" value="LOCAL-00007" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1648117283424</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="8" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="TypeScriptGeneratedFilesManager">
|
||||
|
||||
@@ -21,10 +21,8 @@
|
||||
<uni-card title="普通表格" >
|
||||
<view style="height: 200px">
|
||||
<zb-table
|
||||
:show-header="true"
|
||||
:columns="column1"
|
||||
:stripe="true"
|
||||
:fit="false"
|
||||
@rowClick="rowClick"
|
||||
:data="data"></zb-table>
|
||||
</view>
|
||||
@@ -32,10 +30,8 @@
|
||||
<uni-card title="带边框表格" >
|
||||
<view style="height: 200px">
|
||||
<zb-table
|
||||
:show-header="true"
|
||||
:columns="column1"
|
||||
:stripe="true"
|
||||
:fit="false"
|
||||
@rowClick="rowClick"
|
||||
:border="true"
|
||||
:data="data"></zb-table>
|
||||
@@ -44,10 +40,8 @@
|
||||
<uni-card title="多选,多行数据时使用 Checkbox" >
|
||||
<view style="height: 200px">
|
||||
<zb-table
|
||||
:show-header="true"
|
||||
:columns="column2"
|
||||
:stripe="true"
|
||||
:fit="false"
|
||||
@rowClick="rowClick"
|
||||
@toggleRowSelection="toggleRowSelection"
|
||||
@toggleAllSelection="toggleAllSelection"
|
||||
@@ -60,10 +54,8 @@
|
||||
<uni-card title="固定多列和表头" >
|
||||
<view style="height: 200px">
|
||||
<zb-table
|
||||
:show-header="true"
|
||||
:columns="column3"
|
||||
:stripe="true"
|
||||
:fit="false"
|
||||
@rowClick="rowClick"
|
||||
@toggleRowSelection="toggleRowSelection"
|
||||
@toggleAllSelection="toggleAllSelection"
|
||||
@@ -353,6 +345,7 @@ img:"https://img.pddpic.com/mms-material-img/2020-11-27/84c7fad3-d945-4e71-ab09-
|
||||
},
|
||||
methods:{
|
||||
cellStyle({row, column, rowIndex, columnIndex}){
|
||||
// console.log('row, column, rowIndex, columnIndex')
|
||||
if(columnIndex === 2 || columnIndex === 4) {
|
||||
return{
|
||||
color:'red'
|
||||
|
||||
@@ -65,13 +65,13 @@
|
||||
@click.stop="rowClick(item,index)"
|
||||
v-for="(item,index) in transData" :key="item.key" >
|
||||
<view
|
||||
:style="{
|
||||
:style="[{
|
||||
width:`${ite.width?ite.width:'100'}px`,
|
||||
flex:i===transColumns.length-1?1:'none',
|
||||
minWidth:`${ite.width?ite.width:'100'}px`,
|
||||
borderRight:`${border?'1px solid #e8e8e8':''}`,
|
||||
textAlign:ite.align||'left'
|
||||
}"
|
||||
textAlign:ite.align||'left',
|
||||
},cellStyle&&getCellStyle(item,ite,index,i)]"
|
||||
|
||||
:class="['item-td',stripe?(index % 2) != 0?'odd':'even':'']"
|
||||
v-for="(ite,i) in transColumns" :key="i">
|
||||
@@ -282,15 +282,14 @@
|
||||
@click.stop="rowClick(item,index)"
|
||||
v-for="(item,index) in transData" :key="item.key" >
|
||||
<view
|
||||
:style="{
|
||||
left:`${ite.left}px`,
|
||||
width:`${ite.width?ite.width:'100'}px`,
|
||||
flex:i===transColumns.length-1?1:'none',
|
||||
minWidth:`${ite.width?ite.width:'100'}px`,
|
||||
borderRight:`${border?'1px solid #e8e8e8':''}`,
|
||||
textAlign:ite.align||'left',
|
||||
}
|
||||
"
|
||||
:style="[{
|
||||
left:`${ite.left}px`,
|
||||
width:`${ite.width?ite.width:'100'}px`,
|
||||
flex:i===transColumns.length-1?1:'none',
|
||||
minWidth:`${ite.width?ite.width:'100'}px`,
|
||||
borderRight:`${border?'1px solid #e8e8e8':''}`,
|
||||
textAlign:ite.align||'left',
|
||||
},getCellStyle(item,ite,index,i)]"
|
||||
:class="['item-td', i <fixedLeftColumns.length&&'zb-stick-side',stripe?(index % 2) != 0?'odd':'even':'']"
|
||||
v-for="(ite,i) in transColumns" :key="i">
|
||||
<template v-if="ite.type==='operation'">
|
||||
@@ -415,17 +414,9 @@ export default {
|
||||
computed:{
|
||||
fixedLeftColumns(){
|
||||
let arr = []
|
||||
let number = 0
|
||||
for(let i=0;i<this.columns.length;i++){
|
||||
let item = this.columns[i]
|
||||
if(item.fixed){
|
||||
if(i===0){
|
||||
item.left = 0
|
||||
number+=item.width
|
||||
}else {
|
||||
item.left = number
|
||||
number+=item.width
|
||||
}
|
||||
arr.push(item)
|
||||
}else {
|
||||
break
|
||||
@@ -465,19 +456,32 @@ export default {
|
||||
arr.push(width)
|
||||
}
|
||||
})
|
||||
column.width = Math.max(...arr)+20
|
||||
column.width = Math.max(...arr)+20
|
||||
}
|
||||
})
|
||||
return this.columns
|
||||
}
|
||||
this.columns.forEach(item=>{
|
||||
|
||||
let number = 0
|
||||
|
||||
this.columns.forEach((item,index)=>{
|
||||
if(item.type==="operation"&&item.renders&&!item.width){
|
||||
let str = ''
|
||||
item.renders.map((item)=>{
|
||||
str+=item.name
|
||||
})
|
||||
let str = ''
|
||||
item.renders.map((item)=>{
|
||||
str+=item.name
|
||||
})
|
||||
item.width = this.getTextWidth(str)+item.renders.length*40
|
||||
}
|
||||
if(item.fixed){
|
||||
if(index===0){
|
||||
item.left = 0
|
||||
number+=item.width
|
||||
}else {
|
||||
item.left = number
|
||||
number+=item.width
|
||||
}
|
||||
}
|
||||
|
||||
item.emptyString = item.emptyString||'--'
|
||||
})
|
||||
return this.columns
|
||||
@@ -505,7 +509,15 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
getCellStyle() {
|
||||
return (row, column, rowIndex, columnIndex)=>{
|
||||
const cellStyle = this.cellStyle;
|
||||
if(typeof cellStyle==='function'){
|
||||
return cellStyle({row, column, rowIndex, columnIndex})
|
||||
}
|
||||
return {}
|
||||
}
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
@@ -15,6 +15,7 @@ table 表格 固定表头、固定首列、多列 上拉加载更多、 排序
|
||||
| stripe | 是否为斑马纹 table| boolean | - |false | 否 |
|
||||
| fit | 列的宽度是否自撑开 | boolean |true,false | false |否 |
|
||||
| show-header | 是否显示表头 | boolean |true,false | true |否 |
|
||||
| cell-style | 单元格的 style 的回调方法,也可以使用一个固定的 Object 为所有单元格设置一样的 Style。 | Function({row, column, rowIndex, 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
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
10
unpackage/dist/dev/mp-alipay/common/vendor.js
vendored
10
unpackage/dist/dev/mp-alipay/common/vendor.js
vendored
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -8658,7 +8658,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 + ']');
|
||||
@@ -8679,14 +8679,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');
|
||||
@@ -8772,7 +8772,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
@@ -302,14 +302,6 @@ __webpack_require__.r(__webpack_exports__);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -469,16 +461,16 @@ 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, title: 'Hello', column: [{ type: 'selection', fixed: true, width: 60 }, { name: 'name', label: '姓名', fixed: true, width: 80, emptyString: '--' }, { name: 'age', label: 'id', sorter: true, align: 'right', fixed: false }, { name: 'sex', label: '性别', filters: { 0: '男', 1: '女' } }, { name: 'price', 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: '编辑', func: 'edit' // func 代表子元素点击的事件 父元素接收的事件 父元素 @edit
|
||||
}, { name: '删除', type: 'warn', func: "dele" }] }], data: [{ date: '2016-05-02', name: '', price: 1, province: '上海', 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: '', city: '普陀区', address: '上海市普上海市普上海市普上海市普', zip: 200333 }, { date: '2016-05-01', name: '王小虎2', province: '上海', sex: '0', price: 22, 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: '2016-05-02', 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: 200333 }, { 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: 33, 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: 200333 }, { date: '2019-05-02', name: '王小虎7', price: 33, province: '上海', sex: 1, age: '10', 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: 33, 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: '上海市普',
|
||||
}, { name: '删除', type: 'warn', func: "dele" }] }], data: [{ date: '2016-05-02', name: '', price: 1, province: '上海', 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: '', city: '普陀区', address: '上海市普上海市普上海市普上海市普', zip: 200333 }, { date: '2016-05-01', name: '王小虎2', province: '上海', sex: '0', price: 22, 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: '2016-05-02', 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: 200333 }, { 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: 33, 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: 200333 }, { date: '2019-05-02', name: '王小虎7', price: 33, province: '上海', sex: 1, age: '10', 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: 33, 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',
|
||||
@@ -515,6 +507,7 @@ var that = null;var _default = { components: {}, data: function data() {return {
|
||||
},
|
||||
methods: {
|
||||
cellStyle: function cellStyle(_ref) {var row = _ref.row,column = _ref.column,rowIndex = _ref.rowIndex,columnIndex = _ref.columnIndex;
|
||||
// console.log('row, column, rowIndex, columnIndex')
|
||||
if (columnIndex === 2 || columnIndex === 4) {
|
||||
return {
|
||||
color: 'red' };
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -91,6 +91,18 @@ var render = function() {
|
||||
var l0 = _vm.__map(_vm.transColumns, function(ite, i) {
|
||||
var $orig = _vm.__get_orig(ite)
|
||||
|
||||
var s0 = _vm.__get_style([
|
||||
{
|
||||
left: ite.left + "px",
|
||||
width: (ite.width ? ite.width : "100") + "px",
|
||||
flex: i === _vm.transColumns.length - 1 ? 1 : "none",
|
||||
minWidth: (ite.width ? ite.width : "100") + "px",
|
||||
borderRight: "" + (_vm.border ? "1px solid #e8e8e8" : ""),
|
||||
textAlign: ite.align || "left"
|
||||
},
|
||||
_vm.getCellStyle(item, ite, index, i)
|
||||
])
|
||||
|
||||
var m1 =
|
||||
!(ite.type === "operation") &&
|
||||
!(ite.type === "selection") &&
|
||||
@@ -101,6 +113,7 @@ var render = function() {
|
||||
: null
|
||||
return {
|
||||
$orig: $orig,
|
||||
s0: s0,
|
||||
m1: m1
|
||||
}
|
||||
})
|
||||
@@ -522,7 +535,6 @@ __webpack_require__.r(__webpack_exports__);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{
|
||||
@@ -586,17 +598,9 @@ __webpack_require__.r(__webpack_exports__);
|
||||
computed: {
|
||||
fixedLeftColumns: function fixedLeftColumns() {
|
||||
var arr = [];
|
||||
var number = 0;
|
||||
for (var i = 0; i < this.columns.length; i++) {
|
||||
var item = this.columns[i];
|
||||
if (item.fixed) {
|
||||
if (i === 0) {
|
||||
item.left = 0;
|
||||
number += item.width;
|
||||
} else {
|
||||
item.left = number;
|
||||
number += item.width;
|
||||
}
|
||||
arr.push(item);
|
||||
} else {
|
||||
break;
|
||||
@@ -641,7 +645,10 @@ __webpack_require__.r(__webpack_exports__);
|
||||
});
|
||||
return this.columns;
|
||||
}
|
||||
this.columns.forEach(function (item) {
|
||||
|
||||
var number = 0;
|
||||
|
||||
this.columns.forEach(function (item, index) {
|
||||
if (item.type === "operation" && item.renders && !item.width) {
|
||||
var str = '';
|
||||
item.renders.map(function (item) {
|
||||
@@ -649,6 +656,16 @@ __webpack_require__.r(__webpack_exports__);
|
||||
});
|
||||
item.width = _this.getTextWidth(str) + item.renders.length * 40;
|
||||
}
|
||||
if (item.fixed) {
|
||||
if (index === 0) {
|
||||
item.left = 0;
|
||||
number += item.width;
|
||||
} else {
|
||||
item.left = number;
|
||||
number += item.width;
|
||||
}
|
||||
}
|
||||
|
||||
item.emptyString = item.emptyString || '--';
|
||||
});
|
||||
return this.columns;
|
||||
@@ -675,6 +692,15 @@ __webpack_require__.r(__webpack_exports__);
|
||||
return index === _this3.currentRowIndex;
|
||||
}
|
||||
};
|
||||
},
|
||||
getCellStyle: function getCellStyle() {var _this4 = this;
|
||||
return function (row, column, rowIndex, columnIndex) {
|
||||
var cellStyle = _this4.cellStyle;
|
||||
if (typeof cellStyle === 'function') {
|
||||
return cellStyle({ row: row, column: column, rowIndex: rowIndex, columnIndex: columnIndex });
|
||||
}
|
||||
return {};
|
||||
};
|
||||
} },
|
||||
|
||||
data: function data() {
|
||||
@@ -713,18 +739,7 @@ __webpack_require__.r(__webpack_exports__);
|
||||
mounted: function mounted() {
|
||||
},
|
||||
methods: {
|
||||
getCellStyle: function getCellStyle(row, column, rowIndex, columnIndex) {
|
||||
var cellStyle = this.cellStyle;
|
||||
if (typeof cellStyle === 'function') {
|
||||
return cellStyle.call(null, {
|
||||
rowIndex: rowIndex,
|
||||
columnIndex: columnIndex,
|
||||
row: row,
|
||||
column: column });
|
||||
|
||||
}
|
||||
return cellStyle;
|
||||
},
|
||||
|
||||
pullUpCompleteLoading: function pullUpCompleteLoading(type) {
|
||||
this.isLoadMore = false;
|
||||
@@ -732,7 +747,7 @@ __webpack_require__.r(__webpack_exports__);
|
||||
this.completeLoading = true;
|
||||
}
|
||||
},
|
||||
scrollAlipay: function scrollAlipay(e) {var _this4 = this;
|
||||
scrollAlipay: function scrollAlipay(e) {var _this5 = this;
|
||||
|
||||
if (!this.alipayScrollOldTop) {
|
||||
this.alipayScrollOldTop = e.detail.scrollTop;
|
||||
@@ -740,11 +755,11 @@ __webpack_require__.r(__webpack_exports__);
|
||||
this.aliTime && clearTimeout(this.aliTime);
|
||||
this.aliTime = setTimeout(function () {
|
||||
|
||||
if (_this4.alipayFlag && e.detail.scrollTop > _this4.alipayScrollOldTop) {
|
||||
_this4.pullLoad();
|
||||
if (_this5.alipayFlag && e.detail.scrollTop > _this5.alipayScrollOldTop) {
|
||||
_this5.pullLoad();
|
||||
}
|
||||
_this4.alipayFlag = false;
|
||||
_this4.alipayScrollOldTop = null;
|
||||
_this5.alipayFlag = false;
|
||||
_this5.alipayScrollOldTop = null;
|
||||
}, 500);
|
||||
},
|
||||
pullLoad: function pullLoad() {
|
||||
@@ -788,19 +803,19 @@ __webpack_require__.r(__webpack_exports__);
|
||||
this.$emit('rowClick', row, index);
|
||||
}
|
||||
},
|
||||
checkboxSelectedAll: function checkboxSelectedAll(e) {var _this5 = this;
|
||||
checkboxSelectedAll: function checkboxSelectedAll(e) {var _this6 = this;
|
||||
this.indeterminate = false;
|
||||
if (e.checked) {
|
||||
this.selectArr = [];
|
||||
this.checkedAll = true;
|
||||
this.data.forEach(function (item) {
|
||||
_this5.$set(item, 'checked', true);
|
||||
_this5.selectArr.push(item);
|
||||
_this6.$set(item, 'checked', true);
|
||||
_this6.selectArr.push(item);
|
||||
});
|
||||
} else {
|
||||
this.checkedAll = false;
|
||||
this.data.forEach(function (item) {
|
||||
_this5.$set(item, 'checked', false);
|
||||
_this6.$set(item, 'checked', false);
|
||||
});
|
||||
this.selectArr = [];
|
||||
}
|
||||
@@ -904,14 +919,14 @@ __webpack_require__.r(__webpack_exports__);
|
||||
this.$forceUpdate();
|
||||
|
||||
},
|
||||
sortData: function sortData(item) {var _this6 = this;
|
||||
sortData: function sortData(item) {var _this7 = this;
|
||||
var key = item.name;
|
||||
if (item.sorterMode === '_asc') {
|
||||
this.data.sort(function (a, b) {
|
||||
if (_this6.checkNumber(a[key])) {
|
||||
if (_this7.checkNumber(a[key])) {
|
||||
return a[key] - b[key];
|
||||
}
|
||||
if (_this6.isDate(a[key])) {
|
||||
if (_this7.isDate(a[key])) {
|
||||
var a1 = new Date(a[key]).getTime();
|
||||
var b1 = new Date(b[key]).getTime();
|
||||
return a1 - b1;
|
||||
@@ -919,10 +934,10 @@ __webpack_require__.r(__webpack_exports__);
|
||||
});
|
||||
} else {
|
||||
this.data.sort(function (a, b) {
|
||||
if (_this6.checkNumber(a[key])) {
|
||||
if (_this7.checkNumber(a[key])) {
|
||||
return b[key] - a[key];
|
||||
}
|
||||
if (_this6.isDate(a[key])) {
|
||||
if (_this7.isDate(a[key])) {
|
||||
var a1 = new Date(a[key]).getTime();
|
||||
var b1 = new Date(b[key]).getTime();
|
||||
return b1 - a1;
|
||||
@@ -941,15 +956,15 @@ __webpack_require__.r(__webpack_exports__);
|
||||
}
|
||||
};
|
||||
},
|
||||
debounce: function debounce(method) {var _this7 = this;var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1000;
|
||||
debounce: function debounce(method) {var _this8 = this;var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1000;
|
||||
return function () {for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {args[_key2] = arguments[_key2];}
|
||||
_this7.debounceTime && clearTimeout(_this7.debounceTime);
|
||||
_this7.debounceTime = setTimeout(function () {
|
||||
_this8.debounceTime && clearTimeout(_this8.debounceTime);
|
||||
_this8.debounceTime = setTimeout(function () {
|
||||
method.apply(void 0, args);
|
||||
}, delay);
|
||||
};
|
||||
},
|
||||
handleBodyScroll: function handleBodyScroll(e) {var _this8 = this;
|
||||
handleBodyScroll: function handleBodyScroll(e) {var _this9 = this;
|
||||
if (this.currentDriver && this.currentDriver !== e.currentTarget.id) return;
|
||||
this.currentDriver = e.currentTarget.id;
|
||||
this.headerTableLeft = e.detail.scrollLeft;
|
||||
@@ -957,20 +972,20 @@ __webpack_require__.r(__webpack_exports__);
|
||||
this.leftFiexScrollTop = e.detail.scrollTop;
|
||||
this.bodyTime && clearTimeout(this.bodyTime);
|
||||
this.bodyTime = setTimeout(function () {
|
||||
_this8.currentDriver = null;
|
||||
_this9.currentDriver = null;
|
||||
}, 200);
|
||||
|
||||
},
|
||||
leftFixedScrollAction: function leftFixedScrollAction(e) {var _this9 = this;
|
||||
leftFixedScrollAction: function leftFixedScrollAction(e) {var _this10 = this;
|
||||
if (this.currentDriver && this.currentDriver !== e.currentTarget.id) return;
|
||||
this.currentDriver = e.currentTarget.id;
|
||||
this.bodyScrollTop = e.detail.scrollTop;
|
||||
this.bodyTime && clearTimeout(this.bodyTime);
|
||||
this.bodyTime = setTimeout(function () {
|
||||
_this9.currentDriver = null;
|
||||
_this10.currentDriver = null;
|
||||
}, 200);
|
||||
},
|
||||
scrollToLeft: function scrollToLeft(e) {var _this10 = this;
|
||||
scrollToLeft: function scrollToLeft(e) {var _this11 = this;
|
||||
if (this.currentDriver1 && this.currentDriver1 !== e.currentTarget.id) return;
|
||||
this.currentDriver1 = e.currentTarget.id;
|
||||
if (e.detail.direction === 'left' && this.headerTableLeft < 10) {
|
||||
@@ -980,10 +995,10 @@ __webpack_require__.r(__webpack_exports__);
|
||||
}
|
||||
this.bodyTime && clearTimeout(this.bodyTime);
|
||||
this.bodyTime = setTimeout(function () {
|
||||
_this10.currentDriver1 = null;
|
||||
_this11.currentDriver1 = null;
|
||||
}, 200);
|
||||
},
|
||||
scrollToFixedLeft: function scrollToFixedLeft(e) {var _this11 = this;
|
||||
scrollToFixedLeft: function scrollToFixedLeft(e) {var _this12 = this;
|
||||
if (this.currentDriver1 && this.currentDriver1 !== e.currentTarget.id) return;
|
||||
this.currentDriver1 = e.currentTarget.id;
|
||||
if (e.detail.direction === 'top' && this.bodyScrollTop < 10) {
|
||||
@@ -991,27 +1006,27 @@ __webpack_require__.r(__webpack_exports__);
|
||||
}
|
||||
this.bodyTime && clearTimeout(this.bodyTime);
|
||||
this.bodyTime = setTimeout(function () {
|
||||
_this11.currentDriver1 = null;
|
||||
_this12.currentDriver1 = null;
|
||||
}, 200);
|
||||
},
|
||||
handleTableScrollLeft: function handleTableScrollLeft(e, type) {var _this12 = this;
|
||||
handleTableScrollLeft: function handleTableScrollLeft(e, type) {var _this13 = this;
|
||||
if (this.currentDriver && this.currentDriver !== e.currentTarget.id) return;
|
||||
this.currentDriver = e.currentTarget.id;
|
||||
this.bodyTableLeft = e.detail.scrollLeft;
|
||||
this.headerFooterTableLeft = e.detail.scrollLeft;
|
||||
this.bodyTime && clearTimeout(this.bodyTime);
|
||||
this.bodyTime = setTimeout(function () {
|
||||
_this12.currentDriver = null;
|
||||
_this13.currentDriver = null;
|
||||
}, 200);
|
||||
},
|
||||
handleFooterTableScrollLeft: function handleFooterTableScrollLeft(e) {var _this13 = this;
|
||||
handleFooterTableScrollLeft: function handleFooterTableScrollLeft(e) {var _this14 = this;
|
||||
if (this.currentDriver && this.currentDriver !== e.currentTarget.id) return;
|
||||
this.currentDriver = e.currentTarget.id;
|
||||
this.bodyTableLeft = e.detail.scrollLeft;
|
||||
this.headerTableLeft = e.detail.scrollLeft;
|
||||
this.bodyTime && clearTimeout(this.bodyTime);
|
||||
this.bodyTime = setTimeout(function () {
|
||||
_this13.currentDriver = null;
|
||||
_this14.currentDriver = null;
|
||||
}, 200);
|
||||
} } };exports.default = _default2;
|
||||
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-alipay/dist/index.js */ 1)["default"]))
|
||||
|
||||
@@ -302,14 +302,6 @@ __webpack_require__.r(__webpack_exports__);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -469,16 +461,16 @@ 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, title: 'Hello', column: [{ type: 'selection', fixed: true, width: 60 }, { name: 'name', label: '姓名', fixed: true, width: 80, emptyString: '--' }, { name: 'age', label: 'id', sorter: true, align: 'right', fixed: false }, { name: 'sex', label: '性别', filters: { 0: '男', 1: '女' } }, { name: 'price', 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: '编辑', func: 'edit' // func 代表子元素点击的事件 父元素接收的事件 父元素 @edit
|
||||
}, { name: '删除', type: 'warn', func: "dele" }] }], data: [{ date: '2016-05-02', name: '', price: 1, province: '上海', 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: '', city: '普陀区', address: '上海市普上海市普上海市普上海市普', zip: 200333 }, { date: '2016-05-01', name: '王小虎2', province: '上海', sex: '0', price: 22, 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: '2016-05-02', 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: 200333 }, { 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: 33, 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: 200333 }, { date: '2019-05-02', name: '王小虎7', price: 33, province: '上海', sex: 1, age: '10', 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: 33, 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: '上海市普',
|
||||
}, { name: '删除', type: 'warn', func: "dele" }] }], data: [{ date: '2016-05-02', name: '', price: 1, province: '上海', 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: '', city: '普陀区', address: '上海市普上海市普上海市普上海市普', zip: 200333 }, { date: '2016-05-01', name: '王小虎2', province: '上海', sex: '0', price: 22, 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: '2016-05-02', 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: 200333 }, { 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: 33, 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: 200333 }, { date: '2019-05-02', name: '王小虎7', price: 33, province: '上海', sex: 1, age: '10', 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: 33, 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',
|
||||
@@ -515,6 +507,7 @@ var that = null;var _default = { components: {}, data: function data() {return {
|
||||
},
|
||||
methods: {
|
||||
cellStyle: function cellStyle(_ref) {var row = _ref.row,column = _ref.column,rowIndex = _ref.rowIndex,columnIndex = _ref.columnIndex;
|
||||
// console.log('row, column, rowIndex, columnIndex')
|
||||
if (columnIndex === 2 || columnIndex === 4) {
|
||||
return {
|
||||
color: 'red' };
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -91,6 +91,18 @@ var render = function() {
|
||||
var l0 = _vm.__map(_vm.transColumns, function(ite, i) {
|
||||
var $orig = _vm.__get_orig(ite)
|
||||
|
||||
var s0 = _vm.__get_style([
|
||||
{
|
||||
left: ite.left + "px",
|
||||
width: (ite.width ? ite.width : "100") + "px",
|
||||
flex: i === _vm.transColumns.length - 1 ? 1 : "none",
|
||||
minWidth: (ite.width ? ite.width : "100") + "px",
|
||||
borderRight: "" + (_vm.border ? "1px solid #e8e8e8" : ""),
|
||||
textAlign: ite.align || "left"
|
||||
},
|
||||
_vm.getCellStyle(item, ite, index, i)
|
||||
])
|
||||
|
||||
var m1 =
|
||||
!(ite.type === "operation") &&
|
||||
!(ite.type === "selection") &&
|
||||
@@ -101,6 +113,7 @@ var render = function() {
|
||||
: null
|
||||
return {
|
||||
$orig: $orig,
|
||||
s0: s0,
|
||||
m1: m1
|
||||
}
|
||||
})
|
||||
@@ -522,7 +535,6 @@ __webpack_require__.r(__webpack_exports__);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{
|
||||
@@ -586,17 +598,9 @@ __webpack_require__.r(__webpack_exports__);
|
||||
computed: {
|
||||
fixedLeftColumns: function fixedLeftColumns() {
|
||||
var arr = [];
|
||||
var number = 0;
|
||||
for (var i = 0; i < this.columns.length; i++) {
|
||||
var item = this.columns[i];
|
||||
if (item.fixed) {
|
||||
if (i === 0) {
|
||||
item.left = 0;
|
||||
number += item.width;
|
||||
} else {
|
||||
item.left = number;
|
||||
number += item.width;
|
||||
}
|
||||
arr.push(item);
|
||||
} else {
|
||||
break;
|
||||
@@ -641,7 +645,10 @@ __webpack_require__.r(__webpack_exports__);
|
||||
});
|
||||
return this.columns;
|
||||
}
|
||||
this.columns.forEach(function (item) {
|
||||
|
||||
var number = 0;
|
||||
|
||||
this.columns.forEach(function (item, index) {
|
||||
if (item.type === "operation" && item.renders && !item.width) {
|
||||
var str = '';
|
||||
item.renders.map(function (item) {
|
||||
@@ -649,6 +656,16 @@ __webpack_require__.r(__webpack_exports__);
|
||||
});
|
||||
item.width = _this.getTextWidth(str) + item.renders.length * 40;
|
||||
}
|
||||
if (item.fixed) {
|
||||
if (index === 0) {
|
||||
item.left = 0;
|
||||
number += item.width;
|
||||
} else {
|
||||
item.left = number;
|
||||
number += item.width;
|
||||
}
|
||||
}
|
||||
|
||||
item.emptyString = item.emptyString || '--';
|
||||
});
|
||||
return this.columns;
|
||||
@@ -675,9 +692,17 @@ __webpack_require__.r(__webpack_exports__);
|
||||
return index === _this3.currentRowIndex;
|
||||
}
|
||||
};
|
||||
},
|
||||
getCellStyle: function getCellStyle() {var _this4 = this;
|
||||
return function (row, column, rowIndex, columnIndex) {
|
||||
var cellStyle = _this4.cellStyle;
|
||||
if (typeof cellStyle === 'function') {
|
||||
return cellStyle({ row: row, column: column, rowIndex: rowIndex, columnIndex: columnIndex });
|
||||
}
|
||||
return {};
|
||||
};
|
||||
} },
|
||||
|
||||
|
||||
data: function data() {
|
||||
return {
|
||||
button: [],
|
||||
@@ -722,7 +747,7 @@ __webpack_require__.r(__webpack_exports__);
|
||||
this.completeLoading = true;
|
||||
}
|
||||
},
|
||||
scrollAlipay: function scrollAlipay(e) {var _this4 = this;
|
||||
scrollAlipay: function scrollAlipay(e) {var _this5 = this;
|
||||
|
||||
if (!this.alipayScrollOldTop) {
|
||||
this.alipayScrollOldTop = e.detail.scrollTop;
|
||||
@@ -730,11 +755,11 @@ __webpack_require__.r(__webpack_exports__);
|
||||
this.aliTime && clearTimeout(this.aliTime);
|
||||
this.aliTime = setTimeout(function () {
|
||||
|
||||
if (_this4.alipayFlag && e.detail.scrollTop > _this4.alipayScrollOldTop) {
|
||||
_this4.pullLoad();
|
||||
if (_this5.alipayFlag && e.detail.scrollTop > _this5.alipayScrollOldTop) {
|
||||
_this5.pullLoad();
|
||||
}
|
||||
_this4.alipayFlag = false;
|
||||
_this4.alipayScrollOldTop = null;
|
||||
_this5.alipayFlag = false;
|
||||
_this5.alipayScrollOldTop = null;
|
||||
}, 500);
|
||||
},
|
||||
pullLoad: function pullLoad() {
|
||||
@@ -778,19 +803,19 @@ __webpack_require__.r(__webpack_exports__);
|
||||
this.$emit('rowClick', row, index);
|
||||
}
|
||||
},
|
||||
checkboxSelectedAll: function checkboxSelectedAll(e) {var _this5 = this;
|
||||
checkboxSelectedAll: function checkboxSelectedAll(e) {var _this6 = this;
|
||||
this.indeterminate = false;
|
||||
if (e.checked) {
|
||||
this.selectArr = [];
|
||||
this.checkedAll = true;
|
||||
this.data.forEach(function (item) {
|
||||
_this5.$set(item, 'checked', true);
|
||||
_this5.selectArr.push(item);
|
||||
_this6.$set(item, 'checked', true);
|
||||
_this6.selectArr.push(item);
|
||||
});
|
||||
} else {
|
||||
this.checkedAll = false;
|
||||
this.data.forEach(function (item) {
|
||||
_this5.$set(item, 'checked', false);
|
||||
_this6.$set(item, 'checked', false);
|
||||
});
|
||||
this.selectArr = [];
|
||||
}
|
||||
@@ -894,14 +919,14 @@ __webpack_require__.r(__webpack_exports__);
|
||||
this.$forceUpdate();
|
||||
|
||||
},
|
||||
sortData: function sortData(item) {var _this6 = this;
|
||||
sortData: function sortData(item) {var _this7 = this;
|
||||
var key = item.name;
|
||||
if (item.sorterMode === '_asc') {
|
||||
this.data.sort(function (a, b) {
|
||||
if (_this6.checkNumber(a[key])) {
|
||||
if (_this7.checkNumber(a[key])) {
|
||||
return a[key] - b[key];
|
||||
}
|
||||
if (_this6.isDate(a[key])) {
|
||||
if (_this7.isDate(a[key])) {
|
||||
var a1 = new Date(a[key]).getTime();
|
||||
var b1 = new Date(b[key]).getTime();
|
||||
return a1 - b1;
|
||||
@@ -909,10 +934,10 @@ __webpack_require__.r(__webpack_exports__);
|
||||
});
|
||||
} else {
|
||||
this.data.sort(function (a, b) {
|
||||
if (_this6.checkNumber(a[key])) {
|
||||
if (_this7.checkNumber(a[key])) {
|
||||
return b[key] - a[key];
|
||||
}
|
||||
if (_this6.isDate(a[key])) {
|
||||
if (_this7.isDate(a[key])) {
|
||||
var a1 = new Date(a[key]).getTime();
|
||||
var b1 = new Date(b[key]).getTime();
|
||||
return b1 - a1;
|
||||
@@ -931,15 +956,15 @@ __webpack_require__.r(__webpack_exports__);
|
||||
}
|
||||
};
|
||||
},
|
||||
debounce: function debounce(method) {var _this7 = this;var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1000;
|
||||
debounce: function debounce(method) {var _this8 = this;var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1000;
|
||||
return function () {for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {args[_key2] = arguments[_key2];}
|
||||
_this7.debounceTime && clearTimeout(_this7.debounceTime);
|
||||
_this7.debounceTime = setTimeout(function () {
|
||||
_this8.debounceTime && clearTimeout(_this8.debounceTime);
|
||||
_this8.debounceTime = setTimeout(function () {
|
||||
method.apply(void 0, args);
|
||||
}, delay);
|
||||
};
|
||||
},
|
||||
handleBodyScroll: function handleBodyScroll(e) {var _this8 = this;
|
||||
handleBodyScroll: function handleBodyScroll(e) {var _this9 = this;
|
||||
if (this.currentDriver && this.currentDriver !== e.currentTarget.id) return;
|
||||
this.currentDriver = e.currentTarget.id;
|
||||
this.headerTableLeft = e.detail.scrollLeft;
|
||||
@@ -947,20 +972,20 @@ __webpack_require__.r(__webpack_exports__);
|
||||
this.leftFiexScrollTop = e.detail.scrollTop;
|
||||
this.bodyTime && clearTimeout(this.bodyTime);
|
||||
this.bodyTime = setTimeout(function () {
|
||||
_this8.currentDriver = null;
|
||||
_this9.currentDriver = null;
|
||||
}, 200);
|
||||
|
||||
},
|
||||
leftFixedScrollAction: function leftFixedScrollAction(e) {var _this9 = this;
|
||||
leftFixedScrollAction: function leftFixedScrollAction(e) {var _this10 = this;
|
||||
if (this.currentDriver && this.currentDriver !== e.currentTarget.id) return;
|
||||
this.currentDriver = e.currentTarget.id;
|
||||
this.bodyScrollTop = e.detail.scrollTop;
|
||||
this.bodyTime && clearTimeout(this.bodyTime);
|
||||
this.bodyTime = setTimeout(function () {
|
||||
_this9.currentDriver = null;
|
||||
_this10.currentDriver = null;
|
||||
}, 200);
|
||||
},
|
||||
scrollToLeft: function scrollToLeft(e) {var _this10 = this;
|
||||
scrollToLeft: function scrollToLeft(e) {var _this11 = this;
|
||||
if (this.currentDriver1 && this.currentDriver1 !== e.currentTarget.id) return;
|
||||
this.currentDriver1 = e.currentTarget.id;
|
||||
if (e.detail.direction === 'left' && this.headerTableLeft < 10) {
|
||||
@@ -970,10 +995,10 @@ __webpack_require__.r(__webpack_exports__);
|
||||
}
|
||||
this.bodyTime && clearTimeout(this.bodyTime);
|
||||
this.bodyTime = setTimeout(function () {
|
||||
_this10.currentDriver1 = null;
|
||||
_this11.currentDriver1 = null;
|
||||
}, 200);
|
||||
},
|
||||
scrollToFixedLeft: function scrollToFixedLeft(e) {var _this11 = this;
|
||||
scrollToFixedLeft: function scrollToFixedLeft(e) {var _this12 = this;
|
||||
if (this.currentDriver1 && this.currentDriver1 !== e.currentTarget.id) return;
|
||||
this.currentDriver1 = e.currentTarget.id;
|
||||
if (e.detail.direction === 'top' && this.bodyScrollTop < 10) {
|
||||
@@ -981,27 +1006,27 @@ __webpack_require__.r(__webpack_exports__);
|
||||
}
|
||||
this.bodyTime && clearTimeout(this.bodyTime);
|
||||
this.bodyTime = setTimeout(function () {
|
||||
_this11.currentDriver1 = null;
|
||||
_this12.currentDriver1 = null;
|
||||
}, 200);
|
||||
},
|
||||
handleTableScrollLeft: function handleTableScrollLeft(e, type) {var _this12 = this;
|
||||
handleTableScrollLeft: function handleTableScrollLeft(e, type) {var _this13 = this;
|
||||
if (this.currentDriver && this.currentDriver !== e.currentTarget.id) return;
|
||||
this.currentDriver = e.currentTarget.id;
|
||||
this.bodyTableLeft = e.detail.scrollLeft;
|
||||
this.headerFooterTableLeft = e.detail.scrollLeft;
|
||||
this.bodyTime && clearTimeout(this.bodyTime);
|
||||
this.bodyTime = setTimeout(function () {
|
||||
_this12.currentDriver = null;
|
||||
_this13.currentDriver = null;
|
||||
}, 200);
|
||||
},
|
||||
handleFooterTableScrollLeft: function handleFooterTableScrollLeft(e) {var _this13 = this;
|
||||
handleFooterTableScrollLeft: function handleFooterTableScrollLeft(e) {var _this14 = this;
|
||||
if (this.currentDriver && this.currentDriver !== e.currentTarget.id) return;
|
||||
this.currentDriver = e.currentTarget.id;
|
||||
this.bodyTableLeft = e.detail.scrollLeft;
|
||||
this.headerTableLeft = e.detail.scrollLeft;
|
||||
this.bodyTime && clearTimeout(this.bodyTime);
|
||||
this.bodyTime = setTimeout(function () {
|
||||
_this13.currentDriver = null;
|
||||
_this14.currentDriver = null;
|
||||
}, 200);
|
||||
} } };exports.default = _default2;
|
||||
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user