提交 fbc0ff16 编写于 作者: 刘英杰's avatar 刘英杰

保存

上级 5b661f8b
流水线 #23304 已通过 ,包含阶段
in 1 minute 和 13 second
default:
before_script:
- chcp 65001
stages:
- publish
build:
stage: publish
script:
- remove-item -Force -Recurse D:\ASC_web\A00051\placeManagement\wx*
- xcopy "dist" "D:\ASC_web\A00051\placeManagement\wx\" /s/e/y/
only:
- wx
import{u,f as p,o as l,c as m,a as k,h as _,G as a,i as s,L as f,j as w,C as y,S as d,k as g}from"./index-26130194.js";const x={style:{display:"flex","justify-content":"center","margin-top":"50%"}},R={__name:"SSO",setup(v){const t=u(),c=async o=>{const e=await d(o);if(e.code!==1)await t.replace({name:"403"});else if(e.response.access_token.token_content!==""){s.set("site-management-token",e.response.access_token.token_content),s.set("time",e.response.access_token.expires);const n=await a();s.set("site-user-info",n.response.role),await t.replace({name:"welcome"})}},r=async o=>{const e=await g(o);if(e.code!==1)await t.replace({name:"403"});else if(e.response.access_token.token_content!==""){s.set("site-management-token",e.response.access_token.token_content),s.set("time",e.response.access_token.expires);const n=await a();s.set("site-user-info",n.response.role),await t.replace({name:"welcome"})}},i=async()=>{({asc:async()=>{let e={token:t.currentRoute.value.query.token};await c(e)},first:async()=>{let e={sign:t.currentRoute.value.query.sign,code:t.currentRoute.value.query.code,timestamp:t.currentRoute.value.query.timestamp};await r(e)},test:async()=>{const e=await y();if(e.code!==1)await t.replace({name:"403"});else if(e.response.access_token.token_content!==""){s.set("site-management-token",e.response.access_token.token_content),s.set("time",e.response.access_token.expires);const n=await a();s.set("site-user-info",n.response.role),await t.replace({name:"welcome"})}}})[Number(t.currentRoute.value.query.type)](),a(s.get("site-management-token")).then(e=>{s.set("userInfo",JSON.stringify(e.response))})};return p(()=>{i()}),(o,e)=>{const n=f;return l(),m("div",x,[k(n,{size:"38px",color:"#1989fa",vertical:""},{default:_(()=>[w(" 登录中")]),_:1})])}}};export{R as default};
import{u as i,f as l,o as p,c as k,a as _,h as d,i as s,L as m,j as y}from"./index-26130194.js";const f={style:{display:"flex","justify-content":"center","margin-top":"50%"}},q={__name:"SSOInfo",setup(v){const e=i(),a=async n=>{const t=await(void 0)(n);if(t.code!==1)await e.replace({name:"403"});else if(t.response.access_token.token_content!==""){s.set("site-management-token",t.response.access_token.token_content),s.set("time",t.response.access_token.expires);let o=e.currentRoute.value.query.links,u=e.currentRoute.value.query.id;await e.push({path:`/${o}`,query:{id:u}})}},c=async n=>{const t=await(void 0)(n);if(t.code!==1)await e.replace({name:"403"});else if(t.response.access_token.token_content!==""){s.set("site-management-token",t.response.access_token.token_content),s.set("time",t.response.access_token.expires);let o=e.currentRoute.value.query.links;await e.push({path:`/${o}`})}},r=async()=>{if(Number(e.currentRoute.value.query.type)===2){s.set("token",e.currentRoute.value.query.token);let n={token:s.get("token")};await a(n)}else if(Number(e.currentRoute.value.query.type)===1){let n={sign:e.currentRoute.value.query.sign,code:e.currentRoute.value.query.code,timestamp:e.currentRoute.value.query.timestamp};await c(n)}};return l(()=>{r()}),(n,t)=>{const o=m;return p(),k("div",f,[_(o,{size:"38px",color:"#1989fa",vertical:""},{default:d(()=>[y(" 登录中")]),_:1})])}}};export{q as default};
:root{--van-tag-padding: 0 var(--van-padding-base);--van-tag-text-color: var(--van-white);--van-tag-font-size: var(--van-font-size-sm);--van-tag-radius: 2px;--van-tag-line-height: 16px;--van-tag-medium-padding: 2px 6px;--van-tag-large-padding: var(--van-padding-base) var(--van-padding-xs);--van-tag-large-radius: var(--van-radius-md);--van-tag-large-font-size: var(--van-font-size-md);--van-tag-round-radius: var(--van-radius-max);--van-tag-danger-color: var(--van-danger-color);--van-tag-primary-color: var(--van-primary-color);--van-tag-success-color: var(--van-success-color);--van-tag-warning-color: var(--van-warning-color);--van-tag-default-color: var(--van-gray-6);--van-tag-plain-background: var(--van-background-2)}.van-tag{position:relative;display:inline-flex;align-items:center;padding:var(--van-tag-padding);color:var(--van-tag-text-color);font-size:var(--van-tag-font-size);line-height:var(--van-tag-line-height);border-radius:var(--van-tag-radius)}.van-tag--default{background:var(--van-tag-default-color)}.van-tag--default.van-tag--plain{color:var(--van-tag-default-color)}.van-tag--danger{background:var(--van-tag-danger-color)}.van-tag--danger.van-tag--plain{color:var(--van-tag-danger-color)}.van-tag--primary{background:var(--van-tag-primary-color)}.van-tag--primary.van-tag--plain{color:var(--van-tag-primary-color)}.van-tag--success{background:var(--van-tag-success-color)}.van-tag--success.van-tag--plain{color:var(--van-tag-success-color)}.van-tag--warning{background:var(--van-tag-warning-color)}.van-tag--warning.van-tag--plain{color:var(--van-tag-warning-color)}.van-tag--plain{background:var(--van-tag-plain-background);border-color:currentColor}.van-tag--plain:before{position:absolute;top:0;right:0;bottom:0;left:0;border:1px solid;border-color:inherit;border-radius:inherit;content:"";pointer-events:none}.van-tag--medium{padding:var(--van-tag-medium-padding)}.van-tag--large{padding:var(--van-tag-large-padding);font-size:var(--van-tag-large-font-size);border-radius:var(--van-tag-large-radius)}.van-tag--mark{border-radius:0 var(--van-tag-round-radius) var(--van-tag-round-radius) 0}.van-tag--mark:after{display:block;width:2px;content:""}.van-tag--round{border-radius:var(--van-tag-round-radius)}.van-tag__close{margin-left:2px}:root{--van-cell-group-background: var(--van-background-2);--van-cell-group-title-color: var(--van-text-color-2);--van-cell-group-title-padding: var(--van-padding-md) var(--van-padding-md);--van-cell-group-title-font-size: var(--van-font-size-md);--van-cell-group-title-line-height: 16px;--van-cell-group-inset-padding: 0 var(--van-padding-md);--van-cell-group-inset-radius: var(--van-radius-lg);--van-cell-group-inset-title-padding: var(--van-padding-md) var(--van-padding-md)}.van-cell-group{background:var(--van-cell-group-background)}.van-cell-group--inset{margin:var(--van-cell-group-inset-padding);border-radius:var(--van-cell-group-inset-radius);overflow:hidden}.van-cell-group__title{padding:var(--van-cell-group-title-padding);color:var(--van-cell-group-title-color);font-size:var(--van-cell-group-title-font-size);line-height:var(--van-cell-group-title-line-height)}.van-cell-group__title--inset{padding:var(--van-cell-group-inset-title-padding)}:root{--van-cell-font-size: var(--van-font-size-md);--van-cell-line-height: 24px;--van-cell-vertical-padding: 10px;--van-cell-horizontal-padding: var(--van-padding-md);--van-cell-text-color: var(--van-text-color);--van-cell-background: var(--van-background-2);--van-cell-border-color: var(--van-border-color);--van-cell-active-color: var(--van-active-color);--van-cell-required-color: var(--van-danger-color);--van-cell-label-color: var(--van-text-color-2);--van-cell-label-font-size: var(--van-font-size-sm);--van-cell-label-line-height: var(--van-line-height-sm);--van-cell-label-margin-top: var(--van-padding-base);--van-cell-value-color: var(--van-text-color-2);--van-cell-icon-size: 16px;--van-cell-right-icon-color: var(--van-gray-6);--van-cell-large-vertical-padding: var(--van-padding-sm);--van-cell-large-title-font-size: var(--van-font-size-lg);--van-cell-large-label-font-size: var(--van-font-size-md)}.van-cell{position:relative;display:flex;box-sizing:border-box;width:100%;padding:var(--van-cell-vertical-padding) var(--van-cell-horizontal-padding);overflow:hidden;color:var(--van-cell-text-color);font-size:var(--van-cell-font-size);line-height:var(--van-cell-line-height);background:var(--van-cell-background)}.van-cell:after{position:absolute;box-sizing:border-box;content:" ";pointer-events:none;right:var(--van-padding-md);bottom:0;left:var(--van-padding-md);border-bottom:1px solid var(--van-cell-border-color);transform:scaleY(.5)}.van-cell:last-child:after,.van-cell--borderless:after{display:none}.van-cell__label{margin-top:var(--van-cell-label-margin-top);color:var(--van-cell-label-color);font-size:var(--van-cell-label-font-size);line-height:var(--van-cell-label-line-height)}.van-cell__title,.van-cell__value{flex:1}.van-cell__value{position:relative;overflow:hidden;color:var(--van-cell-value-color);text-align:right;vertical-align:middle;word-wrap:break-word}.van-cell__left-icon,.van-cell__right-icon{height:var(--van-cell-line-height);font-size:var(--van-cell-icon-size);line-height:var(--van-cell-line-height)}.van-cell__left-icon{margin-right:var(--van-padding-base)}.van-cell__right-icon{margin-left:var(--van-padding-base);color:var(--van-cell-right-icon-color)}.van-cell--clickable{cursor:pointer}.van-cell--clickable:active{background-color:var(--van-cell-active-color)}.van-cell--required{overflow:visible}.van-cell--required:before{position:absolute;left:var(--van-padding-xs);color:var(--van-cell-required-color);font-size:var(--van-cell-font-size);content:"*"}.van-cell--center{align-items:center}.van-cell--large{padding-top:var(--van-cell-large-vertical-padding);padding-bottom:var(--van-cell-large-vertical-padding)}.van-cell--large .van-cell__title{font-size:var(--van-cell-large-title-font-size)}.van-cell--large .van-cell__label{font-size:var(--van-cell-large-label-font-size)}
import{u as n,o as c,c as s,a as e,F as m}from"./index-26130194.js";import{E as p}from"./index-74186f38.js";import{N as _}from"./index-eb7bb0a6.js";import"./use-height-4547cdf4.js";const v={__name:"index",setup(i){const t=n(),o=()=>t.replace({name:"welcome"});return(l,f)=>{const r=_,a=p;return c(),s(m,null,[e(r,{"left-text":"返回","left-arrow":"",onClickLeft:o}),e(a,{style:{width:"100%",height:"100%"},image:"error",description:"暂无权限!"})],64)}}};export{v as default};
因为 它太大了无法显示 源差异 。您可以改为 查看blob。
import{g as L,b as k,l as A,d as w,a as l,m as D,n as h,t as B,ac as S,ad as P,I as x,w as y,ae as O,a9 as z,F as R,T as V,af as E}from"./index-26130194.js";const F={to:[String,Object],url:String,replace:Boolean};function G({to:e,url:n,replace:r,$router:a}){e&&a?a[r?"replace":"push"](e):n&&(r?location.replace(n):location.href=n)}function q(){const e=L().proxy;return()=>G(e)}const[N,s]=k("cell"),j={tag:D("div"),icon:String,size:String,title:h,value:h,label:h,center:Boolean,isLink:Boolean,border:B,required:Boolean,iconPrefix:String,valueClass:S,labelClass:S,titleClass:S,titleStyle:null,arrowDirection:String,clickable:{type:Boolean,default:null}},H=A({},j,F);var K=w({name:N,props:H,setup(e,{slots:n}){const r=q(),a=()=>{if(n.label||P(e.label))return l("div",{class:[s("label"),e.labelClass]},[n.label?n.label():e.label])},u=()=>{var t;if(n.title||P(e.title)){const i=(t=n.title)==null?void 0:t.call(n);return Array.isArray(i)&&i.length===0?void 0:l("div",{class:[s("title"),e.titleClass],style:e.titleStyle},[i||l("span",null,[e.title]),a()])}},c=()=>{const t=n.value||n.default;if(t||P(e.value))return l("div",{class:[s("value"),e.valueClass]},[t?t():l("span",null,[e.value])])},o=()=>{if(n.icon)return n.icon();if(e.icon)return l(x,{name:e.icon,class:s("left-icon"),classPrefix:e.iconPrefix},null)},g=()=>{if(n["right-icon"])return n["right-icon"]();if(e.isLink){const t=e.arrowDirection&&e.arrowDirection!=="right"?`arrow-${e.arrowDirection}`:"arrow";return l(x,{name:t,class:s("right-icon")},null)}};return()=>{var t;const{tag:i,size:d,center:f,border:v,isLink:b,required:m}=e,C=(t=e.clickable)!=null?t:b,T={center:f,required:m,clickable:C,borderless:!v};return d&&(T[d]=!!d),l(i,{class:s(T),role:C?"button":void 0,tabindex:C?0:void 0,onClick:r},{default:()=>{var _;return[o(),u(),c(),g(),(_=n.extra)==null?void 0:_.call(n)]}})}}});const Z=y(K),[M,$]=k("tag"),J={size:String,mark:Boolean,show:B,type:D("default"),color:String,plain:Boolean,round:Boolean,textColor:String,closeable:Boolean};var Q=w({name:M,props:J,emits:["close"],setup(e,{slots:n,emit:r}){const a=o=>{o.stopPropagation(),r("close",o)},u=()=>e.plain?{color:e.textColor||e.color,borderColor:e.color}:{color:e.textColor,background:e.color},c=()=>{var o;const{type:g,mark:t,plain:i,round:d,size:f,closeable:v}=e,b={mark:t,plain:i,round:d};f&&(b[f]=f);const m=v&&l(x,{name:"cross",class:[$("close"),z],onClick:a},null);return l("span",{style:u(),class:$([b,g])},[(o=n.default)==null?void 0:o.call(n),m])};return()=>l(O,{name:e.closeable?"van-fade":void 0},{default:()=>[e.show?c():null]})}});const p=y(Q),[U,I]=k("cell-group"),W={title:String,inset:Boolean,border:B};var X=w({name:U,inheritAttrs:!1,props:W,setup(e,{slots:n,attrs:r}){const a=()=>{var c;return l("div",V({class:[I({inset:e.inset}),{[E]:e.border&&!e.inset}]},r),[(c=n.default)==null?void 0:c.call(n)])},u=()=>l("div",{class:I("title",{inset:e.inset})},[n.title?n.title():e.title]);return()=>e.title||n.title?l(R,null,[u(),a()]):a()}});const ee=y(X);export{Z as C,p as T,ee as a,F as r,q as u};
import{b as Z,l as ue,m as J,n as se,d as te,B as He,a as l,I as Be,p as Re,L as Ce,w as be,r as G,q as Fe,s as Q,t as L,v as me,x as le,y as We,z as W,A as Ne,D as Le,E as Oe,H as he,J as Ee,K as re,M as ge,N as ie,O as ze,P as Ve,Q as Pe,R as de,T as Ue,U as ye,V as Ge,W as De,X as je,Y as qe,Z as Xe,_ as Je,$ as I,f as Ke,i as Qe,o as ne,a0 as xe,h as U,a1 as j,a2 as F,c as fe,a3 as Se,F as Me,a4 as pe,a5 as Ze,a6 as K,a7 as et,a8 as tt}from"./index-26130194.js";import{r as at,u as nt,C as ot,a as st,T as lt}from"./index-2cb722d3.js";import{u as rt}from"./use-height-4547cdf4.js";const[it,ee]=Z("button"),ct=ue({},at,{tag:J("button"),text:String,icon:String,type:J("default"),size:J("normal"),color:String,block:Boolean,plain:Boolean,round:Boolean,square:Boolean,loading:Boolean,hairline:Boolean,disabled:Boolean,iconPrefix:String,nativeType:J("button"),loadingSize:se,loadingText:String,loadingType:String,iconPosition:J("left")});var ut=te({name:it,props:ct,emits:["click"],setup(e,{emit:t,slots:r}){const i=nt(),d=()=>r.loading?r.loading():l(Ce,{size:e.loadingSize,type:e.loadingType,class:ee("loading")},null),x=()=>{if(e.loading)return d();if(r.icon)return l("div",{class:ee("icon")},[r.icon()]);if(e.icon)return l(Be,{name:e.icon,class:ee("icon"),classPrefix:e.iconPrefix},null)},B=()=>{let u;if(e.loading?u=e.loadingText:u=r.default?r.default():e.text,u)return l("span",{class:ee("text")},[u])},c=()=>{const{color:u,plain:k}=e;if(u){const T={color:k?u:"white"};return k||(T.background=u),u.includes("gradient")?T.border=0:T.borderColor=u,T}},o=u=>{e.loading?Re(u):e.disabled||(t("click",u),i())};return()=>{const{tag:u,type:k,size:T,block:b,round:$,plain:S,square:E,loading:m,disabled:w,hairline:_,nativeType:y,iconPosition:n}=e,h=[ee([k,T,{plain:S,block:b,round:$,square:E,loading:m,disabled:w,hairline:_}]),{[He]:_}];return l(u,{type:y,class:h,style:c(),disabled:w,onClick:o},{default:()=>[l("div",{class:ee("content")},[n==="left"&&x(),B(),n==="right"&&x()])]})}}});const dt=be(ut);Z("picker-toolbar");const ft={title:String,cancelButtonText:String,confirmButtonText:String};function mt(){const e=G([]),t=[];return Fe(()=>{e.value=[]}),[e,i=>(t[i]||(t[i]=d=>{e.value[i]=d}),t[i])]}const Ae=ue({loading:Boolean,readonly:Boolean,allowHtml:Boolean,optionHeight:Q(44),showToolbar:L,swipeDuration:Q(1e3),visibleOptionNum:Q(6)},ft);ue({},Ae,{columns:me(),modelValue:me(),toolbarPosition:J("top"),columnsFieldNames:Object});const[ht,Y,q]=Z("calendar"),gt=e=>q("monthTitle",e.getFullYear(),e.getMonth()+1);function ve(e,t){const r=e.getFullYear(),i=t.getFullYear();if(r===i){const d=e.getMonth(),x=t.getMonth();return d===x?0:d>x?1:-1}return r>i?1:-1}function N(e,t){const r=ve(e,t);if(r===0){const i=e.getDate(),d=t.getDate();return i===d?0:i>d?1:-1}return r}const ce=e=>new Date(e),Ye=e=>Array.isArray(e)?e.map(ce):ce(e);function ke(e,t){const r=ce(e);return r.setDate(r.getDate()+t),r}const we=e=>ke(e,-1),Ie=e=>ke(e,1),_e=()=>{const e=new Date;return e.setHours(0,0,0,0),e};function yt(e){const t=e[0].getTime();return(e[1].getTime()-t)/(1e3*60*60*24)+1}ue({},Ae,{modelValue:me(),filter:Function,formatter:{type:Function,default:(e,t)=>t}});const Dt=(e,t)=>32-new Date(e,t-1,32).getDate(),[vt]=Z("calendar-day");var wt=te({name:vt,props:{item:le(Object),color:String,index:Number,offset:We(0),rowHeight:String},emits:["click"],setup(e,{emit:t,slots:r}){const i=W(()=>{var o;const{item:u,index:k,color:T,offset:b,rowHeight:$}=e,S={height:$};if(u.type==="placeholder")return S.width="100%",S;if(k===0&&(S.marginLeft=`${100*b/7}%`),T)switch(u.type){case"end":case"start":case"start-end":case"multiple-middle":case"multiple-selected":S.background=T;break;case"middle":S.color=T;break}return b+(((o=u.date)==null?void 0:o.getDate())||1)>28&&(S.marginBottom=0),S}),d=()=>{e.item.type!=="disabled"&&t("click",e.item)},x=()=>{const{topInfo:o}=e.item;if(o||r["top-info"])return l("div",{class:Y("top-info")},[r["top-info"]?r["top-info"](e.item):o])},B=()=>{const{bottomInfo:o}=e.item;if(o||r["bottom-info"])return l("div",{class:Y("bottom-info")},[r["bottom-info"]?r["bottom-info"](e.item):o])},c=()=>{const{item:o,color:u,rowHeight:k}=e,{type:T,text:b}=o,$=[x(),b,B()];return T==="selected"?l("div",{class:Y("selected-day"),style:{width:k,height:k,background:u}},[$]):$};return()=>{const{type:o,className:u}=e.item;return o==="placeholder"?l("div",{class:Y("day"),style:i.value},null):l("div",{role:"gridcell",style:i.value,class:[Y("day",o),u],tabindex:o==="disabled"?void 0:-1,onClick:d},[c()])}}});const[_t]=Z("calendar-month"),bt={date:le(Date),type:String,color:String,minDate:le(Date),maxDate:le(Date),showMark:Boolean,rowHeight:se,formatter:Function,lazyRender:Boolean,currentDate:[Date,Array],allowSameDay:Boolean,showSubtitle:Boolean,showMonthTitle:Boolean,firstDayOfWeek:Number};var kt=te({name:_t,props:bt,emits:["click"],setup(e,{emit:t,slots:r}){const[i,d]=Ne(),x=G(),B=G(),c=rt(B),o=W(()=>gt(e.date)),u=W(()=>Le(e.rowHeight)),k=W(()=>{const f=e.date.getDay();return e.firstDayOfWeek?(f+7-e.firstDayOfWeek)%7:f}),T=W(()=>Dt(e.date.getFullYear(),e.date.getMonth()+1)),b=W(()=>i.value||!e.lazyRender),$=()=>o.value,S=f=>{const R=O=>e.currentDate.some(p=>N(p,O)===0);if(R(f)){const O=we(f),p=Ie(f),P=R(O),a=R(p);return P&&a?"multiple-middle":P?"end":a?"start":"multiple-selected"}return""},E=f=>{const[R,O]=e.currentDate;if(!R)return"";const p=N(f,R);if(!O)return p===0?"start":"";const P=N(f,O);return e.allowSameDay&&p===0&&P===0?"start-end":p===0?"start":P===0?"end":p>0&&P<0?"middle":""},m=f=>{const{type:R,minDate:O,maxDate:p,currentDate:P}=e;if(N(f,O)<0||N(f,p)>0)return"disabled";if(P===null)return"";if(Array.isArray(P)){if(R==="multiple")return S(f);if(R==="range")return E(f)}else if(R==="single")return N(f,P)===0?"selected":"";return""},w=f=>{if(e.type==="range"){if(f==="start"||f==="end")return q(f);if(f==="start-end")return`${q("start")}/${q("end")}`}},_=()=>{if(e.showMonthTitle)return l("div",{class:Y("month-title")},[r["month-title"]?r["month-title"]({date:e.date,text:o.value}):o.value])},y=()=>{if(e.showMark&&b.value)return l("div",{class:Y("month-mark")},[e.date.getMonth()+1])},n=W(()=>{const f=Math.ceil((T.value+k.value)/7);return Array(f).fill({type:"placeholder"})}),h=W(()=>{const f=[],R=e.date.getFullYear(),O=e.date.getMonth();for(let p=1;p<=T.value;p++){const P=new Date(R,O,p),a=m(P);let s={date:P,type:a,text:p,bottomInfo:w(a)};e.formatter&&(s=e.formatter(s)),f.push(s)}return f}),v=W(()=>h.value.filter(f=>f.type==="disabled")),ae=(f,R)=>{if(x.value){const O=he(x.value),p=n.value.length,a=(Math.ceil((R.getDate()+k.value)/7)-1)*O.height/p;Ee(f,O.top+a+f.scrollTop-he(f).top)}},M=(f,R)=>l(wt,{item:f,index:R,color:e.color,offset:k.value,rowHeight:u.value,onClick:O=>t("click",O)},re(r,["top-info","bottom-info"])),X=()=>l("div",{ref:x,role:"grid",class:Y("days")},[y(),(b.value?h:n).value.map(M)]);return Oe({getTitle:$,getHeight:()=>c.value,setVisible:d,scrollToDate:ae,disabledDays:v}),()=>l("div",{class:Y("month"),ref:B},[_(),X()])}});const[Tt]=Z("calendar-header");var xt=te({name:Tt,props:{date:Date,title:String,subtitle:String,showTitle:Boolean,showSubtitle:Boolean,firstDayOfWeek:Number},emits:["clickSubtitle"],setup(e,{slots:t,emit:r}){const i=()=>{if(e.showTitle){const c=e.title||q("title"),o=t.title?t.title():c;return l("div",{class:Y("header-title")},[o])}},d=c=>r("clickSubtitle",c),x=()=>{if(e.showSubtitle){const c=t.subtitle?t.subtitle({date:e.date,text:e.subtitle}):e.subtitle;return l("div",{class:Y("header-subtitle"),onClick:d},[c])}},B=()=>{const{firstDayOfWeek:c}=e,o=q("weekdays"),u=[...o.slice(c,7),...o.slice(0,c)];return l("div",{class:Y("weekdays")},[u.map(k=>l("span",{class:Y("weekday")},[k]))])};return()=>l("div",{class:Y("header")},[i(),x(),B()])}});const St={show:Boolean,type:J("single"),title:String,color:String,round:L,readonly:Boolean,poppable:L,maxRange:Q(null),position:J("bottom"),teleport:[String,Object],showMark:L,showTitle:L,formatter:Function,rowHeight:se,confirmText:String,rangePrompt:String,lazyRender:L,showConfirm:L,defaultDate:[Date,Array],allowSameDay:Boolean,showSubtitle:L,closeOnPopstate:L,showRangePrompt:L,confirmDisabledText:String,closeOnClickOverlay:L,safeAreaInsetTop:Boolean,safeAreaInsetBottom:L,minDate:{type:Date,validator:ge,default:_e},maxDate:{type:Date,validator:ge,default:()=>{const e=_e();return new Date(e.getFullYear(),e.getMonth()+6,e.getDate())}},firstDayOfWeek:{type:se,default:0,validator:e=>e>=0&&e<=6}};var Mt=te({name:ht,props:St,emits:["select","confirm","unselect","monthShow","overRange","update:show","clickSubtitle"],setup(e,{emit:t,slots:r}){const i=(a,s=e.minDate,g=e.maxDate)=>N(a,s)===-1?s:N(a,g)===1?g:a,d=(a=e.defaultDate)=>{const{type:s,minDate:g,maxDate:D,allowSameDay:H}=e;if(a===null)return a;const A=_e();if(s==="range"){Array.isArray(a)||(a=[]);const z=i(a[0]||A,g,H?D:we(D)),C=i(a[1]||A,H?g:Ie(g));return[z,C]}return s==="multiple"?Array.isArray(a)?a.map(z=>i(z)):[i(A)]:((!a||Array.isArray(a))&&(a=A),i(a))};let x;const B=G(),c=G({text:"",date:void 0}),o=G(d()),[u,k]=mt(),T=W(()=>e.firstDayOfWeek?+e.firstDayOfWeek%7:0),b=W(()=>{const a=[],s=new Date(e.minDate);s.setDate(1);do a.push(new Date(s)),s.setMonth(s.getMonth()+1);while(ve(s,e.maxDate)!==1);return a}),$=W(()=>{if(o.value){if(e.type==="range")return!o.value[0]||!o.value[1];if(e.type==="multiple")return!o.value.length}return!o.value}),S=()=>o.value,E=()=>{const a=Pe(B.value),s=a+x,g=b.value.map((C,V)=>u.value[V].getHeight()),D=g.reduce((C,V)=>C+V,0);if(s>D&&a>0)return;let H=0,A;const z=[-1,-1];for(let C=0;C<b.value.length;C++){const V=u.value[C];H<=s&&H+g[C]>=a&&(z[1]=C,A||(A=V,z[0]=C),u.value[C].showed||(u.value[C].showed=!0,t("monthShow",{date:V.date,title:V.getTitle()}))),H+=g[C]}b.value.forEach((C,V)=>{const Te=V>=z[0]-1&&V<=z[1]+1;u.value[V].setVisible(Te)}),A&&(c.value={text:A.getTitle(),date:A.date})},m=a=>{de(()=>{b.value.some((s,g)=>ve(s,a)===0?(B.value&&u.value[g].scrollToDate(B.value,a),!0):!1),E()})},w=()=>{if(!(e.poppable&&!e.show))if(o.value){const a=e.type==="single"?o.value:o.value[0];ge(a)&&m(a)}else de(E)},_=()=>{e.poppable&&!e.show||(de(()=>{x=Math.floor(he(B).height)}),w())},y=(a=d())=>{o.value=a,w()},n=a=>{const{maxRange:s,rangePrompt:g,showRangePrompt:D}=e;return s&&yt(a)>+s?(D&&ye(g||q("rangePrompt",s)),t("overRange"),!1):!0},h=()=>{var a;return t("confirm",(a=o.value)!=null?a:Ye(o.value))},v=(a,s)=>{const g=D=>{o.value=D,t("select",Ye(D))};if(s&&e.type==="range"&&!n(a)){g([a[0],ke(a[0],+e.maxRange-1)]);return}g(a),s&&!e.showConfirm&&h()},ae=(a,s,g)=>{var D;return(D=a.find(H=>N(s,H.date)===-1&&N(H.date,g)===-1))==null?void 0:D.date},M=W(()=>u.value.reduce((a,s)=>{var g,D;return a.push(...(D=(g=s.disabledDays)==null?void 0:g.value)!=null?D:[]),a},[])),X=a=>{if(e.readonly||!a.date)return;const{date:s}=a,{type:g}=e;if(g==="range"){if(!o.value){v([s]);return}const[D,H]=o.value;if(D&&!H){const A=N(s,D);if(A===1){const z=ae(M.value,D,s);if(z){const C=we(z);N(D,C)===-1?v([D,C]):v([s])}else v([D,s],!0)}else A===-1?v([s]):e.allowSameDay&&v([s,s],!0)}else v([s])}else if(g==="multiple"){if(!o.value){v([s]);return}const D=o.value,H=D.findIndex(A=>N(A,s)===0);if(H!==-1){const[A]=D.splice(H,1);t("unselect",ce(A))}else e.maxRange&&D.length>=+e.maxRange?ye(e.rangePrompt||q("rangePrompt",e.maxRange)):v([...D,s])}else v(s,!0)},f=a=>t("update:show",a),R=(a,s)=>{const g=s!==0||!e.showSubtitle;return l(kt,Ue({ref:k(s),date:a,currentDate:o.value,showMonthTitle:g,firstDayOfWeek:T.value},re(e,["type","color","minDate","maxDate","showMark","formatter","rowHeight","lazyRender","showSubtitle","allowSameDay"]),{onClick:X}),re(r,["top-info","bottom-info","month-title"]))},O=()=>{if(r.footer)return r.footer();if(e.showConfirm){const a=r["confirm-text"],s=$.value,g=s?e.confirmDisabledText:e.confirmText;return l(dt,{round:!0,block:!0,type:"primary",color:e.color,class:Y("confirm"),disabled:s,nativeType:"button",onClick:h},{default:()=>[a?a({disabled:s}):g||q("confirm")]})}},p=()=>l("div",{class:[Y("footer"),{"van-safe-area-bottom":e.safeAreaInsetBottom}]},[O()]),P=()=>l("div",{class:Y()},[l(xt,{date:c.value.date,title:e.title,subtitle:c.value.text,showTitle:e.showTitle,showSubtitle:e.showSubtitle,firstDayOfWeek:T.value,onClickSubtitle:a=>t("clickSubtitle",a)},re(r,["title","subtitle"])),l("div",{ref:B,class:Y("body"),onScroll:E},[b.value.map(R)]),p()]);return ie(()=>e.show,_),ie(()=>[e.type,e.minDate,e.maxDate],()=>y(d(o.value))),ie(()=>e.defaultDate,(a=null)=>{o.value=a,w()}),Oe({reset:y,scrollToDate:m,getSelectedDate:S}),ze(_),()=>e.poppable?l(Ve,{show:e.show,class:Y("popup"),round:e.round,position:e.position,closeable:e.showTitle||e.showSubtitle,teleport:e.teleport,closeOnPopstate:e.closeOnPopstate,safeAreaInsetTop:e.safeAreaInsetTop,closeOnClickOverlay:e.closeOnClickOverlay,"onUpdate:show":f},{default:P}):P()}});const pt=be(Mt),[Yt,oe,Bt]=Z("pull-refresh"),$e=50,Rt=["pulling","loosing","success"],Ct={disabled:Boolean,modelValue:Boolean,headHeight:Q($e),successText:String,pullingText:String,loosingText:String,loadingText:String,pullDistance:se,successDuration:Q(500),animationDuration:Q(300)};var Ot=te({name:Yt,props:Ct,emits:["change","refresh","update:modelValue"],setup(e,{emit:t,slots:r}){let i;const d=G(),x=G(),B=Ge(d),c=De({status:"normal",distance:0,duration:0}),o=je(),u=()=>{if(e.headHeight!==$e)return{height:`${e.headHeight}px`}},k=()=>c.status!=="loading"&&c.status!=="success"&&!e.disabled,T=n=>{const h=+(e.pullDistance||e.headHeight);return n>h&&(n<h*2?n=h+(n-h)/2:n=h*1.5+(n-h*2)/4),Math.round(n)},b=(n,h)=>{const v=+(e.pullDistance||e.headHeight);c.distance=n,h?c.status="loading":n===0?c.status="normal":n<v?c.status="pulling":c.status="loosing",t("change",{status:c.status,distance:n})},$=()=>{const{status:n}=c;return n==="normal"?"":e[`${n}Text`]||Bt(n)},S=()=>{const{status:n,distance:h}=c;if(r[n])return r[n]({distance:h});const v=[];return Rt.includes(n)&&v.push(l("div",{class:oe("text")},[$()])),n==="loading"&&v.push(l(Ce,{class:oe("loading")},{default:$})),v},E=()=>{c.status="success",setTimeout(()=>{b(0)},+e.successDuration)},m=n=>{i=Pe(B.value)===0,i&&(c.duration=0,o.start(n))},w=n=>{k()&&m(n)},_=n=>{if(k()){i||m(n);const{deltaY:h}=o;o.move(n),i&&h.value>=0&&o.isVertical()&&(Re(n),b(T(h.value)))}},y=()=>{i&&o.deltaY.value&&k()&&(c.duration=+e.animationDuration,c.status==="loosing"?(b(+e.headHeight,!0),t("update:modelValue",!0),Xe(()=>t("refresh"))):b(0))};return ie(()=>e.modelValue,n=>{c.duration=+e.animationDuration,n?b(+e.headHeight,!0):r.success||e.successText?E():b(0,!1)}),qe("touchmove",_,{target:x}),()=>{var n;const h={transitionDuration:`${c.duration}ms`,transform:c.distance?`translate3d(0,${c.distance}px, 0)`:""};return l("div",{ref:d,class:oe()},[l("div",{ref:x,class:oe("track"),style:h,onTouchstartPassive:w,onTouchend:y,onTouchcancel:y},[l("div",{class:oe("head"),style:u()},[S()]),(n=r.default)==null?void 0:n.call(r)])])}}});const Pt=be(Ot);const At=e=>(et("data-v-dd77f65d"),e=e(),tt(),e),It={class:"container"},$t={class:"dateContainer"},Ht={class:"SlideButton"},Ft=["onClick"],Wt={style:{"font-size":"14px",display:"flex","justify-content":"center","align-items":"flex-end"}},Nt={class:"SlideButton"},Lt=At(()=>F("div",{style:{width:"100%",height:"50px"}},null,-1)),Et={__name:"index",setup(e){let t=De({minDate:new Date(I().year(),I().month()-1,1),maxDate:new Date(I().year(),I().month()+1,15),array:[],dateFlag:!1,addDateFlag:!0,week:["周日","周一","周二","周三","周四","周五","周六"],center:!0,right:!1,left:!1,isShow:!0,toDay:"",dateBackgroundText:[],loading:!1}),r=G(""),i=G(1),d=De({page_index:1,page_size:30,startTime:"",endTime:"",GetWatchListInitArray:[]});const x=async()=>{t.loading=!0,d.startTime=I().format("YYYY-MM-DD"),d.endTime=I().add(30,"day").format("YYYY-MM-DD"),await S(),t.loading=!1,ye("刷新成功!")},B=m=>{const w=Number(I(m.date).format("M")),_=Number(I(m.date).format("D"));return t.dateBackgroundText.forEach((y,n)=>{const h=Number(I(y).format("M")),v=Number(I(y).format("D"));w===h&&_===v&&(m.bottomInfo="值班")}),m},c=m=>{o(I(m).format("YYYY-MM-DD"))},o=m=>{d.endTime=m,d.startTime=m,S()},u=()=>{const m=I().startOf("week"),w=[];t.array=[],t.dateFlag===!1&&t.addDateFlag===!0?i.value=i.value-2:i.value--;const _=i.value;for(let y=0+7*_;y<7+7*_;y++){const n=m.add(y,"day");w.push({date:n.format("YYYY-MM-DD"),dateDay:n.format("D"),week:t.week})}t.dateFlag=!0,t.array=w,t.center=!1,t.right=!1,setTimeout(()=>{t.left=!0},10),t.left=!1},k=()=>{t.dateFlag===!0&&t.addDateFlag,i.value++,t.dateFlag===!1&&t.addDateFlag===!0&&(i.value=1);let m=i.value;const _=I().startOf("week"),y=[];console.log("🚀🚀🚀,","dateArrayLenght_i.value",i.value,"value",m);for(let n=0+7*m;n<7+7*m;n++){const h=_.add(n,"day");y.push({date:h.format("YYYY-MM-DD"),dateDay:h.format("D"),week:t.week})}t.addDateFlag=!1,t.array=y,t.center=!1,t.left=!1,setTimeout(()=>{t.right=!0},10),t.right=!1},T=()=>{const w=I().startOf("week"),_=[];for(let y=0;y<7;y++){const n=w.add(y,"day");_.push(n.format("YYYY-MM-DD")),t.array.push({date:n.format("YYYY-MM-DD"),dateDay:n.format("D"),week:t.week})}console.log("🚀🚀🚀,",I().format("YYYY-MM-DD"),t.array),r.value=t.array.length},b=()=>{pe.push({name:"myDuty"})},$=()=>{pe.push({name:"signList"})},S=async()=>{let w=await(void 0)({is_lead:3,page_index:d.page_index,page_size:d.page_size,start_time:d.startTime,end_time:d.endTime});d.GetWatchListInitArray=w.response.data;let _=1;_===1&&(d.GetWatchListInitArray.forEach((y,n)=>{t.dateBackgroundText.push(y.watch_date)}),_++)},E=()=>{const m=I(),w=m.startOf("day").format("YYYY-MM-DD"),_=m.endOf("month").format("YYYY-MM-DD");d.startTime=w,d.endTime=_};return Ke(()=>{E(),S(),T(),console.log("获取cookie",Qe.get())}),(m,w)=>{const _=pt,y=Be,n=ot,h=st,v=lt,ae=Pt;return ne(),xe(ae,{modelValue:j(t).loading,"onUpdate:modelValue":w[0]||(w[0]=M=>j(t).loading=M),onRefresh:x},{default:U(()=>[F("div",It,[l(_,{type:"single","show-subtitle":!1,poppable:!1,"show-confirm":!1,style:{height:"350px"},"show-title":!1,onConfirm:c,formatter:B,minDate:j(t).minDate,maxDate:j(t).maxDate},null,8,["minDate","maxDate"]),l(h,{style:{width:"100%","margin-top":"10px"}},{default:U(()=>[F("div",$t,[F("div",{class:"left",onClick:u},[F("span",Ht,[l(y,{name:"arrow-left"})])]),(ne(!0),fe(Me,null,Se(j(t).array,(M,X)=>(ne(),fe("div",{class:Ze(j(t).center?"content animate__animated animate__heartBeat":j(t).right?"content animate__animated animate__backInLeft":j(t).left?"content animate__animated animate__backInRight":"content animate__animated animate__heartBeat"),key:X},[F("span",{onClick:f=>o(M.date),style:{display:"flex","justify-content":"center"}},K(M.dateDay)+"号",9,Ft),F("span",Wt,K(M.week[X]),1)],2))),128)),F("div",{class:"right",onClick:k},[F("span",Nt,[l(y,{name:"arrow"})])])]),l(n,{icon:"manager-o",onClick:b,"is-link":"",class:"cardTitle",title:"我的值班",value:"个人值班记录"}),l(n,{icon:"label-o",onClick:$,"is-link":"",class:"cardTitle",title:"签到列表",value:"教师签到"})]),_:1}),(ne(!0),fe(Me,null,Se(j(d).GetWatchListInitArray,(M,X)=>(ne(),xe(h,{key:X,inset:"",style:{width:"100%"},class:"cardContainer"},{default:U(()=>[l(n,{class:"cardContent",title:M.username},{extra:U(()=>[l(v,{type:"primary",plain:""},{default:U(()=>[F("span",null,K(M.card_name),1)]),_:2},1024),l(v,{color:["","#7232dd"][M.is_lead],type:"primary",plain:"",style:{"margin-left":"10px"}},{default:U(()=>[F("span",null,K(["值班教师","值班领导"][M.is_lead]),1)]),_:2},1032,["color"])]),_:2},1032,["title"]),l(n,{class:"cardContent",title:"日期"},{extra:U(()=>[l(v,{type:"primary",plain:""},{default:U(()=>[F("span",null,K(M.watch_date),1)]),_:2},1024),l(v,{type:"primary",plain:"",style:{"margin-left":"10px"}},{default:U(()=>[F("span",null,K(M.watch_hour_time),1)]),_:2},1024)]),_:2},1024),l(n,{class:"cardContent",title:"类型"},{extra:U(()=>[l(v,{type:"primary",plain:""},{default:U(()=>[F("span",null,K(M.watchtypename+"-"+M.dept_name+"-"+M.campusname),1)]),_:2},1024)]),_:2},1024)]),_:2},1024))),128)),Lt])]),_:1},8,["modelValue"])}}},Gt=Je(Et,[["__scopeId","data-v-dd77f65d"]]);export{Gt as default};
:root{--van-empty-padding: var(--van-padding-xl) 0;--van-empty-image-size: 160px;--van-empty-description-margin-top: var(--van-padding-md);--van-empty-description-padding: 0 60px;--van-empty-description-color: var(--van-text-color-2);--van-empty-description-font-size: var(--van-font-size-md);--van-empty-description-line-height: var(--van-line-height-md);--van-empty-bottom-margin-top: 24px}.van-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;box-sizing:border-box;padding:var(--van-empty-padding)}.van-empty__image{width:var(--van-empty-image-size);height:var(--van-empty-image-size)}.van-empty__image img{width:100%;height:100%}.van-empty__description{margin-top:var(--van-empty-description-margin-top);padding:var(--van-empty-description-padding);color:var(--van-empty-description-color);font-size:var(--van-empty-description-font-size);line-height:var(--van-empty-description-line-height)}.van-empty__bottom{margin-top:var(--van-empty-bottom-margin-top)}.van-theme-dark .van-empty{opacity:.5}
:root{--van-nav-bar-height: 46px;--van-nav-bar-background: var(--van-background-2);--van-nav-bar-arrow-size: 16px;--van-nav-bar-icon-color: var(--van-primary-color);--van-nav-bar-text-color: var(--van-primary-color);--van-nav-bar-title-font-size: var(--van-font-size-lg);--van-nav-bar-title-text-color: var(--van-text-color);--van-nav-bar-z-index: 1}.van-nav-bar{position:relative;z-index:var(--van-nav-bar-z-index);line-height:var(--van-line-height-lg);text-align:center;background:var(--van-nav-bar-background);-webkit-user-select:none;-moz-user-select:none;user-select:none}.van-nav-bar--fixed{position:fixed;top:0;left:0;width:100%}.van-nav-bar--safe-area-inset-top{padding-top:constant(safe-area-inset-top);padding-top:env(safe-area-inset-top)}.van-nav-bar .van-icon{color:var(--van-nav-bar-icon-color)}.van-nav-bar__content{position:relative;display:flex;align-items:center;height:var(--van-nav-bar-height)}.van-nav-bar__arrow{margin-right:var(--van-padding-base);font-size:var(--van-nav-bar-arrow-size)}.van-nav-bar__title{max-width:60%;margin:0 auto;color:var(--van-nav-bar-title-text-color);font-weight:var(--van-font-bold);font-size:var(--van-nav-bar-title-font-size)}.van-nav-bar__left,.van-nav-bar__right{position:absolute;top:0;bottom:0;display:flex;align-items:center;padding:0 var(--van-padding-md);font-size:var(--van-font-size-md)}.van-nav-bar__left{left:0}.van-nav-bar__right{right:0}.van-nav-bar__text{color:var(--van-nav-bar-text-color)}
import{g as v,b as w,d as G,a as e,e as k,m as M,w as B}from"./index-26130194.js";let S=0;function C(){const d=v(),{name:a="unknown"}=(d==null?void 0:d.type)||{};return`${a}-${++S}`}const[b,s]=w("empty"),z={image:M("default"),imageSize:[Number,String,Array],description:String};var A=G({name:b,props:z,setup(d,{slots:a}){const x=()=>{const l=a.description?a.description():d.description;if(l)return e("p",{class:s("description")},[l])},F=()=>{if(a.default)return e("div",{class:s("bottom")},[a.default()])},f=C(),r=l=>`${f}-${l}`,t=l=>`url(#${r(l)})`,n=(l,o,D)=>e("stop",{"stop-color":l,offset:`${o}%`,"stop-opacity":D},null),i=(l,o)=>[n(l,0),n(o,100)],u=l=>[e("defs",null,[e("radialGradient",{id:r(l),cx:"50%",cy:"54%",fx:"50%",fy:"54%",r:"297%",gradientTransform:"matrix(-.16 0 0 -.33 .58 .72)"},[n("#EBEDF0",0),n("#F2F3F5",100,.3)])]),e("ellipse",{fill:t(l),opacity:".8",cx:"80",cy:"140",rx:"46",ry:"8"},null)],c=()=>[e("defs",null,[e("linearGradient",{id:r("a"),x1:"64%",y1:"100%",x2:"64%"},[n("#FFF",0,.5),n("#F2F3F5",100)])]),e("g",{opacity:".8"},[e("path",{d:"M36 131V53H16v20H2v58h34z",fill:t("a")},null),e("path",{d:"M123 15h22v14h9v77h-31V15z",fill:t("a")},null)])],h=()=>[e("defs",null,[e("linearGradient",{id:r("b"),x1:"64%",y1:"97%",x2:"64%",y2:"0%"},[n("#F2F3F5",0,.3),n("#F2F3F5",100)])]),e("g",{opacity:".8"},[e("path",{d:"M87 6c3 0 7 3 8 6a8 8 0 1 1-1 16H80a7 7 0 0 1-8-6c0-4 3-7 6-7 0-5 4-9 9-9Z",fill:t("b")},null),e("path",{d:"M19 23c2 0 3 1 4 3 2 0 4 2 4 4a4 4 0 0 1-4 3v1h-7v-1l-1 1c-2 0-3-2-3-4 0-1 1-3 3-3 0-2 2-4 4-4Z",fill:t("b")},null)])],y=()=>e("svg",{viewBox:"0 0 160 160"},[e("defs",null,[e("linearGradient",{id:r(1),x1:"64%",y1:"100%",x2:"64%"},[n("#FFF",0,.5),n("#F2F3F5",100)]),e("linearGradient",{id:r(2),x1:"50%",x2:"50%",y2:"84%"},[n("#EBEDF0",0),n("#DCDEE0",100,0)]),e("linearGradient",{id:r(3),x1:"100%",x2:"100%",y2:"100%"},[i("#EAEDF0","#DCDEE0")]),e("radialGradient",{id:r(4),cx:"50%",cy:"0%",fx:"50%",fy:"0%",r:"100%",gradientTransform:"matrix(0 1 -.54 0 .5 -.5)"},[n("#EBEDF0",0),n("#FFF",100,0)])]),e("g",{fill:"none"},[c(),e("path",{fill:t(4),d:"M0 139h160v21H0z"},null),e("path",{d:"M80 54a7 7 0 0 1 3 13v27l-2 2h-2a2 2 0 0 1-2-2V67a7 7 0 0 1 3-13z",fill:t(2)},null),e("g",{opacity:".6","stroke-linecap":"round","stroke-width":"7"},[e("path",{d:"M64 47a19 19 0 0 0-5 13c0 5 2 10 5 13",stroke:t(3)},null),e("path",{d:"M53 36a34 34 0 0 0 0 48",stroke:t(3)},null),e("path",{d:"M95 73a19 19 0 0 0 6-13c0-5-2-9-6-13",stroke:t(3)},null),e("path",{d:"M106 84a34 34 0 0 0 0-48",stroke:t(3)},null)]),e("g",{transform:"translate(31 105)"},[e("rect",{fill:"#EBEDF0",width:"98",height:"34",rx:"2"},null),e("rect",{fill:"#FFF",x:"9",y:"8",width:"80",height:"18",rx:"1.1"},null),e("rect",{fill:"#EBEDF0",x:"15",y:"12",width:"18",height:"6",rx:"1.1"},null)])])]),g=()=>e("svg",{viewBox:"0 0 160 160"},[e("defs",null,[e("linearGradient",{x1:"50%",x2:"50%",y2:"100%",id:r(5)},[i("#F2F3F5","#DCDEE0")]),e("linearGradient",{x1:"95%",y1:"48%",x2:"5.5%",y2:"51%",id:r(6)},[i("#EAEDF1","#DCDEE0")]),e("linearGradient",{y1:"45%",x2:"100%",y2:"54%",id:r(7)},[i("#EAEDF1","#DCDEE0")])]),c(),h(),e("g",{transform:"translate(36 50)",fill:"none"},[e("g",{transform:"translate(8)"},[e("rect",{fill:"#EBEDF0",opacity:".6",x:"38",y:"13",width:"36",height:"53",rx:"2"},null),e("rect",{fill:t(5),width:"64",height:"66",rx:"2"},null),e("rect",{fill:"#FFF",x:"6",y:"6",width:"52",height:"55",rx:"1"},null),e("g",{transform:"translate(15 17)",fill:t(6)},[e("rect",{width:"34",height:"6",rx:"1"},null),e("path",{d:"M0 14h34v6H0z"},null),e("rect",{y:"28",width:"34",height:"6",rx:"1"},null)])]),e("rect",{fill:t(7),y:"61",width:"88",height:"28",rx:"1"},null),e("rect",{fill:"#F7F8FA",x:"29",y:"72",width:"30",height:"6",rx:"1"},null)])]),E=()=>e("svg",{viewBox:"0 0 160 160"},[e("defs",null,[e("linearGradient",{x1:"50%",x2:"50%",y2:"100%",id:r(8)},[i("#EAEDF1","#DCDEE0")])]),c(),h(),u("c"),e("path",{d:"m59 60 21 21 21-21h3l9 9v3L92 93l21 21v3l-9 9h-3l-21-21-21 21h-3l-9-9v-3l21-21-21-21v-3l9-9h3Z",fill:t(8)},null)]),p=()=>e("svg",{viewBox:"0 0 160 160"},[e("defs",null,[e("linearGradient",{x1:"50%",y1:"100%",x2:"50%",id:r(9)},[i("#EEE","#D8D8D8")]),e("linearGradient",{x1:"100%",y1:"50%",y2:"50%",id:r(10)},[i("#F2F3F5","#DCDEE0")]),e("linearGradient",{x1:"50%",x2:"50%",y2:"100%",id:r(11)},[i("#F2F3F5","#DCDEE0")]),e("linearGradient",{x1:"50%",x2:"50%",y2:"100%",id:r(12)},[i("#FFF","#F7F8FA")])]),c(),h(),u("d"),e("g",{transform:"rotate(-45 113 -4)",fill:"none"},[e("rect",{fill:t(9),x:"24",y:"52.8",width:"5.8",height:"19",rx:"1"},null),e("rect",{fill:t(10),x:"22.1",y:"67.3",width:"9.9",height:"28",rx:"1"},null),e("circle",{stroke:t(11),"stroke-width":"8",cx:"27",cy:"27",r:"27"},null),e("circle",{fill:t(12),cx:"27",cy:"27",r:"16"},null),e("path",{d:"M37 7c-8 0-15 5-16 12",stroke:t(11),"stroke-width":"3",opacity:".5","stroke-linecap":"round",transform:"rotate(45 29 13)"},null)])]),m=()=>{var l;if(a.image)return a.image();const o={error:E,search:p,network:y,default:g};return((l=o[d.image])==null?void 0:l.call(o))||e("img",{src:d.image},null)};return()=>e("div",{class:s()},[e("div",{class:s("image"),style:k(d.imageSize)},[m()]),x(),F()])}});const $=B(A);export{$ as E};
因为 它太大了无法显示 源差异 。您可以改为 查看blob。
import{u as y,W as f,f as x,o as C,c as g,a,a2 as l,h as t,F as v,a1 as n,a6 as r,j as h}from"./index-26130194.js";import{a as w,T as N,C as k}from"./index-2cb722d3.js";import{N as B}from"./index-eb7bb0a6.js";import"./use-height-4547cdf4.js";const b={class:"container"},F={__name:"index",setup(L){const c=y();let e=f({data:{}});const _=async()=>{const i=await(void 0)({id:c.currentRoute.value.query.id});e.data=i.response};x(()=>{_()});const d=()=>c.push({name:"signList"});return(p,i)=>{const u=B,s=N,o=k,m=w;return C(),g(v,null,[a(u,{title:"值班信息","left-text":"返回","left-arrow":"",onClickLeft:d}),l("div",b,[a(m,{class:"cardContainer",inset:""},{default:t(()=>[a(o,{class:"cardContent",title:n(e).data.username},{extra:t(()=>[a(s,{type:"primary",plain:""},{default:t(()=>[l("span",null,r(n(e).data.card_name),1)]),_:1}),a(s,{color:"#7232dd",type:"primary",plain:"",style:{"margin-left":"10px"}},{default:t(()=>[h(r(["值班教师","值班领导"][n(e).data.is_lead]),1)]),_:1})]),_:1},8,["title"]),a(o,{class:"cardContent",title:"手机号"},{extra:t(()=>[a(s,{type:"primary",plain:""},{default:t(()=>[l("span",null,r(n(e).data.mobile),1)]),_:1})]),_:1}),a(o,{class:"cardContent",title:"日期"},{extra:t(()=>[a(s,{type:"primary",plain:""},{default:t(()=>[l("span",null,r(n(e).data.watch_date),1)]),_:1})]),_:1}),a(o,{class:"cardContent",title:"时段"},{extra:t(()=>[a(s,{type:"primary",plain:"",style:{"margin-left":"10px"}},{default:t(()=>[l("span",null,r(n(e).data.watch_hour_time),1)]),_:1})]),_:1}),a(o,{class:"cardContent",title:"类型"},{extra:t(()=>[a(s,{type:"primary",plain:""},{default:t(()=>[l("span",null,r(n(e).data.watchtypename+"-"+n(e).data.dept_name+"-"+n(e).data.campusname),1)]),_:1})]),_:1})]),_:1})])],64)}}};export{F as default};
.container .cardContainer{margin-top:10px;width:95%;background-color:#fff;height:20%}.container .cardContainer .cardContent{//height: 150px}
import{u as b}from"./use-height-4547cdf4.js";import{a as r,b as I,d as R,r as w,n as A,t as s,a9 as o,aa as C,I as P,ab as L,w as N}from"./index-26130194.js";function S(e,l){const t=b(e,!0);return i=>r("div",{class:l("placeholder"),style:{height:t.value?`${t.value}px`:void 0}},[i()])}const[y,a]=I("nav-bar"),E={title:String,fixed:Boolean,zIndex:A,border:s,leftText:String,rightText:String,leftArrow:Boolean,placeholder:Boolean,safeAreaInsetTop:Boolean,clickable:s};var O=R({name:y,props:E,emits:["clickLeft","clickRight"],setup(e,{emit:l,slots:t}){const i=w(),f=S(i,a),d=n=>l("clickLeft",n),h=n=>l("clickRight",n),u=()=>t.left?t.left():[e.leftArrow&&r(P,{class:a("arrow"),name:"arrow-left"},null),e.leftText&&r("span",{class:a("text")},[e.leftText])],g=()=>t.right?t.right():r("span",{class:a("text")},[e.rightText]),c=()=>{const{title:n,fixed:x,border:v,zIndex:T}=e,k=L(T),B=e.leftArrow||e.leftText||t.left,m=e.rightText||t.right;return r("div",{ref:i,style:k,class:[a({fixed:x}),{[C]:v,"van-safe-area-top":e.safeAreaInsetTop}]},[r("div",{class:a("content")},[B&&r("div",{class:[a("left"),e.clickable?o:""],onClick:d},[u()]),r("div",{class:[a("title"),"van-ellipsis"]},[t.title?t.title():n]),m&&r("div",{class:[a("right"),e.clickable?o:""],onClick:h},[g()])])])};return()=>e.fixed&&e.placeholder?f(c):c()}});const D=N(O);export{D as N};
:root{--van-pull-refresh-head-height: 50px;--van-pull-refresh-head-font-size: var(--van-font-size-md);--van-pull-refresh-head-text-color: var(--van-text-color-2);--van-pull-refresh-loading-icon-size: 16px}.van-pull-refresh{overflow:hidden}.van-pull-refresh__track{position:relative;height:100%;transition-property:transform}.van-pull-refresh__head{position:absolute;left:0;width:100%;height:var(--van-pull-refresh-head-height);overflow:hidden;color:var(--van-pull-refresh-head-text-color);font-size:var(--van-pull-refresh-head-font-size);line-height:var(--van-pull-refresh-head-height);text-align:center;transform:translateY(-100%)}.van-pull-refresh__loading .van-loading__spinner{width:var(--van-pull-refresh-loading-icon-size);height:var(--van-pull-refresh-loading-icon-size)}:root{--van-button-mini-height: 24px;--van-button-mini-padding: 0 var(--van-padding-base);--van-button-mini-font-size: var(--van-font-size-xs);--van-button-small-height: 32px;--van-button-small-padding: 0 var(--van-padding-xs);--van-button-small-font-size: var(--van-font-size-sm);--van-button-normal-padding: 0 15px;--van-button-normal-font-size: var(--van-font-size-md);--van-button-large-height: 50px;--van-button-default-height: 44px;--van-button-default-line-height: 1.2;--van-button-default-font-size: var(--van-font-size-lg);--van-button-default-color: var(--van-text-color);--van-button-default-background: var(--van-background-2);--van-button-default-border-color: var(--van-gray-4);--van-button-primary-color: var(--van-white);--van-button-primary-background: var(--van-primary-color);--van-button-primary-border-color: var(--van-primary-color);--van-button-success-color: var(--van-white);--van-button-success-background: var(--van-success-color);--van-button-success-border-color: var(--van-success-color);--van-button-danger-color: var(--van-white);--van-button-danger-background: var(--van-danger-color);--van-button-danger-border-color: var(--van-danger-color);--van-button-warning-color: var(--van-white);--van-button-warning-background: var(--van-warning-color);--van-button-warning-border-color: var(--van-warning-color);--van-button-border-width: var(--van-border-width);--van-button-radius: var(--van-radius-md);--van-button-round-radius: var(--van-radius-max);--van-button-plain-background: var(--van-white);--van-button-disabled-opacity: var(--van-disabled-opacity);--van-button-icon-size: 1.2em;--van-button-loading-icon-size: 20px}.van-theme-dark{--van-button-plain-background: transparent}.van-button{position:relative;display:inline-block;box-sizing:border-box;height:var(--van-button-default-height);margin:0;padding:0;font-size:var(--van-button-default-font-size);line-height:var(--van-button-default-line-height);text-align:center;border-radius:var(--van-button-radius);cursor:pointer;transition:opacity var(--van-duration-fast);-webkit-appearance:none;-webkit-font-smoothing:auto}.van-button:before{position:absolute;top:50%;left:50%;width:100%;height:100%;background:var(--van-black);border:inherit;border-color:var(--van-black);border-radius:inherit;transform:translate(-50%,-50%);opacity:0;content:" "}.van-button:active:before{opacity:.1}.van-button--loading:before,.van-button--disabled:before{display:none}.van-button--default{color:var(--van-button-default-color);background:var(--van-button-default-background);border:var(--van-button-border-width) solid var(--van-button-default-border-color)}.van-button--primary{color:var(--van-button-primary-color);background:var(--van-button-primary-background);border:var(--van-button-border-width) solid var(--van-button-primary-border-color)}.van-button--success{color:var(--van-button-success-color);background:var(--van-button-success-background);border:var(--van-button-border-width) solid var(--van-button-success-border-color)}.van-button--danger{color:var(--van-button-danger-color);background:var(--van-button-danger-background);border:var(--van-button-border-width) solid var(--van-button-danger-border-color)}.van-button--warning{color:var(--van-button-warning-color);background:var(--van-button-warning-background);border:var(--van-button-border-width) solid var(--van-button-warning-border-color)}.van-button--plain{background:var(--van-button-plain-background)}.van-button--plain.van-button--primary{color:var(--van-button-primary-background)}.van-button--plain.van-button--success{color:var(--van-button-success-background)}.van-button--plain.van-button--danger{color:var(--van-button-danger-background)}.van-button--plain.van-button--warning{color:var(--van-button-warning-background)}.van-button--large{width:100%;height:var(--van-button-large-height)}.van-button--normal{padding:var(--van-button-normal-padding);font-size:var(--van-button-normal-font-size)}.van-button--small{height:var(--van-button-small-height);padding:var(--van-button-small-padding);font-size:var(--van-button-small-font-size)}.van-button__loading{color:inherit;font-size:inherit}.van-button__loading .van-loading__spinner{color:currentColor;width:var(--van-button-loading-icon-size);height:var(--van-button-loading-icon-size)}.van-button--mini{height:var(--van-button-mini-height);padding:var(--van-button-mini-padding);font-size:var(--van-button-mini-font-size)}.van-button--mini+.van-button--mini{margin-left:var(--van-padding-base)}.van-button--block{display:block;width:100%}.van-button--disabled{cursor:not-allowed;opacity:var(--van-button-disabled-opacity)}.van-button--loading{cursor:default}.van-button--round{border-radius:var(--van-button-round-radius)}.van-button--square{border-radius:0}.van-button__content{display:flex;align-items:center;justify-content:center;height:100%}.van-button__content:before{content:" "}.van-button__icon{font-size:var(--van-button-icon-size);line-height:inherit}.van-button__icon+.van-button__text,.van-button__loading+.van-button__text,.van-button__text+.van-button__icon,.van-button__text+.van-button__loading{margin-left:var(--van-padding-base)}.van-button--hairline{border-width:0}.van-button--hairline:after{border-color:inherit;border-radius:calc(var(--van-button-radius) * 2)}.van-button--hairline.van-button--round:after{border-radius:var(--van-button-round-radius)}.van-button--hairline.van-button--square:after{border-radius:0}:root{--van-sticky-z-index: 99}.van-sticky--fixed{position:fixed;z-index:var(--van-sticky-z-index)}:root{--van-swipe-indicator-size: 6px;--van-swipe-indicator-margin: var(--van-padding-sm);--van-swipe-indicator-active-opacity: 1;--van-swipe-indicator-inactive-opacity: .3;--van-swipe-indicator-active-background: var(--van-primary-color);--van-swipe-indicator-inactive-background: var(--van-border-color)}.van-swipe{position:relative;overflow:hidden;transform:translateZ(0);cursor:grab;-webkit-user-select:none;-moz-user-select:none;user-select:none}.van-swipe__track{display:flex;height:100%}.van-swipe__track--vertical{flex-direction:column}.van-swipe__indicators{position:absolute;bottom:var(--van-swipe-indicator-margin);left:50%;display:flex;transform:translate(-50%)}.van-swipe__indicators--vertical{top:50%;bottom:auto;left:var(--van-swipe-indicator-margin);flex-direction:column;transform:translateY(-50%)}.van-swipe__indicators--vertical .van-swipe__indicator:not(:last-child){margin-bottom:var(--van-swipe-indicator-size)}.van-swipe__indicator{width:var(--van-swipe-indicator-size);height:var(--van-swipe-indicator-size);background-color:var(--van-swipe-indicator-inactive-background);border-radius:100%;opacity:var(--van-swipe-indicator-inactive-opacity);transition:opacity var(--van-duration-fast),background-color var(--van-duration-fast)}.van-swipe__indicator:not(:last-child){margin-right:var(--van-swipe-indicator-size)}.van-swipe__indicator--active{background-color:var(--van-swipe-indicator-active-background);opacity:var(--van-swipe-indicator-active-opacity)}.van-swipe-item{position:relative;flex-shrink:0;width:100%;height:100%}:root{--van-tab-text-color: var(--van-gray-7);--van-tab-active-text-color: var(--van-text-color);--van-tab-disabled-text-color: var(--van-text-color-3);--van-tab-font-size: var(--van-font-size-md);--van-tab-line-height: var(--van-line-height-md);--van-tabs-default-color: var(--van-primary-color);--van-tabs-line-height: 44px;--van-tabs-card-height: 30px;--van-tabs-nav-background: var(--van-background-2);--van-tabs-bottom-bar-width: 40px;--van-tabs-bottom-bar-height: 3px;--van-tabs-bottom-bar-color: var(--van-primary-color)}.van-tab{position:relative;display:flex;flex:1;align-items:center;justify-content:center;box-sizing:border-box;padding:0 var(--van-padding-base);color:var(--van-tab-text-color);font-size:var(--van-tab-font-size);line-height:var(--van-tab-line-height);cursor:pointer}.van-tab--active{color:var(--van-tab-active-text-color);font-weight:var(--van-font-bold)}.van-tab--disabled{color:var(--van-tab-disabled-text-color);cursor:not-allowed}.van-tab--grow{flex:1 0 auto;padding:0 var(--van-padding-sm)}.van-tab--shrink{flex:none;padding:0 var(--van-padding-xs)}.van-tab--card{color:var(--van-tabs-default-color);border-right:var(--van-border-width) solid var(--van-tabs-default-color)}.van-tab--card:last-child{border-right:none}.van-tab--card.van-tab--active{color:var(--van-white);background-color:var(--van-tabs-default-color)}.van-tab--card--disabled{color:var(--van-tab-disabled-text-color)}.van-tab__text--ellipsis{display:-webkit-box;overflow:hidden;-webkit-line-clamp:1;-webkit-box-orient:vertical}.van-tabs{position:relative}.van-tabs__wrap{overflow:hidden}.van-tabs__wrap--page-top{position:fixed}.van-tabs__wrap--content-bottom{top:auto;bottom:0}.van-tabs__nav{position:relative;display:flex;background:var(--van-tabs-nav-background);-webkit-user-select:none;-moz-user-select:none;user-select:none}.van-tabs__nav--complete{overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch}.van-tabs__nav--complete::-webkit-scrollbar{display:none}.van-tabs__nav--line{box-sizing:content-box;height:100%;padding-bottom:15px}.van-tabs__nav--line.van-tabs__nav--shrink,.van-tabs__nav--line.van-tabs__nav--complete{padding-right:var(--van-padding-xs);padding-left:var(--van-padding-xs)}.van-tabs__nav--card{box-sizing:border-box;height:var(--van-tabs-card-height);margin:0 var(--van-padding-md);border:var(--van-border-width) solid var(--van-tabs-default-color);border-radius:var(--van-border-radius-sm)}.van-tabs__nav--card.van-tabs__nav--shrink{display:inline-flex}.van-tabs__line{position:absolute;bottom:15px;left:0;z-index:1;width:var(--van-tabs-bottom-bar-width);height:var(--van-tabs-bottom-bar-height);background:var(--van-tabs-bottom-bar-color);border-radius:var(--van-tabs-bottom-bar-height)}.van-tabs__track{position:relative;display:flex;width:100%;height:100%;will-change:left}.van-tabs__content--animated{overflow:hidden}.van-tabs--line .van-tabs__wrap{height:var(--van-tabs-line-height)}.van-tabs--card>.van-tabs__wrap{height:var(--van-tabs-card-height)}.van-tab__panel,.van-tab__panel-wrapper{flex-shrink:0;box-sizing:border-box;width:100%}.van-tab__panel-wrapper--inactive{height:0;overflow:visible}:root{--van-picker-background: var(--van-background-2);--van-picker-toolbar-height: 44px;--van-picker-title-font-size: var(--van-font-size-lg);--van-picker-title-line-height: var(--van-line-height-md);--van-picker-action-padding: 0 var(--van-padding-md);--van-picker-action-font-size: var(--van-font-size-md);--van-picker-confirm-action-color: var(--van-primary-color);--van-picker-cancel-action-color: var(--van-text-color-2);--van-picker-option-font-size: var(--van-font-size-lg);--van-picker-option-padding: 0 var(--van-padding-base);--van-picker-option-text-color: var(--van-text-color);--van-picker-option-disabled-opacity: .3;--van-picker-loading-icon-color: var(--van-primary-color);--van-picker-loading-mask-color: rgba(255, 255, 255, .9);--van-picker-mask-color: linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(255, 255, 255, .4)), linear-gradient(0deg, rgba(255, 255, 255, .9), rgba(255, 255, 255, .4))}.van-theme-dark{--van-picker-loading-mask-color: rgba(0, 0, 0, .6);--van-picker-mask-color: linear-gradient(180deg, rgba(0, 0, 0, .6), rgba(0, 0, 0, .1)), linear-gradient(0deg, rgba(0, 0, 0, .6), rgba(0, 0, 0, .1))}.van-picker{position:relative;background:var(--van-picker-background);-webkit-user-select:none;-moz-user-select:none;user-select:none}.van-picker__toolbar{position:relative;display:flex;align-items:center;justify-content:space-between;height:var(--van-picker-toolbar-height)}.van-picker__cancel,.van-picker__confirm{height:100%;padding:var(--van-picker-action-padding);font-size:var(--van-picker-action-font-size);background-color:transparent;border:none}.van-picker__confirm{color:var(--van-picker-confirm-action-color)}.van-picker__cancel{color:var(--van-picker-cancel-action-color)}.van-picker__title{position:absolute;left:50%;color:var(--van-text-color);max-width:50%;font-weight:var(--van-font-bold);font-size:var(--van-picker-title-font-size);line-height:var(--van-picker-title-line-height);text-align:center;transform:translate(-50%)}.van-picker__columns{position:relative;display:flex;cursor:grab}.van-picker__loading{position:absolute;top:0;right:0;bottom:0;left:0;z-index:3;display:flex;align-items:center;justify-content:center;color:var(--van-picker-loading-icon-color);background:var(--van-picker-loading-mask-color)}.van-picker__frame{position:absolute;top:50%;right:var(--van-padding-md);left:var(--van-padding-md);z-index:2;transform:translateY(-50%);pointer-events:none}.van-picker__mask{position:absolute;top:0;left:0;z-index:1;width:100%;height:100%;background-image:var(--van-picker-mask-color);background-repeat:no-repeat;background-position:top,bottom;transform:translateZ(0);pointer-events:none}.van-picker-column{flex:1;overflow:hidden;font-size:var(--van-picker-option-font-size)}.van-picker-column__wrapper{transition-timing-function:cubic-bezier(.23,1,.68,1)}.van-picker-column__item{display:flex;align-items:center;justify-content:center;padding:var(--van-picker-option-padding);color:var(--van-picker-option-text-color)}.van-picker-column__item--disabled{cursor:not-allowed;opacity:var(--van-picker-option-disabled-opacity)}:root{--van-picker-group-background: var(--van-background-2)}.van-picker-group{background:var(--van-picker-group-background)}.van-picker-group__tabs{margin-top:var(--van-padding-base)}.van-picker-group__tab-title{margin-right:16px}:root{--van-calendar-background: var(--van-background-2);--van-calendar-popup-height: 80%;--van-calendar-header-shadow: 0 2px 10px rgba(125, 126, 128, .16);--van-calendar-header-title-height: 44px;--van-calendar-header-title-font-size: var(--van-font-size-lg);--van-calendar-header-subtitle-font-size: var(--van-font-size-md);--van-calendar-weekdays-height: 30px;--van-calendar-weekdays-font-size: var(--van-font-size-sm);--van-calendar-month-title-font-size: var(--van-font-size-md);--van-calendar-month-mark-color: rgba(242, 243, 245, .8);--van-calendar-month-mark-font-size: 160px;--van-calendar-day-height: 64px;--van-calendar-day-font-size: var(--van-font-size-lg);--van-calendar-day-margin-bottom: 4px;--van-calendar-range-edge-color: var(--van-white);--van-calendar-range-edge-background: var(--van-primary-color);--van-calendar-range-middle-color: var(--van-primary-color);--van-calendar-range-middle-background-opacity: .1;--van-calendar-selected-day-size: 54px;--van-calendar-selected-day-color: var(--van-white);--van-calendar-info-font-size: var(--van-font-size-xs);--van-calendar-info-line-height: var(--van-line-height-xs);--van-calendar-selected-day-background: var(--van-primary-color);--van-calendar-day-disabled-color: var(--van-text-color-3);--van-calendar-confirm-button-height: 36px;--van-calendar-confirm-button-margin: 7px 0}.van-theme-dark{--van-calendar-month-mark-color: rgba(100, 101, 102, .2);--van-calendar-day-disabled-color: var(--van-gray-7)}.van-calendar{display:flex;flex-direction:column;height:100%;background:var(--van-calendar-background)}.van-calendar__popup.van-popup--top,.van-calendar__popup.van-popup--bottom{height:var(--van-calendar-popup-height)}.van-calendar__popup.van-popup--left,.van-calendar__popup.van-popup--right{height:100%}.van-calendar__popup .van-popup__close-icon{top:11px}.van-calendar__header{flex-shrink:0;box-shadow:var(--van-calendar-header-shadow)}.van-calendar__month-title,.van-calendar__header-title,.van-calendar__header-subtitle{color:var(--van-text-color);height:var(--van-calendar-header-title-height);font-weight:var(--van-font-bold);line-height:var(--van-calendar-header-title-height);text-align:center}.van-calendar__header-title{font-size:var(--van-calendar-header-title-font-size)}.van-calendar__header-subtitle{font-size:var(--van-calendar-header-subtitle-font-size)}.van-calendar__month-title{font-size:var(--van-calendar-month-title-font-size)}.van-calendar__weekdays{display:flex}.van-calendar__weekday{flex:1;font-size:var(--van-calendar-weekdays-font-size);line-height:var(--van-calendar-weekdays-height);text-align:center}.van-calendar__body{flex:1;overflow:auto;-webkit-overflow-scrolling:touch}.van-calendar__days{position:relative;display:flex;flex-wrap:wrap;-webkit-user-select:none;-moz-user-select:none;user-select:none}.van-calendar__month-mark{position:absolute;top:50%;left:50%;z-index:0;color:var(--van-calendar-month-mark-color);font-size:var(--van-calendar-month-mark-font-size);transform:translate(-50%,-50%);pointer-events:none}.van-calendar__day,.van-calendar__selected-day{display:flex;align-items:center;justify-content:center;text-align:center}.van-calendar__day{position:relative;width:14.285%;height:var(--van-calendar-day-height);font-size:var(--van-calendar-day-font-size);margin-bottom:var(--van-calendar-day-margin-bottom);cursor:pointer}.van-calendar__day--end,.van-calendar__day--start,.van-calendar__day--start-end,.van-calendar__day--multiple-middle,.van-calendar__day--multiple-selected{color:var(--van-calendar-range-edge-color);background:var(--van-calendar-range-edge-background)}.van-calendar__day--start{border-radius:var(--van-radius-md) 0 0 var(--van-radius-md)}.van-calendar__day--end{border-radius:0 var(--van-radius-md) var(--van-radius-md) 0}.van-calendar__day--start-end,.van-calendar__day--multiple-selected{border-radius:var(--van-radius-md)}.van-calendar__day--middle{color:var(--van-calendar-range-middle-color)}.van-calendar__day--middle:after{position:absolute;top:0;right:0;bottom:0;left:0;background-color:currentColor;opacity:var(--van-calendar-range-middle-background-opacity);content:""}.van-calendar__day--disabled{color:var(--van-calendar-day-disabled-color);cursor:default}.van-calendar__top-info,.van-calendar__bottom-info{position:absolute;right:0;left:0;font-size:var(--van-calendar-info-font-size);line-height:var(--van-calendar-info-line-height)}@media (max-width: 350px){.van-calendar__top-info,.van-calendar__bottom-info{font-size:9px}}.van-calendar__top-info{top:6px}.van-calendar__bottom-info{bottom:6px}.van-calendar__selected-day{width:var(--van-calendar-selected-day-size);height:var(--van-calendar-selected-day-size);color:var(--van-calendar-selected-day-color);background:var(--van-calendar-selected-day-background);border-radius:var(--van-radius-md)}.van-calendar__footer{flex-shrink:0;padding-left:var(--van-padding-md);padding-right:var(--van-padding-md)}.van-calendar__confirm{height:var(--van-calendar-confirm-button-height);margin:var(--van-calendar-confirm-button-margin)}.my-swipe .van-swipe-item[data-v-dd77f65d]{width:100px;color:#fff;font-size:20px;line-height:150px;text-align:center;background-color:#39ed81}.container .dateContainer[data-v-dd77f65d]{width:100%;height:auto;background-color:#fff;display:flex;align-content:center;margin-top:10px}.container .dateContainer .left[data-v-dd77f65d],.container .dateContainer .right[data-v-dd77f65d]{display:flex;justify-content:center;align-items:center;width:10%;height:50px;font-size:25px}.container .dateContainer .left[data-v-dd77f65d]:hover,.container .dateContainer .right[data-v-dd77f65d]:hover{color:#1989fa}.container .dateContainer .content[data-v-dd77f65d]{width:11.42%;height:50px}.container .dateContainer .content[data-v-dd77f65d]:hover{background-color:#1989fa;border-radius:10%;color:#fff}.container .cardContainer[data-v-dd77f65d]{margin-top:10px;width:95%;background-color:#fff;height:20%}
import{u as n,o as c,c as s,a as e,F as m}from"./index-26130194.js";import{E as p}from"./index-74186f38.js";import{N as _}from"./index-eb7bb0a6.js";import"./use-height-4547cdf4.js";const v={__name:"index",setup(i){const t=n(),o=()=>t.replace({name:"welcome"});return(l,f)=>{const r=_,a=p;return c(),s(m,null,[e(r,{"left-text":"返回","left-arrow":"",onClickLeft:o}),e(a,{style:{width:"100%",height:"100%"},image:"error",description:"异常"})],64)}}};export{v as default};
import{r as n,f as h,Z as o,ag as r,N as u,ah as c,ai as g,H as f}from"./index-26130194.js";const w=(a,i)=>{const s=n(),e=()=>{s.value=f(a).height};return h(()=>{if(o(e),i)for(let t=1;t<=3;t++)setTimeout(e,100*t)}),r(()=>o(e)),u([c,g],e),s};export{w as u};
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8"/>
<link rel="icon" type="image/svg+xml" href="./vite.svg"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>场地管理</title>
<script type="module" crossorigin src="./assets/index-26130194.js"></script>
<link rel="stylesheet" href="./assets/index-7b86f44a.css">
</head>
<body>
<div id="app"></div>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>消息跳转</title>
</head>
<body>
<!-- <iframe id="ifr" src="" frameborder="0"></iframe>
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
<script>
var script = document.createElement('script') ;
script.type ='text/javascript' ;
script.src = "https://res.wx.qq.com/open/js/jweixin-1.6.0.js";
var head = document.getElementsByTagName('head').item(0);
head.appendChild(script);
script.onload = function(){
$("#ifr").attr("src","https://asc.neaic.com/SRFlowIfream/view/RequestLeavingBackFileUpload.html?imgDel=1&PKVal=2583&FK_MapFrame=ND26201_Frame1&WorkID=2583&FK_Node=26201&UserNo=101&UserName=");
};
</script> -->
<script id="identifyEl" src="/a/manager/identify/identify.js"></script>
<script>
function GetQueryValue(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
var itemStr = window.location.href;
console.log(itemStr);
var itemArr = itemStr.split("links=");
//console.log(itemIndex);
var r = itemArr[1];
for (var i = 2; i < itemArr.length; i++) {
r = r + "links=" + itemArr[i];
}
//匹配目标参数
console.log(r)
return r + "&qrcode=" + getUrlParam("qrcode"); //返回参数值
}
function scriptLoad(script, callback) {
if (script.readyState) { //IE
script.onreadystatechange = function () {
if (script.readyState == 'complete' || script.readyState == 'loaded') {
script.onreadystatechange = null;
callback();
}
}
} else { //非IE
script.onload = function () {
callback();
}
}
}
var identifyEl = document.getElementById('identifyEl');
var i = 0;
var token = null;
while (i == 0) {
if (token != null) {
i = 1;
var links = GetQueryValue("links");
if (links) {
if (token) {
idt.Jump(links, '1');
}
} else {
alert("未找到跳转路径,请核对!");
}
} else {
token = idt.GetToken();
}
}
window.location.href = `/DutyManagement/wx/#/getInfo?type=2&links=${getUrlParam('links')}&id=${getUrlParam('id')}&token=${token}`;
console.log("🚀🚀🚀ssohtml,links,", links)
function getUrlParam(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
var r = window.location.search.substr(1).match(reg); //匹配目标参数
if (r != null) return unescape(r[2]);
return null; //返回参数值
}
</script>
</body>
</html>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
\ No newline at end of file
<!doctype html> <!doctype html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8"/>
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> <link rel="icon" type="image/svg+xml" href="/vite.svg"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>值班管理</title> <title>场地管理</title>
</head> </head>
<body> <body>
<div id="app"></div> <div id="app"></div>
<script type="module" src="/src/main.js"></script> <script type="module" src="/src/main.js"></script>
</body> </body>
</html> </html>
因为 它太大了无法显示 源差异 。您可以改为 查看blob。
{ {
"name": "wxlezduty", "name": "site-management",
"private": true, "private": true,
"version": "0.0.0", "version": "0.0.0",
"type": "module", "type": "module",
...@@ -25,7 +25,10 @@ ...@@ -25,7 +25,10 @@
}, },
"devDependencies": { "devDependencies": {
"@vitejs/plugin-vue": "^4.2.3", "@vitejs/plugin-vue": "^4.2.3",
"autoprefixer": "^10.4.16",
"less": "^4.2.0", "less": "^4.2.0",
"postcss": "^8.4.32",
"tailwindcss": "^3.4.0",
"unplugin-vue-components": "^0.25.1", "unplugin-vue-components": "^0.25.1",
"vite": "^4.4.5" "vite": "^4.4.5"
} }
......
export default {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
...@@ -4,13 +4,13 @@ ...@@ -4,13 +4,13 @@
</script> </script>
<template> <template>
<router-view></router-view> <router-view></router-view>
</template> </template>
<style scoped> <style scoped>
@import "style.css"; @import "style.css";
body{
body {
margin: 0; margin: 0;
} }
</style> </style>
import {requestGet, requestPost} from '../util/request.js' import {requestGet, requestPost} from '../util/request.js'
import axios from 'axios' import axios from 'axios'
export function ImageUpLoad(data) {
//照片上传
return requestPost(`/api/Attendance/ImageUpLoad`, data)
}
/** /**
* 单点 * 单点
* **/ * **/
export function SSONewWX(data) { export function wx(data) {
//单点 //单点
return requestGet(`/api/Login/api/Login/SSONewWX?token=${data.token}`, data) return requestGet(`/api/sso/wx?&code=${data.code}&sign=${data.sign}&timestamp=${data.timestamp}&userType=${data.userType}`, data)
// axios.get(`/api/Login/api/Login/SSOPC`,data)
} }
export function SSOPC(data) { export function SSOPC(data) {
//单点 //单点
return requestGet(`/api/Login/api/Login/SSOPC?token=${data.token}`, data) return requestGet(`/api/sso/pc?token=${data.token}`, data)
// axios.get(`/api/Login/api/Login/SSOPC`,data)
} }
export function GetTokenInfo(data) { export function GetTokenInfo(data) {
//获取用户信息 //获取用户信息
return requestGet(`/api/Login/api/Login/GetTokenInfo`, data) return requestGet(`/api/GetTokenInfo`, data)
} }
export function RefreshToken(data) { export function RefreshToken(data) {
//刷新token //刷新token
return requestGet(`/api/Login/api/Login/RefreshToken`, data) return requestGet(`/api/RefreshToken`, data)
}
export function SSOPCWX(data) {
//刷新token
return requestGet(`/api/Login/api/Login/SSOPCWX?&code=${data.code}&sign=${data.sign}&timestamp=${data.timestamp}`, data)
} }
/** export function CheckLoginTest(data) {
* 值班列表 //test token
* return requestGet(`/api/Login/CheckLoginTest?card="asc666"`, data)
* */
export function GetWatchList(data) {
//获取值班列表
return requestPost('/api/Watch/api/Watch/GetWatchList', data)
} }
export function GetWatchHourTime(data) {
//获取值班时段
return requestGet(`/api/Watch/api/Watch/GetWatchHourTime`, data)
}
export function GetWatchTypeSelect(data) {
//获取值班类型
return requestGet(`/api/Watch/api/Watch/GetWatchTypeSelect`, data)
}
export function GetWatchDepSelect(data) {
//获取值班部门
return requestGet(`/api/Watch/api/Watch/GetWatchDepSelect`, data)
}
export function GetWatchCampusSelect(data) {
//获取校区
return requestGet(`/api/Watch/api/Watch/GetWatchCampusSelect`, data)
}
export function GetWatchInfo(data) {
//获取值班详情
return requestGet(`/api/Watch/api/Watch/GetWatchInfo?id=${data.id}`, data)
}
export function WatchInfoSaveOneSelf(id, card_name) {
//给自己换班
return requestGet(`/api/Watch/api/Watch/WatchInfoSaveOneSelf?id=${id}&card_name=${card_name}`)
}
/***
*
* 签到列表
*
*
* */
export function GetSignRecordList(data) {
//获取签到列表
return requestPost(`/api/SignRecord/api/SignRecord/GetSignRecordList`, data)
}
export function SignInOrOut(data) {
//批量签到签退
return requestPost(`/api/SignRecord/api/SignRecord/SignInOrOut`, data)
}
export function SignLogSave(data) {
//填写日志
return requestGet(`/api/SignRecord/api/SignRecord/SignLogSave?signId=${data.signId}&content=${data.content}`, data)
}
export function LeadLogInit(signid) {
//领导日志初始化
return requestGet(`/api/SignRecord/api/SignRecord/LeadLogInit?signid=${signid}`)
}
/**
* Attendance
*/
export function GetAttendanceList() {
//获取考勤列表
return requestGet(`/api/Attendance/GetAttendanceList`)
}
export function ImageUpLoad(data) {
//照片上传
return requestPost(`/api/Attendance/ImageUpLoad`, data)
}
export function AttendanceSubmit(data) {
//考勤打卡
return requestPost(`/api/Attendance/AttendanceSubmit`, data)
}
/**
* UserInfo
*/
export function GetUserSelect(condition) {
//获取用户信息(选项框)
return requestGet(`/api/UserInfo/api/UserInfo/GetUserSelect?condition=${condition}`)
}
/**
* 微信
*/
export function GetWxInfo(url, data) {
///微信初始化配置
return requestGet(`${url}?url=${data.url}`)
}
...@@ -11,7 +11,7 @@ const app = createApp(App) ...@@ -11,7 +11,7 @@ const app = createApp(App)
//使用测试按钮Vxonsole //使用测试按钮Vxonsole
// const vConsole = new VConsole(); // const vConsole = new VConsole();
app.config.globalProperties.$cookies = VueCookies app.config.globalProperties.$cookies = VueCookies
app.config.globalProperties.$api = api app.config.globalProperties.asc = api
app.use(router) app.use(router)
app.mount('#app') app.mount('#app')
<template> <template>
<van-nav-bar <van-nav-bar
left-text="返回" left-text="返回"
left-arrow left-arrow
@click-left="onClickLeft" @click-left="onClickLeft"
></van-nav-bar> ></van-nav-bar>
<van-empty style="width: 100%;height: 100%" image="error" description="异常" /> <van-empty style="width: 100%;height: 100%" image="error" description="异常"/>
<!-- <van-button primary='success' @click="onClickLeft">返回</van-button>--> <!-- <van-button primary='success' @click="onClickLeft">返回</van-button>-->
</template> </template>
<script setup> <script setup>
import {useRouter} from "vue-router"; import {useRouter} from "vue-router";
const router = useRouter()
const onClickLeft = () => router.replace({name:'welcome'}); const router = useRouter()
const onClickLeft = () => router.replace({name: 'welcome'});
</script> </script>
...@@ -10,10 +10,12 @@ import Cookies from 'js-cookie' ...@@ -10,10 +10,12 @@ import Cookies from 'js-cookie'
import {useRouter} from 'vue-router' import {useRouter} from 'vue-router'
import {onMounted} from 'vue' import {onMounted} from 'vue'
import * as api from '../api/index.js' import * as api from '../api/index.js'
import {CheckLoginTest} from "../api/index.js";
const router = useRouter() const router = useRouter()
const getTokenAction = async (date) => { const getTokenAction = async (date) => {
const res = await api.SSONewWX(date) const res = await api.SSOPC(date)
if (res.code !== 1) { if (res.code !== 1) {
await router.replace({ await router.replace({
name: '403' name: '403'
...@@ -24,14 +26,13 @@ const getTokenAction = async (date) => { ...@@ -24,14 +26,13 @@ const getTokenAction = async (date) => {
Cookies.set('time', res.response.access_token.expires) Cookies.set('time', res.response.access_token.expires)
const user = await api.GetTokenInfo() const user = await api.GetTokenInfo()
Cookies.set('site-user-info', user.response.role) Cookies.set('site-user-info', user.response.role)
localStorage.setItem('site-user-info', user.response.role)
await router.replace({ await router.replace({
name: 'welcome' name: 'welcome'
}) })
} }
} }
const getTokenActionWx = async (date) => { const getTokenActionWx = async (date) => {
const res = await api.SSOPCWX(date) const res = await api.wx(date)
if (res.code !== 1) { if (res.code !== 1) {
await router.replace({ await router.replace({
name: '403' name: '403'
...@@ -41,7 +42,6 @@ const getTokenActionWx = async (date) => { ...@@ -41,7 +42,6 @@ const getTokenActionWx = async (date) => {
Cookies.set('time', res.response.access_token.expires) Cookies.set('time', res.response.access_token.expires)
const user = await api.GetTokenInfo() const user = await api.GetTokenInfo()
Cookies.set('site-user-info', user.response.role) Cookies.set('site-user-info', user.response.role)
localStorage.setItem('site-user-info', user.response.role)
await router.replace({ await router.replace({
name: 'welcome' name: 'welcome'
}) })
...@@ -49,14 +49,14 @@ const getTokenActionWx = async (date) => { ...@@ -49,14 +49,14 @@ const getTokenActionWx = async (date) => {
} }
const getToken = async () => { const getToken = async () => {
let policyObject = { let policyObject = {
"1": async () => { "asc": async () => {
//ASC单点 //ASC单点
let date = { let date = {
token: router.currentRoute.value.query.token token: router.currentRoute.value.query.token
} }
await getTokenAction(date) await getTokenAction(date)
}, },
"2": async () => { "first": async () => {
//AIC单点 //AIC单点
let date = { let date = {
sign: router.currentRoute.value.query.sign, sign: router.currentRoute.value.query.sign,
...@@ -65,8 +65,22 @@ const getToken = async () => { ...@@ -65,8 +65,22 @@ const getToken = async () => {
} }
await getTokenActionWx(date) await getTokenActionWx(date)
}, },
"test": () => { "test": async () => {
//测试token //测试token
const res = await api.CheckLoginTest()
if (res.code !== 1) {
await router.replace({
name: '403'
})
} else if (res.response.access_token.token_content !== '') {
Cookies.set('site-management-token', res.response.access_token.token_content)
Cookies.set('time', res.response.access_token.expires)
const user = await api.GetTokenInfo()
Cookies.set('site-user-info', user.response.role)
await router.replace({
name: 'welcome'
})
}
} }
} }
policyObject[Number(router.currentRoute.value.query.type)]() policyObject[Number(router.currentRoute.value.query.type)]()
......
<template>
<van-pull-refresh v-model="myDuty.loading" @refresh="onRefresh" :disabled="myDuty.show ? true :false">
<div style="position: fixed;z-index: 2;width: 100%">
<!-- &lt;!&ndash; 圆角弹窗(居中) &ndash;&gt;-->
<van-popup v-model:show="myDuty.showCenter" round style="width: 100%; padding: 10px;">
<template v-slot:default>
<van-field
v-model="myDuty.message"
rows="2"
autosize
clearable
type="textarea"
maxlength="100"
placeholder="请输入日志"
show-word-limit
/>
<div style="float: right">
<van-button icon="close" size="small" style="margin-right: 10px" @click="myDuty.showCenter = false">取消
</van-button>
<van-button type="primary" icon="passed" size="small" style="margin-right: 10px">提交</van-button>
</div>
</template>
</van-popup>
<van-nav-bar
title="我的值班"
left-text="返回"
left-arrow
@click-left="onClickLeft"
></van-nav-bar>
<van-search
v-model="searchValue"
shape="round"
placeholder="请输入搜索关键词"
/>
<van-dropdown-menu :overlay="false">
<van-dropdown-item @open="openMenu" title="日期">
<!-- <template #default>-->
<!-- <van-calendar :minDate="myDuty.minDate"-->
<!-- :maxDate="myDuty.maxDate" v-model:show="myDuty.show" type="range" @confirm="dateRange"/>-->
<!-- </template>-->
</van-dropdown-item>
<van-dropdown-item v-model="myDuty[item[2]]" v-for="(item,index) in myDuty.addDutySelectList" :key="index"
:title="item[1]" :options="item[0]"/>
</van-dropdown-menu>
</div>
<!-- 底部弹出日期选择器 -->
<van-popup
v-model:show="myDuty.show"
position="bottom"
:style="{ height: '60%' }"
>
<template #default>
<van-calendar :minDate="myDuty.minDate"
:maxDate="myDuty.maxDate" v-model:show="myDuty.show" type="range" @confirm="dateRange"/>
</template>
</van-popup>
<van-list
class="container"
@load="onLoad"
direction="down"
:finished="finished"
offset="600"
>
<div style="width: 100%;height: 150px"></div>
<!-- <van-cell/>-->
<van-cell-group inset class="cardContainer" v-for="(item,index) in list" :key="index">
<van-cell class="cardContent" :title="item.username">
<template #extra>
<van-tag type="primary" plain><span>{{ item.card_name }}</span></van-tag>
<van-tag :color="['','#7232dd'][item.is_lead]" type="primary" plain style="margin-left: 10px">
<span>{{ ['值班教师', '值班领导'][item.is_lead] }}</span></van-tag>
</template>
</van-cell>
<van-cell class="cardContent" title="日期">
<template #extra>
<van-tag type="primary" plain><span>{{ item.watch_date }}</span></van-tag>
<van-tag type="primary" plain style="margin-left: 10px"><span>{{ item.watch_hour_time }}</span></van-tag>
</template>
</van-cell>
<van-cell class="cardContent" title="类型">
<template #extra>
<van-tag type="primary" plain>
<span>{{ item.watchtypename + '-' + item.dept_name + '-' + item.campusname }}</span></van-tag>
</template>
</van-cell>
<van-cell v-if="item.card_name == userInfo.card_number" class="" title="换班">
<template #value>
<van-button plain type="warning" size="small" @click="pickerChgSftOpen(item)">换班</van-button>
</template>
</van-cell>
<!-- <van-cell class="cardContent">-->
<!-- <template #value>-->
<!-- <van-button @click="dutyLog(item)" type="primary" icon="edit" size="small" style="margin-right: 10px">日志</van-button>-->
<!-- </template>-->
<!-- </van-cell>-->
</van-cell-group>
<div style="width: 100%;height: 100px"></div>
</van-list>
</van-pull-refresh>
<!-- 换班人员选择器 -->
<van-popup v-model:show="changeShiftsPickerShow" round position="bottom">
<!-- 搜索框 -->
<van-search
v-model="changeSftInput"
placeholder="请输入姓名或工号"
@update:model-value="searchChange"/>
<!-- 选择器 -->
<van-picker
:columns="userList"
:loading="pickerLoading"
@cancel="pickerCancel"
@confirm="pickerConfirm"
/>
</van-popup>
</template>
<style scoped lang="less">
.container {
//box-sizing: border-box; //background-color: #706c6c; //width: 100%; //height: 100%; //min-height: 896px; //display: flex; //flex-wrap: wrap; //justify-content: center; //align-content: flex-start;
.cardContainer {
margin-top: 10px;
width: 95%;
background-color: #ffffff;
height: 20%;
// .cardContent {
// height: 150px;
// }
}
.cardContainer:nth-last-child(1) {
background-color: red;
}
}
</style>
<script setup>
import _ from 'lodash';
import * as api from '../../api/index.js';
import {ref, reactive, onMounted, watch} from 'vue';
import dayjs from 'dayjs';
import 'vant/es/dialog/style'
import {showToast, showSuccessToast, showFailToast, showConfirmDialog} from "vant";
import Cookies from 'js-cookie'
const onClickLeft = () => history.back();
let myDuty = reactive({
minDate: new Date(dayjs().year(), dayjs().month() - 1, 1),
maxDate: new Date(dayjs().year(), dayjs().month() + 1, 15),
addDutySelectList: [],
DatePickerKey: 1,
showCenter: false,
message: '',
show: false,
startTime: dayjs().startOf('day').format('YYYY-MM-DD'),
endTime: dayjs().startOf('day').format('YYYY-MM-DD'),
page_index: 1,
page_size: 5,
total: '',
deleteSetTimeOut: '',
menuKey: 1,
loading: false
})
const list = ref([]);
const loading = ref(false);
const finished = ref(false);
let searchValue = ref('')
const userInfo = ref({})
// 选中值班obj
const attendanceObj = ref({})
// 换班选择器显示
const changeShiftsPickerShow = ref(false)
// 搜索条件
const changeSftInput = ref('')
// 换班选择器列表
const userList = ref([])
const pickerLoading = ref(false)
watch([searchValue, () => myDuty.watchtypeid, () => myDuty.watch_hour_id, () => myDuty.campusid, () => myDuty.dept_id], (newValue, oldValue) => {
console.log("🚀🚀🚀,", newValue[0], newValue[1])
if (newValue[0] || newValue[1] || newValue[2] || newValue[3] || newValue[4]) {
clearTimeout(myDuty.deleteSetTimeOut)
myDuty.deleteSetTimeOut = setTimeout(async () => {
await search()
showToast('操作成功!')
}, 500)
}
}, {deep: true})
const onRefresh = async () => {
myDuty.loading = true
myDuty.startTime = dayjs().format('YYYY-MM-DD')
myDuty.endTime = dayjs().format('YYYY-MM-DD')
await onLoad()
myDuty.loading = false
//初始化刷新
// myDuty.loading = true
// let data = {
// "dep_id": "",
// "key_name": "",
// "start_time": myDuty.startTime,
// "end_time": myDuty.endTime,
// "type_id": "",
// "watchhour_time": "",
// "is_lead": 3,
// "campus_id": "",
// "page_index": myDuty.page_index,
// "page_size": myDuty.page_size,
// }
// const res = await api.GetWatchList(data)
// list.value = res.response.data
// myDuty.total = res.response.data_count
}
const dutyLog = (e) => {
console.log("🚀🚀🚀,", e)
myDuty.showCenter = true
}
const search = async () => {
let data = {
"dep_id": myDuty.dept_id,
"key_name": searchValue.value,
"start_time": myDuty.startTime,
"end_time": myDuty.endTime,
"type_id": myDuty.watchtypeid,
"watchhour_time": myDuty.watch_hour_id,
"is_lead": 3,
"campus_id": myDuty.campusid,
"page_index": myDuty.page_index,
"page_size": myDuty.page_size,
}
const res = await api.GetWatchList(data)
list.value = res.response.data
myDuty.total = res.response.data_count
}
const onLoad = async () => {
clearTimeout(myDuty.deleteSetTimeOut)
myDuty.deleteSetTimeOut = setTimeout(async () => {
let data = {
"dep_id": "",
"key_name": "",
"start_time": myDuty.startTime,
"end_time": myDuty.endTime,
"type_id": "",
"watchhour_time": "",
"is_lead": 3,
"campus_id": "",
"page_index": myDuty.page_index,
"page_size": myDuty.page_size,
}
const res = await api.GetWatchList(data)
// showToast('刷新成功!')
list.value = res.response.data
myDuty.total = res.response.data_count
// 异步更新数据
// setTimeout 仅做示例,真实场景中一般为 ajax 请求
// for (let i = 0; i < 10; i++) {
// list.value.push(list.value.length + 1);
// }
// 数据全部加载完成
if (list.value.length >= Number(myDuty.total)) {
finished.value = true;
// showToast('加载完成!')
} else if (list.value.length < Number(myDuty.total)) {
myDuty.page_size = myDuty.page_size + 10
}
}, 100)
}
const dateRange = async (e) => {
myDuty.startTime = dayjs(e[0]).format('YYYY-MM-DD')
myDuty.endTime = dayjs(e[1]).format('YYYY-MM-DD')
await search()
myDuty.menuKey++
closeMenu()
}
const closeMenu = () => {
myDuty.show = false
}
const openMenu = () => {
myDuty.show = true
}
const addDutySearchSelectList = () => {
Promise.all([
getSearchSelectListPromiseAllAction("dutyType", '类型', "watchtypeid", api.GetWatchTypeSelect),
getSearchSelectListPromiseAllAction("dutyHourTime", '时段', "watch_hour_id", api.GetWatchHourTime),
getSearchSelectListPromiseAllAction("campusname", '校区', "campusid", api.GetWatchCampusSelect),
getSearchSelectListPromiseAllAction("dept_name", '部门', "dept_id", api.GetWatchDepSelect),
])
.then(res => {
myDuty.addDutySelectList = res
myDuty.DatePickerKey++
})
}
const getSearchSelectListPromiseAllAction = (publicName, title, objectAttribute, apiFunction) => {
return new Promise(async (resolve, reject) => {
const publicName = await apiFunction()
const list = []
publicName.response.map((cur, index) => {
list.push({text: cur.name, value: cur.id})
})
let array = [list, title, objectAttribute]
resolve(array)
})
}
// 打开换班选择器
function pickerChgSftOpen(obj) {
changeShiftsPickerShow.value = true
attendanceObj.value = obj
}
// 搜索值改变
function searchChange(val) {
pickerLoading.value = true
api.GetUserSelect(val).then(res => {
// console.log('搜索换班人员', res)
if (res.code == 1) {
userList.value = res.response.map(a => {
return {
...a,
text: a.name,
value: a.id,
}
})
} else {
showFailToast(res.msg_detail)
}
}).finally(() => {
pickerLoading.value = false
})
}
// 换班选择器确认
function pickerConfirm(val) {
// console.log('选择器确认', val)
if (val.selectedOptions[0] == undefined) {
// 未选择人员
showToast('请选择换班人员')
return
}
showConfirmDialog({
title: '提示',
message: '是否确认换班?',
}).then(() => {
let id = attendanceObj.value.watchid
let card_name = val.selectedOptions[0].id
api.WatchInfoSaveOneSelf(id, card_name).then(res => {
// console.log('换班请求', res)
if (res.code == 1) {
showSuccessToast(res.response)
changeShiftsPickerShow.value = false
onLoad()
} else {
showFailToast(res.msg_detail)
}
})
}).catch(() => {
})
}
// 换班选择器取消
function pickerCancel() {
changeShiftsPickerShow.value = false
}
onMounted(() => {
addDutySearchSelectList()
// 获取当前用户信息
userInfo.value = JSON.parse(Cookies.get('userInfo'))
})
</script>
<template>
<van-pull-refresh v-model="signList.loading" @refresh="onRefresh">
<van-floating-bubble
axis="xy"
icon="chat"
magnetic="x"
:gap="35"
@click="batch(1)"
v-if="signList.floatingBubble"
>
<template v-slot:default>
<div>批量签</div>
</template>
</van-floating-bubble>
<van-floating-bubble
axis="xy"
icon="chat"
magnetic="x"
@click="batch(2)"
:gap="0"
v-if="signList.floatingBubble"
>
<template v-slot:default>
<div>批量休</div>
</template>
</van-floating-bubble>
<div style="position: fixed;z-index: 2;width: 100%">
<!-- &lt;!&ndash; 圆角弹窗(居中) &ndash;&gt;-->
<van-popup v-model:show="signList.showCenter" round style="width: 100%; padding: 10px;">
<template v-slot:default>
<van-field
v-model="signList.message"
rows="2"
autosize
clearable
type="textarea"
maxlength="100"
placeholder="请输入日志"
show-word-limit
/>
<div style="float: right">
<van-button icon="close" size="small" style="margin-right: 10px" @click="signList.showCenter = false">取消
</van-button>
<van-button @click="submitLog" type="primary" icon="passed" size="small" style="margin-right: 10px">提交
</van-button>
</div>
</template>
</van-popup>
<van-nav-bar
title="签到列表"
left-text="返回"
left-arrow
@click-left="onClickLeft"
>
<template v-slot:title><span style="margin-right: 20vw">签到列表</span></template>
<template v-slot:right>
<van-tabs v-model:active="signList.is_lead" shrink type="card" @click-tab="tabs">
<van-tab title="教师">
<template v-slot:title>
<span style="">值班教师</span>
</template>
</van-tab>
<van-tab title="领导">
<template v-slot:title>
<span style="">值班领导</span>
</template>
</van-tab>
</van-tabs>
</template>
</van-nav-bar>
<van-search
v-model="searchValue"
shape="round"
placeholder="请输入搜索关键词"
/>
<van-dropdown-menu :overlay="false">
<van-dropdown-item v-model="signList.sign" title="状态"
:options="signList.signClass"></van-dropdown-item>
<van-dropdown-item @close="closeMenu" :key="signList.menuKey" @open="openMenu" title="日期">
<template #default>
<van-calendar :max-date="signList.maxDate" :minDate="signList.minDate" v-model:show="signList.show"
type="range" @confirm="dateRange"/>
</template>
</van-dropdown-item>
<van-dropdown-item v-model="signList[item[2]]" v-for="(item,index) in signList.addDutySelectList" :key="index"
:title="item[1]" :options="item[0]"/>
</van-dropdown-menu>
</div>
<van-list
class="container"
@load="onLoad"
direction="down"
:finished="finished"
offset="600"
>
<div style="width: 100%;height: 150px"></div>
<!-- <van-cell/>-->
<van-cell-group inset class="cardContainer" v-for="(item,index) in list" :key="index">
<van-cell class="cardContent" :title="item.username">
<template #extra>
<van-tag type="primary" plain><span>{{ item.card_name }}</span></van-tag>
<van-tag color="#7232dd" type="primary" plain style="margin-left: 10px">{{ item.mobile }}</van-tag>
<!-- <van-tag :color="['','#7232dd'][item.is_lead]" type="primary" plain style="margin-left: 10px">-->
<!-- <span>{{ ['值班教师', '值班领导'][item.is_lead] }}</span></van-tag>-->
</template>
</van-cell>
<van-cell class="cardContent" title="日期">
<template #extra>
<van-tag type="primary" plain><span>{{ item.watch_date }}</span></van-tag>
<van-tag v-if="item.mobile!==''" type="primary" plain style="margin-left: 10px">
<span>{{ item.watch_hour_time }}</span></van-tag>
</template>
</van-cell>
<van-cell class="cardContent" title="类型">
<template #extra>
<van-tag type="primary" plain>
<span>{{ item.watchtypename + '-' + item.campusname }}</span></van-tag>
</template>
</van-cell>
<van-cell class="cardContent">
<template #title>
<span>日志</span>
</template>
<template #extra>
<van-text-ellipsis :rows="1" :content="item.content" expand-text="展开" collapse-text="收起"/>
</template>
<template #value>
<van-button
v-if="item.card_name == userInfo.card_number && userInfo.role[0].indexOf('值班领导') != -1"
type="primary"
size="small"
@click="leadLog(item)">
查看日志
</van-button>
</template>
</van-cell>
<van-cell
class="cardContent"
title="签到"
v-if="item.card_name == userInfo.card_number && item.sign_type != 0">
<!-- <van-button
v-if="item.sign_type == 1 && item.sign < 2"
plain
size="small"
:type="item.sign == 0 ? 'success' : 'primary'"
:disabled="signBtDis(item)"
@click="signBt(item)">
<van-icon name="edit" />
{{ `${item.sign == 0 ? '签到' : '签退'}` }}
</van-button> -->
<van-button
v-if="item.sign !== 0 && item.sign !==2"
size="small"
:disabled="true"
style="margin-right: 10px;"
>
<van-icon name="edit"/>
{{ `${item.sign == 1 ? '已签到' : ''}` }}
</van-button>
<van-button
v-if="item.sign < 2"
size="small"
:plain="item.sign_type == 1"
:type="item.sign == 0 ? 'success' : 'primary'"
:disabled="signBtDis(item)"
@click="locSignIn(item)">
<van-icon name="edit"/>
{{ `${item.sign == 0 ? '签到' : '签退'}` }}
</van-button>
<span v-else>签到完成</span>
<!-- <van-button type="danger" @click="changeSignTimeTest(item)">测试用,修改签到时间限制</van-button> -->
</van-cell>
<!-- <van-cell class="cardContent" style="display: flex;flex-wrap: nowrap;align-items: center">
<template #value>
<div style="display: flex;flex-wrap: nowrap;align-items: center">
<van-checkbox-group v-model="signList.checked">
<van-checkbox :disabled="item.sign=== 2 || item.sign_set === 1 || signList.authUserInfo === -1"
v-model="item.signid" :name="item.signid"></van-checkbox>
</van-checkbox-group>
<div style="margin-left: auto">
<van-button @click="dutyLog(item)" type="primary" icon="edit" size="small" style="margin-right: 10px">
日志
</van-button>
<van-button @click="sign(item,2)"
v-if="item.sign === 1 && item.sign_set === 0 && signList.authUserInfo!== -1" type="warning"
icon="guide-o" size="small" style="margin-right: 10px">签退
</van-button>
<van-button @click="sign(item,1)"
v-if="item.sign === 0 && item.sign_set === 0 && signList.authUserInfo!== -1" type="success"
icon="passed" size="small" style="margin-right: 10px">签到
</van-button>
<van-button :disabled="item.sign === 2" v-if="item.sign === 2" size="small" style="margin-right: 10px">
<van-icon name="passed" style=" margin-left: 5px;color: #23da6f"/>
完成考勤
</van-button>
</div>
</div>
</template>
</van-cell> -->
</van-cell-group>
<div style="width: 100%;height: 100px"></div>
</van-list>
</van-pull-refresh>
<!-- 定位打卡签到 -->
<van-action-sheet
v-model:show="signAcStShow"
ref="VAS"
style="height: 80%;"
:close-on-click-overlay="false"
:title="signObj.sign == 0 ? '签到' : '签退'">
<div style="padding: 16px;">
<div style="width: 80%; margin: auto;">
<img style="width: 100%;" :src="signImgUrl"/>
</div>
<van-sticky container="VAS" position="bottom" :offset-bottom="16">
<van-button :type="signObj.sign == 0 ? 'success' : 'primary'" block @click="signBt(signObj)">
{{ `${signObj.sign == 0 ? '签到' : '签退'}` }}
</van-button>
</van-sticky>
</div>
</van-action-sheet>
<!-- 领导查看日志 -->
<van-action-sheet
v-model:show="logAcStShow"
ref="VASLog"
style="height: 80%;"
title="值班日志"
:close-on-click-overlay="false">
<div style="padding: 16px;">
<van-field
id="teacherLog"
v-model="allLog"
readonly
autosize
label="教师日志"
label-align="top"
type="textarea"
/>
<van-sticky container="VAS" position="bottom" :offset-bottom="16">
<van-button type="primary" block @click="copyLog">复制</van-button>
</van-sticky>
</div>
</van-action-sheet>
</template>
<style scoped lang="less">
.a {
margin-bottom: 50px;
}
.van-floating-bubble {
position: fixed;
left: -81px;
top: 10px;
right: var(--van-floating-bubble-initial-gap);
bottom: -81px;
width: var(--van-floating-bubble-size);
height: var(--van-floating-bubble-size);
box-sizing: border-box;
display: flex;
justify-content: center;
align-items: center;
overflow: hidden;
cursor: pointer;
-webkit-user-select: none;
user-select: none;
touch-action: none;
background: var(--van-floating-bubble-background);
color: var(--van-floating-bubble-color);
border-radius: var(--van-floating-bubble-border-radius);
z-index: var(--van-floating-bubble-z-index);
transition: transform var(--van-duration-base);
}
.container {
//box-sizing: border-box; //background-color: #706c6c; //width: 100%; //height: 100%; //min-height: 896px; //display: flex; //flex-wrap: wrap; //justify-content: center; //align-content: flex-start;
.cardContainer {
margin-top: 10px;
width: 95%;
background-color: #ffffff;
height: 20%;
// .cardContent {
// height: 150px;
// }
}
.cardContainer:nth-last-child(1) {
background-color: red;
}
}
</style>
<script setup>
import _ from 'lodash';
import * as api from '../../api/index.js';
import {ref, reactive, onMounted, watch, computed, onUnmounted} from 'vue';
import dayjs from 'dayjs';
import {showToast, showDialog, ActionSheet, closeToast, showSuccessToast, showFailToast} from "vant";
import Cookies from 'js-cookie'
import wx from "weixin-js-sdk"
import $ from "jquery";
import {useRouter} from "vue-router";
let active = ref(1)
let signList = reactive({
minDate: new Date(dayjs().year(), dayjs().month() - 1, 1),
maxDate: new Date(dayjs().year(), dayjs().month() + 1, 1),
sign: 9,
signClass: [
{
text: '全部状态',
value: 9
},
{
text: '待签到',
value: "0"
},
{
text: '已签到',
value: 1
},
{
text: '已签退',
value: 2
},
],
addDutySelectList: [],
DatePickerKey: 1,
showCenter: false,
message: '',
show: false,
startTime: dayjs().startOf('day').format('YYYY-MM-DD'),
endTime: dayjs().startOf('day').format('YYYY-MM-DD'),
page_index: 1,
page_size: 5,
total: '',
deleteSetTimeOut: '',
menuKey: 1,
loading: false,
authUserInfo: '',
checked: [],
floatingBubble: false,
logId: '',
is_lead: 0,
})
const router = useRouter();
const onClickLeft = () => router.push({
name: 'welcome'
});
const list = ref([]);
const loading = ref(false);
const finished = ref(false);
let searchValue = ref('')
const attendanceList = ref([])
const userInfo = ref({})
const dateConfig = reactive({
year: 'numeric',
month: '2-digit',
day: '2-digit',
hour: '2-digit',
minute: '2-digit',
second: '2-digit',
})
const dateConfigTime = reactive({
hour: '2-digit',
minute: '2-digit',
second: '2-digit',
})
// 定位用↓
const PI = ref(3.1415926535897932384626)
const a = ref(6378245.0)
const ee = ref(0.00669342162296594323)
const jdNow = ref(0)
const wdNow = ref(0)
const address = ref('')
// 定时器
const timer = ref({})
// 是否允许打卡
const allowSignIn = ref(false)
// 点击签到的obj和考勤地点的obj
const signObj = ref({})
const signPosObj = ref({})
// 拍照打卡ActionSheet显示
const signAcStShow = ref(false)
// 打卡照片url
const signImgUrl = ref('')
// 查看日志ActionSheet显示
const logAcStShow = ref(false)
// 领导获取的教师日志
const allLog = ref('')
watch([
searchValue,
() => signList.watchtypeid,
// () => signList.watch_hour_id,
() => signList.campusid,
() => signList.dept_id,
() => signList.sign,
() => signList.checked,
], (newValue, oldValue) => {
// console.log("🚀🚀🚀,", newValue[5])
if (newValue[0] || newValue[1] || newValue[2] || newValue[3] || newValue[4]) {
clearTimeout(signList.deleteSetTimeOut)
signList.deleteSetTimeOut = setTimeout(async () => {
await search()
// showToast('操作成功!')
}, 500)
}
if (newValue[5]) {
// signList.floatingBubble = signList.checked.lenght ? true :false
signList.floatingBubble = !!signList.checked.length
}
}, {deep: true})
const tabs = (e) => {
signList.is_lead = e.name
onLoad()
}
const batch = async (value) => {
let data = []
signList.checked.map((cur, index) => {
data.push({signid: cur, sign: value})
})
const res = await api.SignInOrOut(data)
signList.checked = []
res.code !== 1 ? showToast(res.msg_detail) : await onLoad()
}
const sign = async (e, signValue) => {
let data = [{
"signid": e.signid,
"sign": signValue
}]
let res = await api.SignInOrOut(data)
await onLoad()
}
const onRefresh = async () => {
signList.loading = true
signList.startTime = dayjs().format('YYYY-MM-DD')
signList.endTime = dayjs().format('YYYY-MM-DD')
signList.sign = 9
signList.is_lead = 0
// signList.page_size = 5
list.value = []
await onLoad()
signList.loading = false
}
const submitLog = async () => {
let data = {
signId: signList.logId,
content: signList.message,
}
const res = await api.SignLogSave(data)
signList.showCenter = false
await onLoad()
}
const dutyLog = (e) => {
signList.logId = e.signid
signList.message = e.content
signList.showCenter = true
}
const search = async () => {
let data = {
"dep_id": signList.dept_id,
"key_name": searchValue.value,
"start_time": signList.startTime,
"end_time": signList.endTime,
"type_id": signList.watchtypeid,
"watchhour_time": signList.watch_hour_id,
"is_lead": signList.is_lead,
sign: Number(signList.sign),
"campus_id": signList.campusid,
"page_index": signList.page_index,
"page_size": signList.page_size,
}
const res = await api.GetSignRecordList(data)
list.value = res.response.data
signList.total = res.response.data_count
}
const onLoad = async () => {
clearTimeout(signList.deleteSetTimeOut)
signList.deleteSetTimeOut = setTimeout(async () => {
let data = {
"dep_id": "",
"key_name": "",
"start_time": signList.startTime,
"end_time": signList.endTime,
"type_id": "",
"watchhour_time": "",
"is_lead": signList.is_lead,
sign: Number(signList.sign),
"campus_id": "",
"page_index": signList.page_index,
"page_size": signList.page_size,
}
const res = await api.GetSignRecordList(data)
list.value = res.response.data
signList.total = res.response.data_count
// 异步更新数据
// setTimeout 仅做示例,真实场景中一般为 ajax 请求
// for (let i = 0; i < 10; i++) {
// list.value.push(list.value.length + 1);
// }
// 数据全部加载完成
if (list.value.length >= Number(signList.total)) {
finished.value = true;
// showToast('操作成功!')
} else if (list.value.length < Number(signList.total)) {
signList.page_size = signList.page_size + 10
// signList.page_index = signList.page_index + 1
}
}, 100)
}
const dateRange = async (e) => {
signList.startTime = dayjs(e[0]).format('YYYY-MM-DD')
signList.endTime = dayjs(e[1]).format('YYYY-MM-DD')
await search()
signList.menuKey++
closeMenu()
}
const closeMenu = () => {
signList.show = false
}
const openMenu = () => {
signList.show = true
}
const addDutySearchSelectList = () => {
Promise.all([
getSearchSelectListPromiseAllAction("dutyType", '类型', "watchtypeid", api.GetWatchTypeSelect),
// getSearchSelectListPromiseAllAction("dutyHourTime", '时段', "watch_hour_id", api.GetWatchHourTime),
getSearchSelectListPromiseAllAction("campusname", '校区', "campusid", api.GetWatchCampusSelect),
getSearchSelectListPromiseAllAction("dept_name", '部门', "dept_id", api.GetWatchDepSelect),
])
.then(res => {
signList.addDutySelectList = res
signList.DatePickerKey++
})
}
const getSearchSelectListPromiseAllAction = (publicName, title, objectAttribute, apiFunction) => {
return new Promise(async (resolve, reject) => {
const publicName = await apiFunction()
const list = []
publicName.response.map((cur, index) => {
list.push({text: cur.name, value: cur.id})
})
let array = [list, title, objectAttribute]
resolve(array)
})
}
//微信获取地理位置
function initWxPosition() {
// 微信初始化,并且获取用户当前定位
var getCurrentData = new Promise((resolve, reject) => {
const params = {
url: window.location.href.replace(window.location.hash, ""),
};
// var urla = `https://asc.hnasct.cn/wx/eicrs/api/GetJSSDK/GetWxConfig`
var urla = `${window.location.origin}/wx/eicrs/api/GetJSSDK/GetWxConfig`
api.GetWxInfo(urla, params).then((result) => {
let data = result;
wx.config({
// beta: true,
debug: false,
appId: data.appId, // 必填,公众号的唯一标识
timestamp: data.timeStamp, // 必填,生成签名的时间戳
nonceStr: data.nonceStr, // 必填,生成签名的随机串
signature: data.signature, // 必填,签名,见附录1
jsApiList: ["getLocation", "getLocalImgData", "chooseImage"], // 必填,需要使用的JS接口列表
});
wx.ready(() => {
// console.log('wx.ready')
// 判断当前客户端版本是否支持指定JS接口
// wx.checkJsApi({
// jsApiList: ['chooseImage'], // 需要检测的JS接口列表,所有JS接口列表见附录2,
// success: function(res) {
// // 以键值对的形式返回,可用的api值true,不可用为false
// // 如:{"checkResult":{"chooseImage":true},"errMsg":"checkJsApi:ok"}
// console.log('支持的接口', res)
// }
// });
// console.log('开始获取定位')
getAddress()
timer.value = setInterval(() => {
getAddress()
}, 30000);
});
});
});
}
//获取定位
function getAddress() {
return new Promise((resolve, reject) => {
wx.getLocation({
type: "gcj02", // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
IsHighAccuracy: true,
success: function (res) {
//iOS给的坐标是number 安卓给的坐标是string
const wgs84Loc = gcj02towgs84(Number(res.longitude), Number(res.latitude))
// console.log('wgs84Loc:', wgs84Loc)
jdNow.value = res.longitude; // 经度,浮点数,范围为180 ~ -180。
wdNow.value = res.latitude; // 纬度,浮点数,范围为90 ~ -90
// that.$notify({ type: 'success', message: '获取地址成功' + jdNow + ',' + wdNow });
geocoder(wgs84Loc[1], wgs84Loc[0]);// 地址解析
// 判断是否进入考勤地点
if (attendanceList.value.some(a => {
let flag = latlngDiff(wdNow.value, jdNow.value, a.latitude, a.longitude) < a.offset
if (flag) {
signPosObj.value = a
}
return flag
})) {
// console.log('进入考勤地点')
allowSignIn.value = true
}
resolve()
},
fail: function (err) {
showDialog({
title: '定位失败',
message: '请检查是否已打开手机定位功能、授权微信APP定位权限、授权公众号使用定位等',
theme: 'round-button',
})/*.then(() => {
clearInterval(that.intervalBox2);
});*/
}
});
})
}
// 地址解析
function geocoder(latitude, longitude) {
// var that = this;
var ll = latitude + "," + longitude;
$.ajax({
type: "get",
url: "https://apis.map.qq.com/ws/geocoder/v1",
async: false,
dataType: "jsonp",
data: {
key: "ZNMBZ-NYOEO-WNMWL-SJF4C-MWKQT-KJB7W", //开发密钥
location: ll, //位置坐标
coord_type: "1", //输入的locations的坐标类型,1 GPS坐标
output: "jsonp"
},
success: function (data, textStatus) {
// console.log(data);
if (data.status == 0) {
address.value =
data.result.address_component.province +
data.result.address_component.city +
data.result.formatted_addresses.recommend;
} else {
// that.$toast("获取地址失败");
showDialog({
title: '获取地址失败',
message: JSON.stringify(data),
theme: 'round-button',
}).then(() => {
// on close
});
}
},
error: function (err) {
// console.log(err);
showDialog({
title: '地址解析错误',
message: JSON.stringify(err),
theme: 'round-button',
}).then(() => {
// on close
});
}
});
}
//GCJ02 转换为 WGS84
function gcj02towgs84(lng, lat) {
if (out_of_china(lng, lat)) {
return [lng, lat]
} else {
var dlat = transformlat(lng - 105.0, lat - 35.0);
var dlng = transformlng(lng - 105.0, lat - 35.0);
var radlat = lat / 180.0 * PI.value;
var magic = Math.sin(radlat);
magic = 1 - ee.value * magic * magic;
var sqrtmagic = Math.sqrt(magic);
dlat = (dlat * 180.0) / ((a.value * (1 - ee.value)) / (magic * sqrtmagic) * PI.value);
dlng = (dlng * 180.0) / (a.value / sqrtmagic * Math.cos(radlat) * PI.value);
var mglat = lat + dlat;
var mglng = lng + dlng;
return [(lng * 2) - mglng, (lat * 2) - mglat];
}
}
//判断是否在国内,不在国内则不做偏移
function out_of_china(lng, lat) {
return (lng < 72.004 || lng > 137.8347) || ((lat < 0.8293 || lat > 55.8271) || false);
}
function transformlat(lng, lat) {
var ret = -100.0 + 2.0 * lng + 3.0 * lat + 0.2 * lat * lat + 0.1 * lng * lat + 0.2 * Math.sqrt(Math.abs(lng));
ret += (20.0 * Math.sin(6.0 * lng * PI.value) + 20.0 * Math.sin(2.0 * lng * PI.value)) * 2.0 / 3.0;
ret += (20.0 * Math.sin(lat * PI.value) + 40.0 * Math.sin(lat / 3.0 * PI.value)) * 2.0 / 3.0;
ret += (160.0 * Math.sin(lat / 12.0 * PI.value) + 320 * Math.sin(lat * PI.value / 30.0)) * 2.0 / 3.0;
return ret
}
function transformlng(lng, lat) {
var ret = 300.0 + lng + 2.0 * lat + 0.1 * lng * lng + 0.1 * lng * lat + 0.1 * Math.sqrt(Math.abs(lng));
ret += (20.0 * Math.sin(6.0 * lng * PI.value) + 20.0 * Math.sin(2.0 * lng * PI.value)) * 2.0 / 3.0;
ret += (20.0 * Math.sin(lng * PI.value) + 40.0 * Math.sin(lng / 3.0 * PI.value)) * 2.0 / 3.0;
ret += (150.0 * Math.sin(lng / 12.0 * PI.value) + 300.0 * Math.sin(lng / 30.0 * PI.value)) * 2.0 / 3.0;
return ret
}
//根据经纬度计算两点之间的距离
function latlngDiff(lat1, lng1, lat2, lng2) {
var s = 999999999;
if (lat1 != null && lng1 != null && lat2 != null && lng2 != null) {
var radLat1 = Rad(lat1);
var radLat2 = Rad(lat2);
var a = radLat1 - radLat2;
var b = Rad(lng1) - Rad(lng2);
s =
2 *
Math.asin(
Math.sqrt(
Math.pow(Math.sin(a / 2), 2) +
Math.cos(radLat1) *
Math.cos(radLat2) *
Math.pow(Math.sin(b / 2), 2)
)
);
s = s * 6378137.0; // 取WGS84标准参考椭球中的地球长半径(单位:m)
s = Math.round(s * 10000) / 10000;
}
// console.log('定位距离',s);
return s;
}
function Rad(d) {
return (d * Math.PI) / 180.0;
}
// 签到按钮禁用计算属性
const signBtDis = computed(() => function (obj) {
// console.log('签到按钮类型计算属性', obj)
// let nowDate = new Date().toLocaleDateString('zh-CN', dateConfig).split('/').join('-')
// let nowDate = new Date().toLocaleDateString('zh-CN', dateConfig)
// let signInTime = new Date(obj.sign_in_time).toLocaleDateString('zh-CN', dateConfig)
// let signOutTime = new Date(obj.sign_out_time).toLocaleDateString('zh-CN', dateConfig)
let nowDate = dayjs()
let signInTime = dayjs(obj.sign_in_time)
let signOutTime = dayjs(obj.sign_out_time)
return !(obj.sign == 0 ? (nowDate > signInTime /*&& nowDate < signOutTime*/) : obj.sign == 1 ? (nowDate > signOutTime) : false)
})
// 定位签到
function locSignIn(obj) {
signObj.value = Object.assign({}, obj)
if (obj.sign_type == 1) {
// 不需要定位拍照的签到
signAcStShow.value = true
return
}
if (allowSignIn.value) {
wx.chooseImage({
count: 1, // 默认9
sizeType: ['compressed'], // 可以指定是原图还是压缩图,默认二者都有
sourceType: ['camera'], // 可以指定来源是相册还是相机,默认二者都有
success: function (res) {
var localIds = res.localIds; // 返回选定照片的本地ID列表,localId可以作为img标签的src属性显示图片
getWxImgX(localIds, new Date())
}
});
} else {
// console.log('不在签到范围')
showToast({
message: "不在签到范围"
})
}
}
// 微信图片上传到本地
function getWxImgX(localId, date) {
showToast({
message: "加载中...",
duration: 0,
forbidClick: true,
loadingType: "spinner",
type: "loading",
});
wx.getLocalImgData({
localId: localId.pop(),
success: function (resp) {
var localData = resp.localData; // localData是图片的base64数据,可以用img标签显示
if (localData.indexOf("data:image") != 0) {
//判断是否有这样的头部
localData = "data:image/jpeg;base64," + localData;
}
localData = localData
// .replace(/\r|\n/g, "")
.replace("data:image/jgp", "data:image/jpeg");
const blobBin = atob(localData.split(",")[1]);
let data = [];
for (var i = 0; i < blobBin.length; i++) {
data.push(blobBin.charCodeAt(i));
}
const type = localData.split(";")[0].split(":")[1];
const name = `image.${localData.split(";")[0].split(":")[1].split("/")[1]}`;
let fileBlob = new Blob([new Uint8Array(data)], {type: type});
const file = new File([fileBlob], name, {type: type});
afterRead(file, localId, date);
},
error: function (e) {
console.err('上传错误', e)
},
});
}
// 文件读取完成后的回调函数
function afterRead(file, localIds, date) {
// console.log(localIds);
let params = new FormData()
// params.append("time", `${new Date(this.nowTimestamp).getHours()}:${new Date(this.nowTimestamp).getMinutes()}`);
// params.append("date", this.getAPPDate(new Date(this.nowTimestamp)));
let time = date.toLocaleDateString('zh-CN', dateConfigTime)
time = time.slice(time.length - 8)
params.append("time", time);
params.append("date", date.toLocaleDateString('zh-CN', dateConfig).split('/').join('-'));
params.append("address", address.value);
params.append("file", file);
api.ImageUpLoad(params).then(res => {
// console.log('照片上传后端后', res)
if (res.code == 1) {
signAcStShow.value = true
signImgUrl.value = res.response.file_path
closeToast()
}
})
}
// 签到按钮
function signBt(obj) {
if (obj.sign != 2) {
let data = {
id: obj.signid,
link: signImgUrl.value,
sign: obj.sign == 0 ? 1 : 2,
attendance: signPosObj.value,
}
showToast({
message: "加载中...",
duration: 0,
forbidClick: true,
loadingType: "spinner",
type: "loading",
});
api.AttendanceSubmit(data).then(res => {
// console.log(res)
if (res.code == 1) {
closeToast()
showSuccessToast(res.response)
signAcStShow.value = false
// 重新获取列表
onLoad()
} else {
closeToast()
showFailToast(res.msg_detail)
}
})
}
}
// 测试用,修改签到时间限制
// function changeSignTimeTest(obj) {
// if (obj.sign == 0) {
// obj.sign_in_time = new Date().toLocaleDateString('zh-CN', dateConfig).split('/').join('-')
// } else if (obj.sign == 1) {
// obj.sign_out_time = new Date().toLocaleDateString('zh-CN', dateConfig).split('/').join('-')
// }
// }
// 领导查看日志
function leadLog(obj) {
showToast({
message: "加载中...",
duration: 0,
forbidClick: true,
loadingType: "spinner",
type: "loading",
});
logAcStShow.value = true
api.LeadLogInit(obj.signid).then(res => {
// console.log(res)
if (res.code == 1) {
allLog.value = res.response
closeToast()
} else {
closeToast()
showFailToast(res.msg_detail)
}
})
}
// 复制教师日志
function copyLog() {
// 创建input元素
const el = document.createElement('input')
// 给input元素赋值需要复制的文本
el.setAttribute('value', allLog.value)
// 将input元素插入页面
document.body.appendChild(el)
// 选中input元素的文本
el.select()
// 复制内容到剪贴板
document.execCommand('copy')
// 删除input元素
document.body.removeChild(el)
showSuccessToast('复制成功')
}
onMounted(() => {
addDutySearchSelectList()
signList.authUserInfo = Cookies.get('user-info').split('"').indexOf('值班领导') === -1 ? -1 : 1
api.GetAttendanceList().then(res => {
// console.log('获取考勤列表', res.response)
attendanceList.value = res.response
// 微信初始化
initWxPosition()
})
// 获取当前用户信息
userInfo.value = JSON.parse(Cookies.get('userInfo'))
// console.log('获取当前用户信息', userInfo.value)
})
onUnmounted(() => {
clearInterval(timer.value)
})
</script>
<template>
<van-pull-refresh v-model="signList.loading" @refresh="onRefresh" :disabled="signList.show ? true :false">
<van-floating-bubble
axis="xy"
icon="chat"
magnetic="x"
:gap="35"
@click="batch(1)"
v-if="signList.floatingBubble"
>
<template v-slot:default>
<div>批量签</div>
</template>
</van-floating-bubble>
<van-floating-bubble
axis="xy"
icon="chat"
magnetic="x"
@click="batch(2)"
:gap="0"
v-if="signList.floatingBubble"
>
<template v-slot:default>
<div>批量休</div>
</template>
</van-floating-bubble>
<div style="position: fixed;z-index: 2;width: 100%">
<!-- &lt;!&ndash; 圆角弹窗(居中) &ndash;&gt;-->
<van-popup v-model:show="signList.showCenter" round style="width: 100%; padding: 10px;">
<template v-slot:default>
<van-field
v-model="signList.message"
rows="2"
autosize
clearable
type="textarea"
maxlength="300"
placeholder="请输入日志"
show-word-limit
/>
<div style="float: right;margin-top: 5px">
<van-button icon="close" size="small" style="margin-right: 10px" @click="signList.showCenter = false">取消
</van-button>
<van-button @click="submitLog" type="primary" icon="passed" size="small" style="margin-right: 10px">提交
</van-button>
</div>
</template>
</van-popup>
<van-nav-bar
title="签到列表"
left-text="返回"
left-arrow
@click-left="onClickLeft"
>
<template v-slot:title><span style="margin-right: 20vw">签到列表</span></template>
<template v-slot:right>
<van-tabs v-model:active="signList.is_lead" shrink type="card" @click-tab="tabs">
<van-tab title="教师">
<template v-slot:title>
<span style="">值班教师</span>
</template>
</van-tab>
<van-tab title="领导">
<template v-slot:title>
<span style="">值班领导</span>
</template>
</van-tab>
</van-tabs>
</template>
</van-nav-bar>
<van-search
v-model="searchValue"
shape="round"
placeholder="请输入搜索关键词"
/>
<van-dropdown-menu :overlay="false">
<van-dropdown-item v-model="signList.sign" title="状态"
:options="signList.signClass"></van-dropdown-item>
<van-dropdown-item @open="openMenu" title="日期">
<!-- <template #default>-->
<!-- <van-calendar :max-date="signList.maxDate" :minDate="signList.minDate" v-model:show="signList.show"-->
<!-- type="range" @confirm="dateRange"/>-->
<!-- </template>-->
</van-dropdown-item>
<van-dropdown-item v-model="signList[item[2]]" v-for="(item,index) in signList.addDutySelectList" :key="index"
:title="item[1]" :options="item[0]"/>
</van-dropdown-menu>
</div>
<!-- 底部弹出日期选择器 -->
<van-popup
v-model:show="signList.show"
position="bottom"
:style="{ height: '60%' }"
>
<template #default>
<van-calendar :max-date="signList.maxDate" :minDate="signList.minDate" v-model:show="signList.show"
type="range" @confirm="dateRange"/>
</template>
</van-popup>
<van-list
class="container"
@load="onLoad"
direction="down"
:finished="finished"
offset="600"
>
<div style="width: 100%;height: 150px"></div>
<!-- <van-cell/>-->
<van-cell-group inset class="cardContainer" v-for="(item,index) in list" :key="index">
<van-cell class="cardContent" :title="item.username">
<template #extra>
<van-tag type="primary" plain><span>{{ item.card_name }}</span></van-tag>
<van-tag color="#7232dd" type="primary" plain style="margin-left: 10px">{{ item.mobile }}</van-tag>
<!-- <van-tag :color="['','#7232dd'][item.is_lead]" type="primary" plain style="margin-left: 10px">-->
<!-- <span>{{ ['值班教师', '值班领导'][item.is_lead] }}</span></van-tag>-->
</template>
</van-cell>
<van-cell class="cardContent" title="日期">
<template #extra>
<van-tag type="primary" plain><span>{{ item.watch_date }}</span></van-tag>
<van-tag v-if="item.mobile!==''" type="primary" plain style="margin-left: 10px">
<span>{{ item.watch_hour_time }}</span></van-tag>
</template>
</van-cell>
<van-cell class="cardContent" title="类型">
<template #extra>
<van-tag type="primary" plain>
<span>{{ item.watchtypename + '-' + item.campusname }}</span></van-tag>
</template>
</van-cell>
<van-cell class="cardContent">
<template #title>
<span>日志</span>
</template>
<template #extra>
<van-text-ellipsis v-if="item.is_lead === 0" :rows="1" :content="item.content" expand-text="展开"
collapse-text="收起"/>
</template>
<template #value>
<van-button
v-if="item.card_name == userInfo.card_number && item.is_lead == 1"
type="primary"
size="small"
@click="leadLog(item)">
查看日志
</van-button>
</template>
</van-cell>
<van-cell class="cardContent" style="display: flex;flex-wrap: nowrap;align-items: center"
v-if="item.is_lead === 0">
<template #value>
<div style="display: flex;flex-wrap: nowrap;align-items: center">
<van-checkbox-group v-model="signList.checked">
<van-checkbox :disabled="item.sign=== 2 || item.sign_set === 1 || signList.authUserInfo === -1"
v-model="item.signid" :name="item.signid"></van-checkbox>
</van-checkbox-group>
<div style="margin-left: auto">
<van-button @click="dutyLog(item)" type="primary" icon="edit" size="small"
style="margin-right: 10px">
日志
</van-button>
<!-- <van-button @click="sign(item,2)"
v-if="item.sign === 1 && item.sign_set === 0 && signList.authUserInfo!== -1" type="warning"
icon="guide-o" size="small" style="margin-right: 10px">签退
</van-button>
<van-button @click="sign(item,1)"
v-if="item.sign === 0 && item.sign_set === 0 && signList.authUserInfo!== -1" type="success"
icon="passed" size="small" style="margin-right: 10px">签到
</van-button>
<van-button :disabled="item.sign === 2" v-if="item.sign === 2" size="small" style="margin-right: 10px">
<van-icon name="passed" style=" margin-left: 5px;color: #23da6f"/>
完成考勤
</van-button> -->
</div>
</div>
</template>
</van-cell>
<van-cell
class="cardContent"
title="签到"
v-if=" item.sign_type !== 0">
<van-button
v-if="item.sign !== 0 && item.sign !==2"
size="small"
:disabled="true"
style="margin-right: 10px;"
>
<van-icon name="edit"/>
{{ `${item.sign == 1 ? '已签到' : ''}` }}
</van-button>
<van-button
v-if="item.sign < 2"
size="small"
:plain="item.sign_type === 1"
:type="item.sign === 0 ? 'success' : 'primary'"
:disabled="signBtDis(item)"
@click="locSignIn(item)">
<van-icon name="edit"/>
{{ `${item.sign === 0 ? '签到' : '签退'}` }}
</van-button>
<span v-else>签到完成</span>
</van-cell>
</van-cell-group>
<div style="width: 100%;height: 100px"></div>
</van-list>
</van-pull-refresh>
<!-- 定位打卡签到 -->
<van-action-sheet
v-model:show="signAcStShow"
ref="VAS"
style="height: 80%;"
:close-on-click-overlay="false"
:title="signObj.sign == 0 ? '签到' : '签退'">
<div style="padding: 16px;">
<div style="width: 80%; margin: auto;">
<img style="width: 100%;" :src="signImgUrl"/>
</div>
<van-sticky container="VAS" position="bottom" :offset-bottom="16">
<van-button :type="signObj.sign == 0 ? 'success' : 'primary'" block @click="signBt(signObj)">
{{ `${signObj.sign == 0 ? '签到' : '签退'}` }}
</van-button>
</van-sticky>
</div>
</van-action-sheet>
<!-- 领导查看日志 -->
<van-action-sheet
v-model:show="logAcStShow"
ref="VASLog"
style="height: 80%;"
title="值班日志"
:close-on-click-overlay="false">
<div style="padding: 16px;">
<van-field
id="teacherLog"
v-model="allLog"
readonly
autosize
label="教师日志"
label-align="top"
type="textarea"
/>
<van-sticky container="VAS" position="bottom" :offset-bottom="16">
<van-button type="primary" block @click="copyLog">复制</van-button>
</van-sticky>
</div>
</van-action-sheet>
</template>
<style scoped lang="less">
.a {
margin-bottom: 50px;
}
.van-floating-bubble {
position: fixed;
left: -81px;
top: 10px;
right: var(--van-floating-bubble-initial-gap);
bottom: -81px;
width: var(--van-floating-bubble-size);
height: var(--van-floating-bubble-size);
box-sizing: border-box;
display: flex;
justify-content: center;
align-items: center;
overflow: hidden;
cursor: pointer;
-webkit-user-select: none;
user-select: none;
touch-action: none;
background: var(--van-floating-bubble-background);
color: var(--van-floating-bubble-color);
border-radius: var(--van-floating-bubble-border-radius);
z-index: var(--van-floating-bubble-z-index);
transition: transform var(--van-duration-base);
}
.container {
//box-sizing: border-box; //background-color: #706c6c; //width: 100%; //height: 100%; //min-height: 896px; //display: flex; //flex-wrap: wrap; //justify-content: center; //align-content: flex-start;
.cardContainer {
margin-top: 10px;
width: 95%;
background-color: #ffffff;
height: 20%;
// .cardContent {
// height: 150px;
// }
}
.cardContainer:nth-last-child(1) {
background-color: red;
}
}
</style>
<script setup>
import _ from 'lodash';
import * as api from '../../api/index.js';
import {ref, reactive, onMounted, watch, computed, onUnmounted} from 'vue';
import dayjs from 'dayjs';
import {showToast, showDialog, ActionSheet, closeToast, showSuccessToast, showFailToast} from "vant";
import Cookies from 'js-cookie'
import wx from "weixin-js-sdk"
import $ from "jquery";
import {useRouter} from "vue-router";
let active = ref(1)
let signList = reactive({
minDate: new Date(dayjs().year(), dayjs().month() - 1, 1),
maxDate: new Date(dayjs().year(), dayjs().month() + 1, 15),
sign: 9,
signClass: [
{
text: '全部状态',
value: 9
},
{
text: '待签到',
value: "0"
},
{
text: '已签到',
value: 1
},
{
text: '已签退',
value: 2
},
],
addDutySelectList: [],
DatePickerKey: 1,
showCenter: false,
message: '',
show: false,
startTime: dayjs().startOf('day').format('YYYY-MM-DD'),
endTime: dayjs().startOf('day').format('YYYY-MM-DD'),
page_index: 1,
page_size: 5,
total: '',
deleteSetTimeOut: '',
menuKey: 1,
loading: false,
authUserInfo: '',
checked: [],
floatingBubble: false,
logId: '',
is_lead: 0,
})
const router = useRouter();
const onClickLeft = () => router.push({
name: 'welcome'
});
const list = ref([]);
const loading = ref(false);
const finished = ref(false);
let searchValue = ref('')
const attendanceList = ref([])
const userInfo = ref({})
const dateConfig = reactive({
year: 'numeric',
month: '2-digit',
day: '2-digit',
hour: '2-digit',
minute: '2-digit',
second: '2-digit',
})
const dateConfigTime = reactive({
hour: '2-digit',
minute: '2-digit',
second: '2-digit',
})
// 定位用↓
const PI = ref(3.1415926535897932384626)
const a = ref(6378245.0)
const ee = ref(0.00669342162296594323)
const jdNow = ref(0)
const wdNow = ref(0)
const address = ref('')
// 定时器
const timer = ref({})
// 是否允许打卡
const allowSignIn = ref(false)
// 点击签到的obj和考勤地点的obj
const signObj = ref({})
const signPosObj = ref({})
// 拍照打卡ActionSheet显示
const signAcStShow = ref(false)
// 打卡照片url
const signImgUrl = ref('')
// 查看日志ActionSheet显示
const logAcStShow = ref(false)
// 领导获取的教师日志
const allLog = ref('')
watch([
searchValue,
() => signList.watchtypeid,
// () => signList.watch_hour_id,
() => signList.campusid,
() => signList.dept_id,
() => signList.sign,
() => signList.checked,
], (newValue, oldValue) => {
// console.log("🚀🚀🚀,", newValue[5])
if (newValue[0] || newValue[1] || newValue[2] || newValue[3] || newValue[4]) {
clearTimeout(signList.deleteSetTimeOut)
signList.deleteSetTimeOut = setTimeout(async () => {
await search()
// showToast('操作成功!')
}, 500)
}
if (newValue[5]) {
// signList.floatingBubble = signList.checked.lenght ? true :false
signList.floatingBubble = !!signList.checked.length
}
}, {deep: true})
const tabs = (e) => {
signList.is_lead = e.name
onLoad()
}
const batch = async (value) => {
let data = []
signList.checked.map((cur, index) => {
data.push({signid: cur, sign: value})
})
const res = await api.SignInOrOut(data)
signList.checked = []
res.code !== 1 ? showToast(res.msg_detail) : await onLoad()
}
const sign = async (e, signValue) => {
let data = [{
"signid": e.signid,
"sign": signValue
}]
let res = await api.SignInOrOut(data)
await onLoad()
}
const onRefresh = async () => {
signList.loading = true
signList.startTime = dayjs().format('YYYY-MM-DD')
signList.endTime = dayjs().format('YYYY-MM-DD')
signList.sign = 9
signList.is_lead = 0
// signList.page_size = 5
list.value = []
await onLoad()
signList.loading = false
}
const submitLog = async () => {
let data = {
signId: signList.logId,
content: signList.message,
}
const res = await api.SignLogSave(data)
if (res.code === 1) showSuccessToast(res.msg)
else {
showSuccessToast(res.msg_detail)
}
signList.showCenter = false
await onLoad()
}
const dutyLog = (e) => {
signList.logId = e.signid
signList.message = e.content
signList.showCenter = true
}
const search = async () => {
let data = {
"dep_id": signList.dept_id,
"key_name": searchValue.value,
"start_time": signList.startTime,
"end_time": signList.endTime,
"type_id": signList.watchtypeid,
"watchhour_time": signList.watch_hour_id,
"is_lead": signList.is_lead,
sign: Number(signList.sign),
"campus_id": signList.campusid,
"page_index": signList.page_index,
"page_size": signList.page_size,
}
const res = await api.GetSignRecordList(data)
list.value = res.response.data
signList.total = res.response.data_count
}
const onLoad = async () => {
clearTimeout(signList.deleteSetTimeOut)
signList.deleteSetTimeOut = setTimeout(async () => {
let data = {
"dep_id": "",
"key_name": "",
"start_time": signList.startTime,
"end_time": signList.endTime,
"type_id": "",
"watchhour_time": "",
"is_lead": signList.is_lead,
sign: Number(signList.sign),
"campus_id": "",
"page_index": signList.page_index,
"page_size": signList.page_size,
}
const res = await api.GetSignRecordList(data)
list.value = res.response.data
signList.total = res.response.data_count
// 异步更新数据
// setTimeout 仅做示例,真实场景中一般为 ajax 请求
// for (let i = 0; i < 10; i++) {
// list.value.push(list.value.length + 1);
// }
// 数据全部加载完成
if (list.value.length >= Number(signList.total)) {
finished.value = true;
// showToast('操作成功!')
} else if (list.value.length < Number(signList.total)) {
signList.page_size = signList.page_size + 10
// signList.page_index = signList.page_index + 1
}
}, 100)
}
const dateRange = async (e) => {
signList.startTime = dayjs(e[0]).format('YYYY-MM-DD')
signList.endTime = dayjs(e[1]).format('YYYY-MM-DD')
await search()
signList.menuKey++
closeMenu()
}
const closeMenu = () => {
signList.show = false
}
const openMenu = () => {
signList.show = true
}
const addDutySearchSelectList = () => {
Promise.all([
getSearchSelectListPromiseAllAction("dutyType", '类型', "watchtypeid", api.GetWatchTypeSelect),
// getSearchSelectListPromiseAllAction("dutyHourTime", '时段', "watch_hour_id", api.GetWatchHourTime),
getSearchSelectListPromiseAllAction("campusname", '校区', "campusid", api.GetWatchCampusSelect),
getSearchSelectListPromiseAllAction("dept_name", '部门', "dept_id", api.GetWatchDepSelect),
])
.then(res => {
signList.addDutySelectList = res
signList.DatePickerKey++
})
}
const getSearchSelectListPromiseAllAction = (publicName, title, objectAttribute, apiFunction) => {
return new Promise(async (resolve, reject) => {
const publicName = await apiFunction()
const list = []
publicName.response.map((cur, index) => {
list.push({text: cur.name, value: cur.id})
})
let array = [list, title, objectAttribute]
resolve(array)
})
}
//微信获取地理位置
function initWxPosition() {
// 微信初始化,并且获取用户当前定位
var getCurrentData = new Promise((resolve, reject) => {
const params = {
url: window.location.href.replace(window.location.hash, ""),
};
// var urla = `https://asc.hnasct.cn/wx/eicrs/api/GetJSSDK/GetWxConfig`
var urla = `${window.location.origin}/wx/eicrs/api/GetJSSDK/GetWxConfig`
api.GetWxInfo(urla, params).then((result) => {
let data = result;
wx.config({
// beta: true,
debug: false,
appId: data.appId, // 必填,公众号的唯一标识
timestamp: data.timeStamp, // 必填,生成签名的时间戳
nonceStr: data.nonceStr, // 必填,生成签名的随机串
signature: data.signature, // 必填,签名,见附录1
jsApiList: ["getLocation", "getLocalImgData", "chooseImage"], // 必填,需要使用的JS接口列表
});
wx.ready(() => {
// console.log('wx.ready')
// 判断当前客户端版本是否支持指定JS接口
// wx.checkJsApi({
// jsApiList: ['chooseImage'], // 需要检测的JS接口列表,所有JS接口列表见附录2,
// success: function(res) {
// // 以键值对的形式返回,可用的api值true,不可用为false
// // 如:{"checkResult":{"chooseImage":true},"errMsg":"checkJsApi:ok"}
// console.log('支持的接口', res)
// }
// });
// console.log('开始获取定位')
getAddress()
timer.value = setInterval(() => {
getAddress()
}, 30000);
});
});
});
}
//获取定位
function getAddress() {
return new Promise((resolve, reject) => {
wx.getLocation({
type: "gcj02", // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
IsHighAccuracy: true,
success: function (res) {
//iOS给的坐标是number 安卓给的坐标是string
const wgs84Loc = gcj02towgs84(Number(res.longitude), Number(res.latitude))
// console.log('wgs84Loc:', wgs84Loc)
jdNow.value = res.longitude; // 经度,浮点数,范围为180 ~ -180。
wdNow.value = res.latitude; // 纬度,浮点数,范围为90 ~ -90
// that.$notify({ type: 'success', message: '获取地址成功' + jdNow + ',' + wdNow });
geocoder(wgs84Loc[1], wgs84Loc[0]);// 地址解析
// 判断是否进入考勤地点
if (attendanceList.value.some(a => {
let flag = latlngDiff(wdNow.value, jdNow.value, a.latitude, a.longitude) < a.offset
if (flag) {
signPosObj.value = a
}
return flag
})) {
// console.log('进入考勤地点')
allowSignIn.value = true
}
resolve()
},
fail: function (err) {
showDialog({
title: '定位失败',
message: '请检查是否已打开手机定位功能、授权微信APP定位权限、授权公众号使用定位等',
theme: 'round-button',
})/*.then(() => {
clearInterval(that.intervalBox2);
});*/
}
});
})
}
// 地址解析
function geocoder(latitude, longitude) {
// var that = this;
var ll = latitude + "," + longitude;
$.ajax({
type: "get",
url: "https://apis.map.qq.com/ws/geocoder/v1",
async: false,
dataType: "jsonp",
data: {
key: "ZNMBZ-NYOEO-WNMWL-SJF4C-MWKQT-KJB7W", //开发密钥
location: ll, //位置坐标
coord_type: "1", //输入的locations的坐标类型,1 GPS坐标
output: "jsonp"
},
success: function (data, textStatus) {
// console.log(data);
if (data.status == 0) {
address.value =
data.result.address_component.province +
data.result.address_component.city +
data.result.formatted_addresses.recommend;
} else {
// that.$toast("获取地址失败");
showDialog({
title: '获取地址失败',
message: JSON.stringify(data),
theme: 'round-button',
}).then(() => {
// on close
});
}
},
error: function (err) {
// console.log(err);
showDialog({
title: '地址解析错误',
message: JSON.stringify(err),
theme: 'round-button',
}).then(() => {
// on close
});
}
});
}
//GCJ02 转换为 WGS84
function gcj02towgs84(lng, lat) {
if (out_of_china(lng, lat)) {
return [lng, lat]
} else {
var dlat = transformlat(lng - 105.0, lat - 35.0);
var dlng = transformlng(lng - 105.0, lat - 35.0);
var radlat = lat / 180.0 * PI.value;
var magic = Math.sin(radlat);
magic = 1 - ee.value * magic * magic;
var sqrtmagic = Math.sqrt(magic);
dlat = (dlat * 180.0) / ((a.value * (1 - ee.value)) / (magic * sqrtmagic) * PI.value);
dlng = (dlng * 180.0) / (a.value / sqrtmagic * Math.cos(radlat) * PI.value);
var mglat = lat + dlat;
var mglng = lng + dlng;
return [(lng * 2) - mglng, (lat * 2) - mglat];
}
}
//判断是否在国内,不在国内则不做偏移
function out_of_china(lng, lat) {
return (lng < 72.004 || lng > 137.8347) || ((lat < 0.8293 || lat > 55.8271) || false);
}
function transformlat(lng, lat) {
var ret = -100.0 + 2.0 * lng + 3.0 * lat + 0.2 * lat * lat + 0.1 * lng * lat + 0.2 * Math.sqrt(Math.abs(lng));
ret += (20.0 * Math.sin(6.0 * lng * PI.value) + 20.0 * Math.sin(2.0 * lng * PI.value)) * 2.0 / 3.0;
ret += (20.0 * Math.sin(lat * PI.value) + 40.0 * Math.sin(lat / 3.0 * PI.value)) * 2.0 / 3.0;
ret += (160.0 * Math.sin(lat / 12.0 * PI.value) + 320 * Math.sin(lat * PI.value / 30.0)) * 2.0 / 3.0;
return ret
}
function transformlng(lng, lat) {
var ret = 300.0 + lng + 2.0 * lat + 0.1 * lng * lng + 0.1 * lng * lat + 0.1 * Math.sqrt(Math.abs(lng));
ret += (20.0 * Math.sin(6.0 * lng * PI.value) + 20.0 * Math.sin(2.0 * lng * PI.value)) * 2.0 / 3.0;
ret += (20.0 * Math.sin(lng * PI.value) + 40.0 * Math.sin(lng / 3.0 * PI.value)) * 2.0 / 3.0;
ret += (150.0 * Math.sin(lng / 12.0 * PI.value) + 300.0 * Math.sin(lng / 30.0 * PI.value)) * 2.0 / 3.0;
return ret
}
//根据经纬度计算两点之间的距离
function latlngDiff(lat1, lng1, lat2, lng2) {
var s = 999999999;
if (lat1 != null && lng1 != null && lat2 != null && lng2 != null) {
var radLat1 = Rad(lat1);
var radLat2 = Rad(lat2);
var a = radLat1 - radLat2;
var b = Rad(lng1) - Rad(lng2);
s =
2 *
Math.asin(
Math.sqrt(
Math.pow(Math.sin(a / 2), 2) +
Math.cos(radLat1) *
Math.cos(radLat2) *
Math.pow(Math.sin(b / 2), 2)
)
);
s = s * 6378137.0; // 取WGS84标准参考椭球中的地球长半径(单位:m)
s = Math.round(s * 10000) / 10000;
}
// console.log('定位距离',s);
return s;
}
function Rad(d) {
return (d * Math.PI) / 180.0;
}
// 签到按钮禁用计算属性
const signBtDis = computed(() => function (obj) {
// console.log('签到按钮类型计算属性', obj)
// let nowDate = new Date().toLocaleDateString('zh-CN', dateConfig).split('/').join('-')
// let nowDate = new Date().toLocaleDateString('zh-CN', dateConfig)
// let signInTime = new Date(obj.sign_in_time).toLocaleDateString('zh-CN', dateConfig)
// let signOutTime = new Date(obj.sign_out_time).toLocaleDateString('zh-CN', dateConfig)
let nowDate = dayjs()
let signInTime = dayjs(obj.sign_in_time)
let signOutTime = dayjs(obj.sign_out_time)
return !(obj.sign == 0 ? (nowDate > signInTime /*&& nowDate < signOutTime*/) : obj.sign == 1 ? (nowDate > signOutTime) : false)
})
// 定位签到
function locSignIn(obj) {
signObj.value = Object.assign({}, obj)
if (obj.sign_type == 1) {
// 不需要定位拍照的签到
signAcStShow.value = true
return
}
if (allowSignIn.value) {
wx.chooseImage({
count: 1, // 默认9
sizeType: ['compressed'], // 可以指定是原图还是压缩图,默认二者都有
sourceType: ['camera'], // 可以指定来源是相册还是相机,默认二者都有
success: function (res) {
var localIds = res.localIds; // 返回选定照片的本地ID列表,localId可以作为img标签的src属性显示图片
getWxImgX(localIds, new Date())
}
});
} else {
// console.log('不在签到范围')
showToast({
message: "不在签到范围"
})
}
}
// 微信图片上传到本地
function getWxImgX(localId, date) {
showToast({
message: "加载中...",
duration: 0,
forbidClick: true,
loadingType: "spinner",
type: "loading",
});
wx.getLocalImgData({
localId: localId.pop(),
success: function (resp) {
var localData = resp.localData; // localData是图片的base64数据,可以用img标签显示
if (localData.indexOf("data:image") != 0) {
//判断是否有这样的头部
localData = "data:image/jpeg;base64," + localData;
}
localData = localData
// .replace(/\r|\n/g, "")
.replace("data:image/jgp", "data:image/jpeg");
const blobBin = atob(localData.split(",")[1]);
let data = [];
for (var i = 0; i < blobBin.length; i++) {
data.push(blobBin.charCodeAt(i));
}
const type = localData.split(";")[0].split(":")[1];
const name = `image.${localData.split(";")[0].split(":")[1].split("/")[1]}`;
let fileBlob = new Blob([new Uint8Array(data)], {type: type});
const file = new File([fileBlob], name, {type: type});
afterRead(file, localId, date);
},
error: function (e) {
console.err('上传错误', e)
},
});
}
// 文件读取完成后的回调函数
function afterRead(file, localIds, date) {
// console.log(localIds);
let params = new FormData()
// params.append("time", `${new Date(this.nowTimestamp).getHours()}:${new Date(this.nowTimestamp).getMinutes()}`);
// params.append("date", this.getAPPDate(new Date(this.nowTimestamp)));
let time = date.toLocaleDateString('zh-CN', dateConfigTime)
time = time.slice(time.length - 8)
params.append("time", time);
params.append("date", date.toLocaleDateString('zh-CN', dateConfig).split('/').join('-'));
params.append("address", address.value);
params.append("file", file);
api.ImageUpLoad(params).then(res => {
// console.log('照片上传后端后', res)
if (res.code == 1) {
signAcStShow.value = true
signImgUrl.value = res.response.file_path
closeToast()
}
})
}
// 签到按钮
function signBt(obj) {
if (obj.sign != 2) {
let data = {
id: obj.signid,
link: signImgUrl.value,
sign: obj.sign == 0 ? 1 : 2,
attendance: signPosObj.value,
}
showToast({
message: "加载中...",
duration: 0,
forbidClick: true,
loadingType: "spinner",
type: "loading",
});
api.AttendanceSubmit(data).then(res => {
// console.log(res)
if (res.code == 1) {
closeToast()
showSuccessToast(res.response)
signAcStShow.value = false
// 重新获取列表
onLoad()
} else {
closeToast()
showFailToast(res.msg_detail)
}
})
}
}
// 测试用,修改签到时间限制
// function changeSignTimeTest(obj) {
// if (obj.sign == 0) {
// obj.sign_in_time = new Date().toLocaleDateString('zh-CN', dateConfig).split('/').join('-')
// } else if (obj.sign == 1) {
// obj.sign_out_time = new Date().toLocaleDateString('zh-CN', dateConfig).split('/').join('-')
// }
// }
// 领导查看日志
function leadLog(obj) {
showToast({
message: "加载中...",
duration: 0,
forbidClick: true,
loadingType: "spinner",
type: "loading",
});
logAcStShow.value = true
api.LeadLogInit(obj.signid).then(res => {
// console.log(res)
if (res.code == 1) {
allLog.value = res.response
closeToast()
} else {
closeToast()
showFailToast(res.msg_detail)
}
})
}
// 复制教师日志
function copyLog() {
// 创建input元素
const el = document.createElement('input')
// 给input元素赋值需要复制的文本
el.setAttribute('value', allLog.value)
// 将input元素插入页面
document.body.appendChild(el)
// 选中input元素的文本
el.select()
// 复制内容到剪贴板
document.execCommand('copy')
// 删除input元素
document.body.removeChild(el)
showSuccessToast('复制成功')
}
onMounted(() => {
addDutySearchSelectList()
signList.authUserInfo = Cookies.get('user-info').split('"').indexOf('值班领导') === -1 ? -1 : 1
api.GetAttendanceList().then(res => {
// console.log('获取考勤列表', res.response)
attendanceList.value = res.response
// 微信初始化
initWxPosition()
})
// 获取当前用户信息
userInfo.value = JSON.parse(Cookies.get('userInfo'))
// console.log('获取当前用户信息', userInfo.value)
})
onUnmounted(() => {
clearInterval(timer.value)
})
</script>
<template>
<van-pull-refresh v-model="signList.loading" @refresh="onRefresh">
<van-floating-bubble
axis="xy"
icon="chat"
magnetic="x"
:gap="35"
@click="batch(1)"
v-if="signList.floatingBubble"
>
<template v-slot:default>
<div>批量签</div>
</template>
</van-floating-bubble>
<van-floating-bubble
axis="xy"
icon="chat"
magnetic="x"
@click="batch(2)"
:gap="0"
v-if="signList.floatingBubble"
>
<template v-slot:default>
<div>批量休</div>
</template>
</van-floating-bubble>
<div style="position: fixed;z-index: 2;width: 100%">
<!-- &lt;!&ndash; 圆角弹窗(居中) &ndash;&gt;-->
<van-popup v-model:show="signList.showCenter" round style="width: 100%; padding: 10px;">
<template v-slot:default>
<van-field
v-model="signList.message"
rows="2"
autosize
clearable
type="textarea"
maxlength="100"
placeholder="请输入日志"
show-word-limit
/>
<div style="float: right">
<van-button icon="close" size="small" style="margin-right: 10px" @click="signList.showCenter = false">取消
</van-button>
<van-button @click="submitLog" type="primary" icon="passed" size="small" style="margin-right: 10px">提交
</van-button>
</div>
</template>
</van-popup>
<van-nav-bar
title="签到列表"
left-text="返回"
left-arrow
@click-left="onClickLeft"
>
<template v-slot:title><span style="margin-right: 20vw">签到列表</span></template>
<template v-slot:right>
<van-tabs v-model:active="signList.is_lead" shrink type="card" @click-tab="tabs">
<van-tab title="教师">
<template v-slot:title>
<span style="">值班教师</span>
</template>
</van-tab>
<van-tab title="领导">
<template v-slot:title>
<span style="">值班领导</span>
</template>
</van-tab>
</van-tabs>
</template>
</van-nav-bar>
<van-search
v-model="searchValue"
shape="round"
placeholder="请输入搜索关键词"
/>
<van-dropdown-menu :overlay="false">
<van-dropdown-item v-model="signList.sign" title="状态"
:options="signList.signClass"></van-dropdown-item>
<van-dropdown-item @close="closeMenu" :key="signList.menuKey" @open="openMenu" title="日期">
<template #default>
<van-calendar :max-date="signList.maxDate" :minDate="signList.minDate" v-model:show="signList.show"
type="range" @confirm="dateRange"/>
</template>
</van-dropdown-item>
<van-dropdown-item v-model="signList[item[2]]" v-for="(item,index) in signList.addDutySelectList" :key="index"
:title="item[1]" :options="item[0]"/>
</van-dropdown-menu>
</div>
<van-list
class="container"
@load="onLoad"
direction="down"
:finished="finished"
offset="600"
>
<div style="width: 100%;height: 150px"></div>
<!-- <van-cell/>-->
<van-cell-group inset class="cardContainer" v-for="(item,index) in list" :key="index">
<van-cell class="cardContent" :title="item.username">
<template #extra>
<van-tag type="primary" plain><span>{{ item.card_name }}</span></van-tag>
<van-tag color="#7232dd" type="primary" plain style="margin-left: 10px">{{ item.mobile }}</van-tag>
<!-- <van-tag :color="['','#7232dd'][item.is_lead]" type="primary" plain style="margin-left: 10px">-->
<!-- <span>{{ ['值班教师', '值班领导'][item.is_lead] }}</span></van-tag>-->
</template>
</van-cell>
<van-cell class="cardContent" title="日期">
<template #extra>
<van-tag type="primary" plain><span>{{ item.watch_date }}</span></van-tag>
<van-tag v-if="item.mobile!==''" type="primary" plain style="margin-left: 10px">
<span>{{ item.watch_hour_time }}</span></van-tag>
</template>
</van-cell>
<van-cell class="cardContent" title="类型">
<template #extra>
<van-tag type="primary" plain>
<span>{{ item.watchtypename + '-' + item.campusname }}</span></van-tag>
</template>
</van-cell>
<van-cell class="cardContent">
<template #title>
<span>日志</span>
</template>
<template #extra>
<van-text-ellipsis :rows="1" :content="item.content" expand-text="展开" collapse-text="收起"/>
</template>
<template #value>
<van-button
v-if="item.card_name == userInfo.card_number && userInfo.role[0].indexOf('值班领导') != -1"
type="primary"
size="small"
@click="leadLog(item)">
查看日志
</van-button>
</template>
</van-cell>
<van-cell
class="cardContent"
title="签到"
v-if="item.card_name == userInfo.card_number && item.sign_type != 0">
<!-- <van-button
v-if="item.sign_type == 1 && item.sign < 2"
plain
size="small"
:type="item.sign == 0 ? 'success' : 'primary'"
:disabled="signBtDis(item)"
@click="signBt(item)">
<van-icon name="edit" />
{{ `${item.sign == 0 ? '签到' : '签退'}` }}
</van-button> -->
<van-button
v-if="item.sign !== 0 && item.sign !==2"
size="small"
:disabled="true"
style="margin-right: 10px;"
>
<van-icon name="edit"/>
{{ `${item.sign == 1 ? '已签到' : ''}` }}
</van-button>
<van-button
v-if="item.sign < 2"
size="small"
:plain="item.sign_type == 1"
:type="item.sign == 0 ? 'success' : 'primary'"
:disabled="signBtDis(item)"
@click="locSignIn(item)">
<van-icon name="edit"/>
{{ `${item.sign == 0 ? '签到' : '签退'}` }}
</van-button>
<span v-else>签到完成</span>
<!-- <van-button type="danger" @click="changeSignTimeTest(item)">测试用,修改签到时间限制</van-button> -->
</van-cell>
<!-- <van-cell class="cardContent" style="display: flex;flex-wrap: nowrap;align-items: center">
<template #value>
<div style="display: flex;flex-wrap: nowrap;align-items: center">
<van-checkbox-group v-model="signList.checked">
<van-checkbox :disabled="item.sign=== 2 || item.sign_set === 1 || signList.authUserInfo === -1"
v-model="item.signid" :name="item.signid"></van-checkbox>
</van-checkbox-group>
<div style="margin-left: auto">
<van-button @click="dutyLog(item)" type="primary" icon="edit" size="small" style="margin-right: 10px">
日志
</van-button>
<van-button @click="sign(item,2)"
v-if="item.sign === 1 && item.sign_set === 0 && signList.authUserInfo!== -1" type="warning"
icon="guide-o" size="small" style="margin-right: 10px">签退
</van-button>
<van-button @click="sign(item,1)"
v-if="item.sign === 0 && item.sign_set === 0 && signList.authUserInfo!== -1" type="success"
icon="passed" size="small" style="margin-right: 10px">签到
</van-button>
<van-button :disabled="item.sign === 2" v-if="item.sign === 2" size="small" style="margin-right: 10px">
<van-icon name="passed" style=" margin-left: 5px;color: #23da6f"/>
完成考勤
</van-button>
</div>
</div>
</template>
</van-cell> -->
</van-cell-group>
<div style="width: 100%;height: 100px"></div>
</van-list>
</van-pull-refresh>
<!-- 定位打卡签到 -->
<van-action-sheet
v-model:show="signAcStShow"
ref="VAS"
style="height: 80%;"
:close-on-click-overlay="false"
:title="signObj.sign == 0 ? '签到' : '签退'">
<div style="padding: 16px;">
<div style="width: 80%; margin: auto;">
<img style="width: 100%;" :src="signImgUrl"/>
</div>
<van-sticky container="VAS" position="bottom" :offset-bottom="16">
<van-button :type="signObj.sign == 0 ? 'success' : 'primary'" block @click="signBt(signObj)">
{{ `${signObj.sign == 0 ? '签到' : '签退'}` }}
</van-button>
</van-sticky>
</div>
</van-action-sheet>
<!-- 领导查看日志 -->
<van-action-sheet
v-model:show="logAcStShow"
ref="VASLog"
style="height: 80%;"
title="值班日志"
:close-on-click-overlay="false">
<div style="padding: 16px;">
<van-field
id="teacherLog"
v-model="allLog"
readonly
autosize
label="教师日志"
label-align="top"
type="textarea"
/>
<van-sticky container="VAS" position="bottom" :offset-bottom="16">
<van-button type="primary" block @click="copyLog">复制</van-button>
</van-sticky>
</div>
</van-action-sheet>
</template>
<style scoped lang="less">
.a {
margin-bottom: 50px;
}
.van-floating-bubble {
position: fixed;
left: -81px;
top: 10px;
right: var(--van-floating-bubble-initial-gap);
bottom: -81px;
width: var(--van-floating-bubble-size);
height: var(--van-floating-bubble-size);
box-sizing: border-box;
display: flex;
justify-content: center;
align-items: center;
overflow: hidden;
cursor: pointer;
-webkit-user-select: none;
user-select: none;
touch-action: none;
background: var(--van-floating-bubble-background);
color: var(--van-floating-bubble-color);
border-radius: var(--van-floating-bubble-border-radius);
z-index: var(--van-floating-bubble-z-index);
transition: transform var(--van-duration-base);
}
.container {
//box-sizing: border-box; //background-color: #706c6c; //width: 100%; //height: 100%; //min-height: 896px; //display: flex; //flex-wrap: wrap; //justify-content: center; //align-content: flex-start;
.cardContainer {
margin-top: 10px;
width: 95%;
background-color: #ffffff;
height: 20%;
// .cardContent {
// height: 150px;
// }
}
.cardContainer:nth-last-child(1) {
background-color: red;
}
}
</style>
<script setup>
import _ from 'lodash';
import * as api from '../../api/index.js';
import {ref, reactive, onMounted, watch, computed, onUnmounted} from 'vue';
import dayjs from 'dayjs';
import {showToast, showDialog, ActionSheet, closeToast, showSuccessToast, showFailToast} from "vant";
import Cookies from 'js-cookie'
import wx from "weixin-js-sdk"
import $ from "jquery";
import {useRouter} from "vue-router";
let active = ref(1)
let signList = reactive({
minDate: new Date(dayjs().year(), dayjs().month() - 1, 1),
maxDate: new Date(dayjs().year(), dayjs().month() + 1, 1),
sign: 9,
signClass: [
{
text: '全部状态',
value: 9
},
{
text: '待签到',
value: "0"
},
{
text: '已签到',
value: 1
},
{
text: '已签退',
value: 2
},
],
addDutySelectList: [],
DatePickerKey: 1,
showCenter: false,
message: '',
show: false,
startTime: dayjs().startOf('day').format('YYYY-MM-DD'),
endTime: dayjs().startOf('day').format('YYYY-MM-DD'),
page_index: 1,
page_size: 5,
total: '',
deleteSetTimeOut: '',
menuKey: 1,
loading: false,
authUserInfo: '',
checked: [],
floatingBubble: false,
logId: '',
is_lead: 0,
})
const router = useRouter();
const onClickLeft = () => router.push({
name: 'welcome'
});
const list = ref([]);
const loading = ref(false);
const finished = ref(false);
let searchValue = ref('')
const attendanceList = ref([])
const userInfo = ref({})
const dateConfig = reactive({
year: 'numeric',
month: '2-digit',
day: '2-digit',
hour: '2-digit',
minute: '2-digit',
second: '2-digit',
})
const dateConfigTime = reactive({
hour: '2-digit',
minute: '2-digit',
second: '2-digit',
})
// 定位用↓
const PI = ref(3.1415926535897932384626)
const a = ref(6378245.0)
const ee = ref(0.00669342162296594323)
const jdNow = ref(0)
const wdNow = ref(0)
const address = ref('')
// 定时器
const timer = ref({})
// 是否允许打卡
const allowSignIn = ref(false)
// 点击签到的obj和考勤地点的obj
const signObj = ref({})
const signPosObj = ref({})
// 拍照打卡ActionSheet显示
const signAcStShow = ref(false)
// 打卡照片url
const signImgUrl = ref('')
// 查看日志ActionSheet显示
const logAcStShow = ref(false)
// 领导获取的教师日志
const allLog = ref('')
watch([
searchValue,
() => signList.watchtypeid,
// () => signList.watch_hour_id,
() => signList.campusid,
() => signList.dept_id,
() => signList.sign,
() => signList.checked,
], (newValue, oldValue) => {
// console.log("🚀🚀🚀,", newValue[5])
if (newValue[0] || newValue[1] || newValue[2] || newValue[3] || newValue[4]) {
clearTimeout(signList.deleteSetTimeOut)
signList.deleteSetTimeOut = setTimeout(async () => {
await search()
// showToast('操作成功!')
}, 500)
}
if (newValue[5]) {
// signList.floatingBubble = signList.checked.lenght ? true :false
signList.floatingBubble = !!signList.checked.length
}
}, {deep: true})
const tabs = (e) => {
signList.is_lead = e.name
onLoad()
}
const batch = async (value) => {
let data = []
signList.checked.map((cur, index) => {
data.push({signid: cur, sign: value})
})
const res = await api.SignInOrOut(data)
signList.checked = []
res.code !== 1 ? showToast(res.msg_detail) : await onLoad()
}
const sign = async (e, signValue) => {
let data = [{
"signid": e.signid,
"sign": signValue
}]
let res = await api.SignInOrOut(data)
await onLoad()
}
const onRefresh = async () => {
signList.loading = true
signList.startTime = dayjs().format('YYYY-MM-DD')
signList.endTime = dayjs().format('YYYY-MM-DD')
signList.sign = 9
signList.is_lead = 0
// signList.page_size = 5
list.value = []
await onLoad()
signList.loading = false
}
const submitLog = async () => {
let data = {
signId: signList.logId,
content: signList.message,
}
const res = await api.SignLogSave(data)
signList.showCenter = false
await onLoad()
}
const dutyLog = (e) => {
signList.logId = e.signid
signList.message = e.content
signList.showCenter = true
}
const search = async () => {
let data = {
"dep_id": signList.dept_id,
"key_name": searchValue.value,
"start_time": signList.startTime,
"end_time": signList.endTime,
"type_id": signList.watchtypeid,
"watchhour_time": signList.watch_hour_id,
"is_lead": signList.is_lead,
sign: Number(signList.sign),
"campus_id": signList.campusid,
"page_index": signList.page_index,
"page_size": signList.page_size,
}
const res = await api.GetSignRecordList(data)
list.value = res.response.data
signList.total = res.response.data_count
}
const onLoad = async () => {
clearTimeout(signList.deleteSetTimeOut)
signList.deleteSetTimeOut = setTimeout(async () => {
let data = {
"dep_id": "",
"key_name": "",
"start_time": signList.startTime,
"end_time": signList.endTime,
"type_id": "",
"watchhour_time": "",
"is_lead": signList.is_lead,
sign: Number(signList.sign),
"campus_id": "",
"page_index": signList.page_index,
"page_size": signList.page_size,
}
const res = await api.GetSignRecordList(data)
list.value = res.response.data
signList.total = res.response.data_count
// 异步更新数据
// setTimeout 仅做示例,真实场景中一般为 ajax 请求
// for (let i = 0; i < 10; i++) {
// list.value.push(list.value.length + 1);
// }
// 数据全部加载完成
if (list.value.length >= Number(signList.total)) {
finished.value = true;
// showToast('操作成功!')
} else if (list.value.length < Number(signList.total)) {
signList.page_size = signList.page_size + 10
// signList.page_index = signList.page_index + 1
}
}, 100)
}
const dateRange = async (e) => {
signList.startTime = dayjs(e[0]).format('YYYY-MM-DD')
signList.endTime = dayjs(e[1]).format('YYYY-MM-DD')
await search()
signList.menuKey++
closeMenu()
}
const closeMenu = () => {
signList.show = false
}
const openMenu = () => {
signList.show = true
}
const addDutySearchSelectList = () => {
Promise.all([
getSearchSelectListPromiseAllAction("dutyType", '类型', "watchtypeid", api.GetWatchTypeSelect),
// getSearchSelectListPromiseAllAction("dutyHourTime", '时段', "watch_hour_id", api.GetWatchHourTime),
getSearchSelectListPromiseAllAction("campusname", '校区', "campusid", api.GetWatchCampusSelect),
getSearchSelectListPromiseAllAction("dept_name", '部门', "dept_id", api.GetWatchDepSelect),
])
.then(res => {
signList.addDutySelectList = res
signList.DatePickerKey++
})
}
const getSearchSelectListPromiseAllAction = (publicName, title, objectAttribute, apiFunction) => {
return new Promise(async (resolve, reject) => {
const publicName = await apiFunction()
const list = []
publicName.response.map((cur, index) => {
list.push({text: cur.name, value: cur.id})
})
let array = [list, title, objectAttribute]
resolve(array)
})
}
//微信获取地理位置
function initWxPosition() {
// 微信初始化,并且获取用户当前定位
var getCurrentData = new Promise((resolve, reject) => {
const params = {
url: window.location.href.replace(window.location.hash, ""),
};
// var urla = `https://asc.hnasct.cn/wx/eicrs/api/GetJSSDK/GetWxConfig`
var urla = `${window.location.origin}/wx/eicrs/api/GetJSSDK/GetWxConfig`
api.GetWxInfo(urla, params).then((result) => {
let data = result;
wx.config({
// beta: true,
debug: false,
appId: data.appId, // 必填,公众号的唯一标识
timestamp: data.timeStamp, // 必填,生成签名的时间戳
nonceStr: data.nonceStr, // 必填,生成签名的随机串
signature: data.signature, // 必填,签名,见附录1
jsApiList: ["getLocation", "getLocalImgData", "chooseImage"], // 必填,需要使用的JS接口列表
});
wx.ready(() => {
// console.log('wx.ready')
// 判断当前客户端版本是否支持指定JS接口
// wx.checkJsApi({
// jsApiList: ['chooseImage'], // 需要检测的JS接口列表,所有JS接口列表见附录2,
// success: function(res) {
// // 以键值对的形式返回,可用的api值true,不可用为false
// // 如:{"checkResult":{"chooseImage":true},"errMsg":"checkJsApi:ok"}
// console.log('支持的接口', res)
// }
// });
// console.log('开始获取定位')
getAddress()
timer.value = setInterval(() => {
getAddress()
}, 30000);
});
});
});
}
//获取定位
function getAddress() {
return new Promise((resolve, reject) => {
wx.getLocation({
type: "gcj02", // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
IsHighAccuracy: true,
success: function (res) {
//iOS给的坐标是number 安卓给的坐标是string
const wgs84Loc = gcj02towgs84(Number(res.longitude), Number(res.latitude))
// console.log('wgs84Loc:', wgs84Loc)
jdNow.value = res.longitude; // 经度,浮点数,范围为180 ~ -180。
wdNow.value = res.latitude; // 纬度,浮点数,范围为90 ~ -90
// that.$notify({ type: 'success', message: '获取地址成功' + jdNow + ',' + wdNow });
geocoder(wgs84Loc[1], wgs84Loc[0]);// 地址解析
// 判断是否进入考勤地点
if (attendanceList.value.some(a => {
let flag = latlngDiff(wdNow.value, jdNow.value, a.latitude, a.longitude) < a.offset
if (flag) {
signPosObj.value = a
}
return flag
})) {
// console.log('进入考勤地点')
allowSignIn.value = true
}
resolve()
},
fail: function (err) {
showDialog({
title: '定位失败',
message: '请检查是否已打开手机定位功能、授权微信APP定位权限、授权公众号使用定位等',
theme: 'round-button',
})/*.then(() => {
clearInterval(that.intervalBox2);
});*/
}
});
})
}
// 地址解析
function geocoder(latitude, longitude) {
// var that = this;
var ll = latitude + "," + longitude;
$.ajax({
type: "get",
url: "https://apis.map.qq.com/ws/geocoder/v1",
async: false,
dataType: "jsonp",
data: {
key: "ZNMBZ-NYOEO-WNMWL-SJF4C-MWKQT-KJB7W", //开发密钥
location: ll, //位置坐标
coord_type: "1", //输入的locations的坐标类型,1 GPS坐标
output: "jsonp"
},
success: function (data, textStatus) {
// console.log(data);
if (data.status == 0) {
address.value =
data.result.address_component.province +
data.result.address_component.city +
data.result.formatted_addresses.recommend;
} else {
// that.$toast("获取地址失败");
showDialog({
title: '获取地址失败',
message: JSON.stringify(data),
theme: 'round-button',
}).then(() => {
// on close
});
}
},
error: function (err) {
// console.log(err);
showDialog({
title: '地址解析错误',
message: JSON.stringify(err),
theme: 'round-button',
}).then(() => {
// on close
});
}
});
}
//GCJ02 转换为 WGS84
function gcj02towgs84(lng, lat) {
if (out_of_china(lng, lat)) {
return [lng, lat]
} else {
var dlat = transformlat(lng - 105.0, lat - 35.0);
var dlng = transformlng(lng - 105.0, lat - 35.0);
var radlat = lat / 180.0 * PI.value;
var magic = Math.sin(radlat);
magic = 1 - ee.value * magic * magic;
var sqrtmagic = Math.sqrt(magic);
dlat = (dlat * 180.0) / ((a.value * (1 - ee.value)) / (magic * sqrtmagic) * PI.value);
dlng = (dlng * 180.0) / (a.value / sqrtmagic * Math.cos(radlat) * PI.value);
var mglat = lat + dlat;
var mglng = lng + dlng;
return [(lng * 2) - mglng, (lat * 2) - mglat];
}
}
//判断是否在国内,不在国内则不做偏移
function out_of_china(lng, lat) {
return (lng < 72.004 || lng > 137.8347) || ((lat < 0.8293 || lat > 55.8271) || false);
}
function transformlat(lng, lat) {
var ret = -100.0 + 2.0 * lng + 3.0 * lat + 0.2 * lat * lat + 0.1 * lng * lat + 0.2 * Math.sqrt(Math.abs(lng));
ret += (20.0 * Math.sin(6.0 * lng * PI.value) + 20.0 * Math.sin(2.0 * lng * PI.value)) * 2.0 / 3.0;
ret += (20.0 * Math.sin(lat * PI.value) + 40.0 * Math.sin(lat / 3.0 * PI.value)) * 2.0 / 3.0;
ret += (160.0 * Math.sin(lat / 12.0 * PI.value) + 320 * Math.sin(lat * PI.value / 30.0)) * 2.0 / 3.0;
return ret
}
function transformlng(lng, lat) {
var ret = 300.0 + lng + 2.0 * lat + 0.1 * lng * lng + 0.1 * lng * lat + 0.1 * Math.sqrt(Math.abs(lng));
ret += (20.0 * Math.sin(6.0 * lng * PI.value) + 20.0 * Math.sin(2.0 * lng * PI.value)) * 2.0 / 3.0;
ret += (20.0 * Math.sin(lng * PI.value) + 40.0 * Math.sin(lng / 3.0 * PI.value)) * 2.0 / 3.0;
ret += (150.0 * Math.sin(lng / 12.0 * PI.value) + 300.0 * Math.sin(lng / 30.0 * PI.value)) * 2.0 / 3.0;
return ret
}
//根据经纬度计算两点之间的距离
function latlngDiff(lat1, lng1, lat2, lng2) {
var s = 999999999;
if (lat1 != null && lng1 != null && lat2 != null && lng2 != null) {
var radLat1 = Rad(lat1);
var radLat2 = Rad(lat2);
var a = radLat1 - radLat2;
var b = Rad(lng1) - Rad(lng2);
s =
2 *
Math.asin(
Math.sqrt(
Math.pow(Math.sin(a / 2), 2) +
Math.cos(radLat1) *
Math.cos(radLat2) *
Math.pow(Math.sin(b / 2), 2)
)
);
s = s * 6378137.0; // 取WGS84标准参考椭球中的地球长半径(单位:m)
s = Math.round(s * 10000) / 10000;
}
// console.log('定位距离',s);
return s;
}
function Rad(d) {
return (d * Math.PI) / 180.0;
}
// 签到按钮禁用计算属性
const signBtDis = computed(() => function (obj) {
// console.log('签到按钮类型计算属性', obj)
// let nowDate = new Date().toLocaleDateString('zh-CN', dateConfig).split('/').join('-')
// let nowDate = new Date().toLocaleDateString('zh-CN', dateConfig)
// let signInTime = new Date(obj.sign_in_time).toLocaleDateString('zh-CN', dateConfig)
// let signOutTime = new Date(obj.sign_out_time).toLocaleDateString('zh-CN', dateConfig)
let nowDate = dayjs()
let signInTime = dayjs(obj.sign_in_time)
let signOutTime = dayjs(obj.sign_out_time)
return !(obj.sign == 0 ? (nowDate > signInTime /*&& nowDate < signOutTime*/) : obj.sign == 1 ? (nowDate > signOutTime) : false)
})
// 定位签到
function locSignIn(obj) {
signObj.value = Object.assign({}, obj)
if (obj.sign_type == 1) {
// 不需要定位拍照的签到
signAcStShow.value = true
return
}
if (allowSignIn.value) {
wx.chooseImage({
count: 1, // 默认9
sizeType: ['compressed'], // 可以指定是原图还是压缩图,默认二者都有
sourceType: ['camera'], // 可以指定来源是相册还是相机,默认二者都有
success: function (res) {
var localIds = res.localIds; // 返回选定照片的本地ID列表,localId可以作为img标签的src属性显示图片
getWxImgX(localIds, new Date())
}
});
} else {
// console.log('不在签到范围')
showToast({
message: "不在签到范围"
})
}
}
// 微信图片上传到本地
function getWxImgX(localId, date) {
showToast({
message: "加载中...",
duration: 0,
forbidClick: true,
loadingType: "spinner",
type: "loading",
});
wx.getLocalImgData({
localId: localId.pop(),
success: function (resp) {
var localData = resp.localData; // localData是图片的base64数据,可以用img标签显示
if (localData.indexOf("data:image") != 0) {
//判断是否有这样的头部
localData = "data:image/jpeg;base64," + localData;
}
localData = localData
// .replace(/\r|\n/g, "")
.replace("data:image/jgp", "data:image/jpeg");
const blobBin = atob(localData.split(",")[1]);
let data = [];
for (var i = 0; i < blobBin.length; i++) {
data.push(blobBin.charCodeAt(i));
}
const type = localData.split(";")[0].split(":")[1];
const name = `image.${localData.split(";")[0].split(":")[1].split("/")[1]}`;
let fileBlob = new Blob([new Uint8Array(data)], {type: type});
const file = new File([fileBlob], name, {type: type});
afterRead(file, localId, date);
},
error: function (e) {
console.err('上传错误', e)
},
});
}
// 文件读取完成后的回调函数
function afterRead(file, localIds, date) {
// console.log(localIds);
let params = new FormData()
// params.append("time", `${new Date(this.nowTimestamp).getHours()}:${new Date(this.nowTimestamp).getMinutes()}`);
// params.append("date", this.getAPPDate(new Date(this.nowTimestamp)));
let time = date.toLocaleDateString('zh-CN', dateConfigTime)
time = time.slice(time.length - 8)
params.append("time", time);
params.append("date", date.toLocaleDateString('zh-CN', dateConfig).split('/').join('-'));
params.append("address", address.value);
params.append("file", file);
api.ImageUpLoad(params).then(res => {
// console.log('照片上传后端后', res)
if (res.code == 1) {
signAcStShow.value = true
signImgUrl.value = res.response.file_path
closeToast()
}
})
}
// 签到按钮
function signBt(obj) {
if (obj.sign != 2) {
let data = {
id: obj.signid,
link: signImgUrl.value,
sign: obj.sign == 0 ? 1 : 2,
attendance: signPosObj.value,
}
showToast({
message: "加载中...",
duration: 0,
forbidClick: true,
loadingType: "spinner",
type: "loading",
});
api.AttendanceSubmit(data).then(res => {
// console.log(res)
if (res.code == 1) {
closeToast()
showSuccessToast(res.response)
signAcStShow.value = false
// 重新获取列表
onLoad()
} else {
closeToast()
showFailToast(res.msg_detail)
}
})
}
}
// 测试用,修改签到时间限制
// function changeSignTimeTest(obj) {
// if (obj.sign == 0) {
// obj.sign_in_time = new Date().toLocaleDateString('zh-CN', dateConfig).split('/').join('-')
// } else if (obj.sign == 1) {
// obj.sign_out_time = new Date().toLocaleDateString('zh-CN', dateConfig).split('/').join('-')
// }
// }
// 领导查看日志
function leadLog(obj) {
showToast({
message: "加载中...",
duration: 0,
forbidClick: true,
loadingType: "spinner",
type: "loading",
});
logAcStShow.value = true
api.LeadLogInit(obj.signid).then(res => {
// console.log(res)
if (res.code == 1) {
allLog.value = res.response
closeToast()
} else {
closeToast()
showFailToast(res.msg_detail)
}
})
}
// 复制教师日志
function copyLog() {
// 创建input元素
const el = document.createElement('input')
// 给input元素赋值需要复制的文本
el.setAttribute('value', allLog.value)
// 将input元素插入页面
document.body.appendChild(el)
// 选中input元素的文本
el.select()
// 复制内容到剪贴板
document.execCommand('copy')
// 删除input元素
document.body.removeChild(el)
showSuccessToast('复制成功')
}
onMounted(() => {
addDutySearchSelectList()
signList.authUserInfo = Cookies.get('user-info').split('"').indexOf('值班领导') === -1 ? -1 : 1
api.GetAttendanceList().then(res => {
// console.log('获取考勤列表', res.response)
attendanceList.value = res.response
// 微信初始化
initWxPosition()
})
// 获取当前用户信息
userInfo.value = JSON.parse(Cookies.get('userInfo'))
// console.log('获取当前用户信息', userInfo.value)
})
onUnmounted(() => {
clearInterval(timer.value)
})
</script>
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
<van-pull-refresh v-model="dateArray.loading" @refresh="onRefresh"> <van-pull-refresh v-model="dateArray.loading" @refresh="onRefresh">
<div class="container"> <div class="container">
<van-calendar <van-calendar
type="single" type="single"
:show-subtitle="false" :show-subtitle="false"
:poppable="false" :poppable="false"
...@@ -329,7 +330,7 @@ onMounted(() => { ...@@ -329,7 +330,7 @@ onMounted(() => {
border-radius: 10%; border-radius: 10%;
color: #fff; color: #fff;
} }
.right { .right {
} }
......
...@@ -27,23 +27,10 @@ const routes = [ ...@@ -27,23 +27,10 @@ const routes = [
component: () => import('../pages/welcome/index.vue'), component: () => import('../pages/welcome/index.vue'),
meta: {isAuth: true}, meta: {isAuth: true},
}, },
{
name: 'signList',
path: '/signList',
component: () => import('../pages/signList/index.vue'),
meta: {isAuth: true, admin: true}
},
{
name: 'myDuty',
path: '/myDuty',
component: () => import('../pages/myDuty/index.vue'),
meta: {isAuth: true}
},
{ {
name: 'messageDetails', name: 'messageDetails',
path: '/messageDetails', path: '/messageDetails',
component: () => import('../pages/messageDetails/index.vue'), component: () => import('../pages/messageDetails/index.vue'),
} }
] ]
......
.container{ @tailwind base;
@tailwind components;
@tailwind utilities;
.container {
box-sizing: border-box; box-sizing: border-box;
background-color: #e8e5e5; background-color: #e8e5e5;
width: 100%; width: 100%;
...@@ -11,6 +15,7 @@ ...@@ -11,6 +15,7 @@
justify-content: center; justify-content: center;
align-content: flex-start; align-content: flex-start;
} }
/*:root {*/ /*:root {*/
/* font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;*/ /* font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;*/
/* line-height: 1.5;*/ /* line-height: 1.5;*/
......
...@@ -9,7 +9,7 @@ import * as api from '../api/index.js' ...@@ -9,7 +9,7 @@ import * as api from '../api/index.js'
const axiosInstance = axios.create({ const axiosInstance = axios.create({
// baseURL: 'https://asc.hnasct.cn/DutyManagement', // baseURL: 'https://asc.hnasct.cn/DutyManagement',
baseURL: '/DutyManagement', // 默认地址代理转换为··域名·· 请求地址为 域名 + baseURL + 动态传入URL baseURL: '/placemanage', // 默认地址代理转换为··域名·· 请求地址为 域名 + baseURL + 动态传入URL
timeout: 10000, // 设置请求超时时间,单位为毫秒 timeout: 10000, // 设置请求超时时间,单位为毫秒
headers: { headers: {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
......
/** @type {import('tailwindcss').Config} */
export default {
content: [
"./index.html",
"./src/**/*.{js,ts,jsx,tsx}",
],
theme: {
extend: {},
},
plugins: [],
}
...@@ -23,7 +23,7 @@ export default defineConfig({ ...@@ -23,7 +23,7 @@ export default defineConfig({
proxy: { proxy: {
// 这里的ccc可乱写, 是拼接在url后面的地址 如果接口中没有统一的后缀可自定义 // 这里的ccc可乱写, 是拼接在url后面的地址 如果接口中没有统一的后缀可自定义
// 如果有统一后缀, 如api, 直接写api即可, 也不用rewrite了 // 如果有统一后缀, 如api, 直接写api即可, 也不用rewrite了
"/DutyManagement": { "/placemanage": {
target: "https://asc.hnasct.cn/", // 真实接口地址, 后端给的基地址 target: "https://asc.hnasct.cn/", // 真实接口地址, 后端给的基地址
changeOrigin: true, // 允许跨域 changeOrigin: true, // 允许跨域
// rewrite: (path) => path.replace(/^\/DutyManagement/, ""), // 将ccc替换为空 // rewrite: (path) => path.replace(/^\/DutyManagement/, ""), // 将ccc替换为空
......
Markdown 格式
0% or
您添加了 0 人 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册 或