index.df20dfd7.js 6.8 KB

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