1 |
- var W=Object.defineProperty,X=Object.defineProperties;var Y=Object.getOwnPropertyDescriptors;var N=Object.getOwnPropertySymbols;var A=Object.prototype.hasOwnProperty,O=Object.prototype.propertyIsEnumerable;var R=(t,l,n)=>l in t?W(t,l,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[l]=n,x=(t,l)=>{for(var n in l||(l={}))A.call(l,n)&&R(t,n,l[n]);if(N)for(var n of N(l))O.call(l,n)&&R(t,n,l[n]);return t},K=(t,l)=>X(t,Y(l));var H=(t,l)=>{var n={};for(var u in t)A.call(t,u)&&l.indexOf(u)<0&&(n[u]=t[u]);if(t!=null&&N)for(var u of N(t))l.indexOf(u)<0&&O.call(t,u)&&(n[u]=t[u]);return n};var v=(t,l,n)=>new Promise((u,m)=>{var i=d=>{try{y(n.next(d))}catch(g){m(g)}},h=d=>{try{y(n.throw(d))}catch(g){m(g)}},y=d=>d.done?u(d.value):Promise.resolve(d.value).then(i,h);y((n=n.apply(t,l)).next())});import{S as Z}from"./index.e6fc9d6c.js";import{P as ee}from"./index.c2964e13.js";import{k as ae,a as le,f as te,b as ne,c as ie}from"./api.f7eeabdc.js";import{k as V,l as ue}from"./knowledgeTypeData.3b15dd0b.js";import{d as G,u as J,r as L,a as U,i as a,dk as oe,q as de,l as c,_ as Q,ce as z,db as se,a8 as re,a7 as $,k as s,a9 as B,p as r,c as ce,ai as me,B as ge,cf as fe,H as k,cg as pe,aa as ye,da as M,d9 as p,aj as I,ch as be,bC as C}from"./index.fd264fea.js";import{f as ve}from"./dateUtil.134dfe1f.js";import"./searchs.b637f0d6.js";import"./dayjs.min.bd923176.js";const he=G({name:"KnowledgeModel",emits:["handleSuccess","close"],props:["item"],setup(t,{emit:l}){var P,S,_,D,e,b,w,F;const n=J(),u=L(!1),m=L(null),i=U({id:(P=t==null?void 0:t.item)!=null&&P.id?(S=t==null?void 0:t.item)==null?void 0:S.id:null,name:((_=t==null?void 0:t.item)==null?void 0:_.name)||"",courseTypeCode:((e=(D=t==null?void 0:t.item)==null?void 0:D.courseTypeCode)==null?void 0:e.split(","))||[],autoPlayFlag:((b=t==null?void 0:t.item)==null?void 0:b.autoPlayFlag)==!0?1:0,totalMaterialTimeSecond:(w=t==null?void 0:t.item)==null?void 0:w.totalMaterialTimeSecond,parentId:((F=t==null?void 0:t.item)==null?void 0:F.parentId)||0});function h(o,f){return Array.isArray(f)&&!f.length?new Error("\u8BF7\u9009\u62E9\u8BFE\u7A0B\u7C7B\u578B"):!0}const y={name:[{required:!0,message:"\u8BF7\u8F93\u5165\u77E5\u8BC6\u70B9\u540D\u79F0",trigger:["blur","change"]}],courseTypeCode:[{validator:h,message:"\u8BF7\u9009\u62E9\u8BFE\u7A0B\u7C7B\u578B",trigger:["blur","change"]}]},d=()=>{let o=[];return Object.keys(V).map(f=>{o.push({label:V[f],value:f})}),o},g=()=>{var o;(o=m.value)==null||o.validate(f=>v(this,null,function*(){var E;if(console.log("\u{1F680} ~ err",f),!f){const j=K(x({},i),{courseTypeCode:((E=i.courseTypeCode)==null?void 0:E.join(","))||""});let T=null,q="";i.id?T=yield ae(j):(T=yield le(j),q=T.data),(T==null?void 0:T.code)==200?(n.success("\u4FDD\u5B58\u6210\u529F"),l("handleSuccess",q)):n.warning("\u4FDD\u5B58\u5931\u8D25")}}))};return()=>a("div",null,[a(oe,{show:u.value},{default:()=>[a(de,{ref:m,labelPlacement:"top",model:i,rules:y,"require-mark-placement":"left"},{default:()=>[a(c,{label:"\u77E5\u8BC6\u70B9\u540D\u79F0",path:"name"},{default:()=>[a(Q,{value:i.name,"onUpdate:value":o=>i.name=o},null)]}),a(c,{label:"\u8BFE\u7A0B\u7C7B\u578B",path:"courseTypeCode"},{default:()=>[a(z,{multiple:!0,disabled:!!(t!=null&&t.item),value:i.courseTypeCode,"onUpdate:value":o=>i.courseTypeCode=o,options:d(),clearable:!0},null)]}),a(c,{label:"\u5EFA\u8BAE\u5B66\u4E60\u65F6\u957F",path:"totalMaterialTimeSecond",rule:[{required:!0,type:"number",min:0,message:"\u8BF7\u8F93\u5165\u6B63\u786E\u5EFA\u8BAE\u5B66\u4E60\u65F6\u957F",trigger:"blur"}]},{default:()=>[a(se,{placeholder:"\u8BF7\u8F93\u5165\u5EFA\u8BAE\u5B66\u4E60\u65F6\u957F",showButton:!1,value:i.totalMaterialTimeSecond,"onUpdate:value":o=>i.totalMaterialTimeSecond=o},{suffix:()=>"s(\u79D2)"})]}),a(c,{label:"\u81EA\u52A8\u64AD\u653E\u4E0B\u4E00\u77E5\u8BC6\u70B9",path:"autoPlayFlag"},{default:()=>[a(re,{value:i.autoPlayFlag,"onUpdate:value":o=>i.autoPlayFlag=o},{default:()=>[a($,{value:1},{default:()=>[s("\u662F")]}),a($,{value:0},{default:()=>[s("\u5426")]})]})]})]}),a(B,{justify:"end"},{default:()=>[a(r,{onClick:()=>l("close")},{default:()=>[s("\u53D6\u6D88")]}),a(r,{type:"primary",onClick:g},{default:()=>[s("\u4FDD\u5B58")]})]})]})])}}),Ne=G({name:"knowledge-manage",setup(){const t=ce(),l=U({loading:!1,pagination:{page:1,rows:10,pageTotal:0},dataList:[],visiableKnowledge:!1,modalType:"add",materail:null}),n=U({keyword:null,time:null,courseTypeCode:null,operatorId:null,enableFlag:null}),u=me(),m=J();U({list:[],index:-1});const i=()=>v(this,null,function*(){try{l.loading=!0;const e=n,{time:b}=e,w=H(e,["time"]),{data:F}=yield te(K(x(x({},w),ve(b,["startUpdateTime","endUpdateTime"])),{page:l.pagination.page,rows:l.pagination.rows}));l.loading=!1,l.pagination.pageTotal=Number(F.total),l.dataList=F.rows||[]}catch(b){l.loading=!1}});ge(()=>{i()});const h=e=>{t.push({path:"/knowledgeDetail",query:{id:e.id,name:e.name,courseTypeCode:e.courseTypeCode}})},y=()=>[{title:"\u77E5\u8BC6\u70B9",key:"id",render:e=>a("div",{style:"display: inline-flex;vertical-align: middle;"},[a(M,{labelPlacement:"left",column:1},{default:()=>[a(p,{label:"\u77E5\u8BC6\u70B9\u540D\u79F0"},{default:()=>[e.name]}),a(p,{label:"\u77E5\u8BC6\u70B9\u7F16\u53F7"},{default:()=>[e.id]})]})])},{title:"\u8BFE\u7A0B\u7C7B\u578B",key:"courseTypeName",render:e=>a(I,null,[a(M,{labelPlacement:"left",column:1},{default:()=>[a(p,{label:"\u8BFE\u7A0B\u7C7B\u578B"},{default:()=>[e.courseTypeName]}),a(p,{label:"\u81EA\u52A8\u64AD\u653E"},{default:()=>[e.autoPlayFlag==1?"\u662F":"\u5426"]})]})])},{title:"\u5B66\u4E60\u4FE1\u606F",key:"totalMaterialNum",render:e=>a(I,null,[a(M,{labelPlacement:"left",column:1},{default:()=>[a(p,{label:"\u7D20\u6750\u6570\u91CF"},{default:()=>[e.totalMaterialNum]}),a(p,{label:"\u5EFA\u8BAE\u65F6\u957F"},{default:()=>[(e.totalMaterialTimeSecond||0)+"s"]})]})])},{title:"\u4E0A\u4F20\u4FE1\u606F",key:"updateTime",render:e=>a(I,null,[a(M,{labelPlacement:"left",column:1},{default:()=>[a(p,{label:"\u4FEE\u6539\u4EBA"},{default:()=>[e.operatorName]}),a(p,{label:"\u4FEE\u6539\u65F6\u95F4"},{default:()=>[e.updateTime]})]})])},{title:"\u72B6\u6001",key:"enableFlag",render(e){return a(be,{type:e.enableFlag?"success":"warning"},{default:()=>[e.enableFlag?"\u5DF2\u542F\u7528":"\u672A\u542F\u7528"]})}},{title:"\u64CD\u4F5C",key:"operation",fixed:"right",render(e){return a(B,null,{default:()=>[k(a(r,{type:e.enableFlag?"error":"success",size:"small",text:!0,onClick:()=>P(e)},{default:()=>[e.enableFlag?"\u505C\u7528":"\u542F\u7528"]}),[[C("auth"),"knowledgePoint/status1605123728664281090"]]),!(e.children&&e.children.length>0)&&k(a(r,{type:"primary",size:"small",text:!0,onClick:()=>h(e)},{default:()=>[s("\u8BE6\u60C5")]}),[[C("auth"),"knowledgePointListByLessonCDId1604717561400045569"]]),e.parentId<=0&&!e.materialFlag&&k(a(r,{type:"primary",size:"small",text:!0,onClick:()=>{l.modalType="add-child",l.visiableKnowledge=!0,l.materail={parentId:e.id,courseTypeCode:e.courseTypeCode}}},{default:()=>[s("\u6DFB\u52A0\u5B50\u9879")]}),[[C("auth"),"knowledgePoint/update1604688172914417665"]]),k(a(r,{type:"primary",size:"small",text:!0,onClick:()=>{l.modalType="update",l.visiableKnowledge=!0,l.materail=e}},{default:()=>[s("\u4FEE\u6539")]}),[[C("auth"),"knowledgePoint/update1604688172914417665"]]),k(a(r,{type:"primary",size:"small",disabled:!!e.enableFlag,text:!0,onClick:()=>{S(e)}},{default:()=>[s("\u5220\u9664")]}),[[C("auth"),"knowledgePoint/remove1604688068350418946"]])]})}}],d=L(),g=()=>{l.pagination.page=1,i()},P=(e,b=!0)=>v(this,null,function*(){u.warning({title:"\u8B66\u544A",content:`\u662F\u5426${e.enableFlag?"\u505C\u7528":"\u542F\u7528"}\u6B64\u77E5\u8BC6\u70B9?`,positiveText:"\u786E\u5B9A",negativeText:"\u53D6\u6D88",onPositiveClick:()=>v(this,null,function*(){console.log("row",e),(yield ne(e.id)).data&&(i(),m.success("\u4FEE\u6539\u6210\u529F"))})})}),S=e=>v(this,null,function*(){u.warning({title:"\u8B66\u544A",content:"\u662F\u5426\u786E\u8BA4\u5220\u9664\u6B64\u77E5\u8BC6\u70B9?",positiveText:"\u786E\u5B9A",negativeText:"\u53D6\u6D88",onPositiveClick:()=>v(this,null,function*(){console.log("row",e),(yield ie(e.id)).data&&(g(),m.success("\u5220\u9664\u6210\u529F"))})})}),_=()=>{var e;(e=d.value)==null||e.submit()},D=()=>{var e;(e=d.value)==null||e.reset()};return()=>a("div",{class:"system-menu-container"},[a("div",{class:["section-container"]},[a(Z,{ref:d,model:n,onSubmit:g,onSetModel:e=>Object.assign(n,e)},{default:()=>[a(c,{path:"search",label:"\u5173\u952E\u5B57"},{default:()=>[a(Q,{value:n.keyword,"onUpdate:value":e=>n.keyword=e,placeholder:"\u77E5\u8BC6\u7EC4\u540D\u79F0/\u7F16\u53F7",clearable:!0},null)]}),a(c,{label:"\u8BFE\u7A0B\u7C7B\u578B",path:"courseTypeCode"},{default:()=>[a(z,{clearable:!0,value:n.courseTypeCode,"onUpdate:value":e=>n.courseTypeCode=e,options:ue},null)]}),a(c,{path:"time",label:"\u65F6\u95F4"},{default:()=>[a(fe,{value:n.time,"onUpdate:value":e=>n.time=e,type:"daterange",clearable:!0},null)]}),a(c,{label:"\u72B6\u6001",path:"enableFlag"},{default:()=>[a(z,{placeholder:"\u8BF7\u9009\u62E9\u72B6\u6001",clearable:!0,value:n.enableFlag,"onUpdate:value":e=>n.enableFlag=e,options:[{label:"\u5DF2\u542F\u7528",value:1},{label:"\u672A\u542F\u7528",value:0}]},null)]}),a(c,null,{default:()=>[a(B,null,{default:()=>[a(r,{type:"primary",onClick:_},{default:()=>[s("\u641C\u7D22")]}),a(r,{type:"default",onClick:D},{default:()=>[s("\u91CD\u7F6E")]})]})]})]}),a(B,{style:{paddingBottom:"12px"}},{default:()=>[k(a(r,{type:"primary",onClick:()=>{l.visiableKnowledge=!0,l.modalType="add",l.materail=null}},{default:()=>[s("\u65B0\u589E\u77E5\u8BC6\u70B9")]}),[[C("auth"),"knowledgePoint/save1604687872153460738"]])]}),a(pe,{loading:l.loading,columns:y(),data:l.dataList,"children-key":"children","default-expand-all":!1,"row-key":e=>e.id},null),a(ee,{page:l.pagination.page,"onUpdate:page":e=>l.pagination.page=e,pageSize:l.pagination.rows,"onUpdate:pageSize":e=>l.pagination.rows=e,pageTotal:l.pagination.pageTotal,"onUpdate:pageTotal":e=>l.pagination.pageTotal=e,onList:i,sync:!0},null),a(ye,{show:l.visiableKnowledge,"onUpdate:show":e=>l.visiableKnowledge=e,preset:"dialog",showIcon:!1,title:l.modalType!=="update"?"\u65B0\u589E\u77E5\u8BC6\u70B9":"\u4FEE\u6539\u77E5\u8BC6\u70B9",style:{width:"500px"},onClose:()=>{l.materail=null}},{default:()=>[a(he,{item:l.materail,onHandleSuccess:e=>{if(e){h(e);return}console.log(e),l.visiableKnowledge=!1,i()},onClose:()=>{l.visiableKnowledge=!1,l.materail=null}},null)]})])])}});export{Ne as default};
|