← Back
Editing: index198.js
import{c as e,r as a,k as t,p as s,n as o,q as r,v as l,e as d,A as i,y as m,x as u,B as p,C as c,D as n,a9 as f,a7 as j}from"./base-lib.js?v=VERSION_NUMBER";import{B as _}from"./index398.js?v=VERSION_NUMBER";import{ay as y,h8 as h,b,e as x}from"./utils-lib.js?v=VERSION_NUMBER";import{k as v}from"./useController4.js?v=VERSION_NUMBER";import"./__commonjsHelpers__.js?v=VERSION_NUMBER";import"./validator.js?v=VERSION_NUMBER";import"./index104.js?v=VERSION_NUMBER";import"./column.js?v=VERSION_NUMBER";import"./useController5.js?v=VERSION_NUMBER";import"./site.js?v=VERSION_NUMBER";import"./useStore4.js?v=VERSION_NUMBER";import"./useController6.js?v=VERSION_NUMBER";import"./useMethod5.js?v=VERSION_NUMBER";const D={class:"p-2rem"},C={class:"flex items-center"},k={key:0,class:"text-[#888] mt-[8px] ml-10rem"},w=x(e({__name:"index",props:{compData:{default:()=>{}}},emits:["close"],setup(e,{expose:x,emit:w}){const T=b(),Y=e,{rowData:g,siteType:q}=Y.compData,A=!!Array.isArray(g),{refreshSiteTable:E}=y(),M=w,S=a(),V=t({edate:g.edate||""}),B={},H=e=>e.getTime()<Date.now()-864e5,I=()=>{V.edate="",O(),U()},O=()=>{const e=document.querySelector(".date .el-input__inner");e&&(e.value="永久"),null==e||e.blur()},R=e=>{e||O()},U=async e=>{try{if(A){let e=[],a=[];g.forEach((a=>{e.push(a.id)}));const t=await h({edate:V.edate?V.edate:"0000-00-00",sites_id:e});Object.keys(t.error).forEach((e=>{a.push({name:e,status:!1})})),await t.success.forEach((e=>{a.push({name:e,status:!0})})),v({title:"批量设置到期时间",resultTitle:"设置到期时间",resultData:a}),E(),M("close")}else{let e=T.load("正在设置到期时间,请稍后...");const a=await h({id:g.id,edate:V.edate?V.edate:"0000-00-00"});a.data.status?(T.request(a),E()):T.error(a.data.msg),e.close(),M("close")}}catch(a){}};return x({onConfirm:U}),s((()=>{"0000-00-00"===g.edate&&(V.edate="",o((()=>{O()})))})),(e,a)=>{const t=_,s=n,o=f,y=j;return r(),l("div",D,[d(y,{ref_key:"formRef",ref:S,model:u(V),rules:B},{default:i((()=>[d(o,{label:"到期时间",prop:"edate"},{default:i((()=>[m("div",C,[d(t,{modelValue:u(V).edate,"onUpdate:modelValue":a[0]||(a[0]=e=>u(V).edate=e),"value-format":"YYYY-MM-DD","disabled-date":H,class:"date",onChange:R,type:"date",placeholder:"选择日期"},null,8,["modelValue"]),d(s,{type:"default",class:"!ml-[.4rem]",onClick:I},{default:i((()=>a[1]||(a[1]=[p(" 设为永久 ")]))),_:1})])])),_:1})])),_:1},8,["model"]),u(V).edate?(r(),l("div",k,"* 到期当天24点后过期")):c("",!0)])}}}),[["__scopeId","data-v-44808119"]]);export{w as default};
Save File
Cancel