Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

2 строки
3.7KB

  1. import{ah as F,ai as P,r as c,J as H,c as n,a2 as I,e as i,G as m,i as t,h as o,j as f,w as K,t as p,f as g,k as D,g as O,E as L}from"./index.a2494fc2.js";const Q={key:0},W={key:0},X=["onClick"],Z=["onClick"],ee={class:"text-right w-full mt-8"},te="\u5173\u8054\u8FD0\u7EF4\u5305",le={__name:"operationDialog",props:{modelValue:{},modelModifiers:{},selectProjectList:{type:Array,defult:[]},selectProjectListModifiers:{}},emits:F(["relevanceSuccess"],["update:modelValue","update:selectProjectList"]),setup(b,{emit:Y}){const u=P(b,"modelValue"),T=P(b,"selectProjectList"),V=c(),s=c(!1),w=c(!1),y=c(!1);let _;function j(a){_=a}const k=c([]),C=Y;function $(a){if(!a.name){L({message:"\u8FD0\u7EF4\u5305\u540D\u79F0",type:"warning"});return}if(!a.year){L({message:"\u8BF7\u9009\u62E9\u9884\u7B97\u5E74\u5EA6",type:"warning"});return}s.value=!0,setTimeout(function(){s.value=!1},1e3),a.edit=!1}function M(){k.value.push({year:"",name:"",edit:!0})}function U(){console.log(_),console.log(T.value),w.value=!0,setTimeout(function(){w.value=!1},1e3),u.value=!1,C("relevanceSuccess")}function B(){y.value=!0,setTimeout(function(){y.value=!1},1e3),u.value=!1,C("relevanceSuccess")}function h(){u.value=!1,_=void 0,console.log(_)}H(()=>u.value,async a=>{a&&await N()});async function N(){s.value=!0;const a=await S();k.value=a.data,s.value=!1}function S(){return new Promise(a=>{setTimeout(()=>{a({data:[{year:"2016",name:"Tom"},{year:"2016",name:"Tom"}]})},1e3)})}return(a,l)=>{const E=n("el-radio"),r=n("el-table-column"),A=n("el-input"),x=n("el-form-item"),G=n("el-date-picker"),J=n("el-table"),v=n("el-button"),R=n("el-form"),q=n("el-dialog"),z=I("loading");return i(),m(q,{"model-value":u.value,title:te,width:"700","destroy-on-close":"",onClose:h},{footer:t(()=>[o(v,{onClick:h},{default:t(()=>l[3]||(l[3]=[f(" \u5173\u95ED ")])),_:1}),o(v,{type:"danger",disabled:s.value,loading:y.value,onClick:B},{default:t(()=>l[4]||(l[4]=[f(" \u53D6\u6D88\u6240\u6709\u5173\u8054 ")])),_:1},8,["disabled","loading"]),o(v,{disabled:s.value,type:"primary",loading:w.value,onClick:U},{default:t(()=>l[5]||(l[5]=[f(" \u786E\u8BA4\u5173\u8054 ")])),_:1},8,["disabled","loading"])]),default:t(()=>[K((i(),m(R,null,{default:t(()=>[o(J,{data:k.value,style:{width:"100%"}},{default:t(()=>[o(r,{prop:"index",width:"50"},{default:t(e=>[(i(),m(E,{key:e.$index,modelValue:V.value,"onUpdate:modelValue":l[0]||(l[0]=d=>V.value=d),value:e.$index,disabled:e.row.edit,onChange:d=>j(e.row)},null,8,["modelValue","value","disabled","onChange"]))]),_:1}),o(r,{prop:"index",label:"\u5E8F\u53F7",width:"60"},{default:t(e=>[f(p(e.$index+1),1)]),_:1}),o(r,{prop:"date",label:"\u8FD0\u7EF4\u5305\u540D\u79F0",width:"180"},{default:t(e=>[e.row.edit?(i(),m(x,{key:1},{default:t(()=>[o(A,{modelValue:e.row.name,"onUpdate:modelValue":d=>e.row.name=d},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024)):(i(),g("div",Q,p(e.row.name),1))]),_:1}),o(r,{prop:"name",label:"\u9884\u7B97\u5E74\u5EA6",width:"250"},{default:t(e=>[e.row.edit?D("",!0):(i(),g("div",W,p(e.row.year),1)),e.row.edit?(i(),m(x,{key:1,prop:"year"},{default:t(()=>[o(G,{modelValue:e.row.year,"onUpdate:modelValue":d=>e.row.year=d,type:"year",placeholder:"\u8BF7\u9009\u62E9",format:"YYYY","value-format":"YYYY"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024)):D("",!0)]),_:1}),o(r,{prop:"address",label:"\u64CD\u4F5C",width:"120"},{default:t(e=>[e.row.edit?(i(),g("a",{key:1,onClick:d=>$(e.row)},"\u4FDD\u5B58",8,Z)):(i(),g("a",{key:0,onClick:d=>e.row.edit=!0},"\u7F16\u8F91"+p(e.row.data),9,X))]),_:1})]),_:1},8,["data"]),O("p",ee,[o(v,{type:"primary",class:"w-full",plain:"",icon:"Plus",onClick:l[1]||(l[1]=()=>M())},{default:t(()=>l[2]||(l[2]=[f("\u6DFB\u52A0 ")])),_:1})])]),_:1})),[[z,s.value]])]),_:1},8,["model-value"])}}};export{le as default};