You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/p__Engineering__Lists__Trai...

1 line
15 KiB

"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[59649],{77171:function(e,n,t){t.d(n,{Z:function(){return l}});var i=t(87462),o=t(67294),r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M862 465.3h-81c-4.6 0-9 2-12.1 5.5L550 723.1V160c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v563.1L255.1 470.8c-3-3.5-7.4-5.5-12.1-5.5h-81c-6.8 0-10.5 8.1-6 13.2L487.9 861a31.96 31.96 0 0048.3 0L868 478.5c4.5-5.2.8-13.2-6-13.2z"}}]},name:"arrow-down",theme:"outlined"},a=t(43387),c=function(e,n){return o.createElement(a.Z,(0,i.Z)({},e,{ref:n,icon:r}))};var l=o.forwardRef(c)},11475:function(e,n,t){t.d(n,{Z:function(){return l}});var i=t(87462),o=t(67294),r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z"}}]},name:"exclamation-circle",theme:"outlined"},a=t(43387),c=function(e,n){return o.createElement(a.Z,(0,i.Z)({},e,{ref:n,icon:r}))};var l=o.forwardRef(c)},36579:function(e,n,t){t.d(n,{Z:function(){return w}});var i=t(42122),o=t.n(i),r=t(17061),a=t.n(r),c=t(17156),l=t.n(c),s=t(27424),d=t.n(s),u=t(67294),_={wrp:"wrp___dq7YK",bgBlack:"bgBlack___ARIUV",monaco:"monaco___VnZC3",darkBlue:"darkBlue___UprA9",close:"close___LKoWu",embed:"embed___hvpEJ"},p=t(71577),h=t(77171),f=t(8691),x=t(83062),v=t(29427),m=t(51412),g=t(82982),j=t(59758),y=t(85893),w=function(e){e.editOffice;var n,t,i,r,c,s,w,b=e.data,Z=(e.theme,e.type),k=e.filename,C=e.monacoEditor,I=e.className,N=e.style,P=e.close,S=e.onClose,E=e.hasMask,z=e.disabledDownload,R=e.onImgDimensions,O=e.showNodata,q=(0,u.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),V=d()(q,2),B=(V[0],V[1],(0,u.useState)("")),J=d()(B,2),T=(J[0],J[1]),W=(0,u.useState)(),L=d()(W,2),M=L[0],U=L[1],A="build"===window.ENV?"/react/build":"",X=location.host.startsWith("localhost")?j.Z.PROXY_SERVER:j.Z.API_SERVER,D=(0,u.useRef)();null!==(n=b)&&void 0!==n&&n.startsWith("/api")&&"txt"!==Z&&(b=j.Z.API_SERVER+b),k&&(C.filename=k),(0,u.useEffect)((function(){var e,n,t=null===(e=document.cookie)||void 0===e||null===(n=e.replace(/\s/g,""))||void 0===n?void 0:n.split(";");null==t||t.map((function(e){var n=e.split("=");"_educoder_session"===n[0]&&T(n[1])}))}),[]),(0,u.useEffect)((function(){"office"===Z&&F()}),[Z,b]);var F=function(){var e=l()(a()().mark((function e(){var n,t,i;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=b,b.startsWith("http")||(n=location.origin+n),t=new URL(n).pathname.split("/").pop(),e.next=5,(0,m.gJ)({attachment_id:t});case 5:i=e.sent,U(i);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),H=function(){Y()},Y=function(){(0,v.Nd)(k||"educoder",decodeURIComponent(b))};return(0,y.jsxs)("div",{style:o()({},N||{}),className:"".concat(E&&_.bgBlack," ").concat(Z?_.wrp:"hide"),children:[P&&(0,y.jsxs)("div",{className:_.close,ref:D,children:[!!R&&(0,y.jsx)(x.Z,{title:"点击对图片进行批注",getPopupContainer:function(){return D.current},children:(0,y.jsx)("span",{onClick:function(){S(),R()},children:(0,y.jsx)("i",{className:"icon-yulanpizhu"})})}),!z&&(0,y.jsx)(x.Z,{title:"点击下载此文件",getPopupContainer:function(){return D.current},children:(0,y.jsx)("span",{onClick:Y,children:(0,y.jsx)("i",{className:"icon-quxiaozhiding"})})}),(0,y.jsx)(x.Z,{title:"关闭",getPopupContainer:function(){return D.current},children:(0,y.jsx)("span",{className:"",onClick:S,children:(0,y.jsx)("i",{className:"icon-guanbi1"})})})]}),(0,y.jsx)("div",{className:"".concat(_[I]," ").concat(I," ").concat(_.monaco," ").concat("txt"===Z?"show":"hide"),children:"txt"===Z&&(0,y.jsx)(f.ZP,o()({},C))}),"audio"===Z&&(0,y.jsx)("audio",{src:(null===(t=b)||void 0===t?void 0:t.indexOf("http"))>-1||null!==(i=b)&&void 0!==i&&i.startsWith("/api")?b:"data:image/png;base64,".concat(b),autoPlay:!0}),"video"===Z&&(0,y.jsx)(y.Fragment,{children:(null===(r=b)||void 0===r?void 0:r.indexOf("http"))>-1||null!==(c=b)&&void 0!==c&&c.startsWith("/api")?(0,y.jsx)("video",{controls:!0,src:"".concat(b),autoPlay:!0}):(0,y.jsx)("video",{controls:!0,src:"data:video/mp4;base64,".concat(b),autoPlay:!0})}),"office"===Z&&M&&(0,y.jsx)("iframe",{src:"https://preview.sysu.edu.cn/op/view.aspx?src=".concat(X+M.url)}),"html"===Z&&(0,y.jsx)("iframe",{src:b+"&disposition=inline"}),"pdf"===Z&&(0,y.jsx)("iframe",{src:"".concat(A,"/js/pdfview/index.html?url=").concat(b,"&disabledDownload=").concat(!!z)}),"image"===Z&&(0,y.jsx)("img",{src:(null===(s=b)||void 0===s?void 0:s.indexOf("http"))>-1||null!==(w=b)&&void 0!==w&&w.startsWith("/api")?b:"data:image/png;base64,".concat(b)}),("other"===Z||"download"===Z)&&(0,y.jsx)(y.Fragment,{children:O?(0,y.jsx)(g.Z,{customText:"当前文件不支持预览,可点击下载查看",ButtonTwo:(0,y.jsx)(p.ZP,{icon:(0,y.jsx)("i",{className:"iconfont icon-xiazai4 font14"}),type:"primary",size:"middle",onClick:H,children:"下载"})}):(0,y.jsxs)(p.ZP,{type:"primary",size:"middle",onClick:H,children:[(0,y.jsx)(h.Z,{}),"点击下载"]})})]})}},75200:function(e,n,t){t.r(n),t.d(n,{default:function(){return I}});var i=t(17061),o=t.n(i),r=t(42122),a=t.n(r),c=t(17156),l=t.n(c),s=t(27424),d=t.n(s),u=t(67294),_={flex_box_center:"flex_box_center___3dsSw",flex_space_between:"flex_space_between___UViQa",flex_box_vertical_center:"flex_box_vertical_center___VRHmE",flex_box_center_end:"flex_box_center_end___Sap6p",flex_box_column:"flex_box_column___cXZm0",wrap:"wrap___JbEle",title:"title___PD779",control:"control___xPMqa",label:"label___JqmpT",customTable:"customTable___YjprJ"},p=t(88275),h=t(2453),f=t(83062),x=t(14446),v=t(96101),m=t(71577),g=t(76661),j=t(11475),y=t(12034),w=t(84519),b=t(32337),Z=t(69555),k=t(36579),C=t(85893),I=(0,p.connect)((function(e){return{user:e.user}}))((function(e){var n,t=e.user,i=(0,u.useState)({page:1,per_page:20,total:0,ec_major_school_id:0,ec_year_id:0,category:1,sort_by:null,sort_direction:null,school_id:null}),r=d()(i,2),c=r[0],s=r[1],I=(0,u.useState)(!0),N=d()(I,2),P=N[0],S=N[1],E=(0,u.useState)([]),z=d()(E,2),R=z[0],O=z[1],q=(0,u.useState)([]),V=d()(q,2),B=V[0],J=V[1],T=(0,u.useState)([]),W=d()(T,2),L=W[0],M=W[1],U=(0,u.useState)({filename:"",editOffice:"view",type:"",className:"",data:"",close:!0,hasMask:!0,style:{position:"fixed",zIndex:9999,background:"rgba(0,0,0,.7)"},monacoEditor:{value:"",language:"",theme:"vs",options:{readOnly:!0}}}),A=d()(U,2),X=A[0],D=A[1],F=function(){var e=l()(o()().mark((function e(n){var i,r;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return S(!0),n.school_id=null==t||null===(i=t.userInfo)||void 0===i?void 0:i.school_id,e.next=4,(0,w.ZP)("/api/ec_major_schools/".concat((null==n?void 0:n.ec_major_school_id)||0,"/ec_years.json"),{method:"get",params:a()(a()({},n),{},{year:0===(null==n?void 0:n.ec_year_id)?null:null==n?void 0:n.ec_year_id,ec_year_id:(null==n||n.ec_year_id,null)})});case 4:(r=e.sent)&&(O(null==r?void 0:r.ec_years),S(!1),c.total=null==r?void 0:r.count,s(a()({},c)));case 6:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();function H(){return(H=l()(o()().mark((function e(){var n,i;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,w.ZP)("/api/schools/".concat(null==t||null===(n=t.userInfo)||void 0===n?void 0:n.school_id,"/ec_majors/get_major_list.json"),{method:"get"});case 2:i=e.sent,J(null==i?void 0:i.data);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Y(){return(Y=l()(o()().mark((function e(){var n;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,w.ZP)("/api/ec_major_schools/1/ec_years/select_year.json",{method:"get"});case 2:n=e.sent,M(null==n?void 0:n.year_arr);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}(0,u.useEffect)((function(){var e;null!==(e=t.userInfo)&&void 0!==e&&e.school_id&&(!function(){H.apply(this,arguments)}(),function(){Y.apply(this,arguments)}(),F(c))}),[null==t||null===(n=t.userInfo)||void 0===n?void 0:n.school_id]);var K=function(e,n){c.page=1,c[n]="number"==typeof e?e:null,s(a()({},c)),F(c)},Q=[{title:"序号",dataIndex:"index",width:54,render:function(e,n,t){return c.per_page*(c.page-1)+t+1}},{title:"培养方案",dataIndex:"name",width:"17%",ellipsis:!0,key:"name",render:function(e,n,t){return(0,C.jsx)(p.Link,{to:"/engineering/training/program/edit?ec_year_id=".concat(null==n?void 0:n.id),children:e})}},{title:"培养方案文件",dataIndex:"file_name",width:"10%",ellipsis:!0,key:"name",render:function(e,n,t){return(0,C.jsx)("a",{onClick:function(){["xlsx","docx","pptx"].includes(null==n?void 0:n.type)?(X.editOffice="edit",D(a()(a()({},X),{},{type:n.file_type,data:"/api/attachments/".concat(n.attachment_id)}))):h.ZP.info("当前文件不支持编辑")},children:e||"- -"})}},{title:"届别",width:"5%",dataIndex:"year",render:function(e,n,t){return e+"届"}},{title:"培养目标(项)",width:"8%",dataIndex:"training_subitem_count",render:function(e,n,t){return e||(0,C.jsx)("a",{href:"/engineering/training/objectives?ids=".concat(null==n?void 0:n.ec_major_school_id,",").concat(null==n?void 0:n.id),children:"设置"})}},{title:"毕业要求(项)",width:"8%",dataIndex:"graduation_requirement_count",render:function(e,n,t){return e||(0,C.jsx)("a",{href:"/engineering/graduated/index?ec_major_school_id=".concat(null==n?void 0:n.ec_major_school_id,"&ec_year_id=").concat(null==n?void 0:n.id),children:"设置"})}},{title:"授课教师/学生(人)",width:"10%",dataIndex:"teacher_count",render:function(e,n,t){return e+"/"+(null==n?void 0:n.student_count)}},{title:"课程(门)",width:"7%",dataIndex:"course_count",render:function(e,n,t){return e||(0,C.jsx)("a",{href:"/engineering/course/list?ec_major_school_id=".concat(null==n?void 0:n.ec_major_school_id,"&ec_year_id=").concat(null==n?void 0:n.id),children:"设置"})}},{title:"课程达成度",width:"9%",dataIndex:"achieved_graduation_course_count",render:function(e,n,t){return(0,C.jsx)(f.Z,{title:"已达成课程数:".concat(e," / 课程总数:").concat(null==n?void 0:n.course_count),children:(0,C.jsx)("span",{style:{color:null!=n&&n.course_count?parseInt(e)===parseInt(null==n?void 0:n.course_count)?"#07C160":"#E30000":""},children:null!=n&&n.course_count?e+"/"+(null==n?void 0:n.course_count):"- -"})})}},{title:"毕业要求达成度",width:"8%",dataIndex:"achieved_graduation_objective_count",render:function(e,n,t){return(0,C.jsx)(f.Z,{title:"已达成毕业要求数:".concat(e," / 毕业要求总数:").concat(null==n?void 0:n.graduation_requirement_count),children:(0,C.jsx)("span",{style:{color:null!=n&&n.graduation_requirement_count?parseInt(e)===parseInt(null==n?void 0:n.graduation_requirement_count)?"#07C160":"#E30000":""},children:null!=n&&n.graduation_requirement_count?e+"/"+(null==n?void 0:n.graduation_requirement_count):"- -"})})}},{title:"评价结果",width:"7%",dataIndex:"status",render:function(e,n,t){return(0,C.jsx)("span",{style:{color:"achieved"===e?"#E30000":"#07C160"},children:"achieved"===e?"未达成":"达成"})}},{title:"操作",dataIndex:"id",width:64,render:function(e,n,i){return(0,C.jsxs)("div",{style:{display:"flex"},children:[(0,C.jsx)("i",{onClick:l()(o()().mark((function e(){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:p.history.push("/engineering/training/program/edit?ec_year_id=".concat(null==n?void 0:n.id));case 1:case"end":return e.stop()}}),e)}))),style:{color:"#0152d9",cursor:"pointer",marginRight:"5px"},className:"iconfont icon-bianji6"}),(0,C.jsx)("i",{onClick:function(){var n;x.Z.confirm({title:"确认是否删除?",icon:(0,C.jsx)(j.Z,{}),okText:"确认",cancelText:"取消",onOk:(n=l()(o()().mark((function n(){var i;return o()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,w.ZP)("/api/ec_major_schools/1/ec_years/".concat(e),{method:"delete"});case 2:n.sent&&(Z.U.clear(null==t||null===(i=t.userInfo)||void 0===i?void 0:i.login),h.ZP.info("删除成功"),F(c));case 4:case"end":return n.stop()}}),n)}))),function(){return n.apply(this,arguments)}),onCancel:function(){}})},style:{marginRight:"5px",color:"#0152d9",cursor:"pointer"},className:"iconfont icon-shanchu9"}),(0,C.jsx)("i",{onClick:l()(o()().mark((function n(){var i;return o()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:(0,y.xm)({ec_year_id:e,school_id:null==t||null===(i=t.userInfo)||void 0===i?void 0:i.school_id});case 1:case"end":return n.stop()}}),n)}))),style:{color:"#0152d9",cursor:"pointer"},className:"iconfont icon-daochubeifen"})]})}}];return(0,C.jsxs)("div",{className:_.wrap,children:[(0,C.jsx)(b.p,{title:"培养方案",style:{padding:"12px 0 0 20px"}}),(0,C.jsx)("div",{style:{clear:"both"}}),(0,C.jsxs)("div",{className:_.control,children:[(0,C.jsx)("div",{className:_.label,children:"认证专业"}),(0,C.jsxs)(v.Z,{style:{width:240},allowClear:!0,placeholder:"专业",value:null==c?void 0:c.ec_major_school_id,onChange:function(e){return K(e,"ec_major_school_id")},children:[(0,C.jsx)(v.Z.Option,{value:0,children:"全部"}),null==B?void 0:B.map((function(e,n){return(0,C.jsx)(v.Z.Option,{value:null==e?void 0:e.ec_major_school_id,children:null==e?void 0:e.name})}))]}),(0,C.jsx)("div",{className:_.label,children:"认证届别"}),(0,C.jsxs)(v.Z,{style:{width:140},allowClear:!0,placeholder:"请选择届别",value:null==c?void 0:c.ec_year_id,onChange:function(e){return K(e,"ec_year_id")},children:[(0,C.jsx)(v.Z.Option,{value:0,children:"全部"}),null==L?void 0:L.map((function(e,n){return(0,C.jsxs)(v.Z.Option,{value:e,children:[e,"届"]})}))]}),(0,C.jsx)("div",{style:{flex:1,textAlign:"end"},children:(0,C.jsxs)(m.ZP,{onClick:function(){p.history.push("/engineering/training/program/add")},style:{height:"30px",width:"135px"},type:"primary",children:[(0,C.jsx)("i",{style:{marginRight:"7px"},className:"iconfont icon-xinzeng"}),"新增培养方案"]})})]}),(0,C.jsx)(g.Z,{className:_.customTable,dataSource:R,bordered:!1,rowKey:function(e){return e.id},columns:Q,rowClassName:_.row,loading:P,onChange:function(e,n,t){c.page=null==e?void 0:e.current,c.per_page=null==e?void 0:e.pageSize,null!=t&&t.order?(c.sort_by=null==t?void 0:t.field,c.sort_direction="ascend"===(null==t?void 0:t.order)?"asc":"desc"):(c.sort_by=null,c.sort_direction=null),s(a()({},c)),F(c)},pagination:{pageSize:c.per_page,total:c.total,current:c.page,showQuickJumper:!0,hideOnSinglePage:!0,showSizeChanger:!1,size:"default",position:["bottomCenter"],showTotal:function(e){return(0,C.jsxs)("span",{className:"mr10",children:["共",(0,C.jsx)("span",{className:"c-orange",children:e}),"条数据"]})}}}),(0,C.jsx)(k.Z,a()(a()({},X),{},{onClose:function(){D(a()(a()({},X),{},{type:""}))}}))]})}))},32337:function(e,n,t){t.d(n,{p:function(){return r},v:function(){return c}});t(67294);var i="panelTitleContainer___Ypuh_",o=t(85893),r=function(e){var n=e.title,t=e.style,r=void 0===t?{}:t;return(0,o.jsx)("div",{className:i,style:r,children:(0,o.jsx)("div",{children:n})})},a="selectWrapContainer___qocIH",c=function(e){var n=e.title,t=e.children;return(0,o.jsxs)("div",{className:a,children:[(0,o.jsx)("span",{children:n}),t]})}}}]);