Best JavaScript code snippet using appium-xcuitest-driver
TextFieldUtils.js
Source:TextFieldUtils.js
1//////////////////////////////////////////////////////////////////////////////////////2//3// Copyright (c) 2014-present, Egret Technology.4// All rights reserved.5// Redistribution and use in source and binary forms, with or without6// modification, are permitted provided that the following conditions are met:7//8// * Redistributions of source code must retain the above copyright9// notice, this list of conditions and the following disclaimer.10// * Redistributions in binary form must reproduce the above copyright11// notice, this list of conditions and the following disclaimer in the12// documentation and/or other materials provided with the distribution.13// * Neither the name of the Egret nor the14// names of its contributors may be used to endorse or promote products15// derived from this software without specific prior written permission.16//17// THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS "AS IS" AND ANY EXPRESS18// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES19// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.20// IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,21// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT22// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,23// OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF24// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING25// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,26// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.27//28//////////////////////////////////////////////////////////////////////////////////////29var __reflect = (this && this.__reflect) || function (p, c, t) {30 p.__class__ = c, t ? t.push(c) : t = [c], p.__types__ = p.__types__ ? t.concat(p.__types__) : t;31};32var egret;33(function (egret) {34 /**35 * @private36 * @version Egret 2.437 * @platform Web,Native38 */39 var TextFieldUtils = (function () {40 function TextFieldUtils() {41 }42 /**43 * è·å第ä¸ä¸ªç»å¶çè¡æ°44 * @param textfield ææ¬45 * @returns {number} è¡æ°ï¼ä»0å¼å§46 * @private47 */48 TextFieldUtils.$getStartLine = function (textfield) {49 var values = textfield.$TextField;50 var textHeight = TextFieldUtils.$getTextHeight(textfield);51 var startLine = 0;52 var textFieldHeight = values[4 /* textFieldHeight */];53 if (!isNaN(textFieldHeight)) {54 if (textHeight < textFieldHeight) {55 }56 else if (textHeight > textFieldHeight) {57 startLine = Math.max(values[28 /* scrollV */] - 1, 0);58 startLine = Math.min(values[29 /* numLines */] - 1, startLine);59 }60 if (!values[30 /* multiline */]) {61 startLine = Math.max(values[28 /* scrollV */] - 1, 0);62 if (values[29 /* numLines */] > 0) {63 startLine = Math.min(values[29 /* numLines */] - 1, startLine);64 }65 }66 }67 return startLine;68 };69 /**70 * è·åæ°´å¹³æ¯ä¾71 * @param textfield ææ¬72 * @returns {number} æ°´å¹³æ¯ä¾73 * @private74 */75 TextFieldUtils.$getHalign = function (textfield) {76 var lineArr = textfield.$getLinesArr();77 var halign = 0;78 if (textfield.$TextField[9 /* textAlign */] == egret.HorizontalAlign.CENTER) {79 halign = 0.5;80 }81 else if (textfield.$TextField[9 /* textAlign */] == egret.HorizontalAlign.RIGHT) {82 halign = 1;83 }84 if (textfield.$TextField[24 /* type */] == egret.TextFieldType.INPUT && !textfield.$TextField[30 /* multiline */] && lineArr.length > 1) {85 halign = 0;86 }87 return halign;88 };89 /**90 * @private91 *92 * @param textfield93 * @returns94 */95 TextFieldUtils.$getTextHeight = function (textfield) {96 var textHeight = (egret.TextFieldType.INPUT == textfield.$TextField[24 /* type */]97 && !textfield.$TextField[30 /* multiline */]) ? textfield.$TextField[0 /* fontSize */] : (textfield.$TextField[6 /* textHeight */] + (textfield.$TextField[29 /* numLines */] - 1) * textfield.$TextField[1 /* lineSpacing */]);98 return textHeight;99 };100 /**101 * è·ååç´æ¯ä¾102 * @param textfield ææ¬103 * @returns {number} åç´æ¯ä¾104 * @private105 */106 TextFieldUtils.$getValign = function (textfield) {107 var textHeight = TextFieldUtils.$getTextHeight(textfield);108 //if (textfield.$TextField[sys.TextKeys.type] == egret.TextFieldType.INPUT) {109 // if (textfield.$TextField[sys.TextKeys.multiline]) {110 //return 0;111 //}112 //return 0.5;113 //}114 var textFieldHeight = textfield.$TextField[4 /* textFieldHeight */];115 if (!isNaN(textFieldHeight)) {116 if (textHeight < textFieldHeight) {117 var valign = 0;118 if (textfield.$TextField[10 /* verticalAlign */] == egret.VerticalAlign.MIDDLE)119 valign = 0.5;120 else if (textfield.$TextField[10 /* verticalAlign */] == egret.VerticalAlign.BOTTOM)121 valign = 1;122 return valign;123 }124 }125 return 0;126 };127 /**128 * æ ¹æ®xãyè·åææ¬é¡¹129 * @param textfield ææ¬130 * @param x xåæ å¼131 * @param y yåæ å¼132 * @returns ææ¬å项133 * @private134 */135 TextFieldUtils.$getTextElement = function (textfield, x, y) {136 var hitTextEle = TextFieldUtils.$getHit(textfield, x, y);137 var lineArr = textfield.$getLinesArr();138 if (hitTextEle && lineArr[hitTextEle.lineIndex] && lineArr[hitTextEle.lineIndex].elements[hitTextEle.textElementIndex]) {139 return lineArr[hitTextEle.lineIndex].elements[hitTextEle.textElementIndex];140 }141 return null;142 };143 /**144 * è·åææ¬ç¹å»å145 * @param textfield ææ¬146 * @param x xåæ å¼147 * @param y yåæ å¼148 * @returns ææ¬ç¹å»å149 * @private150 */151 TextFieldUtils.$getHit = function (textfield, x, y) {152 var lineArr = textfield.$getLinesArr();153 if (textfield.$TextField[3 /* textFieldWidth */] == 0) {154 return null;155 }156 var line = 0;157 var textHeight = TextFieldUtils.$getTextHeight(textfield);158 var startY = 0;159 var textFieldHeight = textfield.$TextField[4 /* textFieldHeight */];160 if (!isNaN(textFieldHeight) && textFieldHeight > textHeight) {161 var valign = TextFieldUtils.$getValign(textfield);162 startY = valign * (textFieldHeight - textHeight);163 if (startY != 0) {164 y -= startY;165 }166 }167 var startLine = TextFieldUtils.$getStartLine(textfield);168 var lineH = 0;169 for (var i = startLine; i < lineArr.length; i++) {170 var lineEle = lineArr[i];171 if (lineH + lineEle.height >= y) {172 if (lineH < y) {173 line = i + 1;174 }175 break;176 }177 else {178 lineH += lineEle.height;179 }180 if (lineH + textfield.$TextField[1 /* lineSpacing */] > y) {181 return null;182 }183 lineH += textfield.$TextField[1 /* lineSpacing */];184 }185 if (line == 0) {186 return null;187 }188 var lineElement = lineArr[line - 1];189 var textFieldWidth = textfield.$TextField[3 /* textFieldWidth */];190 if (isNaN(textFieldWidth)) {191 textFieldWidth = textfield.textWidth;192 }193 var halign = TextFieldUtils.$getHalign(textfield);194 x -= halign * (textFieldWidth - lineElement.width);195 var lineW = 0;196 for (var i = 0; i < lineElement.elements.length; i++) {197 var iwTE = lineElement.elements[i];198 if (lineW + iwTE.width <= x) {199 lineW += iwTE.width;200 }201 else if (lineW < x) {202 return { "lineIndex": line - 1, "textElementIndex": i };203 }204 }205 return null;206 };207 /**208 * è·åå½åæ¾ç¤ºå¤å°è¡209 * @param textfield ææ¬210 * @returns {number} æ¾ç¤ºçè¡æ°211 * @private212 */213 TextFieldUtils.$getScrollNum = function (textfield) {214 var scrollNum = 1;215 if (textfield.$TextField[30 /* multiline */]) {216 var height = textfield.height;217 var size = textfield.size;218 var lineSpacing = textfield.lineSpacing;219 scrollNum = Math.floor(height / (size + lineSpacing));220 var leftH = height - (size + lineSpacing) * scrollNum;221 if (leftH > size / 2) {222 scrollNum++;223 }224 }225 return scrollNum;226 };227 return TextFieldUtils;228 }());229 egret.TextFieldUtils = TextFieldUtils;230 __reflect(TextFieldUtils.prototype, "egret.TextFieldUtils");...
LzhhtGrid.js
Source:LzhhtGrid.js
1/**2 * 3 * */4Ext.define("core.lzhht.view.LzhhtGrid", {5 extend: "Ext.grid.Panel",6 alias: "widget.lzhhtGrid",7 id: "lzhhtgrid",8 store: "core.lzhht.store.LzhhtStore",9 border: 0,10 selModel: {11 selType: "checkboxmodel"12 },13 multiSelect: true,14 frame: true,15 tbar: [16 {xtype: 'button', text: 'æ·»å ', ref: 'add', iconCls: 'table_add'}, '|',17 {xtype: 'button', text: 'ä¿®æ¹', ref: 'edit', iconCls: 'table_edit'}, '|',18 {xtype: 'button', text: 'å é¤', ref: 'del', iconCls: 'table_remove'},19 "->",20 'æå称æ¥è¯¢:',21 {22 xtype: 'triggerfield',23 triggerCls: Ext.baseCSSPrefix + 'form-search-trigger',24 listeners: {25 "change": function(_this, _new, _old, _opt) {26 var _store = _this.ownerCt.ownerCt.getStore();27 _store.clearFilter(false);28 _store.filter("name", _new);29 }30 },31 onTriggerClick: function() {32 var _store = this.ownerCt.ownerCt.getStore();33 _store.clearFilter(false);34 _store.filter("name", this.getValue());35 }36 },37 'æç¼å·æ¥è¯¢:',38 {39 xtype: 'triggerfield',40 triggerCls: Ext.baseCSSPrefix + 'form-search-trigger',41 listeners: {42 "change": function(_this, _new, _old, _opt) {43 var _store = _this.ownerCt.ownerCt.getStore();44 _store.clearFilter(false);45 _store.filter("id", _new);46 }47 },48 onTriggerClick: function() {49 var _store = this.ownerCt.ownerCt.getStore();50 _store.clearFilter(false);51 _store.filter("id", this.getValue());52 }53 }54 ],55 bbar: {56 xtype: 'pagingtoolbar',57 store: 'core.lzhht.store.LzhhtStore',58 dock: 'bottom',59 displayInfo: true60 },61 enableKeyNav: true, //å¯ä»¥ä½¿ç¨é®çæ§å¶ä¸ä¸62 columnLines: true, //å±ç¤ºç«çº¿63 columns: [64 {xtype: 'rownumberer'},65 {text: "æ¿å
ååç¼ç ", dataIndex: "ycbhtbm", width: 100, field: {66 xtype: "textfield"67 }},68 {text: "æµè½¬ååç¼ç ", dataIndex: "lzhtbm", width: 100, field: {69 xtype: "textfield"70 }},71 {text: "æ¿å
æ¹ç¼ç ", dataIndex: "cbfbm", width: 70, field: {72 xtype: "textfield"73 }},74 {text: "å让æ¹ç¼ç ", dataIndex: "srfbm", width: 70, field: {75 xtype: "textfield"76 }},77 {text: "æµè½¬æ¹å¼", dataIndex: "lzfs", width: 70, field: {78 xtype: "textfield"79 }},80 {text: "æµè½¬æé", dataIndex: "lzqx", width: 70, field: {81 xtype: "textfield"82 }},83 {text: "æµè½¬å¼å§æ¥æ", dataIndex: "lzqxksrq", width: 70, field: {84 xtype: "textfield"85 }},86 {text: "æµè½¬ç»ææ¥æ", dataIndex: "lzqxjsrq", width: 70, field: {87 xtype: "textfield"88 }},89 {text: "æµè½¬é¢ç§¯", dataIndex: "lzmj", width: 70, field: {90 xtype: "textfield"91 }},92 {text: "æµè½¬å°åæ°", dataIndex: "lzdks", width: 70, field: {93 xtype: "textfield"94 }},95 {text: "æµè½¬ååå°ç¨é", dataIndex: "lzqtdyt", width: 70, field: {96 xtype: "textfield"97 }},98 {text: "æµè½¬ååå°ç¨é", dataIndex: "lzhtdyt", width: 70, field: {99 xtype: "textfield"100 }},101 {text: "æµè½¬è´¹ç¨è¯´æ", dataIndex: "lzjgsm", width: 70, field: {102 xtype: "textfield"103 }},104 {text: "ååç¾è®¢æ¥æ", dataIndex: "htqdrq", width: 70, field: {105 xtype: "textfield"106 }}107 ],108 initComponent: function() {109 this.callParent(arguments);110 }
...
DkGrid.js
Source:DkGrid.js
1/**2 * 3 * */4Ext.define("core.dk.view.DkGrid", {5 extend: "Ext.grid.Panel",6 alias: "widget.dkgrid",7 id: "dkgrid",8 store: "core.dk.store.DkStore",9 border: 0,10 selModel: {11 selType: "checkboxmodel"12 },13 multiSelect: true,14 frame: true,15 tbar: [16 {xtype: 'button', text: 'æ·»å ', ref: 'add', iconCls: 'table_add'}, '|',17 {xtype: 'button', text: 'ä¿®æ¹', ref: 'edit', iconCls: 'table_edit'}, '|',18 {xtype: 'button', text: 'å é¤', ref: 'del', iconCls: 'table_remove'},19 "->",20 'æå称æ¥è¯¢:',21 {22 xtype: 'triggerfield',23 triggerCls: Ext.baseCSSPrefix + 'form-search-trigger',24 listeners: {25 "change": function(_this, _new, _old, _opt) {26 var _store = _this.ownerCt.ownerCt.getStore();27 _store.clearFilter(false);28 _store.filter("name", _new);29 }30 },31 onTriggerClick: function() {32 var _store = this.ownerCt.ownerCt.getStore();33 _store.clearFilter(false);34 _store.filter("name", this.getValue());35 }36 },37 'æç¼å·æ¥è¯¢:',38 {39 xtype: 'triggerfield',40 triggerCls: Ext.baseCSSPrefix + 'form-search-trigger',41 listeners: {42 "change": function(_this, _new, _old, _opt) {43 var _store = _this.ownerCt.ownerCt.getStore();44 _store.clearFilter(false);45 _store.filter("id", _new);46 }47 },48 onTriggerClick: function() {49 var _store = this.ownerCt.ownerCt.getStore();50 _store.clearFilter(false);51 _store.filter("id", this.getValue());52 }53 }54 ],55 bbar: {56 xtype: 'pagingtoolbar',57 store: 'core.dk.store.DkStore',58 dock: 'bottom',59 displayInfo: true60 },61 enableKeyNav: true, //å¯ä»¥ä½¿ç¨é®çæ§å¶ä¸ä¸62 columnLines: true, //å±ç¤ºç«çº¿63 columns: [64 {xtype: 'rownumberer'},65 {text: "å°åç¼ç ", dataIndex: "dkbm", width: 120, field: {66 xtype: "textfield"67 }},68 {text: "å°åå称", dataIndex: "dkmc", field: {69 xtype: "textfield"70 }},71 {text: "ææææ§è´¨", dataIndex: "syqxz", field: {72 xtype: "textfield"73 }},74 {text: "å°åç±»å«", dataIndex: "dklb", field: {75 xtype: "textfield"76 }},77 {text: "åå°å©ç¨ç±»å", dataIndex: "tdlylx", field: {78 xtype: "textfield"79 }},80 {text: "å°åç级", dataIndex: "dldj", width: 100, field: {81 xtype: "textfield"82 }},83 {text: "åå°ç¨é", dataIndex: "tdyt", width: 70, field: {84 xtype: "textfield"85 }},86 {text: "æ¯å¦åºæ¬åç°", dataIndex: "sfjbnt", width: 100, field: {87 xtype: "textfield"88 }},89 {text: "å®æµé¢ç§¯", dataIndex: "scmj", width: 70, field: {90 xtype: "textfield"91 }},92 {text: "å°åä¸è³", dataIndex: "dkdz", width: 70, field: {93 xtype: "textfield"94 }},95 {text: "å°å西è³", dataIndex: "dkxz", width: 70, field: {96 xtype: "textfield"97 }},98 {text: "å°ååè³", dataIndex: "dknz", width: 70, field: {99 xtype: "textfield"100 }},101 {text: "å°ååè³", dataIndex: "dkbz", width: 70, field: {102 xtype: "textfield"103 }},104 {text: "å°åå¤æ³¨ä¿¡æ¯", dataIndex: "dkbzxx", width: 70, field: {105 xtype: "textfield"106 }},107 {text: "æç人å§å", dataIndex: "zjrxm", width: 70, field: {108 xtype: "textfield"109 }}110 ],111 initComponent: function() {112 this.callParent(arguments);113 }
...
NewBackList.js
Source:NewBackList.js
1Ext.define('erp.view.as.port.NewBackList', {2 extend : 'Ext.Viewport',3 layout : 'anchor',4 hideBorders : true,5 initComponent : function() {6 var me = this;7 var store = new Ext.data.Store({8 fields : [ 'NEWFITTINGBACK_NO', 'BACK_DAY', 'STORE_ID',9 'STORE_NAME', 'SHENQING_OP', 'OBJECTIVE_STORE', 'APPLY_DATETIME',10 'APPLY_RESULT', 'APPLY_OP', 'INOUTNO', 'CLASS',11 'UPDATEMAN', 'UPDATEDATE' ],12 proxy : {13 type : 'ajax',14 url : basePath + 'as/port/getNewBackList.action',15 reader : {16 type : 'json',17 root : 'target',18 totalProperty: 'totalCount'19 }20 },21 autoLoad : true,22 pageSize: parseInt((Ext.isIE ? screen.height*0.73 : window.innerHeight)*0.7/23)23 });24 Ext.apply(me, {25 items : [ {26 xtype : 'grid',27 anchor : '100% 100%',28 columnLines : true,29 id : 'grid',30 plugins: [Ext.create('erp.view.core.grid.HeaderFilter', {31 remoteFilter: true32 })],33 columns : [ {34 text : 'ç³è¯·åå·',35 cls : 'x-grid-header-1',36 dataIndex : 'NEWFITTINGBACK_NO',37 width : 180,38 filter: {39 xtype : 'textfield'40 }41 }, {42 text : 'éåæ¶é´',43 cls : 'x-grid-header-1',44 dataIndex : 'BACK_DAY',45 width : 90,46 filter: {47 xtype : 'datefield'48 }49 }, {50 text : 'ç½ç¹ç¼å·',51 cls : 'x-grid-header-1',52 dataIndex : 'STORE_ID',53 width : 150,54 filter: {55 xtype : 'textfield'56 }57 }, {58 text : 'ç½ç¹å称',59 cls : 'x-grid-header-1',60 dataIndex : 'STORE_NAME',61 width : 80,62 filter: {63 xtype : 'textfield'64 }65 }, {66 text : 'ç³è¯·äºº',67 cls : 'x-grid-header-1',68 dataIndex: 'SHENQING_OP',69 width : 70,70 filter: {71 xtype : 'textfield'72 }73 }, {74 text : 'ç®æ å
¬å¸',75 cls : 'x-grid-header-1',76 dataIndex : 'OBJECTIVE_STORE',77 width : 80,78 filter: {79 xtype : 'textfield'80 }81 }, {82 text : 'å®¡æ ¸æ¶é´',83 cls : 'x-grid-header-1',84 dataIndex : 'APPLY_DATETIME',85 width : 90,86 filter: {87 xtype : 'datefield'88 }89 }, {90 text : 'å®¡æ ¸æè§',91 cls : 'x-grid-header-1',92 dataIndex : 'APPLY_RESULT',93 width : 90,94 filter: {95 xtype : 'textfield'96 }97 }, {98 text : 'å®¡æ ¸äºº',99 cls : 'x-grid-header-1',100 dataIndex : 'APPLY_OP',101 width : 70,102 filter: {103 xtype : 'textfield'104 }105 }, {106 text : 'åºå
¥åºåå·',107 cls : 'x-grid-header-1',108 dataIndex : 'INOUTNO',109 width : 110,110 filter: {111 xtype : 'textfield'112 }113 }, {114 text : 'åæ®ç±»å',115 cls : 'x-grid-header-1',116 dataIndex : 'CLASS',117 width : 100,118 filter: {119 xtype : 'textfield'120 }121 }, {122 text : 'å¤ç人',123 cls : 'x-grid-header-1',124 dataIndex : 'UPDATEMAN',125 width : 70,126 filter: {127 xtype : 'textfield'128 }129 }, {130 text : 'å¤çæ¶é´',131 cls : 'x-grid-header-1',132 dataIndex : 'UPDATEDATE',133 width : 90,134 filter: {135 xtype : 'datefield'136 }137 } ],138 store : store,139 dockedItems: [{140 xtype: 'pagingtoolbar',141 store: store,142 dock: 'bottom',143 displayInfo: true144 }]145 } ]146 });147 me.callParent(arguments);148 }...
PreProductList.js
Source:PreProductList.js
1Ext.define('erp.view.as.port.PreProductList', {2 extend : 'Ext.Viewport',3 layout : 'anchor',4 hideBorders : true,5 initComponent : function() {6 var me = this;7 var store = new Ext.data.Store({8 fields : [ 'APPLY_NO', 'STORE_ID', 'STORE_NAME', 'SHENQING_OP', 'OBJECTIVE_STORE',9 'APPLY_DAY', 'APPLY_DATETIME', 'APPLY_OP', 'INOUTNO', 'CLASS',10 'UPDATEMAN', 'UPDATEDATE' ],11 proxy : {12 type : 'ajax',13 url : basePath + 'as/port/getApplyList.action',14 reader : {15 type : 'json',16 root : 'target',17 totalProperty: 'totalCount'18 }19 },20 autoLoad : true,21 pageSize: parseInt((Ext.isIE ? screen.height*0.73 : window.innerHeight)*0.7/23)22 });23 Ext.apply(me, {24 items : [ {25 xtype : 'grid',26 anchor : '100% 100%',27 columnLines : true,28 id : 'grid',29 plugins: [Ext.create('erp.view.core.grid.HeaderFilter', {30 remoteFilter: true31 })],32 columns : [ {33 text : 'ç³è¯·åå·',34 cls : 'x-grid-header-1',35 dataIndex : 'APPLY_NO',36 width : 180,37 filter: {38 xtype : 'textfield'39 }40 }, {41 text : 'ç½ç¹ç¼å·',42 cls : 'x-grid-header-1',43 dataIndex : 'STORE_ID',44 width : 150,45 filter: {46 xtype : 'textfield'47 }48 }, {49 text : 'ç½ç¹å称',50 cls : 'x-grid-header-1',51 dataIndex : 'STORE_NAME',52 width : 80,53 filter: {54 xtype : 'textfield'55 }56 }, {57 text : 'ç³è¯·äºº',58 cls : 'x-grid-header-1',59 dataIndex : 'SHENQING_OP',60 width : 80,61 filter: {62 xtype : 'textfield'63 }64 }, {65 text : 'ç®æ å
¬å¸',66 cls : 'x-grid-header-1',67 dataIndex : 'OBJECTIVE_STORE',68 width : 80,69 filter: {70 xtype : 'textfield'71 }72 }, {73 text : 'ç³è¯·æ¶é´',74 cls : 'x-grid-header-1',75 dataIndex : 'APPLY_DAY',76 width : 90,77 filter: {78 xtype : 'datefield'79 }80 }, {81 text : 'å®¡æ ¸æ¶é´',82 cls : 'x-grid-header-1',83 dataIndex : 'APPLY_DATETIME',84 width : 90,85 filter: {86 xtype : 'datefield'87 }88 }, {89 text : 'å®¡æ ¸æè§',90 cls : 'x-grid-header-1',91 dataIndex : 'APPLY_RESULT',92 width : 90,93 filter: {94 xtype : 'textfield'95 }96 }, {97 text : 'å®¡æ ¸äºº',98 cls : 'x-grid-header-1',99 dataIndex : 'APPLY_OP',100 width : 70,101 filter: {102 xtype : 'textfield'103 }104 }, {105 text : 'åºå
¥åºåå·',106 cls : 'x-grid-header-1',107 dataIndex : 'INOUTNO',108 width : 110,109 filter: {110 xtype : 'textfield'111 }112 }, {113 text : 'åæ®ç±»å',114 cls : 'x-grid-header-1',115 dataIndex : 'CLASS',116 width : 100,117 filter: {118 xtype : 'textfield'119 }120 }, {121 text : 'å¤ç人',122 cls : 'x-grid-header-1',123 dataIndex : 'UPDATEMAN',124 width : 70,125 filter: {126 xtype : 'textfield'127 }128 }, {129 text : 'å¤çæ¶é´',130 cls : 'x-grid-header-1',131 dataIndex : 'UPDATEDATE',132 width : 90,133 filter: {134 xtype : 'datefield'135 }136 } ],137 store : store,138 dockedItems: [{139 xtype: 'pagingtoolbar',140 store: store,141 dock: 'bottom',142 displayInfo: true143 }]144 } ]145 });146 me.callParent(arguments);147 }...
CbfGrid.js
Source:CbfGrid.js
1/**2 * 3 * */4Ext.define("core.cbf.view.CbfGrid", {5 extend: "Ext.grid.Panel",6 alias: "widget.cbfgrid",7 id: "cbfgridId",8 store: "core.cbf.store.CbfStore",9 border: 0,10 selModel: {11 selType: "checkboxmodel"12 },13 multiSelect: true,14 frame: true,15 tbar: [16 {xtype: 'button', text: 'æ·»å ', ref: 'add', iconCls: 'table_add'}, '|',17 {xtype: 'button', text: 'ä¿®æ¹', ref: 'edit', iconCls: 'table_edit'}, '|',18 {xtype: 'button', text: 'å é¤', ref: 'del', iconCls: 'table_remove'},19 "->",20 'æå称æ¥è¯¢:',21 {22 xtype: 'triggerfield',23 triggerCls: Ext.baseCSSPrefix + 'form-search-trigger',24 listeners: {25 "change": function(_this, _new, _old, _opt) {26 var _store = _this.ownerCt.ownerCt.getStore();27 _store.clearFilter(false);28 _store.filter("name", _new);29 }30 },31 onTriggerClick: function() {32 var _store = this.ownerCt.ownerCt.getStore();33 _store.clearFilter(false);34 _store.filter("name", this.getValue());35 }36 },37 'æç¼å·æ¥è¯¢:',38 {39 xtype: 'triggerfield',40 triggerCls: Ext.baseCSSPrefix + 'form-search-trigger',41 listeners: {42 "change": function(_this, _new, _old, _opt) {43 var _store = _this.ownerCt.ownerCt.getStore();44 _store.clearFilter(false);45 _store.filter("id", _new);46 }47 },48 onTriggerClick: function() {49 var _store = this.ownerCt.ownerCt.getStore();50 _store.clearFilter(false);51 _store.filter("id", this.getValue());52 }53 }54 ],55 bbar: {56 xtype: 'pagingtoolbar',57 store: 'core.cbf.store.CbfStore',58 dock: 'bottom',59 displayInfo: true60 },61 enableKeyNav: true, //å¯ä»¥ä½¿ç¨é®çæ§å¶ä¸ä¸62 columnLines: true, //å±ç¤ºç«çº¿63 columns: [64 {xtype: 'rownumberer'},65 {text: "æ¿å
æ¹ç¼ç ", dataIndex: "cbfbm", width: 120, field: {66 xtype: "textfield"67 }},68 {text: "æ¿å
æ¹ç±»å", dataIndex: "cbflx", width: 80, field: {69 xtype: "textfield"70 }},71 {text: "æ¿å
æ¹å称", dataIndex: "cbfmc", width: 80, field: {72 xtype: "textfield"73 }},74 {text: "æ¿å
æ¹æ§å«", dataIndex: "cbfxb", width: 80, field: {75 xtype: "textfield"76 }},77 {text: "æ¿å
æ¹æ°æ", dataIndex: "cbfmz", width: 80, field: {78 xtype: "textfield"79 }},80 {text: "æ¿å
æ¹å°å", dataIndex: "cbfdz", width: 150, field: {81 xtype: "textfield"82 }},83 {text: "èç³»çµè¯", dataIndex: "lxdh", width: 80, field: {84 xtype: "textfield"85 }},86 {text: "æ¿å
æ¹è°æ¥å", dataIndex: "cbfdcy", width: 80, field: {87 xtype: "textfield"88 }},89 {text: "å
¬ç¤ºè®°äºäºº", dataIndex: "gsjsr", width: 70, field: {90 xtype: "textfield"91 }},92 {text: "å
¬ç¤ºå®¡æ ¸äºº", dataIndex: "gsshr", width: 70, field: {93 xtype: "textfield"94 }},95 {text: "å
¬ç¤ºå®¡æ ¸æ¥æ", dataIndex: "gsshrq", width: 80, field: {96 xtype: "textfield"97 }}98 ],99 initComponent: function() {100 this.callParent(arguments);101 }
...
RoomGrid.js
Source:RoomGrid.js
1Ext.define("core.baseset.roomdefine.view.RoomGrid", {2 extend: "core.base.view.BaseGrid",3 alias: "widget.baseset.roomdefine.roomgrid",4 dataUrl: comm.get('baseUrl') + "/BaseRoominfo/list",5 model: "com.zd.school.build.define.model.BuildRoominfo",6 extParams: {7 filter: "[{'type':'string','comparison':'=','value':'ROOT','field':'areaId'},{'type':'string','comparison':'=','value':'0','field':'roomType'}]",8 },9 selModel: {10 type: "checkboxmodel", 11 headerWidth:40, //设置è¿ä¸ªå¼ä¸º50ã ä½columnsä¸çdefaultsä¸è®¾ç½®å®½åº¦ï¼ä¼å½±åä»12 mode:'single', //multi,simple,singleï¼é»è®¤ä¸ºå¤émulti13 },14 panelTopBar:{15 xtype:'toolbar',16 items: [{17 xtype: 'tbtext',18 html: 'åºåæ¿é´',19 style: {20 fontSize: '16px',21 color: '#C44444',22 fontWeight:800,23 lineHeight:'30px'24 }25 }],26 }, 27 panelButtomBar:null,28 columns: { 29 defaults:{30 titleAlign:"center"31 },32 items: [{33 text: "主é®",34 dataIndex: "roomId",35 hidden: true36 }, {37 text: "æ¿é´ç¼å·",38 dataIndex: "roomCode",39 flex:1, 40 minWidth:100,41 field: {42 xtype: "textfield"43 }44 }, {45 text: "æ¿é´å称",46 dataIndex: "roomName",47 flex:1,48 minWidth:100,49 field: {50 xtype: "textfield"51 }52 }, {53 text: "æ¿é´ç±»å", //å段ä¸æå54 dataIndex: "roomType", //å段å55 columnType: "basecombobox", //åç±»å56 width:100,57 ddCode: "FJLX" //åå
¸ä»£ç 58 }, {59 text: "é¨çå·1",60 dataIndex: "extField01",61 width:80,62 field: {63 xtype: "textfield"64 }65 }, {66 text: "é¨çå·2",67 dataIndex: "extField02",68 width:80,69 field: {70 xtype: "textfield"71 }72 }, {73 text: "é¨çå·3",74 dataIndex: "extField03",75 width:80,76 field: {77 xtype: "textfield"78 }79 }, {80 text: "é¨çå·4",81 dataIndex: "extField04",82 width:80,83 field: {84 xtype: "textfield"85 }86 }, {87 text: "é¨çå·5",88 dataIndex: "extField05",89 width:80,90 field: {91 xtype: "textfield"92 }93 }, {94 text: "ç½ç»ç¶æ",95 dataIndex: "roomNet",96 width:80,97 renderer: function(value) {98 switch (value) {99 case '0':100 return '<font color=green>æ</font>';101 break;102 default:103 return '<font color=red>æ </font>';104 break;105 }106 }107 }]108 }109 ...
HeXiaoList.js
Source:HeXiaoList.js
1Ext.define('erp.view.as.port.HeXiaoList', {2 extend : 'Ext.Viewport',3 layout : 'anchor',4 hideBorders : true,5 initComponent : function() {6 var me = this;7 var store = new Ext.data.Store({8 fields : [ 'APPLYHEXIAO_NO', 'BACK_DAY', 'STORE_ID',9 'STORE_NAME', 'OBJECTIVE_STORE', 'APPLY_DATETIME',10 'APPLY_RESULT', 'APPLY_OP', 'INOUTNO', 'CLASS',11 'UPDATEMAN', 'UPDATEDATE' ],12 proxy : {13 type : 'ajax',14 url : basePath + 'as/port/getHexiaoList.action',15 reader : {16 type : 'json',17 root : 'target',18 totalProperty: 'totalCount'19 }20 },21 autoLoad : true,22 pageSize: parseInt((Ext.isIE ? screen.height*0.73 : window.innerHeight)*0.7/23)23 });24 Ext.apply(me, {25 items : [ {26 xtype : 'grid',27 anchor : '100% 100%',28 columnLines : true,29 id : 'grid',30 plugins: [Ext.create('erp.view.core.grid.HeaderFilter', {31 remoteFilter: true32 })],33 columns : [ {34 text : 'ç³è¯·åå·',35 cls : 'x-grid-header-1',36 dataIndex : 'APPLYHEXIAO_NO',37 width : 180,38 filter: {39 xtype : 'textfield'40 }41 }, {42 text : 'éåæ¶é´',43 cls : 'x-grid-header-1',44 dataIndex : 'BACK_DAY',45 width : 90,46 filter: {47 xtype : 'datefield'48 }49 }, {50 text : 'ç½ç¹ç¼å·',51 cls : 'x-grid-header-1',52 dataIndex : 'STORE_ID',53 width : 150,54 filter: {55 xtype : 'textfield'56 }57 }, {58 text : 'ç½ç¹å称',59 cls : 'x-grid-header-1',60 dataIndex : 'STORE_NAME',61 width : 80,62 filter: {63 xtype : 'textfield'64 }65 }, {66 text : 'ç®æ å
¬å¸',67 cls : 'x-grid-header-1',68 dataIndex : 'OBJECTIVE_STORE',69 width : 80,70 filter: {71 xtype : 'textfield'72 }73 }, {74 text : 'å®¡æ ¸æ¶é´',75 cls : 'x-grid-header-1',76 dataIndex : 'APPLY_DATETIME',77 width : 90,78 filter: {79 xtype : 'datefield'80 }81 }, {82 text : 'å®¡æ ¸æè§',83 cls : 'x-grid-header-1',84 dataIndex : 'APPLY_RESULT',85 width : 90,86 filter: {87 xtype : 'textfield'88 }89 }, {90 text : 'å®¡æ ¸äºº',91 cls : 'x-grid-header-1',92 dataIndex : 'APPLY_OP',93 width : 70,94 filter: {95 xtype : 'textfield'96 }97 }, {98 text : 'åºå
¥åºåå·',99 cls : 'x-grid-header-1',100 dataIndex : 'INOUTNO',101 width : 110,102 filter: {103 xtype : 'textfield'104 }105 }, {106 text : 'åæ®ç±»å',107 cls : 'x-grid-header-1',108 dataIndex : 'CLASS',109 width : 100,110 filter: {111 xtype : 'textfield'112 }113 }, {114 text : 'å¤ç人',115 cls : 'x-grid-header-1',116 dataIndex : 'UPDATEMAN',117 width : 70,118 filter: {119 xtype : 'textfield'120 }121 }, {122 text : 'å¤çæ¶é´',123 cls : 'x-grid-header-1',124 dataIndex : 'UPDATEDATE',125 width : 90,126 filter: {127 xtype : 'datefield'128 }129 } ],130 store : store,131 dockedItems: [{132 xtype: 'pagingtoolbar',133 store: store,134 dock: 'bottom',135 displayInfo: true136 }]137 } ]138 });139 me.callParent(arguments);140 }...
Using AI Code Generation
1var wd = require('wd');2var assert = require('assert');3var chai = require('chai');4var chaiAsPromised = require('chai-as-promised');5chai.use(chaiAsPromised);6var expect = chai.expect;7chaiAsPromised.transferPromiseness = wd.transferPromiseness;8var desired = {9};10var driver = wd.promiseChainRemote('localhost', 4723);11 .init(desired)12 .elementByAccessibilityId('Clear')13 .click()14 .elementByAccessibilityId('2')15 .click()16 .elementByAccessibilityId('Plus')17 .click()18 .elementByAccessibilityId('2')19 .click()20 .elementByAccessibilityId('Equals')21 .click()22 .elementByAccessibilityId('Display')23 .text()24 .then(function(text) {25 console.log(text);26 expect(text).to.equal('4');27 })28 .fin(function() { return driver.quit(); })29 .done();30console.log('Test completed');31var wd = require('wd');32var assert = require('assert');33var chai = require('chai');34var chaiAsPromised = require('chai-as-promised');35chai.use(chaiAsPromised);36var expect = chai.expect;37chaiAsPromised.transferPromiseness = wd.transferPromiseness;38var desired = {39};
Using AI Code Generation
1var webdriverio = require('webdriverio');2var options = {3 desiredCapabilities: {4 }5};6 .remote(options)7 .init()8 .click('~textField')9 .setValue('~textField', 'Hello World')10 .getText('~textField')11 .then(function(text) {12 console.log('Text is: ' + text);13 })14 .end();
Using AI Code Generation
1const wd = require('wd');2(async () => {3 await driver.init({4 });5 await driver.setImplicitWaitTimeout(10000);6 const textField = await driver.elementByAccessibilityId('textField');7 const text = await textField.text();8 console.log('text:', text);9})();
Using AI Code Generation
1const wd = require('wd');2require('colors');3const config = {4 capabilities: {5 }6};7const driver = wd.promiseChainRemote(config);8driver.init(config.capabilities)9 .then(() => {10 return driver.elementByAccessibilityId('1');11 })12 .then((element) => {13 return element.click();14 })15 .then(() => {16 return driver.elementByAccessibilityId('2');17 })18 .then((element) => {19 return element.click();20 })21 .then(() => {22 return driver.elementByAccessibilityId('3');23 })24 .then((element) => {25 return element.click();26 })27 .then(() => {28 return driver.elementByAccessibilityId('4');29 })30 .then((element) => {31 return element.click();32 })33 .then(() => {34 return driver.elementByAccessibilityId('5');35 })36 .then((element) => {37 return element.click();38 })39 .then(() => {40 return driver.elementByAccessibilityId('6');41 })42 .then((element) => {43 return element.click();44 })45 .then(() => {46 return driver.elementByAccessibilityId('7');47 })48 .then((element) => {49 return element.click();50 })51 .then(() => {52 return driver.elementByAccessibilityId('8');53 })54 .then((element) => {55 return element.click();56 })57 .then(() => {58 return driver.elementByAccessibilityId('9');59 })60 .then((element) => {61 return element.click();62 })63 .then(() => {64 return driver.elementByAccessibilityId('0');65 })66 .then((element) => {67 return element.click();68 })69 .then(() => {70 return driver.elementByAccessibilityId('Add');71 })
Using AI Code Generation
1var webdriver = require('selenium-webdriver');2var driver = new webdriver.Builder()3.forBrowser('safari')4.build();5driver.findElement(webdriver.By.className('gLFyf')).then(function(element) {6});7driver.quit();8var webdriver = require('selenium-webdriver');9var driver = new webdriver.Builder()10.forBrowser('safari')11.build();12driver.findElement(webdriver.By.className('gLFyf')).then(function(element) {13});14driver.quit();15var webdriver = require('selenium-webdriver');16var driver = new webdriver.Builder()17.forBrowser('safari')18.build();19driver.findElement(webdriver.By.className('gLFyf')).then(function(element) {20});21driver.quit();22var webdriver = require('selenium-webdriver');23var driver = new webdriver.Builder()24.forBrowser('safari')25.build();26driver.findElement(webdriver.By.className('gLFyf')).then(function(element) {27});28driver.quit();
Using AI Code Generation
1describe('Test to get text from a text field', function() {2 it('should get the text from the text field', function() {3 var textField = browser.element('input[type="text"]');4 var text = textField.getText();5 console.log(text);6 });7});8exports.config = {9 capabilities: [{10 }],11 mochaOpts: {12 }13};14var text = browser.getText('input[type="text"]');15var text = browser.element('input[type="text"]').getText();16var text = browser.element('input[type="text"]').getText();17var text = browser.element('
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!