|
@@ -0,0 +1,128 @@
|
|
|
+package com.ys.bdtp.adm.mvvm.ui.screen.offline
|
|
|
+
|
|
|
+import androidx.compose.foundation.background
|
|
|
+import androidx.compose.foundation.layout.*
|
|
|
+import androidx.compose.material.Button
|
|
|
+import androidx.compose.material.ButtonDefaults
|
|
|
+import androidx.compose.material.Text
|
|
|
+import androidx.compose.runtime.Composable
|
|
|
+import androidx.compose.runtime.rememberCoroutineScope
|
|
|
+import androidx.compose.ui.Alignment
|
|
|
+import androidx.compose.ui.Modifier
|
|
|
+import androidx.compose.ui.tooling.preview.Preview
|
|
|
+import androidx.compose.ui.unit.dp
|
|
|
+import com.ys.bdtp.adm.app.theme.bgBlueColor
|
|
|
+import com.ys.bdtp.adm.app.theme.underColor
|
|
|
+import com.ys.bdtp.adm.app.theme.whiteColor
|
|
|
+import com.ys.bdtp.adm.mvvm.model.vo.request.requestBody
|
|
|
+import com.ys.bdtp.adm.mvvm.vm.offline.OfflineViewModel
|
|
|
+import kotlinx.coroutines.launch
|
|
|
+import org.kodein.di.compose.rememberViewModel
|
|
|
+
|
|
|
+
|
|
|
+/**
|
|
|
+ * 离线数据左侧UI
|
|
|
+ */
|
|
|
+@Composable
|
|
|
+fun OfflineSide2() {
|
|
|
+ val vm by rememberViewModel<OfflineViewModel>()
|
|
|
+ val scope = rememberCoroutineScope()
|
|
|
+ Column(
|
|
|
+ modifier = Modifier
|
|
|
+ .width(280.dp)
|
|
|
+ .fillMaxHeight()
|
|
|
+ .background(underColor)
|
|
|
+ .padding(vertical = 30.dp),
|
|
|
+ horizontalAlignment = Alignment.CenterHorizontally
|
|
|
+ ) {
|
|
|
+
|
|
|
+ Button(
|
|
|
+ modifier = Modifier.size(220.dp, 42.dp),
|
|
|
+ onClick = {
|
|
|
+ scope.launch {
|
|
|
+ vm.getDict(
|
|
|
+ map = requestBody(),
|
|
|
+ s = {
|
|
|
+
|
|
|
+ },
|
|
|
+ f = {
|
|
|
+
|
|
|
+ }
|
|
|
+ )
|
|
|
+ }
|
|
|
+ },
|
|
|
+ colors = ButtonDefaults.buttonColors(
|
|
|
+ contentColor = whiteColor,
|
|
|
+ backgroundColor = bgBlueColor
|
|
|
+ ),
|
|
|
+ elevation = ButtonDefaults.elevation(0.dp)
|
|
|
+ ) {
|
|
|
+ Text(text = "全部同步")
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ Button(
|
|
|
+ modifier = Modifier.size(220.dp, 42.dp),
|
|
|
+ onClick = {
|
|
|
+
|
|
|
+ },
|
|
|
+ colors = ButtonDefaults.buttonColors(
|
|
|
+ contentColor = whiteColor,
|
|
|
+ backgroundColor = bgBlueColor
|
|
|
+ ),
|
|
|
+ elevation = ButtonDefaults.elevation(0.dp)
|
|
|
+ ) {
|
|
|
+ Text(text = "字典数据")
|
|
|
+ }
|
|
|
+
|
|
|
+ Button(
|
|
|
+ modifier = Modifier.size(220.dp, 42.dp),
|
|
|
+ onClick = {
|
|
|
+
|
|
|
+ },
|
|
|
+ colors = ButtonDefaults.buttonColors(
|
|
|
+ contentColor = whiteColor,
|
|
|
+ backgroundColor = bgBlueColor
|
|
|
+ ),
|
|
|
+ elevation = ButtonDefaults.elevation(0.dp)
|
|
|
+ ) {
|
|
|
+ Text(text = "配置数据")
|
|
|
+ }
|
|
|
+
|
|
|
+ Button(
|
|
|
+ modifier = Modifier.size(220.dp, 42.dp),
|
|
|
+ onClick = {
|
|
|
+
|
|
|
+ },
|
|
|
+ colors = ButtonDefaults.buttonColors(
|
|
|
+ contentColor = whiteColor,
|
|
|
+ backgroundColor = bgBlueColor
|
|
|
+ ),
|
|
|
+ elevation = ButtonDefaults.elevation(0.dp)
|
|
|
+ ) {
|
|
|
+ Text(text = "框架数据")
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ Button(
|
|
|
+ modifier = Modifier.size(220.dp, 42.dp),
|
|
|
+ onClick = {
|
|
|
+
|
|
|
+ },
|
|
|
+ colors = ButtonDefaults.buttonColors(
|
|
|
+ contentColor = whiteColor,
|
|
|
+ backgroundColor = bgBlueColor
|
|
|
+ ),
|
|
|
+ elevation = ButtonDefaults.elevation(0.dp)
|
|
|
+ ) {
|
|
|
+ Text(text = "任务数据")
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+@Preview
|
|
|
+@Composable
|
|
|
+fun PreviewOfflineSide2() {
|
|
|
+ OfflineSide2()
|
|
|
+}
|