Skip to content

项目字段设置

字段设置,构造项目字段相关接口

GET 项目字段删除

GET /admin/tx/project/fields/delete

请求参数

名称位置类型必选说明
idquerystring字段记录ID
Authorizationheaderstringnone

返回示例

json
{
  "code": 1,
  "msg": "项目字段记录不存在",
  "data": null,
  "ok": false
}

返回结果

状态码状态码含义说明数据模型
200OKnoneInline

返回数据结构

POST 项目字段新增

POST /admin/tx/project/fields/add

Body 请求参数

json
{
  "name": "年份",
  "type": 3,
  "enable": 1,
  "fieldValue": "[{\"key\":\"c1c46b28-2b17-45e2-9eba-1d09979f429b\",\"value\":\"2022\"},{\"key\":\"5a2e0a46-72a4-45d2-8002-487cc9b7b6e7\",\"value\":\"2023\"},{\"key\":\"ff6a5611-f780-4872-b936-c960b8043f1f\",\"value\":\"2024\"},{\"key\":\"53d0926b-d868-4b46-bcbf-3006fde57f5f\",\"value\":\"2025\"}]"
}

请求参数

名称位置类型必选说明
Authorizationheaderstringnone
bodybodyobjectnone
» namebodystring字段名
» typebodyinteger类型
» enablebodyinteger是否启用
» fieldValuebodystring字段值

返回示例

json
{
  "code": 0,
  "msg": null,
  "data": {
    "id": "5ae746916599b12a89861530e0760f44",
    "name": "城市",
    "describe": "描述",
    "type": 1,
    "createBy": "admin",
    "createTime": "2024-09-20 16:19:35",
    "updateBy": "admin",
    "updateTime": "2024-09-20 16:19:35",
    "delFlag": "0",
    "tenantId": null,
    "classify": null,
    "enable": 1,
    "fieldValue": "[{'asdas':'asdasd'}]",
    "condition": "[{'vvvv':'vvv'}]"
  },
  "ok": true
}

返回结果

状态码状态码含义说明数据模型
200OKnoneInline

返回数据结构

状态码 200

名称类型必选约束中文名说明
» codeintegertruenonenone
» msgnulltruenonenone
» dataobjecttruenonenone
»» idstringtruenonenone
»» namestringtruenone字段名
»» describestringtruenone字段备注
»» typeintegertruenone字段类型1单行文本 2多行文本 3单选下拉 4人名输入框 5日期 6数值
»» createBystringtruenonenone
»» createTimestringtruenonenone
»» updateBystringtruenonenone
»» updateTimestringtruenonenone
»» delFlagstringtruenonenone
»» tenantIdnulltruenonenone
»» classifynulltruenone字段分类 1系统字段 2 自定义字段
»» enableintegertruenone是否启用 1启动 0不启用
»» fieldValuestringtruenone初始值(JSON格式)
»» conditionstringtruenone条件(例如仅为整数等等,格式前端组织,JSON格式)
» okbooleantruenonenone

PUT 项目字段编辑

PUT /admin/tx/project/fields/update

Body 请求参数

json
{
  "id": "f30cc46e58f15913b618a79f28d17adf",
  "name": "年份",
  "type": 3,
  "enable": 1,
  "fieldValue": "[{\"key\":\"c1c46b28-2b17-45e2-9eba-1d09979f429b\",\"value\":\"2022\"},{\"key\":\"5a2e0a46-72a4-45d2-8002-487cc9b7b6e7\",\"value\":\"2023\"},{\"key\":\"ff6a5611-f780-4872-b936-c960b8043f1f\",\"value\":\"2024\"},{\"key\":\"53d0926b-d868-4b46-bcbf-3006fde57f5f\",\"value\":\"2025\"}]"
}

请求参数

名称位置类型必选说明
Authorizationheaderstringnone
bodybodyobjectnone
» idbodystring字段ID
» namebodystring字段名
» typebodyinteger字段类型1单行文本 2多行文本 3单选下拉 4人名输入框 5日期 6数值
» enablebodyinteger是否启用 1启动 0不启用
» fieldValuebodystring条件(例如仅为整数等等,格式前端组织,JSON格式)

返回示例

json
{
  "code": 0,
  "msg": null,
  "data": {
    "id": "5ae746916599b12a89861530e0760f44",
    "name": "城市",
    "describe": "描述",
    "type": 1,
    "createBy": "admin",
    "createTime": "2024-09-20 16:19:35",
    "updateBy": "admin",
    "updateTime": "2024-09-20 16:19:35",
    "delFlag": "0",
    "tenantId": null,
    "classify": null,
    "enable": 1,
    "fieldValue": "[{'asdas':'asdasd'}]",
    "condition": "[{'vvvv':'vvv'}]"
  },
  "ok": true
}

返回结果

状态码状态码含义说明数据模型
200OKnoneInline

返回数据结构

状态码 200

名称类型必选约束中文名说明
» codeintegertruenonenone
» msgnulltruenonenone
» dataobjecttruenonenone
»» idstringtruenonenone
»» namestringtruenone字段名
»» describestringtruenone字段备注
»» typeintegertruenone字段类型1单行文本 2多行文本 3单选下拉 4人名输入框 5日期 6数值
»» createBystringtruenonenone
»» createTimestringtruenonenone
»» updateBystringtruenonenone
»» updateTimestringtruenonenone
»» delFlagstringtruenonenone
»» tenantIdnulltruenonenone
»» classifynulltruenone字段分类 1系统字段 2 自定义字段
»» enableintegertruenone是否启用 1启动 0不启用
»» fieldValuestringtruenone初始值(JSON格式)
»» conditionstringtruenone条件(例如仅为整数等等,格式前端组织,JSON格式)
» okbooleantruenonenone

GET 项目字段列表

GET /admin/tx/project/fields/list

请求参数

名称位置类型必选说明
enablequerystringnone
Authorizationheaderstringnone

返回示例

json
{
  "code": 0,
  "msg": null,
  "data": [
    {
      "id": "f30cc46e58f15913b618a79f28d17adf",
      "name": "年份",
      "describe": null,
      "type": 3,
      "createBy": "admin",
      "createTime": "2025-01-10 13:46:00",
      "updateBy": "admin",
      "updateTime": "2025-01-10 13:46:00",
      "delFlag": "0",
      "tenantId": "1",
      "classify": 2,
      "enable": 1,
      "fieldValue": "[{\"key\":\"c1c46b28-2b17-45e2-9eba-1d09979f429b\",\"value\":\"2022\"},{\"key\":\"5a2e0a46-72a4-45d2-8002-487cc9b7b6e7\",\"value\":\"2023\"},{\"key\":\"ff6a5611-f780-4872-b936-c960b8043f1f\",\"value\":\"2024\"},{\"key\":\"53d0926b-d868-4b46-bcbf-3006fde57f5f\",\"value\":\"2025\"}]",
      "condition": null
    }
  ],
  "ok": true
}

返回结果

状态码状态码含义说明数据模型
200OKnoneInline

返回数据结构

状态码 200

名称类型必选约束中文名说明
» codeintegertruenonenone
» msgnulltruenonenone
» data[object]truenonenone
»» idstringfalsenone字段id
»» namestringfalsenone字段名
»» describenullfalsenone描述
»» typeintegerfalsenone字段类型1单行文本 2多行文本 3单选下拉 4人名输入框 5日期 6数值
»» createBystringfalsenonenone
»» createTimestringfalsenonenone
»» updateBystringfalsenonenone
»» updateTimestringfalsenonenone
»» delFlagstringfalsenonenone
»» tenantIdstringfalsenonenone
»» classifyintegerfalsenone字段分类 1系统字段 2 自定义字段
»» enableintegerfalsenone是否启用 1启动 0不启用
»» fieldValuestringfalsenone初始值(JSON格式)
»» conditionnullfalsenone条件(例如仅为整数等等,格式前端组织,JSON格式)
» okbooleantruenonenone

PUT 单独修改项目字段及项目值

PUT /admin/tx/project/updateProjectFields

项目详情下,单独修改项目字段及项目值

Body 请求参数

json
{
  "projectId": "asdasdasd",
  "fieldsId": "asdasd",
  "fieldsValue": "asdadas"
}

请求参数

名称位置类型必选说明
Authorizationheaderstringnone
bodybodyobjectnone
» projectIdbodystringnone
» fieldsIdbodystringnone
» fieldsValuebodystringnone

返回示例

json
{
  "code": 0,
  "msg": null,
  "data": {
    "id": "5ae746916599b12a89861530e0760f44",
    "name": "城市",
    "describe": "描述",
    "type": 1,
    "createBy": "admin",
    "createTime": "2024-09-20 16:19:35",
    "updateBy": "admin",
    "updateTime": "2024-09-20 16:19:35",
    "delFlag": "0",
    "tenantId": null,
    "classify": null,
    "enable": 1,
    "fieldValue": "[{'asdas':'asdasd'}]",
    "condition": "[{'vvvv':'vvv'}]"
  },
  "ok": true
}
json
{
  "code": 0,
  "msg": null,
  "data": null,
  "ok": true
}

返回结果

状态码状态码含义说明数据模型
200OKnoneInline

返回数据结构

状态码 200

名称类型必选约束中文名说明
» codeintegertruenonenone
» msgnulltruenonenone
» datanulltruenonenone
» okbooleantruenonenone

Released under the MIT License.