【发布时间】:2019-01-28 05:28:56
【问题描述】:
我正在为我工作的一家仓库公司创建一个 Sharepoint 列表。该列表包含仓库 1-94 的所有过道。
过道分为不同的部门,
- 杂货 (51-94),冷冻 (1-16)
- 熟食店(17-23, 25, 36-39)
- 生产(24,26-34)
我需要杂货店过道是一种颜色,冷冻成另一种颜色等等。我有一些从这里找到的代码。
https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/column-formatting
但是,我不知道如何让过道 25 成为熟食店的颜色或 24 成为生产颜色,因为它们不属于 >=、
{
"elmType": "div",
"txtContent": "@currentField",
"style": {
"color": "#000000",
"padding-left": "14px",
"background-color": {
"operator": "?",
"operands": [
{
"operator": ">=",
"operands": [
"@currentField",
51
]
},
"#e5e5e5",
{
"operator": "?",
"operands": [
{
"operator": ">=",
"operands": [
"@currentField",
24
]
},
"#91ff94",
{
"operator": "?",
"operands": [
{
"operator": ">=",
"operands": [
"@currentField",
17
]
},
"#fbff93",
{
"operator": "?",
"operands": [
{
"operator": "<=",
"operands": [
"@currentField",
16
]
},
"#91d2ff",
""
]
} ,
{
"operator": "?",
"operands": [
{
"operator": "==",
"operands": [
"@currentField",
25
]
},
"#91d2ff",
""
]
}
]
}
]
}
]
}
}
}
另外,任何人都知道我是否可以将列表的标题更改为 数值而不是一行文本?
【问题讨论】:
标签: json list sharepoint formatting