You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
11 KiB
2 lines
11 KiB
1 month ago
|
"use strict";(self["webpackChunkh5_u2"]=self["webpackChunkh5_u2"]||[]).push([[473],{8859:function(e,t,a){var l=a(4311),r=a(5975);const n={baseURL:location.origin,timeout:5e3},u=l.Z.create(n);u.interceptors.request.use((function(e){return"get"===e.method&&"/api/login"!==e.url&&(localStorage.getItem("os-token")?(e.params||(e.params={}),Object.assign(e.params,{token:localStorage.getItem("os-token")})):((0,r.z8)({message:"请先登录",type:"warning"}),localStorage.clear())),e}),(function(e){return Promise.reject(e)})),u.interceptors.response.use((function(e){return 1===e.data.ret&&(0,r.z8)({message:"请先登录",type:"warning"}),e.data}),(function(e){return Promise.reject(e)})),t["Z"]=u},2648:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{Gh:function(){return transformJSON},WU:function(){return format},XF:function(){return getDiffDate},ax:function(){return transformBeginTime},c$:function(){return getArray},w6:function(){return range}});var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(7658),core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__);function getArray(e=0,t=new Date,a=new Date){t.setDate(t.getDate()-e),a.setDate(a.getDate()+e);var l=[],r=[],n=["日","一","二","三","四","五","六"],u=0;while(a.getTime()-t.getTime()>=0){u++;var o=1==(t.getMonth()+1).toString().length?"0"+(t.getMonth()+1).toString():t.getMonth()+1,i=1==t.getDate().toString().length?"0"+t.getDate():t.getDate(),s=n[t.getDay()];r.push(o+"月"+i+"日(周"+s+")");var c={};c.week=1==u?"今天":"周"+s,c.date=(new Date).getFullYear()+"-"+o+"-"+i,c.date2=o+"-"+i,l.push(c),t.setDate(t.getDate()+1)}return l}function format(e){return e.map((e=>({title:e.date.slice(5),dataKey:e.date,key:e.date,width:60})))}function getDiffDate(e,t){var a=new Array,l=0;while(e<=t){a[l]=e;var r=new Date(e).getTime(),n=r+864e5,u=new Date(n).getFullYear()+"-",o=new Date(n).getMonth()+1<10?"0"+(new Date(n).getMonth()+1)+"-":new Date(n).getMonth()+1+"-",i=new Date(n).getDate()<10?"0"+new Date(n).getDate():new Date(n).getDate();e=u+o+i,l++}return a[0]=a[0].slice(0,10),a}function randomColorAndNotRed(){var e=Math.floor(200*Math.random()),t=Math.floor(206*Math.random()+50),a=Math.floor(206*Math.random()+50);return`rgb(${e},${t},${a})`}function transformBeginTime(e){return getFormatDateTime(e)}function getFormatDateTime(e){var t=new Date;t.setDate(t.getDate()-e);var a=t.getFullYear(),l=t.getMonth()+1,r=t.getDate(),n=t.getHours(),u=t.getMinutes(),o=t.getSeconds();return[a,"-",l<10?`0${l}`:l,"-",r<10?`0${r}`:r," ",n<10?`0${n}`:n,":",u<10?`0${u}`:u,":",o<10?`0${o}`:o].join("")}function transformJSON(e){return new Function("return "+e)()}function transformArray(str){return eval("("+str+")")}function range(e){let[t,a]=e.split("-");t=parseInt(t),a=parseInt(a);let l=a-t+1,r=t-1;return Array.apply(null,{length:l}).map(((e,t)=>(r++,r)))}},4527:function(e,t,a){a.r(t),a.d(t,{default:function(){return p}});a(7658);var l=a(3396),r=a(4870),n=a(7139),u=a(2648),o=a(1977),i=a(5975),s=a(8859);const c={class:"activityTable"};var m={__name:"activityTable",setup(e){const t=(0,r.iH)([]);let a=(0,r.iH)(7);const m=(0,r.iH)([]);let v=(0,r.iH)((0,u.ax)(a.value));const d=(0,r.iH)(null);async function p(e){try{let{data:e=[]}=await s.Z.get("/api/select_activity",{params:{beginTime:v.value}}),t=[];e=e.filter((e=>{const t=Math.abs(Math.floor(((new Date).getTime()-new Date(e.startTime).getTime())/864e5)),l=Math.abs(Math.floor((new Date(e.endTime).getTime()-(new Date).getTime())/864e5));if(t<=a.value||l<=a.value)return!0})),e.forEach(((e,a)=>{t[a]=(0,u.XF)(e.startTime,e.endTime)})),e.forEach(((e,a)=>{g.value.forEach((l=>{t[a].includes(l.key)&&(e[l.key]=`${e.activityName}(${e.activityId})(${e.activityType})`)}))})),await(0,l.Y3)(),k=[],m.value=e}catch(t){(0,i.z8)({message:t,type:"warning"})}}(0,l.bv)((async()=>{await p(),_.value="10",t.value=m.value})),(0,l.YP)(a,(async e=>{v.value=(0,u.ax)(e),await p(),setT
|
||
|
//# sourceMappingURL=activityTable.5355bdfd.js.map
|