mirror of
https://gitee.com/niucloud-team/niucloud-admin.git
synced 2026-01-02 03:08:12 +00:00
2 lines
4.4 KiB
JavaScript
2 lines
4.4 KiB
JavaScript
import{d as O,r as _,l as M,X as P,h,m as U,w as p,a as s,e as v,i as S,c as y,F as X,T as q,n as $,t as A,aN as F,B as G,aF as b,u as H,O as m,E as J,S as K,p as Q,g as W}from"./index-f99f26c5.js";/* empty css *//* empty css *//* empty css */import{d as Y,s as Z,c as I}from"./diy-ba9878e3.js";import{_ as ee}from"./edit-theme.vue_vue_type_script_setup_true_lang-742c68e4.js";import{_ as te}from"./_plugin-vue_export-helper-c27b6911.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]"},ie=["onClick"],ae=["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=O({__name:"theme-list",emits:["confirm"],setup(d,{expose:B,emit:k}){const w=_(),i=_(!1);let a=!1;const t=M({title:"",id:"",theme:{},default_theme:{},new_theme:[],addon_title:"",key:""}),u=_([]),x=(e,o="")=>{I({addon:e.key}).then(n=>{u.value=n.data||[],o&&o(n.data[n.data.length-1])})},g=_(""),D=e=>{g.value=e.id,x(e),a=!1,t.title=e.title,t.id=e.id,t.theme=e.theme,t.addon_title=e.addon_title,t.key=e.key,i.value=!0},E=P(()=>`选择${t.addon_title}配色`),N=(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)},j=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 R=e=>{if(c)return!1;c=!0;const o=e.id;Y(o).then(n=>{x(t),c=!1}).catch(()=>{c=!1})},z=()=>{if(a)return;a=!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,Z(e).then(o=>{a=!1,i.value=!1,k("confirm")}).catch(()=>{a=!1})},T=()=>{i.value=!1,k("confirm")};return B({dialogThemeVisible:i,open:D}),(e,o)=>{const n=J,r=K;return h(),U(r,{modelValue:i.value,"onUpdate:modelValue":o[3]||(o[3]=l=>i.value=l),title:H(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=>z())},{default:p(()=>[S("确定")]),_:1})])]),default:p(()=>[s("div",oe,[s("div",le,[(h(!0),y(X,null,q(u.value,(l,L)=>(h(),y("div",{key:L,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=>N(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}])},A(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:F(V=>R(l),["stop"])},null,8,ie)):G("",!0),s("span",{class:"nc-iconfont nc-icon-bianjiV6xx1 !text-[14px] text-[#999] ml-[5px]",onClick:F(V=>C("edit",l),["stop"])},null,8,ae)])]),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(ee,{ref_key:"editThemeRef",ref:w,onConfirm:j},null,512)]),_:1},8,["modelValue","title"])}}});const be=te(ye,[["__scopeId","data-v-d03cbb32"]]),$e=Object.freeze(Object.defineProperty({__proto__:null,default:be},Symbol.toStringTag,{value:"Module"}));export{$e as _,be as t};
|