687 lines
23 KiB
C#
687 lines
23 KiB
C#
using Adam;
|
|
using OfficeOpenXml.FormulaParsing.Excel.Functions.Text;
|
|
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using Unity.VisualScripting;
|
|
using UnityEditor.VersionControl;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class Controlpage : MonoBehaviour
|
|
{
|
|
/// <summary>
|
|
/// 页面一
|
|
/// </summary>
|
|
public GameObject pageimage1;
|
|
/// <summary>
|
|
/// 页面1按钮
|
|
/// </summary>
|
|
public Button LineBtn, skipbutton2, skipbutton3, skipbutton4;
|
|
/// <summary>
|
|
/// 页面2
|
|
/// </summary>
|
|
public GameObject pageimage2;
|
|
/// <summary>
|
|
/// 页面2按钮
|
|
/// </summary>
|
|
public Button skip2button1, skip2button2, skip2button3;
|
|
/// <summary>
|
|
/// 页面3
|
|
/// </summary>
|
|
public GameObject pageimage3;
|
|
/// <summary>
|
|
/// 页面3按钮
|
|
/// </summary>
|
|
public Button skip3button1, skip3button2, skip3button3, skip3button4;
|
|
/// <summary>
|
|
/// 页面4
|
|
/// </summary>
|
|
public GameObject pageimage4;
|
|
/// <summary>
|
|
/// 页面4按钮
|
|
/// </summary>
|
|
public Button skip4button1, skip4button2;
|
|
/// <summary>
|
|
/// 页面5
|
|
/// </summary>
|
|
public GameObject pageimage5;
|
|
/// <summary>
|
|
/// 页面5按钮
|
|
/// </summary>
|
|
public Button jump1button1, jump1button2;
|
|
/// <summary>
|
|
/// 页面6
|
|
/// </summary>
|
|
public GameObject pageimage6;
|
|
/// <summary>
|
|
/// 页面6按钮
|
|
/// </summary>
|
|
public Button jump2button1, jump2button2, jump2button3;
|
|
/// <summary>
|
|
/// 页面6输入框
|
|
/// </summary>
|
|
public InputField jumpinput;
|
|
/// <summary>
|
|
/// 页面7
|
|
/// </summary>
|
|
public GameObject pageimage7;
|
|
/// <summary>
|
|
/// 页面7按钮
|
|
/// </summary>
|
|
public Button jump3button1, jump3button2, jump3button3;
|
|
/// <summary>
|
|
/// 页面8
|
|
/// </summary>
|
|
public GameObject pageimage8;
|
|
/// <summary>
|
|
/// 页面8按钮
|
|
/// </summary>
|
|
public Button jump4button1, jump4button2, jump4button3;
|
|
/// <summary>
|
|
/// 页面3从Excel表读出信息初始化
|
|
/// </summary>
|
|
public PageInformation3 pageInformation3;
|
|
/// <summary>
|
|
/// 页面2从Excel表读出的信息初始化
|
|
/// </summary>
|
|
public Workorderlink workorderlink;
|
|
/// <summary>
|
|
/// 页面7基本信息信息初始发
|
|
/// </summary>
|
|
public Basicinformation basicinformation;
|
|
/// <summary>
|
|
/// 页面八基本信息初始化
|
|
/// </summary>
|
|
public Userinformation userinformation;
|
|
/// <summary>
|
|
/// 生成的位置
|
|
/// </summary>
|
|
public Transform Contentpos;
|
|
/// <summary>
|
|
/// 需要生成的预制体
|
|
/// </summary>
|
|
public CoustomInfoItem customInfoItems;
|
|
/// <summary>
|
|
/// 退出按钮
|
|
/// </summary>
|
|
public Button pageclosebutton;
|
|
/// <summary>
|
|
/// 主题类
|
|
/// </summary>
|
|
public MessageData messageData = new MessageData();
|
|
/// <summary>
|
|
/// 存入所有数据
|
|
/// </summary>
|
|
public Dictionary<string, string> datas = new Dictionary<string, string>();
|
|
private void Awake()
|
|
{
|
|
Init();
|
|
}
|
|
void Start()
|
|
{
|
|
Pagejump1();
|
|
Pagejump2();
|
|
Pagejump3();
|
|
Pagejump4();
|
|
Pagejump5();
|
|
Pagejump6();
|
|
Pagejump7();
|
|
Pagejump8();
|
|
Exitpage();
|
|
}
|
|
/// <summary>
|
|
/// 退出页面
|
|
/// </summary>
|
|
private void Exitpage()
|
|
{
|
|
pageclosebutton.onClick.AddListener(() =>
|
|
{
|
|
gameObject.SetActive(false);
|
|
});
|
|
}
|
|
|
|
/// <summary>
|
|
/// 初始化信息
|
|
/// </summary>
|
|
private void Init()
|
|
{
|
|
string str = FileUtil.ReadFromLocal("Message.json");
|
|
messageData = Newtonsoft.Json.JsonConvert.DeserializeObject<MessageData>(str);
|
|
for (int i = 0; i < messageData.userList.Count; i++)
|
|
{
|
|
datas.Add(messageData.userList[i].testpoint, messageData.userList[i].valuepoint);
|
|
Debug.Log(messageData.userList[i].testpoint+" "+messageData.userList[i].valuepoint);
|
|
}
|
|
Pagedisplay();//初始化页面1显示
|
|
}
|
|
private void Pagedisplay()
|
|
{
|
|
CoustomInfoItem coustomInfoItem = Instantiate(customInfoItems, Contentpos);
|
|
coustomInfoItem.Setodd(() =>
|
|
{
|
|
Getmessage();
|
|
pageimage1.SetActive(false);
|
|
pageimage3.SetActive(true);
|
|
});
|
|
foreach (KeyValuePair<string, string> item in datas)
|
|
{
|
|
switch (item.Key)
|
|
{
|
|
case "工单编号":
|
|
coustomInfoItem.oddtext.text = item.Value;
|
|
break;
|
|
case "用户编号/客户编号":
|
|
coustomInfoItem.birthinput1.text = item.Value;
|
|
break;
|
|
case "用户名称":
|
|
coustomInfoItem.nameinput1.text = item.Value;
|
|
break;
|
|
case "用户类型":
|
|
coustomInfoItem.typeinput1.text = item.Value;
|
|
break;
|
|
case "工单类型":
|
|
coustomInfoItem.workorderinput1.text = item.Value;
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
private void Pagejump8()
|
|
{
|
|
jump4button1.onClick.AddListener(() =>
|
|
{
|
|
pageimage8.SetActive(false);
|
|
pageimage5.SetActive(true);
|
|
});
|
|
jump4button2.onClick.AddListener(() =>
|
|
{
|
|
pageimage8.SetActive(false);
|
|
pageimage1.SetActive(true);
|
|
});
|
|
jump4button3.onClick.AddListener(() =>
|
|
{
|
|
pageimage8.SetActive(false);
|
|
pageimage7.SetActive(true);
|
|
});
|
|
}
|
|
|
|
private void Pagejump7()
|
|
{
|
|
jump3button1.onClick.AddListener(() =>
|
|
{
|
|
pageimage7.SetActive(false);
|
|
pageimage5.SetActive(true);
|
|
});
|
|
jump3button2.onClick.AddListener(() =>
|
|
{
|
|
pageimage7.SetActive(false);
|
|
pageimage1.SetActive(true);
|
|
});
|
|
jump3button3.onClick.AddListener(() =>
|
|
{
|
|
GetUserinit();
|
|
pageimage7.SetActive(false);
|
|
pageimage8.SetActive(true);
|
|
});
|
|
}
|
|
|
|
private void Pagejump6()
|
|
{
|
|
jump2button1.onClick.AddListener(() =>
|
|
{
|
|
pageimage6.SetActive(false);
|
|
pageimage5.SetActive(true);
|
|
});
|
|
jump2button2.onClick.AddListener(() =>
|
|
{
|
|
pageimage6.SetActive(false);
|
|
pageimage1.SetActive(true);
|
|
});
|
|
jump2button3.onClick.AddListener(() =>
|
|
{
|
|
Basicinit();
|
|
pageimage6.SetActive(false);
|
|
pageimage7.SetActive(true);
|
|
});
|
|
}
|
|
|
|
private void Pagejump5()
|
|
{
|
|
jump1button1.onClick.AddListener(() =>
|
|
{
|
|
Searchinput();
|
|
pageimage5.SetActive(false);
|
|
pageimage6.SetActive(true);
|
|
});
|
|
jump1button2.onClick.AddListener(() =>
|
|
{
|
|
pageimage5.SetActive(false);
|
|
pageimage1.SetActive(true);
|
|
});
|
|
}
|
|
|
|
private void Searchinput()
|
|
{
|
|
foreach (KeyValuePair<string, string> item in datas)
|
|
{
|
|
switch (item.Key)
|
|
{
|
|
case "用户编号/客户编号":
|
|
jumpinput.text = item.Value;
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
private void Pagejump4()
|
|
{
|
|
skip4button1.onClick.AddListener(() =>
|
|
{
|
|
pageimage4.SetActive(false);
|
|
|
|
});
|
|
skip4button2.onClick.AddListener(() =>
|
|
{
|
|
pageimage4.SetActive(false);
|
|
pageimage5.SetActive(true);
|
|
});
|
|
}
|
|
|
|
private void Pagejump3()
|
|
{
|
|
skip3button1.onClick.AddListener(() =>
|
|
{
|
|
pageimage3.SetActive(false);
|
|
pageimage1.SetActive(true);
|
|
});
|
|
skip3button2.onClick.AddListener(() =>
|
|
{
|
|
Getorderlink();
|
|
pageimage3.SetActive(false);
|
|
pageimage2.SetActive(true);
|
|
});
|
|
skip3button3.onClick.AddListener(() =>
|
|
{
|
|
pageimage4.SetActive(true);
|
|
});
|
|
skip3button4.onClick.AddListener(() =>
|
|
{
|
|
pageimage3.SetActive(false);
|
|
pageimage5.SetActive(true);
|
|
});
|
|
}
|
|
|
|
private void Pagejump2()
|
|
{
|
|
skip2button1.onClick.AddListener(() =>
|
|
{
|
|
pageimage2.SetActive(false);
|
|
pageimage1.SetActive(true);
|
|
});
|
|
skip2button2.onClick.AddListener(() =>
|
|
{
|
|
Getmessage();
|
|
pageimage2.SetActive(false);
|
|
pageimage3.SetActive(true);
|
|
});
|
|
skip2button3.onClick.AddListener(() =>
|
|
{
|
|
pageimage2.SetActive(false);
|
|
pageimage5.SetActive(true);
|
|
});
|
|
}
|
|
|
|
private void Pagejump1()
|
|
{
|
|
LineBtn.onClick.AddListener(() =>
|
|
{
|
|
Getorderlink();
|
|
pageimage1.SetActive(false);
|
|
pageimage2.SetActive(true);
|
|
});
|
|
skipbutton2.onClick.AddListener(() =>
|
|
{
|
|
Getmessage();
|
|
pageimage1.SetActive(false);
|
|
pageimage3.SetActive(true);
|
|
});
|
|
skipbutton3.onClick.AddListener(() =>
|
|
{
|
|
pageimage1.SetActive(false);
|
|
pageimage5.SetActive(true);
|
|
});
|
|
skipbutton4.onClick.AddListener(() =>
|
|
{
|
|
pageimage1.SetActive(false);
|
|
pageimage3.SetActive(true);
|
|
});
|
|
}
|
|
/// <summary>
|
|
/// 初始化第二个页面
|
|
/// </summary>
|
|
private void Getorderlink()
|
|
{
|
|
if (workorderlink.workorderlinkinputs[0].text.Length == 0)
|
|
{
|
|
foreach (KeyValuePair<string, string> item in datas)
|
|
{
|
|
switch (item.Key)
|
|
{
|
|
case "供电单位":
|
|
workorderlink.workorderlinkinputs[0].text = item.Value;
|
|
workorderlink.undertheinputs[2].text = item.Value;
|
|
break;
|
|
case "电能表资产编号":
|
|
workorderlink.workorderlinkinputs[1].text = item.Value;
|
|
workorderlink.undertheinputs[7].text = item.Value;
|
|
break;
|
|
case "模型名称":
|
|
workorderlink.workorderlinkinputs[2].text = item.Value;
|
|
break;
|
|
case "用户编号/客户编号":
|
|
workorderlink.workorderlinkinputs[3].text = item.Value;
|
|
workorderlink.undertheinputs[3].text = item.Value;
|
|
break;
|
|
case "台区编号":
|
|
workorderlink.workorderlinkinputs[4].text = item.Value;
|
|
workorderlink.undertheinputs[8].text = item.Value;
|
|
break;
|
|
case "历史是否违窃":
|
|
workorderlink.workorderlinkinputs[5].text = item.Value;
|
|
break;
|
|
case "用户名称":
|
|
workorderlink.workorderlinkinputs[6].text = item.Value;
|
|
workorderlink.undertheinputs[5].text = item.Value;
|
|
break;
|
|
case "台区名称":
|
|
workorderlink.workorderlinkinputs[7].text = item.Value;
|
|
workorderlink.undertheinputs[9].text = item.Value;
|
|
break;
|
|
case "窃电嫌疑度":
|
|
workorderlink.workorderlinkinputs[8].text = item.Value;
|
|
break;
|
|
case "用户类型":
|
|
workorderlink.workorderlinkinputs[9].text = item.Value;
|
|
workorderlink.undertheinputs[6].text = item.Value;
|
|
break;
|
|
case "所属市公司":
|
|
workorderlink.undertheinputs[0].text = item.Value;
|
|
break;
|
|
case "所属区县公司":
|
|
workorderlink.undertheinputs[1].text = item.Value;
|
|
break;
|
|
case "合同容量/运行容量":
|
|
workorderlink.undertheinputs[4].text = item.Value;
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 初始化第三个页面内容
|
|
/// </summary>
|
|
private void Getmessage()
|
|
{
|
|
if (pageInformation3.inputmessages[0].text.Length == 0)
|
|
{
|
|
foreach (KeyValuePair<string, string> item in datas)
|
|
{
|
|
switch (item.Key)
|
|
{
|
|
case "工单编号":
|
|
pageInformation3.inputmessages[0].text = item.Value;
|
|
break;
|
|
case "供电单位":
|
|
pageInformation3.inputmessages[1].text = item.Value;
|
|
break;
|
|
case "用电类型/用电类别":
|
|
pageInformation3.inputmessages[2].text = item.Value;
|
|
break;
|
|
case "电能表资产编号":
|
|
pageInformation3.inputmessages[3].text = item.Value;
|
|
break;
|
|
case "工单状态":
|
|
pageInformation3.inputmessages[4].text = item.Value;
|
|
break;
|
|
case "工单类型":
|
|
pageInformation3.inputmessages[5].text = item.Value;
|
|
break;
|
|
case "台区编号":
|
|
pageInformation3.inputmessages[6].text = item.Value;
|
|
break;
|
|
case "用户编号/客户编号":
|
|
pageInformation3.inputmessages[7].text = item.Value;
|
|
break;
|
|
case "用户地址/用电地址":
|
|
pageInformation3.inputmessages[8].text = item.Value;
|
|
break;
|
|
case "防窃电改造状态":
|
|
pageInformation3.inputmessages[9].text = item.Value;
|
|
break;
|
|
case "工单来源":
|
|
pageInformation3.inputmessages[10].text = item.Value;
|
|
break;
|
|
case "台区名称":
|
|
pageInformation3.inputmessages[11].text = item.Value;
|
|
break;
|
|
case "用户名称":
|
|
pageInformation3.inputmessages[12].text = item.Value;
|
|
break;
|
|
case "重要等级":
|
|
pageInformation3.inputmessages[13].text = item.Value;
|
|
break;
|
|
case "下一环节处理人":
|
|
pageInformation3.inputmessages[14].text = item.Value;
|
|
break;
|
|
case "环节名称":
|
|
pageInformation3.skiptext.text = item.Value;
|
|
break;
|
|
case "开始时间":
|
|
pageInformation3.initiateinput.text = item.Value;
|
|
break;
|
|
case "结束时间":
|
|
pageInformation3.finishinput.text = item.Value;
|
|
break;
|
|
case "状态":
|
|
pageInformation3.statusinput.text = item.Value;
|
|
break;
|
|
case "处理人":
|
|
pageInformation3.processorinput.text = item.Value;
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 页面7基本信息初始化页面
|
|
/// </summary>
|
|
public void Basicinit()
|
|
{
|
|
if (basicinformation.basicioitinputs[0].text.Length == 0)
|
|
{
|
|
foreach (KeyValuePair<string, string> item in datas)
|
|
{
|
|
switch (item.Key)
|
|
{
|
|
case "用户编号/客户编号":
|
|
basicinformation.basicioitinputs[1].text = item.Value;
|
|
basicinformation.basicioitinputs[5].text = item.Value;
|
|
break;
|
|
case "证件号码":
|
|
basicinformation.basicioitinputs[2].text = item.Value;
|
|
break;
|
|
case "联系方式":
|
|
basicinformation.basicioitinputs[3].text = item.Value;
|
|
basicinformation.basicioitinputs[12].text = item.Value;
|
|
break;
|
|
case "用户名称":
|
|
basicinformation.basicioitinputs[0].text = item.Value;
|
|
basicinformation.basicioitinputs[4].text = item.Value;
|
|
break;
|
|
case "用电类型/用电类别":
|
|
basicinformation.basicioitinputs[6].text = item.Value;
|
|
break;
|
|
case "行业分类":
|
|
basicinformation.basicioitinputs[7].text = item.Value;
|
|
break;
|
|
case "供电单位":
|
|
basicinformation.basicioitinputs[8].text = item.Value;
|
|
break;
|
|
case "供电电压":
|
|
basicinformation.basicioitinputs[9].text = item.Value;
|
|
break;
|
|
case "用户状态":
|
|
basicinformation.basicioitinputs[10].text = item.Value;
|
|
break;
|
|
case "用户地址/用电地址":
|
|
basicinformation.basicioitinputs[11].text = item.Value;
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 页面八用户信息初始化
|
|
/// </summary>
|
|
public void GetUserinit()
|
|
{
|
|
if (userinformation.userinitinputs[0].text.Length == 0)
|
|
{
|
|
foreach (KeyValuePair<string, string> item in datas)
|
|
{
|
|
switch (item.Key)
|
|
{
|
|
case "用户编号/客户编号":
|
|
userinformation.userinitinputs[0].text = item.Value;
|
|
userinformation.userinitinputs[1].text = item.Value;
|
|
break;
|
|
case "用户名称":
|
|
userinformation.userinitinputs[2].text = item.Value;
|
|
break;
|
|
case "用户分类":
|
|
userinformation.userinitinputs[3].text = item.Value;
|
|
break;
|
|
case "用电类型/用电类别":
|
|
userinformation.userinitinputs[4].text = item.Value;
|
|
break;
|
|
case "信誉等级":
|
|
userinformation.userinitinputs[5].text = item.Value;
|
|
break;
|
|
case "供电单位":
|
|
userinformation.userinitinputs[6].text = item.Value;
|
|
break;
|
|
case "用户地址/用电地址":
|
|
userinformation.userinitinputs[7].text = item.Value;
|
|
break;
|
|
case "所属供电所":
|
|
userinformation.userinitinputs[8].text = item.Value;
|
|
break;
|
|
case "所属区县公司":
|
|
userinformation.userinitinputs[9].text = item.Value;
|
|
break;
|
|
case "所属市公司":
|
|
userinformation.userinitinputs[10].text = item.Value;
|
|
break;
|
|
case "行业分类":
|
|
userinformation.userinitinputs[11].text = item.Value;
|
|
break;
|
|
case "停电标志":
|
|
userinformation.userinitinputs[12].text = item.Value;
|
|
break;
|
|
case "市场化属性分类":
|
|
userinformation.userinitinputs[13].text = item.Value;
|
|
break;
|
|
case "负荷特性":
|
|
userinformation.userinitinputs[14].text = item.Value;
|
|
break;
|
|
case "城乡类别":
|
|
userinformation.userinitinputs[15].text = item.Value;
|
|
break;
|
|
case "重要性等级":
|
|
userinformation.userinitinputs[16].text = item.Value;
|
|
break;
|
|
case "合同容量/运行容量":
|
|
userinformation.userinitinputs[17].text = item.Value;
|
|
userinformation.userinitinputs[18].text = item.Value;
|
|
break;
|
|
case "交费方式":
|
|
userinformation.userinitinputs[19].text = item.Value;
|
|
break;
|
|
case "用户状态":
|
|
userinformation.userinitinputs[20].text = item.Value;
|
|
break;
|
|
case "立户日期":
|
|
userinformation.userinitinputs[21].text = item.Value;
|
|
break;
|
|
case "销户日期":
|
|
userinformation.userinitinputs[22].text = item.Value;
|
|
break;
|
|
case "负荷性质":
|
|
userinformation.userinitinputs[23].text = item.Value;
|
|
break;
|
|
case "保安负荷容量":
|
|
userinformation.userinitinputs[24].text = item.Value;
|
|
break;
|
|
case "高耗能行业类别":
|
|
userinformation.userinitinputs[25].text = item.Value;
|
|
break;
|
|
case "转供标志":
|
|
userinformation.userinitinputs[26].text = item.Value;
|
|
break;
|
|
case "临时用电标志":
|
|
userinformation.userinitinputs[27].text = item.Value;
|
|
break;
|
|
case "费控标志":
|
|
userinformation.userinitinputs[28].text = item.Value;
|
|
break;
|
|
case "抄表包编号":
|
|
userinformation.userinitinputs[29].text = item.Value;
|
|
break;
|
|
case "核算包编号":
|
|
userinformation.userinitinputs[30].text = item.Value;
|
|
break;
|
|
case "催费包编号":
|
|
userinformation.userinitinputs[31].text = item.Value;
|
|
break;
|
|
case "分次结算标志":
|
|
userinformation.userinitinputs[32].text = item.Value;
|
|
break;
|
|
case "合同账户默认户号标志":
|
|
userinformation.userinitinputs[33].text = item.Value;
|
|
break;
|
|
case "供电电压":
|
|
userinformation.userinitinputs[34].text = item.Value;
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
void Update()
|
|
{
|
|
if (jumpinput.text.Length > 0)
|
|
{
|
|
if (Input.GetKeyDown(KeyCode.Return))
|
|
{
|
|
Basicinit();
|
|
pageimage6.SetActive(false);
|
|
pageimage7.SetActive(true);
|
|
}
|
|
}
|
|
}
|
|
}
|