项目字段设置
字段设置,构造项目字段相关接口
GET 项目字段删除
GET /admin/tx/project/fields/delete
请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 |
|---|---|---|---|---|
| id | query | string | 是 | 字段记录ID |
| Authorization | header | string | 是 | none |
返回示例
json
{
"code": 1,
"msg": "项目字段记录不存在",
"data": null,
"ok": false
}返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | none | Inline |
返回数据结构
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\"}]"
}请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 |
|---|---|---|---|---|
| Authorization | header | string | 是 | none |
| body | body | object | 否 | none |
| » name | body | string | 是 | 字段名 |
| » type | body | integer | 是 | 类型 |
| » enable | body | integer | 是 | 是否启用 |
| » fieldValue | body | string | 是 | 字段值 |
返回示例
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
}返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | none | Inline |
返回数据结构
状态码 200
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| » code | integer | true | none | none | |
| » msg | null | true | none | none | |
| » data | object | true | none | none | |
| »» id | string | true | none | none | |
| »» name | string | true | none | 字段名 | |
| »» describe | string | true | none | 字段备注 | |
| »» type | integer | true | none | 字段类型1单行文本 2多行文本 3单选下拉 4人名输入框 5日期 6数值 | |
| »» createBy | string | true | none | none | |
| »» createTime | string | true | none | none | |
| »» updateBy | string | true | none | none | |
| »» updateTime | string | true | none | none | |
| »» delFlag | string | true | none | none | |
| »» tenantId | null | true | none | none | |
| »» classify | null | true | none | 字段分类 1系统字段 2 自定义字段 | |
| »» enable | integer | true | none | 是否启用 1启动 0不启用 | |
| »» fieldValue | string | true | none | 初始值(JSON格式) | |
| »» condition | string | true | none | 条件(例如仅为整数等等,格式前端组织,JSON格式) | |
| » ok | boolean | true | none | none |
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\"}]"
}请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 |
|---|---|---|---|---|
| Authorization | header | string | 是 | none |
| body | body | object | 否 | none |
| » id | body | string | 是 | 字段ID |
| » name | body | string | 是 | 字段名 |
| » type | body | integer | 是 | 字段类型1单行文本 2多行文本 3单选下拉 4人名输入框 5日期 6数值 |
| » enable | body | integer | 是 | 是否启用 1启动 0不启用 |
| » fieldValue | body | string | 是 | 条件(例如仅为整数等等,格式前端组织,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
}返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | none | Inline |
返回数据结构
状态码 200
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| » code | integer | true | none | none | |
| » msg | null | true | none | none | |
| » data | object | true | none | none | |
| »» id | string | true | none | none | |
| »» name | string | true | none | 字段名 | |
| »» describe | string | true | none | 字段备注 | |
| »» type | integer | true | none | 字段类型1单行文本 2多行文本 3单选下拉 4人名输入框 5日期 6数值 | |
| »» createBy | string | true | none | none | |
| »» createTime | string | true | none | none | |
| »» updateBy | string | true | none | none | |
| »» updateTime | string | true | none | none | |
| »» delFlag | string | true | none | none | |
| »» tenantId | null | true | none | none | |
| »» classify | null | true | none | 字段分类 1系统字段 2 自定义字段 | |
| »» enable | integer | true | none | 是否启用 1启动 0不启用 | |
| »» fieldValue | string | true | none | 初始值(JSON格式) | |
| »» condition | string | true | none | 条件(例如仅为整数等等,格式前端组织,JSON格式) | |
| » ok | boolean | true | none | none |
GET 项目字段列表
GET /admin/tx/project/fields/list
请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 |
|---|---|---|---|---|
| enable | query | string | 是 | none |
| Authorization | header | string | 是 | none |
返回示例
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
}返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | none | Inline |
返回数据结构
状态码 200
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| » code | integer | true | none | none | |
| » msg | null | true | none | none | |
| » data | [object] | true | none | none | |
| »» id | string | false | none | 字段id | |
| »» name | string | false | none | 字段名 | |
| »» describe | null | false | none | 描述 | |
| »» type | integer | false | none | 字段类型1单行文本 2多行文本 3单选下拉 4人名输入框 5日期 6数值 | |
| »» createBy | string | false | none | none | |
| »» createTime | string | false | none | none | |
| »» updateBy | string | false | none | none | |
| »» updateTime | string | false | none | none | |
| »» delFlag | string | false | none | none | |
| »» tenantId | string | false | none | none | |
| »» classify | integer | false | none | 字段分类 1系统字段 2 自定义字段 | |
| »» enable | integer | false | none | 是否启用 1启动 0不启用 | |
| »» fieldValue | string | false | none | 初始值(JSON格式) | |
| »» condition | null | false | none | 条件(例如仅为整数等等,格式前端组织,JSON格式) | |
| » ok | boolean | true | none | none |
PUT 单独修改项目字段及项目值
PUT /admin/tx/project/updateProjectFields
项目详情下,单独修改项目字段及项目值
Body 请求参数
json
{
"projectId": "asdasdasd",
"fieldsId": "asdasd",
"fieldsValue": "asdadas"
}请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 |
|---|---|---|---|---|
| Authorization | header | string | 是 | none |
| body | body | object | 否 | none |
| » projectId | body | string | 是 | none |
| » fieldsId | body | string | 是 | none |
| » fieldsValue | body | string | 是 | none |
返回示例
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
}返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | none | Inline |
返回数据结构
状态码 200
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| » code | integer | true | none | none | |
| » msg | null | true | none | none | |
| » data | null | true | none | none | |
| » ok | boolean | true | none | none |