From e69ad8a253c04834488b00c2b1be138c583e40b5 Mon Sep 17 00:00:00 2001
From: LiJinHuan <lijinhuan@prec-tech.com>
Date: 星期四, 06 七月 2023 18:24:54 +0800
Subject: [PATCH] 调拨新建重写新建默认No.的值 *
---
force-app/main/default/aura/TransferApplyNew/TransferApplyNewController.js | 5 +
force-app/main/default/classes/lexRentalApplyFaultReportController.cls | 34 ++++++-----
force-app/main/default/lwc/lexTransferApplyNew/lexTransferApplyNew.js-meta.xml | 5 +
force-app/main/default/lwc/lexTransferApplyNew/lexTransferApplyNew.html | 3 +
force-app/main/default/aura/TransferApplyNew/TransferApplyNew.cmp-meta.xml | 5 +
force-app/main/default/aura/TransferApplyNew/TransferApplyNew.cmp | 33 +++++++++++
force-app/main/default/lwc/lexTransferApplyNew/__tests__/lexTransferApplyNew.test.js | 25 ++++++++
force-app/main/default/lwc/lexTransferApplyNew/lexTransferApplyNew.js | 41 +++++++++++++
8 files changed, 135 insertions(+), 16 deletions(-)
diff --git a/force-app/main/default/aura/TransferApplyNew/TransferApplyNew.cmp b/force-app/main/default/aura/TransferApplyNew/TransferApplyNew.cmp
new file mode 100644
index 0000000..e46431d
--- /dev/null
+++ b/force-app/main/default/aura/TransferApplyNew/TransferApplyNew.cmp
@@ -0,0 +1,33 @@
+<!--
+ * @Description:
+ * @Author: [lijinhuan]
+ * @Date: 2023-04-26 17:25:35
+ * @LastEditors: [lijinhuan]
+ * @LastEditTime: 2023-07-03 16:17:03
+-->
+<aura:component
+ implements="lightning:actionOverride,lightning:isUrlAddressable,force:lightningQuickAction,force:hasRecordId"
+ access="global">
+ <aura:html tag="style">
+ .slds-modal__container{
+ max-width: 65rem !important;
+ width:100% !important;
+ }
+ .cuf-content {
+ padding: 0 0rem !important;
+ }
+ .slds-p-around--medium {
+ padding: 0rem !important;
+ }
+ .slds-modal__content{
+ overflow-y:auto !important;
+ height:unset !important;
+ max-height:unset !important;
+ min-height:8rem;
+ }
+ .slds-tile_board{
+ padding:20px 40px;
+ }
+ </aura:html>
+ <c:lexTransferApplyNew />
+</aura:component>
\ No newline at end of file
diff --git a/force-app/main/default/aura/TransferApplyNew/TransferApplyNew.cmp-meta.xml b/force-app/main/default/aura/TransferApplyNew/TransferApplyNew.cmp-meta.xml
new file mode 100644
index 0000000..838df43
--- /dev/null
+++ b/force-app/main/default/aura/TransferApplyNew/TransferApplyNew.cmp-meta.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata">
+ <apiVersion>56.0</apiVersion>
+ <description>A Lightning Component Bundle</description>
+</AuraDefinitionBundle>
diff --git a/force-app/main/default/aura/TransferApplyNew/TransferApplyNewController.js b/force-app/main/default/aura/TransferApplyNew/TransferApplyNewController.js
new file mode 100644
index 0000000..77e406b
--- /dev/null
+++ b/force-app/main/default/aura/TransferApplyNew/TransferApplyNewController.js
@@ -0,0 +1,5 @@
+({
+ myAction : function(component, event, helper) {
+
+ }
+})
\ No newline at end of file
diff --git a/force-app/main/default/classes/lexRentalApplyFaultReportController.cls b/force-app/main/default/classes/lexRentalApplyFaultReportController.cls
index 601319b..e84a999 100644
--- a/force-app/main/default/classes/lexRentalApplyFaultReportController.cls
+++ b/force-app/main/default/classes/lexRentalApplyFaultReportController.cls
@@ -3,7 +3,7 @@
* @Author: [lijinhuan]
* @Date: 2023-06-25 20:04:41
* @LastEditors: [lijinhuan]
- * @LastEditTime: 2023-07-06 15:50:03
+ * @LastEditTime: 2023-07-06 17:22:39
*/
public without sharing class lexRentalApplyFaultReportController {
@AuraEnabled
@@ -39,24 +39,26 @@
//鏌ュ綋鍓嶆槑缁嗕笅鏈夊灏戞晠闅滄姤鍛�
// 0 娌℃湁鎶ュ憡
// Id 鏈� 鏈�鏂颁竴鏉′负鑽夋涓�
- // 2 鏈夊緢澶氭潯
- Map<String,String> sIdMap = New Map<String,String>();
- for(Rental_Apply_Fault__c raf : [SELECT Id ,status__c ,Rental_Apply_Equipment_Set_Detail__c from Rental_Apply_Fault__c where Rental_Apply_Equipment_Set_Detail__c in :eIds Order By CreatedDate DESC]){
- if(!sIdMap.containsKey(raf.Rental_Apply_Equipment_Set_Detail__c)){
- sIdMap.put(raf.Rental_Apply_Equipment_Set_Detail__c,raf.Id);
+ // 2 鏈夊緢澶氭潯 娌℃湁杩欎釜鍦烘櫙
+ if(eIds.size() > 0){
+ Map<String,String> sIdMap = New Map<String,String>();
+ for(Rental_Apply_Fault__c raf : [SELECT Id ,status__c ,Rental_Apply_Equipment_Set_Detail__c from Rental_Apply_Fault__c where Rental_Apply_Equipment_Set_Detail__c in :eIds Order By CreatedDate DESC]){
+ if(!sIdMap.containsKey(raf.Rental_Apply_Equipment_Set_Detail__c)){
+ sIdMap.put(raf.Rental_Apply_Equipment_Set_Detail__c,raf.Id);
+ }
}
- }
- for(Rental_Apply_Equipment_Set_Detail__c rae : eList){
- RetObject temp = new RetObject();
- temp.rae = rae;
- if(sIdMap.containsKey(rae.Id)){
- temp.faultId = sIdMap.get(rae.Id) ;
- }else{
- temp.faultId = '';
+ for(Rental_Apply_Equipment_Set_Detail__c rae : eList){
+ RetObject temp = new RetObject();
+ temp.rae = rae;
+ if(sIdMap.containsKey(rae.Id)){
+ temp.faultId = sIdMap.get(rae.Id) ;
+ }else{
+ temp.faultId = '';
+ }
+ retObjectList.add(temp);
}
- retObjectList.add(temp);
+ return retObjectList;
}
- return retObjectList;
}
catch (Exception e) {
System.debug('*******lexRentalApplyFaultReportController******'+e.getMessage());
diff --git a/force-app/main/default/lwc/lexTransferApplyNew/__tests__/lexTransferApplyNew.test.js b/force-app/main/default/lwc/lexTransferApplyNew/__tests__/lexTransferApplyNew.test.js
new file mode 100644
index 0000000..68afd6d
--- /dev/null
+++ b/force-app/main/default/lwc/lexTransferApplyNew/__tests__/lexTransferApplyNew.test.js
@@ -0,0 +1,25 @@
+import { createElement } from 'lwc';
+import LexTransferApplyNew from 'c/lexTransferApplyNew';
+
+describe('c-lex-transfer-apply-new', () => {
+ afterEach(() => {
+ // The jsdom instance is shared across test cases in a single file so reset the DOM
+ while (document.body.firstChild) {
+ document.body.removeChild(document.body.firstChild);
+ }
+ });
+
+ it('TODO: test case generated by CLI command, please fill in test logic', () => {
+ // Arrange
+ const element = createElement('c-lex-transfer-apply-new', {
+ is: LexTransferApplyNew
+ });
+
+ // Act
+ document.body.appendChild(element);
+
+ // Assert
+ // const div = element.shadowRoot.querySelector('div');
+ expect(1).toBe(1);
+ });
+});
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexTransferApplyNew/lexTransferApplyNew.html b/force-app/main/default/lwc/lexTransferApplyNew/lexTransferApplyNew.html
new file mode 100644
index 0000000..27e0f69
--- /dev/null
+++ b/force-app/main/default/lwc/lexTransferApplyNew/lexTransferApplyNew.html
@@ -0,0 +1,3 @@
+<template>
+
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexTransferApplyNew/lexTransferApplyNew.js b/force-app/main/default/lwc/lexTransferApplyNew/lexTransferApplyNew.js
new file mode 100644
index 0000000..36be97d
--- /dev/null
+++ b/force-app/main/default/lwc/lexTransferApplyNew/lexTransferApplyNew.js
@@ -0,0 +1,41 @@
+/*
+ * @Description: 鏂板缓璋冩嫧閲嶅啓 No. 榛樿*
+ * @Author: [lijinhuan]
+ * @Date: 2023-07-03 15:55:28
+ * @LastEditors: [lijinhuan]
+ * @LastEditTime: 2023-07-06 18:05:15
+ */
+import { LightningElement,wire } from 'lwc';
+import { CurrentPageReference,NavigationMixin } from 'lightning/navigation';
+import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
+export default class LexTransferApplyNew extends NavigationMixin(LightningElement) {
+ recordTypeId;
+ @wire(CurrentPageReference)
+ getStateParameters(currentPageReference) {
+ if (currentPageReference) {
+ const urlValue = currentPageReference.state.recordTypeId;
+ if (urlValue) {
+ let str = `${urlValue}`;
+ this.recordTypeId = str;
+ let defaultFieldValues = {};
+ defaultFieldValues['Name'] = '*';
+ this[NavigationMixin.Navigate]({
+ type: 'standard__objectPage',
+ attributes: {
+ objectApiName: 'TransferApply__c',
+ actionName: 'new'
+ },
+ state: {
+ nooverride: '1',
+ defaultFieldValues: encodeDefaultFieldValues(defaultFieldValues),
+ recordTypeId: this.recordTypeId,
+ useRecordTypeCheck: 1,
+ navigationLocation: 'LIST_VIEW',
+ backgroundContext: '/lightning/o/TransferApply__c/list?filterName=Recent&0.source=alohaHeader'
+ }
+ });
+ }
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexTransferApplyNew/lexTransferApplyNew.js-meta.xml b/force-app/main/default/lwc/lexTransferApplyNew/lexTransferApplyNew.js-meta.xml
new file mode 100644
index 0000000..3fe0e73
--- /dev/null
+++ b/force-app/main/default/lwc/lexTransferApplyNew/lexTransferApplyNew.js-meta.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
+ <apiVersion>57.0</apiVersion>
+ <isExposed>false</isExposed>
+</LightningComponentBundle>
\ No newline at end of file
--
Gitblit v1.9.1