Best JavaScript code snippet using argos
HardwareOnboard.js
Source:HardwareOnboard.js
1import React, { Component } from 'react';2import { CallRESTAPI } from '../Helpers/Helper';3const { REACT_APP_API_URL } = process.env;4const $ = require('jquery');5$.DataTable = require('datatables.net');6class HardwareOnboard extends Component {7 constructor(props) {8 super(props);9 this.state = {10 firstoOnboardHWLoad: false,11 currentUserEndPointURL: REACT_APP_API_URL + "/currentUser",12 dasboardEndPointURL: REACT_APP_API_URL + "/Lists/getbytitle('DashboardFlowList')/items?$select=OData__x004c_1,OData__x004c_2,OData__x004c_3,OData__x004c_4&$filter=Title eq 'NewUser'",13 tableTitle: "Onboard Hardware",14 data: [],15 headerList: [{16 columnName: "Created",17 className: ""18 },19 {20 columnName: "New Employee",21 className: ""22 },23 {24 columnName: "Cost Details",25 className: "nosort"26 },27 {28 columnName: "Upload Quote",29 className: "nosort"30 },31 {32 columnName: "HW Infra",33 className: "nosort"34 },35 {36 columnName: "Supervisor",37 className: "nosort"38 },39 {40 columnName: "Country Head",41 className: "nosort"42 },43 {44 columnName: "Asset Details",45 className: ""46 },47 {48 columnName: "Purchase Dept",49 className: "nosort"50 },51 ],52 }53 }54 async componentWillMount() {55 this.CollapseTableData = this.CollapseTableData.bind(this);56 this.SetCurrentUserInState();57 }58 //Get current user details: To-do : merge this in the request for requester and skip for Admin code.59 SetCurrentUserInState = () => {60 61 return CallRESTAPI(this.state.currentUserEndPointURL)62 .then(result => {63 64 this.setState({ currentUser: result.d.Id });65 66 return result.d.Id;67 });68};69 70 SetHardwareOnboardData() {71 72 var endPointUrl = REACT_APP_API_URL + "/Lists/getbytitle('NewUser-HWList')/items?" +73 "$select=Created,RFOnBehalfOf,Title,RFCost,Attachment,RFTicketStatus,RFAsset,RFCIO,RFSupervisorName,RFCountryHead" +74 "&$top=10&$orderby=Created desc &$filter=AuthorId eq '"+this.state.currentUser+"'"75 //endPointUrl=REACT_APP_API_URL+"/Lists/getbytitle('New User Request')/items?$top=10&$orderby=Created desc&$filter=AuthorId eq '"+currentUser+"'"76 //Get Data and Set in the 77 return CallRESTAPI(endPointUrl)78 .then(result => {79 this.setState({ data: result.d.results })80 if (!this.state.firstoOnboardHWLoad) {81 $('#hwOnboardTable').DataTable({82 paging: false,83 info: false,84 aaSorting: [[0, 'desc']],85 aoColumnDefs: [86 {87 bSortable: false,88 aTargets: ['nosort']89 }90 ]91 });92 this.setState({ firstoOnboardHWLoad: true })93 }94 return this.state.data95 })96 .then(dataRes => {97 console.log(dataRes)98 });99 }100 CollapseTableData(element) {101 element.preventDefault();102 var content = element.currentTarget.nextElementSibling;103 var childWidth = element.currentTarget.parentElement.parentElement.parentElement.parentElement;104 if (content != null) {105 if (content.className === "card-body hide") {106 content.className = "card-body active";107 element.currentTarget.parentElement.className = "card card-box"108 childWidth.classList.remove("child-width");109 this.SetHardwareOnboardData();110 }111 else {112 content.className = "card-body hide";113 element.currentTarget.parentElement.className = "card"114 childWidth.classList.add("child-width");115 }116 }117 }118 119 ValueExists(value, status) {120 var statusIcon = '';121 if (status === "PD InProgress")122 statusIcon = "fa fa-clock-o orange"123 else124 statusIcon = (value !== null) ? "fa fa-check green" : "";125 return statusIcon;126 }127 AssetExists(value, status) {128 var statusIcon = '';129 if (status === "Closed")130 statusIcon = "fa fa-check green";131 return ((value !== null) || (value === "Yes")) ? "fa fa-check green" : statusIcon;132 }133 AttachmentExists(value, status) {134 //debugger;135 // var statusIcon = '';136 //if(value!== null && (value === "Yes"))137 //{138 //statusIcon = "fa fa-check green";139 //return ((value !== null) || (value === "Yes")) ? "fa fa-check green" : statusIcon;140 //}141 var statusIcon = '';142 if (status === "PD InProgress")143 statusIcon = ""144 else if(status === "In Progress")145 statusIcon ="fa fa-clock-o orange"146 else if(value!== null && (value === "Yes"))147 statusIcon = (value === "Yes") ? "fa fa-check green" : "";148 return statusIcon;149 }150 IndicateStatusForInfra= function (status) {151 var statusColor = '';152 var generalGreen = "fa fa-check green";153 154 if (status === "L3 In Progress")155 {156 statusColor= "fa fa-clock-o orange"157 }158 else if (status === "L3 Rejected")159 {160 statusColor= "fa fa-close red"161 }162 else if (status === "AssetNumber In Progress")163 {164 statusColor= generalGreen;165 }166 else if (status === "AssetNumber Approved")167 {168 statusColor= generalGreen;169 }170 else if (status === "L3 Approved")171 {172 statusColor= generalGreen;173 }174 else if (status === "L2 Approved")175 {176 statusColor= generalGreen;177 }178 else if (status === "L1 Approved")179 {180 statusColor= generalGreen;181 }182 else if (status === "L1 In Progress")183 {184 statusColor= generalGreen;185 }186 else if (status === "L2 In Progress")187 {188 statusColor= generalGreen;189 }190 else if (status === "L1 Rejected")191 {192 statusColor= generalGreen;193 }194 else if (status === "L2 Rejected")195 {196 statusColor= generalGreen;197 }198 else if(status=== "Closed")199 {200 statusColor = generalGreen;201 }202 203 return statusColor;204 }205 IndicateStatusForSupervisor= function (status) {206 var statusColor = '';207 var generalGreen = "fa fa-check green";208 209 if (status === "L2 In Progress" || status === "L3 Approved" )210 {211 statusColor= "fa fa-clock-o orange"212 }213 else if (status === "L2 Rejected")214 {215 statusColor= "fa fa-close red"216 }217 else if(status === "L2 Approved")218 {219 statusColor = generalGreen;220 }221 else if (status === "L1 Approved")222 {223 statusColor= generalGreen;224 }225 else if(status=== "Closed")226 {227 statusColor = generalGreen;228 }229 else if (status === "AssetNumber In Progress")230 {231 statusColor= generalGreen;232 }233 else if (status === "AssetNumber Approved")234 {235 statusColor= generalGreen;236 }237 else if (status === "L1 In Progress")238 {239 statusColor= generalGreen;240 }241 else if (status === "L1 Rejected")242 {243 statusColor= generalGreen;244 }245 246 return statusColor;247 }248 IndicateStatusForCountryHead= function (status) {249 var statusColor = '';250 var generalGreen = "fa fa-check green";251 252 if (status === "L1 In Progress" || status=== "L2 Approved")253 {254 statusColor= "fa fa-clock-o orange"255 }256 else if (status === "L1 Rejected")257 {258 statusColor= "fa fa-close red"259 }260 else if (status === "L1 Approved")261 {262 statusColor= generalGreen;263 }264 else if(status=== "Closed")265 {266 statusColor = generalGreen;267 }268 else if (status === "AssetNumber In Progress")269 {270 statusColor= generalGreen;271 }272 else if (status === "AssetNumber Approved")273 {274 statusColor= generalGreen;275 }276 277 return statusColor;278 }279 280 IndicateStatusForPurchaseDepartment= function (status) {281 var statusColor = '';282 var generalGreen = "fa fa-check green";283 if (status === "AssetNumber Approved")284 {285 statusColor= "fa fa-clock-o orange"286 }287 288 else if(status==="Closed")289 {290 statusColor = generalGreen;291 }292 return statusColor;293 }294 IndicateStatusForAsset= function (value,status) {295 296 var statusIcon = '';297 if(value!== null)298 {299 statusIcon = "fa fa-check green";300 return ((value !== null) ) ? "fa fa-check green" : statusIcon;301 }302 else if(status==="AssetNumber In Progress")303 {304 statusIcon= "fa fa-clock-o orange"305 return statusIcon;306 }307 308 309 310 }311 IndicateStatusForAll = function (key, status) {312 313 var statusColor = '';314 var generalGreen = "fa fa-check green";315 //If Asset Number In Progress or Approved.316 if (["AssetNumber In Progress", "AssetNumber Approved", "Closed"].indexOf(status) > -1)317 statusColor = generalGreen;318 //IT approver319 if (key === "L1") {320 if (status === "In Progress")321 statusColor = this.IndicateStatus(status)322 else if (status.indexOf("L3") > -1)323 statusColor = generalGreen;324 else if (status.indexOf("L2") > -1)325 statusColor = generalGreen;326 else if (status.indexOf("L1") > -1)327 statusColor = generalGreen;328 }329 //Supervisor330 if (key === "L2") {331 332 if (status.indexOf("L3") > -1)333 statusColor = generalGreen;334 else if (status.indexOf("L2") > -1)335 statusColor = this.IndicateStatus(status);336 else if (status.indexOf("L1") > -1)337 statusColor = generalGreen;338 }339 //CH340 if (key === "L3") {341 342 if (status.indexOf("L3") > -1)343 statusColor = this.IndicateStatus(status)344 else if (status.indexOf("L2") > -1)345 statusColor = "";346 else if (status.indexOf("L1") > -1)347 statusColor = generalGreen;348 }349 //PD350 if (key === "PD") {351 if (status === "Closed") {352 if (status.indexOf("L3") > -1)353 statusColor = generalGreen354 else if (status.indexOf("L2") > -1)355 statusColor = generalGreen356 else if (status.indexOf("L1") > -1)357 statusColor = generalGreen;358 }359 }360 return statusColor361 }362 IndicateStatus = function (status) {363 return "fa " + ((status.indexOf("Approve") > -1)364 ? "fa-check green"365 : ((status.indexOf("In Progress") > -1) ? "fa-clock-o orange" : ((status.indexOf("Rejected") > -1) ? "fa-close red" : "")))366 }367 render() {368 return (369 <div className="child-long child-width">370 <div className="row">371 <div className="col-md-12">372 <div className="card">373 <button className="btn card-header-btn" onClick={this.CollapseTableData}>374 <div className="card-header header-grey card-header-primary">375 <h4 className="card-title ">{this.state.tableTitle} <span className="arrow"><i className="fa fa-angle-down"></i></span></h4>376 </div>377 </button>378 <div className="card-body hide">379 <div className="table-responsive">380 <table className="table" id="hwOnboardTable">381 <thead className=" text-primary-blue">382 <tr>{this.state.headerList.map((headerColumn, key) =>383 <th key={key} className={headerColumn.className}>{headerColumn.columnName}</th>)}384 </tr>385 </thead>386 <tbody>387 {this.state.data.map((rowData, key) => (388 <tr key={key}>389 <td> {rowData.Created.slice(0, 10)} </td>390 <td> {rowData.RFOnBehalfOf}</td>391 <td><i className={this.ValueExists(rowData.RFCost, rowData.RFTicketStatus)}></i><span className="hide">{rowData.RFCost}</span></td>392 <td> <i className={this.AttachmentExists(rowData.Attachment, rowData.RFTicketStatus)}></i> <span className="hide">{rowData.Attachment}</span></td>393 <td> <i className={this.IndicateStatusForInfra( rowData.RFTicketStatus)}> </i> </td>394 <td> <i className={this.IndicateStatusForSupervisor( rowData.RFTicketStatus)} data-toggle="tooltip" data-placement="top" title={rowData.RFSupervisorName}></i><span className="hide">{rowData.RFSupervisorName}</span></td>395 <td> <i className={this.IndicateStatusForCountryHead( rowData.RFTicketStatus)} data-toggle="tooltip" data-placement="top" title={rowData.RFCountryHead}></i><span className="hide">{rowData.RFCountryHead}</span></td>396 <td> <i className={this.IndicateStatusForAsset(rowData.RFAsset, rowData.RFTicketStatus)}></i><span className="">{rowData.RFAsset}</span></td>397 <td> <i className={this.IndicateStatusForPurchaseDepartment( rowData.RFTicketStatus)}></i></td>398 </tr>399 ))}400 </tbody>401 </table>402 </div>403 </div>404 </div>405 </div>406 </div>407 </div>);408 }409}...
data.ts
Source:data.ts
1export const realData: SmartWarning.meterEntry[] = [2 {3 perUnit: 'mA',4 statusName: 'å
³é',5 statusColor: 'Grey',6 channelName: 'æ¼çµ',7 value: 0.0,8 },9 {10 perUnit: 'â',11 statusName: 'æè·¯æ
é',12 statusColor: 'Yellow',13 channelName: 'Aç¸æ¸©åº¦',14 value: 0.0,15 },16 {17 perUnit: 'â',18 statusName: 'æè·¯æ
é',19 statusColor: 'Yellow',20 channelName: 'Bç¸æ¸©åº¦',21 value: 0.0,22 },23 {24 perUnit: 'â',25 statusName: 'æè·¯æ
é',26 statusColor: 'Yellow',27 channelName: 'Cç¸æ¸©åº¦',28 value: 0.0,29 },30 {31 perUnit: 'â',32 statusName: 'æè·¯æ
é',33 statusColor: 'Yellow',34 channelName: 'Nç¸æ¸©åº¦',35 value: 0.0,36 },37 {38 perUnit: 'A',39 statusName: 'å
³é',40 statusColor: 'Grey',41 channelName: 'Aç¸çµæµ',42 value: 0.0,43 },44 {45 perUnit: 'A',46 statusName: 'å
³é',47 statusColor: 'Grey',48 channelName: 'Bç¸çµæµ',49 value: 0.0,50 },51 {52 perUnit: 'A',53 statusName: 'å
³é',54 statusColor: 'Grey',55 channelName: 'Cç¸çµæµ',56 value: 0.0,57 },58 {59 perUnit: 'V',60 statusName: '缺ç¸æ¥è¦',61 statusColor: 'Red',62 channelName: 'Aç¸çµå',63 value: 0.0,64 },65 {66 perUnit: 'V',67 statusName: '缺ç¸æ¥è¦',68 statusColor: 'Red',69 channelName: 'Bç¸çµå',70 value: 0.0,71 },72 {73 perUnit: 'V',74 statusName: '缺ç¸æ¥è¦',75 statusColor: 'Red',76 channelName: 'Cç¸çµå',77 value: 0.0,78 },79 {80 perUnit: 'Hz',81 statusName: 'å
³é',82 statusColor: 'Grey',83 channelName: 'Aç¸é¢ç',84 value: 0.0,85 },86 {87 perUnit: 'Hz',88 statusName: 'å
³é',89 statusColor: 'Grey',90 channelName: 'Bç¸é¢ç',91 value: 0.0,92 },93 {94 perUnit: 'Hz',95 statusName: 'å
³é',96 statusColor: 'Grey',97 channelName: 'Cç¸é¢ç',98 value: 0.0,99 },100 {101 perUnit: '°',102 statusName: 'å
³é',103 statusColor: 'Grey',104 channelName: 'Aç¸çµåç¸ä½è§',105 value: 0.0,106 },107 {108 perUnit: '°',109 statusName: 'å
³é',110 statusColor: 'Grey',111 channelName: 'Bç¸çµåç¸ä½è§',112 value: 0.0,113 },114 {115 perUnit: '°',116 statusName: 'å
³é',117 statusColor: 'Grey',118 channelName: 'Cç¸çµåç¸ä½è§',119 value: 0.0,120 },121 {122 perUnit: '°',123 statusName: 'å
³é',124 statusColor: 'Grey',125 channelName: 'Aç¸çµæµç¸ä½è§',126 value: 0.0,127 },128 {129 perUnit: '°',130 statusName: 'å
³é',131 statusColor: 'Grey',132 channelName: 'Bç¸çµæµç¸ä½è§',133 value: 0.0,134 },135 {136 perUnit: '°',137 statusName: 'å
³é',138 statusColor: 'Grey',139 channelName: 'Cç¸çµæµç¸ä½è§',140 value: 0.0,141 },142 {143 perUnit: '%',144 statusName: 'å
³é',145 statusColor: 'Grey',146 channelName: 'Aç¸åçå ç´ ',147 value: 0.0,148 },149 {150 perUnit: '%',151 statusName: 'å
³é',152 statusColor: 'Grey',153 channelName: 'Bç¸åçå ç´ ',154 value: 0.0,155 },156 {157 perUnit: '%',158 statusName: 'å
³é',159 statusColor: 'Grey',160 channelName: 'Cç¸åçå æ°',161 value: 0.0,162 },163 {164 perUnit: '%',165 statusName: 'å
³é',166 statusColor: 'Grey',167 channelName: 'åç¸åçå ç´ ',168 value: 0.0,169 },170 {171 perUnit: 'KW',172 statusName: 'å
³é',173 statusColor: 'Grey',174 channelName: 'Aç¸æååç',175 value: 0.0,176 },177 {178 perUnit: 'KW',179 statusName: 'å
³é',180 statusColor: 'Grey',181 channelName: 'Bç¸æååç',182 value: 0.0,183 },184 {185 perUnit: 'KW',186 statusName: 'å
³é',187 statusColor: 'Grey',188 channelName: 'Cç¸æååç',189 value: 0.0,190 },191 {192 perUnit: 'KW',193 statusName: 'å
³é',194 statusColor: 'Grey',195 channelName: 'åç¸æååç',196 value: 0.0,197 },198 {199 perUnit: 'KVar',200 statusName: 'å
³é',201 statusColor: 'Grey',202 channelName: 'Aç¸æ ååç',203 value: 0.0,204 },205 {206 perUnit: 'KVar',207 statusName: 'å
³é',208 statusColor: 'Grey',209 channelName: 'Bç¸æ ååç',210 value: 0.0,211 },212 {213 perUnit: 'KVar',214 statusName: 'å
³é',215 statusColor: 'Grey',216 channelName: 'Cç¸æ ååç',217 value: 0.0,218 },219 {220 perUnit: 'KVar',221 statusName: 'å
³é',222 statusColor: 'Grey',223 channelName: 'åç¸æ ååç',224 value: 0.0,225 },226 {227 perUnit: 'KVA',228 statusName: 'å
³é',229 statusColor: 'Grey',230 channelName: 'Aç¸è§å¨åç',231 value: 0.0,232 },233 {234 perUnit: 'KVA',235 statusName: 'å
³é',236 statusColor: 'Grey',237 channelName: 'Bç¸è§å¨åç',238 value: 0.0,239 },240 {241 perUnit: 'KVA',242 statusName: 'å
³é',243 statusColor: 'Grey',244 channelName: 'Cç¸è§å¨åç',245 value: 0.0,246 },247 {248 perUnit: 'KVA',249 statusName: 'å
³é',250 statusColor: 'Grey',251 channelName: 'åç¸è§å¨åç',252 value: 0.0,253 },254 {255 perUnit: 'KWH',256 statusName: 'å
³é',257 statusColor: 'Grey',258 channelName: 'Aç¸æåçµè½',259 value: -1.073741824e8,260 },261 {262 perUnit: 'KWH',263 statusName: 'å
³é',264 statusColor: 'Grey',265 channelName: 'Bç¸æåçµè½',266 value: 6710886.4,267 },268 {269 perUnit: 'KWH',270 statusName: 'å
³é',271 statusColor: 'Grey',272 channelName: 'Cç¸æåçµè½',273 value: 2252.8,274 },275 {276 perUnit: 'KWH',277 statusName: 'å
³é',278 statusColor: 'Grey',279 channelName: 'åç¸æåçµè½',280 value: -1.610612736e8,281 },282 {283 perUnit: 'KVarH',284 statusName: 'å
³é',285 statusColor: 'Grey',286 channelName: 'Aç¸æ åçµè½',287 value: 157286.4,288 },289 {290 perUnit: 'KVarH',291 statusName: 'å
³é',292 statusColor: 'Grey',293 channelName: 'Bç¸æ åçµè½',294 value: 235929.6,295 },296 {297 perUnit: 'KVarH',298 statusName: 'å
³é',299 statusColor: 'Grey',300 channelName: 'Cç¸æ åçµè½',301 value: 1887436.8,302 },303 {304 perUnit: 'KVarH',305 statusName: 'æ¥è¦',306 statusColor: 'Red',307 channelName: 'åç¸æ åçµè½',308 value: 3.69098752e7,309 },310 {311 perUnit: 'KVAH',312 statusName: 'å
³é',313 statusColor: 'Grey',314 channelName: 'Aç¸è§å¨çµè½',315 value: 2.18103808e7,316 },317 {318 perUnit: 'KVAH',319 statusName: 'å
³é',320 statusColor: 'Grey',321 channelName: 'Bç¸è§å¨çµè½',322 value: 85196.8,323 },324 {325 perUnit: 'KVAH',326 statusName: 'å
³é',327 statusColor: 'Grey',328 channelName: 'Cç¸è§å¨çµè½',329 value: 327680.0,330 },331 {332 perUnit: 'KVAH',333 statusName: 'å
³é',334 statusColor: 'Grey',335 channelName: 'åç¸è§å¨çµè½',336 value: -8.05306368e7,337 },338 {339 perUnit: '%',340 statusName: 'å
³é',341 statusColor: 'Grey',342 channelName: 'ä¸ç¸çµæµå¹³è¡¡åº¦',343 value: 0.0,344 },345 {346 perUnit: '%',347 statusName: 'å
³é',348 statusColor: 'Grey',349 channelName: 'ä¸ç¸çµå平衡度',350 value: 0.0,351 },352 {353 perUnit: '强度',354 statusName: 'å
³é',355 statusColor: 'Grey',356 channelName: 'ä¿¡å·å¼ºåº¦',357 value: 56.0,358 },...
result.js
Source:result.js
1// pages/result/result.js2const app = getApp();3Page({4 /**5 * 页é¢çåå§æ°æ®6 */7 data: {8 point: '',9 status: '',10 pointColor: '',11 statusColor: '',12 standard: '',13 },14 /**15 * å¤ææ¯åªä¸ªè¯æµåï¼è·ååæ°ï¼å¹¶æ ¹æ®åæ°16 * 设å®ä¸åé¢è²17 */18 onLoad: function(options) {19 if (options.name == "sas") { //sasè¯æµ20 let point = options.point;21 let status = '';22 let pointColor = '';23 let statusColor = '';24 if (point <= 50) {25 status = "æ£å¸¸";26 pointColor = "text-olive";27 statusColor = "text-olive";28 } else if (point > 50 && point <= 60) {29 status = "轻度ç¦è";30 pointColor = "text-yellow";31 statusColor = "text-yellow";32 } else if (point > 60 && point <= 70) {33 status = "ä¸åº¦ç¦è";34 pointColor = "text-orange";35 statusColor = "text-orange";36 } else if (point > 70) {37 status = "é度ç¦è";38 pointColor = "text-red";39 statusColor = "text-red";40 }41 const standard = " ç¦èSASè¯æµè¯åæ åï¼æ£å计åé¢AãBãCãDæ1ã2ã3ã4å计ï¼åå计åé¢ï¼é¢ç®é¢å·ï¼5ã9ã13ã17ã19ï¼æ4ã3ã2ã1计åãæ»åä¹ä»¥1.25åæ´æ°ï¼å³å¾æ ååãä½äº50åè
为æ£å¸¸ï¼50-60åè
为轻度ç¦èï¼61-70åè
为ä¸åº¦ç¦èï¼70å以ä¸è
为é度ç¦èã";42 this.setData({43 point: point,44 status: status,45 pointColor: pointColor,46 statusColor: statusColor,47 standard: standard,48 })49 }50 if (options.name == "sds") { //sdsè¯æµ51 let point = options.point;52 let status = '';53 let pointColor = '';54 let statusColor = '';55 if (point <= 50) {56 status = "æ£å¸¸";57 pointColor = "text-olive";58 statusColor = "text-olive";59 } else if (point > 50 && point <= 60) {60 status = "轻度æé";61 pointColor = "text-yellow";62 statusColor = "text-yellow";63 } else if (point > 60 && point <= 70) {64 status = "ä¸åº¦æé";65 pointColor = "text-orange";66 statusColor = "text-orange";67 } else if (point > 70) {68 status = "é度æé";69 pointColor = "text-red";70 statusColor = "text-red";71 }72 const standard = " æéSDSè¯æµè¯åæ åï¼æ£å计åé¢AãBãCãDæ1ã2ã3ã4å计ï¼åå计åé¢ï¼é¢å·ï¼2ã5ã6ã11ã12ã14ã16ã17ã18ã20ï¼æ4ã3ã2ã1计åãæ»åä¹ä»¥1.25åæ´æ°ï¼å³å¾æ ååãä½äº50åè
为æ£å¸¸ï¼50-60åè
为轻度æéï¼61-70åè
为ä¸åº¦æéï¼70å以ä¸è
为é度æéã";73 this.setData({74 point: point,75 status: status,76 pointColor: pointColor,77 statusColor: statusColor,78 standard: standard,79 })80 }81 if (options.name == "sad") { //sadè¯æµ82 let point = options.point;83 let status = '';84 let pointColor = '';85 let statusColor = '';86 if (point < 13) {87 status = "æ£å¸¸";88 pointColor = "text-olive";89 statusColor = "text-olive";90 } else if (point >= 13 && point < 18) {91 status = "请åä¸ä¸äººå£«å¨è¯¢";92 pointColor = "text-yellow";93 statusColor = "text-yellow";94 } else if (point >= 18) {95 status = "请åä¸ä¸äººå£«å¯»æ±å¸®å©";96 pointColor = "text-red";97 statusColor = "text-red";98 }99 const standard = " 社交åé¿SADè¯æµè¯åæ åï¼å¨2ï¼5ï¼8ï¼10ï¼11ï¼13ï¼14ï¼16ï¼18ï¼20ï¼21ï¼23ï¼24ï¼26åçâæ¯âå¾1åï¼èå¨1ï¼3ï¼4ï¼6ï¼7ï¼9ï¼12ï¼15ï¼17ï¼19ï¼22ï¼25ï¼27ï¼28åçâå¦âå¾1åã1ãåæ°ä½äº7æ¶ï¼è¡¨ç¤ºä¸ªä½è¡¨ç°æ£å¸¸ï¼æ²¡æè¿æ¹é¢é®é¢ï¼2ãåæ°é«äºçäº7ï¼ä½ä½äº10æ¶ï¼å表示个ä½å¨è¿æ¹é¢å¯è½åå¨ä¸å®ç¨åº¦çé®é¢ï¼éè¦æ¥åè¿ä¸æ¥çä¸ä¸äººåçæ£æ¥ã3ãåæ°é«äºçäº10æ¶ï¼å表示åå¨è¿æ¹é¢çé®é¢ï¼éè¦æ¥åä¸ä¸ç帮å©ã";100 this.setData({101 point: point,102 status: status,103 pointColor: pointColor,104 statusColor: statusColor,105 standard: standard,106 })107 }108 if (options.name == "ses") { //sesè¯æµ109 let point = options.point;110 let status = '';111 let pointColor = '';112 let statusColor = '';113 if (point >= 10 && point < 20) {114 status = "è¾ä½";115 pointColor = "text-yellow";116 statusColor = "text-yellow";117 } else if (point >= 20 && point < 30) {118 status = "è¾é«";119 pointColor = "text-olive";120 statusColor = "text-olive";121 } else if (point >= 30) {122 status = "é«";123 pointColor = "text-green";124 statusColor = "text-green";125 }126 const standard = " 社交åé¿SADè¯æµè¯åæ åï¼å¯¹äºlï¼2ï¼4ï¼6ï¼7é¢(æ£åè®°åé¢)ï¼âå¾ä¸ç¬¦åâè®°1åãâä¸ç¬¦åâè®°2åãâ符åâè®°3åãâé常符åâè®°4åï¼å¯¹äº3ï¼5ï¼8ï¼9ï¼10é¢(ååè®°åé¢)ï¼âå¾ä¸ç¬¦åâè®°4åãâä¸ç¬¦åâè®°3åãâ符åâè®°2åãâé常符åâè®°1åãåå¼è¶é«ï¼èªå°ç¨åº¦è¶é«ã";127 this.setData({128 point: point,129 status: status,130 pointColor: pointColor,131 statusColor: statusColor,132 standard: standard,133 })134 }135 app.loginConfirm(); //æ´æ°å
¨å±ä¿¡æ¯136 },...
Using AI Code Generation
1define('crm/Views/Opportunity/Edit', [2], function(3) {4 var resource = window.localization || {5 "opportunity": {6 "status": {7 }8 }9 };10 var __class = declare('crm.Views.Opportunity.Edit', [Edit], {
Using AI Code Generation
1var argosy = require('argosy');2var statusColor = argosy.statusColor;3var argosy = require('argosy');4var statusColor = argosy.statusColor;5var argosy = require('argosy');6var statusColor = argosy.statusColor;7var argosy = require('argosy');8var statusColor = argosy.statusColor;9var argosy = require('argosy');10var statusColor = argosy.statusColor;11var argosy = require('argosy');12var statusColor = argosy.statusColor;13var argosy = require('argosy');14var statusColor = argosy.statusColor;15var argosy = require('argosy');16var statusColor = argosy.statusColor;17var argosy = require('argosy');18var statusColor = argosy.statusColor;19var argosy = require('argosy');20var statusColor = argosy.statusColor;21var argosy = require('argosy');22var statusColor = argosy.statusColor;23var argosy = require('argosy');24var statusColor = argosy.statusColor;25var argosy = require('argosy');26var statusColor = argosy.statusColor;27var argosy = require('argosy');28var statusColor = argosy.statusColor;29var argosy = require('argosy');
Using AI Code Generation
1require(['argos-saleslogix/Status'], function(Status) {2 Status.statusColor('Prospect');3});4require(['argos-saleslogix/Status'], function(Status) {5 Status.statusColor('Prospect', 'color');6});7require(['argos-saleslogix/Status'], function(Status) {8 Status.statusColor('Prospect', 'icon');9});10require(['argos-saleslogix/Status'], function(Status) {11 Status.statusColor('Prospect', 'iconClass');12});13require(['argos-saleslogix/Status'], function(Status) {14 Status.statusColor('Prospect', 'iconColor');15});16require(['argos-saleslogix/Status'], function(Status) {17 Status.statusColor('Prospect', 'iconColorClass');18});19require(['argos-saleslogix/Status'], function(Status) {20 Status.statusColor('Prospect', 'iconColorStyle');21});22require(['argos-saleslogix/Status'], function(Status) {23 Status.statusColor('Prospect', 'iconStyle');24});25require(['argos-saleslogix/Status'], function(Status) {26 Status.statusColor('Prospect', 'text');27});28require(['argos-saleslogix/Status'], function(Status) {29 Status.statusColor('Prospect', 'textClass');30});31require(['argos-saleslogix/Status'], function(Status) {32 Status.statusColor('Prospect', 'textStyle');33});
Using AI Code Generation
1var argosy = require('argosy');2var color = argosy.statusColor('green');3console.log(color);4var argosy = require('argosy');5var color = argosy.statusColor('green', true);6console.log(color);7var argosy = require('argosy');8var color = argosy.statusColor('green', true, 0.5);9console.log(color);10var argosy = require('argosy');11var color = argosy.statusColor('green', false, 0.5);12console.log(color);13var argosy = require('argosy');14var color = argosy.statusColor('green', true, 1.5);15console.log(color);16var argosy = require('argosy');17var color = argosy.statusColor('green', true, -0.5);18console.log(color);19var argosy = require('argosy');20var color = argosy.statusColor('green', true, 0);21console.log(color);22var argosy = require('argosy');23var color = argosy.statusColor('green', true, 1);24console.log(color);
Using AI Code Generation
1var statusColor = require('argos-saleslogix').StatusColor;2var color = require('argos-saleslogix/Utility').color;3import { color } from 'argos-saleslogix/Utility';4var domClass = require('argos-saleslogix/Utility').domClass;5import { domClass } from 'argos-saleslogix/Utility';6var domStyle = require('argos-saleslogix/Utility').domStyle;7import { domStyle } from 'argos-saleslogix/Utility';8var domAttr = require('argos-saleslogix/Utility').domAttr;9import { domAttr } from 'argos-saleslogix/Utility';10var domGeometry = require('argos-saleslogix/Utility').domGeometry;11import { domGeometry } from 'argos-saleslogix/Utility';12var domConstruct = require('argos-saleslogix/Utility').domConstruct;13import { domConstruct } from 'argos-saleslogix/Utility';14var dom = require('argos-saleslogix/Utility').dom;15import { dom } from 'argos-saleslogix/Utility';16var domProp = require('argos-saleslogix/Utility').domProp;17import { domProp } from 'argos-saleslogix/Utility';18var domForm = require('argos-saleslogix/Utility').domForm;19import { domForm } from 'argos-saleslogix/Utility';20var domQuery = require('argos-saleslogix/Utility').domQuery;21import { domQuery } from 'argos-saleslogix/Utility';22var domReady = require('argos-saleslogix/Utility').domReady;23import { domReady } from 'argos-saleslogix/Utility';24var domNode = require('argos-saleslogix/Utility').domNode;
Using AI Code Generation
1var colors = require('argosy-colors');2console.log('Status Color: ' + colors.statusColor('active'));3var colors = require('argosy-colors');4console.log('Status Color: ' + colors.statusColor('inactive'));5var colors = require('argosy-colors');6console.log('Status Color: ' + colors.statusColor('unknown'));7var colors = require('argosy-colors');8console.log('Status Color: ' + colors.statusColor('test'));9var colors = require('argosy-colors');10console.log('Status Color: ' + colors.statusColor(''));11var colors = require('argosy-colors');12console.log('Status Color: ' + colors.statusColor());13var colors = require('argosy-colors');14console.log('Status Color: ' + colors.statusColor(null));15var colors = require('argosy-colors');16console.log('Status Color: ' + colors.statusColor(undefined));17var colors = require('argosy-colors');18console.log('Status Color: ' + colors.statusColor(0));
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!!