mirror of
https://gitee.com/niucloud-team/niucloud-admin.git
synced 2025-12-30 10:10:16 +00:00
2 lines
6.3 KiB
JavaScript
2 lines
6.3 KiB
JavaScript
import{g as F,r as x,a4 as L,aa as $,m as v,n as G,a1 as _,u as e,q as r,L as d,F as l,E as i,K as f,v as O,D as V,T as q,t as K,I as M,G as H}from"./base-45eb5090.js";/* empty css */import{d as J}from"./index-341914e3.js";/* empty css *//* empty css */import{E as Q}from"./el-overlay-616d6124.js";/* empty css *//* empty css *//* empty css *//* empty css */import"./el-tooltip-58212670.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import{E as W,b as X}from"./el-radio-2719e44c.js";import{v as g}from"./event-4977bef7.js";import{t as a}from"./index-047041cb.js";import{u as Y}from"./diy-0b3a8b2e.js";import{d as Z}from"./storage-4159d1ed.js";import{j as ee}from"./article-4af479a6.js";import{a as te,E as le}from"./index-c4fd4c9d.js";import{E as oe}from"./index-913f64d7.js";import{a as ae,E as ne}from"./index-cbbcd330.js";import{E as ie}from"./index-da8a1336.js";import{E as se}from"./index-e841b684.js";import{E as re}from"./index-25c37860.js";import{v as me}from"./directive-9f485fe5.js";const de={class:"content-wrap"},pe={class:"edit-attr-item-wrap"},ce={class:"mb-[10px]"},ue={class:"mt-[16px] flex justify-end"},_e={class:"dialog-footer"},fe={class:"style-wrap"},ge={class:"edit-attr-item-wrap"},be={class:"mb-[10px]"},Ce=F({__name:"edit-article",setup(ve,{expose:S}){const o=Y();o.editComponent.ignore=[],o.editComponent.verify=m=>{var t={code:!0,message:""};return o.value[m].sources==="diy"&&o.value[m].articleIds.length===0&&(t.code=!1,t.message=a("selectArticleTip")),t};const u=x(!1),T=()=>{u.value=!0},s=L({page:1,limit:10,total:0,loading:!0,data:[],searchParam:{title:"",category_id:"",is_show:1}}),b=(m=1)=>{s.loading=!0,s.page=m,ee({page:s.page,limit:s.limit,...s.searchParam}).then(t=>{s.loading=!1,s.data=t.data.data,s.total=t.data.total}).catch(()=>{s.loading=!1})};b();const h=x([]),z=m=>{h.value=m},I=()=>{o.editComponent.articleIds=[],h.value.forEach(m=>{o.editComponent.articleIds.push(m.id)}),u.value=!1};return S({}),(m,t)=>{const w=W,k=X,p=te,C=oe,R=$("ArrowRight"),D=H,y=le,c=ae,A=ie,B=ne,U=se,E=re,P=Q,N=J,j=me;return v(),G(M,null,[_(r("div",de,[r("div",pe,[r("h3",ce,d(e(a)("articleData")),1),l(y,{"label-width":"80px",class:"px-[10px]"},{default:i(()=>[l(p,{label:e(a)("dataSources")},{default:i(()=>[l(k,{modelValue:e(o).editComponent.sources,"onUpdate:modelValue":t[0]||(t[0]=n=>e(o).editComponent.sources=n)},{default:i(()=>[l(w,{label:"initial"},{default:i(()=>[f(d(e(a)("defaultSources")),1)]),_:1}),l(w,{label:"diy"},{default:i(()=>[f(d(e(a)("manualSelectionSources")),1)]),_:1})]),_:1},8,["modelValue"])]),_:1},8,["label"]),_(l(p,{label:e(a)("articleNum")},{default:i(()=>[l(C,{modelValue:e(o).editComponent.count,"onUpdate:modelValue":t[1]||(t[1]=n=>e(o).editComponent.count=n),"show-input":"",size:"small",class:"ml-[10px] article-slider",min:1,max:30},null,8,["modelValue"])]),_:1},8,["label"]),[[g,e(o).editComponent.sources=="initial"]]),_(l(p,{label:e(a)("manualSelectionSources"),class:"flex"},{default:i(()=>[r("span",{onClick:T,class:O(["cursor-pointer flex-1",{"text-primary":e(o).editComponent.articleIds.length>0}])},d(e(o).editComponent.articleIds.length>0?e(a)("selected")+e(o).editComponent.articleIds.length+e(a)("piece"):e(a)("selectPlaceholder")),3),l(D,null,{default:i(()=>[l(R)]),_:1})]),_:1},8,["label"]),[[g,e(o).editComponent.sources=="diy"]])]),_:1})]),l(P,{modelValue:u.value,"onUpdate:modelValue":t[6]||(t[6]=n=>u.value=n),title:e(a)("selectArticleTips"),width:"60%","close-on-press-escape":!1,"close-on-click-modal":!1},{footer:i(()=>[r("span",_e,[l(E,{onClick:t[5]||(t[5]=n=>u.value=!1)},{default:i(()=>[f(d(e(a)("cancel")),1)]),_:1}),l(E,{type:"primary",onClick:I},{default:i(()=>[f(d(e(a)("confirm")),1)]),_:1})])]),default:i(()=>[r("div",null,[_((v(),V(B,{data:s.data,size:"large",onSelectionChange:z},{empty:i(()=>[r("span",null,d(s.loading?"":e(a)("emptyData")),1)]),default:i(()=>[l(c,{type:"selection",width:"55"}),l(c,{prop:"title","show-overflow-tooltip":!0,label:e(a)("articleTitle"),width:"140"},null,8,["label"]),l(c,{label:e(a)("articleImage"),"min-width":"120",align:"center"},{default:i(({row:n})=>[n.image?(v(),V(A,{key:0,class:"w-12 h-12",src:e(Z)(n.image),fit:"contain"},null,8,["src"])):q("",!0)]),_:1},8,["label"]),l(c,{prop:"category_name",label:e(a)("articleCategoryName"),align:"center","min-width":"140"},null,8,["label"]),l(c,{prop:"summary",label:e(a)("articleSummary"),width:"180","show-overflow-tooltip":!0},null,8,["label"]),l(c,{label:e(a)("createTime"),"min-width":"180",align:"center"},{default:i(({row:n})=>[f(d(n.create_time||""),1)]),_:1},8,["label"])]),_:1},8,["data"])),[[j,s.loading]]),r("div",ue,[l(U,{"current-page":s.page,"onUpdate:currentPage":t[2]||(t[2]=n=>s.page=n),"page-size":s.limit,"onUpdate:pageSize":t[3]||(t[3]=n=>s.limit=n),layout:"total, sizes, prev, pager, next, jumper",total:s.total,onSizeChange:t[4]||(t[4]=n=>b()),onCurrentChange:b},null,8,["current-page","page-size","total"])])])]),_:1},8,["modelValue","title"])],512),[[g,e(o).editTab=="content"]]),_(r("div",fe,[r("div",ge,[r("h3",be,d(e(a)("articleStyle")),1),l(y,{"label-width":"80px",class:"px-[10px]"},{default:i(()=>[l(p,{label:e(a)("articleBgColor")},{default:i(()=>[l(N,{modelValue:e(o).editComponent.elementBgColor,"onUpdate:modelValue":t[7]||(t[7]=n=>e(o).editComponent.elementBgColor=n),"show-alpha":"",predefine:e(o).predefineColors},null,8,["modelValue","predefine"])]),_:1},8,["label"]),l(p,{label:e(a)("topRounded")},{default:i(()=>[l(C,{modelValue:e(o).editComponent.topElementRounded,"onUpdate:modelValue":t[8]||(t[8]=n=>e(o).editComponent.topElementRounded=n),"show-input":"",size:"small",class:"ml-[10px] graphic-nav-slider",max:50},null,8,["modelValue"])]),_:1},8,["label"]),l(p,{label:e(a)("bottomRounded")},{default:i(()=>[l(C,{modelValue:e(o).editComponent.bottomElementRounded,"onUpdate:modelValue":t[9]||(t[9]=n=>e(o).editComponent.bottomElementRounded=n),"show-input":"",size:"small",class:"ml-[10px] graphic-nav-slider",max:50},null,8,["modelValue"])]),_:1},8,["label"])]),_:1})]),K(m.$slots,"style")],512),[[g,e(o).editTab=="style"]])],64)}}});const We=Object.freeze(Object.defineProperty({__proto__:null,default:Ce},Symbol.toStringTag,{value:"Module"}));export{We as _};
|