initPluginColumns()

in src/routes/System/AppAuth/index.js [391:563]


  initPluginColumns() {
    this.setState({
      columns: [
        {
          align: "center",
          title: "AppKey",
          dataIndex: "appKey",
          key: "appKey",
          ellipsis: true,
          width: 320,
        },
        {
          align: "center",
          title: getIntlContent("SHENYU.AUTH.ENCRYPTKEY"),
          dataIndex: "appSecret",
          key: "appSecret",
          ellipsis: true,
          width: 320,
        },
        {
          align: "center",
          title: `${getIntlContent("SHENYU.SYSTEM.USER")}Id`,
          dataIndex: "userId",
          key: "userId",
          ellipsis: true,
          width: 80,
        },
        {
          align: "center",
          title: getIntlContent("SHENYU.AUTH.TEL"),
          dataIndex: "phone",
          key: "phone",
          ellipsis: true,
          width: 120,
        },
        {
          align: "center",
          title: getIntlContent("SHENYU.AUTH.OPENPATH"),
          dataIndex: "open",
          key: "open",
          ellipsis: true,
          width: 100,
          render: (text, row) => (
            <AuthButton
              perms="system:authen:open"
              noAuth={
                text ? (
                  <div className="open">
                    {getIntlContent("SHENYU.COMMON.OPEN")}
                  </div>
                ) : (
                  <div className="close">
                    {getIntlContent("SHENYU.COMMON.CLOSE")}
                  </div>
                )
              }
            >
              <Switch
                checkedChildren={getIntlContent("SHENYU.COMMON.OPEN")}
                unCheckedChildren={getIntlContent("SHENYU.COMMON.CLOSE")}
                checked={text}
                onChange={(checked) => {
                  this.openSwitch({
                    list: [row.id],
                    enabled: checked,
                    callback: this.query,
                  });
                }}
              />
            </AuthButton>
          ),
        },
        {
          align: "center",
          title: getIntlContent("SHENYU.SYSTEM.STATUS"),
          dataIndex: "enabled",
          key: "enabled",
          ellipsis: true,
          width: 100,
          render: (text, row) => (
            <AuthButton
              perms="system:authen:disable"
              noAuth={
                text ? (
                  <div className="open">
                    {getIntlContent("SHENYU.COMMON.OPEN")}
                  </div>
                ) : (
                  <div className="close">
                    {getIntlContent("SHENYU.COMMON.CLOSE")}
                  </div>
                )
              }
            >
              <Switch
                checkedChildren={getIntlContent("SHENYU.COMMON.OPEN")}
                unCheckedChildren={getIntlContent("SHENYU.COMMON.CLOSE")}
                checked={text}
                onChange={(checked) => {
                  this.statusSwitch({
                    list: [row.id],
                    enabled: checked,
                    callback: this.query,
                  });
                }}
              />
            </AuthButton>
          ),
        },
        {
          align: "center",
          title: getIntlContent("SHENYU.SYSTEM.UPDATETIME"),
          dataIndex: "dateUpdated",
          render: (dateUpdated) =>
            dayjs(dateUpdated).format("YYYY-MM-DD HH:mm:ss"),
          key: "dateUpdated",
          ellipsis: true,
          sorter: (a, b) => (a.dateUpdated > b.dateUpdated ? 1 : -1),
        },
        {
          align: "center",
          title: getIntlContent("SHENYU.COMMON.OPERAT"),
          dataIndex: "operate",
          key: "operate",
          ellipsis: true,
          width: 80,
          fixed: "right",
          render: (text, record) => {
            return (
              <AuthButton perms="system:authen:edit">
                <div
                  className="edit"
                  onClick={() => {
                    this.editClick(record);
                  }}
                >
                  {getIntlContent("SHENYU.SYSTEM.EDITOR")}
                </div>
              </AuthButton>
            );
          },
        },
        {
          align: "center",
          title: getIntlContent("SHENYU.AUTH.OPERATPATH"),
          dataIndex: "operates",
          key: "operates",
          ellipsis: true,
          width: 140,
          fixed: "right",
          render: (text, record) => {
            if (record.open) {
              return (
                // 弹窗中的编辑事件
                <AuthButton perms="system:authen:editResourceDetails">
                  <div
                    className="edit"
                    onClick={() => {
                      this.editClickMeta(record);
                    }}
                  >
                    {getIntlContent("SHENYU.AUTH.EDITOR.RESOURCE")}
                  </div>
                </AuthButton>
              );
            } else {
              return null;
            }
          },
        },
      ],
    });
  }