|
|
@@ -354,184 +354,184 @@ class PageDetailTask : PageBase() {
|
|
|
@Composable
|
|
|
fun TaskDevice(vm: VMDetailTask) {
|
|
|
val state by vm.state.collectAsState()
|
|
|
-// CardBox(
|
|
|
-// Modifier
|
|
|
-// .padding(top = 10.dp)
|
|
|
-// .fillMaxWidth()
|
|
|
-// ) {
|
|
|
-// Column(
|
|
|
-// Modifier
|
|
|
-// .fillMaxWidth()
|
|
|
-// .height(120.dp),
|
|
|
-// horizontalAlignment = Alignment.CenterHorizontally,
|
|
|
-// verticalArrangement = Arrangement.Center
|
|
|
-// ) {
|
|
|
-// Icon(
|
|
|
-// painter = painterResource(R.drawable.job_warning),
|
|
|
-// contentDescription = null,
|
|
|
-// modifier = Modifier.size(60.dp),
|
|
|
-// tint = MaterialTheme.colorScheme.primary
|
|
|
-// )
|
|
|
-// Text("请前往锁控柜进行取锁,取钥匙操作", fontSize = 14.sp, color = Text)
|
|
|
-// }
|
|
|
-// }
|
|
|
- // 点位信息
|
|
|
- CardBox(Modifier.padding(top = 10.dp)) {
|
|
|
- Column(
|
|
|
- Modifier
|
|
|
- .fillMaxWidth()
|
|
|
- .padding(10.dp)
|
|
|
- ) {
|
|
|
- Row(verticalAlignment = Alignment.CenterVertically) {
|
|
|
- Icon(
|
|
|
- painterResource(R.drawable.location),
|
|
|
- contentDescription = null,
|
|
|
- modifier = Modifier
|
|
|
- .padding(end = 5.dp)
|
|
|
- .size(16.dp),
|
|
|
- tint = MaterialTheme.colorScheme.primary
|
|
|
- )
|
|
|
- Text("隔离点位", fontSize = 16.sp, fontWeight = FontWeight.Bold, color = Text)
|
|
|
- }
|
|
|
- Row(
|
|
|
- modifier = Modifier
|
|
|
- .padding(top = 8.dp)
|
|
|
- .height(80.dp)
|
|
|
- .fillMaxWidth()
|
|
|
- .horizontalScroll(rememberScrollState())
|
|
|
- ) {
|
|
|
- state.node.points?.forEach {
|
|
|
- Column(
|
|
|
- modifier = Modifier
|
|
|
- .padding(end = 10.dp)
|
|
|
- .fillMaxHeight()
|
|
|
- .aspectRatio(1f)
|
|
|
- .clip(RoundedCornerShape(6.dp))
|
|
|
- .background(Color(0xFFFFF8E6)),
|
|
|
- verticalArrangement = Arrangement.Center,
|
|
|
- horizontalAlignment = Alignment.CenterHorizontally
|
|
|
- ) {
|
|
|
- Spacer(
|
|
|
- modifier = Modifier
|
|
|
- .padding(end = 5.dp)
|
|
|
- .size(8.dp)
|
|
|
- .align(Alignment.End)
|
|
|
- .background(color = if (it.status == "1") Color.Red else Color.Green, shape = RoundedCornerShape(50))
|
|
|
- )
|
|
|
- AsyncImage(
|
|
|
- it.pointIcon,
|
|
|
- contentDescription = null,
|
|
|
- modifier = Modifier
|
|
|
- .size(40.dp)
|
|
|
- .offset(y = (-5).dp),
|
|
|
- contentScale = ContentScale.Fit
|
|
|
- )
|
|
|
- Text(
|
|
|
- it.pointName ?: "",
|
|
|
- fontSize = 12.sp,
|
|
|
- lineHeight = 12.sp,
|
|
|
- modifier = Modifier
|
|
|
- .offset(y = (-5).dp)
|
|
|
- .padding(top = 10.dp),
|
|
|
- color = Text
|
|
|
- )
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- // 所需设备
|
|
|
- CardBox(Modifier.padding(top = 10.dp)) {
|
|
|
+ CardBox(
|
|
|
+ Modifier
|
|
|
+ .padding(top = 10.dp)
|
|
|
+ .fillMaxWidth()
|
|
|
+ ) {
|
|
|
Column(
|
|
|
Modifier
|
|
|
.fillMaxWidth()
|
|
|
- .padding(10.dp)
|
|
|
+ .height(120.dp),
|
|
|
+ horizontalAlignment = Alignment.CenterHorizontally,
|
|
|
+ verticalArrangement = Arrangement.Center
|
|
|
) {
|
|
|
- Row(verticalAlignment = Alignment.CenterVertically) {
|
|
|
- Icon(
|
|
|
- painterResource(R.drawable.return_device),
|
|
|
- contentDescription = null,
|
|
|
- modifier = Modifier
|
|
|
- .padding(end = 5.dp)
|
|
|
- .size(16.dp),
|
|
|
- tint = MaterialTheme.colorScheme.primary
|
|
|
- )
|
|
|
- Text(state.deviceInfo.first, fontSize = 16.sp, fontWeight = FontWeight.Bold, color = Text)
|
|
|
- }
|
|
|
- if (state.deviceInfo.second.isNotEmpty()) Text(
|
|
|
- state.deviceInfo.second,
|
|
|
- fontSize = 14.sp,
|
|
|
- color = Text.copy(alpha = 0.5f),
|
|
|
- modifier = Modifier.padding(start = 21.dp)
|
|
|
+ Icon(
|
|
|
+ painter = painterResource(R.drawable.job_warning),
|
|
|
+ contentDescription = null,
|
|
|
+ modifier = Modifier.size(60.dp),
|
|
|
+ tint = MaterialTheme.colorScheme.primary
|
|
|
)
|
|
|
- Row(
|
|
|
- modifier = Modifier
|
|
|
- .padding(top = 8.dp)
|
|
|
- .height(80.dp)
|
|
|
- .fillMaxWidth()
|
|
|
- .horizontalScroll(rememberScrollState())
|
|
|
- ) {
|
|
|
- state.keys.forEach {
|
|
|
- Column(
|
|
|
- modifier = Modifier
|
|
|
- .padding(end = 10.dp)
|
|
|
- .fillMaxHeight()
|
|
|
- .aspectRatio(1f)
|
|
|
- .clip(RoundedCornerShape(6.dp))
|
|
|
- .background(Color(0xFFFFF8E6)),
|
|
|
- verticalArrangement = Arrangement.Center,
|
|
|
- horizontalAlignment = Alignment.CenterHorizontally
|
|
|
- ) {
|
|
|
- Icon(
|
|
|
- painter = painterResource(R.drawable.key),
|
|
|
- contentDescription = null,
|
|
|
- modifier = Modifier
|
|
|
- .size(40.dp)
|
|
|
- .alpha(if (it.keyNfc.isEmpty()) 0.5f else 1f),
|
|
|
- )
|
|
|
- Text(
|
|
|
- it.keyNfc.ifEmpty { "--" },
|
|
|
- fontSize = 12.sp,
|
|
|
- lineHeight = 12.sp,
|
|
|
- modifier = Modifier
|
|
|
- .padding(top = 10.dp)
|
|
|
- .alpha(if (it.keyNfc.isEmpty()) 0.5f else 1f),
|
|
|
- color = Text
|
|
|
- )
|
|
|
- }
|
|
|
- }
|
|
|
- state.locks.forEach {
|
|
|
- Column(
|
|
|
- modifier = Modifier
|
|
|
- .padding(end = 10.dp)
|
|
|
- .fillMaxHeight()
|
|
|
- .aspectRatio(1f)
|
|
|
- .clip(RoundedCornerShape(6.dp))
|
|
|
- .background(Color(0xFFFFF8E6)),
|
|
|
- verticalArrangement = Arrangement.Center,
|
|
|
- horizontalAlignment = Alignment.CenterHorizontally
|
|
|
- ) {
|
|
|
- Icon(
|
|
|
- painter = painterResource(R.drawable.lock),
|
|
|
- contentDescription = null,
|
|
|
- modifier = Modifier
|
|
|
- .size(40.dp)
|
|
|
- .alpha(if (it.lockNfc.isEmpty()) 0.5f else 1f),
|
|
|
- )
|
|
|
- Text(
|
|
|
- it.lockNfc.ifEmpty { "--" },
|
|
|
- fontSize = 12.sp,
|
|
|
- lineHeight = 12.sp,
|
|
|
- modifier = Modifier
|
|
|
- .padding(top = 10.dp)
|
|
|
- .alpha(if (it.lockNfc.isEmpty()) 0.5f else 1f),
|
|
|
- color = Text
|
|
|
- )
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ Text("请前往锁控柜进行取锁,取钥匙操作", fontSize = 14.sp, color = Text)
|
|
|
}
|
|
|
}
|
|
|
+// // 点位信息
|
|
|
+// CardBox(Modifier.padding(top = 10.dp)) {
|
|
|
+// Column(
|
|
|
+// Modifier
|
|
|
+// .fillMaxWidth()
|
|
|
+// .padding(10.dp)
|
|
|
+// ) {
|
|
|
+// Row(verticalAlignment = Alignment.CenterVertically) {
|
|
|
+// Icon(
|
|
|
+// painterResource(R.drawable.location),
|
|
|
+// contentDescription = null,
|
|
|
+// modifier = Modifier
|
|
|
+// .padding(end = 5.dp)
|
|
|
+// .size(16.dp),
|
|
|
+// tint = MaterialTheme.colorScheme.primary
|
|
|
+// )
|
|
|
+// Text("隔离点位", fontSize = 16.sp, fontWeight = FontWeight.Bold, color = Text)
|
|
|
+// }
|
|
|
+// Row(
|
|
|
+// modifier = Modifier
|
|
|
+// .padding(top = 8.dp)
|
|
|
+// .height(80.dp)
|
|
|
+// .fillMaxWidth()
|
|
|
+// .horizontalScroll(rememberScrollState())
|
|
|
+// ) {
|
|
|
+// state.node.points?.forEach {
|
|
|
+// Column(
|
|
|
+// modifier = Modifier
|
|
|
+// .padding(end = 10.dp)
|
|
|
+// .fillMaxHeight()
|
|
|
+// .aspectRatio(1f)
|
|
|
+// .clip(RoundedCornerShape(6.dp))
|
|
|
+// .background(Color(0xFFFFF8E6)),
|
|
|
+// verticalArrangement = Arrangement.Center,
|
|
|
+// horizontalAlignment = Alignment.CenterHorizontally
|
|
|
+// ) {
|
|
|
+// Spacer(
|
|
|
+// modifier = Modifier
|
|
|
+// .padding(end = 5.dp)
|
|
|
+// .size(8.dp)
|
|
|
+// .align(Alignment.End)
|
|
|
+// .background(color = if (it.status == "1") Color.Red else Color.Green, shape = RoundedCornerShape(50))
|
|
|
+// )
|
|
|
+// AsyncImage(
|
|
|
+// it.pointIcon,
|
|
|
+// contentDescription = null,
|
|
|
+// modifier = Modifier
|
|
|
+// .size(40.dp)
|
|
|
+// .offset(y = (-5).dp),
|
|
|
+// contentScale = ContentScale.Fit
|
|
|
+// )
|
|
|
+// Text(
|
|
|
+// it.pointName ?: "",
|
|
|
+// fontSize = 12.sp,
|
|
|
+// lineHeight = 12.sp,
|
|
|
+// modifier = Modifier
|
|
|
+// .offset(y = (-5).dp)
|
|
|
+// .padding(top = 10.dp),
|
|
|
+// color = Text
|
|
|
+// )
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// // 所需设备
|
|
|
+// CardBox(Modifier.padding(top = 10.dp)) {
|
|
|
+// Column(
|
|
|
+// Modifier
|
|
|
+// .fillMaxWidth()
|
|
|
+// .padding(10.dp)
|
|
|
+// ) {
|
|
|
+// Row(verticalAlignment = Alignment.CenterVertically) {
|
|
|
+// Icon(
|
|
|
+// painterResource(R.drawable.return_device),
|
|
|
+// contentDescription = null,
|
|
|
+// modifier = Modifier
|
|
|
+// .padding(end = 5.dp)
|
|
|
+// .size(16.dp),
|
|
|
+// tint = MaterialTheme.colorScheme.primary
|
|
|
+// )
|
|
|
+// Text(state.deviceInfo.first, fontSize = 16.sp, fontWeight = FontWeight.Bold, color = Text)
|
|
|
+// }
|
|
|
+// if (state.deviceInfo.second.isNotEmpty()) Text(
|
|
|
+// state.deviceInfo.second,
|
|
|
+// fontSize = 14.sp,
|
|
|
+// color = Text.copy(alpha = 0.5f),
|
|
|
+// modifier = Modifier.padding(start = 21.dp)
|
|
|
+// )
|
|
|
+// Row(
|
|
|
+// modifier = Modifier
|
|
|
+// .padding(top = 8.dp)
|
|
|
+// .height(80.dp)
|
|
|
+// .fillMaxWidth()
|
|
|
+// .horizontalScroll(rememberScrollState())
|
|
|
+// ) {
|
|
|
+// state.keys.forEach {
|
|
|
+// Column(
|
|
|
+// modifier = Modifier
|
|
|
+// .padding(end = 10.dp)
|
|
|
+// .fillMaxHeight()
|
|
|
+// .aspectRatio(1f)
|
|
|
+// .clip(RoundedCornerShape(6.dp))
|
|
|
+// .background(Color(0xFFFFF8E6)),
|
|
|
+// verticalArrangement = Arrangement.Center,
|
|
|
+// horizontalAlignment = Alignment.CenterHorizontally
|
|
|
+// ) {
|
|
|
+// Icon(
|
|
|
+// painter = painterResource(R.drawable.key),
|
|
|
+// contentDescription = null,
|
|
|
+// modifier = Modifier
|
|
|
+// .size(40.dp)
|
|
|
+// .alpha(if (it.keyNfc.isEmpty()) 0.5f else 1f),
|
|
|
+// )
|
|
|
+// Text(
|
|
|
+// it.keyNfc.ifEmpty { "--" },
|
|
|
+// fontSize = 12.sp,
|
|
|
+// lineHeight = 12.sp,
|
|
|
+// modifier = Modifier
|
|
|
+// .padding(top = 10.dp)
|
|
|
+// .alpha(if (it.keyNfc.isEmpty()) 0.5f else 1f),
|
|
|
+// color = Text
|
|
|
+// )
|
|
|
+// }
|
|
|
+// }
|
|
|
+// state.locks.forEach {
|
|
|
+// Column(
|
|
|
+// modifier = Modifier
|
|
|
+// .padding(end = 10.dp)
|
|
|
+// .fillMaxHeight()
|
|
|
+// .aspectRatio(1f)
|
|
|
+// .clip(RoundedCornerShape(6.dp))
|
|
|
+// .background(Color(0xFFFFF8E6)),
|
|
|
+// verticalArrangement = Arrangement.Center,
|
|
|
+// horizontalAlignment = Alignment.CenterHorizontally
|
|
|
+// ) {
|
|
|
+// Icon(
|
|
|
+// painter = painterResource(R.drawable.lock),
|
|
|
+// contentDescription = null,
|
|
|
+// modifier = Modifier
|
|
|
+// .size(40.dp)
|
|
|
+// .alpha(if (it.lockNfc.isEmpty()) 0.5f else 1f),
|
|
|
+// )
|
|
|
+// Text(
|
|
|
+// it.lockNfc.ifEmpty { "--" },
|
|
|
+// fontSize = 12.sp,
|
|
|
+// lineHeight = 12.sp,
|
|
|
+// modifier = Modifier
|
|
|
+// .padding(top = 10.dp)
|
|
|
+// .alpha(if (it.lockNfc.isEmpty()) 0.5f else 1f),
|
|
|
+// color = Text
|
|
|
+// )
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
}
|
|
|
|
|
|
/**
|