PageSourceSearch

https://mdm.edu.tw/assets/MDMWindowsClassManage.111eb76c.js

js mdm.edu.tw collected 2026-10-01 23:55:52 UTC 8,981 bytes, 1 lines download raw bytes

1import{u as se,f as te,e as b,r as a,j as r,a as e,F as h,R as oe,b as E,d as F,a8 as re}from"./index.7613290f.js";import{t as S}from"./[email protected]";import{u as ue}from"./[email protected]";import{c as ne}from"./[email protected]";import{c as ae}from"./[email protected]";import{a as W}from"./[email protected]";import{o as ie}from"./[email protected]";import{B as R}from"./ButtonBox.f5ca8933.js";import{B as C}from"./Button.5e3edbef.js";import{G as B}from"./GridTable.414f8d3e.js";import{A as f}from"./Alert.40f5355b.js";import{M as g}from"./Modal.43fb08e1.js";import{F as c}from"./Form.00ebacfa.js";import{B as le}from"./Button.cf4fad43.js";import"./appInsights.79eb1af4.js";import"./ButtonBox.module.888fa962.js";import"./Button.module.5bbc35fb.js";import"./GridTable.module.cf1e4838.js";import"./hook.20acd621.js";import"./TransitionWrapper.b92fa3dc.js";import"./CloseButton.35ab5273.js";const Me=()=>{se();const L=te(),w=sessionStorage.getItem("token"),i=b(s=>s.menu.menu),O=b(s=>s.groupDeviceNumber),[U,ce]=a.exports.useState(!1),[m,G]=a.exports.useState([]),[$,pe]=a.exports.useState(!1),[v,de]=a.exports.useState(!1),[z,p]=a.exports.useState(!1),[I,me]=a.exports.useState(!1),[N,y]=a.exports.useState([]),[H,M]=a.exports.useState(""),[P,_]=a.exports.useState(!1),[d,D]=a.exports.useState([{className:"",classDescription:""}]),x=b(s=>s.deviceSize),[l,T]=a.exports.useState({Group_ID:"",Group_Name:"",Group_Description:""}),X=(s,t)=>{const o=[...d];o[t].className=s.target.value,D(o)},q=(s,t)=>{const o=[...d];o[t].classDescription=s.target.value,D(o)},J=()=>{if(!i.schoolOption){alert("\u8ACB\u5148\u9078\u64C7\u5B78\u6821");return}D([...d,{className:"",classDescription:""}])},K=s=>{const t=[...d];t.splice(s,1),D(t)},Q=(s,t)=>{y(t?[...N,s]:N.filter(o=>o.Group_ID!==s.Group_ID))},V=async()=>{if(!i.schoolOption){alert("\u8ACB\u5148\u9078\u64C7\u5B78\u6821");return}let s=[];for(let t of N){const o=O.find(n=>n.unit===t.Group_Name);if(o){let n=`<strong>\u73ED\u7D1A ${t.Group_Name} \u7121\u6CD5\u79FB\u9664\uFF0C\u5C1A\u6709\u8F09\u5177: </strong>`,u=[];o.Windows>0&&u.push(`Windows: ${o.Windows}`),o.iOS>0&&u.push(`iOS: ${o.iOS}`),o.Android>0&&u.push(`Android: ${o.Android}`),o.ChromeOS>0&&u.push(`ChromeOS: ${o.ChromeOS}`),n+=`<br>${u.join(", ")}`,s.push(n)}else await j(t.Group_ID,t.Group_Name,t.Group_Description)}s.length>0?(M(s.join("<br><br>")),p(!0),setTimeout(()=>{p(!1)},6e3)):p(!1),A(),y([])},A=async()=>{if(!i.schoolOption){alert("\u8ACB\u5148\u9078\u64C7\u5B78\u6821");return}let s=i.schoolOption;try{const o=(await E.get(`${F}/api/Group/${s}/Class`,{headers:{"Content-Type":"application/json;charset=UTF-8","Access-Control-Allow-Origin":"*",Authorization:`Bearer ${w}`}})).data;G(o),L(re(o)),console.log(o)}catch(t){console.log("group_device_number_error",t)}},Y=(s,t,o)=>{T({Group_ID:s,Group_Name:t,Group_Description:o}),_(!0)},k=(s,t)=>{T({...l,[t]:s.target.value})},Z=async s=>{s.preventDefault();const t=m.findIndex(u=>u.Group_ID===l.Group_ID),o=[...m];o[t]=l;let n=i.schoolOption;try{const u=await E.post(`${F}/api/Group/${n}/Class/Update`,{Group_ID:l.Group_ID,Group_Name:l.Group_Name,Group_Description:l.Group_Description},{headers:{"Content-Type":"application/json;charset=UTF-8","Access-Control-Allow-Origin":"*",Authorization:`Bearer ${w}`}});console.log(u.data),G(o),console.log(m),_(!1)}catch(u){console.log("\u65B0\u589E\u6216\u66F4\u65B0\u73ED\u7D1A",u)}A()},j=async(s,t,o)=>{if(!i.schoolOption){alert("\u8ACB\u5148\u9078\u64C7\u5B78\u6821");return}let n=i.schoolOption;await E({method:"post",url:`${F}/api/Group/${n}/Class/Delete`,data:{Group_ID:s,Group_Name:t,Group_Description:o},credentials:"same-origin",headers:{"Content-Type":"application/json;charset=UTF-8","Access-Control-Allow-Origin":"*",Authorization:`Bearer ${w}`}}).then(u=>{console.log(u),G(m.filter(ee=>ee.Group_ID!==s))}).catch(u=>{console.log("\u522A\u9664\u73ED\u7D1A",u)}),A()};return a.exports.useEffect(()=>{i.schoolOption&&A()},[i.schoolOption]),r("div",{className:"MDMWindowsClassManage",children:[e("div",{className:"page-title",children:"\u55AE\u4F4D\u7BA1\u7406"}),r("div",{className:"w-full flex justify-between flex-wrap",children:[r("div",{className:`${x>1280?"w-47":"w-full"}`,children:[r("div",{className:"title title_mobile",children:[i.schoolNameOption,"\u73ED\u7D1A\u7BA1\u7406"]}),r("div",{className:"w-full border-1 boreder-moe-grey ht-15 flex flex-col justify-between",children:[e(B,{itemProperty:["","\u73ED\u7D1A\u540D\u7A31","\u8AAA\u660E",""],propertyStyle:{borderTop:"none"},items:m,render:s=>r(h,{children:[e("span",{children:e("input",{className:"checkbox",type:"checkbox",name:"code",value:"",style:{width:"20px",height:"20px"},onChange:t=>Q(s,t.target.checked)})}),e("span",{children:s.Group_Name})," ",e("span",{children:s.Group_Description}),r("span",{children:[e("img",{src:ne,className:"writeIcon"})," \xA0",e("img",{className:"writeIcon",src:ae,onClick:()=>Y(s.Group_ID,s.Group_Name,s.Group_Description)}),e("img",{className:"trashIcon",src:S,onClick:()=>{const t=O.find(o=>o.unit===s.Group_Name);if(t){let o=`<strong> \u73ED\u7D1A${s.Group_Name}
1\u7121\u6CD5\u79FB\u9664\uFF0C\u5C1A\u6709\u8F09\u5177</strong><br>`,n=[];t.Windows>0&&n.push(`Windows: ${t.Windows}`),t.iOS>0&&n.push(`iOS: ${t.iOS}`),t.Android>0&&n.push(`Android: ${t.Android}`),t.Chromeos>0&&n.push(`ChromeOS: ${t.Chromeos}`),o+=`<br>${n.join(", ")}`,M(o),p(!0),setTimeout(()=>{p(!1)},6e3)}else p(!1),j(s.Group_ID,s.Group_Name,s.Group_Description)}})]})]}),renderNull:()=>e(h,{children:e("span",{className:"col-span-4",children:"\u7121\u8CC7\u6599"})}),style:{gridTemplateColumns:"10% 25% 40% 25%",maxHeight:"300px"}}),z&&e(f,{variant:"danger",children:e("div",{dangerouslySetInnerHTML:{__html:H}})}),r(R,{className:"gap-5 mb-10",children:[r(C,{type:"submit",onClick:V,children:[e("img",{src:S}),"\u591A\u9078\u522A\u9664"]}),r(C,{type:"submit",children:[e("img",{src:ue}),"\u6A39\u72C0\u5716\u532F\u51FA"]})]})]})]}),r("div",{className:`${x>1280?"w-47":"w-full"}`,children:[e("div",{className:"title title_mobile",children:"\u65B0\u589E\u55AE\u4F4D"}),r("div",{className:"w-full border-1 boreder-moe-grey ht-15 flex flex-col justify-between",children:[e(B,{style:{gridTemplateColumns:"35% 50% 15%",maxHeight:"300px"},propertyStyle:{borderTop:"none"},itemProperty:["\u73ED\u7D1A\u540D\u7A31","\u8AAA\u660E",""],items:d,render:(s,t)=>r(h,{children:[e("span",{children:e("input",{type:"text",name:"class1",value:s.className,onChange:o=>X(o,t),placeholder:"\u8F38\u5165\u73ED\u7D1A\u540D\u7A31"})}),e("span",{children:e("input",{type:"text",name:"explain1",value:s.classDescription,onChange:o=>q(o,t),placeholder:"\u8F38\u5165\u8AAA\u660E"})}),r("span",{children:[e("img",{className:"addRow",src:W,alt:"Add row",onClick:J}),d.length>1&&e("img",{src:S,alt:"delete row",onClick:()=>K(t)})]})]}),renderNull:()=>e(h,{children:e("span",{style:{gridColumn:"span 3"},children:"\u7121\u8CC7\u6599"})})}),$||I||v&&r("div",{children:[$&&e(f,{variant:"danger",children:e("strong",{children:"\u73ED\u7D1A\u540D\u7A31\u548C\u8AAA\u660E\u90FD\u9700\u586B\u5BEB"})}),I&&e(f,{variant:"danger",children:e("strong",{children:"\u73ED\u7D1A\u540D\u7A31\u4E0D\u53EF\u4EE5\u91CD\u8907"})}
1),v&&e(f,{variant:"danger",children:e("strong",{children:"\u65B0\u589E\u73ED\u7D1A\u6210\u529F\uFF0C\u7A0D\u5F85\u91CD\u65B0\u6574\u7406\u5F8C\u66F4\u65B0"})})]}),e(R,{className:"mb-10",children:r(C,{disabled:U,children:[e("img",{src:W}),"\u65B0\u589E"]})})]})]}),r(g,{show:P,onHide:()=>_(!1),children:[e(g.Header,{closeButton:!0,children:e(g.Title,{children:"\u4FEE\u6539\u73ED\u7D1A\u8CC7\u6599"})}),e(g.Body,{children:r(c,{style:{gap:"10px"},children:[r(c.Group,{children:[e(c.Label,{style:{color:"#46c5e3",fontSize:"20px"},children:"\u73ED\u7D1A\u540D\u7A31"}),e(c.Control,{type:"text",value:l.Group_Name||"",onChange:s=>k(s,"Group_Name")})]}),r(c.Group,{children:[e(c.Label,{style:{color:"#46c5e3",fontSize:"20px"},children:"\u8AAA\u660E"}),e(c.Control,{type:"text",value:l.Group_Description||"",onChange:s=>k(s,"Group_Description")})]})]})}),e(g.Footer,{children:e(le,{variant:"primary",onClick:Z,children:"\u66F4\u65B0"})})]})]}),e("div",{className:"w-full flex justify-center items-center",children:r("div",{className:`${x>1280?"w-47":"w-full"}`,children:[e("div",{className:"title title_mobile",children:"\u9EDE\u540D"}),e("div",{className:"w-full border-1 boreder-moe-grey ht-15",children:e(B,{style:{gridTemplateColumns:"40% 20% 40%",maxHeight:"300px"},propertyStyle:{gridColumn:"span 3",borderTop:"none"},itemProperty:["XX\u73ED(\u6F14\u793A)"],items:[{lastTime:"2023/08/15 14:00"}],render:(s,t)=>r(oe.Fragment,{children:[r("span",{children:["\u4E0A\u4E00\u6B21\u9EDE\u540D\uFF1A ",s.lastTime]}),e("span",{}),e("span",{children:r(C,{type:"submit",children:[e("img",{src:ie}),"\u6B77\u53F2\u7D00\u9304"]})})]},t),renderNull:()=>e(h,{children:e("span",{style:{gridColumn:"span 3"},children:"\u7121\u8CC7\u6599"})})})})]})})]})};export{Me as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.