1 |
- var z=Object.defineProperty,B=Object.defineProperties;var K=Object.getOwnPropertyDescriptors;var x=Object.getOwnPropertySymbols;var q=Object.prototype.hasOwnProperty,$=Object.prototype.propertyIsEnumerable;var F=(s,o,l)=>o in s?z(s,o,{enumerable:!0,configurable:!0,writable:!0,value:l}):s[o]=l,h=(s,o)=>{for(var l in o||(o={}))q.call(o,l)&&F(s,l,o[l]);if(x)for(var l of x(o))$.call(o,l)&&F(s,l,o[l]);return s},_=(s,o)=>B(s,K(o));var m=(s,o,l)=>new Promise((c,a)=>{var n=r=>{try{p(l.next(r))}catch(d){a(d)}},u=r=>{try{p(l.throw(r))}catch(d){a(d)}},p=r=>r.done?c(r.value):Promise.resolve(r.value).then(n,u);p((l=l.apply(s,o)).next())});import{S as A}from"./index.d94a0a15.js";import{P as G}from"./index.26daa043.js";import{w as j,x as I,y as T,z as V,A as O}from"./api.ca55ae14.js";import{d as N,u as E,r as w,a as S,B as U,i as t,q as X,ac as H,_ as D,a9 as v,p as g,k as f,ai as J,l as b,ce as Q,cg as W,aa as Y,ch as Z}from"./index.6cd81b67.js";import{N as M}from"./FormItemGridItem.a2c5798b.js";import"./searchs.b637f0d6.js";const ee=N({name:"music-calligraphy-edit",props:{editMode:{type:String,required:!0},rowData:{type:Object,required:!1}},emits:["close","getList"],setup(s,{slots:o,attrs:l,emit:c}){E();const a=w(!1),n=S({name:null,url:null}),u=w(),p=S({rowData:null,musicSheetCategories:[]});U(()=>m(this,null,function*(){p.rowData=s.rowData,s.editMode=="edit"&&s.rowData&&(n.name=p.rowData.name,n.url=p.rowData.url)}));const r=()=>m(this,null,function*(){u.value.validate(d=>m(this,null,function*(){if(d)return!1;a.value=!0;try{let i;s.editMode=="add"?i=yield j(h({},n)):i=yield I(_(h({},n),{id:p.rowData.id})),i&&i.code===200&&(c("close"),c("getList"))}catch(i){}a.value=!1}))});return()=>t("div",{style:"background: #fff; padding-top: 12px"},[t(X,{ref:u,labelPlacement:"top",model:n,"label-placement":"left","label-width":"100"},{default:()=>[t(H,{cols:1},{default:()=>[t(M,{label:"\u8C03\u53F7",path:"name",rule:[{required:!0,message:"\u8BF7\u8F93\u5165\u8C03\u53F7"}]},{default:()=>[t(D,{value:n.name,"onUpdate:value":d=>n.name=d,placeholder:"\u8BF7\u8F93\u5165\u8C03\u53F7",clearable:!0},null)]}),t(M,{label:"\u8FDE\u63A5\u5730\u5740",path:"url",rule:[{required:!0,message:"\u8BF7\u8F93\u5165\u8FDE\u63A5\u5730\u5740"}]},{default:()=>[t(D,{value:n.url,"onUpdate:value":d=>n.url=d,placeholder:"\u8BF7\u8F93\u5165\u5E73\u53F0\u6807\u8BC6",clearable:!0},null)]})]})]}),t(v,{justify:"end"},{default:()=>[t(g,{onClick:()=>c("close")},{default:()=>[f("\u53D6\u6D88")]}),t(g,{type:"primary",onClick:r,loading:a.value,disabled:a.value},{default:()=>[f("\u4FDD\u5B58")]})]})])}}),re=N({name:"music-calligraphy",setup(s,{emit:o}){const l=J(),c=E(),a=S({loading:!1,pagination:{page:1,rows:10,pageTotal:0},searchForm:{keyword:null,status:null},showEdit:!1,editMode:"add",dataList:[],rowData:null}),n=()=>[{type:"selection"},{title:"\u7F16\u53F7",key:"id"},{title:"\u8C03\u53F7",key:"name"},{title:"\u8FDE\u63A5\u5730\u5740",key:"url"},{title:"\u66F4\u65B0\u4EBA",key:"updateName"},{title:"\u66F4\u65B0\u65F6\u95F4",key:"updateTime"},{title:"\u6D88\u606F\u72B6\u6001",key:"status",render(e){return t(Z,{type:e.status?"primary":"default"},{default:()=>[e.status?"\u542F\u7528":"\u505C\u7528"]})}},{title:"\u64CD\u4F5C",key:"operation",fixed:"right",width:"300px",render(e){return t(v,null,{default:()=>[t(g,{type:"primary",size:"small",text:!0,onClick:()=>{a.showEdit=!0,a.editMode="edit",a.rowData=e}},{default:()=>[f("\u4FEE\u6539")]}),t(g,{type:"primary",size:"small",text:!0,onClick:()=>p(e)},{default:()=>[e.status?"\u505C\u7528":"\u542F\u7528"]}),t(g,{type:"primary",size:"small",text:!0,disabled:!!e.status,onClick:()=>d(e)},{default:()=>[f("\u5220\u9664")]})]})}}],u=w([]),p=e=>{const y=e.status?"\u505C\u7528":"\u542F\u7528";l.warning({title:"\u63D0\u793A",content:`\u662F\u5426${y}\uFF1F`,positiveText:"\u786E\u5B9A",negativeText:"\u53D6\u6D88",onPositiveClick:()=>m(this,null,function*(){try{yield T({ids:new Array(e.id),status:!e.status}),i(),c.success(`${y}\u6210\u529F`)}catch(C){}})})},r=e=>{const y=u.value.length;y==0&&c.warning("\u672A\u9009\u62E9\u6570\u636E");const C=e?"\u542F\u7528":"\u505C\u7528";l.warning({title:"\u63D0\u793A",content:`\u662F\u5426${C}`+y+"\u6761\u6570\u636E\uFF1F",positiveText:"\u786E\u5B9A",negativeText:"\u53D6\u6D88",onPositiveClick:()=>m(this,null,function*(){try{yield T({ids:u.value,status:e}),i(),c.success(`${C}\u6210\u529F`)}catch(ae){}})})},d=e=>{l.warning({title:"\u63D0\u793A",content:`\u5220\u9664"${e.name}"\uFF0C\u662F\u5426\u7EE7\u7EED\uFF1F`,positiveText:"\u786E\u5B9A",negativeText:"\u53D6\u6D88",onPositiveClick:()=>m(this,null,function*(){try{yield O(e.id),i(),c.success("\u5220\u9664\u6210\u529F")}catch(y){}})})},i=()=>m(this,null,function*(){try{a.loading=!0;const{data:e}=yield V(h(h({},a.pagination),a.searchForm));a.pagination.pageTotal=Number(e.total),a.dataList=e.rows||[]}catch(e){}a.loading=!1}),k=w(),L=()=>{a.pagination.page=1,i()},R=()=>{var e;u.value=[],(e=k.value)==null||e.submit()},P=()=>{var e;(e=k.value)==null||e.reset()};return U(()=>m(this,null,function*(){a.loading=!0,i()})),()=>t("div",{class:"system-menu-container"},[t(A,{ref:k,model:a.searchForm,onSubmit:L,saveKey:"music-calligraphy",onSetModel:e=>a.searchForm=e},{default:()=>[t(b,{label:"\u5173\u952E\u8BCD",path:"keyword"},{default:()=>[t(D,{placeholder:"\u8BF7\u8F93\u5165\u7F16\u53F7/\u8C03\u53F7",value:a.searchForm.keyword,"onUpdate:value":e=>a.searchForm.keyword=e,clearable:!0},null)]}),t(b,{label:"\u72B6\u6001",path:"status"},{default:()=>[t(Q,{placeholder:"\u8BF7\u9009\u62E9\u591A\u58F0\u8F68\u6E32\u67D3",value:a.searchForm.status,"onUpdate:value":e=>a.searchForm.status=e,options:[{label:"\u662F",value:!0},{label:"\u5426",value:!1}],clearable:!0},null)]}),t(b,null,{default:()=>[t(v,null,{default:()=>[t(g,{type:"primary",onClick:R},{default:()=>[f("\u641C\u7D22")]}),t(g,{type:"default",onClick:P},{default:()=>[f("\u91CD\u7F6E")]})]})]})]}),t("div",{class:["section-container"]},[t(v,{style:{paddingBottom:"12px"}},{default:()=>[t(g,{type:"primary",onClick:()=>{a.showEdit=!0,a.editMode="add"}},{default:()=>[f("\u65B0\u589E")]}),t(g,{disabled:u.value.length==0,onClick:()=>{r(!1)}},{default:()=>[f("\u6279\u91CF\u505C\u7528")]}),t(g,{disabled:u.value.length==0,onClick:()=>{r(!0)}},{default:()=>[f("\u6279\u91CF\u542F\u7528")]})]}),t(W,{loading:a.loading,columns:n(),data:a.dataList,rowKey:e=>e.id,checkedRowKeys:u.value,"onUpdate:checkedRowKeys":e=>u.value=e,scrollX:"1200"},null),t(G,{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:i,sync:!0,saveKey:"music-list"},null)]),t(Y,{blockScroll:!0,show:a.showEdit,"onUpdate:show":e=>a.showEdit=e,preset:"dialog",showIcon:!1,title:a.editMode=="add"?"\u65B0\u589E":"\u4FEE\u6539",style:{width:"500px"}},{default:()=>[t(ee,{rowData:a.rowData,editMode:a.editMode,onClose:()=>a.showEdit=!1,onGetList:i},null)]})])}});export{re as default};
|