├── .circleci └── config.yml ├── .cz-config.js ├── .editorconfig ├── .eslintrc.js ├── .gitattributes ├── .gitee ├── ISSUE_TEMPLATE.zh-CN.md └── PULL_REQUEST_TEMPLATE.zh-CN.md ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── config.yml │ ├── feature_request.md │ └── need-help-issue.md ├── PULL_REQUEST_TEMPLATE.md ├── SECURITY.md ├── codecov.yml ├── dependabot.yml ├── release-drafter.yml ├── renovate.json └── workflows │ ├── clear.yml │ ├── deploy.yml │ ├── release.yml │ ├── setup │ └── lighthouse-audit.json │ └── sync.yml ├── .gitignore ├── .husky ├── commit-msg ├── pre-commit └── pre-push ├── .stylelintrc.js ├── .travis.yml ├── CHANGELOG.EN.md ├── CHANGELOG.ZH.md ├── CHANGELOG.md ├── LICENSE ├── README-CN.md ├── README.md ├── api └── proxy.js ├── appveyor.yml ├── azure-pipelines.yml ├── babel.config.js ├── commitlint.config.js ├── jsconfig.json ├── netlify.sh ├── package.json ├── patches └── rc-input-number+7.4.0.patch ├── prettier.config.js ├── public ├── assets │ ├── bg │ │ ├── bg.gif │ │ ├── bg_title.png │ │ ├── bg_title1.png │ │ ├── bg_warning.png │ │ ├── experience-back.png │ │ ├── experience-box-bg.png │ │ ├── experience-left-hover.png │ │ ├── experience-left.png │ │ ├── head.png │ │ ├── pageBg.png │ │ └── screen_center.png │ └── images │ │ ├── Asian │ │ ├── 14b9c258440baff15cdb5fe5490da8d.png │ │ ├── 16448075019322.png │ │ └── 5138162066c98d21b4467e3ad7bbb04.jpg │ │ ├── Device │ │ ├── 1.png │ │ └── 2.png │ │ ├── loading.gif │ │ ├── logo │ │ ├── dgiot_logo.png │ │ ├── dgiot_logo1.png │ │ └── logo.png │ │ ├── plant │ │ └── gc.png │ │ ├── platform │ │ └── assets │ │ │ ├── empty_images │ │ │ └── data_empty.png │ │ │ ├── error_images │ │ │ ├── 403.png │ │ │ ├── 404.png │ │ │ └── cloud.png │ │ │ └── login_images │ │ │ ├── background.jpg │ │ │ ├── login_form.png │ │ │ └── stretch.png │ │ └── topo │ │ ├── bg │ │ └── boiler.jpg │ │ └── screen │ │ └── card.png ├── dist │ ├── element-icons.ttf │ └── element-icons.woff ├── favicon.ico ├── fonts │ ├── ionicons.svg │ ├── ionicons.ttf │ ├── ionicons.woff │ └── ionicons.woff2 ├── img │ └── icons │ │ ├── android-chrome-192x192.png │ │ ├── favicon-16x16.png │ │ └── favicon-32x32.png ├── index.html ├── manifest.webmanifest ├── robots.txt └── undefined ├── src ├── App.vue ├── api │ ├── Acl │ │ └── index.js │ ├── Article │ │ └── index.js │ ├── Batch │ │ └── index.js │ ├── Category │ │ └── index.js │ ├── Channel │ │ └── index.js │ ├── Dba │ │ ├── device-category.json │ │ └── index.js │ ├── Device │ │ ├── device-category.json │ │ └── index.js │ ├── Dict │ │ └── index.js │ ├── Dlink │ │ └── index.js │ ├── Evidence │ │ └── index.js │ ├── Export │ │ └── index.js │ ├── Exproto │ │ └── index.js │ ├── File │ │ └── index.js │ ├── Group │ │ └── index.js │ ├── Hash │ │ └── index.js │ ├── License │ │ └── index.js │ ├── Logs │ │ └── index.js │ ├── MasterData │ │ └── index.js │ ├── Menu │ │ └── index.js │ ├── MetaData │ │ └── index.js │ ├── Mock │ │ ├── SystemLog │ │ │ └── index.js │ │ ├── konva │ │ │ └── index.js │ │ ├── plant │ │ │ └── index.js │ │ └── table │ │ │ └── index.js │ ├── Modeling │ │ └── index.js │ ├── Notification │ │ └── index.js │ ├── Opc │ │ └── index.js │ ├── Parse │ │ └── index.js │ ├── Permission │ │ └── index.js │ ├── Platform │ │ └── index.js │ ├── Product │ │ └── index.js │ ├── ProductTemplet │ │ └── index.js │ ├── Project │ │ └── index.js │ ├── Protocol │ │ └── index.js │ ├── Python │ │ └── index.js │ ├── Relation │ │ └── index.js │ ├── RemixIcon │ │ └── index.js │ ├── Report │ │ └── index.js │ ├── Role │ │ └── index.js │ ├── Rules │ │ └── index.js │ ├── System │ │ ├── filemanagement.js │ │ ├── index.js │ │ └── system.js │ ├── Topo │ │ └── index.js │ ├── Upload │ │ └── index.js │ ├── User │ │ └── index.js │ └── View │ │ └── index.js ├── components │ └── Device │ │ ├── deviceState.vue │ │ └── info.vue ├── config │ ├── cli.config.js │ ├── developer.config.js │ ├── developer.lock.js │ ├── index.js │ ├── loca.config.js │ ├── local.config.js │ ├── mqtt.config.js │ ├── net.config.js │ ├── og.config.js │ ├── pwa.config.js │ ├── router.config.js │ ├── secret.config.js │ ├── setting.config.js │ └── theme.config.js ├── dgiot │ ├── components │ │ ├── DgiotAliplayer │ │ │ └── index.vue │ │ ├── DgiotAmis │ │ │ ├── index.vue │ │ │ ├── rendeX.vue │ │ │ └── render.vue │ │ ├── DgiotAmisEditor │ │ │ └── index.vue │ │ ├── DgiotAppMain │ │ │ └── index.vue │ │ ├── DgiotAvatar │ │ │ └── index.vue │ │ ├── DgiotBaidu │ │ │ └── index.vue │ │ ├── DgiotBaiduMap │ │ │ └── index.vue │ │ ├── DgiotBreadcrumb │ │ │ └── index.vue │ │ ├── DgiotChart │ │ │ └── index.vue │ │ ├── DgiotClientsBasic │ │ │ └── index.vue │ │ ├── DgiotClientsSubscriptions │ │ │ └── index.vue │ │ ├── DgiotDialog │ │ │ └── index.vue │ │ ├── DgiotDoc │ │ │ └── index.vue │ │ ├── DgiotDraggable │ │ │ └── index.vue │ │ ├── DgiotDrawerCode │ │ │ └── index.vue │ │ ├── DgiotEditor │ │ │ └── index.vue │ │ ├── DgiotEmpty │ │ │ └── index.vue │ │ ├── DgiotEmqSelect │ │ │ └── index.vue │ │ ├── DgiotErrorLog │ │ │ └── index.vue │ │ ├── DgiotFlipDown │ │ │ ├── index.vue │ │ │ └── reset.png │ │ ├── DgiotFold │ │ │ └── index.vue │ │ ├── DgiotFooter │ │ │ └── index.vue │ │ ├── DgiotFullScreen │ │ │ └── index.vue │ │ ├── DgiotHeader │ │ │ └── index.vue │ │ ├── DgiotHelp │ │ │ └── index.vue │ │ ├── DgiotIcon │ │ │ └── index.vue │ │ ├── DgiotIconSelector │ │ │ └── index.vue │ │ ├── DgiotIconfont │ │ │ └── index.vue │ │ ├── DgiotInput │ │ │ └── input.vue │ │ ├── DgiotJsonEditor │ │ │ └── index.vue │ │ ├── DgiotKeepAlive │ │ │ └── index.vue │ │ ├── DgiotLanguage │ │ │ └── index.vue │ │ ├── DgiotLink │ │ │ └── index.vue │ │ ├── DgiotLogo │ │ │ └── index.vue │ │ ├── DgiotMenu │ │ │ ├── components │ │ │ │ ├── DgiotMenuItem.vue │ │ │ │ └── DgiotSubMenu.vue │ │ │ └── index.vue │ │ ├── DgiotMonaco │ │ │ └── index.vue │ │ ├── DgiotMonacoPlus │ │ │ └── index.vue │ │ ├── DgiotNav │ │ │ └── index.vue │ │ ├── DgiotNotice │ │ │ └── index.vue │ │ ├── DgiotPagination │ │ │ └── index.vue │ │ ├── DgiotParsePagination │ │ │ └── index.vue │ │ ├── DgiotPlayer │ │ │ └── index.vue │ │ ├── DgiotPuzzle │ │ │ ├── index.vue │ │ │ └── reset.png │ │ ├── DgiotQqMap │ │ │ ├── components │ │ │ │ └── DgiotQqMapSelectPoint.vue │ │ │ └── index.vue │ │ ├── DgiotQrcode │ │ │ └── index.vue │ │ ├── DgiotQueryForm │ │ │ ├── components │ │ │ │ ├── DgiotQueryFormBottomPanel.vue │ │ │ │ ├── DgiotQueryFormLeftPanel.vue │ │ │ │ ├── DgiotQueryFormRightPanel.vue │ │ │ │ └── DgiotQueryFormTopPanel.vue │ │ │ └── index.vue │ │ ├── DgiotRefresh │ │ │ └── index.vue │ │ ├── DgiotRequire │ │ │ └── index.vue │ │ ├── DgiotRoleSwitch │ │ │ └── index.vue │ │ ├── DgiotRoleTree │ │ │ └── index.vue │ │ ├── DgiotSetting │ │ │ └── index.vue │ │ ├── DgiotSideBar │ │ │ └── index.vue │ │ ├── DgiotSlider │ │ │ └── index.vue │ │ ├── DgiotSourceCode │ │ │ └── index.vue │ │ ├── DgiotTable │ │ │ └── index.vue │ │ ├── DgiotTabs │ │ │ └── index.vue │ │ ├── DgiotTheme │ │ │ ├── components │ │ │ │ ├── DgiotThemeDrawer.vue │ │ │ │ └── DgiotThemeSetting.vue │ │ │ └── index.vue │ │ ├── DgiotThreeCheckbox │ │ │ └── index.vue │ │ ├── DgiotUploadFile │ │ │ └── index.vue │ │ └── DgiotVditor │ │ │ └── index.vue │ ├── directives │ │ ├── index.js │ │ └── package │ │ │ ├── LazyLoad.js │ │ │ ├── assets │ │ │ ├── fullScreen.vue │ │ │ └── waves.css │ │ │ ├── backtop.js │ │ │ ├── badge.js │ │ │ ├── clickOut.js │ │ │ ├── clipboard.js │ │ │ ├── copy.js │ │ │ ├── copyText.js │ │ │ ├── debounce.js │ │ │ ├── drag.js │ │ │ ├── draggable.js │ │ │ ├── drawerDrag.js │ │ │ ├── ellipsis.js │ │ │ ├── emoji.js │ │ │ ├── empty.js │ │ │ ├── expandClick.js │ │ │ ├── focus.js │ │ │ ├── format.js │ │ │ ├── fullScreen.js │ │ │ ├── longpress.js │ │ │ ├── permission.js │ │ │ ├── resize.js │ │ │ ├── scrollPop.js │ │ │ ├── sensor.js │ │ │ ├── sticky.js │ │ │ ├── svgDrag.js │ │ │ ├── throttle.js │ │ │ ├── tooltip.js │ │ │ ├── waterMarker.js │ │ │ └── waves.js │ ├── filters │ │ ├── index.js │ │ └── package │ │ │ ├── dateUnix.js │ │ │ └── statusFilter.js │ ├── index.js │ ├── layouts │ │ ├── DgiotEmptyLayout │ │ │ └── index.vue │ │ ├── DgiotLayoutCommon │ │ │ └── index.vue │ │ ├── DgiotLayoutComprehensive │ │ │ └── index.vue │ │ ├── DgiotLayoutHorizontal │ │ │ └── index.vue │ │ ├── DgiotLayoutVertical │ │ │ └── index.vue │ │ └── index.vue │ ├── plugins │ │ ├── FRender.js │ │ ├── amis.js │ │ ├── beFull.js │ │ ├── dgiot.js │ │ ├── directive.js │ │ ├── drag.js │ │ ├── driver.js │ │ ├── element.js │ │ ├── errorLog.js │ │ ├── lajax.js │ │ ├── permissions.js │ │ ├── support.js │ │ └── vue-audio-visual.js │ └── styles │ │ ├── default.scss │ │ ├── dgiot.scss │ │ ├── loading.scss │ │ ├── loading │ │ ├── dots.css │ │ ├── gauge.css │ │ ├── inner-circles.css │ │ └── plus.css │ │ ├── themes │ │ ├── asian.scss │ │ ├── blue-black.scss │ │ ├── blue-white.scss │ │ ├── element-green.scss │ │ ├── green-black.scss │ │ ├── green-white.scss │ │ ├── green.scss │ │ ├── ocean.scss │ │ ├── red-black.scss │ │ ├── red-white.scss │ │ ├── red.scss │ │ └── white.scss │ │ ├── transition.scss │ │ └── variables │ │ ├── element-variables.scss │ │ └── variables.scss ├── directive │ ├── clipboard │ │ ├── clipboard.js │ │ └── index.js │ ├── el-dragDialog │ │ ├── drag.js │ │ └── index.js │ └── sticky.js ├── i18n │ ├── en.js │ ├── index.js │ ├── jp.js │ └── zh.js ├── main.js ├── registerServiceWorker.js ├── router │ └── index.js ├── store │ ├── index.js │ └── modules │ │ ├── acl.js │ │ ├── amis.js │ │ ├── dashboard.js │ │ ├── errorLog.js │ │ ├── global.js │ │ ├── konva.js │ │ ├── product.js │ │ ├── routes.js │ │ ├── settings.js │ │ ├── tabs.js │ │ ├── topo.js │ │ ├── user.js │ │ └── view.js ├── styles │ ├── element-ui.scss │ ├── index.scss │ ├── mixin.scss │ ├── sidebar.scss │ ├── test.scss │ ├── transition.scss │ └── variables.scss ├── utils │ ├── config │ │ └── globalConfig.js │ ├── data │ │ ├── hasAccess.js │ │ ├── jsonpath.js │ │ ├── reg.js │ │ ├── shuwaDb.js │ │ ├── token.js │ │ └── validate.js │ ├── dgiotLog │ │ ├── console.js │ │ ├── index.js │ │ └── o2Console.js │ ├── file │ │ ├── excel.js │ │ ├── export2zip.js │ │ ├── file.js │ │ ├── gif.js │ │ ├── load.js │ │ ├── requirefile.js │ │ ├── requiremodule.js │ │ └── rgif.js │ ├── iframe │ │ ├── common.js │ │ └── store.js │ ├── index.js │ ├── konva │ │ ├── Position.js │ │ ├── common.js │ │ ├── core │ │ │ ├── amis.js │ │ │ ├── canvas.js │ │ │ ├── device.js │ │ │ ├── topoBasic.js │ │ │ ├── topoBg.js │ │ │ ├── topoImage.js │ │ │ ├── topoLable.js │ │ │ ├── topoLine.js │ │ │ ├── topoPath.js │ │ │ ├── topoStage.js │ │ │ ├── topoUtils.js │ │ │ └── topoVideo.js │ │ ├── createGroup.js │ │ ├── createImg.js │ │ ├── createRect.js │ │ ├── createShape.js │ │ ├── createStage.js │ │ ├── createState.js │ │ ├── createText.js │ │ ├── createThing.js │ │ ├── dgagBox.js │ │ ├── findnode.js │ │ ├── getSvgPath.js │ │ ├── konva.js │ │ ├── setImg.js │ │ ├── setRect.js │ │ ├── setText.js │ │ ├── stageMousedown.js │ │ ├── stageMousemove.js │ │ ├── topo.js │ │ └── updateShape.js │ ├── monaco │ │ └── provider.js │ ├── request │ │ └── request.js │ ├── router │ │ ├── routes.js │ │ └── utils.js │ ├── swagger │ │ ├── genSwagger.js │ │ └── index.js │ ├── time │ │ └── index.js │ ├── utilwen.js │ ├── vue │ │ ├── eventBus.js │ │ ├── index.js │ │ └── pageTitle.js │ └── webscroket │ │ └── index.js └── views │ ├── 403.vue │ ├── 404.vue │ ├── CloudFunction │ ├── amis │ │ └── editor.vue │ ├── dict │ │ ├── components │ │ │ ├── dgiotDict.vue │ │ │ ├── dgiotRule.vue │ │ │ ├── dgiotWord.vue │ │ │ ├── dictEdit.vue │ │ │ └── index.vue │ │ └── index.vue │ ├── doc │ │ ├── components │ │ │ ├── details.vue │ │ │ ├── index.vue │ │ │ └── module │ │ │ │ └── docDialog.vue │ │ └── index.vue │ ├── engine │ │ ├── addengine.vue │ │ ├── channel.vue │ │ ├── channelstore.vue │ │ ├── checkengine.vue │ │ ├── components │ │ │ ├── DynamicForms.vue │ │ │ └── mqttLog.vue │ │ ├── createchannel.vue │ │ ├── datalist.js │ │ ├── dict.vue │ │ └── rulesengine.vue │ ├── index.vue │ ├── lowcode │ │ ├── components │ │ │ ├── ViewEdit.vue │ │ │ ├── amis.vue │ │ │ ├── dgiotKonva.vue │ │ │ └── index.vue │ │ └── index.vue │ ├── swagger │ │ └── index.vue │ └── topo │ │ ├── VueKonva.vue │ │ ├── components │ │ ├── Amis.vue │ │ ├── Background.vue │ │ ├── Thing.vue │ │ ├── TopoAllocation.vue │ │ ├── TopoArom.vue │ │ ├── TopoBase.vue │ │ ├── TopoEvidence.vue │ │ ├── TopoOperation.vue │ │ ├── TopoScale.vue │ │ ├── TopoTabs.vue │ │ ├── TopoThing.vue │ │ ├── assets │ │ │ ├── archive_black_24dp.svg │ │ │ ├── folder_black_24dp.svg │ │ │ ├── image_black_24dp.svg │ │ │ ├── live_tv_black_24dp.svg │ │ │ ├── personal_video_black_24dp.svg │ │ │ ├── timeline_black_24dp.svg │ │ │ ├── videocam_black_24dp.svg │ │ │ ├── volume_mute_black_24dp.svg │ │ │ └── volume_up_black_24dp.svg │ │ ├── fabric.vue │ │ ├── iconfont.json │ │ ├── material.json │ │ ├── test.json │ │ └── topoHeader.vue │ │ ├── edit.vue │ │ ├── evidence │ │ └── index.vue │ │ ├── index.vue │ │ ├── js │ │ ├── evidence.js │ │ └── guide.js │ │ ├── preview.vue │ │ └── topo.vue │ ├── CloudOT │ ├── index.vue │ └── maintenance │ │ ├── ChangeStep.vue │ │ ├── alarm │ │ ├── start │ │ │ └── index.vue │ │ └── stop │ │ │ └── index.vue │ │ ├── alert.vue │ │ ├── createTicket.vue │ │ ├── index.vue │ │ └── myticket.vue │ ├── CloudOc │ ├── AmisPage │ │ ├── index.vue │ │ ├── viewgit.vue │ │ └── viewtemplate.vue │ ├── Fassets │ │ └── index.vue │ ├── Fquacate │ │ └── index.vue │ ├── Fstock │ │ └── index.vue │ ├── Ftechnology │ │ ├── componemts │ │ │ └── index.vue │ │ └── index.vue │ ├── MasterData │ │ └── index.vue │ ├── MetaData │ │ ├── components │ │ │ ├── module.vue │ │ │ └── tableEdit.vue │ │ └── index.vue │ ├── Modeling │ │ ├── components │ │ │ └── detail.vue │ │ └── index.vue │ ├── OrderAmis │ │ └── index.vue │ ├── OrderManage │ │ └── index.vue │ └── index.vue │ ├── CloudPressure │ ├── grafana.vue │ └── index.vue │ ├── CloudSystem │ ├── index.vue │ ├── installation │ │ ├── log.vue │ │ └── mqttws.vue │ ├── logs │ │ ├── access.vue │ │ ├── device.vue │ │ ├── history.vue │ │ ├── index.vue │ │ ├── mailList.vue │ │ └── scene.vue │ ├── manage │ │ ├── appmarage.vue │ │ ├── expandprogram.vue │ │ ├── filemanagement.vue │ │ ├── modules.vue │ │ └── nodelist.vue │ └── notification │ │ └── index.vue │ ├── CloudTest │ ├── index.vue │ ├── js │ │ ├── report.js │ │ ├── review.js │ │ └── task.js │ ├── report │ │ └── index.vue │ ├── review │ │ ├── index.vue │ │ └── statistics.vue │ └── task │ │ └── index.vue │ ├── Dashboard │ ├── admin │ │ └── components │ │ │ ├── Circularchart.vue │ │ │ └── LineChart.vue │ └── index.vue │ ├── DeviceCloud │ ├── category │ │ ├── category.vue │ │ ├── categoryEdit.vue │ │ └── instruct_manage.vue │ ├── empty │ │ ├── index.vue │ │ └── tableEdit.vue │ ├── index.vue │ └── manage │ │ ├── application │ │ ├── addApp.vue │ │ ├── application.vue │ │ └── applicationManagement.vue │ │ ├── arp.vue │ │ ├── component │ │ ├── Device │ │ │ ├── children.vue │ │ │ ├── deviceInfo.vue │ │ │ └── runningState.vue │ │ ├── SceneLog.vue │ │ ├── Screen │ │ │ ├── ScreenDevice.vue │ │ │ ├── ScreenLine.vue │ │ │ └── WorkOrder.vue │ │ ├── Thing │ │ │ ├── form.vue │ │ │ ├── old.json │ │ │ └── thing.json │ │ ├── profile │ │ │ ├── ProductTemplet.vue │ │ │ ├── ProfileDescriptions.vue │ │ │ ├── ProfileDict.vue │ │ │ └── ProfileDrawer.vue │ │ ├── task.vue │ │ ├── topocompvue │ │ │ ├── TopoCaltable.vue │ │ │ ├── TopoCard.vue │ │ │ ├── TopoLine.vue │ │ │ └── TopoPie.vue │ │ └── wmxdetail.vue │ │ ├── css │ │ └── proddetail.css │ │ ├── devicelist.vue │ │ ├── devicesDetailLite.vue │ │ ├── devproduct.vue │ │ ├── editdevices.vue │ │ ├── gateway.vue │ │ ├── group.vue │ │ ├── home_group.vue │ │ ├── home_index.vue │ │ ├── index.vue │ │ ├── iotcard.vue │ │ ├── js │ │ ├── devicesDetailLite.js │ │ ├── editdevices.js │ │ └── proddetail.js │ │ ├── konvadevice.vue │ │ ├── parse.vue │ │ ├── platform_overview.vue │ │ ├── proddetail.vue │ │ ├── product.vue │ │ ├── productTemplet.vue │ │ ├── profile.vue │ │ └── thingsParse.vue │ ├── Home │ └── index.vue │ ├── MultiTenant │ ├── roles │ │ ├── components │ │ │ ├── MenuManagementEdit.vue │ │ │ └── menuCollapse.vue │ │ ├── department │ │ │ └── department.vue │ │ ├── departmentforuser.vue │ │ ├── list │ │ │ ├── addroles.vue │ │ │ ├── roles.vue │ │ │ └── rolescontrol.vue │ │ ├── menu.vue │ │ ├── structure.vue │ │ └── userinfo.vue │ └── user │ │ ├── admin │ │ └── index.vue │ │ ├── dev │ │ └── index.vue │ │ ├── edituser.vue │ │ ├── index.json │ │ ├── jwtlogin │ │ └── index.vue │ │ ├── login │ │ ├── index.vue │ │ └── newindex.vue │ │ ├── quick │ │ └── index.vue │ │ └── register │ │ ├── index.vue │ │ └── register.vue │ ├── Tools │ ├── Ys7.vue │ ├── alarms.vue │ ├── aliplayer.vue │ ├── clients.vue │ ├── components │ │ └── provider.js │ ├── listeners.vue │ ├── mqtt.vue │ ├── player.vue │ ├── playerback.vue │ ├── subscriptions.vue │ ├── topic_metrics.vue │ └── topics.vue │ ├── feature │ ├── alisqlsubmit.json │ ├── index.vue │ ├── linkedge.vue │ └── readme.vue │ └── index.md ├── tsconfig.json ├── vercel.json ├── vue.config.js └── webstorm.config.js /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | # This config is equivalent to both the '.circleci/extended/orb-free.yml' and the base '.circleci/config.yml' 2 | version: 2.1 3 | 4 | # Orbs are reusable packages of CircleCI configuration that you may share across projects, enabling you to create encapsulated, parameterized commands, jobs, and executors that can be used across multiple projects. 5 | # See: https://circleci.com/docs/2.0/orb-intro/ 6 | orbs: 7 | node: circleci/node@4.7.0 8 | 9 | # Invoke jobs via workflows 10 | # See: https://circleci.com/docs/2.0/configuration-reference/#workflows 11 | workflows: 12 | sample: # This is the name of the workflow, feel free to change it to better match your workflow. 13 | # Inside the workflow, you define the jobs you want to run. 14 | jobs: 15 | - node/test: 16 | # This is the node version to use for the `cimg/node` tag 17 | # Relevant tags can be found on the CircleCI Developer Hub 18 | # https://circleci.com/developer/images/image/cimg/node 19 | version: '16.10' 20 | # If you are using yarn, change the line below from "npm" to "yarn" 21 | pkg-manager: yarn 22 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | indent_size = 2 7 | indent_style = space 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.html text eol=lf 2 | *.css text eol=lf 3 | *.js text eol=lf 4 | *.scss text eol=lf 5 | *.vue text eol=lf 6 | *.hbs text eol=lf 7 | *.sh text eol=lf 8 | *.md text eol=lf 9 | *.json text eol=lf 10 | *.yml text eol=lf 11 | .browserslistrc text eol=lf 12 | .editorconfig text eol=lf 13 | .eslintignore text eol=lf 14 | .gitattributes text eol=lf 15 | LICENSE text eol=lf 16 | *.conf text eol=lf 17 | public/assets/js/* diff=nodiff 18 | public/assets/css/* diff=nodiff 19 | -------------------------------------------------------------------------------- /.gitee/ISSUE_TEMPLATE.zh-CN.md: -------------------------------------------------------------------------------- 1 | #### 1. 描述问题: 2 | 3 | 请清晰的描述重现该 issue 的步骤,没有清晰重现步骤的 issue 将不会被修复。标有need repro的 issue 如果在 7 天内不提供相关步骤,将直接被关闭。 4 | 5 | #### 2. 截图或视频: 6 | 7 | 可以的话,尽可能提供截图或视频来补充描述你的问题... 8 | 9 | #### 3. 如何复现(请务必完整填写下面内容): 10 | 11 | 1. 你是如何使用 dgiot 的? 12 | 1. [dgiot@v4.5.3](https://gitee.com/dgiiot/dgiot/releases/v4.5.3)、 13 | 2. [开发板](https://gitee.com/dgiiot/dgiot/tree/master/) 14 | 3. [其他版本](https://gitee.com/dgiiot/dgiot/releases) 15 | 16 | 17 | #### 4. 操作平台: 18 | 1. 操作系统: 19 | 2. 浏览器: 20 | 21 | #### 5. 操作步骤 22 | 请简单描述一下复现的操作步骤... 23 | -------------------------------------------------------------------------------- /.gitee/PULL_REQUEST_TEMPLATE.zh-CN.md: -------------------------------------------------------------------------------- 1 | #### 1. 描述问题: 2 | 3 | 请清晰的描述重现该 issue 的步骤,没有清晰重现步骤的 issue 将不会被修复。标有need repro的 issue 如果在 7 天内不提供相关步骤,将直接被关闭。 4 | 5 | #### 2. 截图或视频: 6 | 7 | 可以的话,尽可能提供截图或视频来补充描述你的问题... 8 | 9 | #### 3. 如何复现(请务必完整填写下面内容): 10 | 11 | 1. 你是如何使用 dgiot 的? 12 | 1. [dgiot@v4.5.3](https://gitee.com/dgiiot/dgiot/releases/v4.5.3)、 13 | 2. [开发板](https://gitee.com/dgiiot/dgiot/tree/master/) 14 | 3. [其他版本](https://gitee.com/dgiiot/dgiot/releases) 15 | 16 | 17 | #### 4. 操作平台: 18 | 1. 操作系统: 19 | 2. 浏览器: 20 | 21 | #### 5. 操作步骤 22 | 请简单描述一下复现的操作步骤... 23 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: 报告缺陷 3 | about: 报告缺陷以帮助我们改进 4 | labels: bug 5 | assignees: h7ml 6 | --- 7 | 8 | ### 描述问题 9 | 10 | 11 | 12 | ```markdown 13 | 如果是解析渲染问题的话请在此处贴入 Markdown 原文 14 | ``` 15 | 16 | ### 期待的结果 17 | 18 | 19 | 20 | ### 截屏或录像 21 | 22 | 27 | 28 | ### 版本信息 29 | 30 | - 版本: 31 | - 操作系统: 32 | - 浏览器: 33 | 34 | ### 其他信息 35 | 36 | 37 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: dgiot issues template 4 | url: https://github.com/dgiot 5 | about: dgiot 6 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: 请求新功能 3 | about: 提出你期待的功能特性 4 | labels: Feature 5 | assignees: h7ml 6 | --- 7 | 8 | ### 你在什么场景下需要该功能? 9 | 10 | 11 | 12 | ### 描述最优的解决方案 13 | 14 | 15 | 16 | ### 描述候选解决方案 17 | 18 | 19 | 20 | ### 其他信息 21 | 22 | 23 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/need-help-issue.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Need help issue 3 | about: Question for use(问题求助) 4 | title: '' 5 | labels: question 6 | assignees: h7ml 7 | --- 8 | 9 | **Question (问题描述)** 10 | How to use component `s-table` paging 11 | 12 | **Describe the solution you'd like (你期待的是什么?)** 13 | A clear and concise description of what you want to happen. 14 | 15 | **Additional context(附加信息)** 16 | Add any other context or screenshots about the feature request here. 17 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | Fixes 3 | 4 | **If your build fails** due to your commit message not passing the build checks, please review the guidelines here: https://github.com/dgiot/dgiot/blob/master/CONTRIBUTING.md. 5 | 6 | ## PR Checklist 7 | Please convert it to a draft if any of the following conditions are not met. Reviewers may skip over until all the items are checked: 8 | 9 | - [x] Tests for the changes have been added (for bug fixes / features) 10 | - [x] Docs have been added / updated (for bug fixes / features) 11 | - [ ] In case of non-backward compatible changes, reviewer should check this item as a write-off, and add details in **Backward Compatibility** section 12 | 13 | ## Backward Compatibility 14 | 15 | ## More information 16 | -------------------------------------------------------------------------------- /.github/SECURITY.md: -------------------------------------------------------------------------------- 1 | # 安全报告 Security report 2 | 3 | 如果你发现安全相关漏洞请通过如下任意一种方式告知我们:\ 4 | If you find security-related vulnerabilities, please inform us in any of the following ways: 5 | 6 | - 直接开 Issue(请隐去站点、实际项目等敏感信息)\ 7 | Open Issue directly (please hide sensitive information such as site and actual project) 8 | - 发邮件至 johnliu@iotn2n.com\ 9 | Send an email to johnliu@iotn2n.com 10 | 11 | 非常感谢!\ 12 | Thank you very much! 13 | -------------------------------------------------------------------------------- /.github/codecov.yml: -------------------------------------------------------------------------------- 1 | coverage: 2 | range: '30...100' 3 | 4 | status: 5 | project: 6 | default: 7 | threshold: 1 8 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: 'npm' # See documentation for possible values 9 | directory: '/' # Location of package manifests 10 | schedule: 11 | interval: 'daily' 12 | -------------------------------------------------------------------------------- /.github/release-drafter.yml: -------------------------------------------------------------------------------- 1 | categories: 2 | - title: 新功能 3 | label: feat 4 | - title: Bugfix 5 | label: fix 6 | - title: 依赖更新 7 | label: dep 8 | - title: 日常维护 9 | label: chore 10 | - title: 文档 11 | label: doc 12 | 13 | autolabeler: 14 | - label: 'feat' 15 | title: 16 | - '/feat/i' 17 | - label: 'fix' 18 | title: 19 | - '/fix/i' 20 | - label: 'chore' 21 | title: 22 | - '/chore/i' 23 | - label: 'doc' 24 | title: 25 | - '/doc/i' 26 | 27 | template: | 28 | 29 | ## 更新记录 30 | $CHANGES 31 | 32 | -------------------------------------------------------------------------------- /.github/renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["config:base"] 3 | } 4 | -------------------------------------------------------------------------------- /.github/workflows/clear.yml: -------------------------------------------------------------------------------- 1 | name: claer 2 | on: 3 | push: 4 | branches: [ check ] 5 | workflow_dispatch: 6 | env: 7 | TZ: Asia/Shanghai 8 | 9 | jobs: 10 | clear: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - name: Checkout 🚀 14 | uses: actions/checkout@v2 15 | with: 16 | repository: 'jdsync/Workflows-Cleaner' 17 | - name: Set up Python 🚀 18 | uses: actions/setup-python@v2 19 | with: 20 | python-version: '3.9' 21 | - name: Install pipenv 🚀 22 | env: 23 | GITHUB_REPO: ${{ github.repository }} 24 | GITHUB_TOKEN: ${{ secrets.ACTION_SECRET }} 25 | EXPIRE_TIME: '1h' 26 | run: | 27 | python -m pip install --upgrade pipenv wheel 28 | pipenv install 29 | pipenv run python run.py 30 | - name: Upload coverage to Codecov 🚀 31 | uses: codecov/codecov-action@v1 32 | with: 33 | token: ${{ secrets.CODECOV_TOKEN }} 34 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: Release 2 | 3 | on: 4 | workflow_dispatch: 5 | push: 6 | tags: 7 | - 'v*' 8 | 9 | jobs: 10 | release: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: actions/checkout@v3 14 | with: 15 | fetch-depth: 0 16 | - name: Set node 17 | uses: actions/setup-node@v3 18 | with: 19 | node-version: 16.x 20 | registry-url: 'https://registry.npmjs.org' 21 | 22 | - name: Setup 23 | run: npm i -g @antfu/ni pnpm 24 | 25 | - run: npx changelogithub 26 | continue-on-error: true 27 | env: 28 | GITHUB_TOKEN: ${{secrets.GIT_TOKEN}} 29 | 30 | - name: Install Dependencies 31 | run: nci 32 | 33 | - name: PNPM build 34 | run: nr build 35 | 36 | - name: Publish to NPM 37 | run: pnpm -r publish --access public --no-git-checks 38 | env: 39 | NODE_AUTH_TOKEN: ${{secrets.npm_token}} 40 | -------------------------------------------------------------------------------- /.github/workflows/setup/lighthouse-audit.json: -------------------------------------------------------------------------------- 1 | { 2 | "ci": { 3 | "collect": { 4 | "staticDistDir": "." 5 | }, 6 | "assert": { 7 | "assertions": { 8 | "categories:performance": [ 9 | "error", 10 | { 11 | "minScore": 0.8 12 | } 13 | ], 14 | "first-contentful-paint": [ 15 | "error", 16 | { 17 | "maxNumericValue": 1000 18 | } 19 | ], 20 | "interactive": [ 21 | "error", 22 | { 23 | "maxNumericValue": 1500 24 | } 25 | ], 26 | "resource-summary:font:count": [ 27 | "error", 28 | { 29 | "maxNumericValue": 1 30 | } 31 | ], 32 | "resource-summary:script:size": [ 33 | "error", 34 | { 35 | "maxNumericValue": 150000 36 | } 37 | ], 38 | "resource-summary:stylesheet:size": [ 39 | "error", 40 | { 41 | "maxNumericValue": 100000 42 | } 43 | ] 44 | } 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /.github/workflows/sync.yml: -------------------------------------------------------------------------------- 1 | name: sync 2 | on: 3 | push: 4 | branches: [ master,dev ] 5 | workflow_dispatch: 6 | 7 | # 设置上海时区 8 | env: 9 | TZ: Asia/Shanghai 10 | jobs: 11 | sync: 12 | name: sync gitee 🚀 13 | runs-on: ubuntu-latest 14 | steps: 15 | # - name: get dashboard size 🚀 16 | # run: size = curl https://api.github.com/repos/dgiot/dgiot-dashboard 17 | - name: Checkout 🚀 18 | uses: actions/checkout@v2 19 | - name: Sync dgiot-dashboard 🚀 20 | uses: Yikun/hub-mirror-action@master 21 | with: 22 | src: github/dgiot 23 | dst: gitee/dgiiot 24 | dst_key: ${{ secrets.PRIVATE_KEY }} 25 | dst_token: ${{ secrets.GIT_TOKEN }} 26 | static_list: "dgiot-dashboard" # 只同步这个项目 https://github.com/Yikun/hub-mirror-action#%E9%BB%91%E7%99%BD%E5%90%8D%E5%8D%95 27 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | /.vscode 5 | *.zip 6 | *.rar 7 | release 8 | 9 | # local env files 10 | .env.local 11 | .env.*.local 12 | 13 | # Log files 14 | *.log 15 | npm-debug.log* 16 | yarn-debug.log* 17 | yarn-error.log* 18 | pnpm-debug.log* 19 | pnpm-lock.yaml 20 | *.idea 21 | *-lock.json 22 | 23 | # Editor directories and files 24 | .idea 25 | *.suo 26 | *.ntvs* 27 | *.njsproj 28 | *.sln 29 | *.sw? 30 | *.tar.gz 31 | 32 | # Lock files 33 | pnpm-lock.yaml 34 | pack-lock.json 35 | # Yarn v2 36 | .pnp.* 37 | .yarn/cache 38 | .yarn/unplugged 39 | .yarn/build-state.yml 40 | .yarn/install-state.gz 41 | .yarnrc 42 | yarn.lock 43 | # config 44 | /gitbit 45 | /github 46 | src/config/ignore 47 | # files 48 | swagger.json 49 | lite.sh 50 | /cli.config.js 51 | /lite 52 | /full 53 | /dev 54 | -------------------------------------------------------------------------------- /.husky/commit-msg: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | npx --no-install commitlint --edit "$1" 5 | -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | npm run lint 5 | -------------------------------------------------------------------------------- /.husky/pre-push: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | npm run release 5 | -------------------------------------------------------------------------------- /.stylelintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: ['stylelint-config-recess-order'], 3 | } 4 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 16.13.0 4 | branchs: 5 | only: 6 | - master 7 | cache: 8 | npm: false 9 | directories: 10 | - "~/.pnpm-store" 11 | before_install: 12 | - curl -f https://get.pnpm.io/v6.16.js | node - add --global pnpm@6 13 | - pnpm config set store-dir ~/.pnpm-store 14 | - pnpm config set registry https://registry.npmmirror.com 15 | - pnpm lint 16 | - pnpm lint:fix 17 | - pnpm lint:style 18 | install: 19 | - pnpm install 20 | scripts: 21 | - pnpm build 22 | deploy: 23 | provider: pages 24 | local_dir: dist 25 | skip_cleanup: true 26 | # 在 GitHub 上生成的令牌,允许 Travis 推送代码到你的仓库。 27 | # 在仓库对应的 Travis 设置页面中配置,用于安全控制。 28 | github_token: $GIT_TOKEN 29 | keep_history: true 30 | on: 31 | branch: travis-pages 32 | -------------------------------------------------------------------------------- /api/proxy.js: -------------------------------------------------------------------------------- 1 | // 该服务为 vercel serve跨域处理 2 | const { createProxyMiddleware } = require('http-proxy-middleware') 3 | const targetUrl = 'https://prod.iotn2n.com/' 4 | const startsWith = [ 5 | '/iotapi', 6 | '/dgiot_dashboard', 7 | '/dgiot_swagger', 8 | '/dgiot_file', 9 | '/dgiot-amis-dashboard', 10 | ] 11 | module.exports = (req, res) => { 12 | let target = '' 13 | // 判断 res.url 开头是否包含startsWith 14 | if (req.url.startsWith('/iotapi')) { 15 | target = targetUrl + '/iotapi' 16 | } else if (req.url.startsWith('/dgiot_dashboard')) { 17 | target = targetUrl + '/dgiot_dashboard' 18 | } else if (req.url.includes('/dgiot_swagger')) { 19 | target = targetUrl + '/dgiot_swagger' 20 | } else if (req.url.startsWith('/dgiot_file')) { 21 | target = targetUrl + '/dgiot_file' 22 | } else if (req.url.includes('/dgiot-amis-dashboard')) { 23 | target = targetUrl + '/dgiot-amis-dashboard' 24 | } 25 | // 创建代理对象并转发请求 26 | createProxyMiddleware({ 27 | target, 28 | changeOrigin: true, 29 | pathRewrite: { 30 | '^/iotapi/': '/', 31 | '^/dgiot_dashboard/': '/', 32 | '^/dgiot_swagger/': '/', 33 | '^/dgiot_file/': '/', 34 | '^/dgiot-amis-dashboard/': '/', 35 | }, 36 | })(req, res) 37 | } 38 | -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | # http://www.appveyor.com/docs/appveyor-yml 2 | environment: 3 | matrix: 4 | - nodejs_version: "16" 5 | 6 | install: 7 | - ps: Install-Product node $env:nodejs_version 8 | - npm config get registry 9 | # - npm install --legacy-peer-deps 10 | test_script: 11 | - npm install --legacy-peer-deps 12 | build: off 13 | -------------------------------------------------------------------------------- /azure-pipelines.yml: -------------------------------------------------------------------------------- 1 | # Node.js 2 | # Build a general Node.js project with npm. 3 | # Add steps that analyze code, save build artifacts, deploy, and more: 4 | # https://docs.microsoft.com/azure/devops/pipelines/languages/javascript 5 | 6 | trigger: 7 | - master 8 | 9 | pool: 10 | vmImage: ubuntu-latest 11 | 12 | steps: 13 | - task: NodeTool@0 14 | inputs: 15 | versionSpec: '10.x' 16 | displayName: 'Install Node.js' 17 | 18 | - script: | 19 | npm install 20 | npm run build 21 | displayName: 'npm install and build' 22 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: h7ml 3 | * @Date: 2021-03-11 18:38:56 4 | * @LastEditTime: 2021-03-15 15:48:37 5 | * @LastEditors: h7ml 6 | * @FilePath: \dgiot-dashboard\babel.config.js 7 | * @Description: 8 | */ 9 | const { clearConsole } = require('./src/config') 10 | let plugins = ['dynamic-import-node', '@babel/plugin-transform-runtime'] 11 | if (process.env.NODE_ENV !== 'development' && clearConsole) 12 | plugins.push('transform-remove-console') 13 | 14 | module.exports = { 15 | presets: ['@vue/cli-plugin-babel/preset'], 16 | plugins, 17 | } 18 | -------------------------------------------------------------------------------- /commitlint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: ['@commitlint/config-conventional'], 3 | } 4 | -------------------------------------------------------------------------------- /jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES6", 4 | "module": "commonjs", 5 | "allowSyntheticDefaultImports": true, 6 | "baseUrl": "./", 7 | "paths": { 8 | "@/*": ["src/*"] 9 | } 10 | }, 11 | "exclude": ["node_modules"] 12 | } 13 | -------------------------------------------------------------------------------- /netlify.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | echo "is netlify: $NETLIFY" 3 | echo "in branch: $BRANCH" 4 | echo "head: $HEAD" 5 | 6 | if [ "$NETLIFY" != "true" ] 7 | then 8 | echo "this script only runs in netlify, bye" 9 | exit 1 10 | fi 11 | 12 | if [ "$BRANCH" != "dev" ] && [ "$HEAD" != "dev" ] 13 | then 14 | pnpm build 15 | else 16 | echo "this script only runs in targeting dev's PR deploy preview, bye" 17 | fi 18 | -------------------------------------------------------------------------------- /prettier.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | printWidth: 80, 3 | tabWidth: 2, 4 | useTabs: false, 5 | semi: false, 6 | singleQuote: true, 7 | quoteProps: 'as-needed', 8 | jsxSingleQuote: false, 9 | trailingComma: 'es5', 10 | bracketSpacing: true, 11 | bracketSameLine: false, 12 | arrowParens: 'always', 13 | htmlWhitespaceSensitivity: 'ignore', 14 | vueIndentScriptAndStyle: true, 15 | endOfLine: 'lf', 16 | } 17 | -------------------------------------------------------------------------------- /public/assets/bg/bg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dgiot/iotStudio/1f8f2c16f2c792f2b9b17847d2274d6ccc3315f8/public/assets/bg/bg.gif -------------------------------------------------------------------------------- /public/assets/bg/bg_title.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dgiot/iotStudio/1f8f2c16f2c792f2b9b17847d2274d6ccc3315f8/public/assets/bg/bg_title.png -------------------------------------------------------------------------------- /public/assets/bg/bg_title1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dgiot/iotStudio/1f8f2c16f2c792f2b9b17847d2274d6ccc3315f8/public/assets/bg/bg_title1.png -------------------------------------------------------------------------------- /public/assets/bg/bg_warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dgiot/iotStudio/1f8f2c16f2c792f2b9b17847d2274d6ccc3315f8/public/assets/bg/bg_warning.png -------------------------------------------------------------------------------- /public/assets/bg/experience-back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dgiot/iotStudio/1f8f2c16f2c792f2b9b17847d2274d6ccc3315f8/public/assets/bg/experience-back.png -------------------------------------------------------------------------------- /public/assets/bg/experience-box-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dgiot/iotStudio/1f8f2c16f2c792f2b9b17847d2274d6ccc3315f8/public/assets/bg/experience-box-bg.png -------------------------------------------------------------------------------- /public/assets/bg/experience-left-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dgiot/iotStudio/1f8f2c16f2c792f2b9b17847d2274d6ccc3315f8/public/assets/bg/experience-left-hover.png -------------------------------------------------------------------------------- /public/assets/bg/experience-left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dgiot/iotStudio/1f8f2c16f2c792f2b9b17847d2274d6ccc3315f8/public/assets/bg/experience-left.png -------------------------------------------------------------------------------- /public/assets/bg/head.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dgiot/iotStudio/1f8f2c16f2c792f2b9b17847d2274d6ccc3315f8/public/assets/bg/head.png -------------------------------------------------------------------------------- /public/assets/bg/pageBg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dgiot/iotStudio/1f8f2c16f2c792f2b9b17847d2274d6ccc3315f8/public/assets/bg/pageBg.png -------------------------------------------------------------------------------- /public/assets/bg/screen_center.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dgiot/iotStudio/1f8f2c16f2c792f2b9b17847d2274d6ccc3315f8/public/assets/bg/screen_center.png -------------------------------------------------------------------------------- /public/assets/images/Asian/14b9c258440baff15cdb5fe5490da8d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dgiot/iotStudio/1f8f2c16f2c792f2b9b17847d2274d6ccc3315f8/public/assets/images/Asian/14b9c258440baff15cdb5fe5490da8d.png -------------------------------------------------------------------------------- /public/assets/images/Asian/16448075019322.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dgiot/iotStudio/1f8f2c16f2c792f2b9b17847d2274d6ccc3315f8/public/assets/images/Asian/16448075019322.png -------------------------------------------------------------------------------- /public/assets/images/Asian/5138162066c98d21b4467e3ad7bbb04.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dgiot/iotStudio/1f8f2c16f2c792f2b9b17847d2274d6ccc3315f8/public/assets/images/Asian/5138162066c98d21b4467e3ad7bbb04.jpg -------------------------------------------------------------------------------- /public/assets/images/Device/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dgiot/iotStudio/1f8f2c16f2c792f2b9b17847d2274d6ccc3315f8/public/assets/images/Device/1.png -------------------------------------------------------------------------------- /public/assets/images/Device/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dgiot/iotStudio/1f8f2c16f2c792f2b9b17847d2274d6ccc3315f8/public/assets/images/Device/2.png -------------------------------------------------------------------------------- /public/assets/images/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dgiot/iotStudio/1f8f2c16f2c792f2b9b17847d2274d6ccc3315f8/public/assets/images/loading.gif -------------------------------------------------------------------------------- /public/assets/images/logo/dgiot_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dgiot/iotStudio/1f8f2c16f2c792f2b9b17847d2274d6ccc3315f8/public/assets/images/logo/dgiot_logo.png -------------------------------------------------------------------------------- /public/assets/images/logo/dgiot_logo1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dgiot/iotStudio/1f8f2c16f2c792f2b9b17847d2274d6ccc3315f8/public/assets/images/logo/dgiot_logo1.png -------------------------------------------------------------------------------- /public/assets/images/logo/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dgiot/iotStudio/1f8f2c16f2c792f2b9b17847d2274d6ccc3315f8/public/assets/images/logo/logo.png -------------------------------------------------------------------------------- /public/assets/images/plant/gc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dgiot/iotStudio/1f8f2c16f2c792f2b9b17847d2274d6ccc3315f8/public/assets/images/plant/gc.png -------------------------------------------------------------------------------- /public/assets/images/platform/assets/empty_images/data_empty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dgiot/iotStudio/1f8f2c16f2c792f2b9b17847d2274d6ccc3315f8/public/assets/images/platform/assets/empty_images/data_empty.png -------------------------------------------------------------------------------- /public/assets/images/platform/assets/error_images/403.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dgiot/iotStudio/1f8f2c16f2c792f2b9b17847d2274d6ccc3315f8/public/assets/images/platform/assets/error_images/403.png -------------------------------------------------------------------------------- /public/assets/images/platform/assets/error_images/404.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dgiot/iotStudio/1f8f2c16f2c792f2b9b17847d2274d6ccc3315f8/public/assets/images/platform/assets/error_images/404.png -------------------------------------------------------------------------------- /public/assets/images/platform/assets/error_images/cloud.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dgiot/iotStudio/1f8f2c16f2c792f2b9b17847d2274d6ccc3315f8/public/assets/images/platform/assets/error_images/cloud.png -------------------------------------------------------------------------------- /public/assets/images/platform/assets/login_images/background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dgiot/iotStudio/1f8f2c16f2c792f2b9b17847d2274d6ccc3315f8/public/assets/images/platform/assets/login_images/background.jpg -------------------------------------------------------------------------------- /public/assets/images/platform/assets/login_images/login_form.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dgiot/iotStudio/1f8f2c16f2c792f2b9b17847d2274d6ccc3315f8/public/assets/images/platform/assets/login_images/login_form.png -------------------------------------------------------------------------------- /public/assets/images/platform/assets/login_images/stretch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dgiot/iotStudio/1f8f2c16f2c792f2b9b17847d2274d6ccc3315f8/public/assets/images/platform/assets/login_images/stretch.png -------------------------------------------------------------------------------- /public/assets/images/topo/bg/boiler.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dgiot/iotStudio/1f8f2c16f2c792f2b9b17847d2274d6ccc3315f8/public/assets/images/topo/bg/boiler.jpg -------------------------------------------------------------------------------- /public/assets/images/topo/screen/card.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dgiot/iotStudio/1f8f2c16f2c792f2b9b17847d2274d6ccc3315f8/public/assets/images/topo/screen/card.png -------------------------------------------------------------------------------- /public/dist/element-icons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dgiot/iotStudio/1f8f2c16f2c792f2b9b17847d2274d6ccc3315f8/public/dist/element-icons.ttf -------------------------------------------------------------------------------- /public/dist/element-icons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dgiot/iotStudio/1f8f2c16f2c792f2b9b17847d2274d6ccc3315f8/public/dist/element-icons.woff -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dgiot/iotStudio/1f8f2c16f2c792f2b9b17847d2274d6ccc3315f8/public/favicon.ico -------------------------------------------------------------------------------- /public/fonts/ionicons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dgiot/iotStudio/1f8f2c16f2c792f2b9b17847d2274d6ccc3315f8/public/fonts/ionicons.ttf -------------------------------------------------------------------------------- /public/fonts/ionicons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dgiot/iotStudio/1f8f2c16f2c792f2b9b17847d2274d6ccc3315f8/public/fonts/ionicons.woff -------------------------------------------------------------------------------- /public/fonts/ionicons.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dgiot/iotStudio/1f8f2c16f2c792f2b9b17847d2274d6ccc3315f8/public/fonts/ionicons.woff2 -------------------------------------------------------------------------------- /public/img/icons/android-chrome-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dgiot/iotStudio/1f8f2c16f2c792f2b9b17847d2274d6ccc3315f8/public/img/icons/android-chrome-192x192.png -------------------------------------------------------------------------------- /public/img/icons/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dgiot/iotStudio/1f8f2c16f2c792f2b9b17847d2274d6ccc3315f8/public/img/icons/favicon-16x16.png -------------------------------------------------------------------------------- /public/img/icons/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dgiot/iotStudio/1f8f2c16f2c792f2b9b17847d2274d6ccc3315f8/public/img/icons/favicon-32x32.png -------------------------------------------------------------------------------- /public/manifest.webmanifest: -------------------------------------------------------------------------------- 1 | { 2 | "name": "dgiot-dashboard", 3 | "short_name": "dgiot-dashboard", 4 | "theme_color": "#4fc08d", 5 | "icons": [ 6 | { 7 | "src": "./dgiot_dashboard/public/assets/images/icons/android-chrome-192x192.png", 8 | "sizes": "192x192", 9 | "type": "image/png" 10 | }, 11 | { 12 | "src": "./dgiot_dashboard/public/assets/images/icons/android-chrome-512x512.png", 13 | "sizes": "512x512", 14 | "type": "image/png" 15 | }, 16 | { 17 | "src": "./dgiot_dashboard/public/assets/images/icons/android-chrome-maskable-192x192.png", 18 | "sizes": "192x192", 19 | "type": "image/png", 20 | "purpose": "maskable" 21 | }, 22 | { 23 | "src": "./dgiot_dashboard/public/assets/images/icons/android-chrome-maskable-512x512.png", 24 | "sizes": "512x512", 25 | "type": "image/png", 26 | "purpose": "maskable" 27 | } 28 | ], 29 | "start_url": "/", 30 | "display": "standalone", 31 | "background_color": "#ffffff", 32 | "description": "提供物联网垂直领域应用使能平台及解决方案", 33 | "orientation": "portrait-primary", 34 | "prefer_related_applications": false, 35 | "lang": "zh-CN", 36 | "scope": "/" 37 | } 38 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | # *** 杭州数蛙科技有限公司 *** 4 | # *** www.iotn2n.com *** 5 | -------------------------------------------------------------------------------- /public/undefined: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dgiot/iotStudio/1f8f2c16f2c792f2b9b17847d2274d6ccc3315f8/public/undefined -------------------------------------------------------------------------------- /src/App.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 12 | -------------------------------------------------------------------------------- /src/api/Acl/index.js: -------------------------------------------------------------------------------- 1 | export function aclObj(roles) { 2 | if (!roles) return 3 | let aclObj = {} 4 | roles.map((e) => { 5 | aclObj[`${'role' + ':' + e.name}`] = { 6 | read: true, 7 | write: true, 8 | } 9 | }) 10 | return aclObj 11 | } 12 | -------------------------------------------------------------------------------- /src/api/Article/index.js: -------------------------------------------------------------------------------- 1 | // * @Author: h7ml 2 | // * @Date: 2021-08-23 18:12:12 3 | // * @LastEditors: h7ml 4 | // * @LastEditTime: 2021-08-23 18:12:12 5 | // * @Description: dgiot doc api 6 | // * @FilePath: src\api\Article\index.js 7 | // * @DocumentLink: http://prod.iotn2n.com/swagger/#/Article 8 | import { 9 | create_object, 10 | del_object, 11 | get_object, 12 | query_object, 13 | update_object, 14 | } from '@/api/Parse' 15 | 16 | export async function createArticle(params) { 17 | return create_object( 18 | 'Article', 19 | // eslint-disable-next-line no-undef 20 | _.merge(params, { 21 | // ACL: { 22 | // '*': { 23 | // read: true, 24 | // write: true, 25 | // }, 26 | // }, 27 | timestamp: moment(new Date()).valueOf() + '', 28 | }) 29 | ) 30 | } 31 | 32 | export async function getArticle(ObjectId) { 33 | return get_object('Article', ObjectId) 34 | } 35 | 36 | export async function delArticle(ObjectId) { 37 | return del_object('Article', ObjectId) 38 | } 39 | 40 | export async function putArticle(ObjectId, params) { 41 | return update_object('Article', ObjectId, params) 42 | } 43 | 44 | export async function queryArticle(params) { 45 | return query_object('Article', params) 46 | } 47 | -------------------------------------------------------------------------------- /src/api/Category/index.js: -------------------------------------------------------------------------------- 1 | // * @Author: h7ml 2 | // * @Date: 2021-08-16 12:07:36 3 | // * @LastEditors: h7ml 4 | // * @LastEditTime: 2021-08-16 12:07:36 5 | // * @Description: Category api 6 | // * @FilePath: src\api\Category\index.js 7 | // * @DocumentLink: http://prod.iotn2n.com/swagger/#/category 8 | import request from '@/utils/request/request' 9 | import { 10 | create_object, 11 | del_object, 12 | get_object, 13 | update_object, 14 | } from '@/api/Parse' 15 | 16 | export async function queryCategory(params) { 17 | return request({ 18 | url: `/classes/Category`, 19 | method: 'get', 20 | params: params, 21 | }) 22 | } 23 | 24 | export async function getCategory(ObjectId) { 25 | return get_object('Category', ObjectId) 26 | } 27 | 28 | export async function delCategory(ObjectId) { 29 | return del_object('Category', ObjectId) 30 | } 31 | 32 | export async function putCategory(ObjectId, params) { 33 | return update_object('Category', ObjectId, params) 34 | } 35 | 36 | export async function postCategory(params) { 37 | return create_object('Category', params) 38 | } 39 | -------------------------------------------------------------------------------- /src/api/Dba/index.js: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: h7ml 3 | * @Date: 2021-02-01 19:02:18 4 | * @LastEditTime: 2021-02-22 12:14:04 5 | * @LastEditors: Please set LastEditors 6 | * @Description: In User Settings Edit 7 | * @FilePath: \dgiot-dashboard\src\api\Device\index.js 8 | */ 9 | import request from '@/utils/request/request' 10 | 11 | export async function getTable() { 12 | return request({ 13 | url: '/dlinkjson?type=Table', 14 | method: 'get', 15 | }) 16 | } 17 | export async function getViews() { 18 | return request({ 19 | url: '/dlinkjson?type=Views', 20 | method: 'get', 21 | }) 22 | } 23 | -------------------------------------------------------------------------------- /src/api/Exproto/index.js: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: h7ml 3 | * @Date: 2021-03-18 10:18:03 4 | * @LastEditTime: 2021-03-18 10:19:01 5 | * @LastEditors: h7ml 6 | * @FilePath: \dgiot-dashboard\src\api\Exproto\index.js 7 | * @Description:拓展编程api整合 8 | */ 9 | import request from '@/utils/request/request' 10 | 11 | export async function getExproto(params) { 12 | return request({ 13 | url: 'exproto', 14 | method: 'get', 15 | params: params, 16 | }) 17 | } 18 | 19 | export async function delExproto(params) { 20 | return request({ 21 | url: 'exproto', 22 | method: 'DELETE', 23 | params: params, 24 | }) 25 | } 26 | 27 | export async function putExproto(data) { 28 | return request({ 29 | url: 'exproto', 30 | method: 'put', 31 | data: data, 32 | }) 33 | } 34 | 35 | export async function postExproto(params) { 36 | return request({ 37 | url: 'release_exproto', 38 | method: 'post', 39 | params: params, 40 | }) 41 | } 42 | -------------------------------------------------------------------------------- /src/api/Group/index.js: -------------------------------------------------------------------------------- 1 | import { 2 | create_object, 3 | del_object, 4 | get_object, 5 | query_object, 6 | update_object, 7 | } from '@/api/Parse' 8 | import request from '@/utils/request/request' 9 | 10 | // 获取虚拟设备分组 11 | /** 12 | * <<"nodeType">> => 0 是设备,<<"nodeType">> => 1 是网关,<<"nodeType">> => 2 是虚拟分组 13 | */ 14 | export async function queryGroup(params) { 15 | params = { 16 | where: { 17 | nodeType: 2, 18 | }, 19 | } 20 | return query_object('Product', params) 21 | } 22 | 23 | export async function getGroup(ObjectId) { 24 | return get_object('Product', ObjectId) 25 | } 26 | 27 | export async function delGroup(ObjectId) { 28 | return del_object('Product', ObjectId) 29 | } 30 | 31 | export async function putGroup(ObjectId, params) { 32 | return update_object('Product', ObjectId, params) 33 | } 34 | 35 | export async function postGroup(params) { 36 | return create_object('Product', params) 37 | } 38 | 39 | // 新建虚拟设备分组 40 | export function addGroup(name) { 41 | return request({ 42 | url: 'group', 43 | method: 'post', 44 | data: { 45 | devType: 'dgiot_hub', 46 | name: name, 47 | topo: 'group_topo', 48 | }, 49 | }) 50 | } 51 | -------------------------------------------------------------------------------- /src/api/MasterData/index.js: -------------------------------------------------------------------------------- 1 | // 10 | 11 | import request from '@/utils/request/request' 12 | import { 13 | create_object, 14 | del_object, 15 | get_object, 16 | update_object, 17 | query_object, 18 | } from '@/api/Parse' 19 | 20 | export async function queryMasterData(params) { 21 | return request({ 22 | url: `/classes/MasterData`, 23 | method: 'get', 24 | params: params, 25 | }) 26 | // return query_object('MasterData', params) 27 | } 28 | 29 | export async function getMasterData(ObjectId) { 30 | return get_object('MasterData', ObjectId) 31 | } 32 | 33 | export async function delMasterData(ObjectId) { 34 | return del_object('MasterData', ObjectId) 35 | } 36 | 37 | export async function putMasterData(ObjectId, params) { 38 | return update_object('MasterData', ObjectId, params) 39 | } 40 | 41 | export async function postMasterData(params) { 42 | return create_object('MasterData', params) 43 | } 44 | -------------------------------------------------------------------------------- /src/api/Menu/index.js: -------------------------------------------------------------------------------- 1 | import { 2 | create_object, 3 | del_object, 4 | query_object, 5 | update_object, 6 | } from '@/api/Parse' 7 | import request from '@/utils/request/request' 8 | 9 | export async function queryMenu(params) { 10 | return query_object('Menu', params) 11 | } 12 | 13 | export async function getToken(company) { 14 | return request({ 15 | url: `token`, 16 | method: 'get', 17 | params: { 18 | name: company, 19 | }, 20 | }) 21 | } 22 | 23 | export async function delMenu(ObjectId) { 24 | return del_object('Menu', ObjectId) 25 | } 26 | 27 | export async function putMenu(ObjectId, params) { 28 | return update_object('Menu', ObjectId, params) 29 | } 30 | 31 | export async function postMenu(params) { 32 | return create_object('Menu', params) 33 | } 34 | 35 | // 获取所有的菜单树 36 | export function getmenuTree() { 37 | return request({ 38 | url: 'menu/tree', 39 | method: 'get', 40 | }) 41 | } 42 | 43 | export function buildmenu() { 44 | return request({ 45 | url: 'menu/build', 46 | method: 'get', 47 | }) 48 | } 49 | 50 | export function add(data) { 51 | return request({ 52 | url: 'menu', 53 | method: 'post', 54 | data, 55 | }) 56 | } 57 | 58 | export function del(id) { 59 | return request({ 60 | url: 'api/menu/' + id, 61 | method: 'delete', 62 | }) 63 | } 64 | 65 | export function edit(data) { 66 | return request({ 67 | url: 'menu', 68 | method: 'put', 69 | data, 70 | }) 71 | } 72 | 73 | export function getNavigation() { 74 | return query_object('Navigation', {}) 75 | } 76 | 77 | export function Roletree() { 78 | return request({ 79 | url: 'roletree', 80 | method: 'get', 81 | }) 82 | } 83 | -------------------------------------------------------------------------------- /src/api/MetaData/index.js: -------------------------------------------------------------------------------- 1 | // 10 | 11 | import request from '@/utils/request/request' 12 | import { 13 | create_object, 14 | del_object, 15 | get_object, 16 | update_object, 17 | query_object, 18 | } from '@/api/Parse' 19 | 20 | export async function queryMaterial(params) { 21 | return request({ 22 | url: `/material`, 23 | method: 'get', 24 | params: params, 25 | }) 26 | } 27 | export async function queryMetaData(params) { 28 | return request({ 29 | url: `/classes/MetaData`, 30 | method: 'get', 31 | params: params, 32 | }) 33 | // return query_object('MetaData', params) 34 | } 35 | 36 | export async function getMetaData(ObjectId) { 37 | return get_object('MetaData', ObjectId) 38 | } 39 | 40 | export async function delMetaData(ObjectId) { 41 | return del_object('MetaData', ObjectId) 42 | } 43 | 44 | export async function putMetaData(ObjectId, params) { 45 | return update_object('MetaData', ObjectId, params) 46 | } 47 | 48 | export async function postMetaData(params) { 49 | return create_object('MetaData', params) 50 | } 51 | -------------------------------------------------------------------------------- /src/api/Mock/SystemLog/index.js: -------------------------------------------------------------------------------- 1 | const { mock } = require('mockjs') 2 | const List = [] 3 | const count = 50 4 | for (let i = 0; i < count; i++) { 5 | List.push( 6 | mock({ 7 | uuid: '@uuid', 8 | id: '@id', 9 | account: '@account(1, 2)', 10 | 'type|1': ['操作日志', '数据库日志', '系统日志'], 11 | 'account|1': ['admin', 'editor', 'test'], 12 | 'executeResult|1': [ 13 | '登录成功', 14 | '登录成功', 15 | '登录失败', 16 | '接口异常', 17 | 'dos攻击', 18 | ], 19 | ip: '@ip', 20 | datetime: '@datetime', 21 | }) 22 | ) 23 | } 24 | 25 | export function getList(query) { 26 | const { account, pageNo = 1, pageSize = 20 } = query 27 | const mockList = List.filter( 28 | (item) => !(account && item.account.indexOf(account) < 0) 29 | ) 30 | const list = mockList.filter( 31 | (item, index) => 32 | index < pageSize * pageNo && index >= pageSize * (pageNo - 1) 33 | ) 34 | return { 35 | code: 200, 36 | msg: 'success', 37 | data: { list, ...{ total: mockList.length } }, 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/api/Mock/konva/index.js: -------------------------------------------------------------------------------- 1 | const Layer = [] 2 | const count = Mock.mock({ 3 | 'number|1-5': 4, 4 | }).number 5 | for (let i = 0; i < count; i++) { 6 | Layer.push( 7 | Mock.mock({ 8 | 'id|1': ['Acrel', 'switch', 'opening', 'pressure_out', 'pressure_in'], 9 | x: Mock.mock({ 10 | 'number|1-1000': 1000, 11 | }).number, 12 | y: Mock.mock({ 13 | 'number|1-1000': 1000, 14 | }).number, 15 | text: Mock.mock({ 16 | 'number|12-36': 24, 17 | }).number, 18 | fontSize: Mock.mock({ 19 | 'number|12-36': 24, 20 | }).number, 21 | fontFamily: 'Calibri', 22 | fill: '@hex()', 23 | type: 'text', 24 | }) 25 | ) 26 | } 27 | const data = { 28 | code: 200, 29 | msg: 'success', 30 | data: { 31 | Stage: { 32 | container: 'container', 33 | id: Mock.mock('@string(5)'), 34 | }, 35 | count, 36 | Layer, 37 | }, 38 | } 39 | 40 | export default data 41 | -------------------------------------------------------------------------------- /src/api/Mock/plant/index.js: -------------------------------------------------------------------------------- 1 | function handleRandomImage(/* width = 50, height = 50 */) { 2 | //return `https://picsum.photos/${width}/${height}?random=${Random.guid()}` 3 | return `https://cdn.jsdelivr.net/gh/chuzhixin/image/table/vab-image-${Mock.Random.integer( 4 | 1, 5 | 38 6 | )}.jpg` 7 | } 8 | 9 | const List = [] 10 | const count = 5 11 | for (let i = 0; i < count; i++) { 12 | List.push( 13 | Mock.mock({ 14 | id: '@id', 15 | title: '@ctitle(2, 5)', 16 | description: '@csentence', 17 | datetime: '@datetime', 18 | percent: '@integer(80,99)', 19 | percentage: '@integer(0,100)', 20 | }) 21 | ) 22 | } 23 | 24 | export function getList() { 25 | // const { title, pageNo = 1, pageSize = 20 } = params 26 | // const mockList = List.filter( 27 | // (item) => !(title && item.title.indexOf(title) < 0) 28 | // ) 29 | // const list = mockList.filter( 30 | // (item, index) => 31 | // index < pageSize * pageNo && index >= pageSize * (pageNo - 1) 32 | // ) 33 | return { 34 | code: 200, 35 | msg: 'success', 36 | data: { List }, 37 | } 38 | } 39 | export function doEdit() { 40 | return { 41 | code: 200, 42 | msg: '模拟保存成功', 43 | } 44 | } 45 | 46 | export function doDelete() { 47 | return { 48 | code: 200, 49 | msg: '模拟删除成功', 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/api/Modeling/index.js: -------------------------------------------------------------------------------- 1 | // 10 | 11 | import request from '@/utils/request/request' 12 | import { 13 | create_object, 14 | del_object, 15 | get_object, 16 | update_object, 17 | query_object, 18 | } from '@/api/Parse' 19 | 20 | export async function queryRoleTree() { 21 | return request({ 22 | url: `/roletree`, 23 | method: 'get', 24 | // params: params, 25 | }) 26 | // return query_object('MetaData', params) 27 | } 28 | //iotapi/classes/Dict 29 | export async function queryDictTemp(params) { 30 | return request({ 31 | url: `/classes/Dict`, 32 | method: 'get', 33 | params: params, 34 | }) 35 | // return query_object('MetaData', params) 36 | } 37 | 38 | // export async function getMetaData(ObjectId) { 39 | // return get_object('MetaData', ObjectId) 40 | // } 41 | 42 | // export async function delMetaData(ObjectId) { 43 | // return del_object('MetaData', ObjectId) 44 | // } 45 | 46 | // export async function putMetaData(ObjectId, params) { 47 | // return update_object('MetaData', ObjectId, params) 48 | // } 49 | 50 | export async function postRole(params) { 51 | return request({ 52 | url: `/role`, 53 | method: 'post', 54 | data: params, 55 | }) 56 | // return create_object('role', params) 57 | } 58 | -------------------------------------------------------------------------------- /src/api/Notification/index.js: -------------------------------------------------------------------------------- 1 | // 10 | 11 | import request from '@/utils/request/request' 12 | import { 13 | create_object, 14 | del_object, 15 | get_object, 16 | update_object, 17 | query_object, 18 | } from '@/api/Parse' 19 | 20 | export async function queryNotification(params) { 21 | return request({ 22 | url: `classes/Notification`, 23 | method: 'get', 24 | params: params, 25 | }) 26 | // return query_object('Notification', params) 27 | } 28 | 29 | export async function getNotification(ObjectId) { 30 | return get_object('Notification', ObjectId) 31 | } 32 | 33 | export async function delNotification(ObjectId) { 34 | return del_object('Notification', ObjectId) 35 | } 36 | 37 | export async function putNotification(ObjectId, params) { 38 | return update_object('Notification', ObjectId, params) 39 | } 40 | 41 | export async function postNotification(params) { 42 | return create_object('Notification', params) 43 | } 44 | 45 | export async function getconfiguration() { 46 | return request({ 47 | url: `configuration`, 48 | method: 'get', 49 | }) 50 | } 51 | 52 | export async function postconfiguration(data) { 53 | return request({ 54 | url: `configuration`, 55 | method: 'post', 56 | data: data, 57 | }) 58 | } 59 | -------------------------------------------------------------------------------- /src/api/Opc/index.js: -------------------------------------------------------------------------------- 1 | // * @Author: dext7r 2 | // * @Date: 2021-12-16 21:35:04 3 | // * @LastEditors: dext7r 4 | // * @LastEditTime: 2021-12-16 21:35:04 5 | // * @Description: 6 | // * @FilePath: src\api\Opc\index.js 7 | // * @DocumentLink: http://prod.iotn2n.com/dgiot_swagger/#/OPC 8 | import request from '@/utils/request/request' 9 | 10 | /** 11 | * @docs-api http://prod.iotn2n.com/dgiot_swagger/#/OPC/post_head 12 | * @param data 13 | * @return {Promise<*>} 14 | * @description 获取表头 15 | */ 16 | export async function postHead(data) { 17 | return request({ 18 | url: 'head', 19 | method: 'post', 20 | headers: { 21 | accept: 'application/json', 22 | 'Content-Type': 'application/json', 23 | }, 24 | data: data, 25 | }) 26 | } 27 | -------------------------------------------------------------------------------- /src/api/Permission/index.js: -------------------------------------------------------------------------------- 1 | import { 2 | create_object, 3 | del_object, 4 | get_object, 5 | query_object, 6 | update_object, 7 | } from '@/api/Parse' 8 | import request from '@/utils/request/request' 9 | 10 | export async function queryPermission(params) { 11 | return query_object('Permission', params) 12 | } 13 | 14 | export async function getPermission(ObjectId) { 15 | return get_object('Permission', ObjectId) 16 | } 17 | 18 | export async function delPermission(ObjectId) { 19 | return del_object('Permission', ObjectId) 20 | } 21 | 22 | export async function putPermission(ObjectId, params) { 23 | return update_object('Permission', ObjectId, params) 24 | } 25 | 26 | export async function postPermission(params) { 27 | return create_object('Permission', params) 28 | } 29 | 30 | export async function Permission() { 31 | return request({ 32 | url: `/classes/Permission`, 33 | method: 'get', 34 | headers: { 35 | accept: 'application/json', 36 | 'Content-Type': 'application/json', 37 | }, 38 | }) 39 | } 40 | -------------------------------------------------------------------------------- /src/api/Product/index.js: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: h7ml 3 | * @Date: 2021-02-22 10:31:17 4 | * @LastEditTime: 2021-03-03 15:23:10 5 | * @LastEditors: h7ml 6 | * @Description: In User Settings Edit 7 | * @FilePath: \dgiot-dashboard\src\api\Product\index.js 8 | */ 9 | import { 10 | create_object, 11 | del_object, 12 | get_object, 13 | query_object, 14 | update_object, 15 | } from '@/api/Parse' 16 | import request from '@/utils/request/request' 17 | 18 | export async function queryProduct(params) { 19 | return query_object('Product', params) 20 | } 21 | 22 | export async function getProduct(ObjectId) { 23 | return get_object('Product', ObjectId) 24 | } 25 | 26 | export async function delProduct(ObjectId) { 27 | return del_object('Product', ObjectId) 28 | } 29 | 30 | export async function putProduct(ObjectId, params) { 31 | return update_object('Product', ObjectId, params) 32 | } 33 | 34 | export async function postProduct(params) { 35 | return create_object('Product', params) 36 | } 37 | 38 | export function postThing(data) { 39 | return request({ 40 | url: 'thing', 41 | method: 'post', 42 | data, 43 | }) 44 | } 45 | 46 | export function putThing(data) { 47 | return request({ 48 | url: 'thing', 49 | method: 'put', 50 | data, 51 | }) 52 | } 53 | 54 | export function deleteThing(data) { 55 | return request({ 56 | url: 'thing', 57 | method: 'delete', 58 | data, 59 | }) 60 | } 61 | -------------------------------------------------------------------------------- /src/api/ProductTemplet/index.js: -------------------------------------------------------------------------------- 1 | // * @Author: h7ml 2 | // * @Date: 2021-08-17 12:09:24 3 | // * @LastEditors: h7ml 4 | // * @LastEditTime: 2021-08-17 12:09:24 5 | // * @Description: api ProductTemplet 6 | // * @FilePath: src\api\ProductTemplet\index.js 7 | // * @DocumentLink: http://prod.iotn2n.com/swagger/#/ProductTemplet 8 | import request from '@/utils/request/request' 9 | import { 10 | create_object, 11 | del_object, 12 | get_object, 13 | update_object, 14 | } from '@/api/Parse' 15 | 16 | export async function queryProductTemplet(params) { 17 | return request({ 18 | url: `/classes/ProductTemplet`, 19 | method: 'get', 20 | params: params, 21 | }) 22 | } 23 | 24 | export async function getProductTemplet(ObjectId) { 25 | return get_object('ProductTemplet', ObjectId) 26 | } 27 | 28 | export async function delProductTemplet(ObjectId) { 29 | return del_object('ProductTemplet', ObjectId) 30 | } 31 | 32 | export async function putProductTemplet(ObjectId, params) { 33 | return update_object('ProductTemplet', ObjectId, params) 34 | } 35 | 36 | export async function postProductTemplet(params) { 37 | return create_object('ProductTemplet', params) 38 | } 39 | -------------------------------------------------------------------------------- /src/api/Project/index.js: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: h7ml 3 | * @Date: 2021-02-22 10:31:17 4 | * @LastEditTime: 2021-03-03 15:23:10 5 | * @LastEditors: h7ml 6 | * @Description: In User Settings Edit 7 | * @FilePath: \dgiot-dashboard\src\api\Project\index.js 8 | */ 9 | import { 10 | create_object, 11 | del_object, 12 | get_object, 13 | query_object, 14 | } from '@/api/Parse' 15 | import request from '@/utils/request/request' 16 | 17 | export async function queryProject(params) { 18 | return query_object('Project', params) 19 | } 20 | 21 | export async function getProject(ObjectId) { 22 | return get_object('Project', ObjectId) 23 | } 24 | 25 | export async function delProject(ObjectId) { 26 | return del_object('Project', ObjectId) 27 | } 28 | 29 | export async function putProject(ObjectId, params) { 30 | return request({ 31 | url: `/classes/Project/${ObjectId}`, 32 | method: 'PUT', 33 | headers: { 34 | accept: 'application/json', 35 | 'Content-Type': 'application/json', 36 | }, 37 | data: params, 38 | }) 39 | } 40 | 41 | export async function postProject(params) { 42 | return create_object('Project', params) 43 | } 44 | -------------------------------------------------------------------------------- /src/api/Protocol/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description Dlink 协议 3 | * @docs-api https://dev.iotn2n.com/dgiot_swagger/#/Protocol/get_protocol 4 | */ 5 | /** 6 | * @description /protocol 获取协议列表 7 | * @returns {Promise<*>} 8 | */ 9 | import request from '@/utils/request/request' 10 | export async function getProtocol() { 11 | return request({ 12 | url: `/protocol`, 13 | method: 'get', 14 | headers: { 15 | accept: 'application/json', 16 | }, 17 | }) 18 | } 19 | -------------------------------------------------------------------------------- /src/api/Python/index.js: -------------------------------------------------------------------------------- 1 | /* 2 | * @Description: Python相关接口 3 | * @FilePath: src/api/Python/index.js 4 | */ 5 | // https://docs.parseplatform.org/rest/guide/#batch-operations 6 | // http://39.104.86.18/dgiot_swagger/#/Python/post_python_sinmahe_statistics 7 | import { 8 | create_object, 9 | del_object, 10 | get_object, 11 | query_object, 12 | update_object, 13 | } from '@/api/Parse' 14 | import request from '@/utils/request/request' 15 | 16 | /** 17 | * 18 | * @param params 19 | * @returns {Promise<*>} 20 | */ 21 | export async function getStatistics(params) { 22 | return request({ 23 | url: `python_device_statistics`, 24 | method: 'post', 25 | data: params, 26 | headers: { 27 | 'Content-Type': 'application/json', 28 | accept: 'application/json', 29 | }, 30 | }) 31 | } 32 | -------------------------------------------------------------------------------- /src/api/Relation/index.js: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: h7ml 3 | * @Date: 2021-03-01 10:03:27 4 | * @LastEditTime: 2021-03-01 10:22:52 5 | * @LastEditors: Please set LastEditors 6 | * @Description: In User Settings Edit 7 | * @FilePath: \dgiot-dashboard\src\api\Platform\index.js 8 | */ 9 | import request from '@/utils/request/request' 10 | 11 | export async function postRelation(data) { 12 | return request({ 13 | url: 'relation', 14 | method: 'post', 15 | headers: { 16 | accept: 'application/json', 17 | 'Content-Type': 'application/json', 18 | }, 19 | data: data, 20 | }) 21 | } 22 | 23 | export async function delRelation(data) { 24 | return request({ 25 | url: 'relation', 26 | method: 'delete', 27 | headers: { 28 | accept: 'application/json', 29 | 'Content-Type': 'application/json', 30 | }, 31 | data: data, 32 | }) 33 | } 34 | 35 | export async function queryRelation(params) { 36 | return request({ 37 | url: 'relation', 38 | method: 'get', 39 | headers: { 40 | accept: 'application/json', 41 | 'Content-Type': 'application/json', 42 | }, 43 | params: params, 44 | }) 45 | } 46 | -------------------------------------------------------------------------------- /src/api/Report/index.js: -------------------------------------------------------------------------------- 1 | import request from '@/utils/request/request' 2 | 3 | export async function postRelation(params) { 4 | return request({ 5 | url: 'report', 6 | method: 'Delete', 7 | params: params, 8 | }) 9 | } 10 | 11 | export function postreport(data) { 12 | return request({ 13 | url: 'report', 14 | method: 'post', 15 | data, 16 | }) 17 | } 18 | -------------------------------------------------------------------------------- /src/api/System/filemanagement.js: -------------------------------------------------------------------------------- 1 | import request from '@/utils/request/request' 2 | 3 | //emicp 4 | export async function getproductTree(params) { 5 | return request({ 6 | url: `/producttree`, 7 | method: 'get', 8 | }) 9 | // return query_object('MetaData', params) 10 | } 11 | 12 | export function list_dir(path) { 13 | return request({ 14 | url: 'list_dir', 15 | method: 'get', 16 | params: { 17 | path: path, 18 | }, 19 | }) 20 | } 21 | 22 | export function file_info(path) { 23 | return request({ 24 | url: 'file_info', 25 | method: 'get', 26 | params: { 27 | path: path, 28 | }, 29 | }) 30 | } 31 | 32 | export function delete_file(path) { 33 | return request({ 34 | url: 'file_info', 35 | method: 'DELETE', 36 | params: { 37 | path: path, 38 | }, 39 | }) 40 | } 41 | -------------------------------------------------------------------------------- /src/api/System/system.js: -------------------------------------------------------------------------------- 1 | import request from '@/utils/request/request' 2 | 3 | export function Getmodule(app) { 4 | return request({ 5 | url: '/plugin/' + app, 6 | method: 'post', 7 | params: { 8 | Action: 'modules', 9 | }, 10 | }) 11 | } 12 | 13 | export function GetReload(app) { 14 | return request({ 15 | url: '/plugin/' + app, 16 | method: 'post', 17 | params: { 18 | Action: 'reload', 19 | }, 20 | }) 21 | } 22 | 23 | export function Compile(code) { 24 | return request({ 25 | url: '/compile', 26 | method: 'post', 27 | data: { 28 | code: code, 29 | }, 30 | }) 31 | } 32 | 33 | export function subupadte(channelId, action) { 34 | return request({ 35 | url: `/control/channel`, 36 | method: 'post', 37 | params: { 38 | id: channelId, 39 | action: action, 40 | }, 41 | }) 42 | } 43 | -------------------------------------------------------------------------------- /src/api/Topo/index.js: -------------------------------------------------------------------------------- 1 | import request from '@/utils/request/request' 2 | 3 | export async function _getTopo(params) { 4 | return request({ 5 | url: '/topo', 6 | method: 'get', 7 | params: params, 8 | }) 9 | } 10 | 11 | export async function get_konva_thing(params) { 12 | return request({ 13 | url: '/konva_thing', 14 | method: 'get', 15 | params: params, 16 | }) 17 | } 18 | 19 | export async function edit_konva_thing(params) { 20 | return request({ 21 | url: '/konva_thing', 22 | method: 'post', 23 | data: params, 24 | }) 25 | } 26 | -------------------------------------------------------------------------------- /src/api/Upload/index.js: -------------------------------------------------------------------------------- 1 | import request from '@/utils/request/request' 2 | 3 | /** 4 | * @doc-apis https://prod.iotn2n.com/dgiot_swagger/#/Data/post_upload 5 | * @param params 6 | * @return {*} 7 | */ 8 | export async function uppyUpload( 9 | url, 10 | params, 11 | headers = { 12 | Accept: 'application/json', 13 | 'Content-Type': 'application/json; charset=utf-8', 14 | } 15 | ) { 16 | return axios.post(url, params, headers) 17 | } 18 | -------------------------------------------------------------------------------- /src/config/cli.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | publicPath: './', 3 | outputDir: 'dist', 4 | assetsDir: 'static', 5 | lintOnSave: true, 6 | transpileDependencies: ['resize-detector'], 7 | devPort: '80', 8 | providePlugin: {}, 9 | build7z: false, 10 | buildGzip: true, 11 | imageCompression: false, 12 | useCdn: true, 13 | ignoreCdn: ['php', 'bugtags', '1279876845', 'qq'], 14 | iconfontId: ['font_2759556_r8d9wroaw8'], 15 | isSmp: false, 16 | CDN_URL: '/dgiot_dashboard/public', 17 | CDN: '//dgiot.netlify.app', 18 | } 19 | -------------------------------------------------------------------------------- /src/config/developer.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 由于dgiot开源平台和项目地址代理api不一致,可以将项目配置文件放在以下。代理链接后面不要写/ 3 | */ 4 | module.exports = { 5 | proxy: [ 6 | /** 7 | * @description iotapi 联调接口。开发使用 8 | */ 9 | { 10 | path: 'iotapi', 11 | target: 'http://192.168.1.150', 12 | }, 13 | /** 14 | * @description 静态资源目录。开发使用 15 | */ 16 | { 17 | path: 'dgiot_dashboard', 18 | target: 'http://192.168.1.150', 19 | }, 20 | /** 21 | * @description dgiot_file文件资源目录。开发使用 22 | */ 23 | { 24 | path: 'dgiot_file', 25 | target: 'http://192.168.1.150', 26 | }, 27 | /** 28 | * @description dgiot_file文件资源目录。开发使用 29 | */ 30 | { 31 | path: 'upload', 32 | target: 'http://192.168.1.150', 33 | }, 34 | /** 35 | * @description amis server 开发使用 36 | */ 37 | { 38 | path: 'baidubce', 39 | target: 'https://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock', 40 | }, 41 | { 42 | path: 'amis', 43 | target: 'https://aisuda.bce.baidu.com/amis/api/mock2', 44 | }, 45 | ], 46 | } 47 | -------------------------------------------------------------------------------- /src/config/developer.lock.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 由于dgiot开源平台和项目地址代理api不一致,可以将项目配置文件放在以下。代理链接后面不要写/ 3 | */ 4 | module.exports = { 5 | proxy: [ 6 | /** 7 | * @description iotapi 联调接口。开发使用 8 | */ 9 | { 10 | path: 'iotapi', 11 | target: 'http://127.0.0.1:5080', 12 | }, 13 | /** 14 | * @description 静态资源目录。开发使用 15 | */ 16 | { 17 | path: 'dgiot_dashboard', 18 | target: 'http://127.0.0.1:5080', 19 | }, 20 | /** 21 | * @description dgiot_file文件资源目录。开发使用 22 | */ 23 | { 24 | path: 'dgiot_file', 25 | target: 'http://127.0.0.1:5080', 26 | }, 27 | /** 28 | * @description amis server 开发使用 29 | */ 30 | { 31 | path: 'baidubce', 32 | target: 'https://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock', 33 | }, 34 | { 35 | path: 'amis', 36 | target: 'https://aisuda.bce.baidu.com/amis/api/mock2', 37 | }, 38 | ], 39 | } 40 | -------------------------------------------------------------------------------- /src/config/index.js: -------------------------------------------------------------------------------- 1 | const cli = require('./cli.config') 2 | const setting = require('./setting.config') 3 | const theme = require('./theme.config') 4 | const network = require('./net.config') 5 | const local = require('./local.config') 6 | const pwa = require('./pwa.config') 7 | const og = require('./og.config') 8 | const mqtt = require('./mqtt.config') 9 | const secret = require('./secret.config') 10 | const packages = require('../../package.json') 11 | const info = { 12 | ...cli, 13 | ...setting, 14 | ...theme, 15 | ...network, 16 | ...pwa, 17 | ...mqtt, 18 | ...local, 19 | ...og, 20 | ...secret, 21 | ...packages, 22 | } 23 | module.exports = info 24 | -------------------------------------------------------------------------------- /src/config/loca.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 由于dgiot开源平台和项目地址代理api不一致,可以将项目配置文件放在以下。代理链接后面不要写/ 3 | */ 4 | module.exports = { 5 | proxy: [ 6 | /** 7 | * @description iotapi 联调接口。开发使用 8 | */ 9 | { 10 | path: 'iotapi', 11 | target: 'http://127.0.0.1:5080', 12 | }, 13 | /** 14 | * @description 静态资源目录。开发使用 15 | */ 16 | { 17 | path: 'dgiot_dashboard', 18 | target: 'http://127.0.0.1:5080', 19 | }, 20 | /** 21 | * @description dgiot_file文件资源目录。开发使用 22 | */ 23 | { 24 | path: 'dgiot_file', 25 | target: 'http://127.0.0.1:5080', 26 | }, 27 | /** 28 | * @description amis server 开发使用 29 | */ 30 | { 31 | path: 'baidubce', 32 | target: 'https://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock', 33 | }, 34 | { 35 | path: 'amis', 36 | target: 'https://aisuda.bce.baidu.com/amis/api/mock2', 37 | }, 38 | ], 39 | } 40 | -------------------------------------------------------------------------------- /src/config/mqtt.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | // 是否自动重连 3 | reconnect: true, 4 | // 最大重连次数,值小于4,则该设置无效 5 | maxReconnectNum: 10, 6 | } 7 | -------------------------------------------------------------------------------- /src/config/net.config.js: -------------------------------------------------------------------------------- 1 | const proxy = require('./developer.config').proxy 2 | module.exports = { 3 | proxy, 4 | baseURL: proxy[0].path, 5 | contentType: 'application/json', 6 | requestTimeout: 1000 * 60 * 3, 7 | successCode: [ 8 | 200, 9 | 0, 10 | 201, 11 | 204, 12 | 404, 13 | 500, 14 | '200', 15 | '0', 16 | '201', 17 | '204', 18 | '404', 19 | '500', 20 | ], 21 | errorCode: [401, 209, '209', '401'], 22 | statusName: 'code', 23 | messageName: 'msg', 24 | CODE_MESSAGE: { 25 | 200: '服务器成功返回请求数据', 26 | 201: '新建或修改数据成功', 27 | 202: '一个请求已经进入后台排队(异步任务)', 28 | 204: '删除数据成功', 29 | 400: '发出信息有误', 30 | 401: '用户没有权限(令牌、用户名、密码错误)', 31 | 403: '用户得到授权,但是访问是被禁止的', 32 | 404: '访问资源不存在', 33 | 406: '请求格式不可得', 34 | 410: '请求资源被永久删除,且不会被看到', 35 | 500: '服务器发生错误', 36 | 502: '网关错误', 37 | 503: '服务不可用,服务器暂时过载或维护', 38 | 504: '网关超时', 39 | }, 40 | } 41 | -------------------------------------------------------------------------------- /src/config/og.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @document https://ogp.me/ 3 | * @document https://www.freecodecamp.org/news/what-is-open-graph-and-how-can-i-use-it-for-my-website/ 4 | * @document https://stackoverflow.com/questions/19778620/provide-an-image-for-whatsapp-link-sharing 5 | * @document https://sharethis.com/support/legacy/how-to-customize-which-url-text-and-img-to-share/ 6 | * @document https://juejin.cn/post/7023173942001008670#heading-21 7 | * @Description Open Graph Protocol(开放图谱协议) 8 | * @type {{ogConfig: {'og:image': string, 'og:type': string, 'article:section': string, 'og:image:width': string, 'twitter:card': string, 'og:site_name': string, 'og:title': string, 'og:image:height': string, 'og:description': string, 'article:publisher': string, 'og:image:secure_url': string, 'article:tag': string, 'og:url': string}}} 9 | */ 10 | module.exports = { 11 | ogConfig: { 12 | 'og:site_name': 'dgiot-物联网平台', 13 | 'og:title': 'dgiot-物联网开发平台', 14 | 'og:description': '提供物联网垂直领域应用使能平台及解决方案', 15 | 'og:url': 'https://prod.iotn2n.com', 16 | 'og:type': 'article', 17 | 'article:publisher': 'https://www.iotn2n.com', 18 | 'article:section': 'dgiot', 19 | 'article:tag': 'dgiot', 20 | 'og:image': 21 | 'https://www.iotn2n.com/attachment/images/2021/08/09/image_1628483547_LQMfGmnU.jpg', 22 | 'og:image:secure_url': 23 | 'https://www.iotn2n.com/attachment/images/2021/08/09/image_1628483547_LQMfGmnU.jpg', 24 | 'og:image:width': '1280', 25 | 'og:image:height': '640', 26 | 'twitter:card': 'summary_large_image', 27 | }, 28 | } 29 | -------------------------------------------------------------------------------- /src/config/pwa.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | isPwa: true, 3 | pwaConfig: { 4 | workboxOptions: { 5 | skipWaiting: true, 6 | clientsClaim: true, 7 | }, 8 | themeColor: '#46bd87', 9 | msTileColor: '#ffffff', 10 | appleMobileWebAppCapable: 'yes', 11 | appleMobileWebAppStatusBarStyle: 'black', 12 | manifestOptions: { 13 | author: 'h7ml ', 14 | dateTime: new Date(), 15 | name: 'dgiot-dashboard', 16 | short_name: 'dgiot-dashboard', 17 | description: '提供物联网垂直领域应用使能平台及解决方案', 18 | display: 'standalone', 19 | orientation: 'portrait-primary', 20 | prefer_related_applications: false, 21 | background_color: '#ffffff', 22 | lang: 'zh-CN', 23 | start_url: '/', 24 | scope: '/', 25 | theme_color: '#4fc08d', 26 | icons: [ 27 | { 28 | src: './dgiot_dashboard/public/assets/images/icons/android-chrome-192x192.png', 29 | sizes: '192x192', 30 | type: 'image/png', 31 | }, 32 | { 33 | src: './dgiot_dashboard/public/assets/images/icons/android-chrome-512x512.png', 34 | sizes: '512x512', 35 | type: 'image/png', 36 | }, 37 | { 38 | src: './dgiot_dashboard/public/assets/images/icons/android-chrome-maskable-192x192.png', 39 | sizes: '192x192', 40 | type: 'image/png', 41 | purpose: 'maskable', 42 | }, 43 | { 44 | src: './dgiot_dashboard/public/assets/images/icons/android-chrome-maskable-512x512.png', 45 | sizes: '512x512', 46 | type: 'image/png', 47 | purpose: 'maskable', 48 | }, 49 | ], 50 | }, 51 | }, 52 | } 53 | -------------------------------------------------------------------------------- /src/config/router.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * @type {{redirect: string, path: string, component: string, children: [{path: string, component: string, meta: {icon: string, title: string, noClosable: boolean}, name: string}], meta: {icon: string, title: string}, name: string}} 4 | */ 5 | // indexRoutes 首页路由 6 | const indexRoutes = { 7 | path: '/', 8 | name: 'Root', 9 | component: 'Layout', 10 | redirect: '/index', 11 | meta: { 12 | title: '总控台', 13 | icon: 'home-2-line', 14 | }, 15 | children: [ 16 | { 17 | path: 'index', 18 | name: 'Index', 19 | component: '@/views/equipment_management/platform_overview', 20 | meta: { 21 | title: '总控台', 22 | icon: 'home-2-line', 23 | noClosable: true, 24 | }, 25 | }, 26 | ], 27 | } 28 | // defaultRoutes 29 | const defaultRoutes = { 30 | path: '/roles', 31 | name: 'User', 32 | component: 'Layout', 33 | redirect: '/structures', 34 | meta: { 35 | title: '多租户', 36 | icon: 'admin-fill', 37 | }, 38 | children: [ 39 | { 40 | path: '/roles/menu', 41 | name: 'Menu_management', 42 | component: '@/views/roles/menu', 43 | meta: { 44 | icon: 'menu-2-fill', 45 | title: '菜单管理', 46 | }, 47 | }, 48 | { 49 | path: '/roles/roles', 50 | name: 'Role_management', 51 | component: '@/views/roles/rolelist/roles', 52 | meta: { 53 | title: '角色管理', 54 | icon: 'admin-line', 55 | }, 56 | }, 57 | ], 58 | } 59 | // 出错路由重定向 60 | const errorRoutes = { 61 | path: '*', 62 | redirect: '/404', 63 | hidden: true, 64 | } 65 | module.exports = { 66 | indexRoutes, 67 | errorRoutes, 68 | defaultRoutes, 69 | } 70 | -------------------------------------------------------------------------------- /src/config/secret.config.js: -------------------------------------------------------------------------------- 1 | // * @Author: h7ml 2 | // * @Date: 2021-12-13 11:06:54 3 | // * @LastEditors: h7ml 4 | // * @LastEditTime: 2021-12-13 11:06:54 5 | // * @Description: 用于平台相关机密应用信息配置。建议开发者申请对应的key后替换 6 | // * @FilePath: src\config\secret.config.js 7 | 8 | module.exports = { 9 | secret: { 10 | // 百度相关 11 | baidu: { 12 | // 百度地图 Ak https://lbsyun.baidu.com/apiconsole/key#/home 13 | map: 'S7pehghn5BdQeSGZAcpEk4bLQSQ8czvi', 14 | // 百度统计 https://tongji.baidu.com/web/homepage/index 15 | statistics: '', 16 | }, 17 | // 腾讯相关 18 | tencent: { 19 | // 腾讯地图 Ak https://lbs.qq.com/ 20 | map: '', 21 | }, 22 | }, 23 | } 24 | -------------------------------------------------------------------------------- /src/config/theme.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 导出主题配置,注意事项:此配置下的项修改后需清理浏览器缓存!!! 3 | */ 4 | module.exports = { 5 | // 布局种类:横向布局horizontal、纵向布局vertical、分栏布局column、综合布局comprehensive、常规布局common 6 | layout: 'horizontal', 7 | // 主题名称:默认default、海洋之心ocean、绿荫草场green、碰触纯白white 8 | themeName: 'ocean', 9 | // 分栏风格(仅针对分栏布局column时生效):横向风格horizontal、纵向风格vertical、卡片风格card 10 | columnStyle: 'horizontal', 11 | // 是否固定头部固定 12 | fixedHeader: true, 13 | // 是否开启顶部进度条 14 | showProgressBar: true, 15 | // 是否开启标签页 16 | showTabs: true, 17 | // 显示标签页时标签页样式:卡片风格card、灵动风格smart、圆滑风格smooth 18 | tabsBarStyle: 'card', 19 | // 是否标签页图标 20 | showTabsBarIcon: true, 21 | // 是否开启语言选择组件 22 | showLanguage: true, 23 | // 是否开启刷新组件 24 | showRefresh: true, 25 | // 是否开启搜索组件 26 | showSearch: false, 27 | // 是否开启主题组件 28 | showTheme: true, 29 | // 是否开启通知组件 30 | showNotice: true, 31 | // 是否开启全屏组件 32 | showFullScreen: true, 33 | // 是否开启右侧悬浮窗 34 | showThemeSetting: true, 35 | // 是否开启侧边栏图片切换 36 | pictureSwitch: true, 37 | } 38 | 39 | // {"layout":"comprehensive","themeName":"green","columnStyle":"horizontal","fixedHeader":true,"showProgressBar":true,"showTabs":true,"tabsBarStyle":"card","showTabsBarIcon":true,"showLanguage":true,"showRefresh":true,"showSearch":false,"showTheme":true,"showNotice":false,"showFullScreen":true,"showThemeSetting":false} 40 | -------------------------------------------------------------------------------- /src/dgiot/components/DgiotAmis/index.vue: -------------------------------------------------------------------------------- 1 | 10 | 16 | 17 | 63 | 64 | -------------------------------------------------------------------------------- /src/dgiot/components/DgiotBreadcrumb/index.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 41 | 42 | 66 | -------------------------------------------------------------------------------- /src/dgiot/components/DgiotDoc/index.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 22 | -------------------------------------------------------------------------------- /src/dgiot/components/DgiotDraggable/index.vue: -------------------------------------------------------------------------------- 1 | 10 | 23 | 24 | 59 | -------------------------------------------------------------------------------- /src/dgiot/components/DgiotFlipDown/reset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dgiot/iotStudio/1f8f2c16f2c792f2b9b17847d2274d6ccc3315f8/src/dgiot/components/DgiotFlipDown/reset.png -------------------------------------------------------------------------------- /src/dgiot/components/DgiotFooter/index.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 19 | 20 | 37 | -------------------------------------------------------------------------------- /src/dgiot/components/DgiotFullScreen/index.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 57 | -------------------------------------------------------------------------------- /src/dgiot/components/DgiotIcon/index.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 17 | 18 | 24 | -------------------------------------------------------------------------------- /src/dgiot/components/DgiotLanguage/index.vue: -------------------------------------------------------------------------------- 1 | 9 | 21 | 22 | 49 | 54 | -------------------------------------------------------------------------------- /src/dgiot/components/DgiotLink/index.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 43 | -------------------------------------------------------------------------------- /src/dgiot/components/DgiotMenu/components/DgiotSubMenu.vue: -------------------------------------------------------------------------------- 1 | 9 | 43 | 44 | 58 | -------------------------------------------------------------------------------- /src/dgiot/components/DgiotPuzzle/reset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dgiot/iotStudio/1f8f2c16f2c792f2b9b17847d2274d6ccc3315f8/src/dgiot/components/DgiotPuzzle/reset.png -------------------------------------------------------------------------------- /src/dgiot/components/DgiotQueryForm/components/DgiotQueryFormBottomPanel.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 14 | -------------------------------------------------------------------------------- /src/dgiot/components/DgiotQueryForm/components/DgiotQueryFormLeftPanel.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 20 | -------------------------------------------------------------------------------- /src/dgiot/components/DgiotQueryForm/components/DgiotQueryFormRightPanel.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 20 | -------------------------------------------------------------------------------- /src/dgiot/components/DgiotQueryForm/components/DgiotQueryFormTopPanel.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 14 | -------------------------------------------------------------------------------- /src/dgiot/components/DgiotQueryForm/index.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 12 | 13 | 61 | -------------------------------------------------------------------------------- /src/dgiot/components/DgiotRefresh/index.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 57 | -------------------------------------------------------------------------------- /src/dgiot/components/DgiotRequire/index.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 64 | -------------------------------------------------------------------------------- /src/dgiot/components/DgiotRoleSwitch/index.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 31 | -------------------------------------------------------------------------------- /src/dgiot/components/DgiotSetting/index.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 33 | 34 | 70 | -------------------------------------------------------------------------------- /src/dgiot/components/DgiotSourceCode/index.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 29 | 30 | 62 | -------------------------------------------------------------------------------- /src/dgiot/components/DgiotTheme/index.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 26 | -------------------------------------------------------------------------------- /src/dgiot/directives/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description Vue custom directives 3 | * @date 2021-8-5 19:25:14 4 | * @author h7ml 5 | * @email h7ml@qq.com 6 | * @url https://cn.vuejs.org/v2/guide/custom-directive.html 7 | * @url https://www.jianshu.com/p/8d3980334b80 8 | */ 9 | import { $clipboard } from './package/clipboard' 10 | 11 | const modulesFiles = require.context('./package', true, /.js$/) 12 | const modules = modulesFiles.keys().reduce((modules, modulePath) => { 13 | const moduleName = modulePath.replace(/^.\/(.*)\.js/, '$1') 14 | const value = modulesFiles(modulePath) 15 | modules[moduleName] = value.default 16 | return modules 17 | }, {}) 18 | const directives = { 19 | ...modules, 20 | } 21 | 22 | export default { 23 | install(Vue) { 24 | Vue.prototype.$clipboard = $clipboard 25 | Object.keys(directives).forEach((key) => { 26 | Vue.directive(key, directives[key]) 27 | }) 28 | }, 29 | } 30 | -------------------------------------------------------------------------------- /src/dgiot/directives/package/assets/waves.css: -------------------------------------------------------------------------------- 1 | .waves-ripple { 2 | position: absolute; 3 | border-radius: 100%; 4 | background-color: rgba(0, 0, 0, 0.15); 5 | background-clip: padding-box; 6 | pointer-events: none; 7 | -webkit-user-select: none; 8 | -moz-user-select: none; 9 | -ms-user-select: none; 10 | user-select: none; 11 | -webkit-transform: scale(0); 12 | -ms-transform: scale(0); 13 | transform: scale(0); 14 | opacity: 1; 15 | } 16 | 17 | .waves-ripple.z-active { 18 | opacity: 0; 19 | -webkit-transform: scale(2); 20 | -ms-transform: scale(2); 21 | transform: scale(2); 22 | -webkit-transition: opacity 1.2s ease-out, -webkit-transform 0.6s ease-out; 23 | transition: opacity 1.2s ease-out, -webkit-transform 0.6s ease-out; 24 | transition: opacity 1.2s ease-out, transform 0.6s ease-out; 25 | transition: opacity 1.2s ease-out, transform 0.6s ease-out, 26 | -webkit-transform 0.6s ease-out; 27 | } 28 | -------------------------------------------------------------------------------- /src/dgiot/directives/package/backtop.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * @type {{bind(*, *, *): void, unbind(*): void, update(*, *, *): void}} 4 | * @url https://juejin.cn/post/6963840401899782175#heading-5 5 | */ 6 | const backtop = { 7 | bind(el, binding, vnode) { 8 | // 响应点击后滚动到元素顶部 9 | el.addEventListener('click', () => { 10 | const target = binding.arg ? document.getElementById(binding.arg) : window 11 | target.scrollTo({ 12 | top: 0, 13 | behavior: 'smooth', 14 | }) 15 | }) 16 | }, 17 | update(el, binding, vnode) { 18 | // 滚动到达参数值才出现绑定指令的元素 19 | const target = binding.arg ? document.getElementById(binding.arg) : window 20 | if (binding.value) { 21 | target.addEventListener('scroll', (e) => { 22 | if (e.srcElement.scrollTop > binding.value) { 23 | el.style.visibility = 'unset' 24 | } else { 25 | el.style.visibility = 'hidden' 26 | } 27 | }) 28 | } 29 | // 判断初始化状态 30 | if (target.scrollTop < binding.value) { 31 | el.style.visibility = 'hidden' 32 | } 33 | }, 34 | unbind(el) { 35 | const target = binding.arg ? document.getElementById(binding.arg) : window 36 | target.removeEventListener('scroll') 37 | el.removeEventListener('click') 38 | }, 39 | } 40 | 41 | export default backtop 42 | -------------------------------------------------------------------------------- /src/dgiot/directives/package/badge.js: -------------------------------------------------------------------------------- 1 | const SUCCESS = '#72c140' 2 | const ERROR = '#ed5b56' 3 | const WARNING = '#f0af41' 4 | const INFO = '#4091f7' 5 | const HEIGHT = 20 6 | let flag = false 7 | /** 8 | * 9 | * @type {{update(*, *, *): void}} 10 | * @url https://juejin.cn/post/6963840401899782175#heading-7 11 | */ 12 | const badge = { 13 | update(el, binding, vnode) { 14 | const { modifiers, value } = binding 15 | const modifiersKey = Object.keys(modifiers) 16 | let isDot = modifiersKey.includes('dot') 17 | let backgroundColor = '' 18 | if (modifiersKey.includes('success')) { 19 | backgroundColor = SUCCESS 20 | } else if (modifiersKey.includes('warning')) { 21 | backgroundColor = WARNING 22 | } else if (modifiersKey.includes('info')) { 23 | backgroundColor = INFO 24 | } else { 25 | backgroundColor = ERROR 26 | } 27 | 28 | const targetTemplate = isDot 29 | ? `
` 30 | : `
${value}
` 37 | 38 | el.style.position = el.style.position || 'relative' 39 | const badge = Vue.extend({ 40 | template: targetTemplate, 41 | }) 42 | const component = new badge().$mount().$el 43 | if (flag) { 44 | el.removeChild(el.lastChild) 45 | } 46 | el.appendChild(component) 47 | flag = true 48 | }, 49 | } 50 | export default badge 51 | -------------------------------------------------------------------------------- /src/dgiot/directives/package/clickOut.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * @type {{bind(*, {value?: *}): void, unbind(*): void}} 4 | * @url https://juejin.cn/post/6953879183600648229#heading-3 5 | */ 6 | const clickOut = { 7 | bind(el, { value }) { 8 | function clickHandler(e) { 9 | //先判断点击的元素是否是本身,如果是本身,则返回 10 | if (el.contains(e.target)) return 11 | //判断指令中是否绑定了函数 12 | if (typeof value === 'function') { 13 | //如果绑定了函数,则调用函数,此处value就是clickImgOut方法 14 | value() 15 | } 16 | } 17 | 18 | // 给当前元素绑定个私有变量,方便在unbind中可以解除事件监听 19 | el.handler = clickHandler 20 | //添加事件监听 21 | setTimeout(() => { 22 | document.addEventListener('click', el.handler) 23 | }, 0) 24 | }, 25 | unbind(el) { 26 | //解除事件监听 27 | document.removeEventListener('click', el.handler) 28 | }, 29 | } 30 | 31 | export default clickOut 32 | -------------------------------------------------------------------------------- /src/dgiot/directives/package/copy.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * @type {{bind(*, *): void}} 4 | * @url https://juejin.cn/post/6963840401899782175#heading-1 5 | */ 6 | const copy = { 7 | bind(el, binding) { 8 | // 双击触发复制 9 | if (binding.modifiers.dblclick) { 10 | el.addEventListener('dblclick', () => handleClick(el.innerText)) 11 | el.style.cursor = 'copy' 12 | } 13 | // 点击icon触发复制 14 | else if (binding.modifiers.icon) { 15 | if (el.hasIcon) return 16 | const iconElement = document.createElement('i') 17 | iconElement.setAttribute('class', 'el-icon-document-copy') 18 | iconElement.setAttribute('style', 'margin-left:5px') 19 | el.appendChild(iconElement) 20 | el.hasIcon = true 21 | iconElement.addEventListener('click', () => handleClick(el.innerText)) 22 | iconElement.style.cursor = 'copy' 23 | } 24 | // 单击触发复制 25 | else { 26 | el.addEventListener('click', () => handleClick(el.innerText)) 27 | el.style.cursor = 'copy' 28 | } 29 | }, 30 | } 31 | 32 | /** 33 | * 34 | * @param text 35 | */ 36 | function handleClick(text) { 37 | // 创建元素 38 | if (!document.getElementById('copyTarget')) { 39 | const copyTarget = document.createElement('input') 40 | copyTarget.setAttribute( 41 | 'style', 42 | 'position:fixed;top:0;left:0;opacity:0;z-index:-1000;' 43 | ) 44 | copyTarget.setAttribute('id', 'copyTarget') 45 | document.body.appendChild(copyTarget) 46 | } 47 | 48 | // 复制内容 49 | const input = document.getElementById('copyTarget') 50 | input.value = text 51 | input.select() 52 | document.execCommand('copy') 53 | alert('复制成功') 54 | } 55 | 56 | export default copy 57 | -------------------------------------------------------------------------------- /src/dgiot/directives/package/debounce.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * @type {{inserted: debounce.inserted}} 4 | * @url https://juejin.cn/post/6906028995133833230#heading-2 5 | * @date 2021-8-26 17:25:38 6 | * @description Vue function anti-shake request command 7 | */ 8 | const debounce = { 9 | inserted: function (el, binding) { 10 | let timer 11 | el.addEventListener('click', () => { 12 | if (timer) { 13 | clearTimeout(timer) 14 | } 15 | timer = setTimeout(() => { 16 | binding.value() 17 | }, 1000) 18 | }) 19 | }, 20 | } 21 | 22 | export default debounce 23 | -------------------------------------------------------------------------------- /src/dgiot/directives/package/draggable.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * @type {{inserted: draggable.inserted}} 4 | * @url https://juejin.cn/post/6906028995133833230#heading-7 5 | */ 6 | const draggable = { 7 | inserted: function (el) { 8 | el.style.cursor = 'move' 9 | el.onmousedown = function (e) { 10 | let disx = e.pageX - el.offsetLeft 11 | let disy = e.pageY - el.offsetTop 12 | document.onmousemove = function (e) { 13 | let x = e.pageX - disx 14 | let y = e.pageY - disy 15 | let maxX = 16 | document.body.clientWidth - 17 | parseInt(window.getComputedStyle(el).width) 18 | let maxY = 19 | document.body.clientHeight - 20 | parseInt(window.getComputedStyle(el).height) 21 | if (x < 0) { 22 | x = 0 23 | } else if (x > maxX) { 24 | x = maxX 25 | } 26 | 27 | if (y < 0) { 28 | y = 0 29 | } else if (y > maxY) { 30 | y = maxY 31 | } 32 | 33 | el.style.left = x + 'px' 34 | el.style.top = y + 'px' 35 | } 36 | document.onmouseup = function () { 37 | document.onmousemove = document.onmouseup = null 38 | } 39 | } 40 | }, 41 | } 42 | export default draggable 43 | -------------------------------------------------------------------------------- /src/dgiot/directives/package/drawerDrag.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * @type {{bind(*, *, *, *): void}} 4 | */ 5 | const drawerDrag = { 6 | bind(el, binding, vnode, oldVnode) { 7 | const minWidth = 400 8 | const dragDom = el.querySelector('.el-drawer') 9 | dragDom.style.overflow = 'auto' 10 | 11 | const resizeElL = document.createElement('div') 12 | const img = new Image(24, 38) 13 | img.src = require('../../../../public/assets/images/platform/assets/login_images/stretch.png') 14 | dragDom.appendChild(img) 15 | dragDom.appendChild(resizeElL) 16 | resizeElL.style.cursor = 'w-resize' 17 | resizeElL.style.position = 'absolute' 18 | resizeElL.style.height = '100%' 19 | resizeElL.style.width = '10px' 20 | resizeElL.style.left = '0px' 21 | resizeElL.style.top = '0px' 22 | img.style.position = 'absolute' 23 | img.style.left = '-12px' 24 | img.style.top = '50%' 25 | 26 | resizeElL.onmousedown = (e) => { 27 | const elW = dragDom.clientWidth 28 | const EloffsetLeft = dragDom.offsetLeft 29 | const clientX = e.clientX 30 | document.onmousemove = function (e) { 31 | e.preventDefault() 32 | // 左侧鼠标拖拽位置 33 | if (clientX > EloffsetLeft && clientX < EloffsetLeft + 10) { 34 | // 往左拖拽 35 | if (clientX > e.clientX) { 36 | dragDom.style.width = elW + (clientX - e.clientX) + 'px' 37 | } 38 | // 往右拖拽 39 | if (clientX < e.clientX) { 40 | if (dragDom.clientWidth >= minWidth) { 41 | dragDom.style.width = elW - (e.clientX - clientX) + 'px' 42 | } 43 | } 44 | } 45 | } 46 | // 拉伸结束 47 | document.onmouseup = function (e) { 48 | document.onmousemove = null 49 | document.onmouseup = null 50 | } 51 | } 52 | }, 53 | } 54 | export default drawerDrag 55 | -------------------------------------------------------------------------------- /src/dgiot/directives/package/ellipsis.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * @type {{bind(*, *): void}} 4 | * @url https://juejin.cn/post/6963840401899782175#heading-4 5 | */ 6 | const ellipsis = { 7 | bind(el, binding) { 8 | el.style.width = `${binding.arg || 100}px` 9 | el.style.whiteSpace = 'nowrap' 10 | el.style.overflow = 'hidden' 11 | el.style.textOverflow = 'ellipsis' 12 | }, 13 | } 14 | 15 | export default ellipsis 16 | -------------------------------------------------------------------------------- /src/dgiot/directives/package/emoji.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * @param parent 4 | * @param type 5 | * @return {*} 6 | */ 7 | let findEle = (parent, type) => { 8 | return parent.tagName.toLowerCase() === type 9 | ? parent 10 | : parent.querySelector(type) 11 | } 12 | /** 13 | * 14 | * @param el 15 | * @param type 16 | */ 17 | const trigger = (el, type) => { 18 | const e = document.createEvent('HTMLEvents') 19 | e.initEvent(type, true, true) 20 | el.dispatchEvent(e) 21 | } 22 | 23 | /** 24 | * 25 | * @type {{bind: emoji.bind, unbind: emoji.unbind}} 26 | * @url https://juejin.cn/post/6906028995133833230#heading-3 27 | */ 28 | const emoji = { 29 | bind: function (el, binding, vnode) { 30 | // 正则规则可根据需求自定义 31 | var regRule = 32 | /[^\u4E00-\u9FA5|\d|\a-zA-Z|\r\n\s,.?!,。?!…—&$=()-+/*{}[\]]|\s/g 33 | let $inp = findEle(el, 'input') 34 | el.$inp = $inp 35 | $inp.handle = function () { 36 | let val = $inp.value 37 | $inp.value = val.replace(regRule, '') 38 | 39 | trigger($inp, 'input') 40 | } 41 | $inp.addEventListener('keyup', $inp.handle) 42 | }, 43 | unbind: function (el) { 44 | el.$inp.removeEventListener('keyup', el.$inp.handle) 45 | }, 46 | } 47 | 48 | export default emoji 49 | -------------------------------------------------------------------------------- /src/dgiot/directives/package/empty.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * @type {{update(*, *, *): void}} 4 | * @url https://juejin.cn/post/6963840401899782175#heading-6 5 | */ 6 | const empty = { 7 | update(el, binding, vnode) { 8 | el.style.position = el.style.position || 'relative' 9 | const { offsetHeight, offsetWidth } = el 10 | const { visible, content, img } = binding.value 11 | const image = img ? `` : '' 12 | const defaultStyle = 13 | 'position:absolute;top:0;left:0;z-index:9999;background:#fff;display:flex;justify-content: center;align-items: center;' 14 | const empty = Vue.extend({ 15 | template: `
16 |
17 |
${image}
18 |
${content || '暂无数据'}
19 |
20 |
`, 21 | }) 22 | const component = new empty().$mount().$el 23 | if (visible) { 24 | el.appendChild(component) 25 | } else { 26 | el.removeChild(el.lastChild) 27 | } 28 | }, 29 | } 30 | 31 | export default empty 32 | -------------------------------------------------------------------------------- /src/dgiot/directives/package/expandClick.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * @type {{bind(*, *): void}} 4 | * @url https://juejin.cn/post/6963840401899782175#heading-0 5 | */ 6 | const expandClick = { 7 | bind(el, binding) { 8 | const s = document.styleSheets[document.styleSheets.length - 1] 9 | const DEFAULT = -10 // 默认向外扩展10px 10 | const [top, right, bottom, left] = 11 | (binding.expression && binding.expression.split(',')) || [] 12 | const ruleStr = `content:"";position:absolute;top:-${ 13 | top || DEFAULT 14 | }px;bottom:-${bottom || DEFAULT}px;right:-${right || DEFAULT}px;left:-${ 15 | left || DEFAULT 16 | }px;` 17 | const classNameList = el.className.split(' ') 18 | el.className = classNameList.includes('expand_click_range') 19 | ? classNameList.join(' ') 20 | : [...classNameList, 'expand_click_range'].join(' ') 21 | el.style.position = el.style.position || 'relative' 22 | if (s.insertRule) { 23 | s.insertRule( 24 | '.expand_click_range::before' + '{' + ruleStr + '}', 25 | s.cssRules.length 26 | ) 27 | } else { 28 | /* IE */ 29 | s.addRule('.expand_click_range::before', ruleStr, -1) 30 | } 31 | }, 32 | } 33 | 34 | export default expandClick 35 | -------------------------------------------------------------------------------- /src/dgiot/directives/package/focus.js: -------------------------------------------------------------------------------- 1 | const focus = { 2 | inserted: function (el) { 3 | el.querySelector('input').focus() 4 | }, 5 | } 6 | export default focus 7 | -------------------------------------------------------------------------------- /src/dgiot/directives/package/format.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * @type {{update(*, *, *): void}} 4 | * @url https://juejin.cn/post/6963840401899782175#heading-10 5 | */ 6 | const format = { 7 | update(el, binding, vnode) { 8 | const { value, modifiers } = binding 9 | if (!value) return 10 | let formatValue = value 11 | if (modifiers.toFixed) { 12 | formatValue = value.toFixed(2) 13 | } 14 | dgiotlog.log(formatValue) 15 | if (modifiers.price) { 16 | formatValue = formatNumber(formatValue) 17 | } 18 | el.innerText = formatValue 19 | }, 20 | } 21 | 22 | /** 23 | * 24 | * @param num 25 | * @return {*} 26 | */ 27 | function formatNumber(num) { 28 | num += '' 29 | let strs = num.split('.') 30 | let x1 = strs[0] 31 | let x2 = strs.length > 1 ? '.' + strs[1] : '' 32 | var rgx = /(\d+)(\d{3})/ 33 | while (rgx.test(x1)) { 34 | x1 = x1.replace(rgx, '$1' + ',' + '$2') 35 | } 36 | return x1 + x2 37 | } 38 | 39 | export default format 40 | -------------------------------------------------------------------------------- /src/dgiot/directives/package/longpress.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * @type {{bind: longpress.bind, unbind(*): void, componentUpdated(*, {value: *}): void}} 4 | * @url https://juejin.cn/post/6906028995133833230#heading-1 5 | */ 6 | const longpress = { 7 | bind: function (el, binding, vNode) { 8 | if (typeof binding.value !== 'function') { 9 | throw 'callback must be a function' 10 | } 11 | // 定义变量 12 | let pressTimer = null 13 | // 创建计时器( 2秒后执行函数 ) 14 | let start = (e) => { 15 | if (e.type === 'click' && e.button !== 0) { 16 | return 17 | } 18 | if (pressTimer === null) { 19 | pressTimer = setTimeout(() => { 20 | handler() 21 | }, 2000) 22 | } 23 | } 24 | // 取消计时器 25 | let cancel = (e) => { 26 | if (pressTimer !== null) { 27 | clearTimeout(pressTimer) 28 | pressTimer = null 29 | } 30 | } 31 | // 运行函数 32 | const handler = (e) => { 33 | binding.value(e) 34 | } 35 | // 添加事件监听器 36 | el.addEventListener('mousedown', start) 37 | el.addEventListener('touchstart', start) 38 | // 取消计时器 39 | el.addEventListener('click', cancel) 40 | el.addEventListener('mouseout', cancel) 41 | el.addEventListener('touchend', cancel) 42 | el.addEventListener('touchcancel', cancel) 43 | }, 44 | // 当传进来的值更新的时候触发 45 | componentUpdated(el, { value }) { 46 | el.$value = value 47 | }, 48 | // 指令与元素解绑的时候,移除事件绑定 49 | unbind(el) { 50 | el.removeEventListener('click', el.handler) 51 | }, 52 | } 53 | 54 | export default longpress 55 | -------------------------------------------------------------------------------- /src/dgiot/directives/package/permission.js: -------------------------------------------------------------------------------- 1 | import store from '@/store' 2 | // dgiotlog.log('glolab store', store) 3 | /** 4 | * 5 | * @type {{inserted(*=, *, *): void}} 6 | */ 7 | const permission = { 8 | inserted(el, binding, vnode) { 9 | const { value } = binding 10 | const roles = store.getters && store.getters.roles 11 | 12 | if (value && value instanceof Array && value.length > 0) { 13 | const permissionRoles = value 14 | 15 | const hasPermission = roles.some((role) => { 16 | return permissionRoles.includes(role) 17 | }) 18 | 19 | if (!hasPermission) { 20 | el.parentNode && el.parentNode.removeChild(el) 21 | } 22 | } else { 23 | throw new Error(`need roles! Like v-permission="['admin','editor']"`) 24 | } 25 | }, 26 | } 27 | export default permission 28 | -------------------------------------------------------------------------------- /src/dgiot/directives/package/resize.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * @type {{bind(*=, *): void, unbind(*): void}} 4 | * @url https://juejin.cn/post/6963840401899782175#heading-9 5 | */ 6 | const resize = { 7 | bind(el, binding) { 8 | let width = '', 9 | height = '' 10 | 11 | function isReize() { 12 | const style = document.defaultView.getComputedStyle(el) 13 | if (width !== style.width || height !== style.height) { 14 | binding.value() // 执行传入的方法 15 | } 16 | width = style.width 17 | height = style.height 18 | } 19 | 20 | el.__timer__ = setInterval(isReize, 300) // 周期性监听元素是否改变 21 | }, 22 | unbind(el) { 23 | clearInterval(el.__timer__) 24 | }, 25 | } 26 | 27 | export default resize 28 | -------------------------------------------------------------------------------- /src/dgiot/directives/package/scrollPop.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * @type {{bind(*): void, unbind(*, {value?: *}): void}} 4 | * @url https://juejin.cn/post/6953879183600648229#heading-4 5 | */ 6 | const scrollPop = { 7 | bind(el) { 8 | //定义此时到元素的内容垂直滚动的距离 9 | el.st = 10 | window.pageYOffset || 11 | document.documentElement.scrollTop || 12 | document.body.scrollTop 13 | let cssStr = `overflow: hidden;width: 100%; height: 100%; position: fixed; top: ${-el.st}px;` 14 | document.querySelector('html').cssText = cssStr 15 | document.body.style.cssText = cssStr 16 | }, 17 | unbind(el, { value }) { 18 | let cssStr = 19 | 'overflow: auto; height: 100%; position: relative; top: 0px;scroll-behavior: auto' 20 | document.querySelector('html').cssText = cssStr 21 | document.body.style.cssText = cssStr 22 | document.querySelector('html').style.scrollBehavior = 'auto' 23 | //手动设置滚动距离 24 | document.documentElement.scrollTop = el.st 25 | document.body.scrollTop = el.st 26 | if (value !== 'smooth') return 27 | //如果传了滚动方式为smooth平稳滚动即有感滚动,当滚动完毕后,把auto改回smooth 28 | let timer = setTimeout(() => { 29 | cssStr = `overflow: auto; height: 100%; position: relative; top: 0px; scroll-behavior: ${ 30 | value || 'smooth' 31 | }` 32 | document.querySelector('html').cssText = cssStr 33 | document.querySelector('html').style.scrollBehavior = value || 'smooth' 34 | document.body.style.cssText = cssStr 35 | }, 1) 36 | }, 37 | } 38 | 39 | export default scrollPop 40 | -------------------------------------------------------------------------------- /src/dgiot/directives/package/svgDrag.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * @type {{bind(*, *, *): void}} 4 | */ 5 | var left, 6 | top, 7 | disX, 8 | disY, 9 | isDraggable = false 10 | const svgDrag = { 11 | bind: function (el, bind) { 12 | el.$value = bind.value 13 | el.onmousedown = (e) => { 14 | // dgiotlog.log(el, bind) 15 | isDraggable = false 16 | //算出鼠标相对元素的位置 17 | disX = e.clientX - el.offsetLeft 18 | disY = e.clientY - el.offsetTop 19 | // 给点击的元素添加拖动属性 20 | // https://www.w3school.com.cn/html5/att_global_draggable.asp 21 | el.setAttribute('draggable', true) 22 | el.onmousemove = (e) => { 23 | isDraggable = true 24 | //用鼠标的位置减去鼠标相对元素的位置,得到元素的位置 25 | left = e.clientX - disX 26 | top = e.clientY - disY 27 | 28 | //绑定元素位置到positionX和positionY上面 29 | // this.positionX = top 30 | // this.positionY = left 31 | //移动当前元素 32 | el.style.left = left + 'px' 33 | el.style.top = top + 'px' 34 | } 35 | el.onmouseleave = (e) => { 36 | if (isDraggable) el.$value.callback(e) 37 | isDraggable = false 38 | } 39 | el.onmouseup = (e) => { 40 | isDraggable = false 41 | document.onmouseleave = null 42 | document.onmousemove = null 43 | document.onmouseup = null 44 | } 45 | } 46 | }, 47 | // 当传进来的值更新的时候触发 48 | componentUpdated: function (el, binding) { 49 | isDraggable = false 50 | el.$value = binding.value 51 | }, 52 | // 指令与元素解绑的时候,移除事件绑定 53 | unbind(el) { 54 | isDraggable = false 55 | document.onmouseleave = null 56 | document.onmousemove = null 57 | document.onmouseup = null 58 | }, 59 | } 60 | export default svgDrag 61 | -------------------------------------------------------------------------------- /src/dgiot/directives/package/throttle.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * @type {{bind: throttle.bind, unbind: throttle.unbind}} 4 | * @url https://juejin.cn/post/6953879183600648229#heading-2 5 | */ 6 | const throttle = { 7 | bind: function (el, { value: { fn, time } }) { 8 | if (typeof fn !== 'function') return 9 | el._flag = true //开关默认为开 10 | el._timer = null 11 | el.handler = function () { 12 | if (!el._flag) return 13 | //执行之后开关关闭 14 | el._flag && fn() 15 | el._flag = false 16 | if (el._timer !== null) { 17 | clearTimeout(el._timer) 18 | el._timer = null 19 | } 20 | el._timer = setTimeout(() => { 21 | el._flag = true //三秒后开关开启 22 | }, time) 23 | } 24 | el.addEventListener('click', el.handler) 25 | }, 26 | unbind: function (el, binding) { 27 | el.removeEventListener('click', el.handler) 28 | }, 29 | } 30 | 31 | export default throttle 32 | -------------------------------------------------------------------------------- /src/dgiot/directives/package/tooltip.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * @type {{bind(*, *): void}} 4 | * @url https://juejin.cn/post/6963840401899782175#heading-3 5 | */ 6 | const tooltip = { 7 | bind(el, binding) { 8 | if (el.hasIcon) return 9 | const iconElement = structureIcon(binding.arg, binding.value) 10 | el.appendChild(iconElement) 11 | el.hasIcon = true 12 | }, 13 | } 14 | 15 | /** 16 | * 17 | * @param content 18 | * @param attrs 19 | * @return {Element} 20 | */ 21 | function structureIcon(content, attrs) { 22 | // 拼接绑定属性 23 | let attrStr = '' 24 | for (let key in attrs) { 25 | attrStr += `${key}=${attrs[key]} ` 26 | } 27 | const a = `` 28 | // 创建构造器 29 | const tooltip = Vue.extend({ 30 | template: a, 31 | }) 32 | // 创建一个 tooltip 实例并返回 dom 节点 33 | const component = new tooltip().$mount() 34 | return component.$el 35 | } 36 | 37 | export default tooltip 38 | -------------------------------------------------------------------------------- /src/dgiot/directives/package/waterMarker.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * @param str 4 | * @param parentNode 5 | * @param font 6 | * @param textColor 7 | */ 8 | function addWaterMarker(str, parentNode, font, textColor) { 9 | // 水印文字,父元素,字体,文字颜色 10 | var can = document.createElement('canvas') 11 | parentNode.appendChild(can) 12 | can.width = 200 13 | can.height = 150 14 | can.style.display = 'none' 15 | var cans = can.getContext('2d') 16 | cans.rotate((-20 * Math.PI) / 180) 17 | cans.font = font || '16px Microsoft JhengHei' 18 | cans.fillStyle = textColor || 'rgba(180, 180, 180, 0.3)' 19 | cans.textAlign = 'left' 20 | cans.textBaseline = 'Middle' 21 | cans.fillText(str, can.width / 10, can.height / 2) 22 | parentNode.style.backgroundImage = 'url(' + can.toDataURL('image/png') + ')' 23 | } 24 | 25 | /** 26 | * 27 | * @type {{bind: waterMarker.bind}} 28 | * @url https://juejin.cn/post/6963840401899782175#heading-1 29 | */ 30 | const waterMarker = { 31 | bind: function (el, binding) { 32 | addWaterMarker( 33 | binding.value.text, 34 | el, 35 | binding.value.font, 36 | binding.value.textColor 37 | ) 38 | }, 39 | } 40 | 41 | export default waterMarker 42 | -------------------------------------------------------------------------------- /src/dgiot/filters/index.js: -------------------------------------------------------------------------------- 1 | const modulesFiles = require.context('./package', true, /.js$/) 2 | const modules = modulesFiles.keys().reduce((modules, modulePath) => { 3 | const moduleName = modulePath.replace(/^.\/(.*)\.js/, '$1') 4 | const value = modulesFiles(modulePath) 5 | modules[moduleName] = value.default 6 | return modules 7 | }, {}) 8 | const filters = { 9 | ...modules, 10 | } 11 | export default { 12 | install(Vue) { 13 | Object.keys(filters).forEach((key) => { 14 | Vue.filter(key, filters[key]) 15 | }) 16 | }, 17 | } 18 | -------------------------------------------------------------------------------- /src/dgiot/filters/package/dateUnix.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 时间格式化过滤器 3 | * @param date 4 | * @param format 5 | * @returns {string} 6 | */ 7 | function dateUnix(date, format) { 8 | if (!date) { 9 | return '' 10 | } 11 | if (!format) { 12 | format = 'YYYY-MM-DD HH:mm:ss' 13 | } 14 | return moment.unix(date).format(format) 15 | } 16 | 17 | export default dateUnix 18 | -------------------------------------------------------------------------------- /src/dgiot/filters/package/statusFilter.js: -------------------------------------------------------------------------------- 1 | export default function statusFilter(status) { 2 | const statusMap = { 3 | published: 'success', 4 | draft: 'gray', 5 | deleted: 'danger', 6 | } 7 | return statusMap[status] 8 | } 9 | -------------------------------------------------------------------------------- /src/dgiot/index.js: -------------------------------------------------------------------------------- 1 | import DgiotIcon from '@dgiot/dgiot-icons' 2 | import '@dgiot/dgiot-icons/lib/dgiot-icons.css' 3 | import '@dgiot/dgiot-component' 4 | import utilwen from '@/utils/utilwen' 5 | import Directives from './directives/index.js' 6 | import dgiotFilters from '@/dgiot/filters' 7 | import VueContextMenu from 'vue-contextmenu' 8 | Vue.component('DgiotIcon', DgiotIcon) 9 | Vue.use(dgiotFilters) 10 | Vue.use(Directives) 11 | Vue.use(utilwen) 12 | Vue.use(VueContextMenu) 13 | Vue.use(Vuetify) 14 | // 加载主题 15 | const requireTheme = require.context('./styles/themes', false, /\.scss$/) 16 | requireTheme.keys().forEach((fileName) => { 17 | requireTheme(fileName) 18 | }) 19 | 20 | // 加载全局样式样式(务必在加载主题后加载全局样式) 21 | require('./styles/dgiot.scss') 22 | 23 | // 加载插件 24 | const requirePlugin = require.context('./plugins', true, /\.js$/) 25 | requirePlugin.keys().forEach((fileName) => { 26 | requirePlugin(fileName) 27 | }) 28 | 29 | // 加载布局 30 | const requireLayout = require.context('./layouts', true, /\.vue$/) 31 | requireLayout.keys().forEach((fileName) => { 32 | const componentConfig = requireLayout(fileName) 33 | const componentName = componentConfig.default.name 34 | Vue.component(componentName, componentConfig.default || componentConfig) 35 | }) 36 | 37 | let components = [] 38 | // 加载组件 39 | const requireComponent = require.context('./components', true, /\.vue$/) 40 | requireComponent.keys().forEach((fileName) => { 41 | const componentConfig = requireComponent(fileName) 42 | const componentName = componentConfig.default.name 43 | if (componentName) { 44 | Vue.component(componentName, componentConfig.default || componentConfig) 45 | components.push({ 46 | name: componentName, 47 | config: componentConfig.default, 48 | }) 49 | } 50 | }) 51 | -------------------------------------------------------------------------------- /src/dgiot/layouts/DgiotEmptyLayout/index.vue: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 11 | -------------------------------------------------------------------------------- /src/dgiot/layouts/DgiotLayoutComprehensive/index.vue: -------------------------------------------------------------------------------- 1 | 30 | 31 | 62 | 63 | 72 | -------------------------------------------------------------------------------- /src/dgiot/plugins/FRender.js: -------------------------------------------------------------------------------- 1 | // vue-ele-form 的注册可参考:https://www.yuque.com/chaojie-vjiel/vbwzgu/xl46cd 2 | // import EleForm from 'vue-ele-form' 3 | // import FRender from 'f-render' 4 | // import 'element-ui/lib/theme-chalk/index.css' 5 | 6 | // Vue.use(ElementUI) 7 | // Vue.use(EleForm) 8 | // Vue.component('FRender', FRender) 9 | -------------------------------------------------------------------------------- /src/dgiot/plugins/amis.js: -------------------------------------------------------------------------------- 1 | // https://baidu.gitee.io/amis/zh-CN/docs/start/getting-started#webpack-%E9%85%8D%E7%BD%AE%E5%8F%82%E8%80%83 2 | // import 'amis/lib/themes/cxd.css' 3 | // import 'amis/lib/helper.css' 4 | // import 'amis/sdk/iconfont.css' 5 | // import 'amis/lib/themes/antd.css' 6 | // import 'amis/sdk/sdk.js' 7 | import 'amis/lib/themes/antd.css' 8 | import 'amis-editor/dist/style.css' 9 | import 'amis/sdk/iconfont.css' 10 | import 'amis/lib/helper.css' 11 | import 'amis/lib/themes/antd.js' 12 | import 'amis/sdk/iconfont.css' 13 | // import 'amis/sdk/sdk.css' 14 | import * as Qs from 'qs' 15 | import infiniteScroll from 'vue-infinite-scroll' 16 | Vue.use(infiniteScroll) 17 | window.qs = Qs 18 | -------------------------------------------------------------------------------- /src/dgiot/plugins/driver.js: -------------------------------------------------------------------------------- 1 | import Driver from 'driver.js' 2 | import 'driver.js/dist/driver.min.css' 3 | Vue.prototype.$Driver = Driver 4 | -------------------------------------------------------------------------------- /src/dgiot/plugins/element.js: -------------------------------------------------------------------------------- 1 | import ElementUI from 'element-ui' 2 | import '@/dgiot/styles/variables/element-variables.scss' 3 | import 'element-ui/lib/theme-chalk/display.css' 4 | import i18n from '@/i18n' 5 | import 'element-ui/lib/theme-chalk/base.css' 6 | import CollapseTransition from 'element-ui/lib/transitions/collapse-transition' 7 | Vue.component(CollapseTransition.name, CollapseTransition) 8 | Vue.use(ElementUI, { 9 | size: 'small', 10 | i18n: (key, value) => i18n.t(key, value), 11 | }) 12 | -------------------------------------------------------------------------------- /src/dgiot/plugins/errorLog.js: -------------------------------------------------------------------------------- 1 | import store from '@/store' 2 | import { isArray, isString } from '@/utils/data/validate' 3 | import { errorLog } from '@/config' 4 | 5 | const needErrorLog = errorLog 6 | const checkNeed = () => { 7 | const env = process.env.NODE_ENV 8 | if (isString(needErrorLog)) { 9 | return env === needErrorLog 10 | } 11 | if (isArray(needErrorLog)) { 12 | return needErrorLog.includes(env) 13 | } 14 | return false 15 | } 16 | if (checkNeed()) { 17 | Vue.config.errorHandler = (err, vm, info) => { 18 | // eslint-disable-next-line no-console 19 | const url = window.location.href 20 | err?.message !== 21 | "TypeError: Cannot read properties of undefined (reading 'MapTopic')" 22 | ? Vue.nextTick(() => { 23 | store 24 | .dispatch('errorLog/addErrorLog', { 25 | err, 26 | vm, 27 | info, 28 | url, 29 | }) 30 | .then(() => {}) 31 | }) 32 | : console.warn('错误拦截:', err, vm, info) 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/dgiot/plugins/support.js: -------------------------------------------------------------------------------- 1 | import { MessageBox } from 'element-ui' 2 | import { title } from '@/config' 3 | 4 | if (!!window.ActiveXObject || 'ActiveXObject' in window) { 5 | MessageBox({ 6 | title: '温馨提示', 7 | message: 8 | '检测到您当前浏览器使用的是IE内核,自2015年3月起,微软已宣布弃用IE,且不再对IE提供任何更新维护,请点击此处访问微软官网更新浏览器,如果您使用的是双核浏览器,请您切换浏览器内核为极速模式', 9 | type: 'warning', 10 | showClose: true, 11 | showConfirmButton: false, 12 | closeOnClickModal: false, 13 | closeOnPressEscape: false, 14 | closeOnHashChange: false, 15 | dangerouslyUseHTMLString: true, 16 | }) 17 | } 18 | if (process.env.NODE_ENV !== 'development') { 19 | // eslint-disable-next-line no-console 20 | dgiotlog.log( 21 | ` %c ${title} %c 基于dgiot构建 `, 22 | 'color: #fadfa3; background: #030307; padding:5px 0;', 23 | 'background: #fadfa3; padding:5px 0;' 24 | ) 25 | } 26 | -------------------------------------------------------------------------------- /src/dgiot/plugins/vue-audio-visual.js: -------------------------------------------------------------------------------- 1 | import AudioVisual from 'vue-audio-visual' 2 | import BaiduMap from 'vue-baidu-map' 3 | Vue.use(AudioVisual) 4 | Vue.use(BaiduMap, { 5 | ak: Vue.prototype.$dgiot.secret.baidu.map, 6 | }) 7 | -------------------------------------------------------------------------------- /src/dgiot/styles/loading/inner-circles.css: -------------------------------------------------------------------------------- 1 | .inner-circles-loader:not(:required) { 2 | position: relative; 3 | display: inline-block; 4 | width: 50px; 5 | height: 50px; 6 | margin-bottom: 10px; 7 | overflow: hidden; 8 | text-indent: -9999px; 9 | background: rgba(25, 165, 152, 0.5); 10 | border-radius: 50%; 11 | transform: translate3d(0, 0, 0); 12 | } 13 | 14 | .inner-circles-loader:not(:required)::before, 15 | .inner-circles-loader:not(:required)::after { 16 | position: absolute; 17 | top: 0; 18 | display: inline-block; 19 | width: 50px; 20 | height: 50px; 21 | content: ''; 22 | border-radius: 50%; 23 | } 24 | 25 | .inner-circles-loader:not(:required)::before { 26 | left: 0; 27 | background: #c7efcf; 28 | transform-origin: 0 50%; 29 | animation: inner-circles-loader 3s infinite; 30 | } 31 | 32 | .inner-circles-loader:not(:required)::after { 33 | right: 0; 34 | background: #eef5db; 35 | transform-origin: 100% 50%; 36 | animation: inner-circles-loader 3s 0.2s reverse infinite; 37 | } 38 | 39 | @keyframes inner-circles-loader { 40 | 0% { 41 | transform: rotate(0deg); 42 | } 43 | 44 | 50% { 45 | transform: rotate(360deg); 46 | } 47 | 48 | 100% { 49 | transform: rotate(0deg); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/dgiot/styles/transition.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * @description vue过渡动画 3 | */ 4 | 5 | .fade-transform-leave-active, 6 | .fade-transform-enter-active { 7 | transition: $base-transition; 8 | } 9 | 10 | .fade-transform-enter { 11 | opacity: 0; 12 | } 13 | 14 | .fade-transform-leave-to { 15 | opacity: 0; 16 | } 17 | 18 | /** 19 | * @description 旋转动画 20 | */ 21 | @keyframes rotate { 22 | 0% { 23 | transform: rotate(0); 24 | } 25 | 100% { 26 | transform: rotate(360deg); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/dgiot/styles/variables/element-variables.scss: -------------------------------------------------------------------------------- 1 | /* 动画 */ 2 | $--all-transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1) !default; 3 | $--fade-transition: opacity 300ms cubic-bezier(0.23, 1, 0.32, 1) !default; 4 | $--fade-linear-transition: opacity 200ms linear !default; 5 | $--md-fade-transition: transform 300ms cubic-bezier(0.23, 1, 0.32, 1), 6 | opacity 300ms cubic-bezier(0.23, 1, 0.32, 1) !default; 7 | $--border-transition-base: border-color 0.2s 8 | cubic-bezier(0.645, 0.045, 0.355, 1) !default; 9 | $--color-transition-base: color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1) !default; 10 | 11 | /* 圆角 */ 12 | $--border-radius-base: $base-border-radius !default; 13 | 14 | $--button-small-border-radius: $--border-radius-base !default; 15 | $--border-radius-small: $--border-radius-base !default; 16 | $--msgbox-border-radius: $--border-radius-base !default; 17 | $--pagination-border-radius: $--border-radius-base !default; 18 | $--tag-border-radius: $--border-radius-base !default; 19 | $--card-border-radius: $--border-radius-base !default; 20 | $--slider-border-radius: $--border-radius-base !default; 21 | $--steps-border-radius: $--border-radius-base !default; 22 | 23 | /* 颜色 */ 24 | $--color-primary: $base-color-blue !default; 25 | $--color-success: $base-color-green !default; 26 | $--color-warning: $base-color-yellow !default; 27 | $--color-danger: $base-color-red !default; 28 | $--color-info: #909399 !default; 29 | 30 | $--font-path: '~element-ui/lib/theme-chalk/fonts'; 31 | @import '../../../../node_modules/element-ui/packages/theme-chalk/src/index'; 32 | -------------------------------------------------------------------------------- /src/directive/clipboard/index.js: -------------------------------------------------------------------------------- 1 | import Clipboard from './clipboard' 2 | 3 | const install = function (Vue) { 4 | Vue.directive('Clipboard', Clipboard) 5 | } 6 | 7 | if (window.Vue) { 8 | window.clipboard = Clipboard 9 | Vue.use(install) // eslint-disable-line 10 | } 11 | 12 | Clipboard.install = install 13 | export default Clipboard 14 | -------------------------------------------------------------------------------- /src/directive/el-dragDialog/index.js: -------------------------------------------------------------------------------- 1 | import drag from './drag' 2 | 3 | const install = function (Vue) { 4 | Vue.directive('el-drag-dialog', drag) 5 | } 6 | 7 | if (window.Vue) { 8 | window['el-drag-dialog'] = drag 9 | Vue.use(install) // eslint-disable-line 10 | } 11 | 12 | drag.install = install 13 | export default drag 14 | -------------------------------------------------------------------------------- /src/i18n/index.js: -------------------------------------------------------------------------------- 1 | import store from '@/store' 2 | import VueI18n from 'vue-i18n' 3 | import elEn from 'element-ui/lib/locale/lang/en' 4 | import elZh from 'element-ui/lib/locale/lang/zh-CN' 5 | import elJp from 'element-ui/lib/locale/lang/ja' 6 | import en from './en' 7 | import zh from './zh' 8 | import jp from './jp' 9 | Vue.use(VueI18n) 10 | 11 | const messages = { 12 | en: { 13 | ...en, 14 | ...elEn, 15 | }, 16 | zh: { 17 | ...zh, 18 | ...elZh, 19 | }, 20 | jp: { 21 | ...jp, 22 | ...elJp, 23 | }, 24 | } 25 | function getLanguage() { 26 | return store.getters['settings/language'] || 'zh' 27 | } 28 | 29 | const i18n = new VueI18n({ 30 | locale: getLanguage(), 31 | messages, 32 | }) 33 | 34 | export default i18n 35 | -------------------------------------------------------------------------------- /src/registerServiceWorker.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-console */ 2 | import { register } from 'register-service-worker' 3 | import { isPwa } from '@/config' 4 | 5 | if (process.env.NODE_ENV === 'production' && isPwa) { 6 | register(`${process.env.BASE_URL}service-worker.js`, { 7 | ready() { 8 | dgiotlog.log( 9 | 'App is being served from cache by a service worker.\n' + 10 | 'For more details, visit https://goo.gl/AFskqB' 11 | ) 12 | }, 13 | registered() { 14 | dgiotlog.log('Service worker has been registered.') 15 | }, 16 | cached() { 17 | dgiotlog.log('Content has been cached for offline use.') 18 | }, 19 | updatefound() { 20 | dgiotlog.log('New content is downloading.') 21 | Vue.prototype.$baseNotify( 22 | '检测到新版本,正在更新,请稍后...', 23 | '温馨提示', 24 | 'success', 25 | 'bottom-right', 26 | 8000 27 | ) 28 | }, 29 | updated() { 30 | dgiotlog.log('New content is available; please refresh.') 31 | Vue.prototype.$baseNotify( 32 | '更新版本完成,10秒后刷新本页面', 33 | '温馨提示', 34 | 'success', 35 | 'bottom-right', 36 | 8000 37 | ) 38 | setTimeout(() => { 39 | window.location.reload() 40 | }, 10000) 41 | }, 42 | offline() { 43 | dgiotlog.log( 44 | 'No internet connection found. App is running in offline mode.' 45 | ) 46 | }, 47 | error(error) { 48 | dgiotlog.warn('Error during service worker registration:', error) 49 | }, 50 | }) 51 | } 52 | -------------------------------------------------------------------------------- /src/store/modules/errorLog.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 异常捕获的状态拦截,请勿修改 3 | */ 4 | const state = () => ({ 5 | errorLogs: [], 6 | }) 7 | const getters = { 8 | errorLogs: (state) => state.errorLogs, 9 | } 10 | const mutations = { 11 | addErrorLog(state, errorLog) { 12 | state.errorLogs.push(errorLog) 13 | }, 14 | clearErrorLog: (state) => { 15 | state.errorLogs.splice(0) 16 | }, 17 | } 18 | const actions = { 19 | addErrorLog({ commit }, errorLog) { 20 | errorLog?.err?.message !== 21 | "Cannot read properties of undefined (reading 'MapTopic')" 22 | ? commit('addErrorLog', errorLog) 23 | : '' 24 | }, 25 | clearErrorLog({ commit }) { 26 | commit('clearErrorLog') 27 | }, 28 | } 29 | export default { 30 | state, 31 | getters, 32 | mutations, 33 | actions, 34 | } 35 | -------------------------------------------------------------------------------- /src/store/modules/product.js: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: h7ml 3 | * @Date: 2022-5-5 17:57:00 4 | * @LastEditTime: 2022-5-5 17:57:00 5 | * @LastEditors: h7ml 6 | * @FilePath: \dgiot-dashboard\src\store\modules\product.js 7 | * @Description: product vuex store 8 | */ 9 | import { getToken, setToken } from '@/utils/vue' 10 | 11 | const state = () => ({ 12 | protocol: getToken('protocol') || [], 13 | chartType: getToken('chartType') || [], 14 | }) 15 | const getters = { 16 | protocol: (state) => state.protocol, 17 | chartType: (state) => state.chartType, 18 | } 19 | const mutations = { 20 | setChartType(state, chart) { 21 | state.chartType = chart 22 | setToken('chartType', chart) 23 | }, 24 | setProtocol(state, protocol) { 25 | state.protocol = protocol 26 | setToken('protocol', protocol) 27 | }, 28 | } 29 | const actions = { 30 | setProtocol({ commit }, protocol) { 31 | commit('setProtocol', protocol) 32 | }, 33 | setChartType({ commit }, chart) { 34 | commit('setChartType', chart) 35 | }, 36 | } 37 | export default { 38 | state, 39 | getters, 40 | mutations, 41 | actions, 42 | } 43 | -------------------------------------------------------------------------------- /src/store/modules/view.js: -------------------------------------------------------------------------------- 1 | const state = () => ({ 2 | viewData: {}, 3 | }) 4 | const getters = { 5 | viewData: (state) => state.viewData, 6 | } 7 | const mutations = { 8 | setData(state, json) { 9 | state.viewData = json 10 | }, 11 | } 12 | const actions = { 13 | setData({ commit, json }) { 14 | commit('setData', json) 15 | }, 16 | } 17 | export default { 18 | state, 19 | getters, 20 | mutations, 21 | actions, 22 | } 23 | -------------------------------------------------------------------------------- /src/styles/element-ui.scss: -------------------------------------------------------------------------------- 1 | //to reset element-ui default css 2 | .el-upload { 3 | input[type='file'] { 4 | display: none !important; 5 | } 6 | } 7 | 8 | .el-upload__input { 9 | display: none; 10 | } 11 | 12 | //暂时性解决diolag 问题 https://github.com/ElemeFE/element/issues/2461 13 | .el-dialog { 14 | position: relative; 15 | left: 0; 16 | margin: 0 auto; 17 | transform: none; 18 | } 19 | 20 | //element ui upload 21 | .upload-container { 22 | .el-upload { 23 | width: 100%; 24 | 25 | .el-upload-dragger { 26 | width: 100%; 27 | height: 200px; 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/styles/index.scss: -------------------------------------------------------------------------------- 1 | @import './variables.scss'; 2 | @import './mixin.scss'; 3 | @import './transition.scss'; 4 | @import './element-ui.scss'; 5 | @import './sidebar.scss'; 6 | 7 | body { 8 | height: 100%; 9 | -moz-osx-font-smoothing: grayscale; 10 | -webkit-font-smoothing: antialiased; 11 | text-rendering: optimizeLegibility; 12 | font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, 13 | Microsoft YaHei, Arial, sans-serif; 14 | } 15 | 16 | label { 17 | font-weight: 700; 18 | } 19 | 20 | html { 21 | box-sizing: border-box; 22 | height: 100%; 23 | } 24 | 25 | #app { 26 | height: 100%; 27 | } 28 | 29 | *, 30 | *:before, 31 | *:after { 32 | box-sizing: inherit; 33 | } 34 | 35 | a, 36 | a:focus, 37 | a:hover { 38 | color: inherit; 39 | text-decoration: none; 40 | cursor: pointer; 41 | outline: none; 42 | } 43 | 44 | div:focus { 45 | outline: none; 46 | } 47 | 48 | a:focus, 49 | a:active { 50 | outline: none; 51 | } 52 | 53 | a, 54 | a:focus, 55 | a:hover { 56 | color: inherit; 57 | text-decoration: none; 58 | cursor: pointer; 59 | } 60 | 61 | .clearfix { 62 | &:after { 63 | display: block; 64 | height: 0; 65 | clear: both; 66 | font-size: 0; 67 | visibility: hidden; 68 | content: ' '; 69 | } 70 | } 71 | 72 | //main-container全局样式 73 | .app-main { 74 | min-height: 100%; 75 | } 76 | 77 | .app-container { 78 | padding: 20px; 79 | } 80 | 81 | .ta { 82 | text-align: center; 83 | } 84 | 85 | .tr { 86 | text-align: right; 87 | } 88 | 89 | .tr { 90 | text-align: left; 91 | } 92 | 93 | .block { 94 | display: block; 95 | } 96 | 97 | .ib { 98 | display: inline-block; 99 | } 100 | -------------------------------------------------------------------------------- /src/styles/mixin.scss: -------------------------------------------------------------------------------- 1 | @mixin clearfix { 2 | &:after { 3 | display: table; 4 | clear: both; 5 | content: ''; 6 | } 7 | } 8 | 9 | @mixin scrollBar { 10 | &::-webkit-scrollbar-track-piece { 11 | background: #d3dce6; 12 | } 13 | &::-webkit-scrollbar { 14 | width: 6px; 15 | } 16 | &::-webkit-scrollbar-thumb { 17 | background: #99a9bf; 18 | border-radius: 20px; 19 | } 20 | } 21 | 22 | @mixin relative { 23 | position: relative; 24 | width: 100%; 25 | height: 100%; 26 | } 27 | -------------------------------------------------------------------------------- /src/styles/test.scss: -------------------------------------------------------------------------------- 1 | $link_color: 'red'; 2 | $width: 100%; 3 | .test { 4 | width: $width; 5 | height: auto; 6 | padding: 20px; 7 | color: $link_color; 8 | //父类选择器 9 | &:hover { 10 | color: blue; 11 | } 12 | 13 | body.ie & { 14 | color: green; 15 | } 16 | 17 | a { 18 | color: yellow; 19 | } 20 | 21 | //群组选择器 22 | h1, 23 | h2, 24 | h3 { 25 | margin-bottom: 20px; 26 | } 27 | 28 | //子组合选择器和同层组合选择器:>、+和~; 29 | header + p { 30 | color: green; 31 | } 32 | 33 | article { 34 | ~ article { 35 | color: red; 36 | } 37 | 38 | > section { 39 | background: #eee; 40 | } 41 | 42 | nav + & { 43 | margin-top: 20px; 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/styles/transition.scss: -------------------------------------------------------------------------------- 1 | //globl transition css 2 | 3 | /*fade*/ 4 | .fade-enter-active, 5 | .fade-leave-active { 6 | transition: opacity 0.28s; 7 | } 8 | 9 | .fade-enter, 10 | .fade-leave-active { 11 | opacity: 0; 12 | } 13 | 14 | /*fade-transform*/ 15 | .fade-transform-leave-active, 16 | .fade-transform-enter-active { 17 | transition: all 0.5s; 18 | } 19 | 20 | .fade-transform-enter { 21 | opacity: 0; 22 | transform: translateX(-30px); 23 | } 24 | 25 | .fade-transform-leave-to { 26 | opacity: 0; 27 | transform: translateX(30px); 28 | } 29 | 30 | /*fade*/ 31 | .breadcrumb-enter-active, 32 | .breadcrumb-leave-active { 33 | transition: all 0.5s; 34 | } 35 | 36 | .breadcrumb-enter, 37 | .breadcrumb-leave-active { 38 | opacity: 0; 39 | transform: translateX(20px); 40 | } 41 | 42 | .breadcrumb-move { 43 | transition: all 0.5s; 44 | } 45 | 46 | .breadcrumb-leave-active { 47 | position: absolute; 48 | } 49 | -------------------------------------------------------------------------------- /src/styles/variables.scss: -------------------------------------------------------------------------------- 1 | //sidebar 2 | $menuBg: #304156; 3 | $subMenuBg: #1f2d3d; 4 | $menuHover: #001528; 5 | -------------------------------------------------------------------------------- /src/utils/config/globalConfig.js: -------------------------------------------------------------------------------- 1 | let localTopoUrl = 'http://192.168.2.58:8339' 2 | module.exports = { 3 | localTopoUrl: localTopoUrl, 4 | } 5 | -------------------------------------------------------------------------------- /src/utils/data/hasAccess.js: -------------------------------------------------------------------------------- 1 | import store from '@/store' 2 | import { isArray } from '@/utils/data/validate' 3 | 4 | export function hasAccess(value) { 5 | if (store.getters['acl/admin']) return true 6 | if (isArray(value) && value.length > 0) { 7 | return can(store.getters['acl/role'], { 8 | role: value, 9 | mode: 'oneOf', 10 | }) 11 | } 12 | const { role, ability, mode = 'oneOf' } = value 13 | let result = true 14 | if (role) { 15 | result = 16 | result && 17 | can(store.getters['acl/role'], { 18 | role, 19 | mode, 20 | }) 21 | } 22 | if (result && ability) { 23 | result = can(store.getters['acl/ability'], { 24 | role: ability, 25 | mode, 26 | }) 27 | } 28 | return result 29 | } 30 | 31 | export function can(roleOrAbility, value) { 32 | let hasRole = false 33 | const { role, mode } = value 34 | if (role && mode) { 35 | if (mode === 'allOf') { 36 | hasRole = role.every((item) => { 37 | return roleOrAbility.includes(item) 38 | }) 39 | } 40 | if (mode === 'oneOf') { 41 | hasRole = role.some((item) => { 42 | return roleOrAbility.includes(item) 43 | }) 44 | } 45 | if (mode === 'except') { 46 | hasRole = !role.some((item) => { 47 | return roleOrAbility.includes(item) 48 | }) 49 | } 50 | } 51 | return hasRole 52 | } 53 | -------------------------------------------------------------------------------- /src/utils/dgiotLog/console.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 重新console groupCollapsed 3 | * @param label 4 | * @param info 5 | */ 6 | function dgiotConsole(label, info) { 7 | console.groupCollapsed(`%c ${label.text}`, label.style ?? '') 8 | info.type 9 | ? console[info.type]( 10 | '%c%s', 11 | info.style ?? 'color: #409EFF;font-size: 24px;', 12 | info.message 13 | ) 14 | : console.log( 15 | '%c%s', 16 | info.style ?? 'color: #E6A23C;font-size: 24px;', 17 | info.message 18 | ) 19 | console.groupEnd() 20 | } 21 | export default dgiotConsole 22 | -------------------------------------------------------------------------------- /src/utils/file/export2zip.js: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: h7ml 3 | * @Date: 2021-03-11 12:41:30 4 | * @LastEditTime: 2021-03-11 17:55:38 5 | * @LastEditors: h7ml 6 | * @FilePath: \dgiot-dashboard\src\utils\export2zip.js 7 | * @Description: 8 | */ 9 | // require('script-loader!file-saver') 10 | // import JSZip from 'jszip' 11 | function export_txt_to_zip(jsonData, jsonName, zipName) { 12 | const zip = new JSZip() 13 | const txt_name = jsonName || 'file' 14 | const zip_name = zipName || 'file' 15 | zip.file(`${txt_name}.json`, jsonData) 16 | zip 17 | .generateAsync({ 18 | type: 'blob', 19 | }) 20 | .then( 21 | (blob) => { 22 | saveAs(blob, `${zip_name}.zip`) 23 | }, 24 | (err) => { 25 | dgiotlog.log(err) 26 | alert('导出失败') 27 | } 28 | ) 29 | } 30 | 31 | export { export_txt_to_zip } 32 | -------------------------------------------------------------------------------- /src/utils/file/file.js: -------------------------------------------------------------------------------- 1 | // import requirefile from '@/utils/file/requirefile' 2 | // const FileModule = requirefile(require.context('./File', true, /.js$/)) 3 | // dgiotlog.log(FileModule, 'FileModule') 4 | // module.exports = { 5 | // ...FileModule, 6 | // } 7 | 8 | const modulesFiles = require.context('../file', true, /.js$/) 9 | const modules = modulesFiles.keys().reduce((modules, modulePath) => { 10 | const moduleName = modulePath.replace(/^.\/(.*)\.js/, '$1') 11 | const value = modulesFiles(modulePath) 12 | modules[moduleName] = value.default 13 | return modules 14 | }, {}) 15 | module.exports = { 16 | ...modules, 17 | } 18 | -------------------------------------------------------------------------------- /src/utils/file/load.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | exports.__esModule = true 3 | exports.loadScript = void 0 4 | function loadScript(url) { 5 | // 如果是数组 6 | var promiseList = [] 7 | url.forEach(function (item) { 8 | var p = new Promise(function (resolve, reject) { 9 | var script = document.createElement('script') 10 | script.type = 'text/javascript' 11 | script.src = item 12 | script.onload = function () { 13 | script.onload = null 14 | script.onerror = null 15 | resolve() 16 | } 17 | script.onerror = function () { 18 | script.onload = null 19 | script.onerror = null 20 | reject() 21 | } 22 | var head = document.getElementsByTagName('head')[0] 23 | ;(head || document.body).appendChild(script) 24 | }) 25 | promiseList.push(p) 26 | }) 27 | return Promise.all(promiseList) 28 | } 29 | exports.loadScript = loadScript 30 | -------------------------------------------------------------------------------- /src/utils/file/requirefile.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description require context module 3 | */ 4 | function requirefile(modulesFiles, path, flag, type) { 5 | let modules = {} 6 | if (modulesFiles) { 7 | modules = modulesFiles.keys().reduce((modules, modulePath) => { 8 | const moduleName = modulePath.replace(/^.\/(.*)\.js/, '$1') 9 | const value = modulesFiles(modulePath) 10 | modules[moduleName] = value.default 11 | return modules 12 | }, {}) 13 | } 14 | return modules 15 | } 16 | 17 | export default requirefile 18 | -------------------------------------------------------------------------------- /src/utils/file/requiremodule.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * @param context 4 | * @param path 5 | * @param flag 6 | * @param type 7 | * @return {{}} 8 | * @description require context module 9 | */ 10 | function requiremodule(context, path, flag, type) { 11 | let components = {} 12 | if (context) { 13 | context.keys().forEach((fileName) => { 14 | let comp = context(fileName) 15 | components[fileName.replace(/^\.\/(.*)\.\w+$/, '$1')] = comp.default 16 | }) 17 | } 18 | return components 19 | } 20 | 21 | export default requiremodule 22 | -------------------------------------------------------------------------------- /src/utils/iframe/common.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dgiot/iotStudio/1f8f2c16f2c792f2b9b17847d2274d6ccc3315f8/src/utils/iframe/common.js -------------------------------------------------------------------------------- /src/utils/iframe/store.js: -------------------------------------------------------------------------------- 1 | // * @Author: dext7r 2 | // * @Date: 2021-12-27 14:55:30 3 | // * @LastEditors: dext7r 4 | // * @LastEditTime: 2021-12-27 14:55:30 5 | // * @Description: iframe存储 6 | // * @FilePath: src\utils\iframe\store.js 7 | -------------------------------------------------------------------------------- /src/utils/konva/Position.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * @param {*} oElement 4 | * @returns 5 | */ 6 | export default function Position(oElement) { 7 | var _x = 0 8 | var _y = 0 9 | var _width = oElement.offsetWidth 10 | var _height = oElement.offsetHeight 11 | var _Position = { 12 | offsetLeft: _width, 13 | offsetTop: _height, 14 | x: _x, 15 | y: _y, 16 | offsetParent: 'auto', 17 | } 18 | if (typeof oElement.offsetParent != 'undefined') { 19 | for (var posX = 0, posY = 0; oElement; oElement = oElement.offsetParent) { 20 | posX += oElement.offsetLeft 21 | posY += oElement.offsetTop 22 | } 23 | _x = posX + _width 24 | _y = posY + _height 25 | _Position = { 26 | offsetLeft: posX, 27 | offsetTop: posY, 28 | x: _x, 29 | y: _y, 30 | offsetParent: 'exist', 31 | } 32 | } else { 33 | _x = oElement.x + _width 34 | _y = oElement.y + _height 35 | _Position = { 36 | offsetLeft: posX, 37 | offsetTop: posY, 38 | x: x, 39 | y: y, 40 | offsetParent: 'undefined', 41 | } 42 | } 43 | return _Position 44 | } 45 | -------------------------------------------------------------------------------- /src/utils/konva/core/topoPath.js: -------------------------------------------------------------------------------- 1 | import Konva from 'konva' 2 | import { uuid } from '@/utils' 3 | import Vue from 'vue' 4 | import canvas from '@/utils/konva/core/canvas' 5 | 6 | /** 7 | * @description 组态物模型公共函数 8 | * @type {{create(*, *, *): Text, on(*)}} 9 | */ 10 | const topoPath = { 11 | emitBus(args) { 12 | const params = { 13 | busTopicKey: dgiotBus.topicKey('dgiot_evidence', 'dgiotEvidence'), 14 | msg: { 15 | type: 'bind_evidence', 16 | id: args.getAttr('id'), 17 | evidenceList: args.getAttr('evidenceList'), 18 | node: args, 19 | }, 20 | } 21 | Vue.prototype.$baseEventBus.$emit(params.busTopicKey, params.msg) 22 | }, 23 | on(args) { 24 | const params = { 25 | busTopicKey: dgiotBus.topicKey('dgiot_thing', 'dgiotThing'), 26 | msg: { 27 | type: 'bind_topo', 28 | id: args.getAttr('id'), 29 | text: args.findOne('Text').getAttr('text'), 30 | }, 31 | } 32 | console.log(args, 'args') 33 | console.log(params, 'bind_topo') 34 | Vue.prototype.$baseEventBus.$emit(params.busTopicKey, params.msg) 35 | }, 36 | } 37 | 38 | export default topoPath 39 | -------------------------------------------------------------------------------- /src/utils/konva/core/topoVideo.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 组态视频公共has 3 | * @type {{on(*=): void}} 4 | */ 5 | const topoVideo = { 6 | on(args) { 7 | console.log(args) 8 | }, 9 | } 10 | window.topoVideo = topoVideo 11 | 12 | export default topoVideo 13 | -------------------------------------------------------------------------------- /src/utils/konva/createGroup.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * @param {*} params 4 | * @returns group 5 | */ 6 | // https://konvajs.org/docs/groups_and_layers/Groups.html 7 | function createGroup(params) { 8 | const { x = 0, y = 0, rotation = 0 } = params 9 | var group = new Konva.Group({ 10 | x, 11 | y, 12 | rotation, 13 | }) 14 | return group 15 | } 16 | 17 | export default createGroup 18 | -------------------------------------------------------------------------------- /src/utils/konva/createImg.js: -------------------------------------------------------------------------------- 1 | function createImg(params) { 2 | const { width, height } = params 3 | var imgconfig = {} 4 | 5 | let createimg = new Image() 6 | // 处理图片跨域 7 | createimg.crossOrigin = 'anonymous' 8 | // 设置图图片链接地址 9 | createimg.src = imgUrl 10 | // 处理图片宽高不传的情况 11 | imgconfig.width = width ? width : createimg.width 12 | imgconfig.height = height ? height : createimg.height 13 | imgconfig.imageObj = createimg 14 | return new Konva.Image(Object.assign(params, imgconfig)) 15 | } 16 | 17 | export default createImg 18 | -------------------------------------------------------------------------------- /src/utils/konva/createRect.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * @param x 4 | * @param y 5 | * @param width 6 | * @param height 7 | * @param fill 8 | * @param strokeWidth 9 | * @param offset 10 | * @param draggable 11 | * @param id 12 | * @returns 13 | */ 14 | // https://konvajs.org/docs/shapes/Rect.html 15 | function createRect(params) { 16 | return new Konva.Rect(params) 17 | } 18 | 19 | export default createRect 20 | -------------------------------------------------------------------------------- /src/utils/konva/createShape.js: -------------------------------------------------------------------------------- 1 | import createText from '@/utils/konva/createText' 2 | import createRect from '@/utils/konva/createRect' 3 | import createImg from '@/utils/konva/createImg' 4 | 5 | export default function createShape(group, Shape) { 6 | Shape.forEach((_item) => { 7 | switch (_item.type) { 8 | case 'image': 9 | group.add(createImg(_item)) 10 | break 11 | case 'text': 12 | group.add(createText(_item)) 13 | break 14 | case 'rect': 15 | group.add(createRect(_item)) 16 | break 17 | default: 18 | group.add(createText(_item)) 19 | dgiotlog.log(_item.type, _item) 20 | break 21 | } 22 | }) 23 | return group 24 | } 25 | -------------------------------------------------------------------------------- /src/utils/konva/createStage.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * @param {*} params 4 | * @returns 5 | */ 6 | // https://konvajs.org/api/Konva.Stage.html 7 | function createStage(params) { 8 | let res = new Konva.Stage(params) 9 | return res 10 | } 11 | 12 | export default createStage 13 | -------------------------------------------------------------------------------- /src/utils/konva/createText.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * @param {*} id 4 | * @param {*} x 5 | * @param {*} y 6 | * @param {*} text 7 | * @param {*} fontSize 8 | * @param {*} fontFamily 9 | * @param {*} fill 10 | * @returns 11 | */ 12 | // https://konvajs.org/api/Konva.Text.html 13 | // https://konvajs.org/docs/shapes/Text.html 14 | function createText(params) { 15 | return new Konva.Text(params) 16 | } 17 | 18 | export default createText 19 | -------------------------------------------------------------------------------- /src/utils/konva/createThing.js: -------------------------------------------------------------------------------- 1 | import { uuid } from '@/utils' 2 | 3 | /** 4 | * @description create topo Thing 5 | * @document https://tech.iotn2n.com/w/docs/details?id=7 6 | * @param params 7 | * @return {{children: [{className: string, attrs: {name: string}}, {className: string, attrs: {id: string, text: string}}], className: string, attrs: {productid, name: string, id, thingid}}} 8 | */ 9 | function createThing(params) { 10 | dgiotlog.log(params, 'params') 11 | const { 12 | id = `uuid_${uuid(6)}`, 13 | productid, 14 | thingid, 15 | name = 'thing', 16 | text = '9528ac1c5d_flow_text', 17 | event = 'mousemove', 18 | } = params 19 | const thing = { 20 | attrs: { 21 | name, 22 | productid, 23 | thingid, 24 | id: productid, 25 | }, 26 | className: 'Label', 27 | children: [ 28 | { 29 | attrs: { 30 | name: event, 31 | }, 32 | className: 'Tag', 33 | }, 34 | { 35 | attrs: { 36 | id: '9528ac1c5d_flow_text', 37 | text, 38 | }, 39 | className: 'Text', 40 | }, 41 | ], 42 | } 43 | return thing 44 | } 45 | 46 | export default createThing 47 | -------------------------------------------------------------------------------- /src/utils/konva/dgagBox.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * @param {*} drag 4 | * @param {*} wrap 5 | */ 6 | function getCss(ele, prop) { 7 | return parseInt(window.getComputedStyle(ele)[prop]) 8 | } 9 | 10 | export default function dragBox(drag, wrap) { 11 | dgiotlog.log(drag, wrap) 12 | var initX, 13 | initY, 14 | dragable = false, 15 | wrapLeft = getCss(wrap, 'left'), 16 | wrapRight = getCss(wrap, 'top') 17 | 18 | drag.addEventListener( 19 | 'mousedown', 20 | function (e) { 21 | dragable = true 22 | initX = e.clientX 23 | initY = e.clientY 24 | }, 25 | false 26 | ) 27 | 28 | document.addEventListener('mousemove', function (e) { 29 | if (dragable === true) { 30 | var nowX = e.clientX, 31 | nowY = e.clientY, 32 | disX = nowX - initX, 33 | disY = nowY - initY 34 | wrap.style.left = wrapLeft + disX + 'px' 35 | wrap.style.top = wrapRight + disY + 'px' 36 | } 37 | }) 38 | 39 | drag.addEventListener( 40 | 'mouseup', 41 | function (e) { 42 | dragable = false 43 | wrapLeft = getCss(wrap, 'left') 44 | wrapRight = getCss(wrap, 'top') 45 | }, 46 | false 47 | ) 48 | } 49 | -------------------------------------------------------------------------------- /src/utils/konva/findnode.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * @param {*} id 4 | * @returns 5 | */ 6 | // https://konvajs.org/api/Konva.Container.html#findOne 7 | function findnode(id) { 8 | if (id) { 9 | var node = stage.findOne(id) 10 | return node 11 | } else { 12 | this.$message('id必传', 'error') 13 | } 14 | } 15 | 16 | export default findnode 17 | -------------------------------------------------------------------------------- /src/utils/konva/getSvgPath.js: -------------------------------------------------------------------------------- 1 | const regxD = /d="([^"]+)"/ 2 | const regxFile = /fill="([^"]+)"/ 3 | // const regxPathId = /id="([^"]+)"/ 4 | // const iconfont = require('https://at.alicdn.com/t/font_2759556_r8d9wroaw8.json') 5 | function getSvgPath(item) { 6 | const path = [] 7 | const topo = [] 8 | const font_class = item.font_class || '' 9 | if (!font_class) alert('No font class') 10 | const svgId = `#dgiot-${item.font_class}` || '' 11 | let el = $(svgId) 12 | const childPath = el 13 | let result = { 14 | id: svgId, 15 | el: el[0], 16 | path: path, 17 | topo: topo, 18 | } 19 | childPath[0].children.forEach((child, index) => { 20 | let _d = (regxD.exec(child.outerHTML) || '')[1] 21 | let _fill = (regxFile.exec(child.outerHTML) || '')[1] 22 | path[index] = { 23 | d: _d, 24 | path: _fill, 25 | } 26 | topo[index] = { 27 | attrs: { 28 | data: _d, 29 | originX: 'center', 30 | originY: 'bottom', 31 | id: `${svgId}-${index}-${moment(new Date()).valueOf()}`, 32 | x: 10, 33 | y: 15, 34 | angle: -30, 35 | fill: _fill, 36 | scaleX: 0.15, 37 | scaleY: 0.15, 38 | rotation: 0, 39 | }, 40 | className: 'Path', 41 | } 42 | }) 43 | return result 44 | } 45 | 46 | export default getSvgPath 47 | -------------------------------------------------------------------------------- /src/utils/konva/konva.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 自动引入当前文件夹下所有konva 3 | * require.context(directory, useSubdirectories = false, regExp = /^.//); 4 | * @param {String} directory 读取文件的路径 5 | * @param {Boolean} directory 匹配文件的正则表达式 6 | * @param {regExp} regExp 读取文件的路径 7 | */ 8 | 9 | const modulesFiles = require.context('../konva', true, /.js$/) 10 | const modules = modulesFiles.keys().reduce((modules, modulePath) => { 11 | const moduleName = modulePath.replace(/^.\/(.*)\.js/, '$1') 12 | const value = modulesFiles(modulePath) 13 | modules[moduleName] = value.default 14 | return modules 15 | }, {}) 16 | module.exports = { 17 | ...modules, 18 | } 19 | -------------------------------------------------------------------------------- /src/utils/konva/setImg.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * @param {*} shape 4 | * @param {*} value 5 | * @returns 6 | */ 7 | // https://konvajs.org/docs/tweens/Linear_Easing.html 8 | export async function setImg(shape, value) { 9 | var text = shape.text() 10 | shape.text(value) 11 | var tween 12 | if (tween) { 13 | tween.destroy() 14 | } 15 | 16 | tween = new Konva.Tween({ 17 | node: shape, 18 | duration: 1, 19 | }).play() 20 | return tween 21 | } 22 | 23 | export default setImg 24 | -------------------------------------------------------------------------------- /src/utils/konva/setRect.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * @param {*} shape 4 | * @param {*} value 5 | * @returns 6 | */ 7 | // https://konvajs.org/docs/tweens/Linear_Easing.html 8 | export async function setRect(shape, value) { 9 | var text = shape.text() 10 | shape.text(value) 11 | var tween 12 | if (tween) { 13 | tween.destroy() 14 | } 15 | 16 | tween = new Konva.Tween({ 17 | node: shape, 18 | duration: 1, 19 | }).play() 20 | return tween 21 | } 22 | 23 | export default setRect 24 | -------------------------------------------------------------------------------- /src/utils/konva/setText.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * @param {*} shape 4 | * @param {*} value 5 | * @returns 6 | */ 7 | // https://konvajs.org/docs/tweens/Linear_Easing.html 8 | export async function setText(shape, value) { 9 | var text = shape.text() 10 | shape.text(value) 11 | var tween 12 | if (tween) { 13 | tween.destroy() 14 | } 15 | 16 | tween = new Konva.Tween({ 17 | node: shape, 18 | duration: 1, 19 | }).play() 20 | return tween 21 | } 22 | 23 | export default setText 24 | -------------------------------------------------------------------------------- /src/utils/konva/topo.js: -------------------------------------------------------------------------------- 1 | //射线法-边界检测-只能检测凸边形(检测点在不在多边形里面) 2 | function inRange(x, y, points) { 3 | // points表示多边形的顶点集合 4 | let inside = false 5 | for (let i = 0, j = points.length - 1; i < points.length; j = i++) { 6 | let xi = points[i][0], 7 | yi = points[i][1] 8 | let xj = points[j][0], 9 | yj = points[j][1] 10 | let intersect = 11 | yi > y !== yj > y && x < ((xj - xi) * (y - yi)) / (yj - yi) + xi 12 | if (intersect) inside = !inside 13 | } 14 | return inside 15 | } 16 | 17 | /** 18 | * 矩形边界检测-中心点判断法 19 | * @param {*} frameRect 20 | * @param {*} itemRect 21 | */ 22 | export function checkByPointInRect(frameRect, itemRect) { 23 | var x = itemRect.x + itemRect.width / 2, 24 | y = itemRect.y + itemRect.height / 2 25 | if ( 26 | x > frameRect.x && 27 | y > frameRect.y && 28 | x < frameRect.x + frameRect.width && 29 | y < frameRect.y + frameRect.height 30 | ) { 31 | return true 32 | } else { 33 | return false 34 | } 35 | } 36 | 37 | /** 38 | * 矩形边界检测-碰撞检测法 39 | * 两个矩形中心点在x方向的距离的绝对值小于等于矩形宽度和的二分之一,同时y方向的距离的绝对值小于等于矩形高度和的二分之一 40 | * @param {*} frameRect 41 | * @param {*} itemRect 42 | */ 43 | export function checkByRectCollisionDetection(frameRect, itemRect) { 44 | var x1 = frameRect.x + frameRect.width / 2, 45 | y1 = frameRect.y + frameRect.height / 2, 46 | w1 = frameRect.width, 47 | h1 = frameRect.height 48 | var x2 = itemRect.x + itemRect.width / 2, 49 | y2 = itemRect.y + itemRect.height / 2, 50 | w2 = itemRect.width, 51 | h2 = itemRect.height 52 | if (Math.abs(x1 - x2) < (w1 + w2) / 2 && Math.abs(y1 - y2) < (h1 + h2) / 2) { 53 | return true 54 | } else { 55 | return false 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/utils/konva/updateShape.js: -------------------------------------------------------------------------------- 1 | import _setText from '@/utils/konva/setText' 2 | import _setRect from '@/utils/konva/setRect' 3 | import _setImage from '@/utils/konva/setImg' 4 | 5 | let _errorDate = [] 6 | export default async function updateShape(Shape) { 7 | Shape.forEach((_item) => { 8 | switch (_item.type) { 9 | case 'Image': 10 | _setImage(_item.id, _item.text) 11 | break 12 | case 'Text': 13 | _setText(_item.id, _item.text) 14 | break 15 | case 'Rect': 16 | _setRect(_item.id, _item.text) 17 | break 18 | default: 19 | _errorDate.push(_item) 20 | break 21 | } 22 | }) 23 | dgiotlog.log(_errorDate, '此类型数据更新暂不支持') 24 | return Shape 25 | } 26 | -------------------------------------------------------------------------------- /src/utils/swagger/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 自动构建执行,其他情况禁止执行 3 | * @type {module:fs} 4 | */ 5 | const fs = require('fs') 6 | const path = require('path') 7 | const { proxy } = require('../../config/net.config') 8 | const http = require('http') 9 | const swaggerFile = path.join(__dirname, '../../../swagger.json') 10 | http 11 | .get(`${proxy[0].target}/swagger.json`, (resp) => { 12 | let data = '' 13 | resp.on('data', (chunk) => { 14 | data += chunk 15 | }) 16 | 17 | resp.on('end', () => { 18 | fs.writeFile(swaggerFile, data, function (err) { 19 | if (err) { 20 | return dgiotlog.log('Failed to crawl' + err) 21 | } 22 | dgiotlog.log( 23 | 'File created swagger successfully, address:' + swaggerFile 24 | ) 25 | }) 26 | }) 27 | }) 28 | .on('error', (err) => { 29 | dgiotlog.log('Error: ' + err.message) 30 | }) 31 | -------------------------------------------------------------------------------- /src/utils/time/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 获取当前时间,每秒刷新 3 | * @return {number|*} 4 | */ 5 | 6 | var datetime = null, 7 | date = null 8 | 9 | export function tickTime() { 10 | console.log('start tick Time') 11 | setInterval(update, 1000) 12 | } 13 | 14 | function update() { 15 | date = moment(new Date()) 16 | datetime = date.format('YYYY-MM-DD HH:mm:ss') 17 | window.datetime = datetime 18 | } 19 | -------------------------------------------------------------------------------- /src/utils/vue/eventBus.js: -------------------------------------------------------------------------------- 1 | // * @Author: h7ml 2 | // * @Date: 2021-09-01 10:38:18 3 | // * @LastEditors: h7ml 4 | // * @LastEditTime: 2021-09-01 10:38:18 5 | // * @Description: 6 | // * @FilePath: src\utils\eventBus.js 7 | // * @DocumentLink: https://juejin.cn/post/6844903763560366093 8 | /** 9 | * 10 | * @type {Vue} 11 | */ 12 | import { getMqttEventId } from '@/utils' 13 | 14 | const Bus = new Vue({ 15 | methods: { 16 | emit(event, ...args) { 17 | this.$emit(getMqttEventId(event), ...args) 18 | }, 19 | on(event, callback) { 20 | this.$on(getMqttEventId(event), callback) 21 | }, 22 | off(event, callback) { 23 | this.$off(getMqttEventId(event), callback) 24 | }, 25 | }, 26 | }) 27 | export default Bus 28 | 29 | // user 30 | // $emit 传递 31 | // 32 | // let arr1 = ['hi~']; 33 | // function aa(){ 34 | // return arr1; 35 | // } 36 | // let str = 'hello'; 37 | // let arr = [2,3,4,5]; 38 | // this.$dgiotBus.$emit('log',aa()) 39 | // this.$dgiotBus.$emit('log1',str) 40 | // this.$dgiotBus.$emit('log2',arr) 41 | 42 | // $on 接受 43 | 44 | // created() { 45 | // this.$dgiotBus.$on('log',(res)=>{ 46 | // dgiotlog.log(res); 47 | // }) 48 | // this.$dgiotBus.$on('log1',(res)=>{ 49 | // dgiotlog.log(res); 50 | // }) 51 | // this.$dgiotBus.$on('log2',(res)=>{ 52 | // dgiotlog.log(res); 53 | // }) 54 | // } 55 | 56 | // $off 清空 57 | // 58 | // this.$dgiotBus.$off('log') 59 | // this.$dgiotBus.$off('log1') 60 | // this.$dgiotBus.$off('log2') 61 | -------------------------------------------------------------------------------- /src/utils/vue/pageTitle.js: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: h7ml 3 | * @Date: 2021-03-12 10:00:15 4 | * @LastEditTime: 2021-03-15 12:41:02 5 | * @LastEditors: h7ml 6 | * @FilePath: \dgiot-dashboard\src\utils\pageTitle.js 7 | * @Description: 8 | */ 9 | import { title, titleReverse, titleSeparator } from '@/config' 10 | import store from '@/store/index' 11 | import { translateTitle } from '@/utils/utilwen' 12 | 13 | /** 14 | * @description 设置标题 15 | * @param pageTitle 16 | * @returns {string} 17 | */ 18 | export default function getPageTitle(pageTitle) { 19 | // dgiotlog.log(translateTitle(`route.${pageTitle}`)) 20 | pageTitle = translateTitle(`route.${pageTitle}`) 21 | let newTitles = [] 22 | if (pageTitle) newTitles.push(pageTitle) 23 | if (title) newTitles.push(title) 24 | if (titleReverse) newTitles = newTitles.reverse() 25 | let retutnTitle = newTitles.join(titleSeparator) 26 | if (store.getters['settings/title']) { 27 | retutnTitle = newTitles 28 | .join(titleSeparator) 29 | .replace(title, store.getters['settings/title']) 30 | } 31 | return retutnTitle 32 | } 33 | -------------------------------------------------------------------------------- /src/views/CloudFunction/dict/components/dgiotRule.vue: -------------------------------------------------------------------------------- 1 | 10 | 17 | 18 | 51 | 61 | -------------------------------------------------------------------------------- /src/views/CloudFunction/index.vue: -------------------------------------------------------------------------------- 1 | 10 | 17 | 18 | 39 | 49 | -------------------------------------------------------------------------------- /src/views/CloudFunction/lowcode/components/amis.vue: -------------------------------------------------------------------------------- 1 | 10 | 13 | 14 | 68 | -------------------------------------------------------------------------------- /src/views/CloudFunction/swagger/index.vue: -------------------------------------------------------------------------------- 1 |