|
@@ -15,14 +15,7 @@ namespace FL.FGUI
|
|
|
{
|
|
|
public class PartnerEpiDetailInfoParam
|
|
|
{
|
|
|
- public int PlanId;
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// 槽位id,-1为非更换界面打开的详情
|
|
|
- /// </summary>
|
|
|
- public int SlotId;
|
|
|
public int EpigraphId;
|
|
|
- public int PartnerId;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -33,17 +26,11 @@ namespace FL.FGUI
|
|
|
{
|
|
|
#region 属性
|
|
|
private int _mwId;
|
|
|
- private int _planId;
|
|
|
- private int _slotId;
|
|
|
- private int _partnerId;
|
|
|
#endregion
|
|
|
protected override void OnEnable(object intent)
|
|
|
{
|
|
|
var param = intent as PartnerEpiDetailInfoParam;
|
|
|
_mwId = param.EpigraphId;
|
|
|
- _planId = param.PlanId;
|
|
|
- _slotId = param.SlotId;
|
|
|
- _partnerId = param.PartnerId;
|
|
|
AddUIListenres();
|
|
|
UpView();
|
|
|
}
|
|
@@ -95,105 +82,105 @@ namespace FL.FGUI
|
|
|
Log.Error($"铭文数据不存在tableId:{_mwId}");
|
|
|
return;
|
|
|
}
|
|
|
- if (PartnersData.Instance.UsePlanId == _planId)
|
|
|
- {
|
|
|
- EpigraphService.Instance.RequestEpiInset(info.PartnerId, 0);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- if (!PartnersData.Instance.TryGetPlan(_planId, out var plan))
|
|
|
- {
|
|
|
- Context.ShowTips(StringDefine.PartnerPlanEmptyTips);
|
|
|
- return;
|
|
|
- }
|
|
|
- var caoId = -1;
|
|
|
- var sbId = 0;
|
|
|
- foreach (var slot in plan.Slots)
|
|
|
- {
|
|
|
- if (slot.MwId == _mwId)
|
|
|
- {
|
|
|
- caoId = slot.CaoId;
|
|
|
- sbId = slot.SbId;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- if (sbId == 0 || caoId < 0)
|
|
|
- {
|
|
|
- Context.ShowTips(StringDefine.EpigraphNotInPlanTips);
|
|
|
- return;
|
|
|
- }
|
|
|
- PartnersService.Instance.RequestUpdatePlanMw(_planId, caoId, sbId, 0);
|
|
|
- }
|
|
|
+ //if (PartnersData.Instance.UsePlanId == _planId)
|
|
|
+ //{
|
|
|
+ EpigraphService.Instance.RequestEpiInset(info.PartnerId, 0);
|
|
|
+ //}
|
|
|
+ //else
|
|
|
+ //{
|
|
|
+ // if (!PartnersData.Instance.TryGetPlan(_planId, out var plan))
|
|
|
+ // {
|
|
|
+ // Context.ShowTips(StringDefine.PartnerPlanEmptyTips);
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ // var caoId = -1;
|
|
|
+ // var sbId = 0;
|
|
|
+ // foreach (var slot in plan.Slots)
|
|
|
+ // {
|
|
|
+ // if (slot.MwId == _mwId)
|
|
|
+ // {
|
|
|
+ // caoId = slot.CaoId;
|
|
|
+ // sbId = slot.SbId;
|
|
|
+ // break;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // if (sbId == 0 || caoId < 0)
|
|
|
+ // {
|
|
|
+ // Context.ShowTips(StringDefine.EpigraphNotInPlanTips);
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ // PartnersService.Instance.RequestUpdatePlanMw(_planId, caoId, sbId, 0);
|
|
|
+ //}
|
|
|
Context.ClosePanel();
|
|
|
}
|
|
|
|
|
|
private void OnClickUpBtn(EventContext context)
|
|
|
{
|
|
|
- if (_planId == PartnersData.Instance.UsePlanId)
|
|
|
+ //if (_planId == PartnersData.Instance.UsePlanId)
|
|
|
+ //{
|
|
|
+ if (!EpigraphData.Instance.TryGetEpigraphAttrByTableId(_mwId, out var attr))
|
|
|
{
|
|
|
- if (!EpigraphData.Instance.TryGetEpigraphAttrByTableId(_mwId, out var attr))
|
|
|
- {
|
|
|
- Context.ShowTips(StringDefine.EpigraphEmptyTips);
|
|
|
- return;
|
|
|
- }
|
|
|
- if (attr.PartnerId > 0)
|
|
|
- {
|
|
|
- Context.ShowTips(StringDefine.EpigraphAlreadyUpTips);
|
|
|
- return;
|
|
|
- }
|
|
|
- if (_partnerId > 0)
|
|
|
- {
|
|
|
- if (
|
|
|
- !PartnersData.Instance.TryGetPartnerAttrByTableId(
|
|
|
- _partnerId,
|
|
|
- out var partnerAttr
|
|
|
- )
|
|
|
- )
|
|
|
- {
|
|
|
- Context.ShowTips(StringDefine.PartnerEmptyTips);
|
|
|
- return;
|
|
|
- }
|
|
|
- EpigraphService.Instance.RequestEpiInset(_partnerId, _mwId);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- EpigraphService.Instance.OpenUpMode(_mwId);
|
|
|
- }
|
|
|
+ Context.ShowTips(StringDefine.EpigraphEmptyTips);
|
|
|
+ return;
|
|
|
}
|
|
|
- else
|
|
|
+ if (attr.PartnerId > 0)
|
|
|
{
|
|
|
- if (!PartnersData.Instance.TryGetPlan(_planId, out var plan))
|
|
|
- {
|
|
|
- Context.ShowTips(StringDefine.PartnerPlanEmptyTips);
|
|
|
- return;
|
|
|
- }
|
|
|
- PartnerPlanSlot curSlot = null;
|
|
|
- foreach (var slot in plan.Slots)
|
|
|
- {
|
|
|
- if (slot.MwId == _mwId)
|
|
|
- {
|
|
|
- curSlot = slot;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- if (curSlot != null)
|
|
|
- {
|
|
|
- Context.ShowTips(StringDefine.EpigraphAlreadyUpTips);
|
|
|
- return;
|
|
|
- }
|
|
|
- var targetSlot = PartnersData.Instance.GetPlanSlot(_planId, _slotId);
|
|
|
- if (targetSlot == null || targetSlot.SbId == 0)
|
|
|
- {
|
|
|
- Context.ShowTips(StringDefine.PartnerCurSlotNoSbTips);
|
|
|
- return;
|
|
|
- }
|
|
|
- PartnersService.Instance.RequestUpdatePlanMw(
|
|
|
- _planId,
|
|
|
- _slotId,
|
|
|
- targetSlot.SbId,
|
|
|
- _mwId
|
|
|
- );
|
|
|
+ Context.ShowTips(StringDefine.EpigraphAlreadyUpTips);
|
|
|
+ return;
|
|
|
}
|
|
|
+ //if (_partnerId > 0)
|
|
|
+ //{
|
|
|
+ // if (
|
|
|
+ // !PartnersData.Instance.TryGetPartnerAttrByTableId(
|
|
|
+ // _partnerId,
|
|
|
+ // out var partnerAttr
|
|
|
+ // )
|
|
|
+ // )
|
|
|
+ // {
|
|
|
+ // Context.ShowTips(StringDefine.PartnerEmptyTips);
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ // EpigraphService.Instance.RequestEpiInset(_partnerId, _mwId);
|
|
|
+ //}
|
|
|
+ //else
|
|
|
+ //{
|
|
|
+ EpigraphService.Instance.OpenUpMode(_mwId);
|
|
|
+ //}
|
|
|
+ //}
|
|
|
+ //else
|
|
|
+ //{
|
|
|
+ // if (!PartnersData.Instance.TryGetPlan(_planId, out var plan))
|
|
|
+ // {
|
|
|
+ // Context.ShowTips(StringDefine.PartnerPlanEmptyTips);
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ // PartnerPlanSlot curSlot = null;
|
|
|
+ // foreach (var slot in plan.Slots)
|
|
|
+ // {
|
|
|
+ // if (slot.MwId == _mwId)
|
|
|
+ // {
|
|
|
+ // curSlot = slot;
|
|
|
+ // break;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // if (curSlot != null)
|
|
|
+ // {
|
|
|
+ // Context.ShowTips(StringDefine.EpigraphAlreadyUpTips);
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ // var targetSlot = PartnersData.Instance.GetPlanSlot(_planId, _slotId);
|
|
|
+ // if (targetSlot == null || targetSlot.SbId == 0)
|
|
|
+ // {
|
|
|
+ // Context.ShowTips(StringDefine.PartnerCurSlotNoSbTips);
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ // PartnersService.Instance.RequestUpdatePlanMw(
|
|
|
+ // _planId,
|
|
|
+ // _slotId,
|
|
|
+ // targetSlot.SbId,
|
|
|
+ // _mwId
|
|
|
+ // );
|
|
|
+ //}
|
|
|
Context.ClosePanel();
|
|
|
}
|
|
|
|
|
@@ -238,33 +225,33 @@ namespace FL.FGUI
|
|
|
|
|
|
private void ShowUpDownBtn()
|
|
|
{
|
|
|
- if (_planId == PartnersData.Instance.UsePlanId)
|
|
|
+ //if (_planId == PartnersData.Instance.UsePlanId)
|
|
|
+ //{
|
|
|
+ if (!EpigraphData.Instance.TryGetEpigraphAttrByTableId(_mwId, out var epi))
|
|
|
{
|
|
|
- if (!EpigraphData.Instance.TryGetEpigraphAttrByTableId(_mwId, out var epi))
|
|
|
- {
|
|
|
- Log.Error($"铭文数据不存在,id:{_mwId}");
|
|
|
- return;
|
|
|
- }
|
|
|
- VM.Up.selectedIndex = epi.PartnerId > 0 ? 1 : 0;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- if (!PartnersData.Instance.TryGetPlan(_planId, out var plan))
|
|
|
- {
|
|
|
- Log.Error($"方案信息不存在,planId:{_planId}");
|
|
|
- return;
|
|
|
- }
|
|
|
- var isFind = false;
|
|
|
- foreach (var slot in plan.Slots)
|
|
|
- {
|
|
|
- if (slot.MwId == _mwId)
|
|
|
- {
|
|
|
- isFind = true;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- VM.Up.selectedIndex = isFind ? 1 : 0;
|
|
|
+ Log.Error($"铭文数据不存在,id:{_mwId}");
|
|
|
+ return;
|
|
|
}
|
|
|
+ VM.Up.selectedIndex = epi.PartnerId > 0 ? 1 : 0;
|
|
|
+ //}
|
|
|
+ //else
|
|
|
+ //{
|
|
|
+ // if (!PartnersData.Instance.TryGetPlan(_planId, out var plan))
|
|
|
+ // {
|
|
|
+ // Log.Error($"方案信息不存在,planId:{_planId}");
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ // var isFind = false;
|
|
|
+ // foreach (var slot in plan.Slots)
|
|
|
+ // {
|
|
|
+ // if (slot.MwId == _mwId)
|
|
|
+ // {
|
|
|
+ // isFind = true;
|
|
|
+ // break;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // VM.Up.selectedIndex = isFind ? 1 : 0;
|
|
|
+ //}
|
|
|
}
|
|
|
|
|
|
private void UpDescInfo()
|