Виджет отчета в Web App Builder Developer Edition - PullRequest
0 голосов
/ 16 марта 2020

Я создаю виджет отчета с использованием дополнения ESIRs Web AppBuilder Developers. В моем веб-приложении есть интерактивная карта и инфографика. Я хочу создать виджет отчета, который распечатывает карту и инфографику. Имеющийся у меня виджет отчета может распечатать карту, но как мне написать в Javascript, чтобы также распечатать инфографику с веб-карты? Используемые мной виджеты infographi c являются стандартными, которые поставляются с Web AppBuilder. Я новичок в Javascript, поэтому любая помощь будет оценена. Вот виджет отчета. js:

    define(['dojo/_base/declare', 'jimu/BaseWidget', 'jimu/dijit/Report', 'jimu/dijit/PageUtils'],
function(declare, BaseWidget, Report, PageUtils) {
  //To create a widget, you need to derive from BaseWidget.
  return declare([BaseWidget], {
    // DemoWidget code goes here

    //please note that this property is be set by the framework when widget is loaded.
    //templateString: template,

    baseClass: 'jimu-widget-report',

    postCreate: function() {
      this.inherited(arguments);
      console.log('postCreate');
    },

    startup: function() {
      this.inherited(arguments);

      this.report = new Report({
            footNotes: "Report Generated by James",
            printTaskUrl: "http://utility.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task",
            reportLayout: {
              "pageSize": PageUtils.PageSizes.A4,
              "orientation": PageUtils.Orientation.Landscape
            }
          });

      console.log('startup');
    },

    onOpen: function(){
      console.log('onOpen');
    },

    onClose: function(){
      console.log('onClose');
    },

    onMinimize: function(){
      console.log('onMinimize');
    },

    onMaximize: function(){
      console.log('onMaximize');
    },

    onSignIn: function(credential){
      /* jshint unused:false*/
      console.log('onSignIn');
    },

    onSignOut: function(){
      console.log('onSignOut');
    },

    _onBtnPrintClicked: function(){
        var printData = [
        {
          addPageBreak: true,
          type: "map",
          map: this.map
        }
...