mirror of
https://gitee.com/niucloud-team/niucloud-admin.git
synced 2026-01-03 19:58:12 +00:00
2 lines
4.4 KiB
JavaScript
2 lines
4.4 KiB
JavaScript
import{d as L,r as _,l as M,X as H,h,m as P,w as p,a as s,e as v,i as S,c as y,F as U,T as X,n as $,t as q,aO as B,B as A,aH as b,u as G,O as m,E as J,S as K,p as Q,g as W,_ as Y}from"./index-9f163f98.js";/* empty css *//* empty css *//* empty css */import{d as Z,s as I,c as ee}from"./diy-3042ded9.js";import{_ as te}from"./edit-theme.vue_vue_type_script_setup_true_lang-75cea0d7.js";const f=d=>(Q("data-v-d03cbb32"),d=d(),W(),d),oe={class:"flex flex-col items-baseline"},le={class:"flex items-center flex-wrap max-h-[365px] overflow-auto [&>:nth-child(3n)]:mr-0"},ne=["onClick"],se={class:"flex justify-between pb-[5px]"},ae=["onClick"],ie=["onClick"],de={class:"flex"},ce=f(()=>s("span",null,"主色调",-1)),re=[ce],_e={class:"flex flex-col"},he=f(()=>s("span",null,"辅色",-1)),pe=[he],me=f(()=>s("span",null,"配色",-1)),fe=[me],ue=f(()=>s("span",{class:"text-[14px] text-[var(--el-color-primary)]"},"新增配色",-1)),xe=[ue],ve={class:"dialog-footer"},ye=L({__name:"theme-list",emits:["confirm"],setup(d,{expose:D,emit:k}){const w=_(),a=_(!1);let i=!1;const t=M({title:"",id:"",theme:{},default_theme:{},new_theme:[],addon_title:"",key:""}),u=_([]),x=(e,o="")=>{ee({addon:e.key}).then(n=>{u.value=n.data||[],o&&o(n.data[n.data.length-1])})},g=_(""),F=e=>{g.value=e.id,x(e),i=!1,t.title=e.title,t.id=e.id,t.theme=e.theme,t.addon_title=e.addon_title,t.key=e.key,a.value=!0},E=H(()=>`选择${t.addon_title}配色`),j=(e={})=>{t.title=e.title,t.id=e.id,t.theme=e.theme,t.default_theme=e.default_theme,t.new_theme=e.new_theme},C=(e="add",o={})=>{const n={default_theme:{},theme:{},title:"",id:"",new_theme:[],key:"",theme_field:""};e=="edit"&&(n.title=o.title,n.theme=m(o.theme)||{},n.id=o.id,n.default_theme=m(o.default_theme)||"",n.new_theme=m(o.new_theme)||[],n.new_theme=m(o.new_theme)||[]),n.key=t.key,u.value.forEach((r,l)=>{r.id==t.id&&(n.theme_field=r.theme_field)}),w.value.open(n)},N=e=>{x(t,o=>{t.new_theme=e.new_theme,t.theme=e.theme,t.title=e.title,t.id=e.id||o.id})};let c=!1;const O=e=>{if(c)return!1;c=!0;const o=e.id;Z(o).then(n=>{x(t),c=!1}).catch(()=>{c=!1})},R=()=>{if(i)return;i=!0;const e={};e.addon=t.key,e.id=t.id,e.title=t.title,e.theme=t.theme,e.new_theme=t.new_theme,I(e).then(o=>{i=!1,a.value=!1,k("confirm")}).catch(()=>{i=!1})},T=()=>{a.value=!1,k("confirm")};return D({dialogThemeVisible:a,open:F}),(e,o)=>{const n=J,r=K;return h(),P(r,{modelValue:a.value,"onUpdate:modelValue":o[3]||(o[3]=l=>a.value=l),title:G(E),width:"535px","align-center":"",class:"custom-theme-dialog",onClose:T},{footer:p(()=>[s("div",ve,[v(n,{onClick:o[1]||(o[1]=l=>T())},{default:p(()=>[S("取消")]),_:1}),v(n,{type:"primary",onClick:o[2]||(o[2]=l=>R())},{default:p(()=>[S("确定")]),_:1})])]),default:p(()=>[s("div",oe,[s("div",le,[(h(!0),y(U,null,X(u.value,(l,z)=>(h(),y("div",{key:z,class:$(["flex flex-col border-[1px] border-solid border-[#dcdee2] rounded-[4px] px-[10px] pt-[10px] pb-[15px] mr-[10px] cursor-pointer my-[5px]",{"!border-[var(--el-color-primary)]":t.id==l.id}]),onClick:V=>j(l)},[s("div",se,[s("div",{class:$(["text-[14px] text-[#666] max-w-[85px] whitespace-nowrap overflow-hidden text-ellipsis",{"!text-[#333]":t.id==l.id}])},q(l.title),3),s("div",null,[t.id!=l.id&&l.theme_type!="default"&&g.value!=l.id?(h(),y("span",{key:0,class:"iconfont iconshanchu-fanggaiV6xx !text-[14px] text-[#999]",onClick:B(V=>O(l),["stop"])},null,8,ae)):A("",!0),s("span",{class:"nc-iconfont nc-icon-bianjiV6xx1 !text-[14px] text-[#999] ml-[5px]",onClick:B(V=>C("edit",l),["stop"])},null,8,ie)])]),s("div",de,[s("div",{class:"w-[70px] h-[54px] pl-[7px] pt-[9px] flex flex-col mr-[4px] rounded-[4px] text-[10px] leading-[1] text-[#fff]",style:b({backgroundColor:l.theme["--primary-color"]})},re,4),s("div",_e,[s("div",{class:"secod-color-item mb-[4px]",style:b({backgroundColor:l.theme["--primary-help-color2"]})},pe,4),s("div",{class:"secod-color-item",style:b({backgroundColor:l.theme["--primary-color-dark"]})},fe,4)])])],10,ne))),128))]),s("div",{class:"flex items-center border-[1px] border-solid border-[var(--el-color-primary)] rounded-[2px] h-[32px] px-[15px] cursor-pointer mt-[15px]",onClick:o[0]||(o[0]=l=>C())},xe)]),v(te,{ref_key:"editThemeRef",ref:w,onConfirm:N},null,512)]),_:1},8,["modelValue","title"])}}});const be=Y(ye,[["__scopeId","data-v-d03cbb32"]]),Se=Object.freeze(Object.defineProperty({__proto__:null,default:be},Symbol.toStringTag,{value:"Module"}));export{Se as _,be as t};
|