ysyt-react-agent-lib 1.0.8 → 1.0.9

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.
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-zOLeMqZK.js"),s=require("react"),a=require("./index-D7DHU94M.js"),c=s.memo(({open:n,onCallBack:r,queryFetch:i})=>{const[o,x]=s.useState([]);return s.useEffect(()=>{(async()=>{try{await i({success:t=>{x(t.data||[])}})}catch{}})()},[n]),e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsx(a.Modal,{open:n,title:"咨询",footer:!1,onCancel:()=>r(),children:e.jsxRuntimeExports.jsx(e.ModelBody,{children:o.length===0?e.jsxRuntimeExports.jsx(e.Empty,{image:e.Empty.PRESENTED_IMAGE_SIMPLE}):e.jsxRuntimeExports.jsx(e.Space,{wrap:!0,children:o.map(t=>e.jsxRuntimeExports.jsxs(a.Tag,{color:"processing",onClick:()=>r(t.agent_no),children:[e.jsxRuntimeExports.jsxs("span",{style:{marginRight:10},children:["咨询坐席: ",t.agent_name]}),e.jsxRuntimeExports.jsx(e.YsytIconSvg,{name:"zixun"})]},t.agent_no))})})})})});exports.default=c;
@@ -0,0 +1,27 @@
1
+ import { j as s, M as i, E as r, S as l, Y as m } from "./index-1QbXooTs.mjs";
2
+ import { memo as g, useState as d, useEffect as x } from "react";
3
+ import { M as j, T as p } from "./index-C2_klygC.mjs";
4
+ const f = g(({ open: e, onCallBack: t, queryFetch: o }) => {
5
+ const [n, c] = d([]);
6
+ return x(() => {
7
+ (async () => {
8
+ try {
9
+ await o({
10
+ success: (a) => {
11
+ c(a.data || []);
12
+ }
13
+ });
14
+ } catch {
15
+ }
16
+ })();
17
+ }, [e]), /* @__PURE__ */ s.jsx(s.Fragment, { children: /* @__PURE__ */ s.jsx(j, { open: e, title: "咨询", footer: !1, onCancel: () => t(), children: /* @__PURE__ */ s.jsx(i, { children: n.length === 0 ? /* @__PURE__ */ s.jsx(r, { image: r.PRESENTED_IMAGE_SIMPLE }) : /* @__PURE__ */ s.jsx(l, { wrap: !0, children: n.map((a) => /* @__PURE__ */ s.jsxs(p, { color: "processing", onClick: () => t(a.agent_no), children: [
18
+ /* @__PURE__ */ s.jsxs("span", { style: { marginRight: 10 }, children: [
19
+ "咨询坐席: ",
20
+ a.agent_name
21
+ ] }),
22
+ /* @__PURE__ */ s.jsx(m, { name: "zixun" })
23
+ ] }, a.agent_no)) }) }) }) });
24
+ });
25
+ export {
26
+ f as default
27
+ };
@@ -1,8 +1,70 @@
1
- import { g as ie, m as le, u as D, r as W, a as K, _ as se, b as Q, c as de, d as q, e as X, f as ce, h as Y, w as U, C as A, i as ue, F as be, k as pe, l as Z, D as ge, W as fe, T as he, n as Ce, o as ve, p as me, j as w, M as Se, q as ye, S as ke, Y as xe, I as $e } from "./index-Dsoe_UAg.mjs";
2
- import { M as Re, T as we } from "./index-BJ5Kzufd.mjs";
1
+ import { _ as ie, u as K, a as le, c as q, b as X, d as se, e as Y, w as U, g as de, m as ce, f as D, r as W, h as Q, C as A, i as ue, F as be, k as pe, l as Z, D as ge, W as fe, T as he, n as Ce, o as ve, p as me, j as w, M as Se, q as ye, S as ke, Y as xe, I as $e } from "./index-1QbXooTs.mjs";
3
2
  import * as a from "react";
4
- import Ee, { forwardRef as Ie, useRef as J, useImperativeHandle as Pe, memo as Be, useState as V, useEffect as Oe } from "react";
5
- const je = (e) => {
3
+ import Re, { forwardRef as we, useRef as J, useImperativeHandle as Ee, memo as Ie, useState as V, useEffect as Pe } from "react";
4
+ import { M as Be, T as Oe } from "./index-C2_klygC.mjs";
5
+ const ee = /* @__PURE__ */ a.createContext(null), je = ee.Provider, oe = /* @__PURE__ */ a.createContext(null), _e = oe.Provider;
6
+ var ze = ["prefixCls", "className", "style", "checked", "disabled", "defaultChecked", "type", "title", "onChange"], De = /* @__PURE__ */ we(function(e, r) {
7
+ var n = e.prefixCls, o = n === void 0 ? "rc-checkbox" : n, t = e.className, i = e.style, f = e.checked, p = e.disabled, s = e.defaultChecked, x = s === void 0 ? !1 : s, g = e.type, l = g === void 0 ? "checkbox" : g, I = e.title, k = e.onChange, E = ie(e, ze), m = J(null), c = J(null), $ = K(x, {
8
+ value: f
9
+ }), h = le($, 2), S = h[0], y = h[1];
10
+ Ee(r, function() {
11
+ return {
12
+ focus: function(v) {
13
+ var u;
14
+ (u = m.current) === null || u === void 0 || u.focus(v);
15
+ },
16
+ blur: function() {
17
+ var v;
18
+ (v = m.current) === null || v === void 0 || v.blur();
19
+ },
20
+ input: m.current,
21
+ nativeElement: c.current
22
+ };
23
+ });
24
+ var P = q(o, t, X(X({}, "".concat(o, "-checked"), S), "".concat(o, "-disabled"), p)), d = function(v) {
25
+ p || ("checked" in e || y(v.target.checked), k == null || k({
26
+ target: Y(Y({}, e), {}, {
27
+ type: l,
28
+ checked: v.target.checked
29
+ }),
30
+ stopPropagation: function() {
31
+ v.stopPropagation();
32
+ },
33
+ preventDefault: function() {
34
+ v.preventDefault();
35
+ },
36
+ nativeEvent: v.nativeEvent
37
+ }));
38
+ };
39
+ return /* @__PURE__ */ a.createElement("span", {
40
+ className: P,
41
+ title: I,
42
+ style: i,
43
+ ref: c
44
+ }, /* @__PURE__ */ a.createElement("input", se({}, E, {
45
+ className: "".concat(o, "-input"),
46
+ ref: m,
47
+ onChange: d,
48
+ disabled: p,
49
+ checked: !!S,
50
+ type: l
51
+ })), /* @__PURE__ */ a.createElement("span", {
52
+ className: "".concat(o, "-inner")
53
+ }));
54
+ });
55
+ function Te(e) {
56
+ const r = Re.useRef(null), n = () => {
57
+ U.cancel(r.current), r.current = null;
58
+ };
59
+ return [() => {
60
+ n(), r.current = U(() => {
61
+ r.current = null;
62
+ });
63
+ }, (i) => {
64
+ r.current && (i.stopPropagation(), n()), e == null || e(i);
65
+ }];
66
+ }
67
+ const Ne = (e) => {
6
68
  const {
7
69
  componentCls: r,
8
70
  antCls: n
@@ -26,7 +88,7 @@ const je = (e) => {
26
88
  }
27
89
  })
28
90
  };
29
- }, _e = (e) => {
91
+ }, Me = (e) => {
30
92
  const {
31
93
  componentCls: r,
32
94
  wrapperMarginInlineEnd: n,
@@ -102,7 +164,7 @@ const je = (e) => {
102
164
  &:hover ${S}`]: {
103
165
  borderColor: o
104
166
  },
105
- [`${r}-input:focus-visible + ${S}`]: Object.assign({}, K(e)),
167
+ [`${r}-input:focus-visible + ${S}`]: Object.assign({}, Q(e)),
106
168
  [`${r}:hover::after, ${r}-wrapper:hover &::after`]: {
107
169
  visibility: "visible"
108
170
  },
@@ -194,7 +256,7 @@ const je = (e) => {
194
256
  }
195
257
  })
196
258
  };
197
- }, ze = (e) => {
259
+ }, Le = (e) => {
198
260
  const {
199
261
  buttonColor: r,
200
262
  controlHeight: n,
@@ -318,7 +380,7 @@ const je = (e) => {
318
380
  position: "relative",
319
381
  color: u
320
382
  },
321
- "&:has(:focus-visible)": Object.assign({}, K(e)),
383
+ "&:has(:focus-visible)": Object.assign({}, Q(e)),
322
384
  [`${o}-inner, input[type='checkbox'], input[type='radio']`]: {
323
385
  width: 0,
324
386
  height: 0,
@@ -389,7 +451,7 @@ const je = (e) => {
389
451
  }
390
452
  }
391
453
  };
392
- }, De = (e) => {
454
+ }, Ve = (e) => {
393
455
  const {
394
456
  wireframe: r,
395
457
  padding: n,
@@ -427,82 +489,21 @@ const je = (e) => {
427
489
  radioColor: r ? l : E,
428
490
  radioBgColor: r ? p : l
429
491
  };
430
- }, ee = ie("Radio", (e) => {
492
+ }, te = de("Radio", (e) => {
431
493
  const {
432
494
  controlOutline: r,
433
495
  controlOutlineWidth: n
434
- } = e, o = `0 0 0 ${D(n)} ${r}`, i = le(e, {
496
+ } = e, o = `0 0 0 ${D(n)} ${r}`, i = ce(e, {
435
497
  radioFocusShadow: o,
436
498
  radioButtonFocusShadow: o
437
499
  });
438
- return [je(i), _e(i), ze(i)];
439
- }, De, {
500
+ return [Ne(i), Me(i), Le(i)];
501
+ }, Ve, {
440
502
  unitless: {
441
503
  radioSize: !0,
442
504
  dotSize: !0
443
505
  }
444
- }), oe = /* @__PURE__ */ a.createContext(null), Te = oe.Provider, te = /* @__PURE__ */ a.createContext(null), Ne = te.Provider;
445
- var Me = ["prefixCls", "className", "style", "checked", "disabled", "defaultChecked", "type", "title", "onChange"], Le = /* @__PURE__ */ Ie(function(e, r) {
446
- var n = e.prefixCls, o = n === void 0 ? "rc-checkbox" : n, t = e.className, i = e.style, f = e.checked, p = e.disabled, s = e.defaultChecked, x = s === void 0 ? !1 : s, g = e.type, l = g === void 0 ? "checkbox" : g, I = e.title, k = e.onChange, E = se(e, Me), m = J(null), c = J(null), $ = Q(x, {
447
- value: f
448
- }), h = de($, 2), S = h[0], y = h[1];
449
- Pe(r, function() {
450
- return {
451
- focus: function(v) {
452
- var u;
453
- (u = m.current) === null || u === void 0 || u.focus(v);
454
- },
455
- blur: function() {
456
- var v;
457
- (v = m.current) === null || v === void 0 || v.blur();
458
- },
459
- input: m.current,
460
- nativeElement: c.current
461
- };
462
- });
463
- var P = q(o, t, X(X({}, "".concat(o, "-checked"), S), "".concat(o, "-disabled"), p)), d = function(v) {
464
- p || ("checked" in e || y(v.target.checked), k == null || k({
465
- target: Y(Y({}, e), {}, {
466
- type: l,
467
- checked: v.target.checked
468
- }),
469
- stopPropagation: function() {
470
- v.stopPropagation();
471
- },
472
- preventDefault: function() {
473
- v.preventDefault();
474
- },
475
- nativeEvent: v.nativeEvent
476
- }));
477
- };
478
- return /* @__PURE__ */ a.createElement("span", {
479
- className: P,
480
- title: I,
481
- style: i,
482
- ref: c
483
- }, /* @__PURE__ */ a.createElement("input", ce({}, E, {
484
- className: "".concat(o, "-input"),
485
- ref: m,
486
- onChange: d,
487
- disabled: p,
488
- checked: !!S,
489
- type: l
490
- })), /* @__PURE__ */ a.createElement("span", {
491
- className: "".concat(o, "-inner")
492
- }));
493
506
  });
494
- function Ve(e) {
495
- const r = Ee.useRef(null), n = () => {
496
- U.cancel(r.current), r.current = null;
497
- };
498
- return [() => {
499
- n(), r.current = U(() => {
500
- r.current = null;
501
- });
502
- }, (i) => {
503
- r.current && (i.stopPropagation(), n()), e == null || e(i);
504
- }];
505
- }
506
507
  var qe = function(e, r) {
507
508
  var n = {};
508
509
  for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && r.indexOf(o) < 0 && (n[o] = e[o]);
@@ -512,7 +513,7 @@ var qe = function(e, r) {
512
513
  };
513
514
  const Ge = (e, r) => {
514
515
  var n, o;
515
- const t = a.useContext(oe), i = a.useContext(te), {
516
+ const t = a.useContext(ee), i = a.useContext(oe), {
516
517
  getPrefixCls: f,
517
518
  direction: p,
518
519
  radio: s
@@ -533,7 +534,7 @@ const Ge = (e, r) => {
533
534
  children: c,
534
535
  style: $,
535
536
  title: h
536
- } = e, S = qe(e, ["prefixCls", "className", "rootClassName", "children", "style", "title"]), y = f("radio", k), P = ((t == null ? void 0 : t.optionType) || i) === "button", d = P ? `${y}-button` : y, j = Z(y), [v, u, _] = ee(y, j), b = Object.assign({}, S), B = a.useContext(ge);
537
+ } = e, S = qe(e, ["prefixCls", "className", "rootClassName", "children", "style", "title"]), y = f("radio", k), P = ((t == null ? void 0 : t.optionType) || i) === "button", d = P ? `${y}-button` : y, j = Z(y), [v, u, _] = te(y, j), b = Object.assign({}, S), B = a.useContext(ge);
537
538
  t && (b.name = t.name, b.onChange = I, b.checked = e.value === t.value, b.disabled = (n = b.disabled) !== null && n !== void 0 ? n : t.disabled), b.disabled = (o = b.disabled) !== null && o !== void 0 ? o : B;
538
539
  const O = q(`${d}-wrapper`, {
539
540
  [`${d}-wrapper-checked`]: b.checked,
@@ -541,7 +542,7 @@ const Ge = (e, r) => {
541
542
  [`${d}-wrapper-rtl`]: p === "rtl",
542
543
  [`${d}-wrapper-in-form-item`]: l,
543
544
  [`${d}-wrapper-block`]: !!(t != null && t.block)
544
- }, s == null ? void 0 : s.className, E, m, u, _, j), [z, R] = Ve(b.onClick);
545
+ }, s == null ? void 0 : s.className, E, m, u, _, j), [z, R] = Te(b.onClick);
545
546
  return v(/* @__PURE__ */ a.createElement(fe, {
546
547
  component: "Radio",
547
548
  disabled: b.disabled
@@ -552,7 +553,7 @@ const Ge = (e, r) => {
552
553
  onMouseLeave: e.onMouseLeave,
553
554
  title: h,
554
555
  onClick: z
555
- }, /* @__PURE__ */ a.createElement(Le, Object.assign({}, b, {
556
+ }, /* @__PURE__ */ a.createElement(De, Object.assign({}, b, {
556
557
  className: q(b.className, {
557
558
  [he]: !P
558
559
  }),
@@ -590,12 +591,12 @@ const We = /* @__PURE__ */ a.forwardRef((e, r) => {
590
591
  onMouseLeave: d,
591
592
  onFocus: j,
592
593
  onBlur: v
593
- } = e, [u, _] = Q($, {
594
+ } = e, [u, _] = K($, {
594
595
  value: h
595
596
  }), b = a.useCallback((C) => {
596
597
  const ae = u, F = C.target.value;
597
598
  "value" in e || _(F), F !== ae && (y == null || y(C));
598
- }, [u, _, y]), B = n("radio", i), O = `${B}-group`, z = Z(B), [R, T, M] = ee(B, z);
599
+ }, [u, _, y]), B = n("radio", i), O = `${B}-group`, z = Z(B), [R, T, M] = te(B, z);
599
600
  let N = l;
600
601
  s && s.length > 0 && (N = s.map((C) => typeof C == "string" || typeof C == "number" ? /* @__PURE__ */ a.createElement(L, {
601
602
  key: C.toString(),
@@ -638,7 +639,7 @@ const We = /* @__PURE__ */ a.forwardRef((e, r) => {
638
639
  onBlur: v,
639
640
  id: E,
640
641
  ref: r
641
- }), /* @__PURE__ */ a.createElement(Te, {
642
+ }), /* @__PURE__ */ a.createElement(je, {
642
643
  value: ne
643
644
  }, N)));
644
645
  }), Ae = /* @__PURE__ */ a.memo(We);
@@ -655,7 +656,7 @@ const Fe = (e, r) => {
655
656
  } = a.useContext(A), {
656
657
  prefixCls: o
657
658
  } = e, t = He(e, ["prefixCls"]), i = n("radio", o);
658
- return /* @__PURE__ */ a.createElement(Ne, {
659
+ return /* @__PURE__ */ a.createElement(_e, {
659
660
  value: "button"
660
661
  }, /* @__PURE__ */ a.createElement(L, Object.assign({
661
662
  prefixCls: i
@@ -667,13 +668,9 @@ const Fe = (e, r) => {
667
668
  G.Button = Xe;
668
669
  G.Group = Ae;
669
670
  G.__ANT_RADIO = !0;
670
- const Ke = Be(({
671
- open: e,
672
- onCallBack: r,
673
- queryFetch: n
674
- }) => {
671
+ const Ke = Ie(({ open: e, onCallBack: r, queryFetch: n }) => {
675
672
  const [o, t] = V([]), [i, f] = V(0), [p, s] = V(""), [x, g] = V(!1);
676
- return Oe(() => {
673
+ return Pe(() => {
677
674
  (async () => {
678
675
  g(!0);
679
676
  try {
@@ -682,65 +679,49 @@ const Ke = Be(({
682
679
  t(l.data || []);
683
680
  }
684
681
  });
685
- } catch (l) {
686
- console.log(l);
682
+ } catch {
687
683
  }
688
684
  g(!1);
689
685
  })();
690
- }, [e]), /* @__PURE__ */ w.jsx(w.Fragment, {
691
- children: /* @__PURE__ */ w.jsx(Re, {
692
- open: e,
693
- title: "转接",
694
- footer: !1,
695
- onCancel: () => r(),
696
- children: /* @__PURE__ */ w.jsxs(Se, {
697
- children: [/* @__PURE__ */ w.jsx("div", {
698
- children: /* @__PURE__ */ w.jsx(G.Group, {
699
- options: [{
700
- label: "转接坐席",
701
- value: 0
702
- }, {
703
- label: "转接技能组",
704
- value: 1
705
- }],
706
- value: i,
707
- onChange: (l) => f(l.target.value)
708
- })
709
- }), /* @__PURE__ */ w.jsx(ye, {
710
- spinning: x,
711
- children: /* @__PURE__ */ w.jsxs("div", {
712
- style: {
713
- borderTop: "1px solid #eee",
714
- marginTop: 10,
715
- paddingTop: 10
716
- },
717
- children: [i === 0 && /* @__PURE__ */ w.jsx(ke, {
718
- wrap: !0,
719
- children: o.map((l) => /* @__PURE__ */ w.jsxs(we, {
720
- color: "processing",
721
- onClick: () => r(l.agent_no),
722
- children: [/* @__PURE__ */ w.jsxs("span", {
723
- style: {
724
- marginRight: 10
725
- },
726
- children: ["咨询坐席: ", l.agent_name]
727
- }), /* @__PURE__ */ w.jsx(xe, {
728
- name: "zixun"
729
- })]
730
- }, l.agent_no))
731
- }), i === 1 && /* @__PURE__ */ w.jsx($e, {
732
- value: p,
733
- onChange: (l) => s(l.target.value),
734
- placeholder: "请输入外线号码, 回车转接",
735
- onPressEnter: () => {
736
- r(p);
737
- }
738
- })]
739
- })
740
- })]
741
- })
742
- })
743
- });
686
+ }, [e]), /* @__PURE__ */ w.jsx(w.Fragment, { children: /* @__PURE__ */ w.jsx(Be, { open: e, title: "转接", footer: !1, onCancel: () => r(), children: /* @__PURE__ */ w.jsxs(Se, { children: [
687
+ /* @__PURE__ */ w.jsx("div", { children: /* @__PURE__ */ w.jsx(
688
+ G.Group,
689
+ {
690
+ options: [
691
+ {
692
+ label: "转接坐席",
693
+ value: 0
694
+ },
695
+ {
696
+ label: "转接外线",
697
+ value: 1
698
+ }
699
+ ],
700
+ value: i,
701
+ onChange: (l) => f(l.target.value)
702
+ }
703
+ ) }),
704
+ /* @__PURE__ */ w.jsx(ye, { spinning: x, children: /* @__PURE__ */ w.jsxs("div", { style: { borderTop: "1px solid #eee", marginTop: 10, paddingTop: 10 }, children: [
705
+ i === 0 && /* @__PURE__ */ w.jsx(ke, { wrap: !0, children: o.map((l) => /* @__PURE__ */ w.jsxs(Oe, { color: "processing", onClick: () => r(l.agent_no, 0), children: [
706
+ /* @__PURE__ */ w.jsxs("span", { style: { marginRight: 10 }, children: [
707
+ "咨询坐席: ",
708
+ l.agent_name
709
+ ] }),
710
+ /* @__PURE__ */ w.jsx(xe, { name: "zixun" })
711
+ ] }, l.agent_no)) }),
712
+ i === 1 && /* @__PURE__ */ w.jsx(
713
+ $e,
714
+ {
715
+ value: p,
716
+ onChange: (l) => s(l.target.value),
717
+ placeholder: "请输入外线号码, 回车转接",
718
+ onPressEnter: () => {
719
+ r(p, 1);
720
+ }
721
+ }
722
+ )
723
+ ] }) })
724
+ ] }) }) });
744
725
  });
745
726
  export {
746
727
  Ke as default
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-zOLeMqZK.js"),j=require("react"),A=require("./index-D7DHU94M.js");function J(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const i in e)if(i!=="default"){const t=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(n,i,t.get?t:{enumerable:!0,get:()=>e[i]})}}return n.default=e,Object.freeze(n)}const a=J(j),H=a.createContext(null),K=H.Provider,W=a.createContext(null),Q=W.Provider;var Z=["prefixCls","className","style","checked","disabled","defaultChecked","type","title","onChange"],ee=j.forwardRef(function(e,n){var i=e.prefixCls,t=i===void 0?"rc-checkbox":i,o=e.className,l=e.style,C=e.checked,g=e.disabled,d=e.defaultChecked,$=d===void 0?!1:d,f=e.type,s=f===void 0?"checkbox":f,O=e.title,k=e.onChange,w=r._objectWithoutProperties(e,Z),x=j.useRef(null),u=j.useRef(null),R=r.useMergedState($,{value:C}),h=r._slicedToArray(R,2),S=h[0],y=h[1];j.useImperativeHandle(n,function(){return{focus:function(v){var b;(b=x.current)===null||b===void 0||b.focus(v)},blur:function(){var v;(v=x.current)===null||v===void 0||v.blur()},input:x.current,nativeElement:u.current}});var P=r.classNames(t,o,r._defineProperty(r._defineProperty({},"".concat(t,"-checked"),S),"".concat(t,"-disabled"),g)),c=function(v){g||("checked"in e||y(v.target.checked),k==null||k({target:r._objectSpread2(r._objectSpread2({},e),{},{type:s,checked:v.target.checked}),stopPropagation:function(){v.stopPropagation()},preventDefault:function(){v.preventDefault()},nativeEvent:v.nativeEvent}))};return a.createElement("span",{className:P,title:O,style:l,ref:u},a.createElement("input",r._extends({},w,{className:"".concat(t,"-input"),ref:x,onChange:c,disabled:g,checked:!!S,type:s})),a.createElement("span",{className:"".concat(t,"-inner")}))});function te(e){const n=j.useRef(null),i=()=>{r.wrapperRaf.cancel(n.current),n.current=null};return[()=>{i(),n.current=r.wrapperRaf(()=>{n.current=null})},l=>{n.current&&(l.stopPropagation(),i()),e==null||e(l)}]}const oe=e=>{const{componentCls:n,antCls:i}=e,t=`${n}-group`;return{[t]:Object.assign(Object.assign({},r.resetComponent(e)),{display:"inline-block",fontSize:0,[`&${t}-rtl`]:{direction:"rtl"},[`&${t}-block`]:{display:"flex"},[`${i}-badge ${i}-badge-count`]:{zIndex:1},[`> ${i}-badge:not(:first-child) > ${i}-button-wrapper`]:{borderInlineStart:"none"}})}},re=e=>{const{componentCls:n,wrapperMarginInlineEnd:i,colorPrimary:t,radioSize:o,motionDurationSlow:l,motionDurationMid:C,motionEaseInOutCirc:g,colorBgContainer:d,colorBorder:$,lineWidth:f,colorBgContainerDisabled:s,colorTextDisabled:O,paddingXS:k,dotColorDisabled:w,lineType:x,radioColor:u,radioBgColor:R,calc:h}=e,S=`${n}-inner`,P=h(o).sub(h(4).mul(2)),c=h(1).mul(o).equal({unit:!0});return{[`${n}-wrapper`]:Object.assign(Object.assign({},r.resetComponent(e)),{display:"inline-flex",alignItems:"baseline",marginInlineStart:0,marginInlineEnd:i,cursor:"pointer","&:last-child":{marginInlineEnd:0},[`&${n}-wrapper-rtl`]:{direction:"rtl"},"&-disabled":{cursor:"not-allowed",color:e.colorTextDisabled},"&::after":{display:"inline-block",width:0,overflow:"hidden",content:'"\\a0"'},"&-block":{flex:1,justifyContent:"center"},[`${n}-checked::after`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:"100%",height:"100%",border:`${r.unit(f)} ${x} ${t}`,borderRadius:"50%",visibility:"hidden",opacity:0,content:'""'},[n]:Object.assign(Object.assign({},r.resetComponent(e)),{position:"relative",display:"inline-block",outline:"none",cursor:"pointer",alignSelf:"center",borderRadius:"50%"}),[`${n}-wrapper:hover &,
2
+ &:hover ${S}`]:{borderColor:t},[`${n}-input:focus-visible + ${S}`]:Object.assign({},r.genFocusOutline(e)),[`${n}:hover::after, ${n}-wrapper:hover &::after`]:{visibility:"visible"},[`${n}-inner`]:{"&::after":{boxSizing:"border-box",position:"absolute",insetBlockStart:"50%",insetInlineStart:"50%",display:"block",width:c,height:c,marginBlockStart:h(1).mul(o).div(-2).equal({unit:!0}),marginInlineStart:h(1).mul(o).div(-2).equal({unit:!0}),backgroundColor:u,borderBlockStart:0,borderInlineStart:0,borderRadius:c,transform:"scale(0)",opacity:0,transition:`all ${l} ${g}`,content:'""'},boxSizing:"border-box",position:"relative",insetBlockStart:0,insetInlineStart:0,display:"block",width:c,height:c,backgroundColor:d,borderColor:$,borderStyle:"solid",borderWidth:f,borderRadius:"50%",transition:`all ${C}`},[`${n}-input`]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0},[`${n}-checked`]:{[S]:{borderColor:t,backgroundColor:R,"&::after":{transform:`scale(${e.calc(e.dotSize).div(o).equal()})`,opacity:1,transition:`all ${l} ${g}`}}},[`${n}-disabled`]:{cursor:"not-allowed",[S]:{backgroundColor:s,borderColor:$,cursor:"not-allowed","&::after":{backgroundColor:w}},[`${n}-input`]:{cursor:"not-allowed"},[`${n}-disabled + span`]:{color:O,cursor:"not-allowed"},[`&${n}-checked`]:{[S]:{"&::after":{transform:`scale(${h(P).div(o).equal()})`}}}},[`span${n} + *`]:{paddingInlineStart:k,paddingInlineEnd:k}})}},ne=e=>{const{buttonColor:n,controlHeight:i,componentCls:t,lineWidth:o,lineType:l,colorBorder:C,motionDurationSlow:g,motionDurationMid:d,buttonPaddingInline:$,fontSize:f,buttonBg:s,fontSizeLG:O,controlHeightLG:k,controlHeightSM:w,paddingXS:x,borderRadius:u,borderRadiusSM:R,borderRadiusLG:h,buttonCheckedBg:S,buttonSolidCheckedColor:y,colorTextDisabled:P,colorBgContainerDisabled:c,buttonCheckedBgDisabled:_,buttonCheckedColorDisabled:v,colorPrimary:b,colorPrimaryHover:z,colorPrimaryActive:p,buttonSolidCheckedBg:I,buttonSolidCheckedHoverBg:B,buttonSolidCheckedActiveBg:N,calc:E}=e;return{[`${t}-button-wrapper`]:{position:"relative",display:"inline-block",height:i,margin:0,paddingInline:$,paddingBlock:0,color:n,fontSize:f,lineHeight:r.unit(E(i).sub(E(o).mul(2)).equal()),background:s,border:`${r.unit(o)} ${l} ${C}`,borderBlockStartWidth:E(o).add(.02).equal(),borderInlineStartWidth:0,borderInlineEndWidth:o,cursor:"pointer",transition:[`color ${d}`,`background ${d}`,`box-shadow ${d}`].join(","),a:{color:n},[`> ${t}-button`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,zIndex:-1,width:"100%",height:"100%"},"&:not(:first-child)":{"&::before":{position:"absolute",insetBlockStart:E(o).mul(-1).equal(),insetInlineStart:E(o).mul(-1).equal(),display:"block",boxSizing:"content-box",width:1,height:"100%",paddingBlock:o,paddingInline:0,backgroundColor:C,transition:`background-color ${g}`,content:'""'}},"&:first-child":{borderInlineStart:`${r.unit(o)} ${l} ${C}`,borderStartStartRadius:u,borderEndStartRadius:u},"&:last-child":{borderStartEndRadius:u,borderEndEndRadius:u},"&:first-child:last-child":{borderRadius:u},[`${t}-group-large &`]:{height:k,fontSize:O,lineHeight:r.unit(E(k).sub(E(o).mul(2)).equal()),"&:first-child":{borderStartStartRadius:h,borderEndStartRadius:h},"&:last-child":{borderStartEndRadius:h,borderEndEndRadius:h}},[`${t}-group-small &`]:{height:w,paddingInline:E(x).sub(o).equal(),paddingBlock:0,lineHeight:r.unit(E(w).sub(E(o).mul(2)).equal()),"&:first-child":{borderStartStartRadius:R,borderEndStartRadius:R},"&:last-child":{borderStartEndRadius:R,borderEndEndRadius:R}},"&:hover":{position:"relative",color:b},"&:has(:focus-visible)":Object.assign({},r.genFocusOutline(e)),[`${t}-inner, input[type='checkbox'], input[type='radio']`]:{width:0,height:0,opacity:0,pointerEvents:"none"},[`&-checked:not(${t}-button-wrapper-disabled)`]:{zIndex:1,color:b,background:S,borderColor:b,"&::before":{backgroundColor:b},"&:first-child":{borderColor:b},"&:hover":{color:z,borderColor:z,"&::before":{backgroundColor:z}},"&:active":{color:p,borderColor:p,"&::before":{backgroundColor:p}}},[`${t}-group-solid &-checked:not(${t}-button-wrapper-disabled)`]:{color:y,background:I,borderColor:I,"&:hover":{color:y,background:B,borderColor:B},"&:active":{color:y,background:N,borderColor:N}},"&-disabled":{color:P,backgroundColor:c,borderColor:C,cursor:"not-allowed","&:first-child, &:hover":{color:P,backgroundColor:c,borderColor:C}},[`&-disabled${t}-button-wrapper-checked`]:{color:v,backgroundColor:_,borderColor:C,boxShadow:"none"},"&-block":{flex:1,textAlign:"center"}}}},ie=e=>{const{wireframe:n,padding:i,marginXS:t,lineWidth:o,fontSizeLG:l,colorText:C,colorBgContainer:g,colorTextDisabled:d,controlItemBgActiveDisabled:$,colorTextLightSolid:f,colorPrimary:s,colorPrimaryHover:O,colorPrimaryActive:k,colorWhite:w}=e,x=4,u=l,R=n?u-x*2:u-(x+o)*2;return{radioSize:u,dotSize:R,dotColorDisabled:d,buttonSolidCheckedColor:f,buttonSolidCheckedBg:s,buttonSolidCheckedHoverBg:O,buttonSolidCheckedActiveBg:k,buttonBg:g,buttonCheckedBg:g,buttonColor:C,buttonCheckedBgDisabled:$,buttonCheckedColorDisabled:d,buttonPaddingInline:i-o,wrapperMarginInlineEnd:t,radioColor:n?s:w,radioBgColor:n?g:s}},F=r.genStyleHooks("Radio",e=>{const{controlOutline:n,controlOutlineWidth:i}=e,t=`0 0 0 ${r.unit(i)} ${n}`,o=t,l=r.merge(e,{radioFocusShadow:t,radioButtonFocusShadow:o});return[oe(l),re(l),ne(l)]},ie,{unitless:{radioSize:!0,dotSize:!0}});var ae=function(e,n){var i={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.indexOf(t)<0&&(i[t]=e[t]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,t=Object.getOwnPropertySymbols(e);o<t.length;o++)n.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(e,t[o])&&(i[t[o]]=e[t[o]]);return i};const le=(e,n)=>{var i,t;const o=a.useContext(H),l=a.useContext(W),{getPrefixCls:C,direction:g,radio:d}=a.useContext(r.ConfigContext),$=a.useRef(null),f=r.composeRef(n,$),{isFormItemInput:s}=a.useContext(r.FormItemInputContext);if(process.env.NODE_ENV!=="production"){const D=r.devUseWarning("Radio");process.env.NODE_ENV!=="production"&&D(!("optionType"in e),"usage","`optionType` is only support in Radio.Group.")}const O=D=>{var M,T;(M=e.onChange)===null||M===void 0||M.call(e,D),(T=o==null?void 0:o.onChange)===null||T===void 0||T.call(o,D)},{prefixCls:k,className:w,rootClassName:x,children:u,style:R,title:h}=e,S=ae(e,["prefixCls","className","rootClassName","children","style","title"]),y=C("radio",k),P=((o==null?void 0:o.optionType)||l)==="button",c=P?`${y}-button`:y,_=r.useCSSVarCls(y),[v,b,z]=F(y,_),p=Object.assign({},S),I=a.useContext(r.DisabledContext);o&&(p.name=o.name,p.onChange=O,p.checked=e.value===o.value,p.disabled=(i=p.disabled)!==null&&i!==void 0?i:o.disabled),p.disabled=(t=p.disabled)!==null&&t!==void 0?t:I;const B=r.classNames(`${c}-wrapper`,{[`${c}-wrapper-checked`]:p.checked,[`${c}-wrapper-disabled`]:p.disabled,[`${c}-wrapper-rtl`]:g==="rtl",[`${c}-wrapper-in-form-item`]:s,[`${c}-wrapper-block`]:!!(o!=null&&o.block)},d==null?void 0:d.className,w,x,b,z,_),[N,E]=te(p.onClick);return v(a.createElement(r.Wave,{component:"Radio",disabled:p.disabled},a.createElement("label",{className:B,style:Object.assign(Object.assign({},d==null?void 0:d.style),R),onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,title:h,onClick:N},a.createElement(ee,Object.assign({},p,{className:r.classNames(p.className,{[r.TARGET_CLS]:!P}),type:"radio",prefixCls:c,ref:f,onClick:E})),u!==void 0?a.createElement("span",{className:`${c}-label`},u):null)))},V=a.forwardRef(le);process.env.NODE_ENV!=="production"&&(V.displayName="Radio");const se=a.forwardRef((e,n)=>{const{getPrefixCls:i,direction:t}=a.useContext(r.ConfigContext),o=r.useId(),{prefixCls:l,className:C,rootClassName:g,options:d,buttonStyle:$="outline",disabled:f,children:s,size:O,style:k,id:w,optionType:x,name:u=o,defaultValue:R,value:h,block:S=!1,onChange:y,onMouseEnter:P,onMouseLeave:c,onFocus:_,onBlur:v}=e,[b,z]=r.useMergedState(R,{value:h}),p=a.useCallback(m=>{const Y=b,G=m.target.value;"value"in e||z(G),G!==Y&&(y==null||y(m))},[b,z,y]),I=i("radio",l),B=`${I}-group`,N=r.useCSSVarCls(I),[E,D,M]=F(I,N);let T=s;d&&d.length>0&&(T=d.map(m=>typeof m=="string"||typeof m=="number"?a.createElement(V,{key:m.toString(),prefixCls:I,disabled:f,value:m,checked:b===m},m):a.createElement(V,{key:`radio-group-value-options-${m.value}`,prefixCls:I,disabled:m.disabled||f,value:m.value,checked:b===m.value,title:m.title,style:m.style,id:m.id,required:m.required},m.label)));const L=r.useSize(O),X=r.classNames(B,`${B}-${$}`,{[`${B}-${L}`]:L,[`${B}-rtl`]:t==="rtl",[`${B}-block`]:S},C,g,D,M,N),U=a.useMemo(()=>({onChange:p,value:b,disabled:f,name:u,optionType:x,block:S}),[p,b,f,u,x,S]);return E(a.createElement("div",Object.assign({},r.pickAttrs(e,{aria:!0,data:!0}),{className:X,style:k,onMouseEnter:P,onMouseLeave:c,onFocus:_,onBlur:v,id:w,ref:n}),a.createElement(K,{value:U},T)))}),de=a.memo(se);var ce=function(e,n){var i={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.indexOf(t)<0&&(i[t]=e[t]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,t=Object.getOwnPropertySymbols(e);o<t.length;o++)n.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(e,t[o])&&(i[t[o]]=e[t[o]]);return i};const ue=(e,n)=>{const{getPrefixCls:i}=a.useContext(r.ConfigContext),{prefixCls:t}=e,o=ce(e,["prefixCls"]),l=i("radio",t);return a.createElement(Q,{value:"button"},a.createElement(V,Object.assign({prefixCls:l},o,{type:"radio",ref:n})))},be=a.forwardRef(ue),q=V;q.Button=be;q.Group=de;q.__ANT_RADIO=!0;const pe=j.memo(({open:e,onCallBack:n,queryFetch:i})=>{const[t,o]=j.useState([]),[l,C]=j.useState(0),[g,d]=j.useState(""),[$,f]=j.useState(!1);return j.useEffect(()=>{(async()=>{f(!0);try{await i({success:s=>{o(s.data||[])}})}catch{}f(!1)})()},[e]),r.jsxRuntimeExports.jsx(r.jsxRuntimeExports.Fragment,{children:r.jsxRuntimeExports.jsx(A.Modal,{open:e,title:"转接",footer:!1,onCancel:()=>n(),children:r.jsxRuntimeExports.jsxs(r.ModelBody,{children:[r.jsxRuntimeExports.jsx("div",{children:r.jsxRuntimeExports.jsx(q.Group,{options:[{label:"转接坐席",value:0},{label:"转接外线",value:1}],value:l,onChange:s=>C(s.target.value)})}),r.jsxRuntimeExports.jsx(r.Spin,{spinning:$,children:r.jsxRuntimeExports.jsxs("div",{style:{borderTop:"1px solid #eee",marginTop:10,paddingTop:10},children:[l===0&&r.jsxRuntimeExports.jsx(r.Space,{wrap:!0,children:t.map(s=>r.jsxRuntimeExports.jsxs(A.Tag,{color:"processing",onClick:()=>n(s.agent_no,0),children:[r.jsxRuntimeExports.jsxs("span",{style:{marginRight:10},children:["咨询坐席: ",s.agent_name]}),r.jsxRuntimeExports.jsx(r.YsytIconSvg,{name:"zixun"})]},s.agent_no))}),l===1&&r.jsxRuntimeExports.jsx(r.Input,{value:g,onChange:s=>d(s.target.value),placeholder:"请输入外线号码, 回车转接",onPressEnter:()=>{n(g,1)}})]})})]})})})});exports.default=pe;
@@ -2,7 +2,7 @@ import { default as React } from 'react';
2
2
  import { AgentItemType, RequestBodyType } from 'ysyt-agent-sdk';
3
3
  interface Props {
4
4
  open: boolean;
5
- onCallBack: (value?: string) => void;
5
+ onCallBack: (value?: string, type?: 0 | 1) => void;
6
6
  queryFetch: (params: RequestBodyType<unknown, AgentItemType[]>) => Promise<void>;
7
7
  }
8
8
  declare const TransferModel: React.MemoExoticComponent<({ open, onCallBack, queryFetch }: Props) => React.JSX.Element>;