| | |
| | | import '@/assets/css/table.scss' |
| | | |
| | | const EditTable = asyncComponent(() => import('@/templates/zshare/editTable')) |
| | | const { confirm } = Modal |
| | | |
| | | class MarkColumn extends Component { |
| | | static propTpyes = { |
| | |
| | | resetMark = () => { |
| | | const { marks, columns, type } = this.props |
| | | let markColumns = fromJS(this.state.markColumns).toJS() |
| | | let _columns = fromJS(columns).toJS() |
| | | |
| | | let options = columns.map(col => { |
| | | _columns.unshift({field: '$Index', label: '序号'}) |
| | | |
| | | let options = _columns.map(col => { |
| | | return { |
| | | value: col.field, |
| | | label: col.label, |
| | |
| | | { |
| | | value: 'dynamic', |
| | | label: '动态值', |
| | | children: columns.map(cell => { |
| | | children: _columns.map(cell => { |
| | | return { |
| | | value: cell.field, |
| | | label: cell.label |
| | |
| | | } |
| | | ] |
| | | |
| | | if (type === 'line') { |
| | | if (type === 'line' || type === 'sequence') { |
| | | signs.pop() |
| | | } else if (type === 'slider') { |
| | | markColumns = markColumns.filter(col => { |
| | |
| | | } |
| | | |
| | | markSubmit = () => { |
| | | this.setState({ |
| | | visible: false |
| | | }) |
| | | let save = false |
| | | let input = document.getElementById('contrastValue') |
| | | let val = input && input.value ? input.value : '' |
| | | |
| | | if (!val) { |
| | | save = true |
| | | } |
| | | |
| | | let marks = this.state.marks.map(item => { |
| | | if (item.signType && item.signType[0] === 'background') { |
| | |
| | | item.fontColor = '' |
| | | } |
| | | } |
| | | if (val && item.contrastValue === val) { |
| | | save = true |
| | | } |
| | | return item |
| | | }) |
| | | |
| | | this.props.onSubmit(marks) |
| | | if (save) { |
| | | this.setState({ |
| | | visible: false |
| | | }) |
| | | this.props.onSubmit(marks) |
| | | } else { |
| | | const _this = this |
| | | confirm({ |
| | | title: '存在未保存标记,确定忽略吗?', |
| | | onOk() { |
| | | _this.setState({ visible: false }) |
| | | _this.props.onSubmit(marks) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | | } |
| | | } |
| | | |
| | | render() { |