Files
DinQuant/frontend/dist/js/55-legacy.50f03e02.js
T
TIANHE a6ea4d967c v2.2.2
Signed-off-by: TIANHE <TIANHE@GMAIL.COM>
2026-03-01 03:42:10 +08:00

1 line
35 KiB
JavaScript

"use strict";(self["webpackChunkvue_antd_pro"]=self["webpackChunkvue_antd_pro"]||[]).push([[55],{30055:function(t,e,a){a.r(e),a.d(e,{default:function(){return M}});a(52675),a(89463),a(28706),a(62010);var i=function(){var t=this,e=t._self._c;return e("div",{staticClass:"indicator-community-container",class:{"theme-dark":t.isDarkTheme}},[t.isAdmin?e("a-tabs",{staticClass:"admin-tabs",on:{change:t.handleTabChange},model:{value:t.activeTab,callback:function(e){t.activeTab=e},expression:"activeTab"}},[e("a-tab-pane",{key:"market",attrs:{tab:t.$t("community.title")}}),e("a-tab-pane",{key:"review"},[e("template",{slot:"tab"},[e("a-badge",{attrs:{count:t.reviewStats.pending,offset:[10,0]}},[t._v(" "+t._s(t.$t("community.admin.reviewTab"))+" ")])],1)],2)],1):t._e(),e("div",{directives:[{name:"show",rawName:"v-show",value:"market"===t.activeTab,expression:"activeTab === 'market'"}],staticClass:"market-header"},[e("div",{staticClass:"header-left"},[e("h2",{staticClass:"page-title"},[e("a-icon",{attrs:{type:"shop"}}),t._v(" "+t._s(t.$t("community.title"))+" ")],1)]),e("div",{staticClass:"header-right"},[e("a-input-search",{staticStyle:{width:"240px"},attrs:{placeholder:t.$t("community.searchPlaceholder"),"allow-clear":""},on:{search:t.handleSearch,pressEnter:t.handleSearch},model:{value:t.filters.keyword,callback:function(e){t.$set(t.filters,"keyword",e)},expression:"filters.keyword"}}),e("a-radio-group",{attrs:{"button-style":"solid"},on:{change:t.handleFilterChange},model:{value:t.filters.pricingType,callback:function(e){t.$set(t.filters,"pricingType",e)},expression:"filters.pricingType"}},[e("a-radio-button",{attrs:{value:""}},[t._v(t._s(t.$t("community.all")))]),e("a-radio-button",{attrs:{value:"free"}},[t._v(t._s(t.$t("community.freeOnly")))]),e("a-radio-button",{attrs:{value:"paid"}},[t._v(t._s(t.$t("community.paidOnly")))])],1),e("a-select",{staticStyle:{width:"140px"},on:{change:t.handleFilterChange},model:{value:t.filters.sortBy,callback:function(e){t.$set(t.filters,"sortBy",e)},expression:"filters.sortBy"}},[e("a-select-option",{attrs:{value:"newest"}},[t._v(t._s(t.$t("community.sortNewest")))]),e("a-select-option",{attrs:{value:"hot"}},[t._v(t._s(t.$t("community.sortHot")))]),e("a-select-option",{attrs:{value:"rating"}},[t._v(t._s(t.$t("community.sortRating")))]),e("a-select-option",{attrs:{value:"price_asc"}},[t._v(t._s(t.$t("community.sortPriceLow")))]),e("a-select-option",{attrs:{value:"price_desc"}},[t._v(t._s(t.$t("community.sortPriceHigh")))])],1),e("a-button",{attrs:{type:"link"},on:{click:function(e){t.showMyPurchases=!0}}},[e("a-icon",{attrs:{type:"shopping"}}),t._v(" "+t._s(t.$t("community.myPurchases"))+" ")],1)],1)]),"market"===t.activeTab?[e("a-spin",{attrs:{spinning:t.loading}},[0!==t.indicators.length||t.loading?e("div",{staticClass:"indicator-grid"},t._l(t.indicators,function(a){return e("indicator-card",{key:a.id,attrs:{indicator:a},on:{click:function(e){return t.openDetail(a)}}})}),1):e("div",{staticClass:"empty-state"},[e("a-empty",{attrs:{description:t.$t("community.noIndicators")}},[e("a-button",{attrs:{type:"primary"},on:{click:t.goToCreate}},[t._v(" "+t._s(t.$t("community.createFirst"))+" ")])],1)],1)]),t.pagination.total>0?e("div",{staticClass:"pagination-wrapper"},[e("a-pagination",{attrs:{total:t.pagination.total,"page-size":t.pagination.pageSize,"show-total":function(e){return"".concat(t.$t("community.total")," ").concat(e," ").concat(t.$t("community.items"))},"show-quick-jumper":""},on:{change:t.handlePageChange},model:{value:t.pagination.current,callback:function(e){t.$set(t.pagination,"current",e)},expression:"pagination.current"}})],1):t._e()]:t._e(),"review"===t.activeTab&&t.isAdmin?[e("div",{staticClass:"review-panel"},[e("div",{staticClass:"review-header"},[e("a-radio-group",{attrs:{"button-style":"solid"},on:{change:t.loadPendingIndicators},model:{value:t.reviewFilter,callback:function(e){t.reviewFilter=e},expression:"reviewFilter"}},[e("a-radio-button",{attrs:{value:"pending"}},[e("a-badge",{attrs:{count:t.reviewStats.pending,offset:[8,-2],"number-style":{backgroundColor:"#faad14"}}},[t._v(" "+t._s(t.$t("community.admin.pending"))+" ")])],1),e("a-radio-button",{attrs:{value:"approved"}},[t._v(" "+t._s(t.$t("community.admin.approved"))+" ("+t._s(t.reviewStats.approved)+") ")]),e("a-radio-button",{attrs:{value:"rejected"}},[t._v(" "+t._s(t.$t("community.admin.rejected"))+" ("+t._s(t.reviewStats.rejected)+") ")])],1)],1),e("a-spin",{attrs:{spinning:t.reviewLoading}},[0!==t.pendingIndicators.length||t.reviewLoading?e("div",{staticClass:"review-list"},t._l(t.pendingIndicators,function(a){return e("div",{key:a.id,staticClass:"review-item"},[e("div",{staticClass:"review-item-header"},[e("div",{staticClass:"item-info"},[e("span",{staticClass:"item-name"},[t._v(t._s(a.name))]),"free"===a.pricing_type?e("a-tag",{attrs:{color:"green"}},[t._v(t._s(t.$t("community.free")))]):e("a-tag",{attrs:{color:"orange"}},[t._v(t._s(a.price)+" "+t._s(t.$t("community.credits")))]),e("a-tag",{attrs:{color:t.getStatusColor(a.review_status)}},[t._v(t._s(t.getStatusText(a.review_status)))])],1),e("div",{staticClass:"item-author"},[e("a-avatar",{attrs:{src:a.author.avatar,size:"small"}}),e("span",[t._v(t._s(a.author.nickname||a.author.username))]),e("span",{staticClass:"item-time"},[t._v(t._s(t.formatDate(a.created_at)))])],1)]),e("div",{staticClass:"review-item-body"},[e("div",{staticClass:"item-desc"},[t._v(t._s(a.description||t.$t("community.admin.noDescription")))]),a.code?e("div",{staticClass:"item-code"},[e("a-button",{attrs:{type:"link",size:"small"},on:{click:function(e){return t.toggleCode(a.id)}}},[e("a-icon",{attrs:{type:t.expandedCodes[a.id]?"up":"down"}}),t._v(" "+t._s(t.$t("community.admin.viewCode"))+" ")],1),t.expandedCodes[a.id]?e("pre",{staticClass:"code-preview"},[t._v(t._s(a.code))]):t._e()],1):t._e(),a.review_note?e("div",{staticClass:"review-note"},[e("a-icon",{attrs:{type:"info-circle"}}),t._v(" "+t._s(t.$t("community.admin.note"))+": "+t._s(a.review_note)+" ")],1):t._e()]),e("div",{staticClass:"review-item-actions"},["pending"===a.review_status?[e("a-button",{attrs:{type:"primary",size:"small"},on:{click:function(e){return t.handleReview(a,"approve")}}},[e("a-icon",{attrs:{type:"check"}}),t._v(" "+t._s(t.$t("community.admin.approve"))+" ")],1),e("a-button",{attrs:{type:"danger",size:"small"},on:{click:function(e){return t.handleReview(a,"reject")}}},[e("a-icon",{attrs:{type:"close"}}),t._v(" "+t._s(t.$t("community.admin.reject"))+" ")],1)]:"approved"===a.review_status?[e("a-button",{attrs:{size:"small"},on:{click:function(e){return t.handleUnpublish(a)}}},[e("a-icon",{attrs:{type:"stop"}}),t._v(" "+t._s(t.$t("community.admin.unpublish"))+" ")],1)]:t._e(),e("a-popconfirm",{attrs:{title:t.$t("community.admin.deleteConfirm")},on:{confirm:function(e){return t.handleDelete(a)}}},[e("a-button",{staticClass:"delete-btn",attrs:{type:"link",size:"small"}},[e("a-icon",{attrs:{type:"delete"}}),t._v(" "+t._s(t.$t("community.admin.delete"))+" ")],1)],1)],2)])}),0):e("div",{staticClass:"empty-state"},[e("a-empty",{attrs:{description:t.$t("community.admin.noItems")}})],1)]),t.reviewPagination.total>0?e("div",{staticClass:"pagination-wrapper"},[e("a-pagination",{attrs:{total:t.reviewPagination.total,"page-size":t.reviewPagination.pageSize,"show-total":function(e){return"".concat(t.$t("community.total")," ").concat(e," ").concat(t.$t("community.items"))}},on:{change:t.handleReviewPageChange},model:{value:t.reviewPagination.current,callback:function(e){t.$set(t.reviewPagination,"current",e)},expression:"reviewPagination.current"}})],1):t._e()],1)]:t._e(),e("a-modal",{attrs:{title:"approve"===t.reviewAction?t.$t("community.admin.approveTitle"):t.$t("community.admin.rejectTitle"),"ok-text":"approve"===t.reviewAction?t.$t("community.admin.approve"):t.$t("community.admin.reject"),"ok-button-props":{props:{type:"approve"===t.reviewAction?"primary":"danger"}}},on:{ok:t.submitReview},model:{value:t.showReviewModal,callback:function(e){t.showReviewModal=e},expression:"showReviewModal"}},[e("a-form",{attrs:{layout:"vertical"}},[e("a-form-item",{attrs:{label:t.$t("community.admin.noteLabel")}},[e("a-textarea",{attrs:{placeholder:t.$t("community.admin.notePlaceholder"),rows:3},model:{value:t.reviewNote,callback:function(e){t.reviewNote=e},expression:"reviewNote"}})],1)],1)],1),e("indicator-detail",{attrs:{visible:t.detailVisible,"indicator-id":t.selectedIndicatorId,"current-user-id":t.currentUserId},on:{close:function(e){t.detailVisible=!1},purchased:t.handlePurchased}}),e("a-modal",{attrs:{title:t.$t("community.myPurchases"),footer:null,width:"600px"},model:{value:t.showMyPurchases,callback:function(e){t.showMyPurchases=e},expression:"showMyPurchases"}},[e("a-spin",{attrs:{spinning:t.purchasesLoading}},[0===t.myPurchases.length?e("div",{staticClass:"empty-purchases"},[e("a-empty",{attrs:{description:t.$t("community.noPurchases")}})],1):e("a-list",{attrs:{"data-source":t.myPurchases,"item-layout":"horizontal"},scopedSlots:t._u([{key:"renderItem",fn:function(a){return e("a-list-item",{scopedSlots:t._u([{key:"actions",fn:function(){return[e("a-button",{attrs:{type:"link",size:"small"},on:{click:t.goToUse}},[t._v(" "+t._s(t.$t("community.useNow"))+" ")])]},proxy:!0}])},[e("a-list-item-meta",{scopedSlots:t._u([{key:"title",fn:function(){return[e("a",{on:{click:function(e){return t.openDetailById(a.indicator.id)}}},[t._v(t._s(a.indicator.name))])]},proxy:!0},{key:"description",fn:function(){return[e("div",[t._v(t._s(t.$t("community.purchasedFrom"))+": "+t._s(a.seller.nickname))]),e("div",[t._v(t._s(t.$t("community.purchaseTime"))+": "+t._s(t.formatDate(a.purchase_time)))])]},proxy:!0}],null,!0)})],1)}}])})],1)],1)],2)},n=[],s=a(81127),r=a(56252),o=a(76338),c=a(95353),d=function(){var t=this,e=t._self._c;return e("a-card",{staticClass:"indicator-card",attrs:{hoverable:"","body-style":{padding:"12px"}},on:{click:function(e){return t.$emit("click",t.indicator)}}},[e("div",{staticClass:"card-cover",style:t.coverStyle},[t.indicator.preview_image&&!t.imageError?e("img",{attrs:{src:t.indicator.preview_image,alt:t.indicator.name},on:{error:t.handleImageError}}):e("div",{staticClass:"default-cover",style:{background:t.coverGradient}},[e("span",{staticClass:"cover-title"},[t._v(t._s(t.indicatorInitials))]),e("span",{staticClass:"cover-subtitle"},[t._v(t._s(t.indicator.name))])]),e("div",{staticClass:"price-tag",class:t.isPaid?"paid":"free"},[t._v(" "+t._s(t.isPaid?"".concat(t.indicator.price," ").concat(t.$t("community.credits")):t.$t("community.free"))+" ")]),t.indicator.vip_free?e("div",{staticClass:"vip-free-tag"},[t._v(" "+t._s(t.$t("community.vipFree"))+" ")]):t._e(),t.indicator.is_own?e("div",{staticClass:"own-tag"},[t._v(" "+t._s(t.$t("community.myIndicator"))+" ")]):t.indicator.is_purchased?e("div",{staticClass:"purchased-tag"},[e("a-icon",{attrs:{type:"check-circle"}}),t._v(" "+t._s(t.$t("community.purchased"))+" ")],1):t._e()]),e("div",{staticClass:"card-content"},[e("h3",{staticClass:"card-title",attrs:{title:t.indicator.name}},[t._v(t._s(t.indicator.name))]),e("p",{staticClass:"card-desc"},[t._v(t._s(t.indicator.description||t.$t("community.noDescription")))]),e("div",{staticClass:"card-author"},[e("a-avatar",{attrs:{src:t.indicator.author.avatar,size:24}}),e("span",{staticClass:"author-name"},[t._v(t._s(t.indicator.author.nickname||t.indicator.author.username))])],1),e("div",{staticClass:"card-stats"},[e("span",{staticClass:"stat-item"},[e("a-icon",{attrs:{type:"download"}}),t._v(" "+t._s(t.indicator.purchase_count||0)+" ")],1),e("span",{staticClass:"stat-item"},[e("a-icon",{style:{color:"#faad14"},attrs:{type:"star",theme:"filled"}}),t._v(" "+t._s(t.formatRating(t.indicator.avg_rating))+" ")],1),e("span",{staticClass:"stat-item"},[e("a-icon",{attrs:{type:"eye"}}),t._v(" "+t._s(t.indicator.view_count||0)+" ")],1)])])])},m=[],l=(a(34782),a(9868),a(27495),a(90744),["linear-gradient(135deg, #667eea 0%, #764ba2 100%)","linear-gradient(135deg, #f093fb 0%, #f5576c 100%)","linear-gradient(135deg, #4facfe 0%, #00f2fe 100%)","linear-gradient(135deg, #43e97b 0%, #38f9d7 100%)","linear-gradient(135deg, #fa709a 0%, #fee140 100%)","linear-gradient(135deg, #a8edea 0%, #fed6e3 100%)","linear-gradient(135deg, #d299c2 0%, #fef9d7 100%)","linear-gradient(135deg, #89f7fe 0%, #66a6ff 100%)","linear-gradient(135deg, #fddb92 0%, #d1fdff 100%)","linear-gradient(135deg, #9890e3 0%, #b1f4cf 100%)","linear-gradient(135deg, #ebc0fd 0%, #d9ded8 100%)","linear-gradient(135deg, #f6d365 0%, #fda085 100%)"]),u={name:"IndicatorCard",props:{indicator:{type:Object,required:!0}},data:function(){return{imageError:!1}},computed:{isPaid:function(){return"free"!==this.indicator.pricing_type&&this.indicator.price>0},coverGradient:function(){var t=(this.indicator.id||0)%l.length;return l[t]},indicatorInitials:function(){var t=this.indicator.name||"I";if(/[\u4e00-\u9fa5]/.test(t))return t.slice(0,2);var e=t.split(/\s+/);return e.length>=2?(e[0][0]+e[1][0]).toUpperCase():t.slice(0,2).toUpperCase()},coverStyle:function(){return{background:!this.indicator.preview_image||this.imageError?this.coverGradient:"#f5f5f5"}}},methods:{formatRating:function(t){var e=parseFloat(t)||0;return e>0?e.toFixed(1):"-"},handleImageError:function(){this.imageError=!0}}},p=u,v=a(81656),h=(0,v.A)(p,d,m,!1,null,"b59176ee",null),g=h.exports,f=function(){var t=this,e=t._self._c;return e("a-modal",{staticClass:"indicator-detail-modal",attrs:{visible:t.visible,title:null,footer:null,width:720,"body-style":{padding:0}},on:{cancel:function(e){return t.$emit("close")}}},[e("a-spin",{attrs:{spinning:t.loading}},[t.detail?e("div",{staticClass:"detail-container"},[e("div",{staticClass:"detail-header",style:t.headerStyle},[t.detail.preview_image?e("div",{staticClass:"header-cover"},[e("img",{attrs:{src:t.detail.preview_image,alt:t.detail.name},on:{error:function(e){t.imageError=!0}}})]):e("div",{staticClass:"header-cover default-cover"},[e("span",{staticClass:"cover-initials"},[t._v(t._s(t.indicatorInitials))])]),e("div",{staticClass:"header-info"},[e("h2",{staticClass:"indicator-name"},[t._v(t._s(t.detail.name))]),e("div",{staticClass:"indicator-meta"},[e("div",{staticClass:"author-info"},[e("a-avatar",{attrs:{src:t.detail.author.avatar,size:32}}),e("span",{staticClass:"author-name"},[t._v(t._s(t.detail.author.nickname||t.detail.author.username))])],1),e("div",{staticClass:"publish-time"},[t._v(" "+t._s(t.$t("community.publishedAt"))+": "+t._s(t.formatDate(t.detail.created_at))+" ")])]),e("div",{staticClass:"indicator-stats"},[e("a-statistic",{attrs:{title:t.$t("community.downloads"),value:t.detail.purchase_count||0},scopedSlots:t._u([{key:"prefix",fn:function(){return[e("a-icon",{attrs:{type:"download"}})]},proxy:!0}],null,!1,3253357727)}),e("a-statistic",{attrs:{title:t.$t("community.rating")},scopedSlots:t._u([{key:"formatter",fn:function(){return[e("a-rate",{style:{fontSize:"14px"},attrs:{value:t.detail.avg_rating,disabled:"","allow-half":""}}),e("span",{staticClass:"rating-text"},[t._v("("+t._s(t.detail.rating_count||0)+")")])]},proxy:!0}],null,!1,1010155712)}),e("a-statistic",{attrs:{title:t.$t("community.views"),value:t.detail.view_count||0},scopedSlots:t._u([{key:"prefix",fn:function(){return[e("a-icon",{attrs:{type:"eye"}})]},proxy:!0}],null,!1,3492011442)})],1)])]),e("div",{staticClass:"detail-body"},[e("div",{staticClass:"section"},[e("h3",[t._v(t._s(t.$t("community.description")))]),e("p",{staticClass:"description"},[t._v(t._s(t.detail.description||t.$t("community.noDescription")))])]),t.performance?e("div",{staticClass:"section"},[e("h3",[t._v(t._s(t.$t("community.performance")))]),e("div",{staticClass:"performance-grid"},[e("div",{staticClass:"perf-item"},[e("div",{staticClass:"perf-label"},[t._v(t._s(t.$t("community.strategyCount")))]),e("div",{staticClass:"perf-value"},[t._v(t._s(t.performance.strategy_count))])]),e("div",{staticClass:"perf-item"},[e("div",{staticClass:"perf-label"},[t._v(t._s(t.$t("community.tradeCount")))]),e("div",{staticClass:"perf-value"},[t._v(t._s(t.performance.trade_count))])]),e("div",{staticClass:"perf-item"},[e("div",{staticClass:"perf-label"},[t._v(t._s(t.$t("community.winRate")))]),e("div",{staticClass:"perf-value",class:t.performance.win_rate>=50?"positive":"negative"},[t._v(" "+t._s(t.performance.win_rate)+"% ")])]),e("div",{staticClass:"perf-item"},[e("div",{staticClass:"perf-label"},[t._v(t._s(t.$t("community.totalProfit")))]),e("div",{staticClass:"perf-value",class:t.performance.total_profit>=0?"positive":"negative"},[t._v(" "+t._s(t.performance.total_profit>=0?"+":"")+t._s(t.performance.total_profit)+" ")])])])]):t._e(),e("div",{staticClass:"section"},[e("h3",[t._v(t._s(t.$t("community.reviews"))+" ("+t._s(t.comments.total||0)+")")]),e("comment-list",{attrs:{comments:t.comments.items,loading:t.commentsLoading,"can-comment":t.detail.is_purchased&&!t.detail.is_own&&!t.myComment,"current-user-id":t.currentUserId,"my-comment":t.myComment,total:t.comments.total},on:{"add-comment":t.handleAddComment,"update-comment":t.handleUpdateComment,"load-more":t.loadMoreComments}})],1)]),e("div",{staticClass:"detail-footer"},[e("div",{staticClass:"price-info"},[t.detail.vip_free?e("a-tag",{staticStyle:{"margin-right":"8px"},attrs:{color:"gold"}},[t._v(" "+t._s(t.$t("community.vipFree"))+" ")]):t._e(),"free"===t.detail.pricing_type||t.detail.price<=0?e("span",{staticClass:"free-badge"},[t._v(" "+t._s(t.$t("community.free"))+" ")]):e("span",{staticClass:"price-badge"},[t._v(" "+t._s(t.detail.price)+" "+t._s(t.$t("community.credits"))+" ")])],1),e("div",{staticClass:"action-buttons"},[t.detail.is_own?e("a-button",{attrs:{disabled:""}},[t._v(" "+t._s(t.$t("community.myIndicator"))+" ")]):t.detail.is_purchased?e("a-button",{attrs:{type:"primary"},on:{click:t.goToUse}},[e("a-icon",{attrs:{type:"code"}}),t._v(" "+t._s(t.$t("community.useNow"))+" ")],1):e("a-button",{attrs:{type:"primary",loading:t.purchasing},on:{click:t.handlePurchase}},[e("a-icon",{attrs:{type:"shopping-cart"}}),t._v(" "+t._s("free"===t.detail.pricing_type||t.detail.price<=0?t.$t("community.getFree"):t.$t("community.buyNow"))+" ")],1)],1)])]):t._e()])],1)},y=[],_=a(2403),w=(a(2892),function(){var t=this,e=t._self._c;return e("div",{staticClass:"comment-list"},[t.canComment||t.isEditing?e("div",{staticClass:"comment-form"},[t.isEditing?e("div",{staticClass:"form-header"},[e("span",{staticClass:"edit-label"},[t._v(t._s(t.$t("community.editComment")))]),e("a-button",{attrs:{type:"link",size:"small"},on:{click:t.cancelEdit}},[t._v(t._s(t.$t("community.cancelEdit")))])],1):t._e(),e("div",{staticClass:"rating-input"},[e("span",{staticClass:"label"},[t._v(t._s(t.$t("community.yourRating"))+":")]),e("a-rate",{model:{value:t.formData.rating,callback:function(e){t.$set(t.formData,"rating",e)},expression:"formData.rating"}})],1),e("a-textarea",{attrs:{placeholder:t.$t("community.commentPlaceholder"),rows:3,"max-length":500},model:{value:t.formData.content,callback:function(e){t.$set(t.formData,"content",e)},expression:"formData.content"}}),e("div",{staticClass:"form-actions"},[e("span",{staticClass:"char-count"},[t._v(t._s(t.formData.content.length)+"/500")]),e("a-button",{attrs:{type:"primary",size:"small",loading:t.submitting},on:{click:t.submitComment}},[t._v(" "+t._s(t.isEditing?t.$t("community.updateComment"):t.$t("community.submitComment"))+" ")])],1)],1):!t.myComment||t.canComment||t.isEditing?t._e():e("div",{staticClass:"my-comment-hint"},[e("a-icon",{attrs:{type:"check-circle",theme:"twoTone","two-tone-color":"#52c41a"}}),e("span",[t._v(t._s(t.$t("community.alreadyCommented")))]),e("a-button",{attrs:{type:"link",size:"small"},on:{click:function(e){return t.startEdit(t.myComment)}}},[t._v(" "+t._s(t.$t("community.editMyComment"))+" ")])],1),e("a-spin",{attrs:{spinning:t.loading}},[0===t.comments.length?e("div",{staticClass:"empty-comments"},[e("a-empty",{attrs:{description:t.$t("community.noComments")}})],1):e("div",{staticClass:"comments"},t._l(t.comments,function(a){return e("div",{key:a.id,staticClass:"comment-item",class:{"is-mine":a.user&&a.user.id===t.currentUserId}},[e("div",{staticClass:"comment-header"},[e("a-avatar",{attrs:{src:a.user&&a.user.avatar,size:36}}),e("div",{staticClass:"comment-meta"},[e("div",{staticClass:"user-name"},[t._v(" "+t._s(a.user&&a.user.nickname)+" "),a.user&&a.user.id===t.currentUserId?e("a-tag",{attrs:{size:"small",color:"blue"}},[t._v(t._s(t.$t("community.me")))]):t._e()],1),e("div",{staticClass:"comment-info"},[e("a-rate",{style:{fontSize:"12px"},attrs:{value:a.rating,disabled:""}}),e("span",{staticClass:"comment-time"},[t._v(t._s(t.formatTime(a.created_at)))]),a.updated_at&&a.updated_at!==a.created_at?e("span",{staticClass:"edited-tag"},[t._v(" ("+t._s(t.$t("community.edited"))+") ")]):t._e()],1)]),a.user&&a.user.id===t.currentUserId?e("div",{staticClass:"comment-actions"},[e("a-button",{attrs:{type:"link",size:"small"},on:{click:function(e){return t.startEdit(a)}}},[e("a-icon",{attrs:{type:"edit"}})],1)],1):t._e()],1),e("div",{staticClass:"comment-content"},[t._v(t._s(a.content))])])}),0)]),t.hasMore?e("div",{staticClass:"load-more"},[e("a-button",{attrs:{type:"link"},on:{click:function(e){return t.$emit("load-more")}}},[t._v(" "+t._s(t.$t("community.loadMore"))+" ")])],1):t._e()],1)}),C=[],$=(a(42762),{name:"CommentList",props:{comments:{type:Array,default:function(){return[]}},total:{type:Number,default:0},loading:{type:Boolean,default:!1},canComment:{type:Boolean,default:!1},currentUserId:{type:[Number,String],default:null},myComment:{type:Object,default:null}},data:function(){return{submitting:!1,isEditing:!1,editingCommentId:null,formData:{rating:5,content:""}}},computed:{hasMore:function(){return this.comments.length<this.total}},watch:{myComment:{immediate:!0,handler:function(t){t&&this.isEditing&&(this.formData.rating=t.rating||5,this.formData.content=t.content||"",this.editingCommentId=t.id)}}},methods:{startEdit:function(t){this.isEditing=!0,this.editingCommentId=t.id,this.formData.rating=t.rating||5,this.formData.content=t.content||""},cancelEdit:function(){this.isEditing=!1,this.editingCommentId=null,this.formData={rating:5,content:""}},submitComment:function(){var t=this;return(0,r.A)((0,s.A)().m(function e(){var a;return(0,s.A)().w(function(e){while(1)switch(e.p=e.n){case 0:if(!(t.formData.rating<1)){e.n=1;break}return t.$message.warning(t.$t("community.pleaseRate")),e.a(2);case 1:if(t.submitting=!0,e.p=2,a={rating:t.formData.rating,content:t.formData.content.trim()},!t.isEditing||!t.editingCommentId){e.n=4;break}return e.n=3,t.$emit("update-comment",(0,o.A)({comment_id:t.editingCommentId},a));case 3:e.n=5;break;case 4:return e.n=5,t.$emit("add-comment",a);case 5:t.cancelEdit();case 6:return e.p=6,t.submitting=!1,e.f(6);case 7:return e.a(2)}},e,null,[[2,,6,7]])}))()},formatTime:function(t){if(!t)return"";var e=new Date(t),a=new Date,i=a-e;if(i<6e4)return this.$t("community.justNow");if(i<36e5){var n=Math.floor(i/6e4);return"".concat(n," ").concat(this.$t("community.minutesAgo"))}if(i<864e5){var s=Math.floor(i/36e5);return"".concat(s," ").concat(this.$t("community.hoursAgo"))}if(i<2592e6){var r=Math.floor(i/864e5);return"".concat(r," ").concat(this.$t("community.daysAgo"))}return e.toLocaleDateString()}}}),b=$,k=(0,v.A)(b,w,C,!1,null,"4973cae6",null),A=k.exports,I=a(75769),P={name:"IndicatorDetail",components:{CommentList:A},props:{visible:{type:Boolean,default:!1},indicatorId:{type:Number,default:null},currentUserId:{type:[Number,String],default:null}},data:function(){return{loading:!1,purchasing:!1,commentsLoading:!1,detail:null,performance:null,comments:{items:[],total:0,page:1},myComment:null,imageError:!1}},computed:{headerStyle:function(){if(!this.detail)return{};var t=["linear-gradient(135deg, #667eea 0%, #764ba2 100%)","linear-gradient(135deg, #f093fb 0%, #f5576c 100%)","linear-gradient(135deg, #4facfe 0%, #00f2fe 100%)","linear-gradient(135deg, #43e97b 0%, #38f9d7 100%)","linear-gradient(135deg, #fa709a 0%, #fee140 100%)","linear-gradient(135deg, #89f7fe 0%, #66a6ff 100%)"],e=(this.detail.id||0)%t.length;return{background:t[e]}},indicatorInitials:function(){if(!this.detail)return"";var t=this.detail.name||"I";if(/[\u4e00-\u9fa5]/.test(t))return t.slice(0,2);var e=t.split(/\s+/);return e.length>=2?(e[0][0]+e[1][0]).toUpperCase():t.slice(0,2).toUpperCase()}},watch:{visible:function(t){t&&this.indicatorId?(this.loadDetail(),this.loadPerformance(),this.loadComments(1),this.loadMyComment()):this.resetData()}},methods:{resetData:function(){this.detail=null,this.performance=null,this.comments={items:[],total:0,page:1},this.myComment=null},loadDetail:function(){var t=this;return(0,r.A)((0,s.A)().m(function e(){var a;return(0,s.A)().w(function(e){while(1)switch(e.p=e.n){case 0:return t.loading=!0,e.p=1,e.n=2,(0,I.Ay)({url:"/api/community/indicators/".concat(t.indicatorId),method:"get"});case 2:a=e.v,1===a.code?t.detail=a.data:t.$message.error(a.msg||t.$t("community.loadFailed")),e.n=4;break;case 3:e.p=3,e.v,t.$message.error(t.$t("community.loadFailed"));case 4:return e.p=4,t.loading=!1,e.f(4);case 5:return e.a(2)}},e,null,[[1,3,4,5]])}))()},loadPerformance:function(){var t=this;return(0,r.A)((0,s.A)().m(function e(){var a;return(0,s.A)().w(function(e){while(1)switch(e.p=e.n){case 0:return e.p=0,e.n=1,(0,I.Ay)({url:"/api/community/indicators/".concat(t.indicatorId,"/performance"),method:"get"});case 1:a=e.v,1===a.code&&(t.performance=a.data),e.n=3;break;case 2:e.p=2,e.v;case 3:return e.a(2)}},e,null,[[0,2]])}))()},loadComments:function(){var t=arguments,e=this;return(0,r.A)((0,s.A)().m(function a(){var i,n;return(0,s.A)().w(function(a){while(1)switch(a.p=a.n){case 0:return i=t.length>0&&void 0!==t[0]?t[0]:1,e.commentsLoading=!0,a.p=1,a.n=2,(0,I.Ay)({url:"/api/community/indicators/".concat(e.indicatorId,"/comments"),method:"get",params:{page:i,page_size:10}});case 2:n=a.v,1===n.code&&(e.comments.items=1===i?n.data.items:[].concat((0,_.A)(e.comments.items),(0,_.A)(n.data.items)),e.comments.total=n.data.total,e.comments.page=i),a.n=4;break;case 3:a.p=3,a.v;case 4:return a.p=4,e.commentsLoading=!1,a.f(4);case 5:return a.a(2)}},a,null,[[1,3,4,5]])}))()},loadMoreComments:function(){this.comments.items.length<this.comments.total&&this.loadComments(this.comments.page+1)},loadMyComment:function(){var t=this;return(0,r.A)((0,s.A)().m(function e(){var a;return(0,s.A)().w(function(e){while(1)switch(e.p=e.n){case 0:if(t.currentUserId){e.n=1;break}return e.a(2);case 1:return e.p=1,e.n=2,(0,I.Ay)({url:"/api/community/indicators/".concat(t.indicatorId,"/my-comment"),method:"get"});case 2:a=e.v,1===a.code&&(t.myComment=a.data),e.n=4;break;case 3:e.p=3,e.v;case 4:return e.a(2)}},e,null,[[1,3]])}))()},handleAddComment:function(t){var e=this;return(0,r.A)((0,s.A)().m(function a(){var i,n;return(0,s.A)().w(function(a){while(1)switch(a.p=a.n){case 0:return a.p=0,a.n=1,(0,I.Ay)({url:"/api/community/indicators/".concat(e.indicatorId,"/comments"),method:"post",data:t});case 1:i=a.v,1===i.code?(e.$message.success(e.$t("community.commentSuccess")),e.loadComments(1),e.loadMyComment(),e.loadDetail()):(n="community.".concat(i.msg),e.$message.error(e.$te(n)?e.$t(n):i.msg)),a.n=3;break;case 2:a.p=2,a.v,e.$message.error(e.$t("community.commentFailed"));case 3:return a.a(2)}},a,null,[[0,2]])}))()},handleUpdateComment:function(t){var e=this;return(0,r.A)((0,s.A)().m(function a(){var i,n;return(0,s.A)().w(function(a){while(1)switch(a.p=a.n){case 0:return a.p=0,a.n=1,(0,I.Ay)({url:"/api/community/indicators/".concat(e.indicatorId,"/comments/").concat(t.comment_id),method:"put",data:{rating:t.rating,content:t.content}});case 1:i=a.v,1===i.code?(e.$message.success(e.$t("community.commentUpdateSuccess")),e.loadComments(1),e.loadMyComment(),e.loadDetail()):(n="community.".concat(i.msg),e.$message.error(e.$te(n)?e.$t(n):i.msg)),a.n=3;break;case 2:a.p=2,a.v,e.$message.error(e.$t("community.commentUpdateFailed"));case 3:return a.a(2)}},a,null,[[0,2]])}))()},handlePurchase:function(){var t=this;return(0,r.A)((0,s.A)().m(function e(){var a,i;return(0,s.A)().w(function(e){while(1)switch(e.p=e.n){case 0:return t.purchasing=!0,e.p=1,e.n=2,(0,I.Ay)({url:"/api/community/indicators/".concat(t.indicatorId,"/purchase"),method:"post"});case 2:a=e.v,1===a.code?(t.$message.success(t.$t("community.purchaseSuccess")),t.loadDetail(),t.$emit("purchased")):(i="community.".concat(a.msg),t.$message.error(t.$te(i)?t.$t(i):a.msg)),e.n=4;break;case 3:e.p=3,e.v,t.$message.error(t.$t("community.purchaseFailed"));case 4:return e.p=4,t.purchasing=!1,e.f(4);case 5:return e.a(2)}},e,null,[[1,3,4,5]])}))()},goToUse:function(){this.$emit("close"),this.$router.push("/indicator-analysis")},formatDate:function(t){if(!t)return"-";var e=new Date(t);return e.toLocaleDateString()}}},S=P,x=(0,v.A)(S,f,y,!1,null,"3df2c84f",null),D=x.exports,T={name:"IndicatorCommunity",components:{IndicatorCard:g,IndicatorDetail:D},computed:(0,o.A)((0,o.A)({},(0,c.aH)({currentUserId:function(t){var e,a;return(null===(e=t.user.info)||void 0===e?void 0:e.id)||(null===(a=t.user.info)||void 0===a?void 0:a.userId)},userRole:function(t){var e;return null===(e=t.user.info)||void 0===e?void 0:e.role},navTheme:function(t){return t.app.theme}})),{},{isDarkTheme:function(){return"dark"===this.navTheme||"realdark"===this.navTheme},isAdmin:function(){if(!this.userRole)return!1;var t=this.userRole.id||this.userRole;return"admin"===t}}),data:function(){return{loading:!1,indicators:[],filters:{keyword:"",pricingType:"",sortBy:"newest"},pagination:{current:1,pageSize:12,total:0},detailVisible:!1,selectedIndicatorId:null,showMyPurchases:!1,purchasesLoading:!1,myPurchases:[],activeTab:"market",reviewFilter:"pending",reviewLoading:!1,pendingIndicators:[],reviewPagination:{current:1,pageSize:20,total:0},reviewStats:{pending:0,approved:0,rejected:0},expandedCodes:{},showReviewModal:!1,reviewAction:"approve",reviewNote:"",reviewingIndicator:null}},watch:{showMyPurchases:function(t){t&&this.loadMyPurchases()},isAdmin:{immediate:!0,handler:function(t){t&&this.loadReviewStats()}}},mounted:function(){this.loadIndicators()},methods:{loadIndicators:function(){var t=this;return(0,r.A)((0,s.A)().m(function e(){var a;return(0,s.A)().w(function(e){while(1)switch(e.p=e.n){case 0:return t.loading=!0,e.p=1,e.n=2,(0,I.Ay)({url:"/api/community/indicators",method:"get",params:{page:t.pagination.current,page_size:t.pagination.pageSize,keyword:t.filters.keyword||void 0,pricing_type:t.filters.pricingType||void 0,sort_by:t.filters.sortBy}});case 2:a=e.v,1===a.code?(t.indicators=a.data.items||[],t.pagination.total=a.data.total||0):t.$message.error(a.msg||t.$t("community.loadFailed")),e.n=4;break;case 3:e.p=3,e.v,t.$message.error(t.$t("community.loadFailed"));case 4:return e.p=4,t.loading=!1,e.f(4);case 5:return e.a(2)}},e,null,[[1,3,4,5]])}))()},loadMyPurchases:function(){var t=this;return(0,r.A)((0,s.A)().m(function e(){var a;return(0,s.A)().w(function(e){while(1)switch(e.p=e.n){case 0:return t.purchasesLoading=!0,e.p=1,e.n=2,(0,I.Ay)({url:"/api/community/my-purchases",method:"get",params:{page:1,page_size:50}});case 2:a=e.v,1===a.code&&(t.myPurchases=a.data.items||[]),e.n=4;break;case 3:e.p=3,e.v;case 4:return e.p=4,t.purchasesLoading=!1,e.f(4);case 5:return e.a(2)}},e,null,[[1,3,4,5]])}))()},handleSearch:function(){this.pagination.current=1,this.loadIndicators()},handleFilterChange:function(){this.pagination.current=1,this.loadIndicators()},handlePageChange:function(t){this.pagination.current=t,this.loadIndicators()},openDetail:function(t){this.selectedIndicatorId=t.id,this.detailVisible=!0},openDetailById:function(t){this.showMyPurchases=!1,this.selectedIndicatorId=t,this.detailVisible=!0},handlePurchased:function(){this.loadIndicators()},goToCreate:function(){this.$router.push("/indicator-analysis")},goToUse:function(){this.showMyPurchases=!1,this.$router.push("/indicator-analysis")},formatDate:function(t){return t?new Date(t).toLocaleString():"-"},handleTabChange:function(t){"review"===t&&(this.loadPendingIndicators(),this.loadReviewStats())},loadReviewStats:function(){var t=this;return(0,r.A)((0,s.A)().m(function e(){var a;return(0,s.A)().w(function(e){while(1)switch(e.p=e.n){case 0:return e.p=0,e.n=1,(0,I.Ay)({url:"/api/community/admin/review-stats",method:"get"});case 1:a=e.v,1===a.code&&(t.reviewStats=a.data||{pending:0,approved:0,rejected:0}),e.n=3;break;case 2:e.p=2,e.v;case 3:return e.a(2)}},e,null,[[0,2]])}))()},loadPendingIndicators:function(){var t=this;return(0,r.A)((0,s.A)().m(function e(){var a;return(0,s.A)().w(function(e){while(1)switch(e.p=e.n){case 0:return t.reviewLoading=!0,e.p=1,e.n=2,(0,I.Ay)({url:"/api/community/admin/pending-indicators",method:"get",params:{page:t.reviewPagination.current,page_size:t.reviewPagination.pageSize,review_status:t.reviewFilter}});case 2:a=e.v,1===a.code&&(t.pendingIndicators=a.data.items||[],t.reviewPagination.total=a.data.total||0),e.n=4;break;case 3:e.p=3,e.v,t.$message.error(t.$t("community.admin.loadFailed"));case 4:return e.p=4,t.reviewLoading=!1,e.f(4);case 5:return e.a(2)}},e,null,[[1,3,4,5]])}))()},handleReviewPageChange:function(t){this.reviewPagination.current=t,this.loadPendingIndicators()},toggleCode:function(t){this.$set(this.expandedCodes,t,!this.expandedCodes[t])},getStatusColor:function(t){var e={pending:"orange",approved:"green",rejected:"red"};return e[t]||"default"},getStatusText:function(t){var e={pending:this.$t("community.admin.pending"),approved:this.$t("community.admin.approved"),rejected:this.$t("community.admin.rejected")};return e[t]||t},handleReview:function(t,e){this.reviewingIndicator=t,this.reviewAction=e,this.reviewNote="",this.showReviewModal=!0},submitReview:function(){var t=this;return(0,r.A)((0,s.A)().m(function e(){var a;return(0,s.A)().w(function(e){while(1)switch(e.p=e.n){case 0:if(t.reviewingIndicator){e.n=1;break}return e.a(2);case 1:return e.p=1,e.n=2,(0,I.Ay)({url:"/api/community/admin/indicators/".concat(t.reviewingIndicator.id,"/review"),method:"post",data:{action:t.reviewAction,note:t.reviewNote}});case 2:a=e.v,1===a.code?(t.$message.success(t.$t("community.admin.reviewSuccess")),t.showReviewModal=!1,t.loadPendingIndicators(),t.loadReviewStats()):t.$message.error(a.msg||t.$t("community.admin.reviewFailed")),e.n=4;break;case 3:e.p=3,e.v,t.$message.error(t.$t("community.admin.reviewFailed"));case 4:return e.a(2)}},e,null,[[1,3]])}))()},handleUnpublish:function(t){var e=this;return(0,r.A)((0,s.A)().m(function a(){return(0,s.A)().w(function(a){while(1)switch(a.n){case 0:e.$confirm({title:e.$t("community.admin.unpublishConfirm"),content:e.$t("community.admin.unpublishHint"),okText:e.$t("community.admin.confirm"),cancelText:e.$t("community.admin.cancel"),onOk:function(){var a=(0,r.A)((0,s.A)().m(function a(){var i;return(0,s.A)().w(function(a){while(1)switch(a.p=a.n){case 0:return a.p=0,a.n=1,(0,I.Ay)({url:"/api/community/admin/indicators/".concat(t.id,"/unpublish"),method:"post",data:{note:""}});case 1:i=a.v,1===i.code?(e.$message.success(e.$t("community.admin.unpublishSuccess")),e.loadPendingIndicators(),e.loadReviewStats()):e.$message.error(i.msg||e.$t("community.admin.unpublishFailed")),a.n=3;break;case 2:a.p=2,a.v,e.$message.error(e.$t("community.admin.unpublishFailed"));case 3:return a.a(2)}},a,null,[[0,2]])}));function i(){return a.apply(this,arguments)}return i}()});case 1:return a.a(2)}},a)}))()},handleDelete:function(t){var e=this;return(0,r.A)((0,s.A)().m(function a(){var i;return(0,s.A)().w(function(a){while(1)switch(a.p=a.n){case 0:return a.p=0,a.n=1,(0,I.Ay)({url:"/api/community/admin/indicators/".concat(t.id),method:"delete"});case 1:i=a.v,1===i.code?(e.$message.success(e.$t("community.admin.deleteSuccess")),e.loadPendingIndicators(),e.loadReviewStats()):e.$message.error(i.msg||e.$t("community.admin.deleteFailed")),a.n=3;break;case 2:a.p=2,a.v,e.$message.error(e.$t("community.admin.deleteFailed"));case 3:return a.a(2)}},a,null,[[0,2]])}))()}}},z=T,F=(0,v.A)(z,i,n,!1,null,"9342b380",null),M=F.exports}}]);