提交 34ad427f 编写于 作者: zhujiamin's avatar zhujiamin

历史记录插件新增无数据时文本 --fix1

上级 b524fe04
......@@ -35,7 +35,7 @@ export default class APPHistoryList extends Vue {
* @type {Array}
* @memberof APPHistoryList
*/
@Prop() public items!: Array<any>;
@Prop() public items?: Array<any>;
/**
* 传入数据itemNameDetail
......@@ -64,6 +64,11 @@ export default class APPHistoryList extends Vue {
*/
@Watch('items',{immediate: true, deep: true})
itemsChange(){
if (this.items!=undefined && this.items.length !== 0) {
this.text = '查看更多记录';
} else {
this.text = '暂无更多记录';
}
this.handler();
this.setHeight();
}
......@@ -89,14 +94,16 @@ export default class APPHistoryList extends Vue {
* @memberof APPHistoryList
*/
public handler(){
this.items.forEach((v:any)=>{
if(v.actions){
let info:any = this.getCodeList(this.codeListAAA.actions.tag,'STATIC',v.actions);
v.method = info.text;
v.info = info.text;
}
})
}
if (this.items != undefined) {
this.items.forEach((v:any)=>{
if(v.actions){
let info:any = this.getCodeList(this.codeListAAA.actions.tag,'STATIC',v.actions);
v.method = info.text;
v.info =info.text
}
})
}
}
/**
* 按钮文本
......@@ -167,13 +174,18 @@ export default class APPHistoryList extends Vue {
let ite:any = document.querySelectorAll('.oneitem');
this.startHeig = 0;
this.endHeig = 0;
for(let i = 0; i <= this.num; i++){
this.startHeig += ite[i].offsetHeight;
}
for(let i = 0; i < ite.length; i++){
this.endHeig += ite[i].offsetHeight + 20;
}
for(let i = 0; i <= this.num; i++){
if (ite[i] != undefined) {
this.startHeig += ite[i].offsetHeight;
}
}
for(let i = 0; i < ite.length; i++){
if (ite[i] != undefined) {
this.endHeig += ite[i].offsetHeight + 20;
}
}
ele.style.height = this.isShow?this.endHeig+'px': + this.startHeig+'px';
}
/**
......@@ -193,11 +205,14 @@ export default class APPHistoryList extends Vue {
* @memberof APPHistoryList
*/
public setHeight(){
let ele:any = document.querySelector('.onecontent');
let ite:any = this.$refs.oneitem;
if (ite !== undefined) {
for(let i:any = 0; i <= this.num; i++){
this.startHeig += ite[i].offsetHeight;
if (ite[i] !== undefined) {
this.startHeig += ite[i].offsetHeight;
}
}
}
if(ele && ele.style){
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册