bhd-components 0.7.11 → 0.7.12

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.
@@ -1907,7 +1907,7 @@ const CustomerService = (props)=>{
1907
1907
  className: styles.content_child
1908
1908
  }),
1909
1909
  item.extraInfo && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "imageUrl" && /*#__PURE__*/ _jsxs("p", {
1910
- className: styles.img_con,
1910
+ className: `${styles.img_con} ${showType == 2 || showType == 4 ? styles.img_con2 : ''}`,
1911
1911
  children: [
1912
1912
  /*#__PURE__*/ _jsx("img", {
1913
1913
  src: JSON.parse(item.extraInfo)[0].value
@@ -2022,7 +2022,7 @@ const CustomerService = (props)=>{
2022
2022
  className: styles.content_child
2023
2023
  }),
2024
2024
  item.extraInfo && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "imageUrl" && /*#__PURE__*/ _jsxs("p", {
2025
- className: styles.img_con,
2025
+ className: `${styles.img_con} ${showType == 2 || showType == 4 ? styles.img_con2 : ''}`,
2026
2026
  children: [
2027
2027
  /*#__PURE__*/ _jsx("img", {
2028
2028
  src: JSON.parse(item.extraInfo)[0].value
@@ -2131,11 +2131,21 @@ const CustomerService = (props)=>{
2131
2131
  return "";
2132
2132
  }
2133
2133
  // console.log(historyMessageList,i,'sdcsd;sldcscsdsd')
2134
+ //根据上一行数据,判断是否显示招唤老师按钮
2135
+ let showTeacherBtn = true;
2136
+ let previousLineData = historyMessageList[i - 1];
2137
+ if (!previousLineData) {
2138
+ showTeacherBtn = true;
2139
+ } else if (!previousLineData.extraInfo) {
2140
+ showTeacherBtn = true;
2141
+ } else if (JSON.parse(previousLineData.extraInfo).length > 0 && JSON.parse(previousLineData.extraInfo)[0].key == "imageUrl") {
2142
+ showTeacherBtn = false;
2143
+ }
2134
2144
  return /*#__PURE__*/ _jsxs("p", {
2135
2145
  className: styles.operate,
2136
2146
  children: [
2137
2147
  // 不在智能客服窗口,并已经点击了召唤老师,并有召唤老师权限
2138
- isAiChatWindow && answerMode != 1 && userData.modules.some((item)=>item.short == "TeacherAnswer") && historyMessageList[i - 1] && historyMessageList[i - 1].extraInfo && JSON.parse(historyMessageList[i - 1].extraInfo).length > 0 && JSON.parse(historyMessageList[i - 1].extraInfo)[0].key != "imageUrl" && /*#__PURE__*/ _jsx("span", {
2148
+ isAiChatWindow && answerMode != 1 && userData.modules.some((item)=>item.short == "TeacherAnswer") && showTeacherBtn && /*#__PURE__*/ _jsx("span", {
2139
2149
  className: styles.ask_question,
2140
2150
  onClick: ()=>{
2141
2151
  setAnswerMode(1);
@@ -2278,9 +2288,19 @@ const CustomerService = (props)=>{
2278
2288
  }
2279
2289
  //3、是否显示召唤老师回答按钮
2280
2290
  let findTeacherBtn = false;
2281
- if (!showStopBtn && isAiChatWindow && (extraInfo != undefined && JSON.parse(extraInfo).length > 0 && JSON.parse(extraInfo)[0].key == "questionId" || extraInfo == null) && historyMessageList[i - 1] && historyMessageList[i - 1].extraInfo && JSON.parse(historyMessageList[i - 1].extraInfo).length > 0 && JSON.parse(historyMessageList[i - 1].extraInfo)[0].key != "imageUrl") {
2291
+ if (!showStopBtn && isAiChatWindow && (extraInfo != undefined && JSON.parse(extraInfo).length > 0 && JSON.parse(extraInfo)[0].key == "questionId" || extraInfo == null)) {
2282
2292
  findTeacherBtn = true;
2283
2293
  }
2294
+ //根据上一行数据,判断是否显示招唤老师按钮
2295
+ let showTeacherBtn = true;
2296
+ let previousLineData = historyMessageList[i - 1];
2297
+ if (!previousLineData) {
2298
+ showTeacherBtn = true;
2299
+ } else if (!previousLineData.extraInfo) {
2300
+ showTeacherBtn = true;
2301
+ } else if (JSON.parse(previousLineData.extraInfo).length > 0 && JSON.parse(previousLineData.extraInfo)[0].key == "imageUrl") {
2302
+ showTeacherBtn = false;
2303
+ }
2284
2304
  /// style={{position:showStopBtn && isPosition.current ? 'sticky' : 'relative'}}
2285
2305
  return /*#__PURE__*/ _jsxs("div", {
2286
2306
  className: `${styles.operate_modal_bottom}`,
@@ -2326,7 +2346,7 @@ const CustomerService = (props)=>{
2326
2346
  ]
2327
2347
  }),
2328
2348
  //在ai窗口并ai已经生成完答案
2329
- findTeacherBtn && userData.modules.some((item)=>item.short == "TeacherAnswer") && /*#__PURE__*/ _jsx("span", {
2349
+ findTeacherBtn && userData.modules.some((item)=>item.short == "TeacherAnswer") && showTeacherBtn && /*#__PURE__*/ _jsx("span", {
2330
2350
  className: styles.find_teacher,
2331
2351
  onClick: ()=>{
2332
2352
  setAnswerMode(1);
@@ -638,8 +638,11 @@
638
638
  overflow: hidden;
639
639
  display: inline-flex;
640
640
  margin-top: 12px;
641
+ width: 240px;
642
+ max-height: 134px;
641
643
  img{
642
- width: 100%;
644
+ width: 240px;
645
+ height: fit-content;
643
646
  }
644
647
  .mask_zoom{
645
648
  position: absolute;
@@ -666,6 +669,14 @@
666
669
  }
667
670
  }
668
671
  }
672
+ .img_con2{
673
+ width: 300px;
674
+ max-height: 168px;
675
+ img{
676
+ width: 300px;
677
+ height: fit-content;
678
+ }
679
+ }
669
680
 
670
681
  .copyCode{
671
682
  display: flex;
@@ -635,8 +635,11 @@
635
635
  overflow: hidden;
636
636
  display: inline-flex;
637
637
  margin-top: 12px;
638
+ width: 240px;
639
+ max-height: 134px;
638
640
  img{
639
- width: 100%;
641
+ width: 240px;
642
+ height: fit-content;
640
643
  }
641
644
  .mask_zoom{
642
645
  position: absolute;
@@ -663,6 +666,14 @@
663
666
  }
664
667
  }
665
668
  }
669
+ .img_con2{
670
+ width: 300px;
671
+ max-height: 168px;
672
+ img{
673
+ width: 300px;
674
+ height: fit-content;
675
+ }
676
+ }
666
677
 
667
678
  .copyCode{
668
679
  display: flex;
@@ -932,8 +943,8 @@
932
943
  }
933
944
  }
934
945
  .issues_list_flag {
935
- position: absolute;
936
- bottom: 60px;
946
+ // position: absolute;
947
+ // bottom: 60px;
937
948
  margin: 0 16px;
938
949
  // padding-bottom: 4px;
939
950
  line-height: 1;
@@ -943,6 +954,7 @@
943
954
  background-color: #fff;
944
955
  border-radius: 38px;
945
956
  margin-bottom: 16px;
957
+ line-height: 1.5;
946
958
  cursor: pointer;
947
959
  &:hover{
948
960
  background-color: @color-background-primary-weak;
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "@ice/jsx-runtime/jsx-runtime";
2
- import React, { useState, useRef, forwardRef } from "react";
2
+ import React, { useState, forwardRef } from "react";
3
3
  import ReactCrop, { centerCrop, makeAspectCrop } from "react-image-crop";
4
4
  import { CloseOutlined } from "@ant-design/icons";
5
5
  import { CustomDuihao } from "../icons/index";
@@ -9,7 +9,6 @@ const ScreenshotTool = /*#__PURE__*/ forwardRef((props)=>{
9
9
  let { imgBese64 , saveScreenshotBese64 , cancelScreenshot } = props;
10
10
  const [crop, setCrop] = useState();
11
11
  const [completedCrop, setCompletedCrop] = useState();
12
- const imgRef = useRef(null);
13
12
  const [aspect, setAspect] = useState(16 / 9);
14
13
  const [btnPosition, setBtnPosition] = useState({
15
14
  top: 0,
@@ -85,20 +84,22 @@ const ScreenshotTool = /*#__PURE__*/ forwardRef((props)=>{
85
84
  className: styles.ReactCrop,
86
85
  crop: crop,
87
86
  onChange: (_, percentCrop)=>{
87
+ if (percentCrop.height === 0 && percentCrop.width === 0) {
88
+ return;
89
+ }
88
90
  setShowBtn(false);
89
91
  setCrop(percentCrop);
90
92
  },
91
93
  onComplete: (c)=>{
94
+ if (c.height === 0 && c.width === 0) {
95
+ return;
96
+ }
92
97
  setCompletedCrop(c);
93
98
  savePosition(c);
94
- // console.log(c,'剪裁222');
95
99
  },
96
- // aspect={aspect}
97
- // minWidth={400}
98
100
  minHeight: 100,
99
101
  minWidth: 100,
100
102
  children: /*#__PURE__*/ _jsx("img", {
101
- // ref={imgRef}
102
103
  alt: "Crop me",
103
104
  src: imgBese64,
104
105
  onLoad: onImageLoad
@@ -113,7 +114,12 @@ const ScreenshotTool = /*#__PURE__*/ forwardRef((props)=>{
113
114
  children: [
114
115
  /*#__PURE__*/ _jsx("span", {
115
116
  onClick: cancelScreenshot,
116
- children: /*#__PURE__*/ _jsx(CloseOutlined, {})
117
+ children: /*#__PURE__*/ _jsx(CloseOutlined, {
118
+ style: {
119
+ position: 'relative',
120
+ top: '1px'
121
+ }
122
+ })
117
123
  }),
118
124
  /*#__PURE__*/ _jsx("span", {
119
125
  onClick: saveImage,
@@ -1928,7 +1928,7 @@ var CustomerService = function(props) {
1928
1928
  className: styles.content_child
1929
1929
  }),
1930
1930
  item.extraInfo && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "imageUrl" && /*#__PURE__*/ _jsxs("p", {
1931
- className: styles.img_con,
1931
+ className: "".concat(styles.img_con, " ").concat(showType == 2 || showType == 4 ? styles.img_con2 : ""),
1932
1932
  children: [
1933
1933
  /*#__PURE__*/ _jsx("img", {
1934
1934
  src: JSON.parse(item.extraInfo)[0].value
@@ -2045,7 +2045,7 @@ var CustomerService = function(props) {
2045
2045
  className: styles.content_child
2046
2046
  }),
2047
2047
  item.extraInfo && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "imageUrl" && /*#__PURE__*/ _jsxs("p", {
2048
- className: styles.img_con,
2048
+ className: "".concat(styles.img_con, " ").concat(showType == 2 || showType == 4 ? styles.img_con2 : ""),
2049
2049
  children: [
2050
2050
  /*#__PURE__*/ _jsx("img", {
2051
2051
  src: JSON.parse(item.extraInfo)[0].value
@@ -2158,13 +2158,23 @@ var CustomerService = function(props) {
2158
2158
  return "";
2159
2159
  }
2160
2160
  // console.log(historyMessageList,i,'sdcsd;sldcscsdsd')
2161
+ //根据上一行数据,判断是否显示招唤老师按钮
2162
+ var showTeacherBtn = true;
2163
+ var previousLineData = historyMessageList[i - 1];
2164
+ if (!previousLineData) {
2165
+ showTeacherBtn = true;
2166
+ } else if (!previousLineData.extraInfo) {
2167
+ showTeacherBtn = true;
2168
+ } else if (JSON.parse(previousLineData.extraInfo).length > 0 && JSON.parse(previousLineData.extraInfo)[0].key == "imageUrl") {
2169
+ showTeacherBtn = false;
2170
+ }
2161
2171
  return /*#__PURE__*/ _jsxs("p", {
2162
2172
  className: styles.operate,
2163
2173
  children: [
2164
2174
  // 不在智能客服窗口,并已经点击了召唤老师,并有召唤老师权限
2165
2175
  isAiChatWindow && answerMode != 1 && userData.modules.some(function(item) {
2166
2176
  return item.short == "TeacherAnswer";
2167
- }) && historyMessageList[i - 1] && historyMessageList[i - 1].extraInfo && JSON.parse(historyMessageList[i - 1].extraInfo).length > 0 && JSON.parse(historyMessageList[i - 1].extraInfo)[0].key != "imageUrl" && /*#__PURE__*/ _jsx("span", {
2177
+ }) && showTeacherBtn && /*#__PURE__*/ _jsx("span", {
2168
2178
  className: styles.ask_question,
2169
2179
  onClick: function() {
2170
2180
  setAnswerMode(1);
@@ -2313,9 +2323,19 @@ var CustomerService = function(props) {
2313
2323
  }
2314
2324
  //3、是否显示召唤老师回答按钮
2315
2325
  var findTeacherBtn = false;
2316
- if (!showStopBtn && isAiChatWindow && (extraInfo != undefined && JSON.parse(extraInfo).length > 0 && JSON.parse(extraInfo)[0].key == "questionId" || extraInfo == null) && historyMessageList[i - 1] && historyMessageList[i - 1].extraInfo && JSON.parse(historyMessageList[i - 1].extraInfo).length > 0 && JSON.parse(historyMessageList[i - 1].extraInfo)[0].key != "imageUrl") {
2326
+ if (!showStopBtn && isAiChatWindow && (extraInfo != undefined && JSON.parse(extraInfo).length > 0 && JSON.parse(extraInfo)[0].key == "questionId" || extraInfo == null)) {
2317
2327
  findTeacherBtn = true;
2318
2328
  }
2329
+ //根据上一行数据,判断是否显示招唤老师按钮
2330
+ var showTeacherBtn = true;
2331
+ var previousLineData = historyMessageList[i - 1];
2332
+ if (!previousLineData) {
2333
+ showTeacherBtn = true;
2334
+ } else if (!previousLineData.extraInfo) {
2335
+ showTeacherBtn = true;
2336
+ } else if (JSON.parse(previousLineData.extraInfo).length > 0 && JSON.parse(previousLineData.extraInfo)[0].key == "imageUrl") {
2337
+ showTeacherBtn = false;
2338
+ }
2319
2339
  /// style={{position:showStopBtn && isPosition.current ? 'sticky' : 'relative'}}
2320
2340
  return /*#__PURE__*/ _jsxs("div", {
2321
2341
  className: "".concat(styles.operate_modal_bottom),
@@ -2367,7 +2387,7 @@ var CustomerService = function(props) {
2367
2387
  //在ai窗口并ai已经生成完答案
2368
2388
  findTeacherBtn && userData.modules.some(function(item) {
2369
2389
  return item.short == "TeacherAnswer";
2370
- }) && /*#__PURE__*/ _jsx("span", {
2390
+ }) && showTeacherBtn && /*#__PURE__*/ _jsx("span", {
2371
2391
  className: styles.find_teacher,
2372
2392
  onClick: function() {
2373
2393
  setAnswerMode(1);
@@ -638,8 +638,11 @@
638
638
  overflow: hidden;
639
639
  display: inline-flex;
640
640
  margin-top: 12px;
641
+ width: 240px;
642
+ max-height: 134px;
641
643
  img{
642
- width: 100%;
644
+ width: 240px;
645
+ height: fit-content;
643
646
  }
644
647
  .mask_zoom{
645
648
  position: absolute;
@@ -666,6 +669,14 @@
666
669
  }
667
670
  }
668
671
  }
672
+ .img_con2{
673
+ width: 300px;
674
+ max-height: 168px;
675
+ img{
676
+ width: 300px;
677
+ height: fit-content;
678
+ }
679
+ }
669
680
 
670
681
  .copyCode{
671
682
  display: flex;
@@ -635,8 +635,11 @@
635
635
  overflow: hidden;
636
636
  display: inline-flex;
637
637
  margin-top: 12px;
638
+ width: 240px;
639
+ max-height: 134px;
638
640
  img{
639
- width: 100%;
641
+ width: 240px;
642
+ height: fit-content;
640
643
  }
641
644
  .mask_zoom{
642
645
  position: absolute;
@@ -663,6 +666,14 @@
663
666
  }
664
667
  }
665
668
  }
669
+ .img_con2{
670
+ width: 300px;
671
+ max-height: 168px;
672
+ img{
673
+ width: 300px;
674
+ height: fit-content;
675
+ }
676
+ }
666
677
 
667
678
  .copyCode{
668
679
  display: flex;
@@ -932,8 +943,8 @@
932
943
  }
933
944
  }
934
945
  .issues_list_flag {
935
- position: absolute;
936
- bottom: 60px;
946
+ // position: absolute;
947
+ // bottom: 60px;
937
948
  margin: 0 16px;
938
949
  // padding-bottom: 4px;
939
950
  line-height: 1;
@@ -943,6 +954,7 @@
943
954
  background-color: #fff;
944
955
  border-radius: 38px;
945
956
  margin-bottom: 16px;
957
+ line-height: 1.5;
946
958
  cursor: pointer;
947
959
  &:hover{
948
960
  background-color: @color-background-primary-weak;
@@ -1,6 +1,6 @@
1
1
  import { _ as _sliced_to_array } from "@swc/helpers/_/_sliced_to_array";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "@ice/jsx-runtime/jsx-runtime";
3
- import React, { useState, useRef, forwardRef } from "react";
3
+ import React, { useState, forwardRef } from "react";
4
4
  import ReactCrop, { centerCrop, makeAspectCrop } from "react-image-crop";
5
5
  import { CloseOutlined } from "@ant-design/icons";
6
6
  import { CustomDuihao } from "../icons/index";
@@ -55,7 +55,6 @@ var ScreenshotTool = /*#__PURE__*/ forwardRef(function(props) {
55
55
  var imgBese64 = props.imgBese64, saveScreenshotBese64 = props.saveScreenshotBese64, cancelScreenshot = props.cancelScreenshot;
56
56
  var _useState = _sliced_to_array(useState(), 2), crop = _useState[0], setCrop = _useState[1];
57
57
  var _useState1 = _sliced_to_array(useState(), 2), completedCrop = _useState1[0], setCompletedCrop = _useState1[1];
58
- var imgRef = useRef(null);
59
58
  var _useState2 = _sliced_to_array(useState(16 / 9), 2), aspect = _useState2[0], setAspect = _useState2[1];
60
59
  var _useState3 = _sliced_to_array(useState({
61
60
  top: 0,
@@ -86,20 +85,22 @@ var ScreenshotTool = /*#__PURE__*/ forwardRef(function(props) {
86
85
  className: styles.ReactCrop,
87
86
  crop: crop,
88
87
  onChange: function(_, percentCrop) {
88
+ if (percentCrop.height === 0 && percentCrop.width === 0) {
89
+ return;
90
+ }
89
91
  setShowBtn(false);
90
92
  setCrop(percentCrop);
91
93
  },
92
94
  onComplete: function(c) {
95
+ if (c.height === 0 && c.width === 0) {
96
+ return;
97
+ }
93
98
  setCompletedCrop(c);
94
99
  savePosition(c);
95
- // console.log(c,'剪裁222');
96
100
  },
97
- // aspect={aspect}
98
- // minWidth={400}
99
101
  minHeight: 100,
100
102
  minWidth: 100,
101
103
  children: /*#__PURE__*/ _jsx("img", {
102
- // ref={imgRef}
103
104
  alt: "Crop me",
104
105
  src: imgBese64,
105
106
  onLoad: onImageLoad
@@ -114,7 +115,12 @@ var ScreenshotTool = /*#__PURE__*/ forwardRef(function(props) {
114
115
  children: [
115
116
  /*#__PURE__*/ _jsx("span", {
116
117
  onClick: cancelScreenshot,
117
- children: /*#__PURE__*/ _jsx(CloseOutlined, {})
118
+ children: /*#__PURE__*/ _jsx(CloseOutlined, {
119
+ style: {
120
+ position: "relative",
121
+ top: "1px"
122
+ }
123
+ })
118
124
  }),
119
125
  /*#__PURE__*/ _jsx("span", {
120
126
  onClick: saveImage,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bhd-components",
3
- "version": "0.7.11",
3
+ "version": "0.7.12",
4
4
  "description": "组件功能描述",
5
5
  "files": [
6
6
  "esm",