修改 回显问题

This commit is contained in:
zouzhibing
2022-03-25 14:42:56 +08:00
parent 231a6d435e
commit 0d6c9bd833
25 changed files with 222 additions and 222 deletions

View File

@@ -1,21 +0,0 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="HtmlUnknownTag" enabled="true" level="WARNING" enabled_by_default="true">
<option name="myValues">
<value>
<list size="7">
<item index="0" class="java.lang.String" itemvalue="nobr" />
<item index="1" class="java.lang.String" itemvalue="noembed" />
<item index="2" class="java.lang.String" itemvalue="comment" />
<item index="3" class="java.lang.String" itemvalue="noscript" />
<item index="4" class="java.lang.String" itemvalue="embed" />
<item index="5" class="java.lang.String" itemvalue="script" />
<item index="6" class="java.lang.String" itemvalue="scroll-view" />
</list>
</value>
</option>
<option name="myCustomValuesEnabled" value="true" />
</inspection_tool>
</profile>
</component>

152
.idea/workspace.xml generated
View File

@@ -1,12 +1,56 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="a358e186-f57e-4b90-864b-956058800d13" name="Default Changelist" comment="增加单元格的 设置颜色">
<change afterPath="$PROJECT_DIR$/.gitignore" afterDir="false" />
<list default="true" id="be7958c3-0d1c-4f74-a433-b590462e7034" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/inspectionProfiles/Project_Default.xml" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/manifest.json" beforeDir="false" afterPath="$PROJECT_DIR$/manifest.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/readme.md" beforeDir="false" afterPath="$PROJECT_DIR$/readme.md" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pages/index/index.vue" beforeDir="false" afterPath="$PROJECT_DIR$/pages/index/index.vue" afterDir="false" />
<change beforePath="$PROJECT_DIR$/uni_modules/zb-table/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/readme.md" beforeDir="false" afterPath="$PROJECT_DIR$/uni_modules/zb-table/readme.md" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/.sourcemap/mp-weixin/common/runtime.js.map" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/.sourcemap/mp-weixin/common/runtime.js.map" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/.sourcemap/mp-weixin/common/vendor.js.map" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/.sourcemap/mp-weixin/common/vendor.js.map" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/.sourcemap/mp-weixin/pages/index/index.js.map" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/.sourcemap/mp-weixin/pages/index/index.js.map" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-card/components/uni-card/uni-card.js.map" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/uni-card/components/uni-card/uni-card.js.map" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/zb-table/components/zb-table/components/table-checkbox.js.map" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/zb-table/components/zb-table/components/table-checkbox.js.map" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/zb-table/components/zb-table/components/table-h5-summary.js.map" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/zb-table/components/zb-table/components/table-h5-summary.js.map" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/zb-table/components/zb-table/components/table-side-summary.js.map" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/zb-table/components/zb-table/components/table-side-summary.js.map" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/zb-table/components/zb-table/components/table-summary.js.map" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/zb-table/components/zb-table/components/table-summary.js.map" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/zb-table/components/zb-table/components/zb-load-more.js.map" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/zb-table/components/zb-table/components/zb-load-more.js.map" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/zb-table/components/zb-table/zb-table.js.map" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/.sourcemap/mp-weixin/uni_modules/zb-table/components/zb-table/zb-table.js.map" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/mp-alipay/.mini-ide/project-ide.json" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/mp-alipay/.mini-ide/project-ide.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/app.js" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/app.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/app.json" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/app.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/app.wxss" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/app.wxss" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/common/main.js" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/common/main.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/common/runtime.js" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/common/runtime.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/common/vendor.js" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/common/vendor.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/pages/index/index.js" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/pages/index/index.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/pages/index/index.json" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/pages/index/index.json" 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/pages/index/index.wxss" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/pages/index/index.wxss" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/project.config.json" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/project.config.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/uni_modules/uni-card/components/uni-card/uni-card.js" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/uni_modules/uni-card/components/uni-card/uni-card.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/uni_modules/uni-card/components/uni-card/uni-card.json" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/uni_modules/uni-card/components/uni-card/uni-card.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/uni_modules/uni-card/components/uni-card/uni-card.wxss" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/uni_modules/uni-card/components/uni-card/uni-card.wxss" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/uni_modules/zb-table/components/zb-table/components/table-checkbox.js" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/uni_modules/zb-table/components/zb-table/components/table-checkbox.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/uni_modules/zb-table/components/zb-table/components/table-checkbox.json" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/uni_modules/zb-table/components/zb-table/components/table-checkbox.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/uni_modules/zb-table/components/zb-table/components/table-checkbox.wxss" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/uni_modules/zb-table/components/zb-table/components/table-checkbox.wxss" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/uni_modules/zb-table/components/zb-table/components/table-h5-summary.js" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/uni_modules/zb-table/components/zb-table/components/table-h5-summary.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/uni_modules/zb-table/components/zb-table/components/table-h5-summary.json" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/uni_modules/zb-table/components/zb-table/components/table-h5-summary.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/uni_modules/zb-table/components/zb-table/components/table-h5-summary.wxss" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/uni_modules/zb-table/components/zb-table/components/table-h5-summary.wxss" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/uni_modules/zb-table/components/zb-table/components/table-side-summary.js" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/uni_modules/zb-table/components/zb-table/components/table-side-summary.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/uni_modules/zb-table/components/zb-table/components/table-side-summary.json" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/uni_modules/zb-table/components/zb-table/components/table-side-summary.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/uni_modules/zb-table/components/zb-table/components/table-side-summary.wxss" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/uni_modules/zb-table/components/zb-table/components/table-side-summary.wxss" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/uni_modules/zb-table/components/zb-table/components/table-summary.js" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/uni_modules/zb-table/components/zb-table/components/table-summary.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/uni_modules/zb-table/components/zb-table/components/table-summary.json" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/uni_modules/zb-table/components/zb-table/components/table-summary.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/uni_modules/zb-table/components/zb-table/components/table-summary.wxss" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/uni_modules/zb-table/components/zb-table/components/table-summary.wxss" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/uni_modules/zb-table/components/zb-table/components/zb-load-more.bak.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/uni_modules/zb-table/components/zb-table/components/zb-load-more.js" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/uni_modules/zb-table/components/zb-table/components/zb-load-more.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/uni_modules/zb-table/components/zb-table/components/zb-load-more.json" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/uni_modules/zb-table/components/zb-table/components/zb-load-more.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/uni_modules/zb-table/components/zb-table/components/zb-load-more.wxss" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/uni_modules/zb-table/components/zb-table/components/zb-load-more.wxss" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/uni_modules/zb-table/components/zb-table/zb-table.js" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/uni_modules/zb-table/components/zb-table/zb-table.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/uni_modules/zb-table/components/zb-table/zb-table.json" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/uni_modules/zb-table/components/zb-table/zb-table.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/uni_modules/zb-table/components/zb-table/zb-table.wxss" beforeDir="false" afterPath="$PROJECT_DIR$/unpackage/dist/dev/mp-weixin/uni_modules/zb-table/components/zb-table/zb-table.wxss" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -14,14 +58,9 @@
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="Git.Settings">
<option name="RECENT_BRANCH_BY_REPOSITORY">
<map>
<entry key="$PROJECT_DIR$" value="loadmore" />
</map>
</option>
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="ProjectId" id="26SHfipTTwO2xVBYBbjrX0qwbLM" />
<component name="ProjectId" id="26rhwtBGqLb7juC522rK06TrAm0" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
@@ -30,108 +69,25 @@
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
<property name="node.js.detected.package.eslint" value="true" />
<property name="node.js.detected.package.tslint" value="true" />
<property name="node.js.selected.package.eslint" value="(autodetect)" />
<property name="node.js.selected.package.tslint" value="(autodetect)" />
<property name="vue.rearranger.settings.migration" value="true" />
</component>
<component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS">
<recent name="E:\dingw\pr2\zzb-table" />
<recent name="E:\dingw\pr2\zzb-table\pages\index" />
<recent name="E:\dingw\pr2\zzb-table\uni_modules" />
<recent name="E:\dingw\pr2\zzb-table\components" />
</key>
</component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager">
<task id="LOCAL-00001" summary="测试">
<created>1647398165536</created>
<option name="number" value="00001" />
<option name="presentableId" value="LOCAL-00001" />
<option name="project" value="LOCAL" />
<updated>1647398165536</updated>
</task>
<task id="LOCAL-00002" summary="去掉多余的注释">
<created>1647398498140</created>
<option name="number" value="00002" />
<option name="presentableId" value="LOCAL-00002" />
<option name="project" value="LOCAL" />
<updated>1647398498140</updated>
</task>
<task id="LOCAL-00003" summary="去掉多余的注释">
<created>1647398543163</created>
<option name="number" value="00003" />
<option name="presentableId" value="LOCAL-00003" />
<option name="project" value="LOCAL" />
<updated>1647398543163</updated>
</task>
<task id="LOCAL-00004" summary="修改一些bug">
<created>1647398867425</created>
<option name="number" value="00004" />
<option name="presentableId" value="LOCAL-00004" />
<option name="project" value="LOCAL" />
<updated>1647398867425</updated>
</task>
<task id="LOCAL-00005" summary="修改一些bug">
<created>1647402155287</created>
<option name="number" value="00005" />
<option name="presentableId" value="LOCAL-00005" />
<option name="project" value="LOCAL" />
<updated>1647402155287</updated>
</task>
<task active="true" id="Default" summary="Default task">
<changelist id="a358e186-f57e-4b90-864b-956058800d13" name="Default Changelist" comment="" />
<created>1647410174256</created>
<changelist id="be7958c3-0d1c-4f74-a433-b590462e7034" name="Default Changelist" comment="" />
<created>1648187853980</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1647410174256</updated>
<workItem from="1647410180516" duration="1549000" />
<workItem from="1647508149523" duration="301000" />
<workItem from="1647589649838" duration="6166000" />
<workItem from="1647826362138" duration="2438000" />
<workItem from="1647916742248" duration="1791000" />
<workItem from="1647937670953" duration="1272000" />
<workItem from="1647999056170" duration="961000" />
<workItem from="1648000462160" duration="241000" />
<workItem from="1648001048491" duration="9707000" />
<workItem from="1648117033147" duration="944000" />
<workItem from="1648118132004" duration="5081000" />
<workItem from="1648171525031" duration="2885000" />
<updated>1648187853980</updated>
<workItem from="1648187855487" duration="2594000" />
</task>
<task id="LOCAL-00006" summary="修改一些bug">
<created>1647597737855</created>
<option name="number" value="00006" />
<option name="presentableId" value="LOCAL-00006" />
<option name="project" value="LOCAL" />
<updated>1647597737855</updated>
</task>
<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>
<task id="LOCAL-00008" summary="增加单元格的 设置颜色">
<created>1648122800994</created>
<option name="number" value="00008" />
<option name="presentableId" value="LOCAL-00008" />
<option name="project" value="LOCAL" />
<updated>1648122800994</updated>
</task>
<option name="localTasksCounter" value="9" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="3" />
</component>
<component name="VcsManagerConfiguration">
<MESSAGE value="测试" />
<MESSAGE value="去掉多余的注释" />
<MESSAGE value="修改一些bug" />
<MESSAGE value="增加单元格的 设置颜色" />
<option name="LAST_COMMIT_MESSAGE" value="增加单元格的 设置颜色" />
</component>
</project>

View File

@@ -4,11 +4,12 @@
<view style="height: 300px">
<zb-table
:pullUpLoading="pullUpLoading"
:highlight="true"
:isShowLoadMore="true"
:highlight="true"
:show-header="true"
:columns="column"
:fit="false"
row-key="id"
@rowClick="rowClick"
@toggleRowSelection="toggleRowSelection"
@toggleAllSelection="toggleAllSelection"
@@ -339,9 +340,13 @@ img:"https://img.pddpic.com/mms-material-img/2020-11-27/84c7fad3-d945-4e71-ab09-
},
mounted(){
this.data1 = JSON.parse(JSON.stringify(this.data))
// setTimeout(()=>{
// this.data1.shift()
// },3000)
let data2 = JSON.parse(JSON.stringify(this.data))
setTimeout(()=>{
// data2.forEach(item=>{
// item.checked = true
// })
// this.data = data2
},3000)
},
methods:{
cellStyle({row, column, rowIndex, columnIndex}){
@@ -363,7 +368,7 @@ img:"https://img.pddpic.com/mms-material-img/2020-11-27/84c7fad3-d945-4e71-ab09-
province: '上海',
sex:1,
price: 33,
id:"11111",
id:11111+this.num,
age:'30',
city: '普陀区',
address: '上海市普',

View File

@@ -407,7 +407,7 @@ export default {
type:Boolean,
default:false
},
rowKey:Function,
rowKey:[String, Function],
summaryMethod:Function,
pullUpLoading:Function,
cellStyle:Function
@@ -491,20 +491,43 @@ export default {
let flag = this.columns.some(item=>item.type==='selection')
this.data.forEach((item,index)=>{
if(flag){
if(item.checked==null){item.checked = false}
if(item.checked==null){
item.checked = false
}
if(item.checked){
if(!this.selectArr.length){
this.selectArr.push(item)
}
}
}
if(this.rowKey){
item.key = Object.freeze(this.rowKey(item))||Date.now()
if(typeof this.rowKey==='function'){
item.key = Object.freeze(this.rowKey(item))||Date.now()
}else {
item.key = Object.freeze(item[this.rowKey])||Date.now()
}
}else {
item.key = index
}
})
if(flag&&this.data.length){
let le = this.data.filter(item=>item.checked).length
if(le){
if(le===this.data.length){
this.checkedAll = true
}else {
this.indeterminate = true
}
}
}
return this.data
},
isHighlight(){
return (item,index)=>{
if(this.rowKey){
return item[this.rowKey] === this.currentRow[this.rowKey]
return item.key === this.currentRow['key']
}else{
return index === this.currentRowIndex
}
@@ -582,15 +605,16 @@ export default {
pullLoad(){
if(this.isShowLoadMore){
this.isLoadMore = true
this.$emit('pullUpLoading')
let that = this
this.pullUpLoading&&this.pullUpLoading.call(this.$parent.$parent, (type)=>{
that.isLoadMore = false
if(type==='ok'){
that.completeLoading=true
}
})
}
this.$emit('pullUpLoading')
let that = this
this.pullUpLoading&&this.pullUpLoading.call(this.$parent.$parent, (type)=>{
that.isLoadMore = false
if(type==='ok'){
that.completeLoading=true
}
})
},
scrolltolower(e){
@@ -651,7 +675,6 @@ export default {
}
})
// #endif
item.checked = e.checked
e.data.checked = e.checked
if(e.checked){
@@ -659,7 +682,8 @@ export default {
}else{
this.selectArr = this.selectArr.filter(item=>item.key!==e.data.key)
}
if(this.selectArr.length===this.data.length){
console.log('this.selectArr',this.selectArr,this.transData)
if(this.selectArr.length===this.transData.length){
this.indeterminate = false
this.checkedAll = true
}else{

View File

@@ -12,6 +12,7 @@ table 表格 固定表头、固定首列、多列 上拉加载更多、 排序
| ------ | ------ | ------ | ------ | ------ |------ |
| data | 显示的数据 | array |-- | -- |必须 |
| column | 显示的列数据 | array |-- | -- |必须 |
| row-key | 行数据的 Key用来优化 Table 的渲染;建议添加 | (row)=>row.id 或者 String |-- | -- |否 |
| stripe | 是否为斑马纹 table| boolean | - |false | 否 |
| fit | 列的宽度是否自撑开 | boolean |true,false | false |否 |
| show-header | 是否显示表头 | boolean |true,false | true |否 |

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

View File

@@ -1,3 +1,4 @@
{
"disableRemoteDebugSourcePanel": false
"disableRemoteDebugSourcePanel": false,
"enableLegacyRemoteDebug": false
}

View File

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

View File

@@ -105,11 +105,11 @@
/******/
/******/
/******/ // mini-css-extract-plugin CSS loading
/******/ var cssChunks = {"uni_modules/uni-card/components/uni-card/uni-card":1,"uni_modules/zb-table/components/zb-table/zb-table":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};
/******/ var cssChunks = {"uni_modules/uni-card/components/uni-card/uni-card":1,"uni_modules/zb-table/components/zb-table/zb-table":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/uni-card/components/uni-card/uni-card":"uni_modules/uni-card/components/uni-card/uni-card","uni_modules/zb-table/components/zb-table/zb-table":"uni_modules/zb-table/components/zb-table/zb-table","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"}[chunkId]||chunkId) + ".wxss";
/******/ var href = "" + ({"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/zb-table":"uni_modules/zb-table/components/zb-table/zb-table","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 fullhref = __webpack_require__.p + href;
/******/ var existingLinkTags = document.getElementsByTagName("link");
/******/ for(var i = 0; i < existingLinkTags.length; i++) {

View File

@@ -2100,6 +2100,7 @@ uni$1;exports.default = _default;
"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: '女' } },
@@ -8742,47 +8743,45 @@ Object.defineProperty(exports, "__esModule", { value: true });exports.default =
},
watch: {
'showSummary': {
'data': {
deep: true,
immediate: true,
handler: function handler(newValue) {var _this = this;
console.log('========', newValue);
if (newValue) {
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] = '';
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);
}
});
}
this.sums = sums;
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;
/***/ }),

View File

@@ -309,6 +309,7 @@ __webpack_require__.r(__webpack_exports__);
var _all = __webpack_require__(/*! ./all.js */ 16); //
@@ -461,9 +462,9 @@ 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',
}, { 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",
@@ -501,14 +502,18 @@ var that = null;var _default = { components: {}, data: function data() {return {
},
mounted: function mounted() {
this.data1 = JSON.parse(JSON.stringify(this.data));
// setTimeout(()=>{
// this.data1.shift()
// },3000)
var data2 = JSON.parse(JSON.stringify(this.data));
setTimeout(function () {
// data2.forEach(item=>{
// item.checked = true
// })
// this.data = data2
}, 3000);
},
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) {
if (columnIndex === 1 || columnIndex === 4) {
return {
color: 'red' };
@@ -525,7 +530,7 @@ var that = null;var _default = { components: {}, data: function data() {return {
province: '上海',
sex: 1,
price: 33,
id: "11111",
id: 11111 + _this.num,
age: '30',
city: '普陀区',
address: '上海市普',

File diff suppressed because one or more lines are too long

View File

@@ -1,4 +0,0 @@
{
"usingComponents": {},
"component": true
}

View File

@@ -535,6 +535,7 @@ __webpack_require__.r(__webpack_exports__);
{
@@ -590,7 +591,7 @@ __webpack_require__.r(__webpack_exports__);
type: Boolean,
default: false },
rowKey: Function,
rowKey: [String, Function],
summaryMethod: Function,
pullUpLoading: Function,
cellStyle: Function },
@@ -674,20 +675,43 @@ __webpack_require__.r(__webpack_exports__);
var flag = this.columns.some(function (item) {return item.type === 'selection';});
this.data.forEach(function (item, index) {
if (flag) {
if (item.checked == null) {item.checked = false;}
if (item.checked == null) {
item.checked = false;
}
if (item.checked) {
if (!_this2.selectArr.length) {
_this2.selectArr.push(item);
}
}
}
if (_this2.rowKey) {
item.key = Object.freeze(_this2.rowKey(item)) || Date.now();
if (typeof _this2.rowKey === 'function') {
item.key = Object.freeze(_this2.rowKey(item)) || Date.now();
} else {
item.key = Object.freeze(item[_this2.rowKey]) || Date.now();
}
} else {
item.key = index;
}
});
if (flag && this.data.length) {
var le = this.data.filter(function (item) {return item.checked;}).length;
if (le) {
if (le === this.data.length) {
this.checkedAll = true;
} else {
this.indeterminate = true;
}
}
}
return this.data;
},
isHighlight: function isHighlight() {var _this3 = this;
return function (item, index) {
if (_this3.rowKey) {
return item[_this3.rowKey] === _this3.currentRow[_this3.rowKey];
return item.key === _this3.currentRow['key'];
} else {
return index === _this3.currentRowIndex;
}
@@ -765,15 +789,16 @@ __webpack_require__.r(__webpack_exports__);
pullLoad: function pullLoad() {
if (this.isShowLoadMore) {
this.isLoadMore = true;
this.$emit('pullUpLoading');
var that = this;
this.pullUpLoading && this.pullUpLoading.call(this.$parent.$parent, function (type) {
that.isLoadMore = false;
if (type === 'ok') {
that.completeLoading = true;
}
});
}
this.$emit('pullUpLoading');
var that = this;
this.pullUpLoading && this.pullUpLoading.call(this.$parent.$parent, function (type) {
that.isLoadMore = false;
if (type === 'ok') {
that.completeLoading = true;
}
});
},
scrolltolower: function scrolltolower(e) {
@@ -799,9 +824,8 @@ __webpack_require__.r(__webpack_exports__);
this.currentRowIndex = index;
this.currentRow = row;
this.$emit('currentChange', row, index);
} else {
this.$emit('rowClick', row, index);
}
this.$emit('rowClick', row, index);
},
checkboxSelectedAll: function checkboxSelectedAll(e) {var _this6 = this;
this.indeterminate = false;
@@ -835,7 +859,6 @@ __webpack_require__.r(__webpack_exports__);
}
});
item.checked = e.checked;
e.data.checked = e.checked;
if (e.checked) {
@@ -843,7 +866,8 @@ __webpack_require__.r(__webpack_exports__);
} else {
this.selectArr = this.selectArr.filter(function (item) {return item.key !== e.data.key;});
}
if (this.selectArr.length === this.data.length) {
console.log('this.selectArr', this.selectArr, this.transData);
if (this.selectArr.length === this.transData.length) {
this.indeterminate = false;
this.checkedAll = true;
} else {

View File

@@ -4,6 +4,7 @@
"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"
"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"
}
}

View File

@@ -141,11 +141,13 @@
height: 100%;
overflow: hidden;
width: 100%;
display: flex;
flex-direction: column;
font-size: 12px;
}
.zb-table .zb-table-content.data-v-35b7ff72 {
height: 100%;
position: relative;
overflow: hidden;
}
.zb-table .zb-table-fixed.data-v-35b7ff72 {
min-width: 100%;
@@ -221,12 +223,14 @@
}
.zb-table-applet.data-v-35b7ff72 {
height: 100%;
overflow: hidden;
width: 100%;
display: flex;
flex-direction: column;
font-size: 12px;
}
.zb-table-applet .zb-table-content.data-v-35b7ff72 {
height: 100%;
flex: 1;
overflow: hidden;
position: relative;
}
.zb-table-applet .zb-table-fixed.data-v-35b7ff72 {
@@ -328,4 +332,10 @@
background: white;
width: 100%;
}
.zb-table-applet .current-row .item-td.data-v-35b7ff72 {
background-color: #ecf5ff;
}
.current-row .item-td.data-v-35b7ff72 {
background-color: #ecf5ff;
}