0.0.99 • Published 21 days ago

@datlas/mdt-lib v0.0.99

Weekly downloads
-
License
-
Repository
-
Last release
21 days ago

使用说明

npm install @datlas/mdt-lib
yarn add @datlas/mdt-lib
import MapEditView from '@datlas/mdt-lib/MapEditView'; // 地图组件,使用到地图时引入
import ChartPreview from '@datlas/mdt-lib/ChartPreview'; // 图表组件,使用到图表时引入
import '@datlas/mdt-lib/ChartPreview.css'; // 地图 | 图表  所有的样式代码。使用必须引入

        <MapEditView
            id="9bb6331a-a762-4a39-b3ce-34d055c6fef6" // 地图在编辑页面时 地址栏id
            token={'965f3e3d-8b35-4487-aa01-cf8b6dc61f66'}// 地图拥有者的 user_token
            type="work" // work 为工作台状态
            appid={'88'} // 地图拥有者所对应的app的id
            style={{ width: '100vw', height: '100vh'}} // 地图大小等设置
        />
        <ChartPreview
            chartUuid="17be665f-874e-4c78-b69c-1313d6b55c25"// 图表在编辑页面 地址栏id
            token={'965f3e3d-8b35-4487-aa01-cf8b6dc61f66'}// 图表拥有者的 user_token
            style={{width: '100px', height: '100px'}}// 地图大小等设置
        />
  • 需要在index.html的html标签上添加 data-theme="dark"(目前代表组件的主题,未来可能优化)

window.__DATAMAP_CFS__ 参数说明

const matchs = new RegExp(/(\d+)$/).exec(window.location.host.split('.')[0]);
let env;
if (matchs) {
  env = matchs[1];
}
window.__DATAMAP_CFS__ = {
  deployPublicPath: '/dataapp/',
  deployCdnPath: !env || env === '1' ? `https://statics-cdn${env || ''}.maicedata.com` : '',
  deployEnableHashRouter: false,
  publicFileHost: 'https://public-cdn.maicedata.com/',
  base: {
    host: 'datlas.maicedata.com/api',
    force_update: false,
    gtm: false,
    recommend_url: 'resource.idatatlas.com/recommend',
    // ga_track_id: 'UA-152890991-6',
    ga_track_id: '',
    language: '',
    title: '', //网页标题
    ico: '', // 网页icon
  },
  hideLogout: false, //是否隐藏预览页“退出登录”
  enableBff: false, //是否启用bff
  enableWxSdk: true,
  wxShareTitle: '欢迎使用脉策Datlas', // 微信分享标题
  wxShareDesc: '快速发布你的“地图轻应用”', // 微信分享描述
  wxShareLink: '', // 微信分享链接
  wxShareImgUrl: 'https://statics-cdn.maicedata.com/datlas-statics/images/logo.svg', // 微信分享图标
  sentry: {
    enable: true,
    env: 'prod',
    dsn: 'https://078e38a804a346268118297d53c3bdfa@sentry2.idatatlas.com/14',
  },
  // file_server: {
  //   private: false,
  //   // oss_bucket: 'mdt-staging-public.oss-cn-hangzhou.aliyuncs.com',
  //   oss_bucket: 'minio.idatatlas.com/mdt-staging-public/',
  //   oss_bucket_private: 'mdt-staging.oss-cn-hangzhou.aliyuncs.com',
  //   privateRead: false,
  // },
  ws: { host: window.location.origin },
  statics: { host: window.location.host + '/datlas-statics' },
  admin: { host: 'https://admin.maicedata.com' },
  old: { host: 'https://www.maicedata.com/' },
  share: { host: window.location.origin + '/' },
  storeOld: { host: 'https://datamarket.maicedata.com/' },
  store: { host: window.location.origin + '/datamarket/' },
  factory: { host: window.location.origin + '/datafactory/' },
  collector: { host: 'https://collectoradmin.maicedata.com' },
  workFlow: { host: window.location.origin + '/workflow' },
  organizationManagement: { host: window.location.origin + '/iframe-dataapp/orgadmin/' },
  ResourceShare: { host: window.location.origin + '/iframe-dataapp/share/' },
  jsonEditor: { host: window.location.origin + '/statics/mdt-amis-editor/' },
  mapEditor: { host: window.location.origin + '/dataeditor/' },
  matomo: {
    host: 'https://matomo.idatatlas.com/js/container_3dk0d2p3.js',
  },
  map: { settings: {} },
  myData: {
    host: window.location.origin + '/iframe-dataapp/mydata',
  },
  helpCenter: {
    host: window.location.origin + '/statics/help/datlas/#/zh-cn/quick_start/datlas_introduction',
  },
  login: {
    privacy: true,
    wechat_appid: 'wx737a39a6ecfb066a',
    wechat_redirect: '',
    ding_appid: 'dingoah6wnj05gogocpavz',
    ding_redirect: '',
    u2f_appid: '',
    register: false,
    oa_api: '',
    sso: {
      out: false,
      params: null, // ticket、code,url query里字段
      api_params: null, // api请求参数 ['ticket'] ticket=xxx
      cookie: null, // [{ cookie_key: 'AuthUser_AuthToken'; body_key: 'auth_token' },{cookie_key: 'AuthUser_LoginId'; body_key: 'login_id'}];
      api_method: '', // post | get(default)
      api: '', //免密登陆接口地址 // https://dev.idatatlas.com/auth/sso/login
      logout_ref: window.location.origin + '/sso/', // 退出登陆返回地址
      error_page: '', // 接口解析失败的回调地址
    },
    header_logo_url: '',
    logo_url: '',
    bg_url: '',
    bg_type: '',
    default_by: '',
    login_bys: null,
    personalized_success_jump_url: '',
    page_style: null,
    page_extra: null,
  },
};

地图props

props类型默认值描述
idstring‘000’查找/接口等uuid
typestring'work'\ 'empty'地图类型
tokenstring''接口权限token
appidstring''user所在app
DatlasCfgobject{}window.__DATAMAP_CFS__
styleCSSProperties-组件外层包裹样式
cardCustomerMenu( { cardId } ) => React.ReactNode-自定义card-menu
customerIcons{ showIcon?: string; hideIcon?: string; }-部分icon自定义设置
@analytics/google-analytics@analytics/perfumejs@datlas/brace@datlas/design@datlas/instrument-cra@datlas/react-ace@i18n-chain/react@laverdet/lokesh-quantize@loadable/component@mapbox/polylabel@mapbox/tiny-sdf@mdt/product-micro-modules@metro/components@metro/icons@micro-zoe/micro-app@syncpoint/wkx@tanem/react-nprogress@turf/turf@types/react-grid-layout@videojs/http-streamingahooksajvali-ossali-react-tableali-react-table-forkanalyticsanimated-scroll-toantd-mobileanymatcharray-moveawesome-phonenumber-forkaxiosblobbootstrapbraft-convertbraft-editorbraft-utilsbufferchroma-jsclassnamescocomponent-emittercoordtransformcopy-to-clipboardcore-jscore-util-iscrypto-browserifycrypto-jsdayjsdecamelizedom-to-imagedraft-jsdraft-js-export-htmldraft-js-import-htmldraftjs-utilsearcutechartsecharts-wordcloudentity-converteventemitter2exceljsfakerfile-savergcoordgeobufhtml-to-imagehtml2canvashttps-browserifyignore-loaderimmutableis-emailis-urlis-uuidismobilejsjqueryjs-beautifyjs-cookiejszipkonvalocalforagelodashlz-stringmaptalksmaptalks.snapmaptalks.threemb-sketch-rulerminiomobxmobx-reactomit.jspdfjs-distperf-requestperfect-scrollbarperfume.jsqrcodeqsrbushrc-alignrc-menureactreact-beautiful-dndreact-colorreact-contextmenureact-copy-to-clipboardreact-countupreact-dnd-html5-backendreact-domreact-draggablereact-dropzonereact-grid-layoutreact-id-swiperreact-isreact-json-viewreact-lazyloadreact-markdownreact-pdfreact-progressive-bg-imagereact-resizablereact-rndreact-routerreact-router-domreact-stickyreact-syntax-highlighterreact-transition-groupreact-usereact-virtualizedrrwebscreenfullsimple-statisticssimpleheatsocket.io-clientspark-md5sql-formatter-forkstats.jsstyled-componentssuperstructswipertableexportthreethree-text2dtree-modeltroika-three-textturf-multilinestringturf-multipolygonturf-pointturf-polygonu2f-apiurl-joinuuidvideo.jsvideojs-vrxlsx
0.0.97

21 days ago

0.0.98

21 days ago

0.0.99

21 days ago

0.0.96

1 month ago

0.0.95

1 month ago

0.0.94

4 months ago

0.0.93

4 months ago

0.0.90

5 months ago

0.0.91

5 months ago

0.0.92

5 months ago

0.0.84

6 months ago

0.0.85

6 months ago

0.0.86

6 months ago

0.0.87

5 months ago

0.0.88

5 months ago

0.0.89

5 months ago

0.0.80

9 months ago

0.0.81

8 months ago

0.0.82

8 months ago

0.0.83

7 months ago

0.0.78

10 months ago

0.0.80-es-1

9 months ago

0.0.79-es-4

9 months ago

0.0.79-es-3

9 months ago

0.0.77

10 months ago

0.0.73

11 months ago

0.0.74

11 months ago

0.0.75

11 months ago

0.0.76

11 months ago

0.0.72

12 months ago

0.0.62

12 months ago

0.0.63

12 months ago

0.0.60

12 months ago

0.0.61

12 months ago

0.0.59

1 year ago

0.0.58

1 year ago

0.0.53

1 year ago

0.0.54

1 year ago

0.0.55

1 year ago

0.0.56

1 year ago

0.0.57

1 year ago

0.0.52

1 year ago

0.0.47

1 year ago

0.0.51

1 year ago

0.0.50

1 year ago

0.0.48

1 year ago

0.0.49

1 year ago

0.0.40

1 year ago

0.0.41

1 year ago

0.0.42

1 year ago

0.0.43

1 year ago

0.0.44

1 year ago

0.0.45

1 year ago

0.0.46

1 year ago

0.0.37

1 year ago

0.0.38

1 year ago

0.0.39

1 year ago

0.0.30

1 year ago

0.0.31

1 year ago

0.0.32

1 year ago

0.0.33

1 year ago

0.0.34

1 year ago

0.0.35

1 year ago

0.0.36

1 year ago

0.0.29

1 year ago

0.0.26

1 year ago

0.0.27

1 year ago

0.0.28

1 year ago

0.0.20

2 years ago

0.0.21

2 years ago

0.0.22

2 years ago

0.0.23

2 years ago

0.0.24

1 year ago

0.0.25

1 year ago

0.0.19

2 years ago

0.0.17

2 years ago

0.0.18

2 years ago

0.0.16

2 years ago

0.0.11-alpha.1

2 years ago

0.0.11-alpha.2

2 years ago

0.0.11-alpha.3

2 years ago

0.0.13-alpha.3

2 years ago

0.0.13-alpha.2

2 years ago

0.0.13-alpha.1

2 years ago

0.0.15

2 years ago

0.0.11

2 years ago

0.0.12

2 years ago

0.0.13

2 years ago

0.0.10

2 years ago

0.0.7-v2-alpha.9

2 years ago

0.0.7-v2-alpha.8

2 years ago

0.0.7-alpha.9

2 years ago

0.0.7-alpha.8

2 years ago

0.0.7-alpha.7

2 years ago

0.0.7-v2-alpha.7

2 years ago

0.0.7-v2-alpha.1

2 years ago

0.0.7-v2-alpha.2

2 years ago

0.0.7-v2-alpha.5

2 years ago

0.0.7-v2-alpha.6

2 years ago

0.0.7-v2-alpha.3

2 years ago

0.0.7-v2-alpha.4

2 years ago

0.0.8-alpha.1

2 years ago

0.0.7-alpha.10

2 years ago

0.0.7-alpha.12

2 years ago

0.0.9

2 years ago

0.0.7-alpha.1

2 years ago

0.0.7-alpha.4

2 years ago

0.0.7-alpha.3

2 years ago

0.0.7-alpha.2

2 years ago

0.0.5

2 years ago

0.0.7

2 years ago

0.0.4-alpha.3

2 years ago

0.0.6

2 years ago

0.0.4-alpha.4

2 years ago

0.0.3-beta.7

2 years ago

0.0.3-beta.4

3 years ago

0.0.3-beta.3

3 years ago

0.0.3-beta.2

3 years ago