bhd-components 0.7.10 → 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.
- package/README.md +2 -3
- package/dist/{a23d0ed7.esm.es5.production.js → 367716ff.esm.es5.production.js} +1 -1
- package/dist/{e7af2e4a.esm.es5.development.js → 4507d48e.esm.es5.development.js} +72 -96
- package/dist/index.esm.es5.development.css +2016 -1960
- package/dist/index.esm.es5.development.js +99 -53
- package/dist/index.esm.es5.production.css +1 -1
- package/dist/index.esm.es5.production.js +1 -1
- package/es2017/customerService/contactsList.js +1 -1
- package/es2017/customerService/index.js +81 -41
- package/es2017/customerService/index.module.less +15 -3
- package/es2017/customerService/index2.module.less +15 -3
- package/es2017/customerService/screenshotTool.js +13 -7
- package/esm/customerService/contactsList.js +1 -1
- package/esm/customerService/index.js +82 -42
- package/esm/customerService/index.module.less +15 -3
- package/esm/customerService/index2.module.less +15 -3
- package/esm/customerService/screenshotTool.js +13 -7
- package/package.json +1 -1
|
@@ -66,7 +66,8 @@ var CustomerService = function(props) {
|
|
|
66
66
|
var _useState29 = _sliced_to_array(useState(""), 2), viewBase64 = _useState29[0], setViewBase64 = _useState29[1]; //图片预览
|
|
67
67
|
var _useState30 = _sliced_to_array(useState(false), 2), visible = _useState30[0], setVisible = _useState30[1]; //是否显示图片预览
|
|
68
68
|
var _useState31 = _sliced_to_array(useState([]), 2), bottomRecommendationQuestions = _useState31[0], setBottomRecommendationQuestions = _useState31[1]; //底部推荐问题
|
|
69
|
-
var _useState32 = _sliced_to_array(useState(
|
|
69
|
+
var _useState32 = _sliced_to_array(useState(false), 2), showScreenshot = _useState32[0], setShowScreenshot = _useState32[1]; //是否显示截图 主要用于newlabo页面
|
|
70
|
+
var _useState33 = _sliced_to_array(useState(-1), 2), saveShowType = _useState33[0], setSaveShowType = _useState33[1]; //保存截图时的状态
|
|
70
71
|
var timer = useRef(null); //文本框输入时
|
|
71
72
|
var receiveMessageTimer = useRef(null); //接收ai发回的消息
|
|
72
73
|
// let voiceCountdownTimer = useRef(null); //语音录制倒计时
|
|
@@ -94,17 +95,11 @@ var CustomerService = function(props) {
|
|
|
94
95
|
}
|
|
95
96
|
});
|
|
96
97
|
useEffect(function() {
|
|
97
|
-
|
|
98
|
-
// getQuestiionsList("", 1);
|
|
99
|
-
if (props.config && props.config.type == "video") {
|
|
98
|
+
if (config && config.type == "video") {
|
|
100
99
|
//获取热门推荐
|
|
101
100
|
videoPageQuestiionsList(1);
|
|
102
|
-
// getQuestiionsList("", 3)
|
|
103
101
|
}
|
|
104
102
|
setShowType(initShowType);
|
|
105
|
-
//获取视频页面推荐问题
|
|
106
|
-
// videoPageQuestiionsList();
|
|
107
|
-
// scrollToBottom();
|
|
108
103
|
}, [
|
|
109
104
|
initShowType
|
|
110
105
|
]);
|
|
@@ -155,7 +150,8 @@ var CustomerService = function(props) {
|
|
|
155
150
|
}
|
|
156
151
|
scrollTopHei.current = scrollTop;
|
|
157
152
|
};
|
|
158
|
-
|
|
153
|
+
//|| showScreenshot
|
|
154
|
+
if (showType == 5 || showScreenshot) {
|
|
159
155
|
try {
|
|
160
156
|
setImgBese64("");
|
|
161
157
|
// html2canvas(document.getElementsByTagName('html')[0],{
|
|
@@ -202,7 +198,8 @@ var CustomerService = function(props) {
|
|
|
202
198
|
}, [
|
|
203
199
|
historyMessageList,
|
|
204
200
|
showType,
|
|
205
|
-
pageCount
|
|
201
|
+
pageCount,
|
|
202
|
+
showScreenshot
|
|
206
203
|
]);
|
|
207
204
|
useEffect(function() {
|
|
208
205
|
resettingBottomHei();
|
|
@@ -710,6 +707,10 @@ var CustomerService = function(props) {
|
|
|
710
707
|
sendingExistingIssues(2, dataObj, "");
|
|
711
708
|
testLabQuestion(obj.message, questions.answer, "");
|
|
712
709
|
}
|
|
710
|
+
if (type == 2 && config && config.type == "video") {
|
|
711
|
+
//先请求问题列表
|
|
712
|
+
videoPageQuestiionsList(2);
|
|
713
|
+
}
|
|
713
714
|
});
|
|
714
715
|
};
|
|
715
716
|
//向AI发送问题 type == 1 发送点赞或踩消息,type == 2 发送重新生成消息,type == 3 正常发送消息
|
|
@@ -738,8 +739,8 @@ var CustomerService = function(props) {
|
|
|
738
739
|
});
|
|
739
740
|
});
|
|
740
741
|
}, 60 * 1000);
|
|
741
|
-
if (
|
|
742
|
-
var params =
|
|
742
|
+
if (config && config.type == "video" && config.params) {
|
|
743
|
+
var params = config.params;
|
|
743
744
|
var videoId = params.videoId;
|
|
744
745
|
var watchTime = params.videoProgress;
|
|
745
746
|
var courseId = getQuery("yc_id");
|
|
@@ -794,7 +795,7 @@ var CustomerService = function(props) {
|
|
|
794
795
|
});
|
|
795
796
|
scrollToBottom();
|
|
796
797
|
}
|
|
797
|
-
if (
|
|
798
|
+
if (config && config.type == "video") {
|
|
798
799
|
//先请求问题列表
|
|
799
800
|
videoPageQuestiionsList(3);
|
|
800
801
|
}
|
|
@@ -904,6 +905,7 @@ var CustomerService = function(props) {
|
|
|
904
905
|
}
|
|
905
906
|
if (msg.finished) {
|
|
906
907
|
setFinished(true); //发送结束
|
|
908
|
+
videoPageQuestiionsList(2);
|
|
907
909
|
// isPosition.current = true;
|
|
908
910
|
setTimeout(function() {
|
|
909
911
|
isPosition.current = true;
|
|
@@ -1304,6 +1306,7 @@ var CustomerService = function(props) {
|
|
|
1304
1306
|
};
|
|
1305
1307
|
//获取问题列表flag ==1 是问候消息 2,搜索列表 展示相关问题 ,3.视频页面,4.视频联想问题不够时,增加知识库联想问题
|
|
1306
1308
|
var getQuestiionsList = function(value, flag) {
|
|
1309
|
+
// console.log(flag,'dlfkvdmflkvmdfklv');
|
|
1307
1310
|
var data = {};
|
|
1308
1311
|
if (flag == 1) {
|
|
1309
1312
|
data = {
|
|
@@ -1353,7 +1356,7 @@ var CustomerService = function(props) {
|
|
|
1353
1356
|
}
|
|
1354
1357
|
}).then(function(res) {
|
|
1355
1358
|
if (res.data.questions) {
|
|
1356
|
-
|
|
1359
|
+
setQuestionsList(function(questionList) {
|
|
1357
1360
|
return _to_consumable_array(questionList).concat(_to_consumable_array(res.data.questions));
|
|
1358
1361
|
});
|
|
1359
1362
|
}
|
|
@@ -1366,16 +1369,20 @@ var CustomerService = function(props) {
|
|
|
1366
1369
|
var videoPageQuestiionsList = function() {
|
|
1367
1370
|
var flag = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1;
|
|
1368
1371
|
console.log(flag, props, 3333333);
|
|
1369
|
-
var config = props.config;
|
|
1370
1372
|
if (config && config.type == "video" && config.params) {
|
|
1371
1373
|
var params = config.params;
|
|
1372
1374
|
var videoId = params.videoId;
|
|
1373
1375
|
var watchTime = params.videoProgress;
|
|
1374
1376
|
var courseId = getQuery("yc_id");
|
|
1375
1377
|
var sectionId = params.VideoBriefSummaryId;
|
|
1378
|
+
// let courseId="20899",
|
|
1379
|
+
// sectionId= "462347",
|
|
1380
|
+
// videoId= "29707",
|
|
1381
|
+
// watchTime= 262
|
|
1376
1382
|
if (videoId && courseId && sectionId) {
|
|
1383
|
+
console.log(recommendeQuestionID.current, "recommendeQuestionID.current");
|
|
1377
1384
|
http.post("".concat(urllocation, "/chat-service/public/v1.0/knowledge-base/questions:recommend"), {
|
|
1378
|
-
"recommendedQuestions":
|
|
1385
|
+
"recommendedQuestions": recommendeQuestionID.current,
|
|
1379
1386
|
"contexts": [
|
|
1380
1387
|
{
|
|
1381
1388
|
"type": "VIDEO",
|
|
@@ -1400,11 +1407,11 @@ var CustomerService = function(props) {
|
|
|
1400
1407
|
} else {
|
|
1401
1408
|
setHotQuestionsList(data);
|
|
1402
1409
|
}
|
|
1403
|
-
|
|
1404
|
-
data.map(
|
|
1405
|
-
|
|
1406
|
-
})
|
|
1407
|
-
recommendeQuestionID.current = Array.from(new Set(recommendeQuestionID.current.concat(ids)));
|
|
1410
|
+
// let ids:any[] = [];
|
|
1411
|
+
// data.map((str: { id: string; })=>{
|
|
1412
|
+
// ids.push(str.id);
|
|
1413
|
+
// })
|
|
1414
|
+
// recommendeQuestionID.current = Array.from(new Set(recommendeQuestionID.current.concat(ids)));
|
|
1408
1415
|
resettingBottomHei();
|
|
1409
1416
|
scrollToBottom();
|
|
1410
1417
|
// console.log(data,99999);
|
|
@@ -1921,7 +1928,7 @@ var CustomerService = function(props) {
|
|
|
1921
1928
|
className: styles.content_child
|
|
1922
1929
|
}),
|
|
1923
1930
|
item.extraInfo && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "imageUrl" && /*#__PURE__*/ _jsxs("p", {
|
|
1924
|
-
className: styles.img_con,
|
|
1931
|
+
className: "".concat(styles.img_con, " ").concat(showType == 2 || showType == 4 ? styles.img_con2 : ""),
|
|
1925
1932
|
children: [
|
|
1926
1933
|
/*#__PURE__*/ _jsx("img", {
|
|
1927
1934
|
src: JSON.parse(item.extraInfo)[0].value
|
|
@@ -2038,7 +2045,7 @@ var CustomerService = function(props) {
|
|
|
2038
2045
|
className: styles.content_child
|
|
2039
2046
|
}),
|
|
2040
2047
|
item.extraInfo && JSON.parse(item.extraInfo).length > 0 && JSON.parse(item.extraInfo)[0].key == "imageUrl" && /*#__PURE__*/ _jsxs("p", {
|
|
2041
|
-
className: styles.img_con,
|
|
2048
|
+
className: "".concat(styles.img_con, " ").concat(showType == 2 || showType == 4 ? styles.img_con2 : ""),
|
|
2042
2049
|
children: [
|
|
2043
2050
|
/*#__PURE__*/ _jsx("img", {
|
|
2044
2051
|
src: JSON.parse(item.extraInfo)[0].value
|
|
@@ -2067,10 +2074,9 @@ var CustomerService = function(props) {
|
|
|
2067
2074
|
return /*#__PURE__*/ _jsx("li", {
|
|
2068
2075
|
onClick: function() {
|
|
2069
2076
|
sendMessage(list, 1);
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
}
|
|
2077
|
+
recommendeQuestionID.current = recommendeQuestionID.current.concat(list.value);
|
|
2078
|
+
setBottomRecommendationQuestions([]);
|
|
2079
|
+
resettingBottomHei();
|
|
2074
2080
|
},
|
|
2075
2081
|
children: item.message == "抱歉,我暂时无法回答这样的问题。" ? list.question : /*#__PURE__*/ _jsxs(_Fragment, {
|
|
2076
2082
|
children: [
|
|
@@ -2152,13 +2158,23 @@ var CustomerService = function(props) {
|
|
|
2152
2158
|
return "";
|
|
2153
2159
|
}
|
|
2154
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
|
+
}
|
|
2155
2171
|
return /*#__PURE__*/ _jsxs("p", {
|
|
2156
2172
|
className: styles.operate,
|
|
2157
2173
|
children: [
|
|
2158
2174
|
// 不在智能客服窗口,并已经点击了召唤老师,并有召唤老师权限
|
|
2159
2175
|
isAiChatWindow && answerMode != 1 && userData.modules.some(function(item) {
|
|
2160
2176
|
return item.short == "TeacherAnswer";
|
|
2161
|
-
}) &&
|
|
2177
|
+
}) && showTeacherBtn && /*#__PURE__*/ _jsx("span", {
|
|
2162
2178
|
className: styles.ask_question,
|
|
2163
2179
|
onClick: function() {
|
|
2164
2180
|
setAnswerMode(1);
|
|
@@ -2307,9 +2323,19 @@ var CustomerService = function(props) {
|
|
|
2307
2323
|
}
|
|
2308
2324
|
//3、是否显示召唤老师回答按钮
|
|
2309
2325
|
var findTeacherBtn = false;
|
|
2310
|
-
if (!showStopBtn && isAiChatWindow && (extraInfo != undefined && JSON.parse(extraInfo).length > 0 && JSON.parse(extraInfo)[0].key == "questionId" || extraInfo == null)
|
|
2326
|
+
if (!showStopBtn && isAiChatWindow && (extraInfo != undefined && JSON.parse(extraInfo).length > 0 && JSON.parse(extraInfo)[0].key == "questionId" || extraInfo == null)) {
|
|
2311
2327
|
findTeacherBtn = true;
|
|
2312
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
|
+
}
|
|
2313
2339
|
/// style={{position:showStopBtn && isPosition.current ? 'sticky' : 'relative'}}
|
|
2314
2340
|
return /*#__PURE__*/ _jsxs("div", {
|
|
2315
2341
|
className: "".concat(styles.operate_modal_bottom),
|
|
@@ -2361,7 +2387,7 @@ var CustomerService = function(props) {
|
|
|
2361
2387
|
//在ai窗口并ai已经生成完答案
|
|
2362
2388
|
findTeacherBtn && userData.modules.some(function(item) {
|
|
2363
2389
|
return item.short == "TeacherAnswer";
|
|
2364
|
-
}) && /*#__PURE__*/ _jsx("span", {
|
|
2390
|
+
}) && showTeacherBtn && /*#__PURE__*/ _jsx("span", {
|
|
2365
2391
|
className: styles.find_teacher,
|
|
2366
2392
|
onClick: function() {
|
|
2367
2393
|
setAnswerMode(1);
|
|
@@ -2635,6 +2661,7 @@ var CustomerService = function(props) {
|
|
|
2635
2661
|
"讲解这张图片涉及到的知识内容"
|
|
2636
2662
|
]
|
|
2637
2663
|
}),
|
|
2664
|
+
/*#__PURE__*/ _jsx("br", {}),
|
|
2638
2665
|
/*#__PURE__*/ _jsxs("p", {
|
|
2639
2666
|
onClick: function() {
|
|
2640
2667
|
setHistoryMessageList(function(historyMessageList) {
|
|
@@ -2698,7 +2725,7 @@ var CustomerService = function(props) {
|
|
|
2698
2725
|
var roomList = contactsList;
|
|
2699
2726
|
if (roomList.length > 0 && roomList[0].roomId != roomId) return;
|
|
2700
2727
|
console.log(props, 333333);
|
|
2701
|
-
if (
|
|
2728
|
+
if (config && config.type == "video") {
|
|
2702
2729
|
getQuestiionsList(String(e.target.value), 3);
|
|
2703
2730
|
} else {
|
|
2704
2731
|
getQuestiionsList(String(e.target.value), 2);
|
|
@@ -2795,7 +2822,11 @@ var CustomerService = function(props) {
|
|
|
2795
2822
|
onClick: function() {
|
|
2796
2823
|
if (!finished) return;
|
|
2797
2824
|
setSaveShowType(showType);
|
|
2798
|
-
|
|
2825
|
+
if (showType == 3) {
|
|
2826
|
+
setShowScreenshot(true);
|
|
2827
|
+
} else {
|
|
2828
|
+
setShowType(5);
|
|
2829
|
+
}
|
|
2799
2830
|
},
|
|
2800
2831
|
children: /*#__PURE__*/ _jsx(CustomScreenshot, {})
|
|
2801
2832
|
})
|
|
@@ -2955,17 +2986,20 @@ var CustomerService = function(props) {
|
|
|
2955
2986
|
});
|
|
2956
2987
|
}
|
|
2957
2988
|
};
|
|
2989
|
+
//视频页面底部推荐问题
|
|
2958
2990
|
var renderBottomAssociationProblem = function() {
|
|
2959
2991
|
return /*#__PURE__*/ _jsx("div", {
|
|
2960
2992
|
className: styles.issues_list_flag,
|
|
2961
|
-
style: {
|
|
2962
|
-
bottom: "".concat(buttomHei - 60, "px")
|
|
2963
|
-
},
|
|
2964
2993
|
id: "BottomAssociationProblem",
|
|
2965
2994
|
children: bottomRecommendationQuestions.map(function(item) {
|
|
2966
2995
|
return /*#__PURE__*/ _jsx("p", {
|
|
2967
2996
|
onClick: function() {
|
|
2968
2997
|
sendMessage(item, 1);
|
|
2998
|
+
if (config && config.type == "video") {
|
|
2999
|
+
recommendeQuestionID.current = recommendeQuestionID.current.concat(item.id);
|
|
3000
|
+
setBottomRecommendationQuestions([]);
|
|
3001
|
+
resettingBottomHei();
|
|
3002
|
+
}
|
|
2969
3003
|
},
|
|
2970
3004
|
children: item.question
|
|
2971
3005
|
}, item.id);
|
|
@@ -3177,7 +3211,7 @@ var CustomerService = function(props) {
|
|
|
3177
3211
|
})
|
|
3178
3212
|
]
|
|
3179
3213
|
}),
|
|
3180
|
-
showType == 3
|
|
3214
|
+
showType == 3 && /*#__PURE__*/ _jsxs("div", {
|
|
3181
3215
|
className: "".concat(styles.ChatWindow_Drawer),
|
|
3182
3216
|
id: "",
|
|
3183
3217
|
onClick: function() {
|
|
@@ -3288,12 +3322,12 @@ var CustomerService = function(props) {
|
|
|
3288
3322
|
})
|
|
3289
3323
|
})
|
|
3290
3324
|
]
|
|
3291
|
-
})
|
|
3292
|
-
showType == 4 && /*#__PURE__*/ _jsxs(_Fragment, {
|
|
3325
|
+
}),
|
|
3326
|
+
(showType == 4 || showType == 5) && /*#__PURE__*/ _jsxs(_Fragment, {
|
|
3293
3327
|
children: [
|
|
3294
3328
|
/*#__PURE__*/ _jsxs(Modal, {
|
|
3295
3329
|
title: "AI助手",
|
|
3296
|
-
open: true,
|
|
3330
|
+
open: showType == 4 ? true : false,
|
|
3297
3331
|
onCancel: function() {
|
|
3298
3332
|
onCancel();
|
|
3299
3333
|
onEvent(serverName + serverUrl(), "click_智能问答_收起侧边栏", "提交");
|
|
@@ -3379,7 +3413,7 @@ var CustomerService = function(props) {
|
|
|
3379
3413
|
})
|
|
3380
3414
|
]
|
|
3381
3415
|
}),
|
|
3382
|
-
/*#__PURE__*/ _jsxs("div", {
|
|
3416
|
+
(showType == 4 || showType == 5) && /*#__PURE__*/ _jsxs("div", {
|
|
3383
3417
|
className: "".concat(styles.ChatWindow_Drawer),
|
|
3384
3418
|
id: "",
|
|
3385
3419
|
children: [
|
|
@@ -3477,7 +3511,7 @@ var CustomerService = function(props) {
|
|
|
3477
3511
|
})
|
|
3478
3512
|
]
|
|
3479
3513
|
}),
|
|
3480
|
-
showType == 5 && imgBese64 && /*#__PURE__*/ _jsx(ScreenshotTool, {
|
|
3514
|
+
(showType == 5 || showScreenshot) && imgBese64 && /*#__PURE__*/ _jsx(ScreenshotTool, {
|
|
3481
3515
|
imgBese64: imgBese64,
|
|
3482
3516
|
saveScreenshotBese64: function(base64) {
|
|
3483
3517
|
setScreenshotBese64(base64);
|
|
@@ -3486,9 +3520,15 @@ var CustomerService = function(props) {
|
|
|
3486
3520
|
} else {
|
|
3487
3521
|
setShowType(1);
|
|
3488
3522
|
}
|
|
3523
|
+
setShowScreenshot(false);
|
|
3489
3524
|
},
|
|
3490
3525
|
cancelScreenshot: function() {
|
|
3491
|
-
|
|
3526
|
+
if (saveShowType != -1) {
|
|
3527
|
+
setShowType(saveShowType);
|
|
3528
|
+
} else {
|
|
3529
|
+
setShowType(1);
|
|
3530
|
+
}
|
|
3531
|
+
setShowScreenshot(false);
|
|
3492
3532
|
}
|
|
3493
3533
|
}),
|
|
3494
3534
|
viewBase64 && visible && /*#__PURE__*/ _jsx(ViewImage, {
|
|
@@ -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:
|
|
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;
|
|
@@ -935,8 +946,8 @@
|
|
|
935
946
|
}
|
|
936
947
|
}
|
|
937
948
|
.issues_list_flag {
|
|
938
|
-
position: absolute;
|
|
939
|
-
bottom: 60px;
|
|
949
|
+
// position: absolute;
|
|
950
|
+
// bottom: 60px;
|
|
940
951
|
margin: 0 16px;
|
|
941
952
|
// padding-bottom: 4px;
|
|
942
953
|
line-height: 1;
|
|
@@ -946,6 +957,7 @@
|
|
|
946
957
|
background-color: #fff;
|
|
947
958
|
border-radius: 38px;
|
|
948
959
|
margin-bottom: 16px;
|
|
960
|
+
line-height: 1.5;
|
|
949
961
|
cursor: pointer;
|
|
950
962
|
&:hover{
|
|
951
963
|
background-color: @color-background-primary-weak;
|
|
@@ -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:
|
|
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,
|
|
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,
|