king
2021-12-30 09e0de52a398dd08a0dc3f4b43e4589d211e9c27
src/templates/formtabconfig/index.jsx
@@ -5,7 +5,8 @@
import { DndProvider } from 'react-dnd'
import HTML5Backend from 'react-dnd-html5-backend'
import moment from 'moment'
import { Button, Card, Modal, Collapse, notification, Spin, Select, List, Icon, Empty, Switch, Tooltip } from 'antd'
import { Button, Card, Modal, Collapse, notification, Spin, Select, List, Empty, Switch, Tooltip } from 'antd'
import { QuestionCircleOutlined, CloseOutlined, RedoOutlined, SettingOutlined, PlusOutlined, DeleteOutlined, EditOutlined, SnippetsOutlined } from '@ant-design/icons'
import Api from '@/api'
import zhCN from '@/locales/zh-CN/model.js'
@@ -429,10 +430,7 @@
    let _inputfields = []
    let _tabfields = []
    let _linkableFields = []
    let _linksupFields = [{
      value: '',
      text: '空'
    }]
    let _linksupFields = []
    let _formfields = []
    // 设置下拉菜单可关联字段
@@ -484,7 +482,7 @@
    this.setState({
      modaltype: 'search',
      card: card,
      formlist: getModalForm(card, _inputfields, _tabfields, _linkableFields, _linksupFields, false).map(item => {
      formlist: getModalForm(card, _inputfields, _tabfields, _linkableFields, _linksupFields).map(item => {
        if (item.key === 'type') {
          item.options = item.options.filter(option => !['switch', 'checkbox', 'radio', 'checkcard', 'hint'].includes(option.value))
        }
@@ -1326,7 +1324,6 @@
        initval: '',
        type: item.type,
        resourceType: '0',
        setAll: 'false',
        options: [],
        orderType: 'asc'
      }
@@ -1791,7 +1788,7 @@
                <div className="ant-col ant-form-item-label">
                  <label>
                    <Tooltip placement="topLeft" title="此处可以添加配置相关的常用表,在添加搜索条件和显示列时,可通过工具栏中的添加按钮,批量添加表格相关字段。">
                      <Icon type="question-circle" />
                      <QuestionCircleOutlined className="mk-form-tip" />
                      {this.state.dict['header.menu.table.add']}
                    </Tooltip>
                  </label>
@@ -1801,7 +1798,7 @@
                  className="tables"
                  style={{ width: '100%' }}
                  optionFilterProp="children"
                  value={this.state.dict['header.menu.table.placeholder']}
                  value="请选择表名"
                  onChange={this.onTableChange}
                  showArrow={false}
                  getPopupContainer={() => document.getElementById('common-basedata')}
@@ -1820,7 +1817,7 @@
                  dataSource={this.state.selectedTables}
                  renderItem={(item, index) => <List.Item key={index} title={item.Remark + ' (' + item.TbName + ')'}>
                    {item.Remark + ' (' + item.TbName + ')'}
                    <Icon type="close" onClick={() => this.deleteTable(item)}/>
                    <CloseOutlined onClick={() => this.deleteTable(item)}/>
                    <div className="bottom-mask"></div>
                  </List.Item>}
                />}
@@ -1832,7 +1829,7 @@
                    return (<SourceElement key={index} content={item}/>)
                  })}
                </div>
                <Button type="primary" block onClick={() => this.queryField('search')}>{this.state.dict['header.menu.form.add']}</Button>
                <Button type="primary" block onClick={() => this.queryField('search')}>批量添加</Button>
              </Panel>
              {/* 按钮添加 */}
              <Panel header={this.state.dict['header.menu.action']} key="2">
@@ -1852,9 +1849,9 @@
                {configTabs.length > 0 ?
                  <p className="config-btn-title">
                    <Tooltip placement="topLeft" title="点击按钮,可完成或查看标签配置信息。">
                      <Icon type="question-circle" />
                      <QuestionCircleOutlined className="mk-form-tip" />
                    </Tooltip>
                    {this.state.dict['header.menu.tab.configurable']}
                    标签配置
                  </p> : null
                }
                {configTabs.map((item, index) => {
@@ -1875,8 +1872,8 @@
          <div className="setting">
            <Card title={
              <div>
                {this.state.dict['header.menu.page.configurable']}
                <Icon type="redo" style={{marginLeft: '10px'}} title="刷新标签列表" onClick={this.reloadTab} />
                页面配置
                <RedoOutlined style={{marginLeft: '10px'}} title="刷新标签列表" onClick={this.reloadTab} />
              </div>
            } bordered={false} extra={
              <div>
@@ -1885,9 +1882,9 @@
                <Button onClick={this.cancelConfig}>{this.state.dict['model.back']}</Button>
              </div>
            } style={{ width: '100%' }}>
              <Icon type="setting" onClick={this.changeSetting} />
              <SettingOutlined onClick={this.changeSetting} />
              <Tooltip placement="bottomLeft" overlayClassName="middle" title="在左侧工具栏《搜索》中,选择对应搜索框拖至此处添加;或点击按钮《添加搜索条件》批量添加,选择批量添加时,需提前选择使用表。">
                <Icon type="question-circle" />
                <QuestionCircleOutlined style={{position: 'relative', color: '#c49f47', left: '5px', top: '20px'}} />
              </Tooltip>
              <Collapse
                activeKey={config.groups.map(group => group.uuid)}
@@ -1896,21 +1893,16 @@
                {config.groups.map((group, index) => (
                  <Panel showArrow={false} header={group.label} key={group.uuid} extra={(
                    <span>
                      {index === _length - 1 ? <Icon
                        type="plus"
                      {index === _length - 1 ? <PlusOutlined
                        onClick={() => { this.handleGroup()}}
                      /> : null}
                      {_length > 1 && index !== _length - 1 ? <Icon
                        type="delete"
                      {_length > 1 && index !== _length - 1 ? <DeleteOutlined
                        onClick={() => { this.closeGroup(group) }}
                      /> : null}
                      <Icon
                        type="edit"
                        onClick={() => { this.handleGroup(group) }}
                      />
                      <EditOutlined onClick={() => { this.handleGroup(group) }}/>
                    </span>
                  )}>
                    {group.isDefault ? <Icon type="snippets" title={this.state.dict['header.form.paste']} onClick={() => {this.setState({pasteVisible: true})}} /> : null}
                    {group.isDefault ? <SnippetsOutlined title={this.state.dict['header.form.paste']} onClick={() => {this.setState({pasteVisible: true})}} /> : null}
                    <DragElement
                      type="search"
                      groupId={group.uuid}
@@ -1919,14 +1911,13 @@
                      setting={config.setting}
                      handleMenu={this.handleSearch}
                      deleteMenu={this.deleteElement}
                      placeholder={this.state.dict['header.form.modal.placeholder']}
                    />
                  </Panel>
                ))}
              </Collapse>
              <div className="action-list">
                <Tooltip placement="bottomLeft" overlayClassName="middle" title="在左侧工具栏《按钮》中,选择对应类型的按钮拖至此处添加,如选择按钮类型为表单、新标签页等含有配置页面的按钮,可在左侧工具栏-按钮-可配置按钮处,点击按钮完成相关配置。注:当设置按钮显示位置为表格时,显示列会增加操作列。">
                  <Icon type="question-circle" />
                  <QuestionCircleOutlined style={{position: 'absolute', color: '#c49f47', left: '5px', top: '5px'}} />
                </Tooltip>
                <DragElement
                  type="action"
@@ -1935,7 +1926,6 @@
                  handleMenu={this.handleAction}
                  deleteMenu={this.deleteElement}
                  profileMenu={this.profileAction}
                  placeholder={this.state.dict['header.form.action.placeholder']}
                />
              </div>
              {/* 标签组 */}
@@ -1950,7 +1940,7 @@
        </DndProvider>
        {/* 编辑表单 */}
        <Modal
          title={this.state.card && this.state.card.iscopy ? this.state.dict['header.modal.form.copy'] : this.state.dict['header.modal.form.edit']}
          title={this.state.card && this.state.card.iscopy ? '表单-复制' : '表单-编辑'}
          visible={modaltype === 'search'}
          width={700}
          maskClosable={false}
@@ -1971,7 +1961,7 @@
        <Modal
          title={this.state.dict['model.action'] + '-' + this.state.dict['model.edit']}
          visible={modaltype === 'actionEdit'}
          width={700}
          width={900}
          maskClosable={false}
          onCancel={this.editModalCancel}
          footer={[
@@ -2023,7 +2013,15 @@
          maskClosable={false}
          okText={this.state.dict['model.submit']}
          onOk={this.verifySubmit}
          onCancel={() => { this.setState({ profileVisible: false }) }}
          onCancel={() => {
            if (this.verifyRef.handleCancel) {
              this.verifyRef.handleCancel().then(() => {
                this.setState({ profileVisible: false })
              })
            } else {
              this.setState({ profileVisible: false })
            }
          }}
          destroyOnClose
        >
          <VerifyCard
@@ -2077,7 +2075,7 @@
          {this.state.dict['header.menu.config.placeholder']}
        </Modal>
        <Modal
          title={this.state.dict['header.menu.group.manage']}
          title="分组管理"
          visible={this.state.groupVisible}
          width={700}
          maskClosable={false}