改成人人基础

This commit is contained in:
朱文强 2021-11-15 08:22:01 +08:00
parent c951ee56f5
commit d9810b14b5
1200 changed files with 126167 additions and 90336 deletions

19
.babelrc Normal file
View File

@ -0,0 +1,19 @@
{
"presets": [
["env", {
"modules": false
}],
"stage-2"
],
"plugins": ["transform-runtime", ["component", [
{
"libraryName": "element-ui"
}
]]],
"env": {
"test": {
"presets": ["env", "stage-2"],
"plugins": ["transform-es2015-modules-commonjs", "dynamic-import-node"]
}
}
}

View File

@ -1,7 +0,0 @@
.vscode/
.idea/
node_modules/
dist/
**/*.log
LICENSE
README.md

View File

@ -1,41 +0,0 @@
---
kind: pipeline
type: docker
name: default
steps:
- name: build
image: docker:dind
volumes:
- name: dockersock
path: /var/run/docker.sock
- name: dockerconfig
path: /root/.docker
commands:
- docker build -t harbor.picaiba.com/mes/mes-cigs-ui ./ && docker push harbor.picaiba.com/mes/mes-cigs-ui
- name: deploy
image: harbor.picaiba.com/tools/kubectl:1.19.8
commands:
- echo "172.27.0.20 lb.kubesphere.local" >> /etc/hosts
#- echo "52.74.223.119 github.com" >> /etc/hosts
- sleep 1
- kubectl scale --replicas=0 deployment/mes-ui -n mes-cigs
- sleep 3
- kubectl scale --replicas=1 deployment/mes-ui -n mes-cigs
depends_on:
- build
volumes:
- name: dockersock
host:
path: /var/run/docker.sock
- name: dockerconfig
host:
path: /root/.docker
trigger:
branch:
- develop
event:
- push

View File

@ -1,4 +1,3 @@
# https://editorconfig.org
root = true
[*]
@ -8,7 +7,3 @@ indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
insert_final_newline = false
trim_trailing_whitespace = false

View File

@ -1,17 +0,0 @@
# just a flag
ENV = 'development'
# base api
# 这里修改成api服务器地址
VUE_APP_BASE_API = '/api'
# vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,
# to control whether the babel-plugin-dynamic-import-node plugin is enabled.
# It only does one thing by converting all import() to require().
# This configuration can significantly increase the speed of hot updates,
# when you have a large number of pages.
# Detail: https://github.com/vuejs/vue-cli/blob/dev/packages/@vue/babel-preset-app/index.js
VUE_CLI_BABEL_TRANSPILE_MODULES = true
VUE_APP_REPORT_DESIGN_URL = 'http://127.0.0.1:8080/ureport/designer'
VUE_APP_REPORT_VIEW_URL = 'http://127.0.0.1:8080/ureport/preview'

View File

@ -1,7 +0,0 @@
# just a flag
ENV = 'production'
# base api
VUE_APP_BASE_API = '/api'
VUE_APP_REPORT_DESIGN_URL = '/ureport/designer'
VUE_APP_REPORT_VIEW_URL = '/ureport/preview'

View File

@ -1,8 +0,0 @@
NODE_ENV = production
# just a flag
ENV = 'staging'
# base api
VUE_APP_BASE_API = '/stage-api'

View File

@ -1,4 +1,6 @@
build/*.js
src/assets
public
dist
/build/
/config/
/dist/
/*.js
/test/unit/coverage/
/src/icons/iconfont.js

View File

@ -1,198 +1,25 @@
// https://eslint.org/docs/user-guide/configuring
module.exports = {
root: true,
parserOptions: {
parser: 'babel-eslint',
parserOptions: {
sourceType: 'module'
},
env: {
browser: true,
node: true,
es6: true,
},
extends: ['plugin:vue/recommended', 'eslint:recommended'],
// https://github.com/standard/standard/blob/master/docs/RULES-en.md
extends: 'standard',
// required to lint *.vue files
plugins: [
'html'
],
// add your custom rules here
//it is base on https://github.com/vuejs/eslint-config-vue
rules: {
"vue/max-attributes-per-line": [2, {
"singleline": 10,
"multiline": {
"max": 1,
"allowFirstLine": false
}
}],
"vue/singleline-html-element-content-newline": "off",
"vue/multiline-html-element-content-newline":"off",
"vue/name-property-casing": ["error", "PascalCase"],
"vue/no-v-html": "off",
'accessor-pairs': 2,
'arrow-spacing': [2, {
'before': true,
'after': true
}],
'block-spacing': [2, 'always'],
'brace-style': [2, '1tbs', {
'allowSingleLine': true
}],
'camelcase': [0, {
'properties': 'always'
}],
'comma-dangle': [2, 'never'],
'comma-spacing': [2, {
'before': false,
'after': true
}],
'comma-style': [2, 'last'],
'constructor-super': 2,
'curly': [2, 'multi-line'],
'dot-location': [2, 'property'],
'eol-last': 2,
'eqeqeq': ["error", "always", {"null": "ignore"}],
'generator-star-spacing': [2, {
'before': true,
'after': true
}],
'handle-callback-err': [2, '^(err|error)$'],
'indent': [2, 2, {
'SwitchCase': 1
}],
'jsx-quotes': [2, 'prefer-single'],
'key-spacing': [2, {
'beforeColon': false,
'afterColon': true
}],
'keyword-spacing': [2, {
'before': true,
'after': true
}],
'new-cap': [2, {
'newIsCap': true,
'capIsNew': false
}],
'new-parens': 2,
'no-array-constructor': 2,
'no-caller': 2,
'no-console': 'off',
'no-class-assign': 2,
'no-cond-assign': 2,
'no-const-assign': 2,
'no-control-regex': 0,
'no-delete-var': 2,
'no-dupe-args': 2,
'no-dupe-class-members': 2,
'no-dupe-keys': 2,
'no-duplicate-case': 2,
'no-empty-character-class': 2,
'no-empty-pattern': 2,
'no-eval': 2,
'no-ex-assign': 2,
'no-extend-native': 2,
'no-extra-bind': 2,
'no-extra-boolean-cast': 2,
'no-extra-parens': [2, 'functions'],
'no-fallthrough': 2,
'no-floating-decimal': 2,
'no-func-assign': 2,
'no-implied-eval': 2,
'no-inner-declarations': [2, 'functions'],
'no-invalid-regexp': 2,
'no-irregular-whitespace': 2,
'no-iterator': 2,
'no-label-var': 2,
'no-labels': [2, {
'allowLoop': false,
'allowSwitch': false
}],
'no-lone-blocks': 2,
'no-mixed-spaces-and-tabs': 2,
'no-multi-spaces': 2,
'no-multi-str': 2,
'no-multiple-empty-lines': [2, {
'max': 1
}],
'no-native-reassign': 2,
'no-negated-in-lhs': 2,
'no-new-object': 2,
'no-new-require': 2,
'no-new-symbol': 2,
'no-new-wrappers': 2,
'no-obj-calls': 2,
'no-octal': 2,
'no-octal-escape': 2,
'no-path-concat': 2,
'no-proto': 2,
'no-redeclare': 2,
'no-regex-spaces': 2,
'no-return-assign': [2, 'except-parens'],
'no-self-assign': 2,
'no-self-compare': 2,
'no-sequences': 2,
'no-shadow-restricted-names': 2,
'no-spaced-func': 2,
'no-sparse-arrays': 2,
'no-this-before-super': 2,
'no-throw-literal': 2,
'no-trailing-spaces': 2,
'no-undef': 2,
'no-undef-init': 2,
'no-unexpected-multiline': 2,
'no-unmodified-loop-condition': 2,
'no-unneeded-ternary': [2, {
'defaultAssignment': false
}],
'no-unreachable': 2,
'no-unsafe-finally': 2,
'no-unused-vars': [2, {
'vars': 'all',
'args': 'none'
}],
'no-useless-call': 2,
'no-useless-computed-key': 2,
'no-useless-constructor': 2,
'no-useless-escape': 0,
'no-whitespace-before-property': 2,
'no-with': 2,
'one-var': [2, {
'initialized': 'never'
}],
'operator-linebreak': [2, 'after', {
'overrides': {
'?': 'before',
':': 'before'
}
}],
'padded-blocks': [2, 'never'],
'quotes': [2, 'single', {
'avoidEscape': true,
'allowTemplateLiterals': true
}],
'semi': [2, 'never'],
'semi-spacing': [2, {
'before': false,
'after': true
}],
'space-before-blocks': [2, 'always'],
'space-before-function-paren': [2, 'never'],
'space-in-parens': [2, 'never'],
'space-infix-ops': 2,
'space-unary-ops': [2, {
'words': true,
'nonwords': false
}],
'spaced-comment': [2, 'always', {
'markers': ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ',']
}],
'template-curly-spacing': [2, 'never'],
'use-isnan': 2,
'valid-typeof': 2,
'wrap-iife': [2, 'any'],
'yield-star-spacing': [2, 'both'],
'yoda': [2, 'never'],
'prefer-const': 2,
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
'object-curly-spacing': [2, 'always', {
objectsInObjects: false
}],
'array-bracket-spacing': [2, 'never']
// allow async-await
'generator-star-spacing': 'off',
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
}
}

12
.gitignore vendored
View File

@ -4,10 +4,8 @@ dist/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
**/*.log
tests/**/coverage/
tests/e2e/reports
/test/unit/coverage/
/test/e2e/reports/
selenium-debug.log
# Editor directories and files
@ -17,9 +15,3 @@ selenium-debug.log
*.ntvs*
*.njsproj
*.sln
*.local
package-lock.json
yarn.lock
/.env.development
/vue.config.js

9
.postcssrc.js Normal file
View File

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

View File

@ -1,5 +0,0 @@
language: node_js
node_js: 10
script: npm run test
notifications:
email: false

59
CHANGELOG.md Normal file
View File

@ -0,0 +1,59 @@
## 更新日志
### 1.2.2
*2018-10-16*
- 修复判断当前路由类型 bug
- 默认开放element-ui所有组件
- 修复子菜单同级出现子菜单项会同时选中bug
- 捕获首次请求菜单列表和权限异常,自动跳转至登录页
- 修复菜单按钮权限错误bug [#41](https://github.com/renrenio/renren-fast-vue/issues/41)
- 提供重置登录信息状态方法。修复登出或替换账号还保留之前账号操作信息和痕迹bug
- 优化token失效、退出后为了强制清空整站临时存储数据而刷新页面问题。注意: 此次vux数据并未做重置处理
### 1.2.1
*2018-06-08*
- 修复tabs关闭最后一个tab后再次打开会保留最后一个tab bug
- 优化完善mock模拟数据
- 修复linux系统引入主题色文件名大小写编译错误bug [#22](https://github.com/daxiongYang/renren-fast-vue/issues/22)
- 新增echarts图表、ueditor富文本编辑器demo
- 移除登录成功token前端设置的失效时间
- 修复退出token失效后返回登录页面未清空整站临时存储数据bug
- 修复手机号码验证正则bug
- 同步后台 修改config模块key vulue子段为paramKey paramValue
- 修复角色管理 新增修改授权接口请求错误bug
- 修复1.2 新版本的导航栏Tab错位bug [#14](https://github.com/daxiongYang/renren-fast-vue/issues/14)
- 修复动态菜单路由 最前面带/bug
- 修复其它已知bug
### 1.2.0
*2018-05-03*
- 支持菜单管理操作动态(菜单)路由
- 移除api文件夹目录简化api请求方式
- 新增element-ui组件主题12套可同步修改配置设置成整站主题
- 调整store状态目录结构改变设置获取方式
- 调整views视图层结构更友好的支持动态(菜单)路由
- 修复其它已知bug
### 1.1.0
*2018-04-15*
- 使用SVG Sprite矢量图标替换fontawesome字体图标
- 新增内容tabs标签页关闭当前其它全部、刷新当前功能
- 新增scss变量皮肤定制
- 优化路由机制通过meta isTab属性设定是否通过tab标签页展示内容
- 更新element-ui 2.3.2 用于修复左侧菜单收缩卡顿问题
- 新增mock本地开发模拟数据功能
- 修复本地开发找不到baseUrl问题
- 更新element-ui 2.2.1 用于修复tree半选中状态项不能传给后台接口问题
- 修复其它已知bug
### 1.0.0
*2018-02-11*

View File

@ -1,12 +0,0 @@
FROM node:12 AS builder
WORKDIR /app
ADD package.json /app/
RUN npm install \
--registry=https://registry.npm.taobao.org \
--disturl=https://npm.taobao.org/dist
ADD . /app
RUN npm run build:prod
FROM busybox
LABEL maintainer thomas.hairong@gmail.com
COPY --from=builder /app/dist /html

View File

@ -1,6 +1,6 @@
MIT License
Copyright (c) 2017-present PanJiaChen
Copyright (c) 2018
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

BIN
QR.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 717 B

View File

@ -1,50 +1,19 @@
<!--
* @Author: gtz
* @Date: 2021-01-27 10:07:42
* @LastEditors: gtz
* @LastEditTime: 2021-04-22 09:58:18
* @Description: file content
-->
# Readme
## renren-fast-vue
- renren-fast-vue基于vue、element-ui构建开发实现[renren-fast](https://gitee.com/renrenio/renren-fast)后台管理前端功能,提供一套更优的前端解决方案
- 前后端分离通过token进行数据交互可独立部署
- 主题定制通过scss变量统一一站式定制
- 动态菜单,通过菜单管理统一管理访问路由
- 数据切换通过mock配置对接口数据mock模拟数据进行切换
- 发布时可动态配置CDN静态资源切换新旧版本
- 演示地址:[http://demo.open.renren.io/renren-fast](http://demo.open.renren.io/renren-fast) (账号密码admin/admin)
![输入图片说明](https://images.gitee.com/uploads/images/2019/0305/133529_ff15f192_63154.png "01.png")
![输入图片说明](https://images.gitee.com/uploads/images/2019/0305/133537_7a1b2d85_63154.png "02.png")
页面原型地址: http://rp.picaiba.com/mes/2020-12-29
element 表单生成工具: https://mrhj.gitee.io/form-generator/#/
***
* 顶栏右上角设置的配置在 @/layout/components/Navbar.vue 中
* 富文本编辑器中 右上角上传图片的目标地址需要修改,在@/components/Tinymce/components/EditorImage.vue 中
## 说明文档
项目开发、部署等说明都在[wiki](https://github.com/renrenio/renren-fast-vue/wiki)中。
##### echarts封装
* 考虑使用mixin加入部分功能
* option配置分离再复用
* 定义统一输入的数据格式通过props
##### 国际化注意事项
* 所有methodbtn的tableBtn配置中的btnName写成下种形式具体配置项在@/lang/i18n.js 中,若无想要的自行添加
```
btnName: 'btn.edit'
```
* 所有hidden不为true的路由的mate中的title写成下种形式位置同上
```
meta: { title: routerTitle.dashboard.dashboard?.[language] || routerTitle.dashboard.dashboard.en, icon: 'dashboard', affix: true }
```
* 所有table页引入国际化组件表格配置项中label写成下种形式具体配置需自行到@/lang/en.js 和@/lang/zh.js 中添加
```
import i18n from '@/lang'
const tableProps = [{
...
label: i18n.t('userManage.userId'),
...
}]
```
##### 切换主题色
* 主题样式文件应使用本地文件不应使用element云上的目前尝试使用本地可能因为缓存策略导致切换主题色仅第一次生效目前仍保留使用element云上的样式文件
##### 备注
* 废品报废添加时间隐藏,质量检测计划检测速率、检测内容隐藏
test
## 更新日志
每个版本的详细更改都记录在[release notes](https://github.com/renrenio/renren-fast-vue/releases)中。

View File

@ -1,26 +0,0 @@
/*
* @Date: 2020-12-14 09:07:03
* @LastEditors: guo
* @LastEditTime: 2020-12-29 21:34:11
* @FilePath: \basic-admin\babel.config.js
* @Description: 修改babel配置
* preset-env用于适配浏览器最新4个版本
* transform-runtime 用于识别一些比较新的js语法
*/
module.exports = {
presets: [
['@babel/preset-env', {
'useBuiltIns': 'usage',
'debug': true,
'targets': [
'last 4 versions'
]
}],
'@vue/app'
],
plugins: [
['@babel/plugin-transform-runtime', {
'corejs': 3
}]
]
}

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

View File

@ -1,35 +0,0 @@
const { run } = require('runjs')
const chalk = require('chalk')
const config = require('../vue.config.js')
const rawArgv = process.argv.slice(2)
const args = rawArgv.join(' ')
if (process.env.npm_config_preview || rawArgv.includes('--preview')) {
const report = rawArgv.includes('--report')
run(`vue-cli-service build ${args}`)
const port = 9526
const publicPath = config.publicPath
var connect = require('connect')
var serveStatic = require('serve-static')
const app = connect()
app.use(
publicPath,
serveStatic('./dist', {
index: ['index.html', '/']
})
)
app.listen(port, function () {
console.log(chalk.green(`> Preview at http://localhost:${port}${publicPath}`))
if (report) {
console.log(chalk.green(`> Report at http://localhost:${port}${publicPath}report.html`))
}
})
} else {
run(`vue-cli-service build ${args}`)
}

101
build/utils.js Normal file
View File

@ -0,0 +1,101 @@
'use strict'
const path = require('path')
const config = require('../config')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const packageConfig = require('../package.json')
exports.assetsPath = function (_path) {
const assetsSubDirectory = process.env.NODE_ENV === 'production'
? config.build.assetsSubDirectory
: config.dev.assetsSubDirectory
return path.posix.join(assetsSubDirectory, _path)
}
exports.cssLoaders = function (options) {
options = options || {}
const cssLoader = {
loader: 'css-loader',
options: {
sourceMap: options.sourceMap
}
}
const postcssLoader = {
loader: 'postcss-loader',
options: {
sourceMap: options.sourceMap
}
}
// generate loader string to be used with extract text plugin
function generateLoaders (loader, loaderOptions) {
const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader]
if (loader) {
loaders.push({
loader: loader + '-loader',
options: Object.assign({}, loaderOptions, {
sourceMap: options.sourceMap
})
})
}
// Extract CSS when that option is specified
// (which is the case during production build)
if (options.extract) {
return ExtractTextPlugin.extract({
use: loaders,
fallback: 'vue-style-loader'
})
} else {
return ['vue-style-loader'].concat(loaders)
}
}
// https://vue-loader.vuejs.org/en/configurations/extract-css.html
return {
css: generateLoaders(),
postcss: generateLoaders(),
less: generateLoaders('less'),
sass: generateLoaders('sass', { indentedSyntax: true }),
scss: generateLoaders('sass'),
stylus: generateLoaders('stylus'),
styl: generateLoaders('stylus')
}
}
// Generate loaders for standalone style files (outside of .vue)
exports.styleLoaders = function (options) {
const output = []
const loaders = exports.cssLoaders(options)
for (const extension in loaders) {
const loader = loaders[extension]
output.push({
test: new RegExp('\\.' + extension + '$'),
use: loader
})
}
return output
}
exports.createNotifierCallback = () => {
const notifier = require('node-notifier')
return (severity, errors) => {
if (severity !== 'error') return
const error = errors[0]
const filename = error.file && error.file.split('!').pop()
notifier.notify({
title: packageConfig.name,
message: severity + ': ' + error.name,
subtitle: filename || '',
icon: path.join(__dirname, 'logo.png')
})
}
}

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

104
build/webpack.base.conf.js Normal file
View File

@ -0,0 +1,104 @@
'use strict'
const path = require('path')
const utils = require('./utils')
const config = require('../config')
const vueLoaderConfig = require('./vue-loader.conf')
function resolve (dir) {
return path.join(__dirname, '..', dir)
}
const createLintingRule = () => ({
test: /\.(js|vue)$/,
loader: 'eslint-loader',
enforce: 'pre',
include: [resolve('src'), resolve('test')],
options: {
formatter: require('eslint-friendly-formatter'),
emitWarning: !config.dev.showEslintErrorsInOverlay
}
})
module.exports = {
context: path.resolve(__dirname, '../'),
entry: {
app: ['babel-polyfill', './src/main.js']
},
output: {
path: config.build.assetsRoot,
filename: '[name].js',
publicPath: process.env.NODE_ENV === 'production'
? config.build.assetsPublicPath
: config.dev.assetsPublicPath
},
resolve: {
extensions: ['.js', '.vue', '.json'],
alias: {
'vue$': 'vue/dist/vue.esm.js',
'@': resolve('src'),
}
},
module: {
rules: [
...(config.dev.useEslint ? [createLintingRule()] : []),
{
test: /\.vue$/,
loader: 'vue-loader',
options: vueLoaderConfig
},
{
test: /\.js$/,
loader: 'babel-loader',
include: [resolve('src'), resolve('test')]
},
{
test: /\.svg$/,
loader: 'svg-sprite-loader',
include: [resolve('src/icons')]
},
{
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
loader: 'url-loader',
exclude: [resolve('src/icons')],
options: {
limit: 10000,
name: utils.assetsPath('img/[name].[hash:7].[ext]')
}
},
{
test: /\.(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'
},
// 引入外部库, 无需webpack打包处理
externals: {
mockjs: 'Mock',
echarts: 'echarts',
ueditor: 'UE'
}
}

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

@ -0,0 +1,80 @@
'use strict'
const utils = require('./utils')
const webpack = require('webpack')
const config = require('../config')
const merge = require('webpack-merge')
const baseWebpackConfig = require('./webpack.base.conf')
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: true,
hot: true,
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
}),
]
})
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)
}
})
})

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

@ -0,0 +1,148 @@
'use strict'
const path = require('path')
const utils = require('./utils')
const webpack = require('webpack')
const config = require('../config')
const merge = require('webpack-merge')
const baseWebpackConfig = require('./webpack.base.conf')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin')
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
const env = process.env.NODE_ENV === 'testing'
? require('../config/test.env')
: require('../config/prod.env')
const webpackConfig = merge(baseWebpackConfig, {
module: {
rules: utils.styleLoaders({
sourceMap: config.build.productionSourceMap,
extract: true,
usePostCSS: true
})
},
devtool: config.build.productionSourceMap ? config.build.devtool : false,
output: {
path: config.build.assetsRoot,
filename: utils.assetsPath('js/[name].js'),
chunkFilename: utils.assetsPath('js/[id].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].css'),
// set the following option to `true` if you want to extract CSS from
// codesplit chunks into this main css file as well.
// This will result in *all* of your app's CSS being loaded upfront.
allChunks: false,
}),
// Compress extracted CSS. We are using this plugin so that possible
// duplicated CSS from different components can be deduped.
new OptimizeCSSPlugin({
cssProcessorOptions: config.build.productionSourceMap
? { safe: true, map: { inline: false } }
: { safe: true }
}),
// generate dist index.html with correct asset hash for caching.
// you can customize output by editing /index.html
// see https://github.com/ampedandwired/html-webpack-plugin
new HtmlWebpackPlugin({
filename: process.env.NODE_ENV === 'testing'
? 'index.html'
: config.build.index,
template: 'index.html',
inject: false,
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 vender modules does not change
new webpack.HashedModuleIdsPlugin(),
// enable scope hoisting
new webpack.optimize.ModuleConcatenationPlugin(),
// split vendor js into its own file
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
minChunks (module) {
// any required modules inside node_modules are extracted to vendor
return (
module.resource &&
/\.js$/.test(module.resource) &&
module.resource.indexOf(
path.join(__dirname, '../node_modules')
) === 0
)
}
}),
// extract webpack runtime and module manifest to its own file in order to
// prevent vendor hash from being updated whenever app bundle is updated
new webpack.optimize.CommonsChunkPlugin({
name: 'manifest',
minChunks: Infinity
}),
// This instance extracts shared chunks from code splitted chunks and bundles them
// in a separate chunk, similar to the vendor chunk
// see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk
new webpack.optimize.CommonsChunkPlugin({
name: 'app',
async: 'vendor-async',
children: true,
minChunks: 3
}),
// copy custom static assets
new CopyWebpackPlugin([
{
from: path.resolve(__dirname, '../static'),
to: config.build.assetsSubDirectory,
ignore: ['.*']
}
])
]
})
if (config.build.productionGzip) {
const CompressionWebpackPlugin = require('compression-webpack-plugin')
webpackConfig.plugins.push(
new CompressionWebpackPlugin({
asset: '[path].gz[query]',
algorithm: 'gzip',
test: new RegExp(
'\\.(' +
config.build.productionGzipExtensions.join('|') +
')$'
),
threshold: 10240,
minRatio: 0.8
})
)
}
if (config.build.bundleAnalyzerReport) {
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
webpackConfig.plugins.push(new BundleAnalyzerPlugin({ analyzerMode: 'static' }))
}
module.exports = webpackConfig

View File

@ -0,0 +1,32 @@
'use strict'
// This is the webpack config used for unit tests.
const utils = require('./utils')
const webpack = require('webpack')
const merge = require('webpack-merge')
const baseWebpackConfig = require('./webpack.base.conf')
const webpackConfig = merge(baseWebpackConfig, {
// use inline sourcemap for karma-sourcemap-loader
module: {
rules: utils.styleLoaders()
},
devtool: '#inline-source-map',
resolveLoader: {
alias: {
// necessary to to make lang="scss" work in test when using vue-loader's ?inject option
// see discussion at https://github.com/vuejs/vue-loader/issues/724
'scss-loader': 'sass-loader'
}
},
plugins: [
new webpack.DefinePlugin({
'process.env': require('../config/test.env')
})
]
})
// no need for app entry during tests
delete webpackConfig.entry
module.exports = webpackConfig

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

@ -0,0 +1,8 @@
'use strict'
const merge = require('webpack-merge')
const prodEnv = require('./prod.env')
module.exports = merge(prodEnv, {
NODE_ENV: '"development"',
OPEN_PROXY: false // 是否开启代理, 重置后需重启vue-cli
})

91
config/index.js Normal file
View File

@ -0,0 +1,91 @@
'use strict'
// Template version: 1.2.5
// see http://vuejs-templates.github.io/webpack for documentation.
const path = require('path')
const devEnv = require('./dev.env')
module.exports = {
dev: {
// Paths
assetsSubDirectory: 'static',
assetsPublicPath: '/',
// 代理列表, 是否开启代理通过[./dev.env.js]配置
proxyTable: devEnv.OPEN_PROXY === false ? {} : {
'/proxyApi': {
target: 'http://demo.renren.io/renren-fast/',
changeOrigin: true,
pathRewrite: {
'^/proxyApi': '/'
}
}
},
// Various Dev Server settings
host: 'localhost', // can be overwritten by process.env.HOST
port: 8001, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
autoOpenBrowser: true,
errorOverlay: true,
notifyOnErrors: true,
poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
// Use Eslint Loader?
// If true, your code will be linted during bundling and
// linting errors and warnings will be shown in the console.
useEslint: true,
// If true, eslint errors and warnings will also be shown in the error overlay
// in the browser.
showEslintErrorsInOverlay: false,
/**
* Source Maps
*/
// https://webpack.js.org/configuration/devtool/#development
devtool: '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,
// CSS Sourcemaps off by default because relative paths are "buggy"
// with this option, according to the CSS-Loader README
// (https://github.com/webpack/css-loader#sourcemaps)
// In our experience, they generally work as expected,
// just be aware of this issue when enabling this option.
cssSourceMap: false,
},
build: {
// Template for index.html
index: path.resolve(__dirname, '../dist/index.html'),
// Paths
assetsRoot: path.resolve(__dirname, '../dist'),
assetsSubDirectory: 'static',
assetsPublicPath: './',
/**
* Source Maps
*/
productionSourceMap: false,
// 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"'
}

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

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

View File

@ -1,50 +0,0 @@
server {
listen 80 default_server;
listen [::]:80 default_server;
root /usr/share/nginx/html;
index index.html index.htm;
location / {
try_files $uri $uri/ @rewrites;
}
location /spc/ {
proxy_pass http://58.210.206.230:8000/;
}
location /api {
access_log off;
add_header Access-Control-Allow-Origin * always;
add_header Access-Control-Allow-Methods GET,OPTIONS,POST,GET,PUT,DELETE always;
add_header Access-Control-Allow-Headers $http_access_control_request_headers;
add_header Access-Control-Allow-Credentials true;
add_header Access-Control-Max-Age 1800;
if ($request_method = OPTIONS){
add_header Access-Control-Allow-Origin * always;
add_header Access-Control-Allow-Methods GET,OPTIONS,POST,GET,PUT,DELETE always;
add_header Access-Control-Allow-Headers $http_access_control_request_headers;
add_header Access-Control-Allow-Credentials true;
add_header Access-Control-Max-Age 1800;
return 204;
}
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_buffering off;
proxy_pass http://mes:9090/api;
proxy_http_version 1.1;
}
location @rewrites {
rewrite ^(.+)$ /index.html last;
}
location ~* \.(?:ico|css|js|gif|jpe?g|png)$ {
expires max;
add_header Pragma public;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
}
}

BIN
demo-screenshot/01.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 462 KiB

BIN
demo-screenshot/02.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

66
gulpfile.js Normal file
View File

@ -0,0 +1,66 @@
var gulp = require('gulp');
var $ = require('gulp-load-plugins')();
var path = require('path');
var del = require('del');
var distPath = path.resolve('./dist');
var version = ''; // 版本号
var versionPath = ''; // 版本号路径
var env = ''; // 运行环境
// 创建版本号(年月日时分)
(function () {
var d = new Date();
var yy = d.getFullYear().toString().slice(2);
var MM = d.getMonth() + 1 >= 10 ? (d.getMonth() + 1) : '0' + (d.getMonth() + 1);
var DD = d.getDate() >= 10 ? d.getDate() : '0' + d.getDate();
var h = d.getHours() >= 10 ? d.getHours() : '0' + d.getHours();
var mm = d.getMinutes() >= 10 ? d.getMinutes() : '0' + d.getMinutes();
version = yy + MM + DD + h + mm;
versionPath = distPath + '/' + version;
})();
// 编译
gulp.task('build', $.shell.task([ 'node build/build.js' ]));
// 创建版本号目录
gulp.task('create:versionCatalog', ['build'], function () {
return gulp.src(`${distPath}/static/**/*`)
.pipe(gulp.dest(`${versionPath}/static/`))
});
// 替换${versionPath}/static/js/manifest.js window.SITE_CONFIG.cdnUrl占位变量
gulp.task('replace:cdnUrl', ['create:versionCatalog'], function () {
return gulp.src(`${versionPath}/static/js/manifest.js`)
.pipe($.replace(new RegExp(`"${require('./config').build.assetsPublicPath}"`, 'g'), 'window.SITE_CONFIG.cdnUrl + "/"'))
.pipe(gulp.dest(`${versionPath}/static/js/`))
});
// 替换${versionPath}/static/config/index-${env}.js window.SITE_CONFIG['version']配置变量
gulp.task('replace:version', ['create:versionCatalog'], function () {
return gulp.src(`${versionPath}/static/config/index-${env}.js`)
.pipe($.replace(/window.SITE_CONFIG\['version'\] = '.*'/g, `window.SITE_CONFIG['version'] = '${version}'`))
.pipe(gulp.dest(`${versionPath}/static/config/`))
});
// 合并${versionPath}/static/config/[index-${env}, init].js 至 ${distPath}/config/index.js
gulp.task('concat:config', ['replace:version'], function () {
return gulp.src([`${versionPath}/static/config/index-${env}.js`, `${versionPath}/static/config/init.js`])
.pipe($.concat('index.js'))
.pipe(gulp.dest(`${distPath}/config/`))
});
// 清空
gulp.task('clean', function () {
return del([versionPath])
});
gulp.task('default', ['clean'], function () {
// 获取环境配置
env = process.env.npm_config_qa ? 'qa' : process.env.npm_config_uat ? 'uat' : 'prod'
// 开始打包编译
gulp.start(['build', 'create:versionCatalog', 'replace:cdnUrl', 'replace:version', 'concat:config'], function () {
// 清除, 编译 / 处理项目中产生的文件
del([`${distPath}/static`, `${versionPath}/static/config`])
})
});

25
index.html Normal file
View File

@ -0,0 +1,25 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>人人快速开发平台</title>
<% if (process.env.NODE_ENV === 'production') { %>
<!-- 生产环境 -->
<script>document.write('<script src="./config/index.js?t=' + new Date().getTime() + '"><\/script>');</script>
<% }else { %>
<!-- 开发环境 -->
<link rel="shortcut icon" type="image/x-icon" href="./static/img/favicon.ico">
<script src="./static/config/index.js"></script>
<script src="./static/plugins/mock-1.0.0-beta3/mock-min.js"></script>
<script src="./static/plugins/echarts-3.8.5/echarts.common.min.js"></script>
<script src="./static/plugins/ueditor-1.4.3.3/ueditor.config.js"></script>
<script src="./static/plugins/ueditor-1.4.3.3/ueditor.all.min.js"></script>
<script src="./static/plugins/ueditor-1.4.3.3/lang/zh-cn/zh-cn.js"></script>
<% } %>
</head>
<body>
<div id="app"></div>
</body>
</html>

View File

@ -1,24 +0,0 @@
module.exports = {
moduleFileExtensions: ['js', 'jsx', 'json', 'vue'],
transform: {
'^.+\\.vue$': 'vue-jest',
'.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$':
'jest-transform-stub',
'^.+\\.jsx?$': 'babel-jest'
},
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1'
},
snapshotSerializers: ['jest-serializer-vue'],
testMatch: [
'**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)'
],
collectCoverageFrom: ['src/utils/**/*.{js,vue}', '!src/utils/auth.js', '!src/utils/request.js', 'src/components/**/*.{js,vue}'],
coverageDirectory: '<rootDir>/tests/unit/coverage',
// 'collectCoverage': true,
'coverageReporters': [
'lcov',
'text-summary'
],
testURL: 'http://localhost/'
}

View File

@ -1,9 +0,0 @@
{
"compilerOptions": {
"baseUrl": "./",
"paths": {
"@/*": ["src/*"]
}
},
"exclude": ["node_modules", "dist"]
}

View File

@ -1,116 +0,0 @@
import Mock from 'mockjs'
const List = []
const count = 100
const baseContent = '<p>I am testing data, I am testing data.</p><p><img src="https://wpimg.wallstcn.com/4c69009c-0fd4-4153-b112-6cb53d1cf943"></p>'
const image_uri = 'https://wpimg.wallstcn.com/e4558086-631c-425c-9430-56ffb46e70b3'
for (let i = 0; i < count; i++) {
List.push(Mock.mock({
id: '@increment',
timestamp: +Mock.Random.date('T'),
author: '@first',
reviewer: '@first',
title: '@title(5, 10)',
content_short: 'mock data',
content: baseContent,
forecast: '@float(0, 100, 2, 2)',
importance: '@integer(1, 3)',
'type|1': ['CN', 'US', 'JP', 'EU'],
'status|1': ['published', 'draft'],
display_time: '@datetime',
comment_disabled: true,
pageviews: '@integer(300, 5000)',
image_uri,
platforms: ['a-platform']
}))
}
export default [
{
url: '/vue-element-admin/article/list',
type: 'get',
response: config => {
const { importance, type, title, page = 1, limit = 20, sort } = config.query
let mockList = List.filter(item => {
if (importance && item.importance !== +importance) return false
if (type && item.type !== type) return false
if (title && item.title.indexOf(title) < 0) return false
return true
})
if (sort === '-id') {
mockList = mockList.reverse()
}
const pageList = mockList.filter((item, index) => index < limit * page && index >= limit * (page - 1))
return {
code: 20000,
data: {
total: mockList.length,
items: pageList
}
}
}
},
{
url: '/vue-element-admin/article/detail',
type: 'get',
response: config => {
const { id } = config.query
for (const article of List) {
if (article.id === +id) {
return {
code: 20000,
data: article
}
}
}
}
},
{
url: '/vue-element-admin/article/pv',
type: 'get',
response: _ => {
return {
code: 20000,
data: {
pvData: [
{ key: 'PC', pv: 1024 },
{ key: 'mobile', pv: 1024 },
{ key: 'ios', pv: 1024 },
{ key: 'android', pv: 1024 }
]
}
}
}
},
{
url: '/vue-element-admin/article/create',
type: 'post',
response: _ => {
return {
code: 20000,
data: 'success'
}
}
},
{
url: '/vue-element-admin/article/update',
type: 'post',
response: _ => {
return {
code: 20000,
data: 'success'
}
}
}
]

View File

@ -1,57 +0,0 @@
import Mock from 'mockjs'
import { param2Obj } from '../src/utils'
import user from './user'
import role from './role'
import article from './article'
import search from './remote-search'
const mocks = [
...user,
...role,
...article,
...search
]
// for front mock
// please use it cautiously, it will redefine XMLHttpRequest,
// which will cause many of your third-party libraries to be invalidated(like progress event).
export function mockXHR() {
// mock patch
// https://github.com/nuysoft/Mock/issues/300
Mock.XHR.prototype.proxy_send = Mock.XHR.prototype.send
Mock.XHR.prototype.send = function() {
if (this.custom.xhr) {
this.custom.xhr.withCredentials = this.withCredentials || false
if (this.responseType) {
this.custom.xhr.responseType = this.responseType
}
}
this.proxy_send(...arguments)
}
function XHR2ExpressReqWrap(respond) {
return function(options) {
let result = null
if (respond instanceof Function) {
const { body, type, url } = options
// https://expressjs.com/en/4x/api.html#req
result = respond({
method: type,
body: JSON.parse(body),
query: param2Obj(url)
})
} else {
result = respond
}
return Mock.mock(result)
}
}
for (const i of mocks) {
Mock.mock(new RegExp(i.url), i.type || 'get', XHR2ExpressReqWrap(i.response))
}
}
export default mocks

View File

@ -1,84 +0,0 @@
const chokidar = require('chokidar')
const bodyParser = require('body-parser')
const chalk = require('chalk')
const path = require('path')
const Mock = require('mockjs')
const mockDir = path.join(process.cwd(), 'mock')
function registerRoutes(app) {
let mockLastIndex
const { default: mocks } = require('./index.js')
const mocksForServer = mocks.map(route => {
return responseFake(route.url, route.type, route.response)
})
for (const mock of mocksForServer) {
app[mock.type](mock.url, mock.response)
mockLastIndex = app._router.stack.length
}
const mockRoutesLength = Object.keys(mocksForServer).length
return {
mockRoutesLength: mockRoutesLength,
mockStartIndex: mockLastIndex - mockRoutesLength
}
}
function unregisterRoutes() {
Object.keys(require.cache).forEach(i => {
if (i.includes(mockDir)) {
delete require.cache[require.resolve(i)]
}
})
}
// for mock server
const responseFake = (url, type, respond) => {
return {
url: new RegExp(`${process.env.VUE_APP_BASE_API}${url}`),
type: type || 'get',
response(req, res) {
console.log('request invoke:' + req.path)
res.json(Mock.mock(respond instanceof Function ? respond(req, res) : respond))
}
}
}
module.exports = app => {
// es6 polyfill
require('@babel/register')
// parse app.body
// https://expressjs.com/en/4x/api.html#req.body
app.use(bodyParser.json())
app.use(bodyParser.urlencoded({
extended: true
}))
const mockRoutes = registerRoutes(app)
var mockRoutesLength = mockRoutes.mockRoutesLength
var mockStartIndex = mockRoutes.mockStartIndex
// watch files, hot reload mock server
chokidar.watch(mockDir, {
ignored: /mock-server/,
ignoreInitial: true
}).on('all', (event, path) => {
if (event === 'change' || event === 'add') {
try {
// remove mock routes stack
app._router.stack.splice(mockStartIndex, mockRoutesLength)
// clear routes cache
unregisterRoutes()
const mockRoutes = registerRoutes(app)
mockRoutesLength = mockRoutes.mockRoutesLength
mockStartIndex = mockRoutes.mockStartIndex
console.log(chalk.magentaBright(`\n > Mock Server hot reload success! changed ${path}`))
} catch (error) {
console.log(chalk.redBright(error))
}
}
})
}

View File

@ -1,51 +0,0 @@
import Mock from 'mockjs'
const NameList = []
const count = 100
for (let i = 0; i < count; i++) {
NameList.push(Mock.mock({
name: '@first'
}))
}
NameList.push({ name: 'mock-Pan' })
export default [
// username search
{
url: '/vue-element-admin/search/user',
type: 'get',
response: config => {
const { name } = config.query
const mockNameList = NameList.filter(item => {
const lowerCaseName = item.name.toLowerCase()
return !(name && lowerCaseName.indexOf(name.toLowerCase()) < 0)
})
return {
code: 20000,
data: { items: mockNameList }
}
}
},
// transaction list
{
url: '/vue-element-admin/transaction/list',
type: 'get',
response: _ => {
return {
code: 20000,
data: {
total: 20,
'items|20': [{
order_no: '@guid()',
timestamp: +Mock.Random.date('T'),
username: '@name()',
price: '@float(1000, 15000, 0, 2)',
'status|1': ['success', 'pending']
}]
}
}
}
}
]

View File

@ -1,98 +0,0 @@
import Mock from 'mockjs'
import { deepClone } from '../../src/utils/index.js'
import { asyncRoutes, constantRoutes } from './routes.js'
const routes = deepClone([...constantRoutes, ...asyncRoutes])
const roles = [
{
key: 'admin',
name: 'admin',
description: 'Super Administrator. Have access to view all pages.',
routes: routes
},
{
key: 'editor',
name: 'editor',
description: 'Normal Editor. Can see all pages except permission page',
routes: routes.filter(i => i.path !== '/permission')// just a mock
},
{
key: 'visitor',
name: 'visitor',
description: 'Just a visitor. Can only see the home page and the document page',
routes: [{
path: '',
redirect: 'dashboard',
children: [
{
path: 'dashboard',
name: 'Dashboard',
meta: { title: 'dashboard', icon: 'dashboard' }
}
]
}]
}
]
export default [
// mock get all routes form server
{
url: '/vue-element-admin/routes',
type: 'get',
response: _ => {
return {
code: 20000,
data: routes
}
}
},
// mock get all roles form server
{
url: '/vue-element-admin/roles',
type: 'get',
response: _ => {
return {
code: 20000,
data: roles
}
}
},
// add role
{
url: '/vue-element-admin/role',
type: 'post',
response: {
code: 20000,
data: {
key: Mock.mock('@integer(300, 5000)')
}
}
},
// update role
{
url: '/vue-element-admin/role/[A-Za-z0-9]',
type: 'put',
response: {
code: 20000,
data: {
status: 'success'
}
}
},
// delete role
{
url: '/vue-element-admin/role/[A-Za-z0-9]',
type: 'delete',
response: {
code: 20000,
data: {
status: 'success'
}
}
}
]

View File

@ -1,525 +0,0 @@
// Just a mock data
export const constantRoutes = [
{
path: '/redirect',
component: 'layout/Layout',
hidden: true,
children: [
{
path: '/redirect/:path*',
component: 'views/redirect/index'
}
]
},
{
path: '/login',
component: 'views/login/index',
hidden: true
},
{
path: '/auth-redirect',
component: 'views/login/auth-redirect',
hidden: true
},
{
path: '/404',
component: 'views/error-page/404',
hidden: true
},
{
path: '/401',
component: 'views/error-page/401',
hidden: true
},
{
path: '',
component: 'layout/Layout',
redirect: 'dashboard',
children: [
{
path: 'dashboard',
component: 'views/dashboard/index',
name: 'Dashboard',
meta: { title: 'Dashboard', icon: 'dashboard', affix: true }
}
]
},
{
path: '/documentation',
component: 'layout/Layout',
children: [
{
path: 'index',
component: 'views/documentation/index',
name: 'Documentation',
meta: { title: 'Documentation', icon: 'documentation', affix: true }
}
]
},
{
path: '/guide',
component: 'layout/Layout',
redirect: '/guide/index',
children: [
{
path: 'index',
component: 'views/guide/index',
name: 'Guide',
meta: { title: 'Guide', icon: 'guide', noCache: true }
}
]
}
]
export const asyncRoutes = [
{
path: '/permission',
component: 'layout/Layout',
redirect: '/permission/index',
alwaysShow: true,
meta: {
title: 'Permission',
icon: 'lock',
roles: ['admin', 'editor']
},
children: [
{
path: 'page',
component: 'views/permission/page',
name: 'PagePermission',
meta: {
title: 'Page Permission',
roles: ['admin']
}
},
{
path: 'directive',
component: 'views/permission/directive',
name: 'DirectivePermission',
meta: {
title: 'Directive Permission'
}
},
{
path: 'role',
component: 'views/permission/role',
name: 'RolePermission',
meta: {
title: 'Role Permission',
roles: ['admin']
}
}
]
},
{
path: '/icon',
component: 'layout/Layout',
children: [
{
path: 'index',
component: 'views/icons/index',
name: 'Icons',
meta: { title: 'Icons', icon: 'icon', noCache: true }
}
]
},
{
path: '/components',
component: 'layout/Layout',
redirect: 'noRedirect',
name: 'ComponentDemo',
meta: {
title: 'Components',
icon: 'component'
},
children: [
{
path: 'tinymce',
component: 'views/components-demo/tinymce',
name: 'TinymceDemo',
meta: { title: 'Tinymce' }
},
{
path: 'markdown',
component: 'views/components-demo/markdown',
name: 'MarkdownDemo',
meta: { title: 'Markdown' }
},
{
path: 'json-editor',
component: 'views/components-demo/json-editor',
name: 'JsonEditorDemo',
meta: { title: 'Json Editor' }
},
{
path: 'split-pane',
component: 'views/components-demo/split-pane',
name: 'SplitpaneDemo',
meta: { title: 'SplitPane' }
},
{
path: 'avatar-upload',
component: 'views/components-demo/avatar-upload',
name: 'AvatarUploadDemo',
meta: { title: 'Avatar Upload' }
},
{
path: 'dropzone',
component: 'views/components-demo/dropzone',
name: 'DropzoneDemo',
meta: { title: 'Dropzone' }
},
{
path: 'sticky',
component: 'views/components-demo/sticky',
name: 'StickyDemo',
meta: { title: 'Sticky' }
},
{
path: 'count-to',
component: 'views/components-demo/count-to',
name: 'CountToDemo',
meta: { title: 'Count To' }
},
{
path: 'mixin',
component: 'views/components-demo/mixin',
name: 'ComponentMixinDemo',
meta: { title: 'componentMixin' }
},
{
path: 'back-to-top',
component: 'views/components-demo/back-to-top',
name: 'BackToTopDemo',
meta: { title: 'Back To Top' }
},
{
path: 'drag-dialog',
component: 'views/components-demo/drag-dialog',
name: 'DragDialogDemo',
meta: { title: 'Drag Dialog' }
},
{
path: 'drag-select',
component: 'views/components-demo/drag-select',
name: 'DragSelectDemo',
meta: { title: 'Drag Select' }
},
{
path: 'dnd-list',
component: 'views/components-demo/dnd-list',
name: 'DndListDemo',
meta: { title: 'Dnd List' }
},
{
path: 'drag-kanban',
component: 'views/components-demo/drag-kanban',
name: 'DragKanbanDemo',
meta: { title: 'Drag Kanban' }
}
]
},
{
path: '/charts',
component: 'layout/Layout',
redirect: 'noRedirect',
name: 'Charts',
meta: {
title: 'Charts',
icon: 'chart'
},
children: [
{
path: 'keyboard',
component: 'views/charts/keyboard',
name: 'KeyboardChart',
meta: { title: 'Keyboard Chart', noCache: true }
},
{
path: 'line',
component: 'views/charts/line',
name: 'LineChart',
meta: { title: 'Line Chart', noCache: true }
},
{
path: 'mixchart',
component: 'views/charts/mixChart',
name: 'MixChart',
meta: { title: 'Mix Chart', noCache: true }
}
]
},
{
path: '/nested',
component: 'layout/Layout',
redirect: '/nested/menu1/menu1-1',
name: 'Nested',
meta: {
title: 'Nested',
icon: 'nested'
},
children: [
{
path: 'menu1',
component: 'views/nested/menu1/index',
name: 'Menu1',
meta: { title: 'Menu1' },
redirect: '/nested/menu1/menu1-1',
children: [
{
path: 'menu1-1',
component: 'views/nested/menu1/menu1-1',
name: 'Menu1-1',
meta: { title: 'Menu1-1' }
},
{
path: 'menu1-2',
component: 'views/nested/menu1/menu1-2',
name: 'Menu1-2',
redirect: '/nested/menu1/menu1-2/menu1-2-1',
meta: { title: 'Menu1-2' },
children: [
{
path: 'menu1-2-1',
component: 'views/nested/menu1/menu1-2/menu1-2-1',
name: 'Menu1-2-1',
meta: { title: 'Menu1-2-1' }
},
{
path: 'menu1-2-2',
component: 'views/nested/menu1/menu1-2/menu1-2-2',
name: 'Menu1-2-2',
meta: { title: 'Menu1-2-2' }
}
]
},
{
path: 'menu1-3',
component: 'views/nested/menu1/menu1-3',
name: 'Menu1-3',
meta: { title: 'Menu1-3' }
}
]
},
{
path: 'menu2',
name: 'Menu2',
component: 'views/nested/menu2/index',
meta: { title: 'Menu2' }
}
]
},
{
path: '/example',
component: 'layout/Layout',
redirect: '/example/list',
name: 'Example',
meta: {
title: 'Example',
icon: 'example'
},
children: [
{
path: 'create',
component: 'views/example/create',
name: 'CreateArticle',
meta: { title: 'Create Article', icon: 'edit' }
},
{
path: 'edit/:id(\\d+)',
component: 'views/example/edit',
name: 'EditArticle',
meta: { title: 'Edit Article', noCache: true },
hidden: true
},
{
path: 'list',
component: 'views/example/list',
name: 'ArticleList',
meta: { title: 'Article List', icon: 'list' }
}
]
},
{
path: '/tab',
component: 'layout/Layout',
children: [
{
path: 'index',
component: 'views/tab/index',
name: 'Tab',
meta: { title: 'Tab', icon: 'tab' }
}
]
},
{
path: '/error',
component: 'layout/Layout',
redirect: 'noRedirect',
name: 'ErrorPages',
meta: {
title: 'Error Pages',
icon: '404'
},
children: [
{
path: '401',
component: 'views/error-page/401',
name: 'Page401',
meta: { title: 'Page 401', noCache: true }
},
{
path: '404',
component: 'views/error-page/404',
name: 'Page404',
meta: { title: 'Page 404', noCache: true }
}
]
},
{
path: '/error-log',
component: 'layout/Layout',
redirect: 'noRedirect',
children: [
{
path: 'log',
component: 'views/error-log/index',
name: 'ErrorLog',
meta: { title: 'Error Log', icon: 'bug' }
}
]
},
{
path: '/excel',
component: 'layout/Layout',
redirect: '/excel/export-excel',
name: 'Excel',
meta: {
title: 'Excel',
icon: 'excel'
},
children: [
{
path: 'export-excel',
component: 'views/excel/export-excel',
name: 'ExportExcel',
meta: { title: 'Export Excel' }
},
{
path: 'export-selected-excel',
component: 'views/excel/select-excel',
name: 'SelectExcel',
meta: { title: 'Select Excel' }
},
{
path: 'export-merge-header',
component: 'views/excel/merge-header',
name: 'MergeHeader',
meta: { title: 'Merge Header' }
},
{
path: 'upload-excel',
component: 'views/excel/upload-excel',
name: 'UploadExcel',
meta: { title: 'Upload Excel' }
}
]
},
{
path: '/zip',
component: 'layout/Layout',
redirect: '/zip/download',
alwaysShow: true,
meta: { title: 'Zip', icon: 'zip' },
children: [
{
path: 'download',
component: 'views/zip/index',
name: 'ExportZip',
meta: { title: 'Export Zip' }
}
]
},
{
path: '/pdf',
component: 'layout/Layout',
redirect: '/pdf/index',
children: [
{
path: 'index',
component: 'views/pdf/index',
name: 'PDF',
meta: { title: 'PDF', icon: 'pdf' }
}
]
},
{
path: '/pdf/download',
component: 'views/pdf/download',
hidden: true
},
{
path: '/theme',
component: 'layout/Layout',
redirect: 'noRedirect',
children: [
{
path: 'index',
component: 'views/theme/index',
name: 'Theme',
meta: { title: 'Theme', icon: 'theme' }
}
]
},
{
path: '/clipboard',
component: 'layout/Layout',
redirect: 'noRedirect',
children: [
{
path: 'index',
component: 'views/clipboard/index',
name: 'ClipboardDemo',
meta: { title: 'Clipboard Demo', icon: 'clipboard' }
}
]
},
{
path: '/i18n',
component: 'layout/Layout',
children: [
{
path: 'index',
component: 'views/i18n-demo/index',
name: 'I18n',
meta: { title: 'I18n', icon: 'international' }
}
]
},
{
path: 'external-link',
component: 'layout/Layout',
children: [
{
path: 'https://github.com/PanJiaChen/vue-element-admin',
meta: { title: 'External Link', icon: 'link' }
}
]
},
{ path: '*', redirect: '/404', hidden: true }
]

View File

@ -1,84 +0,0 @@
const tokens = {
admin: {
token: 'admin-token'
},
editor: {
token: 'editor-token'
}
}
const users = {
'admin-token': {
roles: ['admin'],
introduction: 'I am a super administrator',
avatar: 'https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif',
name: 'Super Admin'
},
'editor-token': {
roles: ['editor'],
introduction: 'I am an editor',
avatar: 'https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif',
name: 'Normal Editor'
}
}
export default [
// user login
{
url: '/vue-element-admin/user/login',
type: 'post',
response: config => {
const { username } = config.body
const token = tokens[username]
// mock error
if (!token) {
return {
code: 60204,
message: 'Account and password are incorrect.'
}
}
return {
code: 20000,
data: token
}
}
},
// get user info
{
url: '/vue-element-admin/user/info\.*',
type: 'get',
response: config => {
const { token } = config.query
const info = users[token]
// mock error
if (!info) {
return {
code: 50008,
message: 'Login failed, unable to get user details.'
}
}
return {
code: 20000,
data: info
}
}
},
// user logout
{
url: '/vue-element-admin/user/logout',
type: 'post',
response: _ => {
return {
code: 20000,
data: 'success'
}
}
}
]

20389
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,128 +1,100 @@
{
"name": "vue-element-admin",
"version": "4.2.1",
"description": "A magical vue admin. An out-of-box UI solution for enterprise applications. Newest development stack of vue. Lots of awesome features",
"author": "Pan <panfree23@gmail.com>",
"license": "MIT",
"name": "renren-fast-vue",
"version": "1.2.2",
"description": "renren-fast-vue基于vue、element-ui构建开发实现renren-fast后台管理前端功能提供一套更优的前端解决方案。",
"author": "daxiong.yang <daxiong.yang@qq.com>",
"private": true,
"scripts": {
"dev": "vue-cli-service serve",
"build:prod": "vue-cli-service build",
"build:stage": "vue-cli-service build --mode staging",
"preview": "node build/index.js --preview",
"lint": "eslint --ext .js,.vue src",
"test:unit": "jest --clearCache && vue-cli-service test:unit",
"test:ci": "npm run lint && npm run test:unit",
"svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml",
"new": "plop"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"src/**/*.{js,vue}": [
"eslint --fix",
"git add"
]
},
"keywords": [
"vue",
"admin",
"dashboard",
"element-ui",
"boilerplate",
"admin-template",
"management-system"
],
"repository": {
"type": "git",
"url": "git+https://github.com/PanJiaChen/vue-element-admin.git"
},
"bugs": {
"url": "https://github.com/PanJiaChen/vue-element-admin/issues"
"dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
"start": "npm run dev",
"unit": "jest --config test/unit/jest.conf.js --coverage",
"e2e": "node test/e2e/runner.js",
"test": "npm run unit && npm run e2e",
"lint": "eslint --ext .js,.vue src test/unit/specs test/e2e/specs",
"build": "gulp"
},
"dependencies": {
"axios": "0.18.1",
"clipboard": "2.0.4",
"codemirror": "5.45.0",
"desandro-matches-selector": "^2.0.2",
"driver.js": "0.9.5",
"dropzone": "5.5.1",
"echarts": "4.2.1",
"element-ui": "2.13.0",
"ev-emitter": "^2.1.0",
"file-saver": "2.0.1",
"fizzy-ui-utils": "^3.0.0",
"fuse.js": "3.4.4",
"get-size": "^2.0.3",
"js-cookie": "2.2.0",
"jsonlint": "1.6.3",
"jszip": "3.2.1",
"lodash": "^4.17.15",
"masonry-layout": "^4.2.2",
"moment": "^2.27.0",
"normalize.css": "7.0.0",
"nprogress": "0.2.0",
"outlayer": "^2.1.1",
"path-to-regexp": "2.4.0",
"screenfull": "4.2.0",
"script-loader": "0.7.2",
"showdown": "1.9.0",
"sortablejs": "1.8.4",
"tui-editor": "1.4.10",
"viewerjs": "^1.6.1",
"vue": "2.6.10",
"vue-bus": "^1.2.1",
"vue-count-to": "1.0.13",
"vue-i18n": "^8.22.2",
"vue-perfect-scrollbar": "^0.2.1",
"vue-router": "3.0.2",
"vue-splitpane": "1.0.4",
"vuedraggable": "2.20.0",
"vuex": "3.1.0",
"xlsx": "0.14.1"
"axios": "0.17.1",
"babel-plugin-component": "0.10.1",
"babel-polyfill": "6.26.0",
"element-ui": "2.8.2",
"gulp": "3.9.1",
"gulp-concat": "2.6.1",
"gulp-load-plugins": "1.5.0",
"gulp-replace": "0.6.1",
"gulp-shell": "0.6.5",
"lodash": "4.17.5",
"node-sass": "4.9.0",
"npm": "^6.9.0",
"sass-loader": "6.0.6",
"svg-sprite-loader": "3.7.3",
"vue": "2.5.16",
"vue-cookie": "1.1.4",
"vue-router": "3.0.1",
"vuex": "3.0.1"
},
"devDependencies": {
"@babel/core": "7.0.0",
"@babel/plugin-transform-runtime": "^7.12.10",
"@babel/preset-env": "^7.12.11",
"@babel/register": "7.0.0",
"@babel/runtime-corejs3": "^7.12.5",
"@vue/cli-plugin-babel": "3.5.3",
"@vue/cli-plugin-eslint": "^3.9.1",
"@vue/cli-plugin-unit-jest": "3.5.3",
"@vue/cli-service": "3.5.3",
"@vue/test-utils": "1.0.0-beta.29",
"autoprefixer": "^9.5.1",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "10.0.1",
"babel-jest": "23.6.0",
"chalk": "2.4.2",
"chokidar": "2.1.5",
"connect": "3.6.6",
"eslint": "5.15.3",
"eslint-plugin-vue": "5.2.2",
"html-webpack-plugin": "3.2.0",
"husky": "1.3.1",
"lint-staged": "8.1.5",
"mockjs": "1.0.1-beta3",
"plop": "2.3.0",
"runjs": "^4.3.2",
"sass": "^1.26.10",
"sass-loader": "^7.1.0",
"script-ext-html-webpack-plugin": "2.1.3",
"serve-static": "^1.13.2",
"svg-sprite-loader": "4.1.3",
"svgo": "1.2.0",
"vue-template-compiler": "2.6.10"
"autoprefixer": "7.1.2",
"babel-core": "6.22.1",
"babel-eslint": "7.1.1",
"babel-jest": "21.0.2",
"babel-loader": "7.1.1",
"babel-plugin-dynamic-import-node": "1.2.0",
"babel-plugin-transform-es2015-modules-commonjs": "6.26.0",
"babel-plugin-transform-runtime": "6.22.0",
"babel-preset-env": "1.3.2",
"babel-preset-stage-2": "6.22.0",
"babel-register": "6.22.0",
"chalk": "2.3.0",
"chromedriver": "2.27.2",
"copy-webpack-plugin": "4.0.1",
"cross-spawn": "5.0.1",
"css-loader": "0.28.0",
"eslint": "3.19.0",
"eslint-config-standard": "10.2.1",
"eslint-friendly-formatter": "3.0.0",
"eslint-loader": "1.7.1",
"eslint-plugin-html": "3.0.0",
"eslint-plugin-import": "2.7.0",
"eslint-plugin-node": "5.2.0",
"eslint-plugin-promise": "3.5.0",
"eslint-plugin-standard": "3.0.1",
"eventsource-polyfill": "0.9.6",
"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",
"jest": "21.2.0",
"jest-serializer-vue": "0.3.0",
"nightwatch": "0.9.12",
"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",
"rimraf": "2.6.0",
"selenium-server": "3.0.1",
"semver": "5.3.0",
"shelljs": "0.7.6",
"uglifyjs-webpack-plugin": "1.1.1",
"url-loader": "0.5.8",
"vue-jest": "1.0.2",
"vue-loader": "13.3.0",
"vue-style-loader": "3.0.1",
"vue-template-compiler": "2.5.16",
"webpack": "3.6.0",
"webpack-bundle-analyzer": "2.9.0",
"webpack-dev-server": "2.9.1",
"webpack-merge": "4.1.0"
},
"engines": {
"node": ">=8.9",
"npm": ">= 3.0.0"
"node": ">= 8.11.1",
"npm": ">= 5.6.0"
},
"browserslist": [
"> 1%",
"last 2 versions"
"last 2 versions",
"not ie <= 8"
]
}

View File

@ -1,26 +0,0 @@
{{#if template}}
<template>
<div />
</template>
{{/if}}
{{#if script}}
<script>
export default {
name: '{{ properCase name }}',
props: {},
data() {
return {}
},
created() {},
mounted() {},
methods: {}
}
</script>
{{/if}}
{{#if style}}
<style lang="scss" scoped>
</style>
{{/if}}

View File

@ -1,55 +0,0 @@
const { notEmpty } = require('../utils.js')
module.exports = {
description: 'generate vue component',
prompts: [{
type: 'input',
name: 'name',
message: 'component name please',
validate: notEmpty('name')
},
{
type: 'checkbox',
name: 'blocks',
message: 'Blocks:',
choices: [{
name: '<template>',
value: 'template',
checked: true
},
{
name: '<script>',
value: 'script',
checked: true
},
{
name: 'style',
value: 'style',
checked: true
}
],
validate(value) {
if (value.indexOf('script') === -1 && value.indexOf('template') === -1) {
return 'Components require at least a <script> or <template> tag.'
}
return true
}
}
],
actions: data => {
const name = '{{properCase name}}'
const actions = [{
type: 'add',
path: `src/components/${name}/index.vue`,
templateFile: 'plop-templates/component/index.hbs',
data: {
name: name,
template: data.blocks.includes('template'),
script: data.blocks.includes('script'),
style: data.blocks.includes('style')
}
}]
return actions
}
}

View File

@ -1,16 +0,0 @@
{{#if state}}
const state = {}
{{/if}}
{{#if mutations}}
const mutations = {}
{{/if}}
{{#if actions}}
const actions = {}
{{/if}}
export default {
namespaced: true,
{{options}}
}

View File

@ -1,62 +0,0 @@
const { notEmpty } = require('../utils.js')
module.exports = {
description: 'generate store',
prompts: [{
type: 'input',
name: 'name',
message: 'store name please',
validate: notEmpty('name')
},
{
type: 'checkbox',
name: 'blocks',
message: 'Blocks:',
choices: [{
name: 'state',
value: 'state',
checked: true
},
{
name: 'mutations',
value: 'mutations',
checked: true
},
{
name: 'actions',
value: 'actions',
checked: true
}
],
validate(value) {
if (!value.includes('state') || !value.includes('mutations')) {
return 'store require at least state and mutations'
}
return true
}
}
],
actions(data) {
const name = '{{name}}'
const { blocks } = data
const options = ['state', 'mutations']
const joinFlag = `,
`
if (blocks.length === 3) {
options.push('actions')
}
const actions = [{
type: 'add',
path: `src/store/modules/${name}.js`,
templateFile: 'plop-templates/store/index.hbs',
data: {
options: options.join(joinFlag),
state: blocks.includes('state'),
mutations: blocks.includes('mutations'),
actions: blocks.includes('actions')
}
}]
return actions
}
}

View File

@ -1,89 +0,0 @@
{{#if template}}
<template>
<div class="{{ name }}-container">
<base-table :table-config="tableProps" :table-data="list" :is-loading="listLoading">
<method-btn slot="handleBtn" :method-list="tableBtn" @clickBtn="handleClick" />
</base-table>
<pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" />
</div>
</template>
{{/if}}
{{#if script}}
<script>
// edit here
const tableBtn = [{
type: 'edit',
btnName: 'btn.edit'
}, {
type: 'delete',
btnName: 'btn.delete'
}]
const tableProps = [{
prop: '',
label: '',
width: '',
filter: null,
subcomponent: null,
align: ''
}]
import BaseTable from '@/components/BaseTable'
// edit here
import { fetchList } from '@/api/article'
import Pagination from '@/components/Pagination'
import MethodBtn from '@/components/BaseTable/subcomponents/MethodBtn'
export default {
name: '{{ properCase name }}',
props: {},
components: { Pagination, BaseTable, MethodBtn },
data() {
return {
tableBtn,
tableProps,
list: [],
total: 0,
listLoading: true,
listQuery: {
current: 1,
size: 10
}
}
},
created() {
this.getList()
},
mounted() {},
methods: {
handleClick(raw) {
},
getList() {
this.listLoading = true
// edit here
fetchList(this.listQuery).then(response => {
this.list = response.data.records
this.total = response.data.total
this.listLoading = false
})
}
}
}
</script>
{{/if}}
{{#if style}}
<style lang="scss" scoped>
.{{ name }}-container {
}
.edit-input {
padding-right: 100px;
}
.cancel-btn {
position: absolute;
right: 15px;
top: 10px;
}
</style>
{{/if}}

View File

@ -1,55 +0,0 @@
const { notEmpty } = require('../utils.js')
module.exports = {
description: 'generate a table-view',
prompts: [{
type: 'input',
name: 'name',
message: 'input table name please',
validate: notEmpty('name')
},
{
type: 'checkbox',
name: 'blocks',
message: 'Blocks:',
choices: [{
name: '<template>',
value: 'template',
checked: true
},
{
name: '<script>',
value: 'script',
checked: true
},
{
name: 'style',
value: 'style',
checked: true
}
],
validate(value) {
if (value.indexOf('script') === -1 && value.indexOf('template') === -1) {
return 'View require at least a <script> or <template> tag.'
}
return true
}
}
],
actions: data => {
const name = '{{name}}'
const actions = [{
type: 'add',
path: `src/views/${name}/index.vue`,
templateFile: 'plop-templates/table/index.hbs',
data: {
name: name,
template: data.blocks.includes('template'),
script: data.blocks.includes('script'),
style: data.blocks.includes('style')
}
}]
return actions
}
}

View File

@ -1,9 +0,0 @@
exports.notEmpty = name => {
return v => {
if (!v || v.trim === '') {
return `${name} is required`
} else {
return true
}
}
}

View File

@ -1,26 +0,0 @@
{{#if template}}
<template>
<div />
</template>
{{/if}}
{{#if script}}
<script>
export default {
name: '{{ properCase name }}',
props: {},
data() {
return {}
},
created() {},
mounted() {},
methods: {}
}
</script>
{{/if}}
{{#if style}}
<style lang="scss" scoped>
</style>
{{/if}}

View File

@ -1,55 +0,0 @@
const { notEmpty } = require('../utils.js')
module.exports = {
description: 'generate a view',
prompts: [{
type: 'input',
name: 'name',
message: 'view name please',
validate: notEmpty('name')
},
{
type: 'checkbox',
name: 'blocks',
message: 'Blocks:',
choices: [{
name: '<template>',
value: 'template',
checked: true
},
{
name: '<script>',
value: 'script',
checked: true
},
{
name: 'style',
value: 'style',
checked: true
}
],
validate(value) {
if (value.indexOf('script') === -1 && value.indexOf('template') === -1) {
return 'View require at least a <script> or <template> tag.'
}
return true
}
}
],
actions: data => {
const name = '{{name}}'
const actions = [{
type: 'add',
path: `src/views/${name}/index.vue`,
templateFile: 'plop-templates/view/index.hbs',
data: {
name: name,
template: data.blocks.includes('template'),
script: data.blocks.includes('script'),
style: data.blocks.includes('style')
}
}]
return actions
}
}

View File

@ -1,11 +0,0 @@
const viewGenerator = require('./plop-templates/view/prompt')
const componentGenerator = require('./plop-templates/component/prompt')
const storeGenerator = require('./plop-templates/store/prompt.js')
const tableGenerator = require('./plop-templates/table/prompt.js')
module.exports = function(plop) {
plop.setGenerator('view', viewGenerator)
plop.setGenerator('component', componentGenerator)
plop.setGenerator('store', storeGenerator)
plop.setGenerator('tablepage', tableGenerator)
}

View File

@ -1,5 +0,0 @@
module.exports = {
plugins: {
autoprefixer: {}
}
}

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

View File

@ -1,22 +0,0 @@
<!--
* @Author: gtz
* @Date: 2021-01-27 10:07:42
* @LastEditors: gtz
* @LastEditTime: 2021-02-24 10:15:28
* @Description: file content
-->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="renderer" content="webkit">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= webpackConfig.name %></title>
</head>
<body>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>

View File

@ -1,13 +1,10 @@
<template>
<div id="app">
<router-view />
</div>
<transition name="fade">
<router-view></router-view>
</transition>
</template>
<script>
export default {
name: 'App',
mounted() {
export default {
}
}
</script>

View File

@ -1,126 +0,0 @@
import request from '@/utils/request'
export function list(data) {
return request({
url: '/process/process-flow/page',
method: 'post',
data
})
}
export function getInfo(data) {
return request({
url: '/process/process-flow/get',
method: 'post',
data
})
}
export function enabled(data) {
return request({
url: '/process/process-flow/enabled',
method: 'post',
data
})
}
export function del(data) {
return request({
url: '/process/process-flow/delete',
method: 'post',
data
})
}
export function update(data) {
return request({
url: '/process/process-flow/update',
method: 'post',
data
})
}
export function add(data) {
return request({
url: '/process/process-flow/add',
method: 'post',
data
})
}
// 获取基板列表
export function listSubstrate(data) {
return request({
url: '/process/process-flow/substrateList',
method: 'post',
data
})
}
// 获取BOM列表
export function listBom(data) {
return request({
url: '/process/process-flow/bomList',
method: 'post',
data
})
}
// 获取某个设备下的bom
export function listEquipmentBom(data) {
return request({
url: 'process/process-flow-equipment/equipmentBomList',
method: 'post',
data
})
}
// 获取所有设备的bom
export function listAllEquipmentBom(data) {
return request({
url: '/process/process-flow-equipment/allEquipmentBomList',
method: 'post',
data
})
}
// 获取某个设备下的配方
export function listEquipmentRecipe(data) {
return request({
url: 'process/process-flow-equipment/equipmentRecipeList',
method: 'post',
data
})
}
// 获取所有设备下的配方
export function listAllEquipmentRecipe(data) {
return request({
url: '/process/process-flow-equipment/allEquipmentRecipeList',
method: 'post',
data
})
}
// 保存某个工艺下的所有节点
export function addProcessFlows(data) {
return request({
url: 'process/process-flow-equipment/add',
method: 'post',
data
})
}
// 获取工艺流程下所有节点
export function listProcessFlowNode(data) {
return request({
url: '/process/process-flow-equipment/list',
method: 'post',
data
})
}
// 获取工序列表
export function listProcess(data) {
return request({
url: '/process/work-sequence/list',
method: 'post',
data
})
}
// 获取工艺自动code
export function getCode() {
return request({
url: '/process/process-flow/getCode',
method: 'post'
})
}

View File

@ -1,49 +0,0 @@
/*
* @Author: gtz
* @Date: 2021-04-06 20:20:10
* @LastEditors: gtz
* @LastEditTime: 2021-04-07 16:14:47
* @Description: file content
*/
import request from '@/utils/request'
export function list(data) {
return request({
url: '/process/work-sequence/page',
method: 'post',
data
})
}
export function getInfo(data) {
return request({
url: '/process/work-sequence/get',
method: 'post',
data
})
}
export function del(data) {
return request({
url: '/process/work-sequence/delete',
method: 'post',
data
})
}
export function update(data) {
return request({
url: '/process/work-sequence/update',
method: 'post',
data
})
}
export function add(data) {
return request({
url: '/process/work-sequence/add',
method: 'post',
data
})
}

View File

@ -1,41 +0,0 @@
import request from '@/utils/request'
export function fetchList(query) {
return request({
url: '/vue-element-admin/article/list',
method: 'get',
params: query
})
}
export function fetchArticle(id) {
return request({
url: '/vue-element-admin/article/detail',
method: 'get',
params: { id }
})
}
export function fetchPv(pv) {
return request({
url: '/vue-element-admin/article/pv',
method: 'get',
params: { pv }
})
}
export function createArticle(data) {
return request({
url: '/vue-element-admin/article/create',
method: 'post',
data
})
}
export function updateArticle(data) {
return request({
url: '/vue-element-admin/article/update',
method: 'post',
data
})
}

View File

@ -1,13 +0,0 @@
/*
* @Date: 2021-01-21 17:30:30
* @LastEditors: gtz
* @LastEditTime: 2021-03-01 14:04:42
* @FilePath: \basic-admin\src\api\basic.js
* @Description: 基础功能接口定义
*/
// import request from '@/utils/request'
export const uploadPath = '/api/common/attachment/uploadFileFormData'
export const uploadOnePath = '/api/common/attachment/uploadFile'
export const cloudPath = 'http://mes.picaiba.com'

View File

@ -1,55 +0,0 @@
/*
* @Author: zwq
* @Date: 2020-12-29 16:00:14
* @LastEditors: zwq
* @LastEditTime: 2021-02-01 10:58:22
* @Description:
*/
import request from '@/utils/request'
export function alarmInfoList(data) { // 获取报警信息信息列表
return request({
url: '/basic/alarm/page',
method: 'post',
data
})
}
export function alarmInfoDetail(id) { // 获取报警信息信息单条数据
return request({
url: '/basic/alarm/get',
method: 'post',
data: { id }
})
}
export function alarmInfoUpdate(data) { // 更新报警信息信息单条数据
return request({
url: '/basic/alarm/update',
method: 'post',
data
})
}
export function alarmInfoAdd(data) { // 新增报警信息信息单条数据
return request({
url: '/basic/alarm/add',
method: 'post',
data
})
}
export function alarmInfoCode() { // 获取报警信息信息code
return request({
url: '/basic/alarm/get-code',
method: 'post'
})
}
export function alarmInfoDelete(id) { // 删除报警信息信息单条数据
return request({
url: '/basic/alarm/delete',
method: 'post',
data: { id }
})
}

View File

@ -1,55 +0,0 @@
/*
* @Author: zwq
* @Date: 2020-12-29 16:00:14
* @LastEditors: zwq
* @LastEditTime: 2021-01-16 15:44:55
* @Description:
*/
import request from '@/utils/request'
export function alarmLevelList(data) { // 获取报警等级信息列表
return request({
url: '/basic/alarm-grade/page',
method: 'post',
data
})
}
export function alarmLevelDetail(id) { // 获取报警等级信息单条数据
return request({
url: '/basic/alarm-grade/get',
method: 'post',
data: { id }
})
}
export function alarmLevelUpdate(data) { // 更新报警等级信息单条数据
return request({
url: '/basic/alarm-grade/update',
method: 'post',
data
})
}
export function alarmLevelAdd(data) { // 新增报警等级信息单条数据
return request({
url: '/basic/alarm-grade/add',
method: 'post',
data
})
}
export function alarmLevelCode() { // 获取报警等级信息code
return request({
url: '/basic/alarm-grade/get-code',
method: 'post'
})
}
export function alarmLevelDelete(id) { // 删除报警等级信息单条数据
return request({
url: '/basic/alarm-grade/delete',
method: 'post',
data: { id }
})
}

View File

@ -1,55 +0,0 @@
/*
* @Author: zwq
* @Date: 2020-12-29 16:00:14
* @LastEditors: zwq
* @LastEditTime: 2021-01-16 15:45:10
* @Description:
*/
import request from '@/utils/request'
export function alarmTypeList(data) { // 获取报警类型信息列表
return request({
url: '/basic/alarm-type/page',
method: 'post',
data
})
}
export function alarmTypeDetail(id) { // 获取报警类型信息单条数据
return request({
url: '/basic/alarm-type/get',
method: 'post',
data: { id }
})
}
export function alarmTypeUpdate(data) { // 更新报警类型信息单条数据
return request({
url: '/basic/alarm-type/update',
method: 'post',
data
})
}
export function alarmTypeAdd(data) { // 新增报警类型信息单条数据
return request({
url: '/basic/alarm-type/add',
method: 'post',
data
})
}
export function alarmTypeCode() { // 获取报警类型信息code
return request({
url: '/basic/alarm-type/get-code',
method: 'post'
})
}
export function alarmTypeDelete(id) { // 删除报警类型信息单条数据
return request({
url: '/basic/alarm-type/delete',
method: 'post',
data: { id }
})
}

View File

@ -1,55 +0,0 @@
/*
* @Author: zwq
* @Date: 2020-12-29 16:00:14
* @LastEditors: zwq
* @LastEditTime: 2021-01-27 16:42:27
* @Description:
*/
import request from '@/utils/request'
export function areaList(data) { // 获取缓存区区域信息列表
return request({
url: '/basic/area/page',
method: 'post',
data
})
}
export function areaDetail(id) { // 获取缓存区区域信息单条数据
return request({
url: '/basic/area/get',
method: 'post',
data: { id }
})
}
export function areaUpdate(data) { // 更新缓存区区域信息单条数据
return request({
url: '/basic/area/update',
method: 'post',
data
})
}
export function areaAdd(data) { // 新增缓存区区域信息单条数据
return request({
url: '/basic/area/add',
method: 'post',
data
})
}
export function areaCode() { // 获取缓存区区域信息code
return request({
url: '/basic/area/get-code',
method: 'post'
})
}
export function areaDelete(id) { // 删除缓存区区域信息单条数据
return request({
url: '/basic/area/delete',
method: 'post',
data: { id }
})
}

View File

@ -1,55 +0,0 @@
/*
* @Author: zwq
* @Date: 2020-12-29 16:00:14
* @LastEditors: zwq
* @LastEditTime: 2021-01-20 15:31:32
* @Description:
*/
import request from '@/utils/request'
export function cacheList(data) { // 获取缓存区信息列表
return request({
url: '/basic/cache/page',
method: 'post',
data
})
}
export function cacheDetail(id) { // 获取缓存区信息单条数据
return request({
url: '/basic/cache/get',
method: 'post',
data: { id }
})
}
export function cacheUpdate(data) { // 更新缓存区信息单条数据
return request({
url: '/basic/cache/update',
method: 'post',
data
})
}
export function cacheAdd(data) { // 新增缓存区信息单条数据
return request({
url: '/basic/cache/add',
method: 'post',
data
})
}
export function cacheCode() { // 获取缓存区信息code
return request({
url: '/basic/cache/get-code',
method: 'post'
})
}
export function cacheDelete(id) { // 删除缓存区信息单条数据
return request({
url: '/basic/cache/delete',
method: 'post',
data: { id }
})
}

View File

@ -1,55 +0,0 @@
/*
* @Author: zwq
* @Date: 2020-12-29 16:00:14
* @LastEditors: zwq
* @LastEditTime: 2021-01-28 09:38:31
* @Description:
*/
import request from '@/utils/request'
export function locationList(data) { // 获取库位信息列表
return request({
url: '/basic/stock/page',
method: 'post',
data
})
}
export function locationDetail(id) { // 获取库位信息单条数据
return request({
url: '/basic/stock/get',
method: 'post',
data: { id }
})
}
export function locationUpdate(data) { // 更新库位信息单条数据
return request({
url: '/basic/stock/update',
method: 'post',
data
})
}
export function locationAdd(data) { // 新增库位信息单条数据
return request({
url: '/basic/stock/add',
method: 'post',
data
})
}
export function locationCode() { // 获取库位信息code
return request({
url: '/basic/stock/get-code',
method: 'post'
})
}
export function locationDelete(id) { // 删除库位信息单条数据
return request({
url: '/basic/stock/delete',
method: 'post',
data: { id }
})
}

View File

@ -1,55 +0,0 @@
/*
* @Author: zwq
* @Date: 2020-12-29 16:00:14
* @LastEditors: zwq
* @LastEditTime: 2021-03-25 09:28:58
* @Description:
*/
import request from '@/utils/request'
export function shelfList(data) { // 获取货架信息列表
return request({
url: '/basic/shelf/page',
method: 'post',
data
})
}
export function shelfDetail(id) { // 获取货架信息单条数据
return request({
url: '/basic/shelf/get',
method: 'post',
data: { id }
})
}
export function shelfUpdate(data) { // 更新货架信息单条数据
return request({
url: '/basic/shelf/update',
method: 'post',
data
})
}
export function shelfAdd(data) { // 新增货架信息单条数据
return request({
url: '/basic/shelf/add',
method: 'post',
data
})
}
export function shelfCode() { // 获取货架信息code
return request({
url: '/basic/shelf/get-code',
method: 'post'
})
}
export function shelfDelete(id) { // 删除货架信息单条数据
return request({
url: '/basic/shelf/delete',
method: 'post',
data: { id }
})
}

View File

@ -1,70 +0,0 @@
/*
* @Author: zwq
* @Date: 2020-12-29 16:00:14
* @LastEditors: zwq
* @LastEditTime: 2021-07-21 14:29:10
* @Description:
*/
import request from '@/utils/request'
export function storageBoxList(data) { // 获取存储箱列表
return request({
url: '/basic/storage-tank/page',
method: 'post',
data
})
}
export function storageBoxDetail(id) { // 获取存储箱单条数据
return request({
url: '/basic/storage-tank/get',
method: 'post',
data: { id }
})
}
export function storageBoxUpdate(data) { // 更新存储箱单条数据
return request({
url: '/basic/storage-tank/update',
method: 'post',
data
})
}
export function storageBoxAdd(data) { // 新增存储箱单条数据
return request({
url: '/basic/storage-tank/add',
method: 'post',
data
})
}
export function storageBoxCode() { // 获取存储箱code
return request({
url: '/basic/storage-tank/get-code',
method: 'post'
})
}
export function storageBoxDelete(id) { // 删除存储箱单条数据
return request({
url: '/basic/storage-tank/delete',
method: 'post',
data: { id }
})
}
export function PositionDetailInfoAdd(data) { // 新增存储箱地址单条数据
return request({
url: '/basic/storage-tank-site/add',
method: 'post',
data
})
}
export function PositionDetailInfoList(data) { // 获取存储箱地址列表
return request({
url: '/basic/storage-tank-site/page',
method: 'post',
data
})
}

View File

@ -1,55 +0,0 @@
/*
* @Author: zwq
* @Date: 2020-12-29 16:00:14
* @LastEditors: zwq
* @LastEditTime: 2021-01-29 10:38:02
* @Description:
*/
import request from '@/utils/request'
export function CodeRulesList(data) { // 获取编码规则列表
return request({
url: '/basic/code-rule/page',
method: 'post',
data
})
}
export function CodeRulesDetail(id) { // 获取编码规则单条数据
return request({
url: '/basic/code-rule/get',
method: 'post',
data: { id }
})
}
export function CodeRulesUpdate(data) { // 更新编码规则单条数据
return request({
url: '/basic/code-rule/update',
method: 'post',
data
})
}
export function CodeRulesAdd(data) { // 新增编码规则单条数据
return request({
url: '/basic/code-rule/add',
method: 'post',
data
})
}
export function CodeRulesCode() { // 获取编码规则code
return request({
url: '/basic/code-rule/get-code',
method: 'post'
})
}
export function CodeRulesDelete(id) { // 删除编码规则单条数据
return request({
url: '/basic/code-rule/delete',
method: 'post',
data: { id }
})
}

View File

@ -1,55 +0,0 @@
/*
* @Author: zwq
* @Date: 2020-12-29 16:00:14
* @LastEditors: zwq
* @LastEditTime: 2021-02-02 11:08:34
* @Description:
*/
import request from '@/utils/request'
export function CodeRulesAttrList(data) { // 获取编码规则属性列表
return request({
url: '/basic/code-rule-arrt/page',
method: 'post',
data
})
}
export function CodeRulesAttrDetail(id) { // 获取编码规则属性单条数据
return request({
url: '/basic/code-rule-arrt/get',
method: 'post',
data: { id }
})
}
export function CodeRulesAttrUpdate(data) { // 更新编码规则属性单条数据
return request({
url: '/basic/code-rule-arrt/update',
method: 'post',
data
})
}
export function CodeRulesAttrAdd(data) { // 新增编码规则属性单条数据
return request({
url: '/basic/code-rule-arrt/add',
method: 'post',
data
})
}
export function CodeRulesAttrCode() { // 获取编码规则属性code
return request({
url: '/basic/code-rule-arrt/get-code',
method: 'post'
})
}
export function CodeRulesAttrDelete(id) { // 删除编码规则属性单条数据
return request({
url: '/basic/code-rule-arrt/delete',
method: 'post',
data: { id }
})
}

View File

@ -1,55 +0,0 @@
/*
* @Author: zwq
* @Date: 2020-12-29 16:00:14
* @LastEditors: zwq
* @LastEditTime: 2021-01-12 19:55:30
* @Description:
*/
import request from '@/utils/request'
export function customerList(data) { // 获取客户列表
return request({
url: '/basic/customer/page',
method: 'post',
data
})
}
export function customerDetail(id) { // 获取客户单条数据
return request({
url: '/basic/customer/get',
method: 'post',
data: { id }
})
}
export function customerUpdate(data) { // 更新客户单条数据
return request({
url: '/basic/customer/update',
method: 'post',
data
})
}
export function customerAdd(data) { // 新增客户单条数据
return request({
url: '/basic/customer/add',
method: 'post',
data
})
}
export function customerCode() { // 获取客户code
return request({
url: '/basic/customer/get-code',
method: 'post'
})
}
export function customerDelete(id) { // 删除客户单条数据
return request({
url: '/basic/customer/delete',
method: 'post',
data: { id }
})
}

View File

@ -1,55 +0,0 @@
/*
* @Author: zwq
* @Date: 2020-12-29 16:00:14
* @LastEditors: zwq
* @LastEditTime: 2021-01-12 19:56:00
* @Description:
*/
import request from '@/utils/request'
export function supplierList(data) { // 获取供应商列表
return request({
url: '/basic/supplier/page',
method: 'post',
data
})
}
export function supplierDetail(id) { // 获取供应商单条数据
return request({
url: '/basic/supplier/get',
method: 'post',
data: { id }
})
}
export function supplierUpdate(data) { // 更新供应商单条数据
return request({
url: '/basic/supplier/update',
method: 'post',
data
})
}
export function supplierAdd(data) { // 新增供应商单条数据
return request({
url: '/basic/supplier/add',
method: 'post',
data
})
}
export function supplierCode() { // 获取供应商code
return request({
url: '/basic/supplier/get-code',
method: 'post'
})
}
export function supplierDelete(id) { // 删除供应商单条数据
return request({
url: '/basic/supplier/delete',
method: 'post',
data: { id }
})
}

View File

@ -1,55 +0,0 @@
/*
* @Author: zwq
* @Date: 2020-12-29 16:00:14
* @LastEditors: zwq
* @LastEditTime: 2021-03-12 15:40:20
* @Description:
*/
import request from '@/utils/request'
export function equipmentAlarmList(data) { // 获取设备报警列表
return request({
url: '/basic/equipment-alarm/page',
method: 'post',
data
})
}
export function equipmentAlarmDetail(id) { // 获取设备报警单条数据
return request({
url: '/basic/equipment-alarm/get',
method: 'post',
data: { id }
})
}
export function equipmentAlarmUpdate(data) { // 更新设备报警单条数据
return request({
url: '/basic/equipment-alarm/update',
method: 'post',
data
})
}
export function equipmentAlarmAdd(data) { // 新增设备报警单条数据
return request({
url: '/basic/equipment-alarm/add',
method: 'post',
data
})
}
export function equipmentAlarmCode() { // 获取设备报警code
return request({
url: '/basic/equipment-alarm/get-code',
method: 'post'
})
}
export function equipmentAlarmDelete(id) { // 删除设备报警单条数据
return request({
url: '/basic/equipment-alarm/delete',
method: 'post',
data: { id }
})
}

View File

@ -1,55 +0,0 @@
/*
* @Author: zwq
* @Date: 2020-12-29 16:00:14
* @LastEditors: zwq
* @LastEditTime: 2021-02-02 16:00:23
* @Description:
*/
import request from '@/utils/request'
export function equipmentAlarmAttrList(data) { // 获取设备报警列表
return request({
url: '/basic/equipment-alarm-type/page',
method: 'post',
data
})
}
export function equipmentAlarmAttrDetail(id) { // 获取设备报警单条数据
return request({
url: '/basic/equipment-alarm-type/get',
method: 'post',
data: { id }
})
}
export function equipmentAlarmAttrUpdate(data) { // 更新设备报警单条数据
return request({
url: '/basic/equipment-alarm-type/update',
method: 'post',
data
})
}
export function equipmentAlarmAttrAdd(data) { // 新增设备报警单条数据
return request({
url: '/basic/equipment-alarm-type/add',
method: 'post',
data
})
}
export function equipmentAlarmAttrCode() { // 获取设备报警code
return request({
url: '/basic/equipment-alarm-type/get-code',
method: 'post'
})
}
export function equipmentAlarmAttrDelete(id) { // 删除设备报警单条数据
return request({
url: '/basic/equipment-alarm-type/delete',
method: 'post',
data: { id }
})
}

View File

@ -1,63 +0,0 @@
/*
* @Author: zwq
* @Date: 2021-01-29 09:39:04
* @LastEditors: zwq
* @LastEditTime: 2021-06-10 15:22:55
* @Description:
*/
import request from '@/utils/request'
export function equipmentDetectAreaList(data) { // 获取设备区域列表
return request({
url: '/basic/detect-distribution-area/page',
method: 'post',
data
})
}
export function equipmentDetectTreeList() { // 获取检测设备树形图
return request({
url: '/basic/detect-distribution-area/detect-area',
method: 'post'
})
}
export function equipmentDetectAreaDetail(id) { // 获取设备区域单条数据
return request({
url: '/basic/detect-distribution-area/get',
method: 'post',
data: { id }
})
}
export function equipmentDetectAreaUpdate(data) { // 更新设备区域单条数据
return request({
url: '/basic/detect-distribution-area/update',
method: 'post',
data
})
}
export function equipmentDetectAreaAdd(data) { // 新增设备区域单条数据
return request({
url: '/basic/detect-distribution-area/add',
method: 'post',
data
})
}
export function equipmentDetectAreaCode() { // 获取设备区域code
return request({
url: '/basic/detect-distribution-area/get-code',
method: 'post'
})
}
export function equipmentDetectAreaDelete(id) { // 删除设备区域单条数据
return request({
url: '/basic/detect-distribution-area/delete',
method: 'post',
data: { id }
})
}

View File

@ -1,56 +0,0 @@
/*
* @Author: zwq
* @Date: 2021-01-29 09:39:04
* @LastEditors: zwq
* @LastEditTime: 2021-05-28 09:44:01
* @Description:
*/
import request from '@/utils/request'
export function equipmentDetectAreaAttrList(data) { // 获取设备关联列表
return request({
url: '/basic/detect-equ-area-re/page',
method: 'post',
data
})
}
export function equipmentDetectAreaAttrDetail(id) { // 获取设备关联单条数据
return request({
url: '/basic/detect-equ-area-re/get',
method: 'post',
data: { id }
})
}
export function equipmentDetectAreaAttrUpdate(data) { // 更新设备关联单条数据
return request({
url: '/basic/detect-equ-area-re/update',
method: 'post',
data
})
}
export function equipmentDetectAreaAttrAdd(data) { // 新增设备关联单条数据
return request({
url: '/basic/detect-equ-area-re/add',
method: 'post',
data
})
}
export function equipmentDetectAreaAttrCode() { // 获取设备关联code
return request({
url: '/basic/detect-equ-area-re/get-code',
method: 'post'
})
}
export function equipmentDetectAreaAttrDelete(id) { // 删除设备关联单条数据
return request({
url: '/basic/detect-equ-area-re/delete',
method: 'post',
data: { id }
})
}

View File

@ -1,56 +0,0 @@
/*
* @Author: zwq
* @Date: 2021-01-29 09:39:04
* @LastEditors: zwq
* @LastEditTime: 2021-05-21 10:26:40
* @Description:
*/
import request from '@/utils/request'
export function equipmentDetectAreaSystemList(data) { // 获取设备关联列表
return request({
url: '/basic/detect-area-system/page',
method: 'post',
data
})
}
export function equipmentDetectAreaSystemDetail(id) { // 获取设备关联单条数据
return request({
url: '/basic/detect-area-system/get',
method: 'post',
data: { id }
})
}
export function equipmentDetectAreaSystemUpdate(data) { // 更新设备关联单条数据
return request({
url: '/basic/detect-area-system/update',
method: 'post',
data
})
}
export function equipmentDetectAreaSystemAdd(data) { // 新增设备关联单条数据
return request({
url: '/basic/detect-area-system/add',
method: 'post',
data
})
}
export function equipmentDetectAreaSystemCode() { // 获取设备关联code
return request({
url: '/basic/detect-area-system/get-code',
method: 'post'
})
}
export function equipmentDetectAreaSystemDelete(id) { // 删除设备关联单条数据
return request({
url: '/basic/detect-area-system/delete',
method: 'post',
data: { id }
})
}

View File

@ -1,56 +0,0 @@
/*
* @Author: zwq
* @Date: 2021-01-29 09:39:04
* @LastEditors: zwq
* @LastEditTime: 2021-05-28 10:47:41
* @Description:
*/
import request from '@/utils/request'
export function DetectAreaSystemAttrList(data) { // 获取设备关联列表
return request({
url: '/basic/detect-equipment-area/page',
method: 'post',
data
})
}
export function DetectAreaSystemAttrDetail(id) { // 获取设备关联单条数据
return request({
url: '/basic/detect-equipment-area/get',
method: 'post',
data: { id }
})
}
export function DetectAreaSystemAttrUpdate(data) { // 更新设备关联单条数据
return request({
url: '/basic/detect-equipment-area/update',
method: 'post',
data
})
}
export function DetectAreaSystemAttrAdd(data) { // 新增设备关联单条数据
return request({
url: '/basic/detect-equipment-area/add',
method: 'post',
data
})
}
export function DetectAreaSystemAttrCode() { // 获取设备关联code
return request({
url: '/basic/detect-equipment-area/get-code',
method: 'post'
})
}
export function DetectAreaSystemAttrDelete(id) { // 删除设备关联单条数据
return request({
url: '/basic/detect-equipment-area/delete',
method: 'post',
data: { id }
})
}

View File

@ -1,56 +0,0 @@
/*
* @Author: zwq
* @Date: 2021-01-29 09:39:04
* @LastEditors: zwq
* @LastEditTime: 2021-04-08 15:56:09
* @Description:
*/
import request from '@/utils/request'
export function equipmentDetectParamList(data) { // 获取设备参数列表
return request({
url: '/basic/detect-equipment-param/page',
method: 'post',
data
})
}
export function equipmentDetectParamDetail(id) { // 获取设备参数单条数据
return request({
url: '/basic/detect-equipment-param/get',
method: 'post',
data: { id }
})
}
export function equipmentDetectParamUpdate(data) { // 更新设备参数单条数据
return request({
url: '/basic/detect-equipment-param/update',
method: 'post',
data
})
}
export function equipmentDetectParamAdd(data) { // 新增设备参数单条数据
return request({
url: '/basic/detect-equipment-param/add',
method: 'post',
data
})
}
export function equipmentDetectParamCode() { // 获取设备参数code
return request({
url: '/basic/detect-equipment-param/get-code',
method: 'post'
})
}
export function equipmentDetectParamDelete(id) { // 删除设备参数单条数据
return request({
url: '/basic/detect-equipment-param/delete',
method: 'post',
data: { id }
})
}

View File

@ -1,55 +0,0 @@
/*
* @Author: zwq
* @Date: 2020-12-29 16:00:14
* @LastEditors: zwq
* @LastEditTime: 2021-05-21 10:03:53
* @Description:
*/
import request from '@/utils/request'
export function equipmentDetectSystemList(data) { // 获取检测系统列表
return request({
url: '/basic/detect-system/page',
method: 'post',
data
})
}
export function equipmentDetectSystemDetail(id) { // 获取检测系统单条数据
return request({
url: '/basic/detect-system/get',
method: 'post',
data: { id }
})
}
export function equipmentDetectSystemUpdate(data) { // 更新检测系统单条数据
return request({
url: '/basic/detect-system/update',
method: 'post',
data
})
}
export function equipmentDetectSystemAdd(data) { // 新增检测系统单条数据
return request({
url: '/basic/detect-system/add',
method: 'post',
data
})
}
export function equipmentDetectSystemCode() { // 获取检测系统code
return request({
url: '/basic/detect-system/get-code',
method: 'post'
})
}
export function equipmentDetectSystemDelete(id) { // 删除检测系统单条数据
return request({
url: '/basic/detect-system/delete',
method: 'post',
data: { id }
})
}

View File

@ -1,57 +0,0 @@
/*
* @Author: zwq
* @Date: 2021-01-29 09:39:04
* @LastEditors: Please set LastEditors
* @LastEditTime: 2021-05-13 10:34:03
* @Description:
*/
import request from '@/utils/request'
export function equipmentGroupList(data) { // 获取设备分组列表
return request({
url: '/equipment/equipment-group/findAll',
method: 'post',
data
})
}
export function equipmentGroupDetail(id) { // 获取设备分组列表
return request({
url: '/equipment/equipment-group/findById',
method: 'post',
data: { id }
})
}
export function equipmentGroupUpdate(data) { // 更新设备分组单条数据
return request({
url: '/equipment/equipment-group/update',
method: 'post',
data
})
}
export function equipmentGroupAdd(data) { // 新增设备分组单条数据
return request({
url: '/equipment/equipment-group/create',
method: 'post',
data
})
}
export function equipmentGroupGetCode(data) { // 获取随机生成的设备编码
return request({
url: '/equipment/equipment-group/getCode',
method: 'post',
data
})
}
export function equipmentGroupDelete(id) { // 删除设备分组单条数据
return request({
url: '/equipment/equipment-group/delete',
method: 'post',
data: { id }
})
}

View File

@ -1,71 +0,0 @@
/*
* @Author: zwq
* @Date: 2020-12-29 16:00:14
* @LastEditors: zwq
* @LastEditTime: 2021-03-12 09:40:01
* @Description:
*/
import request from '@/utils/request'
export function equipmentInfoList(data) { // 获取设备信息列表
return request({
url: '/basic/equipment/page',
method: 'post',
data
})
}
export function equipmentInfoDetail(id) { // 获取设备信息单条数据
return request({
url: '/basic/equipment/get',
method: 'post',
data: { id }
})
}
export function equipmentInfoUpdate(data) { // 更新设备信息单条数据
return request({
url: '/basic/equipment/update',
method: 'post',
data
})
}
export function equipmentInfoAdd(data) { // 新增设备信息单条数据
return request({
url: '/basic/equipment/add',
method: 'post',
data
})
}
export function equipmentInfoCode() { // 获取设备信息code
return request({
url: '/basic/equipment/get-code',
method: 'post'
})
}
export function equipmentInfoDelete(id) { // 删除设备信息单条数据
return request({
url: '/basic/equipment/delete',
method: 'post',
data: { id }
})
}
export function equipmentInfoFileAdd(data) { // 设备信息上传
return request({
url: '/basic/equipment-file/update-file',
method: 'post',
data
})
}
export function getEquipmentInfoFile(data) { // 设备信息下载
return request({
url: '/basic/equipment-file/get-by-param',
method: 'post',
data
})
}

View File

@ -1,55 +0,0 @@
/*
* @Author: zwq
* @Date: 2020-12-29 16:00:14
* @LastEditors: zwq
* @LastEditTime: 2021-01-20 12:00:52
* @Description:
*/
import request from '@/utils/request'
export function equipmentInfoAttrList(data) { // 获取设备属性列表
return request({
url: '/basic/equipment-attr/page',
method: 'post',
data
})
}
export function equipmentInfoAttrDetail(id) { // 获取设备属性单条数据
return request({
url: '/basic/equipment-attr/get',
method: 'post',
data: { id }
})
}
export function equipmentInfoAttrUpdate(data) { // 更新设备属性单条数据
return request({
url: '/basic/equipment-attr/update',
method: 'post',
data
})
}
export function equipmentInfoAttrAdd(data) { // 新增设备属性单条数据
return request({
url: '/basic/equipment-attr/add',
method: 'post',
data
})
}
export function equipmentInfoAttrCode() { // 获取设备属性code
return request({
url: '/basic/equipment-attr/get-code',
method: 'post'
})
}
export function equipmentInfoAttrDelete(id) { // 删除设备属性单条数据
return request({
url: '/basic/equipment-attr/delete',
method: 'post',
data: { id }
})
}

View File

@ -1,72 +0,0 @@
/*
* @Author: zwq
* @Date: 2020-12-29 16:00:14
* @LastEditors: zwq
* @LastEditTime: 2021-03-12 09:25:09
* @Description:
*/
import request from '@/utils/request'
export function equipmentLinkList(data) { // 获取连线设备列表
return request({
url: '/basic/connecting-device/page',
method: 'post',
data
})
}
export function equipmentLinkDetail(id) { // 获取连线设备单条数据
return request({
url: '/basic/connecting-device/get',
method: 'post',
data: { id }
})
}
export function equipmentLinkUpdate(data) { // 更新连线设备单条数据
return request({
url: '/basic/connecting-device/update',
method: 'post',
data
})
}
export function equipmentLinkAdd(data) { // 新增连线设备单条数据
return request({
url: '/basic/connecting-device/add',
method: 'post',
data
})
}
export function equipmentLinkCode() { // 获取连线设备code
return request({
url: '/basic/connecting-device/get-code',
method: 'post'
})
}
export function equipmentLinkDelete(id) { // 删除连线设备单条数据
return request({
url: '/basic/connecting-device/delete',
method: 'post',
data: { id }
})
}
export function equipmentLinkFileAdd(data) { // 连线设备上传
return request({
url: '/basic/connecting-device-file/update-file',
method: 'post',
data
})
}
export function getEquipmentLinkFile(data) { // 连线设备下载
return request({
url: '/basic/connecting-device-file/get-by-param',
method: 'post',
data
})
}

View File

@ -1,55 +0,0 @@
/*
* @Author: zwq
* @Date: 2020-12-29 16:00:14
* @LastEditors: zwq
* @LastEditTime: 2021-01-20 10:35:56
* @Description:
*/
import request from '@/utils/request'
export function equipmentLinkAttrList(data) { // 获取连线设备属性列表
return request({
url: '/basic/connecting-device-attr/page',
method: 'post',
data
})
}
export function equipmentLinkAttrDetail(id) { // 获取连线设备属性单条数据
return request({
url: '/basic/connecting-device-attr/get',
method: 'post',
data: { id }
})
}
export function equipmentLinkAttrUpdate(data) { // 更新连线设备属性单条数据
return request({
url: '/basic/connecting-device-attr/update',
method: 'post',
data
})
}
export function equipmentLinkAttrAdd(data) { // 新增连线设备属性单条数据
return request({
url: '/basic/connecting-device-attr/add',
method: 'post',
data
})
}
export function equipmentLinkAttrCode() { // 获取连线设备属性code
return request({
url: '/basic/connecting-device-attr/get-code',
method: 'post'
})
}
export function equipmentLinkAttrDelete(id) { // 删除连线设备属性单条数据
return request({
url: '/basic/connecting-device-attr/delete',
method: 'post',
data: { id }
})
}

View File

@ -1,78 +0,0 @@
/*
* @Author: zwq
* @Date: 2020-12-29 16:00:14
* @LastEditors: zwq
* @LastEditTime: 2021-03-11 18:56:39
* @Description:
*/
import request from '@/utils/request'
export function equipmentTypeList(data) { // 获取设备类型列表
return request({
url: '/basic/equipment-type/page',
method: 'post',
data
})
}
export function equipmentTypeDetail(id) { // 获取设备类型单条数据
return request({
url: '/basic/equipment-type/get',
method: 'post',
data: { id }
})
}
export function equipmentTypeUpdate(data) { // 更新设备类型单条数据
return request({
url: '/basic/equipment-type/update',
method: 'post',
data
})
}
export function equipmentTypeAdd(data) { // 新增设备类型单条数据
return request({
url: '/basic/equipment-type/add',
method: 'post',
data
})
}
export function equipmentTypeCode() { // 获取设备类型code
return request({
url: '/basic/equipment-type/get-code',
method: 'post'
})
}
export function equipmentTypeDelete(id) { // 删除设备类型单条数据
return request({
url: '/basic/equipment-type/delete',
method: 'post',
data: { id }
})
}
export function equipmentTypeListAll() { // 获取全部设备类型层级关系
return request({
url: '/basic/equipment-type/list-all',
method: 'post'
})
}
export function equipmentTypeFileAdd(data) { // 新增设备类型上传
return request({
url: '/basic/equipment-type-file/update-file',
method: 'post',
data
})
}
export function getEquipmentTypeFile(data) { // 获取设备类型上传列表
return request({
url: '/basic/equipment-type-file/get-by-param',
method: 'post',
data
})
}

View File

@ -1,55 +0,0 @@
/*
* @Author: zwq
* @Date: 2020-12-29 16:00:14
* @LastEditors: zwq
* @LastEditTime: 2021-01-19 19:59:16
* @Description:
*/
import request from '@/utils/request'
export function maintenanceCycleList(data) { // 获取保养列表
return request({
url: '/basic/maintenance-period/page',
method: 'post',
data
})
}
export function maintenanceCycleDetail(id) { // 获取保养单条数据
return request({
url: '/basic/maintenance-period/get',
method: 'post',
data: { id }
})
}
export function maintenanceCycleUpdate(data) { // 更新保养单条数据
return request({
url: '/basic/maintenance-period/update',
method: 'post',
data
})
}
export function maintenanceCycleAdd(data) { // 新增保养单条数据
return request({
url: '/basic/maintenance-period/add',
method: 'post',
data
})
}
export function maintenanceCycleCode() { // 获取保养code
return request({
url: '/basic/maintenance-period/get-code',
method: 'post'
})
}
export function maintenanceCycleDelete(id) { // 删除保养单条数据
return request({
url: '/basic/maintenance-period/delete',
method: 'post',
data: { id }
})
}

View File

@ -1,55 +0,0 @@
/*
* @Author: zwq
* @Date: 2020-12-29 16:00:14
* @LastEditors: zwq
* @LastEditTime: 2021-01-19 19:52:52
* @Description:
*/
import request from '@/utils/request'
export function maintenanceTypeList(data) { // 获取维修列表
return request({
url: '/basic/maintenance-type/page',
method: 'post',
data
})
}
export function maintenanceTypeDetail(id) { // 获取维修单条数据
return request({
url: '/basic/maintenance-type/get',
method: 'post',
data: { id }
})
}
export function maintenanceTypeUpdate(data) { // 更新维修单条数据
return request({
url: '/basic/maintenance-type/update',
method: 'post',
data
})
}
export function maintenanceTypeAdd(data) { // 新增维修单条数据
return request({
url: '/basic/maintenance-type/add',
method: 'post',
data
})
}
export function maintenanceTypeCode() { // 获取维修code
return request({
url: '/basic/maintenance-type/get-code',
method: 'post'
})
}
export function maintenanceTypeDelete(id) { // 删除维修单条数据
return request({
url: '/basic/maintenance-type/delete',
method: 'post',
data: { id }
})
}

View File

@ -1,56 +0,0 @@
/*
* @Author: zwq
* @Date: 2021-01-29 09:39:04
* @LastEditors: zwq
* @LastEditTime: 2021-01-29 09:40:21
* @Description:
*/
import request from '@/utils/request'
export function sparePartsList(data) { // 获取备品备件列表
return request({
url: '/basic/tool-spare-part/page',
method: 'post',
data
})
}
export function sparePartsDetail(id) { // 获取备品备件单条数据
return request({
url: '/basic/tool-spare-part/get',
method: 'post',
data: { id }
})
}
export function sparePartsUpdate(data) { // 更新备品备件单条数据
return request({
url: '/basic/tool-spare-part/update',
method: 'post',
data
})
}
export function sparePartsAdd(data) { // 新增备品备件单条数据
return request({
url: '/basic/tool-spare-part/add',
method: 'post',
data
})
}
export function sparePartsCode() { // 获取备品备件code
return request({
url: '/basic/tool-spare-part/get-code',
method: 'post'
})
}
export function sparePartsDelete(id) { // 删除备品备件单条数据
return request({
url: '/basic/tool-spare-part/delete',
method: 'post',
data: { id }
})
}

View File

@ -1,48 +0,0 @@
/*
* @Author: zwq
* @Date: 2020-12-29 16:00:14
* @LastEditors: zwq
* @LastEditTime: 2021-07-06 11:10:22
* @Description:
*/
import request from '@/utils/request'
export function EquipmentScrapGradeList(data) { // 获取废片等级列表
return request({
url: '/basic/equipment-scraps-grade/pageForEquipmentGrade',
method: 'post',
data
})
}
export function EquipmentScrapGradeDetail(id) { // 获取废片等级单条数据
return request({
url: '/basic/equipment-scraps-grade/get',
method: 'post',
data: { id }
})
}
export function EquipmentScrapGradeUpdate(data) { // 更新废片等级单条数据
return request({
url: '/basic/equipment-scraps-grade/update',
method: 'post',
data
})
}
export function EquipmentScrapGradeAdd(data) { // 新增废片等级单条数据
return request({
url: '/basic/equipment-scraps-grade/add',
method: 'post',
data
})
}
export function EquipmentScrapGradeDelete(id) { // 删除废片等级单条数据
return request({
url: '/basic/equipment-scraps-grade/delete',
method: 'post',
data: { id }
})
}

View File

@ -1,58 +0,0 @@
/*
* @Author: zwq
* @Date: 2020-12-29 16:00:14
* @LastEditors: zwq
* @LastEditTime: 2020-12-30 11:54:24
* @Description:
*/
import request from '@/utils/request'
export function factoryList(data) { // 获取工厂列表
return request({
url: '/basic/factory/page',
method: 'post',
data
})
}
export function factoryDetail(id) { // 获取工厂单条数据
const data = {
'id': id
}
return request({
url: '/basic/factory/get',
method: 'post',
data
})
}
export function factoryUpdate(data) { // 更新工厂单条数据
return request({
url: '/basic/factory/update',
method: 'post',
data
})
}
export function factoryAdd(data) { // 新增工厂单条数据
return request({
url: '/basic/factory/add',
method: 'post',
data
})
}
export function factoryCode() { // 获取工厂code
return request({
url: '/basic/factory/get-code',
method: 'post'
})
}
export function factoryDelete(id) { // 删除工厂单条数据
return request({
url: '/basic/factory/delete',
method: 'post',
data: { id }
})
}

View File

@ -1,55 +0,0 @@
/*
* @Author: zwq
* @Date: 2020-12-29 16:00:14
* @LastEditors: zwq
* @LastEditTime: 2021-01-12 10:57:09
* @Description:
*/
import request from '@/utils/request'
export function lineList(data) { // 获取产线列表
return request({
url: '/basic/production-line/page',
method: 'post',
data
})
}
export function lineDetail(id) { // 获取产线单条数据
return request({
url: '/basic/production-line/get',
method: 'post',
data: { id }
})
}
export function lineUpdate(data) { // 更新产线单条数据
return request({
url: '/basic/production-line/update',
method: 'post',
data
})
}
export function lineAdd(data) { // 新增产线单条数据
return request({
url: '/basic/production-line/add',
method: 'post',
data
})
}
export function lineCode() { // 获取产线code
return request({
url: '/basic/production-line/get-code',
method: 'post'
})
}
export function lineDelete(id) { // 删除产线单条数据
return request({
url: '/basic/production-line/delete',
method: 'post',
data: { id }
})
}

View File

@ -1,55 +0,0 @@
/*
* @Author: zwq
* @Date: 2020-12-29 16:00:14
* @LastEditors: zwq
* @LastEditTime: 2021-01-12 10:56:44
* @Description:
*/
import request from '@/utils/request'
export function sectionList(data) { // 获取工段列表
return request({
url: '/basic/workshop-section/page',
method: 'post',
data
})
}
export function sectionDetail(id) { // 获取工段单条数据
return request({
url: '/basic/workshop-section/get',
method: 'post',
data: { id }
})
}
export function sectionUpdate(data) { // 更新工段单条数据
return request({
url: '/basic/workshop-section/update',
method: 'post',
data
})
}
export function sectionAdd(data) { // 新增工段单条数据
return request({
url: '/basic/workshop-section/add',
method: 'post',
data
})
}
export function sectionCode() { // 获取工段code
return request({
url: '/basic/workshop-section/get-code',
method: 'post'
})
}
export function sectionDelete(id) { // 删除工段单条数据
return request({
url: '/basic/workshop-section/delete',
method: 'post',
data: { id }
})
}

View File

@ -1,55 +0,0 @@
/*
* @Author: zwq
* @Date: 2020-12-29 16:00:14
* @LastEditors: zwq
* @LastEditTime: 2021-01-12 15:38:59
* @Description:
*/
import request from '@/utils/request'
export function groupList(data) { // 获取班组列表
return request({
url: '/basic/team/page',
method: 'post',
data
})
}
export function groupDetail(id) { // 获取班组单条数据
return request({
url: '/basic/team/get',
method: 'post',
data: { id }
})
}
export function groupUpdate(data) { // 更新班组单条数据
return request({
url: '/basic/team/update',
method: 'post',
data
})
}
export function groupAdd(data) { // 新增班组单条数据
return request({
url: '/basic/team/add',
method: 'post',
data
})
}
export function groupCode() { // 获取班组code
return request({
url: '/basic/team/get-code',
method: 'post'
})
}
export function groupDelete(id) { // 删除班组单条数据
return request({
url: '/basic/team/delete',
method: 'post',
data: { id }
})
}

Some files were not shown because too many files have changed in this diff Show More