├── .editorconfig ├── .eslintignore ├── .eslintrc.json ├── .gitattributes ├── .gitignore ├── .travis.yml ├── CHANGELOG.md ├── COMMIT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── README_EN.md ├── components ├── common │ ├── .babelrc │ ├── .editorconfig │ ├── .eslintrc.json │ ├── .gitignore │ ├── CHANGELOG.md │ ├── README.md │ ├── build │ │ ├── utils.js │ │ ├── webpack.base.config.js │ │ ├── webpack.dev.config.js │ │ ├── webpack.prod.config.js │ │ └── webpack.test.config.js │ ├── demo │ │ ├── app.vue │ │ ├── components │ │ │ ├── 404 │ │ │ │ └── 404.vue │ │ │ ├── baseUIDemo.vue │ │ │ ├── button │ │ │ │ └── button.vue │ │ │ ├── cascaderSelect │ │ │ │ └── cascaderSelect.vue │ │ │ ├── chart │ │ │ │ ├── chartDemo.vue │ │ │ │ ├── contrastTrendDemo.vue │ │ │ │ └── trendDemo.vue │ │ │ ├── checkbox │ │ │ │ └── checkbox.vue │ │ │ ├── datePicker │ │ │ │ └── datePicker.vue │ │ │ ├── dialog │ │ │ │ └── dialog.vue │ │ │ ├── ellipsis │ │ │ │ └── ellipsis.vue │ │ │ ├── form │ │ │ │ └── formDemo.vue │ │ │ ├── icon │ │ │ │ ├── icon.vue │ │ │ │ └── iconConfig.js │ │ │ ├── list │ │ │ │ └── list.vue │ │ │ ├── multiSelect │ │ │ │ └── multiSelect.vue │ │ │ ├── nvdutytable │ │ │ │ └── nvdutytable.vue │ │ │ ├── pipline │ │ │ │ ├── pipline.less │ │ │ │ └── pipline.vue │ │ │ ├── scrolltab │ │ │ │ └── scrolltab.vue │ │ │ ├── search │ │ │ │ └── search.vue │ │ │ ├── steps │ │ │ │ └── steps.vue │ │ │ ├── switch │ │ │ │ └── switch.vue │ │ │ ├── table │ │ │ │ ├── filterTableDemo.vue │ │ │ │ └── tableDemo.vue │ │ │ ├── tag │ │ │ │ └── tag.vue │ │ │ ├── textArea │ │ │ │ └── textArea.vue │ │ │ ├── textLine │ │ │ │ └── textLine.vue │ │ │ ├── transfer │ │ │ │ ├── transfer.less │ │ │ │ └── transfer.vue │ │ │ └── tree │ │ │ │ └── tree.vue │ │ ├── index.html │ │ ├── main.js │ │ └── router.js │ ├── mockup │ │ └── index.js │ ├── package.json │ ├── src │ │ ├── assets │ │ │ ├── css │ │ │ │ ├── components │ │ │ │ │ ├── 404.less │ │ │ │ │ ├── cascader-select.less │ │ │ │ │ ├── chart.less │ │ │ │ │ ├── checkbox.less │ │ │ │ │ ├── datepicker-common.less │ │ │ │ │ ├── datepicker-console.less │ │ │ │ │ ├── dutyTable.css │ │ │ │ │ ├── dutyTable.less │ │ │ │ │ ├── echarts.less │ │ │ │ │ ├── ellipsis.less │ │ │ │ │ ├── form.less │ │ │ │ │ ├── input.less │ │ │ │ │ ├── list.less │ │ │ │ │ ├── multiSelect.less │ │ │ │ │ ├── pipline.less │ │ │ │ │ ├── pool.less │ │ │ │ │ ├── scrolltab.less │ │ │ │ │ ├── search.less │ │ │ │ │ ├── steps.less │ │ │ │ │ ├── table.less │ │ │ │ │ ├── tag.less │ │ │ │ │ ├── textArea.less │ │ │ │ │ ├── textLine.less │ │ │ │ │ ├── transfer.less │ │ │ │ │ ├── tree.less │ │ │ │ │ └── trend.less │ │ │ │ ├── index.less │ │ │ │ └── main.less │ │ │ ├── fonts │ │ │ │ ├── iconfont.less │ │ │ │ ├── nv-iconfont.eot │ │ │ │ ├── nv-iconfont.svg │ │ │ │ ├── nv-iconfont.ttf │ │ │ │ └── nv-iconfont.woff │ │ │ └── img │ │ │ │ └── nv-steps │ │ │ │ ├── finished.png │ │ │ │ ├── running-inner.png │ │ │ │ └── running-outer.png │ │ ├── components │ │ │ ├── eventBus.js │ │ │ ├── nv-404 │ │ │ │ ├── 404.vue │ │ │ │ └── index.js │ │ │ ├── nv-button │ │ │ │ ├── buttonTpl.vue │ │ │ │ └── index.js │ │ │ ├── nv-cascaderSelect │ │ │ │ ├── cascaderSelect.js │ │ │ │ ├── cascaderSelect.vue │ │ │ │ ├── casitem.vue │ │ │ │ ├── caspanel.vue │ │ │ │ └── index.js │ │ │ ├── nv-chart │ │ │ │ ├── chart.vue │ │ │ │ ├── chartUtil.js │ │ │ │ ├── contrastTrend.vue │ │ │ │ ├── index.js │ │ │ │ ├── options.js │ │ │ │ ├── trend.vue │ │ │ │ └── vueEcharts.vue │ │ │ ├── nv-checkbox │ │ │ │ ├── checkbox.vue │ │ │ │ └── index.js │ │ │ ├── nv-datepicker │ │ │ │ ├── commonTimePanel.vue │ │ │ │ ├── consoleTimePanel.vue │ │ │ │ ├── datePanel.vue │ │ │ │ ├── datePicker.js │ │ │ │ ├── datePicker.vue │ │ │ │ ├── dateTable.vue │ │ │ │ ├── hotKeys.vue │ │ │ │ ├── index.js │ │ │ │ ├── sidebar.vue │ │ │ │ ├── timePanel.vue │ │ │ │ └── topBar.vue │ │ │ ├── nv-dialog │ │ │ │ ├── dialogTpl.vue │ │ │ │ └── index.js │ │ │ ├── nv-dutytable │ │ │ │ ├── CONSTANTS.js │ │ │ │ ├── date-picker.js │ │ │ │ ├── dutyTable.vue │ │ │ │ └── index.js │ │ │ ├── nv-ellipsis │ │ │ │ ├── ellipsis.vue │ │ │ │ └── index.js │ │ │ ├── nv-filtertable │ │ │ │ ├── filtertable.vue │ │ │ │ └── index.js │ │ │ ├── nv-form │ │ │ │ ├── form.vue │ │ │ │ └── index.js │ │ │ ├── nv-icon │ │ │ │ ├── icon.vue │ │ │ │ └── index.js │ │ │ ├── nv-input │ │ │ │ ├── index.js │ │ │ │ └── input.vue │ │ │ ├── nv-list │ │ │ │ ├── index.js │ │ │ │ └── list.vue │ │ │ ├── nv-multiSelect │ │ │ │ ├── index.js │ │ │ │ └── multiSelect.vue │ │ │ ├── nv-pipline │ │ │ │ ├── index.js │ │ │ │ └── pipline.vue │ │ │ ├── nv-scrolltab │ │ │ │ ├── index.js │ │ │ │ └── scrolltab.vue │ │ │ ├── nv-search │ │ │ │ ├── index.js │ │ │ │ └── search.vue │ │ │ ├── nv-steps │ │ │ │ ├── index.js │ │ │ │ ├── steps.js │ │ │ │ └── steps.vue │ │ │ ├── nv-switch │ │ │ │ ├── index.js │ │ │ │ └── switchTpl.vue │ │ │ ├── nv-table │ │ │ │ ├── index.js │ │ │ │ └── table.vue │ │ │ ├── nv-tag │ │ │ │ ├── index.js │ │ │ │ └── tag.vue │ │ │ ├── nv-textArea │ │ │ │ ├── index.js │ │ │ │ └── textArea.vue │ │ │ ├── nv-textline │ │ │ │ ├── index.js │ │ │ │ └── textLine.vue │ │ │ ├── nv-transfer │ │ │ │ ├── index.js │ │ │ │ ├── pool.vue │ │ │ │ └── transfer.vue │ │ │ ├── nv-tree │ │ │ │ ├── editPanel.vue │ │ │ │ ├── index.js │ │ │ │ ├── node.vue │ │ │ │ ├── tree.js │ │ │ │ └── tree.vue │ │ │ └── utils.js │ │ ├── index.js │ │ ├── locale │ │ │ ├── en-US.js │ │ │ ├── index.js │ │ │ └── zh-CN.js │ │ ├── mixins │ │ │ └── index.js │ │ └── util │ │ │ └── index.js │ ├── test │ │ └── unit │ │ │ ├── index.js │ │ │ ├── karma.conf.js │ │ │ ├── specs │ │ │ ├── nv404.spec.js │ │ │ ├── nvButton.spec.js │ │ │ ├── nvCascaderSelect.spec.js │ │ │ ├── nvChart.spec.js │ │ │ ├── nvContrastTrend.spec.js │ │ │ ├── nvDatePicker.spec.js │ │ │ ├── nvDialog.spec.js │ │ │ ├── nvDutyTable.spec.js │ │ │ ├── nvFilterTable.spec.js │ │ │ ├── nvForm.spec.js │ │ │ ├── nvInput.spec.js │ │ │ ├── nvList.spec.js │ │ │ ├── nvPipline.spec.js │ │ │ ├── nvSearch.spec.js │ │ │ ├── nvSteps.spec.js │ │ │ ├── nvSwitch.spec.js │ │ │ ├── nvTable.spec.js │ │ │ ├── nvTag.spec.js │ │ │ ├── nvTextLine.spec.js │ │ │ ├── nvTransfer.spec.js │ │ │ ├── nvTree.spec.js │ │ │ └── nvTrend.spec.js │ │ │ └── util.js │ └── yarn.lock └── visual │ ├── .babelrc │ ├── .eslintrc.js │ ├── .eslintrc.json │ ├── .gitignore │ ├── CHANGELOG.md │ ├── README.md │ ├── build │ ├── webpack.base.config.js │ ├── webpack.dev.config.js │ └── webpack.test.config.js │ ├── demo │ ├── app.vue │ ├── assets │ │ └── css │ │ │ └── style.less │ ├── components │ │ ├── billboard.vue │ │ ├── bubble.vue │ │ ├── circle.vue │ │ ├── circleDemo.vue │ │ ├── eventRiver.vue │ │ ├── nvmap.vue │ │ ├── nvpie.vue │ │ ├── report.vue │ │ ├── trend.vue │ │ └── widget.vue │ ├── index.html │ ├── main.js │ ├── router.js │ └── service │ │ ├── api │ │ └── index.js │ │ ├── config │ │ ├── widgetApi.js │ │ └── widgetConfig.js │ │ └── mock │ │ ├── billboard.js │ │ ├── circle.js │ │ ├── customBox.js │ │ ├── customEventsUrl.js │ │ ├── dashBoardConfig.js │ │ ├── dataBillboard.js │ │ ├── dataCircle.js │ │ ├── dataMap.js │ │ ├── dataMdColumn.js │ │ ├── dataMdTrend.js │ │ ├── dataPie.js │ │ ├── dataReport.js │ │ ├── dataTreeReport.js │ │ ├── eventRiver.js │ │ ├── eventlist.js │ │ ├── mdcolumn.js │ │ ├── mdpie.js │ │ ├── mdreport.js │ │ ├── mdtrend.js │ │ ├── pie.js │ │ ├── trendEvent.js │ │ ├── trendPoint.js │ │ └── trendWarning.js │ ├── package.json │ ├── src │ ├── assets │ │ ├── css │ │ │ ├── billboard │ │ │ │ └── billboard.less │ │ │ ├── eventriver │ │ │ │ ├── eventlist.less │ │ │ │ ├── eventriver.less │ │ │ │ └── index.less │ │ │ ├── index.less │ │ │ ├── mdcircle │ │ │ │ └── circle.less │ │ │ ├── mdmask │ │ │ │ └── mask.less │ │ │ ├── mdreport │ │ │ │ └── report.less │ │ │ ├── mdtrend │ │ │ │ └── trend.less │ │ │ ├── nvmap │ │ │ │ └── map.less │ │ │ ├── nvpie │ │ │ │ └── pie.less │ │ │ └── variables.less │ │ ├── fonts │ │ │ ├── iconfont.eot │ │ │ ├── iconfont.less │ │ │ ├── iconfont.svg │ │ │ ├── iconfont.ttf │ │ │ └── iconfont.woff │ │ └── img │ │ │ ├── Artboard.png │ │ │ ├── ktip.png │ │ │ ├── sort-asc.png │ │ │ ├── sort-desc.png │ │ │ ├── tree_icon.png │ │ │ └── trend │ │ │ ├── chartarea.png │ │ │ ├── chartcolumn.png │ │ │ ├── chartline.png │ │ │ ├── chartnormal.png │ │ │ ├── chartstack.png │ │ │ ├── sortAsc.png │ │ │ └── sortDesc.png │ ├── billboard.vue │ ├── circle.vue │ ├── config │ │ ├── widgetApi.js │ │ └── widgetConfig.js │ ├── customBox.vue │ ├── eventBus.js │ ├── eventRiver │ │ ├── eventDetail.vue │ │ ├── eventList.vue │ │ ├── eventRiver.vue │ │ ├── eventRiverView.vue │ │ └── index.js │ ├── index.js │ ├── locale │ │ ├── en-US.js │ │ ├── index.js │ │ └── zh-CN.js │ ├── mask.vue │ ├── mdbubble │ │ ├── CONSTANTS.js │ │ ├── mdbubble.vue │ │ └── mdbubbleCore.vue │ ├── mdreport.vue │ ├── mdtrend.vue │ ├── mixins │ │ └── index.js │ ├── nvMap │ │ ├── index.js │ │ └── nvMap.vue │ ├── nvPie │ │ ├── index.js │ │ └── nvPie.vue │ └── util │ │ ├── axiosInstance.js │ │ └── util.js │ ├── test │ └── unit │ │ ├── index.js │ │ ├── karma.conf.js │ │ ├── specs │ │ ├── nvBillboard.spec.js │ │ ├── nvBubble.spec.js │ │ ├── nvCircle.spec.js │ │ ├── nvReport.spec.js │ │ └── nvTrend.spec.js │ │ └── util.js │ └── yarn.lock ├── doc ├── .babelrc ├── .eslintrc.json ├── .gitignore ├── README.md ├── build.sh ├── index.html ├── mockup │ └── api │ │ ├── billboard.js │ │ ├── circle.js │ │ ├── dataBillboard.js │ │ ├── dataCircle.js │ │ ├── dataMdTrend.js │ │ ├── dataReport.js │ │ ├── dataTreeReport.js │ │ ├── eventRiver.js │ │ ├── eventlist.js │ │ ├── mdreport.js │ │ ├── mdtrend.js │ │ ├── table.js │ │ ├── tpl │ │ ├── ajax.js │ │ ├── business.js │ │ ├── charts.js │ │ ├── filterTable.js │ │ ├── form.js │ │ ├── formGet.js │ │ ├── formSubmit.js │ │ ├── table.js │ │ ├── tabledelete.js │ │ ├── time-trend.js │ │ └── trend.js │ │ ├── trendEvent.js │ │ └── trendPoint.js ├── package.json ├── release.sh ├── scripts │ ├── build.js │ ├── config.js │ ├── demo-loader │ │ ├── config.js │ │ ├── containers.js │ │ ├── fence.js │ │ ├── index.js │ │ └── util.js │ ├── dev-client.js │ ├── dev-server.js │ ├── openBrowser.js │ ├── openCHrome.applescript │ ├── utils.js │ ├── vue-loader.conf.js │ ├── webpack.base.conf.js │ ├── webpack.dev.conf.js │ └── webpack.prod.conf.js ├── src │ ├── color │ │ └── index.vue │ ├── common │ │ ├── assets │ │ │ ├── css │ │ │ │ ├── global.less │ │ │ │ ├── header.less │ │ │ │ ├── main.less │ │ │ │ ├── markdown.less │ │ │ │ └── theme │ │ │ │ │ ├── components │ │ │ │ │ ├── button.less │ │ │ │ │ ├── checkbox.less │ │ │ │ │ ├── index.less │ │ │ │ │ ├── input.less │ │ │ │ │ ├── modal.less │ │ │ │ │ ├── page.less │ │ │ │ │ ├── radio.less │ │ │ │ │ ├── select.less │ │ │ │ │ ├── switch.less │ │ │ │ │ ├── table.less │ │ │ │ │ ├── tabs.less │ │ │ │ │ ├── toast.less │ │ │ │ │ └── tooltip.less │ │ │ │ │ ├── custom.less │ │ │ │ │ └── my-theme.less │ │ │ ├── icon │ │ │ │ ├── iconfont.css │ │ │ │ ├── iconfont.eot │ │ │ │ ├── iconfont.js │ │ │ │ ├── iconfont.json │ │ │ │ ├── iconfont.svg │ │ │ │ ├── iconfont.ttf │ │ │ │ ├── iconfont.woff │ │ │ │ └── iconfont.woff2 │ │ │ └── img │ │ │ │ ├── ark.png │ │ │ │ ├── catlog.png │ │ │ │ ├── conf.png │ │ │ │ ├── dashboard-api.png │ │ │ │ ├── dashboard-edit.png │ │ │ │ ├── dashboard-list.png │ │ │ │ ├── dashboard.png │ │ │ │ ├── favicon.ico │ │ │ │ ├── header-demo-complex.png │ │ │ │ ├── header-demo.png │ │ │ │ ├── logo.png │ │ │ │ ├── noahv.png │ │ │ │ └── ybp.png │ │ ├── component │ │ │ ├── code.vue │ │ │ └── nv-demo.vue │ │ ├── conifg.js │ │ ├── devProxy.js │ │ ├── header.js │ │ ├── layout │ │ │ ├── 404.vue │ │ │ ├── footer.vue │ │ │ └── layout.vue │ │ └── router.js │ ├── doc │ │ ├── component │ │ │ ├── business │ │ │ │ ├── buttonTpl │ │ │ │ │ └── buttonTpl.md │ │ │ │ ├── chart │ │ │ │ │ └── chart.md │ │ │ │ ├── constrastTrend │ │ │ │ │ └── constrastTrend.vue │ │ │ │ ├── dialogTpl │ │ │ │ │ └── dialogTpl.md │ │ │ │ ├── list │ │ │ │ │ └── list.md │ │ │ │ ├── switchTpl │ │ │ │ │ └── switchTpl.md │ │ │ │ └── trend │ │ │ │ │ └── trend.md │ │ │ ├── cascaderSelect │ │ │ │ └── cascaderSelect.md │ │ │ ├── datePicker │ │ │ │ └── datePicker.md │ │ │ ├── dutyTable │ │ │ │ └── dutyTable.md │ │ │ ├── ellipsis │ │ │ │ └── ellipsis.md │ │ │ ├── pipline │ │ │ │ └── pipline.md │ │ │ ├── search │ │ │ │ └── search.md │ │ │ ├── steps │ │ │ │ └── steps.md │ │ │ ├── tag │ │ │ │ └── tag.md │ │ │ ├── textLine │ │ │ │ └── textLine.md │ │ │ ├── transfer │ │ │ │ └── transfer.md │ │ │ └── tree │ │ │ │ └── tree.md │ │ ├── icon │ │ │ ├── icon.md │ │ │ └── iconConfig.js │ │ ├── template │ │ │ ├── form │ │ │ │ └── form.md │ │ │ ├── table │ │ │ │ ├── filterTable.md │ │ │ │ ├── table.md │ │ │ │ ├── table.vue │ │ │ │ └── tableConfig.js │ │ │ └── trend │ │ │ │ ├── contrastTrend.md │ │ │ │ └── trend.md │ │ ├── view │ │ │ ├── api │ │ │ │ ├── api.md │ │ │ │ ├── dashboardCopy.md │ │ │ │ ├── dashboardCreate.md │ │ │ │ ├── dashboardDelete.md │ │ │ │ ├── dashboardGet.md │ │ │ │ ├── dashboardList.md │ │ │ │ ├── dashboardUpdate.md │ │ │ │ ├── updateMeta.md │ │ │ │ ├── widgetConfig.md │ │ │ │ ├── widgetCopy.md │ │ │ │ ├── widgetCreate.md │ │ │ │ ├── widgetDelete.md │ │ │ │ └── widgetSave.md │ │ │ ├── conf.md │ │ │ ├── guide.md │ │ │ └── quickstart.md │ │ └── visualComponent │ │ │ ├── billboard.md │ │ │ ├── circle.md │ │ │ ├── config │ │ │ ├── mockApi.js │ │ │ ├── widgetApi.js │ │ │ └── widgetConfig.js │ │ │ ├── eventriver.md │ │ │ ├── report.md │ │ │ └── trend.md │ ├── example │ │ ├── dutyTable │ │ │ ├── nvDutyTableComplexDemo.vue │ │ │ └── nvDutyTableNormalDemo.vue │ │ ├── ellipsis │ │ │ └── ellipsisNormalDemo.vue │ │ ├── filterTable │ │ │ └── normal.vue │ │ ├── form │ │ │ ├── aliasDemo.vue │ │ │ ├── complex.vue │ │ │ ├── normal.vue │ │ │ ├── preData.vue │ │ │ └── selectDemo.vue │ │ ├── header │ │ │ ├── complex.vue │ │ │ └── normal.vue │ │ ├── table │ │ │ ├── loadingTable.vue │ │ │ ├── normal.vue │ │ │ └── table-demo.vue │ │ └── trend │ │ │ ├── contrastTrendDemo.vue │ │ │ └── trend.vue │ ├── guide │ │ ├── about.md │ │ ├── about.vue │ │ ├── catalog.md │ │ ├── deploy.md │ │ ├── example │ │ │ └── header │ │ │ │ ├── complex.vue │ │ │ │ └── normal.vue │ │ ├── menu.md │ │ ├── mockup.md │ │ ├── proxy.md │ │ ├── qa.md │ │ ├── quickstart.md │ │ ├── request.md │ │ ├── router.md │ │ ├── specification.md │ │ ├── theme.md │ │ └── tpl.md │ ├── main.js │ ├── store │ │ ├── index.js │ │ └── mutation-types.js │ └── tools │ │ ├── axiosInstance.js │ │ ├── mock.js │ │ └── utils.js └── test │ └── unit │ ├── index.js │ ├── karma.conf.js │ ├── specs │ ├── doc │ │ └── view │ │ │ ├── api.spec.js │ │ │ ├── api │ │ │ └── dashboardList.md.spec.js │ │ │ ├── conf.spec.js │ │ │ ├── guide.spec.js │ │ │ └── quickstart.spec.js │ ├── example │ │ └── trend │ │ │ └── trend.spec.js │ ├── guide │ │ ├── about.spec.js │ │ ├── catalog.spec.js │ │ ├── deploy.spec.js │ │ ├── menu.spec.js │ │ ├── mockup.spec.js │ │ ├── proxy.spec.js │ │ ├── quickstart.spec.js │ │ ├── request.spec.js │ │ ├── router.spec.js │ │ ├── specification.spec.js │ │ └── tpl.spec.js │ └── tableDemo.spec.js │ └── util.js ├── package.json ├── packages ├── noahv-core │ ├── .babelrc │ ├── README.md │ ├── index.js │ ├── lib │ │ ├── header-sidebar │ │ │ ├── header-sidebar.vue │ │ │ ├── headerLink.vue │ │ │ └── sidebarLink.vue │ │ ├── header.js │ │ ├── header │ │ │ ├── header.less │ │ │ ├── header.vue │ │ │ ├── headerLink.vue │ │ │ ├── login.vue │ │ │ ├── logo.vue │ │ │ └── variablesLayout.less │ │ ├── index.js │ │ └── router.js │ ├── package.json │ └── util │ │ └── eventBus.js ├── noahv-i18n │ ├── README.md │ ├── index.js │ ├── lib │ │ └── index.js │ └── package.json ├── noahv-mockup │ ├── README.md │ ├── index.js │ ├── lib │ │ ├── index.js │ │ ├── logger.js │ │ └── util.js │ └── package.json ├── noahv-request │ ├── README.md │ ├── index.js │ ├── lib │ │ └── index.js │ └── package.json └── noahv-tongji │ ├── README.md │ ├── index.js │ ├── lib │ └── index.js │ └── package.json ├── template ├── common-ts │ ├── .babelrc │ ├── .eslintrc.json │ ├── .gitignore │ ├── README.md │ ├── build.sh │ ├── index.html │ ├── mockup │ │ └── api │ │ │ ├── demo │ │ │ ├── chart │ │ │ │ ├── column │ │ │ │ │ └── get.js │ │ │ │ ├── line │ │ │ │ │ └── get.js │ │ │ │ ├── pie │ │ │ │ │ └── get.js │ │ │ │ └── trend │ │ │ │ │ └── get.js │ │ │ ├── form │ │ │ │ ├── default.js │ │ │ │ └── submit.js │ │ │ └── table │ │ │ │ ├── delete.js │ │ │ │ ├── filter │ │ │ │ ├── delete.js │ │ │ │ └── get.js │ │ │ │ └── get.js │ │ │ └── user.js │ ├── package.json │ ├── scripts │ │ ├── build.js │ │ ├── config.js │ │ ├── dev-client.js │ │ ├── dev-server.js │ │ ├── openBrowser.js │ │ ├── openChrome.applescript │ │ ├── webpack.base.conf.js │ │ ├── webpack.dev.conf.js │ │ ├── webpack.prod.conf.js │ │ └── webpack.test.conf.js │ ├── src │ │ ├── common │ │ │ ├── assets │ │ │ │ ├── css │ │ │ │ │ ├── global.less │ │ │ │ │ ├── header.less │ │ │ │ │ ├── loading.less │ │ │ │ │ ├── main.less │ │ │ │ │ └── theme │ │ │ │ │ │ ├── components │ │ │ │ │ │ ├── button.less │ │ │ │ │ │ ├── checkbox.less │ │ │ │ │ │ ├── index.less │ │ │ │ │ │ ├── input.less │ │ │ │ │ │ ├── modal.less │ │ │ │ │ │ ├── page.less │ │ │ │ │ │ ├── radio.less │ │ │ │ │ │ ├── select.less │ │ │ │ │ │ ├── switch.less │ │ │ │ │ │ ├── table.less │ │ │ │ │ │ ├── tabs.less │ │ │ │ │ │ ├── toast.less │ │ │ │ │ │ └── tooltip.less │ │ │ │ │ │ ├── custom.less │ │ │ │ │ │ └── my-theme.less │ │ │ │ └── img │ │ │ │ │ ├── favicon.ico │ │ │ │ │ └── logo.png │ │ │ ├── config.js │ │ │ ├── devProxy.js │ │ │ ├── header.js │ │ │ ├── hook │ │ │ │ └── ajax.js │ │ │ ├── layout │ │ │ │ ├── 404.vue │ │ │ │ ├── footer.vue │ │ │ │ └── layout.vue │ │ │ └── router.js │ │ ├── demo │ │ │ ├── chart │ │ │ │ ├── chartDemo.vue │ │ │ │ └── trend.vue │ │ │ ├── form │ │ │ │ └── formDemo.vue │ │ │ └── table │ │ │ │ ├── filterTableDemo.vue │ │ │ │ └── tableDemo.vue │ │ ├── main.ts │ │ ├── store │ │ │ ├── index.js │ │ │ └── mutation-types.js │ │ ├── tools │ │ │ └── utils.js │ │ ├── types │ │ │ └── tool.d.ts │ │ └── vue-shims.d.ts │ ├── test │ │ └── unit │ │ │ ├── index.js │ │ │ ├── karma.conf.js │ │ │ ├── specs │ │ │ └── demo │ │ │ │ ├── chart │ │ │ │ └── trend.spec.js │ │ │ │ └── table │ │ │ │ └── tableDemo.spec.js │ │ │ └── util.js │ └── tsconfig.json ├── common │ ├── .babelrc │ ├── .eslintrc.json │ ├── .gitignore │ ├── README.md │ ├── build.sh │ ├── index.html │ ├── mockup │ │ └── api │ │ │ ├── demo │ │ │ ├── chart │ │ │ │ ├── column │ │ │ │ │ └── get.js │ │ │ │ ├── line │ │ │ │ │ └── get.js │ │ │ │ ├── pie │ │ │ │ │ └── get.js │ │ │ │ └── trend │ │ │ │ │ └── get.js │ │ │ ├── form │ │ │ │ ├── default.js │ │ │ │ └── submit.js │ │ │ └── table │ │ │ │ ├── delete.js │ │ │ │ ├── filter │ │ │ │ ├── delete.js │ │ │ │ └── get.js │ │ │ │ └── get.js │ │ │ └── user.js │ ├── package.json │ ├── scripts │ │ ├── build.js │ │ ├── config.js │ │ ├── dev-client.js │ │ ├── dev-server.js │ │ ├── openBrowser.js │ │ ├── openChrome.applescript │ │ ├── webpack.base.conf.js │ │ ├── webpack.dev.conf.js │ │ ├── webpack.prod.conf.js │ │ └── webpack.test.conf.js │ ├── src │ │ ├── common │ │ │ ├── assets │ │ │ │ ├── css │ │ │ │ │ ├── global.less │ │ │ │ │ ├── header.less │ │ │ │ │ ├── loading.less │ │ │ │ │ ├── main.less │ │ │ │ │ └── theme │ │ │ │ │ │ ├── components │ │ │ │ │ │ ├── button.less │ │ │ │ │ │ ├── checkbox.less │ │ │ │ │ │ ├── index.less │ │ │ │ │ │ ├── input.less │ │ │ │ │ │ ├── modal.less │ │ │ │ │ │ ├── page.less │ │ │ │ │ │ ├── radio.less │ │ │ │ │ │ ├── select.less │ │ │ │ │ │ ├── switch.less │ │ │ │ │ │ ├── table.less │ │ │ │ │ │ ├── tabs.less │ │ │ │ │ │ ├── toast.less │ │ │ │ │ │ └── tooltip.less │ │ │ │ │ │ ├── custom.less │ │ │ │ │ │ └── my-theme.less │ │ │ │ └── img │ │ │ │ │ ├── favicon.ico │ │ │ │ │ └── logo.png │ │ │ ├── config.js │ │ │ ├── devProxy.js │ │ │ ├── header.js │ │ │ ├── hook │ │ │ │ └── ajax.js │ │ │ ├── layout │ │ │ │ ├── 404.vue │ │ │ │ ├── footer.vue │ │ │ │ └── layout.vue │ │ │ └── router.js │ │ ├── demo │ │ │ ├── chart │ │ │ │ ├── chartDemo.vue │ │ │ │ └── trend.vue │ │ │ ├── form │ │ │ │ └── formDemo.vue │ │ │ └── table │ │ │ │ ├── filterTableDemo.vue │ │ │ │ └── tableDemo.vue │ │ ├── main.js │ │ ├── store │ │ │ ├── index.js │ │ │ └── mutation-types.js │ │ └── tools │ │ │ └── utils.js │ └── test │ │ └── unit │ │ ├── index.js │ │ ├── karma.conf.js │ │ ├── specs │ │ └── demo │ │ │ ├── chart │ │ │ └── trend.spec.js │ │ │ └── table │ │ │ └── tableDemo.spec.js │ │ └── util.js └── dashboard │ ├── .babelrc │ ├── .eslintrc.json │ ├── .gitignore │ ├── README.md │ ├── build.sh │ ├── index.html │ ├── mockup │ └── api │ │ ├── conf │ │ ├── copy.js │ │ ├── get.js │ │ └── update.js │ │ ├── dashboard │ │ ├── create.js │ │ ├── delete.js │ │ ├── get.js │ │ ├── list.js │ │ ├── updateMeta.js │ │ ├── widgetscopy.js │ │ ├── widgetscreate.js │ │ └── widgetsdelete.js │ │ ├── demo │ │ ├── chart │ │ │ ├── column │ │ │ │ └── get.js │ │ │ ├── line │ │ │ │ └── get.js │ │ │ ├── pie │ │ │ │ └── get.js │ │ │ └── trend │ │ │ │ └── get.js │ │ ├── form │ │ │ ├── default.js │ │ │ └── submit.js │ │ └── table │ │ │ ├── delete.js │ │ │ ├── filter │ │ │ ├── delete.js │ │ │ └── get.js │ │ │ └── get.js │ │ ├── get │ │ ├── billboard.js │ │ ├── eventRiver.js │ │ ├── mdcircle.js │ │ ├── report.js │ │ └── trend.js │ │ └── user.js │ ├── package.json │ ├── scripts │ ├── build.js │ ├── config.js │ ├── dev-client.js │ ├── dev-server.js │ ├── openBrowser.js │ ├── openChrome.applescript │ ├── webpack.base.conf.js │ ├── webpack.dev.conf.js │ ├── webpack.prod.conf.js │ └── webpack.test.conf.js │ ├── src │ ├── common │ │ ├── assets │ │ │ ├── css │ │ │ │ ├── global.less │ │ │ │ ├── header.less │ │ │ │ ├── loading.less │ │ │ │ ├── main.less │ │ │ │ └── theme │ │ │ │ │ ├── components │ │ │ │ │ ├── button.less │ │ │ │ │ ├── checkbox.less │ │ │ │ │ ├── index.less │ │ │ │ │ ├── input.less │ │ │ │ │ ├── modal.less │ │ │ │ │ ├── page.less │ │ │ │ │ ├── radio.less │ │ │ │ │ ├── select.less │ │ │ │ │ ├── switch.less │ │ │ │ │ ├── table.less │ │ │ │ │ ├── tabs.less │ │ │ │ │ ├── toast.less │ │ │ │ │ └── tooltip.less │ │ │ │ │ ├── custom.less │ │ │ │ │ └── my-theme.less │ │ │ └── img │ │ │ │ ├── dashboard │ │ │ │ ├── trend │ │ │ │ │ ├── chartarea.png │ │ │ │ │ ├── chartcolumn.png │ │ │ │ │ ├── chartline.png │ │ │ │ │ ├── chartnormal.png │ │ │ │ │ └── chartstack.png │ │ │ │ └── widget │ │ │ │ │ ├── billboard.png │ │ │ │ │ ├── eventriver.png │ │ │ │ │ ├── mdcircle.png │ │ │ │ │ ├── mdtable.png │ │ │ │ │ └── mdtrend.png │ │ │ │ ├── favicon.ico │ │ │ │ └── logo.png │ │ ├── config.js │ │ ├── dashboard │ │ │ └── widgetConfig.js │ │ ├── devProxy.js │ │ ├── header.js │ │ ├── hook │ │ │ └── ajax.js │ │ ├── layout │ │ │ ├── 404.vue │ │ │ ├── footer.vue │ │ │ └── layout.vue │ │ └── router.js │ ├── demo │ │ ├── chart │ │ │ ├── chartDemo.vue │ │ │ └── trend.vue │ │ ├── form │ │ │ └── formDemo.vue │ │ └── table │ │ │ ├── filterTableDemo.vue │ │ │ └── tableDemo.vue │ ├── main.js │ ├── store │ │ ├── index.js │ │ ├── modules │ │ │ └── dashboard.js │ │ └── mutation-types.js │ ├── tools │ │ └── utils.js │ └── view │ │ └── dashboard │ │ ├── api │ │ ├── config.js │ │ └── widget.js │ │ ├── assets │ │ ├── css │ │ │ └── style.less │ │ └── img │ │ │ ├── add.png │ │ │ ├── auto-color.png │ │ │ ├── minus.png │ │ │ └── widget-preview.png │ │ ├── edit.vue │ │ ├── list.vue │ │ ├── util │ │ └── util.js │ │ ├── view.vue │ │ └── widget │ │ ├── billboard │ │ └── billboard.vue │ │ ├── common │ │ ├── colorPicker.vue │ │ ├── defaultDatasource.vue │ │ ├── defaultLink.vue │ │ └── defaultTime.vue │ │ ├── configuration.vue │ │ ├── edit.vue │ │ ├── eventRiver │ │ └── eventRiver.vue │ │ ├── mdcircle │ │ └── mdcircle.vue │ │ ├── mdreport │ │ ├── column-model.vue │ │ ├── column-origin.vue │ │ ├── mdreport.vue │ │ ├── origin-model.vue │ │ ├── search-group.vue │ │ ├── threshold.vue │ │ └── time.vue │ │ ├── mdtrend │ │ └── mdtrend.vue │ │ └── widget.vue │ └── test │ └── unit │ ├── index.js │ ├── karma.conf.js │ ├── specs │ └── demo │ │ ├── chart │ │ └── trend.spec.js │ │ └── table │ │ └── tableDemo.spec.js │ └── util.js ├── tools └── noahv-cli │ ├── .editorconfig │ ├── .eslintrc.json │ ├── .gitignore │ ├── README.md │ ├── bin │ ├── noahv │ ├── noahv-create │ ├── noahv-init │ ├── noahv-start │ ├── noahv-test │ ├── noahv-update │ └── noahv-upgrade │ ├── lib │ ├── check-version.js │ ├── create.js │ ├── getGitTemplate.js │ ├── init.js │ ├── installModules.js │ ├── logUtil.js │ ├── start.js │ ├── test.js │ ├── update.js │ └── upgrade.js │ ├── package-lock.json │ ├── package.json │ ├── scripts │ ├── build.sh │ └── publish.js │ └── template │ ├── createApi │ ├── fail.js │ ├── list.js │ └── ok.js │ ├── createTest │ └── spec.js │ └── createTpl │ ├── action.vue │ ├── chart.vue │ ├── filterList.vue │ ├── form.vue │ └── list.vue └── travis.sh /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 4 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | scripts/ 3 | template/ 4 | doc/ 5 | test/ 6 | tools/noahv-cli/lib 7 | packages/noahv-mockup 8 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.vue linguist-language=javaScript -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: node_js 3 | os: 4 | - linux 5 | - osx 6 | - windows 7 | 8 | node_js: 9 | - '10' 10 | cache: npm 11 | 12 | jobs: 13 | include: 14 | - stage: test 15 | if: (commit_message !~ /(docs|chore)/) 16 | script: bash travis.sh 17 | - stage: deploy 18 | if: (branch = master) AND (commit_message =~ /(docs)/) 19 | script: cd doc && bash release.sh 20 | deploy: 21 | provider: pages 22 | skip_cleanup: true 23 | github_token: $GITHUB_TOKEN 24 | keep_history: true 25 | local_dir: doc/noahv 26 | notifications: 27 | email: 28 | on_success: never 29 | on_failure: always -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## ChangeLog 2 | -------------------------------------------------------------------------------- /components/common/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["env", "stage-2"], 3 | "plugins": ["transform-runtime", "transform-vue-jsx"], 4 | "comments": false, 5 | "env": { 6 | "test": { 7 | "plugins": [ "istanbul" ] 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /components/common/.editorconfig: -------------------------------------------------------------------------------- 1 | # This file is for unifying the coding style for different editors and IDEs 2 | # editorconfig.org 3 | 4 | # top-most EditorConfig file 5 | root = true 6 | 7 | # every file 8 | [*] 9 | charset = utf-8 10 | end_of_line = lf 11 | indent_size = 4 12 | indent_style = space 13 | insert_final_newline = true 14 | trim_trailing_whitespace = true 15 | 16 | # 4 space indentation 17 | [*.py] 18 | indent_size = 4 19 | 20 | # Tab indentation (no size specified) 21 | [Makefile] 22 | indent_style = tab 23 | 24 | [*.md] 25 | trim_trailing_whitespace = false -------------------------------------------------------------------------------- /components/common/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | .DS_Store 3 | npm-debug.log 4 | package-lock.json 5 | test/unit/coverage 6 | -------------------------------------------------------------------------------- /components/common/README.md: -------------------------------------------------------------------------------- 1 | ## 简介 2 | 3 | NoahV组件库: 4 | 5 | * 表单 6 | * 表格 7 | * 带筛选功能表格 8 | * 404 9 | * toggle切换组件 10 | * 弹出框组件 11 | * 自定义功能按钮组件 12 | * 时间对比趋势图组件 13 | * 平铺/流程列表组件 14 | 15 | * icon 16 | * 输入框 17 | * 文本框 18 | * 树组件 19 | * 时间日历组件 20 | * 通用图表组件 21 | * 通用趋势图组件 22 | -------------------------------------------------------------------------------- /components/common/build/webpack.test.config.js: -------------------------------------------------------------------------------- 1 | const webpack = require('webpack'); 2 | const merge = require('webpack-merge'); 3 | const utils = require('./utils'); 4 | const webpackBaseConfig = require('./webpack.base.config.js'); 5 | 6 | 7 | const webpackConfig = merge(webpackBaseConfig, { 8 | mode: 'development', 9 | stats: { 10 | depth: false, 11 | entrypoints: false, 12 | children: false 13 | }, 14 | module: { 15 | rules: utils.styleLoaders({ 16 | sourceMap: true, 17 | extract: true 18 | }) 19 | }, 20 | devtool: 'eval-source-map' 21 | }); 22 | 23 | // no need for app entry during tests 24 | delete webpackConfig.entry; 25 | 26 | module.exports = webpackConfig; 27 | -------------------------------------------------------------------------------- /components/common/demo/components/404/404.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 18 | -------------------------------------------------------------------------------- /components/common/demo/components/checkbox/checkbox.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /components/common/demo/components/pipline/pipline.less: -------------------------------------------------------------------------------- 1 | .pipline-wrapper { 2 | .card-body { 3 | padding: 0 5px; 4 | font-size: 12px; 5 | p { 6 | padding-left: 10px; 7 | } 8 | p:not(last-child){ 9 | margin-bottom: 10px; 10 | } 11 | p label { 12 | width: 75px; 13 | display: inline-block; 14 | } 15 | p .ivu-input-wrapper { 16 | width: 185px; 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /components/common/demo/components/scrolltab/scrolltab.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 24 | 25 | 28 | -------------------------------------------------------------------------------- /components/common/demo/components/transfer/transfer.less: -------------------------------------------------------------------------------- 1 | .transfer-wrapper { 2 | .noahv-transfer { 3 | .noahv-pool { 4 | .noahv-tree .node-wrapper .panel ul { 5 | margin-bottom: 5px; 6 | } 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /components/common/demo/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NoahV components demo 6 | 7 | 8 |
9 | 10 | 11 | -------------------------------------------------------------------------------- /components/common/demo/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import VueRouter from 'vue-router'; 3 | import App from './app.vue'; 4 | import noahvRequest from 'noahv-request'; 5 | import iView from 'iview'; 6 | import 'iview/dist/styles/iview.css'; 7 | import NoahV from '../src/index'; 8 | import routerConfig from './router'; 9 | import '../src/assets/css/index.less'; 10 | 11 | Vue.use(VueRouter); 12 | Vue.use(iView); 13 | Vue.use(noahvRequest); 14 | Vue.use(NoahV); 15 | 16 | // 开启debug模式 17 | Vue.config.debug = true; 18 | 19 | // 路由配置 20 | const router = new VueRouter({ 21 | routes: routerConfig 22 | }); 23 | 24 | /* eslint-disable*/ 25 | let app = new Vue({ 26 | el: '#app', 27 | router: router, 28 | render: h => h(App) 29 | }); 30 | -------------------------------------------------------------------------------- /components/common/src/assets/css/components/404.less: -------------------------------------------------------------------------------- 1 | .@{noahvPrefixCls}-not-found { 2 | .title { 3 | text-align: center; 4 | margin-top: 110px; 5 | font-size: 80px; 6 | color: @noahv-not-found-color; 7 | font-weight: bold; 8 | letter-spacing: 10px; 9 | } 10 | .text { 11 | text-align: center; 12 | color: @noahv-not-found-color; 13 | font-size: 16px; 14 | } 15 | .back-to { 16 | text-align: center; 17 | margin-top: 20px; 18 | a { 19 | width: 100px; 20 | height: 30px; 21 | border: 1px solid @noahv-not-found-color; 22 | color: @noahv-not-found-color; 23 | display: inline-block; 24 | text-align: center; 25 | line-height: 30px; 26 | font-size: 14px; 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /components/common/src/assets/css/components/chart.less: -------------------------------------------------------------------------------- 1 | .@{noahvPrefixCls}-chart { 2 | border: 1px solid #ccc; 3 | padding: 10px; 4 | margin-bottom: 20px; 5 | } -------------------------------------------------------------------------------- /components/common/src/assets/css/components/echarts.less: -------------------------------------------------------------------------------- 1 | .@{noahvPrefixCls}-vue-echarts { 2 | min-height: 300px; 3 | } -------------------------------------------------------------------------------- /components/common/src/assets/css/components/ellipsis.less: -------------------------------------------------------------------------------- 1 | .nv-ellipsis { 2 | display: inline-block; 3 | max-width: 100%; 4 | white-space: nowrap; 5 | text-overflow: ellipsis; 6 | overflow: hidden; 7 | vertical-align: top; 8 | 9 | .ivu-tooltip { 10 | display: inline-block; 11 | width: inherit; 12 | max-width: 100%; 13 | 14 | .ivu-tooltip-rel { 15 | display: inline-block; 16 | width: inherit; 17 | max-width: 100%; 18 | } 19 | } 20 | } 21 | 22 | .nv-ellipsis-content { 23 | overflow: hidden; 24 | font-weight: bold; 25 | word-break: break-all; 26 | white-space: normal; 27 | 28 | a { 29 | display: block; 30 | color: #3a62ca; 31 | cursor: pointer; 32 | 33 | &:hover { 34 | color: #2d8cf0; 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /components/common/src/assets/css/components/pool.less: -------------------------------------------------------------------------------- 1 | .@{noahvPrefixCls}-pool { 2 | width: 250px; 3 | height: 400px; 4 | border: 1px solid #EEE; 5 | .header { 6 | width: 100%; 7 | .meta { 8 | height: 38px; 9 | line-height: 38px; 10 | padding: 0 10px 0 27px; 11 | position: relative; 12 | } 13 | border-bottom: 1px solid #eee; 14 | } 15 | .body { 16 | width: 100%; 17 | overflow: auto; 18 | padding: 0 5px 5px 5px; 19 | } 20 | .backup { 21 | width: 100%; 22 | overflow: hidden; 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /components/common/src/assets/css/components/table.less: -------------------------------------------------------------------------------- 1 | .@{noahvPrefixCls}-table { 2 | .tabletpl-header { 3 | padding: 0 18px; 4 | font-size: 16px; 5 | color: #000; 6 | } 7 | .tabletpl-footer { 8 | background: #f7f7f7; 9 | border-radius: 0 0 4px 4px; 10 | padding: 0 18px; 11 | } 12 | .highlight-error { 13 | color: #f00; 14 | } 15 | } -------------------------------------------------------------------------------- /components/common/src/assets/css/components/textLine.less: -------------------------------------------------------------------------------- 1 | // dependence theme styles 2 | @import '~codemirror/lib/codemirror.css'; 3 | @import '~codemirror/theme/base16-dark.css'; 4 | @import '~codemirror/theme/monokai.css'; 5 | @import '~codemirror/theme/paraiso-light.css'; 6 | @import '~codemirror/theme/ambiance.css'; 7 | @import '~codemirror/theme/cobalt.css'; 8 | @import '~codemirror/theme/base16-light.css'; 9 | @import '~codemirror/theme/mbo.css'; 10 | @import '~codemirror/theme/solarized.css'; 11 | @import '~codemirror/theme/lesser-dark.css'; 12 | 13 | .@{noahvPrefixCls}-text-line-wrapper { 14 | font-size: @noahv-font-size; 15 | border: 1px solid @noahv-textline-border-color; 16 | border-radius: 2px; 17 | .codemirror-placeholder { 18 | color: #bbb8b8; 19 | } 20 | } -------------------------------------------------------------------------------- /components/common/src/assets/css/components/transfer.less: -------------------------------------------------------------------------------- 1 | .@{noahvPrefixCls}-transfer { 2 | .left, .right, .arrow { 3 | display: inline-block; 4 | vertical-align: middle; 5 | } 6 | .arrow { 7 | margin: 0 15px; 8 | .arrow-btn { 9 | display: block; 10 | } 11 | .arrow-btn:nth-child(1) { 12 | margin-bottom: 15px; 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /components/common/src/assets/fonts/nv-iconfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/NoahV/ce78751eeb220e2e58094e9e85627e241ef05f33/components/common/src/assets/fonts/nv-iconfont.eot -------------------------------------------------------------------------------- /components/common/src/assets/fonts/nv-iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/NoahV/ce78751eeb220e2e58094e9e85627e241ef05f33/components/common/src/assets/fonts/nv-iconfont.ttf -------------------------------------------------------------------------------- /components/common/src/assets/fonts/nv-iconfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/NoahV/ce78751eeb220e2e58094e9e85627e241ef05f33/components/common/src/assets/fonts/nv-iconfont.woff -------------------------------------------------------------------------------- /components/common/src/assets/img/nv-steps/finished.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/NoahV/ce78751eeb220e2e58094e9e85627e241ef05f33/components/common/src/assets/img/nv-steps/finished.png -------------------------------------------------------------------------------- /components/common/src/assets/img/nv-steps/running-inner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/NoahV/ce78751eeb220e2e58094e9e85627e241ef05f33/components/common/src/assets/img/nv-steps/running-inner.png -------------------------------------------------------------------------------- /components/common/src/assets/img/nv-steps/running-outer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/NoahV/ce78751eeb220e2e58094e9e85627e241ef05f33/components/common/src/assets/img/nv-steps/running-outer.png -------------------------------------------------------------------------------- /components/common/src/components/eventBus.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file eventBus 3 | * @author Joannamo(joannamo123@163.com) 4 | */ 5 | 6 | import Vue from 'vue'; 7 | export const eventBus = new Vue(); 8 | -------------------------------------------------------------------------------- /components/common/src/components/nv-404/404.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 35 | 36 | -------------------------------------------------------------------------------- /components/common/src/components/nv-404/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * NoahV 3 | * Copyright (c) 2016 Baidu, Inc. All Rights Reserved. 4 | * 5 | * @file Nv404 Component 6 | * @author darren(darrenywyu@gmail.com) 7 | */ 8 | 9 | import Nv404 from './404.vue'; 10 | export default Nv404; 11 | -------------------------------------------------------------------------------- /components/common/src/components/nv-button/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * NoahV 3 | * Copyright (c) 2016 Baidu, Inc. All Rights Reserved. 4 | * 5 | * @file NvButtonTpl Component 6 | * @author Joannamo(joannamo123@163.com) 7 | */ 8 | 9 | import NvButtonTpl from './buttonTpl.vue'; 10 | 11 | export { 12 | NvButtonTpl 13 | }; 14 | 15 | export default NvButtonTpl; 16 | -------------------------------------------------------------------------------- /components/common/src/components/nv-cascaderSelect/cascaderSelect.js: -------------------------------------------------------------------------------- 1 | /** 2 | * NoahV 3 | * Copyright (c) 2019 Baidu, Inc. All Rights Reserved. 4 | * 5 | * @file NvCascaderSelect Component ClickOutSide Directive File 6 | * @author nimingdexiaohai(nimingdexiaohai@163.com) 7 | */ 8 | export default { 9 | bind (el, binding, vnode) { 10 | function documentHandler (e) { 11 | if (el.contains(e.target)) { 12 | return false; 13 | } 14 | if (binding.expression) { 15 | binding.value(e); 16 | } 17 | } 18 | el.__vueClickOutside__ = documentHandler; 19 | document.addEventListener('click', documentHandler); 20 | }, 21 | unbind (el, binding) { 22 | document.removeEventListener('click', el.__vueClickOutside__); 23 | delete el.__vueClickOutside__; 24 | } 25 | }; -------------------------------------------------------------------------------- /components/common/src/components/nv-cascaderSelect/casitem.vue: -------------------------------------------------------------------------------- 1 | 7 | 21 | -------------------------------------------------------------------------------- /components/common/src/components/nv-cascaderSelect/caspanel.vue: -------------------------------------------------------------------------------- 1 | 13 | 40 | -------------------------------------------------------------------------------- /components/common/src/components/nv-cascaderSelect/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * NoahV 3 | * Copyright (c) 2019 Baidu, Inc. All Rights Reserved. 4 | * 5 | * @file NvCascaderSelect Component 6 | * @author nimingdexiaohai(nimingdexiaohai@163.com) 7 | */ 8 | 9 | import NvCascaderSelect from './cascaderSelect.vue'; 10 | 11 | export { 12 | NvCascaderSelect 13 | }; 14 | 15 | export default NvCascaderSelect; 16 | -------------------------------------------------------------------------------- /components/common/src/components/nv-chart/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * NoahV 3 | * Copyright (c) 2016 Baidu, Inc. All Rights Reserved. 4 | * 5 | * @file NvChart/NvTrend/NvContrastTrend Component 6 | * @author Joannamo(joannamo123@163.com) 7 | * darren(darrenywyu@gmail.com) 8 | */ 9 | 10 | import NvChart from './chart'; 11 | import NvTrend from './trend'; 12 | import SaChart from './chart'; 13 | import SaTrend from './trend'; 14 | import NvContrastTrend from './contrastTrend'; 15 | 16 | export { 17 | NvChart, 18 | NvTrend, 19 | SaChart, 20 | SaTrend 21 | }; 22 | export default NvContrastTrend; 23 | -------------------------------------------------------------------------------- /components/common/src/components/nv-checkbox/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * NoahV 3 | * Copyright (c) 2016 Baidu, Inc. All Rights Reserved. 4 | * 5 | * @file NvCheckbox Component 6 | * @author nimingdexiaohai(nimingdexiaohai@163.com) 7 | */ 8 | 9 | import NvCheckbox from './checkbox.vue'; 10 | 11 | export { 12 | NvCheckbox 13 | }; 14 | 15 | export default NvCheckbox; 16 | 17 | -------------------------------------------------------------------------------- /components/common/src/components/nv-datepicker/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * NoahV 3 | * Copyright (c) 2016 Baidu, Inc. All Rights Reserved. 4 | * 5 | * @file NvDatePicker Component 6 | * @author nimingdexiaohai(nimingdexiaohai@163.com) 7 | */ 8 | 9 | import NvDatePicker from './datePicker.vue'; 10 | 11 | export { 12 | NvDatePicker 13 | }; 14 | 15 | export default NvDatePicker; 16 | 17 | -------------------------------------------------------------------------------- /components/common/src/components/nv-dialog/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * NoahV 3 | * Copyright (c) 2016 Baidu, Inc. All Rights Reserved. 4 | * 5 | * @file NvDialog Component 6 | * @author Joannamo(joannamo123@163.com) 7 | */ 8 | 9 | import NvDialog from './dialogTpl.vue'; 10 | 11 | export { 12 | NvDialog 13 | }; 14 | 15 | export default NvDialog; 16 | -------------------------------------------------------------------------------- /components/common/src/components/nv-dutytable/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * NoahV 3 | * Copyright (c) 2016 Baidu, Inc. All Rights Reserved. 4 | * 5 | * @file NvDutyTable 6 | * @author tanrich@foxmail.com 7 | */ 8 | 9 | import NvDutyTable from './dutyTable.vue'; 10 | 11 | export { 12 | NvDutyTable 13 | }; 14 | 15 | export default NvDutyTable; 16 | -------------------------------------------------------------------------------- /components/common/src/components/nv-ellipsis/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * NoahV 3 | * Copyright (c) 2016 Baidu, Inc. All Rights Reserved. 4 | * 5 | * @file NvEllipsis Component 6 | * @author tanrich@foxmail.com 7 | */ 8 | 9 | import NvEllipsis from './ellipsis'; 10 | 11 | export default NvEllipsis; 12 | -------------------------------------------------------------------------------- /components/common/src/components/nv-filtertable/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * NoahV 3 | * Copyright (c) 2016 Baidu, Inc. All Rights Reserved. 4 | * 5 | * @file NvFilterTable Component 6 | * @author darren(darrenywyu@gmail.com) 7 | */ 8 | 9 | import NvFilterTable from './filtertable'; 10 | export default NvFilterTable; 11 | -------------------------------------------------------------------------------- /components/common/src/components/nv-form/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * NoahV 3 | * Copyright (c) 2016 Baidu, Inc. All Rights Reserved. 4 | * 5 | * @file NvForm Component 6 | * @author darren(darrenywyu@gmail.com) 7 | */ 8 | 9 | import NvForm from './form'; 10 | export default NvForm; 11 | -------------------------------------------------------------------------------- /components/common/src/components/nv-icon/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * NoahV 3 | * Copyright (c) 2016 Baidu, Inc. All Rights Reserved. 4 | * 5 | * @file NvIcon Component 6 | * @author Joannamo(joannamo123@163.com) 7 | * cy(cuiy245@gmail.com) 8 | */ 9 | 10 | import NvIcon from './icon.vue'; 11 | export default NvIcon; 12 | -------------------------------------------------------------------------------- /components/common/src/components/nv-input/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * NoahV 3 | * Copyright (c) 2016 Baidu, Inc. All Rights Reserved. 4 | * 5 | * @file NvInput Component 6 | * @author darren(darrenywyu@gmail.com) 7 | */ 8 | 9 | import NvInput from './input'; 10 | export default NvInput; 11 | -------------------------------------------------------------------------------- /components/common/src/components/nv-list/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * NoahV 3 | * Copyright (c) 2016 Baidu, Inc. All Rights Reserved. 4 | * 5 | * @file NvList Component 6 | * @author seven(1754417991@qq.com) 7 | */ 8 | 9 | import NvList from './list.vue'; 10 | export default NvList; 11 | -------------------------------------------------------------------------------- /components/common/src/components/nv-multiSelect/index.js: -------------------------------------------------------------------------------- 1 | import NvMultiSelect from './multiSelect.vue'; 2 | export default NvMultiSelect; 3 | -------------------------------------------------------------------------------- /components/common/src/components/nv-pipline/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * NoahV 3 | * Copyright (c) 2019 Baidu, Inc. All Rights Reserved. 4 | * 5 | * @file NvPipline Component 6 | * @author nimingdexiaohai(nimingdexiaohai@163.com) 7 | */ 8 | 9 | import NvPipline from './pipline.vue'; 10 | export default NvPipline; 11 | -------------------------------------------------------------------------------- /components/common/src/components/nv-scrolltab/index.js: -------------------------------------------------------------------------------- 1 | import NvScrollTab from './scrolltab.vue'; 2 | 3 | export { 4 | NvScrollTab 5 | }; 6 | 7 | export default NvScrollTab; 8 | -------------------------------------------------------------------------------- /components/common/src/components/nv-search/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * NoahV 3 | * Copyright (c) 2016 Baidu, Inc. All Rights Reserved. 4 | * 5 | * @file NvSearch Component 6 | * @author nimingdexiaohai(nimingdexiaohai@163.com) 7 | */ 8 | 9 | import NvSearch from './search.vue'; 10 | export default NvSearch; 11 | -------------------------------------------------------------------------------- /components/common/src/components/nv-steps/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * NoahV 3 | * Copyright (c) 2016 Baidu, Inc. All Rights Reserved. 4 | * 5 | * @file NvSteps Component 6 | * @author nimingdexiaohai(nimingdexiaohai@163.com) 7 | */ 8 | 9 | import NvSteps from './steps.vue'; 10 | 11 | export { 12 | NvSteps 13 | }; 14 | 15 | export default NvSteps; 16 | -------------------------------------------------------------------------------- /components/common/src/components/nv-switch/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * NoahV 3 | * Copyright (c) 2016 Baidu, Inc. All Rights Reserved. 4 | * 5 | * @file NvSwitch Component 6 | * @author Joannamo(joannamo123@163.com) 7 | */ 8 | 9 | import NvSwitch from './switchTpl.vue'; 10 | 11 | export { 12 | NvSwitch 13 | }; 14 | 15 | export default NvSwitch; 16 | -------------------------------------------------------------------------------- /components/common/src/components/nv-table/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * NoahV 3 | * Copyright (c) 2016 Baidu, Inc. All Rights Reserved. 4 | * 5 | * @file NvTable Component 6 | * @author darren(darrenywyu@gmail.com) 7 | */ 8 | 9 | import NvTable from './table'; 10 | export default NvTable; 11 | -------------------------------------------------------------------------------- /components/common/src/components/nv-tag/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * NoahV 3 | * Copyright (c) 2016 Baidu, Inc. All Rights Reserved. 4 | * 5 | * @file NvTag Components 6 | * @author nimingdexiaohai(nimingdexiaohai@163.com) 7 | */ 8 | 9 | import NvTag from './tag.vue'; 10 | 11 | export { 12 | NvTag 13 | }; 14 | 15 | export default NvTag; 16 | -------------------------------------------------------------------------------- /components/common/src/components/nv-textArea/index.js: -------------------------------------------------------------------------------- 1 | 2 | import NvTextArea from './textArea.vue'; 3 | 4 | export { 5 | NvTextArea 6 | }; 7 | 8 | export default NvTextArea; 9 | -------------------------------------------------------------------------------- /components/common/src/components/nv-textline/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * NoahV 3 | * Copyright (c) 2016 Baidu, Inc. All Rights Reserved. 4 | * 5 | * @file NvTextLine Component 6 | * @author nimingdexiaohai(nimingdexiaohai@163.com) 7 | */ 8 | 9 | import NvTextLine from './textLine.vue'; 10 | 11 | export { 12 | NvTextLine 13 | }; 14 | 15 | export default NvTextLine; 16 | 17 | -------------------------------------------------------------------------------- /components/common/src/components/nv-transfer/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * NoahV 3 | * Copyright (c) 2019 Baidu, Inc. All Rights Reserved. 4 | * 5 | * @file NvTransfer Component 6 | * @author nimingdexiaohai(nimingdexiaohai@163.com) 7 | */ 8 | 9 | import NvTransfer from './transfer.vue'; 10 | export default NvTransfer; 11 | -------------------------------------------------------------------------------- /components/common/src/components/nv-tree/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * NoahV 3 | * Copyright (c) 2016 Baidu, Inc. All Rights Reserved. 4 | * 5 | * @file NvTree Component 6 | * @author nimingdexiaohai(nimingdexiaohai@163.com) 7 | */ 8 | 9 | import NvTree from './tree.vue'; 10 | 11 | export { 12 | NvTree 13 | }; 14 | 15 | export default NvTree; 16 | 17 | -------------------------------------------------------------------------------- /components/common/src/mixins/index.js: -------------------------------------------------------------------------------- 1 | import { t } from '../locale'; 2 | import getClassName from '../util'; 3 | 4 | export default { 5 | methods: { 6 | t(...args) { 7 | return t.apply(this, args); 8 | }, 9 | /** 10 | * 获取类名 11 | * 12 | * @param {String} postfix 后缀名称 13 | * @return {Object} 样式集合 14 | */ 15 | getCls(path) { 16 | return getClassName.getComponentWrapperCls(path); 17 | } 18 | } 19 | }; -------------------------------------------------------------------------------- /components/common/test/unit/index.js: -------------------------------------------------------------------------------- 1 | // require all test files (files that ends with .spec.js) 2 | const testsContext = require.context('./specs/', true, /\.spec$/); 3 | testsContext.keys().forEach(testsContext); 4 | -------------------------------------------------------------------------------- /components/common/test/unit/specs/nvButton.spec.js: -------------------------------------------------------------------------------- 1 | import { createVue, destroyVM, createTest } from '../util'; 2 | import NvButton from '../../../src/components/nv-button'; 3 | 4 | describe('button.vue', () => { 5 | let vm; 6 | afterEach(() => { 7 | destroyVM(vm); 8 | }); 9 | it('should have correct default data', done => { 10 | vm = createTest(NvButton, { 11 | }, true); 12 | vm.$nextTick(() => { 13 | expect(vm.content).to.eql('button'); 14 | expect(vm.type).to.eql('ghost'); 15 | expect(vm.disabled).to.eql(false); 16 | done(); 17 | }); 18 | }); 19 | it('test getConfig', done => { 20 | vm = createTest(NvButton, { 21 | action: {} 22 | }, true); 23 | vm.$nextTick(() => { 24 | expect(vm.getConfig().url).to.eql(''); 25 | expect(vm.getConfig().method).to.eql('get'); 26 | done(); 27 | }); 28 | }); 29 | }); -------------------------------------------------------------------------------- /components/common/test/unit/specs/nvChart.spec.js: -------------------------------------------------------------------------------- 1 | import { createVue, destroyVM, createTest } from '../util'; 2 | import { NvChart } from '../../../src/components/nv-chart/'; 3 | 4 | describe('chart.vue', () => { 5 | let vm; 6 | afterEach(() => { 7 | destroyVM(vm); 8 | }); 9 | it('should create a form component rightly', done => { 10 | 11 | vm = createTest(NvChart, { 12 | url: '/api/chart/column', 13 | title: 'chart' 14 | }, true); 15 | vm.$nextTick(() => { 16 | const vm404 = vm.$el; 17 | expect(vm404).is.be.to.exist; 18 | expect(vm.title).to.be.equal('chart'); 19 | done(); 20 | }); 21 | }); 22 | it('should have instance name', done => { 23 | vm = createTest(NvChart, { 24 | url: '/api/chart/column', 25 | title: 'chart' 26 | }, true); 27 | vm.$nextTick(() => { 28 | expect(vm.getInstance()).is.be.to.exist; 29 | done(); 30 | }); 31 | }); 32 | }); -------------------------------------------------------------------------------- /components/common/test/unit/specs/nvContrastTrend.spec.js: -------------------------------------------------------------------------------- 1 | import { createVue, destroyVM, createTest } from '../util'; 2 | import nvContrastTrend from '../../../src/components/nv-chart/'; 3 | 4 | describe('contrastTrend.vue', () => { 5 | let vm; 6 | afterEach(() => { 7 | destroyVM(vm); 8 | }); 9 | it('should create a form component rightly', done => { 10 | 11 | vm = createTest(nvContrastTrend, { 12 | url: '/api/chart/column', 13 | title: 'chart' 14 | }, true); 15 | vm.$nextTick(() => { 16 | const vm404 = vm.$el; 17 | expect(vm404).is.be.to.exist; 18 | expect(vm.title).to.be.equal('chart'); 19 | expect(vm.trendItems).to.eql([]); 20 | expect(vm.nameList).to.eql([]); 21 | done(); 22 | }); 23 | }); 24 | }); -------------------------------------------------------------------------------- /components/common/test/unit/specs/nvDialog.spec.js: -------------------------------------------------------------------------------- 1 | import { createVue, destroyVM, createTest } from '../util'; 2 | import NvDialog from '../../../src/components/nv-dialog'; 3 | 4 | describe('button.vue', () => { 5 | let vm; 6 | afterEach(() => { 7 | destroyVM(vm); 8 | }); 9 | it('should have correct default data', done => { 10 | vm = createTest(NvDialog, { 11 | dialog: {} 12 | }, true); 13 | vm.$nextTick(() => { 14 | expect(vm.dialogWidth).to.eql(520); 15 | done(); 16 | }); 17 | }); 18 | it('test getAjaxConfig', done => { 19 | vm = createTest(NvDialog, { 20 | dialog: { 21 | ok: {} 22 | } 23 | }, true); 24 | vm.$nextTick(() => { 25 | expect(vm.getAjaxConfig().url).to.eql(''); 26 | expect(vm.getAjaxConfig().method).to.eql('get'); 27 | done(); 28 | }); 29 | }); 30 | }); -------------------------------------------------------------------------------- /components/common/test/unit/specs/nvList.spec.js: -------------------------------------------------------------------------------- 1 | import { createVue, destroyVM, createTest } from '../util'; 2 | import NvList from '../../../src/components/nv-list'; 3 | 4 | describe('list.vue', () => { 5 | let vm; 6 | afterEach(() => { 7 | destroyVM(vm); 8 | }); 9 | it('should have correct default data', done => { 10 | vm = createTest(NvList, { 11 | action: {}, 12 | data: [] 13 | }, true); 14 | vm.$nextTick(() => { 15 | expect(vm.list).to.eql([]); 16 | done(); 17 | }); 18 | }); 19 | it('test setList', done => { 20 | vm = createTest(NvList, { 21 | action: {}, 22 | data: [], 23 | templates: {} 24 | }, true); 25 | vm.$nextTick(() => { 26 | vm.setList('test', true) 27 | expect(vm.list).to.eql([{}]); 28 | vm.setList('test', false) 29 | // expect(vm.list).to.eql(['test']); 30 | done(); 31 | }); 32 | }); 33 | }); -------------------------------------------------------------------------------- /components/common/test/unit/specs/nvTrend.spec.js: -------------------------------------------------------------------------------- 1 | import { createVue, destroyVM, createTest } from '../util'; 2 | import { NvTrend } from '../../../src/components/nv-chart/'; 3 | 4 | describe('trend.vue', () => { 5 | let vm; 6 | afterEach(() => { 7 | destroyVM(vm); 8 | }); 9 | it('should create a form component rightly', done => { 10 | 11 | vm = createTest(NvTrend, { 12 | url: '/api/chart/column', 13 | title: 'chart' 14 | }, true); 15 | vm.$nextTick(() => { 16 | const vm404 = vm.$el; 17 | expect(vm404).is.be.to.exist; 18 | expect(vm.title).to.be.equal('chart'); 19 | done(); 20 | }); 21 | }); 22 | it('should have instance name', done => { 23 | vm = createTest(NvTrend, { 24 | url: '/api/chart/column', 25 | title: 'chart' 26 | }, true); 27 | vm.$nextTick(() => { 28 | expect(vm.getInstance()).is.be.to.exist; 29 | done(); 30 | }); 31 | }); 32 | }); -------------------------------------------------------------------------------- /components/visual/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["env", "stage-2"], 3 | "plugins": ["transform-runtime", "transform-vue-jsx"], 4 | "comments": false, 5 | "env": { 6 | "test": { 7 | "plugins": [ "istanbul" ] 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /components/visual/.gitignore: -------------------------------------------------------------------------------- 1 | output 2 | .svn 3 | .DS_Store 4 | node_modules/ 5 | dist/ 6 | saas 7 | package-lock.json 8 | .idea 9 | test/unit/coverage/ -------------------------------------------------------------------------------- /components/visual/README.md: -------------------------------------------------------------------------------- 1 | # noahv-visual-components 2 | 3 | NoahV可视化组件库 4 | 可以提供统一的数据可视化展示方案,主要包括: 5 | 6 | * 趋势图 7 | * 报表 8 | * 仪表图 9 | * 数据面板 10 | * 事件流图 11 | * 饼图以及柱状图 12 | 13 | 14 | -------------------------------------------------------------------------------- /components/visual/build/webpack.test.config.js: -------------------------------------------------------------------------------- 1 | const webpack = require('webpack'); 2 | const merge = require('webpack-merge'); 3 | const webpackBaseConfig = require('./webpack.base.config.js'); 4 | 5 | 6 | const webpackConfig = merge(webpackBaseConfig, { 7 | devtool: 'eval-source-map', 8 | mode: 'development', 9 | plugins: [ 10 | new webpack.DefinePlugin({ 11 | 'process.env': { 12 | NODE_ENV: '"testing"' 13 | } 14 | }) 15 | ] 16 | }); 17 | 18 | // no need for app entry during tests 19 | delete webpackConfig.entry; 20 | 21 | module.exports = webpackConfig; -------------------------------------------------------------------------------- /components/visual/demo/assets/css/style.less: -------------------------------------------------------------------------------- 1 | .demo-holder { 2 | h1 { 3 | margin: 20px 0; 4 | border-left: 6px solid #eee; 5 | padding-left: 10px; 6 | font-size: 20px; 7 | } 8 | p { 9 | line-height: 30px; 10 | font-size: 14px; 11 | } 12 | .higher-btn { 13 | margin-top: 20px; 14 | } 15 | .code { 16 | background: #f7f7f7; 17 | padding-left: 15px; 18 | margin-bottom: 10px; 19 | border: 1px solid #ededed; 20 | -webkit-border-radius: 2px; 21 | border-radius: 2px; 22 | pre { 23 | margin: 10px 0; 24 | overflow: auto; 25 | } 26 | } 27 | } 28 | .change-time-btn { 29 | margin: 10px 0; 30 | } 31 | .common-box { 32 | margin: 10px 0; 33 | } -------------------------------------------------------------------------------- /components/visual/demo/components/nvmap.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 38 | -------------------------------------------------------------------------------- /components/visual/demo/components/widget.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 27 | 28 | 47 | -------------------------------------------------------------------------------- /components/visual/demo/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SAASV components demo 6 | 7 | 8 |
9 | 10 | 11 | -------------------------------------------------------------------------------- /components/visual/demo/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import VueRouter from 'vue-router'; 3 | import App from './app.vue'; 4 | import iView from 'iview'; 5 | import 'iview/dist/styles/iview.css'; 6 | import NvVisualComponents from '../src/index'; 7 | import '../src/assets/css/index.less'; 8 | import routerConfig from './router'; 9 | import {WidgetConfig} from './service/config/widgetConfig'; 10 | import ApiConf from './service/config/widgetApi'; 11 | // import tongji from './tongji'; 12 | 13 | const visualConfig = Object.assign({}, ApiConf, WidgetConfig); 14 | 15 | 16 | Vue.use(VueRouter); 17 | Vue.use(iView); 18 | Vue.use(NvVisualComponents, visualConfig); 19 | // Vue.use(tongji, {}); 20 | 21 | // 开启debug模式 22 | Vue.config.debug = true; 23 | 24 | // 路由配置 25 | const router = new VueRouter({ 26 | routes: routerConfig 27 | }); 28 | 29 | /* eslint-disable*/ 30 | let app = new Vue({ 31 | el: '#app', 32 | router: router, 33 | render: h => h(App) 34 | }); 35 | -------------------------------------------------------------------------------- /components/visual/demo/service/mock/billboard.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | const Mock = require('mockjs'); 3 | const billboard = function() { 4 | return { 5 | data: { 6 | configure : '{"title":"面板配置path","data":[{"namespace":["forDemoNamespace1"],"metric":"#{metric1}/#{metric2}","statistics":"avg","name":"name3","unit":"%","decimals":4},{"namespace":["forDemoNamespace2"],"metric":"#{metric3}","statistics":"avg","name":"name4","unit":"%","decimals":4}],"link":"http://www.baidu.com","timeType":"relative","time":"before(2h)"}', 7 | title: "面板配置path" 8 | }, 9 | success: true 10 | }; 11 | }; 12 | Mock.mock('/mock/billboard', 'post', billboard); 13 | -------------------------------------------------------------------------------- /components/visual/demo/service/mock/circle.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | const Mock = require('mockjs'); 3 | const circle = function() { 4 | return { 5 | data: { 6 | configure : '{"title":"仪表图配置path","data":[{"namespace":["forDemoNamespace"],"metric":"#{metric1}/#{metric2}","statistics":"avg"}],"style":{"decimals":4,"unit":"%","max":100,"min":0,"threshold":[[90,99,"yellow"],[0,90,"red"],[99,99.99,"green"]]},"link":"http://www.baidu.com","timeType":"fixed","time":"before(2h)"}', 7 | title: "仪表图配置path" 8 | }, 9 | success: true 10 | }; 11 | } 12 | Mock.mock('/mock/circle', 'post', circle); 13 | -------------------------------------------------------------------------------- /components/visual/demo/service/mock/customBox.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | const Mock = require('mockjs'); 3 | const custombox = function() { 4 | return '

嵌入百度首页:

' 5 | } 6 | Mock.mock('/mock/customBox', 'post', custombox); -------------------------------------------------------------------------------- /components/visual/demo/service/mock/customEventsUrl.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/NoahV/ce78751eeb220e2e58094e9e85627e241ef05f33/components/visual/demo/service/mock/customEventsUrl.js -------------------------------------------------------------------------------- /components/visual/demo/service/mock/dataBillboard.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | const Mock = require('mockjs'); 3 | const billboardData = function() { 4 | return { 5 | data: [{ 6 | name: 'name1', 7 | value: 12306, 8 | warning: true 9 | }, 10 | { 11 | name: 'name2', 12 | value: 91 13 | }, { 14 | name: 'name3', 15 | value: 99.99875 16 | }], 17 | success: true 18 | }; 19 | } 20 | Mock.mock('/mock/dataBillboard', 'post', billboardData); -------------------------------------------------------------------------------- /components/visual/demo/service/mock/dataCircle.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | const Mock = require('mockjs'); 3 | const circleData = function() { 4 | return { 5 | success: true, 6 | data: [ 7 | { 8 | name: 'shiyu2_netric', 9 | data: [ 10 | [ 11 | 1539587554000, 12 | 52.50842289082938 13 | ] 14 | ] 15 | } 16 | ], 17 | message: 'ok', 18 | traceInfo: null 19 | }; 20 | } 21 | Mock.mock('/mock/circleData', 'post', circleData); -------------------------------------------------------------------------------- /components/visual/demo/service/mock/dataMap.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | const Mock = require('mockjs'); 3 | const mapData = function() { 4 | return { 5 | success: true, 6 | data: [ 7 | {name:'黑龙江', value: 0, toolTipData: [ 8 | { 9 | name: '可用率', 10 | value: 10, 11 | unit: '%' 12 | }, 13 | { 14 | name: '响应时间', 15 | value: 1000, 16 | unit: 'ms' 17 | } 18 | ]}, 19 | {name:'河北', value: 0.9}, 20 | ], 21 | message: 'ok', 22 | traceInfo: null 23 | }; 24 | } 25 | Mock.mock('/mock/dataMap', 'post', mapData); -------------------------------------------------------------------------------- /components/visual/demo/service/mock/dataMdColumn.js: -------------------------------------------------------------------------------- 1 | const Mock = require('mockjs'); 2 | const column = function() { 3 | return [{ 4 | name: 'login_pv', 5 | data: [{ 6 | "alias": "17年10月22日", 7 | "y": 26090, 8 | "x": 1509206400000 9 | }, { 10 | "alias": "17年10月23日", 11 | "y": 28090, 12 | "x": 1509292800000 13 | }, { 14 | "alias": "17年10月24日", 15 | "y": 29090, 16 | "x": 1509379200000 17 | }] 18 | }]; 19 | } 20 | 21 | Mock.mock('/mock/dataMdColumn', 'post', column); -------------------------------------------------------------------------------- /components/visual/demo/service/mock/dataPie.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | const Mock = require('mockjs'); 3 | 4 | const pie = function() { 5 | return { 6 | success: true, 7 | data: [{ 8 | name: 'Microsoft Internet Explorer', 9 | value: 56.33 10 | }, { 11 | name: 'Chrome', 12 | value: 24.03 13 | }, { 14 | name: 'Firefox', 15 | value: 10.38 16 | }, { 17 | name: 'Safari', 18 | value: 4.77 19 | }, { 20 | name: 'Opera', 21 | value: 0.91 22 | }, { 23 | name: 'Proprietary or Undetectable', 24 | value: 0.2 25 | }] 26 | }; 27 | } 28 | 29 | Mock.mock('/mock/dataPie', 'post', pie); -------------------------------------------------------------------------------- /components/visual/demo/service/mock/dataReport.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | const Mock = require('mockjs'); 3 | 4 | const report = function() { 5 | return { 6 | "data": [{ 7 | "name":"noah_namespace", 8 | "value":"2.case-astream-basic.servicization", 9 | "alias":null, 10 | "metrics":{"alias3":90,"alias2":95, "alias1": null} 11 | }, { 12 | "name":"noah_namespace", 13 | "value":"1.case-astream-basic.servicization", 14 | "alias":null, 15 | "metrics":{"alias3":100,"alias2": 80, "alias1": null} 16 | }], 17 | success: true 18 | }; 19 | } 20 | 21 | Mock.mock('/mock/dataReport', 'post', report); -------------------------------------------------------------------------------- /components/visual/demo/service/mock/eventRiver.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | const Mock = require('mockjs'); 3 | // 获取 mock.Random 对象 4 | const Random = Mock.Random; 5 | // mock一组数据 6 | const produceNewsData = function() { 7 | return { 8 | data: { 9 | "configure": '{"title":"事件流图1","data":{"schema":[{"name":"机房1","type":"NJ01error","checked":true},{"name":"机房二","type":"GZHXYerror","checked":true},{"name":"机房三","type":"GZNSwarning","checked":true},{"name":"机房四","type":"BJYZwarning","checked":true},{"name":"机房五","type":"NJ01warning","checked":true,"eventDetailMap":[{"name":"创造者","key":"product.operator","type":"arr"},{"name":"异常类型","key":"type","type":"text"},{"name":"详情","key":"url","type":"link"}]}]},"timeType":"fixed","time":"before(2h)"}' 10 | }, 11 | success: true 12 | } 13 | }; 14 | 15 | // Mock.mock( url, post/get , 返回的数据); 16 | Mock.mock('/mock/eventRiver', 'post', produceNewsData); 17 | -------------------------------------------------------------------------------- /components/visual/demo/service/mock/mdtrend.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | const Mock = require('mockjs'); 3 | 4 | const trend = function() { 5 | return { 6 | "data": { 7 | configure: '{"title":"趋势图标题Conf","data":[{"namespace":["forDemoNamespace1","forDemoNamespace2"],"product":"noahEE","monitoringType":"instance","metric":"#{metric1}/#{metric2}","statistics":"avg","period":5,"name":"name1","contrast":["1d","1w"]},{"namespace":["forDemoNamespace3","forDemoNamespace4"],"product":"noahEE","monitoringType":"instance","metric":"#{metric3}","statistics":"avg","period":5,"name":"name2","contrast":["1d"]}],"style":{"displayType":"line","unit":"个","nullPointMode":"zero","threshold":99},"link":"http://www.baidu.com","timeType":"relative","time":"before(2h)"}' 8 | }, 9 | success: true 10 | }; 11 | } 12 | 13 | Mock.mock('/mock/mdtrend', 'post', trend); -------------------------------------------------------------------------------- /components/visual/demo/service/mock/pie.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | const Mock = require('mockjs'); 3 | 4 | const conf = { 5 | "title": "饼图配置模拟数据", 6 | "data": [{ 7 | "namespace": ["forDemoNamespace"], 8 | "metric": "#{metric1}/#{metric2}", 9 | "statistics": "avg" 10 | }], 11 | "style": { 12 | "decimals": 4, 13 | "unit": "%", 14 | "threshold": [ 15 | // [0.9, 1, "yellow"], 16 | // [0.2, 0.7, "red"], 17 | // [0.7, 0.9, "green"] 18 | ] 19 | }, 20 | "link": "http://www.baidu.com", 21 | "timeType": "fixed", 22 | "time": "before(2h)" 23 | }; 24 | 25 | const pie = function() { 26 | return { 27 | data: { 28 | configure: JSON.stringify(conf), 29 | title: "饼图配置模拟数据" 30 | }, 31 | success: true 32 | }; 33 | } 34 | 35 | Mock.mock('/mock/pie', 'post', pie); -------------------------------------------------------------------------------- /components/visual/demo/service/mock/trendPoint.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | const Mock = require('mockjs'); 3 | 4 | const trend = function() { 5 | return [ 6 | [1543566240000, 11431.2, 7620.8, 100], 7 | [1543558620000, 11328.7, 7552.48, 99.999972477382] 8 | ] 9 | } 10 | 11 | Mock.mock('/mock/trendPoint', 'post', trend); -------------------------------------------------------------------------------- /components/visual/demo/service/mock/trendWarning.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | const Mock = require('mockjs'); 3 | 4 | const trend = function() { 5 | return [{ 6 | count: 4, 7 | events: [{ 8 | startTime: 1543548509, 9 | endTime: 1543548941, 10 | itemValues: "crash_rate=0.208039 ", 11 | tags: ["os=android", "statistics=avg"] 12 | }, 13 | { 14 | startTime: 1543552922, 15 | endTime: 1543553354 16 | }] 17 | }] 18 | } 19 | 20 | Mock.mock('/mock/trendWarning', 'post', trend); -------------------------------------------------------------------------------- /components/visual/src/assets/css/eventriver/index.less: -------------------------------------------------------------------------------- 1 | @import './eventlist.less'; 2 | @import './eventriver.less'; -------------------------------------------------------------------------------- /components/visual/src/assets/css/index.less: -------------------------------------------------------------------------------- 1 | @import './mdreport/report.less'; 2 | @import './mdtrend/trend.less'; 3 | @import './mdcircle/circle.less'; 4 | @import './eventriver/index.less'; 5 | @import './mdmask/mask.less'; 6 | @import './billboard/billboard.less'; 7 | @import './nvmap/map.less'; 8 | @import './nvpie/pie.less'; -------------------------------------------------------------------------------- /components/visual/src/assets/css/mdmask/mask.less: -------------------------------------------------------------------------------- 1 | @import '../variables.less'; 2 | .loading-mask { 3 | position: absolute; 4 | vertical-align: middle; 5 | top: 0; 6 | left: 0; 7 | background: @mdmask-bg-color; 8 | width: 100%; 9 | height: 100%; 10 | line-height: 100%; 11 | text-align: center; 12 | span { 13 | position: relative; 14 | top: 50%; 15 | color: @mdmask-font-color; 16 | font-size: @mdmask-font-size; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /components/visual/src/assets/css/nvmap/map.less: -------------------------------------------------------------------------------- 1 | .nv-map { 2 | .nv-map-title { 3 | width: 100%; 4 | height: 40px; 5 | padding: 0 20px; 6 | line-height: 40px; 7 | font-size: 14px; 8 | font-weight: bold; 9 | } 10 | .nv-map-content { 11 | width: 100%; 12 | height: 460px; 13 | } 14 | height: 500px; 15 | border: 1px solid #ccc; 16 | .nv-map-error-tip { 17 | text-align: center; 18 | margin-top: 200px; 19 | font-size: 14px; 20 | color: #555; 21 | } 22 | } -------------------------------------------------------------------------------- /components/visual/src/assets/css/nvpie/pie.less: -------------------------------------------------------------------------------- 1 | .ui-mdpie { 2 | border: 1px solid #EBEBEB; 3 | position: relative; 4 | .multiple-pie-header h2{ 5 | font-size: 13px; 6 | color: #333; 7 | letter-spacing: 0; 8 | padding: 10px 0 5px 20px; 9 | font-weight: normal; 10 | &.ui-pie-time { 11 | padding: 0 0 0 20px; 12 | font-size: 12px; 13 | color: #999; 14 | } 15 | } 16 | .pie-error-holder { 17 | line-height: 200px; 18 | text-align: center; 19 | } 20 | } -------------------------------------------------------------------------------- /components/visual/src/assets/fonts/iconfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/NoahV/ce78751eeb220e2e58094e9e85627e241ef05f33/components/visual/src/assets/fonts/iconfont.eot -------------------------------------------------------------------------------- /components/visual/src/assets/fonts/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/NoahV/ce78751eeb220e2e58094e9e85627e241ef05f33/components/visual/src/assets/fonts/iconfont.ttf -------------------------------------------------------------------------------- /components/visual/src/assets/fonts/iconfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/NoahV/ce78751eeb220e2e58094e9e85627e241ef05f33/components/visual/src/assets/fonts/iconfont.woff -------------------------------------------------------------------------------- /components/visual/src/assets/img/Artboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/NoahV/ce78751eeb220e2e58094e9e85627e241ef05f33/components/visual/src/assets/img/Artboard.png -------------------------------------------------------------------------------- /components/visual/src/assets/img/ktip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/NoahV/ce78751eeb220e2e58094e9e85627e241ef05f33/components/visual/src/assets/img/ktip.png -------------------------------------------------------------------------------- /components/visual/src/assets/img/sort-asc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/NoahV/ce78751eeb220e2e58094e9e85627e241ef05f33/components/visual/src/assets/img/sort-asc.png -------------------------------------------------------------------------------- /components/visual/src/assets/img/sort-desc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/NoahV/ce78751eeb220e2e58094e9e85627e241ef05f33/components/visual/src/assets/img/sort-desc.png -------------------------------------------------------------------------------- /components/visual/src/assets/img/tree_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/NoahV/ce78751eeb220e2e58094e9e85627e241ef05f33/components/visual/src/assets/img/tree_icon.png -------------------------------------------------------------------------------- /components/visual/src/assets/img/trend/chartarea.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/NoahV/ce78751eeb220e2e58094e9e85627e241ef05f33/components/visual/src/assets/img/trend/chartarea.png -------------------------------------------------------------------------------- /components/visual/src/assets/img/trend/chartcolumn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/NoahV/ce78751eeb220e2e58094e9e85627e241ef05f33/components/visual/src/assets/img/trend/chartcolumn.png -------------------------------------------------------------------------------- /components/visual/src/assets/img/trend/chartline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/NoahV/ce78751eeb220e2e58094e9e85627e241ef05f33/components/visual/src/assets/img/trend/chartline.png -------------------------------------------------------------------------------- /components/visual/src/assets/img/trend/chartnormal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/NoahV/ce78751eeb220e2e58094e9e85627e241ef05f33/components/visual/src/assets/img/trend/chartnormal.png -------------------------------------------------------------------------------- /components/visual/src/assets/img/trend/chartstack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/NoahV/ce78751eeb220e2e58094e9e85627e241ef05f33/components/visual/src/assets/img/trend/chartstack.png -------------------------------------------------------------------------------- /components/visual/src/assets/img/trend/sortAsc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/NoahV/ce78751eeb220e2e58094e9e85627e241ef05f33/components/visual/src/assets/img/trend/sortAsc.png -------------------------------------------------------------------------------- /components/visual/src/assets/img/trend/sortDesc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/NoahV/ce78751eeb220e2e58094e9e85627e241ef05f33/components/visual/src/assets/img/trend/sortDesc.png -------------------------------------------------------------------------------- /components/visual/src/config/widgetApi.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file visual widget config 3 | * 4 | * @author wang_jing13@163.com 5 | */ 6 | export default { 7 | mons: { 8 | dataApi: { 9 | nvMdCircle: '/api/index.php?r=MetricNew/circle', 10 | nvMdBillboard: '/api/index.php?r=MetricNew/billboard', 11 | nvMdTrend: '/api/index.php?r=MetricNew/trend', 12 | nvMdReport: '/api/index.php?r=MetricNew/report', 13 | nvMdEventRiver: '/api/index.php?r=MetricNew/eventRiver', 14 | nvMdPie: '/api/index.php?r=MetricNew/pie' 15 | }, 16 | confApi: { 17 | nvMdCircle: '/api/?r=conf/get', 18 | nvMdBillboard: '/api/?r=conf/get', 19 | nvMdTrend: '/api/?r=conf/get', 20 | nvMdReport: '/api/?r=conf/get', 21 | nvMdEventRiver: '/api/?r=conf/get', 22 | nvMdPie: '/api/?r=conf/get' 23 | } 24 | }, 25 | getAPI(api) { 26 | return api; 27 | } 28 | }; 29 | -------------------------------------------------------------------------------- /components/visual/src/eventBus.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file eventBus 3 | * 4 | * @author mohaiyan(mohaiyan2005@163.com) 5 | */ 6 | 7 | import Vue from 'vue'; 8 | export const eventBus = new Vue(); 9 | -------------------------------------------------------------------------------- /components/visual/src/eventRiver/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file Visual Components EventRiver 3 | * 4 | * @author wang_jing13@163.com 5 | */ 6 | 7 | import EventRiverView from './eventRiverView'; 8 | 9 | export default EventRiverView; -------------------------------------------------------------------------------- /components/visual/src/mask.vue: -------------------------------------------------------------------------------- 1 | 6 | 30 | 31 | -------------------------------------------------------------------------------- /components/visual/src/mixins/index.js: -------------------------------------------------------------------------------- 1 | import { t } from '../locale'; 2 | 3 | export default { 4 | methods: { 5 | t(...args) { 6 | return t.apply(this, args); 7 | } 8 | } 9 | }; -------------------------------------------------------------------------------- /components/visual/src/nvMap/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * NoahV 3 | * Copyright (c) 2019 Baidu, Inc. All Rights Reserved. 4 | * 5 | * @file NvMap Component 6 | * @author darren(darrenywyu@gmail.com) 7 | */ 8 | 9 | import NvMap from './nvMap.vue'; 10 | export default NvMap; -------------------------------------------------------------------------------- /components/visual/src/nvPie/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * NoahV 3 | * Copyright (c) 2019 Baidu, Inc. All Rights Reserved. 4 | * 5 | * @file NvPie Component 6 | * @author darren(darrenywyu@gmail.com) 7 | */ 8 | 9 | import NvPie from './nvPie.vue'; 10 | export default NvPie; -------------------------------------------------------------------------------- /components/visual/test/unit/index.js: -------------------------------------------------------------------------------- 1 | // require all test files (files that ends with .spec.js) 2 | const testsContext = require.context('./specs', true, /\.spec$/); 3 | testsContext.keys().forEach(testsContext); 4 | 5 | // require all src files except main.js for coverage. 6 | // you want coverage for 7 | const srcContext = require.context('../../src', true, /^\.\/(?!styles.*?(\.less)?$)/); 8 | srcContext.keys().forEach(srcContext); 9 | -------------------------------------------------------------------------------- /doc/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["env", "stage-2"], 3 | "plugins": ["transform-runtime", "transform-vue-jsx"], 4 | "comments": false, 5 | "env": { 6 | "test": { 7 | "plugins": [ "istanbul" ] 8 | } 9 | } 10 | } 11 | 12 | -------------------------------------------------------------------------------- /doc/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | dist/ 4 | npm-debug.log 5 | saas 6 | test/unit/coverage/ 7 | package-lock.json 8 | -------------------------------------------------------------------------------- /doc/README.md: -------------------------------------------------------------------------------- 1 | [English](./README_en.md) | 简体中文 2 | 3 | 4 | # NoahV 5 | 6 | NoahV是一个基于vue开发的前端应用框架,主要适用于监控运维、数据分析等场景,同时也适用于常见的后台管理系统。 7 | 8 | 主要包含如下特性: 9 | 10 | * 上手简单,10分钟搭建出一个站点 11 | * 组件丰富,基于iview组件库扩充,包含各类业务组件和模板,满足常见后台管理系统场景下的组件需求 12 | * 导航栏、页面布局JSON配置,无需代码逻辑开发 13 | * API数据模拟和API数据代理,让前后端联调更简单,效率更高 14 | * 数据仪表盘功能,满足常见的数据可视化需求,助力数据分析场景 15 | * 实用的脚手架功能,项目初始化、模板复用、模拟数据创建、调试server启动、框架升级一行命令通通搞定 16 | 17 | 文档地址:http://www.noahv.org/ 18 | 19 | -------------------------------------------------------------------------------- /doc/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | FILE_NAME="noahv-doc" 4 | 5 | CUR_DIR=$(cd `dirname $0`; pwd) 6 | 7 | # prepare 8 | if [ -d $CUR_DIR/output ]; then 9 | rm -rf $CUR_DIR/output 10 | fi 11 | 12 | if [ -d $CUR_DIR/noahv ]; then 13 | rm -rf $CUR_DIR/noahv 14 | fi 15 | 16 | if [ -f $CUR_DIR/dep.tar.gz ]; then 17 | if [ -d $CUR_DIR/node_modules ]; then 18 | rm -rf $CUR_DIR/node_modules 19 | fi 20 | mkdir -p $CUR_DIR/node_modules 21 | tar -zxvf $CUR_DIR/dep.tar.gz -C $CUR_DIR/node_modules 22 | 23 | fi 24 | 25 | echo "install node_modules" 26 | npm install 27 | 28 | # build 29 | echo "npm build start" 30 | 31 | node scripts/build.js 32 | 33 | 34 | if [ $? -ne 0 ]; then 35 | echo "build failed!" 36 | exit 1; 37 | fi 38 | echo "npm build success" 39 | 40 | mv noahv output 41 | 42 | # tar 43 | cd output 44 | tar -zcf $FILE_NAME.tar.gz * 45 | ls . | fgrep -v $FILE_NAME.tar.gz | xargs rm -rf 46 | 47 | echo "build success" 48 | exit 0; 49 | -------------------------------------------------------------------------------- /doc/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NoahV文档 6 | 7 | 8 |
9 | 10 |
11 | 12 | 13 | -------------------------------------------------------------------------------- /doc/mockup/api/billboard.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | const Mock = require('mockjs'); 3 | const billboard = function() { 4 | const CONF = { 5 | "title": "网络模块", 6 | "data": [{ 7 | "namespace": ["forDemoNamespace1"], 8 | "metric": "#{metric1}/#{metric2}", 9 | "statistics": "avg", 10 | "name": "usability", 11 | "alias": '异常率', 12 | "unit": "%", 13 | "decimals": 4 14 | }, { 15 | "namespace": ["forDemoNamespace2"], 16 | "metric": "#{metric3}", 17 | "statistics": "avg", 18 | "name": "abnormal", 19 | "alias": '异常率', 20 | "unit": "%", 21 | "decimals": 4 22 | }], 23 | "link": "http://www.baidu.com", 24 | "timeType": "relative", 25 | "time": "before(2h)" 26 | }; 27 | return { 28 | data: { 29 | configure : JSON.stringify(CONF) 30 | }, 31 | success: true 32 | }; 33 | }; 34 | Mock.mock('/mock/billboard', 'post', billboard); 35 | -------------------------------------------------------------------------------- /doc/mockup/api/circle.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | const Mock = require('mockjs'); 3 | const circle = function() { 4 | return { 5 | data: { 6 | configure : '{"title":"模块B可用性","data":[{"namespace":["forDemoNamespace"],"metric":"#{metric1}/#{metric2}","statistics":"avg"}],"style":{"decimals":4,"unit":"%","max":100,"min":0,"threshold":[[90,99,"yellow"],[0,90,"red"],[99,99.99,"green"]]},"link":"http://www.baidu.com","timeType":"fixed","time":"before(2h)"}', 7 | title: "仪表图配置path" 8 | }, 9 | success: true 10 | }; 11 | } 12 | Mock.mock('/mock/circle', 'post', circle); 13 | -------------------------------------------------------------------------------- /doc/mockup/api/dataBillboard.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | const Mock = require('mockjs'); 3 | const Random = Mock.Random; 4 | const billboardData = function() { 5 | const usability = Random.float(90, 99, 5, 5); 6 | const overtime = Random.float(1, 3, 5, 5); 7 | const abnormal = 100 - usability; 8 | return { 9 | data: [{ 10 | name: 'usability', 11 | value: usability, 12 | warning: usability < 95 ? true : false 13 | }, 14 | { 15 | name: 'overtime', 16 | value: overtime 17 | }, { 18 | name: 'abnormal', 19 | value: abnormal 20 | }], 21 | success: true 22 | }; 23 | } 24 | Mock.mock('/mock/dataBillboard', 'post', billboardData); -------------------------------------------------------------------------------- /doc/mockup/api/dataCircle.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | const Mock = require('mockjs'); 3 | const circleData = function() { 4 | return Mock.mock({ 5 | "data|75-99.1-5": 1, 6 | success: true 7 | }); 8 | } 9 | Mock.mock('/mock/circleData', 'post', circleData); -------------------------------------------------------------------------------- /doc/mockup/api/dataReport.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | const Mock = require('mockjs'); 3 | 4 | const report = function() { 5 | return { 6 | "data": [{ 7 | "name":"noah_namespace", 8 | "value":"2.case-basic.service", 9 | "alias":'metric1', 10 | "metrics":{"alias3":90,"alias2":null, "alias1": 95} 11 | }, { 12 | "name":"noah_namespace", 13 | "value":"1.case-basic.service", 14 | "alias":'metric2', 15 | "metrics":{"alias3":100,"alias2": null, "alias1": 80} 16 | }], 17 | success: true 18 | }; 19 | } 20 | 21 | Mock.mock('/mock/dataReport', 'post', report); -------------------------------------------------------------------------------- /doc/mockup/api/eventRiver.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | const Mock = require('mockjs'); 3 | // 获取 mock.Random 对象 4 | const Random = Mock.Random; 5 | // mock一组数据 6 | const produceNewsData = function() { 7 | return { 8 | data: { 9 | "configure": '{"title":"事件流图1","data":{"schema":[{"name":"机房1","type":"NJ01error","checked":true},{"name":"机房二","type":"GZHXYerror","checked":true},{"name":"机房三","type":"GZNSwarning","checked":true},{"name":"机房四","type":"BJYZwarning","checked":true},{"name":"机房五","type":"NJ01warning","checked":true,"eventDetailMap":[{"name":"创造者","key":"product.operator","type":"arr"},{"name":"异常类型","key":"type","type":"text"},{"name":"详情","key":"url","type":"link"}]}]},"timeType":"fixed","time":"before(2h)"}' 10 | }, 11 | success: true 12 | } 13 | }; 14 | 15 | // Mock.mock( url, post/get , 返回的数据); 16 | Mock.mock('/mock/eventRiver', 'post', produceNewsData); 17 | -------------------------------------------------------------------------------- /doc/mockup/api/mdtrend.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | const Mock = require('mockjs'); 3 | 4 | const trend = function() { 5 | return { 6 | "data": { 7 | configure: '{"title":"网络指标","data":[{"namespace":["forDemoNamespace1","forDemoNamespace2"],"product":"noahEE","monitoringType":"instance","metric":"#{metric1}/#{metric2}","statistics":"avg","period":5,"name":"name1","contrast":["1d","1w"]},{"namespace":["forDemoNamespace3","forDemoNamespace4"],"product":"noahEE","monitoringType":"instance","metric":"#{metric3}","statistics":"avg","period":5,"name":"name2","contrast":["1d"]}],"style":{"displayType":"line","unit":"个","nullPointMode":"zero","threshold":99},"link":"http://www.baidu.com","timeType":"relative","time":"before(2h)"}' 8 | }, 9 | success: true 10 | }; 11 | } 12 | 13 | Mock.mock('/mock/mdtrend', 'post', trend); -------------------------------------------------------------------------------- /doc/mockup/api/table.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by noahv-cli. 3 | */ 4 | var mockup = require('noahv-mockup').mockupTool; 5 | 6 | exports.response = function (path, params) { 7 | 8 | return mockup.ok( 9 | { 10 | // id: 1 11 | } 12 | ); 13 | 14 | }; -------------------------------------------------------------------------------- /doc/mockup/api/tpl/ajax.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | const Mock = require('mockjs'); 3 | const data = function() { 4 | return { 5 | data: 'NoahV', 6 | success: true 7 | } 8 | } 9 | Mock.mock('/api/tpl/ajax', 'post', data); -------------------------------------------------------------------------------- /doc/mockup/api/tpl/business.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | const Mock = require('mockjs'); 3 | const data = function() { 4 | return { 5 | success: true, 6 | message: 'ok', 7 | data: { 8 | 9 | } 10 | } 11 | } 12 | Mock.mock('/api/xxx', 'post', data); -------------------------------------------------------------------------------- /doc/mockup/api/tpl/form.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | const Mock = require('mockjs'); 3 | const data = function() { 4 | return { 5 | data: { 6 | 7 | }, 8 | success: true 9 | } 10 | } 11 | Mock.mock('/api/tpl/form/get', 'get', data); -------------------------------------------------------------------------------- /doc/mockup/api/tpl/formGet.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | const Mock = require('mockjs'); 3 | const data = function() { 4 | return { 5 | data: { 6 | username: '右右右', 7 | email: 'darren@gmail.com' 8 | }, 9 | success: true 10 | } 11 | } 12 | Mock.mock('/api/tpl/form/get', 'post', data); -------------------------------------------------------------------------------- /doc/mockup/api/tpl/formSubmit.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | const Mock = require('mockjs'); 3 | const data = function() { 4 | return { 5 | data: { 6 | }, 7 | success: true 8 | } 9 | } 10 | Mock.mock('/api/tpl/form/submit', 'post', data); -------------------------------------------------------------------------------- /doc/mockup/api/tpl/tabledelete.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | const Mock = require('mockjs'); 3 | const data = function() { 4 | return { 5 | data: {}, 6 | success: true 7 | } 8 | } 9 | Mock.mock('/api/tpl/tabledelete', 'post', data); -------------------------------------------------------------------------------- /doc/mockup/api/trendPoint.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | const Mock = require('mockjs'); 3 | 4 | const trend = function() { 5 | return { 6 | "success": true, 7 | "data": [{ 8 | "name": "异常点", 9 | "ruleName": 'error', 10 | "color": "#f00", 11 | // "symbol": "circle", 12 | "size": 8, 13 | "data": [ 14 | [1529409780000, 172382], 15 | [1529409720000, 144181] 16 | ] 17 | }, { 18 | "name": "超时点", 19 | "ruleName": 'overtime', 20 | "color": "#F90", 21 | "data": [ 22 | [1529410860000, 124365], 23 | [1529412060000, 122014] 24 | ] 25 | }] 26 | }; 27 | } 28 | 29 | Mock.mock('/mock/trendPoint', 'post', trend); -------------------------------------------------------------------------------- /doc/release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | FILE_NAME="noahv-doc" 4 | 5 | CUR_DIR=$(cd `dirname $0`; pwd) 6 | 7 | # prepare 8 | if [ -d $CUR_DIR/output ]; then 9 | rm -rf $CUR_DIR/output 10 | fi 11 | 12 | if [ -d $CUR_DIR/noahv ]; then 13 | rm -rf $CUR_DIR/noahv 14 | fi 15 | 16 | if [ -f $CUR_DIR/dep.tar.gz ]; then 17 | if [ -d $CUR_DIR/node_modules ]; then 18 | rm -rf $CUR_DIR/node_modules 19 | fi 20 | mkdir -p $CUR_DIR/node_modules 21 | tar -zxvf $CUR_DIR/dep.tar.gz -C $CUR_DIR/node_modules 22 | 23 | fi 24 | 25 | echo "install node_modules" 26 | npm install 27 | 28 | # build 29 | echo "npm build start" 30 | 31 | node scripts/build.js 32 | 33 | 34 | if [ $? -ne 0 ]; then 35 | echo "build failed!" 36 | exit 1; 37 | fi 38 | echo "npm build success" 39 | 40 | # tar 41 | # cd output 42 | # tar -zcf $FILE_NAME.tar.gz * 43 | # ls . | fgrep -v $FILE_NAME.tar.gz | xargs rm -rf 44 | 45 | echo "build success" 46 | exit 0; 47 | -------------------------------------------------------------------------------- /doc/scripts/build.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | process.env.NODE_ENV = 'production'; 3 | var path = require('path') 4 | var config = require('./config') 5 | var ora = require('ora') 6 | const fs = require('fs-extra') 7 | var webpack = require('webpack') 8 | var webpackConfig = require('./webpack.prod.conf') 9 | 10 | var spinner = ora('building for production...') 11 | spinner.start() 12 | 13 | var assetsPath = path.join(config.build.assetsRoot, config.build.assetsSubDirectory) 14 | fs.removeSync(assetsPath) 15 | fs.mkdirpSync(assetsPath) 16 | 17 | var staticPath = path.resolve('static'); 18 | if (fs.pathExistsSync(staticPath)) { 19 | fs.copySync('static/*', assetsPath); 20 | } 21 | 22 | webpack(webpackConfig, function(err, stats) { 23 | spinner.stop() 24 | if (err) throw err 25 | process.stdout.write(stats.toString({ 26 | colors: true, 27 | modules: false, 28 | children: false, 29 | chunks: false, 30 | chunkModules: false 31 | }) + '\n') 32 | }) -------------------------------------------------------------------------------- /doc/scripts/demo-loader/config.js: -------------------------------------------------------------------------------- 1 | // https://github.com/ElemeFE/element/blob/dev/build/md-loader/config.js 2 | const Config = require('markdown-it-chain'); 3 | const anchorPlugin = require('markdown-it-anchor'); 4 | const slugify = require('transliteration').slugify; 5 | const containers = require('./containers'); 6 | const overWriteFenceRule = require('./fence'); 7 | 8 | const toc = require('markdown-it-table-of-contents'); 9 | 10 | const config = new Config(); 11 | 12 | config 13 | .options.html(true).end() 14 | 15 | .plugin('anchor').use(anchorPlugin, [ 16 | { 17 | level: 2, 18 | slugify: slugify, 19 | permalink: false, 20 | permalinkBefore: true 21 | } 22 | ]).end() 23 | 24 | .plugin('toc').use(toc, [ 25 | { 26 | includeLevel: [1, 2, 3], 27 | slugify: slugify 28 | } 29 | ]).end() 30 | 31 | .plugin('containers').use(containers).end(); 32 | 33 | 34 | const md = config.toMd(); 35 | overWriteFenceRule(md); 36 | 37 | module.exports = md; -------------------------------------------------------------------------------- /doc/scripts/demo-loader/containers.js: -------------------------------------------------------------------------------- 1 | // https://github.com/ElemeFE/element/blob/dev/build/md-loader/containers.js 2 | const mdContainer = require('markdown-it-container'); 3 | 4 | module.exports = md => { 5 | md.use(mdContainer, 'demo', { 6 | validate(params) { 7 | return params.trim().match(/^demo\s*(.*)$/); 8 | }, 9 | render(tokens, idx) { 10 | const m = tokens[idx].info.trim().match(/^demo\s*(.*)$/); 11 | if (tokens[idx].nesting === 1) { 12 | const description = m && m.length > 1 ? m[1] : ''; 13 | const content = tokens[idx + 1].type === 'fence' ? tokens[idx + 1].content : ''; 14 | return ` 15 | ${description ? `` : ''} 16 | 17 | `; 18 | } 19 | return ''; 20 | } 21 | }); 22 | 23 | md.use(mdContainer, 'tip'); 24 | md.use(mdContainer, 'warning'); 25 | }; -------------------------------------------------------------------------------- /doc/scripts/demo-loader/fence.js: -------------------------------------------------------------------------------- 1 | // https://github.com/ElemeFE/element/blob/dev/build/md-loader/fence.js 2 | // 覆盖默认的 fence 渲染策略 3 | module.exports = md => { 4 | const defaultRender = md.renderer.rules.fence; 5 | md.renderer.rules.fence = (tokens, idx, options, env, self) => { 6 | const token = tokens[idx]; 7 | // 判断该 fence 是否在 :::demo 内 8 | const prevToken = tokens[idx - 1]; 9 | const isInDemoContainer = prevToken && prevToken.nesting === 1 && prevToken.info.trim().match(/^demo\s*(.*)$/); 10 | if ((token.info === 'html' || token.info === 'json') && isInDemoContainer) { 11 | return ``; 12 | } 13 | return defaultRender(tokens, idx, options, env, self); 14 | }; 15 | }; -------------------------------------------------------------------------------- /doc/scripts/dev-client.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | require('eventsource-polyfill') 3 | var hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true') 4 | 5 | hotClient.subscribe(function(event) { 6 | if (event.action === 'reload') { 7 | window.location.reload() 8 | } 9 | }) -------------------------------------------------------------------------------- /doc/scripts/vue-loader.conf.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const utils = require('./utils') 3 | const config = require('./config') 4 | const isProduction = process.env.NODE_ENV === 'production' 5 | const sourceMapEnabled = isProduction 6 | ? config.build.productionSourceMap 7 | : config.dev.cssSourceMap 8 | 9 | module.exports = { 10 | loaders: utils.cssLoaders({ 11 | sourceMap: sourceMapEnabled, 12 | extract: isProduction 13 | }), 14 | cssSourceMap: sourceMapEnabled 15 | } -------------------------------------------------------------------------------- /doc/src/common/assets/css/global.less: -------------------------------------------------------------------------------- 1 | body, div, span, header, footer, nav, section, aside, article, ul, dl, dt, dd, li, a, p, h1, h2, h3, h4,h5, i, b, textarea, button, input, select { 2 | padding: 0; 3 | margin: 0; 4 | list-style: none; 5 | font-style: normal; 6 | text-decoration: none; 7 | border: none; 8 | box-sizing: border-box; 9 | font-weight: normal; 10 | font-family: "Microsoft YaHei",-apple-system,BlinkMacSystemFont,"SF Pro SC","SF Pro Text","Helvetica Neue",Helvetica,"PingFang SC","Segoe UI",Roboto,"Hiragino Sans GB","Arial","microsoft yahei ui",SimSun,sans-serif; 11 | -webkit-tap-highlight-color:transparent; 12 | &:focus { 13 | outline: none; 14 | } 15 | } 16 | 17 | 18 | html { 19 | height: 100%; 20 | width: 100%; 21 | overflow-x: hidden; 22 | } 23 | body { 24 | height: 100%; 25 | width: 100%; 26 | background: #f5f7f9; 27 | } 28 | .ivu-spin-fullscreen { 29 | background-color: rgba(255, 255, 255, .5); 30 | } -------------------------------------------------------------------------------- /doc/src/common/assets/css/main.less: -------------------------------------------------------------------------------- 1 | // relationship of style level: iview -> saasv -> theme 2 | // import iview style 3 | @import '~iview/src/styles/index.less'; 4 | 5 | // import noahv global and components style 6 | @import './global.less'; 7 | @import './header.less'; 8 | @import './markdown.less'; 9 | 10 | @import './theme/custom.less'; 11 | @import './theme/components/index.less'; 12 | 13 | // import noahv header style 14 | @import '~noahv-core/lib/header/header.less'; 15 | 16 | // import theme style 17 | @import './theme/my-theme.less'; -------------------------------------------------------------------------------- /doc/src/common/assets/css/theme/components/checkbox.less: -------------------------------------------------------------------------------- 1 | @import '../custom.less'; 2 | .ivu-checkbox-inner { 3 | width: @noahv-checkbox-width; 4 | height: @noahv-checkbox-height; 5 | border: @noahv-checkbox-default-border; 6 | background-color: @noahv-checkbox-default-bg; 7 | } 8 | .ivu-checkbox-checked .ivu-checkbox-inner { 9 | border-color: @noahv-checkbox-checked-color; 10 | background-color: @noahv-checkbox-checked-color; 11 | } 12 | 13 | .ivu-checkbox-disabled .ivu-checkbox-inner, .ivu-checkbox-disabled.ivu-checkbox-checked .ivu-checkbox-inner { 14 | border-color: @noahv-checkbox-disabled-border; 15 | background-color: @noahv-checkbox-disabled-bg; 16 | } 17 | 18 | .ivu-checkbox-focus { 19 | box-shadow: @noahv-checkbox-box-shadow; 20 | } 21 | 22 | .ivu-checkbox-wrapper { 23 | margin-right: @noahv-checkbox-wapper-margin-right; 24 | } -------------------------------------------------------------------------------- /doc/src/common/assets/css/theme/components/index.less: -------------------------------------------------------------------------------- 1 | @import './button.less'; 2 | @import './table.less'; 3 | @import './input.less'; 4 | @import './radio.less'; 5 | @import './checkbox.less'; 6 | @import './toast.less'; 7 | @import './tooltip.less'; 8 | @import './modal.less'; 9 | @import './tabs.less'; 10 | @import './page.less'; 11 | @import './select.less'; 12 | @import './switch.less'; -------------------------------------------------------------------------------- /doc/src/common/assets/css/theme/components/input.less: -------------------------------------------------------------------------------- 1 | @import '../custom.less'; 2 | .ivu-input { 3 | border-radius: @noahv-input-border-radius; 4 | padding: @noahv-input-padding; 5 | border: @noahv-input-default-border; 6 | color: @noahv-font-text-color; 7 | } 8 | 9 | .ivu-input:focus { 10 | border-color: @noahv-input-focus-color; 11 | box-shadow: @noahv-input-focus-box-shadow; 12 | background: @noahv-input-active-bg; 13 | } 14 | 15 | .ivu-input:hover { 16 | border-color: @noahv-input-focus-color; 17 | } 18 | 19 | .ivu-input::-webkit-input-placeholder { 20 | color: @noahv-font-placeholder-color; 21 | font-size: @noahv-font-size-base 22 | } 23 | 24 | .ivu-input[disabled], fieldset[disabled] .ivu-input { 25 | color: @noahv-font-text-disabled-color; 26 | background-color: @noahv-input-disabled-bg; 27 | } -------------------------------------------------------------------------------- /doc/src/common/assets/css/theme/components/page.less: -------------------------------------------------------------------------------- 1 | @import './select.less'; 2 | @import '../custom.less'; 3 | .ivu-page-item { 4 | border: @noahv-page-border; 5 | border-radius: @noahv-page-border-radius; 6 | min-width: @noahv-page-item-min-width; 7 | height: @noahv-page-item-height; 8 | } 9 | 10 | .ivu-page-item-active { 11 | background-color: @noahv-page-active-bg; 12 | } 13 | 14 | .ivu-page-prev, .ivu-page-next, .ivu-page-item-jump-prev, .ivu-page-item-jump-next { 15 | border: @noahv-page-border; 16 | border-radius: @noahv-page-border-radius; 17 | } 18 | 19 | .ivu-page-item:hover a { 20 | color: @noahv-page-hover-color; 21 | } 22 | .ivu-page-item-active a, .ivu-page-item-active:hover a { 23 | color: @noahv-page-avtive-hover-color; 24 | } 25 | 26 | .ivu-page-options { 27 | float: @noahv-page-options-float; 28 | 29 | &:before { 30 | content: @noahv-page-options-content; 31 | display: block; 32 | float: left; 33 | line-height: @noahv-page-item-height; 34 | margin-right: 2px; 35 | } 36 | } 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /doc/src/common/assets/css/theme/components/radio.less: -------------------------------------------------------------------------------- 1 | @import '../custom.less'; 2 | .ivu-radio-inner { 3 | width: @noahv-radio-width; 4 | height: @noahv-radio-height; 5 | background-color: @noahv-radio-default-bg; 6 | border: @noahv-radio-default-border; 7 | } 8 | .ivu-radio-checked .ivu-radio-inner { 9 | border-color: @noahv-radio-checked-color; 10 | } 11 | .ivu-radio-inner:after { 12 | background-color: @noahv-radio-checked-color; 13 | } 14 | 15 | .ivu-radio-disabled .ivu-radio-inner { 16 | border-color: @noahv-radio-disabled-border; 17 | background-color: @noahv-radio-disabled-bg; 18 | } 19 | 20 | .ivu-radio-disabled .ivu-radio-inner:after { 21 | background-color: @noahv-radio-disabled-border; 22 | } 23 | 24 | .ivu-radio-focus { 25 | box-shadow: @noahv-radio-box-shadow; 26 | } -------------------------------------------------------------------------------- /doc/src/common/assets/css/theme/components/toast.less: -------------------------------------------------------------------------------- 1 | @import '../custom.less'; 2 | .ivu-message-notice-content { 3 | padding: @noahv-toast-padding; 4 | border-radius: @noahv-toast-border-radius; 5 | } 6 | 7 | .ivu-message .ivu-icon { 8 | margin-right: @noahv-toast-icon-margin-right; 9 | } 10 | 11 | .ivu-message-notice-content span { 12 | font-size: @noahv-font-size-base; 13 | } -------------------------------------------------------------------------------- /doc/src/common/assets/css/theme/components/tooltip.less: -------------------------------------------------------------------------------- 1 | @import '../custom.less'; 2 | .ivu-tooltip-inner { 3 | padding: @noahv-tooltip-padding; 4 | font-size: @noahv-font-size-base; 5 | border-radius: @noahv-tooltip-border-radius; 6 | box-shadow: @noahv-tooltip-box-shadow; 7 | } -------------------------------------------------------------------------------- /doc/src/common/assets/css/theme/my-theme.less: -------------------------------------------------------------------------------- 1 | // to define your theme 2 | 3 | // eg. 4 | // define iview style 5 | // @rate-star-color: #8c0776; 6 | 7 | // define noahv style 8 | // @noahv-btn-error-color: #8c0776; 9 | 10 | // define own style 11 | // .ivu-btn.ivu-btn-error { 12 | // background: #8c0776; 13 | // } -------------------------------------------------------------------------------- /doc/src/common/assets/icon/iconfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/NoahV/ce78751eeb220e2e58094e9e85627e241ef05f33/doc/src/common/assets/icon/iconfont.eot -------------------------------------------------------------------------------- /doc/src/common/assets/icon/iconfont.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "1616268", 3 | "name": "1", 4 | "font_family": "iconfont", 5 | "css_prefix_text": "icon", 6 | "description": "", 7 | "glyphs": [ 8 | { 9 | "icon_id": "1222277", 10 | "name": "wechat", 11 | "font_class": "wechat", 12 | "unicode": "e600", 13 | "unicode_decimal": 58880 14 | }, 15 | { 16 | "icon_id": "7239764", 17 | "name": "github", 18 | "font_class": "github", 19 | "unicode": "e732", 20 | "unicode_decimal": 59186 21 | } 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /doc/src/common/assets/icon/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/NoahV/ce78751eeb220e2e58094e9e85627e241ef05f33/doc/src/common/assets/icon/iconfont.ttf -------------------------------------------------------------------------------- /doc/src/common/assets/icon/iconfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/NoahV/ce78751eeb220e2e58094e9e85627e241ef05f33/doc/src/common/assets/icon/iconfont.woff -------------------------------------------------------------------------------- /doc/src/common/assets/icon/iconfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/NoahV/ce78751eeb220e2e58094e9e85627e241ef05f33/doc/src/common/assets/icon/iconfont.woff2 -------------------------------------------------------------------------------- /doc/src/common/assets/img/ark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/NoahV/ce78751eeb220e2e58094e9e85627e241ef05f33/doc/src/common/assets/img/ark.png -------------------------------------------------------------------------------- /doc/src/common/assets/img/catlog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/NoahV/ce78751eeb220e2e58094e9e85627e241ef05f33/doc/src/common/assets/img/catlog.png -------------------------------------------------------------------------------- /doc/src/common/assets/img/conf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/NoahV/ce78751eeb220e2e58094e9e85627e241ef05f33/doc/src/common/assets/img/conf.png -------------------------------------------------------------------------------- /doc/src/common/assets/img/dashboard-api.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/NoahV/ce78751eeb220e2e58094e9e85627e241ef05f33/doc/src/common/assets/img/dashboard-api.png -------------------------------------------------------------------------------- /doc/src/common/assets/img/dashboard-edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/NoahV/ce78751eeb220e2e58094e9e85627e241ef05f33/doc/src/common/assets/img/dashboard-edit.png -------------------------------------------------------------------------------- /doc/src/common/assets/img/dashboard-list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/NoahV/ce78751eeb220e2e58094e9e85627e241ef05f33/doc/src/common/assets/img/dashboard-list.png -------------------------------------------------------------------------------- /doc/src/common/assets/img/dashboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/NoahV/ce78751eeb220e2e58094e9e85627e241ef05f33/doc/src/common/assets/img/dashboard.png -------------------------------------------------------------------------------- /doc/src/common/assets/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/NoahV/ce78751eeb220e2e58094e9e85627e241ef05f33/doc/src/common/assets/img/favicon.ico -------------------------------------------------------------------------------- /doc/src/common/assets/img/header-demo-complex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/NoahV/ce78751eeb220e2e58094e9e85627e241ef05f33/doc/src/common/assets/img/header-demo-complex.png -------------------------------------------------------------------------------- /doc/src/common/assets/img/header-demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/NoahV/ce78751eeb220e2e58094e9e85627e241ef05f33/doc/src/common/assets/img/header-demo.png -------------------------------------------------------------------------------- /doc/src/common/assets/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/NoahV/ce78751eeb220e2e58094e9e85627e241ef05f33/doc/src/common/assets/img/logo.png -------------------------------------------------------------------------------- /doc/src/common/assets/img/noahv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/NoahV/ce78751eeb220e2e58094e9e85627e241ef05f33/doc/src/common/assets/img/noahv.png -------------------------------------------------------------------------------- /doc/src/common/assets/img/ybp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/NoahV/ce78751eeb220e2e58094e9e85627e241ef05f33/doc/src/common/assets/img/ybp.png -------------------------------------------------------------------------------- /doc/src/common/conifg.js: -------------------------------------------------------------------------------- 1 | export default { 2 | index: '' 3 | }; 4 | -------------------------------------------------------------------------------- /doc/src/common/layout/404.vue: -------------------------------------------------------------------------------- 1 | 4 | 9 | 10 | 12 | -------------------------------------------------------------------------------- /doc/src/common/layout/layout.vue: -------------------------------------------------------------------------------- 1 | 19 | 24 | -------------------------------------------------------------------------------- /doc/src/doc/view/api/dashboardCopy.md: -------------------------------------------------------------------------------- 1 | [[TOC]] 2 | ## 接口含义 3 | 复制仪表盘接口 4 | 5 | *复制仪表盘需要生成一个与目标仪表盘一致的新仪表盘(主要是仪表盘具体配置一致),但需要保证id和仪表盘名称不一致* 6 | 7 | ## 请求参数 8 | 9 | | 属性 | 说明 | 类型 | 默认值 | 10 | | ----- | ----------- | ------ | ------ | 11 | | id | 待复制仪表盘接口id | number | '' | 12 | 13 | 14 | ## 返回数据参数 15 | 16 | 返回数据整体格式参考[接口规范](#/guide/specification)中的请求成功接口。 17 | 18 | 19 | res.data 20 | 21 | 空 22 | 23 | 24 | ## 示例 25 | 26 | 27 | ```json 28 | { 29 | data: { 30 | } 31 | success: true, 32 | message: 'ok' 33 | } 34 | ``` 35 | -------------------------------------------------------------------------------- /doc/src/doc/view/api/dashboardCreate.md: -------------------------------------------------------------------------------- 1 | [[TOC]] 2 | ## 接口含义 3 | 新建仪表盘接口 4 | 5 | ## 请求参数 6 | 7 | | 属性 | 说明 | 类型 | 默认值 | 8 | | ----- | ----------- | ------ | ------ | 9 | | title | 仪表盘名称 | String | '' | 10 | 11 | 12 | ## 返回数据参数 13 | 14 | 返回数据整体格式参考[接口规范](#/guide/specification)中的请求成功接口。 15 | 16 | 17 | res.data 18 | 19 | | 属性 | 说明 | 类型 | 默认值 | 20 | | ----- | ----------- | ------ | ------ | 21 | | id | 仪表盘唯一id | number | - | 22 | 23 | 24 | ## 示例 25 | 26 | 27 | ```json 28 | { 29 | data: { 30 | id: 1803 31 | } 32 | success: true, 33 | message: 'ok' 34 | } 35 | ``` 36 | -------------------------------------------------------------------------------- /doc/src/doc/view/api/dashboardDelete.md: -------------------------------------------------------------------------------- 1 | [[TOC]] 2 | 3 | ## 接口含义 4 | 删除仪表盘接口 5 | 6 | 7 | ## 请求参数 8 | 9 | | 属性 | 说明 | 类型 | 默认值 | 10 | | ----- | ----------- | ------ | ------ | 11 | | id | 待复制仪表盘接口id | number | '' | 12 | 13 | 14 | ## 返回数据参数 15 | 16 | 返回数据整体格式参考[接口规范](#/guide/specification)中的请求成功接口。 17 | 18 | 19 | res.data 20 | 21 | 空 22 | 23 | 24 | ## 示例 25 | 26 | 27 | 28 | ```json 29 | { 30 | data: { 31 | } 32 | success: true, 33 | message: 'ok' 34 | } 35 | ``` 36 | 37 | -------------------------------------------------------------------------------- /doc/src/doc/view/api/updateMeta.md: -------------------------------------------------------------------------------- 1 | [[TOC]] 2 | 3 | ## 接口含义 4 | 更新仪表盘部分元信息,主要是仪表盘名称、是否开启自动刷新配置 5 | 6 | ## 请求参数 7 | 8 | | 属性 | 说明 | 类型 | 默认值 | 9 | | ----- | ----------- | ------ | ------ | 10 | | title | 仪表盘名称| string | '' | 11 | | configure | 是否自动刷新,当开启自动刷新时 值为:`{"refresh": true}` | string | '{}' | 12 | 13 | 14 | ## 返回数据参数 15 | 16 | 返回数据整体格式参考[接口规范](#/guide/specification)中的请求成功接口。 17 | 18 | 19 | res.data 20 | 21 | 空 22 | 23 | 24 | ## 示例 25 | 26 | 27 | ```json 28 | { 29 | data: { 30 | } 31 | success: true, 32 | message: 'ok' 33 | } 34 | ``` 35 | -------------------------------------------------------------------------------- /doc/src/doc/view/api/widgetConfig.md: -------------------------------------------------------------------------------- 1 | [[TOC]] 2 | 3 | ## 接口含义 4 | 获取组件配置信息 5 | 6 | ## 请求参数 7 | 8 | | 属性 | 说明 | 类型 | 默认值 | 9 | | ----- | ----------- | ------ | ------ | 10 | | id | 组件id,对应新增中的name字段| string|number | '' | 11 | 12 | 13 | ## 返回数据参数 14 | 15 | 返回数据整体格式参考[接口规范](#/guide/specification)中的请求成功接口。 16 | 17 | 18 | res.data 19 | 20 | | 属性 | 说明 | 类型 | 默认值 | 21 | | ----- | ----------- | ------ | ------ | 22 | | configure | 组件详细配置信息,是个字符串化的JSON数据,这部分数据只需在前后端之间透传,无需后端逻辑处理 | '' | 23 | | title | 组件名称 | stringr | '' | 24 | | type | 组件类型 | string| '' | 25 | 26 | 27 | ## 示例 28 | 29 | 30 | ```json 31 | { 32 | data: { 33 | title: '下游模块可用性监控', 34 | type: 'mdcircle' 35 | configure: '{"style":{"decimals":2,"unit":"%","max":100,"min":0,"threshold":[[0,100,"#ffc91b"]]}, 36 | "datasource":{"api":"/api/get/mdcircle","method":"POST","params":{"dev":true}}, 37 | "title":"下游模块可用性监控-指标1仪表图","data":{"params":{"dev":true}}}' 38 | } 39 | success: true, 40 | message: 'ok' 41 | } 42 | ``` 43 | -------------------------------------------------------------------------------- /doc/src/doc/view/api/widgetCopy.md: -------------------------------------------------------------------------------- 1 | [[TOC]] 2 | ## 接口含义 3 | 在仪表盘综合管理页面中复制组件 4 | 5 | 6 | ## 请求参数 7 | 8 | | 属性 | 说明 | 类型 | 默认值 | 9 | | ----- | ----------- | ------ | ------ | 10 | | widgetsname | 组件名称,对应新增中的name字段 | number|string | - | 11 | 12 | 13 | ## 返回数据参数 14 | 15 | 返回数据整体格式参考[接口规范](#/guide/specification)中的请求成功接口。 16 | 17 | 18 | res.data 19 | 20 | | 属性 | 说明 | 类型 | 默认值 | 21 | | ----- | ----------- | ------ | ------ | 22 | | id | 新复制组件对应的仪表盘id | number | - | 23 | | name | 新复制组件名称,应保证唯一性 | number|string | - | 24 | | title | 新复制组件展示名称 | string | 'WIDGETS' | 25 | | type | 新复制组件类型 | string | 'WIDGETS' | 26 | 27 | ## 示例 28 | 29 | 30 | ```json 31 | { 32 | data: { 33 | id: 1803, 34 | name: '1803_1012', 35 | title: '-', 36 | type: 'WIDGETS' 37 | } 38 | success: true, 39 | message: 'ok' 40 | } 41 | ``` 42 | -------------------------------------------------------------------------------- /doc/src/doc/view/api/widgetCreate.md: -------------------------------------------------------------------------------- 1 | [[TOC]] 2 | ## 接口含义 3 | 在仪表盘综合管理页面中新增组件,点击加号新增 4 | 5 | 6 | ## 请求参数 7 | 8 | | 属性 | 说明 | 类型 | 默认值 | 9 | | ----- | ----------- | ------ | ------ | 10 | | line | 新增组件所在仪表盘的行数,应该在当前行的后面追加,也就是说如果当前行已经有组件了,应该在已有的基础上新增 | number | - | 11 | 12 | 13 | ## 返回数据参数 14 | 15 | 返回数据整体格式参考[接口规范](#/guide/specification)中的请求成功接口。 16 | 17 | 18 | res.data 19 | 20 | | 属性 | 说明 | 类型 | 默认值 | 21 | | ----- | ----------- | ------ | ------ | 22 | | id | 组件对应的仪表盘id | number | - | 23 | | name | 组件名称,应保证唯一性 | number|string | - | 24 | | title | 组件展示名称 | string | 'WIDGETS' | 25 | | type | 组件类型 | string | 'WIDGETS' | 26 | 27 | ## 示例 28 | 29 | 30 | ```json 31 | { 32 | data: { 33 | id: 1803, 34 | name: '1803_1011', 35 | title: '-', 36 | type: 'WIDGETS' 37 | } 38 | success: true, 39 | message: 'ok' 40 | } 41 | ``` 42 | -------------------------------------------------------------------------------- /doc/src/doc/view/api/widgetDelete.md: -------------------------------------------------------------------------------- 1 | [[TOC]] 2 | ## 接口含义 3 | 在仪表盘综合管理页面中删除组件 4 | 5 | 6 | ## 请求参数 7 | 8 | | 属性 | 说明 | 类型 | 默认值 | 9 | | ----- | ----------- | ------ | ------ | 10 | | widgetsname | 组件名称,对应新增中的name字段 | number|string | - | 11 | 12 | 13 | ## 返回数据参数 14 | 15 | 返回数据整体格式参考[接口规范](#/guide/specification)中的请求成功接口。 16 | 17 | 18 | res.data 19 | 空 20 | 21 | ## 示例 22 | 23 | 24 | ```json 25 | { 26 | data: {} 27 | success: true, 28 | message: 'ok' 29 | } 30 | ``` 31 | -------------------------------------------------------------------------------- /doc/src/doc/view/api/widgetSave.md: -------------------------------------------------------------------------------- 1 | [[TOC]] 2 | ## 接口含义 3 | 保存组件配置信息 4 | 5 | ## 请求参数 6 | 7 | | 属性 | 说明 | 类型 | 默认值 | 8 | | ----- | ----------- | ------ | ------ | 9 | | id | 组件id,对应新增中的name字段| string|number | '' | 10 | | type | 组件类型 | string| | '' | 11 | | configure | 组件详细配置,具体字段含义可以查看[可视化UI配置](#/doc/view/conf)部分文档 | string| | '' | 12 | 13 | ## 返回数据参数 14 | 15 | 返回数据整体格式参考[接口规范](#/guide/specification)中的请求成功接口。 16 | 17 | 18 | res.data 19 | 空 20 | 21 | 22 | ## 示例 23 | 24 | 25 | ```json 26 | { 27 | data: {} 28 | success: true, 29 | message: 'ok' 30 | } 31 | ``` 32 | -------------------------------------------------------------------------------- /doc/src/doc/view/guide.md: -------------------------------------------------------------------------------- 1 | [[TOC]] 2 | ## 概述 3 | 4 | 仪表盘是NoahV主要的组成部分,也是我们提供的运维场景组件,只需按照格式提供相应的数据接口就能让你的项目拥有一整套可视化仪表盘功能,目前仪表盘提供功能主要有: 5 | 6 | * 1.仪表盘管理,包含创建、编辑、删除、检索等功能 7 | * 2.仪表盘布局拖动管理 8 | * 3.可视化组件UI配置,目前支持趋势图、仪表图、数据面板、数据报表四种常见可视化组件 9 | * 4.仪表盘刷新、全屏展示等功能 10 | 11 | 12 | 如下图所示为示例Dashboard,支持阈值和自定义颜色样式展示,轻松定位数据异常。 13 | 14 | 15 | 16 | 17 | 18 | ## 使用概览 19 | 20 | 目前仪表盘是作为场景组件整合在NoahV的仪表盘项目模板中,只包括展现层相关功能,所以如果需要接入仪表盘使用,需要按照格式提供仪表盘对应的数据接口,需要的数据接口列表以及格式参考[API接口](#/doc/view/api/api)部分文档。 21 | 22 | 23 | 24 | 得力于数据模拟的功能,我们的仪表盘示例配置好了完善的模拟数据,您可以直接使用模拟数据体验仪表盘的方便快捷和实用。具体请参考[快速使用](#/doc/view/quickstart)部分文档 25 | 26 | 仪表盘现支持趋势图、仪表图、数据面板、数据报表四种常见可视化组件,四种组件配置和使用方式请参考[可视化组件UI配置](#/doc/view/conf)部分文档 27 | -------------------------------------------------------------------------------- /doc/src/doc/visualComponent/config/widgetApi.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file visual widget config 3 | * 4 | * @author wang_jing13@163.com 5 | */ 6 | export default { 7 | mons: { 8 | dataApi: { 9 | saMdCircle: '/api/index.php?r=MetricNew/circle', 10 | saMdBillboard: '/api/index.php?r=MetricNew/billboard', 11 | saMdTrend: '/api/index.php?r=MetricNew/trend', 12 | saMdReport: '/api/index.php?r=MetricNew/report' 13 | }, 14 | confApi: { 15 | saMdCircle: '/api/?r=conf/get', 16 | saMdBillboard: '/api/?r=conf/get', 17 | saMdTrend: '/api/?r=conf/get', 18 | saMdReport: '/api/?r=conf/get' 19 | } 20 | }, 21 | getAPI(api) { 22 | return api; 23 | } 24 | }; 25 | -------------------------------------------------------------------------------- /doc/src/example/dutyTable/nvDutyTableNormalDemo.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 20 | -------------------------------------------------------------------------------- /doc/src/guide/about.md: -------------------------------------------------------------------------------- 1 | [[TOC]] 2 | 3 | ## 概述 4 | 5 | NoahV是一个基于vue开发的前端开发框架,主要适用于监控运维、数据分析等场景,同时也适用于常见的后台管理系统。主要包括如下特性: 6 | 7 | * 组件丰富,提供常用的各类组件,快速开始前端开发 8 | * 导航栏、页面布局JSON配置,无需代码逻辑开发 9 | * API数据模拟和API数据代理,让前后端不再耦合,联调更简单,效率更高 10 | * 数据仪表盘功能,满足常见的数据可视化需求,助力数据分析场景 11 | * 实用的脚手架功能,项目初始化、模板复用、模拟数据创建、调试server启动、框架升级一行命令通通搞定 12 | 13 | ## 系统架构 14 | 15 | NoahV框架由五大部分组成,分别是: 16 | 17 | 18 | 19 | * 底层框架:采用上手简单易用的Vuejs 20 | * 组件模板库:主要有运维业务组件【服务树、趋势图、仪表图、数据面板、运维流程、运维表格、运维表单等】和运维场景组件【仪表盘】 21 | * 代码质量/规范:主要有API规范、开发规范、UI规范等,另外内置单测工具,自动生成各个页面的单测模板,单测的覆盖率、代码覆盖与否一目了然。 22 | * 功能特性:主要包括导航和页面布局JSON配置、主题定制、访问统计以及可以简化前后端联调过程的本地数据模拟和API数据代理功能 23 | * 命令行工具:提供实用的脚手架功能 24 | 25 | 26 | 框架示意图如下所示: 27 | 28 | 29 | 30 | ## 联系我们 31 | 32 | 了解或使用过程中有任何疑问都可以加入微信用户交流群或者到Github提Issues反馈咨询。 33 | 34 | Github Issues地址: baidu/NoahV/issues 35 | 36 | 微信交流群: 37 | 38 | 39 | -------------------------------------------------------------------------------- /doc/src/guide/deploy.md: -------------------------------------------------------------------------------- 1 | [[TOC]] 2 | 3 | ## 概述 4 | 本章主要介绍NoahV项目的构建部署相关知识。 5 | 6 | 在本地开发时,我们使用 `noahv start` 命令启动服务,但在应用部署的时候不可以再这样使用,`noahv start`会针对本地开发做很多处理,而生产运行需要一个更加简单稳定的方式。所以本章主要讲解如何部署你的应用。 7 | 8 | ## 构建 9 | 10 | 项目初始化后目录中会自带一个 `build.sh` 的文件,该文件主要是执行的代码编译框架的过程,经过该脚本构建之后会将所有的配置文件和依赖进行压缩合并,在output目录下产出一个 `noahv.tar.gz` 的包,压缩包中的文件结构如下所示: 11 | 12 | ```bash 13 | noahv.tar.gz 14 | ├── static (js/css/image) 15 | └── index.html (入口文件) 16 | ``` 17 | 18 | 19 | 29 | 30 | 31 | 32 | ## 部署 33 | 34 | 目前NoahV构建之后暂不支持独立部署,而是作为静态文件随API server一起部署,一般是将上述静态文件放到对应的后端框架的指定目录中 35 | 36 | 37 | 如对于 java spring 框架,将压缩包解压到 `static` 目录中,将入口指到 `static/index.html` 即可。 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /doc/src/guide/qa.md: -------------------------------------------------------------------------------- 1 | [[TOC]] 2 | ## 常见问题 3 | 4 | 5 | **1.项目初始化失败提示:get template failed** 6 | 7 | 问题出现原因:NoahV-Cli版本过低或者网络情况异常。 8 | 9 | 问题解决方法: 10 | 1.升级到最新版本 `npm update -g noahv-cli`。 11 | 2.访问Github官网,看是否能正常访问,请确保能正常访问。 12 | 13 | 14 | 15 | **2.命令行工具报错 `SyntaxError: Unexpected token `** 16 | 17 | 问题出现原因:本地环境Node版本过低。 18 | 19 | 问题解决方法:升级Node版本,确保最低版本高于v6.5。 20 | 21 | 22 | **3.提示NoahV相关代码模块某一版本下载安装失败** 23 | 24 | 问题出现原因:当前使用的NPM源为非官方源。 25 | 26 | 问题解决方法:更换到NPM官方源,或者联系源管理员反馈。 27 | -------------------------------------------------------------------------------- /doc/src/guide/theme.md: -------------------------------------------------------------------------------- 1 | [[TOC]] 2 | 3 | ## 样式定义 4 | 1、在/src/common/assets/css/theme/中新建(替换)样式文件my-theme.less 5 | 2、定义样式变量,如: 6 | ```less 7 | @rate-star-color: #8c0776; // for iview variate 8 | @noahv-btn-error-color: #8c0776; // for noahv variate 9 | ``` 10 | 3、在/src/common/assets/css/main.less文件中 'import theme style' 注释下引入你要引用的主题文件(my-theme.less) 11 | ```less 12 | ... 13 | // import theme style 14 | @import './theme/my-theme.less'; 15 | ``` 16 | 17 | ## 样式规则 18 | 19 | 为确保项目整体样式风格能够通过主题设置,样式定义请遵循以下规则: 20 | 21 | 1、使用iview组件或noahv组件时,禁止直接采用样式覆盖改变原有样式,如需覆盖,请添加scoped做作用域限制; 22 | 2、自定义组件时,字号、颜色、背景色等属性值使用iview/noahv样式变量定义: 23 | [iview样式变量](https://github.com/iview/iview/blob/2.0/src/styles/custom.less) 24 | [noahv样式变量](https://github.com/baidu/NoahV/blob/master/template/common/src/common/assets/css/theme/custom.less) 25 | 3、请在自定义样式主题文件中重定义iview/noahv样式变量的值,如/src/common/assets/css/theme/cusmy-theme.less,禁止在其他文件中重定义; -------------------------------------------------------------------------------- /doc/src/store/mutation-types.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file mutation-types 3 | * @author darren(darrenywyu@gmail.com) 4 | * Joannamo(joannamo123@163.com) 5 | */ 6 | export const LOGIN = 'LOGIN'; 7 | export const UPDATE_BASE_FLAG = 'UPDATE_BASE_FLAG'; 8 | 9 | 10 | -------------------------------------------------------------------------------- /doc/src/tools/axiosInstance.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file axios instance 3 | * @author darren(darrenywyu@gmail.com) 4 | * Joannamo(joannamo123@163.com) 5 | */ 6 | 7 | import request from 'noahv-request'; 8 | 9 | export default request; 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /doc/src/tools/mock.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file mockjs conf 3 | * @author Joannamo(joannamo123@163.com) 4 | */ 5 | 6 | /* eslint-disable no-undef */ 7 | require('mock/api/tpl/form'); 8 | require('mock/api/tpl/table'); 9 | require('mock/api/tpl/trend'); 10 | require('mock/api/tpl/tabledelete'); 11 | require('mock/api/tpl/filterTable'); 12 | require('mock/api/tpl/formGet'); 13 | require('mock/api/tpl/formSubmit'); 14 | require('mock/api/tpl/charts'); 15 | require('mock/api/tpl/time-trend'); 16 | require('mock/api/tpl/business'); 17 | require('mock/api/tpl/ajax'); 18 | /* eslint-enable */ 19 | -------------------------------------------------------------------------------- /doc/src/tools/utils.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file public tools 3 | * @author Joannamo(joannamo123@163.com) 4 | */ 5 | 6 | const utils = {}; 7 | 8 | utils.getQueryString = (search, name) => { 9 | const reg = new RegExp('(^|&)'+ name +'=([^&]*)(&|$)'); 10 | const r = search.substr(1).match(reg); 11 | if (r != null) { 12 | return unescape(r[2]); 13 | } 14 | }; 15 | 16 | utils.getRedirectLink = (header, sidebar) => { 17 | let result = ''; 18 | const headerLink = header.link; 19 | const link = sidebar.link; 20 | const toggleLink = sidebar.toggleLink; 21 | 22 | if (typeof headerLink === 'undefined' || headerLink === '') { 23 | // two level 24 | if (link !== '') { 25 | result = link; 26 | } 27 | // three level 28 | else { 29 | result = toggleLink; 30 | } 31 | } 32 | 33 | // one level 34 | if (typeof headerLink !== 'undefined' && headerLink !== '') { 35 | result = headerLink; 36 | } 37 | 38 | return result; 39 | }; 40 | 41 | export default utils; 42 | -------------------------------------------------------------------------------- /doc/test/unit/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | 3 | // require all test files (files that ends with .spec.js) 4 | const testsContext = require.context('./specs', true, /\.spec$/); 5 | testsContext.keys().forEach(testsContext); 6 | 7 | // require all src files except main.js for coverage. 8 | // you want coverage for. 9 | const srcContext = require.context('../../src', true, /^\.\/(?!main(\.js)?$)/); 10 | srcContext.keys().forEach(srcContext); 11 | -------------------------------------------------------------------------------- /doc/test/unit/specs/example/trend/trend.spec.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by noahv-cli. 3 | */ 4 | 5 | /* eslint-disable no-undef */ 6 | import Vue from 'vue'; 7 | import { destroyVM } from '../util'; 8 | import exampleTrendTrend from 'src/example/trend/trend' 9 | 10 | describe('exampleTrendTrend', () => { 11 | let vm; 12 | afterEach(() => { 13 | destroyVM(vm); 14 | }); 15 | 16 | // visit http://www.chaijs.com/api/ for more detail for insertion 17 | it('has a data hook', () => { 18 | expect(typeof exampleTrendTrend.data).to.equal('function'); 19 | }); 20 | 21 | it('new instance', () => { 22 | vm = new Vue(tableDemo).$mount(); 23 | // expect() 24 | }); 25 | 26 | // your expect 27 | }); 28 | /* eslint-enable 29 | -------------------------------------------------------------------------------- /doc/test/unit/specs/guide/about.spec.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import { destroyVM } from '../util'; 3 | import guideAbout from 'src/guide/about' 4 | 5 | describe('guideAbout', () => { 6 | let vm; 7 | afterEach(() => { 8 | destroyVM(vm); 9 | }); 10 | 11 | // visit http://www.chaijs.com/api/ for more detail for insertion 12 | it('has a data hook', () => { 13 | expect(typeof guideAbout.data).to.equal('function'); 14 | }); 15 | 16 | // it('must has a default data', () => { 17 | // const defaultData = guideAbout.data(); 18 | // expect(typeof defaultData.columns).to.equal('object'); 19 | // }); 20 | 21 | // it('defaultPageSize is 10', () => { 22 | // const vm = new Vue(guideAbout).$mount(); 23 | // expect(vm.pagination.defaultPageSize).to.equal(10); 24 | // }); 25 | 26 | // it('renders the correct message', () => { 27 | // const Constructor = Vue.extend(guideAbout) 28 | // const vm = new Constructor().$mount() 29 | // expect(vm.$el.textContent).to.include('xxxx') 30 | // }) 31 | }); -------------------------------------------------------------------------------- /doc/test/unit/specs/guide/menu.spec.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import { destroyVM } from '../util'; 3 | import guideMenu from 'src/guide/menu' 4 | 5 | describe('guideMenu', () => { 6 | let vm; 7 | afterEach(() => { 8 | destroyVM(vm); 9 | }); 10 | 11 | // visit http://www.chaijs.com/api/ for more detail for insertion 12 | it('has a data hook', () => { 13 | expect(typeof guideMenu.data).to.equal('function'); 14 | }); 15 | 16 | // it('must has a default data', () => { 17 | // const defaultData = guideMenu.data(); 18 | // expect(typeof defaultData.columns).to.equal('object'); 19 | // }); 20 | 21 | // it('defaultPageSize is 10', () => { 22 | // const vm = new Vue(guideMenu).$mount(); 23 | // expect(vm.pagination.defaultPageSize).to.equal(10); 24 | // }); 25 | 26 | // it('renders the correct message', () => { 27 | // const Constructor = Vue.extend(guideMenu) 28 | // const vm = new Constructor().$mount() 29 | // expect(vm.$el.textContent).to.include('xxxx') 30 | // }) 31 | }); -------------------------------------------------------------------------------- /doc/test/unit/specs/guide/tpl.spec.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import { destroyVM } from '../util'; 3 | import guideTpl from 'src/guide/tpl' 4 | 5 | describe('guideTpl', () => { 6 | let vm; 7 | afterEach(() => { 8 | destroyVM(vm); 9 | }); 10 | 11 | // visit http://www.chaijs.com/api/ for more detail for insertion 12 | it('has a data hook', () => { 13 | expect(typeof guideTpl.data).to.equal('function'); 14 | }); 15 | 16 | // it('must has a default data', () => { 17 | // const defaultData = guideTpl.data(); 18 | // expect(typeof defaultData.columns).to.equal('object'); 19 | // }); 20 | 21 | // it('defaultPageSize is 10', () => { 22 | // const vm = new Vue(guideTpl).$mount(); 23 | // expect(vm.pagination.defaultPageSize).to.equal(10); 24 | // }); 25 | 26 | // it('renders the correct message', () => { 27 | // const Constructor = Vue.extend(guideTpl) 28 | // const vm = new Constructor().$mount() 29 | // expect(vm.$el.textContent).to.include('xxxx') 30 | // }) 31 | }); -------------------------------------------------------------------------------- /doc/test/unit/specs/tableDemo.spec.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import {destroyVM } from '../util'; 3 | import tableDemo from 'src/demo/table/tableDemo' 4 | 5 | describe('tableTpl', () => { 6 | let vm; 7 | afterEach(() => { 8 | destroyVM(vm); 9 | }); 10 | // visit http://www.chaijs.com/api/ for more detail 11 | 12 | it('has a data hook', () => { 13 | expect(typeof tableDemo.data).to.equal('function'); 14 | }); 15 | 16 | it('must has a default data', () => { 17 | const defaultData = tableDemo.data(); 18 | expect(typeof defaultData.columns).to.equal('object'); 19 | }); 20 | 21 | it('defaultPageSize is 10', () => { 22 | vm = new Vue(tableDemo).$mount(); 23 | expect(vm.pagination.defaultPageSize).to.equal(10); 24 | }); 25 | 26 | it('renders the correct message', () => { 27 | const Constructor = Vue.extend(tableDemo) 28 | vm = new Constructor().$mount() 29 | expect(vm.$el.textContent).to.include('xxxx') 30 | }) 31 | }); -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "noahv", 3 | "version": "0.0.2", 4 | "description": "A front-end application framework based on vue, easy to handle, suitable for teams lacking front-end engineers,support the monitoring、operation、data analysis and common background management system.", 5 | "homepage": "https://github.com/baidu/NoahV", 6 | "repository": { 7 | "type": "git", 8 | "url": "https://github.com/baidu/NoahV" 9 | }, 10 | "author": "darrenywyu", 11 | "license": "Apache-2.0", 12 | "dependencies": {}, 13 | "devDependencies": {} 14 | } 15 | -------------------------------------------------------------------------------- /packages/noahv-core/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["env", "stage-2"], 3 | "plugins": ["transform-runtime", "transform-vue-jsx"], 4 | "comments": false 5 | } -------------------------------------------------------------------------------- /packages/noahv-core/README.md: -------------------------------------------------------------------------------- 1 | ## NoahV-Core 2 | 3 | Kernel module of [NoahV](https://github.com/baidu/NoahV) 4 | 5 | 6 | ## LICENSE 7 | 8 | Apache License 2.0 -------------------------------------------------------------------------------- /packages/noahv-core/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * NoahV Core 3 | * Copyright (c) 2019 Baidu, Inc. All Rights Reserved. 4 | * 5 | * @file NoahV Core 6 | * @author darren(darrenywyu@gmail.com) 7 | */ 8 | 9 | import noahvCore from './lib'; 10 | 11 | export default noahvCore; 12 | -------------------------------------------------------------------------------- /packages/noahv-core/lib/header/logo.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 22 | -------------------------------------------------------------------------------- /packages/noahv-core/util/eventBus.js: -------------------------------------------------------------------------------- 1 | /** 2 | * NoahV Core 3 | * Copyright (c) 2019 Baidu, Inc. All Rights Reserved. 4 | * 5 | * @file eventBus 6 | * @author darren(darrenywyu@gmail.com) 7 | */ 8 | 9 | import Vue from 'vue'; 10 | export const eventBus = new Vue(); 11 | -------------------------------------------------------------------------------- /packages/noahv-i18n/README.md: -------------------------------------------------------------------------------- 1 | ## noahv-i18n 2 | 3 | i18n util for [NoahV](https://github.com/baidu/NoahV) 4 | 5 | ## LICENSE 6 | 7 | Apache License 2.0 -------------------------------------------------------------------------------- /packages/noahv-i18n/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * NoahV Tongji 3 | * Copyright (c) 2019 Baidu, Inc. All Rights Reserved. 4 | * 5 | * @file NoahV Tongji 6 | * @author darren(darrenywyu@gmail.com) 7 | */ 8 | 9 | import noahvI18n from './lib'; 10 | 11 | export default noahvI18n; 12 | -------------------------------------------------------------------------------- /packages/noahv-i18n/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "noahv-i18n", 3 | "version": "0.0.6", 4 | "description": "i18n for noahv", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [ 10 | "noahv", 11 | "track", 12 | "tongji" 13 | ], 14 | "homepage": "https://github.com/baidu/NoahV", 15 | "repository": { 16 | "type": "git", 17 | "url": "https://github.com/baidu/NoahV/tree/master/packages/noahv-i18n" 18 | }, 19 | "author": "darrenywyu@gmail.com", 20 | "license": "Apache-2.0", 21 | "dependencies": { 22 | "js-cookie": "^2.2.1", 23 | "vue-i18n": "^8.15.4" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /packages/noahv-mockup/README.md: -------------------------------------------------------------------------------- 1 | ## noahv-mockup 2 | 3 | A convenient mockup library for [NoahV](https://github.com/baidu/NoahV) 4 | 5 | ## LICENSE 6 | 7 | Apache License 2.0 -------------------------------------------------------------------------------- /packages/noahv-mockup/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * NoahV Mockup 3 | * Copyright (c) 2019 Baidu, Inc. All Rights Reserved. 4 | * 5 | * @file NoahV Mockup 6 | * @author darren(darrenywyu@gmail.com) 7 | */ 8 | 9 | module.exports = require('./lib'); 10 | -------------------------------------------------------------------------------- /packages/noahv-mockup/lib/logger.js: -------------------------------------------------------------------------------- 1 | /** 2 | * NoahV Mockup 3 | * Copyright (c) 2019 Baidu, Inc. All Rights Reserved. 4 | * 5 | * @file format log 6 | * @author darren(darrenywyu@gmail.com) 7 | */ 8 | 9 | let chalk = require('chalk'); 10 | 11 | function log(mod, status, msg, color) { 12 | let drawColor = chalk[color]; 13 | console.log(mod + ' ' + drawColor(status) + ' ' + msg); 14 | } 15 | 16 | let logger = { 17 | ok: function (mod, status, msg) { 18 | log(mod, status, msg, 'green'); 19 | }, 20 | error: function (mod, status, msg) { 21 | log(mod, status, msg, 'red'); 22 | } 23 | }; 24 | 25 | module.exports = exports = logger; 26 | -------------------------------------------------------------------------------- /packages/noahv-mockup/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "noahv-mockup", 3 | "version": "1.0.3", 4 | "description": "mockup library for noahv", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [ 10 | "noahv", 11 | "mockup" 12 | ], 13 | "homepage": "https://github.com/baidu/NoahV", 14 | "repository": { 15 | "type": "git", 16 | "url": "https://github.com/baidu/NoahV/tree/master/packages/noahv-mockup" 17 | }, 18 | "author": "darrenywyu", 19 | "license": "Apache-2.0", 20 | "dependencies": { 21 | "chalk": "^2.4.1", 22 | "lodash": "^4.17.11", 23 | "qs": "^6.5.2", 24 | "url-parse": "^1.4.0" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /packages/noahv-request/README.md: -------------------------------------------------------------------------------- 1 | ## noahv-request 2 | 3 | Request util for [NoahV](https://github.com/baidu/NoahV) 4 | 5 | ## LICENSE 6 | 7 | Apache License 2.0 -------------------------------------------------------------------------------- /packages/noahv-request/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * NoahV 3 | * Copyright (c) 2019 Baidu, Inc. All Rights Reserved. 4 | * 5 | * @file NoahV Request 6 | * @author darren(darrenywyu@gmail.com) 7 | */ 8 | 9 | import request from './lib'; 10 | 11 | export default request; 12 | -------------------------------------------------------------------------------- /packages/noahv-request/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "noahv-request", 3 | "version": "1.0.5", 4 | "description": "request library for noahv", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [ 10 | "noahv", 11 | "request", 12 | "xhr" 13 | ], 14 | "homepage": "https://github.com/baidu/NoahV", 15 | "repository": { 16 | "type": "git", 17 | "url": "https://github.com/baidu/NoahV/tree/master/packages/noahv-request" 18 | }, 19 | "author": "darrenywyu", 20 | "license": "Apache-2.0", 21 | "dependencies": { 22 | "axios": "^0.18.0", 23 | "qs": "^6.5.2", 24 | "underscore": "^1.9.0", 25 | "url-parse": "^1.4.0", 26 | "vue": "^2.5.16" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /packages/noahv-tongji/README.md: -------------------------------------------------------------------------------- 1 | ## noahv-tongji 2 | 3 | Baidu tongji util for [NoahV](https://github.com/baidu/NoahV) 4 | 5 | ## LICENSE 6 | 7 | Apache License 2.0 -------------------------------------------------------------------------------- /packages/noahv-tongji/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * NoahV Tongji 3 | * Copyright (c) 2019 Baidu, Inc. All Rights Reserved. 4 | * 5 | * @file NoahV Tongji 6 | * @author darren(darrenywyu@gmail.com) 7 | */ 8 | 9 | import tongji from './lib'; 10 | 11 | export default tongji; 12 | -------------------------------------------------------------------------------- /packages/noahv-tongji/lib/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * NoahV Tongji 3 | * Copyright (c) 2019 Baidu, Inc. All Rights Reserved. 4 | * 5 | * @file tongji plugin 6 | * @author darren(darrenywyu@gmail.com) 7 | */ 8 | 9 | import loadjs from 'loadjs'; 10 | 11 | let tongji = { 12 | setAccount(userid) { 13 | loadjs('//hm.baidu.com/hm.js' + '?' + userid); 14 | } 15 | }; 16 | 17 | export default tongji; 18 | -------------------------------------------------------------------------------- /packages/noahv-tongji/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "noahv-tongji", 3 | "version": "1.0.3", 4 | "description": "track for noahv", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [ 10 | "noahv", 11 | "track", 12 | "tongji" 13 | ], 14 | "homepage": "https://github.com/baidu/NoahV", 15 | "repository": { 16 | "type": "git", 17 | "url": "https://github.com/baidu/NoahV/tree/master/packages/noahv-tongji" 18 | }, 19 | "author": "darrenywyu@gmail.com", 20 | "license": "Apache-2.0", 21 | "dependencies": { 22 | "loadjs": "^3.5.4" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /template/common-ts/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["env", "stage-2"], 3 | "plugins": ["transform-runtime", "transform-vue-jsx"], 4 | "comments": false, 5 | "env": { 6 | "test": { 7 | "plugins": [ "istanbul" ] 8 | } 9 | } 10 | } 11 | 12 | -------------------------------------------------------------------------------- /template/common-ts/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | dist/ 4 | npm-debug.log 5 | saas 6 | test/unit/coverage/ 7 | -------------------------------------------------------------------------------- /template/common-ts/README.md: -------------------------------------------------------------------------------- 1 | ## NoahV 2 | * [about](http://noahv.org/#/guide/about) 3 | * [quickstart](http://noahv.org/#/guide/quickstart) 4 | * [github](https://github.com/baidu/NoahV) 5 | -------------------------------------------------------------------------------- /template/common-ts/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | FILE_NAME="noahv" 4 | 5 | CUR_DIR=$(cd `dirname $0`; pwd) 6 | 7 | # prepare 8 | if [ -d $CUR_DIR/output ]; then 9 | rm -rf $CUR_DIR/output 10 | fi 11 | 12 | if [ -d $CUR_DIR/noahv ]; then 13 | rm -rf $CUR_DIR/noahv 14 | fi 15 | 16 | echo "install node_module" 17 | npm install 18 | 19 | # build 20 | echo "npm build start" 21 | 22 | node scripts/build.js 23 | 24 | if [ $? -ne 0 ]; then 25 | echo "build failed!" 26 | exit 1; 27 | fi 28 | echo "npm build success" 29 | 30 | mv noahv output 31 | 32 | # tar 33 | cd output 34 | tar -zcf $FILE_NAME.tar.gz * 35 | ls . | fgrep -v $FILE_NAME.tar.gz | xargs rm -rf 36 | 37 | echo "build success" 38 | exit 0; 39 | -------------------------------------------------------------------------------- /template/common-ts/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NoahV 示例项目 6 | 7 | 8 |
9 | 10 |
11 | 12 | 13 | -------------------------------------------------------------------------------- /template/common-ts/mockup/api/demo/chart/column/get.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by noahv-cli. 3 | */ 4 | 5 | /* eslint-disable no-undef,no-unused-vars */ 6 | let mockup = require('noahv-mockup').mockupTool; 7 | 8 | exports.response = (path, params) => { 9 | 10 | return mockup.ok( 11 | { 12 | // id: 1 13 | } 14 | ); 15 | 16 | }; 17 | /* eslint-enable */ 18 | -------------------------------------------------------------------------------- /template/common-ts/mockup/api/demo/form/default.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by noahv-cli. 3 | */ 4 | 5 | /* eslint-disable no-undef,no-unused-vars */ 6 | let mockup = require('noahv-mockup').mockupTool; 7 | 8 | exports.response = (path, params) => { 9 | 10 | return mockup.ok( 11 | { 12 | username: 'username form default Api' 13 | } 14 | ); 15 | 16 | }; 17 | /* eslint-enable */ 18 | -------------------------------------------------------------------------------- /template/common-ts/mockup/api/demo/form/submit.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by noahv-cli. 3 | */ 4 | 5 | /* eslint-disable no-undef,no-unused-vars */ 6 | let mockup = require('noahv-mockup').mockupTool; 7 | 8 | exports.response = (path, params) => { 9 | 10 | return mockup.ok( 11 | { 12 | // id: 1 13 | } 14 | ); 15 | 16 | }; 17 | /* eslint-enable */ 18 | -------------------------------------------------------------------------------- /template/common-ts/mockup/api/demo/table/delete.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by noahv-cli. 3 | */ 4 | 5 | /* eslint-disable no-undef,no-unused-vars */ 6 | let mockup = require('noahv-mockup').mockupTool; 7 | 8 | exports.response = (path, params) => { 9 | 10 | return mockup.ok( 11 | { 12 | // id: 1 13 | } 14 | ); 15 | 16 | }; 17 | /* eslint-enable */ 18 | -------------------------------------------------------------------------------- /template/common-ts/mockup/api/demo/table/filter/delete.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by noahv-cli. 3 | */ 4 | 5 | /* eslint-disable no-undef,no-unused-vars */ 6 | let mockup = require('noahv-mockup').mockupTool; 7 | 8 | exports.response = (path, params) => { 9 | 10 | return mockup.ok( 11 | { 12 | // id: 1 13 | } 14 | ); 15 | 16 | }; 17 | /* eslint-enable */ 18 | -------------------------------------------------------------------------------- /template/common-ts/mockup/api/user.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by noahv-cli. 3 | */ 4 | 5 | /* eslint-disable no-undef,no-unused-vars */ 6 | let mockup = require('noahv-mockup').mockupTool; 7 | 8 | exports.response = (path, params) => { 9 | 10 | return mockup.ok( 11 | { 12 | userName: '管理员' 13 | } 14 | ); 15 | 16 | }; 17 | /* eslint-enable */ 18 | -------------------------------------------------------------------------------- /template/common-ts/scripts/build.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | process.env.NODE_ENV = 'production'; 3 | var path = require('path') 4 | var config = require('./config') 5 | var ora = require('ora') 6 | const fs = require('fs-extra') 7 | var webpack = require('webpack') 8 | var webpackConfig = require('./webpack.prod.conf') 9 | 10 | var spinner = ora('building for production...') 11 | spinner.start() 12 | 13 | var assetsPath = path.join(config.build.assetsRoot, config.build.assetsSubDirectory) 14 | fs.removeSync(assetsPath) 15 | fs.mkdirpSync(assetsPath) 16 | 17 | var staticPath = path.resolve('static'); 18 | if (fs.pathExistsSync(staticPath)) { 19 | fs.copySync('static/*', assetsPath); 20 | } 21 | 22 | webpack(webpackConfig, function(err, stats) { 23 | spinner.stop(); 24 | process.stdout.write(stats.toString({ 25 | colors: true, 26 | modules: false, 27 | children: false, 28 | chunks: false, 29 | chunkModules: false 30 | }) + '\n'); 31 | if (err || stats.hasErrors()) { 32 | process.exit(1); 33 | } 34 | }) -------------------------------------------------------------------------------- /template/common-ts/scripts/dev-client.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | require('eventsource-polyfill') 3 | var hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true') 4 | 5 | hotClient.subscribe(function(event) { 6 | if (event.action === 'reload') { 7 | window.location.reload() 8 | } 9 | }) -------------------------------------------------------------------------------- /template/common-ts/src/common/assets/css/global.less: -------------------------------------------------------------------------------- 1 | body, div, span, header, footer, nav, section, aside, article, ul, dl, dt, dd, li, a, p, h1, h2, h3, h4,h5, i, b, textarea, button, input, select { 2 | padding: 0; 3 | margin: 0; 4 | list-style: none; 5 | font-style: normal; 6 | text-decoration: none; 7 | border: none; 8 | // color: #313131; 9 | box-sizing: border-box; 10 | font-family: "Microsoft YaHei",-apple-system,BlinkMacSystemFont,"SF Pro SC","SF Pro Text","Helvetica Neue",Helvetica,"PingFang SC","Segoe UI",Roboto,"Hiragino Sans GB","Arial","microsoft yahei ui",SimSun,sans-serif; 11 | -webkit-tap-highlight-color:transparent; 12 | &:focus { 13 | outline: none; 14 | } 15 | } 16 | 17 | 18 | html { 19 | height: 100%; 20 | width: 100%; 21 | overflow-x: hidden; 22 | } 23 | body { 24 | height: 100%; 25 | width: 100%; 26 | background: #f5f7f9; 27 | } 28 | .ivu-spin-fullscreen { 29 | background-color: rgba(252, 252, 252, .4) 30 | } 31 | 32 | 33 | -------------------------------------------------------------------------------- /template/common-ts/src/common/assets/css/header.less: -------------------------------------------------------------------------------- 1 | .noahv-layout { 2 | .noahv-layout-header { 3 | .noahv-layout-header-inner { 4 | // logo 5 | .noahv-layout-logo { 6 | width: 120px; 7 | img { 8 | height: 45px; 9 | margin-top: 0px; 10 | } 11 | } 12 | .noahv-layout-nav { 13 | left: 180px; 14 | .menu-list { 15 | min-width: 145px; 16 | } 17 | } 18 | } 19 | 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /template/common-ts/src/common/assets/css/loading.less: -------------------------------------------------------------------------------- 1 | .noahv-loading { 2 | display: block; 3 | animation: noahv-loading 1s linear infinite; 4 | } 5 | @keyframes noahv-loading { 6 | from { transform: rotate(0deg);} 7 | 50% { transform: rotate(180deg);} 8 | to { transform: rotate(360deg);} 9 | } -------------------------------------------------------------------------------- /template/common-ts/src/common/assets/css/main.less: -------------------------------------------------------------------------------- 1 | // relationship of style level: iview -> noahv -> theme 2 | // import iview style 3 | @import '~iview/src/styles/index.less'; 4 | 5 | // import noahv style 6 | @import '~noahv-component/src/assets/css/index.less'; 7 | 8 | @import '~noahv-core/lib/header/header.less'; 9 | 10 | // import noahv global and components style 11 | @import './global.less'; 12 | @import './header.less'; 13 | 14 | @import './theme/custom.less'; 15 | @import './theme/components/index.less'; 16 | @import './loading.less'; 17 | 18 | // import noahv component style 19 | 20 | // import theme style 21 | @import './theme/my-theme.less'; 22 | -------------------------------------------------------------------------------- /template/common-ts/src/common/assets/css/theme/components/checkbox.less: -------------------------------------------------------------------------------- 1 | @import '../custom.less'; 2 | .ivu-checkbox-inner { 3 | width: @noahv-checkbox-width; 4 | height: @noahv-checkbox-height; 5 | border: @noahv-checkbox-default-border; 6 | background-color: @noahv-checkbox-default-bg; 7 | } 8 | .ivu-checkbox-checked .ivu-checkbox-inner { 9 | border-color: @noahv-checkbox-checked-color; 10 | background-color: @noahv-checkbox-checked-color; 11 | } 12 | 13 | .ivu-checkbox-disabled .ivu-checkbox-inner, .ivu-checkbox-disabled.ivu-checkbox-checked .ivu-checkbox-inner { 14 | border-color: @noahv-checkbox-disabled-border; 15 | background-color: @noahv-checkbox-disabled-bg; 16 | } 17 | 18 | .ivu-checkbox-focus { 19 | box-shadow: @noahv-checkbox-box-shadow; 20 | } 21 | 22 | .ivu-checkbox-wrapper { 23 | margin-right: @noahv-checkbox-wapper-margin-right; 24 | } -------------------------------------------------------------------------------- /template/common-ts/src/common/assets/css/theme/components/index.less: -------------------------------------------------------------------------------- 1 | @import './button.less'; 2 | @import './table.less'; 3 | @import './input.less'; 4 | @import './radio.less'; 5 | @import './checkbox.less'; 6 | @import './toast.less'; 7 | @import './tooltip.less'; 8 | @import './modal.less'; 9 | @import './tabs.less'; 10 | @import './page.less'; 11 | @import './select.less'; 12 | @import './switch.less'; -------------------------------------------------------------------------------- /template/common-ts/src/common/assets/css/theme/components/input.less: -------------------------------------------------------------------------------- 1 | @import '../custom.less'; 2 | .ivu-input { 3 | border-radius: @noahv-input-border-radius; 4 | padding: @noahv-input-padding; 5 | border: @noahv-input-default-border; 6 | color: @noahv-font-text-color; 7 | height: @nohav-input-height; 8 | } 9 | 10 | .ivu-input:focus { 11 | border-color: @noahv-input-focus-color; 12 | box-shadow: @noahv-input-focus-box-shadow; 13 | background: @noahv-input-active-bg; 14 | } 15 | 16 | .ivu-input:hover { 17 | border-color: @noahv-input-focus-color; 18 | } 19 | 20 | .ivu-input::-webkit-input-placeholder { 21 | color: @noahv-font-placeholder-color; 22 | font-size: @noahv-font-size-base 23 | } 24 | 25 | .ivu-input[disabled], fieldset[disabled] .ivu-input { 26 | color: @noahv-font-text-disabled-color; 27 | background-color: @noahv-input-disabled-bg; 28 | } -------------------------------------------------------------------------------- /template/common-ts/src/common/assets/css/theme/components/page.less: -------------------------------------------------------------------------------- 1 | @import './select.less'; 2 | @import '../custom.less'; 3 | .ivu-page-item { 4 | border: @noahv-page-border; 5 | border-radius: @noahv-page-border-radius; 6 | min-width: @noahv-page-item-min-width; 7 | height: @noahv-page-item-height; 8 | } 9 | 10 | .ivu-page-item-active { 11 | background-color: @noahv-page-active-bg; 12 | } 13 | 14 | .ivu-page-prev, .ivu-page-next, .ivu-page-item-jump-prev, .ivu-page-item-jump-next { 15 | border: @noahv-page-border; 16 | border-radius: @noahv-page-border-radius; 17 | } 18 | 19 | .ivu-page-item:hover a { 20 | color: @noahv-page-hover-color; 21 | } 22 | .ivu-page-item-active a, .ivu-page-item-active:hover a { 23 | color: @noahv-page-avtive-hover-color; 24 | } 25 | 26 | .ivu-page-options { 27 | float: @noahv-page-options-float; 28 | 29 | &:before { 30 | content: @noahv-page-options-content; 31 | display: block; 32 | float: left; 33 | line-height: @noahv-page-item-height; 34 | margin-right: 2px; 35 | } 36 | } 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /template/common-ts/src/common/assets/css/theme/components/radio.less: -------------------------------------------------------------------------------- 1 | @import '../custom.less'; 2 | .ivu-radio-inner { 3 | width: @noahv-radio-width; 4 | height: @noahv-radio-height; 5 | background-color: @noahv-radio-default-bg; 6 | border: @noahv-radio-default-border; 7 | } 8 | .ivu-radio-checked .ivu-radio-inner { 9 | border-color: @noahv-radio-checked-color; 10 | } 11 | .ivu-radio-inner:after { 12 | background-color: @noahv-radio-checked-color; 13 | } 14 | 15 | .ivu-radio-disabled .ivu-radio-inner { 16 | border-color: @noahv-radio-disabled-border; 17 | background-color: @noahv-radio-disabled-bg; 18 | } 19 | 20 | .ivu-radio-disabled .ivu-radio-inner:after { 21 | background-color: @noahv-radio-disabled-border; 22 | } 23 | 24 | .ivu-radio-focus { 25 | box-shadow: @noahv-radio-box-shadow; 26 | } -------------------------------------------------------------------------------- /template/common-ts/src/common/assets/css/theme/components/toast.less: -------------------------------------------------------------------------------- 1 | @import '../custom.less'; 2 | .ivu-message-notice-content { 3 | padding: @noahv-toast-padding; 4 | border-radius: @noahv-toast-border-radius; 5 | } 6 | 7 | .ivu-message .ivu-icon { 8 | margin-right: @noahv-toast-icon-margin-right; 9 | } 10 | 11 | .ivu-message-notice-content span { 12 | font-size: @noahv-font-size-base; 13 | } -------------------------------------------------------------------------------- /template/common-ts/src/common/assets/css/theme/components/tooltip.less: -------------------------------------------------------------------------------- 1 | @import '../custom.less'; 2 | .ivu-tooltip-inner { 3 | padding: @noahv-tooltip-padding; 4 | font-size: @noahv-font-size-base; 5 | border-radius: @noahv-tooltip-border-radius; 6 | box-shadow: @noahv-tooltip-box-shadow; 7 | } -------------------------------------------------------------------------------- /template/common-ts/src/common/assets/css/theme/my-theme.less: -------------------------------------------------------------------------------- 1 | // to define your theme 2 | 3 | // eg. 4 | // define iview style 5 | // @rate-star-color: #8c0776; 6 | 7 | // define noahv style 8 | // @noahv-btn-error-color: #8c0776; 9 | 10 | // define own style 11 | // .ivu-btn.ivu-btn-error { 12 | // background: #8c0776; 13 | // } -------------------------------------------------------------------------------- /template/common-ts/src/common/assets/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/NoahV/ce78751eeb220e2e58094e9e85627e241ef05f33/template/common-ts/src/common/assets/img/favicon.ico -------------------------------------------------------------------------------- /template/common-ts/src/common/assets/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/NoahV/ce78751eeb220e2e58094e9e85627e241ef05f33/template/common-ts/src/common/assets/img/logo.png -------------------------------------------------------------------------------- /template/common-ts/src/common/config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file conf 3 | */ 4 | export default { 5 | index: '' 6 | }; 7 | -------------------------------------------------------------------------------- /template/common-ts/src/common/hook/ajax.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file ajax hook conf 3 | */ 4 | 5 | import request from 'noahv-request'; 6 | 7 | // // 请求发出前处理,如果需要改变参数或Header,请在此修改 8 | // request.hooks.beforeRequest = config => { 9 | // return config; 10 | // }; 11 | 12 | // // 收到相应后处理,如果需要改变数据,请在此修改 13 | // request.hooks.beforeSuccess = res => { 14 | // return res; 15 | // }; 16 | -------------------------------------------------------------------------------- /template/common-ts/src/common/layout/404.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 22 | 23 | 28 | -------------------------------------------------------------------------------- /template/common-ts/src/common/layout/footer.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 20 | 21 | 27 | -------------------------------------------------------------------------------- /template/common-ts/src/common/layout/layout.vue: -------------------------------------------------------------------------------- 1 | 19 | -------------------------------------------------------------------------------- /template/common-ts/src/store/mutation-types.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file mutation-types 3 | * @author darren(darrenywyu@gmail.com) 4 | * Joannamo(joannamo123@163.com) 5 | */ 6 | export const LOGIN = 'LOGIN'; 7 | export const UPDATE_BASE_FLAG = 'UPDATE_BASE_FLAG'; 8 | export const UPDATE_USER_FLAG = 'UPDATE_USER_FLAG'; 9 | 10 | 11 | -------------------------------------------------------------------------------- /template/common-ts/src/tools/utils.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file public tools 3 | * @author Joannamo(joannamo123@163.com) 4 | */ 5 | 6 | const UTILS = {}; 7 | 8 | export default UTILS; 9 | -------------------------------------------------------------------------------- /template/common-ts/src/types/tool.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'noahv-core'; 2 | declare module 'noahv-request'; 3 | declare module 'noahv-component'; 4 | declare module 'iview' -------------------------------------------------------------------------------- /template/common-ts/src/vue-shims.d.ts: -------------------------------------------------------------------------------- 1 | declare module '*.vue' { 2 | import Vue from 'vue'; 3 | export default Vue; 4 | } -------------------------------------------------------------------------------- /template/common-ts/test/unit/index.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-undef */ 2 | // require all test files (files that ends with .spec.js) 3 | const testsContext = require.context('./specs', true, /\.spec$/); 4 | testsContext.keys().forEach(testsContext); 5 | 6 | // require all src files except main.js for coverage. 7 | // you want coverage for. 8 | const srcContext = require.context('../../src', true, /^\.\/(?!main(\.js)?$)/); 9 | srcContext.keys().forEach(srcContext); 10 | /* eslint-enable */ 11 | -------------------------------------------------------------------------------- /template/common/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["env", "stage-2"], 3 | "plugins": ["transform-runtime", "transform-vue-jsx"], 4 | "comments": false, 5 | "env": { 6 | "test": { 7 | "plugins": [ "istanbul" ] 8 | } 9 | } 10 | } 11 | 12 | -------------------------------------------------------------------------------- /template/common/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | dist/ 4 | npm-debug.log 5 | saas 6 | test/unit/coverage/ 7 | -------------------------------------------------------------------------------- /template/common/README.md: -------------------------------------------------------------------------------- 1 | ## NoahV 2 | * [about](http://noahv.org/#/guide/about) 3 | * [quickstart](http://noahv.org/#/guide/quickstart) 4 | * [github](https://github.com/baidu/NoahV) 5 | -------------------------------------------------------------------------------- /template/common/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | FILE_NAME="noahv" 4 | 5 | CUR_DIR=$(cd `dirname $0`; pwd) 6 | 7 | # prepare 8 | if [ -d $CUR_DIR/output ]; then 9 | rm -rf $CUR_DIR/output 10 | fi 11 | 12 | if [ -d $CUR_DIR/noahv ]; then 13 | rm -rf $CUR_DIR/noahv 14 | fi 15 | 16 | echo "install node_module" 17 | npm install 18 | 19 | # build 20 | echo "npm build start" 21 | 22 | node scripts/build.js 23 | 24 | if [ $? -ne 0 ]; then 25 | echo "build failed!" 26 | exit 1; 27 | fi 28 | echo "npm build success" 29 | 30 | mv noahv output 31 | 32 | # tar 33 | cd output 34 | tar -zcf $FILE_NAME.tar.gz * 35 | ls . | fgrep -v $FILE_NAME.tar.gz | xargs rm -rf 36 | 37 | echo "build success" 38 | exit 0; 39 | -------------------------------------------------------------------------------- /template/common/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NoahV 示例项目 6 | 7 | 8 |
9 | 10 |
11 | 12 | 13 | -------------------------------------------------------------------------------- /template/common/mockup/api/demo/chart/column/get.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by noahv-cli. 3 | */ 4 | 5 | /* eslint-disable no-undef,no-unused-vars */ 6 | let mockup = require('noahv-mockup').mockupTool; 7 | 8 | exports.response = (path, params) => { 9 | 10 | return mockup.ok( 11 | { 12 | // id: 1 13 | } 14 | ); 15 | 16 | }; 17 | /* eslint-enable */ 18 | -------------------------------------------------------------------------------- /template/common/mockup/api/demo/form/default.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by noahv-cli. 3 | */ 4 | 5 | /* eslint-disable no-undef,no-unused-vars */ 6 | let mockup = require('noahv-mockup').mockupTool; 7 | 8 | exports.response = (path, params) => { 9 | 10 | return mockup.ok( 11 | { 12 | username: 'username form default Api' 13 | } 14 | ); 15 | 16 | }; 17 | /* eslint-enable */ 18 | -------------------------------------------------------------------------------- /template/common/mockup/api/demo/form/submit.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by noahv-cli. 3 | */ 4 | 5 | /* eslint-disable no-undef,no-unused-vars */ 6 | let mockup = require('noahv-mockup').mockupTool; 7 | 8 | exports.response = (path, params) => { 9 | 10 | return mockup.ok( 11 | { 12 | // id: 1 13 | } 14 | ); 15 | 16 | }; 17 | /* eslint-enable */ 18 | -------------------------------------------------------------------------------- /template/common/mockup/api/demo/table/delete.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by noahv-cli. 3 | */ 4 | 5 | /* eslint-disable no-undef,no-unused-vars */ 6 | let mockup = require('noahv-mockup').mockupTool; 7 | 8 | exports.response = (path, params) => { 9 | 10 | return mockup.ok( 11 | { 12 | // id: 1 13 | } 14 | ); 15 | 16 | }; 17 | /* eslint-enable */ 18 | -------------------------------------------------------------------------------- /template/common/mockup/api/demo/table/filter/delete.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by noahv-cli. 3 | */ 4 | 5 | /* eslint-disable no-undef,no-unused-vars */ 6 | let mockup = require('noahv-mockup').mockupTool; 7 | 8 | exports.response = (path, params) => { 9 | 10 | return mockup.ok( 11 | { 12 | // id: 1 13 | } 14 | ); 15 | 16 | }; 17 | /* eslint-enable */ 18 | -------------------------------------------------------------------------------- /template/common/mockup/api/user.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by noahv-cli. 3 | */ 4 | 5 | /* eslint-disable no-undef,no-unused-vars */ 6 | let mockup = require('noahv-mockup').mockupTool; 7 | 8 | exports.response = (path, params) => { 9 | 10 | return mockup.ok( 11 | { 12 | userName: '管理员' 13 | } 14 | ); 15 | 16 | }; 17 | /* eslint-enable */ 18 | -------------------------------------------------------------------------------- /template/common/scripts/build.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | process.env.NODE_ENV = 'production'; 3 | var path = require('path') 4 | var config = require('./config') 5 | var ora = require('ora') 6 | const fs = require('fs-extra') 7 | var webpack = require('webpack') 8 | var webpackConfig = require('./webpack.prod.conf') 9 | 10 | var spinner = ora('building for production...') 11 | spinner.start() 12 | 13 | var assetsPath = path.join(config.build.assetsRoot, config.build.assetsSubDirectory) 14 | fs.removeSync(assetsPath) 15 | fs.mkdirpSync(assetsPath) 16 | 17 | var staticPath = path.resolve('static'); 18 | if (fs.pathExistsSync(staticPath)) { 19 | fs.copySync('static/*', assetsPath); 20 | } 21 | 22 | webpack(webpackConfig, function(err, stats) { 23 | spinner.stop(); 24 | process.stdout.write(stats.toString({ 25 | colors: true, 26 | modules: false, 27 | children: false, 28 | chunks: false, 29 | chunkModules: false 30 | }) + '\n'); 31 | if (err || stats.hasErrors()) { 32 | process.exit(1); 33 | } 34 | }) -------------------------------------------------------------------------------- /template/common/scripts/dev-client.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | require('eventsource-polyfill') 3 | var hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true') 4 | 5 | hotClient.subscribe(function(event) { 6 | if (event.action === 'reload') { 7 | window.location.reload() 8 | } 9 | }) -------------------------------------------------------------------------------- /template/common/src/common/assets/css/global.less: -------------------------------------------------------------------------------- 1 | body, div, span, header, footer, nav, section, aside, article, ul, dl, dt, dd, li, a, p, h1, h2, h3, h4,h5, i, b, textarea, button, input, select { 2 | padding: 0; 3 | margin: 0; 4 | list-style: none; 5 | font-style: normal; 6 | text-decoration: none; 7 | border: none; 8 | // color: #313131; 9 | box-sizing: border-box; 10 | font-family: "Microsoft YaHei",-apple-system,BlinkMacSystemFont,"SF Pro SC","SF Pro Text","Helvetica Neue",Helvetica,"PingFang SC","Segoe UI",Roboto,"Hiragino Sans GB","Arial","microsoft yahei ui",SimSun,sans-serif; 11 | -webkit-tap-highlight-color:transparent; 12 | &:focus { 13 | outline: none; 14 | } 15 | } 16 | 17 | 18 | html { 19 | height: 100%; 20 | width: 100%; 21 | overflow-x: hidden; 22 | } 23 | body { 24 | height: 100%; 25 | width: 100%; 26 | background: #f5f7f9; 27 | } 28 | .ivu-spin-fullscreen { 29 | background-color: rgba(252, 252, 252, .4) 30 | } 31 | 32 | 33 | -------------------------------------------------------------------------------- /template/common/src/common/assets/css/header.less: -------------------------------------------------------------------------------- 1 | .noahv-layout { 2 | .noahv-layout-header { 3 | .noahv-layout-header-inner { 4 | // logo 5 | .noahv-layout-logo { 6 | width: 120px; 7 | img { 8 | height: 45px; 9 | margin-top: 0px; 10 | } 11 | } 12 | .noahv-layout-nav { 13 | left: 180px; 14 | .menu-list { 15 | min-width: 145px; 16 | } 17 | } 18 | } 19 | 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /template/common/src/common/assets/css/loading.less: -------------------------------------------------------------------------------- 1 | .noahv-loading { 2 | display: block; 3 | animation: noahv-loading 1s linear infinite; 4 | } 5 | @keyframes noahv-loading { 6 | from { transform: rotate(0deg);} 7 | 50% { transform: rotate(180deg);} 8 | to { transform: rotate(360deg);} 9 | } -------------------------------------------------------------------------------- /template/common/src/common/assets/css/main.less: -------------------------------------------------------------------------------- 1 | // relationship of style level: iview -> noahv -> theme 2 | // import iview style 3 | @import '~iview/src/styles/index.less'; 4 | 5 | // import noahv style 6 | @import '~noahv-component/src/assets/css/index.less'; 7 | 8 | @import '~noahv-core/lib/header/header.less'; 9 | 10 | // import noahv global and components style 11 | @import './global.less'; 12 | @import './header.less'; 13 | 14 | @import './theme/custom.less'; 15 | @import './theme/components/index.less'; 16 | @import './loading.less'; 17 | 18 | // import noahv component style 19 | 20 | // import theme style 21 | @import './theme/my-theme.less'; 22 | -------------------------------------------------------------------------------- /template/common/src/common/assets/css/theme/components/checkbox.less: -------------------------------------------------------------------------------- 1 | @import '../custom.less'; 2 | .ivu-checkbox-inner { 3 | width: @noahv-checkbox-width; 4 | height: @noahv-checkbox-height; 5 | border: @noahv-checkbox-default-border; 6 | background-color: @noahv-checkbox-default-bg; 7 | } 8 | .ivu-checkbox-checked .ivu-checkbox-inner { 9 | border-color: @noahv-checkbox-checked-color; 10 | background-color: @noahv-checkbox-checked-color; 11 | } 12 | 13 | .ivu-checkbox-disabled .ivu-checkbox-inner, .ivu-checkbox-disabled.ivu-checkbox-checked .ivu-checkbox-inner { 14 | border-color: @noahv-checkbox-disabled-border; 15 | background-color: @noahv-checkbox-disabled-bg; 16 | } 17 | 18 | .ivu-checkbox-focus { 19 | box-shadow: @noahv-checkbox-box-shadow; 20 | } 21 | 22 | .ivu-checkbox-wrapper { 23 | margin-right: @noahv-checkbox-wapper-margin-right; 24 | } -------------------------------------------------------------------------------- /template/common/src/common/assets/css/theme/components/index.less: -------------------------------------------------------------------------------- 1 | @import './button.less'; 2 | @import './table.less'; 3 | @import './input.less'; 4 | @import './radio.less'; 5 | @import './checkbox.less'; 6 | @import './toast.less'; 7 | @import './tooltip.less'; 8 | @import './modal.less'; 9 | @import './tabs.less'; 10 | @import './page.less'; 11 | @import './select.less'; 12 | @import './switch.less'; -------------------------------------------------------------------------------- /template/common/src/common/assets/css/theme/components/input.less: -------------------------------------------------------------------------------- 1 | @import '../custom.less'; 2 | .ivu-input { 3 | border-radius: @noahv-input-border-radius; 4 | padding: @noahv-input-padding; 5 | border: @noahv-input-default-border; 6 | color: @noahv-font-text-color; 7 | height: @nohav-input-height; 8 | } 9 | 10 | .ivu-input:focus { 11 | border-color: @noahv-input-focus-color; 12 | box-shadow: @noahv-input-focus-box-shadow; 13 | background: @noahv-input-active-bg; 14 | } 15 | 16 | .ivu-input:hover { 17 | border-color: @noahv-input-focus-color; 18 | } 19 | 20 | .ivu-input::-webkit-input-placeholder { 21 | color: @noahv-font-placeholder-color; 22 | font-size: @noahv-font-size-base 23 | } 24 | 25 | .ivu-input[disabled], fieldset[disabled] .ivu-input { 26 | color: @noahv-font-text-disabled-color; 27 | background-color: @noahv-input-disabled-bg; 28 | } -------------------------------------------------------------------------------- /template/common/src/common/assets/css/theme/components/page.less: -------------------------------------------------------------------------------- 1 | @import './select.less'; 2 | @import '../custom.less'; 3 | .ivu-page-item { 4 | border: @noahv-page-border; 5 | border-radius: @noahv-page-border-radius; 6 | min-width: @noahv-page-item-min-width; 7 | height: @noahv-page-item-height; 8 | } 9 | 10 | .ivu-page-item-active { 11 | background-color: @noahv-page-active-bg; 12 | } 13 | 14 | .ivu-page-prev, .ivu-page-next, .ivu-page-item-jump-prev, .ivu-page-item-jump-next { 15 | border: @noahv-page-border; 16 | border-radius: @noahv-page-border-radius; 17 | } 18 | 19 | .ivu-page-item:hover a { 20 | color: @noahv-page-hover-color; 21 | } 22 | .ivu-page-item-active a, .ivu-page-item-active:hover a { 23 | color: @noahv-page-avtive-hover-color; 24 | } 25 | 26 | .ivu-page-options { 27 | float: @noahv-page-options-float; 28 | 29 | &:before { 30 | content: @noahv-page-options-content; 31 | display: block; 32 | float: left; 33 | line-height: @noahv-page-item-height; 34 | margin-right: 2px; 35 | } 36 | } 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /template/common/src/common/assets/css/theme/components/radio.less: -------------------------------------------------------------------------------- 1 | @import '../custom.less'; 2 | .ivu-radio-inner { 3 | width: @noahv-radio-width; 4 | height: @noahv-radio-height; 5 | background-color: @noahv-radio-default-bg; 6 | border: @noahv-radio-default-border; 7 | } 8 | .ivu-radio-checked .ivu-radio-inner { 9 | border-color: @noahv-radio-checked-color; 10 | } 11 | .ivu-radio-inner:after { 12 | background-color: @noahv-radio-checked-color; 13 | } 14 | 15 | .ivu-radio-disabled .ivu-radio-inner { 16 | border-color: @noahv-radio-disabled-border; 17 | background-color: @noahv-radio-disabled-bg; 18 | } 19 | 20 | .ivu-radio-disabled .ivu-radio-inner:after { 21 | background-color: @noahv-radio-disabled-border; 22 | } 23 | 24 | .ivu-radio-focus { 25 | box-shadow: @noahv-radio-box-shadow; 26 | } -------------------------------------------------------------------------------- /template/common/src/common/assets/css/theme/components/toast.less: -------------------------------------------------------------------------------- 1 | @import '../custom.less'; 2 | .ivu-message-notice-content { 3 | padding: @noahv-toast-padding; 4 | border-radius: @noahv-toast-border-radius; 5 | } 6 | 7 | .ivu-message .ivu-icon { 8 | margin-right: @noahv-toast-icon-margin-right; 9 | } 10 | 11 | .ivu-message-notice-content span { 12 | font-size: @noahv-font-size-base; 13 | } -------------------------------------------------------------------------------- /template/common/src/common/assets/css/theme/components/tooltip.less: -------------------------------------------------------------------------------- 1 | @import '../custom.less'; 2 | .ivu-tooltip-inner { 3 | padding: @noahv-tooltip-padding; 4 | font-size: @noahv-font-size-base; 5 | border-radius: @noahv-tooltip-border-radius; 6 | box-shadow: @noahv-tooltip-box-shadow; 7 | } -------------------------------------------------------------------------------- /template/common/src/common/assets/css/theme/my-theme.less: -------------------------------------------------------------------------------- 1 | // to define your theme 2 | 3 | // eg. 4 | // define iview style 5 | // @rate-star-color: #8c0776; 6 | 7 | // define noahv style 8 | // @noahv-btn-error-color: #8c0776; 9 | 10 | // define own style 11 | // .ivu-btn.ivu-btn-error { 12 | // background: #8c0776; 13 | // } -------------------------------------------------------------------------------- /template/common/src/common/assets/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/NoahV/ce78751eeb220e2e58094e9e85627e241ef05f33/template/common/src/common/assets/img/favicon.ico -------------------------------------------------------------------------------- /template/common/src/common/assets/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/NoahV/ce78751eeb220e2e58094e9e85627e241ef05f33/template/common/src/common/assets/img/logo.png -------------------------------------------------------------------------------- /template/common/src/common/config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file conf 3 | */ 4 | export default { 5 | index: '' 6 | }; 7 | -------------------------------------------------------------------------------- /template/common/src/common/hook/ajax.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file ajax hook conf 3 | */ 4 | 5 | import request from 'noahv-request'; 6 | 7 | // // 请求发出前处理,如果需要改变参数或Header,请在此修改 8 | // request.hooks.beforeRequest = config => { 9 | // return config; 10 | // }; 11 | 12 | // // 收到相应后处理,如果需要改变数据,请在此修改 13 | // request.hooks.beforeSuccess = res => { 14 | // return res; 15 | // }; 16 | -------------------------------------------------------------------------------- /template/common/src/common/layout/404.vue: -------------------------------------------------------------------------------- 1 | 10 | 22 | 23 | 28 | -------------------------------------------------------------------------------- /template/common/src/common/layout/footer.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 18 | 19 | 25 | -------------------------------------------------------------------------------- /template/common/src/common/layout/layout.vue: -------------------------------------------------------------------------------- 1 | 19 | 24 | -------------------------------------------------------------------------------- /template/common/src/store/mutation-types.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file mutation-types 3 | * @author darren(darrenywyu@gmail.com) 4 | * Joannamo(joannamo123@163.com) 5 | */ 6 | export const LOGIN = 'LOGIN'; 7 | export const UPDATE_BASE_FLAG = 'UPDATE_BASE_FLAG'; 8 | export const UPDATE_USER_FLAG = 'UPDATE_USER_FLAG'; 9 | 10 | 11 | -------------------------------------------------------------------------------- /template/common/src/tools/utils.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file public tools 3 | * @author Joannamo(joannamo123@163.com) 4 | */ 5 | 6 | const UTILS = {}; 7 | 8 | export default UTILS; 9 | -------------------------------------------------------------------------------- /template/common/test/unit/index.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-undef */ 2 | // require all test files (files that ends with .spec.js) 3 | const testsContext = require.context('./specs', true, /\.spec$/); 4 | testsContext.keys().forEach(testsContext); 5 | 6 | // require all src files except main.js for coverage. 7 | // you want coverage for. 8 | const srcContext = require.context('../../src', true, /^\.\/(?!main(\.js)?$)/); 9 | srcContext.keys().forEach(srcContext); 10 | /* eslint-enable */ 11 | -------------------------------------------------------------------------------- /template/dashboard/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["env", "stage-2"], 3 | "plugins": ["transform-runtime", "transform-vue-jsx"], 4 | "comments": false, 5 | "env": { 6 | "test": { 7 | "plugins": [ "istanbul" ] 8 | } 9 | } 10 | } 11 | 12 | -------------------------------------------------------------------------------- /template/dashboard/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | dist/ 4 | npm-debug.log 5 | package-lock.json 6 | saas 7 | test/unit/coverage/ 8 | -------------------------------------------------------------------------------- /template/dashboard/README.md: -------------------------------------------------------------------------------- 1 | ## NoahV 2 | * [about](http://noahv.org/#/guide/about) 3 | * [quickstart](http://noahv.org/#/guide/quickstart) 4 | * [github](https://github.com/baidu/NoahV) -------------------------------------------------------------------------------- /template/dashboard/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | FILE_NAME="noahv" 4 | 5 | CUR_DIR=$(cd `dirname $0`; pwd) 6 | 7 | # prepare 8 | if [ -d $CUR_DIR/output ]; then 9 | rm -rf $CUR_DIR/output 10 | fi 11 | 12 | if [ -d $CUR_DIR/noahv ]; then 13 | rm -rf $CUR_DIR/noahv 14 | fi 15 | 16 | echo "install node_module" 17 | npm install 18 | 19 | # build 20 | echo "npm build start" 21 | 22 | node scripts/build.js 23 | 24 | if [ $? -ne 0 ]; then 25 | echo "build failed!" 26 | exit 1; 27 | fi 28 | echo "npm build success" 29 | 30 | mv noahv output 31 | 32 | # tar 33 | cd output 34 | tar -zcf $FILE_NAME.tar.gz * 35 | ls . | fgrep -v $FILE_NAME.tar.gz | xargs rm -rf 36 | 37 | echo "build success" 38 | exit 0; 39 | -------------------------------------------------------------------------------- /template/dashboard/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NoahV Dashboard 示例项目 6 | 7 | 8 |
9 | 10 |
11 | 12 | 13 | -------------------------------------------------------------------------------- /template/dashboard/mockup/api/conf/copy.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by noahv-cli. 3 | */ 4 | 5 | /* eslint-disable no-undef,no-unused-vars */ 6 | let mockup = require('noahv-mockup').mockupTool; 7 | 8 | exports.response = (path, params) => { 9 | 10 | return mockup.ok( 11 | { 12 | // id: 1 13 | } 14 | ); 15 | 16 | }; 17 | /* eslint-enable */ 18 | -------------------------------------------------------------------------------- /template/dashboard/mockup/api/conf/update.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by noahv-cli. 3 | */ 4 | 5 | /* eslint-disable no-undef,no-unused-vars */ 6 | let mockup = require('noahv-mockup').mockupTool; 7 | 8 | exports.response = (path, params) => { 9 | 10 | return mockup.ok( 11 | { 12 | // id: 1 13 | } 14 | ); 15 | 16 | }; 17 | /* eslint-enable */ 18 | -------------------------------------------------------------------------------- /template/dashboard/mockup/api/dashboard/create.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by noahv-cli. 3 | */ 4 | 5 | /* eslint-disable no-undef,no-unused-vars */ 6 | let mockup = require('noahv-mockup').mockupTool; 7 | 8 | exports.response = (path, params) => { 9 | 10 | return mockup.ok( 11 | { 12 | id: '31245312' 13 | } 14 | ); 15 | 16 | }; 17 | /* eslint-enable */ 18 | -------------------------------------------------------------------------------- /template/dashboard/mockup/api/dashboard/delete.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by noahv-cli. 3 | */ 4 | 5 | /* eslint-disable no-undef,no-unused-vars */ 6 | let mockup = require('noahv-mockup').mockupTool; 7 | 8 | exports.response = (path, params) => { 9 | 10 | return mockup.ok( 11 | { 12 | // id: 1 13 | } 14 | ); 15 | 16 | }; 17 | /* eslint-enable */ 18 | -------------------------------------------------------------------------------- /template/dashboard/mockup/api/dashboard/updateMeta.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by noahv-cli. 3 | */ 4 | 5 | /* eslint-disable no-undef,no-unused-vars */ 6 | let mockup = require('noahv-mockup').mockupTool; 7 | 8 | exports.response = (path, params) => { 9 | 10 | return mockup.ok( 11 | { 12 | // id: 1 13 | } 14 | ); 15 | 16 | }; 17 | /* eslint-enable */ 18 | -------------------------------------------------------------------------------- /template/dashboard/mockup/api/dashboard/widgetscopy.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by noahv-cli. 3 | */ 4 | 5 | /* eslint-disable no-undef,no-unused-vars */ 6 | let mockup = require('noahv-mockup').mockupTool; 7 | 8 | exports.response = (path, params) => { 9 | 10 | return mockup.ok( 11 | { 12 | id: '1678360', 13 | name: '1678359_1678361', 14 | title: '' 15 | } 16 | ); 17 | 18 | }; 19 | /* eslint-enable */ 20 | -------------------------------------------------------------------------------- /template/dashboard/mockup/api/dashboard/widgetscreate.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by noahv-cli. 3 | */ 4 | 5 | /* eslint-disable no-undef,no-unused-vars */ 6 | let mockup = require('noahv-mockup').mockupTool; 7 | 8 | exports.response = (path, params) => { 9 | 10 | return mockup.ok( 11 | { 12 | id: '1678360', 13 | name: '1678359_1678360', 14 | title: '' 15 | } 16 | ); 17 | 18 | }; 19 | /* eslint-enable */ 20 | -------------------------------------------------------------------------------- /template/dashboard/mockup/api/dashboard/widgetsdelete.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by noahv-cli. 3 | */ 4 | 5 | /* eslint-disable no-undef,no-unused-vars */ 6 | let mockup = require('noahv-mockup').mockupTool; 7 | 8 | exports.response = (path, params) => { 9 | 10 | return mockup.ok( 11 | true 12 | ); 13 | 14 | }; 15 | /* eslint-enable */ 16 | -------------------------------------------------------------------------------- /template/dashboard/mockup/api/demo/chart/column/get.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by noahv-cli. 3 | */ 4 | 5 | /* eslint-disable no-undef,no-unused-vars */ 6 | let mockup = require('noahv-mockup').mockupTool; 7 | 8 | exports.response = (path, params) => { 9 | 10 | return mockup.ok( 11 | { 12 | // id: 1 13 | } 14 | ); 15 | 16 | }; 17 | /* eslint-enable */ 18 | -------------------------------------------------------------------------------- /template/dashboard/mockup/api/demo/form/default.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by noahv-cli. 3 | */ 4 | 5 | /* eslint-disable no-undef,no-unused-vars */ 6 | let mockup = require('noahv-mockup').mockupTool; 7 | 8 | exports.response = (path, params) => { 9 | 10 | return mockup.ok( 11 | { 12 | username: 'username form default Api' 13 | } 14 | ); 15 | 16 | }; 17 | /* eslint-enable */ 18 | -------------------------------------------------------------------------------- /template/dashboard/mockup/api/demo/form/submit.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by noahv-cli. 3 | */ 4 | 5 | /* eslint-disable no-undef,no-unused-vars */ 6 | let mockup = require('noahv-mockup').mockupTool; 7 | 8 | exports.response = (path, params) => { 9 | 10 | return mockup.ok( 11 | { 12 | // id: 1 13 | } 14 | ); 15 | 16 | }; 17 | /* eslint-enable */ 18 | -------------------------------------------------------------------------------- /template/dashboard/mockup/api/demo/table/delete.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by noahv-cli. 3 | */ 4 | 5 | /* eslint-disable no-undef,no-unused-vars */ 6 | let mockup = require('noahv-mockup').mockupTool; 7 | 8 | exports.response = (path, params) => { 9 | 10 | return mockup.ok( 11 | { 12 | // id: 1 13 | } 14 | ); 15 | 16 | }; 17 | /* eslint-enable */ 18 | -------------------------------------------------------------------------------- /template/dashboard/mockup/api/demo/table/filter/delete.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by noahv-cli. 3 | */ 4 | 5 | /* eslint-disable no-undef,no-unused-vars */ 6 | let mockup = require('noahv-mockup').mockupTool; 7 | 8 | exports.response = (path, params) => { 9 | 10 | return mockup.ok( 11 | { 12 | // id: 1 13 | } 14 | ); 15 | 16 | }; 17 | /* eslint-enable */ 18 | -------------------------------------------------------------------------------- /template/dashboard/mockup/api/get/billboard.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by noahv-cli. 3 | */ 4 | 5 | /* eslint-disable no-undef,no-unused-vars */ 6 | let mockup = require('noahv-mockup').mockupTool; 7 | 8 | exports.response = (path, params) => { 9 | 10 | return mockup.ok( 11 | [ 12 | { 13 | name: '请求平均时长(秒)', 14 | data: 10, 15 | warning: true 16 | }, 17 | { 18 | name: '请求失败量(个)', 19 | data: 91 20 | }, { 21 | name: '请求成功率(%)', 22 | data: 99.99875 23 | } 24 | ] 25 | ); 26 | 27 | }; 28 | /* eslint-enable */ 29 | -------------------------------------------------------------------------------- /template/dashboard/mockup/api/get/mdcircle.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by noahv-cli. 3 | */ 4 | 5 | /* eslint-disable no-undef,no-unused-vars */ 6 | let mockup = require('noahv-mockup').mockupTool; 7 | 8 | exports.response = (path, params) => { 9 | 10 | return mockup.ok( 11 | 99.999999 12 | ); 13 | 14 | }; 15 | /* eslint-enable */ 16 | -------------------------------------------------------------------------------- /template/dashboard/mockup/api/get/report.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by noahv-cli. 3 | */ 4 | 5 | /* eslint-disable no-undef,no-unused-vars */ 6 | let mockup = require('noahv-mockup').mockupTool; 7 | 8 | exports.response = (path, params) => { 9 | 10 | return mockup.ok( 11 | [ 12 | { 13 | 'name': 'noah_namespace', 14 | 'value': 'CUP_1', 15 | 'alias': null, 16 | 'metrics': {'alias3': 90, 'alias2': 95, 'alias1': null} 17 | }, { 18 | 'name': 'noah_namespace', 19 | 'value': 'CUP_2', 20 | 'alias': null, 21 | 'metrics': {'alias3': 100, 'alias2': 80, 'alias1': null} 22 | } 23 | ] 24 | ); 25 | }; 26 | /* eslint-enable */ 27 | -------------------------------------------------------------------------------- /template/dashboard/mockup/api/user.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by noahv-cli. 3 | */ 4 | 5 | /* eslint-disable no-undef,no-unused-vars */ 6 | let mockup = require('noahv-mockup').mockupTool; 7 | 8 | exports.response = (path, params) => { 9 | 10 | return mockup.ok( 11 | { 12 | userName: '管理员' 13 | } 14 | ); 15 | 16 | }; 17 | /* eslint-enable */ 18 | -------------------------------------------------------------------------------- /template/dashboard/scripts/build.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | process.env.NODE_ENV = 'production'; 3 | var path = require('path') 4 | var config = require('./config') 5 | var ora = require('ora') 6 | const fs = require('fs-extra') 7 | var webpack = require('webpack') 8 | var webpackConfig = require('./webpack.prod.conf') 9 | 10 | var spinner = ora('building for production...') 11 | spinner.start() 12 | 13 | var assetsPath = path.join(config.build.assetsRoot, config.build.assetsSubDirectory) 14 | fs.removeSync(assetsPath) 15 | fs.mkdirpSync(assetsPath) 16 | 17 | var staticPath = path.resolve('static'); 18 | if (fs.pathExistsSync(staticPath)) { 19 | fs.copySync('static/*', assetsPath); 20 | } 21 | 22 | webpack(webpackConfig, function(err, stats) { 23 | spinner.stop(); 24 | process.stdout.write(stats.toString({ 25 | colors: true, 26 | modules: false, 27 | children: false, 28 | chunks: false, 29 | chunkModules: false 30 | }) + '\n'); 31 | if (err || stats.hasErrors()) { 32 | process.exit(1); 33 | } 34 | }) -------------------------------------------------------------------------------- /template/dashboard/scripts/dev-client.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | require('eventsource-polyfill') 3 | var hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true') 4 | 5 | hotClient.subscribe(function(event) { 6 | if (event.action === 'reload') { 7 | window.location.reload() 8 | } 9 | }) -------------------------------------------------------------------------------- /template/dashboard/src/common/assets/css/global.less: -------------------------------------------------------------------------------- 1 | body, div, span, header, footer, nav, section, aside, article, ul, dl, dt, dd, li, a, p, h1, h2, h3, h4,h5, i, b, textarea, button, input, select { 2 | padding: 0; 3 | margin: 0; 4 | list-style: none; 5 | font-style: normal; 6 | text-decoration: none; 7 | border: none; 8 | // color: #313131; 9 | box-sizing: border-box; 10 | font-family: "Microsoft YaHei",-apple-system,BlinkMacSystemFont,"SF Pro SC","SF Pro Text","Helvetica Neue",Helvetica,"PingFang SC","Segoe UI",Roboto,"Hiragino Sans GB","Arial","microsoft yahei ui",SimSun,sans-serif; 11 | -webkit-tap-highlight-color:transparent; 12 | &:focus { 13 | outline: none; 14 | } 15 | } 16 | 17 | 18 | html { 19 | height: 100%; 20 | width: 100%; 21 | overflow-x: hidden; 22 | } 23 | body { 24 | height: 100%; 25 | width: 100%; 26 | background: #f5f7f9; 27 | } 28 | .ivu-spin-fullscreen { 29 | background-color: rgba(252, 252, 252, .4) 30 | } 31 | 32 | 33 | -------------------------------------------------------------------------------- /template/dashboard/src/common/assets/css/header.less: -------------------------------------------------------------------------------- 1 | .noahv-layout { 2 | .noahv-layout-header { 3 | .noahv-layout-header-inner { 4 | // logo 5 | .noahv-layout-logo { 6 | width: 120px; 7 | img { 8 | width: 120px; 9 | height: 45px; 10 | margin-top: 0px; 11 | } 12 | } 13 | .noahv-layout-nav { 14 | left: 180px; 15 | .menu-list { 16 | min-width: 145px; 17 | } 18 | } 19 | } 20 | 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /template/dashboard/src/common/assets/css/loading.less: -------------------------------------------------------------------------------- 1 | .noahv-loading { 2 | display: block; 3 | animation: noahv-loading 1s linear infinite; 4 | } 5 | @keyframes noahv-loading { 6 | from { transform: rotate(0deg);} 7 | 50% { transform: rotate(180deg);} 8 | to { transform: rotate(360deg);} 9 | } -------------------------------------------------------------------------------- /template/dashboard/src/common/assets/css/main.less: -------------------------------------------------------------------------------- 1 | // relationship of style level: iview -> noahv -> theme 2 | // import iview style 3 | @import '~iview/src/styles/index.less'; 4 | 5 | @import '~noahv-component/src/assets/css/index.less'; 6 | @import '~noahv-visual-components/src/assets/css/index.less'; 7 | 8 | @import '~noahv-core/lib/header/header.less'; 9 | 10 | // import noahv global and components style 11 | @import './global.less'; 12 | @import './header.less'; 13 | 14 | @import './theme/custom.less'; 15 | @import './theme/components/index.less'; 16 | @import './loading.less'; 17 | 18 | // import noahv component style 19 | 20 | // import theme style 21 | @import './theme/my-theme.less'; 22 | -------------------------------------------------------------------------------- /template/dashboard/src/common/assets/css/theme/components/checkbox.less: -------------------------------------------------------------------------------- 1 | @import '../custom.less'; 2 | .ivu-checkbox-inner { 3 | width: @noahv-checkbox-width; 4 | height: @noahv-checkbox-height; 5 | border: @noahv-checkbox-default-border; 6 | background-color: @noahv-checkbox-default-bg; 7 | } 8 | .ivu-checkbox-checked .ivu-checkbox-inner { 9 | border-color: @noahv-checkbox-checked-color; 10 | background-color: @noahv-checkbox-checked-color; 11 | } 12 | 13 | .ivu-checkbox-disabled .ivu-checkbox-inner, .ivu-checkbox-disabled.ivu-checkbox-checked .ivu-checkbox-inner { 14 | border-color: @noahv-checkbox-disabled-border; 15 | background-color: @noahv-checkbox-disabled-bg; 16 | } 17 | 18 | .ivu-checkbox-focus { 19 | box-shadow: @noahv-checkbox-box-shadow; 20 | } 21 | 22 | .ivu-checkbox-wrapper { 23 | margin-right: @noahv-checkbox-wapper-margin-right; 24 | } -------------------------------------------------------------------------------- /template/dashboard/src/common/assets/css/theme/components/index.less: -------------------------------------------------------------------------------- 1 | @import './button.less'; 2 | @import './table.less'; 3 | @import './input.less'; 4 | @import './radio.less'; 5 | @import './checkbox.less'; 6 | @import './toast.less'; 7 | @import './tooltip.less'; 8 | @import './modal.less'; 9 | @import './tabs.less'; 10 | @import './page.less'; 11 | @import './select.less'; 12 | @import './switch.less'; -------------------------------------------------------------------------------- /template/dashboard/src/common/assets/css/theme/components/input.less: -------------------------------------------------------------------------------- 1 | @import '../custom.less'; 2 | .ivu-input { 3 | border-radius: @noahv-input-border-radius; 4 | padding: @noahv-input-padding; 5 | border: @noahv-input-default-border; 6 | color: @noahv-font-text-color; 7 | } 8 | 9 | .ivu-input:focus { 10 | border-color: @noahv-input-focus-color; 11 | box-shadow: @noahv-input-focus-box-shadow; 12 | background: @noahv-input-active-bg; 13 | } 14 | 15 | .ivu-input:hover { 16 | border-color: @noahv-input-focus-color; 17 | } 18 | 19 | .ivu-input::-webkit-input-placeholder { 20 | color: @noahv-font-placeholder-color; 21 | font-size: @noahv-font-size-base 22 | } 23 | 24 | .ivu-input[disabled], fieldset[disabled] .ivu-input { 25 | color: @noahv-font-text-disabled-color; 26 | background-color: @noahv-input-disabled-bg; 27 | } -------------------------------------------------------------------------------- /template/dashboard/src/common/assets/css/theme/components/page.less: -------------------------------------------------------------------------------- 1 | @import './select.less'; 2 | @import '../custom.less'; 3 | .ivu-page-item { 4 | border: @noahv-page-border; 5 | border-radius: @noahv-page-border-radius; 6 | min-width: @noahv-page-item-min-width; 7 | height: @noahv-page-item-height; 8 | } 9 | 10 | .ivu-page-item-active { 11 | background-color: @noahv-page-active-bg; 12 | } 13 | 14 | .ivu-page-prev, .ivu-page-next, .ivu-page-item-jump-prev, .ivu-page-item-jump-next { 15 | border: @noahv-page-border; 16 | border-radius: @noahv-page-border-radius; 17 | } 18 | 19 | .ivu-page-item:hover a { 20 | color: @noahv-page-hover-color; 21 | } 22 | .ivu-page-item-active a, .ivu-page-item-active:hover a { 23 | color: @noahv-page-avtive-hover-color; 24 | } 25 | 26 | .ivu-page-options { 27 | float: @noahv-page-options-float; 28 | 29 | &:before { 30 | content: @noahv-page-options-content; 31 | display: block; 32 | float: left; 33 | line-height: @noahv-page-item-height; 34 | margin-right: 2px; 35 | } 36 | } 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /template/dashboard/src/common/assets/css/theme/components/radio.less: -------------------------------------------------------------------------------- 1 | @import '../custom.less'; 2 | .ivu-radio-inner { 3 | width: @noahv-radio-width; 4 | height: @noahv-radio-height; 5 | background-color: @noahv-radio-default-bg; 6 | border: @noahv-radio-default-border; 7 | } 8 | .ivu-radio-checked .ivu-radio-inner { 9 | border-color: @noahv-radio-checked-color; 10 | } 11 | .ivu-radio-inner:after { 12 | background-color: @noahv-radio-checked-color; 13 | } 14 | 15 | .ivu-radio-disabled .ivu-radio-inner { 16 | border-color: @noahv-radio-disabled-border; 17 | background-color: @noahv-radio-disabled-bg; 18 | } 19 | 20 | .ivu-radio-disabled .ivu-radio-inner:after { 21 | background-color: @noahv-radio-disabled-border; 22 | } 23 | 24 | .ivu-radio-focus { 25 | box-shadow: @noahv-radio-box-shadow; 26 | } -------------------------------------------------------------------------------- /template/dashboard/src/common/assets/css/theme/components/toast.less: -------------------------------------------------------------------------------- 1 | @import '../custom.less'; 2 | .ivu-message-notice-content { 3 | padding: @noahv-toast-padding; 4 | border-radius: @noahv-toast-border-radius; 5 | } 6 | 7 | .ivu-message .ivu-icon { 8 | margin-right: @noahv-toast-icon-margin-right; 9 | } 10 | 11 | .ivu-message-notice-content span { 12 | font-size: @noahv-font-size-base; 13 | } -------------------------------------------------------------------------------- /template/dashboard/src/common/assets/css/theme/components/tooltip.less: -------------------------------------------------------------------------------- 1 | @import '../custom.less'; 2 | .ivu-tooltip-inner { 3 | padding: @noahv-tooltip-padding; 4 | font-size: @noahv-font-size-base; 5 | border-radius: @noahv-tooltip-border-radius; 6 | box-shadow: @noahv-tooltip-box-shadow; 7 | } -------------------------------------------------------------------------------- /template/dashboard/src/common/assets/css/theme/my-theme.less: -------------------------------------------------------------------------------- 1 | // to define your theme 2 | 3 | // eg. 4 | // define iview style 5 | // @rate-star-color: #8c0776; 6 | 7 | // define noahv style 8 | // @noahv-btn-error-color: #8c0776; 9 | 10 | // define own style 11 | // .ivu-btn.ivu-btn-error { 12 | // background: #8c0776; 13 | // } -------------------------------------------------------------------------------- /template/dashboard/src/common/assets/img/dashboard/trend/chartarea.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/NoahV/ce78751eeb220e2e58094e9e85627e241ef05f33/template/dashboard/src/common/assets/img/dashboard/trend/chartarea.png -------------------------------------------------------------------------------- /template/dashboard/src/common/assets/img/dashboard/trend/chartcolumn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/NoahV/ce78751eeb220e2e58094e9e85627e241ef05f33/template/dashboard/src/common/assets/img/dashboard/trend/chartcolumn.png -------------------------------------------------------------------------------- /template/dashboard/src/common/assets/img/dashboard/trend/chartline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/NoahV/ce78751eeb220e2e58094e9e85627e241ef05f33/template/dashboard/src/common/assets/img/dashboard/trend/chartline.png -------------------------------------------------------------------------------- /template/dashboard/src/common/assets/img/dashboard/trend/chartnormal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/NoahV/ce78751eeb220e2e58094e9e85627e241ef05f33/template/dashboard/src/common/assets/img/dashboard/trend/chartnormal.png -------------------------------------------------------------------------------- /template/dashboard/src/common/assets/img/dashboard/trend/chartstack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/NoahV/ce78751eeb220e2e58094e9e85627e241ef05f33/template/dashboard/src/common/assets/img/dashboard/trend/chartstack.png -------------------------------------------------------------------------------- /template/dashboard/src/common/assets/img/dashboard/widget/billboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/NoahV/ce78751eeb220e2e58094e9e85627e241ef05f33/template/dashboard/src/common/assets/img/dashboard/widget/billboard.png -------------------------------------------------------------------------------- /template/dashboard/src/common/assets/img/dashboard/widget/eventriver.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/NoahV/ce78751eeb220e2e58094e9e85627e241ef05f33/template/dashboard/src/common/assets/img/dashboard/widget/eventriver.png -------------------------------------------------------------------------------- /template/dashboard/src/common/assets/img/dashboard/widget/mdcircle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/NoahV/ce78751eeb220e2e58094e9e85627e241ef05f33/template/dashboard/src/common/assets/img/dashboard/widget/mdcircle.png -------------------------------------------------------------------------------- /template/dashboard/src/common/assets/img/dashboard/widget/mdtable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/NoahV/ce78751eeb220e2e58094e9e85627e241ef05f33/template/dashboard/src/common/assets/img/dashboard/widget/mdtable.png -------------------------------------------------------------------------------- /template/dashboard/src/common/assets/img/dashboard/widget/mdtrend.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/NoahV/ce78751eeb220e2e58094e9e85627e241ef05f33/template/dashboard/src/common/assets/img/dashboard/widget/mdtrend.png -------------------------------------------------------------------------------- /template/dashboard/src/common/assets/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/NoahV/ce78751eeb220e2e58094e9e85627e241ef05f33/template/dashboard/src/common/assets/img/favicon.ico -------------------------------------------------------------------------------- /template/dashboard/src/common/assets/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/NoahV/ce78751eeb220e2e58094e9e85627e241ef05f33/template/dashboard/src/common/assets/img/logo.png -------------------------------------------------------------------------------- /template/dashboard/src/common/config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file conf 3 | */ 4 | export default { 5 | index: '' 6 | }; 7 | -------------------------------------------------------------------------------- /template/dashboard/src/common/hook/ajax.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file ajax hook conf 3 | */ 4 | 5 | import request from 'noahv-request'; 6 | 7 | // // 请求发出前处理,如果需要改变参数或Header,请在此修改 8 | // request.hooks.beforeRequest = config => { 9 | // return config; 10 | // }; 11 | 12 | // // 收到相应后处理,如果需要改变数据,请在此修改 13 | // request.hooks.beforeSuccess = res => { 14 | // return res; 15 | // }; 16 | -------------------------------------------------------------------------------- /template/dashboard/src/common/layout/404.vue: -------------------------------------------------------------------------------- 1 | 10 | 22 | 23 | 28 | -------------------------------------------------------------------------------- /template/dashboard/src/common/layout/footer.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 18 | 19 | 25 | -------------------------------------------------------------------------------- /template/dashboard/src/common/layout/layout.vue: -------------------------------------------------------------------------------- 1 | 19 | 24 | -------------------------------------------------------------------------------- /template/dashboard/src/store/mutation-types.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file mutation-types 3 | * @author darren(darrenywyu@gmail.com) 4 | * Joannamo(joannamo123@163.com) 5 | */ 6 | export const LOGIN = 'LOGIN'; 7 | export const UPDATE_BASE_FLAG = 'UPDATE_BASE_FLAG'; 8 | export const GET_CONFIG = 'GET_CONFIG'; 9 | export const UPDATE_CONFIG = 'UPDATE_CONFIG'; 10 | export const UPDATE_TITLE = 'UPDATE_TITLE'; 11 | export const UPDATE_TYPE = 'UPDATE_TYPE'; 12 | export const UPDATE_PRODUCT = 'UPDATE_PRODUCT'; 13 | export const UPDATE_PRODUCT_TYPE = 'UPDATE_PRODUCT_TYPE'; 14 | export const RESET_CONFIG = 'RESET_CONFIG'; 15 | export const UPDATE_USER_FLAG = 'UPDATE_USER_FLAG'; 16 | 17 | 18 | -------------------------------------------------------------------------------- /template/dashboard/src/tools/utils.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file public tools 3 | * @author Joannamo(joannamo123@163.com) 4 | */ 5 | 6 | const UTILS = {}; 7 | 8 | export default UTILS; 9 | -------------------------------------------------------------------------------- /template/dashboard/src/view/dashboard/api/widget.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 获取widget初始配置信息,提供给vuex 3 | * 4 | * @author darren(darrenywyu@gmail.com) 5 | */ 6 | import apiConfig from './config'; 7 | import util from '../util/util'; 8 | import Vue from 'vue'; 9 | const vueInstace = new Vue(); 10 | 11 | export default { 12 | getConfig(params, cb) { 13 | vueInstace.$request({ 14 | url: util.getApi(apiConfig.widgetConfig), 15 | method: 'get', 16 | params: { 17 | id: params.id 18 | } 19 | }).then(res => { 20 | if (res.data.success) { 21 | const data = res.data.data; 22 | cb(data); 23 | } 24 | else { 25 | // 听天由命了 26 | } 27 | }); 28 | } 29 | }; 30 | -------------------------------------------------------------------------------- /template/dashboard/src/view/dashboard/assets/img/add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/NoahV/ce78751eeb220e2e58094e9e85627e241ef05f33/template/dashboard/src/view/dashboard/assets/img/add.png -------------------------------------------------------------------------------- /template/dashboard/src/view/dashboard/assets/img/auto-color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/NoahV/ce78751eeb220e2e58094e9e85627e241ef05f33/template/dashboard/src/view/dashboard/assets/img/auto-color.png -------------------------------------------------------------------------------- /template/dashboard/src/view/dashboard/assets/img/minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/NoahV/ce78751eeb220e2e58094e9e85627e241ef05f33/template/dashboard/src/view/dashboard/assets/img/minus.png -------------------------------------------------------------------------------- /template/dashboard/src/view/dashboard/assets/img/widget-preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/baidu/NoahV/ce78751eeb220e2e58094e9e85627e241ef05f33/template/dashboard/src/view/dashboard/assets/img/widget-preview.png -------------------------------------------------------------------------------- /template/dashboard/src/view/dashboard/util/util.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file dashBoard 工具信息 3 | * 4 | * @author wang_jing13@163.com 5 | */ 6 | export default { 7 | getApi(api) { 8 | return api; 9 | } 10 | }; 11 | -------------------------------------------------------------------------------- /template/dashboard/test/unit/index.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-undef */ 2 | // require all test files (files that ends with .spec.js) 3 | const testsContext = require.context('./specs', true, /\.spec$/); 4 | testsContext.keys().forEach(testsContext); 5 | 6 | // require all src files except main.js for coverage. 7 | // you want coverage for. 8 | const srcContext = require.context('../../src', true, /^\.\/(?!main(\.js)?$)/); 9 | srcContext.keys().forEach(srcContext); 10 | /* eslint-enable */ 11 | 12 | -------------------------------------------------------------------------------- /tools/noahv-cli/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 4 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /tools/noahv-cli/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "browser": true, 4 | "commonjs": true, 5 | "node": true 6 | }, 7 | "extends": "eslint:recommended", 8 | "parserOptions": { 9 | "ecmaVersion": 5 10 | }, 11 | "rules": { 12 | "indent": [ 13 | "error", 14 | 4 15 | ], 16 | "linebreak-style": [ 17 | "error", 18 | "unix" 19 | ], 20 | "quotes": [ 21 | "error", 22 | "single" 23 | ], 24 | "semi": [ 25 | "error", 26 | "always" 27 | ], 28 | "no-console": "warn" 29 | } 30 | } -------------------------------------------------------------------------------- /tools/noahv-cli/README.md: -------------------------------------------------------------------------------- 1 | ## noahv-cli 2 | 3 | noahv框架的脚手架工具,提供初始化项目、模板复用、调试环境、单测、模拟文件等功能 4 | 5 | ## How to use? 6 | 7 | [quickstart](https://github.com/baidu/NoahV) 8 | -------------------------------------------------------------------------------- /tools/noahv-cli/bin/noahv: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | require('commander') 4 | .version(require('../package.json').version) 5 | .usage(' [options]') 6 | .command('init', '初始化项目') 7 | .command('start', '启动调试') 8 | .command('create', '创建模板') 9 | .command('update', '更新noahv框架') 10 | .command('test', '运行单测框架') 11 | .command('upgrade', '更新脚手架工具') 12 | .parse(process.argv) 13 | -------------------------------------------------------------------------------- /tools/noahv-cli/bin/noahv-init: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | const chalk = require('chalk') 3 | const program = require('commander'); 4 | const checkVersion = require('../lib/check-version'); 5 | /** 6 | * Usage. 7 | */ 8 | 9 | program 10 | .option('--dashboard', '创建带仪表盘功能的项目') 11 | .option('--ts', '创建TypeScript项目'); 12 | 13 | /** 14 | * Help. 15 | */ 16 | 17 | program.on('--help', function () { 18 | console.log() 19 | console.log(' Examples:') 20 | console.log() 21 | console.log(chalk.gray(' # 创建普通项目')) 22 | console.log(' $ noahv init') 23 | console.log() 24 | console.log(chalk.gray(' # 创建带仪表盘功能的项目')) 25 | console.log(' $ noahv init --dashboard') 26 | console.log() 27 | }); 28 | 29 | program.parse(process.argv); 30 | checkVersion(() => void require('../lib/init')(program)); 31 | -------------------------------------------------------------------------------- /tools/noahv-cli/bin/noahv-start: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | const chalk = require('chalk') 3 | const program = require('commander'); 4 | const checkVersion = require('../lib/check-version'); 5 | 6 | /** 7 | * Help. 8 | */ 9 | 10 | program.on('--help', function () { 11 | console.log(); 12 | console.log(' Examples:'); 13 | console.log(); 14 | console.log(chalk.gray(' # start in default port')); 15 | console.log(' $ noahv start'); 16 | console.log(); 17 | console.log(chalk.gray(' # start in specified port')); 18 | console.log(' $ noahv start port'); 19 | console.log(); 20 | }); 21 | 22 | program.parse(process.argv); 23 | require('../lib/start')(program); 24 | -------------------------------------------------------------------------------- /tools/noahv-cli/bin/noahv-test: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | const chalk = require('chalk') 3 | const program = require('commander'); 4 | const checkVersion = require('../lib/check-version'); 5 | 6 | /** 7 | * Help. 8 | */ 9 | 10 | program.on('--help', function () { 11 | console.log(); 12 | console.log(' Examples:'); 13 | console.log(); 14 | console.log(chalk.gray(' # Run the test framework')); 15 | console.log(' $ noahv test'); 16 | console.log(); 17 | }); 18 | 19 | program.parse(process.argv); 20 | 21 | require('../lib/test')(program); 22 | -------------------------------------------------------------------------------- /tools/noahv-cli/bin/noahv-update: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | const chalk = require('chalk') 3 | const program = require('commander'); 4 | const checkVersion = require('../lib/check-version'); 5 | 6 | /** 7 | * Help. 8 | */ 9 | 10 | program.on('--help', function () { 11 | console.log(); 12 | console.log(' Examples:'); 13 | console.log(); 14 | console.log(chalk.gray(' # update noahv framwork')); 15 | console.log(' $ noahv update'); 16 | console.log(); 17 | }); 18 | 19 | program.parse(process.argv); 20 | 21 | checkVersion(() => void require('../lib/update')(program)); 22 | -------------------------------------------------------------------------------- /tools/noahv-cli/bin/noahv-upgrade: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | const chalk = require('chalk') 3 | const program = require('commander'); 4 | const checkVersion = require('../lib/check-version'); 5 | 6 | /** 7 | * Help. 8 | */ 9 | 10 | program.on('--help', function () { 11 | console.log(); 12 | console.log(' Examples:'); 13 | console.log(); 14 | console.log(chalk.gray(' # update noahv cli')); 15 | console.log(' $ noahv upgrade'); 16 | console.log(); 17 | }); 18 | 19 | program.parse(process.argv); 20 | 21 | require('../lib/upgrade')(program); -------------------------------------------------------------------------------- /tools/noahv-cli/lib/getGitTemplate.js: -------------------------------------------------------------------------------- 1 | /** 2 | * NoahV-Cli 3 | * Copyright (c) 2019 Baidu, Inc. All Rights Reserved. 4 | * 5 | * @file get template from git/github 6 | * @author darren(darrenywyu@gmail.com) 7 | */ 8 | 9 | let spawn = require('cross-spawn'); 10 | 11 | const templateDir = 'template'; 12 | 13 | // getTemplate form github 14 | function getTemplate(type, dest, cb) { 15 | let cloneArgs = [ 16 | 'clone', 17 | '--branch', 18 | 'template_' + type, 19 | 'https://github.com/baidu/NoahV.git', 20 | dest 21 | ]; 22 | let gitCloneCmd = spawn.sync('git', cloneArgs, {stdio: 'inherit'}); 23 | if (gitCloneCmd.status !== 0) { 24 | console.log(''); 25 | cb('clone template failed!') 26 | } 27 | else { 28 | cb(); 29 | } 30 | } 31 | 32 | module.exports = getTemplate; 33 | -------------------------------------------------------------------------------- /tools/noahv-cli/lib/installModules.js: -------------------------------------------------------------------------------- 1 | /** 2 | * NoahV-Cli 3 | * Copyright (c) 2019 Baidu, Inc. All Rights Reserved. 4 | * 5 | * @file install module 6 | * @author darren(darrenywyu@gmail.com) 7 | */ 8 | let spawn = require('cross-spawn'); 9 | const logUtil = require('../lib/logUtil'); 10 | 11 | module.exports = function (callback) { 12 | let args = ['i']; 13 | let cmd = spawn.sync('npm', args, {stdio: 'inherit'}); 14 | if (cmd.status !== 0) { 15 | logUtil.error('noahv-cli', 'error', 'Npm running error,you can try run npm i'); 16 | } 17 | else { 18 | callback && callback(); 19 | } 20 | }; 21 | -------------------------------------------------------------------------------- /tools/noahv-cli/lib/logUtil.js: -------------------------------------------------------------------------------- 1 | /** 2 | * NoahV-Cli 3 | * Copyright (c) 2019 Baidu, Inc. All Rights Reserved. 4 | * 5 | * @file format log 6 | * @author darren(darrenywyu@gmail.com) 7 | */ 8 | 9 | let chalk = require('chalk'); 10 | 11 | function log(prefix, status, msg, color) { 12 | let drawColor = chalk[color]; 13 | console.log(prefix + ' ' + drawColor(status) + ' ' + msg); 14 | } 15 | 16 | let logger = { 17 | info: function (prefix, status, msg) { 18 | log(prefix, status, msg, 'gray'); 19 | }, 20 | ok: function (prefix, status, msg) { 21 | log(prefix, status, msg, 'green'); 22 | }, 23 | warn: function (prefix, status, msg) { 24 | log(prefix, status, msg, 'yellow'); 25 | }, 26 | error: function (prefix, status, msg) { 27 | return log(prefix, status, msg, 'red'); 28 | } 29 | }; 30 | 31 | module.exports = exports = logger; 32 | -------------------------------------------------------------------------------- /tools/noahv-cli/scripts/build.sh: -------------------------------------------------------------------------------- 1 | export PATH=$NODEJS_BIN_LATEST:$PATH 2 | 3 | echo "node: $(node -v)" 4 | echo "npm: v$(npm -v)" 5 | 6 | npm install 7 | 8 | npm run build 9 | -------------------------------------------------------------------------------- /tools/noahv-cli/template/createApi/fail.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by noahv-cli. 3 | */ 4 | 5 | /* eslint-disable no-undef,no-unused-vars */ 6 | var mockup = require('noahv-mockup').mockupTool; 7 | 8 | exports.response = (path, params) => { 9 | 10 | return mockup.fail('Error!'); 11 | 12 | }; 13 | /* eslint-enable */ 14 | -------------------------------------------------------------------------------- /tools/noahv-cli/template/createApi/list.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by noahv-cli. 3 | */ 4 | 5 | /* eslint-disable no-undef,no-unused-vars */ 6 | var mockup = require('noahv-mockup').mockupTool; 7 | 8 | exports.response = (path, params) => { 9 | 10 | return mockup.list( 11 | [ 12 | { 13 | // id: 1 14 | }, 15 | { 16 | // id: 2 17 | } 18 | ], 19 | { 20 | totalCount: 20, 21 | pageSize: params.pageSize || 10, 22 | pageNo: params.pageNo || 1 23 | } 24 | ); 25 | 26 | }; 27 | /* eslint-enable */ 28 | -------------------------------------------------------------------------------- /tools/noahv-cli/template/createApi/ok.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by noahv-cli. 3 | */ 4 | 5 | /* eslint-disable no-undef,no-unused-vars */ 6 | var mockup = require('noahv-mockup').mockupTool; 7 | 8 | exports.response = (path, params) => { 9 | 10 | return mockup.ok( 11 | { 12 | // id: 1 13 | } 14 | ); 15 | 16 | }; 17 | /* eslint-enable */ 18 | -------------------------------------------------------------------------------- /tools/noahv-cli/template/createTest/spec.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by noahv-cli. 3 | */ 4 | 5 | /* eslint-disable no-undef */ 6 | import Vue from 'vue'; 7 | import { destroyVM } from '../util'; 8 | import ${componetName} from 'src/${componetPath}' 9 | 10 | describe('${componetName}', () => { 11 | let vm; 12 | afterEach(() => { 13 | destroyVM(vm); 14 | }); 15 | 16 | // visit http://www.chaijs.com/api/ for more detail for insertion 17 | it('has a data hook', () => { 18 | expect(typeof ${componetName}.data).to.equal('function'); 19 | }); 20 | 21 | it('new instance', () => { 22 | vm = new Vue(tableDemo).$mount(); 23 | // expect() 24 | }); 25 | 26 | // your expect 27 | }); 28 | /* eslint-enable 29 | -------------------------------------------------------------------------------- /tools/noahv-cli/template/createTpl/action.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 19 | 20 | 25 | --------------------------------------------------------------------------------