import QtQuick 2.14
import QtQuick.Controls 2.14
import Qt.labs.qmlmodels 1.0
import QtGraphicalEffects 1.0
import "../Component"
Item {
id: mask
width: parent.width
height: parent.height
property bool exportT: false
function isChanged() {
let count = table.model.rows.length
for (var i = 0; i < count; i++) {
if (table.model.rows[i].checked===1) {
return true
}
}
return false
}
Popup {
id: popup
width: 0
height: 0
modal: false
padding: 0
focus: true
visible: true
closePolicy: Popup.NoAutoClose
Item {
width: mask.width
height: mask.height
DropShadow {
id: shadow
anchors.fill: tmpId
horizontalOffset: 5
verticalOffset: 5
radius: 8.0
samples: 16
color: "#80000000"
source: tmpId
}
Rectangle {
id: tmpId
color: "white"
z: 9
width: dpH(1012)
height: dpH(644)
radius: dpH(10)
x: Math.round((mask.width - width) / 2)
y: Math.round((mask.height - height) / 2)
visible: true
Label {
id: tmp_top_label
text: qsTr("导入任务")
color: "#4A6DBC"
anchors {
top: parent.top
topMargin: dpH(21)
left: parent.left
leftMargin: dpH(47)
}
font {
bold: true
family: $font.name
pixelSize: dpH(23)
}
}
Rectangle {
z: 10
id: tableView
width: dpH(919)
height: dpH(475)
anchors {
top: parent.top
topMargin: dpH(88)
left: parent.left
leftMargin: dpH(47)
}
Item {
id: control
implicitHeight: parent.height
implicitWidth: parent.width
//表头行高
property int headerHeight: dpH(48)
//行高
property int rowHeight: dpH(48)
property int tableLeft: dpH(100)
//滚动条
property color scrollBarColor: "#E5E5E5"
property int scrollBarWidth: 7
//列宽
property variant columnWidthArr: [(control.width - control.tableLeft)
/ 2, (control.width - control.tableLeft) / 2]
property var horHeader: ["名称", "格式"]
property int selected: -1
property var datas: [{
"checked": 0,
"id": 1,
"name": "汽车曲轴分拣项目1",
"type": "mission"
}, {
"checked": 0,
"id": 2,
"name": "汽车曲轴分拣项目2",
"type": "mission"
}, {
"checked": 0,
"id": 3,
"name": "汽车曲轴分拣项目3",
"type": "mission"
}, {
"checked": 0,
"id": 4,
"name": "汽车曲轴分拣项目4",
"type": "mission"
}, {
"checked": 0,
"id": 5,
"name": "汽车曲轴分拣项目5",
"type": "mission"
}, {
"checked": 0,
QML tableView表格数据添加全选,不选,和禁用状态
于 2020-07-16 13:55:11 首次发布