render()

in src/routes/System/Dict/index.js [529:649]


  render() {
    const { shenyuDict, loading } = this.props;
    const { shenyuDictList, total } = shenyuDict;

    const {
      currentPage,
      pageSize,
      selectedRowKeys,
      type,
      dictCode,
      dictName,
      popup,
    } = this.state;
    const columns = this.state.columns.map((col, index) => ({
      ...col,
      onHeaderCell: (column) => ({
        width: column.width,
        onResize: this.handleResize(index),
      }),
    }));
    const rowSelection = {
      selectedRowKeys,
      onChange: this.onSelectChange,
    };

    return (
      <div className="plug-content-wrap">
        <div style={{ display: "flex" }}>
          <Input
            allowClear
            value={type}
            placeholder={getIntlContent("SHENYU.DIC.INPUTTYPE")}
            onChange={this.searchTypeOnchange}
            style={{ width: 240 }}
          />
          &nbsp;&nbsp;
          <Input
            allowClear
            value={dictCode}
            placeholder={getIntlContent("SHENYU.DIC.INPUTCODE")}
            onChange={this.searchDictCodeOnchange}
            style={{ width: 240 }}
          />
          &nbsp;&nbsp;
          <Input
            allowClear
            value={dictName}
            placeholder={getIntlContent("SHENYU.DIC.INPUTNAME")}
            onChange={this.searchDictNameOnchange}
            style={{ width: 240 }}
          />
          <AuthButton perms="system:dict:list">
            <Button
              style={{ marginLeft: 20 }}
              type="primary"
              onClick={this.searchClick}
            >
              {getIntlContent("SHENYU.SYSTEM.SEARCH")}
            </Button>
          </AuthButton>
          <AuthButton perms="system:dict:delete">
            <Popconfirm
              title={getIntlContent("SHENYU.COMMON.DELETE")}
              placement="bottom"
              onConfirm={() => {
                this.deleteClick();
              }}
              okText={getIntlContent("SHENYU.COMMON.SURE")}
              cancelText={getIntlContent("SHENYU.COMMON.CALCEL")}
            >
              <Button style={{ marginLeft: 20 }} type="danger">
                {getIntlContent("SHENYU.SYSTEM.DELETEDATA")}
              </Button>
            </Popconfirm>
          </AuthButton>
          <AuthButton perms="system:dict:add">
            <Button
              style={{ marginLeft: 20 }}
              type="primary"
              onClick={this.addClick}
            >
              {getIntlContent("SHENYU.COMMON.ADD")}
            </Button>
          </AuthButton>
          <AuthButton perms="system:dict:disable">
            <Button
              style={{ marginLeft: 20 }}
              type="primary"
              onClick={this.enableClick}
            >
              {getIntlContent("SHENYU.PLUGIN.BATCH")}
            </Button>
          </AuthButton>
        </div>

        <Table
          size="small"
          components={this.components}
          style={{ marginTop: 30 }}
          bordered
          rowKey={(record) => record.id}
          loading={loading}
          columns={columns}
          // scroll={{ x: 1350 }}
          dataSource={shenyuDictList}
          rowSelection={rowSelection}
          pagination={{
            total,
            showTotal: (showTotal) => `${showTotal}`,
            showSizeChanger: true,
            pageSizeOptions: ["12", "20", "50", "100"],
            current: currentPage,
            pageSize,
            onShowSizeChange: this.onShowSizeChange,
            onChange: this.pageOnchange,
          }}
        />
        {popup}
      </div>
    );
  }