選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

relatedProjectDialog.41cef984.js 3.3KB

1
  1. import{l as R}from"./renewalProjectCapitalDeclare.5736b1d4.js";import{d as B,b as O,r as m,J as T,L as I,c as r,e as J,G as z,i as l,g as w,h as a,j as b}from"./index.24398741.js";const A={class:"flex"},E={class:"flex justify-center"},G=B({name:"relatedProjectDialog"}),q=Object.assign(G,{props:{visible:{type:Boolean,default:!1,required:!0},data:Object,column:{type:Array,default:()=>[{type:"selection",reserveSelection:!0,width:"55",fixed:"left"},{label:"\u9879\u76EE\u540D\u79F0",prop:"projectName",key:"projectName"},{label:"\u9884\u7B97\u5E74\u5EA6",prop:"projectYear",key:"projectYear",width:80}]}},emits:["close","getProjectList"],setup(j,{emit:C}){const g=j,n=O({projectName:void 0,projectYear:void 0}),d=m(),k=m(0),u=m([]),y=async(s=d.value.pageParams)=>{var t;const e=await R({...s,...n});u.value=e.data.records,k.value=e.data.total,N.value=JSON.parse(JSON.stringify(i.value)),(t=N.value)!=null&&t.length&&u.value&&u.value.forEach(o=>{N.value.map(c=>c.id).includes(o.id)&&!d.value.getSelectRows().map(c=>c.id).includes(o.id)&&d.value.toggleRowSelect(o,!0)})},P=()=>{d.value.pageParams.pageNumber=1,y()},Y=()=>{n.projectName=void 0,n.projectYear=void 0,d.value.pageParams.pageNumber=1,d.value.pageParams.pageSize=10,y()},i=m([]),N=m([]),S=s=>{const e=s.map(t=>t.id);u.value.forEach(t=>{e.includes(t.id)?i.value.push(t):i.value=i.value.filter(o=>o.id!==t.id)})},V=async()=>{const s={},e=i.value.reduce((t,o)=>(s[o.id]||(s[o.id]=t.push(o)),t),[]);f("getProjectList",e),f("close",!0)},f=C;return T(()=>g.visible,async s=>{var e;s?(await I(),(e=g.data)!=null&&e.length&&(i.value=g.data.map(t=>({id:t.baseProjId,projectName:t.baseProjName,projectYear:t.baseProjSetYear}))),Y()):d.value.tableRef.clearSelection()}),(s,e)=>{const t=r("el-input"),o=r("el-form-item"),v=r("el-col"),c=r("el-date-picker"),_=r("el-button"),x=r("el-row"),h=r("el-form"),D=r("table-list"),L=r("el-dialog");return J(),z(L,{"model-value":j.visible,title:"\u9009\u62E9\u9879\u76EE",width:840,onClose:e[3]||(e[3]=p=>f("close"))},{footer:l(()=>[w("div",E,[a(_,{type:"primary",onClick:V},{default:l(()=>e[6]||(e[6]=[b("\u786E\u5B9A")])),_:1}),a(_,{onClick:e[2]||(e[2]=p=>f("close"))},{default:l(()=>e[7]||(e[7]=[b("\u53D6\u6D88")])),_:1})])]),default:l(()=>[a(h,{model:n,"label-suffix":":",size:"small"},{default:l(()=>[a(x,{gutter:16},{default:l(()=>[a(v,{span:8},{default:l(()=>[a(o,{label:"\u9879\u76EE\u540D\u79F0"},{default:l(()=>[a(t,{modelValue:n.projectName,"onUpdate:modelValue":e[0]||(e[0]=p=>n.projectName=p),placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1})]),_:1}),a(v,{span:8},{default:l(()=>[a(o,{label:"\u9879\u76EE\u9884\u7B97\u5E74\u5EA6",prop:"projectYear"},{default:l(()=>[a(c,{modelValue:n.projectYear,"onUpdate:modelValue":e[1]||(e[1]=p=>n.projectYear=p),type:"year","value-format":"YYYY",placeholder:"\u8BF7\u9009\u62E9",style:{width:"100%"}},null,8,["modelValue"])]),_:1})]),_:1}),a(v,{span:8},{default:l(()=>[a(o,{class:"btn"},{default:l(()=>[w("div",A,[a(_,{type:"primary",onClick:P},{default:l(()=>e[4]||(e[4]=[b("\u641C\u7D22")])),_:1}),a(_,{onClick:Y},{default:l(()=>e[5]||(e[5]=[b("\u91CD\u7F6E")])),_:1})])]),_:1})]),_:1})]),_:1})]),_:1},8,["model"]),a(D,{ref_key:"tableListRef",ref:d,column:j.column,data:u.value,total:k.value,"row-key":"id",onSelectionChange:S,onGetTableData:y},null,8,["column","data","total"])]),_:1},8,["model-value"])}}});export{q as default};