zdy-component
Version:
2 lines (1 loc) • 6.08 kB
JavaScript
(function(i,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(i=typeof globalThis<"u"?globalThis:i||self,e(i["zd-vin-package"]={},i.Vue))})(this,function(i,e){"use strict";const y={__name:"zd-button",props:{list:{type:Array,default:()=>[]},loading:{type:Boolean,default:!1},importUrl:{type:String,default:""},url:{type:String,default:""},templateUrl:{type:String,default:""}},emits:["add","edit","remove","assign","import","export","upFile","sub-examine","revoke","examine","pring","closing","handover","warehousing"],setup(d,{emit:p}){const{proxy:r}=e.getCurrentInstance();e.ref(!1);const l=d;e.provide("url",l.url);const o=p,g=e.ref(!1);e.watchEffect(()=>l.list,()=>{},{deep:!0}),e.computed(()=>l.list);const h=async()=>{await r.DelMessageBox("是否删除所选的数据?")&&o("remove")},D=async()=>{await r.DelMessageBox("是否提交审核该数据?")&&o("sub-examine")};e.watch(()=>l.templateUrl,k=>{l.list.find(n=>n.type=="import")},{deef:!0,immediate:!0});const V=()=>{if(!l.importUrl){r.errorMsg("p-button组件:请传入“importUrl”,导入接口!");return}g.value=!0};return(k,n)=>{const a=e.resolveComponent("el-button"),c=e.resolveComponent("el-col"),S=e.resolveComponent("el-row"),s=e.resolveDirective("hasPermi");return e.openBlock(),e.createBlock(S,{gutter:10,class:"mb8"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.list,(t,N)=>(e.openBlock(),e.createElementBlock("div",{key:`${N}${t.disabled}`},[t.type=="add"?(e.openBlock(),e.createBlock(c,{key:0,span:1.5},{default:e.withCtx(()=>[e.withDirectives((e.openBlock(),e.createBlock(a,{type:"primary",plain:"",icon:"Plus",onClick:n[0]||(n[0]=f=>o("add"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label||"新增"),1)]),_:2},1024)),[[s,[t.hasPermi]]])]),_:2},1024)):e.createCommentVNode("",!0),t.type=="edit"?(e.openBlock(),e.createBlock(c,{key:1,span:1.5},{default:e.withCtx(()=>[e.withDirectives((e.openBlock(),e.createBlock(a,{type:"primary",plain:"",icon:"Edit",disabled:t.disabled,onClick:n[1]||(n[1]=f=>o("edit"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label||"修改"),1)]),_:2},1032,["disabled"])),[[s,[t.hasPermi]]])]),_:2},1024)):e.createCommentVNode("",!0),t.type=="remove"?(e.openBlock(),e.createBlock(c,{key:2,span:1.5},{default:e.withCtx(()=>[e.withDirectives((e.openBlock(),e.createBlock(a,{type:"danger",plain:"",icon:"Delete",disabled:t.disabled,onClick:h},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label||"批量删除"),1)]),_:2},1032,["disabled"])),[[s,[t.hasPermi]]])]),_:2},1024)):e.createCommentVNode("",!0),t.type=="import"?(e.openBlock(),e.createBlock(c,{key:3,span:1.5},{default:e.withCtx(()=>[e.withDirectives((e.openBlock(),e.createBlock(a,{type:"info",plain:"",icon:"Upload",onClick:V},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label||"导入"),1)]),_:2},1024)),[[s,[t.hasPermi]]])]),_:2},1024)):e.createCommentVNode("",!0),t.type=="export"?(e.openBlock(),e.createBlock(c,{key:4,span:1.5},{default:e.withCtx(()=>[e.withDirectives((e.openBlock(),e.createBlock(a,{type:"warning",plain:"",icon:"Download",onClick:n[2]||(n[2]=f=>o("export"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label||"导出"),1)]),_:2},1024)),[[s,[t.hasPermi]]])]),_:2},1024)):e.createCommentVNode("",!0),t.type=="提交审核"?(e.openBlock(),e.createBlock(c,{key:5,span:1.5},{default:e.withCtx(()=>[e.withDirectives((e.openBlock(),e.createBlock(a,{type:"warning",plain:"",icon:"Pointer",disabled:t.disabled,onClick:D},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label||"提交审核"),1)]),_:2},1032,["disabled"])),[[s,[t.hasPermi]]])]),_:2},1024)):e.createCommentVNode("",!0),t.type=="审核"?(e.openBlock(),e.createBlock(c,{key:6,span:1.5},{default:e.withCtx(()=>[e.withDirectives((e.openBlock(),e.createBlock(a,{type:"warning",plain:"",icon:"View",disabled:t.disabled,onClick:n[3]||(n[3]=f=>o("examine"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label||"审核"),1)]),_:2},1032,["disabled"])),[[s,[t.hasPermi]]])]),_:2},1024)):e.createCommentVNode("",!0),t.type=="关结"?(e.openBlock(),e.createBlock(c,{key:7,span:1.5},{default:e.withCtx(()=>[e.withDirectives((e.openBlock(),e.createBlock(a,{type:"primary",plain:"",icon:"View",disabled:t.disabled,onClick:n[4]||(n[4]=f=>o("closing"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label||"关结"),1)]),_:2},1032,["disabled"])),[[s,[t.hasPermi]]])]),_:2},1024)):e.createCommentVNode("",!0),t.type=="自定义"?(e.openBlock(),e.createBlock(c,{key:8,span:1.5},{default:e.withCtx(()=>[e.withDirectives((e.openBlock(),e.createBlock(a,{type:t.btnType||"primary",plain:"",icon:t.icon,disabled:t.disabled,onClick:f=>o(t.emit)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label||"自定义"),1)]),_:2},1032,["type","icon","disabled","onClick"])),[[s,[t.hasPermi]]])]),_:2},1024)):e.createCommentVNode("",!0)]))),128))]),_:1})}}},_=Object.freeze(Object.defineProperty({__proto__:null,default:y},Symbol.toStringTag,{value:"Module"})),B=(d,p)=>{const r=d.__vccOpts||d;for(const[l,o]of p)r[l]=o;return r},b={class:"title"},m=B({__name:"zd-title",props:{title:{type:String,defalut:""}},emits:[],setup(d,{emit:p}){const r=d;return(l,o)=>(e.openBlock(),e.createElementBlock("div",b,[o[0]||(o[0]=e.createElementVNode("div",{class:"flag"},null,-1)),e.createElementVNode("div",null,e.toDisplayString(r.title),1)]))}},[["__scopeId","data-v-d6c12e3d"]]),x=Object.freeze(Object.defineProperty({__proto__:null,default:m},Symbol.toStringTag,{value:"Module"})),C=Object.assign({"./zd-vin/zd-button.vue":()=>Promise.resolve().then(()=>_),"./zd-vin/zd-title.vue":()=>Promise.resolve().then(()=>x)}),w=d=>{for(const[p,r]of Object.entries(C)){const l=p.slice(p.lastIndexOf("/")+1,p.lastIndexOf("."));d.component(l,e.defineAsyncComponent(r))}};i.ZdButton=y,i.ZdTitle=m,i.default=w,Object.defineProperties(i,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});