diff --git a/src/.idea/.gitignore b/src/.idea/.gitignore new file mode 100644 index 0000000..35410ca --- /dev/null +++ b/src/.idea/.gitignore @@ -0,0 +1,8 @@ +# 默认忽略的文件 +/shelf/ +/workspace.xml +# 基于编辑器的 HTTP 客户端请求 +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/src/.idea/codeStyles/Project.xml b/src/.idea/codeStyles/Project.xml new file mode 100644 index 0000000..96f4223 --- /dev/null +++ b/src/.idea/codeStyles/Project.xml @@ -0,0 +1,26 @@ + + + + + + + + \ No newline at end of file diff --git a/src/.idea/codeStyles/codeStyleConfig.xml b/src/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 0000000..79ee123 --- /dev/null +++ b/src/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/src/.idea/hospital.iml b/src/.idea/hospital.iml new file mode 100644 index 0000000..d6ebd48 --- /dev/null +++ b/src/.idea/hospital.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/src/.idea/inspectionProfiles/Project_Default.xml b/src/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..03d9549 --- /dev/null +++ b/src/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/src/.idea/jpa-buddy.xml b/src/.idea/jpa-buddy.xml new file mode 100644 index 0000000..966d5f5 --- /dev/null +++ b/src/.idea/jpa-buddy.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/src/.idea/libraries/chromedriver_win32.xml b/src/.idea/libraries/chromedriver_win32.xml new file mode 100644 index 0000000..9beb869 --- /dev/null +++ b/src/.idea/libraries/chromedriver_win32.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/src/.idea/libraries/selenium_server_standalone_3_141_59.xml b/src/.idea/libraries/selenium_server_standalone_3_141_59.xml new file mode 100644 index 0000000..8aa83fc --- /dev/null +++ b/src/.idea/libraries/selenium_server_standalone_3_141_59.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/src/.idea/misc.xml b/src/.idea/misc.xml new file mode 100644 index 0000000..d79bd4e --- /dev/null +++ b/src/.idea/misc.xml @@ -0,0 +1,9 @@ + + + + + + + + \ No newline at end of file diff --git a/src/.idea/modules.xml b/src/.idea/modules.xml new file mode 100644 index 0000000..e8e7d0d --- /dev/null +++ b/src/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..a2a7be5 --- /dev/null +++ b/src/App.vue @@ -0,0 +1,22 @@ + + + + + diff --git a/src/HelloWorld.vue b/src/HelloWorld.vue new file mode 100644 index 0000000..1c19f2a --- /dev/null +++ b/src/HelloWorld.vue @@ -0,0 +1,113 @@ + + + + + + diff --git a/src/Home.vue b/src/Home.vue new file mode 100644 index 0000000..d5986c5 --- /dev/null +++ b/src/Home.vue @@ -0,0 +1,20 @@ + + + + + diff --git a/src/HosdataApplication.java b/src/HosdataApplication.java new file mode 100644 index 0000000..4d34f26 --- /dev/null +++ b/src/HosdataApplication.java @@ -0,0 +1,13 @@ +package com.example.hosdata; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class HosdataApplication { + + public static void main(String[] args) { + SpringApplication.run(HosdataApplication.class, args); + } + +} diff --git a/src/Login.vue b/src/Login.vue new file mode 100644 index 0000000..f015593 --- /dev/null +++ b/src/Login.vue @@ -0,0 +1,91 @@ + + + + + diff --git a/src/advance/AdvanceIndex.vue b/src/advance/AdvanceIndex.vue new file mode 100644 index 0000000..c192440 --- /dev/null +++ b/src/advance/AdvanceIndex.vue @@ -0,0 +1,118 @@ + + + + + diff --git a/src/assets/logo.png b/src/assets/logo.png new file mode 100644 index 0000000..f3d2503 Binary files /dev/null and b/src/assets/logo.png differ diff --git a/src/build/build.js b/src/build/build.js new file mode 100644 index 0000000..8f2ad8a --- /dev/null +++ b/src/build/build.js @@ -0,0 +1,41 @@ +'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' + )) + }) +}) diff --git a/src/build/check-versions.js b/src/build/check-versions.js new file mode 100644 index 0000000..3ef972a --- /dev/null +++ b/src/build/check-versions.js @@ -0,0 +1,54 @@ +'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('npm')) { + versionRequirements.push({ + name: 'npm', + currentVersion: exec('npm --version'), + versionRequirement: packageConfig.engines.npm + }) +} + +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) + } +} diff --git a/src/build/logo.png b/src/build/logo.png new file mode 100644 index 0000000..f3d2503 Binary files /dev/null and b/src/build/logo.png differ diff --git a/src/build/utils.js b/src/build/utils.js new file mode 100644 index 0000000..e534fb0 --- /dev/null +++ b/src/build/utils.js @@ -0,0 +1,101 @@ +'use strict' +const path = require('path') +const config = require('../config') +const ExtractTextPlugin = require('extract-text-webpack-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 = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] + + if (loader) { + loaders.push({ + loader: loader + '-loader', + options: Object.assign({}, loaderOptions, { + sourceMap: options.sourceMap + }) + }) + } + + // Extract CSS when that option is specified + // (which is the case during production build) + if (options.extract) { + return ExtractTextPlugin.extract({ + use: loaders, + fallback: 'vue-style-loader' + }) + } else { + return ['vue-style-loader'].concat(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') + }) + } +} diff --git a/src/build/vue-loader.conf.js b/src/build/vue-loader.conf.js new file mode 100644 index 0000000..33ed58b --- /dev/null +++ b/src/build/vue-loader.conf.js @@ -0,0 +1,22 @@ +'use strict' +const utils = require('./utils') +const config = require('../config') +const isProduction = process.env.NODE_ENV === 'production' +const sourceMapEnabled = isProduction + ? config.build.productionSourceMap + : config.dev.cssSourceMap + +module.exports = { + loaders: utils.cssLoaders({ + sourceMap: sourceMapEnabled, + extract: isProduction + }), + cssSourceMap: sourceMapEnabled, + cacheBusting: config.dev.cacheBusting, + transformToRequire: { + video: ['src', 'poster'], + source: 'src', + img: 'src', + image: 'xlink:href' + } +} diff --git a/src/build/webpack.base.conf.js b/src/build/webpack.base.conf.js new file mode 100644 index 0000000..1f4f47e --- /dev/null +++ b/src/build/webpack.base.conf.js @@ -0,0 +1,92 @@ +'use strict' +const path = require('path') +const utils = require('./utils') +const config = require('../config') +const vueLoaderConfig = require('./vue-loader.conf') + +function resolve (dir) { + return path.join(__dirname, '..', dir) +} + +const createLintingRule = () => ({ + test: /\.(js|vue)$/, + loader: 'eslint-loader', + enforce: 'pre', + include: [resolve('src'), resolve('test')], + options: { + formatter: require('eslint-friendly-formatter'), + emitWarning: !config.dev.showEslintErrorsInOverlay + } +}) + +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 + }, + resolve: { + extensions: ['.js', '.vue', '.json'], + alias: { + 'vue$': 'vue/dist/vue.esm.js', + '@': resolve('src'), + } + }, + module: { + rules: [ + ...(config.dev.useEslint ? [createLintingRule()] : []), + { + 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', + options: { + limit: 10000, + name: utils.assetsPath('img/[name].[hash:7].[ext]') + } + }, + { + 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' + } +} diff --git a/src/build/webpack.dev.conf.js b/src/build/webpack.dev.conf.js new file mode 100644 index 0000000..070ae22 --- /dev/null +++ b/src/build/webpack.dev.conf.js @@ -0,0 +1,95 @@ +'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, { + 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, + } + }, + 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 + }), + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.dev.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +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) + } + }) +}) diff --git a/src/build/webpack.prod.conf.js b/src/build/webpack.prod.conf.js new file mode 100644 index 0000000..2f17259 --- /dev/null +++ b/src/build/webpack.prod.conf.js @@ -0,0 +1,149 @@ +'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 ExtractTextPlugin = require('extract-text-webpack-plugin') +const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') +const UglifyJsPlugin = require('uglifyjs-webpack-plugin') + +const env = process.env.NODE_ENV === 'testing' + ? require('../config/test.env') + : require('../config/prod.env') + +const webpackConfig = merge(baseWebpackConfig, { + 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'), + chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') + }, + plugins: [ + // http://vuejs.github.io/vue-loader/en/workflow/production.html + new webpack.DefinePlugin({ + 'process.env': env + }), + new UglifyJsPlugin({ + uglifyOptions: { + compress: { + warnings: false + } + }, + sourceMap: config.build.productionSourceMap, + parallel: true + }), + // extract css into its own file + new ExtractTextPlugin({ + filename: utils.assetsPath('css/[name].[contenthash].css'), + // Setting the following option to `false` will not extract CSS from codesplit chunks. + // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, + // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 + allChunks: true, + }), + // 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: process.env.NODE_ENV === 'testing' + ? 'index.html' + : 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 via CommonsChunkPlugin + chunksSortMode: 'dependency' + }), + // keep module.id stable when vendor modules does not change + new webpack.HashedModuleIdsPlugin(), + // enable scope hoisting + new webpack.optimize.ModuleConcatenationPlugin(), + // split vendor js into its own file + new webpack.optimize.CommonsChunkPlugin({ + name: 'vendor', + minChunks (module) { + // any required modules inside node_modules are extracted to vendor + return ( + module.resource && + /\.js$/.test(module.resource) && + module.resource.indexOf( + path.join(__dirname, '../node_modules') + ) === 0 + ) + } + }), + // extract webpack runtime and module manifest to its own file in order to + // prevent vendor hash from being updated whenever app bundle is updated + new webpack.optimize.CommonsChunkPlugin({ + name: 'manifest', + minChunks: Infinity + }), + // This instance extracts shared chunks from code splitted chunks and bundles them + // in a separate chunk, similar to the vendor chunk + // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk + new webpack.optimize.CommonsChunkPlugin({ + name: 'app', + async: 'vendor-async', + children: true, + minChunks: 3 + }), + + // copy custom static assets + new CopyWebpackPlugin([ + { + from: path.resolve(__dirname, '../static'), + to: config.build.assetsSubDirectory, + ignore: ['.*'] + } + ]) + ] +}) + +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 diff --git a/src/common/NavMenu.vue b/src/common/NavMenu.vue new file mode 100644 index 0000000..ffefeda --- /dev/null +++ b/src/common/NavMenu.vue @@ -0,0 +1,46 @@ + + + + + diff --git a/src/config/dev.env.js b/src/config/dev.env.js new file mode 100644 index 0000000..1e22973 --- /dev/null +++ b/src/config/dev.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const prodEnv = require('./prod.env') + +module.exports = merge(prodEnv, { + NODE_ENV: '"development"' +}) diff --git a/src/config/index.js b/src/config/index.js new file mode 100644 index 0000000..36f75f7 --- /dev/null +++ b/src/config/index.js @@ -0,0 +1,85 @@ +'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: '/', + proxyTable: { + '/api': { + target: 'http://localhost:8443', + changeOrigin: true, + pathRewrite: { + '^/api': '' + } + } + }, + + + // 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/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + assetsPublicPath: '/', + + /** + * 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 + } +} diff --git a/src/config/prod.env.js b/src/config/prod.env.js new file mode 100644 index 0000000..a6f9976 --- /dev/null +++ b/src/config/prod.env.js @@ -0,0 +1,4 @@ +'use strict' +module.exports = { + NODE_ENV: '"production"' +} diff --git a/src/config/test.env.js b/src/config/test.env.js new file mode 100644 index 0000000..c2824a3 --- /dev/null +++ b/src/config/test.env.js @@ -0,0 +1,7 @@ +'use strict' +const merge = require('webpack-merge') +const devEnv = require('./dev.env') + +module.exports = merge(devEnv, { + NODE_ENV: '"testing"' +}) diff --git a/src/controller/DoctorController.java b/src/controller/DoctorController.java new file mode 100644 index 0000000..8c8e811 --- /dev/null +++ b/src/controller/DoctorController.java @@ -0,0 +1,20 @@ +package com.example.hosdata.controller; + +import com.example.hosdata.pojo.Doctor; +import com.example.hosdata.pojo.RegisterRecord; +import com.example.hosdata.service.DoctorService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +public class DoctorController { + @Autowired + DoctorService doctorService; + + @CrossOrigin + @GetMapping("/api/register") + public List listByDepartment(String department) throws Exception { + return doctorService.listByDepartment(department); + } +} diff --git a/src/controller/DocyzController.java b/src/controller/DocyzController.java new file mode 100644 index 0000000..833b028 --- /dev/null +++ b/src/controller/DocyzController.java @@ -0,0 +1,35 @@ +package com.example.hosdata.controller; + +import com.example.hosdata.pojo.Docyz; +import com.example.hosdata.pojo.RegisterRecord; +import com.example.hosdata.service.DocyzService; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +@RestController +public class DocyzController { + @Autowired + DocyzService docService; + + @CrossOrigin + @PostMapping("/api/docrecords") + public Docyz addOrUpdate(@RequestBody Docyz doc) throws Exception { + docService.addOrUpdate(doc); + return doc; + } + + /* @CrossOrigin + @GetMapping("/api/docrecords") + public List listdoctorname() throws Exception { + return docService.listBydoctorname(); + }*/ + + @CrossOrigin + @GetMapping("/api/treatment") + public List listghname() throws Exception { + return docService.listByghname(); + } +} diff --git a/src/controller/InController.java b/src/controller/InController.java new file mode 100644 index 0000000..71048f8 --- /dev/null +++ b/src/controller/InController.java @@ -0,0 +1,32 @@ +package com.example.hosdata.controller; + +import com.example.hosdata.pojo.Information; +import com.example.hosdata.pojo.RegisterRecord; +import com.example.hosdata.service.DocyzService; +import com.example.hosdata.service.InService; +import com.example.hosdata.service.RegisterService; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.util.HtmlUtils; + +import java.util.List; + +@RestController +public class InController { + @Autowired + InService inService; + + @CrossOrigin + @GetMapping("/api/setting") + public List listuser() throws Exception { + return inService.listbyuser(); + } + + @CrossOrigin + @PostMapping("/api/setting") + public Information Update(@RequestBody Information information) throws Exception { + inService.update(information); + return information; + } +} diff --git a/src/controller/LoginController.java b/src/controller/LoginController.java new file mode 100644 index 0000000..e9c637c --- /dev/null +++ b/src/controller/LoginController.java @@ -0,0 +1,49 @@ +package com.example.hosdata.controller; + +import com.example.hosdata.pojo.RegisterRecord; +import com.example.hosdata.pojo.User; +import com.example.hosdata.result.Result; +import com.example.hosdata.service.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.util.HtmlUtils; + +import java.util.List; + +@Controller +public class LoginController { + + @Autowired + UserService userService; + + @CrossOrigin + @PostMapping(value = "/api/login") + @ResponseBody + public Result login(@RequestBody User requestUser) { + String username = requestUser.getUsername(); + username = HtmlUtils.htmlEscape(username); + String id = requestUser.getId(); + id = HtmlUtils.htmlEscape(id); + String realname = requestUser.getRealname(); + realname = HtmlUtils.htmlEscape(realname); + + User user = userService.getall(id,username, requestUser.getPassword(),realname); + //String id=requestUser.getId(); + RegisterService.username = username; + DocyzService.ghname = realname; + DocyzService.doctorname = realname; + ShopService.myzh = username; + InService.userna = username; + if (null == user) { + return new Result(400); + } else if(id.equals("医务人员")){ + return new Result(100); + } else if(id.equals("管理员")){ + return new Result(300); + }else { + return new Result(200); + } + } +} + diff --git a/src/controller/RegisterController.java b/src/controller/RegisterController.java new file mode 100644 index 0000000..145d6a0 --- /dev/null +++ b/src/controller/RegisterController.java @@ -0,0 +1,46 @@ +package com.example.hosdata.controller; + + +import com.example.hosdata.pojo.RegisterRecord; +import com.example.hosdata.service.DocyzService; +import com.example.hosdata.service.RegisterService; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.util.HtmlUtils; + +import java.util.List; + +@RestController +public class RegisterController { + @Autowired + RegisterService Reservice; + + @CrossOrigin + @GetMapping("/api/records") + public List list() throws Exception { + return Reservice.listByname(); + } + + @CrossOrigin + @GetMapping("/api/docrecords") + public List listdoc() throws Exception { + return Reservice.list(); + } + + /*@CrossOrigin + @PostMapping("/api/docrecords") + public List searchResult(@RequestParam(value="doctor",required=false) String doctor) { + return Reservice.Search(doctor); + }*/ + + + @CrossOrigin + @PostMapping("/api/register") + public RegisterRecord addOrUpdate(@RequestBody RegisterRecord record) throws Exception { + Reservice.addOrUpdate(record); + return record; + } + +} + diff --git a/src/controller/ShopController.java b/src/controller/ShopController.java new file mode 100644 index 0000000..65955d1 --- /dev/null +++ b/src/controller/ShopController.java @@ -0,0 +1,46 @@ +package com.example.hosdata.controller; + +import com.example.hosdata.pojo.Medicine; +import com.example.hosdata.pojo.RegisterRecord; +import com.example.hosdata.pojo.ShopRecord; +import com.example.hosdata.service.ShopService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +@RestController +public class ShopController { + + @Autowired + ShopService shopService; + + @ResponseBody + @CrossOrigin + @GetMapping(value = "/api/shop") + public List shop() { + return shopService.MedicineList(); + } + + @CrossOrigin + @PostMapping("/api/shop") + public ShopRecord Add(@RequestBody ShopRecord SR) throws Exception { + shopService.addOrUpdate(SR); + return SR; + } + + @CrossOrigin + @PostMapping("/api/Admin") + public Medicine Update(@RequestBody Medicine medicine) throws Exception { + shopService.Update(medicine); + return medicine; + } + + @CrossOrigin + @GetMapping("/api/shoprecords") + public List listbymyzh() throws Exception { + return shopService.listBymyzh(); + } + +} diff --git a/src/controller/ZhuController.java b/src/controller/ZhuController.java new file mode 100644 index 0000000..279da7f --- /dev/null +++ b/src/controller/ZhuController.java @@ -0,0 +1,27 @@ +package com.example.hosdata.controller; +import com.example.hosdata.pojo.Information; +import com.example.hosdata.pojo.RegisterRecord; +import com.example.hosdata.pojo.Zhuce; +import com.example.hosdata.service.DocyzService; +import com.example.hosdata.service.InService; +import com.example.hosdata.service.RegisterService; + +import com.example.hosdata.service.ZhuService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.util.HtmlUtils; + +import java.util.List; + +@RestController +public class ZhuController { + @Autowired + ZhuService zhuService; + + @CrossOrigin + @PostMapping("/api/zhu") + public Zhuce add(@RequestBody Zhuce zhuce) throws Exception { + zhuService.add(zhuce); + return zhuce; + } +} diff --git a/src/dao/DocDAO.java b/src/dao/DocDAO.java new file mode 100644 index 0000000..5b90df4 --- /dev/null +++ b/src/dao/DocDAO.java @@ -0,0 +1,12 @@ +package com.example.hosdata.dao; + +import com.example.hosdata.pojo.Docyz; +import org.springframework.data.jpa.repository.JpaRepository; + +import java.util.List; + +public interface DocDAO extends JpaRepository { + List findByGhname(String ghname); + + List findByDoctorname(String doctorname); +} diff --git a/src/dao/DoctorDAO.java b/src/dao/DoctorDAO.java new file mode 100644 index 0000000..9405b0b --- /dev/null +++ b/src/dao/DoctorDAO.java @@ -0,0 +1,10 @@ +package com.example.hosdata.dao; +import java.util.*; +import com.example.hosdata.pojo.Doctor; +import org.springframework.data.domain.Page; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface DoctorDAO extends JpaRepository { + List findAllByDepartment(String department); + List findAllByDoctorname(String doctorname); +} diff --git a/src/dao/InDAO.java b/src/dao/InDAO.java new file mode 100644 index 0000000..a3207cd --- /dev/null +++ b/src/dao/InDAO.java @@ -0,0 +1,12 @@ +package com.example.hosdata.dao; + +import com.example.hosdata.pojo.Information; +import com.example.hosdata.pojo.RegisterRecord; +import com.example.hosdata.pojo.User; +import org.springframework.data.domain.Page; +import org.springframework.data.jpa.repository.JpaRepository; + +import java.util.List; +public interface InDAO extends JpaRepository{ + List findByUsername(String username); +} diff --git a/src/dao/RegisterDAO.java b/src/dao/RegisterDAO.java new file mode 100644 index 0000000..c1ef457 --- /dev/null +++ b/src/dao/RegisterDAO.java @@ -0,0 +1,15 @@ +package com.example.hosdata.dao; + + +import com.example.hosdata.pojo.RegisterRecord; +import org.springframework.data.domain.Page; +import org.springframework.data.jpa.repository.JpaRepository; + +import java.util.List; + +public interface RegisterDAO extends JpaRepository { + List findByUsername(String username); + + List findByDoctor(String doctor); + +} diff --git a/src/dao/ShopDAO.java b/src/dao/ShopDAO.java new file mode 100644 index 0000000..d0a9c45 --- /dev/null +++ b/src/dao/ShopDAO.java @@ -0,0 +1,10 @@ +package com.example.hosdata.dao; + +import com.example.hosdata.pojo.Medicine; +import org.springframework.data.jpa.repository.JpaRepository; + +import java.util.List; + +public interface ShopDAO extends JpaRepository { + List findAllByPlace(String place); +} diff --git a/src/dao/ShopRecordDAO.java b/src/dao/ShopRecordDAO.java new file mode 100644 index 0000000..55bd1c9 --- /dev/null +++ b/src/dao/ShopRecordDAO.java @@ -0,0 +1,10 @@ +package com.example.hosdata.dao; + +import com.example.hosdata.pojo.Medicine; +import com.example.hosdata.pojo.ShopRecord; +import org.springframework.data.jpa.repository.JpaRepository; + +import java.util.List; +public interface ShopRecordDAO extends JpaRepository { + List findByMyzh(String myzh); +} diff --git a/src/dao/UserDAO.java b/src/dao/UserDAO.java new file mode 100644 index 0000000..f3e1781 --- /dev/null +++ b/src/dao/UserDAO.java @@ -0,0 +1,18 @@ +package com.example.hosdata.dao; +import com.example.hosdata.pojo.User; +import org.springframework.data.jpa.repository.JpaRepository; +import java.util.List; + +public interface UserDAO extends JpaRepository { + User findByUsername(String username); + + User getByUsernameAndPassword(String username,String password); + + User getByIdAndUsernameAndPassword(String id,String username,String password); + + User getByIdAndUsernameAndPasswordAndRealname(String id,String username,String password,String realname); + +} + +//操作数据库的对象,使用了JPA,无需手动构建SQL语句,而只需要按照规范提供方法的名字即可实现对数据库的增删查改 + diff --git a/src/dao/ZhuDAO.java b/src/dao/ZhuDAO.java new file mode 100644 index 0000000..140051d --- /dev/null +++ b/src/dao/ZhuDAO.java @@ -0,0 +1,12 @@ +package com.example.hosdata.dao; + +import com.example.hosdata.pojo.Information; +import com.example.hosdata.pojo.RegisterRecord; +import com.example.hosdata.pojo.User; +import com.example.hosdata.pojo.Zhuce; +import org.springframework.data.domain.Page; +import org.springframework.data.jpa.repository.JpaRepository; + +import java.util.List; +public interface ZhuDAO extends JpaRepository{ +} diff --git a/src/docrecords/DocrecordIndex.vue b/src/docrecords/DocrecordIndex.vue new file mode 100644 index 0000000..3d12977 --- /dev/null +++ b/src/docrecords/DocrecordIndex.vue @@ -0,0 +1,210 @@ + + diff --git a/src/home/Appindex.vue b/src/home/Appindex.vue new file mode 100644 index 0000000..2a0343e --- /dev/null +++ b/src/home/Appindex.vue @@ -0,0 +1,15 @@ + + + + + diff --git a/src/main.js b/src/main.js new file mode 100644 index 0000000..471ed03 --- /dev/null +++ b/src/main.js @@ -0,0 +1,21 @@ +import Vue from 'vue' +import App from './App' +import router from './router' +import ElementUI from 'element-ui' +import 'element-ui/lib/theme-chalk/index.css' + +var axios = require('axios') +axios.defaults.baseURL = 'http://localhost:8443/api' +Vue.prototype.$axios = axios +Vue.config.productionTip = false + +Vue.use(ElementUI) + +/* eslint-disable no-new */ +new Vue({ + el: '#app', + render: h => h(App), + router, + components: { App }, + template: '' +}) diff --git a/src/pojo/Doctor.java b/src/pojo/Doctor.java new file mode 100644 index 0000000..9160784 --- /dev/null +++ b/src/pojo/Doctor.java @@ -0,0 +1,40 @@ +package com.example.hosdata.pojo; +import javax.persistence.*; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + +@Entity +@Table(name = "doctor") +@JsonIgnoreProperties({ "handler","hibernateLazyInitializer" }) + +public class Doctor { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "doctorid") + int doctorid; + + String doctorname; + String department; + String worktime; + + public String getDoctorname() { + return doctorname; + } + public void setDoctorname(String doctorname) { + this.doctorname = doctorname; + } + + public String getDepartment() { + return department; + } + public void setDpartment(String department) { + this.department = department; + } + + public String getWorktime() { + return worktime; + } + public void setWorktime(String worktime) { + this.worktime = worktime; + } +} diff --git a/src/pojo/Docyz.java b/src/pojo/Docyz.java new file mode 100644 index 0000000..d2b62e0 --- /dev/null +++ b/src/pojo/Docyz.java @@ -0,0 +1,76 @@ +package com.example.hosdata.pojo; + +import javax.persistence.*; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + +@Entity +@Table(name = "docyz") +@JsonIgnoreProperties({ "handler","hibernateLazyInitializer" }) + +public class Docyz { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "idnumber") + int idnumber; + + String doctorname; + + String ghname; + int yyh; + String zhengz; + String zhend; + String liaoc; + + + public int getIdnumber() { + return idnumber; + } + public void setIdnumber(int idnumber) { + this.idnumber = idnumber; + } + + public String getDoctorname() { + return doctorname; + } + public void setDoctorname(String doctorname) { + this.doctorname = doctorname; + } + + public String getGhname() { + return ghname; + } + public void setGhname(String ghname) { + this.ghname = ghname; + } + + public int getYyh() { + return yyh; + } + public void setYyh(int yyh) { + this.yyh = yyh; + } + + public String getZhengz() { + return zhengz; + } + public void setZhengz(String zhengz) { + this.zhengz = zhengz; + } + + public String getZhend() { + return zhend; + } + public void setZhend(String zhend) { + this.zhend = zhend; + } + + public String getLiaoc() { + return liaoc; + } + public void setLiaoc(String liaoc) { + this.liaoc = liaoc; + } + +} + diff --git a/src/pojo/Information.java b/src/pojo/Information.java new file mode 100644 index 0000000..968ccb6 --- /dev/null +++ b/src/pojo/Information.java @@ -0,0 +1,52 @@ +package com.example.hosdata.pojo; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + +import javax.persistence.*; + +@Entity +@Table(name = "user") +@JsonIgnoreProperties({"handler","hibernateLazyInitializer"}) + +public class Information { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") + String id; + + String username; + String password; + + String realname; + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getRealname() { + return realname; + } + + public void setRealname(String realname) { + this.realname = realname; + } +} diff --git a/src/pojo/Medicine.java b/src/pojo/Medicine.java new file mode 100644 index 0000000..40ab1b8 --- /dev/null +++ b/src/pojo/Medicine.java @@ -0,0 +1,60 @@ +package com.example.hosdata.pojo; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + +import javax.persistence.*; + +@Entity +@Table(name = "medicine") +@JsonIgnoreProperties({"handler","hibernateLazyInitializer"}) + +public class Medicine { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") + int id; + + String name; + int number; + double price; + + String place; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public int getNumber() {return number;} + + public void setNumber(int number) { + this.number = number; + } + + + public double getPrice() {return price;} + + public void setPrice(double price) { + this.price = price; + } + + public String getPlace() {return place;} + + public void setPlace(String place) { + this.place = place; + } + +} diff --git a/src/pojo/RegisterRecord.java b/src/pojo/RegisterRecord.java new file mode 100644 index 0000000..1032245 --- /dev/null +++ b/src/pojo/RegisterRecord.java @@ -0,0 +1,74 @@ +package com.example.hosdata.pojo; +import javax.persistence.*; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + +@Entity +@Table(name = "register") +@JsonIgnoreProperties({ "handler","hibernateLazyInitializer" }) + +public class RegisterRecord { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "idnum") + int idnum; + + String name; + String department; + String major; + String time; + String doctor; + String username; + + + + public int getIdnum() { + return idnum; + } + public void setIdnum(int idnum) { + this.idnum = idnum; + } + + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + public String getDepartment() { + return department; + } + public void setDepartment(String department) { + this.department = department; + } + + public String getMajor() { + return major; + } + public void setMajor(String major) { + this.major = major; + } + + public String getTime() { + return time; + } + public void setTime(String time) { + this.time = time; + } + + public String getDoctor() { + return doctor; + } + public void setDoctor(String doctor) { + this.doctor = doctor; + } + + public String getUsername() { + return username; + } + public void setUsername(String username) { + this.username = username; + } + +} diff --git a/src/pojo/ShopRecord.java b/src/pojo/ShopRecord.java new file mode 100644 index 0000000..cfe50f1 --- /dev/null +++ b/src/pojo/ShopRecord.java @@ -0,0 +1,48 @@ +package com.example.hosdata.pojo; + +import javax.persistence.*; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + +@Entity +@Table(name = "shoprecord") +@JsonIgnoreProperties({ "handler","hibernateLazyInitializer" }) + +public class ShopRecord { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "mid") + int mid; + + String medicine; + int number; + + String myzh; + + public String getMedicine() { + return medicine; + } + public void setMedicine(String medicine) { + this.medicine = medicine; + } + + public int getNumber() {return number;} + public void setNumber(int number) { + this.number = number; + } + + public int getMid() { + return mid; + } + public void setMid(int mid) { + this.mid = mid; + } + + public String getMyzh() { + return myzh; + } + public void setMyzh(String myzh) { + this.myzh = myzh; + } + +} diff --git a/src/pojo/User.java b/src/pojo/User.java new file mode 100644 index 0000000..c041957 --- /dev/null +++ b/src/pojo/User.java @@ -0,0 +1,52 @@ +package com.example.hosdata.pojo; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + +import javax.persistence.*; + +@Entity +@Table(name = "user") +@JsonIgnoreProperties({"handler","hibernateLazyInitializer"}) + +public class User { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") + String id; + + String username; + String password; + + String realname; + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getRealname() { + return realname; + } + + public void setRealname(String realname) { + this.realname = realname; + } +} diff --git a/src/pojo/Zhuce.java b/src/pojo/Zhuce.java new file mode 100644 index 0000000..9ad6b5a --- /dev/null +++ b/src/pojo/Zhuce.java @@ -0,0 +1,52 @@ +package com.example.hosdata.pojo; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + +import javax.persistence.*; + +@Entity +@Table(name = "user") +@JsonIgnoreProperties({"handler","hibernateLazyInitializer"}) + +public class Zhuce { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id") + String id; + + String username; + String password; + + String realname; + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getRealname() { + return realname; + } + + public void setRealname(String realname) { + this.realname = realname; + } +} diff --git a/src/records/RecordIndex.vue b/src/records/RecordIndex.vue new file mode 100644 index 0000000..344ee7c --- /dev/null +++ b/src/records/RecordIndex.vue @@ -0,0 +1,35 @@ + + + + + diff --git a/src/records/SearchBar.vue b/src/records/SearchBar.vue new file mode 100644 index 0000000..2c971f0 --- /dev/null +++ b/src/records/SearchBar.vue @@ -0,0 +1,34 @@ + + + + + diff --git a/src/records/SideMenu.vue b/src/records/SideMenu.vue new file mode 100644 index 0000000..3702c39 --- /dev/null +++ b/src/records/SideMenu.vue @@ -0,0 +1,52 @@ + + + + + diff --git a/src/records/record.vue b/src/records/record.vue new file mode 100644 index 0000000..94cab3c --- /dev/null +++ b/src/records/record.vue @@ -0,0 +1,64 @@ + + + + + diff --git a/src/register/RegisterIndex.vue b/src/register/RegisterIndex.vue new file mode 100644 index 0000000..dadd6f7 --- /dev/null +++ b/src/register/RegisterIndex.vue @@ -0,0 +1,128 @@ + + + + + diff --git a/src/result/Result.java b/src/result/Result.java new file mode 100644 index 0000000..6cf46ec --- /dev/null +++ b/src/result/Result.java @@ -0,0 +1,19 @@ +package com.example.hosdata.result; + +public class Result { + //响应码 + private int code; + + public Result(int code) { + this.code = code; + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + +} diff --git a/src/router/index.js b/src/router/index.js new file mode 100644 index 0000000..cda5260 --- /dev/null +++ b/src/router/index.js @@ -0,0 +1,123 @@ +import Vue from 'vue' +import Router from 'vue-router' +import AppIndex from '../components/home/AppIndex' +import Login from '../components/Login' +import Home from '../components/Home' +import RegisterIndex from '../components/register/RegisterIndex' +import ShopIndex from '../components/shop/ShopIndex' +import RecordIndex from '../components/records/RecordIndex' +import AdvanceIndex from '../components/advance/AdvanceIndex' +import DocrecordIndex from '../components/docrecords/DocrecordIndex' +import TreatmentIndex from '../components/treatment/TreatmentIndex' +import ShoprecordIndex from '../components/shoprecords/ShoprecordIndex' +import SettingIndex from '../components/setting/SettingIndex' +import ZhuceIndex from '../components/zhu/ZhuceIndex' +import AdminIndex from '../components/Admin/AdminIndex' + +Vue.use(Router) + +export default new Router({ + routes: [ + { + path: '/home', + name: 'Home', + component: Home, + redirect: '/index', + children: [ + { + path: '/index', + name: 'AppIndex', + component: AppIndex, + meta: { + requireAuth: true + } + }, + { + path: '/register', + name: 'RegisterIndex', + component: RegisterIndex, + meta: { + requireAuth: true + } + }, + { + path: '/shop', + name: 'ShopIndex', + component: ShopIndex, + meta: { + requireAuth: true + } + }, + { + path: '/records', + name: 'RecordIndex', + component: RecordIndex, + meta: { + requireAuth: true + } + }, + { + path: '/advance', + name: 'AdvanceIndex', + component: AdvanceIndex, + meta: { + requireAuth: true + } + }, + { + path: '/treatment', + name: 'TreatmentIndex', + component: TreatmentIndex, + meta: { + requireAuth: true + } + }, + { + path: '/shoprecords', + name: 'ShoprecordIndex', + component: ShoprecordIndex, + meta: { + requireAuth: true + } + }, + { + path: '/setting', + name: 'SettingIndex', + component: SettingIndex, + meta: { + requireAuth: true + } + } + ] + }, + { + path: '/docrecords', + name: 'DocrecordIndex', + component: DocrecordIndex, + meta: { + requireAuth: true + } + }, + { + path: '/login', + name: 'Login', + component: Login + }, + { + path: '/zhu', + name: 'ZhuceIndex', + component: ZhuceIndex, + meta: { + requireAuth: true + } + }, + { + path: '/Admin', + name: 'AdminIndex', + component: AdminIndex, + meta: { + requireAuth: true + } + } + ] +}) diff --git a/src/service/DoctorService.java b/src/service/DoctorService.java new file mode 100644 index 0000000..efb6ccc --- /dev/null +++ b/src/service/DoctorService.java @@ -0,0 +1,21 @@ +package com.example.hosdata.service; + +import com.example.hosdata.dao.DoctorDAO; +import com.example.hosdata.pojo.Doctor; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +public class DoctorService { + @Autowired + DoctorDAO doctorDAO; + + public List listByDepartment(String department) { + return doctorDAO.findAllByDepartment(department); + } + + public List listworktime(String doctor) { + return doctorDAO.findAllByDoctorname(doctor); + } +} diff --git a/src/service/DocyzService.java b/src/service/DocyzService.java new file mode 100644 index 0000000..55cff90 --- /dev/null +++ b/src/service/DocyzService.java @@ -0,0 +1,27 @@ +package com.example.hosdata.service; + +import com.example.hosdata.dao.DocDAO; +import com.example.hosdata.pojo.Docyz; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import java.util.List; + +@Service +public class DocyzService { + @Autowired + DocDAO docDAO; + static public String ghname; + static public String doctorname; + + public void addOrUpdate(Docyz doc) { + docDAO.save(doc); + } + + public List listByghname() { + return docDAO.findByGhname(this.ghname); + } + + public List listBydoctorname() { + return docDAO.findByDoctorname(this.doctorname); + } +} diff --git a/src/service/InService.java b/src/service/InService.java new file mode 100644 index 0000000..33bf04b --- /dev/null +++ b/src/service/InService.java @@ -0,0 +1,26 @@ +package com.example.hosdata.service; + +import com.example.hosdata.dao.InDAO; +import com.example.hosdata.dao.RegisterDAO; +import com.example.hosdata.pojo.Information; +import com.example.hosdata.pojo.RegisterRecord; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Sort; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class InService { + @Autowired + InDAO inDAO; + static public String userna; + + public List listbyuser() { + return inDAO.findByUsername(userna); + } + + public void update(Information information) { + inDAO.save(information); + } +} diff --git a/src/service/RegisterService.java b/src/service/RegisterService.java new file mode 100644 index 0000000..0864d07 --- /dev/null +++ b/src/service/RegisterService.java @@ -0,0 +1,35 @@ +package com.example.hosdata.service; + +import com.example.hosdata.dao.RegisterDAO; +import com.example.hosdata.pojo.RegisterRecord; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Sort; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class RegisterService { + @Autowired + RegisterDAO reDAO; + static public String username; + + public List listByname() { + return reDAO.findByUsername(this.username); + } + + public void addOrUpdate(RegisterRecord record) { + reDAO.save(record); + } + + public List list() { + return reDAO.findAll(); + } + + public List Search(String doctor) { + return reDAO.findByDoctor(doctor); + } + +} + + diff --git a/src/service/ShopService.java b/src/service/ShopService.java new file mode 100644 index 0000000..1529aa7 --- /dev/null +++ b/src/service/ShopService.java @@ -0,0 +1,39 @@ +package com.example.hosdata.service; + +import com.example.hosdata.dao.ShopDAO; +import com.example.hosdata.dao.ShopRecordDAO; +import com.example.hosdata.pojo.Medicine; +import com.example.hosdata.pojo.ShopRecord; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class ShopService { + public String place = "药房"; + + static public String myzh; + @Autowired + ShopDAO shopDAO; + + @Autowired + ShopRecordDAO shopRecordDAO; + + public List MedicineList(){ + return shopDAO.findAllByPlace(place); + } + + public void addOrUpdate(ShopRecord shopRecord) { + shopRecordDAO.save(shopRecord); + } + + public void Update(Medicine medicine) { + medicine.setPlace("药房"); + shopDAO.save(medicine); + } + + public List listBymyzh() { + return shopRecordDAO.findByMyzh(this.myzh); + } +} diff --git a/src/service/UserService.java b/src/service/UserService.java new file mode 100644 index 0000000..11d3c0e --- /dev/null +++ b/src/service/UserService.java @@ -0,0 +1,38 @@ +package com.example.hosdata.service; + +import com.example.hosdata.dao.UserDAO; +import com.example.hosdata.pojo.RegisterRecord; +import com.example.hosdata.pojo.User; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class UserService { + @Autowired + UserDAO userDAO; + + public boolean isExist(String username) { + User user = getByName(username); + return null!=user; + } + + public User getByName(String username) { + return userDAO.findByUsername(username); + } + + public User get(String username, String password){ + return userDAO.getByUsernameAndPassword(username, password); + } + + public void add(User user) { + userDAO.save(user); + } + + public User getall(String id, String username, String password, String realname) { + return userDAO.getByIdAndUsernameAndPasswordAndRealname(id,username,password,realname); + } + +} +//在DAO中只定义基础的增删改查操作,而具体操作需要service来完成 diff --git a/src/service/ZhuService.java b/src/service/ZhuService.java new file mode 100644 index 0000000..668682f --- /dev/null +++ b/src/service/ZhuService.java @@ -0,0 +1,23 @@ +package com.example.hosdata.service; + +import com.example.hosdata.dao.InDAO; +import com.example.hosdata.dao.RegisterDAO; +import com.example.hosdata.dao.ZhuDAO; +import com.example.hosdata.pojo.Information; +import com.example.hosdata.pojo.RegisterRecord; +import com.example.hosdata.pojo.Zhuce; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Sort; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class ZhuService { + @Autowired + ZhuDAO zhuDAO; + + public void add(Zhuce zhuce) { + zhuDAO.save(zhuce); + } +} diff --git a/src/setting/SettingIndex.vue b/src/setting/SettingIndex.vue new file mode 100644 index 0000000..79aff7e --- /dev/null +++ b/src/setting/SettingIndex.vue @@ -0,0 +1,147 @@ + + + + + diff --git a/src/shop/ShopIndex.vue b/src/shop/ShopIndex.vue new file mode 100644 index 0000000..4ff9d37 --- /dev/null +++ b/src/shop/ShopIndex.vue @@ -0,0 +1,99 @@ + + + + + diff --git a/src/shoprecords/ShoprecordIndex.vue b/src/shoprecords/ShoprecordIndex.vue new file mode 100644 index 0000000..bf0af64 --- /dev/null +++ b/src/shoprecords/ShoprecordIndex.vue @@ -0,0 +1,56 @@ + + + + + diff --git a/src/treatment/TreatmentIndex.vue b/src/treatment/TreatmentIndex.vue new file mode 100644 index 0000000..df10415 --- /dev/null +++ b/src/treatment/TreatmentIndex.vue @@ -0,0 +1,71 @@ + + + + + diff --git a/src/zhu/ZhuceIndex.vue b/src/zhu/ZhuceIndex.vue new file mode 100644 index 0000000..615f01a --- /dev/null +++ b/src/zhu/ZhuceIndex.vue @@ -0,0 +1,83 @@ + + + + +