service-list-info.vue
2.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<style>
</style>
<template>
<div>
<div class="pd-form fast-search-form" style="clear:both;">
<div class="group-row group-row-2">
<div class="form-group">
<label for="cn1" class="label">搜索</label>
<div class="control">
<input type="text" id="cn1" v-model="search.title">
</div>
</div>
<div class="group-row t-right">
<button class="fast-search-form-btn btn-d btn-d-lg btn-d-activate btn-d-circle" v-on:click="getData('search')">
查 询</button>
</div>
</div>
</div>
<table class="itable itable-thead-13px itable-bordertop itable-td-long-text">
<tbody>
<tr v-for="item in list">
<td style="text-align:left;width:86%;">
<a v-link="{path:'/serviceDetail/'+item.guid}"
class="service-link-1">
{{item.title}}</a>
</td>
<td>{{item.creatdate}}</td>
</tr>
</tbody>
</table>
<pagination
@page-change="getData"
:page-no.sync="search.page"
:total-pages.sync="search.totalPages"></pagination>
</div>
</template>
<script>
module.exports={
data:function(){
return {
search: {hptype:'',contenttype:'',
pageSize: 10,
page: 1,
totalPages: 0,title:''
},list:[],
searchs:{},ids:'',initsearch:{hptype:'',contenttype:'',
pageSize: 10,
page: 1,
totalPages: 0,title:''
}
}
},watch:{
'$route.params':function(res){
this.getData();
}
},methods:{
getData:function(casetxt){
if(this.$route.params.type==undefined){
return ;
}
var newids=this.$route.params.type+'_'+this.$route.params.id;
if(this.ids==newids){
var obj=Object.assign({},this.search)
var s=Object.assign({},this.searchs)
s[this.ids]=obj;
this.$set('searchs',s);
}else{
this.ids=newids;
if(this.searchs[this.ids]){
var obj=Object.assign({},this.searchs[this.ids]);
this.search=obj;
}else{
var obj=Object.assign({},this.initsearch)
var s=Object.assign({},this.searchs)
s[this.ids]=obj;
this.$set('searchs',s);
this.search=obj;
}
}
//this.ids=this.$route.params.type+'_'+this.$route.params.id;
if(casetxt){
if( casetxt=='search' &&
this.search.title.length==''){
return ;
}
this.search.page=1;
}
this.search.hptype=this.$route.params.type;
this.search.contenttype=this.$route.params.id;
Ajax.post('/platform/sys_helper_getList',
this.search).then(function(res){
var result=res.data;
if(result.data && result.data.list){
this.$set('list',result.data.list);
this.search.totalPages = result.data.totalPages || 0;
}
}.bind(this))
}
},ready:function(){
this.getData();
},route:{
activate:function(){
}
}
}
</script>