feat: 获取图文集所有者、类型数据;调整 Lexical Editor z-index 在 Drawer 下使用

2.0/email-builder
Jimmy Liow 11 months ago
parent 55c9a18699
commit bfe9c79bd9

@ -568,7 +568,7 @@ i.chevron-down {
}
.dropdown {
z-index: 1001; /* Ant Modal z-index: 1000, 大于它才能使用在 Modal */
z-index: 1201; /* Ant Modal z-index: 1000, Drawer z-index: 1200, 大于它才能使用在 Modal */
display: block;
position: absolute;
box-shadow: 0 12px 28px 0 rgba(0, 0, 0, 0.2), 0 2px 4px 0 rgba(0, 0, 0, 0.1),

@ -0,0 +1,36 @@
import { create } from 'zustand'
import { devtools } from 'zustand/middleware'
import { fetchJSON, postForm } from '@/utils/request'
import { API_HOST } from '@/config'
import { isNotEmpty, prepareUrl } from '@/utils/commons'
const useSnippetStore = create(devtools((set, get) => ({
ownerList: [],
typeList: [],
fetchParamList: async () => {
let fetchOwnerUrl = `${API_HOST}/v2/GetAutoDocParameters`
const params = {};
return fetchJSON(fetchOwnerUrl, params)
.then(json => {
if (json.errcode === 0) {
console.info(json)
set(() => ({
ownerList: json?.result?.owner.map(item => {
return { value: item.vsn, label: item.vname }
}),
typeList: json?.result?.type.map(item => {
return { value: item.vsn, label: item.vname }
})
}))
} else {
throw new Error(json?.errmsg + ': ' + json.errcode)
}
})
},
}), { name: 'snippetStore' }))
export default useSnippetStore

@ -11,14 +11,18 @@ import {
Modal,
Select
} from 'antd'
import { useState, useRef } from 'react'
import { useState, useRef, useEffect } from 'react'
import LexicalEditorInput from './LexicalEditorInput'
import useSnippetStore from '@/stores/SnippetStore'
function SnippetList() {
const [form] = Form.useForm()
const [snippetForm] = Form.useForm()
const editorRef = useRef(null)
const [fetchParamList, ownerList, typeList] =
useSnippetStore(state => [state.fetchParamList, state.ownerList, state.typeList])
const [isSnippetModalOpen, setSnippetModalOpen] = useState(false)
const [editorContent, setEditorContent] = useState(
"<p>Discover the best of the world with one of the <strong>best-rated tour companies for personalized travel</strong>. With over <strong>10,000+ reviews and a 98.8% 5-star rating</strong>, we focus on streamlining your planning and ensuring joyful travels. Whether it's a milestone celebration or a relaxing getaway, let us help create your beautiful journey.</p>",
@ -35,6 +39,10 @@ function SnippetList() {
// form.resetFields()
}
useEffect(() => {
fetchParamList()
}, [])
return (
<>
<Modal
@ -111,11 +119,12 @@ function SnippetList() {
initialValues={{
layout: 'inline',
}}>
<Form.Item label='所有者'>
<Input placeholder='placeholder' />
<Select className='!w-40' options={ownerList} />
</Form.Item>
<Form.Item label='类别'>
<Input placeholder='placeholder' />
<Select className='!w-40' options={typeList} />
</Form.Item>
<Form.Item label='状态'>
<Input placeholder='placeholder' />

Loading…
Cancel
Save