增加造数的页面

This commit is contained in:
qiaoxinjiu
2026-04-13 16:42:02 +08:00
commit 3c7f075544
48 changed files with 25781 additions and 0 deletions

12
.babelrc Normal file
View File

@@ -0,0 +1,12 @@
{
"presets": [
["env", {
"modules": false,
"targets": {
"browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
}
}],
"stage-2"
],
"plugins": ["transform-vue-jsx", "transform-runtime"]
}

9
.editorconfig Normal file
View File

@@ -0,0 +1,9 @@
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

14
.gitignore vendored Normal file
View File

@@ -0,0 +1,14 @@
.DS_Store
node_modules/
/dist/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln

10
.postcssrc.js Normal file
View File

@@ -0,0 +1,10 @@
// https://github.com/michael-ciniawsky/postcss-load-config
module.exports = {
"plugins": {
"postcss-import": {},
"postcss-url": {},
// to edit target browsers: use "browserslist" field in package.json
"autoprefixer": {}
}
}

21
README.md Normal file
View File

@@ -0,0 +1,21 @@
# drugmanage
> A Vue.js project
## Build Setup
``` bash
# install dependencies
npm install
# serve with hot reload at localhost:8080
npm run dev
# build for production with minification
npm run build
# build for production and view the bundle analyzer report
npm run build --report
```
For a detailed explanation on how things work, check out the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader).

41
build/build.js Normal file
View File

@@ -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'
))
})
})

54
build/check-versions.js Normal file
View File

@@ -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)
}
}

BIN
build/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

102
build/utils.js Normal file
View File

@@ -0,0 +1,102 @@
'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',
// publicPath: '../../'
})
} 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')
})
}
}

22
build/vue-loader.conf.js Normal file
View File

@@ -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'
}
}

View File

@@ -0,0 +1,82 @@
'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)
}
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: [
{
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'
}
}

95
build/webpack.dev.conf.js Normal file
View File

@@ -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)
}
})
})

145
build/webpack.prod.conf.js Normal file
View File

@@ -0,0 +1,145 @@
'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 = 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: 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 CreateData 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

7
config/dev.env.js Normal file
View File

@@ -0,0 +1,7 @@
'use strict'
const merge = require('webpack-merge')
const prodEnv = require('./prod.env')
module.exports = merge(prodEnv, {
NODE_ENV: '"development"'
})

70
config/index.js Normal file
View File

@@ -0,0 +1,70 @@
'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: {},
// Various Dev Server settings
// host: '172.19.29.63', // can be overwritten by process.env.HOST
host: '0.0.0.0', // can be overwritten by process.env.HOST
port: 8081, // 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-
/**
* 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
}
}

4
config/prod.env.js Normal file
View File

@@ -0,0 +1,4 @@
'use strict'
module.exports = {
NODE_ENV: '"production"'
}

23
index.html Normal file
View File

@@ -0,0 +1,23 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>造数管理系统</title>
<style>
body{
height: 100%;
width: 100%;
padding: 0;
margin: 0;
}
html{
height: 100%;
}
</style>
</head>
<body>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>

21083
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

68
package.json Normal file
View File

@@ -0,0 +1,68 @@
{
"name": "librarymanage",
"version": "1.0.0",
"description": "A Vue.js project",
"author": "",
"private": true,
"scripts": {
"dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
"start": "npm run dev",
"build": "node build/build.js"
},
"dependencies": {
"axios": "^0.19.2",
"element-ui": "^2.13.1",
"npm": "^6.14.5",
"to": "^0.2.9",
"update": "^0.7.4",
"vue": "^2.5.2",
"vue-router": "^3.0.1",
"vuex": "^3.3.0"
},
"devDependencies": {
"autoprefixer": "^7.1.2",
"babel-core": "^6.22.1",
"babel-helper-vue-jsx-merge-props": "^2.0.3",
"babel-loader": "^7.1.1",
"babel-plugin-syntax-jsx": "^6.18.0",
"babel-plugin-transform-runtime": "^6.22.0",
"babel-plugin-transform-vue-jsx": "^3.5.0",
"babel-preset-env": "^1.3.2",
"babel-preset-stage-2": "^6.22.0",
"chalk": "^2.0.1",
"copy-webpack-plugin": "^4.0.1",
"css-loader": "^0.28.0",
"extract-text-webpack-plugin": "^3.0.0",
"file-loader": "^1.1.4",
"friendly-errors-webpack-plugin": "^1.6.1",
"html-webpack-plugin": "^2.30.1",
"node-notifier": "^5.1.2",
"optimize-css-assets-webpack-plugin": "^3.2.0",
"ora": "^1.2.0",
"portfinder": "^1.0.13",
"postcss-import": "^11.0.0",
"postcss-loader": "^2.0.8",
"postcss-url": "^7.2.1",
"rimraf": "^2.6.0",
"semver": "^5.3.0",
"shelljs": "^0.7.6",
"uglifyjs-webpack-plugin": "^1.1.1",
"url-loader": "^0.5.8",
"vue-loader": "^13.3.0",
"vue-style-loader": "^3.0.1",
"vue-template-compiler": "^2.5.2",
"webpack": "^3.6.0",
"webpack-bundle-analyzer": "^2.9.0",
"webpack-dev-server": "^2.9.1",
"webpack-merge": "^4.1.0"
},
"engines": {
"node": ">= 6.0.0",
"npm": ">= 3.0.0"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
]
}

27
src/App.vue Normal file
View File

@@ -0,0 +1,27 @@
<template>
<div id="app">
<router-view/>
</div>
</template>
<script>
import { userGetAdvance } from '@/api/Userapi'
export default {
name: 'App',
mounted() {
const userinfo = JSON.parse(localStorage.getItem('userinfo'))
if (userinfo) {
userGetAdvance({ userId: userinfo.userId }).then(data => {
this.$store.commit('SetRole', data.data.userStatus)
})
}
}
}
</script>
<style>
#app{
height: 100%;
}
</style>

12
src/Config.vue Normal file
View File

@@ -0,0 +1,12 @@
<script>
export default {
name: "onlineConfig",
DATA_MONITOR_SERVER: "http://10.250.200.52:8080/apis/v1"
}
</script>
<style scoped>
</style>

202
src/api/CreateDtapi.js Normal file
View File

@@ -0,0 +1,202 @@
import request from '@/utils/request'
// 造数任务列表
export function ItApiList(params) {
return request({
url: '/it/api/list',
method: 'get',
params
})
}
// 执行造数任务
export function ItApiRun(data) {
return request({
url: '/it/api/execute',
method: 'post',
data
})
}
// 新增/修改造数任务
export function ItApiCreate(data) {
return request({
url: '/it/api/create',
method: 'post',
data
})
}
// 造数任务详情
export function ItApiDetail(params) {
return request({
url: '/it/api/detail',
method: 'get',
params
})
}
// 删除造数任务
export function ItApiDelete(data) {
return request({
url: '/it/api/delete',
method: 'post',
data
})
}
/*造数基础信息模块*/
//对方法的请求参数进行新增获取修改
export function DataAdd(data) {
return request({
url: '/create/data/info/add',
method: 'post',
data
})
}
//刪除造数基本信息
export function DataDelete(data) {
return request({
url: '/create/data/detail/delete',
method: 'post',
data
})
}
//接口请求参数列表页查询
export function DataQuery(data) {
return request({
url: '/create/data/info/page',
method: 'post',
data
})
}
//返回待编辑造数请求信息 (详情页)
export function DataAdvance(data) {
return request({
url: '/create/data/info/getAdvance',
method: 'post',
data
})
}
// 重新获取eureka的ip地址
export function getEureka(data) {
return request({
url: '/get/eureka',
method: 'post',
data
})
}
// 重新获取master代码
export function getGitPull(data) {
return request({
url: '/get/pull/git',
method: 'post',
data
})
}
/*造数请求参数模块*/
//刪除造数请求参数信息
export function InfoDelete(data) {
return request({
url: '/create/data/info/delete',
method: 'post',
data
})
}
//列表查询造数请求参数信息
export function InfoQuery(data) {
return request({
url: '/create/data/detail/page',
method: 'post',
data
})
}
//查找出全部的可用方法与描述进行录库
export function InfoScrapy(data) {
return request({
url: '/create/data/detail/scrapy',
method: 'post',
data
})
}
//运行造数
export function RunCreateData(data) {
return request({
url: '/create/data/run',
method: 'post',
data
})
}
/*造数结果模块*/
//造数结果列表页查询
export function ResultQuery(data) {
return request({
url: '/create/data/result/page',
method: 'post',
data
})
}
//返回待编辑造数结果 (详情页)
export function ResultAdvance(data) {
return request({
url: '/create/data/result/getAdvance',
method: 'post',
data
})
}
/*造数数据字典*/
//增加数据字典
export function DictAdd(data) {
return request({
url: '/add/dict/data',
method: 'post',
data
})
}
//查询数据字典
export function DictQuery(data) {
return request({
url: '/dict/data/page',
method: 'post',
data
})
}
//抓取入库
export function ScrapyDetail(data) {
return request({
url: '/create/data/detail/scrapy',
method: 'post',
data
})
}
/*菜单相关*/
//获取一级菜单名称
export function GetMenu(data) {
return request({
url: '/get/menu/name',
method: 'post',
data
})
}
//获取业务线与业务名称
export function GetTeam(data) {
return request({
url: '/api/get/team/name',
method: 'post',
data
})
}

69
src/api/Userapi.js Normal file
View File

@@ -0,0 +1,69 @@
import request from '@/utils/request'
/*注册模块*/
//注册提交用户名
export function Register(data) {
return request({
url: '/Register',
method: 'post',
data
})
}
/*登录功能*/
//登录
export function Login(data) {
return request({
url: '/Login',
method: 'post',
data
})
}
export function logout() {
return request({
url:'/login/out',
method: 'get'
})
}
//新增用户
export function userAdd(data) {
return request({
url: '/manageSystem/user/add',
method: 'post',
data
})
}
//删除用户
export function userDelete(data) {
return request({
url: '/manageSystem/user/delete',
method: 'post',
data
})
}
//用户列表
export function userQueryAdvance(data) {
return request({
url: '/manageSystem/user/queryAdvance',
method: 'post',
data
})
}
//单个用户详情
export function userGetAdvance(data) {
return request({
url: '/manageSystem/user/getAdvance',
method: 'post',
data
})
}
//修改密码
export function editPassword(data) {
return request({
url: '/manageSystem/user/editPassword',
method: 'post',
data
})
}

54
src/assets/css/Form.css Normal file
View File

@@ -0,0 +1,54 @@
#backgroud {
left: 0;
right: 0;
top: 0;
bottom: 0;
/*margin: auto;*/
width: 100%;
height: 100%;
position: absolute;
background-repeat: no-repeat;
background-size: cover;
background-image: url("https://t4.chei.com.cn/account/images/account/bg.jpg");
/*background-image: url("../../src/assets/loginbackgroud.png");*/
}
.model {
padding: 50px 0;
background: #fff;
color: #333;
border-radius: 3px;
border-color: rgba(250, 255, 251, .8);
box-shadow: inset 0 0 5px rgba(0, 0, 0, .1), 0 0 8px rgba(140, 141, 140, .6);
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
margin: auto;
outline: 0;
width: 500px;
height: max-content;
text-align: center;
}
.location {
margin-left: 178%;
margin-top: 20%;
color: #666;
border-left: 0 solid #ddd;
width: 500px;
height: 70px;
}
.enter-btn {
border: 1px solid #248992;
background: #2eafbb;
/*height: 50px;*/
/*line-height: 50px;*/
/*border-radius: 4px;*/
margin-top: 2%;
font-size: 18px;
color: #fff;
float: left;
width: 320px;
outline: 0;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

View File

@@ -0,0 +1,398 @@
<template>
<el-tabs v-model="activeName">
<el-tab-pane label="菜单管理" name="first">
<keep-alive>
<div class="create-data">
<div class="search">
<el-form :inline="true" class="search" size="small" @submit.native.prevent>
<el-form-item label="业务线">
<el-select
v-model="team_name"
placeholder="请选择业务线"
style="width:160px"
clearable
@change="getTeamName(team_name)">
<el-option v-for="item in dict_data" :key="item.value" :value="item.value" :label="item.label"></el-option>
</el-select>
</el-form-item>
<el-form-item label="" labelWidth="110px">
<el-input v-model="keyword" placeholder="名称" clearable @change="search" @keyup.enter="search"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="search">搜索</el-button>
</el-form-item>
</el-form>
</div>
<div class="api-form">
<el-table ref="table" :data="tableData" :header-cell-style="{ textAlign: 'center' }" :stripe="true" :height="tableHeight" border>
<el-table-column label="业务线" prop="team_name"></el-table-column>
<el-table-column label="业务名称" prop="dict_key"></el-table-column>
<el-table-column label="对应名称" prop="dict_value"></el-table-column>
<el-table-column label="创建时间" prop="created_time">
<template slot-scope="props">
{{ formatTimeValue(props.row.created_time) }}
</template>
</el-table-column>
<el-table-column label="操作">
<template slot-scope="props">
<el-button type="primary" @click.native.prevent="addData(props.row)">修改</el-button>
</template>
</el-table-column>
</el-table>
<el-dialog
:title="dialog.title"
:visible="dialog.dialogVisible"
:close-on-click-modal="false"
width="40%"
@close="cancel">
<el-form :model="dialog.moduleForm" label-width="120px" class="demo-ruleForm">
<el-form-item label="业务名称:">
<span>{{ dialog.moduleForm.dict_key }}</span>
</el-form-item>
<el-form-item label="对应名称:">
<el-input v-model="dialog.moduleForm.dict_value"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click.native.prevent="cancel">取消</el-button>
<el-button type="primary" @click.native.prevent="submit">确定</el-button>
</span>
</el-dialog>
</div>
<div class="block">
<el-pagination
:current-page="pageNo"
:page-size="10"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange">
</el-pagination>
</div>
</div>
</keep-alive>
</el-tab-pane>
<el-tab-pane label="数据管理" name="second">
<div class="search">
<el-form :inline="true" class="search" size="small" @submit.native.prevent>
<el-form-item label="业务线">
<el-select
v-model="manage_team_name"
placeholder="请选择业务线"
style="width:160px"
clearable
@change="manageGetFileName(manage_team_name)">
<el-option v-for="item in dict_data" :key="item.value" :value="item.value" :label="item.label"></el-option>
</el-select>
</el-form-item>
<el-form-item label="业务系统">
<el-select v-model="file_name" placeholder="请选择" style="width:160px" clearable>
<el-option v-for="item in dict_file_data" :key="item.value" :value="item.value" :label="item.label"></el-option>
</el-select>
</el-form-item>
<el-form-item label="" labelWidth="110px">
<el-input v-model="detail_name" placeholder="场景名称" clearable @change="manageSearch" @keyup.enter="manageSearch"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="manageSearch">搜索</el-button>
<el-button type="primary" @click.native.prevent="managePullGit">更新关键字</el-button>
</el-form-item>
</el-form>
</div>
<el-table ref="table" :data="manage_tableData" :header-cell-style="{ textAlign: 'center' }" :stripe="true" :height="tableHeight" border>
<el-table-column label="场景名称" prop="method_function_detail"></el-table-column>
<el-table-column label="业务系统" prop="file_name"></el-table-column>
<el-table-column label="业务线" prop="team_name"></el-table-column>
<el-table-column label="负责人" prop="creator"></el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="props">
<el-button type="text" class="delete_button" @click.native.prevent="manageHandleDelete(props.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-dialog
:title="pullmaster.title"
:visible="pullmaster.dialogVisible"
:close-on-click-modal="false"
width="30%"
@close="manageGitCancel">
<el-form :model="pullmaster.moduleForm" label-width="60px" class="demo-ruleForm">
<el-form-item label="业务线:" label-suffix="*">
<el-select v-model="pullmaster.moduleForm.team" placeholder="请选择">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click.native.prevent="manageGitCancel">取消</el-button>
<el-button type="primary" @click.native.prevent="manageGitSubmit">确定</el-button>
</span>
</el-dialog>
<div class="block">
<el-pagination
:current-page="manage_pageNo"
:page-size="10"
:total="manage_total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="manageHandleSizeChange"
@current-change="manageHandleCurrentChange">
</el-pagination>
</div>
</el-tab-pane>
</el-tabs>
</template>
<script>
import { DataDelete, DictAdd, DictQuery, GetTeam, InfoQuery, ScrapyDetail, getGitPull } from '@/api/CreateDtapi'
import { formatTime } from '@/utils/util'
const defaultDialogForm = () => ({
team_name: '',
data_type: '',
dict_key: '',
dict_value: ''
})
const defaultPullForm = () => ({
team: '',
fileName: '',
username: '',
password: ''
})
export default {
name: 'CreateManage',
data() {
return {
activeName: 'first',
tableHeight: null,
keyword: '',
total: 0,
team_name: '',
tableData: [],
pageNo: 1,
pageSize: 10,
dialog: {
title: '编辑',
dialogVisible: false,
moduleForm: defaultDialogForm()
},
manage_tableData: [],
manage_total: 0,
manage_pageNo: 1,
manage_pageSize: 10,
loading: false,
get_team: '',
manage_team_name: '',
file_name: '',
detail_name: '',
module_name: '',
dict_data: {},
dict_file_data: {},
options: [
{ value: 'CC', label: '销售' },
{ value: 'PBE', label: '公共基础' },
{ value: 'TO', label: '教师' },
{ value: 'TMO', label: '教务' },
{ value: 'USER', label: '用户组' }
],
pullmaster: {
title: '编辑',
dialogVisible: false,
moduleForm: defaultPullForm()
}
}
},
methods: {
formatTimeValue(str) {
return str ? formatTime(str) : ''
},
handleSizeChange(val) {
this.pageSize = val
this.search()
},
handleCurrentChange(val) {
this.pageNo = val
this.search(true)
},
dataList(data) {
DictQuery(data).then(data => {
this.tableData = data.data
this.total = data.totalCount
})
},
getTeamName(team) {
this.pageNo = 1
GetTeam({ data_type: 2, team_name: team }).then(data => {
if (data.code === 200) {
this.dict_data = data.data
}
})
},
search(keepPage) {
if (!keepPage) {
this.pageNo = 1
}
this.dataList({
pageNo: this.pageNo,
pageSize: this.pageSize,
keyword: this.keyword,
team_name: this.team_name
})
},
addData(row) {
this.dialog.dialogVisible = true
this.dialog.title = '修改业务对应展示名称'
this.dialog.moduleForm = { ...row }
},
cancel() {
this.dialog = {
title: '编辑',
dialogVisible: false,
moduleForm: defaultDialogForm()
}
},
submit() {
if (!this.dialog.moduleForm.dict_value) {
this.$message({ type: 'info', message: '请输入名称' })
return
}
DictAdd(this.dialog.moduleForm).then(data => {
if (data.code === 200) {
this.$message({ type: 'success', message: '修改成功!' })
this.cancel()
this.search()
}
})
},
manageHandleSizeChange(val) {
this.manage_pageSize = val
this.manageSearch()
},
manageHandleCurrentChange(val) {
this.manage_pageNo = val
this.manageSearch(true)
},
manageDataList(data) {
InfoQuery(data).then(data => {
this.manage_tableData = data.data
this.manage_total = data.totalCount
})
},
manageSearch(keepPage) {
if (!keepPage) {
this.manage_pageNo = 1
}
this.manageDataList({
pageNo: this.manage_pageNo,
pageSize: this.manage_pageSize,
detail_name: this.detail_name,
team_name: this.manage_team_name,
file_name: this.file_name,
module_name: this.module_name
})
},
manageHandleDelete(row) {
this.$confirm('是否删除该数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
DataDelete({ create_data_detail_id: row.create_data_detail_id }).then(data => {
if (data.code === 200) {
this.$message({ type: 'success', message: '删除成功!' })
this.manageSearch()
}
})
})
},
managePullGit() {
this.pullmaster.dialogVisible = true
this.pullmaster.title = '更新关键字'
},
manageGitCancel() {
this.pullmaster = {
title: '编辑',
dialogVisible: false,
moduleForm: defaultPullForm()
}
},
manageSubmit(team) {
this.pullmaster.moduleForm.team = team
ScrapyDetail(this.pullmaster.moduleForm).then(data => {
this.loading = false
if (data.code === 200) {
this.$message({ type: 'success', message: '更新关键字成功!' })
this.pullmaster.moduleForm = defaultPullForm()
this.manageSearch()
} else {
this.$message({ type: 'error', message: data.message })
}
})
},
loadingShow() {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
setTimeout(() => {
loading.close()
this.pullmaster.dialogVisible = false
this.search()
}, 10000)
},
manageGitSubmit() {
this.loadingShow()
this.get_team = this.pullmaster.moduleForm.team
if (!this.pullmaster.moduleForm.team) {
this.$message({ type: 'info', message: '请输入组名' })
return
}
getGitPull(this.pullmaster.moduleForm).then(data => {
if (data.code === 200) {
this.manageSubmit(this.get_team)
}
})
},
manageGetTeamName(manageTeam) {
this.manage_pageNo = 1
GetTeam({ data_type: 2, team_name: manageTeam }).then(data => {
if (data.code === 200) {
this.dict_data = data.data
}
})
},
manageGetFileName(manageTeam) {
this.manage_pageNo = 1
GetTeam({ data_type: 3, team_name: manageTeam }).then(data => {
if (data.code === 200) {
this.dict_file_data = data.data
}
})
}
},
created() {
this.dataList({ pageNo: 1, pageSize: 10, keyword: '', team_name: '' })
this.manageDataList({ pageNo: 1, pageSize: 10, detail_name: '', team_name: '', file_name: '', module_name: '' })
this.tableHeight = document.getElementById('app').clientHeight - 250
this.getTeamName('')
this.manageGetTeamName('')
}
}
</script>
<style scoped>
.data {
padding-left: 100px;
}
.delete_button {
color: #cf9236;
}
</style>

View File

@@ -0,0 +1,146 @@
<template>
<div class="create-data-info">
<el-card shadow="never">
<div slot="header" class="clearfix">
<span>{{ pageTitle }}</span>
</div>
<el-form v-loading="loading" ref="form" :model="form" :rules="rules" label-width="120px" size="small">
<el-form-item label="项目名称" prop="project">
<el-select v-model="form.project" placeholder="请选择项目" clearable style="width: 320px;">
<el-option
v-for="item in projectOptions"
:key="item"
:label="item"
:value="item">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="运行环境" prop="runEnv">
<el-input v-model="form.runEnv" placeholder="请输入运行环境" style="width: 320px;"></el-input>
</el-form-item>
<el-form-item label="运行分组" prop="runGroup">
<el-input v-model="form.runGroup" placeholder="请输入运行分组" style="width: 320px;"></el-input>
</el-form-item>
<el-form-item label="sql语句" prop="sql">
<el-input
v-model="form.sql"
type="textarea"
:rows="8"
placeholder="请输入 sql 语句">
</el-input>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input
v-model="form.remark"
type="textarea"
:rows="4"
placeholder="请输入备注">
</el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" :loading="saving" @click="submitForm">保存</el-button>
<el-button @click="goBack">返回</el-button>
</el-form-item>
</el-form>
</el-card>
</div>
</template>
<script>
import {ItApiCreate, ItApiDetail} from '@/api/CreateDtapi'
export default {
name: 'CreateDataInfo',
data() {
return {
saving: false,
loading: false,
projectOptions: ['ZHYY', 'DLZ', 'JOYHUB', 'OA', 'APP'],
form: {
project: '',
runEnv: '',
sql: '',
remark: '',
sqlId: '',
runGroup: ''
},
rules: {
project: [{required: true, message: '请选择项目名称', trigger: 'change'}],
runEnv: [{required: true, message: '请输入运行环境', trigger: 'blur'}],
sql: [{required: true, message: '请输入sql语句', trigger: 'blur'}],
runGroup: [{required: true, message: '请输入运行分组', trigger: 'blur'}]
}
}
},
computed: {
pageTitle() {
return this.form.sqlId ? '修改造数任务' : '新增造数任务'
}
},
methods: {
initForm() {
const query = this.$route.query || {}
this.form = {
project: '',
runEnv: '',
sql: '',
remark: '',
sqlId: query.sqlId || query.id || query.create_data_detail_id || '',
runGroup: ''
}
if (this.form.sqlId) {
this.getDetail()
}
},
getDetail() {
this.loading = true
ItApiDetail({sqlId: this.form.sqlId}).then(res => {
const data = res && res.data ? res.data : {}
this.form = {
...this.form,
project: data.project || '',
runEnv: data.runEnv || data.run_env || '',
sql: data.sql || '',
remark: data.remark || '',
sqlId: data.sqlId || data.sql_id || data.id || data.create_data_detail_id || this.form.sqlId,
runGroup: data.runGroup || data.run_group || ''
}
}).catch(err => {
this.$message({type: 'error', message: (err && err.message) || '详情获取失败'})
}).finally(() => {
this.loading = false
})
},
submitForm() {
this.$refs.form.validate(valid => {
if (!valid) {
return false
}
this.saving = true
ItApiCreate(this.form).then(res => {
if (res && res.success === true) {
this.$message({type: 'success', message: this.form.sqlId ? '修改成功' : '新增成功'})
this.$router.push({path: '/create/data'})
} else {
this.$message({type: 'error', message: res.message || '保存失败'})
}
}).finally(() => {
this.saving = false
})
})
},
goBack() {
this.$router.push({path: '/create/data'})
}
},
created() {
this.initForm()
}
}
</script>
<style scoped>
.create-data-info {
padding: 20px;
}
</style>

View File

@@ -0,0 +1,525 @@
<template>
<el-tabs v-model="activeName">
<el-tab-pane label="菜单管理" name="first">
<keep-alive>
<div class="create-data">
<div class="search">
<el-form :inline="true" class="search" size="small" @submit.native.prevent>
<el-form-item label="业务线">
<el-select
v-model="team_name"
placeholder="请选择业务线" @change="get_file_name(team_name)"
style="width:160px"
clearable>
<el-option v-for="item in dict_data" :key="item.value" :value="item.value"
:label="item.label"></el-option>
</el-select>
</el-form-item>
<el-form-item label="" labelWidth="110px">
<el-input placeholder="名称" v-model="keyword" clearable @change="search" @keyup.enter="search">
</el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="search" @keyup.enter="search">搜索</el-button>
</el-form-item>
</el-form>
</div>
<div class="api-form">
<el-table ref="table" :data="tableData" :header-cell-style="{textAlign: 'center'}" :stripe="true" :height="tableHeight" border>
<el-table-column label="业务线" prop="team_name"></el-table-column>
<el-table-column label="业务名称" prop="dict_key"></el-table-column>
<el-table-column label="对应名称" prop="dict_value"></el-table-column>
<el-table-column label="创建时间" prop="created_time">
<template slot-scope="props">
{{ formatTime(props.row.created_time) }}
</template>
</el-table-column>
<el-table-column label="操作">
<template slot-scope="props">
<el-button type="primary" @click.native.prevent="addData(props.row)" style="right: 0">修改</el-button>
</template>
</el-table-column>
</el-table>
<el-dialog
:title="dialog.title"
:visible="dialog.dialogVisible"
:close-on-click-modal="false"
width="40%"
@close="cancel()">
<el-form :model="dialog.moduleForm" ref="dialog.moduleForm" :rules="rules" label-width="120px"
class="demo-ruleForm">
<el-form-item label="业务名称:" prop="module_name">
<span>{{ dialog.moduleForm.dict_key }}</span>
</el-form-item>
<el-form-item label="对应名称:" prop="class_name">
<el-input v-model="dialog.moduleForm.dict_value">{{ dialog.moduleForm.dict_value }}</el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click.native.prevent="cancel()">取消</el-button>
<el-button type="primary" @click.native.prevent="submit">确定</el-button>
</span>
</el-dialog>
</div>
<div class="block">
<span class="demonstration"></span>
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="pageNo"
:page-size="10"
layout="total, sizes, prev, pager, next, jumper"
:total="total">
</el-pagination>
</div>
</div>
</keep-alive>
</el-tab-pane>
<el-tab-pane label="数据管理" name="second">
<div class="search">
<el-form :inline="true" class="search" size="small" @submit.native.prevent>
<el-form-item label="业务线">
<el-select
v-model="manage_team_name"
placeholder="请选择业务线" @change="manage_get_file_name(manage_team_name)"
style="width:160px"
clearable>
<el-option v-for="item in dict_data" :key="item.value" :value="item.value"
:label="item.label"></el-option>
</el-select>
</el-form-item>
<el-form-item label="业务系统">
<el-select
v-model="file_name"
placeholder="请选择"
style="width:160px"
clearable>
<el-option v-for="item in dict_file_data" :key="item.value" :value="item.value"
:label="item.label"></el-option>
</el-select>
</el-form-item>
<el-form-item label="" labelWidth="110px">
<el-input placeholder="场景名称" v-model="detail_name" clearable @change="manage_search()"
@keyup.enter="manage_search()">
</el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="manage_search" @keyup.enter="manage_search">搜索</el-button>
<el-button type="primary" @click.native.prevent="manage_pullGit" style="right: 0">更新关键字</el-button>
</el-form-item>
</el-form>
</div>
<el-table ref="table" :data="manage_tableData" :header-cell-style="{textAlign: 'center'}" :stripe="true" :height="tableHeight" border>
<el-table-column label="场景名称" prop="method_function_detail"></el-table-column>
<el-table-column label="业务系统" prop="file_name"></el-table-column>
<el-table-column label="业务线" prop="team_name"></el-table-column>
<el-table-column label="负责人" prop="creator"></el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="props" >
<el-button type="text" class="delete_button" @click.native.prevent="manage_handleDelete(props.row)">删除
</el-button>
</template>
</el-table-column>
</el-table>
<el-dialog
:title="pullmaster.title"
:visible="pullmaster.dialogVisible"
:close-on-click-modal="false"
width="30%"
@close="manage_gitcancel()"
>
<el-form :model="pullmaster.moduleForm" ref="dialog.scrapy" :rules="rules" label-width="60px"
class="demo-ruleForm">
<el-form-item label="业务线:" prop="baseOrUbrd" label-suffix="*">
<el-select v-model="pullmaster.moduleForm.team" placeholder="请选择">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click.native.prevent="manage_gitcancel()">取消</el-button>
<el-button type="primary" @click.native.prevent="manage_gitsubmit()">确定</el-button>
</span>
</el-dialog>
<div class="block">
<span class="demonstration"></span>
<el-pagination
@size-change="manage_handleSizeChange"
@current-change="manage_handleCurrentChange"
:current-page="manage_pageNo"
:page-size="10"
layout="total, sizes, prev, pager, next, jumper"
:total="manage_total">
</el-pagination>
</div>
</el-tab-pane>
</el-tabs>
</template>
<script>
import {DictAdd, DictQuery, GetTeam} from '@/api/CreateDtapi'
import {
DataAdd,
DataDelete,
DataAdvance,
InfoQuery,
ScrapyDetail,
getEureka,
getGitPull
} from '@/api/CreateDtapi'
import {formatTime} from '@/utils/util'
// import CreateData from '@/components/User/EditPassword'
export default {
name: "CreateManage",
// components: {CreateData},
data() {
return {
roles: [
{
value: 1,
label: '初始路径'
}, {
value: 2,
label: '描述简称'
}
],
activeName: 'first',
tableHeight: null,
keyword: '',
currentPage1: 0,
total: 0,
team_name: '',
tableData: [],
pageNo: 1,
pageSize: 10,
create_dict_data_id: '',
drawer: false,
dialog: {
title: "编辑",
dialogVisible: false,
moduleForm: {
team_name: '',
data_type: '',
dict_key: '',
dict_value: '',
},
},
manage_tableData: [],
manage_total: 0,
manage_pageNo: 1,
manage_pageSize: 10,
loading: false,
get_team: '',
manage_team_name: '',
initial_team_name: '',
file_name: '',
detail_name: '',
module_name: '',
create_data_detail_id: "",
manage_drawer: false,
onfocus_create_data_info_id: '',
dict_data: {},
dict_file_data: {},
options: [{
value: 'CC',
label: '销售'
}, {
value: 'PBE',
label: '公共基础'
}, {
value: 'TO',
label: '教师'
}, {
value: 'TMO',
label: '教务'
}, {
value: 'USER',
label: '用户组'
}],
scrapy: {
title: "编辑",
dialogVisible: false,
moduleForm: {
fileName: '',
team: ''
}
},
pullmaster: {
title: "编辑",
dialogVisible: false,
moduleForm: {
team: '',
fileName: '',
username: '',
password: ''
}
},
}
},
methods: {
formatTime(str) {
if (str === undefined || str === null) {
return ''
} else {
return formatTime(str)
}
},
handleSizeChange(val) {
this.pageSize = val;
this.search()
},
handleCurrentChange(val) {
this.pageNo = val;
this.search(true)
},
dataList(data) {
DictQuery(data).then(data => {
this.tableData = data.data;
this.total = data.totalCount
})
},
get_team_name(team) {
let request_data = {"data_type": 2, "team_name": team}
this.pageNo = 1
GetTeam(request_data).then((data) => {
if (data.code === 200) {
this.dict_data = data.data
}
})
},
search(val) {
if (!val) {
this.pageNo = 1
}
let data = {
pageNo: this.pageNo,
pageSize: this.pageSize,
keyword: this.keyword,
team_name: this.team_name
};
this.dataList(data)
},
openDrawer(row) {
this.drawer = true
this.onfocus_create_data_info_id = row.create_data_info_id
},
closeDrwaer() {
this.drawer = false
},
addData(row) {
this.dialog.dialogVisible = true;
this.dialog.title = "修改业务对应展示名称"
this.dialog.moduleForm = row
},
cancel() {
this.dialog.dialogVisible = false;
this.dialog = {
title: "编辑",
dialogVisible: false,
moduleForm: {
data_type: '',
team_name: '',
dict_key: '',
dict_value: '',
},
}
},
submit() {
// if (this.dialog.moduleForm.dict_key !== '' && this.dialog.moduleForm.dict_value !== '' && this.dialog.moduleForm.data_type !== '') {
if (this.dialog.moduleForm.dict_value !== '') {
console.log(this.dialog.moduleForm, "$$$$")
DictAdd(this.dialog.moduleForm).then((data) => {
if (data.code === 200) {
this.$message({
type: 'success',
message: '修改成功!'
});
this.dialog.dialogVisible = false;
this.search()
}
this.dialog.moduleForm = {
data_type: '',
team_name: '',
dict_key: '',
dict_value: '',
}
})
} else {
this.$message({
type: 'info',
message: "请输入名称"
})
}
},
manage_handleDelete(row) {
let data = {create_data_detail_id: row.create_data_detail_id};
this.$confirm('是否删除该数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
DataDelete(data).then((data) => {
if (data.code === 200) {
this.$message({
type: 'success',
message: '删除成功!'
});
this.manage_search()
}
})
})
},
manage_pullGit() {
this.pullmaster.dialogVisible = true;
this.pullmaster.title = "更新关键字"
},
manage_gitcancel() {
this.pullmaster.dialogVisible = false;
this.pullmaster = {
title: "编辑",
dialogVisible: false,
moduleForm: {
team: '',
fileName: '',
username: '',
password: ''
},
}
},
manage_submit(team) {
this.pullmaster.moduleForm.team = team
ScrapyDetail(this.pullmaster.moduleForm).then((data) => {
this.loading = false;
if (data.code === 200) {
this.$message({
type: 'success',
message: '更新关键字成功!',
});
this.pullmaster.moduleForm = {
team: '',
fileName: '',
username: '',
password: ''
}
this.manage_search()
} else {
this.$message({
type: 'false',
message: data.message
});
}
this.pullmaster.moduleForm = {
team: '',
fileName: '',
username: '',
password: ''
}
})
},
loadingShow() {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
setTimeout(() => {
loading.close();
// this.$message({
// type: 'success',
// message: '更新关键字成功!'
// });
this.pullmaster.dialogVisible = false;
this.search()
}, 10000);
},
manage_gitsubmit() {
this.loadingShow();
this.get_team = this.pullmaster.moduleForm.team
if (this.pullmaster.moduleForm.team !== '') {
getGitPull(this.pullmaster.moduleForm).then((data) => {
if (data.code === 200) {
this.manage_submit(this.get_team)
}
})
} else {
this.$message({
type: 'info',
message: "请输入组名"
})
}
},
manage_handleSizeChange(val) {
this.manage_pageSize = val;
this.manage_search()
},
manage_handleCurrentChange(val) {
this.manage_pageNo = val;
this.manage_search(true)
},
manage_dataList(data) {
InfoQuery(data).then(data => {
this.manage_tableData = data.data;
this.manage_total = data.totalCount
})
},
manage_search(val) {
if (!val) {
this.manage_pageNo = 1
}
let data = {
pageNo: this.manage_pageNo,
pageSize: this.manage_pageSize,
detail_name: this.detail_name,
team_name: this.manage_team_name,
file_name: this.file_name,
module_name: this.module_name
};
this.manage_dataList(data)
},
manage_get_team_name(manage_team) {
let request_data = {"data_type": 2, "team_name": manage_team}
this.manage_pageNo = 1
GetTeam(request_data).then((data) => {
if (data.code === 200) {
this.dict_data = data.data
}
})
},
manage_get_file_name(manage_team) {
let request_data = {"data_type": 3, "team_name": manage_team}
this.manage_pageNo = 1
GetTeam(request_data).then((data) => {
if (data.code === 200) {
this.dict_file_data = data.data
}
})
},
},
created() {
let data = {pageNo: 1, pageSize: 10, keyword: "", team_name: ""}
this.dataList(data)
let manage_data = {pageNo: 1, pageSize: 10, detail_name: "", team_name: "", file_name: "", module_name: ""}
this.manage_dataList(manage_data)
this.tableHeight = document.getElementById("app").clientHeight - 250
let team = ""
this.get_team_name(team)
this.manage_get_team_name(team)
}
}
</script>
<style scoped>
.data {
padding-left: 100px;
}
.delete_button{
color: #cf9236;
}
</style>

View File

@@ -0,0 +1,377 @@
<template>
<div class="create-data">
<div class="search">
<el-form :inline="true" :model="queryForm" class="search" size="small" @submit.native.prevent>
<el-form-item label="项目">
<el-select
v-model="queryForm.project"
placeholder="请选择项目"
clearable
filterable>
<el-option
v-for="item in projectOptions"
:key="item"
:label="item"
:value="item">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="环境">
<el-input
v-model="queryForm.runEnv"
placeholder="请输入环境"
clearable
@keyup.enter.native="search()">
</el-input>
</el-form-item>
<el-form-item label="创建人">
<el-input
v-model="queryForm.creator"
placeholder="请输入创建人"
clearable
@keyup.enter.native="search()">
</el-input>
</el-form-item>
<el-form-item label="分组">
<el-input
v-model="queryForm.runGroup"
placeholder="请输入分组"
clearable
@keyup.enter.native="search()">
</el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="search">搜索</el-button>
<el-button @click="resetSearch">重置</el-button>
<el-button type="success" @click="addTask">新增</el-button>
</el-form-item>
</el-form>
</div>
<div class="api-form">
<el-table
ref="table"
v-loading="loading"
:data="tableData"
:header-cell-style="{textAlign: 'center'}"
:stripe="true"
:height="tableHeight"
border>
<el-table-column label="项目名称" prop="project" min-width="150"></el-table-column>
<el-table-column label="运行环境" prop="run_env" width="120"></el-table-column>
<el-table-column label="运行分组" prop="run_group" min-width="150"></el-table-column>
<el-table-column label="SQL语句" prop="sql" min-width="220">
<template slot-scope="props">
<el-tooltip v-if="props.row.sql && props.row.sql.length > 40" :content="props.row.sql" placement="top">
<span>{{ formatSql(props.row.sql) }}</span>
</el-tooltip>
<span v-else>{{ props.row.sql || '-' }}</span>
</template>
</el-table-column>
<el-table-column label="备注" prop="remark" min-width="180" :show-overflow-tooltip="true"></el-table-column>
<el-table-column label="创建人" prop="creator" width="120"></el-table-column>
<el-table-column label="创建时间" prop="created_time" min-width="170"></el-table-column>
<el-table-column label="操作" align="center" width="280" fixed="right">
<template slot-scope="props">
<el-button type="text" @click="editTask(props.row)">编辑</el-button>
<el-button type="text" @click="viewDetail(props.row)">查看详情</el-button>
<el-button type="text" style="color: #F56C6C;" @click="deleteTask(props.row)">删除</el-button>
<el-button type="text" :loading="runningId === getRowId(props.row)" @click="runTask(props.row)">执行</el-button>
</template>
</el-table-column>
</el-table>
</div>
<div class="block">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="pageNo"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="total">
</el-pagination>
</div>
<el-dialog title="任务详情" :visible.sync="detailVisible" width="60%">
<el-table v-if="detailRow" :data="detailItems" border>
<el-table-column label="字段" prop="key" width="180"></el-table-column>
<el-table-column label="值" prop="value" :show-overflow-tooltip="true"></el-table-column>
</el-table>
</el-dialog>
<el-dialog title="执行结果" :visible.sync="executeVisible" width="60%">
<pre class="execute-result" v-html="executeResult"></pre>
</el-dialog>
</div>
</template>
<script>
import {ItApiDelete, ItApiDetail, ItApiList, ItApiRun} from '@/api/CreateDtapi'
export default {
name: "CreateManage",
data() {
return {
tableHeight: null,
total: 0,
tableData: [],
pageNo: 1,
pageSize: 10,
loading: false,
runningId: '',
detailVisible: false,
detailRow: null,
executeVisible: false,
executeResult: '',
queryForm: {
project: '',
runEnv: '',
creator: '',
runGroup: ''
},
projectOptions: ['ZHYY', 'DLZ', 'JOYHUB', 'OA', 'APP']
}
},
computed: {
detailItems() {
if (!this.detailRow) {
return []
}
const fieldMap = [
{label: '项目名称', keys: ['project']},
{label: '运行环境', keys: ['runEnv', 'run_env']},
{label: '运行分组', keys: ['runGroup', 'run_group']},
{label: 'SQL语句', keys: ['sql']},
{label: '备注', keys: ['remark']},
{label: '创建时间', keys: ['createdTime', 'created_time']},
{label: '更新时间', keys: ['updatedTime', 'updated_time']}
]
return fieldMap.reduce((list, item) => {
const value = this.getDetailValue(item.keys)
if (value === '') {
return list
}
list.push({
key: item.label,
value
})
return list
}, [])
}
},
methods: {
handleSizeChange(val) {
this.pageSize = val
this.search()
},
handleCurrentChange(val) {
this.pageNo = val
this.search(true)
},
getList() {
this.loading = true
ItApiList(this.buildParams()).then(res => {
const data = res.data || {}
this.tableData = data.list || []
this.total = data.total || data.totalCount || res.total || res.totalCount || this.tableData.length
}).finally(() => {
this.loading = false
})
},
buildParams() {
const params = {
pageNo: this.pageNo,
pageSize: this.pageSize
}
Object.keys(this.queryForm).forEach(key => {
const value = this.queryForm[key]
if (value !== '') {
params[key] = value
}
})
return params
},
search(keepPage) {
if (!keepPage) {
this.pageNo = 1
}
this.getList()
},
resetSearch() {
this.queryForm = {
project: '',
runEnv: '',
creator: '',
runGroup: ''
}
this.search()
},
addTask() {
this.$router.push({path: '/create/info'})
},
editTask(row) {
const sqlId = this.getRowId(row)
if (!sqlId) {
this.$message({type: 'error', message: '缺少sqlId无法编辑'})
return
}
this.$router.push({path: '/create/info', query: {sqlId}})
},
viewDetail(row) {
const sqlId = this.getRowId(row)
if (!sqlId) {
this.$message({type: 'error', message: '缺少sqlId无法查看详情'})
return
}
this.loading = true
ItApiDetail({sqlId}).then(res => {
const data = res && res.data ? res.data : {}
this.detailRow = data
this.detailVisible = true
}).finally(() => {
this.loading = false
})
},
deleteTask(row) {
const sqlId = this.getRowId(row)
if (!sqlId) {
this.$message({type: 'error', message: '缺少sqlId无法删除'})
return
}
this.$confirm('确认删除该条记录吗?', '提示', {
type: 'warning'
}).then(() => {
ItApiDelete({sqlId: Number(sqlId) || sqlId}).then(res => {
if (res && res.success === true) {
this.$message({type: 'success', message: '删除成功'})
if (this.tableData.length === 1 && this.pageNo > 1) {
this.pageNo = this.pageNo - 1
}
this.getList()
} else {
this.$message({type: 'error', message: res.message || '删除失败'})
}
})
}).catch(() => {})
},
runTask(row) {
const sqlId = this.getRowId(row)
if (!sqlId) {
this.$message({type: 'error', message: '缺少sqlId无法执行'})
return
}
this.runningId = sqlId
ItApiRun({sqlId}).then(res => {
this.executeResult = this.formatJsonHtml(res && res.data)
this.executeVisible = true
}).catch(err => {
this.$message({type: 'error', message: (err && err.message) || '执行失败'})
}).finally(() => {
this.runningId = ''
})
},
escapeHtml(value) {
return String(value)
.replace(/&/g, '&amp;')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
},
syntaxHighlight(json) {
return this.escapeHtml(json).replace(/("(?:\\u[a-fA-F0-9]{4}|\\[^u]|[^\\"])*"\s*:?)|(\btrue\b|\bfalse\b)|(\bnull\b)|(-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g, (match) => {
let className = 'json-number'
if (/^"/.test(match)) {
className = /:$/.test(match) ? 'json-key' : 'json-string'
} else if (/true|false/.test(match)) {
className = 'json-boolean'
} else if (/null/.test(match)) {
className = 'json-null'
}
return '<span class="' + className + '">' + match + '</span>'
})
},
formatJsonHtml(value) {
if (typeof value === 'string') {
try {
return this.syntaxHighlight(JSON.stringify(JSON.parse(value), null, 2))
} catch (e) {
return this.syntaxHighlight(value)
}
}
return this.syntaxHighlight(JSON.stringify(value || {}, null, 2))
},
getRowId(row) {
return String(row.sqlId || row.sql_id || row.id || row.create_data_detail_id || row.createDataDetailId || row.apiId || '')
},
formatSql(sql) {
if (!sql) {
return '-'
}
return sql.length > 40 ? sql.substring(0, 40) + '...' : sql
},
getDetailValue(keys) {
for (let i = 0; i < keys.length; i++) {
const value = this.detailRow[keys[i]]
if (value !== null && typeof value !== 'undefined' && value !== '') {
return this.formatValue(value)
}
}
return ''
},
formatValue(value) {
if (value === null || typeof value === 'undefined') {
return ''
}
if (typeof value === 'object') {
return JSON.stringify(value)
}
return String(value)
}
},
created() {
this.tableHeight = document.getElementById("app").clientHeight - 183
this.getList()
}
}
</script>
<style scoped>
.api-form {
text-align: center;
}
.execute-result {
max-height: 500px;
overflow: auto;
margin: 0;
padding: 16px;
background: #0f172a;
border-radius: 6px;
white-space: pre-wrap;
word-break: break-all;
text-align: left;
color: #e2e8f0;
line-height: 1.6;
}
.execute-result ::v-deep .json-key {
color: #93c5fd;
}
.execute-result ::v-deep .json-string {
color: #86efac;
}
.execute-result ::v-deep .json-number {
color: #f9a8d4;
}
.execute-result ::v-deep .json-boolean {
color: #fcd34d;
}
.execute-result ::v-deep .json-null {
color: #c4b5fd;
}
</style>

View File

@@ -0,0 +1,90 @@
<template>
<div class="create-data">
<el-container>
<el-header>
<p class="create-result-info">造数结果:</p>
</el-header>
<el-main>
<span class="api-module-message-value">组名: {{ dialog.moduleForm.team_name }} </span>
<span class="api-module-message-value">类名: {{ dialog.moduleForm.class_name }} </span>
<span class="api-module-message-value">方法名: {{ dialog.moduleForm.method_name }} </span>
<br><br>
<span class="api-module-message-value">请求参数:<br> {{ dialog.moduleForm.request_parameter }} </span>
<br><br>
<span class="api-module-message-value">描述: {{ dialog.moduleForm.method_function_detail }} </span>
<!-- <span class="api-module-message-value">结果: {{ dialog.moduleForm.result_info }} </span>-->
</el-main>
<el-footer>
<span class="create-result-data">结果: <br>{{ dialog.moduleForm.result_info }} </span>
</el-footer>
</el-container>
</div>
</template>
<script>
import { ResultAdvance } from '@/api/CreateDtapi'
export default {
name: 'CreateResult',
data() {
return {
create_data_result_id: '',
dialog: {
moduleForm: {
team_name: '',
class_name: '',
method_name: '',
request_parameter: '',
method_function_detail: '',
result_info: ''
}
}
}
},
methods: {
getDetail() {
ResultAdvance({ create_data_result_id: this.create_data_result_id }).then(data => {
this.dialog.moduleForm = data.data
})
}
},
mounted() {
this.create_data_result_id = this.$route.query.create_data_result_id
this.getDetail()
}
}
</script>
<style scoped>
.data {
padding-left: 100px;
}
.create-result-info{
text-align: center;
font-family: 华文仿宋;
font-size: 30px;
}
.api-module-message-value {
color: #195fd9;
font-family: 华文楷体;
white-space: pre-wrap;
}
.create-result-data{
color: #ec1270;
font-size: 20px;
font-family: 华文楷体;
white-space: pre-wrap;
}
.api-data {
white-space: pre-wrap;
}
.form-button {
margin-top: 20px;
text-align: center;
bottom: 0;
}
</style>

View File

@@ -0,0 +1,226 @@
<template>
<div class="create-data">
<div class="search">
<el-form :inline="true" class="search" size="small" @submit.native.prevent>
<el-form-item label="业务线">
<el-select
v-model="team_name"
placeholder="请选择业务线"
style="width:160px"
clearable
@change="pageNo = 1">
<el-option v-for="item in dict_data" :key="item.value" :value="item.value" :label="item.label"></el-option>
</el-select>
</el-form-item>
<el-form-item label="" labelWidth="110px">
<el-input v-model="detail_name" placeholder="场景名称" clearable @change="search" @keyup.enter="search"></el-input>
</el-form-item>
<el-form-item label="" labelWidth="110px">
<el-input v-model="get_tag" placeholder="备注" clearable @change="search" @keyup.enter="search"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="search" @keyup.enter="search">搜索</el-button>
</el-form-item>
</el-form>
</div>
<div class="api-form">
<el-table
ref="table"
:data="tableData"
:header-cell-style="{ textAlign: 'center' }"
:stripe="true"
:height="tableHeight"
border>
<el-table-column label="场景名称" prop="method_function_detail"></el-table-column>
<el-table-column label="请求参数" prop="request_parameter" :show-overflow-tooltip="true"></el-table-column>
<el-table-column label="结果数据" prop="result_info" :show-overflow-tooltip="true"></el-table-column>
<el-table-column label="业务线" prop="team_name"></el-table-column>
<el-table-column label="创建时间" prop="created_time">
<template slot-scope="props">
{{ formatTimeValue(props.row.created_time) }}
</template>
</el-table-column>
<el-table-column label="备注" prop="tag"></el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="props">
<el-button type="text" @click.native.prevent="openResult(props.row)">查看详情</el-button>
<el-button type="text" @click.native.prevent="tryRunCreateData(props.row)">再来一次</el-button>
</template>
</el-table-column>
</el-table>
<el-dialog title="造数结果" :visible.sync="result_dialog.dialogVisible" width="50%">
<div v-if="is_json">
<JsonView :json="JsonData"></JsonView>
</div>
<div v-else>
<span>{{ result_dialog.result_info }}</span>
</div>
</el-dialog>
</div>
<div class="block">
<el-pagination
:current-page="pageNo"
:page-size="10"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange">
</el-pagination>
</div>
</div>
</template>
<script>
import { GetTeam, ResultAdvance, ResultQuery } from '@/api/CreateDtapi'
import JsonView from '@/components/formateJson/JsonView'
import { formatTime } from '@/utils/util'
export default {
name: 'CreateResultList',
components: { JsonView },
data() {
return {
tableHeight: null,
team_name: '',
detail_name: '',
get_tag: '',
total: 0,
is_json: '',
tableData: [],
dict_data: {},
pageNo: 1,
pageSize: 10,
JsonData: '',
result_dialog: {
dialogVisible: false,
result_info: ''
}
}
},
methods: {
formatTimeValue(str) {
return str ? formatTime(str) : ''
},
handleSizeChange(val) {
this.pageSize = val
this.search()
},
handleCurrentChange(val) {
this.pageNo = val
this.search(true)
},
dataList(data) {
ResultQuery(data).then(data => {
this.tableData = data.data
this.total = data.totalCount
})
},
search(keepPage) {
if (!keepPage) {
this.pageNo = 1
}
this.dataList({
pageNo: this.pageNo,
pageSize: this.pageSize,
team_name: this.team_name || '',
detail_name: this.detail_name || '',
get_tag: this.get_tag || ''
})
},
resetResultDialog() {
this.result_dialog = {
dialogVisible: false,
result_info: ''
}
this.JsonData = ''
this.is_json = ''
},
getJsonData(val) {
try {
this.JsonData = JSON.parse(val)
} catch (e) {
this.JsonData = e.toString()
}
},
openResult(row) {
this.result_dialog.dialogVisible = true
ResultAdvance({ create_data_result_id: row.create_data_result_id }).then(data => {
if (data.code === 200) {
this.result_dialog.result_info = data.data.result_info
this.is_json = data.data.is_json
this.getJsonData(data.data.result_info)
} else {
this.result_dialog.result_info = data.message
}
}).catch(() => {
this.resetResultDialog()
})
},
tryRunCreateData(row) {
this.$router.push({
path: '/create/info',
query: {
create_data_detail_id: row.create_data_detail_id,
create_data_result_id: row.create_data_result_id
}
})
},
getTeamName(team) {
GetTeam({ data_type: 2, team_name: team }).then(data => {
if (data.code === 200) {
this.dict_data = data.data
}
})
}
},
created() {
this.team_name = this.$route.query.team_name || ''
this.detail_name = this.$route.query.method_function_detail || ''
this.get_tag = this.$route.query.get_tag || ''
this.dataList({
pageNo: 1,
pageSize: 10,
team_name: this.team_name,
detail_name: this.detail_name,
get_tag: this.get_tag
})
this.tableHeight = document.getElementById('app').clientHeight - 183
this.getTeamName('')
}
}
</script>
<style scoped>
.data {
padding-left: 100px;
}
pre {
outline: 1px solid #ccc;
padding: 5px;
margin: 5px;
}
.string {
color: green;
}
.number {
color: darkorange;
}
.boolean {
color: blue;
}
.null {
color: magenta;
}
.key {
color: red;
}
</style>

View File

@@ -0,0 +1,17 @@
<template>
<div style="margin-top: 20px;margin-right: 20px;margin-left: 20px">
<el-breadcrumb separator="/" class="el-breadcrumb-div">
<el-breadcrumb-item :to="{ path: '/dashboard' }">数据监控</el-breadcrumb-item>
<el-breadcrumb-item>数据分析</el-breadcrumb-item>
</el-breadcrumb>
</div>
</template>
<style>
</style>
<script>
export default {
name: 'DataAnalysis'
}
</script>

View File

@@ -0,0 +1,481 @@
<template>
<div style="margin-top: 20px;margin-right: 20px;margin-left: 20px">
<el-breadcrumb separator="/" class="el-breadcrumb-div">
<el-breadcrumb-item :to="{ path: '/dashboard' }">数据监控</el-breadcrumb-item>
<el-breadcrumb-item>问题列表</el-breadcrumb-item>
</el-breadcrumb>
<div class="searchReport">
<el-form
label-width="70px"
labelPosition="right"
class="el-form"
:inline="true"
style="
float:left;
height:50px;
margin-top:30px;"
>
<el-form-item label="业务线">
<el-select
v-model="elSelectBusinessLine.id"
placeholder="请选择业务线"
style="width:160px"
clearable>
<el-option v-for="item in businessInfo" :key="item.id" :value="item.id"
:label="item.business_line_name"></el-option>
</el-select>
</el-form-item>
<el-form-item
label="监控类型">
<el-select
v-model="elSelectMonitorType.id"
placeholder="请选择监控类型"
style="float:left;margin-bottom:20px;width:160px"
clearable>
<el-option v-for="item in monitorTypeInfo" :key="item.id" :value="item.id"
:label="item.type_name"></el-option>
</el-select>
</el-form-item>
<el-form-item
label="修复状态">
<el-select
v-model="elSelectIsFix.id"
placeholder="请选择修复状态"
style="float:left;margin-bottom:20px;width:160px"
clearable>
<el-option v-for="item in is_fix" :key="item.id" :value="item.id"
:label="item.desc"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type="primary"
@click="searchMonitorBugInfo"
size="small"
style="margin-left:15px">查询
</el-button>
</el-form-item>
</el-form>
</div>
<div>
<el-table
:data="tableData"
type="flex"
style="
width: 100%;
margin-top:30px;
font-size:14px;"
max-height="100%"
row-class-name="rowClass"
:header-cell-style="headerTable">
<el-table-column
prop="id"
label="ID"
min-width="10%"
align="center">
</el-table-column>
<el-table-column
prop="monitor_case_name"
label="描述"
min-width="20%"
align="left"
:show-overflow-tooltip='true'>
</el-table-column>
<el-table-column
prop="abnormal_content"
label="问题数据"
min-width="40%"
align="left"
:show-overflow-tooltip='true'>
</el-table-column>
<el-table-column
label="状态"
min-width="10%"
align="center"
:show-overflow-tooltip='true'>
<template slot-scope="scope">
<el-tag v-if="scope.row.is_fix===2" type="success">{{ scope.row.is_fix_desc }}</el-tag>
<el-tag v-else-if="scope.row.is_fix===1" type="success">{{ scope.row.is_fix_desc }}</el-tag>
<el-tag v-else type="warning">{{ scope.row.is_fix_desc }}</el-tag>
</template>
</el-table-column>
<el-table-column
prop="qa"
label="QA"
min-width="15%"
align="center"
:show-overflow-tooltip='true'>
</el-table-column>
<el-table-column
prop="remarks"
label="备注"
min-width="20%"
align="center"
:show-overflow-tooltip='true'>
</el-table-column>
<el-table-column
prop="create_time"
label="创建日期"
min-width="20%"
align="center"
:show-overflow-tooltip='true'>
</el-table-column>
<el-table-column
label="操作"
align="center"
min-width="20%">
<template slot-scope="scope">
<el-button
size="mini"
@click="monitor_bug_detail(scope.row)">查看处理
</el-button>
</template>
</el-table-column>
</el-table>
</div>
<div style="margin-top:30px">
<el-pagination
background
style="text-align: center"
layout="prev, pager, next"
@current-change="handleCurrentChange"
:current-page.sync="currentPage"
:total="total">
</el-pagination>
</div>
<el-dialog
title="问题详细信息"
:visible.sync="dialogVisible"
width=50%>
<el-row :gutter="20">
<el-col :span="5">
<div class="grid-content bg-purple-right"><span class="span-right">业务线</span></div>
</el-col>
<el-col :span="7">
<div class="grid-content bg-purple-left">{{ monitor_bug_detail_info.business_line_name }}</div>
</el-col>
<el-col :span="5">
<div class="grid-content bg-purple-right"><span class="span-right">告警次数</span></div>
</el-col>
<el-col :span="7">
<div class="grid-content bg-purple-left">{{ monitor_bug_detail_info.count }}</div>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="5">
<div class="grid-content bg-purple-right"><span class="span-right">用例名称</span></div>
</el-col>
<el-col :span="19">
<div class="grid-content bg-purple-left">{{ monitor_bug_detail_info.monitor_case_name }}</div>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="5">
<div class="grid-content bg-purple-right"><span class="span-right">函数方法名</span></div>
</el-col>
<el-col :span="19">
<div class="grid-content bg-purple-left">{{ monitor_bug_detail_info.monitor_case_method }}</div>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="5">
<div class="grid-content bg-purple-right"><span class="span-right">问题数据</span></div>
</el-col>
<el-col :span="19">
<div class="grid-content bg-purple-left">{{ monitor_bug_detail_info.abnormal_content }}</div>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="5">
<div class="grid-content bg-purple-right"><span class="span-right">当前状态</span></div>
</el-col>
<el-col :span="19">
<el-select
v-model="monitor_bug_detail_info.is_fix_id"
placeholder="请选择状态"
clearable>
<el-option v-for="item in is_fix" :key="item.id" :value="item.id" :label="item.desc"></el-option>
</el-select>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="5">
<div class="grid-content bg-purple-right"><span class="span-right">原因分类</span></div>
</el-col>
<el-col :span="19">
<el-select
v-model="monitor_bug_detail_info.case_reason_id"
placeholder="请选择原因"
clearable>
<el-option v-for="item in case_reason_desc_dict" :key="item.id" :value="item.id"
:label="item.desc"></el-option>
</el-select>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="5">
<div class="grid-content bg-purple-right"><span class="span-right">JIRA编号</span></div>
</el-col>
<el-col :span="19">
<el-input
v-model="monitor_bug_detail_info.jira_id"
placeholder="请填写提交的jira编号"
clearable></el-input>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="5">
<div class="grid-content bg-purple-right"><span class="span-right">备注</span></div>
</el-col>
<el-col :span="19">
<el-input
v-model="monitor_bug_detail_info.remarks"
placeholder="请填写您分析的原因"
clearable></el-input>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="5">
<div class="grid-content bg-purple-right"><span class="span-right">处理人员</span></div>
</el-col>
<el-col :span="19">
<el-input
v-model="monitor_bug_detail_info.fix_owner"
placeholder="请填写问题解决人员,多个人员英文逗号分割"
clearable></el-input>
</el-col>
</el-row>
<el-row style="margin-top: 40px;margin-left: 40px">
<el-button
type="primary"
@click="clickSave"
size="small"
style="float: left;">保存
</el-button>
<el-button
size="small"
style="float: left;margin-left:50px;"
@click="dialogVisible = false">取消
</el-button>
</el-row>
</el-dialog>
</div>
</template>
<style>
.searchReport {
width: 100%;
height: 100px;
background-color: #F2F6FC;
margin-top: 30px;
}
.bg-purple-right {
text-align: right;
/*background-color: #F1F1EE;*/
}
.span-right {
color: black;
margin-right: 8px;
font-weight: 600;
letter-spacing: 3px;
}
.bg-purple-left {
text-align: left;
}
.grid-content {
border-radius: 4px;
min-height: 40px;
line-height: 40px;
margin-top: 6px;
}
</style>
<script>
import Config from "../../Config";
export default {
name: "CoverageReport",
mounted: function () {
this.initPage()
},
methods: {
initPage() {
//问题数据
this.$axios({
method: 'get',
url: Config.DATA_MONITOR_SERVER + '/data_monitor_server/monitor-abnormal-record',
params: {page: 1, limit: 10, ordering: '-create_time'}
}).then(response => {
if (response.data.errcode !== 20000) {
this.$message({
message: response.data.errmsg,
type: "error"
})
return
}
this.tableData = response.data.data.data_list
this.total = response.data.data.total
})
this.$axios({
method: 'get',
url: Config.DATA_MONITOR_SERVER + '/data_monitor_server/business-info',
params: {page: 1, limit: 100}
}).then(response => {
if (response.data.errcode !== 20000) {
this.$message({
message: response.data.errmsg,
type: "error"
})
return
}
this.businessInfo = response.data.data.data_list
})
//获取监控类型
this.$axios({
method: 'get',
url: Config.DATA_MONITOR_SERVER + '/data_monitor_server/monitor-data-type',
params: {page: 1, limit: 100}
}).then(response => {
if (response.data.errcode !== 20000) {
this.$message({
message: response.data.errmsg,
type: "error"
})
return
}
this.monitorTypeInfo = response.data.data.data_list
})
},
handleCurrentChange() {
const dataJson = {
business_line_id: this.elSelectBusinessLine.id,
monitor_data_type: this.elSelectMonitorType.id,
is_fix: this.elSelectIsFix.id,
page: this.currentPage,
ordering: '-create_time',
limit: 10
}
this.search(dataJson)
},
searchMonitorBugInfo() {
const dataJson = {
business_line_id: this.elSelectBusinessLine.id,
monitor_data_type: this.elSelectMonitorType.id,
is_fix: this.elSelectIsFix.id,
page: 1,
ordering: '-create_time',
limit: 10
}
this.search(dataJson)
},
search(dataJson) {
this.$axios({
method: 'get',
url: Config.DATA_MONITOR_SERVER + '/data_monitor_server/monitor-abnormal-record',
params: dataJson
}).then(response => {
if (response.data.errcode !== 20000) {
this.$message({
message: response.data.errmsg,
type: "error"
})
return
}
this.tableData = response.data.data.data_list
this.currentPage = dataJson.page
this.total = response.data.data.total
})
},
headerTable() {
return 'background:#f5f6fa;color:rgba(0,0,0,.65);font-weight: 500'
},
monitor_bug_detail(rowData) {
this.dialogVisible = true
this.monitor_bug_detail_info.id = rowData.id
this.monitor_bug_detail_info.business_line_name = rowData.business_line_name
this.monitor_bug_detail_info.monitor_case_name = rowData.monitor_case_name
this.monitor_bug_detail_info.monitor_case_method = rowData.monitor_case_method
this.monitor_bug_detail_info.abnormal_content = rowData.abnormal_content
this.monitor_bug_detail_info.count = rowData.count
this.monitor_bug_detail_info.is_fix_desc = rowData.is_fix_desc
this.$set(this.monitor_bug_detail_info, 'is_fix_id', rowData.is_fix)
this.monitor_bug_detail_info.case_reason_desc = rowData.case_reason_desc
this.$set(this.monitor_bug_detail_info, 'case_reason_id', rowData.case_reason)
this.$set(this.monitor_bug_detail_info, 'remarks', rowData.remarks)
this.$set(this.monitor_bug_detail_info, 'jira_id', rowData.jira_id)
this.$set(this.monitor_bug_detail_info, 'fix_owner', rowData.fix_owner)
},
clickSave() {
let dataJson = ''
dataJson = {
id: this.monitor_bug_detail_info.id,
case_reason: this.monitor_bug_detail_info.case_reason_id,
fix_owner: this.monitor_bug_detail_info.fix_owner,
is_fix: this.monitor_bug_detail_info.is_fix_id,
jira_id: this.monitor_bug_detail_info.jira_id,
remarks: this.monitor_bug_detail_info.remarks
}
this.save(dataJson)
},
save(dataJson) {
this.$axios({
method: 'put',
headers : {'user-id': 119},
url: Config.DATA_MONITOR_SERVER + '/data_monitor_server/monitor-abnormal-record/'+dataJson.id,
data: dataJson
}).then(response => {
if (response.data.errcode == 20000) {
this.dialogVisible = false
this.$message({
message: '更新成功',
type: "success"
})
this.initPage()
}else {
this.$message({
message: response.data.errmsg,
type: "error"
})
}
})
}
},
data() {
return {
is_fix: [{'id': 1, 'desc': '无需修复'}, {'id': 2, 'desc': '已修复'}, {'id': 0, 'desc': '未修复'}],
case_reason_desc_dict: [{'id': 1, 'desc': '代码问题'}, {'id': 2, 'desc': '教研数据配置缺失'}, {
'id': 3,
'desc': '服务配置问题'
}, {'id': 4, 'desc': '数据库配置问题'}, {'id': 5, 'desc': '外部三方问题'}, {
'id': 6,
'desc': '业务操作不规范'
}, {'id': 7, 'desc': '非问题'}],
elSelectIsFix: {},
elSelectBusinessLine: {},
elSelectMonitorType: {},
monitor_bug_detail_info: {},
monitorTypeInfo: [],
businessInfo: [],
tableData: [],
currentPage: 1,
total: 0,
dialogVisible: false
}
},
beforeUpdate() {
}
}
</script>

View File

@@ -0,0 +1,240 @@
<template>
<div style="margin-top: 20px;margin-right: 20px;margin-left: 20px">
<el-breadcrumb separator="/" class="el-breadcrumb-div">
<el-breadcrumb-item :to="{ path: '/dashboard' }">数据监控</el-breadcrumb-item>
<el-breadcrumb-item>监控用例</el-breadcrumb-item>
</el-breadcrumb>
<div class="searchReport">
<el-form
label-width="70px"
labelPosition="right"
class="el-form"
:inline="true"
style="
float:left;
height:50px;
margin-top:30px;"
>
<el-form-item label="业务线">
<el-select
v-model="elSelectBusinessLine.id"
placeholder="请选择业务线"
style="width:160px"
clearable>
<el-option v-for="item in businessInfo" :key="item.id" :value="item.id"
:label="item.business_line_name"></el-option>
</el-select>
</el-form-item>
<el-form-item
label="监控类型">
<el-select
v-model="elSelectMonitorType.id"
placeholder="请选择监控类型"
style="float:left;margin-bottom:20px;width:160px"
clearable>
<el-option v-for="item in monitorTypeInfo" :key="item.id" :value="item.id"
:label="item.type_name"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type="primary"
@click="searchMonitorCaseInfo"
size="small"
style="margin-left:15px">查询
</el-button>
</el-form-item>
</el-form>
</div>
<div>
<el-table
:data="tableData"
type="flex"
style="
width: 100%;
margin-top:30px;
font-size:14px;"
max-height="100%"
row-class-name="rowClass"
:header-cell-style="headerTable">
<el-table-column
prop="id"
label="ID"
min-width="5%"
align="center">
</el-table-column>
<el-table-column
prop="case_name"
label="用例名称"
min-width="20%"
align="center"
:show-overflow-tooltip='true'>
</el-table-column>
<el-table-column
prop="case_method"
label="函数名称"
min-width="19%"
align="center"
:show-overflow-tooltip='true'>
</el-table-column>
<el-table-column
prop="monitor_data_type_name"
label="监控类型"
min-width="19%"
align="center"
:show-overflow-tooltip='true'>
</el-table-column>
<el-table-column
prop="business_line_name"
label="业务线"
min-width="10%"
align="center"
:show-overflow-tooltip='true'>
</el-table-column>
<el-table-column
prop="create_time"
label="创建日期"
min-width="20%"
align="center"
:show-overflow-tooltip='true'>
</el-table-column>
</el-table>
</div>
<div style="margin-top:30px">
<el-pagination
background
style="text-align: center"
layout="prev, pager, next"
@current-change="handleCurrentChange"
:current-page.sync="currentPage"
:total="total">
</el-pagination>
</div>
</div>
</template>
<style>
.searchReport {
width: 100%;
height: 100px;
background-color: #F2F6FC;
margin-top: 30px;
}
</style>
<script>
import Config from "../../Config";
export default {
name: "CaseInfo",
mounted: function () {
this.initPage()
},
methods: {
initPage() {
//监控用例数据
this.$axios({
method: 'get',
url: Config.DATA_MONITOR_SERVER + '/data_monitor_server/monitor-case',
params: {page: 1, limit: 10}
}).then(response => {
if (response.data.errcode !== 20000) {
this.$message({
message: response.data.errmsg,
type: "error"
})
return
}
this.tableData = response.data.data.data_list
this.total = response.data.data.total
})
this.$axios({
method: 'get',
url: Config.DATA_MONITOR_SERVER + '/data_monitor_server/business-info',
params: {page: 1, limit: 100}
}).then(response => {
if (response.data.errcode !== 20000) {
this.$message({
message: response.data.errmsg,
type: "error"
})
return
}
this.businessInfo = response.data.data.data_list
})
//获取监控类型
this.$axios({
method: 'get',
url: Config.DATA_MONITOR_SERVER + '/data_monitor_server/monitor-data-type',
params: {page: 1, limit: 100}
}).then(response => {
if (response.data.errcode !== 20000) {
this.$message({
message: response.data.errmsg,
type: "error"
})
return
}
this.monitorTypeInfo = response.data.data.data_list
})
},
handleCurrentChange() {
var dataJson = {
business_line_id: this.elSelectBusinessLine.id,
monitor_data_type: this.elSelectMonitorType.id,
page: this.currentPage,
limit: 10
}
this.search(dataJson)
},
searchMonitorCaseInfo() {
var dataJson = {
business_line_id: this.elSelectBusinessLine.id,
monitor_data_type: this.elSelectMonitorType.id,
page: this.currentPage,
limit: 10
}
this.search(dataJson)
},
search(dataJson) {
this.$axios({
method: 'get',
url: Config.DATA_MONITOR_SERVER + '/data_monitor_server/monitor-case',
params: dataJson
}).then(response => {
if (response.data.errcode != 20000) {
this.$message({
message: response.data.errmsg,
type: "error"
})
return
}
this.tableData = response.data.data.data_list
this.currentPage = dataJson.page
this.total = response.data.data.total
})
},
headerTable() {
return 'background:#f5f6fa;color:rgba(0,0,0,.65);font-weight: 500'
}
},
data() {
return {
elSelectBusinessLine: {},
elSelectMonitorType: {},
tableData: [],
currentPage: 1,
total: 0,
businessInfo: {},
data_list: [],
monitorTypeInfo: []
}
},
beforeUpdate() {
}
}
</script>

View File

@@ -0,0 +1,108 @@
<template>
<div class="effekt-home">
<el-card shadow="never">
<div class="home-content">
<p class="home-desc">这里汇总各项目常用环境地址和文档链接方便快速进入</p>
<div
v-for="project in projectLinks"
:key="project.name"
class="project-block">
<div class="project-title">{{ project.name }}</div>
<div class="project-links">
<div v-for="item in project.links" :key="item.name" class="link-item">
<span class="link-label">{{ item.name }}</span>
<el-link
:href="item.url"
target="_blank"
type="primary"
class="doc-link">
{{ item.url }}
</el-link>
</div>
</div>
</div>
</div>
</el-card>
</div>
</template>
<script>
export default {
name: 'EffektHome',
data() {
return {
projectLinks: [
{
name: '智慧运营',
links: [
{ name: '测试环境地址', url: 'https://smart-management-web-st.best-envision.com/' },
{ name: 'pre环境地址', url: 'https://smart-management-web-pre.best-envision.com/' },
{ name: '需求文档', url: 'https://vcncbabzm4lv.feishu.cn/wiki/UsvzwMzV0i7Lrgk9VIhc2XgJn6e?fromScene=spaceOverview' },
{ name: '资源连接地址(包含数据库连接jenkins配置git仓库日志查询xxjob等)', url: 'https://vcncbabzm4lv.feishu.cn/wiki/ZKmown7QuiXtwTkONhUcagpQnWh' },
{ name: '领星地址', url: 'https://envision.lingxing.com/erp/home' },
{ name: '禅道地址', url: 'http://39.170.26.156:8888/my.html' },
]
},
{
name: '独立站项目',
links: [
{ name: '管理后台测试环境地址', url: 'https://joyhub-website-manager-web-test.best-envision.com/' },
{ name: 'web的C端测试环境地址', url: 'https://joyhub-website-frontend-test.best-envision.com/' },
{ name: '接口开发地址', url: 'https://joyhub-website-manager-api-test.best-envision.com/doc.html#/home' },
{ name: '资源连接地址', url: 'https://vcncbabzm4lv.feishu.cn/wiki/PXTmw6BBviMjNDkKCxCcewD7nMd' },
{ name: '禅道地址', url: 'http://192.168.16.4:8956/index.php?m=my&f=index' },
]
}
]
}
}
}
</script>
<style scoped>
.effekt-home {
padding: 20px;
}
.home-content {
display: flex;
flex-direction: column;
}
.home-desc {
margin: 0 0 16px;
color: #606266;
}
.project-block {
padding: 16px 0;
border-bottom: 1px solid #ebeef5;
}
.project-block:last-child {
border-bottom: none;
}
.project-title {
margin-bottom: 12px;
font-size: 16px;
font-weight: 600;
color: #303133;
}
.link-item {
display: flex;
align-items: flex-start;
margin-bottom: 10px;
line-height: 22px;
}
.link-label {
min-width: 140px;
color: #606266;
}
.doc-link {
word-break: break-all;
}
</style>

86
src/components/Home.vue Normal file
View File

@@ -0,0 +1,86 @@
<template>
<div class="auto-test-main" style="height: 100%">
<el-container style="height: 100%">
<div class="aside" style="height: 100%">
<el-menu
:default-active="$route.path"
class="el-menu-vertical-demo"
:collapse="isCollapse"
background-color="#545c64"
text-color="#fff"
active-text-color="#ffd04b"
:router="true">
<el-menu-item index="/effekt">
<i class="el-icon-house"></i>
<span slot="title">首页</span>
</el-menu-item>
<el-submenu index="create-tool">
<template slot="title">
<i class="el-icon-setting"></i>
<span slot="title">造数工具</span>
</template>
<el-menu-item index="/create/data">数据库造数</el-menu-item>
<el-menu-item index="/create/interface">接口造数</el-menu-item>
</el-submenu>
</el-menu>
</div>
<el-container>
<el-header class="header" style="background-color: rgba(230, 226, 215, 0.9)">
<div class="header-icon" style="float: left;padding-left: 15px;padding-right: 15px">
<i v-if="isCollapse" class="el-icon-s-unfold" style="font-size: 20px" @click="setCollapse"></i>
<i v-else class="el-icon-s-fold" style="font-size: 20px" @click="setCollapse"></i>
</div>
<div class="system-name" style="float: left">
<span>{{ systemName }}</span>
</div>
</el-header>
<el-main>
<router-view class="main-form" name="Manage"></router-view>
</el-main>
</el-container>
</el-container>
</div>
</template>
<script>
export default {
name: 'Home',
data() {
return {
isCollapse: false,
systemName: '效能平台'
}
},
methods: {
setCollapse() {
this.isCollapse = !this.isCollapse
}
}
}
</script>
<style scoped>
.auto-test-main {
height: 100%;
padding: 0;
margin: 0;
}
.el-menu-vertical-demo:not(.el-menu--collapse) {
width: 200px;
/*min-height: 400px;*/
}
.header {
height: 60px;
line-height: 60px
}
.el-header {
padding-left: 0;
}
.el-menu-vertical-demo {
height: 100%;
}
</style>

View File

@@ -0,0 +1,60 @@
<template>
<div class="password-edit">
<div class="username">
<span>学生证号{{username}}</span>
</div>
<div class="password">
<span>新密码</span>
<el-input v-model="password"></el-input>
<el-button type="primary" @click.native.prevent="confirmPassword">确定</el-button>
</div>
</div>
</template>
<script>
import {editPassword} from '@/api/Userapi'
export default {
name: "EditPassword",
props: ['username','userid'],
data(){
return {
password:''
}
},
methods:{
confirmPassword(){
if(this.password!==undefined &&this.password!==''){
let data = {userId:this.userid,new_password:this.password,sure_password:this.password};
editPassword(data).then(data=>{
if(data.code===200){
this.password='';
this.$message({
type: 'success',
message: data.message
});
}else {
this.$message({
type: 'error',
message:data.message
});
}
})
}else {
this.$message({
type: 'info',
message: "请输入密码"
});
}
}
}
}
</script>
<style scoped>
.el-input{
width: 200px;
}
.username{
padding-bottom: 20px;
}
</style>

View File

@@ -0,0 +1,232 @@
<template>
<div id="backgroud">
<div class="content_right">
<div class="login-body-title">
<h2>登录</h2>
</div>
<div class="messge">
<span>{{ msg }}</span>
</div>
<div class="cr_top">
<div class="ct_input" style="height: 60px;width: 254px">
<span class="ct-img-yhm">&nbsp;</span>
<input
id="username"
v-model="username"
name="username"
class="input_text"
tabindex="1"
accesskey="n"
type="text"
size="25"
autocomplete="off"
placeholder="学号">
</div>
<div class="ct_input" style="height:60px;width: 254px">
<span class="ct_img_mm">&nbsp;</span>
<input
id="password"
v-model="password"
name="password"
class="input_text"
tabindex="2"
accesskey="p"
type="password"
size="25"
autocomplete="off"
placeholder="密码">
</div>
<input class="btn_login" value="登录" @click="handleLogin">
</div>
<div class="account-oprate clearfix">
<router-link :to="{ name: 'register' }">
<a class="regist-btn">注册</a>
</router-link>
</div>
</div>
</div>
</template>
<script>
import { Login } from '@/api/Userapi'
export default {
name: 'Login',
data() {
return {
msg: ' ',
username: null,
password: null
}
},
methods: {
handleLogin() {
Login({
studentId: this.username,
password: this.password
}).then(data => {
if (data.code === 200 && data.success === 'true') {
localStorage.setItem('userinfo', JSON.stringify(data.data.userinfo))
localStorage.setItem('Token', data.data.token)
this.$store.commit('SetRole', data.data.userinfo.userStatus)
this.$router.push({ path: '/effekt' })
} else {
this.msg = data.message
}
})
}
}
}
</script>
<style scoped>
@import "../../assets/css/Form.css";
.content_right {
padding: 20px 0;
background: #fff;
color: #333;
border-radius: 3px;
border-color: rgba(250, 255, 251, .8);
box-shadow: inset 0 0 5px rgba(0, 0, 0, .1), 0 0 8px rgba(140, 141, 140, .6);
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
margin: auto;
outline: 0;
width: 300px;
height: 300px;
text-align: center;
}
.cr_top .ct_input {
position: relative;
}
.account-oprate .regist-btn {
float: right;
font-size: 14px;
color: #333;
}
.messge {
font-size: 12px;
margin-top: 10px;
height: 20px;
text-align: left;
padding-left: 24px;
color: #D60909;
}
.content_right .cr_top {
position: relative;
margin: 0 23px 0;
}
.content_right .input_text {
margin-bottom: 18px;
background: #fff;
}
.account-oprate {
width: 252px;
margin-left: 24px;
}
.ct_img_mm,
.ct-img-yhm {
position: absolute;
top: 14px;
left: 8px;
width: 16px;
height: 16px;
background-image: url("https://t4.chei.com.cn/passport/images/login2014/icon_input.png");
}
.ct-img-yhm {
background-position: -16px 0;
}
.input_text {
display: inline-block;
width: 224px;
height: 24px;
padding: 8px 0 8px 28px;
font-size: 14px;
color: #000;
border: 1px solid #ccc;
border-radius: 3px;
vertical-align: middle;
}
.input_text:hover {
border-color: rgba(82, 168, 236, .8);
box-shadow: inset 0 1px 3px rgba(0, 0, 0, .1), 0 0 8px rgba(82, 168, 236, .6);
outline: 0;
}
.btn_login:hover {
background-color: #3e82dc;
}
.btn_login {
text-align: center;
box-sizing: border-box;
width: 254px;
height: 37px;
font-size: 16px;
cursor: pointer;
border-radius: 3px;
color: #fff;
border: 1px solid #4591f5;
background-color: #4591f5;
margin-bottom: 14px;
-webkit-appearance: none;
}
button,
input,
optgroup,
option,
select,
textarea {
font-family: inherit;
font-size: inherit;
font-style: inherit;
font-weight: inherit;
resize: none;
}
blockquote,
body,
button,
code,
dd,
div,
dl,
dt,
fieldset,
form,
h1,
h2,
h3,
h4,
h5,
h6,
input,
legend,
li,
ol,
p,
pre,
td,
textarea,
th,
ul {
margin: 0;
padding: 0;
font-family: '\5FAE\8F6F\96C5\9ED1', '\5B8B\4F53', Arial, Helvetica, sans-serif;
}
</style>

View File

@@ -0,0 +1,143 @@
<template>
<div id="backgroud">
<div class="register-head" style="padding-top: 20px"></div>
<div class="model">
<div class="location-title"><h1>注册</h1></div>
<el-form ref="ruleForm" :model="ruleForm" status-icon :rules="rules" label-width="100px" class="demo-ruleForm">
<el-form-item label="学号" prop="studentId">
<el-input v-model="ruleForm.studentId" type="text" placeholder="学号" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="密码" prop="password">
<el-input v-model="ruleForm.password" type="password" placeholder="密码" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="确认密码" prop="checkPass">
<el-input v-model="ruleForm.checkPass" type="password" placeholder="确认密码" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="姓名" prop="name">
<el-input v-model="ruleForm.name" placeholder="姓名" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="性别" prop="gender">
<el-input v-model="ruleForm.gender" placeholder="性别" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="学院" prop="faculty">
<el-input v-model="ruleForm.faculty" type="text" placeholder="学院" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="年级" prop="grade">
<el-input v-model="ruleForm.grade" type="text" placeholder="年级" autocomplete="off"></el-input>
</el-form-item>
<el-form-item>
<el-button class="enter-btn" type="primary" :disabled="!select" @click="submitForm('ruleForm')">
立即注册
</el-button>
</el-form-item>
</el-form>
</div>
</div>
</template>
<script>
import { Register } from '@/api/Userapi'
export default {
name: 'Register',
data() {
const validatePass = (rule, value, callback) => {
if (value === '') {
callback(new Error('请输入密码'))
return
}
if (this.ruleForm.password !== '') {
this.$refs.ruleForm.validateField('checkPass')
}
callback()
}
const validatePass2 = (rule, value, callback) => {
if (value === '') {
callback(new Error('请再次输入密码'))
} else if (value !== this.ruleForm.password) {
callback(new Error('两次输入密码不一致!'))
} else {
callback()
}
}
const validateStudentId = (rule, value, callback) => {
if (value === '') {
callback(new Error('请输入学号'))
return
}
callback()
}
return {
select: true,
ruleForm: {
studentId: '',
password: '',
checkPass: '',
name: '',
gender: '',
faculty: '',
grade: ''
},
rules: {
studentId: [{ required: true, validator: validateStudentId, trigger: 'blur' }],
password: [{ required: true, validator: validatePass, trigger: 'blur' }],
checkPass: [{ required: true, validator: validatePass2, trigger: 'blur' }],
name: [{ required: true, message: '请输入姓名', trigger: 'blur' }],
gender: [{ required: true, message: '请输入性别', trigger: 'blur' }],
faculty: [{ required: true, message: '请输入学院', trigger: 'blur' }],
grade: [{ required: true, message: '请输入年级', trigger: 'blur' }]
}
}
},
methods: {
open(message) {
this.$alert(message, '提示', {
confirmButtonText: '确定'
})
},
handleRegister() {
Register({
studentId: this.ruleForm.studentId,
password: this.ruleForm.password,
name: this.ruleForm.name,
gender: this.ruleForm.gender,
faculty: this.ruleForm.faculty,
grade: this.ruleForm.grade
}).then(data => {
if (data.code === 200 && data.success === 'true') {
this.open('注册成功')
this.$router.push({ name: 'login' })
} else {
this.open(data.message)
}
})
},
submitForm(formName) {
this.$refs[formName].validate(valid => {
if (valid) {
this.handleRegister()
}
})
}
}
}
</script>
<style>
@import "../../assets/css/Form.css";
.location-title {
text-align: center;
}
.register-head {
position: absolute;
}
.el-input {
float: left;
width: 80%;
}
</style>

View File

@@ -0,0 +1,201 @@
<template>
<div class="bgView">
<div :class="['json-view', length ? 'closeable' : '']" :style="'font-size:' + fontSize+'px'">
<span @click="toggleClose" :class="['angle', innerclosed ? 'closed' : '']" v-if="length">
</span>
<div class="content-wrap">
<p class="first-line">
<span v-if="jsonKey" class="json-key">"{{jsonKey}}": </span>
<span v-if="length">
{{prefix}}
{{innerclosed ? ('...' + subfix) : ''}}
<span class="json-note">
{{innerclosed ? (' // count: ' + length) : ''}}
</span>
</span>
<span v-if="!length">{{isArray ? '[]' : '{}'}}</span>
</p>
<div v-if="!innerclosed && length" class="json-body">
<template v-for="(item, index) in items">
<json-view :closed="closed" v-if="item.isJSON" :key="index" :json="item.value"
:jsonKey="item.key" :isLast="index === items.length - 1"></json-view>
<p class="json-item" v-else :key="index">
<span class="json-key">
{{(isArray ? '' : '"' + item.key + '"')}}
</span>
:
<span class="json-value">
{{item.value + (index ===
items.length - 1 ? '' : ',')}}
</span>
</p>
</template>
<span v-show="!innerclosed" class="body-line"></span>
</div>
<p v-if="!innerclosed && length" class="last-line">
<span>{{subfix}}</span>
</p>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'jsonView',
props: {
json: [Object, Array],
jsonKey: {
type: String,
default: ''
},
closed: {
type: Boolean,
default: false
},
isLast: {
type: Boolean,
default: true
},
fontSize: {
type: Number,
default: 13
}
},
created() {
this.innerclosed = this.closed
this.$watch('closed', () => {
this.innerclosed = this.closed
})
},
data() {
return {
innerclosed: true
}
},
methods: {
isObjectOrArray(source) {
const type = Object.prototype.toString.call(source)
const res = type === '[object Array]' || type === '[object Object]'
return res
},
toggleClose() {
if (this.innerclosed) {
this.innerclosed = false
} else {
this.innerclosed = true
}
}
},
computed: {
isArray() {
return Object.prototype.toString.call(this.json) === '[object Array]'
},
length() {
return this.isArray ? this.json.length : Object.keys(this.json).length
},
subfix() {
return (this.isArray ? ']' : '}') + (this.isLast ? '' : ',')
},
prefix() {
return this.isArray ? '[' : '{'
},
items() {
if (this.isArray) {
return this.json.map(item => {
const isJSON = this.isObjectOrArray(item)
return {
value: isJSON ? item : JSON.stringify(item),
isJSON,
key: ''
}
})
}
const json = this.json
return Object.keys(json).map(key => {
const item = json[key]
const isJSON = this.isObjectOrArray(item)
return {
value: isJSON ? item : JSON.stringify(item),
isJSON,
key
}
})
}
}
}
</script>
<style>
.bgView {
background-color: #fafafa;
}
.json-view {
position: relative;
display: block;
width: 100%;
height: 100%;
white-space: nowrap;
padding-left: 20px;
box-sizing: border-box;
}
.json-note {
color: #909399;
}
.json-key {
color: rgb(147, 98, 15);
}
.json-value {
color: rgb(24, 186, 24);
}
.json-item {
margin: 0;
padding-left: 20px;
}
.first-line {
padding: 0;
margin: 0;
}
.json-body {
position: relative;
padding: 0;
margin: 0;
}
.json-body .body-line {
position: absolute;
height: 100%;
width: 0;
border-left: dashed 1px #bbb;
top: 0;
left: 2px;
}
.last-line {
padding: 0;
margin: 0;
}
.angle {
position: absolute;
display: block;
cursor: pointer;
float: left;
width: 20px;
text-align: center;
left: 0;
}
.angle::after {
content: "";
display: inline-block;
width: 0;
height: 0;
vertical-align: middle;
border-top: solid 4px #333;
border-left: solid 6px transparent;
border-right: solid 6px transparent;
}
.angle.closed::after {
border-left: solid 4px #333;
border-top: solid 6px transparent;
border-bottom: solid 6px transparent;
}
</style>

View File

@@ -0,0 +1,42 @@
<template>
<div class="json">
<div class="json-yuan" style="float: left;width: 50%;height: 100%">
<el-input
v-model="json"
type="textarea"
:autosize="{ minRows: 20}"
placeholder="请输入内容">
</el-input>
</div>
<div class="json-formate" style="float: left;width: 50%">
<JsonView :json="JsonData"></JsonView>
</div>
</div>
</template>
<script>
import JsonView from '@/components/formateJson/JsonView'
export default {
name: 'formatejson',
components: { JsonView },
data() {
return {
json: '',
JsonData: ''
}
},
watch: {
json(val) {
try {
this.JsonData = JSON.parse(val)
} catch (e) {
this.JsonData = e.toString()
}
}
}
}
</script>
<style scoped>
</style>

23
src/main.js Normal file
View File

@@ -0,0 +1,23 @@
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import ElementUI from 'element-ui';
import store from '@/vuex/store'
import 'element-ui/lib/theme-chalk/index.css';
import axios from 'axios'
Vue.use(ElementUI);
Vue.prototype.$axios = axios
Vue.config.productionTip = false
/* eslint-disable no-new */
new Vue({
el: '#app',
router,
store,
components: { App },
template: '<App/>'
})

74
src/router/index.js Normal file
View File

@@ -0,0 +1,74 @@
import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)
export default new Router({
mode: 'history',
routes: [
{
path: '/',
redirect: '/effekt'
},
{
path: '/Login',
name: 'login',
component: (resolve) => require(['@/components/User/Login'], resolve)
},
{
path: '/Register',
name: 'register',
component: (resolve) => require(['@/components/User/Register'], resolve)
},
{
path: '/CreateData',
name: 'home',
component: (resolve) => require(['@/components/Home'], resolve),
redirect: '/effekt',
children:[
{
path: '/effekt',
name: 'EffektHome',
components: {
Manage: (resolve) => require(['@/components/EffektHome'], resolve)
}
},
{
path: '/create/data',
name: 'CreateManage',
components: {
Manage: (resolve) => require(['@/components/CreateData/CreateManage'], resolve)
}
},
{
path: '/create/info',
name: 'CreateDataInfo',
components: {
Manage: (resolve) => require(['@/components/CreateData/CreateDataInfo'], resolve)
}
},
{
path: '/create/result/list',
name: 'CreateResultList',
components: {
Manage: (resolve) => require(['@/components/CreateData/CreateResultList'], resolve)
}
},
{
path: '/create/result',
name: 'CreateResult',
components: {
Manage: (resolve) => require(['@/components/CreateData/CreateResult'], resolve)
}
},
{
path: '/create/interface',
name: 'CreateInterfacePlaceholder',
components: {
Manage: (resolve) => require(['@/components/EffektHome'], resolve)
}
}
]
}
]
})

41
src/utils/request.js Normal file
View File

@@ -0,0 +1,41 @@
import axios from 'axios'
import { Message } from 'element-ui';
import router from '../router/index'
const service = axios.create({
// baseURL: 'http://10.250.0.252:5010', // api 的 base_url
// baseURL: 'http://172.19.29.63:5010', // api 的 base_url
baseURL: 'http://192.168.11.46:5010', // api 的 base_url
timeout: 90000 // request timeout
})
// 请求拦截 设置统一header
service.interceptors.request.use(
config => {
config.headers.Token=localStorage.getItem('Token')
return config
},
error => {
return Promise.reject(error)
}
)
// 响应拦截 401 token过期处理
service.interceptors.response.use(
response => {
if(response.data.code===500){
Message.error("服务异常")
}else if(response.data.code===451){
router.push({name:'login'})
}
else {
return response.data
}
},
error => {
// 错误提醒
return Promise.reject(error)
}
)
export default service

6
src/utils/util.js Normal file
View File

@@ -0,0 +1,6 @@
export function formatTime(str) {
if (str.length === 8) {
return str.toString().substring(0, 4) + '-' + str.toString().substring(4, 6) + '-' + str.toString().substring(6, 8)
}
return str.toString().substring(0, 4) + '-' + str.toString().substring(4, 6) + '-' + str.toString().substring(6, 8) + ' ' + str.toString().substring(8, 10) + ':' + str.toString().substring(10, 12)
}

21
src/vuex/store.js Normal file
View File

@@ -0,0 +1,21 @@
import vuex from 'vuex'
import vue from 'vue'
vue.use(vuex)
const state={
userRole:null
}
const mutations={
SetRole(state,val){
state.userRole=val
}
}
export default new vuex.Store({
state,
mutations
})

0
static/.gitkeep Normal file
View File

18
webstorm.config.js Normal file
View File

@@ -0,0 +1,18 @@
'use strict'
const path = require('path')
function resolve (dir) {
return path.join(__dirname, '.', dir)
}
module.exports = {
context: path.resolve(__dirname, './'),
resolve: {
extensions: ['.js', '.vue', '.json'],
alias: {
'@': resolve('src'),
'_c': resolve('src/components')
}
}
}