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

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

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