页面树结构

版本比较

标识

  • 该行被添加。
  • 该行被删除。
  • 格式已经改变。

...


控件名称主要配置项说明内部函数支持脚本示例说明
1步骤条


1args.stepList              // 步骤条全部数据
2args.inactStepIcon    //  默认图标
3args.actStepIcon      //  激活图标
4args.actStepColor    //  激活颜色



1setDisplayType()
2getFormName()
3getValue()
4setValue()
5setTimeIndex(ind)      //  @params ind: type Number  适用于未绑定任何属性自定义步骤条内容 脚本指定激活位置



ID主要配置项说明内部函数支持
1

var step = this.getAddinById("Steps1");

console.log("步骤条全部数据:",step.args.stepList);

var steps1= "visit"

var steps1= this.getAddinById("Steps1");
steps1.setDisplayType(type);

2

var step = this.getAddinById("Steps1");

console.log("默认图标:",step.args.inactStepIcon);

var steps1 = this.getAddinById("Steps1");

console.log("步骤条getFormName:",steps1.getFormName());
3

var step = this.getAddinById("Steps1");

console.log("激活图标:",step.args.actStepIcon);

var steps1  = this.getAddinById("Steps1");
steps1 .setValue("交易完成")
4

var step = this.getAddinById("Steps1");

step.args.actStepColor='#F5ED04'
console.log("激活颜色:",step.args.actStepColor);


var steps1 = this.getAddinById("Steps1");
steps1 .getValue()
5

var step = this.getAddinById("Steps1");

step.setTimeIndex(2);


步骤条结合卡片样例样例配置展示

//获取当前选中的步骤


var Steps1 = this.getAddinById("Steps1");
if(!Steps1){
    this.msgbox.warning("卡片表单异常!");
    return;
}
console.log(Steps1.getValue())
console.log("当前选中的步骤:" + Steps1.actIndex);
var vnum =Steps1.actIndex

//设置当前进行到第几步

this.getAddinById('Steps1').args.actStepIndex = vnum;

// 获取卡片
var card = this.getAddinById('FormEngine1')

let query ="";

if(vnum==0){
     query = "and obj.woStatus= '维修中'"//查询条件
}

if(vnum==1){
     query = "and obj.woStatus= '保养中'"//查询条件
}

if(vnum==2){
     query = "and obj.woStatus= '已完成'"//查询条件
}
card.freshData(query);





2搜索框


1setValue
2getValue



ID内部函数支持
1debugger;
var select = this.getAddinById('SearchCell1');
select.setValue('上海市');
var custid= select.getValue();
console.log('打印custid', custid);
2debugger;
let mySelect = this.getAddinById('SearchCell1');
let result = mySelect.getValue();
console.log('打印value', result);
this.msgbox.success(result);


3通知栏


1args.scrollable 单条消息展示的时候,是否横向滚动
2args.wrapable 关闭横向滚动的时候,可以选择换行展示消息



1setValue
2getValue



ID内部函数支持主要配置项说明
1

debugger;
var select = this.getAddinById('NoticeBar1');
select.setValue('上海市');
var custid= select.getValue();
console.log('打印custid', custid);

debugger;
var select = this.getAddinById('NoticeBar1');
select.args.scrollable = false;
console.log('Cell1',select);

2

debugger;
let mySelect = this.getAddinById('NoticeBar1');
let result = mySelect.getValue();
console.log('打印value', result);
this.msgbox.success(result);

var select1 = this.getAddinById('NoticeBar1');
select1.args.wrapable = true;
console.log('Cell11',select1);


4卡片



1getParentAddin
2updateShow
3getSelected
4getAll
5setDisplayType
6freshData
7getAddinById
8getRootAddin
9freshObj(res)



ID内部函数支持
1

//卡片之间值传递

var FormEngine1 = this.getAddinById('FormEngine1');//获取卡片1控件id
var FormEngine2 = this.getAddinById('FormEngine2');//获取卡片2控件id
var TextInFormEngine = FormEngine1.getAddinById('TextInput1')//获取卡片1控件中的标签
TextInFormEngine.setValue("3")//为文本框1赋值为1

var FE1 = TextInFormEngine.getParentAddin();//获取文本框1的父控件,也就是卡片1
if(FE1){
var Form = FE1.getParentAddin();//卡片1的父控件,也就是当前表单

if(Form){
var FE2 = Form.getAddinById('FormEngine2');//获取当前表单的卡片2
if(FE2){
var TextInput1FormEngine2 = FE2.getAddinById('TextInput2');//卡片2的文本框
if(TextInput1FormEngine2TextInput1FormEngine2.setValue("1")//给卡片2的文本框赋值
}
}
}
2

var subFormAddin = this.getRootAddin();
if(subFormAddin){
    console.log("subFormAddin",subFormAddin.path)
var label =this.getAddinById("Label1")
label.setValue(subFormAddin.path);
}else{
   
label.setValue('getRootAddin 获取失败');
}

3

//关联类修改

var newObj= {relation_leftOid: '879962768002804A9037B7A3CC790800',
relation_company1:'关联companyd编辑',
relation_oid: "5515480EED5E784E9EE70ED57072272B",
relation_rightOid: "EF51E926F5BBB74E92CDE225FF3C4E9F"

};
this.edit(newObj, 'recuite_reliton', {isRelation: true}).then(res => {
this.getSourceAddin().getParentAddin().freshObj(res)
});
4

var FormEngine1 = this.getAddinById("FormEngine4");
var FormEngine = FormEngine1.getSelected()
console.log("卡片getSelected:",FormEngine);
console.log("卡片getAll:",FormEngine1.getAll());
this.msgbox.success(FormEngine[0].left_companyd)

5

debugger;
var select1 = this.getAddinById('FormEngine4');
let query = select1.args.rootQuery = `and obj.relation_company1='验收UI组'`;
select1.freshData(query);
console.log('Cell11',select1);

6

var form = this.GetAddinById("FormEngine3");
form.setDisplayType("visit");
form.updateShow("recuite_reliton","FormEngine2_input");


5表格


1setRowData
2getRowData
3deleteRowData
4updateRowData
5getDefaultColumnDef
6getAll
7getPageInfo
8getSelected
9setPageInfo
10setDisplayType
11freshData



ID内部函数支持
1

debugger;
var grdiAddin = this.GetAddinById("Table1");
let that = this;
this.dwf_axios.post(`/omf/relations/recuite_reliton/objects`,{}).then(response => {
    let res = response.data;
    if(res.data) temObj = res.data
    console.log(temObj);
    var rowData = [
        {relation_company1: temObj[1].name,oid:temObj[2].oid},
        {relation_company1: '开心',oid:'A366E8AEAAED7C41BA30F0D7F75F41D4'},
        {relation_company1: '尾灯'},
        {relation_company1: '示廊灯'},
];
grdiAddin.updateRowData(temObj[1].oid, {relation_company1: '碧海桑田'});    
console.log("表格updateRowData:",rowData)
})

2

debugger;
var grdiAddin = this.GetAddinById("Table1");
var rowData = [
        {relation_company1: '右前门门框'},
        {relation_company1: '开心'},
        {relation_company1: '尾灯'},
        {relation_company1: '示廊灯'},
];
//添加表格数据
var success = grdiAddin.getRowData(rowData);
console.log("表格getRowData:",success);
this.msgbox.success(success[0].relation_company1)

3

debugger;
var grid = this.GetAddinById("Table1");
var selectedPart = grid.getSelected()

getAll = grid.getAll();
console.log("表格getAll:",getAll)
this.msgbox.success("getSelected:"+selectedPart[0].relation_company1);
4

debugger;
var Table1 = this.GetAddinById("Table1");
var Label1 = this.getAddinById("Label1");
Table1.setDisplayType("edit");
Label1.setValue("表格"+Table1.t_edit);
this.msgbox.success("表格"+Table1.t_edit)
console.log("表格setDisplayType:"+Table1.t_edit)
let query = `and obj.relation_company1 = '验收机电组'`;
Table1.freshData(query);

5

debugger;
var grdiAddin = this.GetAddinById("Table1");
var rowData = [
        {relation_company1: '右前门门框'},
        {relation_company1: '开心'},
        {relation_company1: '尾灯'},
        {relation_company1: '示廊灯'},
];
//设置表格数据
grdiAddin.setRowData(rowData);
console.log("表格setRowData:",rowData)

6

debugger;
var grdiAddin = this.GetAddinById("Table1");
var rowData = [
        {relation_company1: '右前门门框',oid:'1CF18C71E8B6E94AB37D1EC3451AA31D'},
        {relation_company1: '开心',oid:'1CF18C71E8B6E94AB37D1EC3451AA31D'},
        {relation_company1: '尾灯'},
        {relation_company1: '示廊灯'},
];
//删除表格数据(参数对应行)
grdiAddin.deleteRowData('1CF18C71E8B6E94AB37D1EC3451AA31D');
console.log("表格deleteRowData:",rowData)


6时间轴


1args.stepList             // 步骤条全部数据
2args.stepTitle                // 标题
3args.stepNote       // 描述   Type:String
4args.stepTitle         // 标题    Type:Array
5args.inactStepIcon    //  默认图标
6args.actStepIcon      //  激活图标
7args.actStepColor    //  激活颜色
8args.actStepIndex    //  激活位置



1setDisplayType()
2getFormName()
3setTimeIndex(ind)      //  @params ind: type Number  脚本指定激活位置
4freshData()




主要配置项说明内部函数支持
1

var timeSteps = this.getAddinById("TimeSteps1");
console.log("步骤条全部数据",timeSteps.args.stepList);

var type = "visit"

var timeSteps1 = this.getAddinById("TimeSteps1");
timeSteps1.setDisplayType(type);

2var timeSteps = this.getAddinById("TimeSteps1");
console.log("标题",timeSteps.args.stepTitle);

var timeSteps1 = this.getAddinById("TimeSteps1");

console.log("时间轴getFormName:",timeSteps1.getFormName());

3var timeSteps = this.getAddinById("TimeSteps1");
console.log("描述 ",timeSteps.args.stepNote);
var timeSteps = this.getAddinById("TimeSteps1");

timeSteps.setTimeIndex(1)   ;

console.log(" 激活位置",timeSteps.args.actStepIndex); 
4var timeSteps = this.getAddinById("TimeSteps1");
console.log("标题",timeSteps.args.stepTitle);

var timeSteps =  this.getAddinById("TimeSteps1");
timeSteps.freshData()

5var timeSteps = this.getAddinById("TimeSteps1");

console.log("默认图标",timeSteps.args.inactStepIcon);


6var timeSteps = this.getAddinById("TimeSteps1");

console.log("激活图标",timeSteps.args.actStepIcon);


7var timeSteps = this.getAddinById("TimeSteps1");
timeSteps.args.actStepColor='#F5ED04';
console.log("激活颜色",timeSteps.args.actStepColor);

8var timeSteps = this.getAddinById("TimeSteps1");

timeSteps.args.actStepIndex=2;

console.log(" 激活位置",timeSteps.args.actStepIndex); 


7下拉菜单


1args.menuList       // 下拉菜单全部数据
2args.actMenuColor    //  选中颜色
3args.menuDirection   //  菜单方向
4menuValue      //  当前选中菜单项名称



1setDisplayType()
2getFormName()



ID主要配置项说明内部函数支持
1

var dropDownMenu = this.getAddinById("DropDownMenu1");
console.log(dropDownMenu.args.menuList);

var type = "visit"

var dropDownMenu1= this.getAddinById("DropDownMenu1");
dropDownMenu1.setDisplayType(type);

2

var dropDownMenu = this.getAddinById("DropDownMenu1");

dropDownMenu.args.actMenuColor="#F5ED04"

var dropDownMenu1 = this.getAddinById("DropDownMenu1");
dropDownMenu1.setDisplayType(type);

3

var dropDownMenu = this.getAddinById("DropDownMenu1");

dropDownMenu.args.menuDirection="up"


4

var dropDownMenu = this.getAddinById("DropDownMenu1");

console.log("当前选中菜单项名称:",dropDownMenu.menuValue);



8商品卡片

args.cardList                 // 商品卡片全部数据

args.bindTargetClass   // 目标类

args.titleAttr                  // 商品标题

args.discribeAttr           // 商品描述

args.imgAttr                  // 商品图片

args.priceAttr                // 商品价格

args.numAttr                 // 商品数量

args.tagAttr                  // 商品标签

args.extagAttr              // 商品标识


setDisplayType()

getFormName()

getSelected()

freshData()

getAll() 

 // 0409的下个release版本支持


ID内部函数支持配置项说明
1

varCard1 = this.getAddinById("Card1");

Card1.setDisplayType("visit")

varCard1 = this.getAddinById("Card1");

console.log(Card1.args.cardList);

console.log(Card1.args.bindTargetClass);

console.log(Card1.args.titleAttr);

console.log(Card1.args.discribeAttr);

console.log(Card1.args.imgAttr );

console.log(Card1.args.priceAttr);

console.log(Card1.args.numAttr);

console.log(Card1.args.tagAttr);

console.log(Card1.args.extagAttr);

2

varCard1 = this.getAddinById("Card1");
console.log("商品卡片 "+Card1.getFormName());

varCard1 = this.getAddinById("Card5");

console.log(Card1.args.cardList);
Card1.args.bindTargetClass="relationClass";
console.log(Card1.args.bindTargetClass);
Card1.args.titleAttr='relation_rTitle';
console.log(Card1.args.titleAttr);
Card1.args.imgAttr='relation_rphoto'
console.log(Card1.args.imgAttr);
console.log(Card1.args.discribeAttr);
Card1.args.priceAttr='relation_rprice';
console.log(Card1.args.priceAttr);
Card1.args.numAttr='relation_rNum';
console.log(Card1.args.numAttr);
Card1.args.tagAttr='relation_biqoqian';
console.log(Card1.args.tagAttr);
Card1.args.extagAttr='relation_oid';
console.log(Card1.args.extagAttr);
Card1.freshData();
3

varCard1 = this.getAddinById("Card1");

var selectObjs=Card1.getSelected();
console.log("商品卡片 "+

Card1

selectObjs[0]);

//弹窗前处理脚本

var cards =this.getAddinById("Card4");
var selectData=cards.getSelected(

)

);
return{
obj:selectData[0]
}




4varCard1 = this.getAddinById("Card1");
console.log("商品卡片 "+Card1.getAll());


9轮播

args.swipeList                 // 轮播全部数据

args.autoPlayTimer        // 轮播间隔

args.needLoop               // 循环播放


setDisplayType()

getFormName()

swipePrev()           

// 切换到上一张轮播

swipeNext()         

 // 切换到下一张轮播

swipeToIndex(num)     

 // 切换到指定位置轮播     @params num  type: Number


ID内部函数支持配置项说明
1

varSwipe1 = this.getAddinById("Swipe1");
console.log("轮播 "+Swipe1.getFormName());
console.log("轮播 "+Swipe1.setDisplayType("visit"));

let mySwipe = this.getAddinById('Swipe1');

mySwipe.args.swipeList=[];

console.log("轮播 "+mySwipe.args.swipeList);    

2

let mySwipe = this.getAddinById('Swipe1');
mySwipe.swipePrev();

let mySwipe = this.getAddinById('Swipe1');
mySwipe.args.autoPlayTimer=1000;

// 轮播间隔
console.log("轮播 "+mySwipe.args.autoPlayTimer);

3let mySwipe = this.getAddinById('Swipe1');
mySwipe.swipeNext();

let mySwipe = this.getAddinById('Swipe1');

mySwipe.args.needLoop=false

// 循环播放

console.log("轮播 "+mySwipe.args.needLoop);

4let mySwipe = this.getAddinById('Swipe1');
mySwipe.swipeToIndex(2)


10二维码

args.needLogo               // 显示LOGO

args.logoUrl                   // LOGO地址

args.logoSize                 // LOGO比例

args.logoRadius             // LOGO圆角大小

args.logoBackColor       // LOGO背景颜色

codeStr                          //  二维码字符串


setDisplayType()

getFormName()

getValue()

setValue()

freshData()


ID内部函数支持配置项说明
1

var QRcode1 = this.getAddinById("Swipe1");
console.log("二维码 "+QRcode1.getFormName());
console.log("二维码 "+QRcode1.setDisplayType("visit"));

varQRcode1 =this.getAddinById("QRcode1");



QRcode1.args.needLogo ="true";
console.log(QRcode1.args.needLogo);

QRcode1.args.logoUrl=''

QRcode1.logoSize=0.5

QRcode1.logoRadius=5

QRcode1.logoBackColor=red

QRcode1.codeStr='https://image.baidu.com/';

//设置后需要调用freshData方法

QRcode1.freshData();

2

varQRcode1 =this.getAddinById("QRcode1");
QRcode1.setValue(this.obj.price=75);
console.log(QRcode1.getValue());


3

varQRcode1 =this.getAddinById("QRcode2");
QRcode1.freshData('

http://api.map.baidu.com/lbsapi/getpoint/index.html?qq-pf-to=pcqq.group');



11日历

args.needTitle               // 显示标题

args.titleText                 // 标题文本

args.needSubtitle        // 显示副标题

args.needMark            // 显示水印

args.selfCalendarDate    // 日期范围

args.actColor               // 主题色

targetTimeStamp        // 选中日期的时间戳

targetDate                   // 选中日期

setDisplayType()

getFormName()


ID内部函数支持配置项说明
1

varCalendar1 = this.getAddinById("Calendar1");
console.log("日历 "+Calendar1.getFormName());

console.log(Calendar1.setDisplayType("visit"));

varCalendar1 = this.getAddinById("Calendar1");

Calendar1.needTitle =true;

Calendar1.args.titleText ='我的日历'

Calendar1.args.needSubtitle =true

Calendar1.args.needMark =true;

Calendar1.args.selfCalendarDate=

Calendar1.args.actColor =red

Calendar1.targetTimeStamp


2

/*根据查询条件统计出哪天需要追加标记,

然后根据返回的标记日期设置actYear、actMonth、actDay
//注意:query中的sql语句可以使用聚合查询将属性映射到提前

定义好的中间类上即可

*/
var queryData = {
targetClass:"WorkOrder",
fresh:true,
query:`nativequery:select plt_oid as "oid",plt_faultTime as "riliriqi",plt_faultName as "guzhangmingcheng" from plt_cus_WorkOrder where 1=1 `
};
this.handleQueryData(queryData).then(res=>{
console.log(res);
var year = [];
var month = [];
var day = [];
for(let i = 0 ; i < res.length; i++){
let time = newDate(res[i].riliriqi);
let y = time.getFullYear();
year.push(y);
let m = time.getMonth() + 1;
month.push(m);
let d = time.getDate();
day.push(d);
}
//var rili = this.getSourceAddin();
let rili=this.getAddinById('Calendar1')
console.log(rili);
rili.actYear = year;//[2021];
rili.actMonth = month;//[02];
rili.actDay = day;//[01,02];
});

varCalendar1 = this.getAddinById("Calendar1");

Calendar1.targetDate ='2020-01-02'

3

/*

选中日期后,可以在表格中只显示当前选中的日期的信息

*/

let myCalendar = this.getAddinById('Calendar1');
console.log('myCalendar', myCalendar.targetDate);
//this.getAddinById('Label1').parsedLabel = myCalendar.targetDate;//
//targetTimeStamp
this.getAddinById('Label1').parsedLabel = myCalendar.targetDate;
//let query = `and obj.faultTime = ${myCalendar.targetTimeStamp}`
//let query = `and obj.faultTime = '${myCalendar.targetTimeStamp}'`
let query = `and obj.faultTime = '${myCalendar.targetDate}'`
this.getAddinById('Table1').freshData(query)



12树选择


1args.treeList  // 树选择全部数据
2args.rootQuery  // 根节点查询条件
3args.childrenQuery   //  子节点查询条件
4

args.multiSwitch    // 是否多选 ↓

需配合多选:args.activeIds = []

单选:args.activeIds = 0

5args.activeIds    // 当前选中导航
6args.activeIndex    // 当前选中项



1setDisplayType()
2getSelected()
3freshData()
4getAll()
5getFormName() 移除



ID内部函数支持主要配置项说明
1

debugger;
var TreeSelect1 = this.GetAddinById("TreeSelect1");
var Label1 = this.getAddinById("Label1");
TreeSelect1.setDisplayType("edit");
Label1.setValue("树选择"+TreeSelect1.t_edit);
this.msgbox.success("树选择"+TreeSelect1.t_edit)

debugger;
var select1 = this.getAddinById('TreeSelect1');
select1.args.treeList[0].text = '可可组组组'

2

var TreeSelect1 = this.getAddinById("TreeSelect1");
console.log("树选择getSelected:",TreeSelect1.getSelected());

debugger;
var select1 = this.getAddinById('TreeSelect1');
let query = select1.args.rootQuery = `and obj.companyd='行政组'`;
select1.freshData(query);
console.log('Cell11',select1);

3

var TreeSelect1 = this.getAddinById("TreeSelect1");
console.log("树选择getAll:",TreeSelect1.getAll());

debugger;
var select1 = this.getAddinById('TreeSelect1');
select1.args.childrenQuery = `and obj.companyd='皮皮狗'`;
select1.freshData();
console.log('Cell11',select1);

4debugger;
var select1 = this.getAddinById('TreeSelect1');
select1.args.childrenQuery = `and obj.companyd='皮皮狗'`;
select1.freshData();
console.log('Cell11',select1);

debugger;
var select1 = this.getAddinById('TreeSelect1');
select1.args.multiSwitch = true;
select1.args.activeIds = [];//多选
// select1.args.activeIds = 0;//单选

5

debugger;
var select1 = this.getAddinById('TreeSelect1');
console.log('获取树索引',select1.args.activeIds, select1.args.activeIndex)

6

debugger;
var select1 = this.getAddinById('TreeSelect1');
select1.args.multiSwitch = true;
select1.args.activeIds = [];


...