"use strict";(self["webpackChunkaida"]=self["webpackChunkaida"]||[]).push([[9533],{69533:function(t,e,s){s.r(e),s.d(e,{default:function(){return D}});var i=s(66252),a=s(3577),n=s(49963),r=s(55929);const o={class:"task_content"},l={class:"task_content_item"},h=["src"],c={class:"task_content_item_text"},g={class:"task_content_item_text_left modal_title_text"},u={class:"task_content_item_text_left_titile"},k={class:"task_content_item_text_left_into modal_title_text_intro"},_={key:0,src:r,alt:""},d={key:1,class:"task_content_item_text_right modal_title_text"},m={class:"task_content_item_text_left_titile"},p=["onClick"],f={class:"task_content_more"},v=(0,i._)("img",{src:r,alt:""},null,-1),L=[v],w={class:"mark_loading"};function T(t,e,s,r,v,T){const M=(0,i.up)("a-spin"),b=(0,i.up)("a-drawer"),x=(0,i.Q2)("observe");return(0,i.wg)(),(0,i.j4)(b,{visible:t.visible,"onUpdate:visible":e[0]||(e[0]=e=>t.visible=e),class:"task_page",style:{color:"#000"},title:t.$t("taskPage.TaskList"),placement:"right",onAfterVisibleChange:t.afterVisibleChange},{default:(0,i.w5)((()=>[(0,i._)("div",o,[((0,i.wg)(!0),(0,i.iD)(i.HY,null,(0,i.Ko)(t.taskListMore,(e=>((0,i.wg)(),(0,i.iD)("div",l,[(0,i._)("img",{src:e?.inputImage,alt:""},null,8,h),(0,i._)("div",c,[(0,i._)("div",g,[(0,i._)("div",u,(0,a.zw)(e?.imageName),1),(0,i._)("div",k,(0,a.zw)(e?.createDate),1)]),"Executing"==e?.status?((0,i.wg)(),(0,i.iD)("img",_)):((0,i.wg)(),(0,i.iD)("div",d,[(0,i._)("div",m,(0,a.zw)(e.status),1),(0,i.wy)((0,i._)("div",{onClick:s=>t.setDownloadIamge(e),class:"task_content_item_text_left_into modal_title_text_intro"},(0,a.zw)(t.$t("taskPage.download")),9,p),[[n.F8,"success"===e.status]])]))])])))),256)),(0,i.wy)(((0,i.wg)(),(0,i.iD)("div",f,L)),[[n.F8,t.total>t.taskListMore?.length&&0!=t.total&&t.taskListMore.length>0],[x]])]),(0,i.wy)((0,i._)("div",w,[(0,i.Wm)(M,{size:"large"})],512),[[n.F8,t.isShowMark]])])),_:1},8,["visible","title","onAfterVisibleChange"])}var M=s(2262),b=s(74961),x=s(47332),S=s(8552),I=s(33907),C=(0,i.aZ)({components:{},props:["msg","sketchCatecoryList"],setup(){let{t:t}=(0,S.QT)(),e=(0,M.qj)({currentPage:1,pageSize:10,total:0});const s=(0,I.oR)();let i=(0,M.iH)(!1),a=(0,M.iH)([]),n=(0,M.iH)([]),r=(0,M.iH)([{label:"SR",value:"SR"}]),o=(0,M.iH)({value:"SR"}),l=null,h=(0,M.iH)(!1);return{...(0,M.BK)(e),store:s,visible:i,taskListUnfinished:a,taskListMore:n,state:r,currentState:o,getTaskTime:l,t:t,isShowMark:h}},data(){return{}},mounted(){},directives:{observe:{mounted(t,e){const s=new IntersectionObserver(a,{root:null,threshold:[.1]});s.observe(t);let i=e.instance;function a(t,e){t.forEach((t=>{t.isIntersecting&&i.getTaskMoreList("")}))}}}},watch:{},methods:{getPopupContainer(){let t=document.querySelector(".task_page .task_content_select");return t},init(t){this.visible=!0;let e=100;t&&(e=1e3),setTimeout((()=>{this.currentPage=1,this.isShowMark=!0,this.getTaskMoreList(t),this.getTaskTime=null}),e)},sort(t){return t.sort(((t,e)=>{var s=Date.parse(t.createDate),i=Date.parse(e.createDate);return i-s})),t},afterVisibleChange(t){t||(this.taskListMore=[])},visibleChange(){this.pageSize=10,this.currentPage=1,this.total=0,this.taskListMore=[],this.getTaskMoreList("")},getTaskList(){clearTimeout(this.getTaskTime);let t=this.taskListUnfinished.map((t=>t.taskId));t<=0&&!t[0].taskId||b.V.axiosPost(b.V.httpUrls.getTasksList,t).then((t=>{this.taskListUnfinished.forEach(((e,s)=>{t.forEach((t=>{if(e.taskId==t.taskId&&"success"==t.status){(0,x.W$)(t.outputImage,t.imageName),this.store.dispatch("getCredits");let i=e.index;this.taskListUnfinished[s]=t,this.taskListUnfinished[s].index=i,this.taskListMore[i]=t,this.taskListMore[i].inputImage=t.inputParam.images}}))})),this.taskListUnfinished=this.taskListUnfinished.filter((t=>"Waiting"==t.status||"Executing"==t.status)),this.taskListUnfinished.length>0&&(this.getTaskTime=setTimeout((()=>{this.getTaskList()}),4e3))}))},getTaskMoreList(t){clearTimeout(this.getTaskTime);let e={size:this.pageSize,page:this.currentPage,type:this.currentState.value,endTime:"",startTime:""};this.isShowMark=!0,b.V.axiosPost(b.V.httpUrls.getTasksHistory,e).then((e=>{this.isShowMark=!1,1!=this.currentPage&&0==e.content.length?(this.currentPage=1,this.getTaskMoreList("")):(this.currentPage+=1,this.taskListMore.push(...e.content),this.total=e.total,this.taskListUnfinished=[],t&&e.content.forEach((e=>{t.forEach((t=>{t==e.taskId&&"success"==e.status&&((0,x.W$)(e.outputImage,e.imageName),this.store.dispatch("getCredits"))}))})),this.taskListMore.forEach(((t,e)=>{"Waiting"!=t.status&&"Executing"!=t.status||(t.index=e,this.taskListUnfinished.push(t),this.getTaskList())})))})).catch((t=>{this.isShowMark=!1}))},setDownloadIamge(t){(0,x.W$)(t.outputImage,t.imageName)}}}),P=s(83744);const U=(0,P.Z)(C,[["render",T]]);var D=U}}]);