|
|
|
@ -2,6 +2,7 @@ import React, { Component } from "react"; |
|
|
|
|
import { Form, Input, Button, Radio, Checkbox, Select, message } from "antd"; |
|
|
|
|
import { dictionary } from "api/dict/index"; |
|
|
|
|
import { addQuestion, findIndustry } from "api/question"; |
|
|
|
|
import { CloseCircleOutlined } from '@ant-design/icons'; |
|
|
|
|
import * as XLSX from "xlsx"; |
|
|
|
|
|
|
|
|
|
const { Option } = Select; |
|
|
|
@ -282,70 +283,72 @@ class QuestionAdd extends Component<any, States> { |
|
|
|
|
{formIds.map((formId, index) => ( |
|
|
|
|
<div key={formId} style={{ marginBottom: 30 }}> |
|
|
|
|
<div style={{ display: "flex" }}> |
|
|
|
|
<Form.Item name={`questionTypes_${formId}`}> |
|
|
|
|
<Radio.Group |
|
|
|
|
onChange={(e) => this.handleQuestionTypeChange(formId, e.target.value)} |
|
|
|
|
> |
|
|
|
|
<Radio.Button value="1">单选题</Radio.Button> |
|
|
|
|
<Radio.Button value="2">多选题</Radio.Button> |
|
|
|
|
</Radio.Group> |
|
|
|
|
</Form.Item> |
|
|
|
|
<Form.Item |
|
|
|
|
label="监管行业:" |
|
|
|
|
name={`industryId_${formId}`} |
|
|
|
|
rules={[{ required: true, message: "请选择监管行业" }]} |
|
|
|
|
> |
|
|
|
|
<Select |
|
|
|
|
placeholder="请选择监管行业" |
|
|
|
|
style={{ width: 240 }} |
|
|
|
|
allowClear |
|
|
|
|
<div style={{ display: "flex", flex: 1, justifyContent: "flex-start" }}> |
|
|
|
|
<Form.Item name={`questionTypes_${formId}`}> |
|
|
|
|
<Radio.Group |
|
|
|
|
onChange={(e) => this.handleQuestionTypeChange(formId, e.target.value)} |
|
|
|
|
> |
|
|
|
|
<Radio.Button value="1">单选题</Radio.Button> |
|
|
|
|
<Radio.Button value="2">多选题</Radio.Button> |
|
|
|
|
</Radio.Group> |
|
|
|
|
</Form.Item> |
|
|
|
|
<Form.Item |
|
|
|
|
label="监管行业:" |
|
|
|
|
name={`industryId_${formId}`} |
|
|
|
|
rules={[{ required: true, message: "请选择监管行业" }]} |
|
|
|
|
> |
|
|
|
|
{industryDict && industryDict.length > 0? ( |
|
|
|
|
(() => { |
|
|
|
|
let rows = []; |
|
|
|
|
for (let i = 0; i < industryDict.length; i++) { |
|
|
|
|
const item = industryDict[i]; |
|
|
|
|
rows.push( |
|
|
|
|
<Option value={item.industryId}>{item.industryName}</Option> |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
return rows; |
|
|
|
|
})() |
|
|
|
|
) : ( |
|
|
|
|
<Option disabled>暂无数据</Option> |
|
|
|
|
)} |
|
|
|
|
</Select> |
|
|
|
|
</Form.Item> |
|
|
|
|
<Form.Item |
|
|
|
|
label="AQ服务类型:" |
|
|
|
|
name={`serviceTypeId_${formId}`} |
|
|
|
|
rules={[{ required: true, message: "请选择AQ服务类型" }]} |
|
|
|
|
> |
|
|
|
|
<Select |
|
|
|
|
placeholder="请选择AQ服务类型" |
|
|
|
|
style={{ width: 240 }} |
|
|
|
|
allowClear |
|
|
|
|
<Select |
|
|
|
|
placeholder="请选择监管行业" |
|
|
|
|
style={{ width: 240 }} |
|
|
|
|
allowClear |
|
|
|
|
> |
|
|
|
|
{industryDict && industryDict.length > 0? ( |
|
|
|
|
(() => { |
|
|
|
|
let rows = []; |
|
|
|
|
for (let i = 0; i < industryDict.length; i++) { |
|
|
|
|
const item = industryDict[i]; |
|
|
|
|
rows.push( |
|
|
|
|
<Option value={item.industryId}>{item.industryName}</Option> |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
return rows; |
|
|
|
|
})() |
|
|
|
|
) : ( |
|
|
|
|
<Option disabled>暂无数据</Option> |
|
|
|
|
)} |
|
|
|
|
</Select> |
|
|
|
|
</Form.Item> |
|
|
|
|
<Form.Item |
|
|
|
|
label="AQ服务类型:" |
|
|
|
|
name={`serviceTypeId_${formId}`} |
|
|
|
|
rules={[{ required: true, message: "请选择AQ服务类型" }]} |
|
|
|
|
> |
|
|
|
|
{serviceTypeDict && serviceTypeDict.length > 0? ( |
|
|
|
|
(() => { |
|
|
|
|
let rows = []; |
|
|
|
|
for (let i = 0; i < serviceTypeDict.length; i++) { |
|
|
|
|
const item = serviceTypeDict[i]; |
|
|
|
|
rows.push( |
|
|
|
|
<Option value={String(item.dictKey)}>{item.dictValue}</Option> |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
return rows; |
|
|
|
|
})() |
|
|
|
|
) : ( |
|
|
|
|
<Option disabled>暂无数据</Option> |
|
|
|
|
)} |
|
|
|
|
</Select> |
|
|
|
|
</Form.Item> |
|
|
|
|
<Select |
|
|
|
|
placeholder="请选择AQ服务类型" |
|
|
|
|
style={{ width: 240 }} |
|
|
|
|
allowClear |
|
|
|
|
> |
|
|
|
|
{serviceTypeDict && serviceTypeDict.length > 0? ( |
|
|
|
|
(() => { |
|
|
|
|
let rows = []; |
|
|
|
|
for (let i = 0; i < serviceTypeDict.length; i++) { |
|
|
|
|
const item = serviceTypeDict[i]; |
|
|
|
|
rows.push( |
|
|
|
|
<Option value={String(item.dictKey)}>{item.dictValue}</Option> |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
return rows; |
|
|
|
|
})() |
|
|
|
|
) : ( |
|
|
|
|
<Option disabled>暂无数据</Option> |
|
|
|
|
)} |
|
|
|
|
</Select> |
|
|
|
|
</Form.Item> |
|
|
|
|
</div> |
|
|
|
|
<Form.Item> |
|
|
|
|
{index > 0 && ( |
|
|
|
|
<Button type="link" onClick={() => this.handleDeleteQuestion(formId)}> |
|
|
|
|
X |
|
|
|
|
<CloseCircleOutlined /> |
|
|
|
|
</Button> |
|
|
|
|
)} |
|
|
|
|
</Form.Item> |
|
|
|
|