Commit b09608e1 by haojie

1

parent de3c4e82
import{a5 as t,a6 as r,a7 as e,x as n,a8 as a,a9 as o,aa as c,ab as u,O as i,B as s,ac as f,D as l,ad as b,ae as p,af as j,ag as v,ah as y,ai as d,aj as h,ak as g,al as m,am as O,an as A,t as w,ao as x,_ as I}from"./index-a8c47147.js";import{_ as S}from"./const-c26d39ab.js";import{k as P,A as E,B as _,I as k,U as D,o as U,V as F,W as B}from"./vue-b5c0e5e9.js";import{_ as C}from"./_plugin-vue_export-helper-1b428a4d.js";var M=function(t,r){for(var e=-1,n=r.length,a=t.length;++e<n;)t[a+e]=r[e];return t};var T=function(t,r){for(var e=-1,n=null==t?0:t.length;++e<n&&!1!==r(t[e],e,t););return t},$=y,V=d,N=h;var R=function(t){return N(t)?$(t):V(t)},W=l,z=R;var G=function(t,r){return t&&W(r,z(r),t)},L=l,q=f;var H=function(t,r){return t&&L(r,q(r),t)};var J=function(){return[]},K=function(t,r){for(var e=-1,n=null==t?0:t.length,a=0,o=[];++e<n;){var c=t[e];r(c,e,t)&&(o[a++]=c)}return o},Q=J,X=Object.prototype.propertyIsEnumerable,Y=Object.getOwnPropertySymbols,Z=Y?function(t){return null==t?[]:(t=Object(t),K(Y(t),(function(r){return X.call(t,r)})))}:Q,tt=l,rt=Z;var et=function(t,r){return tt(t,rt(t),r)},nt=M,at=g,ot=Z,ct=J,ut=Object.getOwnPropertySymbols?function(t){for(var r=[];t;)nt(r,ot(t)),t=at(t);return r}:ct,it=l,st=ut;var ft=function(t,r){return it(t,st(t),r)},lt=M,bt=s;var pt=function(t,r,e){var n=r(t);return bt(t)?n:lt(n,e(t))},jt=pt,vt=Z,yt=R;var dt=function(t){return jt(t,yt,vt)},ht=pt,gt=ut,mt=f;var Ot=function(t){return ht(t,mt,gt)},At=Object.prototype.hasOwnProperty;var wt=function(t){var r=t.length,e=new t.constructor(r);return r&&"string"==typeof t[0]&&At.call(t,"index")&&(e.index=t.index,e.input=t.input),e},xt=b;var It=function(t,r){var e=r?xt(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.byteLength)},St=/\w*$/;var Pt=function(t){var r=new t.constructor(t.source,St.exec(t));return r.lastIndex=t.lastIndex,r},Et=n?n.prototype:void 0,_t=Et?Et.valueOf:void 0;var kt=b,Dt=It,Ut=Pt,Ft=function(t){return _t?Object(_t.call(t)):{}},Bt=p;var Ct=function(t,r,e){var n=t.constructor;switch(r){case"[object ArrayBuffer]":return kt(t);case"[object Boolean]":case"[object Date]":return new n(+t);case"[object DataView]":return Dt(t,e);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return Bt(t,e);case"[object Map]":case"[object Set]":return new n;case"[object Number]":case"[object String]":return new n(t);case"[object RegExp]":return Ut(t);case"[object Symbol]":return Ft(t)}},Mt=c,Tt=m;var $t=function(t){return Tt(t)&&"[object Map]"==Mt(t)},Vt=j,Nt=t.exports,Rt=Nt&&Nt.isMap,Wt=Rt?Vt(Rt):$t,zt=c,Gt=m;var Lt=function(t){return Gt(t)&&"[object Set]"==zt(t)},qt=j,Ht=t.exports,Jt=Ht&&Ht.isSet,Kt=Jt?qt(Jt):Lt,Qt=a,Xt=T,Yt=v,Zt=G,tr=H,rr=r.exports,er=o,nr=et,ar=ft,or=dt,cr=Ot,ur=c,ir=wt,sr=Ct,fr=u,lr=s,br=e.exports,pr=Wt,jr=i,vr=Kt,yr=R,dr=f,hr="[object Arguments]",gr="[object Function]",mr="[object Object]",Or={};Or[hr]=Or["[object Array]"]=Or["[object ArrayBuffer]"]=Or["[object DataView]"]=Or["[object Boolean]"]=Or["[object Date]"]=Or["[object Float32Array]"]=Or["[object Float64Array]"]=Or["[object Int8Array]"]=Or["[object Int16Array]"]=Or["[object Int32Array]"]=Or["[object Map]"]=Or["[object Number]"]=Or[mr]=Or["[object RegExp]"]=Or["[object Set]"]=Or["[object String]"]=Or["[object Symbol]"]=Or["[object Uint8Array]"]=Or["[object Uint8ClampedArray]"]=Or["[object Uint16Array]"]=Or["[object Uint32Array]"]=!0,Or["[object Error]"]=Or[gr]=Or["[object WeakMap]"]=!1;var Ar=function t(r,e,n,a,o,c){var u,i=1&e,s=2&e,f=4&e;if(n&&(u=o?n(r,a,o,c):n(r)),void 0!==u)return u;if(!jr(r))return r;var l=lr(r);if(l){if(u=ir(r),!i)return er(r,u)}else{var b=ur(r),p=b==gr||"[object GeneratorFunction]"==b;if(br(r))return rr(r,i);if(b==mr||b==hr||p&&!o){if(u=s||p?{}:fr(r),!i)return s?ar(r,tr(u,r)):nr(r,Zt(u,r))}else{if(!Or[b])return o?r:{};u=sr(r,b,i)}}c||(c=new Qt);var j=c.get(r);if(j)return j;c.set(r,u),vr(r)?r.forEach((function(a){u.add(t(a,e,n,a,r,c))})):pr(r)&&r.forEach((function(a,o){u.set(o,t(a,e,n,o,r,c))}));var v=l?void 0:(f?s?cr:or:s?dr:yr)(r);return Xt(v||r,(function(a,o){v&&(a=r[o=a]),Yt(u,o,t(a,e,n,o,r,c))})),u},wr=s,xr=A,Ir=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Sr=/^\w*$/;var Pr=function(t,r){if(wr(t))return!1;var e=w(t);return!("number"!=e&&"symbol"!=e&&"boolean"!=e&&null!=t&&!xr(t))||(Sr.test(t)||!Ir.test(t)||null!=r&&t in Object(r))},Er=x;function _r(t,r){if("function"!=typeof t||null!=r&&"function"!=typeof r)throw new TypeError("Expected a function");var e=function e(){var n=arguments,a=r?r.apply(this,n):n[0],o=e.cache;if(o.has(a))return o.get(a);var c=t.apply(this,n);return e.cache=o.set(a,c)||o,c};return e.cache=new(_r.Cache||Er),e}_r.Cache=Er;var kr=_r;var Dr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ur=/\\(\\)?/g,Fr=function(t){var r=kr(t,(function(t){return 500===e.size&&e.clear(),t})),e=r.cache;return r}((function(t){var r=[];return 46===t.charCodeAt(0)&&r.push(""),t.replace(Dr,(function(t,e,n,a){r.push(n?a.replace(Ur,"$1"):e||t)})),r})),Br=s,Cr=Pr,Mr=Fr,Tr=O;var $r=function(t,r){return Br(t)?t:Cr(t,r)?[t]:Mr(Tr(t))},Vr=A;var Nr=function(t){if("string"==typeof t||Vr(t))return t;var r=t+"";return"0"==r&&1/t==-Infinity?"-0":r},Rr=$r,Wr=Nr;var zr=function(t,r){for(var e=0,n=(r=Rr(r,t)).length;null!=t&&e<n;)t=t[Wr(r[e++])];return e&&e==n?t:void 0},Gr=["from","to","direction"];function Lr(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),e.push.apply(e,n)}return e}function qr(t,r){for(var e=function(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?Lr(Object(e),!0).forEach((function(r){I(t,r,e[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Lr(Object(e)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))}))}return t}({},t),n=0;n<r.length;n++){delete e[r[n]]}return e}function Hr(t){if("string"==typeof t)return t;if(Array.isArray(t))return t[0]&&"#"===t[0][0]&&t.unshift("90deg"),"linear-gradient( ".concat(t.join(",")," )");var r=t.from,e=t.to,n=t.direction,a=void 0===n?"to right":n,o=S(t,Gr),c=Object.keys(o);if(c.length){var u=(c=c.sort((function(t,r){return parseFloat(t.substr(0,t.length-1))-parseFloat(r.substr(0,r.length-1))}))).map((function(t){return"".concat(o[t]," ").concat(t)}));return"linear-gradient(".concat(a,", ").concat(u.join(","),")")}return"linear-gradient(".concat(a,", ").concat(r,", ").concat(e,")")}function Jr(t,r){var e="number"==typeof r;if(!t||0===t.length)return e?{length:0,characters:t}:0;for(var n=0,a=0;a<t.length;a++){var o=0;if(o=t.charCodeAt(a)>127||94===t.charCodeAt(a)?2:1,e&&n+o>r)return{length:n,characters:t.slice(0,a)};n+=o}return e?{length:n,characters:t}:n}const Kr=t=>(F("data-v-60ab0cfe"),t=t(),B(),t),Qr=[Kr((()=>_("div",null,null,-1))),Kr((()=>_("div",null,null,-1))),Kr((()=>_("div",null,null,-1)))],Xr=C(P({__name:"Animation",props:{background:{default:""},position:{default:"absolute"},width:{default:"100%"},left:{default:"0px"},height:{default:"100%"},top:{default:"0px"},isTable:{type:Boolean,default:!1}},setup:t=>(r,e)=>(U(),E("div",{class:k(["custom-loading-box",{"custom-is-table-box":!t.isTable}]),style:D({width:t.width,height:t.height,background:t.background,position:t.position})},[_("div",{class:k(["ball-beat",{"custom-is-table-child":!t.isTable}]),style:D({top:t.top,left:t.left})},Qr,6)],6))}),[["__scopeId","data-v-60ab0cfe"]]);export{Xr as A,M as _,Ar as a,$r as b,Ot as c,Nr as d,zr as e,Hr as f,Jr as g,R as k,qr as o};
System.register(["./index-legacy-0dac1084.js","./const-legacy-049a303d.js","./vue-legacy-8b51572f.js","./_plugin-vue_export-helper-legacy-762b7923.js"],(function(t,e){"use strict";var r,n,o,c,a,u,i,l,f,s,b,p,j,y,g,d,h,v,O,A,w,m,x,S,I,P,E,_,k,D,U,F,B,C,M,T;return{setters:[t=>{r=t.a5,n=t.a6,o=t.a7,c=t.x,a=t.a8,u=t.a9,i=t.aa,l=t.ab,f=t.O,s=t.B,b=t.ac,p=t.D,j=t.ad,y=t.ae,g=t.af,d=t.ag,h=t.ah,v=t.ai,O=t.aj,A=t.ak,w=t.al,m=t.am,x=t.an,S=t.t,I=t.ao,P=t._},t=>{E=t._},t=>{_=t.k,k=t.A,D=t.B,U=t.I,F=t.U,B=t.o,C=t.V,M=t.W},t=>{T=t._}],execute:function(){t({f:function(t){if("string"==typeof t)return t;if(Array.isArray(t))return t[0]&&"#"===t[0][0]&&t.unshift("90deg"),"linear-gradient( ".concat(t.join(",")," )");var e=t.from,r=t.to,n=t.direction,o=void 0===n?"to right":n,c=E(t,qe),a=Object.keys(c);if(a.length){var u=(a=a.sort((function(t,e){return parseFloat(t.substr(0,t.length-1))-parseFloat(e.substr(0,e.length-1))}))).map((function(t){return"".concat(c[t]," ").concat(t)}));return"linear-gradient(".concat(o,", ").concat(u.join(","),")")}return"linear-gradient(".concat(o,", ").concat(e,", ").concat(r,")")},g:function(t,e){var r="number"==typeof e;if(!t||0===t.length)return r?{length:0,characters:t}:0;for(var n=0,o=0;o<t.length;o++){var c=0;if(c=t.charCodeAt(o)>127||94===t.charCodeAt(o)?2:1,r&&n+c>e)return{length:n,characters:t.slice(0,o)};n+=c}return r?{length:n,characters:t}:n},o:function(t,e){for(var r=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?He(Object(r),!0).forEach((function(e){P(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):He(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},t),n=0;n<e.length;n++)delete r[e[n]];return r}});var e=t("_",(function(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t})),$=function(t,e){for(var r=-1,n=null==t?0:t.length;++r<n&&!1!==e(t[r],r,t););return t},V=h,N=v,R=O,W=t("k",(function(t){return R(t)?V(t):N(t)})),z=p,G=W,L=function(t,e){return t&&z(e,G(e),t)},q=p,H=b,J=function(t,e){return t&&q(e,H(e),t)},K=function(){return[]},Q=function(t,e){for(var r=-1,n=null==t?0:t.length,o=0,c=[];++r<n;){var a=t[r];e(a,r,t)&&(c[o++]=a)}return c},X=K,Y=Object.prototype.propertyIsEnumerable,Z=Object.getOwnPropertySymbols,tt=Z?function(t){return null==t?[]:(t=Object(t),Q(Z(t),(function(e){return Y.call(t,e)})))}:X,et=p,rt=tt,nt=function(t,e){return et(t,rt(t),e)},ot=e,ct=A,at=tt,ut=K,it=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)ot(e,at(t)),t=ct(t);return e}:ut,lt=p,ft=it,st=function(t,e){return lt(t,ft(t),e)},bt=e,pt=s,jt=function(t,e,r){var n=e(t);return pt(t)?n:bt(n,r(t))},yt=jt,gt=tt,dt=W,ht=function(t){return yt(t,dt,gt)},vt=jt,Ot=it,At=b,wt=t("c",(function(t){return vt(t,At,Ot)})),mt=Object.prototype.hasOwnProperty,xt=function(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&mt.call(t,"index")&&(r.index=t.index,r.input=t.input),r},St=j,It=function(t,e){var r=e?St(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)},Pt=/\w*$/,Et=function(t){var e=new t.constructor(t.source,Pt.exec(t));return e.lastIndex=t.lastIndex,e},_t=c?c.prototype:void 0,kt=_t?_t.valueOf:void 0,Dt=j,Ut=It,Ft=Et,Bt=function(t){return kt?Object(kt.call(t)):{}},Ct=y,Mt=function(t,e,r){var n=t.constructor;switch(e){case"[object ArrayBuffer]":return Dt(t);case"[object Boolean]":case"[object Date]":return new n(+t);case"[object DataView]":return Ut(t,r);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return Ct(t,r);case"[object Map]":case"[object Set]":return new n;case"[object Number]":case"[object String]":return new n(t);case"[object RegExp]":return Ft(t);case"[object Symbol]":return Bt(t)}},Tt=i,$t=w,Vt=function(t){return $t(t)&&"[object Map]"==Tt(t)},Nt=g,Rt=r.exports,Wt=Rt&&Rt.isMap,zt=Wt?Nt(Wt):Vt,Gt=i,Lt=w,qt=function(t){return Lt(t)&&"[object Set]"==Gt(t)},Ht=g,Jt=r.exports,Kt=Jt&&Jt.isSet,Qt=Kt?Ht(Kt):qt,Xt=a,Yt=$,Zt=d,te=L,ee=J,re=n.exports,ne=u,oe=nt,ce=st,ae=ht,ue=wt,ie=i,le=xt,fe=Mt,se=l,be=s,pe=o.exports,je=zt,ye=f,ge=Qt,de=W,he=b,ve="[object Arguments]",Oe="[object Function]",Ae="[object Object]",we={};we[ve]=we["[object Array]"]=we["[object ArrayBuffer]"]=we["[object DataView]"]=we["[object Boolean]"]=we["[object Date]"]=we["[object Float32Array]"]=we["[object Float64Array]"]=we["[object Int8Array]"]=we["[object Int16Array]"]=we["[object Int32Array]"]=we["[object Map]"]=we["[object Number]"]=we[Ae]=we["[object RegExp]"]=we["[object Set]"]=we["[object String]"]=we["[object Symbol]"]=we["[object Uint8Array]"]=we["[object Uint8ClampedArray]"]=we["[object Uint16Array]"]=we["[object Uint32Array]"]=!0,we["[object Error]"]=we[Oe]=we["[object WeakMap]"]=!1,t("a",(function t(e,r,n,o,c,a){var u,i=1&r,l=2&r,f=4&r;if(n&&(u=c?n(e,o,c,a):n(e)),void 0!==u)return u;if(!ye(e))return e;var s=be(e);if(s){if(u=le(e),!i)return ne(e,u)}else{var b=ie(e),p=b==Oe||"[object GeneratorFunction]"==b;if(pe(e))return re(e,i);if(b==Ae||b==ve||p&&!c){if(u=l||p?{}:se(e),!i)return l?ce(e,ee(u,e)):oe(e,te(u,e))}else{if(!we[b])return c?e:{};u=fe(e,b,i)}}a||(a=new Xt);var j=a.get(e);if(j)return j;a.set(e,u),ge(e)?e.forEach((function(o){u.add(t(o,r,n,o,e,a))})):je(e)&&e.forEach((function(o,c){u.set(c,t(o,r,n,c,e,a))}));var y=s?void 0:(f?l?ue:ae:l?he:de)(e);return Yt(y||e,(function(o,c){y&&(o=e[c=o]),Zt(u,c,t(o,r,n,c,e,a))})),u}));var me=s,xe=x,Se=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ie=/^\w*$/,Pe=function(t,e){if(me(t))return!1;var r=S(t);return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!xe(t))||Ie.test(t)||!Se.test(t)||null!=e&&t in Object(e)},Ee=I;function _e(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function r(){var n=arguments,o=e?e.apply(this,n):n[0],c=r.cache;if(c.has(o))return c.get(o);var a=t.apply(this,n);return r.cache=c.set(o,a)||c,a};return r.cache=new(_e.Cache||Ee),r}_e.Cache=Ee;var ke,De,Ue,Fe=_e,Be=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ce=/\\(\\)?/g,Me=(ke=function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(Be,(function(t,r,n,o){e.push(n?o.replace(Ce,"$1"):r||t)})),e},De=Fe(ke,(function(t){return 500===Ue.size&&Ue.clear(),t})),Ue=De.cache,De),Te=s,$e=Pe,Ve=Me,Ne=m,Re=t("b",(function(t,e){return Te(t)?t:$e(t,e)?[t]:Ve(Ne(t))})),We=x,ze=t("d",(function(t){if("string"==typeof t||We(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e})),Ge=Re,Le=ze;t("e",(function(t,e){for(var r=0,n=(e=Ge(e,t)).length;null!=t&&r<n;)t=t[Le(e[r++])];return r&&r==n?t:void 0}));var qe=["from","to","direction"];function He(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}const Je=t=>(C("data-v-60ab0cfe"),t=t(),M(),t),Ke=[Je((()=>D("div",null,null,-1))),Je((()=>D("div",null,null,-1))),Je((()=>D("div",null,null,-1)))],Qe=_({__name:"Animation",props:{background:{default:""},position:{default:"absolute"},width:{default:"100%"},left:{default:"0px"},height:{default:"100%"},top:{default:"0px"},isTable:{type:Boolean,default:!1}},setup:t=>(e,r)=>(B(),k("div",{class:U(["custom-loading-box",{"custom-is-table-box":!t.isTable}]),style:F({width:t.width,height:t.height,background:t.background,position:t.position})},[D("div",{class:U(["ball-beat",{"custom-is-table-child":!t.isTable}]),style:F({top:t.top,left:t.left})},Ke,6)],6))});t("A",T(Qe,[["__scopeId","data-v-60ab0cfe"]]))}}}));
const o=(o,t)=>{const c=o.__vccOpts||o;for(const[s,n]of t)c[s]=n;return c};export{o as _};
System.register([],(function(t,e){"use strict";return{execute:function(){t("_",((t,e)=>{const c=t.__vccOpts||t;for(const[n,r]of e)c[n]=r;return c}))}}}));
import{h as e,i as t,j as r,J as n,b as o}from"./index-a8c47147.js";import{k as c,h as a,f as l,g as i}from"./vue-b5c0e5e9.js";function s(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},c=Object.keys(e);for(n=0;n<c.length;n++)r=c[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(n=0;n<c.length;n++)r=c[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var f={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M10.88 8a2.88 2.88 0 11-5.76 0 2.88 2.88 0 015.76 0zm-1 0a1.88 1.88 0 10-3.76 0 1.88 1.88 0 003.76 0z",fillOpacity:.9}},{tag:"path",attrs:{fill:"currentColor",d:"M1.12 8.23A7.72 7.72 0 008 12.5c2.9 0 5.54-1.63 6.88-4.27L15 8l-.12-.23A7.73 7.73 0 008 3.5a7.74 7.74 0 00-6.88 4.27L1 8l.12.23zM8 11.5A6.73 6.73 0 012.11 8 6.73 6.73 0 0113.9 8 6.74 6.74 0 018 11.5z",fillOpacity:.9}}]},v=c({name:"BrowseIcon",props:{size:{type:String},onClick:{type:Function}},setup(r,n){var{attrs:o}=n,c=a((()=>r.size)),{className:l,style:i}=e(c),s=a((()=>["t-icon","t-icon-browse",l.value])),u=a((()=>p(p({},i.value),o.style))),v=a((()=>({class:s.value,style:u.value,onClick:e=>{var t;return null===(t=r.onClick)||void 0===t?void 0:t.call(r,{e:e})}})));return()=>t(f,v.value)}});function y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function O(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?y(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var b={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M15 8A7 7 0 101 8a7 7 0 0014 0zM5.67 4.95L8 7.29l2.33-2.34.7.7L8.7 8l2.34 2.35-.71.7L8 8.71l-2.33 2.34-.7-.7L7.3 8 4.96 5.65l.71-.7z",fillOpacity:.9}}]},m=c({name:"CloseCircleFilledIcon",props:{size:{type:String},onClick:{type:Function}},setup(r,n){var{attrs:o}=n,c=a((()=>r.size)),{className:l,style:i}=e(c),s=a((()=>["t-icon","t-icon-close-circle-filled",l.value])),u=a((()=>O(O({},i.value),o.style))),p=a((()=>({class:s.value,style:u.value,onClick:e=>{var t;return null===(t=r.onClick)||void 0===t?void 0:t.call(r,{e:e})}})));return()=>t(b,p.value)}});function g(e,t,r,o){var c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"value",a=i(),s=a.emit,u=a.vnode,p=l(),f=u.props||{},v=Object.prototype.hasOwnProperty.call(f,"modelValue")||Object.prototype.hasOwnProperty.call(f,"model-value"),y=Object.prototype.hasOwnProperty.call(f,c)||Object.prototype.hasOwnProperty.call(f,n(c));return v?[t,function(e){s("update:modelValue",e);for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];null==o||o.apply(void 0,[e].concat(r))}]:y?[e,function(e){s("update:".concat(c),e);for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];null==o||o.apply(void 0,[e].concat(r))}]:(p.value=r,[p,function(e){p.value=e;for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];null==o||o.apply(void 0,[e].concat(r))}])}var h=new Set,d={warn:function(e,t){console.warn("TDesign ".concat(e," Warn: ").concat(t))},warnOnce:function(e,t){var r="TDesign ".concat(e," Warn: ").concat(t);h.has(r)||(h.add(r),console.warn(r))},error:function(e,t){console.error("TDesign ".concat(e," Error: ").concat(t))},errorOnce:function(e,t){var r="TDesign ".concat(e," Error: ").concat(t);h.has(r)||(h.add(r),console.error(r))},info:function(e,t){console.info("TDesign ".concat(e," Info: ").concat(t))}},w=function(){var e=o();return a((function(){var t="".concat(e.value,"-form"),r="".concat(e.value,"-input"),n="".concat(e.value,"-is");return{form:t,label:"".concat(t,"__label"),labelTop:"".concat(t,"__label--top"),inline:"".concat(t,"-inline"),formItem:"".concat(t,"__item"),formItemWithHelp:"".concat(t,"__item-with-help"),formItemWithExtra:"".concat(t,"__item-with-extra"),controls:"".concat(t,"__controls"),controlsContent:"".concat(t,"__controls-content"),status:"".concat(t,"__status"),extra:"".concat(r,"__extra"),help:"".concat(r,"__help"),success:"".concat(n,"-success"),successBorder:"".concat(t,"--success-border"),error:"".concat(n,"-error"),warning:"".concat(n,"-warning")}}))},j=function(e){return e.TO_BE_VALIDATED="not",e.SUCCESS="success",e.FAIL="fail",e}(j||{}),P=Symbol("FormProvide"),_=Symbol("FormItemProvide");export{_ as F,j as V,s as _,P as a,v as b,m as c,w as d,d as l,g as u};
System.register(["./index-legacy-0dac1084.js","./vue-legacy-8b51572f.js"],(function(e,t){"use strict";var r,n,o,c,a,l,i,s,u;return{setters:[e=>{r=e.h,n=e.i,o=e.j,c=e.J,a=e.b},e=>{l=e.k,i=e.h,s=e.f,u=e.g}],execute:function(){function t(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function p(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?t(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):t(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}e({_:function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},c=Object.keys(e);for(n=0;n<c.length;n++)r=c[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(n=0;n<c.length;n++)r=c[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o},u:function(e,t,r,n){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"value",a=u(),l=a.emit,i=a.vnode,p=s(),f=i.props||{},y=Object.prototype.hasOwnProperty.call(f,"modelValue")||Object.prototype.hasOwnProperty.call(f,"model-value"),v=Object.prototype.hasOwnProperty.call(f,o)||Object.prototype.hasOwnProperty.call(f,c(o));return y?[t,function(e){l("update:modelValue",e);for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];null==n||n.apply(void 0,[e].concat(r))}]:v?[e,function(e){l("update:".concat(o),e);for(var t=arguments.length,r=new Array(t>1?t-1:0),c=1;c<t;c++)r[c-1]=arguments[c];null==n||n.apply(void 0,[e].concat(r))}]:(p.value=r,[p,function(e){p.value=e;for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];null==n||n.apply(void 0,[e].concat(r))}])}});var f={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M10.88 8a2.88 2.88 0 11-5.76 0 2.88 2.88 0 015.76 0zm-1 0a1.88 1.88 0 10-3.76 0 1.88 1.88 0 003.76 0z",fillOpacity:.9}},{tag:"path",attrs:{fill:"currentColor",d:"M1.12 8.23A7.72 7.72 0 008 12.5c2.9 0 5.54-1.63 6.88-4.27L15 8l-.12-.23A7.73 7.73 0 008 3.5a7.74 7.74 0 00-6.88 4.27L1 8l.12.23zM8 11.5A6.73 6.73 0 012.11 8 6.73 6.73 0 0113.9 8 6.74 6.74 0 018 11.5z",fillOpacity:.9}}]};function y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function v(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?y(Object(r),!0).forEach((function(t){o(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):y(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}e("b",l({name:"BrowseIcon",props:{size:{type:String},onClick:{type:Function}},setup(e,t){var{attrs:o}=t,c=i((()=>e.size)),{className:a,style:l}=r(c),s=i((()=>["t-icon","t-icon-browse",a.value])),u=i((()=>p(p({},l.value),o.style))),y=i((()=>({class:s.value,style:u.value,onClick:t=>{var r;return null===(r=e.onClick)||void 0===r?void 0:r.call(e,{e:t})}})));return()=>n(f,y.value)}}));var O={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M15 8A7 7 0 101 8a7 7 0 0014 0zM5.67 4.95L8 7.29l2.33-2.34.7.7L8.7 8l2.34 2.35-.71.7L8 8.71l-2.33 2.34-.7-.7L7.3 8 4.96 5.65l.71-.7z",fillOpacity:.9}}]};e("c",l({name:"CloseCircleFilledIcon",props:{size:{type:String},onClick:{type:Function}},setup(e,t){var{attrs:o}=t,c=i((()=>e.size)),{className:a,style:l}=r(c),s=i((()=>["t-icon","t-icon-close-circle-filled",a.value])),u=i((()=>v(v({},l.value),o.style))),p=i((()=>({class:s.value,style:u.value,onClick:t=>{var r;return null===(r=e.onClick)||void 0===r?void 0:r.call(e,{e:t})}})));return()=>n(O,p.value)}}));var b=new Set,g=(e("l",{warn:function(e,t){console.warn("TDesign ".concat(e," Warn: ").concat(t))},warnOnce:function(e,t){var r="TDesign ".concat(e," Warn: ").concat(t);b.has(r)||(b.add(r),console.warn(r))},error:function(e,t){console.error("TDesign ".concat(e," Error: ").concat(t))},errorOnce:function(e,t){var r="TDesign ".concat(e," Error: ").concat(t);b.has(r)||(b.add(r),console.error(r))},info:function(e,t){console.info("TDesign ".concat(e," Info: ").concat(t))}}),e("d",(function(){var e=a();return i((function(){var t="".concat(e.value,"-form"),r="".concat(e.value,"-input"),n="".concat(e.value,"-is");return{form:t,label:"".concat(t,"__label"),labelTop:"".concat(t,"__label--top"),inline:"".concat(t,"-inline"),formItem:"".concat(t,"__item"),formItemWithHelp:"".concat(t,"__item-with-help"),formItemWithExtra:"".concat(t,"__item-with-extra"),controls:"".concat(t,"__controls"),controlsContent:"".concat(t,"__controls-content"),status:"".concat(t,"__status"),extra:"".concat(r,"__extra"),help:"".concat(r,"__help"),success:"".concat(n,"-success"),successBorder:"".concat(t,"--success-border"),error:"".concat(n,"-error"),warning:"".concat(n,"-warning")}}))})),e("V",function(e){return e.TO_BE_VALIDATED="not",e.SUCCESS="success",e.FAIL="fail",e}(g||{})));e("a",Symbol("FormProvide")),e("F",Symbol("FormItemProvide"))}}}));
import{o as a,A as t,B as s,k as l,C as e,h as c,D as n,E as o,f as r,m as u,F as h,G as i,H as v,I as p,J as d,c as m,w as f,K as g,L as w,r as y,a as k}from"./vue-b5c0e5e9.js";import{u as F,M as x}from"./index-a8c47147.js";import{B as _}from"./index-89061701.js";const C={width:"35",height:"35",fill:"none",xmlns:"http://www.w3.org/2000/svg"},M=[s("path",{d:"M29.64 14.146c-2.49 0-4.913-.817-6.905-2.33v10.545c0 5.384-4.11 9.744-9.18 9.744-5.07 0-9.18-4.36-9.18-9.744 0-5.384 4.11-9.746 9.18-9.746.508 0 1 .043 1.479.128v5.585a3.905 3.905 0 0 0-1.44-.277c-2.263 0-4.099 1.947-4.099 4.35 0 2.4 1.836 4.348 4.098 4.348 2.26 0 4.095-1.949 4.095-4.348V1.458h5.12c0 4.025 3.076 7.288 6.87 7.288v5.396l-.037.002",fill:"#03FBFF"},null,-1),s("path",{d:"M30.59 15.58c-2.495 0-4.92-.818-6.907-2.327v10.544c0 5.384-4.11 9.745-9.18 9.745-5.069 0-9.179-4.36-9.179-9.745 0-5.384 4.11-9.745 9.18-9.745.507 0 1 .044 1.48.129v5.585a3.903 3.903 0 0 0-1.441-.277c-2.262 0-4.098 1.947-4.098 4.35 0 2.4 1.836 4.35 4.098 4.35 2.26 0 4.095-1.95 4.095-4.35V2.895h5.12c0 4.025 3.075 7.287 6.869 7.287v5.396l-.037.003Z",fill:"#FD1753"},null,-1)];const b={render:function(s,l){return a(),t("svg",C,M)}},B={width:"45",height:"45",fill:"none",xmlns:"http://www.w3.org/2000/svg"},V=[s("circle",{cx:"22.5",cy:"22.5",r:"22.5",fill:"#393939"},null,-1),s("path",{d:"M34.64 19.146c-2.49 0-4.913-.817-6.905-2.33v10.545c0 5.384-4.11 9.744-9.18 9.744-5.07 0-9.18-4.36-9.18-9.744 0-5.384 4.11-9.746 9.18-9.746.508 0 1 .043 1.479.128v5.585a3.905 3.905 0 0 0-1.44-.277c-2.263 0-4.099 1.947-4.099 4.35 0 2.4 1.836 4.348 4.098 4.348 2.26 0 4.095-1.949 4.095-4.348V6.458h5.12c0 4.025 3.076 7.288 6.87 7.288v5.396l-.037.002",fill:"#03FBFF"},null,-1),s("path",{d:"M35.59 20.58c-2.495 0-4.92-.817-6.907-2.327v10.544c0 5.384-4.11 9.745-9.18 9.745-5.069 0-9.178-4.36-9.178-9.745 0-5.384 4.109-9.745 9.178-9.745.508 0 1 .044 1.48.129v5.585a3.902 3.902 0 0 0-1.44-.277c-2.262 0-4.098 1.947-4.098 4.35 0 2.4 1.836 4.35 4.098 4.35 2.26 0 4.095-1.95 4.095-4.35V7.895h5.12c0 4.025 3.075 7.287 6.869 7.287v5.396l-.037.003Z",fill:"#FD1753"},null,-1)];const j={render:function(s,l){return a(),t("svg",B,V)}},D={class:"custom-layout-head"},A={class:"layout-head-left"},G=s("span",null,"AI",-1),I=["onClick"],T={class:"layout-head-right"},Z=l({__name:"header",setup(l){const y=e(),k=c((()=>y.getters["user/token"])),C=n(),M=o(),B=r(C.path),V=[{label:"图片生成",path:"/"},{label:"GPT对话",path:"/gpt"}],Z=async()=>{try{0==(await F()).code&&(y.commit("user/removeToken"),x.success("退出成功"),M.replace({path:"/"}))}catch(a){console.log(a)}};return(l,e)=>(a(),t("div",D,[s("div",A,[u(h(b)),G,(a(),t(i,null,v(V,(a=>s("div",{class:p(["layout-chose-button",{active:a.path===h(B)}]),key:a.path,onClick:t=>(a=>{B.value=a.path,M.replace({path:a.path})})(a)},d(a.label),11,I))),64))]),s("div",T,[h(k)?(a(),m(h(_),{key:0,class:"logout",onClick:Z},{default:f((()=>[g(" 退出 ")])),_:1})):w("",!0),u(h(j))])]))}}),E={class:"custom-layout"},H={class:"custom-content"},J=l({__name:"content",setup(l){const e=n();return(l,c)=>{const n=y("router-view");return a(),t("div",E,[h(e).meta.header?(a(),m(Z,{key:0})):w("",!0),s("div",H,[u(n,null,{default:f((({Component:t})=>[(a(),m(k(t)))])),_:1})])])}}});export{J as default};
System.register(["./vue-legacy-8b51572f.js","./index-legacy-0dac1084.js","./index-legacy-9092dd76.js"],(function(t,e){"use strict";var l,c,a,n,s,u,o,r,h,i,v,d,p,g,f,y,m,w,k,F,x,_,C,M;return{setters:[t=>{l=t.o,c=t.A,a=t.B,n=t.k,s=t.C,u=t.h,o=t.D,r=t.E,h=t.f,i=t.m,v=t.F,d=t.G,p=t.H,g=t.I,f=t.J,y=t.c,m=t.w,w=t.K,k=t.L,F=t.r,x=t.a},t=>{_=t.u,C=t.M},t=>{M=t.B}],execute:function(){const e={width:"35",height:"35",fill:"none",xmlns:"http://www.w3.org/2000/svg"},b=[a("path",{d:"M29.64 14.146c-2.49 0-4.913-.817-6.905-2.33v10.545c0 5.384-4.11 9.744-9.18 9.744-5.07 0-9.18-4.36-9.18-9.744 0-5.384 4.11-9.746 9.18-9.746.508 0 1 .043 1.479.128v5.585a3.905 3.905 0 0 0-1.44-.277c-2.263 0-4.099 1.947-4.099 4.35 0 2.4 1.836 4.348 4.098 4.348 2.26 0 4.095-1.949 4.095-4.348V1.458h5.12c0 4.025 3.076 7.288 6.87 7.288v5.396l-.037.002",fill:"#03FBFF"},null,-1),a("path",{d:"M30.59 15.58c-2.495 0-4.92-.818-6.907-2.327v10.544c0 5.384-4.11 9.745-9.18 9.745-5.069 0-9.179-4.36-9.179-9.745 0-5.384 4.11-9.745 9.18-9.745.507 0 1 .044 1.48.129v5.585a3.903 3.903 0 0 0-1.441-.277c-2.262 0-4.098 1.947-4.098 4.35 0 2.4 1.836 4.35 4.098 4.35 2.26 0 4.095-1.95 4.095-4.35V2.895h5.12c0 4.025 3.075 7.287 6.869 7.287v5.396l-.037.003Z",fill:"#FD1753"},null,-1)],B={render:function(t,a){return l(),c("svg",e,b)}},V={width:"45",height:"45",fill:"none",xmlns:"http://www.w3.org/2000/svg"},j=[a("circle",{cx:"22.5",cy:"22.5",r:"22.5",fill:"#393939"},null,-1),a("path",{d:"M34.64 19.146c-2.49 0-4.913-.817-6.905-2.33v10.545c0 5.384-4.11 9.744-9.18 9.744-5.07 0-9.18-4.36-9.18-9.744 0-5.384 4.11-9.746 9.18-9.746.508 0 1 .043 1.479.128v5.585a3.905 3.905 0 0 0-1.44-.277c-2.263 0-4.099 1.947-4.099 4.35 0 2.4 1.836 4.348 4.098 4.348 2.26 0 4.095-1.949 4.095-4.348V6.458h5.12c0 4.025 3.076 7.288 6.87 7.288v5.396l-.037.002",fill:"#03FBFF"},null,-1),a("path",{d:"M35.59 20.58c-2.495 0-4.92-.817-6.907-2.327v10.544c0 5.384-4.11 9.745-9.18 9.745-5.069 0-9.178-4.36-9.178-9.745 0-5.384 4.109-9.745 9.178-9.745.508 0 1 .044 1.48.129v5.585a3.902 3.902 0 0 0-1.44-.277c-2.262 0-4.098 1.947-4.098 4.35 0 2.4 1.836 4.35 4.098 4.35 2.26 0 4.095-1.95 4.095-4.35V7.895h5.12c0 4.025 3.075 7.287 6.869 7.287v5.396l-.037.003Z",fill:"#FD1753"},null,-1)],D={render:function(t,e){return l(),c("svg",V,j)}},A={class:"custom-layout-head"},G={class:"layout-head-left"},I=a("span",null,"AI",-1),T=["onClick"],Z={class:"layout-head-right"},E=n({__name:"header",setup(t){const e=s(),n=u((()=>e.getters["user/token"])),F=o(),x=r(),b=h(F.path),V=[{label:"图片生成",path:"/"},{label:"GPT对话",path:"/gpt"}],j=async()=>{try{0==(await _()).code&&(e.commit("user/removeToken"),C.success("退出成功"),x.replace({path:"/"}))}catch(t){console.log(t)}};return(t,e)=>(l(),c("div",A,[a("div",G,[i(v(B)),I,(l(),c(d,null,p(V,(t=>a("div",{class:g(["layout-chose-button",{active:t.path===v(b)}]),key:t.path,onClick:e=>(t=>{b.value=t.path,x.replace({path:t.path})})(t)},f(t.label),11,T))),64))]),a("div",Z,[v(n)?(l(),y(v(M),{key:0,class:"logout",onClick:j},{default:m((()=>[w(" 退出 ")])),_:1})):k("",!0),i(v(D))])]))}}),H={class:"custom-layout"},J={class:"custom-content"};t("default",n({__name:"content",setup(t){const e=o();return(t,n)=>{const s=F("router-view");return l(),c("div",H,[v(e).meta.header?(l(),y(E,{key:0})):k("",!0),a("div",J,[i(s,null,{default:m((({Component:t})=>[(l(),y(x(t)))])),_:1})])])}}}))}}}));
This source diff could not be displayed because it is too large. You can view the blob instead.
function e(){import("data:text/javascript,")}import{c as r,w as o,r as t,o as n,a as i,b as s}from"./vue-b5c0e5e9.js";import{r as c,g as a,s as l}from"./index-a8c47147.js";import{_ as u}from"./_plugin-vue_export-helper-1b428a4d.js";!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))r(e);new MutationObserver((e=>{for(const o of e)if("childList"===o.type)for(const e of o.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&r(e)})).observe(document,{childList:!0,subtree:!0})}function r(e){if(e.ep)return;e.ep=!0;const r=function(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerpolicy&&(r.referrerPolicy=e.referrerpolicy),"use-credentials"===e.crossorigin?r.credentials="include":"anonymous"===e.crossorigin?r.credentials="omit":r.credentials="same-origin",r}(e);fetch(e.href,r)}}();const d=u({},[["render",function(e,s){const c=t("router-view");return n(),r(c,null,{default:o((({Component:e})=>[(n(),r(i(e)))])),_:1})}]]);c.beforeEach(((e,r,o)=>{if("login"==e.name)return void o();a()?o():o("/login")}));const f=s(d);f.use(c),f.use(l),f.mount("#app");export{e as __vite_legacy_guard};
import{E as e,a as t,b as n,c as a,d as o,e as r,_ as i,L as l,f as u,w as c}from"./index-a8c47147.js";import{f as s,l as d,M as v,h as p,i as f,g,k as b,m,j as y}from"./vue-b5c0e5e9.js";var h={block:Boolean,content:{type:[String,Function]},default:{type:[String,Function]},disabled:Boolean,ghost:Boolean,href:{type:String,default:""},icon:{type:Function},loading:Boolean,shape:{type:String,default:"rectangle",validator:function(e){return!e||["rectangle","square","round","circle"].includes(e)}},size:{type:String,default:"medium",validator:function(e){return!e||["small","medium","large"].includes(e)}},suffix:{type:Function},tag:{type:String,validator:function(e){return!e||["button","a","div"].includes(e)}},theme:{type:String,validator:function(e){return!e||["default","primary","danger","warning","success"].includes(e)}},type:{type:String,default:"button",validator:function(e){return!e||["submit","reset","button"].includes(e)}},variant:{type:String,default:"base",validator:function(e){return!e||["base","outline","dashed","text"].includes(e)}},onClick:Function},x=e.expand,k=e.ripple,O=e.fade;function S(e,t){Object.keys(t).forEach((function(n){e.style[n]=t[n]}))}function j(e,a){var o,r,i=s(null),l=n(),u=(o=t("animation").globalConfig,{keepExpand:(r=function(e){var t,n,a=o.value;return a&&!(null!==(t=a.exclude)&&void 0!==t&&t.includes(e))&&(null===(n=a.include)||void 0===n?void 0:n.includes(e))})(x),keepRipple:r(k),keepFade:r(O)}).keepRipple,c=function(t){var n=e.value,o=function(e,t){var n;if(t)return t;if(null!=e&&null!==(n=e.dataset)&&void 0!==n&&n.ripple)return e.dataset.ripple;var a=getComputedStyle(e).getPropertyValue("--ripple-color");return a||"rgba(0, 0, 0, 0.35)"}(n,null==a?void 0:a.value);if(0===t.button&&e&&u&&!(n.classList.contains("".concat(l.value,"-is-active"))||n.classList.contains("".concat(l.value,"-is-disabled"))||n.classList.contains("".concat(l.value,"-is-checked"))||n.classList.contains("".concat(l.value,"-is-loading")))){var r=getComputedStyle(n),c=parseInt(r.borderWidth,10),s=c>0?c:0,d=n.offsetWidth,v=n.offsetHeight;null===i.value.parentNode&&(S(i.value,{position:"absolute",left:"".concat(0-s,"px"),top:"".concat(0-s,"px"),width:"".concat(d,"px"),height:"".concat(v,"px"),borderRadius:r.borderRadius,pointerEvents:"none",overflow:"hidden"}),n.appendChild(i.value));var p=document.createElement("div");S(p,{marginTop:"0",marginLeft:"0",right:"".concat(d,"px"),width:"".concat(d+20,"px"),height:"100%",transition:"transform ".concat(200,"ms cubic-bezier(.38, 0, .24, 1), background ").concat(400,"ms linear"),transform:"skewX(-8deg)",pointerEvents:"none",position:"absolute",zIndex:0,backgroundColor:o,opacity:"0.9"});for(var f=new WeakMap,g=n.children.length,b=0;b<g;++b){var m=n.children[b];""===m.style.zIndex&&m!==i.value&&(m.style.zIndex="1",f.set(m,!0))}var y=n.style.position?n.style.position:getComputedStyle(n).position;""!==y&&"static"!==y||(n.style.position="relative"),i.value.insertBefore(p,i.value.firstChild),setTimeout((function(){p.style.transform="translateX(".concat(d,"px)")}),0);var h=function t(){p.style.backgroundColor="rgba(0, 0, 0, 0)",e.value&&(e.value.removeEventListener("pointerup",t,!1),e.value.removeEventListener("pointerleave",t,!1),setTimeout((function(){p.remove(),0===i.value.children.length&&i.value.remove()}),500))};e.value.addEventListener("pointerup",h,!1),e.value.addEventListener("pointerleave",h,!1)}};d((function(){var t=null==e?void 0:e.value;t&&(i.value=document.createElement("div"),t.addEventListener("pointerdown",c,!1))})),v((function(){var t;null==e||null===(t=e.value)||void 0===t||t.removeEventListener("pointerdown",c,!1)}))}function E(e){var t=g(),n=p((function(){return t.props.disabled})),a=f("formDisabled",Object.create(null)).disabled;return p((function(){return n.value||(null==a?void 0:a.value)||(null==e?void 0:e.value)||!1}))}function w(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function C(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?w(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var L=c(b({name:"TButton",props:h,setup:function(e,t){var c=t.attrs,d=t.slots,v=a(),f=o(),g=n("button"),b=r(),h=b.STATUS,x=b.SIZE,k=E(),O=s();j(O);var S=p((function(){return e.disabled||e.loading||k.value})),w=p((function(){var t=e.theme,n=e.variant;return t||("base"===n?"primary":"default")})),L=p((function(){var t;return["".concat(g.value),"".concat(g.value,"--variant-").concat(e.variant),"".concat(g.value,"--theme-").concat(w.value),(t={},i(t,x.value[e.size],"medium"!==e.size),i(t,h.value.disabled,e.disabled||k.value),i(t,h.value.loading,e.loading),i(t,"".concat(g.value,"--shape-").concat(e.shape),"rectangle"!==e.shape),i(t,"".concat(g.value,"--ghost"),e.ghost),i(t,x.value.block,e.block),t)]}));return function(){var t=f("default","content"),n=e.loading?m(l,{inheritColor:!0},null):v("icon"),a=n&&!t,o=e.suffix||d.suffix?m("span",{className:"".concat(g.value,"__suffix")},[v("suffix")]):null;t=t?m("span",{class:"".concat(g.value,"__text")},[t]):"",n&&(t=[n,t]),o&&(t=[t].concat(o));var r={class:[].concat(u(L.value),[i({},"".concat(g.value,"--icon-only"),a)]),type:e.type,disabled:S.value,href:e.href};return y(!e.tag&&e.href?"a":e.tag||"button",C(C(C({ref:O},c),r),{},{onClick:e.onClick}),[t])}}}));export{L as B,E as u};
System.register(["./index-legacy-0dac1084.js","./vue-legacy-8b51572f.js"],(function(e,t){"use strict";var n,a,r,o,i,l,u,c,s,d,v,p,f,g,b,y,m,h,x;return{setters:[e=>{n=e.E,a=e.a,r=e.b,o=e.c,i=e.d,l=e.e,u=e._,c=e.L,s=e.f,d=e.w},e=>{v=e.f,p=e.l,f=e.M,g=e.h,b=e.i,y=e.g,m=e.k,h=e.m,x=e.j}],execute:function(){e("u",w);var t={block:Boolean,content:{type:[String,Function]},default:{type:[String,Function]},disabled:Boolean,ghost:Boolean,href:{type:String,default:""},icon:{type:Function},loading:Boolean,shape:{type:String,default:"rectangle",validator:function(e){return!e||["rectangle","square","round","circle"].includes(e)}},size:{type:String,default:"medium",validator:function(e){return!e||["small","medium","large"].includes(e)}},suffix:{type:Function},tag:{type:String,validator:function(e){return!e||["button","a","div"].includes(e)}},theme:{type:String,validator:function(e){return!e||["default","primary","danger","warning","success"].includes(e)}},type:{type:String,default:"button",validator:function(e){return!e||["submit","reset","button"].includes(e)}},variant:{type:String,default:"base",validator:function(e){return!e||["base","outline","dashed","text"].includes(e)}},onClick:Function},k=n.expand,O=n.ripple,S=n.fade;function j(e,t){Object.keys(t).forEach((function(n){e.style[n]=t[n]}))}function E(e,t){var n,o,i=v(null),l=r(),u=(n=a("animation").globalConfig,{keepExpand:(o=function(e){var t,a,r=n.value;return r&&!(null!==(t=r.exclude)&&void 0!==t&&t.includes(e))&&(null===(a=r.include)||void 0===a?void 0:a.includes(e))})(k),keepRipple:o(O),keepFade:o(S)}).keepRipple,c=function(n){var a=e.value,r=function(e,t){var n;if(t)return t;if(null!=e&&null!==(n=e.dataset)&&void 0!==n&&n.ripple)return e.dataset.ripple;var a=getComputedStyle(e).getPropertyValue("--ripple-color");return a||"rgba(0, 0, 0, 0.35)"}(a,null==t?void 0:t.value);if(0===n.button&&e&&u&&!(a.classList.contains("".concat(l.value,"-is-active"))||a.classList.contains("".concat(l.value,"-is-disabled"))||a.classList.contains("".concat(l.value,"-is-checked"))||a.classList.contains("".concat(l.value,"-is-loading")))){var o=getComputedStyle(a),c=parseInt(o.borderWidth,10),s=c>0?c:0,d=a.offsetWidth,v=a.offsetHeight;null===i.value.parentNode&&(j(i.value,{position:"absolute",left:"".concat(0-s,"px"),top:"".concat(0-s,"px"),width:"".concat(d,"px"),height:"".concat(v,"px"),borderRadius:o.borderRadius,pointerEvents:"none",overflow:"hidden"}),a.appendChild(i.value));var p=document.createElement("div");j(p,{marginTop:"0",marginLeft:"0",right:"".concat(d,"px"),width:"".concat(d+20,"px"),height:"100%",transition:"transform ".concat(200,"ms cubic-bezier(.38, 0, .24, 1), background ").concat(400,"ms linear"),transform:"skewX(-8deg)",pointerEvents:"none",position:"absolute",zIndex:0,backgroundColor:r,opacity:"0.9"});for(var f=new WeakMap,g=a.children.length,b=0;b<g;++b){var y=a.children[b];""===y.style.zIndex&&y!==i.value&&(y.style.zIndex="1",f.set(y,!0))}var m=a.style.position?a.style.position:getComputedStyle(a).position;""!==m&&"static"!==m||(a.style.position="relative"),i.value.insertBefore(p,i.value.firstChild),setTimeout((function(){p.style.transform="translateX(".concat(d,"px)")}),0);var h=function t(){p.style.backgroundColor="rgba(0, 0, 0, 0)",e.value&&(e.value.removeEventListener("pointerup",t,!1),e.value.removeEventListener("pointerleave",t,!1),setTimeout((function(){p.remove(),0===i.value.children.length&&i.value.remove()}),500))};e.value.addEventListener("pointerup",h,!1),e.value.addEventListener("pointerleave",h,!1)}};p((function(){var t=null==e?void 0:e.value;t&&(i.value=document.createElement("div"),t.addEventListener("pointerdown",c,!1))})),f((function(){var t;null==e||null===(t=e.value)||void 0===t||t.removeEventListener("pointerdown",c,!1)}))}function w(e){var t=y(),n=g((function(){return t.props.disabled})),a=b("formDisabled",Object.create(null)).disabled;return g((function(){return n.value||(null==a?void 0:a.value)||(null==e?void 0:e.value)||!1}))}function C(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function L(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?C(Object(n),!0).forEach((function(t){u(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var P=m({name:"TButton",props:t,setup:function(e,t){var n=t.attrs,a=t.slots,d=o(),p=i(),f=r("button"),b=l(),y=b.STATUS,m=b.SIZE,k=w(),O=v();E(O);var S=g((function(){return e.disabled||e.loading||k.value})),j=g((function(){var t=e.theme,n=e.variant;return t||("base"===n?"primary":"default")})),C=g((function(){var t;return["".concat(f.value),"".concat(f.value,"--variant-").concat(e.variant),"".concat(f.value,"--theme-").concat(j.value),(t={},u(t,m.value[e.size],"medium"!==e.size),u(t,y.value.disabled,e.disabled||k.value),u(t,y.value.loading,e.loading),u(t,"".concat(f.value,"--shape-").concat(e.shape),"rectangle"!==e.shape),u(t,"".concat(f.value,"--ghost"),e.ghost),u(t,m.value.block,e.block),t)]}));return function(){var t=p("default","content"),r=e.loading?h(c,{inheritColor:!0},null):d("icon"),o=r&&!t,i=e.suffix||a.suffix?h("span",{className:"".concat(f.value,"__suffix")},[d("suffix")]):null;t=t?h("span",{class:"".concat(f.value,"__text")},[t]):"",r&&(t=[r,t]),i&&(t=[t].concat(i));var l={class:[].concat(s(C.value),[u({},"".concat(f.value,"--icon-only"),o)]),type:e.type,disabled:S.value,href:e.href};return x(!e.tag&&e.href?"a":e.tag||"button",L(L(L({ref:O},n),l),{},{onClick:e.onClick}),[t])}}});e("B",d(P))}}}));
System.register(["./vue-legacy-8b51572f.js","./index-legacy-0dac1084.js","./_plugin-vue_export-helper-legacy-762b7923.js"],(function(e,n){"use strict";var t,r,u,o,s,c,i,l,a,g;return{setters:[e=>{t=e.c,r=e.w,u=e.r,o=e.o,s=e.a,c=e.b},e=>{i=e.r,l=e.g,a=e.s},e=>{g=e._}],execute:function(){const e=g({},[["render",function(e,n){const c=u("router-view");return o(),t(c,null,{default:r((({Component:e})=>[(o(),t(s(e)))])),_:1})}]]);i.beforeEach(((e,n,t)=>{"login"!=e.name?l()?t():t("/login"):t()}));const n=c(e);n.use(i),n.use(a),n.mount("#app")}}}));
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/logo.svg" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"
/>
<title>GPT</title>
<script type="module" crossorigin src="/assets/index-6239f49c.js"></script>
<link rel="modulepreload" crossorigin href="/assets/vue-b5c0e5e9.js">
<link rel="modulepreload" crossorigin href="/assets/index-a8c47147.js">
<link rel="modulepreload" crossorigin href="/assets/_plugin-vue_export-helper-1b428a4d.js">
<link rel="stylesheet" href="/assets/style-4c8e809c.css">
<script type="module">try{import.meta.url;import("_").catch(()=>1);}catch(e){}window.__vite_is_modern_browser=true;</script>
<script type="module">!function(){if(window.__vite_is_modern_browser)return;console.warn("vite: loading legacy build because dynamic import or import.meta.url is unsupported, syntax error above should be ignored");var e=document.getElementById("vite-legacy-polyfill"),n=document.createElement("script");n.src=e.src,n.onload=function(){System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))},document.body.appendChild(n)}();</script>
</head>
<body>
<div id="app"></div>
<script nomodule>!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",(function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()}),!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script>
<script nomodule crossorigin id="vite-legacy-polyfill" src="/assets/polyfills-legacy-61159727.js"></script>
<script nomodule crossorigin id="vite-legacy-entry" data-src="/assets/index-legacy-c99e7d03.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
</body>
</html>
192.168.1.1:3000
\ No newline at end of file
<svg width="23" height="26" viewBox="0 0 23 26" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M11.5919 0.5C11.9687 0.5 12.2741 0.800513 12.2741 1.17121V5.57183L14.6679 3.2164C14.9342 2.95427 15.3662 2.95427 15.6325 3.2164C15.8989 3.47853 15.8989 3.90352 15.6325 4.16564L12.2741 7.47031V11.8362L16.1225 9.64986L17.3502 5.14146C17.4477 4.78339 17.8218 4.5709 18.1857 4.66684C18.5496 4.76279 18.7655 5.13084 18.668 5.48891L17.7934 8.70062L21.6627 6.50246C21.989 6.31711 22.4062 6.4271 22.5946 6.74814C22.7829 7.06918 22.6711 7.47969 22.3449 7.66504L18.4718 9.86535L21.7417 10.7275C22.1056 10.8234 22.3216 11.1915 22.2241 11.5496C22.1266 11.9076 21.7525 12.1201 21.3886 12.0242L16.8009 10.8146L12.9584 12.9975L16.8069 15.1838L21.3886 13.9758C21.7525 13.8799 22.1266 14.0924 22.2241 14.4504C22.3216 14.8085 22.1056 15.1766 21.7417 15.2725L18.4778 16.1331L22.3471 18.3312C22.6733 18.5166 22.7851 18.9271 22.5967 19.2481C22.4084 19.5692 21.9912 19.6792 21.6649 19.4938L17.7918 17.2935L18.668 20.5111C18.7655 20.8692 18.5496 21.2372 18.1857 21.3332C17.8218 21.4291 17.4477 21.2166 17.3502 20.8585L16.1209 16.3443L12.2741 14.1589V18.5407L15.6325 21.8454C15.8989 22.1075 15.8989 22.5325 15.6325 22.7946C15.3662 23.0567 14.9342 23.0567 14.6679 22.7946L12.2741 20.4392V24.8288C12.2741 25.1995 11.9687 25.5 11.5919 25.5C11.2152 25.5 10.9098 25.1995 10.9098 24.8288V20.4435L8.52039 22.7946C8.254 23.0567 7.82209 23.0567 7.5557 22.7946C7.28931 22.5325 7.28931 22.1075 7.5557 21.8454L10.9098 18.545V14.1613L7.05762 16.3498L5.82833 20.864C5.73083 21.2221 5.35678 21.4346 4.99288 21.3387C4.62899 21.2427 4.41303 20.8747 4.51054 20.5166L5.38672 17.299L1.52332 19.4938C1.19706 19.6792 0.779871 19.5692 0.591504 19.2481C0.403136 18.9271 0.514921 18.5166 0.841184 18.3312L4.7008 16.1386L1.43681 15.278C1.07291 15.1821 0.856957 14.814 0.954464 14.4559C1.05197 14.0979 1.42601 13.8854 1.78991 13.9813L6.3717 15.1893L10.2298 12.9975L6.37765 10.8091L1.78991 12.0187C1.42601 12.1146 1.05197 11.9021 0.95446 11.5441C0.856953 11.186 1.07291 10.8179 1.43681 10.722L4.70676 9.85984L0.843363 7.66504C0.517099 7.47969 0.405314 7.06918 0.593682 6.74814C0.78205 6.4271 1.19924 6.31711 1.5255 6.50246L5.38512 8.69512L4.51054 5.4834C4.41303 5.12533 4.62898 4.75728 4.99288 4.66134C5.35678 4.56539 5.73083 4.77789 5.82833 5.13596L7.05602 9.64436L10.9098 11.8337V7.46602L7.5557 4.16564C7.28931 3.90352 7.28931 3.47853 7.5557 3.2164C7.82209 2.95427 8.254 2.95427 8.52039 3.2164L10.9098 5.56754V1.17121C10.9098 0.800513 11.2152 0.5 11.5919 0.5Z" fill="#2962FF"/>
</svg>
\ No newline at end of file
const path = require('path');
const express = require('express');
const { createProxyMiddleware } = require('http-proxy-middleware');
// const history = require('connect-history-api-fallback');
const app = express();
// 处理单页应用路由
// app.use(history());
// 代理对象地址
// 读取本地配置的ip
app.use(
'/video',
createProxyMiddleware({
target: 'http://192.168.1.19:5000',
changeOrigin: true,
// pathRewrite: {
// '^api': '',
// },
})
);
// 加载静态资源
app.use(express.static('./dist'));
// 启动服务
app.listen(3001, () => {
console.log('success => http://localhost:3001');
});
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
"@vitejs/plugin-legacy": "^3.0.1", "@vitejs/plugin-legacy": "^3.0.1",
"@vitejs/plugin-vue-jsx": "^3.0.0", "@vitejs/plugin-vue-jsx": "^3.0.0",
"dayjs": "^1.11.7", "dayjs": "^1.11.7",
"event-source-polyfill": "^1.0.31",
"js-cookie": "^3.0.1", "js-cookie": "^3.0.1",
"tdesign-icons-vue-next": "^0.1.7", "tdesign-icons-vue-next": "^0.1.7",
"tdesign-vue-next": "^1.0.5", "tdesign-vue-next": "^1.0.5",
...@@ -21,6 +22,7 @@ ...@@ -21,6 +22,7 @@
"vuex": "^4.1.0" "vuex": "^4.1.0"
}, },
"devDependencies": { "devDependencies": {
"@types/event-source-polyfill": "^1.0.1",
"@types/js-cookie": "^3.0.2", "@types/js-cookie": "^3.0.2",
"@types/node": "^18.11.15", "@types/node": "^18.11.15",
"@types/uuid": "^9.0.0", "@types/uuid": "^9.0.0",
...@@ -881,6 +883,12 @@ ...@@ -881,6 +883,12 @@
"node": ">=10.13.0" "node": ">=10.13.0"
} }
}, },
"node_modules/@types/event-source-polyfill": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@types/event-source-polyfill/-/event-source-polyfill-1.0.1.tgz",
"integrity": "sha512-dls8b0lUgJ/miRApF0efboQ9QZnAm7ofTO6P1ILu8bRPxUFKDxVwFf8+TeuuErmNui6blpltyr7+eV72dbQXlQ==",
"dev": true
},
"node_modules/@types/http-proxy": { "node_modules/@types/http-proxy": {
"version": "1.17.9", "version": "1.17.9",
"resolved": "https://registry.npmjs.org/@types/http-proxy/-/http-proxy-1.17.9.tgz", "resolved": "https://registry.npmjs.org/@types/http-proxy/-/http-proxy-1.17.9.tgz",
...@@ -2132,6 +2140,11 @@ ...@@ -2132,6 +2140,11 @@
"node": ">= 0.6" "node": ">= 0.6"
} }
}, },
"node_modules/event-source-polyfill": {
"version": "1.0.31",
"resolved": "https://registry.npmjs.org/event-source-polyfill/-/event-source-polyfill-1.0.31.tgz",
"integrity": "sha512-4IJSItgS/41IxN5UVAVuAyczwZF7ZIEsM1XAoUzIHA6A+xzusEZUutdXz2Nr+MQPLxfTiCvqE79/C8HT8fKFvA=="
},
"node_modules/eventemitter3": { "node_modules/eventemitter3": {
"version": "4.0.7", "version": "4.0.7",
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz",
...@@ -4785,6 +4798,12 @@ ...@@ -4785,6 +4798,12 @@
"integrity": "sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA==", "integrity": "sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA==",
"dev": true "dev": true
}, },
"@types/event-source-polyfill": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@types/event-source-polyfill/-/event-source-polyfill-1.0.1.tgz",
"integrity": "sha512-dls8b0lUgJ/miRApF0efboQ9QZnAm7ofTO6P1ILu8bRPxUFKDxVwFf8+TeuuErmNui6blpltyr7+eV72dbQXlQ==",
"dev": true
},
"@types/http-proxy": { "@types/http-proxy": {
"version": "1.17.9", "version": "1.17.9",
"resolved": "https://registry.npmjs.org/@types/http-proxy/-/http-proxy-1.17.9.tgz", "resolved": "https://registry.npmjs.org/@types/http-proxy/-/http-proxy-1.17.9.tgz",
...@@ -5761,6 +5780,11 @@ ...@@ -5761,6 +5780,11 @@
"integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==",
"dev": true "dev": true
}, },
"event-source-polyfill": {
"version": "1.0.31",
"resolved": "https://registry.npmjs.org/event-source-polyfill/-/event-source-polyfill-1.0.31.tgz",
"integrity": "sha512-4IJSItgS/41IxN5UVAVuAyczwZF7ZIEsM1XAoUzIHA6A+xzusEZUutdXz2Nr+MQPLxfTiCvqE79/C8HT8fKFvA=="
},
"eventemitter3": { "eventemitter3": {
"version": "4.0.7", "version": "4.0.7",
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz",
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
"@vitejs/plugin-legacy": "^3.0.1", "@vitejs/plugin-legacy": "^3.0.1",
"@vitejs/plugin-vue-jsx": "^3.0.0", "@vitejs/plugin-vue-jsx": "^3.0.0",
"dayjs": "^1.11.7", "dayjs": "^1.11.7",
"event-source-polyfill": "^1.0.31",
"js-cookie": "^3.0.1", "js-cookie": "^3.0.1",
"tdesign-icons-vue-next": "^0.1.7", "tdesign-icons-vue-next": "^0.1.7",
"tdesign-vue-next": "^1.0.5", "tdesign-vue-next": "^1.0.5",
...@@ -25,6 +26,7 @@ ...@@ -25,6 +26,7 @@
"vuex": "^4.1.0" "vuex": "^4.1.0"
}, },
"devDependencies": { "devDependencies": {
"@types/event-source-polyfill": "^1.0.1",
"@types/js-cookie": "^3.0.2", "@types/js-cookie": "^3.0.2",
"@types/node": "^18.11.15", "@types/node": "^18.11.15",
"@types/uuid": "^9.0.0", "@types/uuid": "^9.0.0",
......
...@@ -36,9 +36,21 @@ const router = useRouter(); ...@@ -36,9 +36,21 @@ const router = useRouter();
const currentBtn = ref(route.path); const currentBtn = ref(route.path);
const btns = [ const btns = [
{ {
label: '图片生成', label: '图片生成_自动化',
path: '/', path: '/',
}, },
// {
// label: 'GPT对话',
// path: '/gpt',
// },
{
label: '图片生成',
path: '/image',
},
{
label: '图片生成stable',
path: '/Image_stable',
},
]; ];
const logout = async () => { const logout = async () => {
try { try {
......
<template>
<div class="custom-gpt-page">
<div class="message-box"></div>
<div class="input">
<t-input v-model="gpt_input"></t-input>
<t-button @click="submit">发送</t-button>
</div>
</div>
</template>
<script lang="ts" setup>
import { Input as TInput, Button as TButton } from 'tdesign-vue-next';
import { EventSourcePolyfill } from 'event-source-polyfill';
import { submitmessage } from '@/utils/api/gpt';
import { getUserCookie } from '@/utils/api/userApi';
import { ref } from 'vue';
const gpt_input = ref('');
// 提交消息
const submit = async () => {
try {
let res: any = await submitmessage({
prompt: gpt_input.value,
regen: false,
});
if (res.code == 0 && res.data.chat_id) {
console.log('发送成功');
// 发起会话
const eventSource = new EventSourcePolyfill(
`/api/gpt/stream?chat_id=${res.data.chat_id}`,
{
headers: {
authorization: `Bearer ${getUserCookie()}`,
},
}
);
eventSource.onmessage = function (e: any) {
if (e.data == '[DONE]') {
eventSource.close();
} else {
let word = JSON.parse(e.data).choices[0].delta.content;
if (word !== undefined) {
console.log(word);
}
}
};
eventSource.onerror = function (e: any) {
console.log(e);
eventSource.close();
console.log('报错了');
};
}
} catch (e) {
console.log(e);
}
};
</script>
<style lang="less">
.custom-gpt-page {
padding: 40px;
box-sizing: border-box;
.message-box {
}
.input {
display: flex;
& > :nth-child(2) {
margin-left: 12px;
}
}
}
</style>
<template>
<t-dialog
v-model:visible="visible"
attach="body"
placement="center"
:footer="false"
class="custom-img-dialog"
>
<template #header>
<div>请耐心等待图片生成</div>
</template>
<template #body>
<div class="custom-dialog-body">
<div class="content narrow-scrollbar">
<div v-for="(item, index) in list" :key="item.id">
<div class="img-box">
<img class="img" :src="item.img" alt="" />
<template v-if="item.split_img">
<img class="split-img img" :src="item.split_img" alt="" />
</template>
<template v-else-if="item.loading">
<div class="split_img_loading">
<t-loading size="24px"></t-loading>
</div>
</template>
</div>
<div class="btns">
<t-button
v-for="it in btns"
:key="it.value"
@click="to_split(item.id, it.value, index)"
>{{ it.label }}</t-button
>
</div>
<div>
---------------------------------------------------------------
</div>
</div>
</div>
<Animation v-show="dialogloading"></Animation>
</div>
</template>
</t-dialog>
</template>
<script lang="ts" setup>
import {
Dialog as TDialog,
Button as TButton,
Loading as TLoading,
} from 'tdesign-vue-next';
import { PropType, ref, watch } from 'vue';
import Animation from '@/components/Animation.vue';
const btns = [
{
label: '第一张',
value: 1,
},
{
label: '第二张',
value: 2,
},
{
label: '第三张',
value: 3,
},
{
label: '第四张',
value: 4,
},
];
const props = defineProps({
modelValue: Boolean,
list: Array as PropType<any[]>,
dialogloading: Boolean,
});
const emit = defineEmits(['update:modelValue', 'SubmitSplit']);
const visible = ref(props.modelValue);
const to_split = (prompt_id: number, click_id: number, index: number) => {
if (prompt_id && click_id) {
// 发送切割图片任务
emit('SubmitSplit', {
prompt_id: prompt_id,
click_id: click_id,
index: index,
});
}
};
watch(
() => props.modelValue,
(v) => {
visible.value = v;
}
);
watch(
() => visible.value,
(v) => {
emit('update:modelValue', v);
}
);
</script>
<style lang="less">
.custom-img-dialog {
.t-dialog {
width: 50vw;
max-width: 50vw;
.t-dialog__body {
overflow: hidden;
}
}
.custom-dialog-body {
height: 500px;
box-sizing: border-box;
.content {
height: 450px;
overflow-y: auto;
.img-box {
display: flex;
justify-content: space-between;
.img {
width: 300px;
height: 300px;
}
.split_img_loading {
width: 300px;
height: 300px;
display: flex;
align-items: center;
justify-content: center;
}
}
.btns {
margin: 20px 0;
& > :not(:nth-child(1)) {
margin-left: 12px;
}
}
}
.custom-loading-box {
position: relative !important;
width: auto !important;
height: 50px !important;
}
}
}
</style>
.custom-img-to-img-content {
.keyword {
.label {
font-size: 20px;
font-weight: bold;
margin-bottom: 20px;
}
& > :nth-child(2) {
margin-bottom: 30px;
}
.t-textarea {
.t-textarea__inner {
height: 200px;
resize: none;
}
}
}
}
import { defineComponent, PropType, ref, watch } from 'vue';
import './index.less';
import { Textarea as TTextarea } from 'tdesign-vue-next';
export default defineComponent({
props: {
modelValue: {
type: String as PropType<string>,
},
},
emits: ['update:modelValue'],
setup(props, { emit }) {
const keyword = ref('');
watch(
() => keyword.value,
(v) => {
emit('update:modelValue', v);
}
);
return () => (
<div class="custom-img-to-img-content">
<div class="keyword">
<div class="label">关键词</div>
<TTextarea autosize={false} v-model={keyword.value}></TTextarea>
</div>
</div>
);
},
});
.custom-real-upload {
margin-top: 30px;
background: #ffffff;
box-shadow: 0px 1px 6px rgba(0, 0, 0, 0.25);
border-radius: 10px;
height: 330px;
padding: 20px 46px;
position: relative;
display: flex;
justify-content: center;
flex-direction: column;
.real-upload-close-icon {
position: absolute;
right: 12px;
top: 12px;
cursor: pointer;
}
.real-upload-content {
margin-top: 6px;
display: flex;
justify-content: space-between;
.custom-real-upload-component {
width: 360px;
height: 200px;
border: 1px dashed #000000;
.t-upload {
width: 100%;
height: 100%;
.custom-upload-click-box {
border-radius: 8px;
width: 360px;
height: 200px;
display: flex;
justify-content: space-evenly;
align-items: center;
flex-direction: column;
.title {
font-weight: 600;
font-size: 18px;
color: black;
}
.title2 {
font-weight: 400;
font-size: 15px;
color: #8b8b8b;
}
.custom-chose-file {
background: #fd1753;
border-radius: 8px;
border: none;
width: 200px;
height: 46px;
--ripple-color: none !important;
}
}
.t-upload__dragger {
padding: 0;
border: none;
width: 360px;
height: 200px;
}
}
.custom-uploading-stauts {
display: flex;
justify-content: space-evenly;
align-items: center;
flex-direction: column;
width: 100%;
height: 100%;
.uploading-title {
font-weight: 400;
font-size: 15px;
color: #8b8b8b;
}
}
.custom-UploadSuccess-stauts {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
width: 100%;
height: 100%;
.UploadSuccess-img {
width: 100%;
height: 100%;
}
.title1 {
font-weight: 600;
font-size: 18px;
color: #000000;
}
}
}
}
.custom-real-upload-footer {
flex: 1;
display: flex;
align-items: center;
.t-button {
width: 164px;
height: 46px;
border: none;
--ripple-color: none !important;
border-radius: 8px;
font-size: 18px;
}
.submit {
background: #ebebeb;
color: #9a9a9a;
cursor: not-allowed;
}
.active {
background: #fd1753;
color: #ffffff;
cursor: pointer;
}
.reset-button {
border: 1px solid #dbdbdb;
background: white;
color: #000000;
margin-left: 12px;
}
}
}
.label {
font-size: 20px;
font-weight: bold;
margin-bottom: 20px;
}
import { computed, defineComponent, reactive, ref } from 'vue';
import './index.less';
import UploadTip from '@/assets/svg/upload/uploadTip.svg?component';
import {
MessagePlugin,
Button as TButton,
Upload as TUpload,
Progress as TProgress,
UploadFile,
RequestMethodResponse,
} from 'tdesign-vue-next';
import { useStore } from 'vuex';
import { getUserCookie } from '@/utils/api/userApi';
import request from '@/utils/otherRequest';
import { v4 } from 'uuid';
export default defineComponent({
props: {
modelValue: String,
},
emits: ['update:modelValue'],
setup(props, { emit }) {
const store = useStore();
// 后台配置的地址
const adminConfigUrl = computed(() => store.getters['user/getadminConfig']);
// 上传策略
const uploadStrategy = computed(
() => store.getters['user/getuploadStrategy']
);
const files = ref([]);
// 文件地址
const Curfile = reactive({
url: '',
status: 0,
// 当前上传模块提交的状态
uploadStatus: false,
});
const actionUrl = ref('');
// 上传进度条
const percentage = ref(0);
// 定时器
let percentageInterval: any = null;
// 上传进度定时器
const openpercentage = () => {
// 开启一个定时器,模拟上传进度
percentage.value = 0;
percentageInterval = setInterval(() => {
if (percentage.value == 99) {
return;
}
percentage.value += 1;
}, 100);
};
const beforeUpload = (file: File) => {
return true;
};
const handleFail = ({ file }: any) => {
MessagePlugin.error(`文件 ${file.name} 上传失败`);
};
// 上传成功回调
const UploadSuccessCallback = (uuid: any, url: any) => {
// 关闭定时器
window.clearInterval(percentageInterval);
MessagePlugin.success('上传成功');
// 将将完整url传给父组件
Curfile.url = url;
// 成功2
Curfile.status = 2;
emit('update:modelValue', Curfile.url);
};
// 上传失败回调
const UploadErrorCallback = () => {
// 关闭定时器
window.clearInterval(percentageInterval);
Curfile.url = '';
// 失败0
Curfile.status = 0;
emit('update:modelValue', Curfile.url);
MessagePlugin.warning('上传失败');
};
// 内网上传-Intranet
const IntranetUpload = (file: any) => {
openpercentage();
return new Promise((resolve) => {
let uuid = v4();
// 上传中状态
Curfile.status = 1;
let url = '';
if (import.meta.env.MODE == 'production') {
// 线上地址使用完整url
url = adminConfigUrl.value + 'video/' + uuid + '.png';
// url = `http://192.168.1.19:5000/video/` + uuid + '.png';
} else if (import.meta.env.MODE == 'app') {
// app
url = '/video/' + uuid + '.png';
} else {
// 本地
url = '/video/' + uuid + '.png';
}
setTimeout(() => {
request.put(url, file[0].raw).then((res: any) => {
// resolve 参数为关键代码
if (res == 200) {
let url = adminConfigUrl.value + 'video/' + uuid + '.png';
UploadSuccessCallback(uuid, url);
//
Curfile.uploadStatus = true;
resolve({
status: 'success',
response: { url: Curfile.url },
});
} else {
UploadErrorCallback();
Curfile.uploadStatus = false;
}
});
}, 1000);
});
};
// 外网上传-func
const ExtranetUpload = (file: any) => {
openpercentage();
return new Promise<RequestMethodResponse>((resolve) => {
let uuid = v4();
// 上传中状态
Curfile.status = 1;
let url = '';
const { config } = uploadStrategy.value;
url = 'https://' + config.host;
setTimeout(() => {
let formData = new FormData();
formData.append('key', config.dir + uuid + '.png');
formData.append('policy', config.policy);
formData.append('OSSAccessKeyId', config.accessid);
formData.append('success_action_status', '200');
formData.append('callback', config.callback);
formData.append('signature', config.signature);
// formData.append('name', uuid + '.png');
formData.append('file', file[0].raw);
request
.post(url, formData, {
headers: {
'Content-Type': 'multipart/form-data;charset=utf-8',
// Accept: '*/*',
},
})
.then((res: any) => {
// resolve 参数为关键代码
if (res == 200) {
// 外网url
let url = config.domain + config.dir + uuid + '.png';
UploadSuccessCallback(uuid, url);
//
Curfile.uploadStatus = true;
resolve({
status: 'success',
response: { url: Curfile.url },
});
} else {
UploadErrorCallback();
Curfile.uploadStatus = false;
}
})
.catch((e) => {
console.log(e);
});
}, 1000);
});
};
const requestSuccessMethod = async (file: UploadFile | UploadFile[]) => {
return ExtranetUpload(file);
};
// 未上传
const notUploadHtml = () => {
return (
<TUpload
v-model={files.value}
method="PUT"
requestMethod={requestSuccessMethod}
action={actionUrl.value}
headers={{
authorization: `Bearer ${getUserCookie()}`,
}}
accept={'video'}
theme="custom"
before-upload={beforeUpload}
multiple
max={1}
draggable={true}
onfail={handleFail}
>
<div class="custom-upload-click-box">
<div class="title">选择图片</div>
<div class="title2">或拖拽图片到此处</div>
<div>
<UploadTip></UploadTip>
</div>
<TButton class="custom-chose-file">选择文件</TButton>
</div>
</TUpload>
);
};
// 上传中
const UploadingHtml = () => {
return (
<div class="custom-uploading-stauts">
<TProgress
theme="circle"
percentage={percentage.value}
size={'small'}
/>
<div class="uploading-title">正在上传</div>
</div>
);
};
const UploadSuccess = () => {
return (
<div class="custom-UploadSuccess-stauts">
<img class="UploadSuccess-img" src={Curfile.url} alt="" />
</div>
);
};
// 获取当前上传状态
const currentUploadStatus = () => {
if (Curfile.status == 0) {
return notUploadHtml();
} else if (Curfile.status == 1) {
// 上传中
return UploadingHtml();
} else {
// 上传完成
return UploadSuccess();
}
};
return () => (
<div>
<div class="label">原图</div>
<div class="custom-real-upload">
<div class="real-upload-content">
<div class="custom-real-upload-component">
{currentUploadStatus()}
</div>
</div>
</div>
</div>
);
},
});
<template>
<t-dialog
v-model:visible="visible"
attach="body"
placement="center"
:confirm-on-enter="true"
:on-cancel="onCancel"
:on-confirm="onConfirmAnother"
>
<template #header>
<div>请确认是否提交</div>
</template>
<template #body> </template>
</t-dialog>
</template>
<script lang="ts" setup>
import { ref, watch } from 'vue';
import { Dialog as TDialog } from 'tdesign-vue-next';
const props = defineProps({
modelValue: Boolean,
});
const emit = defineEmits(['update:modelValue', 'Submit']);
const visible = ref(false);
const onCancel = (context: any) => {
//
console.log('onCancel');
};
// 确认按钮
const onConfirmAnother = (context: any) => {
// 通知页面发起请求
visible.value = false;
emit('Submit');
};
watch(
() => props.modelValue,
(v) => {
visible.value = v;
}
);
watch(
() => visible.value,
(v) => {
emit('update:modelValue', v);
}
);
</script>
<style lang="less">
.custom-confirm-dialog {
}
</style>
.img-to-img-page {
box-sizing: border-box;
padding: 30px;
.submit-button {
background: #fd1753;
border: none;
height: 36px;
--ripple-color: none !important;
margin-top: 20px;
&:hover {
background: #fd1753;
}
}
}
import { defineComponent, onMounted, reactive, ref } from 'vue';
import './index.less';
import EnterKeywords from './components/EnterKeywords';
import { useStore } from 'vuex';
import UploadImg from './components/UploadImg';
import { Button as TButton } from 'tdesign-vue-next';
import { Tasks } from '@/utils/api/Task';
import { filterRepeatTimestamp } from '@/utils/tool';
import {
useSubmitTask,
IntervalCheckTask,
SubmitSplitImgTask,
get_split_img_status,
} from '@/utils/api/userApi';
import CustomDialog from './components/Dialog/index.vue';
import Animation from '@/components/Animation.vue';
import ConfirmDIalog from './components/confimDialog.vue';
// wf
export default defineComponent({
setup(props, ctx) {
const store = useStore();
let custom_interval: any = null;
let split_interval: any = null;
const task_id = ref();
// 确认弹窗
const confirmDialogVisible = ref(false);
const prompt_num = ref();
const task_result_list = reactive<{
list: any[];
}>({
list: [],
});
// 关键词
const keywords = ref('');
const loading = ref(false);
const dialogloading = ref(true);
// 图片链接
const Img_url = ref('');
// 弹窗状态
const DialogVisible = ref(false);
// 测试
const test_num = ref(1);
onMounted(() => {
store.dispatch('user/AdminConfig');
});
// 获取返回的四宫格图片
const getTask = async () => {
try {
let res: any = await IntervalCheckTask({
task_id: task_id.value,
});
if (res.code == 0 && res.data.length) {
res.data.forEach((item: any) => {
if (item.loading === undefined) {
item.loading = false;
}
});
if (res.data.length > task_result_list.list.length) {
// 合并去重
filterRepeatTimestamp(task_result_list.list, res.data);
}
if (prompt_num.value == task_result_list.list.length) {
// 关闭定时器
closeInterval();
dialogloading.value = false;
} else {
dialogloading.value = true;
}
}
} catch (e) {
console.log(e);
}
};
// 获取返回的切割图片
const get_split_img = async (prompt_id: number) => {
try {
let res: any = await get_split_img_status({
prompt_id: prompt_id,
});
if (res.code == 0 && res.data.cut_img && res.data.id) {
// 切割成功--找到list对应的id,将cut_img添加进去
task_result_list.list.forEach((item: any) => {
if (item.id == res.data.id) {
item.split_img = res.data.cut_img;
item.loading = false;
}
});
// 关闭定时器
closeSplitTaskInterval();
}
} catch (e) {
console.log(e);
}
};
// 打开定时器
const openInterval = () => {
custom_interval = window.setInterval(() => {
getTask();
}, 3000);
};
// 打开图片切割任务定时器
const openSplitTaskInterval = (prompt_id: number) => {
split_interval = window.setInterval(() => {
get_split_img(prompt_id);
}, 3000);
};
// 关闭定时器
const closeInterval = () => {
if (custom_interval) {
window.clearInterval(custom_interval);
}
};
// 关闭图片切割任务定时器
const closeSplitTaskInterval = () => {
if (split_interval) {
window.clearInterval(split_interval);
}
};
const submit_before = () => {
if (!keywords.value) {
return;
}
// 打开的确认弹窗
confirmDialogVisible.value = true;
// submit();
};
// 确认对话框的确认事件
const CanSubmit = () => {
if (!keywords.value) {
return;
}
submit();
};
// 提交任务
const submit = async () => {
// prompt_img需要传数组
let params: any = {
type: Img_url.value ? Tasks.img_to_img : Tasks.text_to_img,
prompt: keywords.value,
prompt_img: [Img_url.value],
prompt_num: 5,
};
try {
loading.value = true;
// 请求
let res: any = await useSubmitTask(params);
if (res.code == 0) {
task_id.value = res.data.task_id;
prompt_num.value = res.data.prompt_num;
// 打开弹窗
DialogVisible.value = true;
// 清空已返回的图片
task_result_list.list = [];
// 开启轮询
openInterval();
}
loading.value = false;
} catch (e) {
console.log(e);
loading.value = false;
}
};
// 提交切割任务
const SubmitSplit = async ({ prompt_id, click_id, index }: any) => {
try {
let res: any = await SubmitSplitImgTask({
prompt_id: prompt_id,
cut_id: click_id,
});
if (res.code == 0) {
// 检测切割任务是否完成
openSplitTaskInterval(res.data.prompt_id);
// 将对应的item.loading打开
task_result_list.list[index].loading = true;
}
} catch (e) {
console.log(e);
}
};
return () => (
<div class="img-to-img-page">
<div class="tips">提示:可不上传图片</div>
<EnterKeywords v-model={keywords.value}></EnterKeywords>
<UploadImg v-model={Img_url.value}></UploadImg>
<TButton
onClick={submit_before}
class={['submit-button', !keywords.value ? 'disabled' : '']}
>
提交
</TButton>
<CustomDialog
v-model={DialogVisible.value}
list={task_result_list.list}
dialogloading={dialogloading.value}
onSubmitSplit={SubmitSplit}
></CustomDialog>
<Animation position={'fixed'} v-show={loading.value}></Animation>
<ConfirmDIalog
v-model={confirmDialogVisible.value}
onSubmit={CanSubmit}
></ConfirmDIalog>
</div>
);
},
});
<template>
<t-dialog
v-model:visible="visible"
attach="body"
placement="center"
:footer="false"
class="custom-img-dialog"
>
<template #header>
<div>请耐心等待图片生成</div>
</template>
<template #body>
<div class="custom-dialog-body">
<div class="content narrow-scrollbar">
<div v-for="(item, index) in list" :key="item.id">
<div class="img-box">
<img class="img" :src="item.img" alt="" />
<template v-if="item.split_img">
<img class="split-img img" :src="item.split_img" alt="" />
</template>
<template v-else-if="item.loading">
<div class="split_img_loading">
<t-loading size="24px"></t-loading>
</div>
</template>
</div>
<div class="btns">
<t-button
v-for="it in btns"
:key="it.value"
@click="to_split(item.id, it.value, index)"
>{{ it.label }}</t-button
>
</div>
<div>
---------------------------------------------------------------
</div>
</div>
</div>
<Animation v-show="dialogloading"></Animation>
</div>
</template>
</t-dialog>
</template>
<script lang="ts" setup>
import {
Dialog as TDialog,
Button as TButton,
Loading as TLoading,
} from 'tdesign-vue-next';
import { PropType, ref, watch } from 'vue';
import Animation from '@/components/Animation.vue';
const btns = [
{
label: '第一张',
value: 1,
},
{
label: '第二张',
value: 2,
},
{
label: '第三张',
value: 3,
},
{
label: '第四张',
value: 4,
},
];
const props = defineProps({
modelValue: Boolean,
list: Array as PropType<any[]>,
dialogloading: Boolean,
});
const emit = defineEmits(['update:modelValue', 'SubmitSplit']);
const visible = ref(props.modelValue);
const to_split = (prompt_id: number, click_id: number, index: number) => {
if (prompt_id && click_id) {
// 发送切割图片任务
emit('SubmitSplit', {
prompt_id: prompt_id,
click_id: click_id,
index: index,
});
}
};
watch(
() => props.modelValue,
(v) => {
visible.value = v;
}
);
watch(
() => visible.value,
(v) => {
emit('update:modelValue', v);
}
);
</script>
<style lang="less">
.custom-img-dialog {
.t-dialog {
width: 50vw;
max-width: 50vw;
.t-dialog__body {
overflow: hidden;
}
}
.custom-dialog-body {
height: 500px;
box-sizing: border-box;
.content {
height: 450px;
overflow-y: auto;
.img-box {
display: flex;
justify-content: space-between;
.img {
width: 300px;
height: 300px;
}
.split_img_loading {
width: 300px;
height: 300px;
display: flex;
align-items: center;
justify-content: center;
}
}
.btns {
margin: 20px 0;
& > :not(:nth-child(1)) {
margin-left: 12px;
}
}
}
.custom-loading-box {
position: relative !important;
width: auto !important;
height: 50px !important;
}
}
}
</style>
.custom-img-to-img-content {
.keyword {
.label {
font-size: 20px;
font-weight: bold;
margin-bottom: 20px;
}
& > :nth-child(2) {
margin-bottom: 30px;
}
.t-textarea {
.t-textarea__inner {
height: 200px;
resize: none;
}
}
}
}
import { defineComponent, PropType, ref, watch } from 'vue';
import './index.less';
import { Textarea as TTextarea } from 'tdesign-vue-next';
export default defineComponent({
props: {
modelValue: {
type: String as PropType<string>,
},
},
emits: ['update:modelValue'],
setup(props, { emit }) {
const keyword = ref('');
watch(
() => keyword.value,
(v) => {
emit('update:modelValue', v);
}
);
return () => (
<div class="custom-img-to-img-content">
<div class="keyword">
<div class="label">关键词</div>
<TTextarea autosize={false} v-model={keyword.value}></TTextarea>
</div>
</div>
);
},
});
.custom-real-upload {
margin-top: 30px;
background: #ffffff;
box-shadow: 0px 1px 6px rgba(0, 0, 0, 0.25);
border-radius: 10px;
height: 330px;
padding: 20px 46px;
position: relative;
display: flex;
justify-content: center;
flex-direction: column;
.real-upload-close-icon {
position: absolute;
right: 12px;
top: 12px;
cursor: pointer;
}
.real-upload-content {
margin-top: 6px;
display: flex;
justify-content: space-between;
.custom-real-upload-component {
width: 360px;
height: 200px;
border: 1px dashed #000000;
.t-upload {
width: 100%;
height: 100%;
.custom-upload-click-box {
border-radius: 8px;
width: 360px;
height: 200px;
display: flex;
justify-content: space-evenly;
align-items: center;
flex-direction: column;
.title {
font-weight: 600;
font-size: 18px;
color: black;
}
.title2 {
font-weight: 400;
font-size: 15px;
color: #8b8b8b;
}
.custom-chose-file {
background: #fd1753;
border-radius: 8px;
border: none;
width: 200px;
height: 46px;
--ripple-color: none !important;
}
}
.t-upload__dragger {
padding: 0;
border: none;
width: 360px;
height: 200px;
}
}
.custom-uploading-stauts {
display: flex;
justify-content: space-evenly;
align-items: center;
flex-direction: column;
width: 100%;
height: 100%;
.uploading-title {
font-weight: 400;
font-size: 15px;
color: #8b8b8b;
}
}
.custom-UploadSuccess-stauts {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
width: 100%;
height: 100%;
.UploadSuccess-img {
width: 100%;
height: 100%;
}
.title1 {
font-weight: 600;
font-size: 18px;
color: #000000;
}
}
}
}
.custom-real-upload-footer {
flex: 1;
display: flex;
align-items: center;
.t-button {
width: 164px;
height: 46px;
border: none;
--ripple-color: none !important;
border-radius: 8px;
font-size: 18px;
}
.submit {
background: #ebebeb;
color: #9a9a9a;
cursor: not-allowed;
}
.active {
background: #fd1753;
color: #ffffff;
cursor: pointer;
}
.reset-button {
border: 1px solid #dbdbdb;
background: white;
color: #000000;
margin-left: 12px;
}
}
}
.label {
font-size: 20px;
font-weight: bold;
margin-bottom: 20px;
}
import { computed, defineComponent, reactive, ref } from 'vue';
import './index.less';
import UploadTip from '@/assets/svg/upload/uploadTip.svg?component';
import {
MessagePlugin,
Button as TButton,
Upload as TUpload,
Progress as TProgress,
UploadFile,
RequestMethodResponse,
} from 'tdesign-vue-next';
import { useStore } from 'vuex';
import { getUserCookie } from '@/utils/api/userApi';
import request from '@/utils/otherRequest';
import { v4 } from 'uuid';
export default defineComponent({
props: {
modelValue: String,
},
emits: ['update:modelValue'],
setup(props, { emit }) {
const store = useStore();
// 后台配置的地址
const adminConfigUrl = computed(() => store.getters['user/getadminConfig']);
// 上传策略
const uploadStrategy = computed(
() => store.getters['user/getuploadStrategy']
);
const files = ref([]);
// 文件地址
const Curfile = reactive({
url: '',
status: 0,
// 当前上传模块提交的状态
uploadStatus: false,
});
const actionUrl = ref('');
// 上传进度条
const percentage = ref(0);
// 定时器
let percentageInterval: any = null;
// 上传进度定时器
const openpercentage = () => {
// 开启一个定时器,模拟上传进度
percentage.value = 0;
percentageInterval = setInterval(() => {
if (percentage.value == 99) {
return;
}
percentage.value += 1;
}, 100);
};
const beforeUpload = (file: File) => {
return true;
};
const handleFail = ({ file }: any) => {
MessagePlugin.error(`文件 ${file.name} 上传失败`);
};
// 上传成功回调
const UploadSuccessCallback = (uuid: any, url: any) => {
// 关闭定时器
window.clearInterval(percentageInterval);
MessagePlugin.success('上传成功');
// 将将完整url传给父组件
Curfile.url = url;
// 成功2
Curfile.status = 2;
emit('update:modelValue', Curfile.url);
};
// 上传失败回调
const UploadErrorCallback = () => {
// 关闭定时器
window.clearInterval(percentageInterval);
Curfile.url = '';
// 失败0
Curfile.status = 0;
emit('update:modelValue', Curfile.url);
MessagePlugin.warning('上传失败');
};
// 内网上传-Intranet
const IntranetUpload = (file: any) => {
openpercentage();
return new Promise((resolve) => {
let uuid = v4();
// 上传中状态
Curfile.status = 1;
let url = '';
if (import.meta.env.MODE == 'production') {
// 线上地址使用完整url
url = adminConfigUrl.value + 'video/' + uuid + '.png';
// url = `http://192.168.1.19:5000/video/` + uuid + '.png';
} else if (import.meta.env.MODE == 'app') {
// app
url = '/video/' + uuid + '.png';
} else {
// 本地
url = '/video/' + uuid + '.png';
}
setTimeout(() => {
request.put(url, file[0].raw).then((res: any) => {
// resolve 参数为关键代码
if (res == 200) {
let url = adminConfigUrl.value + 'video/' + uuid + '.png';
UploadSuccessCallback(uuid, url);
//
Curfile.uploadStatus = true;
resolve({
status: 'success',
response: { url: Curfile.url },
});
} else {
UploadErrorCallback();
Curfile.uploadStatus = false;
}
});
}, 1000);
});
};
// 外网上传-func
const ExtranetUpload = (file: any) => {
openpercentage();
return new Promise<RequestMethodResponse>((resolve) => {
let uuid = v4();
// 上传中状态
Curfile.status = 1;
let url = '';
const { config } = uploadStrategy.value;
url = 'https://' + config.host;
setTimeout(() => {
let formData = new FormData();
formData.append('key', config.dir + uuid + '.png');
formData.append('policy', config.policy);
formData.append('OSSAccessKeyId', config.accessid);
formData.append('success_action_status', '200');
formData.append('callback', config.callback);
formData.append('signature', config.signature);
// formData.append('name', uuid + '.png');
formData.append('file', file[0].raw);
request
.post(url, formData, {
headers: {
'Content-Type': 'multipart/form-data;charset=utf-8',
// Accept: '*/*',
},
})
.then((res: any) => {
// resolve 参数为关键代码
if (res == 200) {
// 外网url
let url = config.domain + config.dir + uuid + '.png';
UploadSuccessCallback(uuid, url);
//
Curfile.uploadStatus = true;
resolve({
status: 'success',
response: { url: Curfile.url },
});
} else {
UploadErrorCallback();
Curfile.uploadStatus = false;
}
})
.catch((e) => {
console.log(e);
});
}, 1000);
});
};
const requestSuccessMethod = async (file: UploadFile | UploadFile[]) => {
return ExtranetUpload(file);
};
// 未上传
const notUploadHtml = () => {
return (
<TUpload
v-model={files.value}
method="PUT"
requestMethod={requestSuccessMethod}
action={actionUrl.value}
headers={{
authorization: `Bearer ${getUserCookie()}`,
}}
accept={'video'}
theme="custom"
before-upload={beforeUpload}
multiple
max={1}
draggable={true}
onfail={handleFail}
>
<div class="custom-upload-click-box">
<div class="title">选择图片</div>
<div class="title2">或拖拽图片到此处</div>
<div>
<UploadTip></UploadTip>
</div>
<TButton class="custom-chose-file">选择文件</TButton>
</div>
</TUpload>
);
};
// 上传中
const UploadingHtml = () => {
return (
<div class="custom-uploading-stauts">
<TProgress
theme="circle"
percentage={percentage.value}
size={'small'}
/>
<div class="uploading-title">正在上传</div>
</div>
);
};
const UploadSuccess = () => {
return (
<div class="custom-UploadSuccess-stauts">
<img class="UploadSuccess-img" src={Curfile.url} alt="" />
</div>
);
};
// 获取当前上传状态
const currentUploadStatus = () => {
if (Curfile.status == 0) {
return notUploadHtml();
} else if (Curfile.status == 1) {
// 上传中
return UploadingHtml();
} else {
// 上传完成
return UploadSuccess();
}
};
return () => (
<div>
<div class="label">原图</div>
<div class="custom-real-upload">
<div class="real-upload-content">
<div class="custom-real-upload-component">
{currentUploadStatus()}
</div>
</div>
</div>
</div>
);
},
});
<template>
<t-dialog
v-model:visible="visible"
attach="body"
placement="center"
:confirm-on-enter="true"
:on-cancel="onCancel"
:on-confirm="onConfirmAnother"
>
<template #header>
<div>请确认是否提交</div>
</template>
<template #body> </template>
</t-dialog>
</template>
<script lang="ts" setup>
import { ref, watch } from 'vue';
import { Dialog as TDialog } from 'tdesign-vue-next';
const props = defineProps({
modelValue: Boolean,
});
const emit = defineEmits(['update:modelValue', 'Submit']);
const visible = ref(false);
const onCancel = (context: any) => {
//
console.log('onCancel');
};
// 确认按钮
const onConfirmAnother = (context: any) => {
// 通知页面发起请求
visible.value = false;
emit('Submit');
};
watch(
() => props.modelValue,
(v) => {
visible.value = v;
}
);
watch(
() => visible.value,
(v) => {
emit('update:modelValue', v);
}
);
</script>
<style lang="less">
.custom-confirm-dialog {
}
</style>
.img-to-img-page {
box-sizing: border-box;
padding: 30px;
.submit-button {
background: #fd1753;
border: none;
height: 36px;
--ripple-color: none !important;
margin-top: 20px;
&:hover {
background: #fd1753;
}
}
}
import { defineComponent, onMounted, reactive, ref } from 'vue';
import './index.less';
import EnterKeywords from './components/EnterKeywords';
import { useStore } from 'vuex';
import UploadImg from './components/UploadImg';
import { Button as TButton } from 'tdesign-vue-next';
import { Tasks } from '@/utils/api/Task';
import { filterRepeatTimestamp } from '@/utils/tool';
import {
useSubmitTask,
IntervalCheckTask,
SubmitSplitImgTask,
get_split_img_status,
} from '@/utils/api/userApi';
import CustomDialog from './components/Dialog/index.vue';
import Animation from '@/components/Animation.vue';
import ConfirmDIalog from './components/confimDialog.vue';
// wf
export default defineComponent({
setup(props, ctx) {
const store = useStore();
let custom_interval: any = null;
let split_interval: any = null;
const task_id = ref();
// 确认弹窗
const confirmDialogVisible = ref(false);
const prompt_num = ref();
const task_result_list = reactive<{
list: any[];
}>({
list: [],
});
// 关键词
const keywords = ref('');
const loading = ref(false);
const dialogloading = ref(true);
// 图片链接
const Img_url = ref('');
// 弹窗状态
const DialogVisible = ref(false);
// 测试
const test_num = ref(1);
onMounted(() => {
store.dispatch('user/AdminConfig');
});
// 获取返回的四宫格图片
const getTask = async () => {
try {
let res: any = await IntervalCheckTask({
task_id: task_id.value,
});
if (res.code == 0 && res.data.length) {
res.data.forEach((item: any) => {
if (item.loading === undefined) {
item.loading = false;
}
});
if (res.data.length > task_result_list.list.length) {
// 合并去重
filterRepeatTimestamp(task_result_list.list, res.data);
}
if (prompt_num.value == task_result_list.list.length) {
// 关闭定时器
closeInterval();
dialogloading.value = false;
} else {
dialogloading.value = true;
}
}
} catch (e) {
console.log(e);
}
};
// 获取返回的切割图片
const get_split_img = async (prompt_id: number) => {
try {
let res: any = await get_split_img_status({
prompt_id: prompt_id,
});
if (res.code == 0 && res.data.cut_img && res.data.id) {
// 切割成功--找到list对应的id,将cut_img添加进去
task_result_list.list.forEach((item: any) => {
if (item.id == res.data.id) {
item.split_img = res.data.cut_img;
item.loading = false;
}
});
// 关闭定时器
closeSplitTaskInterval();
}
} catch (e) {
console.log(e);
}
};
// 打开定时器
const openInterval = () => {
custom_interval = window.setInterval(() => {
getTask();
}, 3000);
};
// 打开图片切割任务定时器
const openSplitTaskInterval = (prompt_id: number) => {
split_interval = window.setInterval(() => {
get_split_img(prompt_id);
}, 3000);
};
// 关闭定时器
const closeInterval = () => {
if (custom_interval) {
window.clearInterval(custom_interval);
}
};
// 关闭图片切割任务定时器
const closeSplitTaskInterval = () => {
if (split_interval) {
window.clearInterval(split_interval);
}
};
const submit_before = () => {
if (!keywords.value) {
return;
}
// 打开的确认弹窗
confirmDialogVisible.value = true;
// submit();
};
// 确认对话框的确认事件
const CanSubmit = () => {
if (!keywords.value) {
return;
}
submit();
};
// 提交任务
const submit = async () => {
// prompt_img需要传数组
let params: any = {
type: Img_url.value ? Tasks.img_to_img : Tasks.text_to_img,
prompt: keywords.value,
prompt_img: [Img_url.value],
prompt_num: 5,
};
try {
loading.value = true;
// 请求
let res: any = await useSubmitTask(params);
if (res.code == 0) {
task_id.value = res.data.task_id;
prompt_num.value = res.data.prompt_num;
// 打开弹窗
DialogVisible.value = true;
// 清空已返回的图片
task_result_list.list = [];
// 开启轮询
openInterval();
}
loading.value = false;
} catch (e) {
console.log(e);
loading.value = false;
}
};
// 提交切割任务
const SubmitSplit = async ({ prompt_id, click_id, index }: any) => {
try {
let res: any = await SubmitSplitImgTask({
prompt_id: prompt_id,
cut_id: click_id,
});
if (res.code == 0) {
// 检测切割任务是否完成
openSplitTaskInterval(res.data.prompt_id);
// 将对应的item.loading打开
task_result_list.list[index].loading = true;
}
} catch (e) {
console.log(e);
}
};
return () => (
<div class="img-to-img-page">
<div class="tips">提示:可不上传图片</div>
<EnterKeywords v-model={keywords.value}></EnterKeywords>
<UploadImg v-model={Img_url.value}></UploadImg>
<TButton
onClick={submit_before}
class={['submit-button', !keywords.value ? 'disabled' : '']}
>
提交
</TButton>
<CustomDialog
v-model={DialogVisible.value}
list={task_result_list.list}
dialogloading={dialogloading.value}
onSubmitSplit={SubmitSplit}
></CustomDialog>
<Animation position={'fixed'} v-show={loading.value}></Animation>
<ConfirmDIalog
v-model={confirmDialogVisible.value}
onSubmit={CanSubmit}
></ConfirmDIalog>
</div>
);
},
});
...@@ -80,6 +80,10 @@ ...@@ -80,6 +80,10 @@
flex-direction: column; flex-direction: column;
width: 100%; width: 100%;
height: 100%; height: 100%;
.UploadSuccess-img {
width: 100%;
height: 100%;
}
.title1 { .title1 {
font-weight: 600; font-weight: 600;
font-size: 18px; font-size: 18px;
......
...@@ -87,20 +87,20 @@ export default defineComponent({ ...@@ -87,20 +87,20 @@ export default defineComponent({
let url = ''; let url = '';
if (import.meta.env.MODE == 'production') { if (import.meta.env.MODE == 'production') {
// 线上地址使用完整url // 线上地址使用完整url
url = adminConfigUrl.value + 'video/' + uuid + '.mp4'; url = adminConfigUrl.value + 'video/' + uuid + '.png';
// url = `http://192.168.1.19:5000/video/` + uuid + '.mp4'; // url = `http://192.168.1.19:5000/video/` + uuid + '.png';
} else if (import.meta.env.MODE == 'app') { } else if (import.meta.env.MODE == 'app') {
// app // app
url = '/video/' + uuid + '.mp4'; url = '/video/' + uuid + '.png';
} else { } else {
// 本地 // 本地
url = '/video/' + uuid + '.mp4'; url = '/video/' + uuid + '.png';
} }
setTimeout(() => { setTimeout(() => {
request.put(url, file[0].raw).then((res: any) => { request.put(url, file[0].raw).then((res: any) => {
// resolve 参数为关键代码 // resolve 参数为关键代码
if (res == 200) { if (res == 200) {
let url = adminConfigUrl.value + 'video/' + uuid + '.mp4'; let url = adminConfigUrl.value + 'video/' + uuid + '.png';
UploadSuccessCallback(uuid, url); UploadSuccessCallback(uuid, url);
// //
Curfile.uploadStatus = true; Curfile.uploadStatus = true;
...@@ -128,13 +128,13 @@ export default defineComponent({ ...@@ -128,13 +128,13 @@ export default defineComponent({
url = 'https://' + config.host; url = 'https://' + config.host;
setTimeout(() => { setTimeout(() => {
let formData = new FormData(); let formData = new FormData();
formData.append('key', config.dir + uuid + '.mp4'); formData.append('key', config.dir + uuid + '.png');
formData.append('policy', config.policy); formData.append('policy', config.policy);
formData.append('OSSAccessKeyId', config.accessid); formData.append('OSSAccessKeyId', config.accessid);
formData.append('success_action_status', '200'); formData.append('success_action_status', '200');
formData.append('callback', config.callback); formData.append('callback', config.callback);
formData.append('signature', config.signature); formData.append('signature', config.signature);
// formData.append('name', uuid + '.mp4'); // formData.append('name', uuid + '.png');
formData.append('file', file[0].raw); formData.append('file', file[0].raw);
request request
.post(url, formData, { .post(url, formData, {
...@@ -147,7 +147,7 @@ export default defineComponent({ ...@@ -147,7 +147,7 @@ export default defineComponent({
// resolve 参数为关键代码 // resolve 参数为关键代码
if (res == 200) { if (res == 200) {
// 外网url // 外网url
let url = config.domain + config.dir + uuid + '.mp4'; let url = config.domain + config.dir + uuid + '.png';
UploadSuccessCallback(uuid, url); UploadSuccessCallback(uuid, url);
// //
Curfile.uploadStatus = true; Curfile.uploadStatus = true;
...@@ -215,8 +215,7 @@ export default defineComponent({ ...@@ -215,8 +215,7 @@ export default defineComponent({
const UploadSuccess = () => { const UploadSuccess = () => {
return ( return (
<div class="custom-UploadSuccess-stauts"> <div class="custom-UploadSuccess-stauts">
<div class="title1">上传完成</div> <img class="UploadSuccess-img" src={Curfile.url} alt="" />
<div class="title1">请点击下方提交按钮</div>
</div> </div>
); );
}; };
......
<template>
<t-dialog
v-model:visible="visible"
attach="body"
placement="center"
:confirm-on-enter="true"
:on-cancel="onCancel"
:on-confirm="onConfirmAnother"
>
<template #header>
<div>请确认是否提交</div>
</template>
<template #body> </template>
</t-dialog>
</template>
<script lang="ts" setup>
import { ref, watch } from 'vue';
import { Dialog as TDialog } from 'tdesign-vue-next';
const props = defineProps({
modelValue: Boolean,
});
const emit = defineEmits(['update:modelValue', 'Submit']);
const visible = ref(false);
const onCancel = (context: any) => {
//
console.log('onCancel');
};
// 确认按钮
const onConfirmAnother = (context: any) => {
// 通知页面发起请求
visible.value = false;
emit('Submit');
};
watch(
() => props.modelValue,
(v) => {
visible.value = v;
}
);
watch(
() => visible.value,
(v) => {
emit('update:modelValue', v);
}
);
</script>
<style lang="less">
.custom-confirm-dialog {
}
</style>
...@@ -14,12 +14,15 @@ import { ...@@ -14,12 +14,15 @@ import {
} from '@/utils/api/userApi'; } from '@/utils/api/userApi';
import CustomDialog from './components/Dialog/index.vue'; import CustomDialog from './components/Dialog/index.vue';
import Animation from '@/components/Animation.vue'; import Animation from '@/components/Animation.vue';
import ConfirmDIalog from './components/confimDialog.vue';
export default defineComponent({ export default defineComponent({
setup(props, ctx) { setup(props, ctx) {
const store = useStore(); const store = useStore();
let custom_interval: any = null; let custom_interval: any = null;
let split_interval: any = null; let split_interval: any = null;
const task_id = ref(); const task_id = ref();
// 确认弹窗
const confirmDialogVisible = ref(false);
const prompt_num = ref(); const prompt_num = ref();
const task_result_list = reactive<{ const task_result_list = reactive<{
list: any[]; list: any[];
...@@ -77,7 +80,6 @@ export default defineComponent({ ...@@ -77,7 +80,6 @@ export default defineComponent({
// 切割成功--找到list对应的id,将cut_img添加进去 // 切割成功--找到list对应的id,将cut_img添加进去
task_result_list.list.forEach((item: any) => { task_result_list.list.forEach((item: any) => {
if (item.id == res.data.id) { if (item.id == res.data.id) {
console.log('我执行了');
item.split_img = res.data.cut_img; item.split_img = res.data.cut_img;
item.loading = false; item.loading = false;
} }
...@@ -113,11 +115,23 @@ export default defineComponent({ ...@@ -113,11 +115,23 @@ export default defineComponent({
window.clearInterval(split_interval); window.clearInterval(split_interval);
} }
}; };
// 提交任务 const submit_before = () => {
const submit = async () => {
if (!keywords.value) { if (!keywords.value) {
return; return;
} }
// 打开的确认弹窗
confirmDialogVisible.value = true;
// submit();
};
// 确认对话框的确认事件
const CanSubmit = () => {
if (!keywords.value) {
return;
}
submit();
};
// 提交任务
const submit = async () => {
// prompt_img需要传数组 // prompt_img需要传数组
let params: any = { let params: any = {
type: Img_url.value ? Tasks.img_to_img : Tasks.text_to_img, type: Img_url.value ? Tasks.img_to_img : Tasks.text_to_img,
...@@ -134,6 +148,8 @@ export default defineComponent({ ...@@ -134,6 +148,8 @@ export default defineComponent({
prompt_num.value = res.data.prompt_num; prompt_num.value = res.data.prompt_num;
// 打开弹窗 // 打开弹窗
DialogVisible.value = true; DialogVisible.value = true;
// 清空已返回的图片
task_result_list.list = [];
// 开启轮询 // 开启轮询
openInterval(); openInterval();
} }
...@@ -166,7 +182,7 @@ export default defineComponent({ ...@@ -166,7 +182,7 @@ export default defineComponent({
<EnterKeywords v-model={keywords.value}></EnterKeywords> <EnterKeywords v-model={keywords.value}></EnterKeywords>
<UploadImg v-model={Img_url.value}></UploadImg> <UploadImg v-model={Img_url.value}></UploadImg>
<TButton <TButton
onClick={submit} onClick={submit_before}
class={['submit-button', !keywords.value ? 'disabled' : '']} class={['submit-button', !keywords.value ? 'disabled' : '']}
> >
提交 提交
...@@ -178,6 +194,10 @@ export default defineComponent({ ...@@ -178,6 +194,10 @@ export default defineComponent({
onSubmitSplit={SubmitSplit} onSubmitSplit={SubmitSplit}
></CustomDialog> ></CustomDialog>
<Animation position={'fixed'} v-show={loading.value}></Animation> <Animation position={'fixed'} v-show={loading.value}></Animation>
<ConfirmDIalog
v-model={confirmDialogVisible.value}
onSubmit={CanSubmit}
></ConfirmDIalog>
</div> </div>
); );
}, },
......
...@@ -20,6 +20,32 @@ export default [ ...@@ -20,6 +20,32 @@ export default [
header: true, header: true,
}, },
}, },
{
path: '/gpt',
name: 'gpt',
component: () => import('@/pages/GPT/index.vue'),
meta: {
header: true,
},
},
// image
{
path: '/image',
name: 'image',
component: () => import('@/pages/Image'),
meta: {
header: true,
},
},
// Image_stable
{
path: '/Image_stable',
name: 'Image_stable',
component: () => import('@/pages/Image_stable'),
meta: {
header: true,
},
},
], ],
}, },
]; ];
import { getUserCookie } from './userApi';
import request from '@/utils/request';
// gpt对话
export const submitmessage = (data: any) => {
return request.post(
'/api/gpt/chat',
{
...data,
},
{
headers: {
authorization: `Bearer ${getUserCookie()}`,
},
}
);
};
...@@ -42,7 +42,7 @@ instance.interceptors.response.use( ...@@ -42,7 +42,7 @@ instance.interceptors.response.use(
if (status_code == 403) { if (status_code == 403) {
MessagePlugin.warning('请登录'); MessagePlugin.warning('请登录');
router.replace({ router.replace({
path: '/', path: '/login',
}); });
return; return;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment