0.1.5 • Published 8 months ago

@datlas/mdt-lib v0.1.5

Weekly downloads
-
License
-
Repository
-
Last release
8 months 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__ = {
  filePreviewUrl: 'https://kkfileview.maicedata.com/onlinePreview',
  deployPublicPath: '/dataapp/',
  deployCdnPath: !env || env === '1' ? `https://statics-cdn${env || ''}.maicedata.com` : '',
  deployEnableHashRouter: false,
  publicFileHost: 'https://public-cdn.maicedata.com/',
  base: {
    host: window.location.host + '/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
  },
  noPermissionPageTip: '', // 没权限页面文案
  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' },
  oneTable: { host: window.location.origin + '/onetable' },
  organizationManagement: { host: window.location.origin + '/iframe-dataapp/orgadmin/' },
  ResourceShare: { host: window.location.origin + '/iframe-dataapp/share/' },
  jsonEditor: { host: window.location.origin + '/mdtamiseditor/' },
  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/perf-request@datlas/react-ace@i18n-chain/react@laverdet/lokesh-quantize@loadable/component@mapbox/polylabel@mapbox/tiny-sdf@mdt/product-micro-modules@metro/colors@metro/components@micro-zoe/micro-app@sql-generator/sql-builder-mdt@sql-generator/sql-editor-mdt@sql-generator/utils@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-reactmonaco-editor-webpack-pluginomit.jspdfjs-distperfect-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-astsql-formatter-forkstats.jsstyled-componentssuperstructswipertableexportthreethree-text2dtree-modeltroika-three-textturf-multilinestringturf-multipolygonturf-pointturf-polygonu2f-apiurl-joinuuidvideo.jsvideojs-vrxlsx
0.1.5

8 months ago

0.1.2

9 months ago

0.1.1

9 months ago

0.1.4

8 months ago

0.1.3

9 months ago

0.0.97

1 year ago

0.0.98

1 year ago

0.0.99

1 year ago

0.0.96

1 year ago

0.0.95

1 year ago

0.0.94

1 year ago

0.0.93

1 year ago

0.0.90

2 years ago

0.0.91

2 years ago

0.0.92

2 years ago

0.0.84

2 years ago

0.0.85

2 years ago

0.0.86

2 years ago

0.0.87

2 years ago

0.0.88

2 years ago

0.0.89

2 years ago

0.0.80

2 years ago

0.0.81

2 years ago

0.0.82

2 years ago

0.0.83

2 years ago

0.0.78

2 years ago

0.0.80-es-1

2 years ago

0.0.79-es-4

2 years ago

0.0.79-es-3

2 years ago

0.0.77

2 years ago

0.0.73

2 years ago

0.0.74

2 years ago

0.0.75

2 years ago

0.0.76

2 years ago

0.0.72

2 years ago

0.0.62

2 years ago

0.0.63

2 years ago

0.0.60

2 years ago

0.0.61

2 years ago

0.0.59

2 years ago

0.0.58

2 years ago

0.0.53

2 years ago

0.0.54

2 years ago

0.0.55

2 years ago

0.0.56

2 years ago

0.0.57

2 years ago

0.0.52

2 years ago

0.0.47

2 years ago

0.0.51

2 years ago

0.0.50

2 years ago

0.0.48

2 years ago

0.0.49

2 years ago

0.0.40

2 years ago

0.0.41

2 years ago

0.0.42

2 years ago

0.0.43

2 years ago

0.0.44

2 years ago

0.0.45

2 years ago

0.0.46

2 years ago

0.0.37

2 years ago

0.0.38

2 years ago

0.0.39

2 years ago

0.0.30

3 years ago

0.0.31

3 years ago

0.0.32

3 years ago

0.0.33

3 years ago

0.0.34

3 years ago

0.0.35

2 years ago

0.0.36

2 years ago

0.0.29

3 years ago

0.0.26

3 years ago

0.0.27

3 years ago

0.0.28

3 years ago

0.0.20

3 years ago

0.0.21

3 years ago

0.0.22

3 years ago

0.0.23

3 years ago

0.0.24

3 years ago

0.0.25

3 years ago

0.0.19

3 years ago

0.0.17

3 years ago

0.0.18

3 years ago

0.0.16

3 years ago

0.0.11-alpha.1

3 years ago

0.0.11-alpha.2

3 years ago

0.0.11-alpha.3

3 years ago

0.0.13-alpha.3

3 years ago

0.0.13-alpha.2

3 years ago

0.0.13-alpha.1

3 years ago

0.0.15

3 years ago

0.0.11

3 years ago

0.0.12

3 years ago

0.0.13

3 years ago

0.0.10

3 years ago

0.0.7-v2-alpha.9

3 years ago

0.0.7-v2-alpha.8

3 years ago

0.0.7-alpha.9

4 years ago

0.0.7-alpha.8

4 years ago

0.0.7-alpha.7

4 years ago

0.0.7-v2-alpha.7

3 years ago

0.0.7-v2-alpha.1

3 years ago

0.0.7-v2-alpha.2

3 years ago

0.0.7-v2-alpha.5

3 years ago

0.0.7-v2-alpha.6

3 years ago

0.0.7-v2-alpha.3

3 years ago

0.0.7-v2-alpha.4

3 years ago

0.0.8-alpha.1

3 years ago

0.0.7-alpha.10

4 years ago

0.0.7-alpha.12

3 years ago

0.0.9

3 years ago

0.0.7-alpha.1

4 years ago

0.0.7-alpha.4

4 years ago

0.0.7-alpha.3

4 years ago

0.0.7-alpha.2

4 years ago

0.0.5

4 years ago

0.0.7

4 years ago

0.0.4-alpha.3

4 years ago

0.0.6

4 years ago

0.0.4-alpha.4

4 years ago

0.0.3-beta.7

4 years ago

0.0.3-beta.4

4 years ago

0.0.3-beta.3

4 years ago

0.0.3-beta.2

4 years ago