1010 <div class =" control d-flex justify-start" style =" margin : 10px 0 " >
1111 <v-btn
1212 @click =" importFile"
13- :loading =" importLoading"
14- :disabled =" importLoading"
13+ :loading =" importLoading || loading "
14+ :disabled =" importLoading || loading "
1515 depressed
1616 small
1717 color =" primary"
4646 <div class =" text-subtitle-2" >
4747 脚本导入进度: {{ scriptNum }}/{{ selectedScript.length }}
4848 </div >
49- <div v-if =" loading" class =" text-subtitle-2" >
50- 脚本加载进度: {{ cur }}/{{ total }}
49+ <div
50+ v-if =" loading"
51+ class =" text-subtitle-2"
52+ style =" margin-left : 10px "
53+ >
54+ 加载进度: {{ cur }}/{{ total }}
55+ </div >
56+ </div >
57+ <div
58+ class =" control d-flex justify-start align-center"
59+ style =" margin : 10px 0 "
60+ >
61+ <div class =" subtitle-2" >请选择你要导入的订阅:</div >
62+ <v-checkbox
63+ v-model =" isSelectAllScript"
64+ label =" 全选"
65+ color =" secondary"
66+ @change =" selectAllSubscribe"
67+ style =" margin : 0 10px ; padding : 0 "
68+ hide-details
69+ ></v-checkbox >
70+ <div class =" text-subtitle-2" >
71+ 订阅导入进度: {{ subscribeNum }}/{{ selectedSubscribe.length }}
5172 </div >
5273 </div >
5374 <v-list two-line >
6283 <v-list-item-title
6384 v-html ="
6485 item.name +
65- (item.background
66- ? '<img src=\'/assets/logo.png\' width=\'16px\'/>'
67- : '')
86+ (item.background
87+ ? '<img src=\'/assets/logo.png\' width=\'16px\'/>'
88+ : '')
6889 "
6990 >
7091 </v-list-item-title >
116137 class =" script-list"
117138 style =" border-top : 1px dashed "
118139 >
119- <div
120- class =" control d-flex justify-start align-center"
121- style =" margin : 10px 0 "
122- >
123- <div class =" subtitle-2" >请选择你要导入的订阅:</div >
124- <v-checkbox
125- v-model =" isSelectAllScript"
126- label =" 全选"
127- color =" secondary"
128- @change =" selectAllSubscribe"
129- style =" margin : 0 10px ; padding : 0 "
130- hide-details
131- ></v-checkbox >
132- <div class =" text-subtitle-2" >
133- 订阅导入进度: {{ subscribeNum }}/{{ selectedSubscribe.length }}
134- </div >
135- </div >
136140 <v-list two-line >
137141 <v-list-item-group
138142 v-model =" selectedScript"
@@ -297,11 +301,11 @@ export default class Index extends Vue {
297301 };
298302 let [newScript, oldScript] = await this .scriptCtrl .prepareScriptByCode (
299303 importScript .source ,
300- script .download_url
304+ script .download_url ,
301305 );
302306 if (typeof oldScript === ' string' || ! newScript ) {
303307 script .error = <string >oldScript || ' error' ;
304- this .scripts .push (script );
308+ this .selectedScript . push ( this . scripts .push (script ) - 1 );
305309 continue ;
306310 }
307311 if (oldScript ) {
@@ -314,7 +318,7 @@ export default class Index extends Vue {
314318 script .hasOld = oldScript ? true : false ;
315319 script .script = newScript ;
316320 script .background = newScript ?.type !== 1 ;
317- this .scripts .push (script );
321+ this .selectedScript . push ( this . scripts .push (script ) - 1 );
318322 }
319323 let importSubscribe;
320324 while ((importSubscribe = backup .ReadSubscribe ())) {
@@ -330,7 +334,7 @@ export default class Index extends Vue {
330334 );
331335 if (typeof oldSub === ' string' || ! newSub ) {
332336 subscribe .error = <string >oldSub || ' error' ;
333- this .subscribes .push (subscribe );
337+ this .selectedSubscribe . push ( this . subscribes .push (subscribe ) - 1 );
334338 continue ;
335339 }
336340 if (oldSub ) {
@@ -339,7 +343,7 @@ export default class Index extends Vue {
339343 newSub .scripts = importSubscribe .scripts ;
340344 subscribe .subscribe = newSub ;
341345 subscribe .hasOld = oldSub ? true : false ;
342- this .subscribes .push (subscribe );
346+ this .selectedSubscribe . push ( this . subscribes .push (subscribe ) - 1 );
343347 }
344348 this .selectAll ();
345349 this .selectAllSubscribe ();
@@ -411,6 +415,7 @@ export default class Index extends Vue {
411415 let handle = async () => {
412416 let script = scriptInfo .script ;
413417 if (! script ) {
418+ console .log (' error' ,scriptInfo );
414419 return ;
415420 }
416421 script .status = scriptInfo .enabled
@@ -451,6 +456,9 @@ export default class Index extends Vue {
451456 };
452457 void importValue ();
453458 }
459+ } else {
460+ this .scriptNum += 1 ;
461+ wait .done ();
454462 }
455463 };
456464 try {
0 commit comments