sinosoft-common-button 1.2.7 → 1.2.8

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.
@@ -1,16 +1,16 @@
1
- import { openBlock as h, createElementBlock as c, createElementVNode as u, defineComponent as _, resolveComponent as a, createVNode as y, normalizeClass as v, normalizeStyle as f, withCtx as C, createCommentVNode as S, renderSlot as $, createBlock as w } from "vue";
1
+ import { openBlock as h, createElementBlock as f, createElementVNode as g, defineComponent as v, resolveComponent as u, createBlock as C, normalizeClass as w, normalizeStyle as a, withCtx as y, createCommentVNode as S, renderSlot as z, createVNode as _ } from "vue";
2
2
  /*! Element Plus Icons Vue v2.1.0 */
3
- var W = (t, e) => {
3
+ var k = (t, e) => {
4
4
  let r = t.__vccOpts || t;
5
5
  for (let [i, o] of e)
6
6
  r[i] = o;
7
7
  return r;
8
- }, k = {
8
+ }, W = {
9
9
  name: "Loading"
10
10
  }, x = {
11
11
  xmlns: "http://www.w3.org/2000/svg",
12
12
  viewBox: "0 0 1024 1024"
13
- }, F = /* @__PURE__ */ u(
13
+ }, F = /* @__PURE__ */ g(
14
14
  "path",
15
15
  {
16
16
  fill: "currentColor",
@@ -23,13 +23,13 @@ var W = (t, e) => {
23
23
  F
24
24
  ];
25
25
  function B(t, e, r, i, o, l) {
26
- return h(), c("svg", x, A);
26
+ return h(), f("svg", x, A);
27
27
  }
28
- var L = /* @__PURE__ */ W(k, [["render", B], ["__file", "loading.vue"]]);
29
- function g(t, e, r) {
28
+ var L = /* @__PURE__ */ k(W, [["render", B], ["__file", "loading.vue"]]);
29
+ function b(t, e, r) {
30
30
  for (var i = [], o = Math.max(t.length, e.length), l = 0, s = 0; s < o || l; ) {
31
- var n = s < t.length ? t[s] : 0, d = s < e.length ? e[s] : 0, p = l + n + d;
32
- i.push(p % r), l = Math.floor(p / r), s++;
31
+ var n = s < t.length ? t[s] : 0, c = s < e.length ? e[s] : 0, d = l + n + c;
32
+ i.push(d % r), l = Math.floor(d / r), s++;
33
33
  }
34
34
  return i;
35
35
  }
@@ -38,8 +38,8 @@ function m(t, e, r) {
38
38
  return null;
39
39
  if (t == 0)
40
40
  return [];
41
- for (var i = [], o = e; t & 1 && (i = g(i, o, r)), t = t >> 1, t !== 0; )
42
- o = g(o, o, r);
41
+ for (var i = [], o = e; t & 1 && (i = b(i, o, r)), t = t >> 1, t !== 0; )
42
+ o = b(o, o, r);
43
43
  return i;
44
44
  }
45
45
  function O(t, e) {
@@ -56,7 +56,7 @@ function R(t, e, r) {
56
56
  if (i === null)
57
57
  return null;
58
58
  for (var o = [], l = [1], s = 0; s < i.length; s++)
59
- i[s] && (o = g(
59
+ i[s] && (o = b(
60
60
  o,
61
61
  m(i[s], l, r),
62
62
  r
@@ -98,7 +98,7 @@ function N(t, e) {
98
98
  const T = new D({
99
99
  mid: 42,
100
100
  offset: (2019 - 1970) * 31536e3 * 1e3
101
- }), M = _({
101
+ }), H = v({
102
102
  components: {
103
103
  Loading: L
104
104
  },
@@ -145,6 +145,10 @@ const T = new D({
145
145
  type: Boolean,
146
146
  default: !1
147
147
  },
148
+ link: {
149
+ type: Boolean,
150
+ default: !1
151
+ },
148
152
  fontSize: {
149
153
  type: String,
150
154
  default: ""
@@ -314,6 +318,18 @@ const T = new D({
314
318
  fontWeight: this.fontWeight || 500,
315
319
  size: this.size,
316
320
  lineHeight: this.lineHeight || "24px"
321
+ } : this.link ? {
322
+ width: this.width,
323
+ height: this.height,
324
+ borderWidth: "0px",
325
+ borderStyle: `${this.borderStyle}`,
326
+ borderColor: `${this.borderColor || this.color || "#C4C4C4"}`,
327
+ color: this.color || "#E2A650",
328
+ borderRadius: this.circle || "8px",
329
+ fontSize: this.fontSize || "14px",
330
+ fontWeight: this.fontWeight || 500,
331
+ size: this.size,
332
+ lineHeight: this.lineHeight || "24px"
317
333
  } : {
318
334
  width: this.width,
319
335
  height: this.height,
@@ -363,54 +379,63 @@ const E = (t, e) => {
363
379
  for (const [i, o] of e)
364
380
  r[i] = o;
365
381
  return r;
366
- }, H = { class: "common-button" }, V = {
382
+ }, M = { class: "common-button" }, j = {
367
383
  key: 0,
368
384
  class: "s-icon"
369
- }, j = ["src"];
370
- function I(t, e, r, i, o, l) {
371
- const s = a("Loading"), n = a("el-icon"), d = a("el-button");
372
- return h(), c("div", H, [
373
- y(d, {
374
- class: v(["s-button", { plain: t.plain, btnhover: !t.plain, loading: t.loading }]),
385
+ }, V = ["src"], I = ["btnCode"];
386
+ function G(t, e, r, i, o, l) {
387
+ const s = u("Loading"), n = u("el-icon"), c = u("el-button");
388
+ return h(), f("div", M, [
389
+ t.link ? (h(), f("span", {
390
+ key: 1,
391
+ class: "link",
392
+ style: a(t.styleOjb),
393
+ btnCode: t.btnCode,
394
+ onClick: e[0] || (e[0] = (...d) => t.debouncedClick && t.debouncedClick(...d))
395
+ }, [
396
+ z(t.$slots, "default", {}, void 0, !0)
397
+ ], 12, I)) : (h(), C(c, {
398
+ key: 0,
399
+ class: w(["s-button", { plain: t.plain, btnhover: !t.plain, loading: t.loading }]),
375
400
  disabled: t.disabled,
376
401
  loading: t.loading,
377
- style: f(t.styleOjb),
402
+ style: a(t.styleOjb),
378
403
  onClick: t.debouncedClick,
379
404
  btnCode: t.btnCode
380
405
  }, {
381
- default: C(() => [
382
- t.icon ? (h(), c("i", V, [
383
- u("img", {
406
+ default: y(() => [
407
+ t.icon ? (h(), f("i", j, [
408
+ g("img", {
384
409
  src: t.geturl,
385
410
  alt: "",
386
- style: f(t.styleObject)
387
- }, null, 12, j)
411
+ style: a(t.styleObject)
412
+ }, null, 12, V)
388
413
  ])) : S("", !0),
389
- u("span", {
390
- style: f({ color: t.color })
414
+ g("span", {
415
+ style: a({ color: t.color })
391
416
  }, [
392
- $(t.$slots, "default", {}, void 0, !0)
417
+ z(t.$slots, "default", {}, void 0, !0)
393
418
  ], 4),
394
- t.loading ? (h(), w(n, {
419
+ t.loading ? (h(), C(n, {
395
420
  key: 1,
396
421
  class: "is-loading",
397
422
  color: t.loadingColor
398
423
  }, {
399
- default: C(() => [
400
- y(s)
424
+ default: y(() => [
425
+ _(s)
401
426
  ]),
402
427
  _: 1
403
428
  }, 8, ["color"])) : S("", !0)
404
429
  ]),
405
430
  _: 3
406
- }, 8, ["class", "disabled", "loading", "style", "onClick", "btnCode"])
431
+ }, 8, ["class", "disabled", "loading", "style", "onClick", "btnCode"]))
407
432
  ]);
408
433
  }
409
- const z = /* @__PURE__ */ E(M, [["render", I], ["__scopeId", "data-v-bcd0a5e0"]]);
410
- function b(t, e = {}) {
411
- b.installed || (b.installed = !0, t.component("common-button", z));
434
+ const $ = /* @__PURE__ */ E(H, [["render", G], ["__scopeId", "data-v-4118ea46"]]);
435
+ function p(t, e = {}) {
436
+ p.installed || (p.installed = !0, t.component("common-button", $));
412
437
  }
413
- z.install = b;
438
+ $.install = p;
414
439
  export {
415
- z as default
440
+ $ as default
416
441
  };
@@ -1 +1 @@
1
- (function(e,d){typeof exports=="object"&&typeof module<"u"?module.exports=d(require("vue")):typeof define=="function"&&define.amd?define(["vue"],d):(e=typeof globalThis<"u"?globalThis:e||self,e.button=d(e.Vue))})(this,function(e){"use strict";/*! Element Plus Icons Vue v2.1.0 */var d=(t,i)=>{let l=t.__vccOpts||t;for(let[o,r]of i)l[o]=r;return l},b={name:"Loading"},y={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},C=e.createElementVNode("path",{fill:"currentColor",d:"M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32zm0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32zm448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32zm-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32zM195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0zm-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"},null,-1),m=[C];function S(t,i,l,o,r,n){return e.openBlock(),e.createElementBlock("svg",y,m)}var z=d(b,[["render",S],["__file","loading.vue"]]);function a(t,i,l){for(var o=[],r=Math.max(t.length,i.length),n=0,s=0;s<r||n;){var h=s<t.length?t[s]:0,g=s<i.length?i[s]:0,p=n+h+g;o.push(p%l),n=Math.floor(p/l),s++}return o}function u(t,i,l){if(t<0)return null;if(t==0)return[];for(var o=[],r=i;t&1&&(o=a(o,r,l)),t=t>>1,t!==0;)r=a(r,r,l);return o}function _(t,i){for(var l=t.split(""),o=[],r=l.length-1;r>=0;r--){var n=parseInt(l[r],i);if(isNaN(n))return null;o.push(n)}return o}function $(t,i,l){var o=_(t,i);if(o===null)return null;for(var r=[],n=[1],s=0;s<o.length;s++)o[s]&&(r=a(r,u(o[s],n,l),l)),n=u(i,n,l);for(var h="",s=r.length-1;s>=0;s--)h+=r[s].toString(l);return h}function w(t){return t.substring(0,2)==="0x"&&(t=t.substring(2)),t=t.toLowerCase(),$(t,16,10)}class k{constructor(i){i=i||{},this.seq=0,this.mid=(i.mid||1)%1023,this.offset=i.offset||0,this.lastTime=0}generate(){const i=Date.now(),l=(i-this.offset).toString(2);this.lastTime==i?(this.seq++,this.seq>4095&&(this.seq=0)):this.seq=0,this.lastTime=i;let o=this.seq.toString(2),r=this.mid.toString(2);for(;o.length<12;)o="0"+o;for(;r.length<10;)r="0"+r;const n=l+r+o;let s="";for(let h=n.length;h>0;h-=4)s=parseInt(n.substring(h-4,h),2).toString(16)+s;return w(s)}}function W(t,i){let l;return(...o)=>{clearTimeout(l),l=setTimeout(()=>{t(...o)},i)}}const x=new k({mid:42,offset:(2019-1970)*31536e3*1e3}),v=e.defineComponent({components:{Loading:z},props:{disabled:{type:Boolean,default:!1},plain:{type:Boolean,default:!1},primary:{type:Boolean,default:!1},default:{type:Boolean,default:!1},primaryDialog:{type:Boolean,default:!1},primaryOrdinary:{type:Boolean,default:!1},info:{type:Boolean,default:!1},infoDialog:{type:Boolean,default:!1},infoOrdinary:{type:Boolean,default:!1},text:{type:Boolean,default:!1},fontSize:{type:String,default:""},btnCode:{type:String,default:""},circle:{type:String,default:""},height:{type:String,default:""},width:{type:String,default:""},color:{type:String,default:""},loadingColor:{type:String,default:"#333333"},bgColor:{type:String,default:""},borderColor:{type:String,default:""},loading:{type:Boolean,default:!1},borderStyle:{type:String,default:"solid"},icon:{type:String,required:!1},size:{type:[Number,String],default:"auto"},fontWeight:{type:Number,default:500},lineHeight:{type:String,default:""}},computed:{styleOjb(){return this.plain?{background:this.bgColor||"#fff",borderWidth:"1px",borderStyle:`${this.borderStyle}`,borderColor:`${this.borderColor||this.color||"#99004A"}`,color:this.color||"#99004A",width:this.width,height:this.height,borderRadius:this.circle,fontSize:this.fontSize||"16px",fontWeight:this.fontWeight||500,size:this.size}:this.primary?{background:this.bgColor||"#99004A",borderWidth:"1px",borderStyle:`${this.borderStyle}`,borderColor:`${this.borderColor||this.color||"#99004A"}`,color:this.color||"#ffffff",width:this.width,height:this.height,borderRadius:this.circle,fontWeight:this.fontWeight||500,size:this.size}:this.primaryOrdinary?{background:this.bgColor||"#99004A",borderWidth:"1px",borderStyle:`${this.borderStyle}`,borderColor:`${this.borderColor||this.color||"#99004A"}`,color:this.color||"#ffffff",width:`${this.width||"190px"}`,height:`${this.height||"52px"}`,borderRadius:this.circle,fontSize:this.fontSize||"16px",fontWeight:this.fontWeight||600,size:this.size}:this.primaryDialog?{minWidth:`${this.width||"250px"}`,height:`${this.height||"60px"}`,background:"#99004A",borderWidth:"1px",borderStyle:`${this.borderStyle}`,borderColor:`${this.borderColor||this.color||"#99004A"}`,color:this.color||"#ffffff",borderRadius:this.circle||"8px",fontSize:this.fontSize||"16px",fontWeight:this.fontWeight||560,size:this.size}:this.default?{background:this.bgColor||"#ffffff",borderWidth:"1px",borderStyle:`${this.borderStyle}`,borderColor:`${this.borderColor||this.color||"#DDE2E6"}`,color:this.color||"#99004A",width:this.width,height:this.height,borderRadius:this.circle,fontWeight:this.fontWeight||500,size:this.size}:this.info?{background:this.bgColor||"#C4C4C4",borderWidth:"1px",borderStyle:`${this.borderStyle}`,borderColor:`${this.borderColor||this.color||"#C4C4C4"}`,color:this.color||"#FFFFFF",width:this.width,height:this.height,borderRadius:this.circle,fontWeight:this.fontWeight||500,size:this.size}:this.infoDialog?{minWidth:`${this.width||"250px"}`,height:`${this.height||"60px"}`,background:this.bgColor||"#C4C4C4",borderWidth:"1px",borderStyle:`${this.borderStyle}`,borderColor:`${this.borderColor||this.color||"#C4C4C4"}`,color:this.color||"#FFFFFF",borderRadius:this.circle||"8px",fontSize:this.fontSize||"16px",fontWeight:this.fontWeight||600,size:this.size}:this.infoOrdinary?{width:`${this.width||"176px"}`,height:`${this.height||"52px"}`,background:this.bgColor||"#C4C4C4",borderWidth:"1px",borderStyle:`${this.borderStyle}`,borderColor:`${this.borderColor||this.color||"#C4C4C4"}`,color:this.color||"#FFFFFF",borderRadius:this.circle||"8px",fontSize:this.fontSize||"16px",fontWeight:this.fontWeight||600,size:this.size}:this.text?{width:`${this.width||"41px"}`,height:`${this.height||"24px"}`,background:this.bgColor||"#ffffff",borderWidth:"0px",borderStyle:`${this.borderStyle}`,borderColor:`${this.borderColor||this.color||"#C4C4C4"}`,color:this.color||"#E2A650",borderRadius:this.circle||"8px",fontSize:this.fontSize||"14px",fontWeight:this.fontWeight||500,size:this.size,lineHeight:this.lineHeight||"24px"}:{width:this.width,height:this.height,color:this.color||"#ffffff",background:this.bgColor||"#99004A",borderStyle:`${this.borderStyle}`,borderColor:`${this.borderColor||this.color||"#99004A"}`,borderRadius:this.circle||"8px",fontSize:this.fontSize||"16px",fontWeight:this.fontWeight||500,size:this.size||"20"}},geturl(){if(this.icon){if(this.icon.includes("/")||this.icon.includes("base64"))return this.icon;if(this.icon.includes("svg"))return`${this.icon}`}else return"";return`${this.icon}`},styleObject:function(){return{width:typeof this.size=="string"?this.size:this.size+"px",height:typeof this.size=="string"?this.size:this.size+"px"}}},emits:["handleClick"],setup(t,i){return{debouncedClick:W(r=>{let n=x.generate(),s=`${t.btnCode}_${n}`;console.log("按钮组件点击事件获取到事件对象及事件唯一标识符",r,s),t.btnCode?i.emit("handleClick",s):i.emit("handleClick","")},3e3)}}}),q="",B=(t,i)=>{const l=t.__vccOpts||t;for(const[o,r]of i)l[o]=r;return l},F={class:"common-button"},A={key:0,class:"s-icon"},N=["src"];function L(t,i,l,o,r,n){const s=e.resolveComponent("Loading"),h=e.resolveComponent("el-icon"),g=e.resolveComponent("el-button");return e.openBlock(),e.createElementBlock("div",F,[e.createVNode(g,{class:e.normalizeClass(["s-button",{plain:t.plain,btnhover:!t.plain,loading:t.loading}]),disabled:t.disabled,loading:t.loading,style:e.normalizeStyle(t.styleOjb),onClick:t.debouncedClick,btnCode:t.btnCode},{default:e.withCtx(()=>[t.icon?(e.openBlock(),e.createElementBlock("i",A,[e.createElementVNode("img",{src:t.geturl,alt:"",style:e.normalizeStyle(t.styleObject)},null,12,N)])):e.createCommentVNode("",!0),e.createElementVNode("span",{style:e.normalizeStyle({color:t.color})},[e.renderSlot(t.$slots,"default",{},void 0,!0)],4),t.loading?(e.openBlock(),e.createBlock(h,{key:1,class:"is-loading",color:t.loadingColor},{default:e.withCtx(()=>[e.createVNode(s)]),_:1},8,["color"])):e.createCommentVNode("",!0)]),_:3},8,["class","disabled","loading","style","onClick","btnCode"])])}const f=B(v,[["render",L],["__scopeId","data-v-bcd0a5e0"]]);function c(t,i={}){c.installed||(c.installed=!0,t.component("common-button",f))}return f.install=c,f});
1
+ (function(e,d){typeof exports=="object"&&typeof module<"u"?module.exports=d(require("vue")):typeof define=="function"&&define.amd?define(["vue"],d):(e=typeof globalThis<"u"?globalThis:e||self,e.button=d(e.Vue))})(this,function(e){"use strict";/*! Element Plus Icons Vue v2.1.0 */var d=(t,i)=>{let l=t.__vccOpts||t;for(let[o,r]of i)l[o]=r;return l},b={name:"Loading"},C={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},y=e.createElementVNode("path",{fill:"currentColor",d:"M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32zm0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32zm448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32zm-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32zM195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0zm-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"},null,-1),m=[y];function S(t,i,l,o,r,n){return e.openBlock(),e.createElementBlock("svg",C,m)}var z=d(b,[["render",S],["__file","loading.vue"]]);function f(t,i,l){for(var o=[],r=Math.max(t.length,i.length),n=0,s=0;s<r||n;){var h=s<t.length?t[s]:0,u=s<i.length?i[s]:0,a=n+h+u;o.push(a%l),n=Math.floor(a/l),s++}return o}function p(t,i,l){if(t<0)return null;if(t==0)return[];for(var o=[],r=i;t&1&&(o=f(o,r,l)),t=t>>1,t!==0;)r=f(r,r,l);return o}function k(t,i){for(var l=t.split(""),o=[],r=l.length-1;r>=0;r--){var n=parseInt(l[r],i);if(isNaN(n))return null;o.push(n)}return o}function $(t,i,l){var o=k(t,i);if(o===null)return null;for(var r=[],n=[1],s=0;s<o.length;s++)o[s]&&(r=f(r,p(o[s],n,l),l)),n=p(i,n,l);for(var h="",s=r.length-1;s>=0;s--)h+=r[s].toString(l);return h}function w(t){return t.substring(0,2)==="0x"&&(t=t.substring(2)),t=t.toLowerCase(),$(t,16,10)}class _{constructor(i){i=i||{},this.seq=0,this.mid=(i.mid||1)%1023,this.offset=i.offset||0,this.lastTime=0}generate(){const i=Date.now(),l=(i-this.offset).toString(2);this.lastTime==i?(this.seq++,this.seq>4095&&(this.seq=0)):this.seq=0,this.lastTime=i;let o=this.seq.toString(2),r=this.mid.toString(2);for(;o.length<12;)o="0"+o;for(;r.length<10;)r="0"+r;const n=l+r+o;let s="";for(let h=n.length;h>0;h-=4)s=parseInt(n.substring(h-4,h),2).toString(16)+s;return w(s)}}function W(t,i){let l;return(...o)=>{clearTimeout(l),l=setTimeout(()=>{t(...o)},i)}}const x=new _({mid:42,offset:(2019-1970)*31536e3*1e3}),B=e.defineComponent({components:{Loading:z},props:{disabled:{type:Boolean,default:!1},plain:{type:Boolean,default:!1},primary:{type:Boolean,default:!1},default:{type:Boolean,default:!1},primaryDialog:{type:Boolean,default:!1},primaryOrdinary:{type:Boolean,default:!1},info:{type:Boolean,default:!1},infoDialog:{type:Boolean,default:!1},infoOrdinary:{type:Boolean,default:!1},text:{type:Boolean,default:!1},link:{type:Boolean,default:!1},fontSize:{type:String,default:""},btnCode:{type:String,default:""},circle:{type:String,default:""},height:{type:String,default:""},width:{type:String,default:""},color:{type:String,default:""},loadingColor:{type:String,default:"#333333"},bgColor:{type:String,default:""},borderColor:{type:String,default:""},loading:{type:Boolean,default:!1},borderStyle:{type:String,default:"solid"},icon:{type:String,required:!1},size:{type:[Number,String],default:"auto"},fontWeight:{type:Number,default:500},lineHeight:{type:String,default:""}},computed:{styleOjb(){return this.plain?{background:this.bgColor||"#fff",borderWidth:"1px",borderStyle:`${this.borderStyle}`,borderColor:`${this.borderColor||this.color||"#99004A"}`,color:this.color||"#99004A",width:this.width,height:this.height,borderRadius:this.circle,fontSize:this.fontSize||"16px",fontWeight:this.fontWeight||500,size:this.size}:this.primary?{background:this.bgColor||"#99004A",borderWidth:"1px",borderStyle:`${this.borderStyle}`,borderColor:`${this.borderColor||this.color||"#99004A"}`,color:this.color||"#ffffff",width:this.width,height:this.height,borderRadius:this.circle,fontWeight:this.fontWeight||500,size:this.size}:this.primaryOrdinary?{background:this.bgColor||"#99004A",borderWidth:"1px",borderStyle:`${this.borderStyle}`,borderColor:`${this.borderColor||this.color||"#99004A"}`,color:this.color||"#ffffff",width:`${this.width||"190px"}`,height:`${this.height||"52px"}`,borderRadius:this.circle,fontSize:this.fontSize||"16px",fontWeight:this.fontWeight||600,size:this.size}:this.primaryDialog?{minWidth:`${this.width||"250px"}`,height:`${this.height||"60px"}`,background:"#99004A",borderWidth:"1px",borderStyle:`${this.borderStyle}`,borderColor:`${this.borderColor||this.color||"#99004A"}`,color:this.color||"#ffffff",borderRadius:this.circle||"8px",fontSize:this.fontSize||"16px",fontWeight:this.fontWeight||560,size:this.size}:this.default?{background:this.bgColor||"#ffffff",borderWidth:"1px",borderStyle:`${this.borderStyle}`,borderColor:`${this.borderColor||this.color||"#DDE2E6"}`,color:this.color||"#99004A",width:this.width,height:this.height,borderRadius:this.circle,fontWeight:this.fontWeight||500,size:this.size}:this.info?{background:this.bgColor||"#C4C4C4",borderWidth:"1px",borderStyle:`${this.borderStyle}`,borderColor:`${this.borderColor||this.color||"#C4C4C4"}`,color:this.color||"#FFFFFF",width:this.width,height:this.height,borderRadius:this.circle,fontWeight:this.fontWeight||500,size:this.size}:this.infoDialog?{minWidth:`${this.width||"250px"}`,height:`${this.height||"60px"}`,background:this.bgColor||"#C4C4C4",borderWidth:"1px",borderStyle:`${this.borderStyle}`,borderColor:`${this.borderColor||this.color||"#C4C4C4"}`,color:this.color||"#FFFFFF",borderRadius:this.circle||"8px",fontSize:this.fontSize||"16px",fontWeight:this.fontWeight||600,size:this.size}:this.infoOrdinary?{width:`${this.width||"176px"}`,height:`${this.height||"52px"}`,background:this.bgColor||"#C4C4C4",borderWidth:"1px",borderStyle:`${this.borderStyle}`,borderColor:`${this.borderColor||this.color||"#C4C4C4"}`,color:this.color||"#FFFFFF",borderRadius:this.circle||"8px",fontSize:this.fontSize||"16px",fontWeight:this.fontWeight||600,size:this.size}:this.text?{width:`${this.width||"41px"}`,height:`${this.height||"24px"}`,background:this.bgColor||"#ffffff",borderWidth:"0px",borderStyle:`${this.borderStyle}`,borderColor:`${this.borderColor||this.color||"#C4C4C4"}`,color:this.color||"#E2A650",borderRadius:this.circle||"8px",fontSize:this.fontSize||"14px",fontWeight:this.fontWeight||500,size:this.size,lineHeight:this.lineHeight||"24px"}:this.link?{width:this.width,height:this.height,borderWidth:"0px",borderStyle:`${this.borderStyle}`,borderColor:`${this.borderColor||this.color||"#C4C4C4"}`,color:this.color||"#E2A650",borderRadius:this.circle||"8px",fontSize:this.fontSize||"14px",fontWeight:this.fontWeight||500,size:this.size,lineHeight:this.lineHeight||"24px"}:{width:this.width,height:this.height,color:this.color||"#ffffff",background:this.bgColor||"#99004A",borderStyle:`${this.borderStyle}`,borderColor:`${this.borderColor||this.color||"#99004A"}`,borderRadius:this.circle||"8px",fontSize:this.fontSize||"16px",fontWeight:this.fontWeight||500,size:this.size||"20"}},geturl(){if(this.icon){if(this.icon.includes("/")||this.icon.includes("base64"))return this.icon;if(this.icon.includes("svg"))return`${this.icon}`}else return"";return`${this.icon}`},styleObject:function(){return{width:typeof this.size=="string"?this.size:this.size+"px",height:typeof this.size=="string"?this.size:this.size+"px"}}},emits:["handleClick"],setup(t,i){return{debouncedClick:W(r=>{let n=x.generate(),s=`${t.btnCode}_${n}`;console.log("按钮组件点击事件获取到事件对象及事件唯一标识符",r,s),t.btnCode?i.emit("handleClick",s):i.emit("handleClick","")},3e3)}}}),O="",v=(t,i)=>{const l=t.__vccOpts||t;for(const[o,r]of i)l[o]=r;return l},F={class:"common-button"},A={key:0,class:"s-icon"},E=["src"],L=["btnCode"];function N(t,i,l,o,r,n){const s=e.resolveComponent("Loading"),h=e.resolveComponent("el-icon"),u=e.resolveComponent("el-button");return e.openBlock(),e.createElementBlock("div",F,[t.link?(e.openBlock(),e.createElementBlock("span",{key:1,class:"link",style:e.normalizeStyle(t.styleOjb),btnCode:t.btnCode,onClick:i[0]||(i[0]=(...a)=>t.debouncedClick&&t.debouncedClick(...a))},[e.renderSlot(t.$slots,"default",{},void 0,!0)],12,L)):(e.openBlock(),e.createBlock(u,{key:0,class:e.normalizeClass(["s-button",{plain:t.plain,btnhover:!t.plain,loading:t.loading}]),disabled:t.disabled,loading:t.loading,style:e.normalizeStyle(t.styleOjb),onClick:t.debouncedClick,btnCode:t.btnCode},{default:e.withCtx(()=>[t.icon?(e.openBlock(),e.createElementBlock("i",A,[e.createElementVNode("img",{src:t.geturl,alt:"",style:e.normalizeStyle(t.styleObject)},null,12,E)])):e.createCommentVNode("",!0),e.createElementVNode("span",{style:e.normalizeStyle({color:t.color})},[e.renderSlot(t.$slots,"default",{},void 0,!0)],4),t.loading?(e.openBlock(),e.createBlock(h,{key:1,class:"is-loading",color:t.loadingColor},{default:e.withCtx(()=>[e.createVNode(s)]),_:1},8,["color"])):e.createCommentVNode("",!0)]),_:3},8,["class","disabled","loading","style","onClick","btnCode"]))])}const c=v(B,[["render",N],["__scopeId","data-v-4118ea46"]]);function g(t,i={}){g.installed||(g.installed=!0,t.component("common-button",c))}return c.install=g,c});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sinosoft-common-button",
3
- "version": "1.2.7",
3
+ "version": "1.2.8",
4
4
  "description": "",
5
5
  "main": "common-button.es.js",
6
6
  "scripts": {
package/style.css CHANGED
@@ -1 +1 @@
1
- .s-button[data-v-bcd0a5e0]{display:inline-block;height:36px;line-height:1;border:none;background:#99004A;padding:0 19px;border-radius:7px;cursor:pointer;white-space:nowrap;text-align:center;transition:all .5s ease-in-out;user-select:none}.s-button+.s-button[data-v-bcd0a5e0]{margin-left:15px}.s-button span[data-v-bcd0a5e0]{display:inline-block;margin:0 4px;text-justify:auto;line-height:1}.s-button>*[data-v-bcd0a5e0]{vertical-align:middle}.plain[data-v-bcd0a5e0]{background:#fff}.plain-icon[data-v-bcd0a5e0]{margin-right:4px}.loading[data-v-bcd0a5e0]{opacity:.8}.s-icon[data-v-bcd0a5e0]{display:inline-block;line-height:1;flex-shrink:0;overflow:hidden}.s-icon img[data-v-bcd0a5e0]{float:left;width:25px;height:25px}
1
+ .s-button[data-v-4118ea46]{display:inline-block;height:36px;line-height:1;border:none;background:#99004A;padding:0 19px;border-radius:7px;cursor:pointer;white-space:nowrap;text-align:center;transition:all .5s ease-in-out;user-select:none}.s-button+.s-button[data-v-4118ea46]{margin-left:15px}.s-button span[data-v-4118ea46]{display:inline-block;margin:0 4px;text-justify:auto;line-height:1}.s-button>*[data-v-4118ea46]{vertical-align:middle}.link[data-v-4118ea46]:hover{cursor:pointer;color:red}.plain[data-v-4118ea46]{background:#fff}.plain-icon[data-v-4118ea46]{margin-right:4px}.loading[data-v-4118ea46]{opacity:.8}.s-icon[data-v-4118ea46]{display:inline-block;line-height:1;flex-shrink:0;overflow:hidden}.s-icon img[data-v-4118ea46]{float:left;width:25px;height:25px}