Merge branch 'dev_xq_0.0.1' of http://web.ronyao.com:3000/xq/maotu-webtopo into dev_xq_0.0.1

dev_xq_0.0.1
谢庆 6 days ago
commit a63f3074c2

@ -9,6 +9,9 @@ interface RecIn{
STR: {
EnumType: [number, string][]
},
YX: {
EnumType: [number, string][]
},
UserPage:[string, string][]
},
EnumTypeVal: [number, string][][],
@ -33,7 +36,17 @@ Rec.Node.InTypeIn = [
[1, '遥信'],
[2, '遥测']
];
const getIndex=(num:number)=>{
switch (num)
{
case 1 :
return 100
case 2 :
return 0
default:
return -1
}
}
// 四遥基本类型
Rec.Node.TypeBase = [
[1, '遥信'],
@ -54,19 +67,37 @@ Rec.CONST.STR.EnumType = [
[14, '国网空调模式'],
[21, 'KTC空调']
];
Rec.CONST.YX.EnumType=[
[0, '颜色'],
[1, '文字'],
[2, '颜色+文字'],
]
Rec.EnumTypeVal = []; // 定值类型,用于编辑时的选择
Rec.EnumTypeValFun = []; // 转换函数,用于显示与控制
Rec.EnumTypeVal[100] = [
[0, '绿色'],
[1, '黄色'],
[2, '红色'],
];
Rec.EnumTypeVal[101] = [
[0, '开启'],
[1, '关闭'],
[2, ''],
];
// 缺省
Rec.EnumTypeVal[0] = [
[0, '关闭'],
[1, '开启']
];
Rec.EnumTypeValFun[0] = function (val:any) {
return Rec.trans!(val, Rec.EnumTypeVal![0])
Rec.EnumTypeValFun[0] = function (val:any,index:number) {
return Rec.trans!(val, Rec.EnumTypeVal![index+0])
}
//Rec.EnumTypeValFun[0](val,getIndex(btype));
// 遥控
Rec.EnumTypeVal[1] = [
@ -74,14 +105,14 @@ Rec.EnumTypeVal[1] = [
[1, '开启']
];
Rec.EnumTypeValFun[1] = function (val:any) {
return Rec.trans!(val, Rec.EnumTypeVal![1])
Rec.EnumTypeValFun[1] = function (val:any,index:number) {
return Rec.trans!(val, Rec.EnumTypeVal![index+1])
}
// 数值
Rec.EnumTypeVal[2] = [];
Rec.EnumTypeValFun[2] = function (val:any) {
return [];
Rec.EnumTypeValFun[2] = function (val:any,index:number) {
return Rec.trans!(val, Rec.EnumTypeVal![index+2]);
}
// timestamp 转换成时间
@ -161,7 +192,8 @@ Rec.EnumTypeVal[21] = [
Rec.EnumTypeValFun[21] = function (val:any) {
return Rec.trans!(val, Rec.EnumTypeVal![21])
}
//
Rec.EnumTypeValFun[21]()
// 用户的缺省界面
Rec.CONST.UserPage = [
['Admin', 'Admin'],

Loading…
Cancel
Save