import React, { Component } from "react"; import style from "../index.less"; import deleteIcon from '@common/images/delete.png'; import tableIcon from '@common/images/table.png'; import printIcon from '@common/images/team.png'; import allTableIcon from '@common/images/all-table.png'; import level1 from "@common/images/级别1.png"; import checkIcon from '@common/images/check.png'; import {ComplexModal,MiniToast,Radio} from '@commonComp'; import ScaleTable from '@containers/ScaleTable'; import $ from "jquery"; /** * 来源于页面选择 * * **/ class ScaleItem extends Component { constructor(props) { super(props); this.$area = React.createRef(); this.state = { scaleId:'', scaleName:'', parentId:'', showScale:false, optionId:'', possible:props.possible||{}, radioVal:props.radioVal||{}, formulaId:'' }; this.getItems = this.getItems.bind(this); this.getDetailItems = this.getDetailItems.bind(this); this.showScaleFn = this.showScaleFn.bind(this); this.closeScaleFn = this.closeScaleFn.bind(this); this.showOption = this.showOption.bind(this); this.closeOption = this.closeOption.bind(this); this.closeFormula = this.closeFormula.bind(this); this.onPrint = this.onPrint.bind(this); } showOption(id){ this.setState({ optionId:id }) } closeOption(){ this.setState({ optionId:null }) } confirmOption(parent,pIndex){ const {radioVal,possible} = this.state; this.setState({ possible:Object.assign({},possible,radioVal), radioVal:Object.assign({},possible,radioVal),//不设置radioVal只有最近一次选中的值 optionId:null }) } handleRadio(item,parent,pIndex){ let {radioVal} = this.props; this.setState({ radioVal:Object.assign({},radioVal,{[pIndex]:item.detailName}) }) } handleForRadio(){ } showFormula(id){ this.setState({ formulaId:id }) } confirmFormula(){ } closeFormula(){ this.setState({ formulaId:null }) } getDetailItems(item,i){ let arr = [],temp=''; const {indexs} = this.props; const {optionId,radioVal,possible,formulaId} = this.state; item.details.map((it,j)=>{ if(indexs[i]&&indexs[i].includes(j)){ if(it.type==1){ //量表 temp =this.showScaleFn(it.content.name,it.content.id,item.id)}>【{it.content.name}】; }else if(it.type==2){ //计算公式 temp =
{'请选择'+item.name+':'} |
{item.details.map((ii,ind)=>{
return |
{'请输入'+item.name+':'} | |
{'请选择'+item.name+':'} |
{item.details.map((ii,ind)=>{
return |