Commit bb974807 authored by 刘殿昕's avatar 刘殿昕

apaas/apaas-ui-new,/apaas/new/

parents
clone:
git:
image: registry.cn-qingdao.aliyuncs.com/wod-devops/git:1.4.0
pipeline:
read-cache:
image: registry.cn-qingdao.aliyuncs.com/wod-devops/cache:latest
restore: true
mount:
- ./node_modules
volumes:
- /data/cache:/cache
build:
image: registry.cn-qingdao.aliyuncs.com/wod-devops/node:8.15.0-onbuild
volumes:
- /data/cache/yarn:/usr/local/share/.cache/yarn/v1
commands:
- yarn install
- yarn run build
store-cache:
image: registry.cn-qingdao.aliyuncs.com/wod-devops/cache:latest
rebuild: true
mount:
- ./node_modules
volumes:
- /data/cache:/cache
docker-dev:
image: registry.cn-qingdao.aliyuncs.com/wod-devops/docker:1.0
volumes:
- /var/run/docker.sock:/var/run/docker.sock
base: registry.cn-qingdao.aliyuncs.com/wod/nginx:1.15.9-alpine
repo: apaas/apaas-ui-new
version: 1.0.0
channel: alpha
registry: hub.wodcloud.com
when:
branch: dev
docker-master:
image: registry.cn-qingdao.aliyuncs.com/wod-devops/docker:1.0
volumes:
- /var/run/docker.sock:/var/run/docker.sock
base: registry.cn-qingdao.aliyuncs.com/wod/nginx:1.15.9-alpine
repo: apaas/apaas-ui-new
version: 1.0.0
registry: hub.wodcloud.com
when:
branch: master
deploy:
image: registry.cn-qingdao.aliyuncs.com/wod-devops/kubernetes:1.0
namespace: apaas
deployment: apaas-ui-new
container: apaas-ui-new
registry: hub.wodcloud.com
branches: [master,dev]
node_modules/
\ No newline at end of file
.DS_Store
node_modules/
dist
npm-debug.log*
yarn-debug.log*
yarn-error.log*
package-lock.json
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
\ No newline at end of file
// https://github.com/michael-ciniawsky/postcss-load-config
module.exports = {
"plugins": {
"postcss-import": {},
"postcss-url": {},
// to edit target browsers: use "browserslist" field in package.json
"autoprefixer": {}
}
}
# awecloud
> A Vue.js project
## Build Setup
``` bash
# install dependencies
yarn install
# serve with hot reload at localhost:8080
yarn run dev
# build for production with minification
yarn run build
```
# 使用
## 修改config/index.js
```javascript
build: {
// Template for index.html
index: path.resolve(__dirname, '../dist', 'awecloud', 'ui', 'index.html'),
// Paths
assetsRoot: path.resolve(__dirname, '../dist', 'awecloud', 'ui'),
assetsSubDirectory: 'static',
assetsPublicPath: '/awecloud/ui/',
}
```
## 修改build/dockerfile
```
ADD ./dist /www
ADD ./build/conf.yaml /etc/awecloud/conf.yaml
```
## 修改.drone.yml
```
```
## googlefonts本地化
```bash
# index.html
- <link href='https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Material+Icons' rel="stylesheet">
# src/assets/css
add googlefonts.css googlefonts
# src/main.js
+ import "@src/assets/css/googlefonts.css";
```
## add IE11 support
```bash
# src/main.js
+ import "babel-polyfill";
# package.json
yarn add babel-polyfill
```
## remove overflow-y
```bash
# index.html
+ <style>
+ html {
+ overflow-y: auto
+ }
+ </style>
```
module.exports = {
presets: [
["@babel/preset-env", {
"modules": false
}]
],
plugins: ["transform-vue-jsx", "@babel/plugin-transform-runtime"]
}
'use strict'
require('./check-versions')()
process.env.NODE_ENV = 'production'
const ora = require('ora')
const rm = require('rimraf')
const path = require('path')
const chalk = require('chalk')
const webpack = require('webpack')
const config = require('../config')
const webpackConfig = require('./webpack.prod.conf')
const spinner = ora('building for production...')
spinner.start()
rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
if (err) throw err
webpack(webpackConfig, (err, stats) => {
spinner.stop()
if (err) throw err
process.stdout.write(stats.toString({
colors: true,
modules: false,
children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build.
chunks: false,
chunkModules: false
}) + '\n\n')
if (stats.hasErrors()) {
console.log(chalk.red(' Build failed with errors.\n'))
process.exit(1)
}
console.log(chalk.cyan(' Build complete.\n'))
console.log(chalk.yellow(
' Tip: built files are meant to be served over an HTTP server.\n' +
' Opening index.html over file:// won\'t work.\n'
))
})
})
'use strict'
const chalk = require('chalk')
const semver = require('semver')
const packageConfig = require('../package.json')
const shell = require('shelljs')
function exec(cmd) {
return require('child_process').execSync(cmd).toString().trim()
}
const versionRequirements = [
{
name: 'node',
currentVersion: semver.clean(process.version),
versionRequirement: packageConfig.engines.node
}
]
if (shell.which('yarn')) {
versionRequirements.push({
name: 'yarn',
currentVersion: exec('yarn --version'),
versionRequirement: packageConfig.engines.yarn
})
}
module.exports = function () {
const warnings = []
for (let i = 0; i < versionRequirements.length; i++) {
const mod = versionRequirements[i]
if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
warnings.push(mod.name + ': ' +
chalk.red(mod.currentVersion) + ' should be ' +
chalk.green(mod.versionRequirement)
)
}
}
if (warnings.length) {
console.log('')
console.log(chalk.yellow('To use this template, you must update following to modules:'))
console.log()
for (let i = 0; i < warnings.length; i++) {
const warning = warnings[i]
console.log(' ' + warning)
}
console.log()
process.exit(1)
}
}
index: /awecloud/ui/
login: /awecloud/dex/login
logout: /awecloud/dex/logout
\ No newline at end of file
FROM {{ BASEIMAGE }}
MAINTAINER {{ AUTHOR }}
LABEL Author={{ AUTHOR }} Name={{ PROJECT }} Version={{ VERSION }}
ADD ./dist /usr/share/nginx/html
\ No newline at end of file
'use strict'
const path = require('path')
const config = require('../config')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const packageConfig = require('../package.json')
exports.assetsPath = function (_path) {
const assetsSubDirectory = process.env.NODE_ENV === 'production'
? config.build.assetsSubDirectory
: config.dev.assetsSubDirectory
return path.posix.join(assetsSubDirectory, _path)
}
exports.cssLoaders = function (options) {
options = options || {}
const cssLoader = {
loader: 'css-loader',
options: {
sourceMap: options.sourceMap
}
}
const postcssLoader = {
loader: 'postcss-loader',
options: {
sourceMap: options.sourceMap
}
}
// generate loader string to be used with extract text plugin
function generateLoaders (loader, loaderOptions) {
const loaders = []
// Extract CSS when that option is specified
// (which is the case during production build)
if (options.extract) {
loaders.push(MiniCssExtractPlugin.loader)
}
else {
loaders.push('vue-style-loader')
}
loaders.push(cssLoader)
if (options.usePostCSS) {
loaders.push(postcssLoader)
}
if (loader) {
loaders.push({
loader: loader + '-loader',
options: Object.assign({}, loaderOptions, {
sourceMap: options.sourceMap
})
})
}
return loaders
}
// https://vue-loader.vuejs.org/en/configurations/extract-css.html
return {
css: generateLoaders(),
postcss: generateLoaders(),
less: generateLoaders('less'),
sass: generateLoaders('sass', { indentedSyntax: true }),
scss: generateLoaders('sass'),
stylus: generateLoaders('stylus'),
styl: generateLoaders('stylus')
}
}
// Generate loaders for standalone style files (outside of .vue)
exports.styleLoaders = function (options) {
const output = []
const loaders = exports.cssLoaders(options)
for (const extension in loaders) {
const loader = loaders[extension]
output.push({
test: new RegExp('\\.' + extension + '$'),
use: loader
})
}
return output
}
exports.createNotifierCallback = () => {
const notifier = require('node-notifier')
return (severity, errors) => {
if (severity !== 'error') return
const error = errors[0]
const filename = error.file && error.file.split('!').pop()
notifier.notify({
title: packageConfig.name,
message: severity + ': ' + error.name,
subtitle: filename || '',
icon: path.join(__dirname, 'logo.png')
})
}
}
'use strict'
const config = require('../config')
module.exports = {
cacheBusting: config.dev.cacheBusting,
transformAssetUrls: {
video: ['src', 'poster'],
source: 'src',
img: 'src',
image: 'xlink:href'
}
}
'use strict'
const path = require('path')
const utils = require('./utils')
const config = require('../config')
const vueLoaderConfig = require('./vue-loader.conf')
const { VueLoaderPlugin } = require('vue-loader')
function resolve(dir) {
return path.join(__dirname, '..', dir)
}
module.exports = {
context: path.resolve(__dirname, '../'),
entry: {
app: './src/main.js'
},
output: {
path: config.build.assetsRoot,
filename: '[name].js',
publicPath: process.env.NODE_ENV === 'production'
? config.build.assetsPublicPath
: config.dev.assetsPublicPath
},
plugins: [
new VueLoaderPlugin(),
],
resolve: {
extensions: ['.js', '.vue', '.json'],
alias: {
'vue$': 'vue/dist/vue.esm.js',
'@': resolve('src'),
}
},
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader',
options: vueLoaderConfig
},
{
test: /\.js$/,
loader: 'babel-loader',
include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')]
},
{
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
loader: 'url-loader',
exclude: [resolve('src/icons')],
options: {
limit: 10000,
name: utils.assetsPath('img/[name].[hash:7].[ext]')
}
},
{
test: /\.svg$/,
loader: 'svg-sprite-loader',
include: [resolve('src/icons')],
options: {
symbolId: 'icon-[name]'
}
},
{
test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('media/[name].[hash:7].[ext]')
}
},
{
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
}
}
]
},
node: {
// prevent webpack from injecting useless setImmediate polyfill because Vue
// source contains it (although only uses it if it's native).
setImmediate: false,
// prevent webpack from injecting mocks to Node native modules
// that does not make sense for the client
dgram: 'empty',
fs: 'empty',
net: 'empty',
tls: 'empty',
child_process: 'empty'
}
}
'use strict'
const utils = require('./utils')
const webpack = require('webpack')
const config = require('../config')
const merge = require('webpack-merge')
const path = require('path')
const baseWebpackConfig = require('./webpack.base.conf')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
const portfinder = require('portfinder')
const HOST = process.env.HOST
const PORT = process.env.PORT && Number(process.env.PORT)
const devWebpackConfig = merge(baseWebpackConfig, {
mode: 'development',
module: {
rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true })
},
// cheap-module-eval-source-map is faster for development
devtool: config.dev.devtool,
// these devServer options should be customized in /config/index.js
devServer: {
clientLogLevel: 'warning',
historyApiFallback: {
rewrites: [
{ from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') },
],
},
hot: true,
contentBase: false, // since we use CopyWebpackPlugin.
compress: true,
host: HOST || config.dev.host,
port: PORT || config.dev.port,
open: config.dev.autoOpenBrowser,
overlay: config.dev.errorOverlay
? { warnings: false, errors: true }
: false,
publicPath: config.dev.assetsPublicPath,
proxy: config.dev.proxyTable,
quiet: true, // necessary for FriendlyErrorsPlugin
watchOptions: {
poll: config.dev.poll,
},
disableHostCheck: true//不检查来访的host
},
plugins: [
new webpack.DefinePlugin({
'process.env': require('../config/dev.env')
}),
new webpack.HotModuleReplacementPlugin(),
new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update.
new webpack.NoEmitOnErrorsPlugin(),
// https://github.com/ampedandwired/html-webpack-plugin
new HtmlWebpackPlugin({
filename: 'index.html',
template: 'index.html',
inject: true,
favicon: './static/favicon.ico'
}),
// copy custom static assets
new CopyWebpackPlugin([
{
from: path.resolve(__dirname, '../static'),
to: config.dev.assetsSubDirectory,
ignore: ['.*']
}
])
],
optimization: {
noEmitOnErrors: true,
},
})
module.exports = new Promise((resolve, reject) => {
portfinder.basePort = process.env.PORT || config.dev.port
portfinder.getPort((err, port) => {
if (err) {
reject(err)
} else {
// publish the new Port, necessary for e2e tests
process.env.PORT = port
// add port to devServer config
devWebpackConfig.devServer.port = port
// Add FriendlyErrorsPlugin
devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({
compilationSuccessInfo: {
messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`],
},
onErrors: config.dev.notifyOnErrors
? utils.createNotifierCallback()
: undefined
}))
resolve(devWebpackConfig)
}
})
})
'use strict'
const path = require('path')
const utils = require('./utils')
const webpack = require('webpack')
const config = require('../config')
const merge = require('webpack-merge')
const baseWebpackConfig = require('./webpack.base.conf')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin')
const TerserPlugin = require('terser-webpack-plugin');
const env = require('../config/prod.env')
const webpackConfig = merge(baseWebpackConfig, {
mode: 'production',
module: {
rules: utils.styleLoaders({
sourceMap: config.build.productionSourceMap,
extract: true,
usePostCSS: true
})
},
devtool: config.build.productionSourceMap ? config.build.devtool : false,
output: {
path: config.build.assetsRoot,
filename: utils.assetsPath('js/[name].[chunkhash].js'),
},
plugins: [
// http://vuejs.github.io/vue-loader/en/workflow/production.html
new webpack.DefinePlugin({
'process.env': env
}),
// extract css into its own file
new MiniCssExtractPlugin({
filename: utils.assetsPath('css/[name].[chunkhash].css'),
}),
// Compress extracted CSS. We are using this plugin so that possible
// duplicated CSS from different components can be deduped.
new OptimizeCSSPlugin({
cssProcessorOptions: config.build.productionSourceMap
? { safe: true, map: { inline: false } }
: { safe: true }
}),
// generate dist index.html with correct asset hash for caching.
// you can customize output by editing /index.html
// see https://github.com/ampedandwired/html-webpack-plugin
new HtmlWebpackPlugin({
filename: config.build.index,
template: 'index.html',
inject: true,
minify: {
removeComments: true,
collapseWhitespace: true,
removeAttributeQuotes: true
// more options:
// https://github.com/kangax/html-minifier#options-quick-reference
},
// necessary to consistently work with multiple chunks
chunksSortMode: 'dependency'
}),
// keep module.id stable when vendor modules does not change
new webpack.NamedChunksPlugin(),
new webpack.HashedModuleIdsPlugin(),
// copy custom static assets
new CopyWebpackPlugin([
{
from: path.resolve(__dirname, '../static'),
to: config.build.assetsSubDirectory,
ignore: ['.*']
}
])
],
optimization: {
splitChunks: {
chunks: 'all',
cacheGroups: {
vendor: {
name: 'vendor',
test: /[\\/]node_modules[\\/]/,
enforce: true,
},
},
},
runtimeChunk: 'single',
minimizer: [
new TerserPlugin({
terserOptions: {
ecma: 6,
compress: true,
output: {
comments: false,
beautify: false
}
}
}),
],
},
})
if (config.build.productionGzip) {
const CompressionWebpackPlugin = require('compression-webpack-plugin')
webpackConfig.plugins.push(
new CompressionWebpackPlugin({
asset: '[path].gz[query]',
algorithm: 'gzip',
test: new RegExp(
'\\.(' +
config.build.productionGzipExtensions.join('|') +
')$'
),
threshold: 10240,
minRatio: 0.8
})
)
}
if (config.build.bundleAnalyzerReport) {
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
webpackConfig.plugins.push(new BundleAnalyzerPlugin())
}
module.exports = webpackConfig
'use strict'
const merge = require('webpack-merge')
const prodEnv = require('./prod.env')
module.exports = merge(prodEnv, {
NODE_ENV: '"development"'
})
"use strict";
// Template version: 1.3.1
// see http://vuejs-templates.github.io/webpack for documentation.
const path = require("path");
module.exports = {
dev: {
// Paths
assetsSubDirectory: "static",
assetsPublicPath: "/",
// Various Dev Server settings
host: "localhost", // can be overwritten by process.env.HOST
port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
autoOpenBrowser: false,
errorOverlay: true,
notifyOnErrors: true,
poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
// Use Eslint Loader?
// If true, your code will be linted during bundling and
// linting errors and warnings will be shown in the console.
useEslint: true,
// If true, eslint errors and warnings will also be shown in the error overlay
// in the browser.
showEslintErrorsInOverlay: false,
/**
* Source Maps
*/
// https://webpack.js.org/configuration/devtool/#development
devtool: "cheap-module-eval-source-map",
// If you have problems debugging vue-files in devtools,
// set this to false - it *may* help
// https://vue-loader.vuejs.org/en/options.html#cachebusting
cacheBusting: true,
cssSourceMap: true
},
build: {
// Template for index.html
index: path.resolve(__dirname, "../dist", "apaas", "new", "index.html"),
// Paths
assetsRoot: path.resolve(__dirname, "../dist", "apaas", "new"),
assetsSubDirectory: "static",
assetsPublicPath: "/apaas/new/",
/**
* Source Maps
*/
productionSourceMap: true,
// https://webpack.js.org/configuration/devtool/#production
devtool: "#source-map",
// Gzip off by default as many popular static hosts such as
// Surge or Netlify already gzip all static assets for you.
// Before setting to `true`, make sure to:
// npm install --save-dev compression-webpack-plugin
productionGzip: false,
productionGzipExtensions: ["js", "css"],
// Run the build command with an extra argument to
// View the bundle analyzer report after build finishes:
// `npm run build --report`
// Set to `true` or `false` to always turn it on or off
bundleAnalyzerReport: process.env.npm_config_report
}
};
'use strict'
module.exports = {
NODE_ENV: '"production"'
}
<?xml version="1.0" encoding="utf-8"?>
<AutoResponder LastSave="2018-04-21T17:18:19.4349974+08:00" FiddlerVersion="5.0.20173.50948">
<State Enabled="true" Fallthrough="true" UseLatency="false">
<ResponseRule Match="EXACT:http://localhost:8080/rest/harbor/api/projects" Action="C:\Git\cloud\awecloud-ui\docs\harbor_api_projects.json" Enabled="true" />
<ResponseRule Match="EXACT:http://localhost:8080/rest/harbor/api/projects/3" Action="C:\Git\cloud\awecloud-ui\docs\harbor_api_projects_3.json" Enabled="true" />
<ResponseRule Match="regex:http://localhost:8080/rest/harbor/api/repositories/(.*?)/tags" Action="C:\Git\cloud\awecloud-ui\docs\harbor_api_repositories_cig_rest_tags.json" Enabled="true" />
<ResponseRule Match="regex:http://localhost:8080/rest/harbor/api/repositories(.*?)" Action="C:\Git\cloud\awecloud-ui\docs\harbor_api_repositories.json" Enabled="true" />
<ResponseRule Match="regex:http://localhost:8080/rest/kubernetes/api/v1/node(.*?)" Action="C:\Git\cloud\awecloud-ui\docs\k8s_api_v1_node.json" Enabled="true" />
<ResponseRule Match="EXACT:http://localhost:8080/rest/kubernetes/api/v1/node" Action="C:\Git\cloud\awecloud-ui\docs\k8s_api_v1_node.json" Enabled="true" />
<ResponseRule Match="EXACT:http://localhost:8080/rest/kubernetes/api/v1/node/172.16.11.241" Action="C:\Git\cloud\awecloud-ui\docs\k8s_api_v1_node_192.168.74.101.json" Enabled="true" />
<ResponseRule Match="EXACT:http://localhost:8080/api/v4/user" Action="C:\Git\cloud\awecloud-ui\docs\gitlab_api_v4_user.json" Enabled="true" />
</State>
</AutoResponder>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<AutoResponder LastSave="2018-04-20T23:41:40.6792103+08:00" FiddlerVersion="5.0.20173.49666">
<State Enabled="true" Fallthrough="true" UseLatency="false">
<ResponseRule Match="regex:https://gitlab.ispacesys.cn/awecloud/ui(.*?)" Action="http://localhost:8080$1" Enabled="true" />
<ResponseRule Match="regex:https://gitlab.ispacesys.cn/static(.*?)" Action="http://localhost:8080/static$1" Enabled="true" />
<ResponseRule Match="EXACT:https://gitlab.ispacesys.cn/app.js" Action="http://localhost:8080/app.js" Enabled="true" />
</State>
</AutoResponder>
\ No newline at end of file
This diff is collapsed.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<title>宁乡智慧商圈app</title>
<link rel="shortcut icon" type="image/x-icon" href="static/favicon.ico" />
</head>
<body>
<div id="app"></div>
</body>
</html>
{
"name": "apaas-ui-new",
"version": "1.0.0",
"description": "A Vuetify.js Project Manage Kubernetes",
"author": "shucheng <shucheng@bd-apaas.com>",
"private": true,
"scripts": {
"dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
"start": "npm run dev",
"build": "node build/build.js"
},
"dependencies": {
"@antv/f2": "^3.6.0-alpha.2",
"@fortawesome/fontawesome-free": "^5.8.0",
"babel-polyfill": "^6.26.0",
"codemirror": "^5.45.0",
"echarts": "^4.2.1",
"element-ui": "^2.11.1",
"esri-loader": "^2.13.0",
"material-design-icons-iconfont": "^4.0.5",
"mint-ui": "^2.2.13",
"string-format": "^2.0.0",
"svg-sprite-loader": "^4.2.1",
"vant": "^2.5.3",
"vue": "^2.6.10",
"vue-resource": "^1.5.1",
"vue-router": "^3.0.2",
"vuex": "^3.1.0"
},
"devDependencies": {
"@babel/core": "^7.4.0",
"@babel/plugin-syntax-jsx": "^7.2.0",
"@babel/plugin-transform-runtime": "^7.4.0",
"@babel/preset-env": "^7.4.2",
"@babel/runtime": "^7.4.2",
"autoprefixer": "^9.5.0",
"babel-loader": "^8.0.5",
"babel-plugin-syntax-jsx": "^6.18.0",
"babel-plugin-transform-vue-jsx": "^3.7.0",
"chalk": "^2.4.2",
"copy-webpack-plugin": "^4.0.1",
"css-loader": "^2.1.1",
"file-loader": "^3.0.1",
"friendly-errors-webpack-plugin": "^1.7.0",
"html-webpack-plugin": "^3.2.0",
"mini-css-extract-plugin": "^0.5.0",
"node-notifier": "^5.4.0",
"optimize-css-assets-webpack-plugin": "^5.0.1",
"ora": "^3.2.0",
"portfinder": "^1.0.20",
"postcss-import": "^12.0.1",
"postcss-loader": "^3.0.0",
"postcss-url": "^8.0.0",
"rimraf": "^2.6.3",
"semver": "^5.6.0",
"shelljs": "^0.8.3",
"terser-webpack-plugin": "^1.2.3",
"url-loader": "^1.1.2",
"vue-loader": "^15.7.0",
"vue-style-loader": "^4.1.2",
"vue-template-compiler": "^2.6.10",
"vux": "^2.9.4",
"webpack": "^4.29.6",
"webpack-bundle-analyzer": "^3.1.0",
"webpack-cli": "^3.2.3",
"webpack-dev-server": "^3.2.1",
"webpack-merge": "^4.2.1"
},
"engines": {
"node": ">= 8.12.0",
"npm": ">= 6.4.1",
"yarn": ">= 1.12.3"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
]
}
; DO NOT EDIT (unless you know what you are doing)
;
; This subdirectory is a git "subrepo", and this file is maintained by the
; git-subrepo command. See https://github.com/git-commands/git-subrepo#readme
;
[subrepo]
remote = https://github.com/vuetifyjs/templates-common.git
branch = subrepo/webpack-src
commit = 090741fa8ba4da0c6f85db64eff64550704123e1
parent = e05204fc0583a8c99f1963ce873eba1266838215
method = merge
cmdver = 0.4.0
<template>
<div id="app">
<router-view />
</div>
</template>
<script>
export default {
data: () => ({}),
methods: {
windowResize() {
const remSize = 20; // 1rem === 20px
const rect = document.body.getBoundingClientRect();
const fontSize = (Math.min(rect.width, rect.height) / 720) * remSize;
document.documentElement.style.fontSize = fontSize + "px";
},
initRem() {
this.windowResize();
window.addEventListener("resize", this.windowResize, false);
}
},
created() {
this.initRem();
}
};
</script>
/* reset */
html {
height: 100%;
}
body {
height: 100%;
margin: 0;
font-family: PingFangSC-Regular, sans-serif;
font-size: 1rem;
}
ul {
list-style: none;
padding: 0;
margin: 0;
}
p {
margin: 0;
}
h1,
h2,
h3,
h4,
h5 {
margin: 0;
font-weight: normal;
}
/* reset end */
/* common */
#app {
height: 100%;
overflow: hidden;
}
.text_clip {
overflow: hidden;
text-overflow: ellipsis;
word-break: break-all;
white-space: nowrap;
}
.map_container {
background-color: #eee;
}
.ss_card {
padding: 1.2rem;
display: flex;
justify-content: flex-start;
align-items: flex-start;
}
.ss_card > .sc_left_container {
width: 6rem;
height: 6rem;
flex-shrink: 0;
border-radius: 0.5rem;
overflow: hidden;
font-size: 0;
}
.ss_card > .sc_right_container {
width: calc(100% - 7rem);
flex-grow: 1;
margin-left: 1.2rem;
}
.ss_card > .sc_right_container > .sc_title {
font-size: 1.6rem;
font-weight: bold;
line-height: 2.6rem;
}
.ss_card > .sc_right_container > .sc_info {
display: flex;
justify-content: space-between;
align-items: center;
font-size: 1.2rem;
line-height: 2rem;
margin-top: 0.5rem;
}
.ss_card > .sc_right_container > .sc_info > span:not(:first-of-type) {
margin-left: 1.2rem;
}
.ss_card > .sc_right_container > .sc_info > .sc_star {
color: #ff9c00;
}
.ss_card > .sc_right_container > .sc_info > .sc_star > * {
display: inline-block;
vertical-align: middle;
}
.ss_card > .sc_right_container > .sc_description {
font-size: 1.3rem;
line-height: 2rem;
margin-top: 0.5rem;
}
.card_list > li {
padding: 1.2rem;
display: flex;
justify-content: flex-start;
align-items: flex-start;
}
.card_list > li:not(:last-child) {
border-bottom: 2px solid #f8f9fd;
}
.card_list > li > .caid_icon {
width: 4rem;
height: 4rem;
flex-shrink: 0;
border: 1px solid #e3e5ef;
box-sizing: border-box;
border-radius: 0.5rem;
background-color: #f4f7fc;
overflow: hidden;
}
.card_list > li > .card_detail {
margin-left: 1.7rem;
width: calc(100vw - 5.7rem);
}
.card_list > li > .card_detail > .card_title {
display: flex;
justify-content: space-between;
align-items: center;
font-size: 1.2rem;
font-weight: bold;
color: #58617a;
}
.card_list > li > .card_detail > .card_score {
height: 2rem;
display: flex;
justify-content: flex-start;
align-items: center;
margin-top: 0.5rem;
}
.card_list > li > .card_detail > .card_score > span {
margin-left: 0.5rem;
font-size: 1.2rem;
}
.card_list > li > .card_detail > .card_description {
font-size: 1.3rem;
line-height: 2rem;
margin-top: 0.5rem;
}
.card_list > li > .card_detail > .card_images {
font-size: 0;
margin-top: 1.5rem;
}
.card_list > li > .card_detail > .card_images > li {
display: inline-block;
vertical-align: middle;
width: calc((100vw - 5.7rem - 2.4rem - 2.6rem) / 3);
height: calc((100vw - 5.7rem - 2.4rem - 2.6rem) / 3);
background-color: #f4f7fc;
border-radius: 0.5rem;
overflow: hidden;
}
.card_list > li > .card_detail > .card_images > li.bigger {
width: calc((100vw - 5.7rem - 2.4rem - 1.3rem) / 2);
height: calc((100vw - 5.7rem - 2.4rem - 1.3rem) / 2);
}
.card_list > li > .card_detail > .card_images > li:not(:last-child) {
margin-right: 1.3rem;
}
.search_header .van-nav-bar {
height: 5.6rem;
line-height: 5.6rem;
}
.search_header .van-nav-bar__title {
max-width: calc(100% - 6.4rem);
margin: 0 0 0 5.2rem;
}
.search_header .van-hairline--bottom::after {
border-bottom: none;
}
.search_header .van-search {
height: 3.2rem;
background-color: #f8f9fd;
padding: 0 1.5rem;
border-radius: 1.6rem;
overflow: hidden;
margin: 1.2rem 0;
}
.search_header .van-search__content {
background-color: transparent;
}
.search_header .van-search__action {
font-size: 1.4rem;
line-height: 3.4rem;
}
/* common end */
/* vant reset */
.white {
background-color: #fff !important;
}
.van-nav-bar {
height: 4.2rem;
line-height: 4.2rem;
}
.van-nav-bar__title {
font-size: 1.7rem;
font-weight: bold;
}
.van-nav-bar__left {
left: 1.6rem;
font-size: 1.8rem;
}
.van-nav-bar__right {
right: 1.6rem;
font-size: 1.8rem;
}
.van-nav-bar .van-icon {
font-size: 1.6rem;
}
.van-hairline--bottom::after {
border-bottom: 2px solid #dfe2ec;
}
.van-hairline--bottom.hide_border::after {
border-bottom: none;
}
.van-button--small {
min-width: 3rem;
height: 1.8rem;
padding: 0 0.4rem;
font-size: 1rem;
line-height: 1.4rem;
margin-right: 0.5rem;
}
.white .van-tabs__nav {
background-color: #fff;
}
.van-tab {
padding: 0 0.5rem;
font-size: 1.6rem;
line-height: 4rem;
}
.van-tabs__nav--line {
padding-bottom: 1.5rem;
}
.van-tabs--line .van-tabs__wrap {
height: 4rem;
}
.van-cell {
padding: 1rem 1.6rem;
font-size: 1.4rem;
line-height: 2.4rem;
}
.van-cell:not(:last-child)::after {
right: 1.6rem;
left: 1.6rem;
}
.van-cell__label {
font-size: 1.2rem;
line-height: 1.8rem;
margin-top: 0.3rem;
}
.search_head {
width: 100%;
height: 5rem;
}
.search_head .van-nav-bar {
position: relative;
z-index: 1;
height: 5rem;
line-height: 5rem;
text-align: center;
background-color: #fff;
-webkit-user-select: none;
user-select: none;
}
.search_head .van-nav-bar .van-search {
display: -webkit-box;
display: -webkit-flex;
display: flex;
-webkit-box-align: center;
-webkit-align-items: center;
align-items: center;
box-sizing: border-box;
padding: 1rem 1.1rem 0;
background-color: #fff;
}
.search_head .van-nav-bar__title {
max-width: 92%;
margin: 0 0 0 8%;
color: #323233;
font-weight: 500;
font-size: 1.6rem;
}
.search_head .van-nav-bar__left {
top: 0;
left: 1.5rem;
}
.van-search {
display: -webkit-box;
display: -webkit-flex;
display: flex;
-webkit-box-align: center;
-webkit-align-items: center;
align-items: center;
box-sizing: border-box;
padding: 1rem 1.1rem;
background-color: #fff;
}
.van-search .van-cell {
-webkit-box-flex: 1;
-webkit-flex: 1;
flex: 1;
padding: 0.4rem 0.8rem 0.4rem 0;
background-color: transparent;
}
.van-dropdown-menu {
background-color: transparent;
}
.van-dropdown-menu__title {
padding: 0 0.8rem;
font-size: 1.4rem;
line-height: 1.8rem;
}
.van-sidebar {
width: 100%;
}
.van-sidebar-item {
display: block;
box-sizing: border-box;
padding: 1.6rem 1.3rem 1.6rem 0.9rem;
overflow: hidden;
color: #323233;
font-size: 1rem;
line-height: 2.2rem;
word-break: break-word;
background-color: #fafafa;
border-left: 0.3rem solid transparent;
cursor: pointer;
-webkit-user-select: none;
user-select: none;
}
.van-sidebar-item {
height: 4rem;
padding: 1rem;
box-sizing: border-box;
font-size: 1.4rem;
font-weight: bold;
line-height: 2rem;
}
.van-sidebar-item--select {
border-color: #fff;
background-color: #fff;
color: #0562f2;
}
.van-tree-select__item {
height: 4rem;
padding: 1rem 2rem;
box-sizing: border-box;
font-size: 1.4rem;
line-height: 2rem;
}
.van-tree-select__item--active {
color: #0562f2;
}
.van-tree-select__item--active .van-icon {
display: none;
}
.van-dropdown-item__content {
border-bottom-left-radius: 1.2rem;
border-bottom-right-radius: 1.2rem;
}
.van-field__control,
.van-field__control::placeholder {
max-height: 9.6rem !important;
}
.van-field__word-limit {
font-size: 1.2rem;
line-height: 1.6rem;
}
.van-field__error-message {
font-size: 1.2rem;
}
.van-uploader__upload {
border-radius: 0.5rem;
}
.van-uploader__preview {
margin: 0 1rem 1rem 0;
}
.van-uploader__upload {
background-color: #d1e2fc;
}
.van-uploader__upload-icon {
font-size: 2rem;
color: #327ef4;
}
.van-uploader__preview-delete {
font-size: 1.8rem;
top: -0.9rem;
right: -0.9rem;
}
.van-button {
height: 4.4rem;
line-height: 4.4rem;
}
.van-button--normal {
padding: 0 1.5rem;
}
.van-button--normal {
font-size: 1.4rem;
}
.van-list__error-text,
.van-list__finished-text,
.van-list__loading {
font-size: 1.4rem;
line-height: 5rem;
}
.van-image__error,
.van-image__loading {
font-size: 1.4rem;
}
.van-dropdown-item--down {
z-index: 30;
}
.van-overlay {
z-index: 999;
}
/* vant reset end */
.in_list {
height: calc(100vh - 4.5rem);
overflow: auto;
}
This diff is collapsed.
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 672 301"><defs><style>.cls-1{fill:#fff;}.cls-1,.cls-2{fill-rule:evenodd;}.cls-2{fill:#f4f7fc;}</style></defs><title>ic_画板 3</title><path class="cls-1" d="M658,59H252.75c-8.84,0-21.28-5.28-27.79-11.79L189.54,11.79C183,5.28,170.59,0,161.75,0H14A14,14,0,0,0,0,14V287a14,14,0,0,0,14,14H658a14,14,0,0,0,14-14V73A14,14,0,0,0,658,59Z"/><path class="cls-2" d="M658,59H252.75c-8.84,0-21.28-5.28-27.79-11.79L189.54,11.79C183,5.28,170.59,0,161.75,0H14A14,14,0,0,0,0,14V231H672V73A14,14,0,0,0,658,59Z"/></svg>
\ No newline at end of file
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 672 839"><defs><style>.cls-1{fill:none;}.cls-2{fill:#fff;fill-rule:evenodd;}</style></defs><title>ic_画板 4</title><path class="cls-1" d="M658,59H252.75c-8.84,0-21.28-5.28-27.79-11.79L189.54,11.79C183,5.28,170.59,0,161.75,0H14A14,14,0,0,0,0,14V825a14,14,0,0,0,14,14H658a14,14,0,0,0,14-14V73A14,14,0,0,0,658,59Z"/><path class="cls-2" d="M658,59H252.75c-8.84,0-21.28-5.28-27.79-11.79L189.54,11.79C183,5.28,170.59,0,161.75,0H14A14,14,0,0,0,0,14V825a14,14,0,0,0,14,14H658a14,14,0,0,0,14-14V73A14,14,0,0,0,658,59Z"/></svg>
\ No newline at end of file
import "babel-polyfill";
import Vue from "vue";
import Vuex from "vuex";
Vue.use(Vuex);
import store from "@/store";
store.install(Vuex);
import VueResource from "vue-resource";
Vue.use(VueResource);
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css'
Vue.use(ElementUI)
import App from "./App";
import router from "./router";
import "./assets/css/index.css";
new Vue({
el: "#app",
router,
store,
components: { App },
template: "<App/>"
});
<template>
<div class="index_container">
<router-view />
</div>
</template>
<script>
export default {
data: () => ({})
};
</script>
<style scoped>
.index_container {
height: 100%;
overflow-x: hidden;
overflow-y: auto;
}
</style>
import Vue from "vue";
import Router from "vue-router";
import Index from "@/pages/index";
Vue.use(Router);
export default new Router({
routes: [
{
path: "/",
redirect: "/index"
},
{
path: "/index",
name: "index",
component: Index,
}
]
});
module.exports = {
"harbor": "/awecloud/rest/harbor/api",
};
\ No newline at end of file
var store = {
install: function(Vuex) {
store.namespace = new Vuex.Store({
state: {
userInfo: null, // 用户信息
ssType: "全部",
ssPrams: {
firstId: "", // int 一级分类 0全部
secondId: "", // int 二级分类 0全部
type: 0, // int 0 附近 1评价
search: "", // string 按名称搜索
fifteen: 0
}, // 设施列表参数 for ssHeader组件
name: "",
//进行相关操作和请求接口时,调用函数同步更改,页面的初始化使用state里面的值进行绑定
selectedFacility: {
//选中的poi,点击地图上的点或者在列表中选中时更新状态
name: "", //poi的名称
id: "", //poi的id
distance: "", //poi离用户的距离
evaluation: "", //poi的评分
evaluation_num: "", //poi的评价次数
address: "", //poi的详细地址
discribe: "", //poi的描述信息
lat: "", //poi的经纬度
lng: "",
type: "" ,//poi的类型
detail_type: "" ,//poi的类型
tertiary_type:[]//停车场的具体类型,地下1,地面2,路边3
},
// selectID:"",
// selectTag: "",
currentPosition: {
lng: 112.546184,
lat: 28.281588
},
mapState: "showAll", //"showAll","showSelectTag","showSelectedFacility",
isPullUp: false//是否上拉,为true时,地图的浮窗将会隐藏
},
mutations: {
updateSstype(state, payload) {
state.ssType = payload;
},
upDateSsParams(state, payload) {
Object.assign(state.ssPrams, payload);
},
change(state, name) {
state.name = name;
sessionStorage.setItem("name", name);
},
updateFullDetail(state, detail) {
Object.assign(state.selectedFacility, detail);
},
updateMapState(state, payload) {
state.mapState = payload;
},
updatecurrentPosition(state, payload) {
state.currentPosition = payload;
},
upDateIsPullUp(state, value) {
state.isPullUp = value;
}
/* updateselectTag(state, payload) {
state.selectTag = payload;
},
updateselectID(state, payload) {
state.selectID = payload;
}, */
}
});
}
};
module.exports = store;
(function (window, document) {
var eventUrl = "/awecloud/api/events/token/subscribe";
var pingUrl = "/awecloud/api/events/token/publish?state=ping";
var evtSource = new EventSource(eventUrl);
evtSource.addEventListener("message", function (e) {
console.log("message:", e);
if (e.data == "timeout") {
location.href = "/awecloud/dex/logout?ReturnUrl=" + encodeURIComponent(location.href);
} else if (e.data == "new_login") {
location.href = "/awecloud/dex/logout?ReturnUrl=" + encodeURIComponent(location.href);
}
});
var pingFn = function () {
var req = new XMLHttpRequest();
req.open("GET", pingUrl);
req.send();
};
var nowFn = function () {
return new Date().getTime();
};
var lastActTime = nowFn();
var interval = 10000;
var pingTimerFn = function () {
if (nowFn() - lastActTime < interval) {
pingFn();
}
setTimeout(pingTimerFn, interval);
};
pingTimerFn();
var listenMouseover = function () {
document.body.addEventListener("mouseover", function (e) {
lastActTime = nowFn();
});
};
if (document.body) {
listenMouseover();
} else {
window.addEventListener("load", listenMouseover);
}
})(window, document);
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment