Commit 0e4fff56 by zhaochengxiang

init

parents
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
## Available Scripts
In the project directory, you can run:
### `yarn start`
Runs the app in the development mode.<br />
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
The page will reload if you make edits.<br />
You will also see any lint errors in the console.
### `yarn test`
Launches the test runner in the interactive watch mode.<br />
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
### `yarn build`
Builds the app for production to the `build` folder.<br />
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.<br />
Your app is ready to be deployed!
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
### `yarn eject`
**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
## Learn More
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
To learn React, check out the [React documentation](https://reactjs.org/).
'use strict';
const fs = require('fs');
const path = require('path');
const paths = require('./paths');
// Make sure that including paths.js after env.js will read .env variables.
delete require.cache[require.resolve('./paths')];
const NODE_ENV = process.env.NODE_ENV;
if (!NODE_ENV) {
throw new Error(
'The NODE_ENV environment variable is required but was not specified.'
);
}
// https://github.com/bkeepers/dotenv#what-other-env-files-can-i-use
const dotenvFiles = [
`${paths.dotenv}.${NODE_ENV}.local`,
`${paths.dotenv}.${NODE_ENV}`,
// Don't include `.env.local` for `test` environment
// since normally you expect tests to produce the same
// results for everyone
NODE_ENV !== 'test' && `${paths.dotenv}.local`,
paths.dotenv,
].filter(Boolean);
// Load environment variables from .env* files. Suppress warnings using silent
// if this file is missing. dotenv will never modify any environment variables
// that have already been set. Variable expansion is supported in .env files.
// https://github.com/motdotla/dotenv
// https://github.com/motdotla/dotenv-expand
dotenvFiles.forEach(dotenvFile => {
if (fs.existsSync(dotenvFile)) {
require('dotenv-expand')(
require('dotenv').config({
path: dotenvFile,
})
);
}
});
// We support resolving modules according to `NODE_PATH`.
// This lets you use absolute paths in imports inside large monorepos:
// https://github.com/facebook/create-react-app/issues/253.
// It works similar to `NODE_PATH` in Node itself:
// https://nodejs.org/api/modules.html#modules_loading_from_the_global_folders
// Note that unlike in Node, only *relative* paths from `NODE_PATH` are honored.
// Otherwise, we risk importing Node.js core modules into an app instead of Webpack shims.
// https://github.com/facebook/create-react-app/issues/1023#issuecomment-265344421
// We also resolve them to make sure all tools using them work consistently.
const appDirectory = fs.realpathSync(process.cwd());
process.env.NODE_PATH = (process.env.NODE_PATH || '')
.split(path.delimiter)
.filter(folder => folder && !path.isAbsolute(folder))
.map(folder => path.resolve(appDirectory, folder))
.join(path.delimiter);
// Grab NODE_ENV and REACT_APP_* environment variables and prepare them to be
// injected into the application via DefinePlugin in Webpack configuration.
const REACT_APP = /^REACT_APP_/i;
function getClientEnvironment(publicUrl) {
const raw = Object.keys(process.env)
.filter(key => REACT_APP.test(key))
.reduce(
(env, key) => {
env[key] = process.env[key];
return env;
},
{
// Useful for determining whether we’re running in production mode.
// Most importantly, it switches React into the correct mode.
NODE_ENV: process.env.NODE_ENV || 'development',
// Useful for resolving the correct path to static assets in `public`.
// For example, <img src={process.env.PUBLIC_URL + '/img/logo.png'} />.
// This should only be used as an escape hatch. Normally you would put
// images into the `src` and `import` them in code to get their paths.
PUBLIC_URL: publicUrl,
}
);
// Stringify all values so we can feed into Webpack DefinePlugin
const stringified = {
'process.env': Object.keys(raw).reduce((env, key) => {
env[key] = JSON.stringify(raw[key]);
return env;
}, {}),
};
return { raw, stringified };
}
module.exports = getClientEnvironment;
'use strict';
// This is a custom Jest transformer turning style imports into empty objects.
// http://facebook.github.io/jest/docs/en/webpack.html
module.exports = {
process() {
return 'module.exports = {};';
},
getCacheKey() {
// The output is always the same.
return 'cssTransform';
},
};
'use strict';
const path = require('path');
const camelcase = require('camelcase');
// This is a custom Jest transformer turning file imports into filenames.
// http://facebook.github.io/jest/docs/en/webpack.html
module.exports = {
process(src, filename) {
const assetFilename = JSON.stringify(path.basename(filename));
if (filename.match(/\.svg$/)) {
// Based on how SVGR generates a component name:
// https://github.com/smooth-code/svgr/blob/01b194cf967347d43d4cbe6b434404731b87cf27/packages/core/src/state.js#L6
const pascalCaseFilename = camelcase(path.parse(filename).name, {
pascalCase: true,
});
const componentName = `Svg${pascalCaseFilename}`;
return `const React = require('react');
module.exports = {
__esModule: true,
default: ${assetFilename},
ReactComponent: React.forwardRef(function ${componentName}(props, ref) {
return {
$$typeof: Symbol.for('react.element'),
type: 'svg',
ref: ref,
key: null,
props: Object.assign({}, props, {
children: ${assetFilename}
})
};
}),
};`;
}
return `module.exports = ${assetFilename};`;
},
};
'use strict';
const fs = require('fs');
const path = require('path');
const paths = require('./paths');
const chalk = require('react-dev-utils/chalk');
const resolve = require('resolve');
/**
* Get additional module paths based on the baseUrl of a compilerOptions object.
*
* @param {Object} options
*/
function getAdditionalModulePaths(options = {}) {
const baseUrl = options.baseUrl;
// We need to explicitly check for null and undefined (and not a falsy value) because
// TypeScript treats an empty string as `.`.
if (baseUrl == null) {
// If there's no baseUrl set we respect NODE_PATH
// Note that NODE_PATH is deprecated and will be removed
// in the next major release of create-react-app.
const nodePath = process.env.NODE_PATH || '';
return nodePath.split(path.delimiter).filter(Boolean);
}
const baseUrlResolved = path.resolve(paths.appPath, baseUrl);
// We don't need to do anything if `baseUrl` is set to `node_modules`. This is
// the default behavior.
if (path.relative(paths.appNodeModules, baseUrlResolved) === '') {
return null;
}
// Allow the user set the `baseUrl` to `appSrc`.
if (path.relative(paths.appSrc, baseUrlResolved) === '') {
return [paths.appSrc];
}
// If the path is equal to the root directory we ignore it here.
// We don't want to allow importing from the root directly as source files are
// not transpiled outside of `src`. We do allow importing them with the
// absolute path (e.g. `src/Components/Button.js`) but we set that up with
// an alias.
if (path.relative(paths.appPath, baseUrlResolved) === '') {
return null;
}
// Otherwise, throw an error.
throw new Error(
chalk.red.bold(
"Your project's `baseUrl` can only be set to `src` or `node_modules`." +
' Create React App does not support other values at this time.'
)
);
}
/**
* Get webpack aliases based on the baseUrl of a compilerOptions object.
*
* @param {*} options
*/
function getWebpackAliases(options = {}) {
const baseUrl = options.baseUrl;
if (!baseUrl) {
return {};
}
const baseUrlResolved = path.resolve(paths.appPath, baseUrl);
if (path.relative(paths.appPath, baseUrlResolved) === '') {
return {
src: paths.appSrc,
};
}
}
/**
* Get jest aliases based on the baseUrl of a compilerOptions object.
*
* @param {*} options
*/
function getJestAliases(options = {}) {
const baseUrl = options.baseUrl;
if (!baseUrl) {
return {};
}
const baseUrlResolved = path.resolve(paths.appPath, baseUrl);
if (path.relative(paths.appPath, baseUrlResolved) === '') {
return {
'^src/(.*)$': '<rootDir>/src/$1',
};
}
}
function getModules() {
// Check if TypeScript is setup
const hasTsConfig = fs.existsSync(paths.appTsConfig);
const hasJsConfig = fs.existsSync(paths.appJsConfig);
if (hasTsConfig && hasJsConfig) {
throw new Error(
'You have both a tsconfig.json and a jsconfig.json. If you are using TypeScript please remove your jsconfig.json file.'
);
}
let config;
// If there's a tsconfig.json we assume it's a
// TypeScript project and set up the config
// based on tsconfig.json
if (hasTsConfig) {
const ts = require(resolve.sync('typescript', {
basedir: paths.appNodeModules,
}));
config = ts.readConfigFile(paths.appTsConfig, ts.sys.readFile).config;
// Otherwise we'll check if there is jsconfig.json
// for non TS projects.
} else if (hasJsConfig) {
config = require(paths.appJsConfig);
}
config = config || {};
const options = config.compilerOptions || {};
const additionalModulePaths = getAdditionalModulePaths(options);
return {
additionalModulePaths: additionalModulePaths,
webpackAliases: getWebpackAliases(options),
jestAliases: getJestAliases(options),
hasTsConfig,
};
}
module.exports = getModules();
'use strict';
const path = require('path');
const fs = require('fs');
const url = require('url');
// Make sure any symlinks in the project folder are resolved:
// https://github.com/facebook/create-react-app/issues/637
const appDirectory = fs.realpathSync(process.cwd());
const resolveApp = relativePath => path.resolve(appDirectory, relativePath);
const envPublicUrl = process.env.PUBLIC_URL;
function ensureSlash(inputPath, needsSlash) {
const hasSlash = inputPath.endsWith('/');
if (hasSlash && !needsSlash) {
return inputPath.substr(0, inputPath.length - 1);
} else if (!hasSlash && needsSlash) {
return `${inputPath}/`;
} else {
return inputPath;
}
}
const getPublicUrl = appPackageJson =>
envPublicUrl || require(appPackageJson).homepage;
// We use `PUBLIC_URL` environment variable or "homepage" field to infer
// "public path" at which the app is served.
// Webpack needs to know it to put the right <script> hrefs into HTML even in
// single-page apps that may serve index.html for nested URLs like /todos/42.
// We can't use a relative path in HTML because we don't want to load something
// like /todos/42/static/js/bundle.7289d.js. We have to know the root.
function getServedPath(appPackageJson) {
const publicUrl = getPublicUrl(appPackageJson);
const servedUrl =
envPublicUrl || (publicUrl ? url.parse(publicUrl).pathname : '/');
return ensureSlash(servedUrl, true);
}
const moduleFileExtensions = [
'web.mjs',
'mjs',
'web.js',
'js',
'web.ts',
'ts',
'web.tsx',
'tsx',
'json',
'web.jsx',
'jsx',
];
// Resolve file paths in the same order as webpack
const resolveModule = (resolveFn, filePath) => {
const extension = moduleFileExtensions.find(extension =>
fs.existsSync(resolveFn(`${filePath}.${extension}`))
);
if (extension) {
return resolveFn(`${filePath}.${extension}`);
}
return resolveFn(`${filePath}.js`);
};
// config after eject: we're in ./config/
module.exports = {
dotenv: resolveApp('.env'),
appPath: resolveApp('.'),
appBuild: resolveApp('build'),
appPublic: resolveApp('public'),
appHtml: resolveApp('public/index.html'),
appIndexJs: resolveModule(resolveApp, 'src/index'),
appPackageJson: resolveApp('package.json'),
appSrc: resolveApp('src'),
appTsConfig: resolveApp('tsconfig.json'),
appJsConfig: resolveApp('jsconfig.json'),
yarnLockFile: resolveApp('yarn.lock'),
testsSetup: resolveModule(resolveApp, 'src/setupTests'),
proxySetup: resolveApp('src/setupProxy.js'),
appNodeModules: resolveApp('node_modules'),
publicUrl: getPublicUrl(resolveApp('package.json')),
servedPath: getServedPath(resolveApp('package.json')),
};
module.exports.moduleFileExtensions = moduleFileExtensions;
'use strict';
const { resolveModuleName } = require('ts-pnp');
exports.resolveModuleName = (
typescript,
moduleName,
containingFile,
compilerOptions,
resolutionHost
) => {
return resolveModuleName(
moduleName,
containingFile,
compilerOptions,
resolutionHost,
typescript.resolveModuleName
);
};
exports.resolveTypeReferenceDirective = (
typescript,
moduleName,
containingFile,
compilerOptions,
resolutionHost
) => {
return resolveModuleName(
moduleName,
containingFile,
compilerOptions,
resolutionHost,
typescript.resolveTypeReferenceDirective
);
};
'use strict';
const errorOverlayMiddleware = require('react-dev-utils/errorOverlayMiddleware');
const evalSourceMapMiddleware = require('react-dev-utils/evalSourceMapMiddleware');
const noopServiceWorkerMiddleware = require('react-dev-utils/noopServiceWorkerMiddleware');
const ignoredFiles = require('react-dev-utils/ignoredFiles');
const paths = require('./paths');
const fs = require('fs');
const protocol = process.env.HTTPS === 'true' ? 'https' : 'http';
const host = process.env.HOST || '0.0.0.0';
module.exports = function(proxy, allowedHost) {
return {
// WebpackDevServer 2.4.3 introduced a security fix that prevents remote
// websites from potentially accessing local content through DNS rebinding:
// https://github.com/webpack/webpack-dev-server/issues/887
// https://medium.com/webpack/webpack-dev-server-middleware-security-issues-1489d950874a
// However, it made several existing use cases such as development in cloud
// environment or subdomains in development significantly more complicated:
// https://github.com/facebook/create-react-app/issues/2271
// https://github.com/facebook/create-react-app/issues/2233
// While we're investigating better solutions, for now we will take a
// compromise. Since our WDS configuration only serves files in the `public`
// folder we won't consider accessing them a vulnerability. However, if you
// use the `proxy` feature, it gets more dangerous because it can expose
// remote code execution vulnerabilities in backends like Django and Rails.
// So we will disable the host check normally, but enable it if you have
// specified the `proxy` setting. Finally, we let you override it if you
// really know what you're doing with a special environment variable.
disableHostCheck:
!proxy || process.env.DANGEROUSLY_DISABLE_HOST_CHECK === 'true',
// Enable gzip compression of generated files.
compress: true,
// Silence WebpackDevServer's own logs since they're generally not useful.
// It will still show compile warnings and errors with this setting.
clientLogLevel: 'none',
// By default WebpackDevServer serves physical files from current directory
// in addition to all the virtual build products that it serves from memory.
// This is confusing because those files won’t automatically be available in
// production build folder unless we copy them. However, copying the whole
// project directory is dangerous because we may expose sensitive files.
// Instead, we establish a convention that only files in `public` directory
// get served. Our build script will copy `public` into the `build` folder.
// In `index.html`, you can get URL of `public` folder with %PUBLIC_URL%:
// <link rel="icon" href="%PUBLIC_URL%/favicon.ico">
// In JavaScript code, you can access it with `process.env.PUBLIC_URL`.
// Note that we only recommend to use `public` folder as an escape hatch
// for files like `favicon.ico`, `manifest.json`, and libraries that are
// for some reason broken when imported through Webpack. If you just want to
// use an image, put it in `src` and `import` it from JavaScript instead.
contentBase: paths.appPublic,
// By default files from `contentBase` will not trigger a page reload.
watchContentBase: true,
// Enable hot reloading server. It will provide /sockjs-node/ endpoint
// for the WebpackDevServer client so it can learn when the files were
// updated. The WebpackDevServer client is included as an entry point
// in the Webpack development configuration. Note that only changes
// to CSS are currently hot reloaded. JS changes will refresh the browser.
hot: true,
// Use 'ws' instead of 'sockjs-node' on server since we're using native
// websockets in `webpackHotDevClient`.
transportMode: 'ws',
// Prevent a WS client from getting injected as we're already including
// `webpackHotDevClient`.
injectClient: false,
// It is important to tell WebpackDevServer to use the same "root" path
// as we specified in the config. In development, we always serve from /.
publicPath: '/',
// WebpackDevServer is noisy by default so we emit custom message instead
// by listening to the compiler events with `compiler.hooks[...].tap` calls above.
quiet: true,
// Reportedly, this avoids CPU overload on some systems.
// https://github.com/facebook/create-react-app/issues/293
// src/node_modules is not ignored to support absolute imports
// https://github.com/facebook/create-react-app/issues/1065
watchOptions: {
ignored: ignoredFiles(paths.appSrc),
},
// Enable HTTPS if the HTTPS environment variable is set to 'true'
https: protocol === 'https',
host,
overlay: false,
historyApiFallback: {
// Paths with dots should still use the history fallback.
// See https://github.com/facebook/create-react-app/issues/387.
disableDotRule: true,
},
public: allowedHost,
proxy,
before(app, server) {
if (fs.existsSync(paths.proxySetup)) {
// This registers user provided middleware for proxy reasons
require(paths.proxySetup)(app);
}
// This lets us fetch source contents from webpack for the error overlay
app.use(evalSourceMapMiddleware(server));
// This lets us open files from the runtime error overlay.
app.use(errorOverlayMiddleware());
// This service worker file is effectively a 'no-op' that will reset any
// previous service worker registered for the same host:port combination.
// We do this in development to avoid hitting the production cache if
// it used the same host and port.
// https://github.com/facebook/create-react-app/issues/2272#issuecomment-302832432
app.use(noopServiceWorkerMiddleware());
},
};
};
## 关于引入less-loader之后编译时报Unrecognised input的问题
在新的脚手架中我们只要修改webpack.config.js中的loader配置。并且一定要在oneOF数组中添加上面的配置
\ No newline at end of file
{
"name": "frontend",
"version": "0.1.0",
"private": true,
"dependencies": {
"@antv/data-set": "^0.10.2",
"@babel/core": "7.7.4",
"@svgr/webpack": "4.3.3",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
"@types/classnames": "^2.2.9",
"@types/jest": "^24.0.0",
"@types/lodash.debounce": "^4.0.6",
"@types/md5": "^2.1.33",
"@types/node": "^12.0.0",
"@types/nprogress": "^0.2.0",
"@types/react": "^16.9.0",
"@types/react-dom": "^16.9.0",
"@types/react-redux": "^7.1.5",
"@types/react-router-dom": "^5.1.3",
"@types/sha1": "^1.1.2",
"@typescript-eslint/eslint-plugin": "^2.8.0",
"@typescript-eslint/parser": "^2.8.0",
"antd": "^3.26.0",
"antd-mobile": "^2.3.1",
"axios": "^0.19.0",
"babel-eslint": "10.0.3",
"babel-jest": "^24.9.0",
"babel-loader": "8.0.6",
"babel-plugin-named-asset-import": "^0.3.5",
"babel-preset-react-app": "^9.1.0",
"bizcharts": "^3.5.6",
"camelcase": "^5.3.1",
"case-sensitive-paths-webpack-plugin": "2.2.0",
"classnames": "^2.2.6",
"css-loader": "3.2.0",
"dotenv": "8.2.0",
"dotenv-expand": "5.1.0",
"eslint": "^6.6.0",
"eslint-config-react-app": "^5.1.0",
"eslint-loader": "3.0.2",
"eslint-plugin-flowtype": "3.13.0",
"eslint-plugin-import": "2.18.2",
"eslint-plugin-jsx-a11y": "6.2.3",
"eslint-plugin-react": "7.16.0",
"eslint-plugin-react-hooks": "^1.6.1",
"file-loader": "4.3.0",
"fs-extra": "^8.1.0",
"html-webpack-plugin": "4.0.0-beta.5",
"identity-obj-proxy": "3.0.0",
"jest": "24.9.0",
"jest-environment-jsdom-fourteen": "0.1.0",
"jest-resolve": "24.9.0",
"jest-watch-typeahead": "0.4.2",
"loadjs": "^4.2.0",
"lodash": "^4.17.15",
"lodash.debounce": "^4.0.8",
"lodash.union": "^4.6.0",
"md5": "^2.2.1",
"mini-css-extract-plugin": "0.8.0",
"moment": "^2.24.0",
"nprogress": "^0.2.0",
"optimize-css-assets-webpack-plugin": "5.0.3",
"pnp-webpack-plugin": "1.5.0",
"postcss-flexbugs-fixes": "4.1.0",
"postcss-loader": "3.0.0",
"postcss-normalize": "8.0.1",
"postcss-preset-env": "6.7.0",
"postcss-safe-parser": "4.0.1",
"react": "^16.12.0",
"react-app-polyfill": "^1.0.5",
"react-dev-utils": "^10.0.0",
"react-dom": "^16.12.0",
"react-redux": "^7.1.3",
"react-router-dom": "^5.1.2",
"recharts": "^2.0.0-beta.1",
"redux": "^4.0.5",
"redux-saga": "^1.1.3",
"resolve": "1.12.2",
"resolve-url-loader": "3.1.1",
"sass-loader": "8.0.0",
"semver": "6.3.0",
"sha1": "^1.1.1",
"style-loader": "1.0.0",
"terser-webpack-plugin": "2.2.1",
"ts-pnp": "1.1.5",
"typescript": "~3.7.2",
"url-loader": "2.3.0",
"webpack": "4.41.2",
"webpack-dev-server": "3.9.0",
"webpack-manifest-plugin": "2.2.0",
"workbox-webpack-plugin": "4.3.1"
},
"scripts": {
"start": "node scripts/start.js",
"build": "node scripts/build.js",
"test": "node scripts/test.js",
"rm": "find ./build -name '*.map' -delete"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"jest": {
"roots": [
"<rootDir>/src"
],
"collectCoverageFrom": [
"src/**/*.{js,jsx,ts,tsx}",
"!src/**/*.d.ts"
],
"setupFiles": [
"react-app-polyfill/jsdom"
],
"setupFilesAfterEnv": [
"<rootDir>/src/setupTests.ts"
],
"testMatch": [
"<rootDir>/src/**/__tests__/**/*.{js,jsx,ts,tsx}",
"<rootDir>/src/**/*.{spec,test}.{js,jsx,ts,tsx}"
],
"testEnvironment": "jest-environment-jsdom-fourteen",
"transform": {
"^.+\\.(js|jsx|ts|tsx)$": "<rootDir>/node_modules/babel-jest",
"^.+\\.css$": "<rootDir>/config/jest/cssTransform.js",
"^(?!.*\\.(js|jsx|ts|tsx|css|json)$)": "<rootDir>/config/jest/fileTransform.js"
},
"transformIgnorePatterns": [
"[/\\\\]node_modules[/\\\\].+\\.(js|jsx|ts|tsx)$",
"^.+\\.module\\.(css|sass|scss)$"
],
"modulePaths": [],
"moduleNameMapper": {
"^react-native$": "react-native-web",
"^.+\\.module\\.(css|sass|scss)$": "identity-obj-proxy"
},
"moduleFileExtensions": [
"web.js",
"js",
"web.ts",
"ts",
"web.tsx",
"tsx",
"json",
"web.jsx",
"jsx",
"node"
],
"watchPlugins": [
"jest-watch-typeahead/filename",
"jest-watch-typeahead/testname"
]
},
"babel": {
"presets": [
"react-app"
],
"plugins": [
[
"import",
{
"libraryName": "antd",
"libraryDirectory": "es",
"style": true
}
]
]
},
"devDependencies": {
"babel-plugin-import": "^1.13.0",
"less": "^3.10.3",
"less-loader": "^5.0.0",
"node-sass": "^4.13.0",
"request": "^2.88.0"
}
}
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<title>设置地图当前行政区</title>
<link rel="stylesheet" href="https://a.amap.com/jsapi_demos/static/demo-center/css/demo-center.css" />
<style>
html,
body,
#container {
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<div id="container"></div>
<div class="input-card" style="width:24rem;">
<h4>设置地图当前行政区</h4>
<div class="input-item">
<input id='city-name' placeholder="北京市" type="text" style="margin-right:1rem;"><button class="btn" id="query">去指定城市</button>
</div>
</div>
<script src="https://webapi.amap.com/maps?v=1.4.15&key=608d75903d29ad471362f8c58c550daf"></script>
<script src="https://a.amap.com/jsapi_demos/static/demo-center/js/demoutils.js"></script>
<script>
var map = new AMap.Map('container', {
resizeEnable: true,
center: [106.405285,39.904989]
});
//根据cityname、adcode、citycode设置地图位置
function gotoCity() {
var val = document.querySelector('#city-name').value; //可以是cityname、adcode、citycode
if (!val) {
val = "北京市";
}
map.setCity(val);
log.info(`已跳转至${val}`);
}
//绑定查询点击、回车事件
document.querySelector('#query').onclick = gotoCity;
document.querySelector('#city-name').onkeydown = function(e) {
if (e.keyCode === 13) {
gotoCity();
return false;
}
return true;
};
</script>
</body>
</html>
\ No newline at end of file
<!-- 重点参数:iconTheme, iconStyle -->
<!doctype html>
<html lang="zh-CN">
<head>
<!-- 原始地址://webapi.amap.com/ui/1.0/ui/overlay/SimpleMarker/examples/themes.html -->
<base href="//webapi.amap.com/ui/1.0/ui/overlay/SimpleMarker/examples/" />
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<title>图标主题</title>
<style>
html,
body,
#container {
width: 100%;
height: 100%;
margin: 0px;
}
.amap-marker-label {
font-size: 13px;
border: 1px solid #b8b8b8;
background: #fff;
border-radius: 6px 6px 6px 0;
color: #777;
line-height: 130%;
}
#ctrlBox {
position: absolute;
top: 10px;
left: 10px;
z-index: 99999;
line-height: 200%;
font-size: 13px;
background: rgba(0, 0, 0, 0.7);
color: #FFEB3B;
padding: 3px 10px;
border-radius: 5px;
}
#ctrlBox label {
display: block;
}
#ctrlBox input {
vertical-align: middle;
}
</style>
</head>
<body>
<div id="container"></div>
<div id="ctrlBox">
<label id="themesBox">切换主题:
<select id="themesList">
<option value="default">default</option>
<option value="fresh">fresh</option>
<option value="numv1" data-no-txt="1">numv1</option>
<option value="numv2" data-no-txt="1">numv2</option>
</select>
</label>
<label>
显示定位点:
<input type="checkbox" id="showPos" value="1" />
</label>
</div>
<script type="text/javascript" src='//webapi.amap.com/maps?v=1.4.15&key=您申请的key值'></script>
<!-- UI组件库 1.0 -->
<script src="//webapi.amap.com/ui/1.0/main.js?v=1.0.11"></script>
<script type="text/javascript">
//创建地图
var map = new AMap.Map('container', {
zoom: 4
});
function getParameterByName(name) {
var match = new RegExp('[?&]' + name + '=([^&]*)').exec(window.location.search);
return match && decodeURIComponent(match[1].replace(/\+/g, ' '));
}
function addMarkers(SimpleMarker, $) {
var $selTheme = $("#themesList option").filter(function() {
return this.selected;
});
var theme = $selTheme.attr('value');
var noLabel = !!$selTheme.attr('data-no-txt');
//内置的样式
var iconStyles = SimpleMarker.getBuiltInIconStyles(theme);
//获取一批grid排布的经纬度
var lngLats = getGridLngLats(map.getCenter(), 5, iconStyles.length, 120, 60);
console.log(map.getCenter())
var markers = [];
for (var i = 0, len = lngLats.length; i < len; i++) {
var marker = new SimpleMarker({
iconTheme: theme,
//使用内置的iconStyle
iconStyle: iconStyles[i],
//图标文字
iconLabel: noLabel ? null : {
//A,B,C.....
innerHTML: String.fromCharCode('A'.charCodeAt(0) + i),
style: {
//颜色, #333, red等等,这里仅作示例,取iconStyle中首尾相对的颜色
color: iconStyles[i] === 'white' ? '#000' : '#fff'
}
},
//显示定位点
showPositionPoint: $('#showPos').is(':checked'),
map: map,
position: lngLats[i],
//Marker的label(见https://lbs.amap.com/api/javascript-api/reference/overlay/#Marker)
label: {
content: iconStyles[i],
offset: new AMap.Pixel(32, 25)
}
});
markers.push(marker);
}
return markers;
}
var globalMarkers = [];
//加载SimpleMarker
AMapUI.load(['ui/overlay/SimpleMarker', 'lib/$'], function(SimpleMarker, $) {
var themeId = getParameterByName('tid');
if (themeId) {
$("#themesList").val(themeId);
}
function refreshMarkers() {
//清除现有的marker
for (var i = 0, len = globalMarkers.length; i < len; i++) {
globalMarkers[i].setMap(null);
}
globalMarkers = addMarkers(SimpleMarker, $);
}
refreshMarkers();
$('#themesList, #showPos').on('change', refreshMarkers);
window.SimpleMarker = SimpleMarker;
});
/**
* 返回一批网格排列的经纬度
* @param {AMap.LngLat} center 网格中心
* @param {number} colNum 列数
* @param {number} size 总数
* @param {number} cellX 横向间距
* @param {number} cellY 竖向间距
* @return {Array} 返回经纬度数组
*/
function getGridLngLats(center, colNum, size, cellX, cellY) {
var pxCenter = map.lnglatToPixel(center);
var rowNum = Math.ceil(size / colNum);
var startX = pxCenter.getX(),
startY = pxCenter.getY();
cellX = cellX || 70;
cellY = cellY || 70;
var lngLats = [];
for (var r = 0; r < rowNum; r++) {
for (var c = 0; c < colNum; c++) {
var x = startX + (c - (colNum - 1) / 2) * (cellX);
var y = startY + (r - (rowNum - 1) / 2) * (cellY);
lngLats.push(map.pixelToLngLat(new AMap.Pixel(x, y)));
if (lngLats.length >= size) {
break;
}
}
}
return lngLats;
}
</script>
</body>
</html>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta name="theme-color" content="#000000" />
<!-- <meta
name="description"
content="Web site created using create-react-app"
/> -->
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title >元曜大数据新冠疫情最新动态</title >
<script src="/fy_home_echart_funs.js?v=1.0"></script>
<script>
function rem() {
var t = 100,
o = 750,
e = document.documentElement.clientWidth || window.innerWidth,
n = Math.max(Math.min(e, 480), 320),
h = 50;
320 >= n && (h = Math.floor(n / o * t * .99)), n > 320 && 362 >= n && (h = Math.floor(n / o * t * 1)), n > 362 &&
375 >= n && (h = Math.floor(n / o * t * 1)), n > 375 && (h = Math.floor(n / o * t * .97)), document.querySelector(
"html").style.fontSize =
h + "px"
};
rem();
window.onresize = function () {
rem();
}
var g;
// This works in non-strict mode
g = (function() {
return this;
})();
try {
// This works if eval is allowed (see CSP)
g = g || Function("return this")() || (1,eval)("this");
} catch(e) {
// This works if the window reference is available
if(typeof window === "object")
g = window;
}
window.global = g;
</script>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
This source diff could not be displayed because it is too large. You can view the blob instead.
var provinceMapData = {"type":"FeatureCollection","features":[{"id":"820001","type":"Feature","geometry":{"type":"MultiPolygon","coordinates":[["@@LADC^umZ@DONWE@DALBBF@H@DFBBTC"],["@@P@LC@AGM@OECMBABBTCD@DDH"]],"encodeOffsets":[[[116285,22746]],[[116303,22746]]]},"properties":{"cp":[113.552965,22.207882],"name":"花地玛堂区","childNum":2}},{"id":"820002","type":"Feature","geometry":{"type":"Polygon","coordinates":["@@MK@CA@AAGDEB@NVFJG"],"encodeOffsets":[[116281,22734]]},"properties":{"cp":[113.549052,22.199175],"name":"花王堂区","childNum":1}},{"id":"820003","type":"Feature","geometry":{"type":"Polygon","coordinates":["@@EGOB@DNLHE@C"],"encodeOffsets":[[116285,22729]]},"properties":{"cp":[113.550252,22.193791],"name":"望德堂区","childNum":1}},{"id":"820004","type":"Feature","geometry":{"type":"Polygon","coordinates":["@@ŸYMVAN@BFCBBDAFHDBBFDHIJJEFDPCHHlYJQ"],"encodeOffsets":[[116313,22707]]},"properties":{"cp":[113.55374,22.188119],"name":"大堂区","childNum":1}},{"id":"820005","type":"Feature","geometry":{"type":"Polygon","coordinates":["@@JICGAECACGEBAAEDBFNXB@"],"encodeOffsets":[[116266,22728]]},"properties":{"cp":[113.54167,22.187778],"name":"风顺堂区","childNum":1}},{"id":"820006","type":"Feature","geometry":{"type":"Polygon","coordinates":["@@ ZNWRquZCBCC@AEA@@ADCDCAACEAGBQ@INEL"],"encodeOffsets":[[116265,22694]]},"properties":{"cp":[113.558783,22.154124],"name":"嘉模堂区","childNum":1}},{"id":"820007","type":"Feature","geometry":{"type":"Polygon","coordinates":["@@MOIAIEI@@GE@AAUCBdCFIFR@HAFBBDDBDCBC@@FB@BDDDA\\M"],"encodeOffsets":[[116316,22676]]},"properties":{"cp":[113.56925,22.136546],"name":"路凼填海区","childNum":1}},{"id":"820008","type":"Feature","geometry":{"type":"Polygon","coordinates":["@@DKMMa_GC_COD@dVDBBF@@HJ@JFJBNPZK"],"encodeOffsets":[[116329,22670]]},"properties":{"cp":[113.559954,22.124049],"name":"圣方济各堂区","childNum":1}}],"UTF8Encoding":true}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
{"data_title":"fymap","data":{"times":"\u622a\u81f32\u67088\u65e523\u65f646\u5206","cachetime":"2020-02-08 23:49:36","province":"\u6e56\u5317","contotal":"24953","deathtotal":"699","sustotal":"0","curetotal":"1218","city":[{"name":"\u6b66\u6c49","conNum":"13603","susNum":"0","cureNum":"747","deathNum":"545","mapName":"\u6b66\u6c49\u5e02"},{"name":"\u9ec4\u5188","conNum":"2041","susNum":"0","cureNum":"105","deathNum":"36","mapName":"\u9ec4\u5188\u5e02"},{"name":"\u5b5d\u611f","conNum":"2313","susNum":"0","cureNum":"42","deathNum":"26","mapName":"\u5b5d\u611f\u5e02"},{"name":"\u8346\u95e8","conNum":"588","susNum":"0","cureNum":"36","deathNum":"18","mapName":"\u8346\u95e8\u5e02"},{"name":"\u54b8\u5b81","conNum":"476","susNum":"0","cureNum":"16","deathNum":"2","mapName":"\u54b8\u5b81\u5e02"},{"name":"\u8346\u5dde","conNum":"941","susNum":"0","cureNum":"31","deathNum":"11","mapName":"\u8346\u5dde\u5e02"},{"name":"\u8944\u9633","conNum":"907","susNum":"0","cureNum":"34","deathNum":"5","mapName":"\u8944\u9633\u5e02"},{"name":"\u968f\u5dde","conNum":"953","susNum":"0","cureNum":"23","deathNum":"9","mapName":"\u968f\u5dde\u5e02"},{"name":"\u5341\u5830","conNum":"438","susNum":"0","cureNum":"40","deathNum":"0","mapName":"\u5341\u5830\u5e02"},{"name":"\u9102\u5dde","conNum":"569","susNum":"0","cureNum":"33","deathNum":"20","mapName":"\u9102\u5dde\u5e02"},{"name":"\u9ec4\u77f3","conNum":"703","susNum":"0","cureNum":"48","deathNum":"2","mapName":"\u9ec4\u77f3\u5e02"},{"name":"\u5b9c\u660c","conNum":"633","susNum":"0","cureNum":"25","deathNum":"8","mapName":"\u5b9c\u660c\u5e02"},{"name":"\u6069\u65bd\u5dde","conNum":"160","susNum":"0","cureNum":"20","deathNum":"0","mapName":"\u6069\u65bd\u571f\u5bb6\u65cf\u82d7\u65cf\u81ea\u6cbb\u5dde"},{"name":"\u4ed9\u6843","conNum":"359","susNum":"0","cureNum":"14","deathNum":"5","mapName":"\u4ed9\u6843\u5e02"},{"name":"\u5929\u95e8","conNum":"179","susNum":"0","cureNum":"1","deathNum":"10","mapName":"\u5929\u95e8\u5e02"},{"name":"\u6f5c\u6c5f","conNum":"80","susNum":"0","cureNum":"1","deathNum":"2","mapName":"\u6f5c\u6c5f\u5e02"},{"name":"\u795e\u519c\u67b6\u6797\u533a","conNum":"10","susNum":"0","cureNum":"2","deathNum":"0","mapName":"\u795e\u519c\u67b6\u6797\u533a"}],"historylist":[{"date":"02.07","conNum":"24953","susNum":null,"cureNum":"1115","deathNum":"699"},{"date":"02.06","conNum":"22112","susNum":null,"cureNum":"817","deathNum":"618"},{"date":"02.05","conNum":"19665","susNum":null,"cureNum":"633","deathNum":"549"},{"date":"02.04","conNum":"16678","susNum":null,"cureNum":"520","deathNum":"479"},{"date":"02.03","conNum":"13522","susNum":null,"cureNum":"396","deathNum":"414"},{"date":"02.02","conNum":"11177","susNum":null,"cureNum":"295","deathNum":"350"},{"date":"02.01","conNum":"9074","susNum":null,"cureNum":"215","deathNum":"294"},{"date":"01.31","conNum":"7153","susNum":null,"cureNum":"166","deathNum":"249"},{"date":"01.30","conNum":"5806","susNum":null,"cureNum":"116","deathNum":"204"},{"date":"01.29","conNum":"4586","susNum":null,"cureNum":"90","deathNum":"162"},{"date":"01.28","conNum":"3554","susNum":null,"cureNum":"80","deathNum":"125"},{"date":"01.27","conNum":"2714","susNum":null,"cureNum":"47","deathNum":"100"},{"date":"01.26","conNum":"1423","susNum":null,"cureNum":"44","deathNum":"76"},{"date":"01.25","conNum":"1052","susNum":null,"cureNum":"42","deathNum":"52"},{"date":"01.24","conNum":"729","susNum":null,"cureNum":"32","deathNum":"39"},{"date":"01.23","conNum":"549","susNum":null,"cureNum":"31","deathNum":"24"},{"date":"01.22","conNum":"444","susNum":null,"cureNum":"28","deathNum":"17"},{"date":"01.21","conNum":"375","susNum":null,"cureNum":"28","deathNum":"9"},{"date":"01.20","conNum":"270","susNum":null,"cureNum":"25","deathNum":"6"},{"date":"01.19","conNum":"198","susNum":null,"cureNum":"25","deathNum":"4"},{"date":"01.18","conNum":"198","susNum":null,"cureNum":"25","deathNum":"3"},{"date":"01.17","conNum":"62","susNum":null,"cureNum":"19","deathNum":"2"},{"date":"01.16","conNum":"45","susNum":null,"cureNum":"15","deathNum":"2"},{"date":"01.15","conNum":"41","susNum":null,"cureNum":"12","deathNum":"2"},{"date":"01.14","conNum":"41","susNum":null,"cureNum":"7","deathNum":"1"},{"date":"01.13","conNum":"41","susNum":null,"cureNum":"7","deathNum":"1"},{"date":"01.12","conNum":"41","susNum":null,"cureNum":"7","deathNum":"1"},{"date":"01.11","conNum":"41","susNum":null,"cureNum":"6","deathNum":"1"}]}}
\ No newline at end of file
# https://www.robotstxt.org/robotstxt.html
User-agent: *
This source diff could not be displayed because it is too large. You can view the blob instead.
'use strict';
// Do this as the first thing so that any code reading it knows the right env.
process.env.BABEL_ENV = 'production';
process.env.NODE_ENV = 'production';
// Makes the script crash on unhandled rejections instead of silently
// ignoring them. In the future, promise rejections that are not handled will
// terminate the Node.js process with a non-zero exit code.
process.on('unhandledRejection', err => {
throw err;
});
// Ensure environment variables are read.
require('../config/env');
const path = require('path');
const chalk = require('react-dev-utils/chalk');
const fs = require('fs-extra');
const webpack = require('webpack');
const configFactory = require('../config/webpack.config');
const paths = require('../config/paths');
const checkRequiredFiles = require('react-dev-utils/checkRequiredFiles');
const formatWebpackMessages = require('react-dev-utils/formatWebpackMessages');
const printHostingInstructions = require('react-dev-utils/printHostingInstructions');
const FileSizeReporter = require('react-dev-utils/FileSizeReporter');
const printBuildError = require('react-dev-utils/printBuildError');
const measureFileSizesBeforeBuild =
FileSizeReporter.measureFileSizesBeforeBuild;
const printFileSizesAfterBuild = FileSizeReporter.printFileSizesAfterBuild;
const useYarn = fs.existsSync(paths.yarnLockFile);
// These sizes are pretty large. We'll warn for bundles exceeding them.
const WARN_AFTER_BUNDLE_GZIP_SIZE = 512 * 1024;
const WARN_AFTER_CHUNK_GZIP_SIZE = 1024 * 1024;
const isInteractive = process.stdout.isTTY;
// Warn and crash if required files are missing
if (!checkRequiredFiles([paths.appHtml, paths.appIndexJs])) {
process.exit(1);
}
// Generate configuration
const config = configFactory('production');
// We require that you explicitly set browsers and do not fall back to
// browserslist defaults.
const { checkBrowsers } = require('react-dev-utils/browsersHelper');
checkBrowsers(paths.appPath, isInteractive)
.then(() => {
// First, read the current file sizes in build directory.
// This lets us display how much they changed later.
return measureFileSizesBeforeBuild(paths.appBuild);
})
.then(previousFileSizes => {
// Remove all content but keep the directory so that
// if you're in it, you don't end up in Trash
fs.emptyDirSync(paths.appBuild);
// Merge with the public folder
copyPublicFolder();
// Start the webpack build
return build(previousFileSizes);
})
.then(
({ stats, previousFileSizes, warnings }) => {
if (warnings.length) {
console.log(chalk.yellow('Compiled with warnings.\n'));
console.log(warnings.join('\n\n'));
console.log(
'\nSearch for the ' +
chalk.underline(chalk.yellow('keywords')) +
' to learn more about each warning.'
);
console.log(
'To ignore, add ' +
chalk.cyan('// eslint-disable-next-line') +
' to the line before.\n'
);
} else {
console.log(chalk.green('Compiled successfully.\n'));
}
console.log('File sizes after gzip:\n');
printFileSizesAfterBuild(
stats,
previousFileSizes,
paths.appBuild,
WARN_AFTER_BUNDLE_GZIP_SIZE,
WARN_AFTER_CHUNK_GZIP_SIZE
);
console.log();
const appPackage = require(paths.appPackageJson);
const publicUrl = paths.publicUrl;
const publicPath = config.output.publicPath;
const buildFolder = path.relative(process.cwd(), paths.appBuild);
printHostingInstructions(
appPackage,
publicUrl,
publicPath,
buildFolder,
useYarn
);
},
err => {
const tscCompileOnError = process.env.TSC_COMPILE_ON_ERROR === 'true';
if (tscCompileOnError) {
console.log(
chalk.yellow(
'Compiled with the following type errors (you may want to check these before deploying your app):\n'
)
);
printBuildError(err);
} else {
console.log(chalk.red('Failed to compile.\n'));
printBuildError(err);
process.exit(1);
}
}
)
.catch(err => {
if (err && err.message) {
console.log(err.message);
}
process.exit(1);
});
// Create the production build and print the deployment instructions.
function build(previousFileSizes) {
// We used to support resolving modules according to `NODE_PATH`.
// This now has been deprecated in favor of jsconfig/tsconfig.json
// This lets you use absolute paths in imports inside large monorepos:
if (process.env.NODE_PATH) {
console.log(
chalk.yellow(
'Setting NODE_PATH to resolve modules absolutely has been deprecated in favor of setting baseUrl in jsconfig.json (or tsconfig.json if you are using TypeScript) and will be removed in a future major release of create-react-app.'
)
);
console.log();
}
console.log('Creating an optimized production build...');
const compiler = webpack(config);
return new Promise((resolve, reject) => {
compiler.run((err, stats) => {
let messages;
if (err) {
if (!err.message) {
return reject(err);
}
let errMessage = err.message;
// Add additional information for postcss errors
if (Object.prototype.hasOwnProperty.call(err, 'postcssNode')) {
errMessage +=
'\nCompileError: Begins at CSS selector ' +
err['postcssNode'].selector;
}
messages = formatWebpackMessages({
errors: [errMessage],
warnings: [],
});
} else {
messages = formatWebpackMessages(
stats.toJson({ all: false, warnings: true, errors: true })
);
}
if (messages.errors.length) {
// Only keep the first error. Others are often indicative
// of the same problem, but confuse the reader with noise.
if (messages.errors.length > 1) {
messages.errors.length = 1;
}
return reject(new Error(messages.errors.join('\n\n')));
}
if (
process.env.CI &&
(typeof process.env.CI !== 'string' ||
process.env.CI.toLowerCase() !== 'false') &&
messages.warnings.length
) {
console.log(
chalk.yellow(
'\nTreating warnings as errors because process.env.CI = true.\n' +
'Most CI servers set it automatically.\n'
)
);
return reject(new Error(messages.warnings.join('\n\n')));
}
return resolve({
stats,
previousFileSizes,
warnings: messages.warnings,
});
});
});
}
function copyPublicFolder() {
fs.copySync(paths.appPublic, paths.appBuild, {
dereference: true,
filter: file => file !== paths.appHtml,
});
}
const request = require('request');
const fs = require('fs')
const provinces = ["beijing","hubei","guangdong","zhejiang","henan","hunan","chongqing","anhui","sichuan","shandong","jilin","fujian","jiangxi","jiangsu","shanghai","guangxi","hainan","shanxis","hebei","heilongjiang","liaoning","yunnan","tianjin","shanxi","gansu","neimenggu","taiwan","aomen","xianggang","guizhou","xizang","qinghai","xinjiang","ningxia"]
// wrap a request in an promise
function getData(url) {
return new Promise((resolve, reject) => {
console.log( url);
request(url, (error, response, body) => {
if (error) reject(error);
if (response.statusCode != 200) {
reject('Invalid status code <' + response.statusCode + '>');
}
resolve(body);
});
});
}
async function getDataSync(province) {
try {
const _province = function(){
if(province==='shanxis') {
return 'shanxi1'
}
return province;
}()
const body = await getData(`https://finance.sina.com.cn/other/src/map_${_province}.json`)
const data = fs.writeFileSync(`./public/map/map_${province}.js`, body)
console.log('file written successfully:',province)
} catch (error) {
console.error(province,error);
}
}
for (var i=0;i<provinces.length;i++) {
getDataSync(provinces[i])
}
'use strict';
// Do this as the first thing so that any code reading it knows the right env.
process.env.BABEL_ENV = 'development';
process.env.NODE_ENV = 'development';
// Makes the script crash on unhandled rejections instead of silently
// ignoring them. In the future, promise rejections that are not handled will
// terminate the Node.js process with a non-zero exit code.
process.on('unhandledRejection', err => {
throw err;
});
// Ensure environment variables are read.
require('../config/env');
const fs = require('fs');
const chalk = require('react-dev-utils/chalk');
const webpack = require('webpack');
const WebpackDevServer = require('webpack-dev-server');
const clearConsole = require('react-dev-utils/clearConsole');
const checkRequiredFiles = require('react-dev-utils/checkRequiredFiles');
const {
choosePort,
createCompiler,
prepareProxy,
prepareUrls,
} = require('react-dev-utils/WebpackDevServerUtils');
const openBrowser = require('react-dev-utils/openBrowser');
const paths = require('../config/paths');
const configFactory = require('../config/webpack.config');
const createDevServerConfig = require('../config/webpackDevServer.config');
const useYarn = fs.existsSync(paths.yarnLockFile);
const isInteractive = process.stdout.isTTY;
// Warn and crash if required files are missing
if (!checkRequiredFiles([paths.appHtml, paths.appIndexJs])) {
process.exit(1);
}
// Tools like Cloud9 rely on this.
const DEFAULT_PORT = parseInt(process.env.PORT, 10) || 3000;
const HOST = process.env.HOST || '0.0.0.0';
if (process.env.HOST) {
console.log(
chalk.cyan(
`Attempting to bind to HOST environment variable: ${chalk.yellow(
chalk.bold(process.env.HOST)
)}`
)
);
console.log(
`If this was unintentional, check that you haven't mistakenly set it in your shell.`
);
console.log(
`Learn more here: ${chalk.yellow('https://bit.ly/CRA-advanced-config')}`
);
console.log();
}
// We require that you explicitly set browsers and do not fall back to
// browserslist defaults.
const { checkBrowsers } = require('react-dev-utils/browsersHelper');
checkBrowsers(paths.appPath, isInteractive)
.then(() => {
// We attempt to use the default port but if it is busy, we offer the user to
// run on a different port. `choosePort()` Promise resolves to the next free port.
return choosePort(HOST, DEFAULT_PORT);
})
.then(port => {
if (port == null) {
// We have not found a port.
return;
}
const config = configFactory('development');
const protocol = process.env.HTTPS === 'true' ? 'https' : 'http';
const appName = require(paths.appPackageJson).name;
const useTypeScript = fs.existsSync(paths.appTsConfig);
const tscCompileOnError = process.env.TSC_COMPILE_ON_ERROR === 'true';
const urls = prepareUrls(protocol, HOST, port);
const devSocket = {
warnings: warnings =>
devServer.sockWrite(devServer.sockets, 'warnings', warnings),
errors: errors =>
devServer.sockWrite(devServer.sockets, 'errors', errors),
};
// Create a webpack compiler that is configured with custom messages.
const compiler = createCompiler({
appName,
config,
devSocket,
urls,
useYarn,
useTypeScript,
tscCompileOnError,
webpack,
});
// Load proxy config
const proxySetting = require(paths.appPackageJson).proxy;
const proxyConfig = prepareProxy(proxySetting, paths.appPublic);
// Serve webpack assets generated by the compiler over a web server.
const serverConfig = createDevServerConfig(
proxyConfig,
urls.lanUrlForConfig
);
const devServer = new WebpackDevServer(compiler, serverConfig);
// Launch WebpackDevServer.
devServer.listen(port, HOST, err => {
if (err) {
return console.log(err);
}
if (isInteractive) {
clearConsole();
}
// We used to support resolving modules according to `NODE_PATH`.
// This now has been deprecated in favor of jsconfig/tsconfig.json
// This lets you use absolute paths in imports inside large monorepos:
if (process.env.NODE_PATH) {
console.log(
chalk.yellow(
'Setting NODE_PATH to resolve modules absolutely has been deprecated in favor of setting baseUrl in jsconfig.json (or tsconfig.json if you are using TypeScript) and will be removed in a future major release of create-react-app.'
)
);
console.log();
}
console.log(chalk.cyan('Starting the development server...\n'));
openBrowser(urls.localUrlForBrowser);
});
['SIGINT', 'SIGTERM'].forEach(function(sig) {
process.on(sig, function() {
devServer.close();
process.exit();
});
});
})
.catch(err => {
if (err && err.message) {
console.log(err.message);
}
process.exit(1);
});
'use strict';
// Do this as the first thing so that any code reading it knows the right env.
process.env.BABEL_ENV = 'test';
process.env.NODE_ENV = 'test';
process.env.PUBLIC_URL = '';
// Makes the script crash on unhandled rejections instead of silently
// ignoring them. In the future, promise rejections that are not handled will
// terminate the Node.js process with a non-zero exit code.
process.on('unhandledRejection', err => {
throw err;
});
// Ensure environment variables are read.
require('../config/env');
const jest = require('jest');
const execSync = require('child_process').execSync;
let argv = process.argv.slice(2);
function isInGitRepository() {
try {
execSync('git rev-parse --is-inside-work-tree', { stdio: 'ignore' });
return true;
} catch (e) {
return false;
}
}
function isInMercurialRepository() {
try {
execSync('hg --cwd . root', { stdio: 'ignore' });
return true;
} catch (e) {
return false;
}
}
// Watch unless on CI or explicitly running all tests
if (
!process.env.CI &&
argv.indexOf('--watchAll') === -1 &&
argv.indexOf('--watchAll=false') === -1
) {
// https://github.com/facebook/create-react-app/issues/5210
const hasSourceControl = isInGitRepository() || isInMercurialRepository();
argv.push(hasSourceControl ? '--watch' : '--watchAll');
}
jest.run(argv);
import React from 'react';
import { render } from '@testing-library/react';
import App from './App';
test('renders learn react link', () => {
const { getByText } = render(<App />);
const linkElement = getByText(/learn react/i);
expect(linkElement).toBeInTheDocument();
});
import React, { Dispatch, SetStateAction } from "react";
import { withRouter, StaticContext, } from "react-router";
import { Provider } from "react-redux";
import { BrowserRouter as Router, Route, Switch, RouteChildrenProps, RouteComponentProps } from "react-router-dom";
import NProgress from "nprogress";
// import { DatePicker, Button } from "antd";
import "nprogress/nprogress.css";
import "./App.css";
import { AppContext } from "data-platform";
import { store } from "data-platform/model";
import { routes } from "./Routes";
async function getComponent(asyncCOM: () => any): Promise<any> {
const COM1 = await asyncCOM();
const COM2 = await new Promise((resolve, reject) => {
setTimeout(() => {
resolve(COM1);
}, 500);
});
return COM2;
}
class RouterWrapper extends React.Component<RouteComponentProps<any, StaticContext, any>, any> {
shouldComponentUpdate(preProps: RouteChildrenProps) {
if (preProps.location.pathname === this.props.location.pathname) {
return false;
}
return true;
}
render() {
return this.props.children;
}
}
const RouteWrapperWR: any = withRouter(RouterWrapper);
const components: { [key: string]: any } = {};
interface IRouteStateProp extends RouteChildrenProps {
component: () => any
}
class RouteWrapper extends React.Component<IRouteStateProp> {
componentDidMount() {
// console.log(this.props)
const { location } = this.props;
const COM = components[location.pathname];
if (COM) {
this.context.setApp(<COM {...this.props}/>);
} else {
NProgress.start();
getComponent(this.props.component).then(
(
{ default: Component }: { default: any }
) => {
components[location.pathname] = Component;//cache async component
this.context.setApp(<Component {...this.props} />);
NProgress.done();
});
}
}
render() {
return <></>
}
}
RouteWrapper.contextType = AppContext;
const App: React.FC = () => {
const [app, setApp]: [any, Dispatch<SetStateAction<any>>] = React.useState<any>(null);
return (
<div className="App">
<Router>
<RouteWrapperWR>
{/* <NavLink to="/" >home</NavLink>{" "}
<NavLink to="/signin" >signin</NavLink>{" "}
<NavLink to="/dashboard/123" >dashboard</NavLink> */}
<Route component={() => {
window.scrollTo(0, 0);
return null;
}} />
<AppContext.Provider value={{ setApp }}>
<Switch>
{routes.map((r, i) => (
<Route key={i} path={r.path} exact
component={(props: RouteChildrenProps) => <RouteWrapper {...r.props} {...props} component={r.component}></RouteWrapper>} />
))}
<Route path="/" exact children={<p>Home</p>} />
</Switch>
</AppContext.Provider>
</RouteWrapperWR>
</Router>
<Provider store={store}>
{app}
</Provider>
</div>
);
}
export default App;
export const routes: {path:string, props?: any, component: ()=>any }[] = [
{ path: "/signin", component: ()=>import('view/Signin') },
{ path: "/dashboard", component: ()=>import('view/Dashboard') },
{ path: "/province/:id/:date?", component: ()=>import('view/Province') },
{ path: "/provinces", component: ()=>import('view/ProvinceList') },
{ path: "/world", component: ()=>import('view/World') },
{ path: "/amap", component: ()=>import('view/Amap') },
]
import axios, {AxiosRequestConfig} from 'axios';
const baseURL: string = '';
const config: any = {
baseURL,
timeout: 3600000,
headers: {
'Cache-Control': 'no-cache,no-store,must-revalidate,max-age=-1,private'
},
responseType: 'json', // default
validateStatus: () => true
};
const callback = (resp: any): any => {
if (resp.status === 401) {
console.log("session过期,请重新登录!");
return null;
}
else if (resp.status !== 200) {
throw resp;
}
return resp.data || resp;
}
const encode = (config: AxiosRequestConfig) => {
let url:string = config.url||""
// get参数编码
if (config.method === 'get' && config.params) {
url += '?'
let keys = Object.keys(config.params)
for (let key of keys) {
url += `${key}=${encodeURIComponent(config.params[key])}&`
}
url = url.substring(0, url.length - 1)
config.params = {}
}
config.url = url
return config
};
export function GetJSON(url: string, params?: any, cfg?: any): Promise<any> {
const instance = axios.create({ ...config, ...cfg });
instance.interceptors.request.use(encode);
return instance.get(url, { params }).then(callback);
}
export function PostJSON(
url: string,
{ payload, params }: { payload?: any, params?: any } = {}, cfg?: any): Promise<any> {
const instance = axios.create({ ...config, ...cfg });
instance.interceptors.request.use(encode);
return instance.post(url, payload, { params }).then(callback);
}
\ No newline at end of file
import React from 'react';
import { Card, Typography } from 'antd';
const { Title } = Typography;
interface Props extends React.ComponentProps<any> {
title?: React.ReactNode | string
}
const FC: React.FC<Props> = function (props: Props) {
const { children, title, ...rest } = props;
return <Card bordered={false} {...rest}>
{title && <Title className="text-primary" level={3}>{title}</Title>}
{children}
</Card>
}
export default FC;
\ No newline at end of file
@import '~antd/lib/style/themes/default.less';
.tag {
border: @border-width-base @border-style-base @border-color-base;
border-radius: @border-radius-base;
padding: 1rem 1.5rem;
margin-right: 1rem;
margin-top: 1rem;
display: inline-block;
font-size: 1.25rem;
i {
vertical-align: baseline;
margin-right: 1rem;
font-size: 1.25rem;
}
// + .tag {
// margin-left: 2rem;
// }
}
@media (max-width: @screen-xl-max) {
.tag {
padding: .5rem .8rem;
font-size: .9rem;
i {
vertical-align: baseline;
margin-right: 1rem;
font-size: .9rem;
}
}
}
\ No newline at end of file
import React from 'react';
import classnames from "classnames";
import { tag } from "./Tag.module.less";
interface Props extends React.ComponentProps<any> {
}
const FC: React.FC<Props> = function (props: Props) {
const { children, className, ...rest } = props;
return <span className={classnames(className,tag)} {...rest}>
{children}
</span>
}
export default FC;
\ No newline at end of file
import React, { Context } from 'react';
import { RouteComponentProps } from 'react-router-dom';
import { connect } from 'react-redux';
import { dispatch, State } from "./model";
export const AppContext:Context<any> = React.createContext(null);
type GetSessionProps = State&RouteComponentProps<any>;
export const GetSession: React.FC = connect((state:GetSessionProps) => state) (({children, session, history}: React.PropsWithChildren<GetSessionProps> ) => {
React.useEffect(() => {
dispatch({type:'user.fetchSessionInfo',payload:{history}});
// eslint-disable-next-line
}, []);
if (session) {
return (children as React.ReactElement);
}
return <div>正在获取用户信息...</div>;
});
\ No newline at end of file
@import '~antd/es/style/themes/default.less';
.container {
display: flex;
flex-direction: column;
height: 100vh;
overflow: auto;
background: @layout-body-background;
}
.lang {
width: 100%;
height: 40px;
line-height: 44px;
text-align: right;
:global(.ant-dropdown-trigger) {
margin-right: 24px;
}
}
.content {
flex: 1;
padding: 32px 0;
}
@media (min-width: @screen-md-min) {
.container {
background-image: url('https://gw.alipayobjects.com/zos/rmsportal/TVYTbAXWheQpRcWDaDMu.svg');
background-repeat: no-repeat;
background-position: center 110px;
background-size: 100%;
}
.content {
padding: 32px 0 24px;
}
}
.top {
text-align: center;
}
.header {
height: 44px;
line-height: 44px;
a {
text-decoration: none;
}
}
.logo {
height: 44px;
margin-right: 16px;
vertical-align: top;
}
.title {
position: relative;
top: 2px;
color: @heading-color;
font-weight: 600;
font-size: 33px;
font-family: Avenir, 'Helvetica Neue', Arial, Helvetica, sans-serif;
}
.desc {
margin-top: 12px;
margin-bottom: 40px;
color: @text-color-secondary;
font-size: @font-size-base;
}
import React from 'react';
// import logo from '../assets/logo.svg';
import styles from './UserLayout.module.less';
// console.log(styles)
const UserLayout: React.FC<{}> = props => {
const {
children,
} = props;
return (
<div
className={styles.container}
>
<div className={styles.lang}>
{/* <SelectLang /> */}
</div>
<div className={styles.content}>
<div className={styles.top}>
<div className={styles.header}>
{/* <img alt="logo" className={styles.logo} src={logo} /> */}
<span className={styles.title}>数据中台</span>
</div>
<div className={styles.desc}></div>
</div>
{children}
</div>
{/* <DefaultFooter /> */}
</div>
);
};
export default UserLayout;
import { createStore, applyMiddleware } from 'redux';
import createSagaMiddleware from 'redux-saga';
import { all, call, takeLatest, takeEvery } from 'redux-saga/effects';
import * as user from './user';
import { reducers } from './reducers';
interface Session {
userName?: string
}
interface Props {
type: string,
payload?: any
}
export interface State {
data: any,
session: Session
}
function connect(modules:any):any {
const actions:any = {};
for (const m in modules) {
const mdl = modules[m];
for (const f in mdl) {
const name:string = [m, f].join('.');
console.log(name);
actions[name] = mdl[f];
}
}
return actions;
}
const actions = connect({ user });
const sagaMiddleware = createSagaMiddleware();
export const store = createStore(
reducers,
applyMiddleware(sagaMiddleware)
)
/*
run saga
*/
function* worker(action: any) { //dispatched action
const { type, payload } = action.args;
try {
yield call(actions[type], payload||{}); //call method in models
} catch (exception){
console.error(exception);
} finally {
//exception
}
}
function* watchLatest() {
yield takeLatest('TAKE_LATEST', worker)
}
function* watchEvery() {
yield takeEvery('TAKE_EVERY', worker)
}
function* rootSaga() {
yield all([
watchLatest(),watchEvery()
])
}
sagaMiddleware.run(rootSaga);
//If we want to only get the response of the latest request fired
// (e.g. to always display the latest version of data) we can use the takeLatest helper:
export const dispatch = (args: Props) => store.dispatch({ type: 'TAKE_LATEST', args })
export const every = (args: Props) => store.dispatch({ type: 'TAKE_EVERY', args })
\ No newline at end of file
import { combineReducers } from 'redux';
interface ActionProps {
type: string,
args: any
}
export enum Actions {
SetData = 'set_data',
MergeData = 'merge_data',
SetSession = 'set_sess'
}
const data: any = function (state:any = {} , action:ActionProps) {
switch (action.type) {
case Actions.SetData:
return action.args
case Actions.MergeData:
// console.log(state, action.args)
return action.args ? { ...state, ...action.args } : {};
default:
return state
}
}
const session: any = function (state:any = null , action:ActionProps) {
switch (action.type) {
case Actions.SetSession:
return action.args
default:
return state
}
}
export const reducers = combineReducers({ data, session });
\ No newline at end of file
import * as service from '../service/user';
import { call, put } from 'redux-saga/effects';
import { Actions } from './reducers';
export function* fetchSessionInfo(payload:any) {
const foobar = yield call(service.sessionInfo, payload);
yield put({ type: Actions.SetSession, args: foobar });
}
export function* getUserSubscribeTableModels() {
const tableModels = yield call(service.getUserSubscribeTableModels);
yield put({ type: Actions.MergeData, args: {tableModels} });
}
export function* listPrivilegeTableModels() {
const tableModels = yield call(service.listPrivilegeTableModels);
yield put({ type: Actions.MergeData, args: {tableModels} });
}
export interface DashboardProps {
data: {
historyData?: any
provinceData?: any
locationData?:any
models?: any
}
}
export function* getPlague() {
const models = yield call(service.getPlague);//console.log(data)
yield put({ type: Actions.MergeData, args: {models} });
}
export function* getHistory(payload:any) {
const historyData = yield call(service.getHistory,payload);//console.log(data)
yield put({ type: Actions.MergeData, args: {historyData} });
}
export function* getLocations(payload:any) {
const locationData = yield call(service.getLocations,payload);//console.log(data)
yield put({ type: Actions.MergeData, args: {locationData} });
}
\ No newline at end of file
import { PostJSON, GetJSON } from 'data-platform/axios';
export function sessionInfo(payload: any): Promise<any> {
const { history } = payload;
return PostJSON('/auth/sessionInfo', payload).catch((error) => {
history && history.push('/signin');
throw error;
});
}
export function login(params: any): Promise<any> {
return PostJSON('/auth/signin', { params });
}
export function getUserSubscribeTableModels(): Promise<any> {
return GetJSON("/datacatalog/front/getUserSubscribeTableModels");
}
export function listPrivilegeTableModels(): Promise<any> {
return GetJSON("/datacatalog/front/listPrivilegeTableModels");
}
export function queryTagAsTree(): Promise<any> {
return GetJSON("/datacatalog/front/queryTagAsTree");
}
export function listTagTableModels(payload: any): Promise<any> {
return GetJSON("/datacatalog/front/listTagTableModels", payload);
}
export function getPlague(): Promise<any> {
return GetJSON("/cov/stats");//"/news/wap/fymap2020_data.d.json?"
}
export function getHistory(payload:any): Promise<any> {
return GetJSON("/cov/stats/pro",payload); //"/news/wap/historydata.d.json"
}
export function getLocations(payload:any): Promise<any> {
return GetJSON("/cov/location",payload); ///location-data.json
//return GetJSON("/2019-nCoV/data.json?t="+(new Date().getTime()));
}
import loadjs from 'loadjs';
import union from 'lodash.union';
export const ContextPath = process.env.REACT_APP_CONTEXT_PATH || '';
export const LoadPath = process.env.REACT_APP_LOAD_PATH || '';
export const Title = process.env.REACT_APP_TITLE || 'My Test App';
export const SetTitle = function (title) {
//console.log(title)
window.document.title = Title + (title ? (' - ' + title) : '');
}
export const IsObj = function (data) {
return data && (typeof data) === "object"
}
export const IsArr = function (data) {
return data && Object.prototype.toString.call(data) === '[object Array]';
}
export const IsStr = function (data) {
return data && (typeof data) === "string"
}
export const LoadJs = function (what, libs) {
if (libs && !loadjs.isDefined(what)) {
const _libs = libs.map((lib) => {
return LoadPath + lib;
});
loadjs(_libs, what, {
// before: function (path, scriptEl) { /* execute code before fetch */ },
async: false, // load files synchronously or asynchronously (default: true)
// numRetries: 3, // see caveats about using numRetries with async:false (default: 0)
// returnPromise: false // return Promise object (default: false)
});
}
}
export const LoadJsReady = function (what, success, error) {
loadjs.ready(what, {
success, //: function () { /* foo.js & bar.js loaded */ },
error//: function (depsNotFound) { /* foobar bundle load failed */ },
});
}
export const GetLocaleDate = function (time) {
var d = new Date();
d.setTime(time || Date.now());
return d.toLocaleDateString('zh-CN')
}
// export const GetSha1 = function (str) {
// if (null == str)
// str = ""
// var sha1 = new SHA1("SHA-1", "TEXT")
// sha1.update(str)
// return sha1.getHash("HEX")
// }
export const Redirect = function (redirect) {
// location.hash = '#'+redirect;
window.location.href = ContextPath + redirect;
}
export const Open = function (url, args) {
const { target = '_blank' } = args || {};
return window.open(url, target);//_self
}
export const StopPropagation = function (e) {
e = e || window.event;
if (e.stopPropagation) {
e.stopPropagation();
} else {
e.cancelBubble = true;
}
}
export const PreventDefault = function (e) {
e.preventDefault();
}
/*
// Usage:
// query string: ?foo=lorem&bar=&baz
var foo = GetParameterByName('foo'); // "lorem"
var bar = GetParameterByName('bar'); // "" (present with empty value)
var baz = GetParameterByName('baz'); // "" (present with no value)
var qux = GetParameterByName('qux'); // null (absent)
*/
export const GetParameterByName = function (name, url) {
url = url || window.location.href;
name = name.replace(/[[\]]/g, "\\$&");
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
results = regex.exec(url);
if (!results) return null;
if (!results[2]) return '';
return decodeURIComponent(results[2].replace(/\+/g, " "));
}
export const XOR = function (a, b) {
return (a ? 1 : 0) ^ (b ? 1 : 0);
}
export const Union = function (source, arr) {
return union(source, arr);
}
export function NumWithCommas(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
\ No newline at end of file
interface Window {
echarts: any;
provinceMapData: any;
__world_geo_map:any;
EchartOptions: any;
EchartDataFormat: any;
AMap:any;
AMapUI:any;
SimpleMarker:any;
}
/* body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
} */
code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
monospace;
}
.__am-infowin {
width: 3rem;
}
\ No newline at end of file
@import '~antd/lib/style/themes/default.less'; // 引入官方提供的 less 样式入口文件
@import "~antd-mobile/dist/antd-mobile.less";
@muted-color: #989898;
@textColors: primary @primary-color, warning @warning-color, success @success-color, danger @error-color, muted @muted-color;
.textColor(@iterator:1) when(@iterator <= length(@textColors)) {
@key: extract(extract(@textColors, @iterator), 1);
@value: extract(extract(@textColors, @iterator), 2);
.text-@{key} {
color: @value !important;
}
.textColor(@iterator + 1);
}
.textColor();
.border-light { border-color: #eeeeee;}
\ No newline at end of file
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import './index.less';
import './scss/index.scss';
import './global.d';
import App from './App';
import * as serviceWorker from './serviceWorker';
ReactDOM.render(<App />, document.getElementById('root'));
// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: https://bit.ly/CRA-PWA
serviceWorker.unregister();
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 841.9 595.3">
<g fill="#61DAFB">
<path d="M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3zm-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9zm-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9zm32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1zM421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32zm-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24 4.7 8 9.5 15.8 14.4 23.4zM420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32zm-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9zm-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6 0-15.7 22.9-35.6 58.3-50.6 8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2zM310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1zm38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6zM320.8 78.4z"/>
<circle cx="420.9" cy="296.5" r="45.7"/>
<path d="M520.5 78.1z"/>
</g>
</svg>
/// <reference types="node" />
/// <reference types="react" />
/// <reference types="react-dom" />
declare namespace NodeJS {
interface ProcessEnv {
readonly NODE_ENV: 'development' | 'production' | 'test';
readonly PUBLIC_URL: string;
}
}
declare module '*.bmp' {
const src: string;
export default src;
}
declare module '*.gif' {
const src: string;
export default src;
}
declare module '*.jpg' {
const src: string;
export default src;
}
declare module '*.jpeg' {
const src: string;
export default src;
}
declare module '*.png' {
const src: string;
export default src;
}
declare module '*.webp' {
const src: string;
export default src;
}
declare module '*.svg' {
import * as React from 'react';
export const ReactComponent: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
const src: string;
export default src;
}
declare module '*.module.css' {
const classes: { readonly [key: string]: string };
export default classes;
}
declare module '*.module.scss' {
const classes: { readonly [key: string]: string };
export default classes;
}
declare module '*.module.sass' {
const classes: { readonly [key: string]: string };
export default classes;
}
// @import url('https://fonts.googleapis.com/css?family=Cormorant+Garamond:400,700i&display=swap');
// @import url('https://fonts.googleapis.com/css?family=Work+Sans&display=swap');
a { text-decoration: none}
ul { margin-block-start: 0; padding-inline-start: 0; list-style: none; margin-block-end: 0; margin: 0;}
.align-between { flex: 1 auto; }
.bg-white{
background-color: #fff;
}
.w-100 { width: 100%;}
.h-100{ height: 100%;}
.d-block { display: block;}
.d-flex { display: flex;}
.d-inline { display: inline;}
.d-inline-block { display: inline-block;}
$fontSizes: (
'1': 10rem, '2': 5rem,'3': 3rem,'4': 2rem,'5': .28rem,'6': .2rem,
);
@each $name, $value in $fontSizes{
.font-h#{$name} {
font-size: $value !important;
}
}
// 强制不换行,中英文都起作用
.nowrap {white-space: nowrap;}
// 只对英文起作用,以字母作为换行依据
.break-all {word-break:break-all;}
// 只对英文起作用,以单词作为换行依据
.word-wrap {word-wrap:break-word;}
// white-space:pre-wrap; 只对中文起作用,强制换行
// 不换行,超出部分隐藏且以省略号形式出现, 注意,一定要指定容器的宽度,不然的话是没有用的。
.ellipsis {white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.overflow-y { overflow: auto;}
.text-right { text-align: right;}
.text-center { text-align: center;}
.lr {
display: flex;
.__left {
flex-grow: 1;
}
}
@media (min-width: 1280px) {
.col-md-20 {
flex-grow: 0;
max-width: 20%;
flex-basis: 20% !important;
}
}
@mixin margin-padding($level,$val) {
$locations: (
't': '-top', 'b': '-bottom', 'l': '-left', 'r': '-right', '': ''
);
@each $name, $value in $locations{
.m#{$name}-#{$level} {
margin#{$value}: $val !important;
}
.p#{$name}-#{$level} {
padding#{$value}: $val !important;
}
}
.mx-#{$level} {
margin-left: $val;
margin-right: $val;
}
.px-#{$level} {
padding-left: $val;
padding-right: $val;
}
.my-#{$level} {
margin-top: $val;
margin-bottom: $val;
}
.py-#{$level} {
padding-top: $val;
padding-bottom: $val;
}
}
@mixin border(){
$locations: '-top' '-bottom' '-left' '-right' '';
@each $loc in $locations{
.border#{$loc} {
border#{$loc}-width: 1px;
border#{$loc}-style: solid;
}
.border#{$loc}-sm {
border#{$loc}-width: 1px;
border#{$loc}-style: solid;
}
.border#{$loc}-md {
border#{$loc}-width: 3px;
border#{$loc}-style: solid;
}
}
}
// @mixin border-color(){
// $types: (info: $brand-info, primary: $brand-primary, white: #ffffff);
// @each $key, $value in $types{
// .border-#{$key} { border-color: $value !important;}
// }
// }
@include margin-padding('7', 50px);
@include margin-padding('6', 30px);
@include margin-padding('5', 20px);
@include margin-padding('4', 15px);
@include margin-padding('3', 10px);
@include margin-padding('2', 5px);
@include margin-padding('1', 3px);
@include margin-padding('0', 0);
@include border();
// This optional code is used to register a service worker.
// register() is not called by default.
// This lets the app load faster on subsequent visits in production, and gives
// it offline capabilities. However, it also means that developers (and users)
// will only see deployed updates on subsequent visits to a page, after all the
// existing tabs open on the page have been closed, since previously cached
// resources are updated in the background.
// To learn more about the benefits of this model and instructions on how to
// opt-in, read https://bit.ly/CRA-PWA
const isLocalhost = Boolean(
window.location.hostname === 'localhost' ||
// [::1] is the IPv6 localhost address.
window.location.hostname === '[::1]' ||
// 127.0.0.0/8 are considered localhost for IPv4.
window.location.hostname.match(
/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
)
);
type Config = {
onSuccess?: (registration: ServiceWorkerRegistration) => void;
onUpdate?: (registration: ServiceWorkerRegistration) => void;
};
export function register(config?: Config) {
if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
// The URL constructor is available in all browsers that support SW.
const publicUrl = new URL(
process.env.PUBLIC_URL,
window.location.href
);
if (publicUrl.origin !== window.location.origin) {
// Our service worker won't work if PUBLIC_URL is on a different origin
// from what our page is served on. This might happen if a CDN is used to
// serve assets; see https://github.com/facebook/create-react-app/issues/2374
return;
}
window.addEventListener('load', () => {
const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
if (isLocalhost) {
// This is running on localhost. Let's check if a service worker still exists or not.
checkValidServiceWorker(swUrl, config);
// Add some additional logging to localhost, pointing developers to the
// service worker/PWA documentation.
navigator.serviceWorker.ready.then(() => {
console.log(
'This web app is being served cache-first by a service ' +
'worker. To learn more, visit https://bit.ly/CRA-PWA'
);
});
} else {
// Is not localhost. Just register service worker
registerValidSW(swUrl, config);
}
});
}
}
function registerValidSW(swUrl: string, config?: Config) {
navigator.serviceWorker
.register(swUrl)
.then(registration => {
registration.onupdatefound = () => {
const installingWorker = registration.installing;
if (installingWorker == null) {
return;
}
installingWorker.onstatechange = () => {
if (installingWorker.state === 'installed') {
if (navigator.serviceWorker.controller) {
// At this point, the updated precached content has been fetched,
// but the previous service worker will still serve the older
// content until all client tabs are closed.
console.log(
'New content is available and will be used when all ' +
'tabs for this page are closed. See https://bit.ly/CRA-PWA.'
);
// Execute callback
if (config && config.onUpdate) {
config.onUpdate(registration);
}
} else {
// At this point, everything has been precached.
// It's the perfect time to display a
// "Content is cached for offline use." message.
console.log('Content is cached for offline use.');
// Execute callback
if (config && config.onSuccess) {
config.onSuccess(registration);
}
}
}
};
};
})
.catch(error => {
console.error('Error during service worker registration:', error);
});
}
function checkValidServiceWorker(swUrl: string, config?: Config) {
// Check if the service worker can be found. If it can't reload the page.
fetch(swUrl, {
headers: { 'Service-Worker': 'script' }
})
.then(response => {
// Ensure service worker exists, and that we really are getting a JS file.
const contentType = response.headers.get('content-type');
if (
response.status === 404 ||
(contentType != null && contentType.indexOf('javascript') === -1)
) {
// No service worker found. Probably a different app. Reload the page.
navigator.serviceWorker.ready.then(registration => {
registration.unregister().then(() => {
window.location.reload();
});
});
} else {
// Service worker found. Proceed as normal.
registerValidSW(swUrl, config);
}
})
.catch(() => {
console.log(
'No internet connection found. App is running in offline mode.'
);
});
}
export function unregister() {
if ('serviceWorker' in navigator) {
navigator.serviceWorker.ready.then(registration => {
registration.unregister();
});
}
}
const proxy = require('http-proxy-middleware');
module.exports = function(app) {
app.use('/api', proxy({target: 'http://139.198.126.96:9011',logLevel: 'debug'}) );
app.use('/news', proxy({target: 'https://interface.sina.cn',logLevel: 'debug', changeOrigin: true, secure: false}) );
app.use('/other', proxy({target: 'https://finance.sina.com.cn',logLevel: 'debug', changeOrigin: true, secure: false}) );
app.use('/cov', proxy({target: 'http://139.198.127.39:18077',logLevel: 'debug', changeOrigin: true}) );
app.use('/2019-nCoV', proxy({target: 'https://assets.cbndata.org',logLevel: 'debug', changeOrigin: true}) );
app.use('/amap-api', proxy({target: 'https://restapi.amap.com',logLevel: 'debug', changeOrigin: true,
pathRewrite: {
//'^/api/old-path' : '/api/new-path', // rewrite path
'^/amap-api' : '' // remove base path
}
}));
};
\ No newline at end of file
// jest-dom adds custom jest matchers for asserting on DOM nodes.
// allows you to do things like:
// expect(element).toHaveTextContent(/react/i)
// learn more: https://github.com/testing-library/jest-dom
import '@testing-library/jest-dom/extend-expect';
declare module "*.less";
\ No newline at end of file
.suggest{
position: relative;
z-index: 999;
:global(.list) {
position: absolute;
width: 100%;
background-color: #fff;
}
}
\ No newline at end of file
import React from 'react';
import { RouteComponentProps } from "react-router-dom";
import { connect } from 'react-redux';
import { NavBar, Icon, Button, List, InputItem, SearchBar } from 'antd-mobile';
import { LoadJs, LoadJsReady } from 'data-platform/utils';
// import ImgD from 'assets/desktop.jpg';
// import ImgM from 'assets/m.jpg';
import { DashboardProps } from 'data-platform/model/user';
import { every } from 'data-platform/model';
// import './Dashboard.css';
interface FCProps {
shenzhen: number
}
const center = [114.032326,22.567909];
const mapOpts = {
showIndoorMap: false, // 是否在有矢量底图的时候自动展示室内地图,PC默认true,移动端默认false
resizeEnable: true, //是否监控地图容器尺寸变化,默认值为false
dragEnable: true, // 地图是否可通过鼠标拖拽平移,默认为true
keyboardEnable: false, //地图是否可通过键盘控制,默认为true
doubleClickZoom: false, // 地图是否可通过双击鼠标放大地图,默认为true
zoomEnable: true, //地图是否可缩放,默认值为true
rotateEnable: false, // 地图是否可旋转,3D视图默认为true,2D视图默认false
// center,
zoom:11,
zooms:[8,20],
}
function addMarkers(SimpleMarker:any, $:any, map:any, positions: any[]) {
var theme = 'numv1';
// var noLabel = true;
//内置的样式
var iconStyles = SimpleMarker.getBuiltInIconStyles(theme);
//获取一批grid排布的经纬度
// var lngLats = getGridLngLats(mapObj.getCenter(), 5, iconStyles.length, 120, 60);
var markers = [];
// for (var i = 0, len = lngLats.length; i < len; i++) {
for (var i = 0, len = positions.length; i < len; i++) {
// console.log(lngLats[i])
const {longitude,latitude,address,count} = positions[i];
const position = [ parseFloat(longitude),parseFloat(latitude)];//[114.0257,22.536312];
// count<0&&console.log(positions[i]);
try {
var marker = new SimpleMarker({
iconTheme: theme,
//使用内置的iconStyle
iconStyle: iconStyles[23],
//图标文字
iconLabel: '',
//显示定位点
showPositionPoint: false,
map,
position,//: lngLats[i],
});
} catch (error) {
// console.log(positions[i]);
continue;
}
const AMap:any = window.AMap;
const countStr:string = count>0?`<b class="text-danger">${count}</b>人<div></div>`:'';
const infoWindow:any = new AMap.InfoWindow({
//isCustom: true, //使用自定义窗体
content: `<div class="__am-infowin">${address}&nbsp;${countStr}`,
offset: new AMap.Pixel(16, -45)
});
//鼠标点击marker弹出自定义的信息窗体
AMap.event.addListener(marker, 'click', function () {
infoWindow.open(map, position);
});
markers.push(marker);
}//for
return markers;
}
let globalMarkers:any[] = [];
const FC: React.FC<FCProps & DashboardProps> = function (props: FCProps & DashboardProps) {
const { data, shenzhen } = props;
const mapRef = React.useRef<any>();
const [city, setCity] = React.useState("");
React.useEffect(() => {
// console.log(data.locationData)
if (data.locationData) {
const AMapUI = window.AMapUI;
//加载SimpleMarker
AMapUI.load(['ui/overlay/SimpleMarker', 'lib/$'], function(SimpleMarker:any, $:any) {
function refreshMarkers() {
//清除现有的marker
for (var i = 0, len = globalMarkers.length; i < len; i++) {
globalMarkers[i].setMap(null);
}
globalMarkers = addMarkers(SimpleMarker, $, mapRef.current, data.locationData.data);
}
refreshMarkers();
window.SimpleMarker = SimpleMarker;
});
}
},[data]);
React.useEffect(() => {
LoadJs("amap",[
`https://webapi.amap.com/maps?v=1.4.15&key=7bff66c837e3eb6fb1229cbef51c2cff`,// 89432503d7989acb091a835da32b8f9d
"https://webapi.amap.com/ui/1.0/main.js?v=1.0.11"
]);
LoadJsReady("amap", ()=>{
const AMap = window.AMap;
var mapObj = new AMap.Map('container', mapOpts);
mapRef.current = mapObj;
mapObj.getCity( function(info:any){
console.log(info)
every({
type: 'user.getLocations', payload: {city:info.city}
});
});
});
return ()=>{
mapRef.current && mapRef.current.destroy();
}
}, []);
React.useEffect(() => {
if(shenzhen>0 && mapRef.current) {
mapRef.current.setCity('0755');
every({
type: 'user.getLocations', payload: {city:'深圳市'}
});
}
}, [shenzhen]);
return <div id="container" style={{
height:'5rem'
}}>loading...</div>
}
export default connect((state: DashboardProps) => state)(FC);
\ No newline at end of file
.tool-wap{padding: 0 .3rem;margin-top: .5rem;background: url(https://n.sinaimg.cn/finance/cece9e13/20200129/fyHot.png) 0.4rem 0.05rem no-repeat;padding-left: .7rem;background-size: .28rem auto;flex-direction: row;justify-content:space-between;display:none}
.tool-enter{}
.tool-enter a{font-size: .24rem;color: #4d79f3;}
.top-pop-inner{width: 4.5rem;white-space: nowrap;overflow: hidden;flex-direction: row;}
.pop-Inner{white-space: nowrap;color: #333;flex-direction: row;}
.pop-Inner span{padding: 0 .6rem;}
.pop-Inner {font-size: 13px;}
.t_notice{background-color:#e1a439;padding:5px;}
.t_notice span{color:#fff;}
.topMapData{/*height:2.78rem;*/overflow: hidden;background-color: #f5f5f5;padding-bottom:.4rem;}
.topMapData .t_tit{display: flex;
flex-direction: row;
justify-content: space-between;padding:.3rem 0 0; height:.35rem;line-height: .35rem;text-align: center;color:#777;font-size:.24rem;}
.topMapData .t_tit b{background-color: #ff4d4f;display: inline-block;height:.35rem;color:#fff;font-size:.26rem;
border-radius: .05rem; margin-right: .1rem; font-weight: 700;padding:0 0.1rem;}
.topMapData .t_list{display: flex;flex-direction:row;padding:0 .3rem;}
.topMapData .t_item{color:#333;line-height: .4rem;text-align: center;flex:1;display: flex;flex-direction: column;}
.topMapData .t_item h5{font-size:.24rem;font-weight: bold;display: block;line-height: .4rem;position:relative;}
.topMapData .t_item span{font-size:.28rem;font-weight: bold;display: block;}
.topMapData .t_item span b{color:#e50000;font-weight: bold;}
.topMapData .t_item span .t_con{color:#e50000;}
.topMapData .t_item span .t_sus{color:#ffa019;}
.topMapData .t_item span .t_death{color:#2f2f2f;}
.topMapData .t_item span .t_cure{color:#1e6b00;}
.topMapData .t_item h4 {
display: block;
line-height: .4rem;
font-size: .24rem;
color: #999;
font-weight: normal;
}
.topMapData .t_item h4 code {
color: #e50000;
font-size: .2rem;
display: inline;
font-weight: bold;
font-family: Microsoft YaHei,Helvetica Neue,Helvetica,STHeiTi,Arial,sans-serif;
}
.topMapData .t_item h4 .t_con_add {
color:#e50000;
}
.topMapData .t_item h4 .t_sus_add {
color:#ffa019;
}
.topMapData .t_item h4 .t_death_add {
color:#2f2f2f;
}
.topMapData .t_item h4 .t_cure_add {
color:#1e6b00;
}
.q_list{display: flex;flex-direction:row;}
.q_item{color:#333;line-height: .4rem;text-align: center;flex:1;display: flex;flex-direction: column;align-self: center;margin-left:10px;}
.q_item:first-child{margin-left:0;}
.q_list_top:first-child{background-color:#d24338;}
.q_list_top:nth-child(2){background-color:#c54a40;}
.q_list_top:nth-child(3){background-color:#b5534a;}
.q_list_bottom:first-child{background-color:#5855d0;}
.q_list_bottom:nth-child(2){background-color:#444be1;}
.q_list_bottom:nth-child(3){background-color:#3c3cea;}
.q_item span{color:#fff;font-size:.28rem;font-weight: bold;display: block;}
.yqloading {
display: -webkit-box;
display: flex;
-webkit-box-pack: center;
justify-content: center;
-webkit-box-align: center;
align-items: center;
height: 100%;
min-height: 2rem;
background:url(https://touzi.sina.com.cn/view/public/images/loading.gif) no-repeat 50% 50%;background-size:.5rem .5rem;
}
/*浮层样式*/
.tool-tip-wrap{padding: .28rem .2rem;width: 1.8rem;}
.tool-tip-wrap .name{font-size: .28rem;color: #333;font-weight: bold;}
.tool-tip-wrap .detail{margin-top: .15rem;padding-bottom: .1rem;}
.tool-tip-wrap .detail span{display: block;margin-bottom: .1rem;font-size: .24rem;}
.tool-tip-wrap .btn-tip{display: block;width: 1.8rem;height: .48rem;line-height: .48rem;border-radius: .24rem;color: #fff;font-size: .24rem;background-color: #ff4d4f;text-align: center;}
.tool-tip-wrap .btn-tip:visited{text-decoration: none;font-size: .24rem}
.tool-tip-wrap .btn-tip:hover{text-decoration: none;font-size: .24rem}
.tool-tip-wrap .view-detail{}
.tool-tip-wrap .gen-share{margin-top: .15rem;}
\ No newline at end of file
This diff is collapsed. Click to expand it.
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