提交 2e1f5e38 authored 作者: tb53863844's avatar tb53863844

开发

上级 285d96cd
...@@ -24,7 +24,7 @@ import { ...@@ -24,7 +24,7 @@ import {
Upload, Upload,
Form, Form,
Table, Table,
notification, Cascader,
} from 'antd'; } from 'antd';
import UUID from 'react-native-uuid'; import UUID from 'react-native-uuid';
import QRCode from 'qrcode.react'; import QRCode from 'qrcode.react';
...@@ -445,6 +445,19 @@ export default class tableCom extends Component { ...@@ -445,6 +445,19 @@ export default class tableCom extends Component {
} }
}, },
}); });
searchJson=(value,json,level,labs)=>{
for(var i=0;i<json.length;i++){
if(json[i].value==value[level]){
labs.push(json[i].label)
if(json[i].children){
this.searchJson(value,json[i].children,level+1,labs);
}
break;
}
}
}
componentWillReceiveProps(props) { componentWillReceiveProps(props) {
const {json, mapData, obj} = props; const {json, mapData, obj} = props;
...@@ -547,9 +560,10 @@ export default class tableCom extends Component { ...@@ -547,9 +560,10 @@ export default class tableCom extends Component {
} }
} }
dataFilter = ['Select', 'Radio', 'Checkbox']; dataFilter = ['Select', 'Radio', 'Checkbox','Cascader'];
getData = (json, dataColumn, obj, init) => { getData = (json, dataColumn, obj, init) => {
const allValues = JSON.stringify(obj); const allValues = JSON.stringify(obj);
if (json.comName == 'TableSelect') { if (json.comName == 'TableSelect') {
const {dispatch} = this.props; const {dispatch} = this.props;
...@@ -665,6 +679,7 @@ export default class tableCom extends Component { ...@@ -665,6 +679,7 @@ export default class tableCom extends Component {
} }
if (json.optionType != null && this.dataFilter.includes(json.comName)) { if (json.optionType != null && this.dataFilter.includes(json.comName)) {
switch (json.optionType) { switch (json.optionType) {
case 'reference': case 'reference':
if (dataColumn.referenceObjId != null) { if (dataColumn.referenceObjId != null) {
...@@ -699,13 +714,36 @@ export default class tableCom extends Component { ...@@ -699,13 +714,36 @@ export default class tableCom extends Component {
break; break;
case 'func': case 'func':
if (json.funcs != null && json.funcs != '') { if (json.funcs != null && json.funcs != '') {
let enu; if(json.comName=="Cascader"){
try {
this.getFunctionValue(json.funcs, {base52: this.props.uuid}, json, () => {
if (init != null && Object.keys(init).length > 0) {
let base52 = dataColumn.base52;
let vlu = this.props.form.getFieldValue(base52);
const labs = [];
this.searchJson(vlu,this.state.options,0,labs)
this.setState({labels: labs});
} else if (!this.props.isEdit && Object.keys(obj).length > 0) {
let base52 = dataColumn.base52;
const vlu = obj[base52];
const labs = [];
this.searchJson(vlu,this.state.options,0,labs)
this.setState({labels: labs});
}
});
} catch (e) {
message.error('公式选项配置存在问题');
}
}else{
try { try {
this.getFunctionValue(json.funcs, {base52: this.props.uuid}, json, () => { this.getFunctionValue(json.funcs, {base52: this.props.uuid}, json, () => {
if (init != null && Object.keys(init).length > 0) { if (init != null && Object.keys(init).length > 0) {
let base52 = dataColumn.base52; let base52 = dataColumn.base52;
let vlu = this.props.form.getFieldValue(base52); let vlu = this.props.form.getFieldValue(base52);
const labs = [];
if (vlu instanceof Array) { if (vlu instanceof Array) {
for (var i = 0; i < this.state.options.length; i++) { for (var i = 0; i < this.state.options.length; i++) {
if (vlu.includes(this.state.options[i].value)) { if (vlu.includes(this.state.options[i].value)) {
...@@ -749,6 +787,13 @@ export default class tableCom extends Component { ...@@ -749,6 +787,13 @@ export default class tableCom extends Component {
} catch (e) { } catch (e) {
message.error('公式选项配置存在问题'); message.error('公式选项配置存在问题');
} }
}
} }
break; break;
} }
...@@ -1195,7 +1240,6 @@ export default class tableCom extends Component { ...@@ -1195,7 +1240,6 @@ export default class tableCom extends Component {
this.props.messageData, this.props.messageData,
this.props.concealModel, this.props.concealModel,
); );
if (base52) { if (base52) {
if (value != null && value == 'norefeshxxxxxxxxxxxxxxxxxxxx') { if (value != null && value == 'norefeshxxxxxxxxxxxxxxxxxxxx') {
} else { } else {
...@@ -2041,6 +2085,13 @@ export default class tableCom extends Component { ...@@ -2041,6 +2085,13 @@ export default class tableCom extends Component {
case 'Select': case 'Select':
cm = <span>{labels != null && labels.length > 0 ? Object.values(labels[0]) : ''}</span>; cm = <span>{labels != null && labels.length > 0 ? Object.values(labels[0]) : ''}</span>;
break;
case 'Cascader':
cm= <span>
{labels != null
? labels.join(json.spliter?json.spliter:"")
: ''}
</span>
break; break;
case 'TableSelect': case 'TableSelect':
const ds = const ds =
...@@ -2754,6 +2805,41 @@ export default class tableCom extends Component { ...@@ -2754,6 +2805,41 @@ export default class tableCom extends Component {
cm = <div>{cm}</div>; cm = <div>{cm}</div>;
} }
break;
case 'Cascader':
cm = getFieldDecorator(dataColumn.base52, {
initialValue: initValue,
rules:
json.vlds && json.vlds.length > 0
? json.vlds
: [{required: required, message: '请选择' + dataColumn.title}],
})(<Cascader options={options}
allowClear
showSearch
disabled={disabled}
placeholder={json.placeholder}
style={{width: json.width}} />);
if (
get === 'mobile' &&
((json.isMobileLabel != null && json.isMobileLabel) ||
(json.isMobileLabel == null && json.isLabel)) &&
title
) {
cm = (
<MobileItem
isPreview={isPreview}
labelCol={{span: json.labelSpan}}
wrapperCol={{span: json.wrapperSpan}}
label={title}
>
{cm}
</MobileItem>
);
} else if (get === 'mobile') {
cm = <div>{cm}</div>;
}
break; break;
case 'TableSelect': case 'TableSelect':
cm = getFieldDecorator(dataColumn.base52, { cm = getFieldDecorator(dataColumn.base52, {
...@@ -2973,7 +3059,7 @@ export default class tableCom extends Component { ...@@ -2973,7 +3059,7 @@ export default class tableCom extends Component {
} }
break; break;
case 'RichText': case 'RichText':
debugger; //debugger;
cm = getFieldDecorator(dataColumn.base52, { cm = getFieldDecorator(dataColumn.base52, {
initialValue: initValue, initialValue: initValue,
rules: rules:
......
...@@ -256,7 +256,7 @@ export default class ViewPrint extends Component { ...@@ -256,7 +256,7 @@ export default class ViewPrint extends Component {
name={'打印设备选择'} name={'打印设备选择'}
handleClick={() => { handleClick={() => {
window.LODOP.SELECT_PRINTER(); window.LODOP.SELECT_PRINTER();
debugger; //debugger;
this.setState({ this.setState({
preaparePrint: true, preaparePrint: true,
}); });
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论