import { LightningElement, track, wire } from 'lwc'; import init from '@salesforce/apex/ContractdetailpdfController.init'; const columns = [ { label: 'Item_Order__c', fieldName: 'Item_Order__c' }, { label: 'Asset_Model_No_forPrint__c', fieldName: 'Asset_Model_No_forPrint__c' }, { label: 'NameForPrintDelimiter__c', fieldName: 'NameForPrintDelimiter__c' }, { label: 'NameForPrint__c', fieldName: 'NameForPrint__c' }, { label: 'ApprobationNo_c', fieldName: 'ApprobationNo_c' }, { label: 'ProduceCompany_c', fieldName: 'ProduceCompany_c' }, { label: 'SalesPackagingUnit_c', fieldName: 'SalesPackagingUnit_c' }, { label: 'PackingListManual_c', fieldName: 'PackingListManual_c' }, { label: 'qli.Quantity', fieldName: 'qli.Quantity' }, { label: 'qli.GuaranteePeriod__c', fieldName: 'qli.GuaranteePeriod__c' }, { label: 'qli.DeliveryDate__c', fieldName: 'qli.DeliveryDate__c', type: 'date' } // { label: 'Website', fieldName: 'Asset_Model_No_forPrint__c', type: 'url' }, // { label: 'Phone', fieldName: 'phone', type: 'phone' }, // { label: 'Balance', fieldName: 'amount', type: 'currency' }, // { label: 'CloseAt', fieldName: 'closeAt', type: 'date' }, ]; export default class lexContractdetailpdf extends LightningElement { items = []; data=[]; Contract_Detail_Title="标题"; columns=columns ; params={ trade:false, PurchaseType:false }; connectedCallback() { init().then(res=>{ console.log("res:"); console.log(res); this.data=res; this.items=res; }) } generateData( amountOfRecords ) { return [...Array(amountOfRecords)].map((_, index) => { return { name: `Name (${index})`, website: 'www.salesforce.com', amount: Math.floor(Math.random() * 100), phone: `${Math.floor(Math.random() * 9000000000) + 1000000000}`, closeAt: new Date( Date.now() + 86400000 * Math.ceil(Math.random() * 20) ), }; }); } }