index.727fda.js 2.4 KB

1
  1. import{aT as l,ac as E,_ as F,d as A,w as p,r as v,o as B,G as P,C as x,j as f,l as g,aN as m}from"./index.js";import w from"./modal.82c577.js";import{u as y}from"./use-page-search.f7bc460e.js";import"./index.da6d65fd.js";const{VITE_PROXY_DOMAIN_REAL:Y,VITE_PROXY_USER_REAL:$}=E(),i=$+"/admin/",S=e=>l.request("post",`${i}golpricelast`,{data:e}),U=e=>l.request("post",`${i}golpriceedit`,{data:e}),k=e=>l.request("post",`${i}goldpricecreate`,{data:e}),q=e=>l.request("post",`${i}usestatus`,{data:e}),N=e=>l.request("post",`${i}goldpricedelect`,{data:e}),O=[{prop:"type_cn",label:"\u8D35\u91D1\u5C5E\u79CD\u7C7B"},{prop:"price",label:"\u5F53\u524D\u91D1\u4EF7(\u5143/g)"},{prop:"action_name",label:"\u521B\u5EFA\u4EBA"},{prop:"addtime",label:"\u521B\u5EFA\u65F6\u95F4",width:"100px"},{prop:"",label:"\u64CD\u4F5C",fixed:"right",width:"100px",slot:"operation"}],R={title:"\u8D35\u91D1\u5C5E\u5B9E\u65F6\u91D1\u4EF7",columns:O,statusListProp:"canOrder",apis:{httpList:S,httpStatus:q,httpAdd:!0,httpUpdate:!0,httpDelete:N}},I=[{value:"1",label:"18K"},{value:"2",label:"24K"},{value:"3",label:"\u767D\u94F6"}],_={formItems:[{field:"type",type:"select",placeholder:"\u8D35\u91D1\u5C5E\u79CD\u7C7B",options:I}]},L=A({__name:"index",setup(e){const C="goldPrice",d=p(null),c=p(!1),s=p(!1),r=p({}),h={pageSearchHook:()=>y(void 0,void 0,_)},D={content:{create:()=>{c.value=!1,s.value=!0},preview:u=>{const{type:t,price:a}=u;r.value={type:t,price:a},c.value=!0,s.value=!0},update:u=>{const{type:t,price:a}=u;r.value={type:t,price:a},c.value=!1,s.value=!0}}};async function b(){const{type:u,price:t,id:a}=r.value,n=a===void 0||!a,o={type:u,price:t};n&&delete o.id,(await(n?k:U)(o)).code===0?(s.value=!1,m.success(`${n?"\u6DFB\u52A0":"\u66F4\u65B0"}\u6210\u529F`),d.value.onSearch()):m.warning(`${n?"\u6DFB\u52A0":"\u66F4\u65B0"}\u5931\u8D25`)}return(u,t)=>{const a=v("PageContainer"),n=v("PageAuth");return B(),P(n,{pageName:C},{default:x(()=>[f(a,{hooks:h,events:D,contentConfig:g(R),"search-config":g(_),"get-content-ref":o=>d.value=o},null,8,["contentConfig","search-config","get-content-ref"]),f(w,{visible:s.value,"onUpdate:visible":t[0]||(t[0]=o=>s.value=o),data:r.value,"onUpdate:data":t[1]||(t[1]=o=>r.value=o),disabled:c.value,onSubmit:b},null,8,["visible","data","disabled"])]),_:1})}}});var G=F(L,[["__file","C:/Users/Administrator/Desktop/projects/purchase-vue3/src/views/serviceParam/goldPrice/index.vue"]]);export{G as default};