index.20b675ae.js 15 KB

1
  1. import{d as C,r as f,bK as v,$ as A,c as u,q as e,aw as T,B as D,m as g,o as l,R as N,aj as R}from"./index.5f7ffb46.js";import{O as b}from"./index.7790de2a.js";import{v as w}from"./toolsValidate.4388d7ee.js";import{C as E}from"./index.052b3caa.js";import{C as i}from"./index.abd668f7.js";import{F as p}from"./index.6438a25f.js";import{r as F,b as V,c as x,a as h,d as P}from"./date.176df113.js";import{T as k,a as y}from"./index.6bbd7daa.js";import"./use-tab-status.69b57a37.js";import"./index.99e0cf1f.js";import"./index.61ab9823.js";const G="_attendanceRules_176h5_1",M="_ruleContainer_176h5_6",S="_informationBottom_176h5_10",U="_ruleTitle_176h5_28",I="_smallRuleTitle_176h5_34",L="_ruleContent_176h5_37",q="_ruleMore_176h5_41",O="_red_176h5_44",H="_field_176h5_47",j="_unit_176h5_55",K="_active_176h5_85",W="_ruleRange_176h5_104",$="_ruleTips_176h5_109",z="_ruleDesc_176h5_122",J="_ruleExtra_176h5_131",Q="_popover_176h5_135",X="_flexDev_176h5_138";var t={attendanceRules:G,ruleContainer:M,informationBottom:S,ruleTitle:U,smallRuleTitle:I,ruleContent:L,ruleMore:q,red:O,field:H,unit:j,active:K,"field-m":"_field-m_176h5_89","field-w80":"_field-w80_176h5_92","field-w136":"_field-w136_176h5_95","field-w102":"_field-w102_176h5_98","field-w126":"_field-w126_176h5_101",ruleRange:W,ruleTips:$,ruleDesc:z,ruleExtra:J,popover:Q,flexDev:X},Y=C({name:"range-model",setup(){f({show1:!1,show2:!1});const s=v({}),n=f({}),m=async()=>{try{const{data:a}=await g.get("/api-school/schoolParamConfig/queryByParamNameList",{params:{paramNames:"scope_of_attendance,sign_in_attendance,sign_in_attendance_type,sign_out_attendance,sign_out_attendance_type"}});console.log(a,"data"),(a||[]).forEach(o=>{n[o.paramName]=o.paramValue}),s.value={...n}}catch{}},c=(a,_)=>{const o=[];for(const r in a)a[r]!=_[r]&&o.push({paramName:r,paramValue:_[r]});return o||[]},B=async()=>{if(!n.scope_of_attendance){l("\u8BF7\u8F93\u5165\u8003\u52E4\u5B9A\u4F4D\u8303\u56F4");return}if(!n.sign_in_attendance){l("\u8BF7\u8F93\u5165\u7B7E\u5230\u6263\u51CF\u91D1\u989D");return}if(n.sign_in_attendance>100&&n.sign_in_attendance_type==="PERCENTAGE"){l("\u7B7E\u5230\u6263\u51CF\u91D1\u989D\u8F93\u5165\u6709\u8BEF");return}if(!n.sign_out_attendance){l("\u8BF7\u8F93\u5165\u7B7E\u9000\u6263\u51CF\u91D1\u989D");return}if(n.sign_out_attendance>100&&n.sign_out_attendance_type==="PERCENTAGE"){l("\u7B7E\u9000\u6263\u51CF\u91D1\u989D\u8F93\u5165\u6709\u8BEF");return}try{const a=c(s.value,n);a.length>0&&await g.post("/api-school/schoolParamConfig/update",{hideLoading:!1,data:{configs:[...a],group:"ATTENDANCE"}}),setTimeout(()=>{l("\u4FDD\u5B58\u6210\u529F")},200)}catch{}};A(()=>{m()});const d=a=>a&&a>=0?w(a):"";return()=>u("div",{class:t.ruleContainer},[u(E,{inset:!0},{default:()=>[u(i,null,{title:()=>u("div",{class:t.ruleTitle},[e("\u8003\u52E4\u5B9A\u4F4D\u8303\u56F4")])}),u(i,null,{title:()=>u("div",{class:t.ruleContent,style:{display:"flex",alignItems:"center"}},[e("\u7B7E\u5230\u3001\u7B7E\u9000\u5730\u70B9\u987B\u5728\u5B66\u6821\u5B9A\u4F4D\u70B9"),u(p,{class:[t.field,t["field-m"],t["field-w80"]],autocomplete:"off",formatter:d,type:"number",modelValue:n.scope_of_attendance,"onUpdate:modelValue":a=>n.scope_of_attendance=a},{extra:()=>u("span",{class:t.ruleExtra},[e("\u7C73")])}),e("\u4EE5\u5185")])})]}),u(T,{to:"#app"},{default:()=>[u(b,{position:"bottom"},{default:()=>[u("div",{class:"btnGroup"},[u(D,{type:"primary",round:!0,block:!0,onClick:B},{default:()=>[e("\u4FDD\u5B58\u8BBE\u7F6E")]})])]})]})])}}),Z=C({name:"sigin-in-rule",setup(){f({show1:!1,show2:!1,show3:!1,show4:!1});const s=v({}),n=f({}),m=async()=>{try{const{data:a}=await g.get("/api-school/schoolParamConfig/queryByParamNameList",{params:{paramNames:"normal_sign_in_start,normal_sign_in_end,abnormal_sign_in,abnormal_sign_in_fee,abnormal_sign_in_fee_type,late_sign_in,late_sign_in_fee,late_sign_in_fee_type,absence_sign_in,absence_sign_in_fee,absence_sign_in_fee_type,not_sign_in_fee,not_sign_in_fee_type"}});console.log(a,"data"),(a||[]).forEach(o=>{n[o.paramName]=o.paramValue}),s.value={...n}}catch{}},c=(a,_)=>{const o=[];for(const r in a)a[r]!=_[r]&&o.push({paramName:r,paramValue:_[r]});return o||[]},B=async()=>{if(!n.normal_sign_in_start){l("\u8BF7\u8F93\u5165\u7B7E\u5230\u65F6\u95F4\u8303\u56F4");return}if(!n.normal_sign_in_end){l("\u8BF7\u8F93\u5165\u6B63\u5E38\u7B7E\u5230\u65F6\u95F4");return}if(console.log(n.normal_sign_in_end,n.normal_sign_in_start),n.normal_sign_in_end-n.normal_sign_in_start>0){console.log(!0),l("\u6B63\u5E38\u7B7E\u5230\u65F6\u95F4\u4E0D\u80FD\u5927\u4E8E\u7B7E\u5230\u65F6\u95F4\u8303\u56F4");return}if(!n.abnormal_sign_in_fee){l("\u8BF7\u8F93\u5165\u5F02\u5E38\u7B7E\u5230\u6263\u51CF\u91D1\u989D");return}if(n.abnormal_sign_in_fee>100&&n.abnormal_sign_in_fee_type==="PERCENTAGE"){l("\u5F02\u5E38\u7B7E\u5230\u6263\u51CF\u91D1\u989D\u8F93\u5165\u6709\u8BEF");return}if(!n.late_sign_in){l("\u8BF7\u8F93\u5165\u8FDF\u5230\u65F6\u95F4");return}if(!n.late_sign_in_fee){l("\u8BF7\u8F93\u5165\u8FDF\u5230\u6263\u51CF\u91D1\u989D");return}if(n.late_sign_in_fee>100&&n.late_sign_in_fee_type==="PERCENTAGE"){l("\u8FDF\u5230\u6263\u51CF\u91D1\u989D\u8F93\u5165\u6709\u8BEF");return}if(!n.absence_sign_in_fee){l("\u8BF7\u8F93\u5165\u65F7\u8BFE\u6263\u51CF\u91D1\u989D");return}if(n.absence_sign_in_fee>100&&n.absence_sign_in_fee_type==="PERCENTAGE"){l("\u65F7\u8BFE\u6263\u51CF\u91D1\u989D\u8F93\u5165\u6709\u8BEF");return}if(!n.not_sign_in_fee){l("\u8BF7\u8F93\u5165\u672A\u7B7E\u5230\u6263\u51CF\u91D1\u989D");return}if(n.not_sign_in_fee>100&&n.not_sign_in_fee_type==="PERCENTAGE"){l("\u672A\u7B7E\u5230\u6263\u51CF\u91D1\u989D\u8F93\u5165\u6709\u8BEF");return}try{const a=c(s.value,n);a.length>0&&(await g.post("/api-school/schoolParamConfig/update",{hideLoading:!1,data:{configs:[...a],group:"ATTENDANCE"}}),s.value={...n}),setTimeout(()=>{l("\u4FDD\u5B58\u6210\u529F")},200)}catch{}};A(()=>{m()});const d=a=>a&&a>=0?w(a):"";return()=>u("div",{class:t.ruleContainer},[u(E,{inset:!0},{default:()=>[u(i,null,{title:()=>u("div",{class:t.ruleTitle},[e("\u7B7E\u5230\u65F6\u95F4\u8303\u56F4")])}),u(i,null,{title:()=>u("div",{class:t.ruleContent},[u("div",{class:t.ruleRange},[e("\u8BFE\u7A0B\u5F00\u59CB\u524D\u591A\u5C11\u5206\u949F\u53EF\u4EE5\u7B7E\u5230\uFF1A"),u(p,{class:[t.field,t["field-w102"]],autocomplete:"off",formatter:d,type:"number",modelValue:n.normal_sign_in_start,"onUpdate:modelValue":a=>n.normal_sign_in_start=a},{extra:()=>u("span",{class:t.ruleExtra},[e("\u5206\u949F")])})]),u("div",{class:t.ruleTips},[e("\u4EE5"),u("span",null,[e("12:00:00")]),e("\u5F00\u59CB\u7684\u8BFE\u7A0B\u4E3A\u4F8B,\u6700\u65E9"),u("span",null,[F("12:00:00",n.normal_sign_in_start)]),e("\u53EF\u4EE5\u8FDB\u884C\u7B7E\u5230")])])})]}),u(E,{inset:!0},{default:()=>[u(i,null,{title:()=>u("div",{class:t.ruleTitle},[e("\u6B63\u5E38\u7B7E\u5230")])}),u(i,null,{title:()=>u("div",{class:t.ruleContent},[u("div",{class:t.ruleRange},[e("\u7B7E\u5230\u65F6\u95F4\u65E9\u4E8E\u8BFE\u7A0B\u5F00\u59CB\u65F6\u95F4\uFF1A"),u(p,{class:[t.field,t["field-w102"]],autocomplete:"off",formatter:d,type:"number",modelValue:n.normal_sign_in_end,"onUpdate:modelValue":[a=>n.normal_sign_in_end=a,a=>{console.log(a,"value"),n.abnormal_sign_in=a}]},{extra:()=>u("span",{class:t.ruleExtra},[e("\u5206\u949F")])})]),u("div",{class:t.ruleTips},[e("\u4EE5"),u("span",null,[e("12:00:00")]),e("\u5F00\u59CB\u7684\u8BFE\u7A0B\u4E3A\u4F8B,\u5728"),u("span",{style:"display: inline-block;"},[F("12:00:00",n.normal_sign_in_start),e("~"),F("12:00:00",n.normal_sign_in_end)]),e("\u65F6\u95F4\u8303\u56F4\u5185\u7B7E\u5230\u5C5E\u4E8E"),u("span",null,[e("\u6B63\u5E38\u7B7E\u5230")])])])})]}),u(E,{inset:!0},{default:()=>[u(i,null,{title:()=>u("div",{class:[t.ruleTitle]},[e("\u5F02\u5E38\u7B7E\u5230")])}),u(i,null,{title:()=>u("div",{class:[t.ruleContent,t.ruleMore]},[u("div",{class:t.ruleDesc},[e("\u7B7E\u5230\u65F6\u95F4\u665A\u4E8E\u8BFE\u7A0B\u5F00\u59CB\u65F6\u95F4"),u("span",null,[e("\u524D"),n.normal_sign_in_end||0,e("\u5206\u949F")])," ",u("br",null,null),e("\u65E9\u4E8E\u8BFE\u7A0B\u5F00\u59CB\u65F6\u95F4\u65F6\uFF0C\u6263\u51CF\u5F53\u65E5\u8BAD\u7EC3\u8865\u52A9")]),u("div",{class:t.ruleTips},[e("\u4EE5"),u("span",null,[e("12:00:00")]),e("\u5F00\u59CB\u7684\u8BFE\u7A0B\u4E3A\u4F8B,\u5728"),u("span",{style:"display: inline-block;"},[V("12:00:00",n.normal_sign_in_end),e("~12:00:00")]),e("\u65F6\u95F4\u8303\u56F4\u5185\u7B7E\u5230\u5C5E\u4E8E"),u("span",null,[e("\u5F02\u5E38\u7B7E\u5230")])])])})]}),u(E,{inset:!0},{default:()=>[u(i,null,{title:()=>u("div",{class:[t.ruleTitle]},[e("\u8FDF\u5230")])}),u(i,null,{title:()=>u("div",{class:[t.ruleContent,t.ruleMore]},[u("div",{class:t.ruleRange},[e("\u7B7E\u5230\u65F6\u95F4\u665A\u4E8E\u8BFE\u7A0B\u5F00\u59CB\u65F6\u95F4\uFF1A"),u(p,{class:[t.field,t["field-w102"]],autocomplete:"off",formatter:d,type:"number",modelValue:n.late_sign_in,"onUpdate:modelValue":[a=>n.late_sign_in=a,a=>{n.absence_sign_in=a}]},{extra:()=>u("span",{class:t.ruleExtra},[e("\u5206\u949F")])})]),u("div",{class:t.ruleTips},[e("\u4EE5"),u("span",null,[e("12:00:00")]),e("\u5F00\u59CB\u7684\u8BFE\u7A0B\u4E3A\u4F8B,\u5728"),u("span",{style:"display: inline-block;"},[x("12:00:00",0),e(" ~")," ",h("12:00:00",n.late_sign_in)]),e("\u65F6\u95F4\u8303\u56F4\u5185\u7B7E\u5230\u5C5E\u4E8E"),u("span",null,[e("\u8FDF\u5230")])])])})]}),u(E,{inset:!0},{default:()=>[u(i,null,{title:()=>u("div",{class:[t.ruleTitle]},[e("\u65F7\u8BFE")])}),u(i,null,{title:()=>u("div",{class:[t.ruleContent,t.ruleMore]},[u("div",{class:t.ruleDesc},[e("\u7B7E\u5230\u65F6\u95F4\u665A\u4E8E\u8BFE\u7A0B\u5F00\u59CB\u65F6\u95F4"),u("span",null,[n.late_sign_in||0,e("\u5206\u949F")]),e(" "),u("br",null,null),e("\u6263\u51CF\u5F53\u65E5\u8BAD\u7EC3\u8865\u52A9")]),u("div",{class:t.ruleTips},[e("\u4EE5"),u("span",null,[e("12:00:00")]),e("\u5F00\u59CB\u7684\u8BFE\u7A0B\u4E3A\u4F8B,\u5728"),u("span",null,[h("12:00:00",n.late_sign_in)]),e("\u540E\u7B7E\u5230(\u542B"),h("12:00:00",n.late_sign_in),e(") \u5C5E\u4E8E"),u("span",null,[e("\u65F7\u8BFE")])])])})]}),u(T,{to:"#app"},{default:()=>[u(b,{position:"bottom"},{default:()=>[u("div",{class:"btnGroup"},[u(D,{type:"primary",round:!0,block:!0,onClick:B},{default:()=>[e("\u4FDD\u5B58\u8BBE\u7F6E")]})])]})]})])}}),uu=C({name:"sigin-out-rule",setup(){f({show1:!1,show2:!1,show3:!1});const s=v({}),n=f({}),m=async()=>{try{const{data:a}=await g.get("/api-school/schoolParamConfig/queryByParamNameList",{params:{paramNames:"normal_sign_out,abnormal_sign_out,abnormal_sign_out_fee,abnormal_sign_out_fee_type,premise_sign_out,premise_sign_out_fee,premise_sign_out_fee_type,not_sign_out_fee,not_sign_out_fee_type"}});console.log(a,"data"),(a||[]).forEach(o=>{n[o.paramName]=o.paramValue}),s.value={...n}}catch{}},c=(a,_)=>{const o=[];for(const r in a)a[r]!=_[r]&&o.push({paramName:r,paramValue:_[r]});return o||[]},B=async()=>{if(!n.normal_sign_out){l("\u8BF7\u8F93\u5165\u6B63\u5E38\u7B7E\u9000\u65F6\u95F4");return}if(!n.abnormal_sign_out){l("\u8BF7\u8F93\u5165\u5F02\u5E38\u7B7E\u9000\u65F6\u95F4");return}if(!n.abnormal_sign_out_fee){l("\u8BF7\u8F93\u5165\u5F02\u5E38\u7B7E\u9000\u6263\u51CF\u91D1\u989D");return}if(n.abnormal_sign_out_fee>100&&n.abnormal_sign_out_fee_type==="PERCENTAGE"){l("\u5F02\u5E38\u7B7E\u9000\u6263\u51CF\u91D1\u989D\u8F93\u5165\u6709\u8BEF");return}if(!n.premise_sign_out_fee){l("\u8BF7\u8F93\u5165\u65E9\u9000\u6263\u51CF\u91D1\u989D");return}if(n.premise_sign_out_fee>100&&n.premise_sign_out_fee_type==="PERCENTAGE"){l("\u65E9\u9000\u6263\u51CF\u91D1\u989D\u8F93\u5165\u6709\u8BEF");return}if(!n.not_sign_out_fee){l("\u8BF7\u8F93\u5165\u672A\u7B7E\u9000\u6263\u51CF\u91D1\u989D");return}if(n.not_sign_out_fee>100&&n.not_sign_out_fee_type==="PERCENTAGE"){l("\u672A\u7B7E\u9000\u6263\u51CF\u91D1\u989D\u8F93\u5165\u6709\u8BEF");return}try{const a=c(s.value,n);a.length>0&&(await g.post("/api-school/schoolParamConfig/update",{hideLoading:!1,data:{configs:[...a],group:"ATTENDANCE"}}),s.value={...n}),setTimeout(()=>{l("\u4FDD\u5B58\u6210\u529F")},200)}catch{}};A(()=>{m()});const d=a=>a&&a>=0?w(a):"";return()=>u("div",{class:t.ruleContainer},[u(E,{inset:!0},{default:()=>[u(i,null,{title:()=>u("div",{class:t.ruleTitle},[e("\u6B63\u5E38\u7B7E\u9000")])}),u(i,null,{title:()=>u("div",{class:t.ruleContent},[u("div",{class:t.ruleRange},[e("\u7B7E\u9000\u65F6\u95F4\u4E0D\u5F97\u665A\u4E8E\u8BFE\u7A0B\u7ED3\u675F\u540E\uFF1A"),u(p,{class:[t.field,t["field-w102"]],autocomplete:"off",formatter:d,type:"number",modelValue:n.normal_sign_out,"onUpdate:modelValue":a=>n.normal_sign_out=a},{extra:()=>u("span",{class:t.ruleExtra},[e("\u5206\u949F")])})]),u("div",{class:t.ruleTips},[e("\u4EE5"),u("span",null,[e("12:00:00")]),e("\u7ED3\u675F\u7684\u8BFE\u7A0B\u4E3A\u4F8B, \u5728"),u("span",{style:"display: inline-block;"},[e("12:00:00\uFF5E"),h("12:00:00",n.normal_sign_out)]),e("\u65F6\u95F4\u8303\u56F4\u5185\u7B7E\u9000\u5C5E\u4E8E"),u("span",null,[e("\u6B63\u5E38\u7B7E\u9000")])])])})]}),u(E,{inset:!0},{default:()=>[u(i,null,{title:()=>u("div",{class:t.ruleTitle},[e("\u5F02\u5E38\u7B7E\u9000")])}),u(i,null,{title:()=>u("div",{class:t.ruleContent},[u("div",{class:t.ruleRange},[e("\u7B7E\u9000\u65F6\u95F4\u65E9\u4E8E\u8BFE\u7A0B\u7ED3\u675F\u65F6\u95F4\uFF1A"),u(p,{class:[t.field,t["field-w126"]],autocomplete:"off",formatter:d,type:"number",modelValue:n.abnormal_sign_out,"onUpdate:modelValue":[a=>n.abnormal_sign_out=a,a=>{n.premise_sign_out=a}]},{extra:()=>u("span",{class:t.ruleExtra},[e("\u5206\u949F\u4EE5\u5185")])})]),u("div",{class:t.ruleTips},[e("\u4EE5"),u("span",null,[e("12:00:00")]),e("\u7ED3\u675F\u7684\u8BFE\u7A0B\u4E3A\u4F8B, \u5728"),u("span",{style:"display: inline-block;"},[F("12:00:00",n.abnormal_sign_out),e("~"),P("12:00:00",0)]),e("\u65F6\u95F4\u8303\u56F4\u5185\u7B7E\u9000\u5C5E\u4E8E"),u("span",null,[e("\u5F02\u5E38\u7B7E\u9000")])])])})]}),u(E,{inset:!0},{default:()=>[u(i,null,{title:()=>u("div",{class:[t.ruleTitle]},[e("\u65E9\u9000")])}),u(i,null,{title:()=>u("div",{class:[t.ruleContent,t.ruleMore]},[u("div",{class:t.ruleDesc},[e("\u7B7E\u9000\u65F6\u95F4\u65E9\u4E8E\u8BFE\u7A0B\u7ED3\u675F\u65F6\u95F4"),u("span",null,[n.abnormal_sign_out||0,e("\u5206\u949F")]),e("\u4EE5\u4E0A")," ",u("br",null,null),e("\u6263\u51CF\u5F53\u65E5\u8BAD\u7EC3\u8865\u52A9")]),u("div",{class:t.ruleTips},[e("\u4EE5"),u("span",null,[e("12:00:00")]),e("\u7ED3\u675F\u7684\u8BFE\u7A0B\u4E3A\u4F8B,\u5728"),u("span",null,[F("12:00:00",n.abnormal_sign_out)]),e("\u524D\u7B7E\u9000 (\u542B"),F("12:00:00",n.abnormal_sign_out),e(") \u5C5E\u4E8E"),u("span",null,[e("\u65E9\u9000")])])])})]}),u(T,{to:"#app"},{default:()=>[u(b,{position:"bottom"},{default:()=>[u("div",{class:"btnGroup"},[u(D,{type:"primary",round:!0,block:!0,onClick:B},{default:()=>[e("\u4FDD\u5B58\u8BBE\u7F6E")]})])]})]})])}}),Eu=C({name:"attendance-rules",setup(){const s=f({tabValue:"range",heightV:0}),n=N(),m=c=>{s.heightV=c,console.log(s.heightV,"\u83B7\u53D6\u9AD8\u5EA6"),document.documentElement.style.setProperty("--header-height",c+"px")};return()=>u("div",{class:t.attendanceRules},[u(b,{position:"top",background:"#F8F8F8",onGetHeight:m,ref:n},{default:()=>[u(R,{border:!1},null)]}),u(k,{sticky:!0,lineWidth:20,lineHeight:4,offsetTop:s.heightV,swipeable:!0,animated:!0,active:s.tabValue,"onUpdate:active":c=>s.tabValue=c},{default:()=>[u(y,{title:"\u8003\u52E4\u8303\u56F4",name:"range"},{default:()=>[s.tabValue==="range"&&u(Y,null,null)]}),u(y,{title:"\u7B7E\u5230\u89C4\u5219",name:"signin-rule"},{default:()=>[s.tabValue==="signin-rule"&&u(Z,null,null)]}),u(y,{title:"\u7B7E\u9000\u89C4\u5219",name:"signout-rule"},{default:()=>[s.tabValue==="signout-rule"&&u(uu,null,null)]})]})])}});export{Eu as default};