11Vue . component ( "script-config-box" , {
2- props : [ "id" , "v-script-config" , "comment" ] ,
2+ props : [ "id" , "v-script-config" , "comment" , "v-auditing-status" ] ,
3+ mounted : function ( ) {
4+ let that = this
5+ setTimeout ( function ( ) {
6+ that . $forceUpdate ( )
7+ } , 100 )
8+ } ,
39 data : function ( ) {
410 let config = this . vScriptConfig
511 if ( config == null ) {
612 config = {
713 isPrior : false ,
814 isOn : false ,
9- code : ""
15+ code : "" ,
16+ auditingCode : ""
17+ }
18+ }
19+
20+ let auditingStatus = null
21+ if ( config . auditingCodeMD5 != null && config . auditingCodeMD5 . length > 0 && config . auditingCode != null && config . auditingCode . length > 0 ) {
22+ config . code = config . auditingCode
23+
24+ if ( this . vAuditingStatus != null ) {
25+ for ( let i = 0 ; i < this . vAuditingStatus . length ; i ++ ) {
26+ let status = this . vAuditingStatus [ i ]
27+ if ( status . md5 == config . auditingCodeMD5 ) {
28+ auditingStatus = status
29+ break
30+ }
31+ }
1032 }
1133 }
1234
@@ -15,7 +37,8 @@ Vue.component("script-config-box", {
1537 }
1638
1739 return {
18- config : config
40+ config : config ,
41+ auditingStatus : auditingStatus
1942 }
2043 } ,
2144 watch : {
@@ -30,6 +53,12 @@ Vue.component("script-config-box", {
3053 changeCode : function ( code ) {
3154 this . config . code = code
3255 this . change ( )
56+ } ,
57+ isPlus : function ( ) {
58+ if ( Tea == null || Tea . Vue == null ) {
59+ return false
60+ }
61+ return Tea . Vue . teaIsPlus
3362 }
3463 } ,
3564 template : `<div>
@@ -43,7 +72,14 @@ Vue.component("script-config-box", {
4372 <tbody>
4473 <tr :style="{opacity: !config.isOn ? 0.5 : 1}">
4574 <td>脚本代码</td>
46- <td><source-code-box :id="id" type="text/javascript" :read-only="false" @change="changeCode">{{config.code}}</source-code-box>
75+ <td>
76+ <p class="comment" v-if="auditingStatus != null">
77+ <span class="green" v-if="auditingStatus.isPassed">管理员审核结果:审核通过。</span>
78+ <span class="red" v-else-if="auditingStatus.isRejected">管理员审核结果:驳回 驳回理由:{{auditingStatus.rejectedReason}}</span>
79+ <span class="red" v-else>当前脚本将在审核后生效,请耐心等待审核结果。 <a href="/servers/user-scripts" target="_blank" v-if="isPlus()">去审核 »</a></span>
80+ </p>
81+ <p class="comment" v-if="auditingStatus == null"><span class="green">管理员审核结果:审核通过。</span></p>
82+ <source-code-box :id="id" type="text/javascript" :read-only="false" @change="changeCode">{{config.code}}</source-code-box>
4783 <p class="comment">{{comment}}</p>
4884 </td>
4985 </tr>
0 commit comments