bhd-components 0.7.18 → 0.7.20

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.
@@ -309,10 +309,10 @@ const CustomerService = (props)=>{
309
309
  let watchTime = params.videoProgress;
310
310
  let courseId = getQuery('yc_id');
311
311
  let sectionId = params.VideoBriefSummaryId;
312
- // let courseId="31007",
313
- // sectionId= "446168",
314
- // videoId= "71399",
315
- // watchTime= 527
312
+ // let courseId="20899",
313
+ // sectionId= "462368",
314
+ // videoId= "29832",
315
+ // watchTime= 753
316
316
  if (videoId && courseId && sectionId) {
317
317
  http.post(`${urllocation}/chat-service/public/v1.0/knowledge-base/questions:recommend`, {
318
318
  "recommendedQuestions": [],
@@ -332,16 +332,22 @@ const CustomerService = (props)=>{
332
332
  let questionsList = null;
333
333
  if (data.length > 0) {
334
334
  questionsList = data.map((item, index)=>{
335
- return {
336
- key: "messageSource",
337
- value: item.id,
338
- question: item.question,
339
- answer: item.answer
340
- };
335
+ if (userData.modules.some((item)=>item.short == "AIservice") || item.answer) {
336
+ return {
337
+ key: "messageSource",
338
+ value: item.id,
339
+ question: item.question,
340
+ answer: item.answer
341
+ };
342
+ } else {
343
+ return null;
344
+ }
341
345
  });
346
+ questionsList = questionsList.filter((i)=>i != null);
342
347
  recommendeQuestionID.current = data.map((item)=>{
343
348
  return item.id;
344
349
  });
350
+ console.log(recommendeQuestionID.current, 4444444);
345
351
  }
346
352
  console.log('dflkvmdfklvdf欢迎语', data);
347
353
  let obj = {
@@ -2984,19 +2990,23 @@ const CustomerService = (props)=>{
2984
2990
  return `<span class=${styles.sign}>${i}</span>`;
2985
2991
  });
2986
2992
  }
2987
- return /*#__PURE__*/ _jsx("p", {
2988
- className: styles.item,
2989
- children: /*#__PURE__*/ _jsx("span", {
2990
- onClick: ()=>{
2991
- sendMessage(item, 2, 'AssociativeProblem');
2992
- setKeyWord("");
2993
- onEvent(serverName + serverUrl(), "click_智能问答_ 发送", "提交");
2994
- },
2995
- dangerouslySetInnerHTML: {
2996
- __html: span
2997
- }
2998
- })
2999
- });
2993
+ if (userData.modules.some((item)=>item.short == "AIservice") || item.answer) {
2994
+ return /*#__PURE__*/ _jsx("p", {
2995
+ className: styles.item,
2996
+ children: /*#__PURE__*/ _jsx("span", {
2997
+ onClick: ()=>{
2998
+ sendMessage(item, 2, 'AssociativeProblem');
2999
+ setKeyWord("");
3000
+ onEvent(serverName + serverUrl(), "click_智能问答_ 发送", "提交");
3001
+ },
3002
+ dangerouslySetInnerHTML: {
3003
+ __html: span
3004
+ }
3005
+ })
3006
+ });
3007
+ } else {
3008
+ return null;
3009
+ }
3000
3010
  })
3001
3011
  });
3002
3012
  }
@@ -3008,21 +3018,25 @@ const CustomerService = (props)=>{
3008
3018
  className: styles.issues_list_flag,
3009
3019
  id: "BottomAssociationProblem",
3010
3020
  children: bottomRecommendationQuestions.map((item)=>{
3011
- return /*#__PURE__*/ _jsxs(_Fragment, {
3012
- children: [
3013
- /*#__PURE__*/ _jsx("p", {
3014
- onClick: ()=>{
3015
- sendMessage(item, 1);
3016
- if (config && config.type == 'video') {
3017
- setBottomRecommendationQuestions([]);
3018
- resettingBottomHei();
3019
- }
3020
- },
3021
- children: item.question
3022
- }, item.id),
3023
- /*#__PURE__*/ _jsx("br", {})
3024
- ]
3025
- });
3021
+ if (userData.modules.some((item)=>item.short == "AIservice") || item.answer) {
3022
+ return /*#__PURE__*/ _jsxs(_Fragment, {
3023
+ children: [
3024
+ /*#__PURE__*/ _jsx("p", {
3025
+ onClick: ()=>{
3026
+ sendMessage(item, 1);
3027
+ if (config && config.type == 'video') {
3028
+ setBottomRecommendationQuestions([]);
3029
+ resettingBottomHei();
3030
+ }
3031
+ },
3032
+ children: item.question
3033
+ }, item.id),
3034
+ /*#__PURE__*/ _jsx("br", {})
3035
+ ]
3036
+ });
3037
+ } else {
3038
+ return null;
3039
+ }
3026
3040
  })
3027
3041
  });
3028
3042
  } else {
@@ -3030,21 +3044,25 @@ const CustomerService = (props)=>{
3030
3044
  className: styles.issues_list_flag,
3031
3045
  id: "BottomAssociationProblem_modal",
3032
3046
  children: bottomRecommendationQuestions.map((item)=>{
3033
- return /*#__PURE__*/ _jsxs(_Fragment, {
3034
- children: [
3035
- /*#__PURE__*/ _jsx("p", {
3036
- onClick: ()=>{
3037
- sendMessage(item, 1);
3038
- if (config && config.type == 'video') {
3039
- setBottomRecommendationQuestions([]);
3040
- resettingBottomHei();
3041
- }
3042
- },
3043
- children: item.question
3044
- }, item.id),
3045
- /*#__PURE__*/ _jsx("br", {})
3046
- ]
3047
- });
3047
+ if (userData.modules.some((item)=>item.short == "AIservice") || item.answer) {
3048
+ return /*#__PURE__*/ _jsxs(_Fragment, {
3049
+ children: [
3050
+ /*#__PURE__*/ _jsx("p", {
3051
+ onClick: ()=>{
3052
+ sendMessage(item, 1);
3053
+ if (config && config.type == 'video') {
3054
+ setBottomRecommendationQuestions([]);
3055
+ resettingBottomHei();
3056
+ }
3057
+ },
3058
+ children: item.question
3059
+ }, item.id),
3060
+ /*#__PURE__*/ _jsx("br", {})
3061
+ ]
3062
+ });
3063
+ } else {
3064
+ return null;
3065
+ }
3048
3066
  })
3049
3067
  });
3050
3068
  }
@@ -313,10 +313,10 @@ var CustomerService = function(props) {
313
313
  var watchTime = params.videoProgress;
314
314
  var courseId = getQuery("yc_id");
315
315
  var sectionId = params.VideoBriefSummaryId;
316
- // let courseId="31007",
317
- // sectionId= "446168",
318
- // videoId= "71399",
319
- // watchTime= 527
316
+ // let courseId="20899",
317
+ // sectionId= "462368",
318
+ // videoId= "29832",
319
+ // watchTime= 753
320
320
  if (videoId && courseId && sectionId) {
321
321
  http.post("".concat(urllocation, "/chat-service/public/v1.0/knowledge-base/questions:recommend"), {
322
322
  "recommendedQuestions": [],
@@ -336,16 +336,26 @@ var CustomerService = function(props) {
336
336
  var questionsList = null;
337
337
  if (data.length > 0) {
338
338
  questionsList = data.map(function(item, index) {
339
- return {
340
- key: "messageSource",
341
- value: item.id,
342
- question: item.question,
343
- answer: item.answer
344
- };
339
+ if (userData.modules.some(function(item) {
340
+ return item.short == "AIservice";
341
+ }) || item.answer) {
342
+ return {
343
+ key: "messageSource",
344
+ value: item.id,
345
+ question: item.question,
346
+ answer: item.answer
347
+ };
348
+ } else {
349
+ return null;
350
+ }
351
+ });
352
+ questionsList = questionsList.filter(function(i) {
353
+ return i != null;
345
354
  });
346
355
  recommendeQuestionID.current = data.map(function(item) {
347
356
  return item.id;
348
357
  });
358
+ console.log(recommendeQuestionID.current, 4444444);
349
359
  }
350
360
  console.log("dflkvmdfklvdf欢迎语", data);
351
361
  var obj = {
@@ -3044,19 +3054,25 @@ var CustomerService = function(props) {
3044
3054
  return "<span class=".concat(styles.sign, ">").concat(i, "</span>");
3045
3055
  });
3046
3056
  }
3047
- return /*#__PURE__*/ _jsx("p", {
3048
- className: styles.item,
3049
- children: /*#__PURE__*/ _jsx("span", {
3050
- onClick: function() {
3051
- sendMessage(item, 2, "AssociativeProblem");
3052
- setKeyWord("");
3053
- onEvent(serverName + serverUrl(), "click_智能问答_ 发送", "提交");
3054
- },
3055
- dangerouslySetInnerHTML: {
3056
- __html: span
3057
- }
3058
- })
3059
- });
3057
+ if (userData.modules.some(function(item) {
3058
+ return item.short == "AIservice";
3059
+ }) || item.answer) {
3060
+ return /*#__PURE__*/ _jsx("p", {
3061
+ className: styles.item,
3062
+ children: /*#__PURE__*/ _jsx("span", {
3063
+ onClick: function() {
3064
+ sendMessage(item, 2, "AssociativeProblem");
3065
+ setKeyWord("");
3066
+ onEvent(serverName + serverUrl(), "click_智能问答_ 发送", "提交");
3067
+ },
3068
+ dangerouslySetInnerHTML: {
3069
+ __html: span
3070
+ }
3071
+ })
3072
+ });
3073
+ } else {
3074
+ return null;
3075
+ }
3060
3076
  })
3061
3077
  });
3062
3078
  }
@@ -3068,21 +3084,27 @@ var CustomerService = function(props) {
3068
3084
  className: styles.issues_list_flag,
3069
3085
  id: "BottomAssociationProblem",
3070
3086
  children: bottomRecommendationQuestions.map(function(item) {
3071
- return /*#__PURE__*/ _jsxs(_Fragment, {
3072
- children: [
3073
- /*#__PURE__*/ _jsx("p", {
3074
- onClick: function() {
3075
- sendMessage(item, 1);
3076
- if (config && config.type == "video") {
3077
- setBottomRecommendationQuestions([]);
3078
- resettingBottomHei();
3079
- }
3080
- },
3081
- children: item.question
3082
- }, item.id),
3083
- /*#__PURE__*/ _jsx("br", {})
3084
- ]
3085
- });
3087
+ if (userData.modules.some(function(item) {
3088
+ return item.short == "AIservice";
3089
+ }) || item.answer) {
3090
+ return /*#__PURE__*/ _jsxs(_Fragment, {
3091
+ children: [
3092
+ /*#__PURE__*/ _jsx("p", {
3093
+ onClick: function() {
3094
+ sendMessage(item, 1);
3095
+ if (config && config.type == "video") {
3096
+ setBottomRecommendationQuestions([]);
3097
+ resettingBottomHei();
3098
+ }
3099
+ },
3100
+ children: item.question
3101
+ }, item.id),
3102
+ /*#__PURE__*/ _jsx("br", {})
3103
+ ]
3104
+ });
3105
+ } else {
3106
+ return null;
3107
+ }
3086
3108
  })
3087
3109
  });
3088
3110
  } else {
@@ -3090,21 +3112,27 @@ var CustomerService = function(props) {
3090
3112
  className: styles.issues_list_flag,
3091
3113
  id: "BottomAssociationProblem_modal",
3092
3114
  children: bottomRecommendationQuestions.map(function(item) {
3093
- return /*#__PURE__*/ _jsxs(_Fragment, {
3094
- children: [
3095
- /*#__PURE__*/ _jsx("p", {
3096
- onClick: function() {
3097
- sendMessage(item, 1);
3098
- if (config && config.type == "video") {
3099
- setBottomRecommendationQuestions([]);
3100
- resettingBottomHei();
3101
- }
3102
- },
3103
- children: item.question
3104
- }, item.id),
3105
- /*#__PURE__*/ _jsx("br", {})
3106
- ]
3107
- });
3115
+ if (userData.modules.some(function(item) {
3116
+ return item.short == "AIservice";
3117
+ }) || item.answer) {
3118
+ return /*#__PURE__*/ _jsxs(_Fragment, {
3119
+ children: [
3120
+ /*#__PURE__*/ _jsx("p", {
3121
+ onClick: function() {
3122
+ sendMessage(item, 1);
3123
+ if (config && config.type == "video") {
3124
+ setBottomRecommendationQuestions([]);
3125
+ resettingBottomHei();
3126
+ }
3127
+ },
3128
+ children: item.question
3129
+ }, item.id),
3130
+ /*#__PURE__*/ _jsx("br", {})
3131
+ ]
3132
+ });
3133
+ } else {
3134
+ return null;
3135
+ }
3108
3136
  })
3109
3137
  });
3110
3138
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bhd-components",
3
- "version": "0.7.18",
3
+ "version": "0.7.20",
4
4
  "description": "组件功能描述",
5
5
  "files": [
6
6
  "esm",