lanjianrong před 4 roky
rodič
revize
4807cfeaf5

+ 45 - 0
src/pages/Hr/Notification/components/RighEditor.jsx

@@ -20,6 +20,51 @@ const RighEditor = ({ value, onChange }) => {
       toolbarConfig: {
         pin: true
       },
+      toolbar: [
+        'emoji',
+        'headings',
+        'bold',
+        'italic',
+        'strike',
+        'link',
+        '|',
+        'list',
+        'ordered-list',
+        'check',
+        'outdent',
+        'indent',
+        '|',
+        'quote',
+        'line',
+        'code',
+        'inline-code',
+        'insert-before',
+        'insert-after',
+        '|',
+        // "upload",
+        // "record",
+        'table',
+        '|',
+        'undo',
+        'redo',
+        '|',
+        'fullscreen',
+        'edit-mode',
+        {
+          name: 'more',
+          toolbar: [
+            'both',
+            'code-theme',
+            'content-theme',
+            'export',
+            'outline',
+            'preview',
+            'devtools',
+            'info',
+            'help'
+          ]
+        }
+      ],
       value: cValue,
       input(val) {
         handleEditorChange(val)

+ 8 - 10
src/pages/Hr/Notification/index.jsx

@@ -4,27 +4,22 @@ import InfiniteScroll from 'react-infinite-scroll-component'
 import { queryMessageList, sendMessage } from '@/services/staff'
 import AddMessage from './components/AddMessage'
 import consts from '@/consts'
-import { useRequest } from 'umi'
+import { useRequest, useIntl } from 'umi'
 import { useModal } from '@/components/Modal'
 import MessageDrawer from './components/MessageDrawer'
 import ws, { CmdType } from '@/utils/ws'
-// import MarkDown from 'react-markdown'
 
 const Notification = () => {
+  const intl = useIntl()
   const { toggleDrawer, setDrawerProps } = useModal()
   // const { sendMsg } = useWebSocketFn()
-  const msgTypeEnum = {
-    message: '消息',
-    notification: '通知'
-  }
   const [state, setState] = useState({
     loading: false,
     list: [],
     hasMore: false,
     current: 1,
     pageSize: 15,
-    total: 0,
-    msgType: 'notification'
+    total: 0
   })
 
   const initData = async params => {
@@ -36,7 +31,7 @@ const Notification = () => {
     if (code === consts.RET_CODE.SUCCESS) {
       setState({
         ...state,
-        list: params?.current === 1 ? list : state.list.concat(message),
+        list: params?.current === 1 ? list : state.list.concat(list),
         total,
         loading: false,
         hasMore: total > params.current * state.pageSize,
@@ -114,7 +109,10 @@ const Notification = () => {
                   }
                   description={
                     <div className="mb-1">
-                      <Tag color="purple">{msgTypeEnum[item.msgType]}</Tag> '发布于',
+                      <Tag color="purple">
+                        {intl.formatMessage({ id: `component.globalHeader.${item.msgType}` })}
+                      </Tag>{' '}
+                      '发布于',
                       <span className="ml-2">全公司</span>
                     </div>
                   }