car/frontend/pages/question.json

246 lines
6.9 KiB
JSON

{
"type": "page",
"body": [
{
"title": "查询条件",
"type": "form",
"target": "dataTable",
"body": [
{
"type": "input-text",
"name": "keyword",
"label": "关键字:"
}
],
"submitText": "搜索"
},
{
"type": "crud",
"name": "dataTable",
"api": {
"method": "post",
"url": "/api/car/amis/list",
"data": {
"page": "${page}",
"size": "${perPage}",
"keyword": "$keyword"
}
},
"mode": "cards",
"data": {
"answerMap": [
"",
"",
"",
"",
"A",
"B",
"C",
"D",
"E",
"F",
"G",
"H"
]
},
"columnsCount": 1,
"card": {
"body": [
{
"name": "id",
"label": "id",
"hidden": true
},
{
"name": "question_id",
"label": "题目id",
"hidden": true
},
{
"name": "keywords",
"label": "关键字",
"hidden": true
},
{
"type": "tpl",
"name": "question",
"tpl": "<h3>$question</h3>"
},
{
"name": "media_content",
"label": "图片",
"width": "400px",
"height": "300px",
"type": "image",
"enlargeAble": true,
"hiddenOn": "this.media_content == 'None'"
},
{
"type": "wrapper",
"body": [
{
"type": "tag",
"hiddenOn": "this.option_a.length == 0",
"color": "active",
"displayMode": "rounded",
"style": {
"backgroundColor": "#2468f2",
"borderColor": "#2468f2",
"color": "#fff",
"font-size": "16px",
"max-width": "none",
"margin": "5px"
},
"label": "A. ${option_a}"
},
{
"type": "tag",
"hiddenOn": "this.option_b.length == 0",
"color": "active",
"displayMode": "rounded",
"style": {
"backgroundColor": "#2468f2",
"borderColor": "#2468f2",
"color": "#fff",
"font-size": "16px",
"max-width": "none",
"margin": "5px"
},
"label": "B. ${option_b}"
},
{
"type": "tag",
"hiddenOn": "this.option_c.length == 0",
"color": "active",
"displayMode": "rounded",
"style": {
"backgroundColor": "#2468f2",
"borderColor": "#2468f2",
"color": "#fff",
"font-size": "16px",
"max-width": "none",
"margin": "5px"
},
"label": "C. ${option_c}"
},
{
"type": "tag",
"hiddenOn": "this.option_d.length == 0",
"color": "active",
"displayMode": "rounded",
"style": {
"backgroundColor": "#2468f2",
"borderColor": "#2468f2",
"color": "#fff",
"font-size": "16px",
"max-width": "none",
"margin": "5px"
},
"label": "D. ${option_d}"
},
{
"type": "tag",
"hiddenOn": "this.option_e.length == 0",
"color": "active",
"displayMode": "rounded",
"style": {
"backgroundColor": "#2468f2",
"borderColor": "#2468f2",
"color": "#fff",
"font-size": "16px",
"max-width": "none",
"margin": "5px"
},
"label": "E. ${option_e}"
},
{
"type": "tag",
"hiddenOn": "this.option_f.length == 0",
"color": "active",
"displayMode": "rounded",
"style": {
"backgroundColor": "#2468f2",
"borderColor": "#2468f2",
"color": "#fff",
"font-size": "16px",
"max-width": "none",
"margin": "5px"
},
"label": "F. ${option_f}"
},
{
"type": "tag",
"hiddenOn": "this.option_g.length == 0",
"color": "active",
"displayMode": "rounded",
"style": {
"backgroundColor": "#2468f2",
"borderColor": "#2468f2",
"color": "#fff",
"font-size": "16px",
"max-width": "none",
"margin": "5px"
},
"label": "G. ${option_g}"
},
{
"type": "tag",
"hiddenOn": "this.option_h.length == 0",
"color": "active",
"displayMode": "rounded",
"style": {
"backgroundColor": "#2468f2",
"borderColor": "#2468f2",
"color": "#fff",
"font-size": "16px",
"max-width": "none",
"margin": "5px"
},
"label": "H. ${option_h}"
}
]
},
{
"name": "answer",
"label": "答案",
"type": "tpl",
"tpl": "<span><%= data.answerMap.filter((_,index)=>{return (data.answer).toString(2).split('').reverse()[index] == '1'}) %></span>"
},
{
"name": "explain",
"label": "解析",
"type": "tpl",
"body": "$explain"
},
{
"name": "illiteracy_explain",
"label": "相关规定"
},
{
"name": "knack",
"label": "窍门",
"hiddenOn": "this.knack == 'None' || this.knack.length == 0"
},
{
"name": "concise_explain",
"label": "简单解析",
"type": "tpl",
"body": "$concise_explain"
},
{
"name": "wrong_rate",
"label": "错误率",
"type": "tpl",
"tpl": "<%= (data.wrong_rate * 100).toFixed(2) %>%"
}
]
},
"footerToolbar": [
"statistics",
"switch-per-page",
"pagination"
]
}
]
}