china-mobile-international-custom-components 0.0.24 → 0.0.25
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/PageContainer.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { w as oe } from "./chunks/index.bCzIhWFw.js";
|
|
2
|
-
import { ref as h, useSlots as ie, computed as
|
|
2
|
+
import { ref as h, useSlots as ie, computed as z, watch as T, onMounted as se, createElementBlock as m, openBlock as u, createCommentVNode as k, createElementVNode as x, renderSlot as C, createVNode as p, unref as s, withCtx as d, createBlock as w, resolveDynamicComponent as de, toDisplayString as P, normalizeClass as F, mergeProps as I, toHandlers as ue, createSlots as $, Fragment as N, renderList as E, createTextVNode as L, normalizeProps as fe, guardReactiveProps as pe } from "vue";
|
|
3
3
|
import { C as R } from "./chunks/layout.CWL6NVjA.js";
|
|
4
4
|
import { SearchBar as ce } from "color-star-custom-components";
|
|
5
5
|
import { IconZuo as me, IconMore as ge } from "color-message-aibox-vue";
|
|
6
6
|
import { emitsMap as i, paginationConfig as O, pageParams as v, operationConfigMap as W } from "color-star-custom-methods";
|
|
7
7
|
import { ElIcon as U, ElTable as ye, ElTableColumn as be, ElButton as he, ElDropdown as ve, ElDropdownMenu as ke, ElDropdownItem as Ce, ElPagination as we } from "element-plus";
|
|
8
|
-
import { useRouter as
|
|
9
|
-
import { _ as
|
|
8
|
+
import { useRouter as Se } from "vue-router";
|
|
9
|
+
import { _ as ze } from "./chunks/_plugin-vue_export-helper.CHgC5LLL.js";
|
|
10
10
|
import './assets/PageContainer.css';const H = {
|
|
11
11
|
ACTION: "action"
|
|
12
12
|
}, xe = { class: "page-container flex flex-col overflow-hidden h-full" }, Pe = { class: "text-1f2329 pd-l-4" }, Ee = { class: "action-buttons flex items-center" }, Oe = {
|
|
@@ -126,19 +126,19 @@ import './assets/PageContainer.css';const H = {
|
|
|
126
126
|
i.updateModelValue
|
|
127
127
|
],
|
|
128
128
|
setup(l, { expose: q, emit: K }) {
|
|
129
|
-
const Y =
|
|
129
|
+
const Y = Se(), n = l, g = K, Z = h(null), G = h(null), J = ie(), V = h(!1), S = h([]), y = h({
|
|
130
130
|
page: v.pageNum,
|
|
131
131
|
size: v.pageSize,
|
|
132
132
|
total: 0,
|
|
133
133
|
pageSizes: O.pageSizes,
|
|
134
134
|
layout: O.layout
|
|
135
|
-
}), c = h({ ...n.modelValue }), Q =
|
|
136
|
-
() => n.api ?
|
|
137
|
-
), f =
|
|
135
|
+
}), c = h({ ...n.modelValue }), Q = z(
|
|
136
|
+
() => n.api ? S.value : n.tableData
|
|
137
|
+
), f = z(
|
|
138
138
|
() => n.api ? y.value : n.pagination
|
|
139
|
-
), X =
|
|
139
|
+
), X = z(
|
|
140
140
|
() => n.api ? V.value : n.tableProps.loading || !1
|
|
141
|
-
), D =
|
|
141
|
+
), D = z(() => n.columns?.map((e) => {
|
|
142
142
|
if (e.type === H.ACTION && (Array.isArray(e.actions) || typeof e.actions == "function"))
|
|
143
143
|
return {
|
|
144
144
|
...e,
|
|
@@ -162,13 +162,14 @@ import './assets/PageContainer.css';const H = {
|
|
|
162
162
|
...c.value
|
|
163
163
|
};
|
|
164
164
|
n.showPagination && (a.page = f.value.page, a.size = f.value.size), n.api(a).then((t) => {
|
|
165
|
-
|
|
166
|
-
data:
|
|
165
|
+
S.value = t?.data?.memberSo?.data || t?.data?.data || t?.data || [], y.value.total = t?.data?.totalNum || t?.data?.total || 0, g(i.dataLoaded, {
|
|
166
|
+
data: S.value,
|
|
167
167
|
pagination: y.value,
|
|
168
|
-
params: a
|
|
168
|
+
params: a,
|
|
169
|
+
response: t?.data
|
|
169
170
|
});
|
|
170
171
|
}).catch((t) => {
|
|
171
|
-
|
|
172
|
+
S.value = [], y.value.total = 0, g(i.dataError, t);
|
|
172
173
|
}).finally(() => {
|
|
173
174
|
V.value = !1;
|
|
174
175
|
});
|
|
@@ -276,7 +277,8 @@ import './assets/PageContainer.css';const H = {
|
|
|
276
277
|
data: Q.value,
|
|
277
278
|
columns: D.value,
|
|
278
279
|
"row-key": l.treeProps.rowKey,
|
|
279
|
-
"tree-props": l.treeProps
|
|
280
|
+
"tree-props": l.treeProps,
|
|
281
|
+
"show-overflow-tooltip": !0
|
|
280
282
|
}, { ...l.tableProps, loading: X.value }, ue(l.tableEvents), {
|
|
281
283
|
class: "flex-1 admin-dashboard-table",
|
|
282
284
|
border: ""
|
|
@@ -389,7 +391,7 @@ import './assets/PageContainer.css';const H = {
|
|
|
389
391
|
C(e.$slots, "default", {}, void 0, !0)
|
|
390
392
|
]));
|
|
391
393
|
}
|
|
392
|
-
}), Ae = /* @__PURE__ */
|
|
394
|
+
}), Ae = /* @__PURE__ */ ze(Ve, [["__scopeId", "data-v-9075f216"]]), Re = oe(Ae);
|
|
393
395
|
export {
|
|
394
396
|
H as COLUMN_TYPES,
|
|
395
397
|
Re as PageContainer,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.search-section[data-v-
|
|
1
|
+
.search-section[data-v-9075f216]{border-bottom:1px solid var(--border-color)}.action-buttons[data-v-9075f216]{gap:8px;flex-wrap:wrap}.bg-fff[data-v-9075f216]{background-color:var(--background-color-2);border:1px solid var(--border-color)}
|
package/lib/PageContainer.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./assets/PageContainer.css');const $=require("./chunks/index.CkihWzK6.js"),e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./assets/PageContainer.css');const $=require("./chunks/index.CkihWzK6.js"),e=require("vue"),S=require("./chunks/layout.DC4lrADH.js"),R=require("color-star-custom-components"),x=require("color-message-aibox-vue"),l=require("color-star-custom-methods"),u=require("element-plus"),W=require("vue-router"),U=require("./chunks/_plugin-vue_export-helper.BHFhmbuH.js"),b={ACTION:"action"},H={class:"page-container flex flex-col overflow-hidden h-full"},Y={class:"text-1f2329 pd-l-4"},K={class:"action-buttons flex items-center"},Z={key:1,class:"pagination-section pd-t-16 flex justify-center"},G=Object.assign({name:"PageContainer"},{__name:"layout",props:{breadcrumb:{type:Object,default:()=>({show:!1,text:""})},title:{type:String,default:""},searchFields:{type:Array,default:()=>[]},modelValue:{type:Object,default:()=>({})},columns:{type:Array,default:()=>[]},tableData:{type:Array,default:()=>[]},tableProps:{type:Object,default:()=>({stripe:!0,border:!1})},treeProps:{type:Object,default:()=>({})},tableEvents:{type:Object,default:()=>({})},showPagination:{type:Boolean,default:!0},pagination:{type:Object,default:()=>({page:l.pageParams.pageNum,size:l.pageParams.pageSize,total:0,pageSizes:l.paginationConfig.pageSizes,layout:l.paginationConfig.layout})},customSlots:{type:Array,default:()=>[]},api:{type:Function,default:null},autoLoad:{type:Boolean,default:!0},apiParams:{type:Object,default:()=>({})},isSeparate:{type:Boolean,default:!1},minWidth:{type:Number,default:290}},emits:[l.emitsMap.search,l.emitsMap.reset,l.emitsMap.actionClick,l.emitsMap.paginationChange,l.emitsMap.sizeChange,l.emitsMap.dataLoaded,l.emitsMap.dataError,l.emitsMap.updateModelValue],setup(n,{expose:V,emit:B}){const N=W.useRouter(),i=n,p=B,M=e.ref(null),z=e.ref(null),E=e.useSlots(),h=e.ref(!1),g=e.ref([]),f=e.ref({page:l.pageParams.pageNum,size:l.pageParams.pageSize,total:0,pageSizes:l.paginationConfig.pageSizes,layout:l.paginationConfig.layout}),c=e.ref({...i.modelValue}),O=e.computed(()=>i.api?g.value:i.tableData),d=e.computed(()=>i.api?f.value:i.pagination),A=e.computed(()=>i.api?h.value:i.tableProps.loading||!1),C=e.computed(()=>i.columns?.map(t=>{if(t.type===b.ACTION&&(Array.isArray(t.actions)||typeof t.actions=="function"))return{...t,align:"center",fixed:"right"};const{width:r,...a}=t;return{...a,minWidth:r}})),D=()=>{N.back()},T=(t,r)=>r.formatter?r.formatter(t[r.prop],t,r):t[r.prop],L=t=>E[t]!==void 0,y=(t,r)=>typeof t.actions=="function"?t.actions(r)||[]:t.actions||[],j=t=>t.length<3?t:t.slice(0,1),k=t=>t.length<3?[]:t.slice(1),m=(t={})=>{if(!i.api)return;h.value=!0;const r={...t,...i.apiParams,...c.value};i.showPagination&&(r.page=d.value.page,r.size=d.value.size),i.api(r).then(a=>{g.value=a?.data?.memberSo?.data||a?.data?.data||a?.data||[],f.value.total=a?.data?.totalNum||a?.data?.total||0,p(l.emitsMap.dataLoaded,{data:g.value,pagination:f.value,params:r,response:a?.data})}).catch(a=>{g.value=[],f.value.total=0,p(l.emitsMap.dataError,a)}).finally(()=>{h.value=!1})},v=()=>{i.api?(f.value.page=l.pageParams.pageNum,m()):p(l.emitsMap.search,c.value)},F=()=>{const t={};Object.keys(c.value).forEach(r=>{t[r]=void 0}),c.value=t,i.api?(f.value.page=l.pageParams.pageNum,m()):p(l.emitsMap.reset)},w=(t,r,a)=>{p(l.emitsMap.actionClick,{action:t,row:r,index:a})},q=(t,r)=>{switch(t){case l.operationConfigMap.search:v();break;case l.operationConfigMap.reset:F();break}},I=(t,r)=>{};return e.watch(()=>i.modelValue,t=>{c.value={...t}},{deep:!0,immediate:!0}),e.watch(()=>c.value,t=>{p(l.emitsMap.updateModelValue,{...t})},{deep:!0}),e.onMounted(()=>{i.autoLoad&&i.api&&m()}),V({loadData:m,handleSearch:v}),(t,r)=>(e.openBlock(),e.createElementBlock("div",H,[n.breadcrumb.show?(e.openBlock(),e.createElementBlock("div",{key:0,class:"flex items-center fz-14 pd-b-20 pointer",onClick:D},[e.createVNode(e.unref(u.ElIcon),{size:16},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.breadcrumb.icon||e.unref(x.IconZuo))))]),_:1}),e.createElementVNode("span",Y,e.toDisplayString(n.breadcrumb.text),1)])):e.createCommentVNode("",!0),n.searchFields&&n.searchFields.length>0?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass({"search-section pd-b-12 mg-b-12":!n.isSeparate,"bg-fff radius-4 pd-l-16 pd-r-16 pd-t-16 pd-b-16":n.isSeparate})},[e.createVNode(S.CustomTitle,{title:"查询"}),e.createVNode(e.unref(R.SearchBar),{ref_key:"searchFormRef",ref:M,items:n.searchFields,"filter-mode":!1,minWidth:n.minWidth,hideExpandButton:!1,fixedWidth:!0,maxHeight:32,modelValue:c.value,"onUpdate:modelValue":r[0]||(r[0]=a=>c.value=a),onOperation:q,onChange:I},null,8,["items","minWidth","modelValue"])],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["table-section flex-1 overflow-hidden flex flex-col",{"bg-fff radius-4 pd-l-16 pd-r-16 pd-t-16 pd-b-16 mg-t-16":n.isSeparate}])},[n.title?e.renderSlot(t.$slots,"title",{key:0},()=>[e.createVNode(S.CustomTitle,{title:n.title},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"title-actions",{},void 0,!0)]),_:3},8,["title"])],!0):e.createCommentVNode("",!0),e.createVNode(e.unref(u.ElTable),e.mergeProps({ref_key:"tableRef",ref:z,data:O.value,columns:C.value,"row-key":n.treeProps.rowKey,"tree-props":n.treeProps,"show-overflow-tooltip":!0},{...n.tableProps,loading:A.value},e.toHandlers(n.tableEvents),{class:"flex-1 admin-dashboard-table",border:""}),e.createSlots({default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.value,a=>(e.openBlock(),e.createBlock(e.unref(u.ElTableColumn),e.mergeProps({key:a.prop},{ref_for:!0},a),e.createSlots({_:2},[a.type===e.unref(b).ACTION?{name:"default",fn:e.withCtx(s=>[e.createElementVNode("div",K,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(j(y(a,s.row)),o=>(e.openBlock(),e.createBlock(e.unref(u.ElButton),{key:o.key||o.label,type:o.type||"primary",size:o.size||"small",disabled:o.disabled,loading:o.loading,text:o.text,link:o.link,icon:o.icon,onClick:Q=>w(o,s.row,s.$index)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.label),1)]),_:2},1032,["type","size","disabled","loading","text","link","icon","onClick"]))),128)),k(y(a,s.row)).length>0?(e.openBlock(),e.createBlock(e.unref(u.ElDropdown),{key:0,onCommand:o=>w(o,s.row,s.$index),trigger:"click"},{dropdown:e.withCtx(()=>[e.createVNode(e.unref(u.ElDropdownMenu),null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k(y(a,s.row)),o=>(e.openBlock(),e.createBlock(e.unref(u.ElDropdownItem),{key:o.key||o.label,command:o,disabled:o.disabled},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.label),1)]),_:2},1032,["command","disabled"]))),128))]),_:2},1024)]),default:e.withCtx(()=>[e.createVNode(e.unref(u.ElIcon),null,{default:e.withCtx(()=>[e.createVNode(e.unref(x.IconMore))]),_:1})]),_:2},1032,["onCommand"])):e.createCommentVNode("",!0)])]),key:"0"}:L(a.prop)?{name:"default",fn:e.withCtx(s=>[e.renderSlot(t.$slots,a.prop,{row:s.row,index:s.$index,column:a},void 0,!0)]),key:"1"}:{name:"default",fn:e.withCtx(s=>[e.createElementVNode("span",null,e.toDisplayString(T(s.row,a)),1)]),key:"2"}]),1040))),128))]),_:2},[e.renderList(n.customSlots,a=>({name:a,fn:e.withCtx(s=>[e.renderSlot(t.$slots,a,e.normalizeProps(e.guardReactiveProps(s)),void 0,!0)])}))]),1040,["data","columns","row-key","tree-props"]),n.showPagination?(e.openBlock(),e.createElementBlock("div",Z,[e.createVNode(e.unref(u.ElPagination),{"current-page":d.value.page,"onUpdate:currentPage":r[1]||(r[1]=a=>d.value.page=a),"page-size":d.value.size,"onUpdate:pageSize":r[2]||(r[2]=a=>d.value.size=a),"page-sizes":d.value.pageSizes,total:d.value.total,layout:d.value.layout,onSizeChange:m,onCurrentChange:m},null,8,["current-page","page-size","page-sizes","total","layout"])])):e.createCommentVNode("",!0)],2),e.renderSlot(t.$slots,"default",{},void 0,!0)]))}}),J=U._export_sfc(G,[["__scopeId","data-v-9075f216"]]),P=$.withInstall(J);exports.COLUMN_TYPES=b;exports.PageContainer=P;exports.default=P;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.search-section[data-v-
|
|
1
|
+
.search-section[data-v-9075f216]{border-bottom:1px solid var(--border-color)}.action-buttons[data-v-9075f216]{gap:8px;flex-wrap:wrap}.bg-fff[data-v-9075f216]{background-color:var(--background-color-2);border:1px solid var(--border-color)}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "china-mobile-international-custom-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.25",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"components",
|
|
6
6
|
"vue",
|
|
@@ -105,10 +105,10 @@
|
|
|
105
105
|
"peerDependencies": {
|
|
106
106
|
"axios": "^1.8.2",
|
|
107
107
|
"vue": "^3.5.26",
|
|
108
|
-
"color-star-atom-style": "0.0.2",
|
|
109
|
-
"color-message-aibox-vue": "0.0.80",
|
|
110
108
|
"color-message-lingyun-vue": "0.0.30",
|
|
109
|
+
"color-message-aibox-vue": "0.0.80",
|
|
111
110
|
"color-star-custom-methods": "0.0.17",
|
|
111
|
+
"color-star-atom-style": "0.0.2",
|
|
112
112
|
"color-star-custom-components": "0.0.18"
|
|
113
113
|
},
|
|
114
114
|
"optionalDependencies": {
|