({
|
doInit1 : function(component, event, helper) {
|
let rid = component.get('v.recordId');
|
console.log(rid);
|
let pid = window.location.href.replace("https://","").split("/");
|
pid = pid[pid.length-1].replace("new?","");
|
let jsonobj = {};
|
console.log(pid);
|
pid.split("&").forEach(function(v){
|
|
console.log(v);
|
let param = v.split("=");
|
jsonobj[param[0]] = param[1];
|
});
|
let urlStr = JSON.stringify(jsonobj);
|
console.log(urlStr);
|
// if (rid) {}
|
/*let pid = null;
|
if(!rid){
|
pid = window.location.href.replace("https://","").split("/")[4];
|
}
|
let isClone = component.get('v.isClone');
|
if(!rid || isClone){
|
component.set('v.title',$A.get("$Label.c.New")+'.客户人员');
|
}else{
|
component.set('v.title',$A.get("$Label.c.Edit")+'.客户人员');
|
}
|
|
let record_type_id = null;
|
let pageref = component.get("v.pageReference")
|
if(!record_type_id && pageref){
|
record_type_id = pageref.state.recordTypeId
|
}
|
component.set("v.showSpinner", true);*/
|
helper.CallBackAction(component,'init',{
|
recordId : rid,
|
urlStr : urlStr
|
},function(data){
|
console.log("data");
|
console.log(data);
|
});
|
},
|
doInit : function(component, event, helper) {
|
let rid = component.get('v.recordId');
|
// console.log(rid);
|
let pid = window.location.href.replace("https://","").split("/");
|
pid = pid[pid.length-1].replace("new?","");
|
let jsonobj = {};
|
// console.log(pid);
|
pid.split("&").forEach(function(v){
|
|
// console.log(v);
|
let param = v.split("=");
|
jsonobj[param[0]] = param[1];
|
});
|
let urlStr = JSON.stringify(jsonobj);
|
// console.log(urlStr);
|
component.set('v.urlStr',urlStr);
|
// create a one-time use instance of the serverEcho action
|
// in the server-side controller
|
/*var action = component.get("c.init");
|
action.setParams({
|
recordId : rid,
|
urlStr : urlStr
|
});
|
|
// Create a callback that is executed after
|
// the server-side action returns
|
action.setCallback(this, function(response) {
|
console.log("response");
|
console.log(response);
|
// var state = response.getState();
|
if (state === "SUCCESS") {
|
// Alert the user with the value returned
|
// from the server
|
alert("From server: " + response.getReturnValue());
|
|
// You would typically fire a event here to trigger
|
// client-side notification that the server-side
|
// action is complete
|
}
|
else if (state === "INCOMPLETE") {
|
// do something
|
}
|
else if (state === "ERROR") {
|
var errors = response.getError();
|
if (errors) {
|
if (errors[0] && errors[0].message) {
|
console.log("Error message: " +
|
errors[0].message);
|
}
|
} else {
|
console.log("Unknown error");
|
}
|
}
|
});
|
|
// optionally set storable, abortable, background flag here
|
|
// A client-side action could cause multiple events,
|
// which could trigger other events and
|
// other server-side action calls.
|
// $A.enqueueAction adds the server-side action to the queue.
|
$A.enqueueAction(action);*/
|
}
|
})
|