default.86fd4980.js 1.9 KB

1
  1. import{_ as g,d as k,x as p,A as x,r,o as h,G as y,D as t,h as i,l as e,bJ as C,m as d,M as F,aQ as D}from"./index.js";import{R as w}from"./global.9ad647c8.js";const b={status:[{required:!0,trigger:"change",message:"\u8BF7\u9009\u62E9\u5BA1\u6838\u72B6\u6001"}],remark:[{required:!0,trigger:"change",message:"\u8BF7\u8F93\u5165\u5907\u6CE8"}]},N={flex:"","flex-col":"",style:{width:"50%"}},R={class:"w-full flex justify-end"},j=k({__name:"default",props:{approveValue:{type:String,required:!0},rejectValue:{type:String,required:!0}},emits:["approval"],setup(o,{emit:v}){const _=o,c=p(null),u=p({status:"",remark:""}),m=p({...b});async function E(){var l;try{await((l=c.value)==null?void 0:l.validate()),v("approval",d(u))}catch{}}return x(()=>u.value,({status:l})=>{m.value.remark[0].required=l===_.rejectValue},{deep:!0}),(l,a)=>{const f=r("ElOption"),B=r("ElSelect"),s=r("ElFormItem"),V=r("ElInput"),A=r("ElButton");return h(),y(d(D),{ref_key:"formRef",ref:c,model:u.value,rules:m.value,"label-width":"100px"},{default:t(()=>[i("div",N,[e(s,{label:"\u5BA1\u6838\u72B6\u6001",prop:"status"},{default:t(()=>[e(B,{placeholder:"\u8BF7\u9009\u62E9\u5BA1\u6838\u72B6\u6001",modelValue:u.value.status,"onUpdate:modelValue":a[0]||(a[0]=n=>u.value.status=n)},{default:t(()=>[e(f,{value:o.approveValue,label:"\u901A\u8FC7"},null,8,["value"]),e(f,{value:o.rejectValue,label:"\u9A73\u56DE"},null,8,["value"])]),_:1},8,["modelValue"])]),_:1}),e(s,{label:"\u5907\u6CE8",prop:"remark"},{default:t(()=>[e(V,C({rows:5,type:"textarea",placeholder:"\u8BF7\u8F93\u5165\u5907\u6CE8",modelValue:u.value.remark,"onUpdate:modelValue":a[1]||(a[1]=n=>u.value.remark=n)},d(w)),null,16,["modelValue"])]),_:1})]),e(s,null,{default:t(()=>[i("div",R,[e(A,{type:"primary",onClick:E},{default:t(()=>[F(" \u63D0\u4EA4\u5BA1\u6838\u7ED3\u679C ")]),_:1})])]),_:1})]),_:1},8,["model","rules"])}}});var S=g(j,[["__file","C:/Users/89793/Desktop/projects/settle-vue3/src/components/ApprovalNode/src/default.vue"]]);export{S as D};