153 lines
4.7 KiB
QML
153 lines
4.7 KiB
QML
import QtQuick
|
|
import QtQuick.Controls
|
|
import QtWebEngine
|
|
import "./common"
|
|
// import "./Style"
|
|
Item {
|
|
id: self
|
|
width: 400
|
|
height: 300
|
|
property var proDataModel: ListModel{}
|
|
onVisibleChanged: {
|
|
if(visible)
|
|
{
|
|
var result = backend_proxy.get_projects()
|
|
if(result.code === 200)
|
|
{
|
|
proDataModel.clear()
|
|
var arr = result.data
|
|
for(var i = 0; i < arr.length; ++i)
|
|
{
|
|
|
|
var obj = arr[i].remark == "" ? {} : JSON.parse(arr[i].remark)
|
|
proDataModel.append({
|
|
"last_date": arr[i].last_date,
|
|
"cysc": !!obj.cysc ? obj.cysc: "" ,
|
|
"tdcount": !!obj.tdcount ? obj.tdcount : "",
|
|
"zdfile": !!obj.zdfile ? obj.zdfile : "",
|
|
"csperson": !!obj.csperson ? obj.csperson : "",
|
|
"cslocation": !!obj.cslocation ? obj.cslocation : "",
|
|
"cscompany": !!obj.cscompany ? obj.cscompany : "",
|
|
"cssummary": !!obj.cssummary ? obj.cssummary : ""
|
|
})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
TableView{
|
|
id: proDataTableView
|
|
anchors.fill: parent
|
|
model: proDataModel
|
|
|
|
// headerDelegate: Rectangle{
|
|
// anchors.top: parent.top
|
|
// width: parent.width
|
|
// height: 25
|
|
// color: "white"
|
|
// QxText {
|
|
// anchors.centerIn: parent
|
|
// font.pointSize: 10
|
|
// text: styleData.value
|
|
// }
|
|
// Rectangle{
|
|
// width: 1
|
|
// height: parent.height
|
|
// visible: styleData.value !== "序号"
|
|
// color: "lightgray"
|
|
// }
|
|
// Rectangle{
|
|
// y: parent.height
|
|
// width: parent.width
|
|
// height: 1
|
|
// color: "lightgray"
|
|
// }
|
|
// }
|
|
// rowDelegate: Rectangle{
|
|
// height: 25
|
|
// color : proDataTableView.currentRow === styleData.row ? "#beebff": ( (styleData.row %2 == 0) ? "#f2f2f2": "white" )
|
|
// }
|
|
// itemDelegate: Item {
|
|
// clip: true
|
|
// QxText {
|
|
// visible: styleData.role === "id"
|
|
// x: 5
|
|
// anchors.centerIn: parent
|
|
// color: "#999999"
|
|
// elide: styleData.elideMode
|
|
// font.pointSize: 10
|
|
// text: styleData.row + 1
|
|
// }
|
|
|
|
// QxText{
|
|
// z: 2
|
|
// anchors.centerIn: parent
|
|
// visible: styleData.role !== "id"
|
|
// text: !!styleData.value ? styleData.value : ""
|
|
// }
|
|
// Rectangle{
|
|
// width: 1
|
|
// height: parent.height
|
|
// visible: styleData.role !== "id"
|
|
// color: "lightgray"
|
|
// }
|
|
// }
|
|
// TableViewColumn {
|
|
// id: proNoCol
|
|
// title: "序号"
|
|
// role: "id"
|
|
// width: 50
|
|
// }
|
|
|
|
// TableViewColumn {
|
|
// id: proOpenTimeCol
|
|
// title: "实验时间"
|
|
// role: "last_date"
|
|
// width: 200
|
|
// }
|
|
// TableViewColumn {
|
|
// id: proCysc
|
|
// title: "采样时长"
|
|
// role: "cysc"
|
|
// width: 200
|
|
// }
|
|
// TableViewColumn {
|
|
// id: proTdcount
|
|
// title: "通道数据"
|
|
// role: "tdcount"
|
|
// width: 200
|
|
// }
|
|
// TableViewColumn {
|
|
// id: proZdFile
|
|
// title: "震动文件"
|
|
// role: "zdfile"
|
|
// width: 200
|
|
// }
|
|
// TableViewColumn {
|
|
// id: proCsperson
|
|
// title: "测试人员"
|
|
// role: "csperson"
|
|
// width: 200
|
|
// }
|
|
// TableViewColumn {
|
|
// id: proCsLocation
|
|
// title: "测试地点"
|
|
// role: "cslocation"
|
|
// width: 200
|
|
// }
|
|
// TableViewColumn {
|
|
// id: proCsCompany
|
|
// title: "测试单位"
|
|
// role: "cscompany"
|
|
// width: 200
|
|
// }
|
|
// TableViewColumn {
|
|
// id: proCsSummary
|
|
// title: "测试概要"
|
|
// role: "cssummary"
|
|
// width: 200
|
|
// }
|
|
}
|
|
|
|
}
|