This repository was archived by the owner on Dec 5, 2023. It is now read-only.
Commit 32627d8 1 parent 51c803c commit 32627d8 Copy full SHA for 32627d8
File tree 1 file changed +18
-7
lines changed
1 file changed +18
-7
lines changed Original file line number Diff line number Diff line change 1
1
<template >
2
2
<el-container >
3
3
<el-header >
4
- <el-select v-model =" uid" @change =" chaneUid()" placeholder =" 请选择来源" >
4
+ <el-select
5
+ v-model =" uid"
6
+ @change =" chaneUid()"
7
+ placeholder =" 请选择来源"
8
+ clearable
9
+ >
5
10
<el-option
6
11
:key =" producer.uid"
7
12
v-for =" producer in producers"
@@ -96,9 +101,11 @@ export default {
96
101
},
97
102
methods: {
98
103
async fetchData (limit , offset ) {
99
- let res = await axios .get (
100
- " /list?limit=" + limit + " &offset=" + offset + " &uid=" + this .uid
101
- );
104
+ let url = " /list?limit=" + limit + " &offset=" + offset;
105
+ if (this .uid ) {
106
+ url = url + " &uid=" + this .uid ;
107
+ }
108
+ let res = await axios .get (url);
102
109
let pic_infos = res .data .map ((item ) => {
103
110
let pic_info = item .pic_info ;
104
111
return {
@@ -120,13 +127,17 @@ export default {
120
127
type: " error" ,
121
128
});
122
129
}
123
- this .uid = this . producers [ 0 ]. uid ;
124
- let res = await axios .get (" /list_count?uid= " + this . uid );
130
+ this .uid = " " ;
131
+ let res = await axios .get (" /list_count" );
125
132
this .total = res .data ;
126
133
this .fetchData (40 , 0 );
127
134
},
128
135
async chaneUid () {
129
- let res = await axios .get (" /list_count?uid=" + this .uid );
136
+ let url = " /list_count" ;
137
+ if (this .uid ) {
138
+ url = url + " ?uid=" + this .uid ;
139
+ }
140
+ let res = await axios .get (url);
130
141
this .total = res .data ;
131
142
this .pic_infos = [];
132
143
this .fetchData (40 , 0 );
You can’t perform that action at this time.
0 commit comments