15
15
<v-file-input label =" 上传变量地址表文件" v-model =" file" ></v-file-input >
16
16
</v-col >
17
17
<v-col cols =" 8" >
18
- <v-text-field clearable placeholder =" 搜索变量" prepend-icon =" mdi-magnify" v-model =" keyword" ></v-text-field >
18
+ <v-text-field
19
+ clearable
20
+ placeholder =" 搜索变量"
21
+ prepend-icon =" mdi-magnify"
22
+ v-model =" keyword"
23
+ ></v-text-field >
19
24
</v-col >
20
25
</v-row >
21
26
32
37
</thead >
33
38
<tbody >
34
39
<tr v-for =" list in searchData" :key =" list.Name" >
35
- <td >{{list.Name}}</td >
36
- <td >{{list.Type}}</td >
37
- <td >{{list.Addr}}</td >
40
+ <td >{{ list.Name }}</td >
41
+ <td >{{ list.Type }}</td >
42
+ <td >{{ list.Addr }}</td >
38
43
<td >
39
44
<v-btn icon v-on:click =" variableReadAdd(list)" >
40
45
<v-icon >mdi-plus</v-icon >
@@ -62,17 +67,17 @@ export default {
62
67
file: null ,
63
68
lists: [],
64
69
searchData: [],
65
- keyword: " "
70
+ keyword: " " ,
66
71
}),
67
72
watch: {
68
73
file : function () {
69
74
let file = this .file ;
70
75
let param = new FormData ();
71
76
param .append (" file" , file);
72
77
let config = {
73
- headers: { " Content-Type" : " multipart/form-data" }
78
+ headers: { " Content-Type" : " multipart/form-data" },
74
79
};
75
- axios .post (" /file/upload" , param, config).then (response => {
80
+ axios .post (" /file/upload" , param, config).then (( response ) => {
76
81
if (response .data .status == 0 ) {
77
82
this .getVariableList ();
78
83
this .$toasted .show (" 文件上传成功" );
@@ -102,7 +107,7 @@ export default {
102
107
} else {
103
108
return this .searchData ;
104
109
}
105
- }
110
+ },
106
111
},
107
112
mounted () {
108
113
this .getVariableList ();
@@ -116,7 +121,7 @@ export default {
116
121
this .dialog = false ;
117
122
},
118
123
getVariableList () {
119
- axios .get (" /file/variables" ).then (response => {
124
+ axios .get (" /file/variables" ).then (( response ) => {
120
125
this .lists = response .data .Variables ;
121
126
this .searchData = response .data .Variables ;
122
127
});
@@ -127,9 +132,9 @@ export default {
127
132
Board: 1 ,
128
133
Name: i .Name ,
129
134
Type: i .Type ,
130
- Addr: parseInt (i .Addr , 16 )
135
+ Addr: parseInt (i .Addr , 16 ),
131
136
})
132
- .then (response => {
137
+ .then (( response ) => {
133
138
if (response .data .status == 0 ) {
134
139
this .$toasted .show (" 变量添加成功" );
135
140
} else if (response .data .status == 22 ) {
@@ -145,9 +150,9 @@ export default {
145
150
Board: 1 ,
146
151
Name: i .Name ,
147
152
Type: i .Type ,
148
- Addr: parseInt (i .Addr , 16 )
153
+ Addr: parseInt (i .Addr , 16 ),
149
154
})
150
- .then (response => {
155
+ .then (( response ) => {
151
156
if (response .data .status == 0 ) {
152
157
this .$toasted .show (" 变量添加成功" );
153
158
} else if (response .data .status == 22 ) {
@@ -156,7 +161,7 @@ export default {
156
161
this .$toasted .error (" 重复添加变量" );
157
162
}
158
163
});
159
- }
160
- }
164
+ },
165
+ },
161
166
};
162
167
</script >
0 commit comments