提交 be3b2400 authored 作者: 王鹏飞's avatar 王鹏飞

bug fixes

上级 45848021
差异被折叠。
...@@ -20,11 +20,12 @@ ...@@ -20,11 +20,12 @@
"@wangeditor/plugin-link-card": "^1.0.0", "@wangeditor/plugin-link-card": "^1.0.0",
"ahooks": "^3.8.0", "ahooks": "^3.8.0",
"ali-oss": "^6.20.0", "ali-oss": "^6.20.0",
"antd": "^5.20.6", "antd": "^5.21.6",
"axios": "^1.6.2", "axios": "^1.6.2",
"dayjs": "^1.11.11", "dayjs": "^1.11.11",
"easy-formula-editor": "^0.0.2-alpha.1", "easy-formula-editor": "^0.0.2-alpha.1",
"echarts": "^5.4.3", "echarts": "^5.4.3",
"evit-gm-crypt": "^1.0.1",
"highlight.js": "^11.9.0", "highlight.js": "^11.9.0",
"jquery": "^3.7.1", "jquery": "^3.7.1",
"js-cookie": "^3.0.5", "js-cookie": "^3.0.5",
......
...@@ -33,11 +33,13 @@ const ChapterItemModal = (props, ref) => { ...@@ -33,11 +33,13 @@ const ChapterItemModal = (props, ref) => {
} }
}, [sectionInfo]) }, [sectionInfo])
const bgColorChange = (value, hex) => { const bgColorChange = value => {
const hex = typeof value === 'string' ? value : value?.toHexString()
setBgColorValue(hex) setBgColorValue(hex)
form.setFieldsValue({ bgColor: hex }) form.setFieldsValue({ bgColor: hex })
} }
const textColorChange = (value, hex) => { const textColorChange = value => {
const hex = typeof value === 'string' ? value : value?.toHexString()
setTextColor(hex) setTextColor(hex)
form.setFieldsValue({ textColor: hex }) form.setFieldsValue({ textColor: hex })
} }
...@@ -130,7 +132,11 @@ const ChapterItemModal = (props, ref) => { ...@@ -130,7 +132,11 @@ const ChapterItemModal = (props, ref) => {
<Divider /> <Divider />
<div className="editor-content-form"> <div className="editor-content-form">
<Form layout="vertical" name="validate_other" form={form} onFinish={onFinish} initialValues={initValues}> <Form layout="vertical" name="validate_other" form={form} onFinish={onFinish} initialValues={initValues}>
<Form.Item label="节头标题" name="title" rules={[{ required: true, message: '请输入节头标题' }]} extra="最多输入30字"> <Form.Item
label="节头标题"
name="title"
rules={[{ required: true, message: '请输入节头标题' }]}
extra="最多输入30字">
<Input maxLength={30} placeholder="" allowClear /> <Input maxLength={30} placeholder="" allowClear />
</Form.Item> </Form.Item>
...@@ -146,7 +152,13 @@ const ChapterItemModal = (props, ref) => { ...@@ -146,7 +152,13 @@ const ChapterItemModal = (props, ref) => {
<Input maxLength={100} placeholder="" allowClear /> <Input maxLength={100} placeholder="" allowClear />
</Form.Item> </Form.Item>
<Form.Item label={` `}> <Form.Item label={` `}>
<ColorPicker disabledAlpha format="hex" value={bgColorValue} defaultValue={bgColorValue} onChange={bgColorChange} /> <ColorPicker
disabledAlpha
format="hex"
value={bgColorValue}
defaultValue={bgColorValue}
onChange={bgColorChange}
/>
</Form.Item> </Form.Item>
</div> </div>
</Col> </Col>
...@@ -160,7 +172,13 @@ const ChapterItemModal = (props, ref) => { ...@@ -160,7 +172,13 @@ const ChapterItemModal = (props, ref) => {
<Input placeholder="" allowClear /> <Input placeholder="" allowClear />
</Form.Item> </Form.Item>
<Form.Item label={` `}> <Form.Item label={` `}>
<ColorPicker disabledAlpha format="hex" value={textColor} defaultValue={textColor} onChange={textColorChange} /> <ColorPicker
disabledAlpha
format="hex"
value={textColor}
defaultValue={textColor}
onChange={textColorChange}
/>
</Form.Item> </Form.Item>
</div> </div>
</Col> </Col>
...@@ -201,7 +219,12 @@ const ChapterItemModal = (props, ref) => { ...@@ -201,7 +219,12 @@ const ChapterItemModal = (props, ref) => {
</Col> </Col>
<Col span={12}> <Col span={12}>
<Form.Item label="高度" name="height"> <Form.Item label="高度" name="height">
<InputNumber controls={false} placeholder="" style={{ width: '100%', textAlign: 'left' }} allowClear /> <InputNumber
controls={false}
placeholder=""
style={{ width: '100%', textAlign: 'left' }}
allowClear
/>
</Form.Item> </Form.Item>
</Col> </Col>
<Col span={12}></Col> <Col span={12}></Col>
......
import { useState, useEffect, forwardRef, useImperativeHandle } from 'react' import { useState, useEffect, forwardRef, useImperativeHandle } from 'react'
import { Divider, Upload, Input, Space, Button, Form, Spin, message, ColorPicker, Select, InputNumber, Row, Col } from 'antd' import {
Divider,
Upload,
Input,
Space,
Button,
Form,
Spin,
message,
ColorPicker,
Select,
InputNumber,
Row,
Col
} from 'antd'
import { CloudUploadOutlined } from '@ant-design/icons' import { CloudUploadOutlined } from '@ant-design/icons'
import { SlateEditor, SlateTransforms, SlateElement } from '@wangeditor/editor' import { SlateEditor, SlateTransforms, SlateElement } from '@wangeditor/editor'
import { fontFamilyList, fontSizeList } from '../utils/setting' import { fontFamilyList, fontSizeList } from '../utils/setting'
...@@ -53,11 +67,13 @@ const ImageModal = (props, ref) => { ...@@ -53,11 +67,13 @@ const ImageModal = (props, ref) => {
} }
}) })
const textColorChange = (value, hex) => { const textColorChange = value => {
const hex = typeof value === 'string' ? value : value?.toHexString()
setTextColor(hex) setTextColor(hex)
form.setFieldsValue({ textColor: hex }) form.setFieldsValue({ textColor: hex })
} }
const bgColorChange = (value, hex) => { const bgColorChange = value => {
const hex = typeof value === 'string' ? value : value?.toHexString()
setBgColorValue(hex) setBgColorValue(hex)
form.setFieldsValue({ bgColor: hex }) form.setFieldsValue({ bgColor: hex })
} }
...@@ -253,7 +269,13 @@ const ImageModal = (props, ref) => { ...@@ -253,7 +269,13 @@ const ImageModal = (props, ref) => {
<Input placeholder="" allowClear /> <Input placeholder="" allowClear />
</Form.Item> </Form.Item>
<Form.Item label={` `}> <Form.Item label={` `}>
<ColorPicker disabledAlpha value={bgColorValue} defaultValue={bgColorValue} format="hex" onChange={bgColorChange} /> <ColorPicker
disabledAlpha
value={bgColorValue}
defaultValue={bgColorValue}
format="hex"
onChange={bgColorChange}
/>
</Form.Item> </Form.Item>
</div> </div>
</Col> </Col>
...@@ -267,7 +289,13 @@ const ImageModal = (props, ref) => { ...@@ -267,7 +289,13 @@ const ImageModal = (props, ref) => {
<Input maxLength={100} placeholder="" allowClear /> <Input maxLength={100} placeholder="" allowClear />
</Form.Item> </Form.Item>
<Form.Item label={` `}> <Form.Item label={` `}>
<ColorPicker value={textColor} defaultValue={textColor} disabledAlpha format="hex" onChange={textColorChange} /> <ColorPicker
value={textColor}
defaultValue={textColor}
disabledAlpha
format="hex"
onChange={textColorChange}
/>
</Form.Item> </Form.Item>
</div> </div>
</Col> </Col>
...@@ -308,7 +336,12 @@ const ImageModal = (props, ref) => { ...@@ -308,7 +336,12 @@ const ImageModal = (props, ref) => {
</Col> </Col>
<Col span={12}> <Col span={12}>
<Form.Item label="高度" name="height"> <Form.Item label="高度" name="height">
<InputNumber controls={false} placeholder="" style={{ width: '100%', textAlign: 'left' }} allowClear /> <InputNumber
controls={false}
placeholder=""
style={{ width: '100%', textAlign: 'left' }}
allowClear
/>
</Form.Item> </Form.Item>
</Col> </Col>
</Row> </Row>
......
...@@ -8,7 +8,16 @@ import './index.less' ...@@ -8,7 +8,16 @@ import './index.less'
import { addExpandRead, expandReadInfo } from '../utils/request' import { addExpandRead, expandReadInfo } from '../utils/request'
const ExpandModal = forwardRef((props, ref) => { const ExpandModal = forwardRef((props, ref) => {
const { editor, ossClient, bookId, chapterId, setExpandVisible, setExpandInfo, expandInfo, selectionSize = 18 } = props const {
editor,
ossClient,
bookId,
chapterId,
setExpandVisible,
setExpandInfo,
expandInfo,
selectionSize = 18
} = props
const [form] = Form.useForm() const [form] = Form.useForm()
const flexValue = Form.useWatch('flex', form) const flexValue = Form.useWatch('flex', form)
...@@ -42,7 +51,8 @@ const ExpandModal = forwardRef((props, ref) => { ...@@ -42,7 +51,8 @@ const ExpandModal = forwardRef((props, ref) => {
setLoadLoading(false) setLoadLoading(false)
} }
const textColorChange = (value, hex) => { const textColorChange = value => {
const hex = typeof value === 'string' ? value : value?.toHexString()
setThemeValue(hex) setThemeValue(hex)
form.setFieldsValue({ theme: hex }) form.setFieldsValue({ theme: hex })
} }
...@@ -248,7 +258,11 @@ const ExpandModal = forwardRef((props, ref) => { ...@@ -248,7 +258,11 @@ const ExpandModal = forwardRef((props, ref) => {
<Select.Option value={2}>行内扩展</Select.Option> <Select.Option value={2}>行内扩展</Select.Option>
</Select> </Select>
</Form.Item> </Form.Item>
<Form.Item label="扩展名称" name="name" rules={[{ required: true, message: '请输入扩展名称' }]} extra="最多输入100字"> <Form.Item
label="扩展名称"
name="name"
rules={[{ required: true, message: '请输入扩展名称' }]}
extra="最多输入100字">
<Input maxLength={100} placeholder="" allowClear /> <Input maxLength={100} placeholder="" allowClear />
</Form.Item> </Form.Item>
{flexValue === 1 && ( {flexValue === 1 && (
...@@ -278,7 +292,13 @@ const ExpandModal = forwardRef((props, ref) => { ...@@ -278,7 +292,13 @@ const ExpandModal = forwardRef((props, ref) => {
<Input placeholder="" allowClear /> <Input placeholder="" allowClear />
</Form.Item> </Form.Item>
<Form.Item label={` `}> <Form.Item label={` `}>
<ColorPicker disabledAlpha value={themeValue} defaultValue={themeValue} format="hex" onChange={textColorChange} /> <ColorPicker
disabledAlpha
value={themeValue}
defaultValue={themeValue}
format="hex"
onChange={textColorChange}
/>
</Form.Item> </Form.Item>
</div> </div>
</Form.Item> </Form.Item>
...@@ -311,7 +331,13 @@ const ExpandModal = forwardRef((props, ref) => { ...@@ -311,7 +331,13 @@ const ExpandModal = forwardRef((props, ref) => {
<Input placeholder="" allowClear /> <Input placeholder="" allowClear />
</Form.Item> </Form.Item>
<Form.Item label={` `}> <Form.Item label={` `}>
<ColorPicker disabledAlpha value={themeValue} defaultValue={themeValue} format="hex" onChange={textColorChange} /> <ColorPicker
disabledAlpha
value={themeValue}
defaultValue={themeValue}
format="hex"
onChange={textColorChange}
/>
</Form.Item> </Form.Item>
</div> </div>
</Col> </Col>
......
...@@ -9,7 +9,16 @@ import GalleryFormItem from './galleryItem' ...@@ -9,7 +9,16 @@ import GalleryFormItem from './galleryItem'
const randomOne = Math.random().toString(16).substring(2, 10) const randomOne = Math.random().toString(16).substring(2, 10)
const GalleryModal = props => { const GalleryModal = props => {
const { editor, galleryInfo, bookId, chapterId, setGalleryVisible, setGalleryInfo, selectionSize = 18, isOnline = false } = props const {
editor,
galleryInfo,
bookId,
chapterId,
setGalleryVisible,
setGalleryInfo,
selectionSize = 18,
isOnline = false
} = props
const [form] = Form.useForm() const [form] = Form.useForm()
const [loading, setLoading] = useState(false) const [loading, setLoading] = useState(false)
...@@ -38,7 +47,8 @@ const GalleryModal = props => { ...@@ -38,7 +47,8 @@ const GalleryModal = props => {
form.setFieldsValue({ gallery: newGalleryList }) form.setFieldsValue({ gallery: newGalleryList })
}, [contentValue]) }, [contentValue])
const textColorChange = (value, hex) => { const textColorChange = value => {
const hex = typeof value === 'string' ? value : value?.toHexString()
setThemeValue(hex) setThemeValue(hex)
form.setFieldsValue({ theme: hex }) form.setFieldsValue({ theme: hex })
} }
...@@ -47,7 +57,15 @@ const GalleryModal = props => { ...@@ -47,7 +57,15 @@ const GalleryModal = props => {
const initialItems = [ const initialItems = [
{ {
label: '图 1', label: '图 1',
children: <GalleryFormItem form={form} galleryInfo={galleryInfo} activeKey={randomOne} setPicList={setPicList} isOnline={isOnline} />, children: (
<GalleryFormItem
form={form}
galleryInfo={galleryInfo}
activeKey={randomOne}
setPicList={setPicList}
isOnline={isOnline}
/>
),
key: randomOne, key: randomOne,
forceRender: true forceRender: true
} }
...@@ -66,7 +84,15 @@ const GalleryModal = props => { ...@@ -66,7 +84,15 @@ const GalleryModal = props => {
const newActiveKey = `${random}` const newActiveKey = `${random}`
newPanes.push({ newPanes.push({
label: `图 ${index + 1}`, label: `图 ${index + 1}`,
children: <GalleryFormItem form={form} galleryInfo={galleryInfo} activeKey={newActiveKey} setPicList={setPicList} isOnline={isOnline} />, children: (
<GalleryFormItem
form={form}
galleryInfo={galleryInfo}
activeKey={newActiveKey}
setPicList={setPicList}
isOnline={isOnline}
/>
),
key: newActiveKey, key: newActiveKey,
forceRender: true forceRender: true
}) })
...@@ -331,7 +357,13 @@ const GalleryModal = props => { ...@@ -331,7 +357,13 @@ const GalleryModal = props => {
<Input placeholder="" allowClear /> <Input placeholder="" allowClear />
</Form.Item> </Form.Item>
<Form.Item label={` `}> <Form.Item label={` `}>
<ColorPicker disabledAlpha value={themeValue} defaultValue={themeValue} format="hex" onChange={textColorChange} /> <ColorPicker
disabledAlpha
value={themeValue}
defaultValue={themeValue}
format="hex"
onChange={textColorChange}
/>
</Form.Item> </Form.Item>
</div> </div>
</Col> </Col>
...@@ -340,7 +372,11 @@ const GalleryModal = props => { ...@@ -340,7 +372,11 @@ const GalleryModal = props => {
)} )}
{flexValue !== 2 && ( {flexValue !== 2 && (
<Form.Item label="画廊标题" name="galleryTitle" rules={[{ required: true, message: '请输入画廊标题' }]} extra="最多输入100字"> <Form.Item
label="画廊标题"
name="galleryTitle"
rules={[{ required: true, message: '请输入画廊标题' }]}
extra="最多输入100字">
<Input maxLength={100} placeholder="" allowClear /> <Input maxLength={100} placeholder="" allowClear />
</Form.Item> </Form.Item>
)} )}
......
...@@ -53,7 +53,8 @@ const LinkModal = (props, ref) => { ...@@ -53,7 +53,8 @@ const LinkModal = (props, ref) => {
} }
}, [linkInfo]) }, [linkInfo])
const textColorChange = (value, hex) => { const textColorChange = value => {
const hex = typeof value === 'string' ? value : value?.toHexString()
setThemeValue(hex) setThemeValue(hex)
form.setFieldsValue({ theme: hex }) form.setFieldsValue({ theme: hex })
} }
...@@ -153,7 +154,11 @@ const LinkModal = (props, ref) => { ...@@ -153,7 +154,11 @@ const LinkModal = (props, ref) => {
</Form.Item> </Form.Item>
{linktype === 1 && ( {linktype === 1 && (
<> <>
<Form.Item label="链接标题" name="title" rules={[{ required: true, message: '请输入链接标题' }]} extra="最多输入100字"> <Form.Item
label="链接标题"
name="title"
rules={[{ required: true, message: '请输入链接标题' }]}
extra="最多输入100字">
<Input maxLength={100} placeholder="" allowClear /> <Input maxLength={100} placeholder="" allowClear />
</Form.Item> </Form.Item>
<Form.Item <Form.Item
...@@ -171,7 +176,12 @@ const LinkModal = (props, ref) => { ...@@ -171,7 +176,12 @@ const LinkModal = (props, ref) => {
{linktype === 2 && ( {linktype === 2 && (
<> <>
<Form.Item label="子节" name="chapters" rules={[{ required: true, message: '请选择子节' }]}> <Form.Item label="子节" name="chapters" rules={[{ required: true, message: '请选择子节' }]}>
<Cascader options={gData} fieldNames={{ label: 'title', value: 'key', children: 'children' }} placeholder="请选择子节" allowClear /> <Cascader
options={gData}
fieldNames={{ label: 'title', value: 'key', children: 'children' }}
placeholder="请选择子节"
allowClear
/>
</Form.Item> </Form.Item>
</> </>
)} )}
...@@ -204,7 +214,13 @@ const LinkModal = (props, ref) => { ...@@ -204,7 +214,13 @@ const LinkModal = (props, ref) => {
<Input placeholder="" allowClear /> <Input placeholder="" allowClear />
</Form.Item> </Form.Item>
<Form.Item label={` `}> <Form.Item label={` `}>
<ColorPicker disabledAlpha value={themeValue} defaultValue={themeValue} format="hex" onChange={textColorChange} /> <ColorPicker
disabledAlpha
value={themeValue}
defaultValue={themeValue}
format="hex"
onChange={textColorChange}
/>
</Form.Item> </Form.Item>
</div> </div>
</Col> </Col>
......
...@@ -22,7 +22,8 @@ const PracticeModal = (props, ref) => { ...@@ -22,7 +22,8 @@ const PracticeModal = (props, ref) => {
} }
}) })
const textColorChange = (value, hex) => { const textColorChange = value => {
const hex = typeof value === 'string' ? value : value?.toHexString()
setThemeValue(hex) setThemeValue(hex)
form.setFieldsValue({ theme: hex }) form.setFieldsValue({ theme: hex })
} }
...@@ -88,7 +89,11 @@ const PracticeModal = (props, ref) => { ...@@ -88,7 +89,11 @@ const PracticeModal = (props, ref) => {
<Divider /> <Divider />
<div className="editor-content-form"> <div className="editor-content-form">
<Form layout="vertical" name="validate_other" form={form} onFinish={onFinish} initialValues={initValues}> <Form layout="vertical" name="validate_other" form={form} onFinish={onFinish} initialValues={initValues}>
<Form.Item label="标题" name="practice" rules={[{ required: true, message: '请输入标题' }]} extra="最多输入100字"> <Form.Item
label="标题"
name="practice"
rules={[{ required: true, message: '请输入标题' }]}
extra="最多输入100字">
<Input maxLength={100} placeholder="" allowClear /> <Input maxLength={100} placeholder="" allowClear />
</Form.Item> </Form.Item>
<Form.Item> <Form.Item>
...@@ -104,7 +109,13 @@ const PracticeModal = (props, ref) => { ...@@ -104,7 +109,13 @@ const PracticeModal = (props, ref) => {
<Input placeholder="" allowClear /> <Input placeholder="" allowClear />
</Form.Item> </Form.Item>
<Form.Item label={` `}> <Form.Item label={` `}>
<ColorPicker disabledAlpha value={themeValue} defaultValue={themeValue} format="hex" onChange={textColorChange} /> <ColorPicker
disabledAlpha
value={themeValue}
defaultValue={themeValue}
format="hex"
onChange={textColorChange}
/>
</Form.Item> </Form.Item>
</div> </div>
</Form.Item> </Form.Item>
......
...@@ -26,7 +26,11 @@ const TooltipModal = (props, ref) => { ...@@ -26,7 +26,11 @@ const TooltipModal = (props, ref) => {
useEffect(() => { useEffect(() => {
if (Object.entries(tooltipInfo).length > 0) { if (Object.entries(tooltipInfo).length > 0) {
let obj = { ...tooltipInfo, tooltipType: parseInt(tooltipInfo.tooltipType), fontSize: parseInt(tooltipInfo.fontsize) } let obj = {
...tooltipInfo,
tooltipType: parseInt(tooltipInfo.tooltipType),
fontSize: parseInt(tooltipInfo.fontsize)
}
setInitValue(obj) setInitValue(obj)
form.setFieldsValue(obj) form.setFieldsValue(obj)
setThemeValue(tooltipInfo.theme) setThemeValue(tooltipInfo.theme)
...@@ -36,7 +40,8 @@ const TooltipModal = (props, ref) => { ...@@ -36,7 +40,8 @@ const TooltipModal = (props, ref) => {
} }
}, [tooltipInfo]) }, [tooltipInfo])
const textColorChange = (value, hex) => { const textColorChange = value => {
const hex = typeof value === 'string' ? value : value?.toHexString()
setThemeValue(hex) setThemeValue(hex)
form.setFieldsValue({ theme: hex }) form.setFieldsValue({ theme: hex })
} }
...@@ -65,7 +70,13 @@ const TooltipModal = (props, ref) => { ...@@ -65,7 +70,13 @@ const TooltipModal = (props, ref) => {
}) })
if (data) { if (data) {
const props = { ...values, link: newLink, random: nowRandom, theme, fontsize: values.fontSize || selectionSize || fontsize } const props = {
...values,
link: newLink,
random: nowRandom,
theme,
fontsize: values.fontSize || selectionSize || fontsize
}
const aPath = findNodeWithParent(editor.children, 'chapterTooltip', 'random', nowRandom) const aPath = findNodeWithParent(editor.children, 'chapterTooltip', 'random', nowRandom)
SlateTransforms.setNodes(editor, props, { at: aPath.reverse() }) SlateTransforms.setNodes(editor, props, { at: aPath.reverse() })
...@@ -199,7 +210,13 @@ const TooltipModal = (props, ref) => { ...@@ -199,7 +210,13 @@ const TooltipModal = (props, ref) => {
<Input placeholder="" allowClear /> <Input placeholder="" allowClear />
</Form.Item> </Form.Item>
<Form.Item label={` `}> <Form.Item label={` `}>
<ColorPicker disabledAlpha value={themeValue} defaultValue={themeValue} format="hex" onChange={textColorChange} /> <ColorPicker
disabledAlpha
value={themeValue}
defaultValue={themeValue}
format="hex"
onChange={textColorChange}
/>
</Form.Item> </Form.Item>
</div> </div>
</Col> </Col>
......
...@@ -8,8 +8,8 @@ const actionMap = { ...@@ -8,8 +8,8 @@ const actionMap = {
expand: { name: '扩写', prompt: '帮我在以下文字内容基础上进行扩写:' }, expand: { name: '扩写', prompt: '帮我在以下文字内容基础上进行扩写:' },
abbreviate: { name: '润色', prompt: '帮我润色以下文字内容:' }, abbreviate: { name: '润色', prompt: '帮我润色以下文字内容:' },
summary: { name: '总结', prompt: '帮我总结以下文字内容:' }, summary: { name: '总结', prompt: '帮我总结以下文字内容:' },
punctuation: { name: '标点校对', prompt: '帮我校对以下文字内容中的标点符号' }, punctuation: { name: '标点校对', prompt: '帮我校对以下文字内容中的标点符号' },
contentInspect: { name: '内容检查', prompt: '帮我检查以下文字内容中的敏感词和错别字' } contentInspect: { name: '内容检查', prompt: '帮我检查以下文字内容中的敏感词和错别字' }
} }
export default function AIModal({ editor, docAction }) { export default function AIModal({ editor, docAction }) {
...@@ -38,7 +38,7 @@ export default function AIModal({ editor, docAction }) { ...@@ -38,7 +38,7 @@ export default function AIModal({ editor, docAction }) {
const handlePrimary = () => { const handlePrimary = () => {
editor.restoreSelection() editor.restoreSelection()
editor.insertText(text) editor.insertText(content)
setIsModalOpen(false) setIsModalOpen(false)
} }
...@@ -47,7 +47,11 @@ export default function AIModal({ editor, docAction }) { ...@@ -47,7 +47,11 @@ export default function AIModal({ editor, docAction }) {
title={`以下是AI${actionText}结果:`} title={`以下是AI${actionText}结果:`}
open={isModalOpen} open={isModalOpen}
footer={null} footer={null}
classNames={{ header: 'editor-header-customer', body: 'editor-body-customer', wrapper: 'editor-wrapper-customer' }} classNames={{
header: 'editor-header-customer',
body: 'editor-body-customer',
wrapper: 'editor-wrapper-customer'
}}
onOk={handlePrimary} onOk={handlePrimary}
onCancel={() => setIsModalOpen(false)}> onCancel={() => setIsModalOpen(false)}>
<Spin spinning={isLoading}> <Spin spinning={isLoading}>
......
...@@ -2,7 +2,7 @@ import axios from 'axios' ...@@ -2,7 +2,7 @@ import axios from 'axios'
import md5 from 'js-md5' import md5 from 'js-md5'
import qs from 'qs' import qs from 'qs'
import { Modal, notification } from 'antd' import { Modal, notification } from 'antd'
import Sm4js from 'sm4js' import { sm4 as Sm4js } from 'evit-gm-crypt'
const sm4 = new Sm4js({ const sm4 = new Sm4js({
key: 'XDXDXU_ZIJING_01', key: 'XDXDXU_ZIJING_01',
......
...@@ -5,7 +5,7 @@ import md5 from 'js-md5' ...@@ -5,7 +5,7 @@ import md5 from 'js-md5'
import { get } from 'lodash-es' import { get } from 'lodash-es'
import { sortObjASCII } from '@/utils/common.js' import { sortObjASCII } from '@/utils/common.js'
import qs from 'qs' import qs from 'qs'
import Sm4js from 'sm4js' import { sm4 as Sm4js } from 'evit-gm-crypt'
const sm4 = new Sm4js({ const sm4 = new Sm4js({
key: 'XDXDXU_ZIJING_01', key: 'XDXDXU_ZIJING_01',
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论