1 |
- var P=Object.defineProperty;var F=Object.getOwnPropertySymbols;var U=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable;var _=(o,t,l)=>t in o?P(o,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):o[t]=l,x=(o,t)=>{for(var l in t||(t={}))U.call(t,l)&&_(o,l,t[l]);if(F)for(var l of F(t))A.call(t,l)&&_(o,l,t[l]);return o};var c=(o,t,l)=>new Promise((h,m)=>{var y=s=>{try{d(l.next(s))}catch(u){m(u)}},w=s=>{try{d(l.throw(s))}catch(u){m(u)}},d=s=>s.done?h(s.value):Promise.resolve(s.value).then(y,w);d((l=l.apply(o,t)).next())});import{S as z}from"./index.a45fcbc1.js";import{P as B}from"./index.5d4cf042.js";import{w as M,x as R,y as V}from"./api.c178af47.js";import{d as K,c as O,a as k,ai as j,u as Y,B as q,r as H,i as a,l as g,_ as G,ce as v,a9 as D,p as i,k as p,H as f,cg as J,da as T,d9 as r,aj as C,ae as Q,bC as b}from"./index.19a1245a.js";import{l as W,k as X}from"./knowledgeTypeData.3b15dd0b.js";import{q as Z}from"./api.fb79cc90.js";import"./searchs.b637f0d6.js";const L={SINGLE_DELIVERY:"\u5355\u4EA4\u4ED8\u56E2",MULTIPLE_DELIVERY:"\u591A\u4EA4\u4ED8\u5E38\u89C4\u56E2",MULTIPLE_DELIVERY_SCHOOL:"\u591A\u4EA4\u4ED8\u6821\u56E2"},ue=K({name:"courseware-manage",setup(){const o=O(),t=k({loading:!1,pagination:{page:1,rows:10,pageTotal:0},dataList:[],visiableKnowledge:!1,modalType:"add",materail:null,staffList:[],orchestraTypeList:[]}),l=k({orchestraType:null,name:"",keyword:"",enableFlag:null,operatorId:null,courseTypeCode:null}),h=j(),m=Y();k({list:[],index:-1});const y=()=>c(this,null,function*(){try{t.loading=!0;const e=x({page:t.pagination.page,rows:t.pagination.rows},l),{data:n}=yield M(e);t.loading=!1,t.pagination.pageTotal=Number(n.total),t.dataList=n.rows||[]}catch(e){t.loading=!1}}),w=()=>c(this,null,function*(){try{const{data:e}=yield Z({page:1,rows:999});Array.isArray(e.rows)&&(t.staffList=e.rows.map(n=>({label:n.nickname,value:n.id})))}catch(e){}});q(()=>{w(),y();for(let e in L)t.orchestraTypeList.push({label:L[e],value:e})});const d=(e,n)=>{h.warning({title:"\u8B66\u544A",content:n?"\u662F\u5426\u786E\u8BA4\u542F\u7528\u8BFE\u4EF6?":"\u662F\u5426\u786E\u8BA4\u505C\u7528\u8BFE\u4EF6?",positiveText:"\u786E\u5B9A",negativeText:"\u53D6\u6D88",onPositiveClick:()=>c(this,null,function*(){(yield V({id:e.id,enableFlag:n})).data&&(E(),m.success("\u64CD\u4F5C\u6210\u529F"))})})},s=()=>[{title:"\u8BFE\u4EF6\u4FE1\u606F",key:"id",render:e=>a(C,null,[a(T,{labelPlacement:"left",column:1},{default:()=>[a(r,{label:"\u8BFE\u7A0B\u540D\u79F0"},{default:()=>[e.name]}),a(r,{label:"\u8BFE\u4EF6\u7F16\u53F7"},{default:()=>[e.id]})]})])},{title:"\u8BFE\u4EF6\u5C01\u9762",key:"coverImg",render(e){return a(Q,{width:80,height:80,objectFit:"contain",src:e.coverImg},null)}},{title:"\u7C7B\u578B",key:"orchestraType",render:e=>a(C,null,[a(T,{labelPlacement:"left",column:1},{default:()=>[a(r,{label:"\u4E50\u56E2\u7C7B\u578B"},{default:()=>[L[e.orchestraType]]}),a(r,{label:"\u8BFE\u7A0B\u7C7B\u578B"},{default:()=>[e.courseTypeCode?X[e.courseTypeCode]:"--"]})]})])},{title:"\u8BFE\u4EF6\u5185\u5BB9",key:"courseNum",render:e=>a(C,null,[a(T,{labelPlacement:"left",column:1},{default:()=>[a(r,{label:"\u8BFE\u65F6\u6570"},{default:()=>[e.courseNum]}),a(r,{label:"\u9636\u6BB5\u81EA\u6D4B"},{default:()=>[e.unitTestNum]})]})])},{title:"\u66F4\u65B0\u4FE1\u606F",key:"updateTime",render:e=>a(C,null,[a(T,{labelPlacement:"left",column:1},{default:()=>[a(r,{label:"\u66F4\u65B0\u4EBA"},{default:()=>[e.operatorName]}),a(r,{label:"\u66F4\u65B0\u65F6\u95F4"},{default:()=>[e.updateTime]})]})])},{title:"\u72B6\u6001",key:"enableFlag",render(e){return e.enableFlag?"\u5DF2\u542F\u7528":"\u672A\u542F\u7528"}},{title:"\u64CD\u4F5C",key:"operation",fixed:"right",render(e){return a(D,null,{default:()=>[e.enableFlag?f(a(i,{type:"error",size:"small",text:!0,onClick:()=>d(e,!1)},{default:()=>[p("\u505C\u7528")]}),[[b("auth"),"lessonCourseware/updateEnableFlag1608067923699892226"]]):f(a(i,{type:"primary",size:"small",text:!0,onClick:()=>d(e,!0)},{default:()=>[p("\u542F\u7528")]}),[[b("auth"),"lessonCourseware/updateEnableFlag1608067923699892226"]]),f(a(i,{type:"primary",size:"small",text:!0,onClick:()=>{o.push({path:"/coursewareDetail",query:{id:e.id}})}},{default:()=>[p("\u8BE6\u60C5")]}),[[b("auth"),"coursewareDetail1607207526805606402"]]),f(a(i,{type:"primary",size:"small",text:!0,onClick:()=>I(e)},{default:()=>[p("\u5220\u9664")]}),[[b("auth"),"lessonCourseware/delete1610257235044466690"]])]})}}],u=H(),E=()=>{t.pagination.page=1,y()},I=e=>c(this,null,function*(){h.warning({title:"\u8B66\u544A",content:"\u662F\u5426\u786E\u8BA4\u5220\u9664\u6B64\u8BFE\u4EF6?",positiveText:"\u786E\u5B9A",negativeText:"\u53D6\u6D88",onPositiveClick:()=>c(this,null,function*(){console.log("row",e),(yield R(e.id)).data&&(E(),m.success("\u5220\u9664\u6210\u529F"))})})}),N=()=>{var e;(e=u.value)==null||e.submit()},S=()=>{var e;(e=u.value)==null||e.reset()};return()=>a("div",{class:"system-menu-container"},[a("div",{class:["section-container"]},[a(z,{ref:u,model:l,onSubmit:E,onSetModel:e=>Object.assign(l,e),saveKey:"courseware-manage-ad-key"},{default:()=>[a(g,{path:"keyword",label:"\u5173\u952E\u5B57"},{default:()=>[a(G,{value:l.keyword,"onUpdate:value":e=>l.keyword=e,placeholder:"\u8BF7\u8F93\u5165\u8BFE\u4EF6\u540D\u79F0/\u7F16\u53F7",clearable:!0},null)]}),a(g,{path:"courseTypeCode",label:"\u8BFE\u7A0B\u7C7B\u578B"},{default:()=>[a(v,{placeholder:"\u8BF7\u9009\u62E9\u8BFE\u7A0B\u7C7B\u578B",clearable:!0,value:l.courseTypeCode,"onUpdate:value":e=>l.courseTypeCode=e,options:W},null)]}),a(g,{path:"enableFlag",label:"\u662F\u5426\u542F\u7528"},{default:()=>[a(v,{placeholder:"\u662F\u5426\u542F\u7528",clearable:!0,value:l.enableFlag,"onUpdate:value":e=>l.enableFlag=e,options:[{label:"\u662F",value:1},{label:"\u5426",value:0}]},null)]}),a(g,{path:"orchestraType",label:"\u4E50\u56E2\u7C7B\u578B"},{default:()=>[a(v,{placeholder:"\u8BF7\u8F93\u5165\u4E50\u56E2\u7C7B\u578B",clearable:!0,value:l.orchestraType,"onUpdate:value":e=>l.orchestraType=e,options:t.orchestraTypeList},null)]}),a(g,{path:"operatorId",label:"\u66F4\u65B0\u4EBA"},{default:()=>[a(v,{placeholder:"\u8BF7\u8F93\u5165\u66F4\u65B0\u4EBA",clearable:!0,value:l.operatorId,"onUpdate:value":e=>l.operatorId=e,options:t.staffList,filterable:!0},null)]}),a(g,null,{default:()=>[a(D,null,{default:()=>[a(i,{type:"primary",onClick:N},{default:()=>[p("\u641C\u7D22")]}),a(i,{type:"default",onClick:S},{default:()=>[p("\u91CD\u7F6E")]})]})]})]}),a(D,{style:{paddingBottom:"12px"}},{default:()=>[f(a(i,{type:"primary",onClick:()=>{t.visiableKnowledge=!0,o.push({path:"/coursewareDetail"})}},{default:()=>[p("\u65B0\u589E\u8BFE\u4EF6")]}),[[b("auth"),"coursewareDetail1607207526805606402"]])]}),a(J,{loading:t.loading,columns:s(),data:t.dataList},null),a(B,{saveKey:"courseware-manage-ad-key",page:t.pagination.page,"onUpdate:page":e=>t.pagination.page=e,pageSize:t.pagination.rows,"onUpdate:pageSize":e=>t.pagination.rows=e,pageTotal:t.pagination.pageTotal,"onUpdate:pageTotal":e=>t.pagination.pageTotal=e,onList:y,sync:!0},null)])])}});export{ue as default};
|