|
@@ -1,6 +1,6 @@
|
|
|
import React, { forwardRef, useEffect, useLayoutEffect, useRef, useState } from 'react'
|
|
|
import BaseTmp from '@/components/BaseTmp';
|
|
|
-import { Row, Col, Radio, RadioChangeEvent , Select, Input, Button, message } from 'antd'
|
|
|
+import { Row, Col, Radio, RadioChangeEvent, Select, Input, Button, message, Tooltip, Modal, Image } from 'antd'
|
|
|
import classNames from 'classnames';
|
|
|
import type { Position } from 'react-rnd';
|
|
|
import { Rnd } from 'react-rnd'
|
|
@@ -15,7 +15,20 @@ import iPhonexBangs from '@/static/common/iPhoneX-top.png'
|
|
|
|
|
|
import { getSectionExcludState } from '@/services/api/section'
|
|
|
|
|
|
-const { getQuestionBank, getQuestionBook, addQuestionCard, getQuestionCardByid, putQuestionCard } = api.question
|
|
|
+import { CloseCircleOutline, QuestionCircleOutlined } from '@ant-design/icons'
|
|
|
+
|
|
|
+import './style/preview.less'
|
|
|
+
|
|
|
+const bg = "https://app-resources-luojigou.luojigou.vip/FhaDyMVgzWGpaTqZTHlGBWN1oKzp";
|
|
|
+
|
|
|
+const TipText = `鼠标双击删除图片`
|
|
|
+
|
|
|
+const {
|
|
|
+ getQuestionBank,
|
|
|
+ addQuestionCard,
|
|
|
+ getQuestionCardByid,
|
|
|
+ putQuestionCard
|
|
|
+} = api.question
|
|
|
|
|
|
type TMerge = IQPData & IQData & IIData & {
|
|
|
color: string,
|
|
@@ -57,8 +70,8 @@ const colorList = [
|
|
|
{color: '', label: ''}
|
|
|
]
|
|
|
|
|
|
-const QPData = { pw: 100, ph: 100, px: 40, py: 80}
|
|
|
-const QData = { w: 80, h: 80, x: 0, y: 0}
|
|
|
+const QPData = { pw: 90, ph: 90, px: 20, py: 80}
|
|
|
+const QData = { w: 60, h: 60, x: 0, y: 0}
|
|
|
const QIData = { iw: 40, ih: 40, ix: 0, iy: 0 }
|
|
|
|
|
|
const permutationKey = ( type: TType ) => {
|
|
@@ -82,7 +95,8 @@ interface IQuestionCard {
|
|
|
deleteImg: ( _imgUrl: string ) => void,
|
|
|
onDragStop: (type: TType, index: number, {x, y}: {x: number, y: number}) => void
|
|
|
saveImageUrl: (imgUrl: string, index: number) => void,
|
|
|
- addBackgoundPicture: () => void
|
|
|
+ addBackgoundPicture: () => void,
|
|
|
+ onClick: (id: string | number, e: any) => void,
|
|
|
}
|
|
|
|
|
|
const QuestionCard: React.FC<IQuestionCard> = ({
|
|
@@ -93,7 +107,8 @@ const QuestionCard: React.FC<IQuestionCard> = ({
|
|
|
onInput,
|
|
|
saveImageUrl,
|
|
|
onDragStop,
|
|
|
- addBackgoundPicture
|
|
|
+ addBackgoundPicture,
|
|
|
+ onClick
|
|
|
}) => {
|
|
|
|
|
|
const [ menuState, setMenuState ] = useState<boolean>(false)
|
|
@@ -105,13 +120,6 @@ const QuestionCard: React.FC<IQuestionCard> = ({
|
|
|
const backgroundList = content.length >= 1 && content?.filter( item => item.bg === 'true' )
|
|
|
|
|
|
const _content = content.length >= 1 && content?.filter( item => item.bg === 'false')
|
|
|
-
|
|
|
- // const backgroundImg = ''
|
|
|
-
|
|
|
- console.log("content:", content);
|
|
|
-
|
|
|
- console.log("backgroundList:", backgroundList );
|
|
|
-
|
|
|
|
|
|
/**
|
|
|
*
|
|
@@ -120,21 +128,36 @@ const QuestionCard: React.FC<IQuestionCard> = ({
|
|
|
*/
|
|
|
|
|
|
const pictureRightClick = ( e: React.MouseEvent ) => {
|
|
|
+
|
|
|
e.preventDefault()
|
|
|
- if (e.button === 2) {
|
|
|
- setMenuState(true)
|
|
|
+
|
|
|
+ console.log("鼠标右键事件:", e);
|
|
|
+ if (e.target.id === 'questionId') {
|
|
|
+ if (e.button === 2) {
|
|
|
+ console.log("鼠标右键事件:", true);
|
|
|
+ setMenuState(true)
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ setMenuState(false)
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ const changeRnder = () => {
|
|
|
+ setMenuState(false)
|
|
|
+ }
|
|
|
|
|
|
const RenderButton = ({color}: {color: string}) => {
|
|
|
- return <div className={styles['render-button']} style={{backgroundColor: color}} ></div>
|
|
|
+ return <div className={styles['render-button']} style={{backgroundColor: color}} />
|
|
|
}
|
|
|
|
|
|
return (
|
|
|
<div className={styles.question} >
|
|
|
- <RightClick render={menuState} deleteImg={(_imgUrl) => deleteImg(_imgUrl)} />
|
|
|
+ <RightClick
|
|
|
+ render={menuState}
|
|
|
+ deleteImg={(_imgUrl) => deleteImg(_imgUrl)}
|
|
|
+ changeRnder={changeRnder}
|
|
|
+ />
|
|
|
<div className={styles['question-card-iphonex']} >
|
|
|
<img src={iPhonexBangs} alt="" />
|
|
|
</div>
|
|
@@ -152,14 +175,16 @@ const QuestionCard: React.FC<IQuestionCard> = ({
|
|
|
/>
|
|
|
</Col>
|
|
|
</Row>
|
|
|
- <Row className={styles['opration-area']} justify='start' >
|
|
|
- <Col className='opration-left' span={16} style={{height: `438px`}}>
|
|
|
+ <Row className={styles['opration-area']} justify="center" >
|
|
|
+ <Col
|
|
|
+ className={styles['opration-left']}
|
|
|
+ >
|
|
|
{
|
|
|
_content && _content?.map( (item, index) => (
|
|
|
<Rnd
|
|
|
key={index}
|
|
|
- minHeight={80}
|
|
|
- minWidth={80}
|
|
|
+ minHeight={20}
|
|
|
+ minWidth={20}
|
|
|
bounds='parent'
|
|
|
className='parent-rnd'
|
|
|
style={{ border: `1px solid ${item.color}`, zIndex: 2}}
|
|
@@ -192,18 +217,18 @@ const QuestionCard: React.FC<IQuestionCard> = ({
|
|
|
}}
|
|
|
>
|
|
|
{
|
|
|
- item.imgUrl ?
|
|
|
+ item?.imgUrl ?
|
|
|
<img
|
|
|
- src={item.imgUrl}
|
|
|
- id={questionId}
|
|
|
- style={{width: item.w + 'px', height: item.h + 'px', boxSizing: 'border-box'}}
|
|
|
- onMouseDown={ (e: React.MouseEvent) => pictureRightClick(e) }
|
|
|
+ src={item?.imgUrl}
|
|
|
+ id={questionId}
|
|
|
+ style={{width: item.w + 'px', height: item.h + 'px', boxSizing: 'border-box', display: 'block'}}
|
|
|
+ onDoubleClick={(e) => onClick(item.id, e)}
|
|
|
/>
|
|
|
:
|
|
|
<UploadImg
|
|
|
title='上传试题'
|
|
|
- imageUrl={item.imgUrl}
|
|
|
- saveImageUrl={ (imgUrl) => saveImageUrl(imgUrl, index)}
|
|
|
+ imageUrl={item?.imgUrl}
|
|
|
+ saveImageUrl={ (imgUrl) => saveImageUrl(imgUrl, item.id)}
|
|
|
uploadCount={1}
|
|
|
/>
|
|
|
}
|
|
@@ -215,7 +240,7 @@ const QuestionCard: React.FC<IQuestionCard> = ({
|
|
|
onMouseDown={e => e.stopPropagation()}
|
|
|
size={{ width: item.iw, height: item.ih }}
|
|
|
position={{ x: item.ix, y: item.iy }}
|
|
|
- onDragStop={(e, d) => { onDragStop( 'button', index, { x: d.x, y: d.y }) }}
|
|
|
+ onDragStop={(e, d) => { onDragStop( 'button', item.id, { x: d.x, y: d.y }) }}
|
|
|
>
|
|
|
{ item.color ? <RenderButton color={item.color} /> : null}
|
|
|
</Rnd>
|
|
@@ -229,13 +254,14 @@ const QuestionCard: React.FC<IQuestionCard> = ({
|
|
|
backgroundList.map( (bg, index) =>
|
|
|
<Rnd
|
|
|
key={index}
|
|
|
- minHeight={80}
|
|
|
- minWidth={80}
|
|
|
+ minHeight={20}
|
|
|
+ minWidth={20}
|
|
|
bounds='parent'
|
|
|
style={{
|
|
|
border: `1px solid blue`,
|
|
|
zIndex: 1,
|
|
|
- background: `url(${bg.imgUrl}) no-repeat center/100% 100% `,
|
|
|
+ background: `url(${bg?.imgUrl}) no-repeat center/100% 100% `,
|
|
|
+ display: 'block'
|
|
|
}}
|
|
|
position={{ x: bg.px, y: bg.py }}
|
|
|
size={{width: bg.pw, height: bg.ph}}
|
|
@@ -249,18 +275,30 @@ const QuestionCard: React.FC<IQuestionCard> = ({
|
|
|
}}
|
|
|
>
|
|
|
{
|
|
|
- bg.imgUrl ? null : <UploadImg
|
|
|
- imageUrl={bg.imgUrl as string}
|
|
|
- saveImageUrl={(imgUrl) => saveImageUrl(imgUrl, bg.id)}
|
|
|
- title='上传背景'
|
|
|
- uploadCount={1}
|
|
|
- />
|
|
|
+ bg?.imgUrl
|
|
|
+ ?
|
|
|
+ <div
|
|
|
+ style={{
|
|
|
+ width: bg.pw + 'px',
|
|
|
+ height: bg.ph + 'px',
|
|
|
+ position: 'absolute',
|
|
|
+ top: 0,
|
|
|
+ left: 0
|
|
|
+ }}
|
|
|
+ onDoubleClick={(e) => onClick(bg.id, e)}
|
|
|
+ /> :
|
|
|
+ <UploadImg
|
|
|
+ imageUrl={bg?.imgUrl as string}
|
|
|
+ saveImageUrl={(imgUrl) => saveImageUrl(imgUrl, bg.id)}
|
|
|
+ title='上传背景'
|
|
|
+ uploadCount={1}
|
|
|
+ />
|
|
|
}
|
|
|
</Rnd>
|
|
|
)
|
|
|
}
|
|
|
</Col>
|
|
|
- <Col span={8} className={styles['answer-area']} > 答案区域 </Col>
|
|
|
+ <Col className={styles['answer-area']} > 答案区域 </Col>
|
|
|
</Row>
|
|
|
{/* 底部操作按钮 */}
|
|
|
|
|
@@ -268,7 +306,6 @@ const QuestionCard: React.FC<IQuestionCard> = ({
|
|
|
style={{
|
|
|
width: "378px",
|
|
|
height: '50px',
|
|
|
- border: '1px solid #000',
|
|
|
borderTop: 'none',
|
|
|
marginTop: "-2px",
|
|
|
marginLeft: '-1px',
|
|
@@ -280,7 +317,6 @@ const QuestionCard: React.FC<IQuestionCard> = ({
|
|
|
<Button type="primary" onClick={addBackgoundPicture} > +背景 </Button>
|
|
|
</Col>
|
|
|
</Row>
|
|
|
-
|
|
|
</div>
|
|
|
)
|
|
|
}
|
|
@@ -319,7 +355,6 @@ const AnswerCard: React.FC<IAnswerCard> = ({
|
|
|
:
|
|
|
<></>
|
|
|
)
|
|
|
-
|
|
|
)
|
|
|
}
|
|
|
</Radio.Group>
|
|
@@ -340,12 +375,11 @@ const AnswerCard: React.FC<IAnswerCard> = ({
|
|
|
<UploadImg
|
|
|
title=''
|
|
|
saveImageUrl={(imageUrl) => saveImageAnswerUrl(imageUrl, index) }
|
|
|
- imageUrl={answer.imgUrl}
|
|
|
+ imageUrl={answer?.imgUrl}
|
|
|
/>
|
|
|
</Col>
|
|
|
<Col>对应答案</Col>
|
|
|
<Col>
|
|
|
-
|
|
|
<RenderColorRadio _color={answer.color} index={index} />
|
|
|
</Col>
|
|
|
</Row>
|
|
@@ -358,15 +392,15 @@ const AnswerCard: React.FC<IAnswerCard> = ({
|
|
|
|
|
|
return (
|
|
|
<Row className={styles['answer-card'] } >
|
|
|
- <Col
|
|
|
- span={24}
|
|
|
+ <Col
|
|
|
+ span={24}
|
|
|
className={styles['ability-point']}
|
|
|
>
|
|
|
|
|
|
{/* 能力选择: */}
|
|
|
</Col>
|
|
|
- <Col
|
|
|
- span={24}
|
|
|
+ <Col
|
|
|
+ span={24}
|
|
|
className={styles['answer-setting']}
|
|
|
style={{height: '232px', borderTop: '1px solid #000', paddingTop: '40px'}}
|
|
|
>
|
|
@@ -400,7 +434,10 @@ const QuestionBankManage: React.FC = () => {
|
|
|
|
|
|
const [ bankList, setBankList ] = useState<{id: string, label: string}[]>([])
|
|
|
|
|
|
- const [ currentBank, setCurrentBank ] = useState<{id: string, label: string}>({})
|
|
|
+ const [ currentBank, setCurrentBank ] = useState<{id: string, label: string}>({
|
|
|
+ id: '',
|
|
|
+ label: ''
|
|
|
+ })
|
|
|
|
|
|
const [ title, setTitle ] = useState<string>()
|
|
|
|
|
@@ -430,6 +467,13 @@ const QuestionBankManage: React.FC = () => {
|
|
|
semesterName: ""
|
|
|
})
|
|
|
|
|
|
+ /**预览弹窗 */
|
|
|
+ const [ previewVisible, setPreviewVisible ] = useState<boolean>(false)
|
|
|
+
|
|
|
+
|
|
|
+ console.log(answerList);
|
|
|
+
|
|
|
+
|
|
|
const location = useLocation()
|
|
|
|
|
|
const cardId = location.query.cardId
|
|
@@ -474,12 +518,33 @@ const QuestionBankManage: React.FC = () => {
|
|
|
|
|
|
}, [previous])
|
|
|
|
|
|
+ /**删除试题获取背景图 */
|
|
|
+ const onClear = ( id: string | number , e: any) => {
|
|
|
+ console.log("删除试题获取背景图:", id, e);
|
|
|
+
|
|
|
+ const r = content.map( item => {
|
|
|
+ if ( item.id === id && item.bg === 'false') {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ imgUrl: ''
|
|
|
+ }
|
|
|
+ } else if (item.id === id && item.bg === 'true') {
|
|
|
+ return false
|
|
|
+ } else {
|
|
|
+ return item
|
|
|
+ }
|
|
|
+ }).filter( _ => !!_ )
|
|
|
+ console.log(r);
|
|
|
+
|
|
|
+ setContent(r)
|
|
|
+ }
|
|
|
+
|
|
|
/**保存结果答案 */
|
|
|
const saveImageAnswerUrl = (imgUrl: string, index: number) => {
|
|
|
const r = answerList.map( (answer, i) => {
|
|
|
return {
|
|
|
...answer,
|
|
|
- imgUrl: index === i ? imgUrl: answer.imgUrl
|
|
|
+ imgUrl: index === i ? imgUrl: answer?.imgUrl
|
|
|
}
|
|
|
})
|
|
|
setAnswerList(r)
|
|
@@ -505,12 +570,12 @@ const QuestionBankManage: React.FC = () => {
|
|
|
const onInput = (e: InputEvent) => setLabel(e.target.value)
|
|
|
|
|
|
/** 保存图片 */
|
|
|
- const saveImageUrl = (imgUrl: string, index: number) => {
|
|
|
+ const saveImageUrl = (imgUrl: string, id: number) => {
|
|
|
|
|
|
const r = content?.map( (item, i) => {
|
|
|
return {
|
|
|
...item,
|
|
|
- imgUrl: index === i ? imgUrl : item.imgUrl
|
|
|
+ imgUrl: id === item.id ? imgUrl : item.imgUrl
|
|
|
}
|
|
|
})
|
|
|
|
|
@@ -525,17 +590,16 @@ const QuestionBankManage: React.FC = () => {
|
|
|
|
|
|
) => {
|
|
|
|
|
|
- console.log( x, y);
|
|
|
-
|
|
|
-
|
|
|
const [ _w, _h , _x, _y ] = permutationKey(type)
|
|
|
|
|
|
const r = content?.map( (item, i) => {
|
|
|
+ console.log(item.id, index);
|
|
|
+
|
|
|
const target = item.id === index
|
|
|
return {
|
|
|
...item,
|
|
|
- [_x]: target? x : item[_x],
|
|
|
- [_y]: target? y : item[_y]
|
|
|
+ [_x]: target? x.toFixed(2) : item[_x],
|
|
|
+ [_y]: target? y.toFixed(2) : item[_y]
|
|
|
}
|
|
|
})
|
|
|
|
|
@@ -567,7 +631,7 @@ const QuestionBankManage: React.FC = () => {
|
|
|
|
|
|
const _QPData = {
|
|
|
...QPData,
|
|
|
- px: even ? 140 : 30,
|
|
|
+ px: even ? 100 : 10,
|
|
|
py: lt ? 80 : 200,
|
|
|
}
|
|
|
|
|
@@ -663,12 +727,13 @@ const QuestionBankManage: React.FC = () => {
|
|
|
index?: number,
|
|
|
) => {
|
|
|
|
|
|
- const rw = Number(w.replace('px', ''))
|
|
|
- const rh = Number(h.replace('px', ''))
|
|
|
+ const rw = Number(w.replace('px', '')).toFixed(2)
|
|
|
+
|
|
|
+ const rh = Number(h.replace('px', '')).toFixed(2)
|
|
|
|
|
|
const [ _w, _h , _x, _y ] = permutationKey(type)
|
|
|
|
|
|
- console.log(_w, _h , _x, _y, index);
|
|
|
+ console.log('修改题卡大小:', rw, rh, index);
|
|
|
|
|
|
const r = content?.map( (item, i) => {
|
|
|
const target = item.id === index
|
|
@@ -676,8 +741,8 @@ const QuestionBankManage: React.FC = () => {
|
|
|
...item,
|
|
|
[_w]: target? rw : item[_w],
|
|
|
[_h]: target? rh : item[_h],
|
|
|
- [_x]: target? pos.x : item[_x],
|
|
|
- [_y]: target? pos.y : item[_y]
|
|
|
+ [_x]: target? pos.x.toFixed(2) : item[_x],
|
|
|
+ [_y]: target? pos.y.toFixed(2) : item[_y]
|
|
|
}
|
|
|
})
|
|
|
if (type === 'parent' || type === "bg") {
|
|
@@ -700,23 +765,18 @@ const QuestionBankManage: React.FC = () => {
|
|
|
setLabel(result.label)
|
|
|
setTitle(result.title)
|
|
|
setAbility(result.ableVar)
|
|
|
-
|
|
|
- console.log('bankList:', bankList);
|
|
|
|
|
|
setCurrentBank({
|
|
|
- label: result.bankLabel,
|
|
|
+ label: result.bankName,
|
|
|
id: result.bankId
|
|
|
})
|
|
|
|
|
|
setSection({
|
|
|
- label: result.semesterName,
|
|
|
+ semesterName: result.semesterName,
|
|
|
id: result.semesterId
|
|
|
})
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
/**返回上一次 */
|
|
@@ -734,10 +794,10 @@ const QuestionBankManage: React.FC = () => {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- // if (!ability?.length) {
|
|
|
- // message.error("请填写能力点")
|
|
|
- // return
|
|
|
- // }
|
|
|
+ if (!ability?.length) {
|
|
|
+ message.error("请填写能力点")
|
|
|
+ return
|
|
|
+ }
|
|
|
|
|
|
|
|
|
if ( !section.id ) {
|
|
@@ -769,9 +829,9 @@ const QuestionBankManage: React.FC = () => {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- const r2 = content.filter( item => !item.imgUrl && item.bg === "false" ).length
|
|
|
+ const r2 = content.filter( item => !item?.imgUrl && item.bg === "false" ).length
|
|
|
|
|
|
- const r3 = answerList.filter( item => !item.imgUrl ).length
|
|
|
+ const r3 = answerList.filter( item => !item?.imgUrl ).length
|
|
|
|
|
|
if( r2 ) {
|
|
|
message.error("存在未上传的问题")
|
|
@@ -803,11 +863,11 @@ const QuestionBankManage: React.FC = () => {
|
|
|
label,
|
|
|
title,
|
|
|
semesterId: section.id,
|
|
|
- ableVar: "逻辑能力",
|
|
|
+ ableVar: ability,
|
|
|
id: cardId ? cardId : '',
|
|
|
bankId: currentBank?.id,
|
|
|
bankLabel: currentBank?.label,
|
|
|
- semesterName: section?.laebl
|
|
|
+ semesterName: section?.semesterName
|
|
|
}
|
|
|
|
|
|
_addQuestionCard(state, $par)
|
|
@@ -865,6 +925,12 @@ const QuestionBankManage: React.FC = () => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /** 预览游戏 */
|
|
|
+
|
|
|
+ const previewView = () => {
|
|
|
+ setPreviewVisible(true)
|
|
|
+ }
|
|
|
+
|
|
|
return (
|
|
|
<BaseTmp>
|
|
|
<Row style={{marginTop: '20px', width: '100%'}} >
|
|
@@ -881,13 +947,14 @@ const QuestionBankManage: React.FC = () => {
|
|
|
<Row style={{marginTop: '20px'}} >
|
|
|
<Col span={2} > 学段: </Col>
|
|
|
<Col>
|
|
|
- <Select defaultValue={section.id} style={{ width: 300 }} onChange={onChangeSection} >
|
|
|
+
|
|
|
+ <Select key={section.id} defaultValue={section.id} style={{ width: 300 }} onChange={onChangeSection} >
|
|
|
+
|
|
|
{
|
|
|
- sectionList && sectionList.map( data =>
|
|
|
- <Select.Option
|
|
|
- value={data.id}
|
|
|
+ sectionList.map( data =>
|
|
|
+ <Select.Option
|
|
|
+ value={data.id}
|
|
|
key={data.id}
|
|
|
-
|
|
|
>
|
|
|
{data.semesterName}
|
|
|
</Select.Option>
|
|
@@ -900,15 +967,20 @@ const QuestionBankManage: React.FC = () => {
|
|
|
<Col span={2} > 卡片名称: </Col>
|
|
|
<Col> <Input style={{ width: "300px" }} onInput={onInputTitle} value={title} /> </Col>
|
|
|
</Row>
|
|
|
- {/* <Row style={{marginTop: '20px'}} >
|
|
|
- <Col> 能力点: </Col>
|
|
|
+ <Row style={{marginTop: '20px'}} >
|
|
|
+ <Col span={2} > 能力点: </Col>
|
|
|
<Col> <Input onInput={onInputAbility} value={ability} /> </Col>
|
|
|
- </Row> */}
|
|
|
+ </Row>
|
|
|
<Row
|
|
|
className={styles['question-bank-manage']}
|
|
|
style={{marginTop: '20px'}}
|
|
|
>
|
|
|
- <Col>题卡:</Col>
|
|
|
+ <Col>
|
|
|
+ 题卡:<br />
|
|
|
+ <Tooltip placement="top" title={TipText} >
|
|
|
+ <QuestionCircleOutlined />
|
|
|
+ </Tooltip>
|
|
|
+ </Col>
|
|
|
<Col span={7.5} >
|
|
|
<QuestionCard
|
|
|
label={label}
|
|
@@ -920,6 +992,7 @@ const QuestionBankManage: React.FC = () => {
|
|
|
deleteImg={deleteImg}
|
|
|
saveImageUrl={saveImageUrl}
|
|
|
addBackgoundPicture={addBackgoundPicture}
|
|
|
+ onClick={(id, e) => onClear(id, e)}
|
|
|
/>
|
|
|
</Col>
|
|
|
<Col span={13.5}>
|
|
@@ -941,12 +1014,152 @@ const QuestionBankManage: React.FC = () => {
|
|
|
保存
|
|
|
</Button>
|
|
|
</Col>
|
|
|
+ <Col span={2} >
|
|
|
+ <Button type="primary" onClick={previewView} > 预览 </Button>
|
|
|
+ </Col>
|
|
|
+
|
|
|
<Col span={2} >
|
|
|
<Button type="primary" onClick={() => submit(1)} >
|
|
|
{submitButtonLabel}
|
|
|
</Button>
|
|
|
</Col>
|
|
|
</Row>
|
|
|
+
|
|
|
+ <Modal
|
|
|
+ title="预览"
|
|
|
+ visible={ previewVisible }
|
|
|
+ closable={false}
|
|
|
+ onCancel={() => setPreviewVisible(false)}
|
|
|
+ onOk={ () => setPreviewVisible(false)}
|
|
|
+ >
|
|
|
+ <div className="game-card-v2">
|
|
|
+ <div className="header">
|
|
|
+ <div className="header-content" >
|
|
|
+ <div className="level-count">
|
|
|
+ { [0,1,2,3,4].map( item => <div key={item} className={classNames(['level-item', 'level-item-active'])} /> ) }
|
|
|
+
|
|
|
+ </div>
|
|
|
+ <div className="count-down">
|
|
|
+ <img className="clock" src='https://app-resources-luojigou.luojigou.vip/FtYk1U3hzbNiea1x6OS8_ZnCluq-' />
|
|
|
+ <div className={classNames(['showCountDownAni', 'flack-className'])} >
|
|
|
+ 60
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div
|
|
|
+ className="content"
|
|
|
+ style={{
|
|
|
+ background: `url(https://app-resources-luojigou.luojigou.vip/Fqj0sowjX078sk3PgbBlSvT_Ti9R) no-repeat top left`,
|
|
|
+ backgroundSize: '100%',
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ <div
|
|
|
+ className="board"
|
|
|
+ style={{
|
|
|
+ background: `url(${bg}) no-repeat center`,
|
|
|
+ backgroundSize: '100%',
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ <div className="board-header" id="game-label">
|
|
|
+ <div className="trumpt">
|
|
|
+ <image className="dog" src='https://app-resources-luojigou.luojigou.vip/Fg6qeptPdjRsg3eDUyuGiXOTSPJV' />
|
|
|
+ <image className="trumpt-icon" src="https://app-resources-luojigou.luojigou.vip/FnahepHJN1cSRD03VEFLebxL5Br-"/>
|
|
|
+ </div>
|
|
|
+ <div className="tip van-multi-ellipsis--l2">
|
|
|
+ 我是问题
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div className="question">
|
|
|
+ <div className="question-card">
|
|
|
+ {
|
|
|
+ content.map( item => (
|
|
|
+ <div
|
|
|
+ className="game-item"
|
|
|
+ style={{
|
|
|
+ width: item.pw + 'px',
|
|
|
+ height: item.ph + 'px',
|
|
|
+ top: item.py + 'px',
|
|
|
+ left: item.px + 'px',
|
|
|
+ }}
|
|
|
+ key={item.id}
|
|
|
+ >
|
|
|
+ <div
|
|
|
+ className="round"
|
|
|
+ style={{
|
|
|
+ backgroundColor: item.color,
|
|
|
+ width: item.iw + 'px',
|
|
|
+ height: item.ih + 'px',
|
|
|
+ top: item.iy + 'px',
|
|
|
+ left: item.ix + 'px',
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ <img
|
|
|
+ style={{
|
|
|
+ width: item.w + 'px',
|
|
|
+ height: item.h + 'px',
|
|
|
+ top: item.y + 'px',
|
|
|
+ left: item.x + 'px',
|
|
|
+ display: 'block'
|
|
|
+ }}
|
|
|
+ src={item.imgUrl}
|
|
|
+ />
|
|
|
+ {
|
|
|
+ item.bg == 'true' &&
|
|
|
+ <div
|
|
|
+ className={classNames(['game-item', "game-bg"])}
|
|
|
+ style={{
|
|
|
+ width: item.pw + 'rpx',
|
|
|
+ height: item.ph + 'rpx',
|
|
|
+ top: item.py + 'rpx',
|
|
|
+ left: item.px + 'rpx',
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ <Image
|
|
|
+ style={{
|
|
|
+ width: item.w + 'rpx',
|
|
|
+ height: item.h + 'rpx',
|
|
|
+ top: item.y + 'rpx',
|
|
|
+ left: item.x + 'rpx',
|
|
|
+ display: 'block'
|
|
|
+ }}
|
|
|
+ src={item.imgUrl}
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ }
|
|
|
+ </div>
|
|
|
+ ))
|
|
|
+ }
|
|
|
+ </div>
|
|
|
+ <div className="question-answer" id="right-box">
|
|
|
+ {
|
|
|
+ answerList.filter( answer => !!answer.imgUrl).map( (item, index) => (
|
|
|
+ <div
|
|
|
+ key={item.color}
|
|
|
+ className="answer-item"
|
|
|
+ >
|
|
|
+ { console.log(index)}
|
|
|
+
|
|
|
+ {/* <div
|
|
|
+ className="answer-round"
|
|
|
+ style={{ backgroundColor: item.color }}
|
|
|
+ >
|
|
|
+ </div> */}
|
|
|
+ <img style={{objectFit: 'cover'}} src={item.imgUrl} />
|
|
|
+ {/* <div className="line" v-if="index !== gameOption.length - 1" /> */}
|
|
|
+ </div>
|
|
|
+ ))
|
|
|
+ }
|
|
|
+
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </Modal>
|
|
|
</BaseTmp>
|
|
|
)
|
|
|
|