ソースを参照

风险管理4月11日提交代码-liu.bolan-三期部分页面

Liu.bolan 4 年 前
コミット
200def1df9

+ 8 - 0
RMA/app/src/main/AndroidManifest.xml

@@ -217,6 +217,14 @@
 
 
         <activity android:name=".view.base.home.inventory.inventorymanager.InventoryDetailsActivity"/>
         <activity android:name=".view.base.home.inventory.inventorymanager.InventoryDetailsActivity"/>
 
 
+        <activity android:name=".view.base.home.rolemanagement.RoleSetActivity"/>
+
+        <activity android:name=".view.base.home.rolemanagement.AddRoleSetActivity"/>
+
+        <activity android:name=".view.base.home.contract.SpotMarketPriceActivity"/>
+
+        <activity android:name=".view.base.home.contract.AddSpotMarketPriceActivity"/>
+
     </application>
     </application>
 
 
 </manifest>
 </manifest>

+ 44 - 0
RMA/app/src/main/java/cn/muchinfo/rma/business/role/RoleManager.kt

@@ -0,0 +1,44 @@
+package cn.muchinfo.rma.business.role
+
+import cn.muchinfo.rma.global.data.AccMgrRoleData
+import cn.muchinfo.rma.global.data.ContractData
+import cn.muchinfo.rma.netManage.base.ResponseCallback
+import cn.muchinfo.rma.netManage.utils.MyOkHttpUtils
+import cn.muchinfo.rma.view.base.app.BaseResult
+import cn.muchinfo.rma.view.base.app.Constant
+import com.blankj.utilcode.util.SPUtils
+import okhttp3.Call
+import java.lang.Exception
+
+/**
+ * 账户管理的manager
+ */
+class RoleManager {
+
+    /**
+     * 查询账户管理角色设置(账户管理/角色设置)
+     * @param params Map<String, String>
+     * @param responseBack Function3<[@kotlin.ParameterName] Boolean, [@kotlin.ParameterName] List<AccMgrRoleData>?, [@kotlin.ParameterName] Error?, Unit>
+     */
+    fun queryAccMgrRole(
+        params: Map<String, String>,
+        responseBack: (isSuccess: Boolean, respData: List<AccMgrRoleData>?, error: Error?) -> Unit
+    ) {
+        MyOkHttpUtils().query(
+            URL = SPUtils.getInstance()
+                .getString(Constant.goCommonSearchUrl) + "/Ermcp/QueryAccMgrRole",
+            params = params,
+            type = "1",
+            callback = object : ResponseCallback<BaseResult<List<AccMgrRoleData>>>() {
+                override fun onResponse(response: BaseResult<List<AccMgrRoleData>>?, id: Int) {
+                    responseBack(true, response?.data, null)
+                }
+
+                override fun onError(call: Call?, e: Exception?, id: Int) {
+                    responseBack(false, null, Error(e?.message))
+                }
+            }
+        )
+    }
+
+}

+ 60 - 0
RMA/app/src/main/java/cn/muchinfo/rma/global/data/AccMgrRoleData.kt

@@ -0,0 +1,60 @@
+package cn.muchinfo.rma.global.data
+
+import android.os.Parcel
+import android.os.Parcelable
+
+/**
+ * 账户管理角色设置(账户管理/角色设置)
+ */
+data class AccMgrRoleData(
+    val areauserid : String? = "",//所属机构
+    val autoid : String? = "",//角色ID(自增ID)
+    val modifierid : String? = "",//修改人(创建人)
+    val modifiername : String? = "",//修改人名称
+    val modifytime : String? = "",//修改时间(创建时间)
+    val rolename : String? = "",//角色名称
+    val rolestatus : String? = "",//角色状态 - 1:启用 2:停用
+    val roletype : String?  = "",//角色类型 - 1- 管理端 2- 交易端
+    var indexSelect: Int = 0
+) : Parcelable{
+    constructor(parcel: Parcel) : this(
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readString(),
+        parcel.readInt()
+    ) {
+    }
+
+    override fun writeToParcel(parcel: Parcel, flags: Int) {
+        parcel.writeString(areauserid)
+        parcel.writeString(autoid)
+        parcel.writeString(modifierid)
+        parcel.writeString(modifiername)
+        parcel.writeString(modifytime)
+        parcel.writeString(rolename)
+        parcel.writeString(rolestatus)
+        parcel.writeString(roletype)
+        parcel.writeInt(indexSelect)
+    }
+
+    override fun describeContents(): Int {
+        return 0
+    }
+
+    companion object CREATOR : Parcelable.Creator<AccMgrRoleData> {
+        override fun createFromParcel(parcel: Parcel): AccMgrRoleData {
+            return AccMgrRoleData(parcel)
+        }
+
+        override fun newArray(size: Int): Array<AccMgrRoleData?> {
+            return arrayOfNulls(size)
+        }
+    }
+
+
+}

+ 5 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/MyApplication.kt

@@ -21,6 +21,7 @@ import cn.muchinfo.rma.business.management.BusinessManager
 import cn.muchinfo.rma.business.quote.QuoteManager
 import cn.muchinfo.rma.business.quote.QuoteManager
 import cn.muchinfo.rma.business.quote.adapter.QuoteAdapter
 import cn.muchinfo.rma.business.quote.adapter.QuoteAdapter
 import cn.muchinfo.rma.business.report.ReportManager
 import cn.muchinfo.rma.business.report.ReportManager
+import cn.muchinfo.rma.business.role.RoleManager
 import cn.muchinfo.rma.business.tradingquery.TradingQueryManager
 import cn.muchinfo.rma.business.tradingquery.TradingQueryManager
 import cn.muchinfo.rma.business.warehouse.WarehouseManager
 import cn.muchinfo.rma.business.warehouse.WarehouseManager
 import cn.muchinfo.rma.global.GlobalDataCollection
 import cn.muchinfo.rma.global.GlobalDataCollection
@@ -121,6 +122,9 @@ class MyApplication : BaseApplication() {
     /** 仓库相关管理类 */
     /** 仓库相关管理类 */
     var warehouseManager : WarehouseManager? = null
     var warehouseManager : WarehouseManager? = null
 
 
+    /** 账户管理 **/
+    var roleManager : RoleManager? = null
+
     companion object {
     companion object {
         private var instance: MyApplication? = null
         private var instance: MyApplication? = null
 
 
@@ -236,6 +240,7 @@ class MyApplication : BaseApplication() {
         futureManager = FutureManager()
         futureManager = FutureManager()
         chartManager = ChartManager()
         chartManager = ChartManager()
         warehouseManager = WarehouseManager()
         warehouseManager = WarehouseManager()
+        roleManager = RoleManager()
     }
     }
 
 
     /**
     /**

+ 32 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/contract/AddSpotMarketPriceActivity.kt

@@ -0,0 +1,32 @@
+package cn.muchinfo.rma.view.base.home.contract
+
+import android.os.Bundle
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.view.autoWidget.commonLeftButton
+
+import cn.muchinfo.rma.view.autoWidget.commonTitle
+import cn.muchinfo.rma.view.autoWidget.topBar
+import cn.muchinfo.rma.view.base.BaseActivity
+
+import org.jetbrains.anko.verticalLayout
+
+class AddSpotMarketPriceActivity : BaseActivity<SpotMarketPriceViewModel>(){
+
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+        verticalLayout {
+            background = resources.getDrawable(R.color.main_hit_bg_color)
+            //页面标题
+            topBar {
+                commonLeftButton()
+                commonTitle {
+                    text = "市价录入"
+                }
+            }
+
+
+
+        }
+    }
+
+}

+ 117 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/contract/SpotMarketPriceActivity.kt

@@ -0,0 +1,117 @@
+package cn.muchinfo.rma.view.base.home.contract
+
+import android.content.Intent
+import android.os.Bundle
+import android.view.Gravity
+import cn.muchinfo.rma.R
+
+import cn.muchinfo.rma.lifecycle.bindOptional
+import cn.muchinfo.rma.view.autoWidget.*
+import cn.muchinfo.rma.view.base.BaseActivity
+
+import com.blankj.utilcode.util.ActivityUtils
+import mtp.polymer.com.autowidget.adapter.BaseAdapter
+import org.jetbrains.anko.linearLayout
+import org.jetbrains.anko.matchParent
+import org.jetbrains.anko.textView
+import org.jetbrains.anko.verticalLayout
+
+/**
+ * 现货市价页面
+ */
+class SpotMarketPriceActivity : BaseActivity<SpotMarketPriceViewModel>(){
+
+    // 下拉刷新
+    private lateinit var swipeToLayout: SwipeToLoadLayout
+    private lateinit var statusLayout: StatusLayout
+
+    private val spotMarketPriceAdapter: BaseAdapter<String, SpotMarketPriceViewHolder> =
+        BaseAdapter { _, _ -> SpotMarketPriceViewHolder(this, viewModel) }
+
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+        verticalLayout {
+            background = resources.getDrawable(R.color.main_hit_bg_color)
+            //页面标题
+            topBar {
+                commonLeftButton()
+                commonTitle {
+                    text = "角色设置"
+                }
+                // 新增角色设置
+                commonMenuButton(R.mipmap.add_new) {
+                    val intent = Intent()
+                    intent.setClass(context,AddSpotMarketPriceActivity::class.java)
+                    ActivityUtils.startActivity(intent)
+                }
+            }
+
+            linearLayout {
+                textView {
+                    gravity = Gravity.CENTER
+                    text = "现货品种"
+                    textSizeAuto = 30
+                    textColorInt = R.color.rma_hint_title_text_color
+                }.lparams(0, autoSize(100),1f)
+                textView {
+                    gravity = Gravity.CENTER
+                    text = "品类"
+                    textSizeAuto = 30
+                    textColorInt = R.color.rma_hint_title_text_color
+                }.lparams(0, autoSize(100),1f)
+                textView {
+                    gravity = Gravity.CENTER
+                    text = "品牌"
+                    textSizeAuto = 30
+                    textColorInt = R.color.rma_hint_title_text_color
+                }.lparams(0, autoSize(100),1f)
+                textView {
+                    gravity = Gravity.CENTER
+                    text = "价格"
+                    textSizeAuto = 30
+                    textColorInt = R.color.rma_hint_title_text_color
+                }.lparams(0, autoSize(100),1f)
+            }.lparams(matchParent, autoSize(100))
+
+
+            statusLayout(contentBlock = {
+                statusLayout = this
+//                bindTaskStatus(viewModule.status)
+                setRetryAction {
+                    viewModel.querySpotMarketPriceList()
+                }
+                swipeToLoadLayout {
+                    swipeToLayout = this
+                    setEnableRefresh(true)
+                    setEnableLoadMore(false)
+                    setOnRefreshListener {
+                        viewModel.querySpotMarketPriceList()
+                    }
+                    setEnableScrollContentWhenLoaded(false)
+                    setEnableLoadMoreWhenContentNotFull(false)
+
+                    // 未提交列表
+                    recyclerView {
+                        background = resources.getDrawable(R.color.white)
+                        adapter = spotMarketPriceAdapter
+                    }.lparams(matchParent, matchParent)
+                }
+            }, emptyBlock = {
+                emptyView(hint = resources.getString(R.string.now_no_data))
+            }).lparams(matchParent, matchParent)
+
+            viewModel.spotMarketPriceDataList.bindOptional(context) {
+                if (it?.isEmpty() == true || it?.size == 0) {
+                    statusLayout.showEmpty()
+                } else {
+                    if (swipeToLayout.getIsRefreshing()) {
+                        swipeToLayout.finishRefresh()
+                    }
+                    statusLayout.showSuccess()
+                    spotMarketPriceAdapter.setNewData(it)
+                }
+            }
+        }
+    }
+
+}

+ 108 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/contract/SpotMarketPriceViewHolder.kt

@@ -0,0 +1,108 @@
+package cn.muchinfo.rma.view.base.home.contract
+
+import android.view.Gravity
+import android.view.View
+import androidx.appcompat.app.AppCompatActivity
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.lifecycle.bindOptional
+import cn.muchinfo.rma.view.autoWidget.autoSize
+import cn.muchinfo.rma.view.autoWidget.onThrottleFirstClick
+import cn.muchinfo.rma.view.autoWidget.textColorInt
+import cn.muchinfo.rma.view.autoWidget.textSizeAuto
+import mtp.polymer.com.autowidget.adapter.BaseViewHolder
+import org.jetbrains.anko.*
+
+/**
+ * 现货市价viewholder
+ * @property activity AppCompatActivity
+ * @property viewModel SpotMarketPriceViewModel
+ * @constructor
+ */
+class SpotMarketPriceViewHolder(private val activity : AppCompatActivity,private val viewModel: SpotMarketPriceViewModel) : BaseViewHolder<String>(activity){
+    override val itemSize: IntArray = intArrayOf(matchParent, wrapContent)
+
+    override fun _FrameLayout.createContentView() {
+        verticalLayout {
+            linearLayout {
+                textView {
+                    gravity = Gravity.CENTER
+                    text = "现货品种"
+                    textSizeAuto = 30
+                    textColorInt = R.color.rma_hint_title_text_color
+                }.lparams(0, autoSize(100),1f)
+                textView {
+                    gravity = Gravity.CENTER
+                    text = "品类"
+                    textSizeAuto = 30
+                    textColorInt = R.color.rma_hint_title_text_color
+                }.lparams(0, autoSize(100),1f)
+                textView {
+                    gravity = Gravity.CENTER
+                    text = "品牌"
+                    textSizeAuto = 30
+                    textColorInt = R.color.rma_hint_title_text_color
+                }.lparams(0, autoSize(100),1f)
+                textView {
+                    gravity = Gravity.CENTER
+                    text = "价格"
+                    textSizeAuto = 30
+                    textColorInt = R.color.rma_hint_title_text_color
+                }.lparams(0, autoSize(100),1f)
+            }.lparams(matchParent, autoSize(100))
+
+            // 控制区
+            linearLayout {
+                data.bindOptional(context) {
+//                    if (it?.indexSelect == 0) {
+//                        visibility = View.GONE
+//                    } else if (it?.indexSelect == 1) {
+//                        visibility = View.VISIBLE
+//                    }
+                }
+                gravity = Gravity.CENTER_VERTICAL
+
+                emptyView()
+
+                textView {
+                    onThrottleFirstClick {
+
+                    }
+                    backgroundResource = R.drawable.rma_item_click_bg
+                    gravity = Gravity.CENTER
+                    text = "修改"
+                    textColorInt = R.color.rma_item_click_color
+                    textSizeAuto = 26
+                }.lparams(autoSize(120), autoSize(48)) {
+                    marginEnd = autoSize(24)
+                }
+
+                textView {
+                    onThrottleFirstClick {
+
+                    }
+                    backgroundResource = R.drawable.rma_item_click_bg
+                    gravity = Gravity.CENTER
+                    text = "删除"
+                    textColorInt = R.color.rma_item_click_color
+                    textSizeAuto = 26
+                }.lparams(autoSize(120), autoSize(48)) {
+                    marginEnd = autoSize(24)
+                }
+
+                textView {
+                    onThrottleFirstClick {
+
+                    }
+                    backgroundResource = R.drawable.rma_item_click_bg
+                    gravity = Gravity.CENTER
+                    text = "详情"
+                    textColorInt = R.color.rma_item_click_color
+                    textSizeAuto = 26
+                }.lparams(autoSize(120), autoSize(48)) {
+                    marginEnd = autoSize(36)
+                }
+            }.lparams(matchParent, autoSize(72))
+        }
+    }
+
+}

+ 21 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/contract/SpotMarketPriceViewModel.kt

@@ -0,0 +1,21 @@
+package cn.muchinfo.rma.view.base.home.contract
+
+import androidx.lifecycle.MutableLiveData
+import cn.muchinfo.rma.view.base.BaseViewModel
+
+/**
+ * 现货市价viewmodel
+ */
+class SpotMarketPriceViewModel : BaseViewModel(){
+
+
+    /**
+     * 现货市价列表数据
+     */
+    val spotMarketPriceDataList : MutableLiveData<List<String>> = MutableLiveData()
+
+    fun querySpotMarketPriceList(){
+
+    }
+
+}

+ 1 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/inventory/inventorymanager/InventoryManagerViewModel.kt

@@ -171,6 +171,7 @@ class InventoryManagerViewModel : BaseViewModel() {
                 )
                 )
             }
             }
         }
         }
+
     }
     }
 
 
     /**
     /**

+ 29 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/rolemanagement/AddRoleSetActivity.kt

@@ -0,0 +1,29 @@
+package cn.muchinfo.rma.view.base.home.rolemanagement
+
+import android.os.Bundle
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.view.autoWidget.commonLeftButton
+import cn.muchinfo.rma.view.autoWidget.commonMenuButton
+import cn.muchinfo.rma.view.autoWidget.commonTitle
+import cn.muchinfo.rma.view.autoWidget.topBar
+import cn.muchinfo.rma.view.base.BaseActivity
+import org.jetbrains.anko.verticalLayout
+
+class AddRoleSetActivity : BaseActivity<RoleSetViewModel>(){
+
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+        verticalLayout {
+            background = resources.getDrawable(R.color.main_hit_bg_color)
+            //页面标题
+            topBar {
+                commonLeftButton()
+                commonTitle {
+                    text = "新增角色"
+                }
+
+            }
+        }
+    }
+
+}

+ 121 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/rolemanagement/RoleSetActivity.kt

@@ -0,0 +1,121 @@
+package cn.muchinfo.rma.view.base.home.rolemanagement
+
+import android.content.Intent
+import android.os.Bundle
+import android.view.Gravity
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.data.AccMgrRoleData
+import cn.muchinfo.rma.lifecycle.bindOptional
+import cn.muchinfo.rma.view.autoWidget.*
+import cn.muchinfo.rma.view.base.BaseActivity
+import com.blankj.utilcode.util.ActivityUtils
+import mtp.polymer.com.autowidget.adapter.BaseAdapter
+import org.jetbrains.anko.linearLayout
+import org.jetbrains.anko.matchParent
+import org.jetbrains.anko.textView
+import org.jetbrains.anko.verticalLayout
+
+/**
+ * 角色设置页面
+ * @property swipeToLayout SwipeToLoadLayout
+ * @property statusLayout StatusLayout
+ * @property unSubmitAdapter BaseAdapter<WarehouseInfoData, WarehouseInformationViewHolder>
+ */
+class RoleSetActivity : BaseActivity<RoleSetViewModel>() {
+
+    // 下拉刷新
+    private lateinit var swipeToLayout: SwipeToLoadLayout
+    private lateinit var statusLayout: StatusLayout
+
+    private val roleSetAdapter: BaseAdapter<AccMgrRoleData, RoleSetViewHolder> =
+        BaseAdapter { _, _ -> RoleSetViewHolder(this, viewModel) }
+
+
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+        verticalLayout {
+            viewModel.queryAccMgrRole()
+            background = resources.getDrawable(R.color.main_hit_bg_color)
+            //页面标题
+            topBar {
+                commonLeftButton()
+                commonTitle {
+                    text = "角色设置"
+                }
+                // 新增角色设置
+                commonMenuButton(R.mipmap.add_new) {
+                    val intent = Intent()
+                    intent.setClass(context,AddRoleSetActivity::class.java)
+                    ActivityUtils.startActivity(intent)
+                }
+            }
+            linearLayout {
+                textView {
+                    gravity = Gravity.CENTER
+                    text = "角色名称"
+                    textSizeAuto = 30
+                    textColorInt = R.color.rma_hint_title_text_color
+                }.lparams(autoSize(200), autoSize(100))
+                textView {
+                    gravity = Gravity.CENTER
+                    text = "创建人"
+                    textSizeAuto = 30
+                    textColorInt = R.color.rma_hint_title_text_color
+                }.lparams(autoSize(200), autoSize(100))
+                textView {
+                    gravity = Gravity.CENTER
+                    text = "创建时间"
+                    textSizeAuto = 30
+                    textColorInt = R.color.rma_hint_title_text_color
+                }.lparams(autoSize(350), autoSize(100))
+                textView {
+                    gravity = Gravity.CENTER
+                    text = "状态"
+                    textSizeAuto = 30
+                    textColorInt = R.color.rma_hint_title_text_color
+                }.lparams(autoSize(150), autoSize(100))
+            }.lparams(matchParent, autoSize(100))
+
+
+            statusLayout(contentBlock = {
+                statusLayout = this
+//                bindTaskStatus(viewModule.status)
+                setRetryAction {
+                    viewModel.queryAccMgrRole()
+                }
+                swipeToLoadLayout {
+                    swipeToLayout = this
+                    setEnableRefresh(true)
+                    setEnableLoadMore(false)
+                    setOnRefreshListener {
+                        viewModel.queryAccMgrRole()
+                    }
+                    setEnableScrollContentWhenLoaded(false)
+                    setEnableLoadMoreWhenContentNotFull(false)
+
+                    // 未提交列表
+                    recyclerView {
+                        background = resources.getDrawable(R.color.white)
+                        adapter = roleSetAdapter
+                    }.lparams(matchParent, matchParent)
+                }
+            }, emptyBlock = {
+                emptyView(hint = resources.getString(R.string.now_no_data))
+            }).lparams(matchParent, matchParent)
+
+            viewModel.roleSetDataList.bindOptional(context) {
+                if (it?.isEmpty() == true || it?.size == 0) {
+                    statusLayout.showEmpty()
+                } else {
+                    if (swipeToLayout.getIsRefreshing()) {
+                        swipeToLayout.finishRefresh()
+                    }
+                    statusLayout.showSuccess()
+                    roleSetAdapter.setNewData(it)
+                }
+            }
+
+        }
+    }
+
+}

+ 100 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/rolemanagement/RoleSetViewHolder.kt

@@ -0,0 +1,100 @@
+package cn.muchinfo.rma.view.base.home.rolemanagement
+
+import android.view.Gravity
+import android.view.View
+import androidx.appcompat.app.AppCompatActivity
+import cn.muchinfo.rma.R
+import cn.muchinfo.rma.global.data.AccMgrRoleData
+import cn.muchinfo.rma.lifecycle.bindOptional
+import cn.muchinfo.rma.view.autoWidget.autoSize
+import cn.muchinfo.rma.view.autoWidget.onThrottleFirstClick
+import cn.muchinfo.rma.view.autoWidget.textColorInt
+import cn.muchinfo.rma.view.autoWidget.textSizeAuto
+import cn.muchinfo.rma.view.base.home.contract.emptyView
+import mtp.polymer.com.autowidget.adapter.BaseViewHolder
+import org.jetbrains.anko.*
+
+/**
+ * 角色设置的viewholder
+ * @property activity AppCompatActivity
+ * @property viewModel RoleSetViewModel
+ * @property itemSize IntArray
+ * @constructor
+ */
+class RoleSetViewHolder(private val activity : AppCompatActivity,private val viewModel : RoleSetViewModel) : BaseViewHolder<AccMgrRoleData>(activity){
+    override val itemSize: IntArray = intArrayOf(matchParent, wrapContent)
+
+    override fun _FrameLayout.createContentView() {
+         verticalLayout {
+             linearLayout {
+                 textView {
+                     gravity = Gravity.CENTER
+                     data.bindOptional(context){
+
+                     }
+                     text = "角色名称"
+                     textSizeAuto = 30
+                     textColorInt = R.color.rma_hint_title_text_color
+                 }.lparams(autoSize(200), autoSize(100))
+                 textView {
+                     gravity = Gravity.CENTER
+                     text = "创建人"
+                     textSizeAuto = 30
+                     textColorInt = R.color.rma_hint_title_text_color
+                 }.lparams(autoSize(200), autoSize(100))
+                 textView {
+                     gravity = Gravity.CENTER
+                     text = "创建时间"
+                     textSizeAuto = 30
+                     textColorInt = R.color.rma_hint_title_text_color
+                 }.lparams(autoSize(350), autoSize(100))
+                 textView {
+                     gravity = Gravity.CENTER
+                     text = "状态"
+                     textSizeAuto = 30
+                     textColorInt = R.color.rma_hint_title_text_color
+                 }.lparams(autoSize(150), autoSize(100))
+             }.lparams(matchParent, autoSize(100))
+
+             // 控制区
+             linearLayout {
+                 data.bindOptional(context) {
+                     if (it?.indexSelect == 0) {
+                         visibility = View.GONE
+                     } else if (it?.indexSelect == 1) {
+                         visibility = View.VISIBLE
+                     }
+                 }
+                 gravity = Gravity.CENTER_VERTICAL
+
+                 emptyView()
+
+                 textView {
+                     onThrottleFirstClick {
+
+                     }
+                     backgroundResource = R.drawable.rma_item_click_bg
+                     gravity = Gravity.CENTER
+                     text = "修改"
+                     textColorInt = R.color.rma_item_click_color
+                     textSizeAuto = 26
+                 }.lparams(autoSize(120), autoSize(48)) {
+                     marginEnd = autoSize(24)
+                 }
+                 textView {
+                     onThrottleFirstClick {
+
+                     }
+                     backgroundResource = R.drawable.rma_item_click_bg
+                     gravity = Gravity.CENTER
+                     text = "详情"
+                     textColorInt = R.color.rma_item_click_color
+                     textSizeAuto = 26
+                 }.lparams(autoSize(120), autoSize(48)) {
+                     marginEnd = autoSize(36)
+                 }
+             }.lparams(matchParent, autoSize(72))
+         }.lparams(matchParent, wrapContent)
+    }
+
+}

+ 30 - 0
RMA/app/src/main/java/cn/muchinfo/rma/view/base/home/rolemanagement/RoleSetViewModel.kt

@@ -0,0 +1,30 @@
+package cn.muchinfo.rma.view.base.home.rolemanagement
+
+import androidx.lifecycle.MutableLiveData
+import cn.muchinfo.rma.global.GlobalDataCollection
+import cn.muchinfo.rma.global.data.AccMgrRoleData
+import cn.muchinfo.rma.view.MyApplication
+import cn.muchinfo.rma.view.base.BaseViewModel
+
+/**
+ * 角色设置viewmodel
+ */
+class RoleSetViewModel : BaseViewModel(){
+
+    /**
+     *
+     */
+    val roleSetDataList : MutableLiveData<List<AccMgrRoleData>> = MutableLiveData()
+
+    fun queryAccMgrRole(){
+        val params = mutableMapOf<String, String>().apply {
+            put("userid", GlobalDataCollection.instance?.loginRsp?.userID.toString())
+        }
+        MyApplication.getInstance()?.roleManager?.queryAccMgrRole(params = params){isSuccess, respData, error ->
+            if (isSuccess){
+                roleSetDataList.postValue(respData)
+            }
+        }
+    }
+
+}