3a3ecabe
Imshann
init
|
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
</div>
</div>
<script src="https://cdn.staticfile.org/angular.js/1.2.28/angular.min.js"></script>
<script src="../dist/ng-antd.js"></script>
<script>
angular
.module("esNgAntd")
.controller("mainCtrl", function ($scope, $timeout) {
$scope.loading = false;
$scope.columns = [
{
title: "批次",
key: "name",
width: "100px",
},
{
title: "航线",
key: "age",
|
3a3ecabe
Imshann
init
|
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
},
{
title: "状态",
key: "status",
},
{
title: "操作",
key: "action",
render: (value, record, index) => {
return `<a ng-click="handleClick(${index})">Delete</a>`;
}
},
];
$scope.dataSource = [
{
id: 1,
name: "AAA",
age: 32,
status: 1,
},
{
id: 2,
name: "BBB",
age: 42,
status: 0,
},
];
$scope.rowSelection = {
onChange: (selectedRowKeys, selectedRows) => {
// console.log(selectedRowKeys, selectedRows);
},
getCheckboxProps: (record) => ({
disabled: record.age === 42,
}),
};
|
3a3ecabe
Imshann
init
|
75
76
77
78
79
80
81
82
83
84
|
$scope.handleClick = (key) => {
$scope.dataSource[key].status = $scope.dataSource[key].status ? 0 : 1;
$scope.dataSource.splice(key, 1);
console.log($scope.dataSource);
};
});
</script>
</body>
</html>
|