Commit 0bea5939 authored by 李纪文's avatar 李纪文

fix: 增加不展示不做处理

parent 184caa9f
......@@ -142,12 +142,12 @@ const ConfigurationView = (props) => {
const showNodeMethod = (node, list) => {
const realVal = list.Value * 1;
let switchState;
myDiagram.model.setDataProperty(node, 'realVal', realVal);
if (node.switch === '是') {
switchState = openValState(node.openVal, realVal) ? '开' : '关';
myDiagram.model.setDataProperty(node, 'switchState', switchState);
}
if (!node.shType) return false;
myDiagram.model.setDataProperty(node, 'realVal', realVal);
const patt = /[><=]/gi;
let shRule = [];
try {
......@@ -866,7 +866,7 @@ const ConfigurationView = (props) => {
{
// 设置其可选择
selectable: false,
layerName: 'Background'
layerName: 'Background',
},
goJS(
go.Shape,
......@@ -1901,6 +1901,9 @@ const ConfigurationView = (props) => {
item.hBarClolor = item.waterStroke;
item.typeDash = false;
}
if (item.category === 'valCase') {
if (item.shType === '') item.showVal = item.text;
}
if (item.category === 'nameCase') {
item.dtFillColor = item.fillColor;
item.dtStroke = item.stroke;
......
......@@ -172,12 +172,12 @@ const ConfigurationView = (props) => {
const showNodeMethod = (node, list) => {
const realVal = list.Value * 1;
let switchState;
myDiagram.model.setDataProperty(node, 'realVal', realVal);
if (node.switch === '是') {
switchState = openValState(node.openVal, realVal) ? '开' : '关';
myDiagram.model.setDataProperty(node, 'switchState', switchState);
}
if (!node.shType) return false;
myDiagram.model.setDataProperty(node, 'realVal', realVal);
const patt = /[><=]/gi;
let shRule = [];
try {
......@@ -1281,7 +1281,7 @@ const ConfigurationView = (props) => {
{
// 设置其可选择
selectable: false,
layerName: 'Background'
layerName: 'Background',
},
goJS(
go.Shape,
......@@ -2354,6 +2354,9 @@ const ConfigurationView = (props) => {
item.hBarClolor = item.waterStroke;
item.typeDash = false;
}
if (item.category === 'valCase') {
if (item.shType === '') item.showVal = item.text;
}
if (item.category === 'nameCase') {
item.dtFillColor = item.fillColor;
item.dtStroke = item.stroke;
......
table{
width: 100%;
}
thead{
width: 100%;
}
thead tr{
display: table;
width: 100%;
table-layout: fixed;
line-height: 30px;
}
tbody{
width: 100%;
display: block;
}
tbody tr{
display: table;
width: 100%;
table-layout: fixed;
line-height: 30px;
}
thead tr th{
text-align: center;
}
tbody tr td{
text-align: center;
}
.addBox{
display: flex;
justify-content: center;
}
.inputPublic{
width: 120px;
height: 32px;
border: 1px solid #ccc;
border-radius: 3px;
padding: 0 5px;
margin-right: 20px;
outline: none;
}
.addBtn{
width: 60px;
height: 32px;
text-align: center;
border: 1px solid #ccc;
border-radius: 3px;
line-height: 32px;
cursor: pointer;
}
\ No newline at end of file
import React from 'react';
// eslint-disable-next-line no-unused-vars
import Table from './index';
import './demo.css';
const head = ['序号', '名字', '性别', '年龄'];
class Alphabet extends React.Component {
constructor(props) {
super(props);
this.state = {
data: [
{
index: 1,
name: '张三',
sex: '男',
age: '16',
},
],
};
this.addUser = this.addUser.bind(this);
}
addUser() {
const {data} = this.state;
data.push({
index: this.state.data.length + 1,
name: this.refs.inputName.value,
sex: this.refs.inputSex.value,
age: this.refs.inputAge.value,
});
this.setState(() => ({
data,
}));
this.refs.inputName.value = '';
this.refs.inputSex.value = '';
this.refs.inputAge.value = '';
}
render() {
return (
<>
<div className="addBox">
<input className="inputPublic inputName" ref="inputName" type="text" placeholder="姓名" />
<input className="inputPublic inputSex" ref="inputSex" type="text" placeholder="性别" />
<input className="inputPublic inputAge" ref="inputAge" type="text" placeholder="年龄" />
<p className="addBtn" onClick={this.addUser}>
添加
</p>
</div>
<Table dataSource={this.state.data} header={head} />
</>
);
}
}
export default Alphabet;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment