king
2024-08-25 326aa6b3effaccc71cfe0775d47b0f29eb3695a6
src/templates/modalconfig/index.jsx
@@ -280,15 +280,15 @@
   * @description 表单删除并刷新
   */
  closeForm = (card) => {
    let _this = this
    let that = this
    confirm({
      content: `确定删除${card.label ? `<<${card.label}>>` : ''}吗?`,
      onOk() {
        let _config = fromJS(_this.state.config).toJS()
        let _config = fromJS(that.state.config).toJS()
        _config.fields = _config.fields.filter(item => !(item.uuid === card.uuid))
        _this.setState({
        that.setState({
          config: _config,
        })
      },
@@ -379,14 +379,14 @@
  cancelConfig = () => {
    // const { config, originConfig } = this.state
    // let _this = this
    // let that = this
    // let isOrigin = config.fields.filter(item => item.origin).length > 0
    // if (isOrigin) {
    //   confirm({
    //     content: '尚未提交,确定放弃保存吗?',
    //     onOk() {
    //       _this.handleViewBack()
    //       that.handleViewBack()
    //     },
    //     onCancel() {}
    //   })
@@ -455,7 +455,7 @@
  changecols = (type) => {
    let config = fromJS(this.state.config).toJS()
    let _this = this
    let that = this
    config.fields = config.fields.map(item => {
      item.labelwidth = 33.3
@@ -481,7 +481,7 @@
    confirm({
      content: `确定切换为${type}列吗?`,
      onOk() {
        _this.setState({config})
        that.setState({config})
      },
      onCancel() {}
    })
@@ -557,13 +557,13 @@
  }
  clearConfig = () => {
    const _this = this
    const that = this
    let _config = {...this.state.config, fields: []}
    confirm({
      content: '确定清空表单吗?',
      onOk() {
        _this.setState({ config: _config })
        that.setState({ config: _config })
      },
      onCancel() {}
    })