niucloud-admin/niucloud/public/admin/assets/edit-article-9e04f0e0.js
全栈小学生 26524c4bf5 update admin
2023-08-12 16:21:13 +08:00

2 lines
6.6 KiB
JavaScript

import{d as F,r as x,R as L,V as $,e as v,f as O,Q as _,u as e,g as s,B as d,y as o,x as n,A as f,n as G,v as V,H,h as M,F as Q}from"./base-04829be5.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./el-tooltip-4ed993c7.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import{v as g}from"./index-30df2c14.js";import{t as a}from"./index-043d021e.js";import{u as q}from"./diy-9ea654fa.js";import{f as J}from"./storage-1a3ddb14.js";import{j as K}from"./article-082cb1c5.js";import{E as W,b as X}from"./index-1cbf3455.js";import{a as Y,E as Z}from"./index-6bd50bb5.js";import{E as ee}from"./index-cc473227.js";import{E as te}from"./index-7e933ae4.js";import{a as oe,E as le}from"./index-ed9a1afd.js";import{E as ae}from"./index-c4af56cf.js";import{E as ie}from"./index-1808e3f9.js";import{E as ne}from"./index-eb678249.js";import{E as re}from"./index-b1557f8a.js";import{E as se}from"./index-869e0480.js";import{v as me}from"./directive-013f0a4e.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 l=q();l.editComponent.ignore=[],l.editComponent.verify=m=>{var t={code:!0,message:""};return l.value[m].sources==="diy"&&l.value[m].articleIds.length===0&&(t.code=!1,t.message=a("selectArticleTip")),t};const u=x(!1),z=()=>{u.value=!0},r=L({page:1,limit:10,total:0,loading:!0,data:[],searchParam:{title:"",category_id:"",is_show:1}}),b=(m=1)=>{r.loading=!0,r.page=m,K({page:r.page,limit:r.limit,...r.searchParam}).then(t=>{r.loading=!1,r.data=t.data.data,r.total=t.data.total}).catch(()=>{r.loading=!1})};b();const h=x([]),R=m=>{h.value=m},T=()=>{l.editComponent.articleIds=[],h.value.forEach(m=>{l.editComponent.articleIds.push(m.id)}),u.value=!1};return S({}),(m,t)=>{const y=W,k=X,p=Y,C=ee,I=$("ArrowRight"),A=te,w=Z,c=oe,B=ae,D=le,U=ie,E=ne,P=re,N=se,j=me;return v(),O(Q,null,[_(s("div",de,[s("div",pe,[s("h3",ce,d(e(a)("articleData")),1),o(w,{"label-width":"80px",class:"px-[10px]"},{default:n(()=>[o(p,{label:e(a)("dataSources")},{default:n(()=>[o(k,{modelValue:e(l).editComponent.sources,"onUpdate:modelValue":t[0]||(t[0]=i=>e(l).editComponent.sources=i)},{default:n(()=>[o(y,{label:"initial"},{default:n(()=>[f(d(e(a)("defaultSources")),1)]),_:1}),o(y,{label:"diy"},{default:n(()=>[f(d(e(a)("manualSelectionSources")),1)]),_:1})]),_:1},8,["modelValue"])]),_:1},8,["label"]),_(o(p,{label:e(a)("articleNum")},{default:n(()=>[o(C,{modelValue:e(l).editComponent.count,"onUpdate:modelValue":t[1]||(t[1]=i=>e(l).editComponent.count=i),"show-input":"",size:"small",class:"ml-[10px] article-slider",min:1,max:30},null,8,["modelValue"])]),_:1},8,["label"]),[[g,e(l).editComponent.sources=="initial"]]),_(o(p,{label:e(a)("manualSelectionSources"),class:"flex"},{default:n(()=>[s("span",{onClick:z,class:G(["cursor-pointer flex-1",{"text-primary":e(l).editComponent.articleIds.length>0}])},d(e(l).editComponent.articleIds.length>0?e(a)("selected")+e(l).editComponent.articleIds.length+e(a)("piece"):e(a)("selectPlaceholder")),3),o(A,null,{default:n(()=>[o(I)]),_:1})]),_:1},8,["label"]),[[g,e(l).editComponent.sources=="diy"]])]),_:1})]),o(P,{modelValue:u.value,"onUpdate:modelValue":t[6]||(t[6]=i=>u.value=i),title:e(a)("selectArticleTips"),width:"60%","close-on-press-escape":!1,"close-on-click-modal":!1},{footer:n(()=>[s("span",_e,[o(E,{onClick:t[5]||(t[5]=i=>u.value=!1)},{default:n(()=>[f(d(e(a)("cancel")),1)]),_:1}),o(E,{type:"primary",onClick:T},{default:n(()=>[f(d(e(a)("confirm")),1)]),_:1})])]),default:n(()=>[s("div",null,[_((v(),V(D,{data:r.data,size:"large",onSelectionChange:R},{empty:n(()=>[s("span",null,d(r.loading?"":e(a)("emptyData")),1)]),default:n(()=>[o(c,{type:"selection",width:"55"}),o(c,{prop:"title","show-overflow-tooltip":!0,label:e(a)("articleTitle"),width:"140"},null,8,["label"]),o(c,{label:e(a)("articleImage"),"min-width":"120",align:"center"},{default:n(({row:i})=>[i.image?(v(),V(B,{key:0,class:"w-12 h-12",src:e(J)(i.image),fit:"contain"},null,8,["src"])):H("",!0)]),_:1},8,["label"]),o(c,{prop:"category_name",label:e(a)("articleCategoryName"),align:"center","min-width":"140"},null,8,["label"]),o(c,{prop:"summary",label:e(a)("articleSummary"),width:"180","show-overflow-tooltip":!0},null,8,["label"]),o(c,{label:e(a)("createTime"),"min-width":"180",align:"center"},{default:n(({row:i})=>[f(d(i.create_time||""),1)]),_:1},8,["label"])]),_:1},8,["data"])),[[j,r.loading]]),s("div",ue,[o(U,{"current-page":r.page,"onUpdate:currentPage":t[2]||(t[2]=i=>r.page=i),"page-size":r.limit,"onUpdate:pageSize":t[3]||(t[3]=i=>r.limit=i),layout:"total, sizes, prev, pager, next, jumper",total:r.total,onSizeChange:t[4]||(t[4]=i=>b()),onCurrentChange:b},null,8,["current-page","page-size","total"])])])]),_:1},8,["modelValue","title"])],512),[[g,e(l).editTab=="content"]]),_(s("div",fe,[s("div",ge,[s("h3",be,d(e(a)("articleStyle")),1),o(w,{"label-width":"80px",class:"px-[10px]"},{default:n(()=>[o(p,{label:e(a)("articleBgColor")},{default:n(()=>[o(N,{modelValue:e(l).editComponent.elementBgColor,"onUpdate:modelValue":t[7]||(t[7]=i=>e(l).editComponent.elementBgColor=i),"show-alpha":"",predefine:e(l).predefineColors},null,8,["modelValue","predefine"])]),_:1},8,["label"]),o(p,{label:e(a)("topRounded")},{default:n(()=>[o(C,{modelValue:e(l).editComponent.topElementRounded,"onUpdate:modelValue":t[8]||(t[8]=i=>e(l).editComponent.topElementRounded=i),"show-input":"",size:"small",class:"ml-[10px] graphic-nav-slider",max:50},null,8,["modelValue"])]),_:1},8,["label"]),o(p,{label:e(a)("bottomRounded")},{default:n(()=>[o(C,{modelValue:e(l).editComponent.bottomElementRounded,"onUpdate:modelValue":t[9]||(t[9]=i=>e(l).editComponent.bottomElementRounded=i),"show-input":"",size:"small",class:"ml-[10px] graphic-nav-slider",max:50},null,8,["modelValue"])]),_:1},8,["label"])]),_:1})]),M(m.$slots,"style")],512),[[g,e(l).editTab=="style"]])],64)}}});const at=Object.freeze(Object.defineProperty({__proto__:null,default:Ce},Symbol.toStringTag,{value:"Module"}));export{at as _};