| | |
| | | uniqueFunc: (data, item) => { |
| | | let index = data.findIndex(mark => mark.uuid !== item.uuid && mark.contrastValue === item.contrastValue && mark.match === item.match && mark.field.join('') === item.field.join('')) |
| | | |
| | | if (index > -1) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '此标记已存在!', |
| | | duration: 5 |
| | | }) |
| | | return false |
| | | } |
| | | return true |
| | | if (index > -1) return '此标记已存在!' |
| | | return '' |
| | | }, |
| | | inputType: 'cascader', |
| | | options: [], |
| | |
| | | options: [], |
| | | render: text => { |
| | | let sign = { |
| | | 'font': '文字', |
| | | 'font': '字体颜色', |
| | | 'background': '背景', |
| | | 'underline': '下划线', |
| | | 'line-through': '中划线', |
| | |
| | | let signs = [ |
| | | { |
| | | value: 'font', |
| | | label: '文字' |
| | | label: '字体颜色' |
| | | }, |
| | | { |
| | | value: 'background', |
| | |
| | | signs.pop() |
| | | signs.pop() |
| | | signs.pop() |
| | | } else if (type === 'icon') { |
| | | signs = [{ |
| | | value: 'font', |
| | | label: '字体颜色' |
| | | }] |
| | | } else if (type === 'slider') { |
| | | markColumns = markColumns.filter(col => { |
| | | col.width = '20%' |
| | |
| | | }) |
| | | this.props.onSubmit(marks) |
| | | } else { |
| | | const _this = this |
| | | const that = this |
| | | confirm({ |
| | | title: '存在未保存标记,确定忽略吗?', |
| | | onOk() { |
| | | _this.setState({ visible: false }) |
| | | _this.props.onSubmit(marks) |
| | | that.setState({ visible: false }) |
| | | that.props.onSubmit(marks) |
| | | }, |
| | | onCancel() {} |
| | | }) |