12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- /// #pkgName FGUI包名
- /// #panelName UIPanel名字
- /// #UIName = $"{#pkgName}{#panelName}" UIKey名字
- /// 该脚本由模板创建
- /// created by cb 2024
- using System.Collections.Generic;
- using FairyGUI;
- using FL.Data;
- using XGame.Framework.UI;
- namespace FL.FGUI
- {
- /// <summary>
- /// UI逻辑处理类
- /// </summary>
- /// <typeparam name=""></typeparam>
- public partial class PartnerMwReplacePanelCtrl : UIController<PartnerMwReplacePanelVM>
- {
- protected override void OnEnable(object intent)
- {
- _posId = (int)intent;
- _sbId = PartnersData.Instance.UpSbMap.GetValueOrDefault(_posId, 0);
- var sbData = PartnersData.Instance.GetPartnerAttrByTableId(_sbId);
- _mwId = sbData.EpigraphId;
- AddUIListenres();
- InitView();
- ShowUI();
- }
- protected override void OnDisable()
- {
- RemoveUIListenres();
- }
- #region UI事件
- private void AddUIListenres()
- {
- Context.AddListener(EventDefine.PartnerSbMwUpSelect, OnSelectUpMw);
- }
- private void RemoveUIListenres()
- {
- Context.RemoveListener(EventDefine.PartnerSbMwUpSelect, OnSelectUpMw);
- }
- private void OnSelectUpMw(int eventId, object args)
- {
- var id = (int)args;
- EpigraphService.Instance.RequestEpiInset(_sbId, id);
- Context.ClosePanel();
- }
- #endregion
- private int _sbId;
- private int _posId;
- private int _mwId;
- private bool _initView;
- private void InitView()
- {
- if (_initView)
- return;
- _initView = true;
- VM.List.ListType = EGListType.Virtual;
- }
- private void ShowUI()
- {
- VM.DetailNested.VM.SpGroup.visible = false;
- VM.DetailNested.Ctrl.ShowUI(_mwId);
- var list = EpigraphData.Instance.EpiList;
- var dataList = new List<int>();
- foreach (var item in list)
- {
- if (item.PartnerId > 0)
- continue;
- dataList.Add(item.TableId);
- }
- VM.List.BindDatas(dataList);
- }
- }
- }
|