king
2022-10-18 a8507cc8c42d17d4fb854594dbf1e084d61912ac
src/templates/zshare/editTable/index.jsx
@@ -10,13 +10,10 @@
import PasteForm from '@/templates/zshare/pasteform'
import asyncComponent from '@/utils/asyncComponent'
import CusSwitch from './cusSwitch'
import zhCN from '@/locales/zh-CN/model.js'
import enUS from '@/locales/en-US/model.js'
import MKEmitter from '@/utils/events.js'
import './index.scss'
const MkEditIcon = asyncComponent(() => import('@/components/mkIcon'))
let eTDict = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS
const EditableContext = React.createContext()
const { confirm } = Modal
let dragingIndex = -1
@@ -144,7 +141,7 @@
              rules: [
                {
                  required: required,
                  message: ['number', 'text', 'input'].includes(inputType) ? `${eTDict['form.required.input']} ${title}!` : `${eTDict['form.required.select']} ${title}!`,
                  message: ['number', 'text', 'input'].includes(inputType) ? `请输入${title}!` : `请选择${title}!`,
                },
                ...rules
              ],
@@ -195,7 +192,7 @@
      operation = {
        title: (<div>
          {eTDict['model.operation']}
          操作
          <span className="copy-control">
            {actions.includes('copy') ? <CopyOutlined title="复制" onClick={() => this.copy()} /> : null}
            {actions.includes('copy') ? <SnippetsOutlined title="粘贴" onClick={this.paste} /> : null}
@@ -212,11 +209,11 @@
              <EditableContext.Consumer>
                {form => (
                  <span onClick={() => this.save(form, record.uuid)} style={{ marginRight: 8 , color: '#1890ff', cursor: 'pointer'}}>
                    {eTDict['model.save']}
                    保存
                  </span>
                )}
              </EditableContext.Consumer>
              <span style={{ color: '#1890ff', cursor: 'pointer'}} onClick={() => this.cancel(record.uuid)}>{eTDict['model.cancel']}</span>
              <span style={{ color: '#1890ff', cursor: 'pointer'}} onClick={() => this.cancel(record.uuid)}>取消</span>
            </div>
          ) : (
            <div className={'edit-operation-btn' + (editingKey !== '' ? ' disabled' : '')} style={{minWidth: '110px', whiteSpace: 'nowrap'}}>
@@ -225,7 +222,7 @@
              {actions.includes('status') ? <span className="status" onClick={() => {editingKey === '' && this.handleStatus(record)}}><SwapOutlined /></span> : null}
              {actions.includes('del') && editingKey === '' ? <Popconfirm
                overlayClassName="popover-confirm"
                title={eTDict['model.query.delete']}
                title="确定删除吗?"
                onConfirm={() => this.handleDelete(record.uuid)
              }>
                <span className="danger"><DeleteOutlined /></span>
@@ -402,7 +399,6 @@
              uuid: Utils.getuuid()
            })
          }
        })
      } else if (res.key !== type) {
        message.warning('配置信息格式错误!')
@@ -665,7 +661,7 @@
          </DndProvider>
          {/* 信息粘贴 */}
          <Modal
            title={eTDict['header.form.paste']}
            title="粘贴"
            visible={this.state.visible}
            width={600}
            maskClosable={false}
@@ -673,7 +669,7 @@
            onCancel={() => {this.setState({visible: false})}}
            destroyOnClose
          >
            <PasteForm dict={eTDict} wrappedComponentRef={(inst) => this.pasteFormRef = inst} inputSubmit={this.pasteSubmit}/>
            <PasteForm wrappedComponentRef={(inst) => this.pasteFormRef = inst} inputSubmit={this.pasteSubmit}/>
          </Modal>
        </div>
      </EditableContext.Provider>