king
2025-04-23 b48528b1a1a88e289fc0b7ad52f2da213a3f9dfe
src/tabviews/zshare/settingcomponent/editTable/index.jsx
@@ -3,11 +3,8 @@
import { Table, Form, Select, Cascader } from 'antd'
import { EditOutlined } from '@ant-design/icons'
import zhCN from '@/locales/zh-CN/model.js'
import enUS from '@/locales/en-US/model.js'
import './index.scss'
let eTDict = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS
const EditableContext = React.createContext()
const shortkeycode = {
  65: 'A', 66: 'B', 67: 'C', 68: 'D', 69: 'E', 70: 'F', 71: 'G', 72: 'H', 73: 'I', 74: 'J', 75: 'K', 76: 'L', 77: 'M',
@@ -70,11 +67,11 @@
    editingKey: '',
    visible: false,
    columns: [{
      title: '名称',
      title: window.GLOB.dict['name'] || '名称',
      dataIndex: 'label',
      width: '25%'
    }, {
      title: '快捷键',
      title: window.GLOB.dict['shortcut'] || '快捷键',
      dataIndex: 'shortcut',
      inputType: 'cascader',
      editable: true,
@@ -85,14 +82,14 @@
        return text[0] + '+' + shortkeycode[text[1]]
      }
    }, {
      title: '打印机',
      title: window.GLOB.dict['printer'] || '打印机',
      dataIndex: 'printer',
      inputType: 'select',
      editable: true,
      options: [],
      width: '25%'
    }, {
      title: '操作',
      title: window.GLOB.dict['operation'] || '操作',
      dataIndex: 'operation',
      width: '140px',
      render: (text, record) => {
@@ -103,11 +100,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'}}>
@@ -123,14 +120,14 @@
        width: '26.1%'
      },
      {
        title: '打印机',
        title: window.GLOB.dict['printer'] || '打印机',
        dataIndex: 'printer',
        inputType: 'select',
        editable: true,
        options: [],
      },
      {
        title: '操作',
        title: window.GLOB.dict['operation'] || '操作',
        dataIndex: 'operation',
        width: '153px',
        render: (text, record) => {
@@ -141,11 +138,11 @@
              <EditableContext.Consumer>
                {form => (
                  <span onClick={() => this.save(form, record.uuid, record.parentId)} 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'}}>