bhd-components 0.6.1 → 0.6.2

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.
@@ -9,7 +9,6 @@ const ContactsList = /*#__PURE__*/ forwardRef((props, ref)=>{
9
9
  let { type , roomId , userData , http , urllocation , onClose , switchChatRoom , saveContactsList } = props;
10
10
  const [contactsList, setContactsList] = useState([]); //老师列表
11
11
  const [newRoomId, setNewRoomId] = useState("");
12
- const [firstLoading, setFirstLoading] = useState(true);
13
12
  // const [type,setType] = useState(0);
14
13
  let timer = useRef(null); //文本框输入时
15
14
  //获取聊天室列表
@@ -1,6 +1,8 @@
1
1
  @import "../../theme/variable.less";
2
2
  // @color-background-primary-weak-hover:@color-background-info-weak;
3
3
 
4
+
5
+
4
6
  //联系人列表
5
7
  .teacher_layout {
6
8
  position: fixed;
@@ -12,7 +12,6 @@ const HistoryFun = (props)=>{
12
12
  let { type , roomId , userData , http , urllocation , onClose , loadSpecifiedData , roomList } = props;
13
13
  const [keyWordProblem, setKeyWordProblem] = useState(""); //搜索内容
14
14
  const [keyHistoryMessageList, setKeyHistoryMessageList] = useState([]); //搜索的历史记录
15
- const [userNameObj, setUserNameObj] = useState([]); //根据用户id,存储一些用户名
16
15
  const [showLoadingState, setShowLoadingState] = useState(1); //1,初始状态,2、无数据 ,3、不显示图片
17
16
  const [load, setLoad] = useState(false);
18
17
  const timer = useRef(null); //文本框输入时
@@ -88,7 +87,7 @@ const HistoryFun = (props)=>{
88
87
  return pageNumber;
89
88
  };
90
89
  //根据index,计算历史数据在第几页
91
- const calculationData = (roomId, index, id, sender)=>{
90
+ const calculationData = (roomId, index, id, receiver)=>{
92
91
  allData(roomId).then((res)=>{
93
92
  // console.log(res.data.messages,'11111111')
94
93
  if (res.data) {
@@ -243,7 +242,8 @@ const HistoryFun = (props)=>{
243
242
  return /*#__PURE__*/ _jsxs("div", {
244
243
  className: styles.list,
245
244
  onClick: ()=>{
246
- calculationData(item.roomId, item.messageIdWithinRoom, item.id, item.receiver);
245
+ let id = item.receiver == userData.mid ? item.sender : item.receiver;
246
+ calculationData(item.roomId, item.messageIdWithinRoom, id, item.receiver);
247
247
  },
248
248
  children: [
249
249
  /*#__PURE__*/ _jsxs("div", {
@@ -1815,7 +1815,7 @@ const CustomerService = (props)=>{
1815
1815
  ]
1816
1816
  }),
1817
1817
  //在ai窗口并ai已经生成完答案
1818
- findTeacherBtn && /*#__PURE__*/ _jsx("span", {
1818
+ findTeacherBtn && userData.modules.some((item)=>item.short == "TeacherAnswer") && /*#__PURE__*/ _jsx("span", {
1819
1819
  className: styles.find_teacher,
1820
1820
  onClick: ()=>{
1821
1821
  setAnswerMode(1);
@@ -2190,7 +2190,9 @@ const CustomerService = (props)=>{
2190
2190
  }
2191
2191
  createRooms(receiver);
2192
2192
  if (childRef.current) {
2193
- childRef.current.roomsListTimer();
2193
+ setTimeout(()=>{
2194
+ childRef.current.roomsListTimer();
2195
+ }, 500);
2194
2196
  }
2195
2197
  setPageNum(page);
2196
2198
  setLastId(id); //用于定位
@@ -2,6 +2,7 @@
2
2
  // @color-data-visualization-01: @color-background-info-base;
3
3
  // @color-text-primary: @color-background-info-base;
4
4
 
5
+
5
6
  .service_ChatWindow_Drawer,
6
7
  .ChatWindow_Modal {
7
8
  width: 100% !important;
@@ -10,7 +10,6 @@ var ContactsList = /*#__PURE__*/ forwardRef(function(props, ref) {
10
10
  var type = props.type, roomId = props.roomId, userData = props.userData, http = props.http, urllocation = props.urllocation, onClose = props.onClose, switchChatRoom = props.switchChatRoom, saveContactsList = props.saveContactsList;
11
11
  var _useState = _sliced_to_array(useState([]), 2), contactsList = _useState[0], setContactsList = _useState[1]; //老师列表
12
12
  var _useState1 = _sliced_to_array(useState(""), 2), newRoomId = _useState1[0], setNewRoomId = _useState1[1];
13
- var _useState2 = _sliced_to_array(useState(true), 2), firstLoading = _useState2[0], setFirstLoading = _useState2[1];
14
13
  // const [type,setType] = useState(0);
15
14
  var timer = useRef(null); //文本框输入时
16
15
  //获取聊天室列表
@@ -1,6 +1,8 @@
1
1
  @import "../../theme/variable.less";
2
2
  // @color-background-primary-weak-hover:@color-background-info-weak;
3
3
 
4
+
5
+
4
6
  //联系人列表
5
7
  .teacher_layout {
6
8
  position: fixed;
@@ -13,9 +13,8 @@ var HistoryFun = function(props) {
13
13
  var type = props.type, roomId = props.roomId, userData = props.userData, http = props.http, urllocation = props.urllocation, onClose = props.onClose, loadSpecifiedData = props.loadSpecifiedData, roomList = props.roomList;
14
14
  var _useState = _sliced_to_array(useState(""), 2), keyWordProblem = _useState[0], setKeyWordProblem = _useState[1]; //搜索内容
15
15
  var _useState1 = _sliced_to_array(useState([]), 2), keyHistoryMessageList = _useState1[0], setKeyHistoryMessageList = _useState1[1]; //搜索的历史记录
16
- var _useState2 = _sliced_to_array(useState([]), 2), userNameObj = _useState2[0], setUserNameObj = _useState2[1]; //根据用户id,存储一些用户名
17
- var _useState3 = _sliced_to_array(useState(1), 2), showLoadingState = _useState3[0], setShowLoadingState = _useState3[1]; //1,初始状态,2、无数据 ,3、不显示图片
18
- var _useState4 = _sliced_to_array(useState(false), 2), load = _useState4[0], setLoad = _useState4[1];
16
+ var _useState2 = _sliced_to_array(useState(1), 2), showLoadingState = _useState2[0], setShowLoadingState = _useState2[1]; //1,初始状态,2、无数据 ,3、不显示图片
17
+ var _useState3 = _sliced_to_array(useState(false), 2), load = _useState3[0], setLoad = _useState3[1];
19
18
  var timer = useRef(null); //文本框输入时
20
19
  var objName = useRef([]);
21
20
  useEffect(function() {
@@ -95,7 +94,7 @@ var HistoryFun = function(props) {
95
94
  return pageNumber;
96
95
  };
97
96
  //根据index,计算历史数据在第几页
98
- var calculationData = function(roomId, index, id, sender) {
97
+ var calculationData = function(roomId, index, id, receiver) {
99
98
  allData(roomId).then(function(res) {
100
99
  // console.log(res.data.messages,'11111111')
101
100
  if (res.data) {
@@ -256,7 +255,8 @@ var HistoryFun = function(props) {
256
255
  return /*#__PURE__*/ _jsxs("div", {
257
256
  className: styles.list,
258
257
  onClick: function() {
259
- calculationData(item.roomId, item.messageIdWithinRoom, item.id, item.receiver);
258
+ var id = item.receiver == userData.mid ? item.sender : item.receiver;
259
+ calculationData(item.roomId, item.messageIdWithinRoom, id, item.receiver);
260
260
  },
261
261
  children: [
262
262
  /*#__PURE__*/ _jsxs("div", {
@@ -1897,7 +1897,9 @@ var CustomerService = function(props) {
1897
1897
  ]
1898
1898
  }),
1899
1899
  //在ai窗口并ai已经生成完答案
1900
- findTeacherBtn && /*#__PURE__*/ _jsx("span", {
1900
+ findTeacherBtn && userData.modules.some(function(item) {
1901
+ return item.short == "TeacherAnswer";
1902
+ }) && /*#__PURE__*/ _jsx("span", {
1901
1903
  className: styles.find_teacher,
1902
1904
  onClick: function() {
1903
1905
  setAnswerMode(1);
@@ -2284,7 +2286,9 @@ var CustomerService = function(props) {
2284
2286
  }
2285
2287
  createRooms(receiver);
2286
2288
  if (childRef.current) {
2287
- childRef.current.roomsListTimer();
2289
+ setTimeout(function() {
2290
+ childRef.current.roomsListTimer();
2291
+ }, 500);
2288
2292
  }
2289
2293
  setPageNum(page);
2290
2294
  setLastId(id); //用于定位
@@ -2,6 +2,7 @@
2
2
  // @color-data-visualization-01: @color-background-info-base;
3
3
  // @color-text-primary: @color-background-info-base;
4
4
 
5
+
5
6
  .service_ChatWindow_Drawer,
6
7
  .ChatWindow_Modal {
7
8
  width: 100% !important;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bhd-components",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
4
4
  "description": "组件功能描述",
5
5
  "files": [
6
6
  "esm",