学生档案管理系统

This commit is contained in:
伊丽莎白 2022-03-04 17:44:26 +08:00
commit afe18b80bb
57 changed files with 28291 additions and 0 deletions

3
.browserslistrc Normal file
View File

@ -0,0 +1,3 @@
> 1%
last 2 versions
not dead

5
.editorconfig Normal file
View File

@ -0,0 +1,5 @@
[*.{js,jsx,ts,tsx,vue}]
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = true

405
.eslintrc.js Normal file
View File

@ -0,0 +1,405 @@
/**
* Eslint 检查规则A
* "off" 或者 0 -- 关闭规则
* "warn" 或者 1 -- 将规则打开为警告不影响退出代码
* "error" 或者 2 -- 将规则打开为错误触发时退出代码为 1
*/
module.exports = {
root: true, // 禁用持续查找root
env: {
browser: true, // 启用浏览器全局变量。
node: true, // Node.js全局变量和Node.js范围。
es6: true // 启用ES6的功能。
},
parserOptions: {
parser: 'babel-eslint', // 解析器parser
ecmaVersion: 2020, // ECMA版本
sourceType: 'module' // 指定源代码存在的位置script | module默认为script
},
// eslint:recommended:表示引入eslint的核心功能并且报告一些常见的共同错误。
extends: ['eslint:recommended', 'plugin:vue/vue3-recommended'],
rules: {
'vue/html-self-closing': 0,
// 设置每行最大属性数
'vue/max-attributes-per-line': [
2,
{
singleline: 10, // 标签为单行时,每行最大属性数值为 10默认值为 1
multiline: {
max: 1, // 标签为多行时,每行最大属性数字为 1默认值为 1
allowFirstLine: false // 不允许属性与该标记名称位于同一行,默认值为 false
}
}
],
'vue/no-multiple-template-root': 'off',
// 禁用单行标签内容需换行的校验
'vue/singleline-html-element-content-newline': 'off',
// 禁用多行标签内容需换行的校验
'vue/multiline-html-element-content-newline': 'off',
// 组件 name 属性值必须使用帕斯卡命名法(单词首字母大写)
'vue/name-property-casing': ['error', 'PascalCase'],
// 禁用禁止使用 v-html 的校验
'vue/no-v-html': 'off',
// 对象必须使用 getter / setter 对,即:每个已定义 setter 的属性都需有一个 getter
'accessor-pairs': 2,
// 箭头函数 => 前后必须有空格
'arrow-spacing': [
2,
{
before: true,
after: true
}
],
// 单行代码块花括号打开块之后和关闭块之前,至少一个空格
// 'block-spacing': [2, 'always'],
// 强制执行标准大括号风格样式(关键字要与花括号保持在同一行)
'brace-style': [
2,
'1tbs',
{
allowSingleLine: true // 允许同一行上打开和关闭括号
}
],
// 关闭驼峰命名规则校验(变量命名时,名称之间不允许下划线,常量(全部大写)除外)
camelcase: [
0,
{
properties: 'always' // 属性名称强制执行驼峰命名法样式
}
],
// 在对象或数组中不允许尾随逗号
// 数组和对象键值对最后一个逗号, never参数不能带末尾的逗号, always参数必须带末尾的逗号
// always-multiline多行模式必须带逗号单行模式不能带逗号
// only-multiline都行
'comma-dangle': [2, 'never'],
// 变量声明,数组文字,对象文字,函数参数和序列中的逗号前后加上一致的间距
'comma-spacing': [
2,
{
before: false, // 在逗号前不允许有空格
after: true // 在逗号后需要一个或多个空格
}
],
// 使用标准逗号样式,逗号位于当前行的末尾。在数组元素,对象属性或变量声明在同一行之后和同一行需要逗号
'comma-style': [2, 'last'],
// 子类构造函数必须使用 super()调用父类构造函数。非子类的构造函数不得调用
'constructor-super': 2,
// 当一个块只包含一条语句时ifelse ifelseforwhile或 do 允许省略花括号
curly: [2, 'multi-line'],
// 表达式中点"."要求与属性位于同一行
'dot-location': [2, 'property'],
// 强制文件以换行符结束(文件以一空行结束)
'eol-last': 2,
// 强制使用 === 和 !== 但不将此规则应用于 null
eqeqeq: ['error', 'always', { null: 'ignore' }],
// 使用生成器时关键字 * 前后均须有空格
'generator-star-spacing': [
2,
{
before: true,
after: true
}
],
// 回调模式需处理 err 或 error报告所有未处理的错误
'handle-callback-err': [2, '^(err|error)$'],
// 使用两个空格进行缩进,
indent: [
2,
2,
{
SwitchCase: 1 // case 针对 switch 语句使用 2 个空格缩进
}
],
// 在 JSX 属性中强制使用单引号
'jsx-quotes': [2, 'prefer-single'],
// 对象字面量属性中强制在冒号后放置空格,冒号前不允许空格
'key-spacing': [
2,
{
beforeColon: false, // 不允许在对象文字中的键和冒号之间使用空格
afterColon: true // 需要在冒号和对象文字中的值之间至少有一个空格
}
],
// 关键字前后至少有一个空格
'keyword-spacing': [
2,
{
before: true,
after: true
}
],
// 构造函数名需以大写字母开头以下内置标识符可免除此规则Array、Boolean、 Date、Error、Function、Number、Object、RegExp、String、Symbol
'new-cap': [
2,
{
newIsCap: true, // new 方式调用的函数需以大写开头
capIsNew: false // 允许直接调用大写开头的函数,无需使用 new
}
],
// 使用 new 关键字调用无参构造函数,函数名后强制使用括号
'new-parens': 2,
// 禁止使用数组构造函数,
'no-array-constructor': 2,
// 禁止使用 arguments.caller 和 arguments.callee
'no-caller': 2,
// 关闭 console 检验规则
'no-console': 'off',
// 禁止给类赋值
'no-class-assign': 2,
// 禁止在条件语句中使用赋值运算符
'no-cond-assign': 2,
// 禁止修改 const 关键字声明的变量
'no-const-assign': 2,
// 关闭正则表达式中的控制字符校验规则
'no-control-regex': 0,
// 不允许对变量使用 delete 操作符
'no-delete-var': 2,
// 不允许在函数声明或表达式中使用重复的参数名称
'no-dupe-args': 2,
// 不允许在类的声明中出现重复名称
'no-dupe-class-members': 2,
// 不允许在对象中使用重复键
'no-dupe-keys': 2,
// 不允许在 switch 语句的 case 子句中使用重复的 case 分支
'no-duplicate-case': 2,
// 不允许在正则表达式中使用空字符
'no-empty-character-class': 2,
// 对象和数组使用解构时,不允许空模式
'no-empty-pattern': 2,
// 禁止使用 eval()函数
'no-eval': 2,
// 禁止给 catch 语句中的异常参数赋值
'no-ex-assign': 2,
// 不允许直接修改内置原生对象
'no-extend-native': 2,
// 避免不必要的函数绑定 bind()
'no-extra-bind': 2,
// 禁止不必要的布尔转换
'no-extra-boolean-cast': 2,
// 在使用函数表达式时,禁止使用不必要的括号
'no-extra-parens': [2, 'functions'],
// 禁止 switch 穿透,需使用 break 中断
'no-fallthrough': 2,
// 禁止省略浮点数中的 0
'no-floating-decimal': 2,
// 不允许重新分配 function 声明
'no-func-assign': 2,
// 禁止使用隐式 eval(),即:始终使用函数作为 setTimeout()、setInterval()和execScript()的第一个参数
'no-implied-eval': 2,
// 禁止在块中声明 function
'no-inner-declarations': [2, 'functions'],
// 不允许 RegExp 构造函数中使用无效的正则表达式字符串
'no-invalid-regexp': 2,
// 禁止使用无效空格(不是正常的制表符和空格),但允许在字符串中使用任何空格字符
'no-irregular-whitespace': 2,
// 禁止使用该__iterator__属性
'no-iterator': 2,
// label 标签名不能与变量名相同
'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,
// 禁止多个连续空行,最大连续空行数为 1
'no-multiple-empty-lines': [
2,
{
max: 1
}
],
// 不允许修改只读全局变量
'no-native-reassign': 2,
// 不允许否定 in 表达式中的左操作数
'no-negated-in-lhs': 2,
// 不允许使用 Object 构造函数
'no-new-object': 2,
// 不允许使用 new require
'no-new-require': 2,
// 禁止使用 Symbol 构造器
'no-new-symbol': 2,
// 禁止使用原始包装器new Stringnew Number 或 new Boolean
'no-new-wrappers': 2,
// 禁止将全局对象作为函数调用,即不允许调用 MathJSON 和 Reflect 对象作为函数
'no-obj-calls': 2,
// 不允许使用八进制
'no-octal': 2,
// 不允许字符串中的八进制转义序列
'no-octal-escape': 2,
// node 中避免使用__dirname 和__filename 全局变量进行路径字符串拼接
'no-path-concat': 2,
// 使用方法 getPrototypeOf 替换__proto__属性
'no-proto': 2,
// 不允许同一作用域内声明相同变量名称
'no-redeclare': 2,
// 正则表达式文字中不允许有多个空格
'no-regex-spaces': 2,
// return 语句中的赋值必需有括号包裹
'no-return-assign': [2, 'except-parens'],
// 不允许将变量自我赋值
'no-self-assign': 2,
// 禁止变量与自己进行比较操作
'no-self-compare': 2,
// 禁止使用逗号运算符,除非在 for 语句的初始化或更新部分,表达式序列显式包含在圆括号中
'no-sequences': 2,
// 禁止对全局对象赋值
'no-shadow-restricted-names': 2,
// 功能标识符与其应用程序之间不允许有间距
'no-spaced-func': 2,
// 禁止使用稀疏数组,不适用于最后一个元素之后的尾随逗号
'no-sparse-arrays': 2,
// 使用 this 前请确保 super() 已调用
'no-this-before-super': 2,
// 用 throw 抛错时,抛出 Error 对象而不是字符串
'no-throw-literal': 2,
// 禁止在行尾添加尾随空白(空格,制表符和其他 Unicode 空白字符)
'no-trailing-spaces': 2,
// 禁止引用未声明的变量
'no-undef': 2,
// 禁止使用 undefined 来初始化变量
'no-undef-init': 2,
// 禁止混淆多行表达式
'no-unexpected-multiline': 2,
// 检查循环条件内的引用是否在循环中被修改
'no-unmodified-loop-condition': 2,
// 当存在更简单的选择时,此规则不允许三元运算符
'no-unneeded-ternary': [
2,
{
defaultAssignment: false // 不允许将条件表达式作为默认的分配模式
}
],
// returnthrowcontinue和 break 语句后不允许跟代码
'no-unreachable': 2,
// 不允许 returnthrowbreak和 continue 语句使用 finally 块finally 代码块中不要再改变程序执行流程,但它允许间接使用
'no-unsafe-finally': 2,
// 不允许存在声明但未使用的变量,函数和函数的参数
'no-unused-vars': [
0,
{
vars: 'all', // 检查全局范围内的变量
args: 'none' // 不检查参数
}
],
// 禁止使用.call()和.apply()
'no-useless-call': 2,
// 禁止不必要的计算属性键作对象属性
'no-useless-computed-key': 2,
// 禁止不必要的构造函数
'no-useless-constructor': 2,
// 关闭不必要的转义检测规则
'no-useless-escape': 0,
// 对象的属性在同一行上时禁止在属性前使用空格,当对象和属性位于单独的行上时,此规则允许使用空格,因为通常在较长的属性链中添加换行符
'no-whitespace-before-property': 2,
// 禁止使用 with
'no-with': 2,
// 一个变量关键字varlet 或 const只声明一个变量
'one-var': [
2,
{
initialized: 'never' // 每个作用域要求多个变量声明用于初始化变量
}
],
// 使用一致的换行符样式,将换行符放置在运算符之后
'operator-linebreak': [
2,
'after',
{
overrides: {
'?': 'before', // 三元运算换行符置于 ? 前
':': 'before' // 三元运算换行符置于 : 前
}
}
],
// 在 block 语句和类的开头和结尾处不允许出现空行
'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'],
// 函数名称或 function 关键字与开头括号之间不允许有空格
'space-before-function-paren': 0
// 'space-before-function-paren': [
// 'error',
// {
// anonymous: 'always',
// named: 'never',
// asyncArrow: 'always'
// }
// ],
// 禁止在括号内使用空格
'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'],
// 不允许 NaN 值得直接比较,需使用 isNaN()
'use-isnan': 2,
// typeof 比较需使用有效字符串("undefined""object""boolean""number""string""function""symbol",和"bigint"
'valid-typeof': 2,
// 自调用匿名函数 (IIFEs) 使用括号包裹
'wrap-iife': [2, 'any'],
// yield 表达式前后都要有空格
'yield-star-spacing': [2, 'both'],
// 禁止 Yoda 条件(条件的字面值排在第一,而变量排在第二)
yoda: [2, 'never'],
// 使用 const 声明初始赋值后永远不重新赋值的变量
'prefer-const': 2,
// 生产环境中禁止使用 debugger 调试器
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
// 花括号内需要空格({}除外)
'object-curly-spacing': [
2,
'always',
{
objectsInObjects: false // 以对象元素开始或结束的花括号间不允许有空格
}
],
// 数组方括号内不允许使用空格
'array-bracket-spacing': [2, 'never']
}
}

22
.gitignore vendored Normal file
View File

@ -0,0 +1,22 @@
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

1
README.en.md Normal file
View File

@ -0,0 +1 @@
# 档案管理前台

39
README.md Normal file
View File

@ -0,0 +1,39 @@
# 档案管理前台
#### 介绍
{**以下是码云平台说明,您可以替换此简介**
码云是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN。专为开发者提供稳定、高效、安全的云端软件开发协作平台
无论是个人、团队、或是企业,都能够用码云实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)}
#### 软件架构
软件架构说明
#### 安装教程
1. xxxx
2. xxxx
3. xxxx
#### 使用说明
1. xxxx
2. xxxx
3. xxxx
#### 参与贡献
1. Fork 本仓库
2. 新建 Feat_xxx 分支
3. 提交代码
4. 新建 Pull Request
#### 码云特技
1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md
2. 码云官方博客 [blog.gitee.com](https://blog.gitee.com)
3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解码云上的优秀开源项目
4. [GVP](https://gitee.com/gvp) 全称是码云最有价值开源项目,是码云综合评定出的优秀开源项目
5. 码云官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help)
6. 码云封面人物是一档用来展示码云会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)

5
babel.config.js Normal file
View File

@ -0,0 +1,5 @@
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
}

12133
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

38
package.json Normal file
View File

@ -0,0 +1,38 @@
{
"name": "stu-fms",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"axios": "^0.19.2",
"core-js": "^3.6.5",
"echarts": "^4.9.0",
"element-ui": "^2.13.2",
"style-resources-loader": "^1.3.3",
"vue": "^2.6.11",
"vue-router": "^3.2.0",
"vuex": "^3.4.0"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^4.4.0",
"@vue/cli-plugin-eslint": "^4.4.0",
"@vue/cli-plugin-router": "^4.4.0",
"@vue/cli-plugin-vuex": "^4.4.0",
"@vue/cli-service": "^4.4.0",
"@vue/eslint-config-standard": "^5.1.2",
"babel-eslint": "^10.1.0",
"eslint": "^6.7.2",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.0",
"eslint-plugin-vue": "^6.2.2",
"less": "^3.0.4",
"less-loader": "^5.0.0",
"vue-template-compiler": "^2.6.11"
}
}

9
public/dist/animate.min.css vendored Normal file

File diff suppressed because one or more lines are too long

33
public/dist/global/global.css vendored Normal file
View File

@ -0,0 +1,33 @@
@charset "utf-8";
/*全局的css文件*/
html,body,#app{width:100%;height:100%}
body{margin:0px;padding:0px;}
/*重置样式*/
*{margin:0;padding:0;}
a,u{text-decoration: none;color:#000;}
i,em{font-style: normal;}
b,strong{font-weight: normal;}
h1,h2,h3,h3,h4,h5,h6{font-weight: normal;font-size: 16px;}
ul,ol,li{list-style: none;font-size: 16px;}
input{outline: none;}
img{border:0;display: block;}
/*滚动条相关的样式*/
*::-webkit-scrollbar-track-piece {
background-color: #f8f8f8;
}
*::-webkit-scrollbar {
width: 8px;
height: 9px;
}
*::-webkit-scrollbar-thumb {
background-color: #ccc;
background-clip: padding-box;
border-radius: 5px;
min-height: 28px;
}
*::-webkit-scrollbar-thumb:hover {
background-color: #bbb;
}

4
public/dist/theme/theme-primary.css vendored Normal file
View File

@ -0,0 +1,4 @@
/*主题样式文件*/
.body {
background: blue;
}

7
public/dist/theme/theme-primary.less vendored Normal file
View File

@ -0,0 +1,7 @@
/*主题样式文件*/
@theme-color:blue;
@theme-btn-primary:blue;
.body{
background: blue;
}

BIN
public/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

BIN
public/images/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

21
public/index.html Normal file
View File

@ -0,0 +1,21 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title><%= htmlWebpackPlugin.options.title %></title>
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<!-- 全局样式文件 -->
<link rel="stylesheet" type="text/css" href="dist/global/global.css"/>
<!-- 导入皮肤文件 -->
<!-- <link id="theme-css" rel="stylesheet" type="text/css" href="dist/theme/theme-primary.css"/> -->
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>

36
src/App.vue Normal file
View File

@ -0,0 +1,36 @@
<template>
<div id="app">
<template v-if="$store.state.showFramework">
<framework >
<!-- 主要内容区域 -->
<Router-view></Router-view>
</framework>
</template>
<template v-else>
<Router-view ></Router-view>
</template >
</div>
</template>
<script>
import framework from '@/components/framework'
export default {
components: { framework },
mounted() {
window.addEventListener('unload', this.unLoad)
window.addEventListener('load', this.load)
},
methods: {
load(){
//shiro
this.$shiro.initShiro(this);
},
unLoad() {
//store
sessionStorage.setItem('state', JSON.stringify(this.$store.state))
}
}
}
</script>
<style lang="less">
</style>

View File

@ -0,0 +1,19 @@
import request from '@/utils/request'
const URl = "/archive";
export function list(0, 1) {
return request.get('/api/archive/list', {
params: {
page: page,
size: size
}
}
).then(res => {
console.log(res);
}).catch(error => {
console.log("api请求失败", error);
})
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

BIN
src/assets/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

View File

@ -0,0 +1,19 @@
<template>
<div>
借阅状态
</div>
</template>
<script>
export default {
name: 'archive-borrow-status',
data () {
return {
}
}
}
</script>
<style>
</style>

View File

@ -0,0 +1,168 @@
<template>
<div>
<!-- 搜索框 -->
<el-form :inline="true" style="display: inline;float: right;" class="demo-form-inline;">
<el-form-item>
<el-input placeholder="请输入借阅者...." v-model="searchData" :inline="true">
<el-button slot="append" icon="el-icon-search" @click="search"></el-button>
</el-input>
</el-form-item>
</el-form>
<el-table height="370" :data="tableData" style="width: 100%" @selection-change="getRows">
<el-table-column type="selection" width="55">
</el-table-column>
<el-table-column prop="archiveId" label="档案ID">
</el-table-column>
<el-table-column prop="archiveName" label="档案名称">
</el-table-column>
<el-table-column prop="stuName" label="档案拥有者">
</el-table-column>
<el-table-column prop="username" label="借阅者">
</el-table-column>
<el-table-column label="档案借阅时间" width="190">
<template slot-scope="scope">
<i class="el-icon-time"></i>
<span style="margin-left: 10px">{{ scope.row.borrTime }}</span>
</template>
</el-table-column>
<el-table-column label="档案借阅状态" width="190">
<template slot-scope="scope">
<el-tag type="success" size="mini" v-if="scope.row.borrStatus == '0'">借阅中</el-tag>
<el-tag type="danger" size="mini" v-if="scope.row.borrStatus == '1'">已归还</el-tag>
<el-tag type="info" size="mini" v-if="scope.row.borrStatus == '-1' ">借阅超时</el-tag>
</template>
</el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-popconfirm
confirmButtonText='确定'
cancelButtonText='取消'
icon="el-icon-info"
iconColor="red"
title="是否确定删除该数据吗?"
@onConfirm="delet(scope.row)"
>
<el-button slot="reference" size="mini" type="danger">删除</el-button>
</el-popconfirm>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<el-pagination align="right" @current-change="handleCurrentChange"
:current-page.sync="currentPage3" :page-size="pageSize" layout="prev, pager, next, jumper"
:total="pageNum">
</el-pagination>
</div>
</template>
<script>
import request from '@/utils/request';
export default {
name: 'archive-borrow-info',
data() {
return {
//
currentPage: 0,
//
pageSize: 5,
//
pageNum: 100,
searchData: '',
//
tableData: [],
//
currentPage3: 0,
}
},
created() {
this.getList(this.currentPage, this.pageSize);
},
methods: {
//
//05
getList: function (page, size) {
request.get('/api/physical/archives/record/list', {
params: {
page: page,
size: size
}
}
).then(res => {
//
var data = res.data.data.records;
//
this.tableData = data;
//
this.pageNum = res.data.data.total;
console.log(res);
console.log("总页数", this.pageNum);
}).catch(error => {
console.log("api请求失败", error);
})
},
//
handleCurrentChange(page) {
this.getList(page, this.pageSize);
//
this.currentPage = page;
},
//
delet(data) {
console.log("删除", data);
request.post("/api/physical/archives/record/delete", data).then(res => {
if (res.data.status == 0) {
this.$message({
message: '删除成功!',
type: 'success',
center: true
})
} else {
this.$message({
message: '删除失败!',
type: 'warning',
center: true
})
}
}).catch(error => {
});
//
this.getList(this.currentPage,this.pageSize);
},
//
search(){
console.log(this.searchData);
request.get("/api/physical/archives/record/search",{
params:{
page:this.currentPage,
size:this.pageSize,
searchValue:this.searchData
}
}).then( res =>{
var data = res.data.data.records;
this.tableData =data;
//
this.pageNum = res.data.data.total;
}).catch( error =>{
console.log(error);
})
}
},
}
</script>
<style>
</style>

View File

@ -0,0 +1,229 @@
<template>
<div>
<el-button type="danger" size="medium" icon="el-icon-delete" @click="batchDelete">批量删除</el-button>
<el-button type="success" size="medium" icon="el-icon-finished" @click="batchAudit">批量审核</el-button>
<!-- 搜索框 -->
<el-form :inline="true" style="display: inline;float: right;" class="demo-form-inline;">
<el-form-item>
<el-input placeholder="请输入学号...." v-model="searchData" :inline="true">
<el-button slot="append" icon="el-icon-search" @click="search"></el-button>
</el-input>
</el-form-item>
</el-form>
<el-table height="370" :data="table2Data" style="width: 100%" @selection-change="getRows">
<el-table-column type="selection" width="55">
</el-table-column>
<el-table-column prop="id" label="档案ID">
</el-table-column>
<el-table-column prop="stuId" label="学号">
</el-table-column>
<el-table-column prop="dictDesc" label="档案类型">
</el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button type="info" size="mini" @click="$router.push('/userManager')">详情...</el-button>
<el-button type="danger" size="mini" v-if="scope.row.isAudited== '0'" @click="audit(scope.row.id)">审核
</el-button>
<el-button type="success" size="mini" v-if="scope.row.isAudited== '1'" disabled>审核已通过</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<el-pagination align="right" @current-change="handleCurrentChange"
:current-page.sync="currentPage3" :page-size="pageSize" layout="prev, pager, next, jumper"
:total="pageNum">
</el-pagination>
</div>
</template>
<script>
import request from '@/utils/request';
export default {
name: 'archives-check',
data() {
return {
//
rowData: {},
//ids
selectIds: [],
//
currentPage: 1,
//
pageSize: 5,
pageSize: 10,
//
pageNum: 100,
dialogVisible: false,
selectIds: [], // ids
searchData: '',
dialogType: '', //
dialogTitle: '',
value1: '',
value2: '',
currentPage3: 0,
pickerOptions: {
disabledDate(time) {
return time.getTime() > Date.now()
}
},
dialogFormVisible: false,
formLabelWidth: '120px',
//
table2Data: [],
}
},
created() {
this.getList(this.currentPage, this.pageSize);
},
methods: {
//
handleCurrentChange(val) {
this.getList(val, this.pageSize);
this.currentPage = val;
console.log('当前页:', this.currentPage);
},
//
//05
getList: function (page, size) {
request.get('/api/verify/list', {
params: {
page: page,
size: size
}
}
).then(res => {
//
console.log("res", res);
var data = res.data.data.records;
//
this.table2Data = data;
//
this.pageNum = res.data.data.total;
console.log("审核数据", data);
console.log("总页数", this.pageNum);
}).catch(error => {
console.log("api请求失败", error);
})
},
//
batchAudit() {
//
var ids = this.selectIds
if (ids.length <= 0) {
this.$message({
showClose: true,
message: '请至少选择一条数据审核',
type: 'warning',
center: true
})
}
console.log('需要审核的ids', ids)
},
//
search() {
var data = this.searchData;
console.log('searchData', data);
},
//
batchDelete() {
//
var ids = this.selectIds
if (ids.length <= 0) {
this.$message({
showClose: true,
message: '请至少选择一点数据删除',
type: 'warning',
center: true
})
return;
}
var deleteData = {};
deleteData.ids = ids;
console.log('需要删除的数据', deleteData);
request.post("/api/verify/deleteBatch", deleteData).then(res => {
if (res.data.status == 0) {
this.$message({
message: '批量删除成功!',
type: 'success',
center: true
})
} else {
this.$message({
message: '批量删除失败!',
type: 'warning',
center: true
})
}
}).catch(error => {
console.log(error);
})
//
this.getList(1, this.pageSize);
},
//
getRows(rows) {
this.selectIds = [];
for (var i = 0; i < rows.length; i++) {
this.selectIds.push(rows[i].id);
}
// console.log("ids",this.selectIds);
},
//
audit(id) {
console.log("审核id", id);
request.get("/api/verify/audit", {
params: {
id
}
}).then(res => {
if (res.data.status == 0) {
this.$message({
message: '审核成功!',
type: 'success',
center: true
})
} else {
this.$message({
message: '审核失败!',
type: 'warning',
center: true
})
}
//
this.getList(this.currentPage, this.pageSize);
}).catch(error => {
console.log(error);
})
}
}
}
</script>
<style>
.grid-content {
border-radius: 4px;
font-size: 18px;
min-height: 50px;
}
</style>

View File

@ -0,0 +1,428 @@
<template>
<div>
<!-- 档案信息表 -->
<el-button type="primary" size="medium" icon="el-icon-plus" @click="add">新增</el-button>
<el-button type="danger" size="medium" icon="el-icon-delete" @click="batchDelete">批量删除</el-button>
<el-button type="infor" size="medium" icon="el-icon-s-data" @click="testData">数据统计</el-button>
<!-- 搜索框 -->
<el-form :inline="true" style="display: inline;float: right;" class="demo-form-inline;">
<el-form-item>
<el-input placeholder="请输入用户名...." v-model="searchData" :inline="true">
<el-button slot="append" icon="el-icon-search" @click="search"></el-button>
</el-input>
</el-form-item>
</el-form>
<!-- 表格 -->
<el-table :data="table1Data" style="width: 100%" @selection-change="getRows">
<el-table-column type="selection" width="55">
</el-table-column>
<el-table-column prop="id" v-if="false">
</el-table-column>
<el-table-column prop="userId" label="用户ID" width="180">
</el-table-column>
<el-table-column prop="username" label="用户名" width="150">
</el-table-column>
<el-table-column label="档案创建时间" width="190">
<template slot-scope="scope">
<i class="el-icon-time"></i>
<span style="margin-left: 10px">{{ scope.row.created }}</span>
</template>
</el-table-column>
<el-table-column prop="borrCount" label="借阅次数">
</el-table-column>
<el-table-column prop="cutOffTime" label="截止时间">
<template slot-scope="scope">
<i class="el-icon-time"></i>
<span style="margin-left: 10px">{{ scope.row.cutOffTime }}</span>
</template>
</el-table-column>
<el-table-column align="right" size="200">
<!-- 编辑删除按钮 -->
<template slot-scope="scope">
<el-button size="mini" type="infor" icon="el-icon-edit" @click="edit(scope.row)">修改</el-button>
<el-button size="mini" type="danger" icon="el-icon-delete" @click="del(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- 对话框 -->
<el-dialog :title="dialogTitle" :visible.sync="dialogFormVisible" width="34%">
<el-form :model="form" class="demo-form-inline">
<el-form-item label="用户ID" :label-width="formLabelWidth">
<el-input v-model="form.userId" autocomplete="off" style="width: 218px;"></el-input>
</el-form-item>
<el-form-item label="用户名" :label-width="formLabelWidth">
<el-input v-model="form.username" autocomplete="off" style="width: 218px;"></el-input>
</el-form-item>
<el-form-item label="创建时间" :label-width="formLabelWidth">
<el-date-picker v-model="form.created" type="date" value-format="yyyy-MM-dd" placeholder="选择日期">
</el-date-picker>
</el-form-item>
<el-form-item label="借阅次数" :label-width="formLabelWidth">
<el-input v-model="form.borrCount" autocomplete="off" style="width: 218px;"></el-input>
</el-form-item>
<el-form-item label="截止时间" :label-width="formLabelWidth">
<el-date-picker v-model="form.cutOffTime" type="date" value-format="yyyy-MM-dd" placeholder="选择日期">
</el-date-picker>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancelDialog"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</div>
</el-dialog>
<!-- 分页 -->
<el-pagination align="right" @current-change="handleCurrentChange"
:current-page.sync="this.currentPage" :page-size="this.pageSize" layout="prev, pager, next, jumper"
:total="pageNum">
</el-pagination>
</div>
</template>
<script>
//api
import request from '@/utils/request';
export default {
name: 'archives-info',
data() {
return {
//
currentPage: 0,
//
pageSize: 5,
//
pageNum: 100,
selectIds: [], // ids
searchData: '',
dialogType: '', //
dialogTitle: '',
value1: '',
value2: '',
currentPage3: 0,
pickerOptions: {
disabledDate(time) {
return time.getTime() > Date.now()
}
},
dialogFormVisible: false,
formLabelWidth: '120px',
form: {
id: '',
userId: '',
created: '',
borrCount: '',
cutOffTime: ''
},
//
table1Data: [],
}
},
//
created() {
this.getList(this.currentPage, this.pageSize);
},
methods: {
//
//05
getList: function (page, size) {
request.get('/api/archive/list', {
params: {
page: page,
size: size
}
}
).then(res => {
//
var data = res.data.data.records;
//
this.table1Data = data;
//
this.pageNum = res.data.data.total;
console.log(res);
console.log("总页数", this.pageNum);
}).catch(error => {
console.log("api请求失败", error);
})
},
//
add() {
this.from = {};
this.dialogType = 'add';
//
this.dialogTitle = '新增';
this.dialogFormVisible = true;
}
,
//
edit(data) {
this.dialogType = 'edit'
//
this.dialogTitle = '编辑'
this.dialogFormVisible = true
//console.log('edit', data)
//
this.form.id = data.id;
this.form.userId = data.userId;
this.form.username = data.username;
this.form.borrCount = data.borrCount;
this.form.created = data.created;
this.form.cutOffTime = data.cutOffTime;
}
,
//
submit() {
//
if (this.dialogType == 'add') {
//
var form = this.form;
console.log("新增", form);
request.post('/api/archive/insert', form).then(res => {
if (res.data.status == 0) {
this.$message({
type: 'success',
message: '新增成功!',
center: true
});
} else {
this.$message({
type: 'warning',
message: '新增失败!',
center: true
});
}
}).catch(error => {
console.log("请求api错误" + "/api/archives/insert", error);
});
//
this.dialogFormVisible = false;
//
this.getList(this.currentPage, this.pageSize);
//
this.form = {};
}
//
if (this.dialogType == 'edit') {
var form = this.form;
console.log(this.form);
request.post('/api/archive/update', form).then(res => {
if (res.data.status == 0) {
this.$message({
type: 'success',
message: '修改成功!',
center: true
});
} else {
this.$message({
type: 'warning',
message: '修改失败!',
center: true
});
}
console.log("res=", res)
}).catch(error => {
console.log("请求api错误" + "/api/archives/update");
});
//
console.log('发送修改请求')
//
this.dialogFormVisible = false;
//
this.getList(this.currentPage, this.pageSize);
//form
this.form = {};
}
}
,
//
search() {
var data = this.searchData;
console.log('searchData', data);
request.get("/api/archive/search", {
params: {
page: 0,
size: this.pageSize,
searchValue: data
}
}).then(res => {
//
var data = res.data.data.records;
//
this.table1Data = data;
//
this.pageNum = res.data.data.total;
}).catch(error => {
console.log(error);
})
}
,
//
del(data) {
//
var deleteData = {
id: '',
userId: '',
username: '',
borrCount: '',
created: '',
cutOffTime: '',
};
deleteData.id = data.id;
deleteData.userId = data.userId;
deleteData.username = data.username;
deleteData.borrCount = data.borrCount;
deleteData.created = data.created;
deleteData.cutOffTime = data.cutOffTime;
console.log('删除行的数据', deleteData);
this.$confirm('是否确定删除该数据, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
request.post('/api/archive/delete', deleteData).then(res => {
console.log("删除", res);
if (res.data.status == 0) {
this.$message({
type: 'success',
message: '删除成功!',
center: true
});
}
else {
this.$message({
type: 'warning',
message: '删除失败!',
center: true
});
}
//
this.getList(this.currentPage, this.pageSize);
}).catch(error => {
console.log("api请求失败", error);
});
}
).catch(() => {
this.$message({
type: 'info',
message: '已取消删除',
center: true
});
});
}
,
//
getRows(rows) {
this.selectIds = [];
for (var i = 0; i < rows.length; i++) {
this.selectIds.push(rows[i].id);
}
// console.log("ids",this.selectIds);
},
//
batchDelete() {
//
var ids = this.selectIds;
var idsObj = {ids: []};
idsObj.ids = ids;
if (ids.length <= 0) {
this.$message({
showClose: true,
message: '请至少选择一点数据删除',
type: 'warning',
center: true
})
return;
}
console.log('需要删除的ids', idsObj);
request.post('/api/archive/deleteBatch', idsObj).then(res => {
console.log("批量删除", res);
if (res.data.status == 0) {
this.$message({
message: '批量删除成功!',
type: 'success',
center: true
})
} else {
this.$message({
message: '批量删除失败!',
type: 'warning',
center: true
})
}
//
this.getList(this.currentPage, this.pageSize);
}).catch(error => {
});
}
,
//
handleCurrentChange(page) {
this.getList(page, this.pageSize);
//
this.currentPage = page;
},
//
cancelDialog() {
this.dialogFormVisible = false;
this.form = {};
}
}
}
</script>
<style>
</style>

View File

@ -0,0 +1,186 @@
<template>
<div>
<!-- 表格 -->
<el-table :data="table1Data" style="width: 100%" @selection-change="getRows">
<el-table-column type="selection" width="55">
</el-table-column>
<el-table-column prop="id" label="档案ID" width="100">
</el-table-column>
<el-table-column prop="stuId" label="学号" width="150">
</el-table-column>
<el-table-column prop="archiveName" label="档案名称" width="150">
</el-table-column>
<el-table-column label="档案图片" width="190">
<template slot-scope="scope">
<el-image
style="width: 100px; height: 100px"
:src="scope.row.img"
:fit="fit"></el-image>
</template>
</el-table-column>
<el-table-column prop="position" label="存放位置" width="130">
</el-table-column>
<el-table-column label="档案入库时间" width="190">
<template slot-scope="scope">
<i class="el-icon-time"></i>
<span style="margin-left: 10px">{{ scope.row.inTime }}</span>
</template>
</el-table-column>
<el-table-column prop="operatorId" label="操作人员">
</el-table-column>
<el-table-column align="right" label="状态">
<template slot-scope="scope">
<el-tag type="success" size="small" v-if="scope.row.auditStatusCode =='4'">已入库</el-tag>
<el-tag type="danger" size="small" v-if="scope.row.auditStatusCode =='5'">已被驳回</el-tag>
<el-tag type="info" size="small" v-if="scope.row.auditStatusCode =='6'">已出库</el-tag>
</template>
</el-table-column>
<el-table-column align="right" label="操作">
<template slot-scope="scope">
<el-button size="mini" type="info" icon="el-icon-upload2"
v-if="scope.row.auditStatusCode!='4'" disabled>出库
</el-button>
<el-button size="mini" type="info" icon="el-icon-upload2" @click="outStock(scope.row)"
v-if="scope.row.auditStatusCode=='4'">出库
</el-button>
</template>
</el-table-column>
<el-table-column align="right" label="">
<template slot-scope="scope">
<el-popconfirm
confirmButtonText='确定'
cancelButtonText='取消'
icon="el-icon-info"
iconColor="red"
title="是否确定删除该数据吗?"
@onConfirm="delet(scope.row)"
>
<el-button slot="reference" size="mini" type="danger">删除</el-button>
</el-popconfirm>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<el-pagination align="right" @current-change="handleCurrentChange"
:current-page.sync="this.currentPage" :page-size="this.pageSize" layout="prev, pager, next, jumper"
:total="pageNum">
</el-pagination>
</div>
</template>
<script>
import request from '@/utils/request';
export default {
name: 'archiver-submit',
data() {
return {
//
currentPage: 0,
//
pageSize: 3,
//
pageNum: 100,
//
table1Data: [],
}
},
created() {
this.getList(this.currentPage, this.pageSize);
},
methods: {
//
//05
getList: function (page, size) {
request.get('/api//physical/archives/list', {
params: {
page: page,
size: size
}
}
).then(res => {
//
var data = res.data.data.records;
//
this.table1Data = data;
//
this.pageNum = res.data.data.total;
console.log(res);
console.log("总页数", this.pageNum);
}).catch(error => {
console.log("api请求失败", error);
})
},
//
handleCurrentChange(page) {
this.getList(page, this.pageSize);
//
this.currentPage = page;
},
//
delet(data) {
console.log("删除", data);
request.post("/api/physical/archives/delete", data).then(res => {
if (res.data.msg == "success") {
this.$message({
message: '删除成功!',
type: 'success',
center: true
})
} else {
this.$message({
message: '删除失败!',
type: 'warning',
center: true
})
}
}).catch(error => {
});
//
this.getList(this.currentPage, this.pageSize);
},
//
outStock(data) {
var id = data.id;
console.log("id",id);
request.get("/api/physical/archives/outStock",{
params:{
id
}
}).then(res => {
if (res.data.msg == "success") {
this.$message({
message: '出库成功!',
type: 'success',
center: true
})
} else {
this.$message({
message: '出库失败!',
type: 'warning',
center: true
})
}
this.getList(this.currentPage,this.pageSize);
});
}
},
}
</script>
<style>
</style>

View File

@ -0,0 +1,57 @@
<template>
<div>
<el-table :data="tableData" stripe style="width: 100%">
<el-table-column prop="title" label="标题" width="180">
</el-table-column>
<el-table-column prop="number" label="数量" width="180">
</el-table-column>
<el-table-column prop="updateTime" label="最新更新时间" width="180">
</el-table-column>
</el-table>
<!-- 分页 -->
<el-pagination align="right" @size-change="handleSizeChange" @current-change="handleCurrentChange"
:current-page.sync="currentPage3" :page-size="8" layout="prev, pager, next, jumper" :total="1000">
</el-pagination>
</div>
</template>
<script>
export default {
name: 'archives-title',
data () {
return {
currentPage3: 5,
tableData: [
{
title: '管理类',
number: '15',
updateTime: '2017-12-4'
},
{
title: '社会类',
number: '13',
updateTime: '2017-12-4'
},
{
title: '文学类',
number: '15',
updateTime: '2017-12-4'
}
]
}
},
methods: {
//
handleSizeChange (val) {
console.log(`每页 ${val}`)
},
handleCurrentChange (val) {
console.log(`当前页: ${val}`)
}
}
}
</script>
<style>
</style>

View File

@ -0,0 +1,140 @@
<template>
<div>
<!--表格-->
<el-table
:data="tableData"
v-loading="tableLoading"
height="370">
<el-table-column prop="stuId" label="学号" >
</el-table-column>
<el-table-column prop="archiveName" label="档案名称">
</el-table-column>
<el-table-column prop="position" label="存放位置" >
</el-table-column>
<el-table-column prop="archiveDesc" label="档案说明" >
<template slot-scope="scope">
<el-link type="primary" @click="openDesc(scope.row.archiveDesc)">{{subStr(scope.row.archiveDesc,10)}}</el-link>
</template>
</el-table-column>
<el-table-column
fixed="right"
label="操作"
width="250">
<template slot-scope="scope">
<el-button size="mini" type="success" @click="commit(scope.row)">申请借阅</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页-->
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-sizes="[10,20,50]"
:page-size="pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="total">
</el-pagination>
<el-dialog
title="体检结果说明"
@close="closeDesc"
:visible.sync="showDesc">
<span>{{desc}}</span>
</el-dialog>
</div>
</template>
<script>
import request from '../utils/request'
export default {
name: 'borrow_allow',
data(){
return {
showMutipleImg:false,
imgUrls:[], //src
tableData: [{
stuId:45451
}],
tableLoading:false,
updateLoading:false,
insertLoading:false,
deleteBatchLoading:false,
searchLoading:false,
searchValue:"",
selectedRows:[],
currentPage:1,
pageSize:10,
total:0,
showDetail:false, //
detail:{}, //
showDesc:false,
desc:'暂无描述'
}
},
mounted () {
this.search();
},
methods:{
closeDesc(){
this.showDesc=false;
this.desc="暂无描述";
},
openDesc(desc){
this.showDesc=true;
this.desc=desc;
},
subStr(str,num){
if(str&&str.length>num){
str=str.substring(0,num)+"...";
}
return str;
},
//
//urls:
openMutipleImg(urls){
this.showMutipleImg=true;
if(urls){
var array=urls.split(';');
for(var i=0;i<array.length;i++){
array[i]=array[i].replace(/^\s+|\s+$/g,"");
if(array[i].length>0){
this.imgUrls.push(array[i]);
this.detail.img+=";"+array[i];
}
}
}
},
closeMutipleImg(){
this.showMutipleImg=false;
this.imgUrls=[];
},
handleCurrentChange(curPage){
this.currentPage=curPage;
this.search();
},
handleSizeChange(size){
this.pageSize=size;
this.search();
},
search () {
this.tableLoading=true;
request.get("/api/physical/archives/borrow/list",{
params:{
page:this.currentPage,
size:this.pageSize
}
}).then(res=>{
this.tableLoading=false;
this.total=res.data.data.total;
this.tableData=res.data.data.records;
});
},
}
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,138 @@
<template>
<div>
<!--表格-->
<el-table
:data="tableData"
v-loading="tableLoading"
height="370">
<el-table-column prop="stuId" label="被借阅学生学号" >
</el-table-column>
<el-table-column prop="archiveName" label="档案名称">
</el-table-column>
<el-table-column prop="borrTime" label="借阅开始时间">
</el-table-column>
<el-table-column prop="borrStatus" label="借阅状态">
<template slot-scope="scope">
<span v-if="scope.row.borrStatus===1" style="color: #E6A23C">借阅中</span>
<span v-if="scope.row.borrStatus===0" style="color:#67C23A">已归还</span>
<span v-if="scope.row.borrStatus===-1" style="color: #F56C6C">超时未归还</span>
</template>
</el-table-column>
<el-table-column
fixed="right"
label="操作"
width="160">
<template slot-scope="scope">
<el-button v-if="scope.row.borrStatus===1" size="mini" type="success" @click="commit(scope.row)">申请归还</el-button>
<el-button v-if="scope.row.borrStatus===-1" size="mini" type="danger" @click="commit(scope.row)">立即归还</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页-->
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-sizes="[10,20,50]"
:page-size="pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="total">
</el-pagination>
</div>
</template>
<script>
import request from '../utils/request'
export default {
name: 'borrow_my',
data(){
return {
showMutipleImg:false,
imgUrls:[], //src
tableData: [{
stuId:45451
}],
tableLoading:false,
updateLoading:false,
insertLoading:false,
deleteBatchLoading:false,
searchLoading:false,
searchValue:"",
selectedRows:[],
currentPage:1,
pageSize:10,
total:0,
showDetail:false, //
detail:{}, //
showDesc:false,
desc:'暂无描述'
}
},
mounted () {
this.search();
},
methods:{
closeDesc(){
this.showDesc=false;
this.desc="暂无描述";
},
openDesc(desc){
this.showDesc=true;
this.desc=desc;
},
subStr(str,num){
if(str&&str.length>num){
str=str.substring(0,num)+"...";
}
return str;
},
//
//urls:
openMutipleImg(urls){
this.showMutipleImg=true;
if(urls){
var array=urls.split(';');
for(var i=0;i<array.length;i++){
array[i]=array[i].replace(/^\s+|\s+$/g,"");
if(array[i].length>0){
this.imgUrls.push(array[i]);
this.detail.img+=";"+array[i];
}
}
}
},
closeMutipleImg(){
this.showMutipleImg=false;
this.imgUrls=[];
},
handleCurrentChange(curPage){
this.currentPage=curPage;
this.search();
},
handleSizeChange(size){
this.pageSize=size;
this.search();
},
search () {
var uid=this.$store.state.user.id;
if(!uid) return;
this.tableLoading=true;
request.get("/api/physical/archives/record/getOne",{
params:{
usernameId:uid
}
}).then(res=>{
this.tableLoading=false;
this.total=res.data.data.length;
this.tableData=res.data.data;
});
},
}
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,268 @@
<template>
<div id="framework">
<!-- 侧边栏 -->
<div id="sidebar">
<div id="logo" @click="toIndex">
<!-- logo -->
<el-avatar v-show="isCollapse" shape="square" :size="48" src="https://cn.vuejs.org/images/logo.png"></el-avatar>
<span v-show="!isCollapse">档案管理系统</span>
</div>
<el-menu class="el-menu-vertical-demo" @select="handleSelect" :collapse="isCollapse" :collapse-transition="true"
background-color="#20222a" text-color="#bdbdc0">
<el-menu-item index="/firstPage">
<i class="el-icon-s-home"></i>
<span slot="title">首页</span>
</el-menu-item>
<el-menu-item v-if="$shiro.hasPermission(this,'menu:stu_info')" index="/basic">
<i class="el-icon-user"></i>
<span slot="title">基本信息</span>
</el-menu-item>
<el-submenu v-if="$shiro.hasPermission(this,'menu:course_project')" index="2">
<template slot="title">
<i class="el-icon-s-grid"></i>
<span slot="title">课程学业信息</span>
</template>
<el-menu-item index="/courseMes">
<i class="el-icon-tickets"></i>
<span slot="title">课业成绩</span>
</el-menu-item>
<el-menu-item index="/scienceMes">
<i class="el-icon-tickets"></i>
<span slot="title">科研项目</span>
</el-menu-item>
</el-submenu>
<el-menu-item v-if="$shiro.hasPermission(this,'menu:activity')" index="/activity">
<i class="el-icon-s-flag"></i>
<span slot="title">活动/竞赛信息</span>
</el-menu-item>
<el-menu-item v-if="$shiro.hasPermission(this,'menu:medical')" index="/medical">
<i class="el-icon-scissors"></i>
<span slot="title">健康体检信息</span>
</el-menu-item>
<el-menu-item v-if="$shiro.hasPermission(this,'menu:weijiMes')" index="/weijiMes">
<i class="el-icon-info"></i>
<span slot="title">违纪信息</span>
</el-menu-item>
<el-menu-item v-if="$shiro.hasPermission(this,'menu:grow_infro')" index="/grow_infro">
<i class="el-icon-star-on"></i>
<span slot="title">就业与发展信息</span>
</el-menu-item>
<el-submenu v-if="$shiro.hasPermission(this,'menu:archives')" index="10">
<template slot="title">
<i class="el-icon-s-management"></i>
<span slot="title">档案管理</span>
</template>
<el-submenu v-if="$shiro.hasPermission(this,'menu:archives')" index="11">
<template slot="title">
<i class="el-icon-s-finance"></i>
<span slot="title">档案分析</span>
</template>
<el-menu-item index="/forecast">
<i class="el-icon-s-marketing"></i>
<span slot="title">就业趋势预测</span>
</el-menu-item>
<el-menu-item index="/analyze">
<i class="el-icon-s-marketing"></i>
<span slot="title">指标分析</span>
</el-menu-item>
</el-submenu>
<el-menu-item index="/archives-manager">
<i class="el-icon-s-management"></i>
<span slot="title">档案借阅管理</span>
</el-menu-item>
<el-menu-item index="/archives">
<i class="el-icon-s-finance"></i>
<span slot="title">档案管理</span>
</el-menu-item>
</el-submenu>
<el-menu-item v-if="$shiro.hasPermission(this,'menu:archives_borrow')" index="/borrow">
<i class="el-icon-s-finance"></i>
<span slot="title">档案借阅</span>
</el-menu-item>
<el-submenu v-if="$shiro.hasPermission(this,'menu:system_manager')" index="8">
<template slot="title">
<i class="el-icon-location"></i>
<span slot="title">系统管理</span>
</template>
<el-menu-item v-if="$shiro.hasPermission(this,'menu:user_manager')" index="/userManager">
<i class="el-icon-document"></i>
<span slot="title">用户管理</span>
</el-menu-item>
<el-menu-item v-if="$shiro.hasPermission(this,'menu:role_manager')" index="/roleManager">
<i class="el-icon-document"></i>
<span slot="title">角色管理</span>
</el-menu-item>
<el-menu-item v-if="$shiro.hasPermission(this,'menu:permission_manager')" index="/permission">
<i class="el-icon-document"></i>
<span slot="title">权限管理</span>
</el-menu-item>
<!-- <el-menu-item v-if="$shiro.hasPermission(this,'menu:setting')" index="/setting">-->
<!-- <i class="el-icon-document"></i>-->
<!-- <span slot="title">系统设置</span>-->
<!-- </el-menu-item>-->
</el-submenu>
</el-menu>
</div>
<div id="right">
<!-- 顶部栏 -->
<div id="topbar">
<el-menu default-active="2-1" class="el-menu-demo" mode="horizontal" @select="handleSelect" menu-trigger="hover">
<el-menu-item index="1" @click="handleCollapse">
<span v-show="isCollapse" class="el-icon-s-unfold"></span>
<span v-show="!isCollapse" class="el-icon-s-fold"></span>
</el-menu-item>
<el-menu-item index="2"><span class="el-icon-school"></span>学校官网</el-menu-item>
<el-menu-item index="3"><span class="el-icon-document-copy"></span>图书馆</el-menu-item>
<div style="float: right;width:100px;height:60px;">
<el-submenu index="4">
<template slot="title">
<el-avatar shape="square" :size="32" :src="avatar"></el-avatar>
</template>
<el-menu-item index="4-1"><span class="el-icon-user-solid"></span>基本信息</el-menu-item>
<el-menu-item index="4-2"><span class="el-icon-key"></span>
用户信息
</el-menu-item>
<el-divider></el-divider>
<el-menu-item index="/logout"><span class="el-icon-back"></span>
退出
</el-menu-item>
</el-submenu>
</div>
</el-menu>
</div>
<div id="mainOut">
<!-- 主要内容区 -->
<div id="main" class="panel">
<slot></slot>
<el-backtop target="#mainOut">
<span class="backTop el-icon-caret-top"></span>
</el-backtop>
</div>
<!--页脚-->
<div id="footer" class="panel"></div>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'framework',
data () {
return {
isCollapse: true
}
},
mounted(){
},
computed:{
avatar(){
try {
if(this.$store.state.user){
return this.$store.state.user.avatar;
}
}catch (e) {
}
return "http://localhost:8080/images/logo.png";
}
},
methods: {
handleCollapse () {
//
this.isCollapse = !this.isCollapse
},
handleSelect (key, keyPath) {
var path = keyPath[keyPath.length - 1]
// 退
if (path === '/logout') {
this.$store.commit('setUser', null)
this.$router.push('/login')
} else {
//
this.$router.push(path)
}
},
toIndex () {
this.$router.push('/')
}
},
mounted () {
}
}
</script>
<style lang="less" scoped>
.el-avatar {
background-color: rgba(0, 0, 0, 0);
}
#framework {
width: 100%;
height: 100%;
display: flex;
#sidebar {
height: 100%;
background: #20222a;
overflow: auto;
#logo {
color: #bdbdc0;
height: 60px;
.el-menu {
border: 0px;
}
span {
background-color: rgba(0, 0, 0, 0);
display: block;
text-align: center;
position: relative;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
}
}
#right {
flex: 1;
background: #f2f2f2;
overflow: hidden;
#topbar {
position: sticky;
top: 0px;
width: 100%;
}
#mainOut {
height: calc(~"100% - 80px");
;
padding: 10px;
padding-bottom: 0px;
overflow-y: auto;
.panel {
background: white;
border-radius: 5px;
}
#main {
// height: 1500px;
.backTop {
font-size: 32px;
color: #409eff;
}
}
#footer {
margin-top: 10px;
}
}
}
}
</style>

41
src/main.js Normal file
View File

@ -0,0 +1,41 @@
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import inject from './plugins/inject'
// 导入完整的element-ui
Vue.use(ElementUI)
//挂载到vue上
Vue.use(inject)
Vue.config.productionTip = true
window.vue=new Vue({
router,
store,
render: h => h(App)
}).$mount('#app')
// 全局路由守卫
router.beforeEach((to, form, next) => {
// 如果进入到的路由是登录页或者注册页面,则正常展示
if(router.app.$store.state.user||to.path=='/login'){
if (to.path == '/login') {
// 如果是登录页面就把框架去掉
router.app.$store.commit('showFramework', false)
} else {
router.app.$store.commit('showFramework', true)
}
//直接放行
next()
}else{
router.app.$store.commit('showFramework', false)
//跳转到登录页面
console.log(to)
next({
path:"/login"
})
}
})

42
src/plugins/dict.js Normal file
View File

@ -0,0 +1,42 @@
import request from "@/utils/request"
export default {
initDict(vue,callback){
//请求角色数据
request.get("/api/dict/all").then(res=>{
vue.$store.state.dicts=res.data.data;
if(callback) callback();
});
},
getValue(vue,key,code){
if(code){
let dicts=null;
try {
dicts=vue.$store.state.dicts
}catch (e) {
//使用表格的scope访问时
dicts=vue._self.$store.state.dicts;
}
if(dicts){
for(var i=0;i<dicts.length;i++){
if(dicts[i].dictKey==key&&dicts[i].dictCode==code){
return dicts[i].dictValue;
}
}
}
}
return "--";
},
getDicts(vue,key){
let dicts=vue.$store.state.dicts;
var array=[];
if(dicts){
for(var i=0;i<dicts.length;i++){
if(dicts[i].dictKey==key){
array.push(dicts[i]);
}
}
}
return array;
}
}

13
src/plugins/inject.js Normal file
View File

@ -0,0 +1,13 @@
/*注入的js*/
/*把这些都挂载到vue实例下*/
import shiro from "./shiro"
import dict from './dict'
import echarts from "echarts"
export default {
install: (Vue, options) => {
Vue.prototype.$shiro = shiro
Vue.prototype.$dict = dict
Vue.prototype.$echarts = echarts
}
}

57
src/plugins/shiro.js Normal file
View File

@ -0,0 +1,57 @@
/*模拟shiro的一个js*/
import request from "@/utils/request"
import { Notification } from 'element-ui'
export default {
initShiro(vue,callback){
if(!vue.$store.state.user.id){
return Notification({
type:"error",
message:'用户ID不存在'
});
}
//请求角色数据
request.get("/api/role/vo/getByUid",{
params:{
uid:vue.$store.state.user.id
}
}).then(res=>{
console.log("刷新shiro",res);
var roles=res.data.data;
//角色数据
let roleMap={};
let permMap={};
for(var i=0;i<roles.length;i++){
roleMap[roles[i].roleMark]='role';
//权限数据
var prmissions=roles[i].permissions;
if(prmissions){
for(var j=0;j<prmissions.length;j++){
permMap[prmissions[j].perms]=j;
}
}
}
vue.$store.state.roleMap=roleMap;
vue.$store.state.permMap=permMap;
if(callback) callback();
});
},
hasPermission(vue,permission){
let permMap=vue.$store.state.permMap;
// console.log("拥有的权限:",permMap);
if(permMap){
return permission in permMap;
}else{
return false;
}
},
hasRole(vue,role){
let roleMap=vue.$store.state.roleMap;
// console.log("拥有的角色:",roleMap);
if(roleMap){
return role in roleMap;
}else{
return false;
}
}
}

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

@ -0,0 +1,110 @@
import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)
const routes = [
{
path: '/firstPage',
name: 'firstPage',
component: () => import('@/views/firstPage.vue')
},
{
path: '/analyze',
name: 'analyze',
component: () => import('@/views/analyze.vue')
},
{
path: '/forecast',
name: 'forecast',
component: () => import('@/views/forecast.vue')
},
{
path: '/permission',
name: 'permission',
component: () => import('@/views/system/permission.vue')
},
{
path: '/borrow',
name: 'borrow',
component: () => import('@/views/borrow.vue')
},
{
path: '/',
name: 'login',
component: () => import('@/views/login/login.vue')
},
{
path: '/login',
name: 'login',
component: () => import('@/views/login/login.vue')
},
{
path: '/index',
name: 'index',
component: () => import('@/views/studentMes/basic.vue')
},
{
path: '/userManager',
name: 'userManager',
component: () => import('@/views/system/userManager.vue')
},
{
path: '/roleManager',
name: 'roleManager',
component: () => import('@/views/system/roleManager.vue')
},,
{
path: '/basic',
name: 'basic',
component: () => import('@/views/studentMes/basic.vue')
},
{
path: '/courseMes',
name: 'courseMes',
component: () => import('@/views/studentMes/courseMes.vue')
},
{
path: '/scienceMes',
name: 'scienceMes',
component: () => import('@/views/studentMes/scienceMes.vue')
},
{
path: '/activity',
name: 'activity',
component: () => import('@/views/studentMes/activity.vue')
},
{
path: '/medical',
name: 'medical',
component: () => import('@/views/studentMes/medical.vue')
},
{
path: '/weijiMes',
name: 'weijiMes',
component: () => import('@/views/studentMes/weijiMes.vue')
},
{
path: '/grow_infro',
name: 'grow_infro',
component: () => import('@/views/studentMes/grow_infro.vue')
}, {
path: '/archives',
name: 'archives',
component: () => import('@/views/archives-manager.vue')
},
{
path: '/archives-manager',
name: 'archives-manager',
component: () => import('@/views/archives-borrow.vue')
}
]
const router = new VueRouter({
mode: 'hash',//只有hash模式才能保证地址栏输入时会走路由守卫
base: process.env.BASE_URL,
routes
})
export default router

69
src/store/index.js Normal file
View File

@ -0,0 +1,69 @@
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
export default new Vuex.Store({
state: sessionStorage.getItem('state') ? JSON.parse(sessionStorage.getItem('state')):{
cache: {},
showFramework: false, // 是否需要显示框架
user: null
},
mutations: {
// 把一个数据添加到缓存中
// expirationTime:数据到期时间
appendToCache (state, params) {
if (params.timeout) {
this.state.cache[params.key] = {
data: params.data,
expirationTime: new Date().getTime() + params.timeout
}
} else {
this.state.cache[params.key] = { data: params.data }
}
},
// 从缓存中删除一个数据
removeFromCache (state, key) {
delete this.state.cache.key
},
showFramework (state, isShow) {
this.state.showFramework = isShow
},
setUser (state, user) {
state.user = user
}
},
actions: {
appendToCache (context, params) {
context.commit('appendToCache', params)
}
},
modules: {
},
getters: {
hasPermission(state,permission){
console.log("权限:",permission,state);
},
getUserInfo (state) {
return state.user
},
// 获取缓存中的一个数据
getCacheData: (state) => (key) => {
var needRequest = true
var data = null
// 判断是否含有这个键
if (state.cache.hasOwnProperty(key)) {
var value = state.cache[key]
// 判断是否需要重新请求
if (value.hasOwnProperty('expirationTime')) {
needRequest = new Date().getTime() > value.expirationTime
} else {
needRequest = false
}
data = value.data
}
// needRequest用来记录是否需要重新发起请求来获取
return { data, needRequest }
}
}
})

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

@ -0,0 +1,107 @@
/*
封装所有的ajax请求
形成同一个错误响应,
同时实现统一的缓存效果
*/
import axios from 'axios'
import { Notification } from 'element-ui'
/**
* 暴露出去的接口
*/
export default { ajax, get, post }
/**
* 发起请求,返回数据
* 这里不能使用缓存
* @param {Object} params
*/
function json (params) {
return axios(params)
.then(res=>{
if(res.data.status==-1){
Notification({
type: 'error',
message: res.data.msg
})
}
return res;
})
.catch(err => {
Notification({
type: 'error',
message: '数据请求异常'
})
// 返回到下一级,便于之后的catch获取这个err
return err
})
}
/**
* 利用vuex使用缓存
* @param {Object} params
* @param {Object} store
*/
function ajax (params) {
// 如果不需要使用缓存就直接返回一个异步请求对象
if (!params.hasOwnProperty('cache') || !params.cache) {
return json(params)
.then(res => {
res.useCache = false
return res
})
}
// 使用缓存
// 从缓存里面拿到这个键对应的值
/* cacheRes:{
data:data //缓存的数据
needRequest:true//需不需要发送请求
}
*/
var store = params.cache.store
var cacheRes = store.getters.getCacheData(params.cache.key)
// 判断需不需要去发起请求
if (cacheRes.needRequest == true) {
return json(params)
.then(res => {
store.dispatch('appendToCache', { data: res, ...params.cache })
res.useCache = false
return res
})
} else {
// 使用promise便于返回一个统一的链式调用接口
return new Promise(function (resolve, reject) {
resolve({ ...cacheRes.data, useCache: true })
})
}
}
/**
* 封装好的get
* @param {Object} url
* @param {Object} data
* @param {Object} cache
*/
function get (url, data, cache) {
return ajax({
url,
params:(data ? data.params:{}),
cache,
method: 'get'
})
}
/**
* 封装好的post
* @param {Object} url
* @param {Object} data
* @param {Object} cache
*/
function post (url, data, cache) {
return ajax({
url,
data,
cache,
method: 'post'
})
}

288
src/views/analyze.vue Normal file
View File

@ -0,0 +1,288 @@
<template>
<div>
<!--上方筛选条件-->
<div class="select">
<el-select v-model="value1" multiple placeholder="请选择年级">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<el-select
v-model="value2"
multiple
collapse-tags
style="margin-left: 20px;"
placeholder="请选择专业">
<el-option
v-for="item in options1"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<el-select
v-model="value3"
multiple
collapse-tags
style="margin-left: 20px;"
placeholder="请选择班级">
<el-option
v-for="item in options2"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<el-select
v-model="value4"
multiple
collapse-tags
style="margin-left: 20px;"
placeholder="请选择课程">
<el-option
v-for="item in options3"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<el-select
v-model="value5"
multiple
collapse-tags
style="margin-left: 20px;"
placeholder="请选择分析方法">
<el-option
v-for="item in options4"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<el-button type="primary" round @click="query">查询</el-button>
</div>
<div class="ranks">
<!--左边饼状图,分布图-->
<div class="pie">
<div id="distribution" :style="{width: '500px', height: '400px'}"></div>
<div style="padding-bottom: 30px;margin-left: 30px;">
<el-input placeholder="请输入分数段名称" v-model="input" clearable>
<!-- <template slot="prepend">Http://</template>-->
<el-button slot="append" icon="el-icon-search" @click="search">搜索</el-button>
</el-input>
</div>
</div>
<!--右边排行榜-->
<div class="rank-table">
<h3>排名</h3>
<el-table
:data="tableData"
border
style="width: 100%">
<el-table-column
prop="name"
label="姓名"
width="180">
</el-table-column>
<el-table-column
prop="grade"
label="成绩"
width="160">
</el-table-column>
<el-table-column
prop="rank"
label="排名"
width="160">
</el-table-column>
</el-table>
</div>
</div>
</div>
</template>
<script>
export default {
name: "analyze",
data() {
return {
input:'',
options: [{
value: '2020级',
label: '2020级'
}, {
value: '2019级',
label: '2019级'
}, {
value: '2018级',
label: '2018级'
}, {
value: '2017级',
label: '2017级'
}],
options1: [{
value: '物联网',
label: '物联网'
}, {
value: '机械设计制造及自动化',
label: '机械设计制造及自动化'
}, {
value: '计算机科学与技术',
label: '计算机科学与技术'
}, {
value: '电商',
label: '电商'
}],
options2: [{
value: '1班',
label: '1班'
}, {
value: '2班',
label: '2班'
}, {
value: '3班',
label: '3班'
}, {
value: '4班',
label: '4班'
}],
options3: [{
value: 'JAVA语言程序设计',
label: 'JAVA语言程序设计'
}, {
value: 'C++语言程序设计',
label: 'C++语言程序设计'
}, {
value: '高等数学A1',
label: '高等数学A1'
}, {
value: '大学物理',
label: '大学物理'
}],
options4: [{
value: '总分',
label: '总分'
}, {
value: '平均分',
label: '平均分'
}],
value1: [],
value2: [],
value3:[],
value4:[],
value5:[],
tableData: [{
grade: 99,
name: '王小虎',
rank: 1
}, {
grade: 89,
name: '李四',
rank: 2
}, {
grade: 85,
name: '王五',
rank: 3
}, {
grade: 80,
name: 'xxx',
rank: 4
}]
}
},
mounted() {
this.drawLine();
},
methods:{
//
query(){
console.log(this.value1,this.value2,this.value3,this.value4,this.value5)
},
//
search(){
console.log(this.input);
},
//
drawLine(){
var self = this;
var detail = this.$echarts.init(document.getElementById('distribution'));
var option = {
title: {
text: '各分数段所占比',
//
top:0,
left:60,
textStyle: {
color:'#777'
}
},
tooltip: {
trigger: 'item',
axisPointer: {
type: 'cross',
crossStyle: {
color: '#999'
}
},
formatter: function (params) {
//console.log(params)
let firstParams = params;
return firstParams.name + ':' + firstParams.data.value +' %';
}
},
legend: {
orient: 'vertical',
right: 'right',
top:'40px'
},
series : [
{
name: '',
type: 'pie', //
radius: '55%', // 55%
data:[ // name value
{value:20, name:'0-60'},
{value:30, name:'60-80'},
{value:40, name:'80-90'},
{value:10, name:'90-100'},
],
color: ['#73b9bc','#759aa0','#e69d87','#8dc1a9','#ea7e53','#eedd78','#73a373','#7289ab', '#91ca8c','#f49f42'],
}
]
}
detail.setOption(option);
}
}
}
</script>
<style scoped>
.select{
padding-top: 30px;
padding-left: 20px;
display: flex;
justify-content: space-around;
}
.ranks{
padding-top: 60px;
display: flex;
justify-content: space-between;
}
.rank-table{
position: relative;
}
.rank-table .el-table{
margin-top: 35px;
}
.rank-table h3{
font-weight: bold;
font-size: 18px;
color: #777;
position: absolute;
top: 0;
left: -140px;
}
</style>

View File

@ -0,0 +1,31 @@
<template>
<el-tabs type="border-card">
<el-tab-pane>
<span slot="label"><i class="el-icon-date"></i>档案借阅记录</span>
<archives-borrow-info></archives-borrow-info>
</el-tab-pane>
<el-tab-pane>
<span slot="label"><i class="el-icon-date"></i>档案借阅状态</span>
<archive-borrow-status></archive-borrow-status>
</el-tab-pane>
</el-tabs>
</template>
<script>
import ArchivesBorrowInfo from '@/components/archives_borrow_info'
import ArchiveBorrowStatus from '@/components/archive_borrow_status'
export default {
components: {
ArchivesBorrowInfo,
ArchiveBorrowStatus
},
data () {
return {
}
}
}
</script>
<style>
</style>

View File

@ -0,0 +1,52 @@
<template>
<div>
<!-- 选项卡 -->
<el-tabs type="border-card">
<!-- 档案信息表 -->
<el-tab-pane>
<span slot="label"><i class="el-icon-date"></i>档案信息</span>
<archives-info></archives-info>
</el-tab-pane>
<!-- 档案审核 -->
<el-tab-pane>
<span slot="label"><i class="el-icon-date"></i>档案审核</span>
<archives-check></archives-check>
</el-tab-pane>
<!--归档建目-->
<el-tab-pane>
<span slot="label"><i class="el-icon-date"></i> 归档建目</span>
<archives-title></archives-title>
</el-tab-pane>
<!--提交入库-->
<el-tab-pane>
<span slot="label"><i class="el-icon-date"></i> 提交入库</span>
<archives-submit></archives-submit>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import archivesInfo from '@/components/archives_info'
import archivesCheck from '@/components/archives_check'
import archivesTitle from '@/components/archives_title'
import archivesSubmit from '@/components/archives_submit'
export default {
components: { archivesInfo, archivesCheck, archivesTitle, archivesSubmit },
data () {
I
return {
}
},
methods: {
}
}
</script>
<style>
</style>

33
src/views/borrow.vue Normal file
View File

@ -0,0 +1,33 @@
<template>
<!-- 档案借阅-->
<div style="padding:20px;">
<el-tabs v-model="activeName">
<el-tab-pane label="可借阅档案" name="可借阅档案">
<BorrowAllow></BorrowAllow>
</el-tab-pane>
<el-tab-pane label="我的借阅记录" name="我的借阅记录">
<BorrowMy></BorrowMy>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import BorrowAllow from '@/components/borrow_allow'
import BorrowMy from '../components/borrow_my'
export default {
name: 'borrow',
components:{
BorrowAllow,BorrowMy
},
data(){
return {
activeName:"可借阅档案"
}
}
}
</script>
<style scoped>
</style>

171
src/views/firstPage.vue Normal file
View File

@ -0,0 +1,171 @@
<template>
<div>
<div class="user-mes" :style="{width: '100%', height: '110px'}">
<!--用户信息-->
<div style="background: #7fdbda;width: 31%;height: 100%">
<i class="el-icon-user-solid"></i>
<span>总用户数量300</span>
</div>
<div style="background: #848ccf;width: 31%;height: 100%">
<i class="el-icon-s-custom"></i>
<span>学生数{{this.student}}</span>
</div>
<div style="background: #F56C6C;width: 31%;height: 100%">
<i class="el-icon-s-check"></i>
<span>教职工数66</span>
</div>
</div>
<div class="charts">
<!--档案借阅记录信息-->
<div id="file-borrow" :style="{width: '600px', height: '400px'}"></div>
<!--档案信息-->
<div id="stu-files" :style="{width: '600px', height: '400px'}"></div>
<!--就业信息-->
<div id="stu-jobs" :style="{width: '600px', height: '400px'}"></div>
</div>
</div>
</template>
<script>
export default {
name: "firstPage",
data(){
return {
student:234,
list:[30.3, 20.5, 56.8, 60.9, 90, 80]
}
},
mounted(){
this.drawLine();
},
methods: {
drawLine(){
var self = this;
// domecharts,
let files = this.$echarts.init(document.getElementById('stu-files'))
//
files.setOption({
title: {
text: '档案数据详情',
textStyle: {
color:'#777'
}
},
tooltip: {},
xAxis: {
data: ["分类1","分类2","分类3","分类4","分类5"]
},
yAxis: {},
series: [{
name: '数量',
type: 'bar',
data: [5, 20, 36, 10, 78]
}]
});
//
let jobs = this.$echarts.init(document.getElementById('stu-jobs'));
jobs.setOption({
title: {
text: '就业信息详情',
textStyle: {
color:'#777'
}
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross',
crossStyle: {
color: '#999'
}
},
formatter: function (params) {
//console.log(params[0]); //
let firstParams = params[0];
return '专业名称:'+firstParams.name + '<br>' + firstParams.seriesName + '' + firstParams.data +' %';
}
},
xAxis: {
data: ["专业1","专业2","专业3","专业4","专业5","专业6"]
},
yAxis: {},
series: [{
name: '就业率',
type: 'bar',
data: this.list
}]
});
//
let counts = this.$echarts.init(document.getElementById('file-borrow'));
counts.setOption({
title: {
text: '档案借阅记录',
textStyle: {
color:'#777'
}
},
tooltip: {
trigger: 'item',
axisPointer: {
type: 'cross',
crossStyle: {
color: '#999'
}
},
formatter: function (params) {
//console.log(params)
let firstParams = params;
return firstParams.name + ':' + firstParams.data.value +' %';
}
},
series : [
{
name: '',
type: 'pie', //
radius: '55%', // 55%
data:[ // name value
{value:67.2, name:'入库记录'},
{value:56.8, name:'借阅'},
{value:10.4, name:'超时借阅'},
],
color: ['#73b9bc','#759aa0','#e69d87','#8dc1a9','#ea7e53','#eedd78','#73a373','#7289ab', '#91ca8c','#f49f42'],
}
]
});
}
}
}
</script>
<style scoped>
/*图表*/
.charts{
padding-top: 20px;
display: flex;
justify-content: space-evenly;
}
/*顶层div*/
.user-mes{
padding-top: 20px;
display: flex;
justify-content: space-between;
}
/*用户数的单个div*/
.user-mes div{
border-radius: 15px;
display: flex;
justify-content: center;
align-items: center;
}
.user-mes span{
font-size: 18px;
color: white;
}
/*图标大小*/
.el-icon-s-check,.el-icon-user-solid,.el-icon-s-custom{
font-size: 40px;
margin-right: 15px;
color: white;
}
</style>

173
src/views/forecast.vue Normal file
View File

@ -0,0 +1,173 @@
<template>
<!-- 就业预测-->
<div style="padding:20px;height: 480px;">
<el-transfer
style="text-align: left; display: inline-block"
v-model="checked"
filterable
:titles="['毕业生就业公司', '预计算列表']"
:button-texts="['移出', '加入']"
:format="{
noChecked: '${total}',
hasChecked: '${checked}/${total}'
}"
@change="handleChange"
:data="company">
<span slot-scope="{ option }">{{ option.key }} - {{ option.label }}</span>
<el-button v-loading="computeLoading" @click="computeData" type="success" :disabled="checked.length==0" class="transfer-footer" slot="right-footer" size="small">开始计算</el-button>
</el-transfer>
<div v-loading="computeLoading" style="float: right;width: 45%;">
<span>成就-入职率(学生记录数据量少时结果不具备参考价值)</span>
<el-divider></el-divider>
<div style="max-height: 420px;overflow-y: auto">
<h4 v-if="result.length==0" align="center">暂无结果</h4>
<p v-for="item in result" :key="JSON.stringify(item)" style="margin-bottom: 15px;">
<el-card shadow="hover" class="box-card">
<h4 align="right">入职率: <span class="ratio">{{stayTwoNum(item.ratio)}}</span></h4>
<el-divider></el-divider>
<span v-for="archive in item.achievements" :key="archive" class="tags">
<el-tag :type="randomTagType()">{{archive}}</el-tag>
</span>
</el-card>
</p>
</div>
</div>
</div>
</template>
<script>
import request from '../utils/request'
import { Notification } from 'element-ui'
export default {
name: 'forecast',
data(){
return {
computeLoading:false,
checked: [1],
archives:[
{
id:1,
value:'JAVA'
},
{
id:2,
value:'蓝桥杯'
},{
id:3,
value:'ACM'
},{
id:4,
value:'国家级项目'
},{
id:5,
value:'JAVA'
}
],
company:[
{
key:1,
label:'国家电网',
achievements:[1,2]
},
{
key:2,
label:'蚂蚁金服',
achievements:[2,3]
},
{
key:3,
label:'亚信科技',
achievements:[2,3,4]
},
{
key:4,
label:'阿里巴巴',
achievements:[3,5]
}
],
result:[]
}
},
methods:{
handleChange(value, direction, movedKeys) {
console.log(value, direction, movedKeys);
},
randomTagType(){
var colors=['','success','warning','danger'];
console.log(Math.floor(Math.random()*(colors.length+1)));
return colors[Math.floor(Math.random()*(colors.length+1))];
},
//
stayTwoNum(num){
num=(num*100).toFixed(2);
if(num==100){
return "99.99%";
}
return num+"%";
},
computeData(){
//ID
var data=[];
for(var i=0;i<this.company.length;i++){
for(var j=0;j<this.checked.length;j++){
if(this.company[i].key==this.checked[j]){
data.push(this.company[i].achievements);
break;
}
}
}
//
this.computeLoading=true;
request.post("/api/apriori",{
minSupport:0.5,
data:data
}).then(res=>{
console.log(res);
this.computeLoading=false;
if(res.data.status==0){
Notification({
type: 'success',
message: '计算完成'
})
this.createData(res.data.data.data,res.data.data.support);
}
});
},
createData(data,support){
this.result=[];
for(var i=0;i<data.length;i++){
var names=[];
for(var j=0;j<data[i].length;j++){
names.push(this.getArchiveName(data[i][j]));
}
this.result.push({
achievements:names,
ratio:support[i]
});
}
//
this.result.sort(function(a,b){
return b.ratio-a.ratio;
});
},
getArchiveName(id){
for(var i=0;i<this.archives.length;i++){
if(id==this.archives[i].id){
return this.archives[i].value;
}
}
}
}
}
</script>
<style scoped>
.tags{
margin:5px;
display: inline-block;
}
.ratio{
color:#67C23A;
}
</style>

15
src/views/index.vue Normal file
View File

@ -0,0 +1,15 @@
<template>
<div class="home">
<img alt="Vue logo" src="../assets/logo.png">
<h1>454545445</h1>
</div>
</template>
<script>
import request from '@/utils/request'
import { Notification } from 'element-ui'
export default {
name: 'index',
components: {},
}
</script>

214
src/views/login/login.vue Normal file
View File

@ -0,0 +1,214 @@
<template>
<div id="login">
<!-- 文字部分 -->
<div id="font">
克勤之致<br>
<span class="yellow">结青藤</span>之缘
</div>
<!-- 图片部分 -->
<div id="img">
<img src="../../assets/images/lh/login-sc.png">
</div>
<!-- 下部图片 -->
<div id="downImg">
<img src="../../assets/images/lh/login-cao.png">
</div>
<!-- 登录部分 -->
<div id="account" v-loading="loginLoading">
<h1 class="title">学生档案管理系统</h1>
<el-form @submit.native.prevent label-width="80px" ref="ruleForm" :model="ruleForm" :rules="rules">
<el-form-item label="账号" prop="account">
<el-input autocomplete="on" @keyup.enter.native="submitForm('ruleForm')" placeholder="账号" prefix-icon="el-icon-user" v-model="ruleForm.account">
</el-input>
</el-form-item>
<el-form-item label="密码" prop="password">
<el-input autocomplete="on" @keyup.enter.native="submitForm('ruleForm')" placeholder="密码" prefix-icon="el-icon-warning-outline" v-model="ruleForm.password" show-password>
</el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="submitForm('ruleForm')">登录</el-button>
<el-button native-type="reset" @click="resetForm('ruleForm')">重置</el-button>
</el-form-item>
</el-form>
<div class="lookout">
<p>注意</p>
<p>1.学生登录请使用学号初始密码为后6位请登录之后及时修改</p>
<p>2.其他用户请使用管理员分配的账户进行登录</p>
<p>3.账号问题请联系:12452175@qq.com</p>
</div>
</div>
</div>
</template>
<script>
import request from "@/utils/request"
import { Notification } from 'element-ui'
export default {
data () {
/* 自定义验证 */
var validateAccount = (rule, value, callback) => {
var regAccount = /^[a-zA-Z0-9_]{4,15}$/
if (value === '') {
callback(new Error('账号不能为空!'))
} else if (regAccount.test(value) == false) {
callback(new Error('只允许5-16位字母数字下划线组合!'))
} else {
callback()
}
}
var validatePassword = (rule, value, callback) => {
if (value === '') {
callback(new Error('密码不能为空!'))
} else {
callback()
}
}
return {
loginLoading:false,
ruleForm: {
account: '',
password: ''
},
rules: {
account: [{
validator: validateAccount,
trigger: 'blur'
}],
password: [{
validator: validatePassword,
trigger: 'blur'
}]
}
}
},
methods: {
submitForm (formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
//
this.loginLoading=true;
request.post("/api/auth/login",{
username:this.ruleForm.account,
password:this.ruleForm.password
}).then(res => {
this.loginLoading=false;
if(res.data.status==-1) return;
Notification({
type:"success",
message:res.data.msg
});
//
this.$store.state.user=res.data.data
// this.$store.commit('setUser', res.data.data)
//shiro
var self=this;
this.$shiro.initShiro(this,function(){
//
self.$dict.initDict(self,function(){
//
self.$router.push('/firstPage')
})
});
});
} else {
return false
}
})
},
resetForm (formName) {
this.$refs[formName].resetFields()
}
},
mounted () {
}
}
</script>
<style lang="less">
/*声明动画*/
@keyframes moveImg {
0% {
top: 0px
}
50% {
top: 10px
}
100% {
top: 0px
}
}
#login {
width: 100%;
height: 100%;
background: #10c55c;
#font {
position: relative;
width: 500px;
left: 160px;
top: 170px;
font-size: 5rem;
color: white;
.yellow {
color: yellow;
}
}
#img {
position: relative;
left: 35%;
top: -30%;
width: 400px;
height: 350px;
img {
animation: moveImg 3s infinite;
position: absolute;
top: 0px;
left: 0px;
width: 400px;
height: 350px;
}
}
#downImg {
position: absolute;
bottom: 0px;
left: 150px;
}
#account {
position: absolute;
display: inline-block;
width: 400px;
height: 460px;
top: 80px;
right: 12%;
background: white;
border-radius: 10px;
box-shadow: 3px 3px 10px 2px #0b9243;
padding: 10px;
.title {
color: #777;
font-size: 35px;
text-align: center;
margin: 35px 0px;
}
.lookout {
color: #777;
padding: 20px;
}
.el-input {
width: 85%;
}
}
}
</style>

View File

@ -0,0 +1,444 @@
<template>
<div style="padding: 20px;">
<!-- 查询部分-->
<div id="query" >
<el-button type="primary" @click="openDetail({})" :loading="insertLoading">
<i class="el-icon-plus"></i>新增</el-button>
<span style="width: 10px;height: 2px;display: inline-block"></span>
<el-popconfirm
title="确定删除这些用户吗?"
@onConfirm="deleteBatch">
<el-button slot="reference" type="danger" @click="" :loading="deleteBatchLoading">
<i class="el-icon-delete"></i>批量删除</el-button>
</el-popconfirm>
<span style="width: 10px;height: 2px;display: inline-block"></span>
<div style="width:30%;float: right">
<el-input @keyup.enter.native="search" placeholder="请输入内容" v-model="searchValue" class="input-with-select">
<el-button @click="search" slot="append" icon="el-icon-search" :loading="searchLoading"></el-button>
</el-input>
</div>
</div>
<!--显示表格-->
<div class="activity">
<el-table
:data="tableData"
v-loading="tableLoading"
@selection-change="selectionChange"
height="370"
style="width: 100%">
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column
prop="stuId"
label="学号"
width="200">
<template slot-scope="scope">
<el-link type="primary" @click="linkToStuInfo(scope.row)">{{scope.row.stuId}}</el-link>
</template>
</el-table-column>
<el-table-column
prop="activityName"
label="活动/竞赛名称"
width="200">
</el-table-column>
<el-table-column
prop="activityLevel"
label="活动/竞赛等级"
width="180">
</el-table-column>
<el-table-column
prop="activityType"
label="活动/竞赛类型"
width="180">
</el-table-column>
<el-table-column
prop="activityTime"
label="参与/获得时间"
width="160">
</el-table-column>
<el-table-column
prop="img"
label="参与/获得证明"
width="300"
height="300">
<template slot-scope="scope">
<el-link type="primary" @click="openMutipleImg(scope.row.img)">查看证明</el-link>
</template>
</el-table-column>
<el-table-column
prop="auditStatusCode"
label="审核状态">
<template slot-scope="scope">
<span>{{$dict.getValue(scope,'audit_status',scope.row.auditStatusCode)}}</span>
</template>
</el-table-column>
<el-table-column
fixed="right"
label="操作"
width="250">
<template slot-scope="scope">
<el-button @click="openDetail(scope.row)" type="primary" size="small">修改</el-button>
<span style="width: 10px;height: 2px;display: inline-block"></span>
<el-popconfirm
title="确定删除这个用户吗?"
v-model="showDeleteConfirm"
@onConfirm="deleteRow(scope.row)">
<el-button slot="reference" type="danger" size="small">删除</el-button>
</el-popconfirm>
</template>
</el-table-column>
</el-table>
<!-- 分页-->
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-sizes="[10,20,50]"
:page-size="pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="total">
</el-pagination>
</div>
<!--新增信息弹出框-->
<el-dialog @close="closeDetail" title="活动/竞赛信息" :visible.sync="showDetail">
<el-form :model="detail">
<el-form-item label="学号:" required :label-width="formLabelWidth" >
<el-input v-model="detail.stuId" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="活动/竞赛名称" required :label-width="formLabelWidth">
<el-input v-model="detail.activityName" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="活动/竞赛类型" required :label-width="formLabelWidth">
<el-select v-model="detail.activityType" clearable placeholder="请选择">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="活动/竞赛等级" required :label-width="formLabelWidth" >
<el-select v-model="detail.activityLevel" clearable placeholder="请选择">
<el-option label="国际级" value="国际级"></el-option>
<el-option label="国家级" value="国家级"></el-option>
<el-option label="省部级" value="省部级"></el-option>
<el-option label="市、州级" value="市、州级"></el-option>
<el-option label="校级" value="校级"></el-option>
<el-option label="院级" value="院级"></el-option>
</el-select>
</el-form-item>
<el-form-item label="参与/获得时间" required :label-width="formLabelWidth">
<el-date-picker
v-model="detail.activityTime"
type="date"
placeholder="选择日期"
style="width: 207.27px">
</el-date-picker>
</el-form-item>
<el-form-item label="参与/获得证明" required :label-width="formLabelWidth" >
<el-upload
ref="upload"
:file-list="imgsList"
action="/api/upload/img"
:on-success="uploadSuccess"
list-type="picture-card"
>
<i slot="default" class="el-icon-plus"></i>
<div slot="file" slot-scope="{file}" id="img">
<img
class="el-upload-list__item-thumbnail"
:src="file.url" alt="">
<span class="el-upload-list__item-actions">
<span class="el-upload-list__item-preview"
@click="handlePictureCardPreview(file)">
<i class="el-icon-zoom-in"></i>
</span>
<span
v-if="!disabled"
class="el-upload-list__item-delete"
@click="handleRemove(file.url)">
<i class="el-icon-delete"></i>
</span>
</span>
</div>
</el-upload>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false"> </el-button>
<el-button v-if="detail.id" type="primary" :loading="updateLoading" @click="updateRow">保存</el-button>
<el-button v-if="!detail.id" type="primary" :loading="insertLoading" @click="insertRow">新增</el-button>
<!-- <el-button type="primary" @click="submit('ruleForm')">提交</el-button>-->
</div>
</el-dialog>
<el-dialog :visible.sync="dialogVisible">
<img width="100%" :src="dialogImageUrl" alt="">
</el-dialog>
<el-dialog title="证明材料"
:visible.sync="showMutipleImg"
@close="closeMutipleImg">
<span v-if="imgUrls.length==0">未上传证明材料</span>
<template v-if="imgUrls.length>0">
<el-image v-for="item in imgUrls"
style="width: 100px; height: 100px"
:src="item"
:lazy="true"
:preview-src-list="[item]">
</el-image>
</template>
</el-dialog>
</div>
</template>
<script>
import request from '../../utils/request'
import { Notification } from 'element-ui'
export default {
name: 'activity',
data () {
return {
showMutipleImg:false,
imgUrls:[], //src
imgsList:[],
//
ruleForm: {
name: '',
time: '',
type: [],
level: '',
img: ''
},
//
rules:{
stuId:[
{ required: true,message:'请输入学号',trigger:'blur' }
]
},
url: '',
dialogImageUrl: '',
dialogVisible: false,
disabled: false,
input: '',
options: [{
value: '学术竞赛',
label: '学术竞赛'
}, {
value: '体育活动',
label: '体育活动'
}, {
value: '校园活动',
label: '校园活动'
}, {
value: '道德奖励',
label: '道德奖励'
}],
types: '',
dialogFormVisible: false,
formLabelWidth: '180px',
form: {
verify_id: '×'
},
tableData: [],
tableLoading:false,
updateLoading:false,
insertLoading:false,
deleteBatchLoading:false,
searchLoading:false,
searchValue:"",
selectedRows:[],
currentPage:1,
pageSize:10,
total:0,
showDetail:false, //
detail:{}, //
showDeleteConfirm:false,
}
},
mounted () {
this.search();
},
methods: {
linkToStuInfo(row){
this.$router.push({
path:'/basic',
query:{
stuId:row.stuId
}
});
},
//
//urls:
openMutipleImg(urls){
this.showMutipleImg=true;
if(urls){
var array=urls.split(';');
for(var i=0;i<array.length;i++){
array[i]=array[i].replace(/^\s+|\s+$/g,"");
if(array[i].length>0){
this.imgUrls.push(array[i]);
this.detail.img+=";"+array[i];
}
}
}
},
closeMutipleImg(){
this.showMutipleImg=false;
this.imgUrls=[];
},
uploadSuccess(res){
if(!this.detail.img){
this.detail.img="";
}
this.detail.img+=";"+res.data;
},
handleRemove (url) {
//
var newList=[];
//
this.detail.img="";
for(var i=0;i<this.imgsList.length;i++){
if(url!=this.imgsList[i].url){
newList.push(this.imgsList[i]);
this.detail.img+=";"+this.imgsList[i].url;
}
}
this.imgsList=newList;
},
handlePictureCardPreview (file) {
this.dialogImageUrl = file.url
this.dialogVisible = true
this.url = file.url //
},
// submit (formName) {
// this.form.type = this.types
// this.form.img = this.url //form.img
// this.$refs[formName].validate((valid)=>{
// if (valid){
// console.log(this.form);
// }else{
// console.log('error submit!')
// return false;
// }
// });
// },
handleCurrentChange(curPage){
this.currentPage=curPage;
this.search();
},
handleSizeChange(size){
this.pageSize=size;
this.search();
},
search () {
this.tableLoading=true;
request.get("/api/activity/search",{
params:{
searchValue:this.searchValue,
page:this.currentPage,
size:this.pageSize
}
}).then(res=>{
this.total=res.data.data.total;
this.tableData=res.data.data.records;
this.tableLoading=false;
});
},
//
openDetail(row){
this.showDetail=true;
this.detail={...row};
if(this.detail.id){
if(this.detail.img && this.detail.img.length>0){
var array=this.detail.img.split(";");
for(var i=0;i<array.length;i++){
if(array[i].length>0){
this.imgsList.push({url:array[i]});
}
}
}
}
},
//
closeDetail(row){
this.showDetail=false;
this.detail={};
this.imgsList=[];
},
deleteRow(row){
this.tableLoading=true;
request.post("/api/activity/delete",{
id:row.id
}).then(res=>{
if(res.data.status==0){
this.tableLoading=false;
Notification({
type: 'success',
message: '删除成功'
})
//
this.search();
}
});
},
deleteBatch(){
var ids=[];
for(var i=0;i<this.selectedRows.length;i++){
ids.push(this.selectedRows[i].id);
}
if(ids.length==0){
return Notification({
type: 'info',
message: '请选择需要删除的数据'
});
}
this.deleteBatchLoading=true
request.post("/api/activity/deleteBatch",{ids}).then(res=>{
this.deleteBatchLoading=false;
if(res.data.status==0){
Notification({
type: 'success',
message: '批量删除成功'
})
//
this.search();
}
});
},
insertRow(){
this.insertLoading=true;
request.post("/api/activity/insert",{...this.detail}).then(res=>{
this.insertLoading=false;
if(res.data.status==0){
Notification({
type: 'success',
message: '新增成功'
})
this.closeDetail()
//
this.search();
}
});
},
updateRow(){
this.updateLoading=true;
request.post("/api/activity/update",{...this.detail}).then(res=>{
this.updateLoading=false;
Notification({
type: 'success',
message: '保存成功'
})
this.closeDetail();
//
this.search();
});
},
selectionChange(val){
this.selectedRows=val;
},
}
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,363 @@
<template>
<div>
<!--tab选项卡-->
<el-tabs type="border-card" v-model="activeName">
<!--学生总的信息-->
<el-tab-pane v-if="$shiro.hasPermission(this,'stuInfoManager')" name="all">
<span slot="label"><i class="el-icon-info"></i>学生信息</span>
<!-- <basic-all @all="onFn"></basic-all>-->
<el-button v-loading="insertLoading" type="primary" size="medium" icon="el-icon-plus" @click="add">新增</el-button>
<span style="width: 10px;height: 2px;display: inline-block"></span>
<el-popconfirm
title="确定删除这些数据吗?"
@onConfirm="deleteBatch">
<el-button slot="reference" type="danger" @click="" :loading="deleteBatchLoading">
<i class="el-icon-delete"></i>批量删除</el-button>
</el-popconfirm>
<div style="width:20%;float: right">
<el-input @keyup.enter.native="search" placeholder="请输入学号..." v-model="searchValue" class="input-with-select">
<el-button @click="search" slot="append" icon="el-icon-search" :loading="searchLoading"></el-button>
</el-input>
</div>
<!--表格-->
<el-table
:data="tableData"
v-loading="tableLoading"
height="370"
@selection-change="selectionChange">
<el-table-column type="selection" width="45">
</el-table-column>
<el-table-column prop="stuId" label="学号" >
</el-table-column>
<el-table-column prop="address" label="家庭住址" >
</el-table-column>
<el-table-column prop="political" label="政治面貌">
</el-table-column>
<el-table-column prop="college" label="学院名称">
</el-table-column>
<el-table-column prop="prof" label="专业名称">
</el-table-column>
<el-table-column prop="stuClass" label="行政班级" >
</el-table-column>
<el-table-column prop="inTime" label="入学年月" >
<template slot-scope="scope">
<i class="el-icon-time"></i>
<span style="margin-left: 10px">{{ scope.row.inTime }}</span>
</template>
</el-table-column>
<el-table-column prop="outTime" label="毕业年月">
<template slot-scope="scope">
<i class="el-icon-time"></i>
<span style="margin-left: 10px">{{ scope.row.outTime }}</span>
</template>
</el-table-column>
<el-table-column prop="academic" label="毕业学历">
</el-table-column>
<el-table-column prop="degree" label="毕业学位" >
</el-table-column>
<el-table-column
fixed="right"
label="操作"
width="250">
<template slot-scope="scope">
<el-button size="mini" type="infor" icon="el-icon-edit" @click="edit(scope.row)">查看</el-button>
<span style="width: 10px;height: 2px;display: inline-block"></span>
<el-popconfirm
title="确定删除这个用户吗?"
v-model="showDeleteConfirm"
@onConfirm="deleteRow(scope.row)">
<el-button slot="reference" type="danger" size="small">删除</el-button>
</el-popconfirm>
</template>
</el-table-column>
</el-table>
<!-- 分页-->
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-sizes="[10,20,50]"
:page-size="pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="total">
</el-pagination>
</el-tab-pane>
<!--学生新增-->
<el-tab-pane name="add">
<span slot="label"><i class="el-icon-edit-outline"></i>详情</span>
<div class="container" style="margin-top: 20px">
<div style="padding-top: 20px">
<el-form ref="form" :model="form" label-width="100px" class="demo-form-inline" :inline="true">
<el-form-item label="学号">
<el-input v-model="form.stuId"></el-input>
</el-form-item>
<el-form-item label="家庭住址">
<el-input v-model="form.address"></el-input>
</el-form-item>
<el-form-item label="政治面貌">
<el-input v-model="form.political"></el-input>
</el-form-item>
<el-form-item label="入学年月">
<el-date-picker
v-model="form.inTime"
type="date"
placeholder="选择日期"
style="width: 207.27px">
</el-date-picker>
</el-form-item>
<el-form-item label="毕业年月">
<el-date-picker
v-model="form.outTime"
type="date"
placeholder="选择日期"
style="width: 207.27px">
</el-date-picker>
</el-form-item>
<el-form-item label="学院名称">
<el-input v-model="form.college"></el-input>
</el-form-item>
<el-form-item label="专业名称">
<el-input v-model="form.prof"></el-input>
</el-form-item>
<el-form-item label="行政班级">
<el-input v-model="form.stuClass"></el-input>
</el-form-item>
<el-form-item label="毕业学历">
<el-select v-model="form.academic" clearable placeholder="请选择">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="毕业学位">
<el-select v-model="form.degree" clearable placeholder="请选择">
<el-option
v-for="item in options1"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item style="margin-left: 900px">
<el-button v-if="form.id" type="primary" @click="updateRow" style="margin-right: 30px">保存</el-button>
<el-button v-if="!form.id" type="primary" @click="insertRow" style="margin-right: 30px">新增</el-button>
<el-button style="margin-right: 30px" @click="onreset">重置</el-button>
</el-form-item>
</el-form>
</div>
</div>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import request from '../../utils/request'
import { Notification } from 'element-ui'
export default {
name: 'basic',
data () {
return {
showDeleteConfirm:false,
activeName: 'all',
selectIds: [], // ids
tableData: [],
tableLoading:false,
updateLoading:false,
insertLoading:false,
deleteBatchLoading:false,
searchLoading:false,
searchValue:"",
selectedRows:[],
form: {},
value: '',
value1: '',
options: [{
value: '专科',
label: '专科'
}, {
value: '本科',
label: '本科'
}, {
value: '硕士研究生',
label: '硕士研究生'
}, {
value: '博士研究生',
label: '博士研究生'
}],
options1: [{
value: '学士',
label: '学士'
}, {
value: '硕士',
label: '硕士'
}, {
value: '博士',
label: '博士'
}],
currentPage:1,
pageSize:10,
total:0,
}
},
mounted () {
console.log("坚定",this.$shiro.hasPermission(this,"menu:archives-manage"));
//
var stuId=this.$route.query.stuId;
if(stuId){
this.loadStuInfo(stuId);
}
//
this.loadMySelfInfo();
this.search()
},
methods: {
loadMySelfInfo(){
if(!this.$shiro.hasPermission(this,'stuInfoManager')){
var uid=this.$store.state.user.id;
if(uid){
//
request.get("/api/stu_info/getByUid",{
params:{uid:uid}
}).then(res=>{
if(res.data.status==0&&res.data.data){
this.edit(res.data.data);
}
});
}else{
console.log("不加载任何数据");
}
}
},
loadStuInfo(stuId){
if(this.$shiro.hasPermission(this,'stuInfoManager')){
//
request.get("/api/stu_info/getByStuId",{
params:{stuId:stuId}
}).then(res=>{
if(res.data.status==0){
this.edit(res.data.data);
}
});
}
},
//
add(){
this.activeName = 'add';
this.form = {};
this.value ='';
this.value1 = '';
},
//
edit(mes){
this.activeName = 'add';
this.form = mes;
this.value = mes.academic;
this.value1 = mes.degree;
},
handleCurrentChange(curPage){
this.currentPage=curPage;
this.search();
},
handleSizeChange(size){
this.pageSize=size;
this.search();
},
//
search () {
this.tableLoading=true;
request.get("/api/stu_info/search",{
params:{
searchValue:this.searchValue,
page:this.currentPage,
size:this.pageSize
}
}).then(res=>{
this.total=res.data.data.total;
this.tableData=res.data.data.records;
this.tableLoading=false;
});
},
deleteRow(row){
this.tableLoading=true;
request.post("/api/stu_info/delete",{
id:row.id
}).then(res=>{
if(res.data.status==0){
this.tableLoading=false;
Notification({
type: 'success',
message: '删除成功'
})
//
this.search();
}
});
},
deleteBatch(){
var ids=[];
for(var i=0;i<this.selectedRows.length;i++){
ids.push(this.selectedRows[i].id);
}
if(ids.length==0){
return Notification({
type: 'info',
message: '请选择需要删除的数据'
});
}
this.deleteBatchLoading=true
request.post("/api/stu_info/deleteBatch",{ids}).then(res=>{
this.deleteBatchLoading=false;
if(res.data.status==0){
Notification({
type: 'success',
message: '批量删除成功'
})
//
this.search();
}
});
},
insertRow(){
this.insertLoading=true;
request.post("/api/stu_info/insert",{...this.form}).then(res=>{
this.insertLoading=false;
if(res.data.status==0){
Notification({
type: 'success',
message: '新增成功'
})
//
this.search();
}
});
},
updateRow(){
this.updateLoading=true;
request.post("/api/stu_info/update",{...this.form}).then(res=>{
this.updateLoading=false;
Notification({
type: 'success',
message: '保存成功'
})
//
this.search();
});
},
selectionChange(val){
this.selectedRows=val;
},
onreset() { //
this.form = {}
},
}
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,310 @@
<template>
<div class="course" style="padding:20px;">
<!-- 查询部分-->
<div id="query" style="padding-bottom: 10px">
<el-button type="primary" @click="openCourseDetail({})" :loading="insertLoading">
<i class="el-icon-plus"></i>新增</el-button>
<span style="width: 10px;height: 2px;display: inline-block"></span>
<el-popconfirm
title="确定删除这些用户吗?"
@onConfirm="deleteBatch">
<el-button slot="reference" type="danger" @click="" :loading="deleteBatchLoading">
<i class="el-icon-delete"></i>批量删除</el-button>
</el-popconfirm>
<div style="width:30%;float: right">
<el-input @keyup.enter.native="search" placeholder="请输入内容" v-model="searchValue" class="input-with-select">
<el-button @click="search" slot="append" icon="el-icon-search" :loading="searchLoading"></el-button>
</el-input>
</div>
</div>
<div class="courseGrade">
<el-table
:data="tableData"
v-loading="tableLoading"
@selection-change="selectionChange"
height="370"
style="width: 100%">
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column
prop="stuId"
label="学号"
width="180">
<template slot-scope="scope">
<el-link type="primary" @click="linkToStuInfo(scope.row)">{{scope.row.stuId}}</el-link>
</template>
</el-table-column>
<el-table-column
prop="courseName"
label="课程名称"
width="280">
</el-table-column>
<el-table-column
prop="score"
label="课程成绩"
width="240">
<template slot-scope="scope">
<el-link type="primary" @click="lookCourse(scope.row)">
{{computeScore(scope.row)}}
</el-link>
</template>
</el-table-column>
<el-table-column
prop="courseLevel"
label="课程等级"
width="240">
<template slot-scope="scope">
<span v-if="scope.row.courseLevel==''" style="color: #85ce61" ></span>
<span v-if="scope.row.courseLevel==''" style="color: #409eff" ></span>
<span v-if="scope.row.courseLevel==''" style="color: #e6a23c" ></span>
<span v-if="scope.row.courseLevel==''" style="color: #f56c6c" ></span>
</template>
</el-table-column>
<el-table-column
prop="courseRank"
label="课程排名"
width="240">
</el-table-column>
<el-table-column
prop="auditStatusCode"
label="状态"
width="240">
<template slot-scope="scope">
<span>{{$dict.getValue(scope,'audit_status',scope.row.auditStatusCode)}}</span>
</template>
</el-table-column>
<el-table-column
prop="teacher"
label="任课教师"
>
</el-table-column>
<el-table-column
fixed="right"
label="操作"
width="250">
<template slot-scope="scope">
<el-button @click="openCourseDetail(scope.row)" type="primary" size="small">修改</el-button>
<span style="width: 10px;height: 2px;display: inline-block"></span>
<el-popconfirm
title="确定删除这个用户吗?"
v-model="showDeleteConfirm"
@onConfirm="deleteCourse(scope.row)">
<el-button slot="reference" type="danger" size="small">删除</el-button>
</el-popconfirm>
</template>
</el-table-column>
</el-table>
<!-- 分页-->
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-sizes="[10,20,50]"
:page-size="pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="total">
</el-pagination>
<el-dialog title="成绩详情" :visible.sync="showScoreDialog" width="15%" :before-close="closeDialog">
平时成绩(<span>{{course.usualRatio*100}}%</span>)<span style="color: #e6a23c">{{course.usualScore}}</span><br>
卷面成绩(<span>{{(1-course.usualRatio)*100}}%</span>)<span style="color: #85ce61">{{course.score}}</span><br>
成绩等级<span>{{course.courseLevel}}</span>
</el-dialog>
<!-- 课程详情-->
<el-dialog title="成绩信息" :visible.sync="showCourseDetail" width="30%" :before-close="closeDialog">
<el-form :model="course">
<el-form-item label="学号:" required>
<el-input v-model="course.uid" ></el-input>
</el-form-item>
<el-form-item label="课程名称:" required>
<el-input v-model="course.courseName" ></el-input>
</el-form-item>
<el-form-item label="卷面成绩:">
<el-input type="number" v-model="course.score" ></el-input>
</el-form-item>
<el-form-item label="平时成绩:">
<el-input type="number" v-model="course.usualScore" ></el-input>
</el-form-item>
<el-form-item label="平时成绩占比:">
<el-input type="number" v-model="course.usualRatio" ></el-input>
</el-form-item>
<el-form-item label="总成绩:">
<el-input :disabled="true" type="number" :value="computeScore(course)" readonly></el-input>
</el-form-item>
<el-form-item label="成绩等级:">
<el-select v-model="course.courseLevel" placeholder="请选择">
<el-option label="优" value="优"></el-option>
<el-option label="良" value="良"></el-option>
<el-option label="中" value="中"></el-option>
<el-option label="差" value="差"></el-option>
</el-select>
</el-form-item>
<el-form-item label="排名:">
<el-input type="number" v-model="course.courseRank" ></el-input>
</el-form-item>
<el-form-item label="任课老师:" required>
<el-input v-model="course.teacher" ></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="closeCourseDetail"> </el-button>
<el-button v-if="course.id" type="primary" :loading="updateLoading" @click="updateCourse">保存</el-button>
<el-button v-if="!course.id" type="primary" :loading="insertLoading" @click="insertCourse">新增</el-button>
</span>
</el-dialog>
</div>
</div>
</template>
<script>
import request from '../../utils/request'
import { Notification } from 'element-ui'
export default {
name: 'courseMes',
data () {
return {
labelPosition:"top",
tableData: [],
tableLoading:false,
currentPage:1,
pageSize:10,
searchValue:"",
total:0,
showDeleteConfirm: false,
showScoreDialog:false,
course:{},
updateLoading:false,
insertLoading:false,
showCourseDetail:false,
deleteBatchLoading:false,
selectedRows:[]
}
},
mounted () {
this.search(this.currentPage,this.pageSize);
},
methods: {
linkToStuInfo(row){
this.$router.push({
path:'/basic',
query:{
stuId:row.stuId
}
});
},
//
search (page,size) {
this.tableLoading=true;
request.get("/api/course/search",{
params:{
searchValue:this.searchValue,
page:this.currentPage,
size:this.pageSize
}
}).then(res=>{
this.total=res.data.data.total;
this.tableData=res.data.data.records;
this.tableLoading=false;
});
},
handleCurrentChange(curPage){
this.currentPage=curPage;
this.search(this.currentPage,this.pageSize);
},
handleSizeChange(size){
this.pageSize=size;
this.search(this.currentPage,this.pageSize);
},
lookCourse(row){
this.showScoreDialog=true;
this.course=row;
},
updateCourse(){
this.updateLoading=true;
request.post("/api/course/update",{...this.course}).then(res=>{
this.updateLoading=false;
this.closeCourseDetail();
Notification({
type: 'success',
message: '保存成功'
})
//
this.search(this.currentPage,this.pageSize);
});
},
deleteCourse(row){
this.tableLoading=true;
request.post("/api/course/delete",{
id:row.id
}).then(res=>{
if(res.data.status==0){
this.tableLoading=false;
Notification({
type: 'success',
message: '删除成功'
})
//
this.search(this.currentPage,this.pageSize);
}
});
},
deleteBatch(){
var ids=[];
for(var i=0;i<this.selectedRows.length;i++){
ids.push(this.selectedRows[i].id);
}
if(ids.length==0){
return Notification({
type: 'info',
message: '请选择需要删除的数据'
});
}
this.deleteBatchLoading=true
request.post("/api/course/deleteBatch",{ids}).then(res=>{
this.deleteBatchLoading=false;
if(res.data.status==0){
Notification({
type: 'success',
message: '批量删除成功'
})
//
this.search(this.currentPage,this.pageSize);
}
});
},
insertCourse(){
this.insertLoading=true;
request.post("/api/course/insert",{...this.course}).then(res=>{
this.insertLoading=false;
if(res.data.status==0){
Notification({
type: 'success',
message: '新增成功'
})
this.closeCourseDetail()
//
this.search(this.currentPage,this.pageSize);
}
});
},
openCourseDetail(row){
this.showCourseDetail=true;
this.course={...row};
},
closeCourseDetail(){
this.showCourseDetail=false;
this.course={};
},
selectionChange(val){
this.selectedRows=val;
},
//
computeScore(course){
var score=course.score*(1-course.usualRatio)+course.usualScore*course.usualRatio;
score=score.toFixed(1);
return score;
}
}
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,300 @@
<template>
<div>
<div style="padding: 20px;">
<!-- 查询部分-->
<div id="query" >
<el-button type="primary" @click="openDetail({})" :loading="insertLoading">
<i class="el-icon-plus"></i>新增</el-button>
<span style="width: 10px;height: 2px;display: inline-block"></span>
<el-popconfirm
title="确定删除这些数据吗?"
@onConfirm="deleteBatch">
<el-button slot="reference" type="danger" @click="" :loading="deleteBatchLoading">
<i class="el-icon-delete"></i>批量删除</el-button>
</el-popconfirm>
<span style="width: 10px;height: 2px;display: inline-block"></span>
<div style="width:30%;float: right">
<el-input @keyup.enter.native="search" placeholder="请输入学号" v-model="searchValue" class="input-with-select">
<el-button @click="search" slot="append" icon="el-icon-search" :loading="searchLoading"></el-button>
</el-input>
</div>
</div>
<div class="growMes">
<el-table
:data="tableData"
v-loading="tableLoading"
@selection-change="selectionChange"
height="370"
style="width: 100%">
<el-table-column type="selection" width="45">
</el-table-column>
<el-table-column
prop="stuId"
label="学号"
width="180">
<template slot-scope="scope">
<el-link type="primary" @click="linkToStuInfo(scope.row)">{{scope.row.stuId}}</el-link>
</template>
</el-table-column>
<el-table-column
prop="company"
label="就职单位"
width="200">
</el-table-column>
<el-table-column
prop="inTime"
label="入职时间"
width="160">
</el-table-column>
<el-table-column
prop="salary"
label="薪资(元)"
width="120">
</el-table-column>
<el-table-column
prop="auditStatusCode"
label="审核状态">
<template slot-scope="scope">
<span>{{$dict.getValue(scope,'audit_status',scope.row.auditStatusCode)}}</span>
</template>
</el-table-column>
<el-table-column
fixed="right"
label="操作"
width="250">
<template slot-scope="scope">
<el-button @click="openDetail(scope.row)" type="primary" size="small">修改</el-button>
<span style="width: 10px;height: 2px;display: inline-block"></span>
<el-popconfirm
title="确定删除这个用户吗?"
v-model="showDeleteConfirm"
@onConfirm="deleteRow(scope.row)">
<el-button slot="reference" type="danger" size="small">删除</el-button>
</el-popconfirm>
</template>
</el-table-column>
</el-table>
<!-- 分页-->
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-sizes="[10,20,50]"
:page-size="pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="total">
</el-pagination>
</div>
<!--修改信息对话框-->
<div class="edit">
<el-dialog @close="closeDetail" title="就业发展信息" :visible.sync="showDetail">
<el-form :model="detail">
<el-form-item label="学号" :labewidth="formLabelWidth">
<el-input v-model="detail.stuId" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="就职单位" :labewidth="formLabelWidth">
<el-input v-model="detail.company" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="薪资" :labewidth="formLabelWidth">
<el-input type="number" v-model="detail.salary" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="入职时间" :labewidth="formLabelWidth">
<el-date-picker
v-model="detail.inTime"
type="date"
placeholder="选择日期"
style="width: 207.27px">
</el-date-picker>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="showDetail = false"> </el-button>
<el-button v-if="detail.id" type="primary" :loading="updateLoading" @click="updateRow">保存</el-button>
<el-button v-if="!detail.id" type="primary" :loading="insertLoading" @click="insertRow">新增</el-button>
</div>
</el-dialog>
</div>
</div>
</div>
</template>
<script>
import request from '../../utils/request'
import { Notification } from 'element-ui'
export default {
name: 'grow_infro',
data () {
return {
tableData: [],
tableLoading:false,
updateLoading:false,
insertLoading:false,
deleteBatchLoading:false,
searchLoading:false,
searchValue:"",
selectedRows:[],
currentPage:1,
pageSize:10,
total:0,
showDetail:false, //
detail:{}, //
showDeleteConfirm:false,
formLabelWidth: '120px',
form: {
depart:'',
desc:'',
work_time:''
},
form1:{},
ruleForm:{
depart:'',
desc:'',
work_time:''
},
rules:{
depart:[
{required:true,message:'请输入就职单位',trigger:'blur'}
],
desc:[
{required:true,message:'请输入任职情况',trigger:'blur'}
],
work_time:[
{required:true,message:'请输入已工作时间',trigger:'blur'}
],
}
}
},
mounted () {
this.search();
},
methods: {
linkToStuInfo(row){
this.$router.push({
path:'/basic',
query:{
stuId:row.stuId
}
});
},
handleCurrentChange(curPage){
this.currentPage=curPage;
this.search();
},
handleSizeChange(size){
this.pageSize=size;
this.search();
},
search () {
this.tableLoading=true;
request.get("/api/employ/search",{
params:{
searchValue:this.searchValue,
page:this.currentPage,
size:this.pageSize
}
}).then(res=>{
this.tableLoading=false;
this.total=res.data.data.total;
this.tableData=res.data.data.records;
});
},
//
openDetail(row){
this.showDetail=true;
this.detail={...row};
},
//
closeDetail(row){
this.showDetail=false;
this.detail={};
},
deleteRow(row){
this.tableLoading=true;
request.post("/api/employ/delete",{
id:row.id
}).then(res=>{
if(res.data.status==0){
this.tableLoading=false;
Notification({
type: 'success',
message: '删除成功'
})
//
this.search();
}
});
},
deleteBatch(){
var ids=[];
for(var i=0;i<this.selectedRows.length;i++){
ids.push(this.selectedRows[i].id);
}
if(ids.length==0){
return Notification({
type: 'info',
message: '请选择需要删除的数据'
});
}
this.deleteBatchLoading=true
request.post("/api/employ/deleteBatch",{ids}).then(res=>{
this.deleteBatchLoading=false;
if(res.data.status==0){
Notification({
type: 'success',
message: '批量删除成功'
})
//
this.search();
}
});
},
insertRow(){
this.insertLoading=true;
request.post("/api/employ/insert",{...this.detail}).then(res=>{
this.insertLoading=false;
if(res.data.status==0){
Notification({
type: 'success',
message: '新增成功'
})
this.closeDetail()
//
this.search();
}
});
},
updateRow(){
this.updateLoading=true;
request.post("/api/employ/update",{...this.detail}).then(res=>{
this.updateLoading=false;
Notification({
type: 'success',
message: '保存成功'
})
this.closeDetail();
//
this.search();
});
},
selectionChange(val){
this.selectedRows=val;
},
subStr(str,num){
if(str&&str.length>num){
str=str.substring(0,num)+"...";
}
return str;
}
}
}
</script>
<style scoped>
.header{
padding-top: 20px;
}
.header>.el-button{
margin-left: 10px;
}
</style>

View File

@ -0,0 +1,402 @@
<template>
<div style="padding:20px">
<!-- 查询部分-->
<div id="query" >
<el-button type="primary" @click="openDetail({})" :loading="insertLoading">
<i class="el-icon-plus"></i>新增</el-button>
<span style="width: 10px;height: 2px;display: inline-block"></span>
<el-popconfirm
title="确定删除这些数据吗?"
@onConfirm="deleteBatch">
<el-button slot="reference" type="danger" @click="" :loading="deleteBatchLoading">
<i class="el-icon-delete"></i>批量删除</el-button>
</el-popconfirm>
<span style="width: 10px;height: 2px;display: inline-block"></span>
<div style="width:30%;float: right">
<el-input @keyup.enter.native="search" placeholder="请输入学号" v-model="searchValue" class="input-with-select">
<el-button @click="search" slot="append" icon="el-icon-search" :loading="searchLoading"></el-button>
</el-input>
</div>
</div>
<div class="medicalMes">
<el-table
:data="tableData"
v-loading="tableLoading"
@selection-change="selectionChange"
height="370"
style="width: 100%">
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column
prop="stuId"
label="学号"
width="180">
<template slot-scope="scope">
<el-link type="primary" @click="linkToStuInfo(scope.row)">{{scope.row.stuId}}</el-link>
</template>
</el-table-column>
<el-table-column
prop="medicalTime"
label="体检时间" width="180">
</el-table-column>
<el-table-column
prop="unit"
label="体检单位" width="180">
</el-table-column>
<el-table-column
prop="medicalDesc"
label="体检结果说明"
width="320">
<template slot-scope="scope">
<el-link type="primary" @click="openDesc(scope.row.medicalDesc)">{{subStr(scope.row.medicalDesc,10)}}</el-link>
</template>
</el-table-column>
<el-table-column
prop="img"
label="体检结果图片"
width="150"
height="300">
<template slot-scope="scope">
<el-link type="primary" @click="openMutipleImg(scope.row.img)">查看结果</el-link>
</template>
</el-table-column>
<el-table-column
prop="auditStatusCode"
width="150"
label="档案状态">
<template slot-scope="scope">
<span>{{$dict.getValue(scope,'audit_status',scope.row.auditStatusCode)}}</span>
</template>
</el-table-column>
<el-table-column
fixed="right"
label="操作"
width="250">
<template slot-scope="scope">
<el-button @click="openDetail(scope.row)" type="primary" size="small">修改</el-button>
<span style="width: 10px;height: 2px;display: inline-block"></span>
<el-popconfirm
title="确定删除这个用户吗?"
v-model="showDeleteConfirm"
@onConfirm="deleteRow(scope.row)">
<el-button slot="reference" type="danger" size="small">删除</el-button>
</el-popconfirm>
</template>
</el-table-column>
</el-table>
<!-- 分页-->
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-sizes="[10,20,50]"
:page-size="pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="total">
</el-pagination>
</div>
<!--新增信息弹出框-->
<el-dialog @close="closeDetail" title="体检信息" :visible.sync="showDetail">
<el-form :model="detail">
<el-form-item label="学号:" required :label-width="formLabelWidth" >
<el-input
maxlength="20"
show-word-limit
v-model="detail.stuId" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="体检单位:" required :label-width="formLabelWidth">
<el-input v-model="detail.unit" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="体检结果说明:" required :label-width="formLabelWidth">
<el-input type="textarea"
:rows="6"
placeholder="请输入体检结果说明"
maxlength="500"
show-word-limit
v-model="detail.medicalDesc" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="体检时间" required :label-width="formLabelWidth">
<el-date-picker
v-model="detail.medicalTime"
type="date"
placeholder="选择日期"
style="width: 207.27px">
</el-date-picker>
</el-form-item>
<el-form-item label="参与/获得证明" required :label-width="formLabelWidth" >
<el-upload
ref="upload"
:file-list="imgsList"
action="/api/upload/img"
:on-success="uploadSuccess"
list-type="picture-card"
>
<i slot="default" class="el-icon-plus"></i>
<div slot="file" slot-scope="{file}" id="img">
<img
class="el-upload-list__item-thumbnail"
:src="file.url" alt="">
<span class="el-upload-list__item-actions">
<span class="el-upload-list__item-preview"
@click="handlePictureCardPreview(file)">
<i class="el-icon-zoom-in"></i>
</span>
<span
v-if="!disabled"
class="el-upload-list__item-delete"
@click="handleRemove(file.url)">
<i class="el-icon-delete"></i>
</span>
</span>
</div>
</el-upload>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false"> </el-button>
<el-button v-if="detail.id" type="primary" :loading="updateLoading" @click="updateRow">保存</el-button>
<el-button v-if="!detail.id" type="primary" :loading="insertLoading" @click="insertRow">新增</el-button>
<!-- <el-button type="primary" @click="submit('ruleForm')">提交</el-button>-->
</div>
</el-dialog>
<el-dialog
title="体检结果说明"
@close="closeDesc"
:visible.sync="showDesc">
<span>{{desc}}</span>
</el-dialog>
<el-dialog title="证明材料"
:visible.sync="showMutipleImg"
@close="closeMutipleImg">
<span v-if="imgUrls.length==0">未上传体检结果图片</span>
<template v-if="imgUrls.length>0">
<el-image v-for="item in imgUrls"
style="width: 100px; height: 100px"
:src="item"
:lazy="true"
:preview-src-list="[item]">
</el-image>
</template>
</el-dialog>
</div>
</template>
<script>
import request from '../../utils/request'
import { Notification } from 'element-ui'
export default {
name: 'medical',
data () {
return {
formLabelWidth: '130px',
imgsList:[],
showMutipleImg:false,
imgUrls:[], //src
tableData: [],
tableLoading:false,
updateLoading:false,
insertLoading:false,
deleteBatchLoading:false,
searchLoading:false,
searchValue:"",
selectedRows:[],
currentPage:1,
pageSize:10,
total:0,
showDetail:false, //
detail:{}, //
showDeleteConfirm:false,
showDesc:false,
desc:"",
}
},
mounted () {
this.search();
},
methods: {
openDesc(desc){
this.showDesc=true;
this.desc=desc;
},
closeDesc(){
this.showDesc=false;
this.desc="暂无描述";
},
linkToStuInfo(row){
this.$router.push({
path:'/basic',
query:{
stuId:row.stuId
}
});
},
//
//urls:
openMutipleImg(urls){
this.showMutipleImg=true;
if(urls){
var array=urls.split(';');
for(var i=0;i<array.length;i++){
array[i]=array[i].replace(/^\s+|\s+$/g,"");
if(array[i].length>0){
this.imgUrls.push(array[i]);
this.detail.img+=";"+array[i];
}
}
}
},
closeMutipleImg(){
this.showMutipleImg=false;
this.imgUrls=[];
},
uploadSuccess(res){
if(!this.detail.img){
this.detail.img="";
}
this.detail.img+=";"+res.data;
},
handleRemove (url) {
//
var newList=[];
//
this.detail.img="";
for(var i=0;i<this.imgsList.length;i++){
if(url!=this.imgsList[i].url){
newList.push(this.imgsList[i]);
this.detail.img+=";"+this.imgsList[i].url;
}
}
this.imgsList=newList;
},
handlePictureCardPreview (file) {
this.dialogImageUrl = file.url
this.dialogVisible = true
this.url = file.url //
},
handleCurrentChange(curPage){
this.currentPage=curPage;
this.search();
},
handleSizeChange(size){
this.pageSize=size;
this.search();
},
search () {
this.tableLoading=true;
request.get("/api/medical/search",{
params:{
searchValue:this.searchValue,
page:this.currentPage,
size:this.pageSize
}
}).then(res=>{
this.tableLoading=false;
this.total=res.data.data.total;
this.tableData=res.data.data.records;
});
},
//
openDetail(row){
this.showDetail=true;
this.detail={...row};
if(this.detail.id){
if(this.detail.img && this.detail.img.length>0){
var array=this.detail.img.split(";");
for(var i=0;i<array.length;i++){
if(array[i].length>0){
this.imgsList.push({url:array[i]});
}
}
}
}
},
//
closeDetail(row){
this.showDetail=false;
this.detail={};
this.imgsList=[];
},
deleteRow(row){
this.tableLoading=true;
request.post("/api/medical/delete",{
id:row.id
}).then(res=>{
if(res.data.status==0){
this.tableLoading=false;
Notification({
type: 'success',
message: '删除成功'
})
//
this.search();
}
});
},
deleteBatch(){
var ids=[];
for(var i=0;i<this.selectedRows.length;i++){
ids.push(this.selectedRows[i].id);
}
if(ids.length==0){
return Notification({
type: 'info',
message: '请选择需要删除的数据'
});
}
this.deleteBatchLoading=true
request.post("/api/medical/deleteBatch",{ids}).then(res=>{
this.deleteBatchLoading=false;
if(res.data.status==0){
Notification({
type: 'success',
message: '批量删除成功'
})
//
this.search();
}
});
},
insertRow(){
this.insertLoading=true;
request.post("/api/medical/insert",{...this.detail}).then(res=>{
this.insertLoading=false;
if(res.data.status==0){
Notification({
type: 'success',
message: '新增成功'
})
this.closeDetail()
//
this.search();
}
});
},
updateRow(){
this.updateLoading=true;
request.post("/api/medical/update",{...this.detail}).then(res=>{
this.updateLoading=false;
Notification({
type: 'success',
message: '保存成功'
})
this.closeDetail();
//
this.search();
});
},
selectionChange(val){
this.selectedRows=val;
},
subStr(str,num){
if(str&&str.length>num){
str=str.substring(0,num)+"...";
}
return str;
}
}
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,324 @@
<template>
<div style="padding: 20px">
<!-- 查询部分-->
<div id="query" >
<el-button type="primary" @click="openDetail({})" :loading="insertLoading">
<i class="el-icon-plus"></i>新增</el-button>
<span style="width: 10px;height: 2px;display: inline-block"></span>
<el-popconfirm
title="确定删除这些用户吗?"
@onConfirm="deleteBatch">
<el-button slot="reference" type="danger" @click="" :loading="deleteBatchLoading">
<i class="el-icon-delete"></i>批量删除</el-button>
</el-popconfirm>
<span style="width: 10px;height: 2px;display: inline-block"></span>
<el-popover
placement="bottom"
width="600"
offset="10"
trigger="click">
<el-form :inline="true" :model="searchForm">
<el-form-item label="项目名称:" >
<el-input v-model="searchForm.proName" placeholder="请填写项目名称"></el-input>
</el-form-item>
<el-form-item label="项目级别:" >
<el-select v-model="searchForm.proLevel" placeholder="请选择">
<el-option label="国际级" value="国际级"></el-option>
<el-option label="国家级" value="国家级"></el-option>
<el-option label="省部级" value="省部级"></el-option>
<el-option label="市、州级" value="市、州级"></el-option>
<el-option label="校级" value="校级"></el-option>
<el-option label="院级" value="院级"></el-option>
</el-select>
</el-form-item>
<el-form-item label="项目经费:" >
<el-input v-model="searchForm.funds" placeholder="请填写项目经费"></el-input>
</el-form-item>
<el-form-item label="项目状态:" >
<el-select v-model="searchForm.status" placeholder="请选择">
<el-option label="已立项" value="已立项"></el-option>
<el-option label="完成中" value="完成中"></el-option>
<el-option label="已完成" value="已完成"></el-option>
</el-select>
</el-form-item>
<el-button type="primary" @click="search"><i class="el-icon-search"></i>查询</el-button>
</el-form>
<el-button slot="reference">筛选</el-button>
</el-popover>
<div style="width:30%;float: right">
<el-input @keyup.enter.native="search" placeholder="请输入内容" v-model="searchValue" class="input-with-select">
<el-button @click="search" slot="append" icon="el-icon-search" :loading="searchLoading"></el-button>
</el-input>
</div>
</div>
<div class="science">
<el-table
:data="tableData"
v-loading="tableLoading"
@selection-change="selectionChange"
height="370"
style="width: 100%">
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column
prop="stuId"
label="学号"
width="100">
<template slot-scope="scope">
<el-link type="primary" @click="linkToStuInfo(scope.row)">{{scope.row.stuId}}</el-link>
</template>
</el-table-column>
<el-table-column
prop="proName"
label="项目名称"
width="140">
</el-table-column>
<el-table-column
prop="proLevel"
label="项目级别"
width="140">
</el-table-column>
<el-table-column
prop="funds"
label="项目经费"
width="140">
</el-table-column>
<el-table-column
prop="status"
label="项目状态"
width="140">
</el-table-column>
<el-table-column
prop="auditStatusCode"
label="审核状态"
width="140">
<template slot-scope="scope">
<span>{{$dict.getValue(scope,'audit_status',scope.row.auditStatusCode)}}</span>
</template>
</el-table-column>
<el-table-column
prop="descr"
label="项目简介">
<template slot-scope="scope">
<el-popover
placement="top-start"
title="项目简介"
width="400"
trigger="hover"
:content="scope.row.descr">
<span slot="reference">{{subDesc(scope.row.descr)}}</span>
</el-popover>
</template>
</el-table-column>
<el-table-column
fixed="right"
label="操作"
width="250">
<template slot-scope="scope">
<el-button @click="openDetail(scope.row)" type="primary" size="small">修改</el-button>
<span style="width: 10px;height: 2px;display: inline-block"></span>
<el-popconfirm
title="确定删除这个用户吗?"
v-model="showDeleteConfirm"
@onConfirm="deleteRow(scope.row)">
<el-button slot="reference" type="danger" size="small">删除</el-button>
</el-popconfirm>
</template>
</el-table-column>
</el-table>
<!-- 分页-->
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-sizes="[10,20,50]"
:page-size="pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="total">
</el-pagination>
</div>
<el-dialog title="科研信息" :visible.sync="showDetail">
<el-form :model="detail">
<el-form-item label="项目名称" required>
<el-input v-model="detail.proName" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="项目级别" required>
<el-select v-model="detail.proLevel" placeholder="请选择">
<el-option label="国际级" value="国际级"></el-option>
<el-option label="国家级" value="国家级"></el-option>
<el-option label="省部级" value="省部级"></el-option>
<el-option label="市、州级" value="市、州级"></el-option>
<el-option label="校级" value="校级"></el-option>
<el-option label="院级" value="院级"></el-option>
</el-select>
</el-form-item>
<el-form-item label="项目经费" required>
<el-input v-model="detail.funds" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="项目状态" required>
<el-select v-model="detail.status" placeholder="请选择">
<el-option label="已立项" value="已立项"></el-option>
<el-option label="完成中" value="完成中"></el-option>
<el-option label="已完成" value="已完成"></el-option>
</el-select>
</el-form-item>
<el-form-item label="项目简介" required>
<el-input type="textarea" :rows="4" v-model="detail.descr" autocomplete="off"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="closeDetail"> </el-button>
<el-button v-if="detail.id" type="primary" :loading="updateLoading" @click="updateRow">保存</el-button>
<el-button v-if="!detail.id" type="primary" :loading="insertLoading" @click="insertRow">新增</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import request from '../../utils/request'
import { Notification } from 'element-ui'
export default {
name: 'scienceMes',
data () {
return {
input: '',
dialogFormVisible: false,
formLabelWidth: '120px',
form: {},
tableData: [],
tableLoading:false,
updateLoading:false,
insertLoading:false,
deleteBatchLoading:false,
searchLoading:false,
searchValue:"",
selectedRows:[],
currentPage:1,
pageSize:10,
total:0,
showDetail:false, //
detail:{}, //
searchForm:{}
}
},
mounted () {
this.search();
},
methods: {
linkToStuInfo(row){
this.$router.push({
path:'/basic',
query:{
stuId:row.stuId
}
});
},
handleCurrentChange(curPage){
this.currentPage=curPage;
this.search();
},
handleSizeChange(size){
this.pageSize=size;
this.search();
},
search () {
this.tableLoading=true;
request.get("/api/project/search",{
params:{
searchValue:this.searchValue,
page:this.currentPage,
size:this.pageSize
}
}).then(res=>{
this.total=res.data.data.total;
this.tableData=res.data.data.records;
this.tableLoading=false;
});
},
//
openDetail(row){
this.showDetail=true;
this.detail={...row};
},
//
closeDetail(row){
this.showDetail=false;
this.detail={};
},
deleteRow(row){
this.tableLoading=true;
request.post("/api/project/delete",{
id:row.id
}).then(res=>{
if(res.data.status==0){
this.tableLoading=false;
Notification({
type: 'success',
message: '删除成功'
})
//
this.search();
}
});
},
deleteBatch(){
var ids=[];
for(var i=0;i<this.selectedRows.length;i++){
ids.push(this.selectedRows[i].id);
}
if(ids.length==0){
return Notification({
type: 'info',
message: '请选择需要删除的数据'
});
}
this.deleteBatchLoading=true
request.post("/api/project/deleteBatch",{ids}).then(res=>{
this.deleteBatchLoading=false;
if(res.data.status==0){
Notification({
type: 'success',
message: '批量删除成功'
})
//
this.search();
}
});
},
insertRow(){
this.insertLoading=true;
request.post("/api/project/insert",{...this.detail}).then(res=>{
this.insertLoading=false;
if(res.data.status==0){
Notification({
type: 'success',
message: '新增成功'
})
this.closeDetail()
//
this.search();
}
});
},
updateRow(row){
this.updateLoading=true;
request.post("/api/project/update",{...this.detail}).then(res=>{
this.updateLoading=false;
this.closeDetail();
//
this.search();
});
},
selectionChange(val){
this.selectedRows=val;
},
//
subDesc(desc){
return desc.substring(1,15)+"......";
}
}
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,312 @@
<template>
<div style="padding: 20px;">
<!-- 查询部分-->
<div id="query" >
<el-button type="primary" @click="openDetail({})" :loading="insertLoading">
<i class="el-icon-plus"></i>新增</el-button>
<span style="width: 10px;height: 2px;display: inline-block"></span>
<el-popconfirm
title="确定删除这些数据吗?"
@onConfirm="deleteBatch">
<el-button slot="reference" type="danger" @click="" :loading="deleteBatchLoading">
<i class="el-icon-delete"></i>批量删除</el-button>
</el-popconfirm>
<span style="width: 10px;height: 2px;display: inline-block"></span>
<div style="width:30%;float: right">
<el-input @keyup.enter.native="search" placeholder="请输入学号" v-model="searchValue" class="input-with-select">
<el-button @click="search" slot="append" icon="el-icon-search" :loading="searchLoading"></el-button>
</el-input>
</div>
</div>
<div class="weiji">
<el-table
:data="tableData"
v-loading="tableLoading"
@selection-change="selectionChange"
height="370"
style="width: 100%" >
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column
prop="stuId"
label="学号"
width="180">
<template slot-scope="scope">
<el-link type="primary" @click="linkToStuInfo(scope.row)">{{scope.row.stuId}}</el-link>
</template>
</el-table-column>
<el-table-column
prop="disName"
label="违纪名称"
width="160">
</el-table-column>
<el-table-column
prop="disTime"
label="违纪时间"
width="160">
</el-table-column>
<el-table-column
prop="disDesc"
label="违纪说明"
width="300">
</el-table-column>
<el-table-column
prop="auditStatusCode"
label="审核状态">
<template slot-scope="scope">
<span>{{$dict.getValue(scope,'audit_status',scope.row.auditStatusCode)}}</span>
</template>
</el-table-column>
<el-table-column
fixed="right"
label="操作"
width="250">
<template slot-scope="scope">
<el-button @click="openDetail(scope.row)" type="primary" size="small">修改</el-button>
<span style="width: 10px;height: 2px;display: inline-block"></span>
<el-popconfirm
title="确定删除这个用户吗?"
v-model="showDeleteConfirm"
@onConfirm="deleteRow(scope.row)">
<el-button slot="reference" type="danger" size="small">删除</el-button>
</el-popconfirm>
</template>
</el-table-column>
</el-table>
<!-- 分页-->
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-sizes="[10,20,50]"
:page-size="pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="total">
</el-pagination>
<!--新增对话框-->
<el-dialog title="违纪信息" :visible.sync="showDetail">
<el-form :model="detail">
<el-form-item label="学号" required :label-width="formLabelWidth" >
<el-input v-model="detail.stuId" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="违纪名称" required :label-width="formLabelWidth">
<el-input v-model="detail.disName" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="违纪时间" required :label-width="formLabelWidth" >
<el-date-picker
v-model="detail.disTime"
type="date"
placeholder="选择日期"
style="width: 207.27px">
</el-date-picker>
</el-form-item>
<el-form-item label="违纪说明" required :label-width="formLabelWidth">
<el-input v-model="detail.disDesc" autocomplete="off"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="showDetail=false"> </el-button>
<el-button v-if="detail.id" type="primary" :loading="updateLoading" @click="updateRow">保存</el-button>
<el-button v-if="!detail.id" type="primary" :loading="insertLoading" @click="insertRow">新增</el-button>
</div>
</el-dialog>
</div>
</div>
</template>
<script>
import request from '../../utils/request'
import { Notification } from 'element-ui'
export default {
name: 'weijiMes',
data () {
return {
currentPage3: 1,
selectIds:[],//ids
searchData:'',//
dialogFormVisible:false,
formLabelWidth: '120px',
tableData: [],
tableLoading:false,
updateLoading:false,
insertLoading:false,
deleteBatchLoading:false,
searchLoading:false,
searchValue:"",
selectedRows:[],
currentPage:1,
pageSize:10,
total:0,
showDetail:false, //
detail:{}, //
showDeleteConfirm:false,
form:{},
ruleForm:{
name:'',
time:'',
desc:''
},
rules:{
name:[
{required:true,message:'请输入违纪名称',trigger:'blur'}
],
time:[
{required:true,message:'请输入违纪时间',trigger:'blur'}
],
desc:[
{required:true,message:'请输入违纪描述',trigger:'blur'}
],
}
}
},
mounted () {
this.search();
},
methods: {
//
submit(formName){
this.dialogFormVisible = false;
this.$refs[formName].validate((valid)=>{
if (valid){
alert('提交成功!');
this.tableData.push(this.form); //
}else{
this.dialogFormVisible = true;
console.log('error submit!');
return false;
}
});
//form
//this.form.name = ''
//this.form.time = ''
},
linkToStuInfo(row){
this.$router.push({
path:'/basic',
query:{
stuId:row.stuId
}
});
},
handleCurrentChange(curPage){
this.currentPage=curPage;
this.search();
},
handleSizeChange(size){
this.pageSize=size;
this.search();
},
search () {
this.tableLoading=true;
request.get("/api/discipline/search",{
params:{
searchValue:this.searchValue,
page:this.currentPage,
size:this.pageSize
}
}).then(res=>{
this.tableLoading=false;
this.total=res.data.data.total;
this.tableData=res.data.data.records;
});
},
//
openDetail(row){
this.showDetail=true;
this.detail={...row};
},
//
closeDetail(row){
this.showDetail=false;
this.detail={};
},
deleteRow(row){
this.tableLoading=true;
request.post("/api/discipline/delete",{
id:row.id
}).then(res=>{
if(res.data.status==0){
this.tableLoading=false;
Notification({
type: 'success',
message: '删除成功'
})
//
this.search();
}
});
},
deleteBatch(){
var ids=[];
for(var i=0;i<this.selectedRows.length;i++){
ids.push(this.selectedRows[i].id);
}
if(ids.length==0){
return Notification({
type: 'info',
message: '请选择需要删除的数据'
});
}
this.deleteBatchLoading=true
request.post("/api/discipline/deleteBatch",{ids}).then(res=>{
this.deleteBatchLoading=false;
if(res.data.status==0){
Notification({
type: 'success',
message: '批量删除成功'
})
//
this.search();
}
});
},
insertRow(){
this.insertLoading=true;
request.post("/api/discipline/insert",{...this.detail}).then(res=>{
this.insertLoading=false;
if(res.data.status==0){
Notification({
type: 'success',
message: '新增成功'
})
this.closeDetail()
//
this.search();
}
});
},
updateRow(){
this.updateLoading=true;
request.post("/api/discipline/update",{...this.detail}).then(res=>{
this.updateLoading=false;
Notification({
type: 'success',
message: '保存成功'
})
this.closeDetail();
//
this.search();
});
},
selectionChange(val){
this.selectedRows=val;
},
subStr(str,num){
if(str&&str.length>num){
str=str.substring(0,num)+"...";
}
return str;
}
}
}
</script>
<style scoped>
.header{
padding-top: 20px;
}
.header>.el-button{
margin-left: 10px;
}
</style>

View File

@ -0,0 +1,303 @@
<template>
<div style="padding: 20px;">
<!-- 查询部分-->
<div id="query" >
<el-button type="primary" @click="openDetail({})" :loading="insertLoading">
<i class="el-icon-plus"></i>新增</el-button>
<span style="width: 10px;height: 2px;display: inline-block"></span>
<el-popconfirm
title="确定删除这些数据吗?"
@onConfirm="deleteBatch">
<el-button slot="reference" type="danger" @click="" :loading="deleteBatchLoading">
<i class="el-icon-delete"></i>批量删除</el-button>
</el-popconfirm>
<span style="width: 10px;height: 2px;display: inline-block"></span>
<div style="width:30%;float: right">
<el-input @keyup.enter.native="search" placeholder="请输入权限名" v-model="searchValue" class="input-with-select">
<el-button @click="search" slot="append" icon="el-icon-search" :loading="searchLoading"></el-button>
</el-input>
</div>
</div>
<div class="weiji">
<el-table
:data="tableData"
v-loading="tableLoading"
@selection-change="selectionChange"
height="370"
style="width: 100%" >
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column
prop="title"
label="权限简称"
width="160">
</el-table-column>
<el-table-column
prop="perms"
label="标识"
width="300">
</el-table-column>
<el-table-column
prop="type"
label="权限类型"
width="160">
</el-table-column>
<el-table-column
prop="descr"
label="权限描述"
width="160">
</el-table-column>
<el-table-column
fixed="right"
label="操作"
width="250">
<template slot-scope="scope">
<el-button @click="openDetail(scope.row)" type="primary" size="small">修改</el-button>
<span style="width: 10px;height: 2px;display: inline-block"></span>
<el-popconfirm
title="确定删除这个数据吗?"
v-model="showDeleteConfirm"
@onConfirm="deleteRow(scope.row)">
<el-button slot="reference" type="danger" size="small">删除</el-button>
</el-popconfirm>
</template>
</el-table-column>
</el-table>
<!-- 分页-->
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-sizes="[10,20,50]"
:page-size="pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="total">
</el-pagination>
<!--新增对话框-->
<el-dialog title="权限信息" :visible.sync="showDetail">
<el-form :model="detail">
<el-form-item label="权限简称" required :label-width="formLabelWidth">
<el-input v-model="detail.title" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="标识" required :label-width="formLabelWidth">
<el-input v-model="detail.perms" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="权限类型" required :label-width="formLabelWidth">
<el-select v-model="detail.type" placeholder="请选择">
<el-option label="菜单" value="菜单"></el-option>
<el-option label="按钮" value="按钮"></el-option>
<el-option label="url" value="url"></el-option>
<el-option label="图片" value="图片"></el-option>
<el-option label="资源" value="资源"></el-option>
</el-select>
</el-form-item>
<el-form-item label="描述" required :label-width="formLabelWidth" >
<el-input type="textarea" :row="4" v-model="detail.descr" autocomplete="off"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="showDetail=false"> </el-button>
<el-button v-if="detail.id" type="primary" :loading="updateLoading" @click="updateRow">保存</el-button>
<el-button v-if="!detail.id" type="primary" :loading="insertLoading" @click="insertRow">新增</el-button>
</div>
</el-dialog>
</div>
</div>
</template>
<script>
import request from '../../utils/request'
import { Notification } from 'element-ui'
export default {
name: 'weijiMes',
data () {
return {
currentPage3: 1,
selectIds:[],//ids
searchData:'',//
dialogFormVisible:false,
formLabelWidth: '120px',
tableData: [],
tableLoading:false,
updateLoading:false,
insertLoading:false,
deleteBatchLoading:false,
searchLoading:false,
searchValue:"",
selectedRows:[],
currentPage:1,
pageSize:10,
total:0,
showDetail:false, //
detail:{}, //
showDeleteConfirm:false,
form:{},
ruleForm:{
name:'',
time:'',
desc:''
},
rules:{
name:[
{required:true,message:'请输入违纪名称',trigger:'blur'}
],
time:[
{required:true,message:'请输入违纪时间',trigger:'blur'}
],
desc:[
{required:true,message:'请输入违纪描述',trigger:'blur'}
],
}
}
},
mounted () {
this.search();
},
methods: {
//
submit(formName){
this.dialogFormVisible = false;
this.$refs[formName].validate((valid)=>{
if (valid){
alert('提交成功!');
this.tableData.push(this.form); //
}else{
this.dialogFormVisible = true;
console.log('error submit!');
return false;
}
});
//form
//this.form.name = ''
//this.form.time = ''
},
linkToStuInfo(row){
this.$router.push({
path:'/basic',
query:{
stuId:row.stuId
}
});
},
handleCurrentChange(curPage){
this.currentPage=curPage;
this.search();
},
handleSizeChange(size){
this.pageSize=size;
this.search();
},
search () {
this.tableLoading=true;
request.get("/api/permission/search",{
params:{
searchValue:this.searchValue,
page:this.currentPage,
size:this.pageSize
}
}).then(res=>{
this.tableLoading=false;
this.total=res.data.data.total;
this.tableData=res.data.data.records;
});
},
//
openDetail(row){
this.showDetail=true;
this.detail={...row};
},
//
closeDetail(row){
this.showDetail=false;
this.detail={};
},
deleteRow(row){
this.tableLoading=true;
request.post("/api/permission/delete",{
id:row.id
}).then(res=>{
if(res.data.status==0){
this.tableLoading=false;
Notification({
type: 'success',
message: '删除成功'
})
//
this.search();
}
});
},
deleteBatch(){
var ids=[];
for(var i=0;i<this.selectedRows.length;i++){
ids.push(this.selectedRows[i].id);
}
if(ids.length==0){
return Notification({
type: 'info',
message: '请选择需要删除的数据'
});
}
this.deleteBatchLoading=true
request.post("/api/permission/deleteBatch",{ids}).then(res=>{
this.deleteBatchLoading=false;
if(res.data.status==0){
Notification({
type: 'success',
message: '批量删除成功'
})
//
this.search();
}
});
},
insertRow(){
this.insertLoading=true;
request.post("/api/permission/insert",{...this.detail}).then(res=>{
this.insertLoading=false;
if(res.data.status==0){
Notification({
type: 'success',
message: '新增成功'
})
this.closeDetail()
//
this.search();
}
});
},
updateRow(){
this.updateLoading=true;
request.post("/api/permission/update",{...this.detail}).then(res=>{
this.updateLoading=false;
Notification({
type: 'success',
message: '保存成功'
})
this.closeDetail();
//
this.search();
});
},
selectionChange(val){
this.selectedRows=val;
},
subStr(str,num){
if(str&&str.length>num){
str=str.substring(0,num)+"...";
}
return str;
}
}
}
</script>
<style scoped>
.header{
padding-top: 20px;
}
.header>.el-button{
margin-left: 10px;
}
</style>

View File

@ -0,0 +1,310 @@
<template>
<!-- 角色管理 -->
<div id="roleManager" style="padding:10px;">
<div style="padding:10px 0px;padding-left: 20px;">
<el-button type="primary" @click="openDetail({})" :loading="insertLoading">
<i class="el-icon-plus"></i>新增</el-button>
<span style="width: 10px;height: 2px;display: inline-block"></span>
</div>
<!-- 表格部分 -->
<div id="table">
<el-table
:data="tableData"
v-loading="tableLoading"
@selection-change="selectionChange"
height="370"
border
style="width: 100%">
<el-table-column fixed prop="roleName" label="角色名">
</el-table-column>
<el-table-column fixed prop="roleDesc" label="描述">
</el-table-column>
<el-table-column fixed prop="roleMark" label="标识">
</el-table-column>
<el-table-column
fixed="right"
label="操作"
width="250">
<template slot-scope="scope">
<el-button @click="openDetail(scope.row)" type="primary" size="small">修改</el-button>
<span style="width: 10px;height: 2px;display: inline-block"></span>
<el-popconfirm
title="确定删除这个数据吗?"
v-model="showDeleteConfirm"
@onConfirm="deleteRow(scope.row)">
<el-button slot="reference" type="danger" size="small">删除</el-button>
</el-popconfirm>
</template>
</el-table-column>
</el-table>
<!-- 分页-->
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-sizes="[10,20,50]"
:page-size="pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="total">
</el-pagination>
</div>
<!-- 用来添加权限 -->
<!-- <el-dialog title="添加权限" :visible.sync="showAppendPerm">-->
<!-- &lt;!&ndash; 树形控件 &ndash;&gt;-->
<!-- <el-tree show-checkbox :data="treeData" :props="defaultProps" @check-change="handleNodeCheckChange"></el-tree>-->
<!-- <span slot="footer" class="dialog-footer">-->
<!-- <el-button @click="dialogVisible = false"> </el-button>-->
<!-- <el-button type="primary" @click="dialogVisible = false">添加</el-button>-->
<!-- </span>-->
<!-- </el-dialog>-->
<el-dialog
title="角色信息"
:visible.sync="showDetail"
@close="closeDetail"
width="35%">
<!-- 表单区域-->
<el-form :model="detail" class="demo-form-inline">
<el-form-item label="角色名" required>
<el-input v-model="detail.roleName" placeholder="请输入角色名"></el-input>
</el-form-item>
<el-form-item label="标识" required>
<el-input v-model="detail.roleMark" placeholder="请输入标识"></el-input>
</el-form-item>
<el-tree
node-key="id"
ref="tree"
show-checkbox
:data="treeData"
:props="defaultProps"></el-tree>
<el-form-item label="角色描述">
<el-input type="textarea" v-model="detail.roleDesc" :rows="4" placeholder="请输入角色描述"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="showCreateRole = false">取消</el-button>
<el-button v-if="detail.id" type="primary" :loading="updateLoading" @click="updateRow">保存</el-button>
<el-button v-if="!detail.id" type="primary" :loading="insertLoading" @click="insertRow">新增</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import request from '@/utils/request'
import { Notification } from 'element-ui'
export default {
name: 'roleManager',
data () {
return {
showAppendPerm: false,
showCreateRole:false,
activeName: 1,
formRole: null,
treeData: [],
defaultProps: {
children: 'children',
label: 'label'
},
tableData: [],
tableLoading:false,
updateLoading:false,
insertLoading:false,
deleteBatchLoading:false,
searchLoading:false,
searchValue:"",
selectedRows:[],
currentPage:1,
pageSize:10,
total:0,
showDetail:false, //
detail:{}, //
showDeleteConfirm:false,
}
},
mounted () {
this.search();
//
this.requestPermissionData();
},
methods: {
search () {
this.tableLoading=true;
request.get("/api/role/list",{
params:{
searchValue:this.searchValue,
page:this.currentPage,
size:this.pageSize
}
}).then(res=>{
this.tableLoading=false;
this.total=res.data.data.total;
this.tableData=res.data.data.records;
});
},
//
requestPermissionData(){
//
request.get("/api/permission/all").then(res=>{
console.log(res);
var treeData=[];
var data=res.data.data;
for(var i=0;i<data.length;i++){
var k=-1;//-1
for(var j=0;j<treeData.length;j++){
if(treeData[j].label==data[i].type){
k=j;
break;
}
}
if(k==-1){
k=treeData.length;
treeData[k]={label:data[i].type,children:[]}
}
treeData[k].children.push({
label:data[i].title,
data:data[i],
id:data[i].id
});
}
this.treeData=treeData;
});
},
handleCurrentChange(curPage){
this.currentPage=curPage;
this.search();
},
handleSizeChange(size){
this.pageSize=size;
this.search();
},
//
openDetail(row){
this.showDetail=true;
this.detail={...row};
//
var permissions=row.permissions;
if(permissions){
var checkedIds=[];
for(var i=0;i<permissions.length;i++){
checkedIds.push(permissions[i].id);
}
var self=this;
setTimeout(function(){
self.$refs.tree.setCheckedKeys(checkedIds);
},200);
}
},
//
closeDetail(){
this.showDetail=false;
this.detail={};
this.$refs.tree.setCheckedKeys([]);
},
deleteRow(row){
this.tableLoading=true;
request.post("/api/role/delete",{
id:row.id
}).then(res=>{
if(res.data.status==0){
this.tableLoading=false;
Notification({
type: 'success',
message: '删除成功'
})
//
this.search();
}
});
},
deleteBatch(){
var ids=[];
for(var i=0;i<this.selectedRows.length;i++){
ids.push(this.selectedRows[i].id);
}
if(ids.length==0){
return Notification({
type: 'info',
message: '请选择需要删除的数据'
});
}
this.deleteBatchLoading=true
request.post("/api/role/deleteBatch",{ids}).then(res=>{
this.deleteBatchLoading=false;
if(res.data.status==0){
Notification({
type: 'success',
message: '批量删除成功'
})
//
this.search();
}
});
},
insertRow(){
this.insertLoading=true;
//
var checkedNods=this.$refs.tree.getCheckedNodes();
var permissions=[];
for(var i=0;i<checkedNods.length;i++){
if(checkedNods[i].data){
permissions.push(checkedNods[i].data);
}
}
this.detail.permissions=permissions;
request.post("/api/role/insert",{...this.detail}).then(res=>{
this.insertLoading=false;
if(res.data.status==0){
Notification({
type: 'success',
message: '新增成功'
})
this.closeDetail()
//
this.search();
}
});
},
updateRow(){
this.updateLoading=true;
//
var checkedNods=this.$refs.tree.getCheckedNodes();
var permissions=[];
for(var i=0;i<checkedNods.length;i++){
if(checkedNods[i].data){
permissions.push(checkedNods[i].data);
}
}
this.detail.permissions=permissions;
request.post("/api/role/update",{...this.detail}).then(res=>{
this.updateLoading=false;
Notification({
type: 'success',
message: '保存成功'
})
this.closeDetail();
//
this.search();
});
},
selectionChange(val){
this.selectedRows=val;
},
subStr(str,num){
if(str&&str.length>num){
str=str.substring(0,num)+"...";
}
return str;
}
}
}
</script>
<style>
#table {
padding: 0px 20px;
}
.el-tag {
margin-right: 10px;
}
</style>

View File

@ -0,0 +1,395 @@
<template>
<div id="userManager" >
<!-- 多条件查询区域 -->
<div id="query">
<el-button type="primary" @click="showInsertUser=true" :loading="insertLoading">
<i class="el-icon-plus"></i>新增</el-button>
<span style="width: 10px;height: 2px;display: inline-block"></span>
<el-popconfirm
title="确定删除这些用户吗?"
@onConfirm="deleteUserBatch">
<el-button slot="reference" type="danger" @click="" :loading="deleteBatchLoading">
<i class="el-icon-delete"></i>批量删除</el-button>
</el-popconfirm>
<div style="width:30%;float: right">
<el-input @keyup.enter.native="search" placeholder="请输入内容" v-model="searchValue" class="input-with-select">
<el-button @click="search" slot="append" icon="el-icon-search" :loading="searchLoading"></el-button>
</el-input>
</div>
</div>
<!-- 表格部分 -->
<div id="table" >
<el-table
@selection-change="selectionChange"
v-loading="tableLoading"
height="370"
:data="tableData"
border
style="width: 100%">
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column prop="username" label="用户名"></el-table-column>
<el-table-column prop="password" label="密码">
<template slot-scope="psw">
<span>******</span>
</template>
</el-table-column>
<el-table-column prop="roleName" label="角色"></el-table-column>
<el-table-column prop="avatar" label="头像" >
<template slot-scope="scope">
<el-avatar shape="square" :size="30" :src="scope.row.avatar"></el-avatar>
</template>
</el-table-column>
<el-table-column prop="realName" label="真实姓名" ></el-table-column>
<el-table-column prop="nickName" label="昵称" ></el-table-column>
<el-table-column prop="mobile" label="电话"></el-table-column>
<el-table-column prop="gender" label="性别"></el-table-column>
<el-table-column fixed="right" label="操作" width="210">
<template slot-scope="scope">
<el-row>
<el-col :span="8">
<el-button @click="detail(scope.row)" type="primary" size="mini">
详情</el-button>
</el-col>
<el-col :span="8">
<el-button @click="changePassword(scope.row)" type="primary" size="mini">
修改</el-button>
</el-col>
<el-col :span="8">
<el-popconfirm
title="确定删除这个用户吗?"
v-model="showDeleteConfirm"
@onConfirm="deleteUser(scope.row)">
<el-button slot="reference" type="danger" size="mini">删除</el-button>
</el-popconfirm>
</el-col>
</el-row>
</template>
</el-table-column>
</el-table>
<!-- 分页-->
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-sizes="[10,20,50]"
:page-size="pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="total">
</el-pagination>
</div>
<el-dialog title="修改" :visible.sync="showDialog" width="40%" :before-close="closeDialog">
<el-form @submit.native.prevent label-width="80px" v-model="myDetail" >
<el-form-item label="密码:" required>
<el-input @keyup.enter.native="comfirmDialog" placeholder="新密码" prefix-icon="el-icon-warning-outline"
v-model="myDetail.password" show-password>
</el-input>
</el-form-item>
<el-form-item label="角色:" required>
<el-select v-model="myDetail.roleId" placeholder="请选择">
<el-option
v-for="item in roles"
:key="item.id"
:label="item.roleName"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="closeDialog"> </el-button>
<el-button type="primary" :loading="updateLoading" @click="comfirmDialog">确认修改</el-button>
</span>
</el-dialog>
<!-- 详情-->
<el-dialog width="65%" title="详情" :visible.sync="showUserDetail">
<el-form :inline="true" :model="detailForm">
<el-form-item label="用户名:">
<el-input v-model="detailForm.username" readonly></el-input>
</el-form-item>
<el-form-item label="密码:">
<el-input v-model="detailForm.password" readonly></el-input>
</el-form-item>
<el-form-item label="昵称:">
<el-input v-model="detailForm.nickName" readonly></el-input>
</el-form-item>
<el-form-item label="真实姓名:">
<el-input v-model="detailForm.password" readonly></el-input>
</el-form-item>
<el-form-item label="电话:">
<el-input v-model="detailForm.mobile" readonly></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="showUserDetail = false">知道了</el-button>
</div>
</el-dialog>
<!-- 新增-->
<el-dialog width="35%" title="新增" :visible.sync="showInsertUser">
<el-form :model="insertForm">
<el-collapse v-model="activeName" >
<el-collapse-item title="必填项" name="必填">
<el-form-item label="用户名:" required>
<el-input placeholder="请输入用户名" v-model="insertForm.username" ></el-input>
</el-form-item>
<el-form-item label="密码:" required >
<el-input placeholder="请输入密码" type="password" v-model="insertForm.password" ></el-input>
</el-form-item>
<el-form-item label="真名:" required>
<el-input placeholder="请输入真实姓名" v-model="insertForm.realName" ></el-input>
</el-form-item>
<el-form-item label="电话:" required>
<el-input v-model="insertForm.mobile" ></el-input>
</el-form-item>
</el-collapse-item>
<el-collapse-item title="选填项" name="选填">
<el-form-item label="头像:">
<el-upload
class="upload-demo"
action="/api/upload/img"
:file-list="fileList"
:multiple="false"
@on-success="uploadSuccess"
@on-error="uploadError"
ref="upload"
name="file"
:limit="1"
:auto-upload="false"
list-type="picture">
<el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件且不超过500kb</div>
</el-upload>
</el-form-item>
<el-form-item label="昵称:">
<el-input v-model="insertForm.nickName" readonly></el-input>
</el-form-item>
<el-form-item label="邮箱:">
<el-input v-model="insertForm.email" readonly></el-input>
</el-form-item>
<el-form-item label="性别:">
<el-radio-group v-model="insertForm.gender">
<el-radio label="0"></el-radio>
<el-radio label="1"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="微信:">
<el-input v-model="insertForm.wechat" readonly></el-input>
</el-form-item>
<el-form-item label="生日:">
<el-input v-model="insertForm.birthday" readonly></el-input>
</el-form-item>
</el-collapse-item>
</el-collapse>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="showInsertUser = false"> </el-button>
<el-button type="primary" @click="insertUser" :loading="insertLoading"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import request from '@/utils/request'
import { Notification } from 'element-ui'
export default {
name: 'userManager',
data () {
var validatePassword = (rule, value, callback) => {
if (value === '') {
callback(new Error('密码不能为空!'))
} else {
callback()
}
}
return {
squareUrl: "https://cube.elemecdn.com/9/c2/f0ee8a3c7c9638a54940382568c9dpng.png",
activeName:'必填',
showInsertUser:false,
insertForm:{},
newPassword:"",
detailForm:{},
showUserDetail:false,
total:0,
pageSize:10,
currentPage:1,
fileList: [],
queryModel: {
account: null
},
tableData: [],
editInfo: {},
showDialog: false,
selectedRows:[],
showDeleteConfirm: false,
newPassword: '',
rules: {
password: [{ validator: validatePassword, trigger: 'blur' }]
},
updateLoading:false,
tableLoading:false,
insertLoading:false,
deleteBatchLoading:false,
searchLoading:false,
searchValue:"",
roles:[],
myDetail:{}
}
},
mounted () {
this.search();
this.requestAllRoles();
},
methods: {
requestAllRoles(){
request.get("/api/role/all").then(res=>{
this.roles=res.data.data;
});
},
uploadError(err, file, fileList){
console.log(err, file, fileList)
},
uploadSuccess(response, file, fileList){
console.log(response, file, fileList)
},
//
search(){
this.tableLoading=true;
request.get("/api/user/vo/search",{
params:{
searchValue:this.searchValue,
page:this.currentPage,
size:this.pageSize
}
}).then(res=>{
this.tableLoading=false;
this.total=res.data.data.total;
this.tableData=res.data.data.records;
});
},
handleCurrentChange(curPage){
this.currentPage=curPage;
this.search();
},
handleSizeChange(size){
this.pageSize=size;
this.search();
},
query () {
console.log(this.queryModel)
},
//
comfirmDialog () {
this.updateLoading=true;
request.post("/api/user/vo/update",this.myDetail).then(res=>{
this.updateLoading=false;
this.showDialog = false
if(res.data.status==0){
Notification({
type: 'success',
message: '修改成功'
});
//
this.search();
}
});
},
closeDialog () {
this.showDialog = false
},
//
deleteUser (row) {
request.post("/api/user/delete",{
id:row.id
}).then(res=>{
if(res.data.status==0){
Notification({
type: 'success',
message: '删除成功'
})
//
this.search();
}
});
},
//
deleteUserBatch(){
var ids=[];
for(var i=0;i<this.selectedRows.length;i++){
ids.push(this.selectedRows[i].id);
}
if(ids.length==0){
return Notification({
type: 'info',
message: '请选择需要删除用户'
});
}
this.deleteBatchLoading=true
request.post("/api/user/deleteBatch",{ids}).then(res=>{
this.deleteBatchLoading=false;
if(res.data.status==0){
Notification({
type: 'success',
message: '批量删除成功'
})
//
this.search();
}
});
},
//
insertUser(){
this.insertLoading=true;
//
this.$refs.upload.submit();
request.post("/api/user/insert",{...this.insertForm}).then(res=>{
this.insertLoading=false;
this.showInsertUser=false;
if(res.data.status==0){
Notification({
type: 'success',
message: '新增成功'
})
//
this.search();
}
});
},
//
detail (row) {
this.showUserDetail=true;
this.detailForm=row;
},
//
changePassword (row) {
// dialog
this.showDialog = true
this.myDetail={...row};
},
selectionChange(val){
this.selectedRows=val;
},
handleRemove(file, fileList) {
console.log(file, fileList);
},
handlePreview(file) {
console.log(file);
}
}
}
</script>
<style scoped lang="less">
#userManager {
padding: 20px;
#query {
padding-bottom: 5px;
}
.name {
color: red;
font-weight: 700;
}
}
</style>

23
vue.config.js Normal file
View File

@ -0,0 +1,23 @@
const proxy = require('http-proxy-middleware');
module.exports = {
lintOnSave: false, // 关闭lint检查
// host: '0.0.0.0'
// 解决跨域
devServer: {
host: '127.0.0.1', // can be overwritten by process.env.HOST
port: 9080,
proxy: {
'/api': {//代理器中设置/api,项目中请求路径为/api的替换为target
// target: 'http://localhost:8082',
target: 'http://192.168.2.105:8082',//代理地址会代替axios中的baseUrl
secure: false, // 使用的是http协议则设置为falsehttps协议则设置为true
changOrigin: true, // 跨域
ws: true,
pathRewrite: {//重写url
'^/api': '/'
},
}
}
}
}

8976
yarn.lock Normal file

File diff suppressed because it is too large Load Diff