You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
6.9 KiB
JavaScript

import{z as q,A as z,G as H,F as M,w as Q,H as Z,K as J,N as W,O as X,P as oo}from"./element-plus.54d22a26.js";import{_ as eo}from"./index.vue_vue_type_script_setup_true_lang.c4ca5dc1.js";import{_ as to}from"./index.vue_vue_type_script_setup_true_lang.00a5f88e.js";import{l as lo,f as ao,b as uo}from"./index.73351f2d.js";import{u as no}from"./usePaging.63ca32b2.js";import{_ as io,a as po,b as so}from"./edit.vue_vue_type_script_setup_true_name_shopGiftsEdit_lang.7239cb3d.js";import"./lodash.e8662b6c.js";import{d as N,s as ro,r as x,Z as mo,am as co,o as n,c as g,U as o,L as l,u as t,T,a9 as I,K as s,R as m,M as y,a as K,j as fo,Q as _o,n as A}from"./@vue.90bde458.js";import"./lodash-es.151604d4.js";import"./async-validator.fb49d0f5.js";import"./@vueuse.c9321399.js";import"./@element-plus.637a59d4.js";import"./dayjs.75ab1bbe.js";import"./axios.71c4c5b2.js";import"./@ctrl.b082b0c1.js";import"./normalize-wheel-es.8aeb3683.js";import"./@popperjs.36402333.js";import"./vue-router.1051b4fa.js";import"./pinia.8db5076b.js";import"./css-color-function.7400b82e.js";import"./color.be84bc95.js";import"./clone.ec2f9c3f.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./ms.564e106c.js";import"./nprogress.8f68f559.js";import"./vue-clipboard3.053a92aa.js";import"./clipboard.9dddce66.js";import"./echarts.5016c48c.js";import"./zrender.58d022a1.js";import"./tslib.60310f1a.js";import"./highlight.js.31cd7941.js";import"./@highlightjs.f76f30bc.js";import"./index.206a3348.js";const bo={class:"mt-4"},yo={class:"flex mt-4 justify-end"},vo=N({name:"shopGiftsLists"}),te=N({...vo,setup(wo){const v=ro(),w=x(!1),i=mo({commodityType:"",productKey:"",productIdentifying:"",buyCondition:""}),E=x([]),$=p=>{E.value=p.map(({id:u})=>u)},{dictData:c}=lo("shopgift_type,buy_condition"),{pager:f,getLists:C,resetParams:P,resetPage:S}=no({fetchFun:so,params:i}),L=async()=>{var p;w.value=!0,await A(),(p=v.value)==null||p.open("add")},U=async p=>{var u,r;w.value=!0,await A(),(u=v.value)==null||u.open("edit"),(r=v.value)==null||r.setFormData(p)},B=async p=>{await ao.confirm("\u786E\u5B9A\u8981\u5220\u9664\uFF1F"),await po({id:p}),C()};return C(),(p,u)=>{const r=q,F=z,_=H,k=M,d=Q,R=Z,D=J,G=uo,a=W,V=to,O=X,Y=eo,h=co("perms"),j=oo;return n(),g("div",null,[o(D,{class:"!border-none mb-4",shadow:"never"},{default:l(()=>[o(R,{class:"mb-[-16px]",model:t(i),inline:""},{default:l(()=>[o(_,{label:"\u793C\u5305\u7C7B\u578B",prop:"commodityType"},{default:l(()=>[o(F,{class:"!w-[280px]",modelValue:t(i).commodityType,"onUpdate:modelValue":u[0]||(u[0]=e=>t(i).commodityType=e),clearable:"",placeholder:"\u8BF7\u9009\u62E9\u793C\u5305\u7C7B\u578B"},{default:l(()=>[o(r,{label:"\u5168\u90E8",value:""}),(n(!0),g(T,null,I(t(c).shopgift_type,(e,b)=>(n(),s(r,{key:b,label:e.name,value:e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),o(_,{label:"\u4EA7\u54C1KEY",prop:"productKey"},{default:l(()=>[o(k,{class:"w-[280px]",modelValue:t(i).productKey,"onUpdate:modelValue":u[1]||(u[1]=e=>t(i).productKey=e),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u4EA7\u54C1KEY"},null,8,["modelValue"])]),_:1}),o(_,{label:"\u793C\u5305ID",prop:"productIdentifying"},{default:l(()=>[o(k,{class:"w-[280px]",modelValue:t(i).productIdentifying,"onUpdate:modelValue":u[2]||(u[2]=e=>t(i).productIdentifying=e),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u793C\u5305ID"},null,8,["modelValue"])]),_:1}),o(_,{label:"\u9650\u5236\u6761\u4EF6",prop:"buyCondition"},{default:l(()=>[o(F,{class:"!w-[280px]",modelValue:t(i).buyCondition,"onUpdate:modelValue":u[3]||(u[3]=e=>t(i).buyCondition=e),clearable:"",placeholder:"\u8BF7\u9009\u62E9\u9650\u5236\u6761\u4EF6"},{default:l(()=>[o(r,{label:"\u5168\u90E8",value:""}),(n(!0),g(T,null,I(t(c).buy_condition,(e,b)=>(n(),s(r,{key:b,label:e.name,value:e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),o(_,null,{default:l(()=>[o(d,{type:"primary",onClick:t(S)},{default:l(()=>[m("\u67E5\u8BE2")]),_:1},8,["onClick"]),o(d,{onClick:t(P)},{default:l(()=>[m("\u91CD\u7F6E")]),_:1},8,["onClick"])]),_:1})]),_:1},8,["model"])]),_:1}),y((n(),s(D,{class:"!border-none",shadow:"never"},{default:l(()=>[y((n(),s(d,{type:"primary",onClick:L},{icon:l(()=>[o(G,{name:"el-icon-Plus"})]),default:l(()=>[m(" \u65B0\u589E ")]),_:1})),[[h,["config.shopgifts/add"]]]),y((n(),s(d,{disabled:!t(E).length,onClick:u[4]||(u[4]=e=>B(t(E)))},{default:l(()=>[m(" \u5220\u9664 ")]),_:1},8,["disabled"])),[[h,["config.shopgifts/delete"]]]),K("div",bo,[o(O,{data:t(f).lists,onSelectionChange:$},{default:l(()=>[o(a,{type:"selection",width:"55"}),o(a,{label:"\u4E3B\u952E",prop:"id","show-overflow-tooltip":""}),o(a,{label:"\u793C\u5305\u7C7B\u578B",prop:"commodityType"},{default:l(({row:e})=>[o(V,{options:t(c).shopgift_type,value:e.commodityType},null,8,["options","value"])]),_:1}),o(a,{label:"\u4EF7\u683C",prop:"commodityPrice","show-overflow-tooltip":""}),o(a,{label:"KEY",prop:"key","show-overflow-tooltip":""}),o(a,{label:"\u793C\u5305\u8BF4\u660E",prop:"productDes","show-overflow-tooltip":""}),o(a,{label:"\u4EA7\u54C1KEY",prop:"productKey","show-overflow-tooltip":""}),o(a,{label:"\u6210\u529F\u6587\u672C",prop:"supplementaryOrderTips","show-overflow-tooltip":""}),o(a,{label:"\u663E\u793A\u5929\u6570",prop:"showDay","show-overflow-tooltip":""}),o(a,{label:"\u591A\u8BED\u8A00\u5305\u6587\u672C",prop:"giftBagName","show-overflow-tooltip":""}),o(a,{label:"\u793C\u5305ID",prop:"productIdentifying","show-overflow-tooltip":""}),o(a,{label:"ICON",prop:"giftIcon","show-overflow-tooltip":""}),o(a,{label:"\u9650\u5236\u6761\u4EF6",prop:"buyCondition"},{default:l(({row:e})=>[o(V,{options:t(c).buy_condition,value:e.buyCondition},null,8,["options","value"])]),_:1}),o(a,{label:"\u8D2D\u4E70\u4E0A\u9650",prop:"buyNum","show-overflow-tooltip":""}),o(a,{label:"\u5956\u54C1\u7C7B\u578B",prop:"rewardType","show-overflow-tooltip":""}),o(a,{label:"\u5956\u54C1\u6570\u503C",prop:"rewardNum","show-overflow-tooltip":""}),o(a,{label:"\u6298\u6263",prop:"discount","show-overflow-tooltip":""}),o(a,{label:"\u8FD4\u5229",prop:"rebate","show-overflow-tooltip":""}),o(a,{label:"\u6269\u5C55\u5B57\u6BB5",prop:"extend","show-overflow-tooltip":""}),o(a,{label:"\u64CD\u4F5C",width:"120",fixed:"right"},{default:l(({row:e})=>[y((n(),s(d,{type:"primary",link:"",onClick:b=>U(e)},{default:l(()=>[m(" \u7F16\u8F91 ")]),_:2},1032,["onClick"])),[[h,["config.shopgifts/edit"]]]),y((n(),s(d,{type:"danger",link:"",onClick:b=>B(e.id)},{default:l(()=>[m(" \u5220\u9664 ")]),_:2},1032,["onClick"])),[[h,["config.shopgifts/delete"]]])]),_:1})]),_:1},8,["data"])]),K("div",yo,[o(Y,{modelValue:t(f),"onUpdate:modelValue":u[5]||(u[5]=e=>fo(f)?f.value=e:null),onChange:t(C)},null,8,["modelValue","onChange"])])]),_:1})),[[j,t(f).loading]]),t(w)?(n(),s(io,{key:0,ref_key:"editRef",ref:v,"dict-data":t(c),onSuccess:t(C),onClose:u[6]||(u[6]=e=>w.value=!1)},null,8,["dict-data","onSuccess"])):_o("",!0)])}}});export{te as default};