index-e474ed3b.js 6.5 KB

1
  1. var ee=Object.defineProperty,te=Object.defineProperties;var ae=Object.getOwnPropertyDescriptors;var $=Object.getOwnPropertySymbols;var ie=Object.prototype.hasOwnProperty,se=Object.prototype.propertyIsEnumerable;var E=(i,s,t)=>s in i?ee(i,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[s]=t,L=(i,s)=>{for(var t in s||(s={}))ie.call(s,t)&&E(i,t,s[t]);if($)for(var t of $(s))se.call(s,t)&&E(i,t,s[t]);return i},O=(i,s)=>te(i,ae(s));var r=(i,s,t)=>new Promise((f,h)=>{var w=l=>{try{d(t.next(l))}catch(y){h(y)}},x=l=>{try{d(t.throw(l))}catch(y){h(y)}},d=l=>l.done?f(l.value):Promise.resolve(l.value).then(w,x);d((t=t.apply(i,s)).next())});import{u as oe,a as le,_ as ne}from"./useTable-3abd6d70.js";import{o as re,f as I,ao as ce,_ as ue}from"./index.js";import{a as de,c as P,b as pe,_ as me,d as fe,e as _e,s as he}from"./formDrawer.vue_vue_type_script_setup_true_lang-b1d7fa00.js";import{P as ye}from"./ImportModal.vue_vue_type_style_index_0_scoped_a59c69fa_lang-1f52fa9b.js";import{I as ve}from"./ImportModal-0a643374.js";import{a as S}from"./index-b614de6b.js";import{X as be}from"./XTTab-2f7efd67.js";import{_ as ge}from"./componentMap-6df01015.js";import{u as we}from"./useForm-c3e28b04.js";import"./FormItem.vue_vue_type_script_lang-35d3ca4d.js";import{u as xe}from"./index-e473004f.js";import{u as Ce}from"./index-8cbf1e33.js";import{B as ke,a7 as j}from"./antd-ecb53b14.js";import{d as Ie,f as _,B as Se,q as De,Y as u,Z as g,_ as m,l as p,u as a,n as Te,a6 as D,a7 as T,F as B,a9 as k,E as Be,$ as N,a0 as Ne,ad as ze,a1 as Fe,a2 as Me}from"./vue-8fccce23.js";import"./useForm-19fca69f.js";import"./componentMap-16efd70f.js";import"./uuid-31b8b5a4.js";import"./useWindowSizeFn-8ad2dbf2.js";import"./onMountedOrActivated-cb072c10.js";import"./sortable.esm-4ae27e0b.js";import"./download-c6c2acd3.js";import"./index-22d6b33a.js";import"./index-3eef3423.js";import"./useFormItem-d8cab136.js";import"./useSortable-987ef813.js";import"./copyTextToClipboard-ab85e052.js";import"./TextEditor-284232fa.js";const Re=i=>(Fe("data-v-0dfdd393"),i=i(),Me(),i),Ve={class:"m-4"},$e={class:"flex justify-between"},Ee=Re(()=>m("span",null,"新增模板",-1)),Le={class:"flex items-center justify-between my-4"},Oe={class:"flex"},Pe={key:1},je={key:3},Ue=Ie({__name:"index",setup(i){const[s,{getFieldsValue:t}]=we({schemas:he,autoSubmitOnEnter:!0,size:"large",rowProps:{gutter:16}}),f=_(),h=_(""),w=_(""),x=_(),d=_(),l=_(),y=_();Se(()=>r(this,null,function*(){l.value=yield S({dictCode:"sys_disable_type"}),y.value=yield S({dictCode:"het"}),C()}));const{createMessage:z}=ce(),[U,{openDrawer:F}]=xe(),[X,{openModal:q}]=Ce(),[A,{reload:v,clearSelectedRowKeys:M}]=oe({api:de,rowKey:"id",columns:P,showIndexColumn:!1,bordered:!0,actionColumn:{width:200,title:"操作",dataIndex:"action"},beforeFetch:G});function K(e){F(!0,{record:e,isUpdate:!0})}function Y(e){e=="add"?F(!0,{isUpdate:!1,record:{}}):e=="print"?console.log("打印中..."):e=="import"&&q(!0,{title:"导入宣教"})}function Z(e){return r(this,null,function*(){console.log("🚀 ~ file: index.vue:141 ~ handleDelete ~ record",e),yield fe([e.id]),z.success("删除成功!"),yield v()})}function R(e){return r(this,null,function*(){if(e){yield _e(e.id);let n="停用成功!";e.disable===1&&(n="启用成功!"),z.success(n),M(),yield v(),yield C()}})}function G(e){return r(this,null,function*(){return x.value=O(L({},e),{title:h.value==""?void 0:h.value,status:f.value==""?void 0:f.value,type:w.value.length<=0?void 0:w.value}),x.value})}function C(){return r(this,null,function*(){d.value=yield S({dictCode:"sys_disable_type"});const e=yield pe(x.value);let n=[];d.value.forEach(b=>{let c={};Object.keys(e).forEach(o=>{b.value==o&&(c={key:b.value,label:b.label,value:e[o],hasValue:!0,prefixColor:b.prefixColor,hasBracket:!0},n.push(c))})}),n=n.reverse(),n.splice(0,0,{key:"",label:"全部",value:e.total,hasValue:!0,hasBracket:!0}),d.value=n,f.value=""})}function H(){return r(this,null,function*(){M(),yield v(),yield C()})}function J(){return r(this,null,function*(){yield v(),yield C()})}function Q(e){return r(this,null,function*(){console.log("data:::",e),f.value=e.label==="全部"?"":e.value,yield v()})}function W(){return r(this,null,function*(){w.value=t().hetType?t().hetType:"",h.value=t().searchNames?t().searchNames:"",yield v(),yield C()})}return(e,n)=>{const b=De("auth");return u(),g("div",Ve,[m("div",null,[m("div",$e,[p(a(ye),{title:"宣教模板"}),m("div",null,[Te((u(),D(a(ke),{border:!1,size:"large",type:"primary",onClick:n[0]||(n[0]=c=>Y("add"))},{icon:T(()=>[p(re,{icon:"icon-xt-add_default|iconfont",size:18,color:"#fff",class:"mr-1"})]),default:T(()=>[Ee]),_:1})),[[b,["biz:educationLibrary:add"]]])])]),m("div",Le,[p(a(be),{type:"article",width:180,selected:f.value,data:d.value,onItemClick:Q,columns:a(P)},null,8,["selected","data","columns"]),m("div",Oe,[p(a(ge),{onRegister:a(s),onFieldValueChange:W,style:{width:"450px"},class:"mr-2"},null,8,["onRegister"])])])]),p(a(ne),{onRegister:a(A)},{bodyCell:T(({column:c,record:o})=>{var V;return[c.dataIndex==="cover"?(u(),g(B,{key:0},[o.file?(u(),D(a(j),{key:0,width:80,src:(V=o.file)==null?void 0:V.absolutePath},null,8,["src"])):(u(),g("span",Pe))],64)):k("",!0),c.dataIndex==="updatorName"?(u(),g(B,{key:1},[p(a(j),{src:o.updateAvatar,style:{width:"20",height:"20px"}},null,8,["src"]),Be(" "+N(o.updatorName),1)],64)):k("",!0),c.key==="disable"?(u(),g(B,{key:2},[m("span",{class:Ne(["table-dot"]),style:ze({backgroundColor:a(I)(l.value,o.disable,"prefixColor")})},null,4),m("span",null,N(a(I)(l.value,o.disable,"label")),1)],64)):k("",!0),c.key==="type"?(u(),g("span",je,N(a(I)(y.value,o.type,"label")),1)):k("",!0),c.key==="action"?(u(),D(a(le),{key:4,actions:[{auth:"biz:educationLibrary:edit",icon:"icon-xt-details_edit_default|iconfont",tooltip:"编辑",onClick:K.bind(null,o)},{auth:"biz:education:edit",icon:"icon-tingyong-moren|iconfont",tooltip:"停用",ifShow:o.disable===0,popConfirm:{title:"是否确认停用",placement:"left",confirm:R.bind(null,o)}},{auth:"biz:education:edit",icon:"icon-xt-revocation_default|iconfont",tooltip:"启用",ifShow:o.disable===1,popConfirm:{title:"是否确认启用",placement:"left",confirm:R.bind(null,o)}},{auth:"biz:educationLibrary:remove",icon:"icon-xt-details_delete_default|iconfont",tooltip:"删除",popConfirm:{title:"是否确认删除",placement:"left",confirm:Z.bind(null,o)}}]},null,8,["actions"])):k("",!0)]}),_:1},8,["onRegister"]),p(me,{onRegister:a(U),onSuccess:J,onCancel:H},null,8,["onRegister"]),p(a(ve),{onRegister:a(X)},null,8,["onRegister"])])}}});const yt=ue(Ue,[["__scopeId","data-v-0dfdd393"]]);export{yt as default};