ling-yun-custom-components 0.0.55 → 0.0.56

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/es/AppIntro.mjs CHANGED
@@ -5,7 +5,7 @@ import { IconLook as J } from "color-message-lingyun-vue";
5
5
  import { C as H } from "./chunks/layout.DXw3haOP.js";
6
6
  import { C as K } from "./chunks/layout.BKJPyxR8.js";
7
7
  import { _ as V } from "./chunks/_plugin-vue_export-helper.CHgC5LLL.js";
8
- import { pageParams as Q, emitsMap as b } from "ling-yun-methods";
8
+ import { pageParams as Q, emitsMap as D } from "ling-yun-methods";
9
9
  import './assets/AppIntro.css';const t = {
10
10
  LISTING: 1,
11
11
  // 上架申请
@@ -15,7 +15,7 @@ import './assets/AppIntro.css';const t = {
15
15
  // 上线应用
16
16
  OFFLINE: 4
17
17
  // 下线应用
18
- }, k = {
18
+ }, b = {
19
19
  PENDING: 0,
20
20
  // 待审核
21
21
  APPROVED: 1,
@@ -37,16 +37,16 @@ import './assets/AppIntro.css';const t = {
37
37
  [t.DELISTING]: "下架申请",
38
38
  [t.ONLINE]: "上线应用",
39
39
  [t.OFFLINE]: "下线应用"
40
- }, D = {
41
- [k.PENDING]: {
40
+ }, k = {
41
+ [b.PENDING]: {
42
42
  type: "warning",
43
43
  text: "待审核"
44
44
  },
45
- [k.APPROVED]: {
45
+ [b.APPROVED]: {
46
46
  type: "primary",
47
47
  text: "已通过"
48
48
  },
49
- [k.REJECTED]: {
49
+ [b.REJECTED]: {
50
50
  type: "danger",
51
51
  text: "已驳回"
52
52
  }
@@ -259,7 +259,7 @@ import './assets/AppIntro.css';const t = {
259
259
  }, 8, ["modelValue"])
260
260
  ]));
261
261
  }
262
- }, pe = /* @__PURE__ */ V(ce, [["__scopeId", "data-v-f5af90d9"]]), me = { class: "flex items-center flex-gap-row-nowrap-8 mg-b-12" }, fe = {
262
+ }, pe = /* @__PURE__ */ V(ce, [["__scopeId", "data-v-7bb24f99"]]), me = { class: "flex items-center flex-gap-row-nowrap-8 mg-b-12" }, fe = {
263
263
  class: "fz-14 weight-500",
264
264
  style: { color: "#1d2129" }
265
265
  }, ye = {
@@ -329,12 +329,12 @@ import './assets/AppIntro.css';const t = {
329
329
  d("div", me, [
330
330
  d("span", fe, h(o(W)[s.operationType] || "--"), 1),
331
331
  I(s.operationType) ? (l(), i(v, { key: 0 }, [
332
- o(D)[s.auditStatus] ? (l(), N(o(z), {
332
+ o(k)[s.auditStatus] ? (l(), N(o(z), {
333
333
  key: 0,
334
- type: o(D)[s.auditStatus].type
334
+ type: o(k)[s.auditStatus].type
335
335
  }, {
336
336
  default: p(() => [
337
- L(h(o(D)[s.auditStatus].text), 1)
337
+ L(h(o(k)[s.auditStatus].text), 1)
338
338
  ]),
339
339
  _: 2
340
340
  }, 1032, ["type"])) : f("", !0)
@@ -403,13 +403,13 @@ import './assets/AppIntro.css';const t = {
403
403
  }
404
404
  }
405
405
  },
406
- emits: [b.tabChange],
406
+ emits: [D.tabChange],
407
407
  setup(a, { emit: u }) {
408
408
  const y = u, I = g(w.INTRO), E = R(() => [
409
409
  { label: "应用介绍", value: w.INTRO },
410
410
  { label: "迭代时间轴", value: w.TIMELINE }
411
411
  ]), T = (r) => {
412
- y(b.tabChange, r);
412
+ y(D.tabChange, r);
413
413
  };
414
414
  return (r, e) => (l(), i("div", ve, [
415
415
  d("div", Te, [
@@ -1,27 +1,28 @@
1
1
  import { w as Be } from "./chunks/index.bCzIhWFw.js";
2
- import { useSlots as Ee, computed as m, ref as h, watch as oe, onMounted as Re, nextTick as ze, createElementBlock as E, openBlock as y, createElementVNode as S, createCommentVNode as R, unref as v, renderSlot as I, Fragment as Ne, createBlock as re, withCtx as j, createTextVNode as de, toDisplayString as Pe, createVNode as U, createSlots as Ae, renderList as We, normalizeProps as _e, guardReactiveProps as De, h as H } from "vue";
2
+ import { useSlots as Ee, computed as m, ref as h, watch as oe, onMounted as Re, nextTick as ze, createElementBlock as E, openBlock as y, createElementVNode as S, createCommentVNode as R, unref as v, renderSlot as I, Fragment as Ne, createBlock as re, withCtx as j, createTextVNode as de, toDisplayString as Pe, createVNode as U, createSlots as Ae, renderList as We, normalizeProps as De, guardReactiveProps as _e, h as H } from "vue";
3
3
  import { ElButton as ce, ElAutoResizer as Ie, ElTableV2 as je, ElCheckbox as Oe } from "element-plus";
4
4
  import { emitsMap as fe, paginationConfig as qe } from "ling-yun-methods";
5
5
  import { calculateScale as Ke } from "color-star-custom-methods";
6
6
  import { _ as Fe } from "./chunks/layout.BzQrppiO.js";
7
- import { _ as Ve } from "./chunks/_plugin-vue_export-helper.CHgC5LLL.js";
8
- import './assets/PaginationTable.css';const $e = { class: "flex h-full flex-col" }, Le = {
7
+ import { cloneDeep as Ve } from "lodash";
8
+ import { _ as $e } from "./chunks/_plugin-vue_export-helper.CHgC5LLL.js";
9
+ import './assets/PaginationTable.css';const Le = { class: "flex h-full flex-col" }, Me = {
9
10
  class: "w-full flex justify-between overflow-hidden",
10
11
  style: { height: "auto" }
11
- }, Me = {
12
+ }, Ue = {
12
13
  key: 0,
13
14
  class: "flex-1 overflow-hidden"
14
- }, Ue = {
15
+ }, He = {
15
16
  class: "flex",
16
17
  style: { width: "auto", gap: "10px" }
17
- }, He = {
18
+ }, Ge = {
18
19
  key: 1,
19
20
  class: "flex items-center mg-b-18"
20
- }, Ge = { class: "fz-12 text-74798c" }, Je = { class: "btn-group mg-l-12" }, Qe = { class: "w-full flex-1 overflow-hidden flex flex-col" }, Xe = { class: "flex-1 overflow-hidden TABLE-AREA" }, Ye = {
21
+ }, Je = { class: "fz-12 text-74798c" }, Qe = { class: "btn-group mg-l-12" }, Xe = { class: "w-full flex-1 overflow-hidden flex flex-col" }, Ye = { class: "flex-1 overflow-hidden TABLE-AREA" }, Ze = {
21
22
  key: 0,
22
23
  class: "flex justify-end mg-t-20",
23
24
  style: { height: "auto" }
24
- }, Ze = /* @__PURE__ */ Object.assign({
25
+ }, et = /* @__PURE__ */ Object.assign({
25
26
  name: "PaginationTable"
26
27
  }, {
27
28
  __name: "layout",
@@ -281,7 +282,7 @@ import './assets/PaginationTable.css';const $e = { class: "flex h-full flex-col"
281
282
  }, se = (e) => {
282
283
  e === "size" && (r.value[f.value] = 1), B(), x(fe.paginationChange, r.value);
283
284
  }, P = h(0), A = () => {
284
- let e = P.value, t = [...u.columns];
285
+ let e = P.value, t = Ve(u.columns);
285
286
  const l = 1 / Ke(), a = t.filter((n) => n.fixedWidth), s = t.filter((n) => !n.fixedWidth);
286
287
  let o = 0;
287
288
  a.forEach((n) => {
@@ -293,17 +294,17 @@ import './assets/PaginationTable.css';const $e = { class: "flex h-full flex-col"
293
294
  });
294
295
  const ue = [];
295
296
  if (t.forEach((n, W) => {
296
- let _;
297
+ let D;
297
298
  if (n.fixedWidth)
298
- _ = n.width || 100;
299
+ D = n.width || 100;
299
300
  else if (n.width && L > 0) {
300
- const D = n.width / L, M = c * D;
301
- _ = Math.max(M, n.width);
301
+ const _ = n.width / L, M = c * _;
302
+ D = Math.max(M, n.width);
302
303
  } else {
303
- const D = s.filter((M) => !M.width);
304
- _ = D.length > 0 ? c / D.length : c / s.length;
304
+ const _ = s.filter((M) => !M.width);
305
+ D = _.length > 0 ? c / _.length : c / s.length;
305
306
  }
306
- ue.push(_);
307
+ ue.push(D);
307
308
  }), t = t.map((n, W) => (n.width = ue[W] * l, w.value && Object.keys(w.value).length && w.value[n.key] && (n.sortable = !0), n)), T.value) {
308
309
  const n = g.value.find((W) => W.key === "selection");
309
310
  n && (g.value = [n, ...t]);
@@ -335,21 +336,21 @@ import './assets/PaginationTable.css';const $e = { class: "flex h-full flex-col"
335
336
  initBatchSelect: we,
336
337
  handleCancelSelect: V,
337
338
  handleResize: ie
338
- }), (e, t) => (y(), E("div", $e, [
339
- S("div", Le, [
340
- v(O)["filter-left"] ? (y(), E("div", Me, [
339
+ }), (e, t) => (y(), E("div", Le, [
340
+ S("div", Me, [
341
+ v(O)["filter-left"] ? (y(), E("div", Ue, [
341
342
  I(e.$slots, "filter-left", {}, void 0, !0)
342
343
  ])) : R("", !0),
343
- S("div", Ue, [
344
+ S("div", He, [
344
345
  p.hasBatchSelect && d.value.length ? (y(), E(Ne, { key: 0 }, [
345
- T.value ? (y(), E("div", He, [
346
- S("div", Ge, "已选" + Pe(i.value.length) + "条数据", 1),
346
+ T.value ? (y(), E("div", Ge, [
347
+ S("div", Je, "已选" + Pe(i.value.length) + "条数据", 1),
347
348
  S("div", {
348
349
  class: "fz-12 text-3b64ff mg-l-4 pointer",
349
350
  onClick: V
350
351
  }, "取消选择"),
351
352
  I(e.$slots, "btn-group", {}, () => [
352
- S("div", Je, [
353
+ S("div", Qe, [
353
354
  U(v(ce), {
354
355
  type: "danger",
355
356
  onClick: xe,
@@ -376,8 +377,8 @@ import './assets/PaginationTable.css';const $e = { class: "flex h-full flex-col"
376
377
  v(O)["filter-right"] ? I(e.$slots, "filter-right", { key: 1 }, void 0, !0) : R("", !0)
377
378
  ])
378
379
  ]),
379
- S("div", Qe, [
380
- S("div", Xe, [
380
+ S("div", Xe, [
381
+ S("div", Ye, [
381
382
  U(v(Ie), null, {
382
383
  default: j(({ width: l, height: a }) => [
383
384
  U(v(je), {
@@ -395,7 +396,7 @@ import './assets/PaginationTable.css';const $e = { class: "flex h-full flex-col"
395
396
  We(v(O), (s, o) => ({
396
397
  name: o,
397
398
  fn: j((c) => [
398
- I(e.$slots, o, _e(De(c)), void 0, !0)
399
+ I(e.$slots, o, De(_e(c)), void 0, !0)
399
400
  ])
400
401
  }))
401
402
  ]), 1032, ["expanded-row-keys", "expand-column-key", "columns", "data", "width", "height", "sort-state"])
@@ -403,7 +404,7 @@ import './assets/PaginationTable.css';const $e = { class: "flex h-full flex-col"
403
404
  _: 3
404
405
  })
405
406
  ]),
406
- p.isPagination && G.value > r.value[N.value] ? (y(), E("div", Ye, [
407
+ p.isPagination && G.value > r.value[N.value] ? (y(), E("div", Ze, [
407
408
  p.isPagination ? (y(), re(Fe, {
408
409
  key: 0,
409
410
  "current-page": r.value[f.value],
@@ -420,8 +421,8 @@ import './assets/PaginationTable.css';const $e = { class: "flex h-full flex-col"
420
421
  ])
421
422
  ]));
422
423
  }
423
- }), et = /* @__PURE__ */ Ve(Ze, [["__scopeId", "data-v-adcd3040"]]), ot = Be(et);
424
+ }), tt = /* @__PURE__ */ $e(et, [["__scopeId", "data-v-365abca5"]]), dt = Be(tt);
424
425
  export {
425
- ot as PaginationTable,
426
- ot as default
426
+ dt as PaginationTable,
427
+ dt as default
427
428
  };
@@ -1 +1 @@
1
- .hover-overlay[data-v-f5af90d9]{background:#00000080}[data-v-3a2170d7] .el-timeline-item__timestamp{color:#86909c}[data-v-3a2170d7] .el-card{background:var(--neutral-color-18)}
1
+ .hover-overlay[data-v-7bb24f99]{background:#00000080}[data-v-3a2170d7] .el-timeline-item__timestamp{color:#86909c}[data-v-3a2170d7] .el-card{background:var(--neutral-color-18)}
@@ -1 +1 @@
1
- [data-v-adcd3040] .el-table-v2__header-cell-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
1
+ [data-v-365abca5] .el-table-v2__header-cell-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
package/lib/AppIntro.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./assets/AppIntro.css');const g=require("./chunks/index.CkihWzK6.js"),e=require("vue"),c=require("element-plus"),w=require("color-message-lingyun-vue"),V=require("./chunks/layout.B9EVVV-O.js"),_=require("./chunks/layout.B-T_NE6r.js"),v=require("./chunks/_plugin-vue_export-helper.BHFhmbuH.js"),h=require("ling-yun-methods"),o={LISTING:1,DELISTING:2,ONLINE:3,OFFLINE:4},y={PENDING:0,APPROVED:1,REJECTED:2},E={IMAGE:1,VIDEO:2},f={INTRO:"intro",TIMELINE:"timeline"},B={[o.LISTING]:"上架申请",[o.DELISTING]:"下架申请",[o.ONLINE]:"上线应用",[o.OFFLINE]:"下线应用"},N={[y.PENDING]:{type:"warning",text:"待审核"},[y.APPROVED]:{type:"primary",text:"已通过"},[y.REJECTED]:{type:"danger",text:"已驳回"}},C=[{title:"申请人:",field:"appCreatorName"},{title:"应用省份:",field:"appCreatorOrg"},{title:"应用说明:",field:"appDesc"},{title:"接入系统:",field:"accessSystem"},{title:"业务背景:",field:"businessBackground"},{title:"业务目标:",field:"businessTarget"},{title:"成效数据:",field:"resultData"}],L=[{title:"申请人",field:"creatorName",showForTypes:[o.LISTING,o.DELISTING]},{title:"操作人",field:"creatorName",showForTypes:[o.ONLINE,o.OFFLINE]},{title:"下架原因",field:"delistingReason",showForTypes:[o.DELISTING]},{title:"成效数据",field:"resultData",showForTypes:[o.LISTING]},{title:"推荐理由",field:"recommendReason",showForTypes:[o.LISTING]},{title:"版本号",field:"appVersionNum",showForTypes:[o.ONLINE,o.OFFLINE],formatter:a=>a?`V${a}`:"--"},{title:"配置摘要",field:"configSummary",showForTypes:[o.ONLINE]},{title:"版本说明",field:"publishRemark",showForTypes:[o.ONLINE,o.OFFLINE]},{title:"下线原因",field:"offlineReason",showForTypes:[o.OFFLINE]}],k={[o.LISTING]:{text:"查看上架申请"},[o.DELISTING]:{text:"查看下架申请"}},D={key:0,class:"media-video relative w-full"},x=["src"],F={key:1,class:"media-image relative w-full"},S=["src"],I={__name:"MediaViewer",props:{media:{type:Object,default:null}},setup(a){return(i,d)=>a.media?.type===e.unref(E).VIDEO?(e.openBlock(),e.createElementBlock("div",D,[e.createElementVNode("video",{class:"w-full",src:a.media.url,controls:""},null,8,x)])):a.media?.type===e.unref(E).IMAGE?(e.openBlock(),e.createElementBlock("div",F,[e.createElementVNode("img",{class:"w-full",src:a.media.url,alt:""},null,8,S)])):e.createCommentVNode("",!0)}},b={class:"app-intro-content overflow-hidden h-full"},O={key:0,class:"media-section w-full pd-b-12"},$={class:"media-content relative w-full"},G=["onClick"],M={class:"info-section"},R={class:"flex items-center"},q={class:"fz-14 text-666 pd-r-12"},A={class:"preview-content"},P={__name:"AppIntroContent",props:{introData:{type:Object,default:()=>({})}},setup(a){const i=e.ref(!1),d=e.ref(null),u=r=>{d.value=r,i.value=!0},m=()=>{i.value=!1,d.value=null},p=r=>{try{const t=document.createElement("a");t.href=r.attachementUrl,t.download=r.attachementName,t.style.display="none",t.target="_blank",document.body.appendChild(t),t.click(),document.body.removeChild(t)}catch(t){console.error(t)}};return(r,t)=>(e.openBlock(),e.createElementBlock("div",b,[a.introData?.pics?.length>0?(e.openBlock(),e.createElementBlock("div",O,[e.createElementVNode("div",$,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.introData.pics,(l,n)=>(e.openBlock(),e.createElementBlock("div",{key:n,class:"media-item w-full"},[e.createVNode(I,{media:l},null,8,["media"]),e.createElementVNode("div",{class:"hover-overlay absolute top-0 left-0 w-full h-full flex justify-center items-center",onClick:s=>u(l)},[e.createVNode(e.unref(c.ElIcon),{size:24,class:"view-icon"},{default:e.withCtx(()=>[e.createVNode(e.unref(w.IconLook))]),_:1})],8,G)]))),128))])])):e.createCommentVNode("",!0),e.renderSlot(r.$slots,"default",{},void 0,!0),e.createElementVNode("div",M,[e.createVNode(e.unref(c.ElForm),{model:a.introData,"label-width":"auto"},{default:e.withCtx(()=>[["agent","workflow"].includes(a.introData?.appCategory)?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(e.unref(C),l=>(e.openBlock(),e.createBlock(e.unref(c.ElFormItem),{key:l.field,label:l.title,class:"mg-b-0"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.introData?.[l.field]??"--"),1)]),_:2},1032,["label"]))),128)):e.createCommentVNode("",!0)]),_:1},8,["model"]),a.introData?.attachements?.length?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(_.CustomTitle,{content:"附件:",class:"pd-b-12 pd-t-24"}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.introData.attachements,(l,n)=>(e.openBlock(),e.createElementBlock("div",{key:n,class:"mg-b-8"},[e.createElementVNode("div",R,[e.createElementVNode("span",q,e.toDisplayString(l.attachementName),1),l.attachementUrl?(e.openBlock(),e.createBlock(e.unref(c.ElLink),{key:0,type:"primary",underline:!1,onClick:s=>p(l)},{default:e.withCtx(()=>[...t[1]||(t[1]=[e.createTextVNode(" 点击查看 ",-1)])]),_:1},8,["onClick"])):e.createCommentVNode("",!0)])]))),128))],64)):e.createCommentVNode("",!0)]),e.createVNode(V.CustomDialog,{modelValue:i.value,"onUpdate:modelValue":t[0]||(t[0]=l=>i.value=l),width:"60%","show-close":!0,onClose:m,buttons:{showCancel:!1,showConfirm:!1}},{default:e.withCtx(()=>[e.createElementVNode("div",A,[e.createVNode(I,{media:d.value,class:"preview-media"},null,8,["media"])])]),_:1},8,["modelValue"])]))}},j=v._export_sfc(P,[["__scopeId","data-v-f5af90d9"]]),z={class:"flex items-center flex-gap-row-nowrap-8 mg-b-12"},U={class:"fz-14 weight-500",style:{color:"#1d2129"}},H={class:"fz-14",style:{color:"#4e5969"}},J={__name:"AppTimeline",props:{appId:{type:String,default:""},square:{type:Boolean,default:!1},vueRouter:{type:Object,default:()=>({})},appOperationList:{type:Function,default:()=>{}}},setup(a){const i=a,d=async t=>{i.vueRouter.push({path:"/promptTestDetail",query:{id:t.id,type:t.auditStatus,sourceFlag:"1",operationType:t.operationType,sourceHistory:"1"}})},u=t=>[o.LISTING,o.DELISTING].includes(t),m=t=>L.filter(l=>l.showForTypes.includes(t)),p=e.ref([]),r=async()=>{await i.appOperationList({appId:i.appId,operationType:[o.LISTING,o.DELISTING,o.ONLINE,o.OFFLINE].join(","),pageNum:h.pageParams.pageNum,pageSize:1e6}).then(({data:t})=>{p.value=t.list})};return e.onMounted(()=>{r()}),(t,l)=>(e.openBlock(),e.createBlock(e.unref(c.ElTimeline),{class:"overflow-y-auto h-full pd-l-4"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,n=>(e.openBlock(),e.createBlock(e.unref(c.ElTimelineItem),{key:n.id,timestamp:n.createTime,placement:"top",color:"var(--primary-color-1)"},{default:e.withCtx(()=>[e.createVNode(e.unref(c.ElCard),{shadow:"hover"},{default:e.withCtx(()=>[e.createElementVNode("div",z,[e.createElementVNode("span",U,e.toDisplayString(e.unref(B)[n.operationType]||"--"),1),u(n.operationType)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.unref(N)[n.auditStatus]?(e.openBlock(),e.createBlock(e.unref(c.ElTag),{key:0,type:e.unref(N)[n.auditStatus].type},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(N)[n.auditStatus].text),1)]),_:2},1032,["type"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)]),e.createElementVNode("div",H,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m(n.operationType),s=>(e.openBlock(),e.createElementBlock("div",{key:s.field+s.title,class:"mg-t-8 mg-b-8",style:{"line-height":"1.5"}},e.toDisplayString(s.title)+":"+e.toDisplayString(s.formatter?s.formatter(n[s.field]):n[s.field]??"--"),1))),128)),e.unref(k)[n.operationType]&&!a.square?(e.openBlock(),e.createBlock(e.unref(c.ElLink),{key:0,type:"primary",underline:!1,class:"mg-t-8",onClick:s=>d(n)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k)[n.operationType].text),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0)])]),_:2},1024)]),_:2},1032,["timestamp"]))),128))]),_:1}))}},Y=v._export_sfc(J,[["__scopeId","data-v-3a2170d7"]]),K={class:"h-full overflow-hidden flex flex-col pd-t-12"},Q={class:"pd-b-12"},W={key:0,class:"flex-1 overflow-hidden"},X={key:1,class:"flex-1 overflow-hidden"},Z=Object.assign({name:"AppIntro"},{__name:"layout",props:{introData:{type:Object,default:()=>({})},square:{type:Boolean,default:!1},vueRouter:{type:Object,default:()=>({})},appId:{type:String,default:""},appOperationList:{type:Function,default:()=>{}}},emits:[h.emitsMap.tabChange],setup(a,{emit:i}){const d=i,u=e.ref(f.INTRO),m=e.computed(()=>[{label:"应用介绍",value:f.INTRO},{label:"迭代时间轴",value:f.TIMELINE}]),p=r=>{d(h.emitsMap.tabChange,r)};return(r,t)=>(e.openBlock(),e.createElementBlock("div",K,[e.createElementVNode("div",Q,[e.createVNode(e.unref(c.ElSegmented),{modelValue:u.value,"onUpdate:modelValue":t[0]||(t[0]=l=>u.value=l),options:m.value,onChange:p},null,8,["modelValue","options"])]),u.value===e.unref(f).INTRO?(e.openBlock(),e.createElementBlock("div",W,[e.createVNode(j,{"intro-data":a.introData},{default:e.withCtx(()=>[e.renderSlot(r.$slots,"plugin-detail")]),_:3},8,["intro-data"])])):u.value===e.unref(f).TIMELINE?(e.openBlock(),e.createElementBlock("div",X,[e.createVNode(Y,{"app-operation-list":a.appOperationList,square:a.square,"vue-router":a.vueRouter,"app-id":a.appId},null,8,["app-operation-list","square","vue-router","app-id"])])):e.createCommentVNode("",!0)]))}}),T=g.withInstall(Z);exports.AppIntro=T;exports.default=T;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./assets/AppIntro.css');const g=require("./chunks/index.CkihWzK6.js"),e=require("vue"),c=require("element-plus"),w=require("color-message-lingyun-vue"),V=require("./chunks/layout.B9EVVV-O.js"),_=require("./chunks/layout.B-T_NE6r.js"),v=require("./chunks/_plugin-vue_export-helper.BHFhmbuH.js"),h=require("ling-yun-methods"),o={LISTING:1,DELISTING:2,ONLINE:3,OFFLINE:4},y={PENDING:0,APPROVED:1,REJECTED:2},E={IMAGE:1,VIDEO:2},f={INTRO:"intro",TIMELINE:"timeline"},B={[o.LISTING]:"上架申请",[o.DELISTING]:"下架申请",[o.ONLINE]:"上线应用",[o.OFFLINE]:"下线应用"},N={[y.PENDING]:{type:"warning",text:"待审核"},[y.APPROVED]:{type:"primary",text:"已通过"},[y.REJECTED]:{type:"danger",text:"已驳回"}},C=[{title:"申请人:",field:"appCreatorName"},{title:"应用省份:",field:"appCreatorOrg"},{title:"应用说明:",field:"appDesc"},{title:"接入系统:",field:"accessSystem"},{title:"业务背景:",field:"businessBackground"},{title:"业务目标:",field:"businessTarget"},{title:"成效数据:",field:"resultData"}],L=[{title:"申请人",field:"creatorName",showForTypes:[o.LISTING,o.DELISTING]},{title:"操作人",field:"creatorName",showForTypes:[o.ONLINE,o.OFFLINE]},{title:"下架原因",field:"delistingReason",showForTypes:[o.DELISTING]},{title:"成效数据",field:"resultData",showForTypes:[o.LISTING]},{title:"推荐理由",field:"recommendReason",showForTypes:[o.LISTING]},{title:"版本号",field:"appVersionNum",showForTypes:[o.ONLINE,o.OFFLINE],formatter:a=>a?`V${a}`:"--"},{title:"配置摘要",field:"configSummary",showForTypes:[o.ONLINE]},{title:"版本说明",field:"publishRemark",showForTypes:[o.ONLINE,o.OFFLINE]},{title:"下线原因",field:"offlineReason",showForTypes:[o.OFFLINE]}],k={[o.LISTING]:{text:"查看上架申请"},[o.DELISTING]:{text:"查看下架申请"}},D={key:0,class:"media-video relative w-full"},b=["src"],x={key:1,class:"media-image relative w-full"},F=["src"],I={__name:"MediaViewer",props:{media:{type:Object,default:null}},setup(a){return(i,d)=>a.media?.type===e.unref(E).VIDEO?(e.openBlock(),e.createElementBlock("div",D,[e.createElementVNode("video",{class:"w-full",src:a.media.url,controls:""},null,8,b)])):a.media?.type===e.unref(E).IMAGE?(e.openBlock(),e.createElementBlock("div",x,[e.createElementVNode("img",{class:"w-full",src:a.media.url,alt:""},null,8,F)])):e.createCommentVNode("",!0)}},S={class:"app-intro-content overflow-hidden h-full"},O={key:0,class:"media-section w-full pd-b-12"},$={class:"media-content relative w-full"},G=["onClick"],M={class:"info-section"},R={class:"flex items-center"},q={class:"fz-14 text-666 pd-r-12"},A={class:"preview-content"},P={__name:"AppIntroContent",props:{introData:{type:Object,default:()=>({})}},setup(a){const i=e.ref(!1),d=e.ref(null),u=r=>{d.value=r,i.value=!0},m=()=>{i.value=!1,d.value=null},p=r=>{try{const t=document.createElement("a");t.href=r.attachementUrl,t.download=r.attachementName,t.style.display="none",t.target="_blank",document.body.appendChild(t),t.click(),document.body.removeChild(t)}catch(t){console.error(t)}};return(r,t)=>(e.openBlock(),e.createElementBlock("div",S,[a.introData?.pics?.length>0?(e.openBlock(),e.createElementBlock("div",O,[e.createElementVNode("div",$,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.introData.pics,(l,n)=>(e.openBlock(),e.createElementBlock("div",{key:n,class:"media-item w-full"},[e.createVNode(I,{media:l},null,8,["media"]),e.createElementVNode("div",{class:"hover-overlay absolute top-0 left-0 w-full h-full flex justify-center items-center",onClick:s=>u(l)},[e.createVNode(e.unref(c.ElIcon),{size:24,class:"view-icon"},{default:e.withCtx(()=>[e.createVNode(e.unref(w.IconLook))]),_:1})],8,G)]))),128))])])):e.createCommentVNode("",!0),e.renderSlot(r.$slots,"default",{},void 0,!0),e.createElementVNode("div",M,[e.createVNode(e.unref(c.ElForm),{model:a.introData,"label-width":"auto"},{default:e.withCtx(()=>[["agent","workflow"].includes(a.introData?.appCategory)?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(e.unref(C),l=>(e.openBlock(),e.createBlock(e.unref(c.ElFormItem),{key:l.field,label:l.title,class:"mg-b-0"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.introData?.[l.field]??"--"),1)]),_:2},1032,["label"]))),128)):e.createCommentVNode("",!0)]),_:1},8,["model"]),a.introData?.attachements?.length?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(_.CustomTitle,{content:"附件:",class:"pd-b-12 pd-t-24"}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.introData.attachements,(l,n)=>(e.openBlock(),e.createElementBlock("div",{key:n,class:"mg-b-8"},[e.createElementVNode("div",R,[e.createElementVNode("span",q,e.toDisplayString(l.attachementName),1),l.attachementUrl?(e.openBlock(),e.createBlock(e.unref(c.ElLink),{key:0,type:"primary",underline:!1,onClick:s=>p(l)},{default:e.withCtx(()=>[...t[1]||(t[1]=[e.createTextVNode(" 点击查看 ",-1)])]),_:1},8,["onClick"])):e.createCommentVNode("",!0)])]))),128))],64)):e.createCommentVNode("",!0)]),e.createVNode(V.CustomDialog,{modelValue:i.value,"onUpdate:modelValue":t[0]||(t[0]=l=>i.value=l),width:"60%","show-close":!0,onClose:m,buttons:{showCancel:!1,showConfirm:!1}},{default:e.withCtx(()=>[e.createElementVNode("div",A,[e.createVNode(I,{media:d.value,class:"preview-media"},null,8,["media"])])]),_:1},8,["modelValue"])]))}},j=v._export_sfc(P,[["__scopeId","data-v-7bb24f99"]]),z={class:"flex items-center flex-gap-row-nowrap-8 mg-b-12"},U={class:"fz-14 weight-500",style:{color:"#1d2129"}},H={class:"fz-14",style:{color:"#4e5969"}},J={__name:"AppTimeline",props:{appId:{type:String,default:""},square:{type:Boolean,default:!1},vueRouter:{type:Object,default:()=>({})},appOperationList:{type:Function,default:()=>{}}},setup(a){const i=a,d=async t=>{i.vueRouter.push({path:"/promptTestDetail",query:{id:t.id,type:t.auditStatus,sourceFlag:"1",operationType:t.operationType,sourceHistory:"1"}})},u=t=>[o.LISTING,o.DELISTING].includes(t),m=t=>L.filter(l=>l.showForTypes.includes(t)),p=e.ref([]),r=async()=>{await i.appOperationList({appId:i.appId,operationType:[o.LISTING,o.DELISTING,o.ONLINE,o.OFFLINE].join(","),pageNum:h.pageParams.pageNum,pageSize:1e6}).then(({data:t})=>{p.value=t.list})};return e.onMounted(()=>{r()}),(t,l)=>(e.openBlock(),e.createBlock(e.unref(c.ElTimeline),{class:"overflow-y-auto h-full pd-l-4"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,n=>(e.openBlock(),e.createBlock(e.unref(c.ElTimelineItem),{key:n.id,timestamp:n.createTime,placement:"top",color:"var(--primary-color-1)"},{default:e.withCtx(()=>[e.createVNode(e.unref(c.ElCard),{shadow:"hover"},{default:e.withCtx(()=>[e.createElementVNode("div",z,[e.createElementVNode("span",U,e.toDisplayString(e.unref(B)[n.operationType]||"--"),1),u(n.operationType)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.unref(N)[n.auditStatus]?(e.openBlock(),e.createBlock(e.unref(c.ElTag),{key:0,type:e.unref(N)[n.auditStatus].type},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(N)[n.auditStatus].text),1)]),_:2},1032,["type"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)]),e.createElementVNode("div",H,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m(n.operationType),s=>(e.openBlock(),e.createElementBlock("div",{key:s.field+s.title,class:"mg-t-8 mg-b-8",style:{"line-height":"1.5"}},e.toDisplayString(s.title)+":"+e.toDisplayString(s.formatter?s.formatter(n[s.field]):n[s.field]??"--"),1))),128)),e.unref(k)[n.operationType]&&!a.square?(e.openBlock(),e.createBlock(e.unref(c.ElLink),{key:0,type:"primary",underline:!1,class:"mg-t-8",onClick:s=>d(n)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k)[n.operationType].text),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0)])]),_:2},1024)]),_:2},1032,["timestamp"]))),128))]),_:1}))}},Y=v._export_sfc(J,[["__scopeId","data-v-3a2170d7"]]),K={class:"h-full overflow-hidden flex flex-col pd-t-12"},Q={class:"pd-b-12"},W={key:0,class:"flex-1 overflow-hidden"},X={key:1,class:"flex-1 overflow-hidden"},Z=Object.assign({name:"AppIntro"},{__name:"layout",props:{introData:{type:Object,default:()=>({})},square:{type:Boolean,default:!1},vueRouter:{type:Object,default:()=>({})},appId:{type:String,default:""},appOperationList:{type:Function,default:()=>{}}},emits:[h.emitsMap.tabChange],setup(a,{emit:i}){const d=i,u=e.ref(f.INTRO),m=e.computed(()=>[{label:"应用介绍",value:f.INTRO},{label:"迭代时间轴",value:f.TIMELINE}]),p=r=>{d(h.emitsMap.tabChange,r)};return(r,t)=>(e.openBlock(),e.createElementBlock("div",K,[e.createElementVNode("div",Q,[e.createVNode(e.unref(c.ElSegmented),{modelValue:u.value,"onUpdate:modelValue":t[0]||(t[0]=l=>u.value=l),options:m.value,onChange:p},null,8,["modelValue","options"])]),u.value===e.unref(f).INTRO?(e.openBlock(),e.createElementBlock("div",W,[e.createVNode(j,{"intro-data":a.introData},{default:e.withCtx(()=>[e.renderSlot(r.$slots,"plugin-detail")]),_:3},8,["intro-data"])])):u.value===e.unref(f).TIMELINE?(e.openBlock(),e.createElementBlock("div",X,[e.createVNode(Y,{"app-operation-list":a.appOperationList,square:a.square,"vue-router":a.vueRouter,"app-id":a.appId},null,8,["app-operation-list","square","vue-router","app-id"])])):e.createCommentVNode("",!0)]))}}),T=g.withInstall(Z);exports.AppIntro=T;exports.default=T;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./assets/PaginationTable.css');const ve=require("./chunks/index.CkihWzK6.js"),l=require("vue"),k=require("element-plus"),I=require("ling-yun-methods"),pe=require("color-star-custom-methods"),ge=require("./chunks/layout.DE2WIKAN.js"),me=require("./chunks/_plugin-vue_export-helper.BHFhmbuH.js"),Se={class:"flex h-full flex-col"},ye={class:"w-full flex justify-between overflow-hidden",style:{height:"auto"}},be={key:0,class:"flex-1 overflow-hidden"},Ce={class:"flex",style:{width:"auto",gap:"10px"}},xe={key:1,class:"flex items-center mg-b-18"},ke={class:"fz-12 text-74798c"},we={class:"btn-group mg-l-12"},Be={class:"w-full flex-1 overflow-hidden flex flex-col"},Ee={class:"flex-1 overflow-hidden TABLE-AREA"},Ne={key:0,class:"flex justify-end mg-t-20",style:{height:"auto"}},Te=Object.assign({name:"PaginationTable"},{__name:"layout",props:{isPagination:{type:Boolean,default:!0},total:{type:Number,default:0},tableData:{type:Array,default:()=>[]},pagination:{type:Object,default:()=>I.paginationConfig},params:{type:Object,default:()=>{}},requestFn:{type:Function},columns:{type:Array,default:()=>[]},hasBatchSelect:{type:Boolean,default:!1},expandColumnKey:{type:String,default:""},tableDataKey:{type:String,default:"list"},tableDomWidth:{type:Number,default:0},pageMapping:{type:Object,default:()=>({pageSize:"pageSize",pageNum:"pageNum"})},sortState:{type:Object,default:()=>{}}},emits:[I.emitsMap.paginationChange,"updateTableData","handleTableSelect","handleBatchDelete","updateSortState"],setup(v,{expose:te,emit:le}){const S=le,r=v,R=l.useSlots(),w=l.computed(()=>typeof r.requestFn=="function"),d=l.computed({get:()=>w.value?g.value:r.tableData,set:e=>{w.value?g.value=e:S("updateTableData",e)}}),z=l.ref(0),O=l.computed(()=>w.value?z.value:r.total),y=l.computed({get:()=>r.sortState,set:e=>{S("updateSortState",e)}}),ae=({key:e,order:t})=>{y.value[e]=t,d.value=d.value.reverse()},g=l.ref([]),h=l.computed(()=>r.pageMapping.pageNum),B=l.computed(()=>r.pageMapping.pageSize),A={[h.value]:1,[B.value]:20},c=l.ref({...A}),p=l.ref([]),s=l.ref([]),M=l.ref([]),m=l.ref({}),K=l.computed(()=>ne(m.value));function ne(e){const t=new Set;for(const a in e)e.hasOwnProperty(a)&&e[a].forEach(n=>{t.add(n.id)});return t}const F=({value:e,intermediate:t=!1,onChange:a})=>l.h(k.ElCheckbox,{onChange:a,modelValue:e,indeterminate:t}),oe=(e,t)=>{if(e.selected=t,t?s.value.some(a=>a.id===e.id)||s.value.push(e):s.value=s.value.filter(({id:a})=>a!==e.id),e.children&&e.children.length>0){const a=n=>{n.forEach(u=>{u.selected=t,t?s.value.some(i=>i.id===u.id)||s.value.push(u):s.value=s.value.filter(({id:i})=>i!==u.id),u.children&&u.children.length>0&&a(u.children)})};a(e.children)}e.parentId&&L(e.parentId),U(),C()},L=e=>{const t=$(d.value,e);if(!t)return;const a=t.children.every(n=>n.selected);a&&!t.selected?(t.selected=!0,s.value.some(n=>n.id===t.id)||s.value.push(t)):!a&&t.selected&&(t.selected=!1,s.value=s.value.filter(({id:n})=>n!==t.id)),t.parentId&&L(t.parentId)},$=(e,t)=>{for(const a of e){if(a.id===t)return a;if(a.children){const n=$(a.children,t);if(n)return n}}return null};function U(){m.value[c.value[h.value]]=H(d.value)}function H(e){let t=[];return e.forEach(a=>{a.selected&&t.push(a),a.children&&a.children.length>0&&(t=t.concat(H(a.children)))}),t}function q(e,t){e.selected=t,e.children&&e.children.length>0&&e.children.forEach(a=>q(a,t))}const ue=e=>{const t=d.value.map(a=>(q(a,e),a));return d.value=[...t],U(),s.value=e?[...Object.values(m.value).flat()]:[],C(),[...s.value]},se=()=>{p.value.unshift({key:"selection",width:50,cellRenderer:e=>{const{rowData:t}=e,n=t.children&&t.children.length>0?re(t):!1;return l.h(F,{value:t.selected,intermediate:n,onChange:u=>oe(t,u)})},headerCellRenderer:()=>{const e=l.unref(d),t=e.every(n=>{const u=n.selected,i=Y(n);return u&&i}),a=e.some(n=>n.selected||G(n));return l.h(F,{value:t,intermediate:a&&!t,onChange:ue})}})},re=e=>{if(!e.children||e.children.length===0)return!1;const t=e.children.filter(a=>a.selected).length;return t>0&&t<e.children.length};function Y(e){return e.children?.length?!!e.selected&&e.children.every(Y):!!e.selected}function G(e){return e.selected?!0:e.children?.some(G)||!1}function J(e){return e.map(t=>{const a={...t,selected:!1};return a.children&&(a.children=J(a.children)),a})}const b=l.ref(!1),ie=()=>{b.value=!0,se()},_=()=>{b.value=!1,s.value=[],d.value=d.value.map(e=>(q(e,!1),e)),m.value={},g.value=J(g.value),p.value.shift(),C()},ce=()=>{S("handleBatchDelete",{selectedRows:Object.values(m.value).flat(),cb:()=>{_(),C()}})},de=()=>{s.value=[],C()};function C(){const e=Object.values(m.value).flat();S("handleTableSelect",{originNodeData:s.value,allSelectedNodes:e,selectedSubNodes:e.filter(t=>!t.children)})}const x=()=>{w.value?r.requestFn({...r.params,...c.value}).then(e=>{g.value=W(e?.data[r.tableDataKey],c.value[h.value],K.value)||[],z.value=e?.data?.total}):(g.value=W(r.tableData,c.value[h.value],K.value),z.value=r.total)};function W(e,t,a,n=!1){return e.map(u=>{const i=a.has(u.id)||n,f={...u,selected:i};return f.children&&(f.children=W(f.children,t,a,i)),f})}const fe=()=>{c.value[h.value]=A[h.value],x()},he=()=>{c.value={...A},x()},Q=e=>{e==="size"&&(c.value[h.value]=1),x(),S(I.emitsMap.paginationChange,c.value)},E=l.ref(0),N=()=>{let e=E.value,t=[...r.columns];const a=1/pe.calculateScale(),n=t.filter(o=>o.fixedWidth),u=t.filter(o=>!o.fixedWidth);let i=0;n.forEach(o=>{o.width&&(i+=o.width)});let f=e-i,j=0;u.forEach(o=>{o.width&&(j+=o.width)});const Z=[];if(t.forEach((o,T)=>{let P;if(o.fixedWidth)P=o.width||100;else if(o.width&&j>0){const V=o.width/j,D=f*V;P=Math.max(D,o.width)}else{const V=u.filter(D=>!D.width);P=V.length>0?f/V.length:f/u.length}Z.push(P)}),t=t.map((o,T)=>(o.width=Z[T]*a,y.value&&Object.keys(y.value).length&&y.value[o.key]&&(o.sortable=!0),o)),b.value){const o=p.value.find(T=>T.key==="selection");o&&(p.value=[o,...t])}else p.value=[...t]};l.watch(()=>b.value,()=>{N()}),l.watch(()=>r.tableDomWidth,e=>{e&&(E.value=e,N())});const X=()=>{E.value=document.querySelector(".TABLE-AREA").getBoundingClientRect().width,N()};return l.onMounted(()=>{x(),p.value=r.columns,E.value=document.querySelector(".TABLE-AREA").getBoundingClientRect().width,l.nextTick(()=>{N()}),window.addEventListener("resize",X)}),te({getTableList:x,search:fe,reset:he,initBatchSelect:de,handleCancelSelect:_,handleResize:X}),(e,t)=>(l.openBlock(),l.createElementBlock("div",Se,[l.createElementVNode("div",ye,[l.unref(R)["filter-left"]?(l.openBlock(),l.createElementBlock("div",be,[l.renderSlot(e.$slots,"filter-left",{},void 0,!0)])):l.createCommentVNode("",!0),l.createElementVNode("div",Ce,[v.hasBatchSelect&&d.value.length?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[b.value?(l.openBlock(),l.createElementBlock("div",xe,[l.createElementVNode("div",ke,"已选"+l.toDisplayString(s.value.length)+"条数据",1),l.createElementVNode("div",{class:"fz-12 text-3b64ff mg-l-4 pointer",onClick:_},"取消选择"),l.renderSlot(e.$slots,"btn-group",{},()=>[l.createElementVNode("div",we,[l.createVNode(l.unref(k.ElButton),{type:"danger",onClick:ce,disabled:!s.value.length},{default:l.withCtx(()=>[...t[6]||(t[6]=[l.createTextVNode(" 删除 ",-1)])]),_:1},8,["disabled"])])],!0)])):(l.openBlock(),l.createBlock(l.unref(k.ElButton),{key:0,type:"default",onClick:ie},{default:l.withCtx(()=>[...t[5]||(t[5]=[l.createTextVNode(" 批量选择 ",-1)])]),_:1}))],64)):l.createCommentVNode("",!0),l.unref(R)["filter-right"]?l.renderSlot(e.$slots,"filter-right",{key:1},void 0,!0):l.createCommentVNode("",!0)])]),l.createElementVNode("div",Be,[l.createElementVNode("div",Ee,[l.createVNode(l.unref(k.ElAutoResizer),null,{default:l.withCtx(({width:a,height:n})=>[l.createVNode(l.unref(k.ElTableV2),{"expanded-row-keys":M.value,"onUpdate:expandedRowKeys":t[0]||(t[0]=u=>M.value=u),"expand-column-key":v.expandColumnKey,columns:p.value,data:d.value,width:a,height:n,fixed:"","sort-state":y.value,onColumnSort:ae},l.createSlots({_:2},[l.renderList(l.unref(R),(u,i)=>({name:i,fn:l.withCtx(f=>[l.renderSlot(e.$slots,i,l.normalizeProps(l.guardReactiveProps(f)),void 0,!0)])}))]),1032,["expanded-row-keys","expand-column-key","columns","data","width","height","sort-state"])]),_:3})]),v.isPagination&&O.value>c.value[B.value]?(l.openBlock(),l.createElementBlock("div",Ne,[v.isPagination?(l.openBlock(),l.createBlock(ge._sfc_main,{key:0,"current-page":c.value[h.value],"onUpdate:currentPage":t[1]||(t[1]=a=>c.value[h.value]=a),"page-size":c.value[B.value],"onUpdate:pageSize":t[2]||(t[2]=a=>c.value[B.value]=a),"page-sizes":v.pagination.pageSizes,layout:v.pagination.layout,total:O.value,onSizeChange:t[3]||(t[3]=a=>Q("size")),onCurrentChange:t[4]||(t[4]=a=>Q("page"))},null,8,["current-page","page-size","page-sizes","layout","total"])):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0)])]))}}),Pe=me._export_sfc(Te,[["__scopeId","data-v-adcd3040"]]),ee=ve.withInstall(Pe);exports.PaginationTable=ee;exports.default=ee;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./assets/PaginationTable.css');const ve=require("./chunks/index.CkihWzK6.js"),l=require("vue"),k=require("element-plus"),I=require("ling-yun-methods"),pe=require("color-star-custom-methods"),ge=require("./chunks/layout.DE2WIKAN.js"),me=require("lodash"),Se=require("./chunks/_plugin-vue_export-helper.BHFhmbuH.js"),ye={class:"flex h-full flex-col"},be={class:"w-full flex justify-between overflow-hidden",style:{height:"auto"}},Ce={key:0,class:"flex-1 overflow-hidden"},xe={class:"flex",style:{width:"auto",gap:"10px"}},ke={key:1,class:"flex items-center mg-b-18"},we={class:"fz-12 text-74798c"},Be={class:"btn-group mg-l-12"},Ee={class:"w-full flex-1 overflow-hidden flex flex-col"},Ne={class:"flex-1 overflow-hidden TABLE-AREA"},Te={key:0,class:"flex justify-end mg-t-20",style:{height:"auto"}},Pe=Object.assign({name:"PaginationTable"},{__name:"layout",props:{isPagination:{type:Boolean,default:!0},total:{type:Number,default:0},tableData:{type:Array,default:()=>[]},pagination:{type:Object,default:()=>I.paginationConfig},params:{type:Object,default:()=>{}},requestFn:{type:Function},columns:{type:Array,default:()=>[]},hasBatchSelect:{type:Boolean,default:!1},expandColumnKey:{type:String,default:""},tableDataKey:{type:String,default:"list"},tableDomWidth:{type:Number,default:0},pageMapping:{type:Object,default:()=>({pageSize:"pageSize",pageNum:"pageNum"})},sortState:{type:Object,default:()=>{}}},emits:[I.emitsMap.paginationChange,"updateTableData","handleTableSelect","handleBatchDelete","updateSortState"],setup(v,{expose:te,emit:le}){const S=le,r=v,R=l.useSlots(),w=l.computed(()=>typeof r.requestFn=="function"),d=l.computed({get:()=>w.value?g.value:r.tableData,set:e=>{w.value?g.value=e:S("updateTableData",e)}}),z=l.ref(0),O=l.computed(()=>w.value?z.value:r.total),y=l.computed({get:()=>r.sortState,set:e=>{S("updateSortState",e)}}),ae=({key:e,order:t})=>{y.value[e]=t,d.value=d.value.reverse()},g=l.ref([]),h=l.computed(()=>r.pageMapping.pageNum),B=l.computed(()=>r.pageMapping.pageSize),q={[h.value]:1,[B.value]:20},c=l.ref({...q}),p=l.ref([]),s=l.ref([]),M=l.ref([]),m=l.ref({}),K=l.computed(()=>ne(m.value));function ne(e){const t=new Set;for(const a in e)e.hasOwnProperty(a)&&e[a].forEach(n=>{t.add(n.id)});return t}const F=({value:e,intermediate:t=!1,onChange:a})=>l.h(k.ElCheckbox,{onChange:a,modelValue:e,indeterminate:t}),oe=(e,t)=>{if(e.selected=t,t?s.value.some(a=>a.id===e.id)||s.value.push(e):s.value=s.value.filter(({id:a})=>a!==e.id),e.children&&e.children.length>0){const a=n=>{n.forEach(u=>{u.selected=t,t?s.value.some(i=>i.id===u.id)||s.value.push(u):s.value=s.value.filter(({id:i})=>i!==u.id),u.children&&u.children.length>0&&a(u.children)})};a(e.children)}e.parentId&&L(e.parentId),U(),C()},L=e=>{const t=$(d.value,e);if(!t)return;const a=t.children.every(n=>n.selected);a&&!t.selected?(t.selected=!0,s.value.some(n=>n.id===t.id)||s.value.push(t)):!a&&t.selected&&(t.selected=!1,s.value=s.value.filter(({id:n})=>n!==t.id)),t.parentId&&L(t.parentId)},$=(e,t)=>{for(const a of e){if(a.id===t)return a;if(a.children){const n=$(a.children,t);if(n)return n}}return null};function U(){m.value[c.value[h.value]]=H(d.value)}function H(e){let t=[];return e.forEach(a=>{a.selected&&t.push(a),a.children&&a.children.length>0&&(t=t.concat(H(a.children)))}),t}function A(e,t){e.selected=t,e.children&&e.children.length>0&&e.children.forEach(a=>A(a,t))}const ue=e=>{const t=d.value.map(a=>(A(a,e),a));return d.value=[...t],U(),s.value=e?[...Object.values(m.value).flat()]:[],C(),[...s.value]},se=()=>{p.value.unshift({key:"selection",width:50,cellRenderer:e=>{const{rowData:t}=e,n=t.children&&t.children.length>0?re(t):!1;return l.h(F,{value:t.selected,intermediate:n,onChange:u=>oe(t,u)})},headerCellRenderer:()=>{const e=l.unref(d),t=e.every(n=>{const u=n.selected,i=Y(n);return u&&i}),a=e.some(n=>n.selected||G(n));return l.h(F,{value:t,intermediate:a&&!t,onChange:ue})}})},re=e=>{if(!e.children||e.children.length===0)return!1;const t=e.children.filter(a=>a.selected).length;return t>0&&t<e.children.length};function Y(e){return e.children?.length?!!e.selected&&e.children.every(Y):!!e.selected}function G(e){return e.selected?!0:e.children?.some(G)||!1}function J(e){return e.map(t=>{const a={...t,selected:!1};return a.children&&(a.children=J(a.children)),a})}const b=l.ref(!1),ie=()=>{b.value=!0,se()},_=()=>{b.value=!1,s.value=[],d.value=d.value.map(e=>(A(e,!1),e)),m.value={},g.value=J(g.value),p.value.shift(),C()},ce=()=>{S("handleBatchDelete",{selectedRows:Object.values(m.value).flat(),cb:()=>{_(),C()}})},de=()=>{s.value=[],C()};function C(){const e=Object.values(m.value).flat();S("handleTableSelect",{originNodeData:s.value,allSelectedNodes:e,selectedSubNodes:e.filter(t=>!t.children)})}const x=()=>{w.value?r.requestFn({...r.params,...c.value}).then(e=>{g.value=W(e?.data[r.tableDataKey],c.value[h.value],K.value)||[],z.value=e?.data?.total}):(g.value=W(r.tableData,c.value[h.value],K.value),z.value=r.total)};function W(e,t,a,n=!1){return e.map(u=>{const i=a.has(u.id)||n,f={...u,selected:i};return f.children&&(f.children=W(f.children,t,a,i)),f})}const fe=()=>{c.value[h.value]=q[h.value],x()},he=()=>{c.value={...q},x()},Q=e=>{e==="size"&&(c.value[h.value]=1),x(),S(I.emitsMap.paginationChange,c.value)},E=l.ref(0),N=()=>{let e=E.value,t=me.cloneDeep(r.columns);const a=1/pe.calculateScale(),n=t.filter(o=>o.fixedWidth),u=t.filter(o=>!o.fixedWidth);let i=0;n.forEach(o=>{o.width&&(i+=o.width)});let f=e-i,D=0;u.forEach(o=>{o.width&&(D+=o.width)});const Z=[];if(t.forEach((o,T)=>{let P;if(o.fixedWidth)P=o.width||100;else if(o.width&&D>0){const V=o.width/D,j=f*V;P=Math.max(j,o.width)}else{const V=u.filter(j=>!j.width);P=V.length>0?f/V.length:f/u.length}Z.push(P)}),t=t.map((o,T)=>(o.width=Z[T]*a,y.value&&Object.keys(y.value).length&&y.value[o.key]&&(o.sortable=!0),o)),b.value){const o=p.value.find(T=>T.key==="selection");o&&(p.value=[o,...t])}else p.value=[...t]};l.watch(()=>b.value,()=>{N()}),l.watch(()=>r.tableDomWidth,e=>{e&&(E.value=e,N())});const X=()=>{E.value=document.querySelector(".TABLE-AREA").getBoundingClientRect().width,N()};return l.onMounted(()=>{x(),p.value=r.columns,E.value=document.querySelector(".TABLE-AREA").getBoundingClientRect().width,l.nextTick(()=>{N()}),window.addEventListener("resize",X)}),te({getTableList:x,search:fe,reset:he,initBatchSelect:de,handleCancelSelect:_,handleResize:X}),(e,t)=>(l.openBlock(),l.createElementBlock("div",ye,[l.createElementVNode("div",be,[l.unref(R)["filter-left"]?(l.openBlock(),l.createElementBlock("div",Ce,[l.renderSlot(e.$slots,"filter-left",{},void 0,!0)])):l.createCommentVNode("",!0),l.createElementVNode("div",xe,[v.hasBatchSelect&&d.value.length?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[b.value?(l.openBlock(),l.createElementBlock("div",ke,[l.createElementVNode("div",we,"已选"+l.toDisplayString(s.value.length)+"条数据",1),l.createElementVNode("div",{class:"fz-12 text-3b64ff mg-l-4 pointer",onClick:_},"取消选择"),l.renderSlot(e.$slots,"btn-group",{},()=>[l.createElementVNode("div",Be,[l.createVNode(l.unref(k.ElButton),{type:"danger",onClick:ce,disabled:!s.value.length},{default:l.withCtx(()=>[...t[6]||(t[6]=[l.createTextVNode(" 删除 ",-1)])]),_:1},8,["disabled"])])],!0)])):(l.openBlock(),l.createBlock(l.unref(k.ElButton),{key:0,type:"default",onClick:ie},{default:l.withCtx(()=>[...t[5]||(t[5]=[l.createTextVNode(" 批量选择 ",-1)])]),_:1}))],64)):l.createCommentVNode("",!0),l.unref(R)["filter-right"]?l.renderSlot(e.$slots,"filter-right",{key:1},void 0,!0):l.createCommentVNode("",!0)])]),l.createElementVNode("div",Ee,[l.createElementVNode("div",Ne,[l.createVNode(l.unref(k.ElAutoResizer),null,{default:l.withCtx(({width:a,height:n})=>[l.createVNode(l.unref(k.ElTableV2),{"expanded-row-keys":M.value,"onUpdate:expandedRowKeys":t[0]||(t[0]=u=>M.value=u),"expand-column-key":v.expandColumnKey,columns:p.value,data:d.value,width:a,height:n,fixed:"","sort-state":y.value,onColumnSort:ae},l.createSlots({_:2},[l.renderList(l.unref(R),(u,i)=>({name:i,fn:l.withCtx(f=>[l.renderSlot(e.$slots,i,l.normalizeProps(l.guardReactiveProps(f)),void 0,!0)])}))]),1032,["expanded-row-keys","expand-column-key","columns","data","width","height","sort-state"])]),_:3})]),v.isPagination&&O.value>c.value[B.value]?(l.openBlock(),l.createElementBlock("div",Te,[v.isPagination?(l.openBlock(),l.createBlock(ge._sfc_main,{key:0,"current-page":c.value[h.value],"onUpdate:currentPage":t[1]||(t[1]=a=>c.value[h.value]=a),"page-size":c.value[B.value],"onUpdate:pageSize":t[2]||(t[2]=a=>c.value[B.value]=a),"page-sizes":v.pagination.pageSizes,layout:v.pagination.layout,total:O.value,onSizeChange:t[3]||(t[3]=a=>Q("size")),onCurrentChange:t[4]||(t[4]=a=>Q("page"))},null,8,["current-page","page-size","page-sizes","layout","total"])):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0)])]))}}),Ve=Se._export_sfc(Pe,[["__scopeId","data-v-365abca5"]]),ee=ve.withInstall(Ve);exports.PaginationTable=ee;exports.default=ee;
@@ -1 +1 @@
1
- .hover-overlay[data-v-f5af90d9]{background:#00000080}[data-v-3a2170d7] .el-timeline-item__timestamp{color:#86909c}[data-v-3a2170d7] .el-card{background:var(--neutral-color-18)}
1
+ .hover-overlay[data-v-7bb24f99]{background:#00000080}[data-v-3a2170d7] .el-timeline-item__timestamp{color:#86909c}[data-v-3a2170d7] .el-card{background:var(--neutral-color-18)}
@@ -1 +1 @@
1
- [data-v-adcd3040] .el-table-v2__header-cell-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
1
+ [data-v-365abca5] .el-table-v2__header-cell-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ling-yun-custom-components",
3
- "version": "0.0.55",
3
+ "version": "0.0.56",
4
4
  "keywords": [
5
5
  "component library",
6
6
  "ui framework",
@@ -182,7 +182,8 @@
182
182
  "typescript": "~5.9.3",
183
183
  "vite": "^7.1.11",
184
184
  "vite-plugin-lib-inject-css": "^2.2.2",
185
- "vue": "^3.5.22"
185
+ "vue": "^3.5.22",
186
+ "lodash": "^4.17.21"
186
187
  },
187
188
  "peerDependencies": {
188
189
  "axios": "^1.8.2",