1 |
- var S=Object.defineProperty;var x=Object.getOwnPropertySymbols;var U=Object.prototype.hasOwnProperty,B=Object.prototype.propertyIsEnumerable;var P=(l,a,n)=>a in l?S(l,a,{enumerable:!0,configurable:!0,writable:!0,value:n}):l[a]=n,h=(l,a)=>{for(var n in a||(a={}))U.call(a,n)&&P(l,n,a[n]);if(x)for(var n of x(a))B.call(a,n)&&P(l,n,a[n]);return l};var v=(l,a,n)=>new Promise((m,c)=>{var d=s=>{try{f(n.next(s))}catch(o){c(o)}},i=s=>{try{f(n.throw(s))}catch(o){c(o)}},f=s=>s.done?m(s.value):Promise.resolve(s.value).then(d,i);f((n=n.apply(l,a)).next())});import{S as z}from"./index.e6fc9d6c.js";import{P as E}from"./index.c2964e13.js";import{z as q,A as M,B as A,C as I,D as j}from"./api.fe2aadc7.js";import{d as R,e as K,u as T,r as N,a as k,B as _,i as t,q as V,l as p,_ as C,db as $,a9 as w,p as u,k as r,c as G,ai as O,ce as X,cg as H,aa as J}from"./index.fd264fea.js";import"./searchs.b637f0d6.js";const Q=R({emits:["close","getList"],props:["actvieRow"],name:"eidt-plan",setup(l,{emit:a}){K().query.orchestraId;const m=T(),c=N(),d=k({loading:!1,dataList:[],btnLoading:!1}),i=k({id:"",name:"",lessonTargetDesc:"",sortNo:"",semesterNo:"",enableFlag:!1}),f=()=>v(this,null,function*(){var s;console.log("formRef",c.value),(s=c.value)==null||s.validate(o=>v(this,null,function*(){var g;if(!o)try{if((g=l==null?void 0:l.actvieRow)!=null&&g.id){const{data:b}=yield q(h({},i));a("getList"),m.success("\u4FEE\u6539\u6210\u529F")}else{const{data:b}=yield M(h({},i));a("getList"),m.success("\u6DFB\u52A0\u6210\u529F")}}catch(b){}}))});return _(()=>{var s,o;if(console.log((s=l==null?void 0:l.actvieRow)==null?void 0:s.id,"\u67E5\u8BE2id"),(o=l==null?void 0:l.actvieRow)!=null&&o.id)for(let g in l==null?void 0:l.actvieRow)i[g]=l==null?void 0:l.actvieRow[g],console.log(g,l==null?void 0:l.actvieRow[g])}),()=>t("div",null,[t(V,{ref:c,model:i},{default:()=>[t(p,{label:"\u6559\u5B66\u8BA1\u5212\u540D\u79F0",rule:[{required:!0,message:"\u8BF7\u8F93\u5165\u6559\u5B66\u8BA1\u5212\u540D\u79F0",trigger:["blur","input"]}],path:"name"},{default:()=>[t(C,{value:i.name,"onUpdate:value":s=>i.name=s,placeholder:"\u8BF7\u8F93\u5165\u6559\u5B66\u8BA1\u5212\u540D\u79F0",maxlength:50,clearable:!0},null)]}),t(p,{label:"\u5B66\u671F\u6570",rule:[{required:!0,pattern:/^[1-6]$/,message:"\u8BF7\u8F93\u5165\u6570\u5B57\u4E3A1-6\u7684\u5B66\u671F\u6570",trigger:["blur","input"]}],path:"sortNo"},{default:()=>[t($,{style:{width:"100%"},value:i.sortNo,"onUpdate:value":s=>i.sortNo=s,placeholder:"\u8BF7\u8F93\u5165\u5B66\u671F\u6570",maxlength:50,clearable:!0},null)]}),t(p,{label:"\u6559\u5B66\u76EE\u6807",rule:[{required:!0,message:"\u8BF7\u8F93\u5165\u6559\u5B66\u76EE\u6807",trigger:["blur","input"]}],path:"lessonTargetDesc"},{default:()=>[t(C,{value:i.lessonTargetDesc,"onUpdate:value":s=>i.lessonTargetDesc=s,type:"textarea",placeholder:"\u8BF7\u8F93\u5165\u6559\u5B66\u76EE\u6807",maxlength:500,clearable:!0},null)]})]}),t(w,{justify:"end"},{default:()=>[t(u,{type:"default",onClick:()=>a("close")},{default:()=>[r("\u53D6\u6D88")]}),t(u,{type:"primary",onClick:()=>f(),loading:d.btnLoading,disabled:d.btnLoading},{default:()=>[r("\u786E\u8BA4")]})]})])}}),ne=R({name:"teaching-plan",setup(){const l=G(),a=k({loading:!1,pagination:{page:1,rows:10,pageTotal:0},dataList:[],visiablePlan:!1,modalType:"add",materail:null,actvieRow:null}),n=k({name:"",keyword:"",enableFlag:null}),m=O(),c=T(),d=()=>v(this,null,function*(){try{a.loading=!0;const e=h({page:a.pagination.page,rows:a.pagination.rows},n),{data:y}=yield A(e);a.loading=!1,a.pagination.pageTotal=Number(y.total),a.dataList=y.rows||[]}catch(e){a.loading=!1}});_(()=>{d()});const i=(e,y)=>{m.warning({title:"\u8B66\u544A",content:y?"\u662F\u5426\u786E\u8BA4\u542F\u7528\u8BA1\u5212?":"\u662F\u5426\u786E\u8BA4\u505C\u7528\u8BA1\u5212?",positiveText:"\u786E\u5B9A",negativeText:"\u53D6\u6D88",onPositiveClick:()=>v(this,null,function*(){(yield j({id:e.id,enableFlag:y})).data&&(o(),c.success("\u64CD\u4F5C\u6210\u529F"))})})},f=()=>[{title:"\u6559\u5B66\u8BA1\u5212\u7F16\u53F7",key:"id"},{title:"\u6559\u5B66\u8BA1\u5212\u540D\u79F0",key:"name"},{title:"\u5B66\u671F\u6570",key:"name",render(e){return`\u7B2C${e.sortNo}\u5B66\u671F`}},{title:"\u8BFE\u4EF6\u6570",key:"coursewareNum"},{title:"\u72B6\u6001",key:"enableFlag",render(e){return e.enableFlag?"\u5DF2\u542F\u7528":"\u672A\u542F\u7528"}},{title:"\u66F4\u65B0\u65F6\u95F4",key:"updateTime"},{title:"\u66F4\u65B0\u4EBA",key:"operatorName"},{title:"\u64CD\u4F5C",key:"operation",fixed:"right",render(e){return t(w,null,{default:()=>[e.enableFlag?t(u,{type:"error",size:"small",text:!0,onClick:()=>i(e,!1)},{default:()=>[r("\u505C\u7528")]}):t(u,{type:"primary",size:"small",text:!0,onClick:()=>i(e,!0)},{default:()=>[r("\u542F\u7528")]}),t(u,{type:"primary",size:"small",text:!0,onClick:()=>{L(e)}},{default:()=>[r("\u8BE6\u60C5")]}),t(u,{type:"primary",size:"small",text:!0,onClick:()=>{D(e)}},{default:()=>[r("\u4FEE\u6539")]}),t(u,{type:"primary",size:"small",text:!0,onClick:()=>g(e)},{default:()=>[r("\u5220\u9664")]})]})}}],s=N(),o=()=>{a.pagination.page=1,d()},g=e=>v(this,null,function*(){m.warning({title:"\u8B66\u544A",content:"\u662F\u5426\u786E\u8BA4\u5220\u9664\u6B64\u8BA1\u5212?",positiveText:"\u786E\u5B9A",negativeText:"\u53D6\u6D88",onPositiveClick:()=>v(this,null,function*(){console.log("row",e),(yield I(e.id)).data&&(o(),c.success("\u5220\u9664\u6210\u529F"))})})}),b=()=>{var e;(e=s.value)==null||e.submit()},F=()=>{var e;(e=s.value)==null||e.reset()},D=e=>{a.actvieRow=e,a.visiablePlan=!0},L=e=>{console.log(e),l.push({path:"/planDetail",query:{name:e.name,id:e.id}})};return()=>t("div",{class:"system-menu-container"},[t("div",{class:["section-container"]},[t(z,{ref:s,model:n,onSubmit:o,onSetModel:e=>Object.assign(n,e),saveKey:"courseware-manage-key"},{default:()=>[t(p,{path:"keyword",label:"\u5173\u952E\u8BCD"},{default:()=>[t(C,{value:n.keyword,"onUpdate:value":e=>n.keyword=e,placeholder:"\u8BA1\u5212\u540D\u79F0/\u7F16\u53F7",clearable:!0},null)]}),t(p,{path:"enableFlag",label:"\u662F\u5426\u542F\u7528"},{default:()=>[t(X,{placeholder:"\u662F\u5426\u542F\u7528",clearable:!0,value:n.enableFlag,"onUpdate:value":e=>n.enableFlag=e,options:[{label:"\u662F",value:1},{label:"\u5426",value:0}]},null)]}),t(p,null,{default:()=>[t(w,null,{default:()=>[t(u,{type:"primary",onClick:b},{default:()=>[r("\u641C\u7D22")]}),t(u,{type:"default",onClick:F},{default:()=>[r("\u91CD\u7F6E")]})]})]})]}),t(w,{style:{paddingBottom:"12px"}},{default:()=>[t(u,{type:"primary",onClick:()=>{a.actvieRow=null,a.visiablePlan=!0}},{default:()=>[r("\u65B0\u589E\u6559\u5B66\u8BA1\u5212")]})]}),t(H,{scrollX:1e3,loading:a.loading,columns:f(),data:a.dataList},null),t(E,{saveKey:"after-class-training-manage-key",page:a.pagination.page,"onUpdate:page":e=>a.pagination.page=e,pageSize:a.pagination.rows,"onUpdate:pageSize":e=>a.pagination.rows=e,pageTotal:a.pagination.pageTotal,"onUpdate:pageTotal":e=>a.pagination.pageTotal=e,onList:d,sync:!0},null)]),t(J,{show:a.visiablePlan,"onUpdate:show":e=>a.visiablePlan=e,preset:"dialog",showIcon:!1,title:a.actvieRow?"\u4FEE\u6539\u6559\u5B66\u8BA1\u5212":"\u65B0\u589E\u6559\u5B66\u8BA1\u5212",style:{width:"550px"}},{default:()=>[t(Q,{actvieRow:a.actvieRow,onClose:()=>{a.visiablePlan=!1},onGetList:()=>{a.visiablePlan=!1,d()}},null)]})])}});export{ne as default};
|