提交 2c7fd284 authored 作者: zfl's avatar zfl

等保要求整改

上级 ff5622f0
......@@ -72,10 +72,11 @@ export function add_roles(data) {
})
}
//角色-删除
export function delete_roles(id) {
export function delete_roles(data) {
return request({
url: `/api/roles/${id}`,
method: 'delete'
url: `/api/roles/${data.id}`,
method: 'delete',
data
})
}
//角色-修改
......
......@@ -53,10 +53,11 @@ export function add_tobacco_breed(data) {
})
}
//烟草品种信息-删除
export function delete_tobacco_breed(id) {
export function delete_tobacco_breed(data) {
return request({
url: `/api/tobacco_breed/${id}`,
url: `/api/tobacco_breed/${data.id}`,
method: 'delete',
data
})
}
//烟草品种信息-修改
......@@ -174,10 +175,11 @@ export function add_examination_question_detail(data) {
})
}
//试题信息管理详情-删除
export function delete_examination_question_detail(id) {
export function delete_examination_question_detail(data) {
return request({
url: `/api/examination_question_detail/${id}`,
url: `/api/examination_question_detail/${data.id}`,
method: 'delete',
data
})
}
//试题信息管理详情-修改
......@@ -210,10 +212,11 @@ export function examination_questions_publish(id) {
})
}
//试题信息管理-停止使用/删除
export function delete_examination_questions(id) {
export function delete_examination_questions(data) {
return request({
url: `/api/examination_questions/${id}`,
url: `/api/examination_questions/${data.id}`,
method: 'delete',
data
})
}
//试题模板文件下载
......@@ -282,10 +285,11 @@ export function add_tobacco_grades(data) {
})
}
//烟草等级信息-删除
export function delete_tobacco_grades(id) {
export function delete_tobacco_grades(data) {
return request({
url: `/api/tobacco_grades/${id}`,
url: `/api/tobacco_grades/${data.id}`,
method: 'delete',
data
})
}
//烟草等级信息-修改
......@@ -336,10 +340,11 @@ export function add_student(data) {
})
}
//学员信息-删除
export function delete_student(id) {
export function delete_student(data) {
return request({
url: `/api/student/${id}`,
url: `/api/student/${data.id}`,
method: 'delete',
data
})
}
//学员信息-修改
......@@ -471,9 +476,10 @@ export function updata_read_over(id, data) {
})
}
//批阅试题列表-删除
export function delete_read_over(id) {
export function delete_read_over(data) {
return request({
url: `/api/read_over/${id}`,
url: `/api/read_over/${data.id}`,
method: 'delete',
data
})
}
......@@ -38,10 +38,11 @@ export function create_temporary(data) {
//管理员-删除
export function delete_administrators(id) {
export function delete_administrators(data) {
return request({
url: `/api/users/${id}`,
url: `/api/users/${data.id}`,
method: 'delete',
data
})
}
//管理员-修改
......@@ -99,10 +100,11 @@ export function add_permission_menu(data) {
})
}
//删除菜单、功能(按钮)
export function delete_permission_menu(id) {
export function delete_permission_menu(data) {
return request({
url: `/api/permission/${id}`,
url: `/api/permission/${data.id}`,
method: 'delete',
data
})
}
//修改菜单、功能(按钮)
......@@ -135,10 +137,11 @@ export function add_department(data) {
})
}
//部门管理-删除
export function delete_department(id) {
export function delete_department(data) {
return request({
url: `/api/department/${id}`,
url: `/api/department/${data.id}`,
method: 'delete',
data
})
}
//部门管理-修改
......@@ -173,4 +176,28 @@ export function search_system_log(data) {
}
export function getStorageSpace(params) {
return request({
url: `/api/system_log/getStorageSpace`,
method: 'get',
params
})
}
export function countlog(params) {
return request({
url: `/api/system_log/countlog`,
method: 'get',
params
})
}
export function system_log_index(params) {
return request({
url: `/api/system_log/s_index`,
method: 'get',
params
})
}
......@@ -80,3 +80,30 @@ export function email_updata_user_password(data) {
data
})
}
//获取邮箱验证码
export function getCaptcha() {
return request({
url: '/api/getCaptcha',
method: 'get'
})
}
//个人信息修改
export function resetPassword(data) {
return request({
url: '/api/resetpassword',
method: 'post',
data
})
}
//密码验证,是否可以进行修改
export function VerificationPassword(data) {
return request({
url: '/api/VerificationPassword',
method: 'post',
data
})
}
\ No newline at end of file
<!--
* @Author: czj
* @Date: 2023-02-24 16:50:22
* @Description:
* @FilePath: \AdministrationHome\src\components\SizeSelect\index.vue
-->
<template>
<div>
<el-dialog
:title="'请您输入密码进行验证'"
:visible.sync="is_show_password"
width="500px"
:before-close="handleClose"
:class="'add_dialog'"
>
<el-form
:model="sub_data"
:rules="info_rules"
ref="ruleForm"
label-width="100px"
class="demo-ruleForm"
>
<el-form-item label="密码" prop="password">
<el-input
v-model="sub_data.password"
placeholder="请输入密码"
:type="passwordType"
>
<i
slot="suffix"
class="el-input__icon el-icon-view"
@click="showPwd"
></i>
</el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="handleClose">取 消</el-button>
<el-button type="primary" @click="submitInfo">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { VerificationPassword } from '@/api/user';
export default {
data() {
return {
is_password:false,
is_show_password:false,
info_rules: {
},
passwordType: 'password', //输入框的类型,密码框
sub_data:{
password:''
}
}
},
computed: {
},
mounted() {
this.submitInfo(false)
},
methods: {
//取消
handleClose() {
this.is_show_password = false;
},
show_password() {
this.is_show_password = true;
},
submitInfo(is_d=true) {
let data={
password: this.sub_data.password?this.$Aesencrypt(this.sub_data.password):null,
}
VerificationPassword(data).then((res) => {
console.log(res)
if(is_d){
if(res.status==200){
this.is_password=true
this.is_show_password=false
}else if(res.status==203){
this.is_password=false
this.$message({
type: 'error',
message: res.message,
});
}else if(res.status==202){
this.is_password=false
this.$message({
type: 'error',
message: res.message,
});
this.is_show_password=true
}
}else{
if(res.status==200){
this.is_password=true
}else{
this.is_password=false
}
}
});
},
showPwd() {
if (this.passwordType === 'password') {
this.passwordType = '';
} else {
this.passwordType = 'password';
}
},
}
}
</script>
\ No newline at end of file
......@@ -7,7 +7,8 @@
<!-- -->
<template>
<div>
质检系统
<!-- 质检系统 -->
学员考试分析系统
<!-- <img src="/image/log.svg" alt="" class="object_logo" @click="toHomePage"> -->
</div>
</template>
......
......@@ -6,6 +6,9 @@
{{ user_name.slice(0, 1) || '' }}
</div>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item divided @click.native="tosetuserinfo">
<span style="display:block;">个人中心</span>
</el-dropdown-item>
<el-dropdown-item divided @click.native="logout">
<span style="display:block;">退出登录</span>
</el-dropdown-item>
......@@ -36,6 +39,11 @@ export default {
async logout() {
await this.$store.dispatch('user/logout')
this.$router.push(`/login?redirect=${this.$route.fullPath}`)
},
async tosetuserinfo() {
this.$router.push({
path: '/s_user/setuserinfo'
});
}
}
}
......
......@@ -89,7 +89,7 @@ export const asyncRoutes = [
redirect: '/dashboard',
children: [
......@@ -223,7 +223,21 @@ export const asyncRoutes = [
]
},
{
path: '/s_user',
component: Layout,
is_show: false,
redirect: '',
children: [
{
path: 'setuserinfo',
component: () => import('@/views/system/setuserinfo'),
is_show: false,
meta: { title: '个人信息修改' }
}
]
},
// 404 page must be placed at the end !!!
{ path: '*', redirect: '/404', is_show: false }
]
......
......@@ -51,7 +51,7 @@ const actions = {
const { data } = response
commit('SET_TOKEN', response.access_token)
setToken(response.access_token)
resolve()
resolve(response)
}).catch(error => {
reject(error)
})
......
......@@ -56,6 +56,16 @@
></i>
</el-input>
</el-form-item>
<el-form-item >
<el-row style="padding-top:10px">
<el-col :span="14">
<el-input type="text" v-model="loginForm.code" placeholder="输入验证码"></el-input>
</el-col>
<el-col :span="10" style="text-align: right; padding:2px 4px">
<img @click="getCaptcha_fun()" :loading="Captcha_l" :src="loginForm.image" style="width: 98%;" alt="">
</el-col>
</el-row>
</el-form-item>
<el-tooltip
v-model="capsTooltip"
content="大写锁定打开"
......@@ -150,6 +160,7 @@
<script>
import { validUsername } from '@/utils/validate';
import { getCaptcha } from '@/api/user';
export default {
name: 'Login',
components: {},
......@@ -162,8 +173,8 @@ export default {
}
};
const validatePassword = (rule, value, callback) => {
if (value.length < 6) {
callback(new Error('密码不能少于6位'));
if (value.length < 8) {
callback(new Error('密码不能少于8位'));
} else {
callback();
}
......@@ -177,10 +188,14 @@ export default {
// password: '123456',
name: '',
password: '',
code: '',
image: '',
key: '',
grant_type: 'password',
client_id: 2,
client_secret: 'yTahrwHlHby7JhKGHXjJ6mvqnSVZn2JOTnVNZK4Q',
},
Captcha_l:false,
loginRules: {
name: [
......@@ -211,6 +226,7 @@ export default {
},
},
created() {
this.getCaptcha_fun()
// window.addEventListener('storage', this.afterQRScan)
},
mounted() {
......@@ -228,6 +244,16 @@ export default {
const { key } = e;
this.capsTooltip = key && key.length === 1 && key >= 'A' && key <= 'Z';
},
getCaptcha_fun(){
this.Captcha_l=true
getCaptcha().then(res => {
if(res.img){
this.loginForm.image=res.img
this.loginForm.key=res.key
this.Captcha_l=false
}
})
},
showPwd() {
if (this.passwordType === 'password') {
this.passwordType = '';
......@@ -247,15 +273,48 @@ export default {
params.password = this.$Aesencrypt(params.password);
// console.log('登录数据加密');
// console.log(params);
this.getCaptcha_fun();
this.$store
.dispatch('user/login', params)
.then(() => {
this.$router.push({
path: this.redirect || '/',
query: this.otherQuery,
});
/* this.$router.push('/') */
.then((res) => {
if(res.is_update_password=='1' && !res.is_update_password_date){
// TODO 跳转修改密码页面
this.$confirm('因您属于首次登录,未修改密码,请您前往个人中心进行密码修改操作', '提示', {
confirmButtonText: '前往',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
this.$router.push({
path: '/s_user/setuserinfo'
});
}).catch(() => {
this.$router.push({
path: this.redirect || '/',
query: this.otherQuery,
});
});
}else if(res.is_update_password=='1' && res.is_update_password_date){
// TODO 跳转修改密码页面
this.$confirm('您已经三个月没有修改密码,请您前往个人中心进行密码修改操作', '提示', {
confirmButtonText: '前往',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
this.$router.push({
path: '/s_user/setuserinfo'
});
}).catch(() => {
this.$router.push({
path: this.redirect || '/',
query: this.otherQuery,
});
});
}else{
this.$router.push({
path: this.redirect || '/',
query: this.otherQuery,
});
}
this.loading = false;
})
.catch(() => {
......
......@@ -15,7 +15,7 @@
<el-input v-model="retrieve_params.email"></el-input>
</el-form-item>
<el-form-item prop="verification_code">
<span>验证码</span>
<span>邮箱验证码</span>
<el-row>
<el-col :span="12">
<el-input type="number" v-model="retrieve_params.verification_code"></el-input>
......@@ -25,6 +25,17 @@
</el-col>
</el-row>
</el-form-item>
<el-form-item >
<span>验证码</span>
<el-row style="padding-top:10px">
<el-col :span="15">
<el-input type="text" v-model="retrieve_params.code" placeholder="输入验证码"></el-input>
</el-col>
<el-col :span="9" style="text-align: right; padding:2px 4px">
<img @click="getCaptcha_fun()" :loading="Captcha_l" :src="retrieve_params.image" style="width: 98%;" alt="">
</el-col>
</el-row>
</el-form-item>
<el-form-item prop="new_password">
<span>新密码</span>
<el-tooltip v-model="capsTooltip1" content="大写锁定打开" placement="right" manual>
......@@ -61,7 +72,7 @@
</template>
<script>
import { get_email_code, email_updata_user_password } from '@/api/user';
import { get_email_code, email_updata_user_password,getCaptcha } from '@/api/user';
export default {
data() {
let validatePass2 = (rule, value, callback) => {
......@@ -80,7 +91,11 @@ export default {
verification_code: '',//短信验证码
new_password: '',//新密码
affirm_password: '',//确认密码
code: '',
image: '',
key: '',
},
Captcha_l:false,
//表单校验
rules: {
email: [
......@@ -112,9 +127,21 @@ export default {
computed: {},
mounted() { },
mounted() {
this.getCaptcha_fun()
},
methods: {
getCaptcha_fun(){
this.Captcha_l=true
getCaptcha().then(res => {
if(res.img){
this.retrieve_params.image=res.img
this.retrieve_params.key=res.key
this.Captcha_l=false
}
})
},
checkCapslock1(e) {
const { key } = e
this.capsTooltip1 = key && key.length === 1 && (key >= 'A' && key <= 'Z')
......@@ -171,9 +198,12 @@ export default {
verification_key: this.retrieve_params.verification_key,
password: this.$Aesencrypt(this.retrieve_params.affirm_password),
verification_code: this.retrieve_params.verification_code,
code: this.retrieve_params.code,
key: this.retrieve_params.key,
})
console.log('要提交的参数');
console.log(params);
this.getCaptcha_fun();
email_updata_user_password(params).then(res => {
if (res.err_code == 200) {
this.$message.success('修改成功,即将放回登录页')
......
......@@ -25,6 +25,17 @@
</el-col>
</el-row>
</el-form-item>
<el-form-item >
<span>验证码</span>
<el-row style="padding-top:10px">
<el-col :span="15">
<el-input type="text" v-model="retrieve_params.code" placeholder="输入验证码"></el-input>
</el-col>
<el-col :span="9" style="text-align: right; padding:2px 4px">
<img @click="getCaptcha_fun()" :loading="Captcha_l" :src="retrieve_params.image" style="width: 98%;" alt="">
</el-col>
</el-row>
</el-form-item>
<el-form-item prop="new_password">
<span>新密码</span>
<el-tooltip v-model="capsTooltip1" content="大写锁定打开" placement="right" manual>
......@@ -61,7 +72,7 @@
</template>
<script>
import { get_short_message_code, short_message_updata_user_password } from '@/api/user';
import { get_short_message_code, short_message_updata_user_password,getCaptcha } from '@/api/user';
export default {
data() {
let validatePass2 = (rule, value, callback) => {
......@@ -80,7 +91,11 @@ export default {
verification_code: '',//短信验证码
new_password: '',//新密码
affirm_password: '',//确认密码
code: '',
image: '',
key: '',
},
Captcha_l:false,
//表单校验
rules: {
phone: [
......@@ -112,9 +127,21 @@ export default {
computed: {},
mounted() { },
mounted() {
this.getCaptcha_fun()
},
methods: {
getCaptcha_fun(){
this.Captcha_l=true
getCaptcha().then(res => {
if(res.img){
this.retrieve_params.image=res.img
this.retrieve_params.key=res.key
this.Captcha_l=false
}
})
},
checkCapslock1(e) {
const { key } = e
this.capsTooltip1 = key && key.length === 1 && (key >= 'A' && key <= 'Z')
......@@ -170,9 +197,12 @@ export default {
verification_key: this.retrieve_params.verification_key,
password: this.$Aesencrypt(this.retrieve_params.affirm_password),
verification_code: this.retrieve_params.verification_code,
code: this.retrieve_params.code,
key: this.retrieve_params.key,
})
console.log('要提交的参数');
console.log(params);
this.getCaptcha_fun();
short_message_updata_user_password(params).then(res => {
if (res.err_code == 200) {
this.$message.success('修改成功,即将放回登录页')
......
<!--
* @Author: czj
* @Date: 2023-02-28 18:37:15
* @Description:
* @FilePath: \AdministrationHome\src\views\system\log\index.vue
-->
<!-- -->
<template>
<div>
<div class="card_container">
<el-card class="box-card">
<!-- <table-head :head_data="head_data" @search="searchEvent" @resetting="resetting" @btnClick="btnClick"></table-head> -->
<div>
<el-row>
<el-col style="padding:5px" :span="6"><el-input class="search_box" v-model="request_params.username" :placeholder=" '搜索用户名称'" @keydown.enter.native="getSystemLog()"></el-input></el-col>
<el-col style="padding:5px" :span="6"><el-input class="search_box" v-model="request_params.title" :placeholder=" '搜索标题'" @keydown.enter.native="getSystemLog()"></el-input></el-col>
<el-col style="padding:5px" :span="6"><el-input class="search_box" v-model="request_params.intro" :placeholder=" '搜索介绍'" @keydown.enter.native="getSystemLog()"></el-input></el-col>
<!-- <el-col style="padding:5px" :span="6"><el-input class="search_box" v-model="request_params.category" :placeholder=" '搜索类别'" @keydown.enter.native="getSystemLog()"></el-input></el-col> -->
</el-row>
<el-row >
<el-col style="padding:5px" :span="6">
<el-select v-model="request_params.level" clearable @change="getSystemLog()" placeholder="搜索日志级别" style="width:100%">
<el-option
v-for="item in level_options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<!-- <el-input class="search_box" v-model="request_params.level" :placeholder=" '搜索日志级别'" @keydown.enter.native="getSystemLog()"></el-input> -->
</el-col>
<el-col style="padding:5px" :span="6"><el-input class="search_box" v-model="request_params.type" :placeholder=" '搜索操作类型'" @keydown.enter.native="getSystemLog()"></el-input></el-col>
<el-col style="padding:5px" :span="6">
<el-date-picker style="width:100%" clearable v-model="request_params.start_time"
@change="getSystemLog()" type="daterange" range-separator="至" value-format="yyyy-MM-dd"
start-placeholder="开始日期"
:default-time="['00:00:00', '23:59:59']"
end-placeholder="结束日期">
</el-date-picker>
<!-- <el-input class="search_box" v-model="request_params.start_time" :placeholder=" '搜索开始时间'" @keydown.enter.native="getSystemLog()"></el-input> -->
</el-col>
<el-col style="padding:5px" :span="6">
<el-button type="warning" size="small" @click="getSystemLog()">搜索</el-button>
</el-col>
</el-row>
</div>
<div class="table_container">
<el-table v-loading="is_loading" @sort-change="changeSort" :data="tableData" style="width: 100%;margin-bottom: 20px;" height="650">
<el-table-column prop="id" :sortable="true" label="序号">
</el-table-column>
<el-table-column prop="username" :sortable="true" label="操作人">
</el-table-column>
<el-table-column prop="level" :sortable="true" label="日志级别"></el-table-column>
<el-table-column prop="type" :sortable="true" label="操作类型"></el-table-column>
<el-table-column prop="title" :sortable="true" label="操作内容"></el-table-column>
<el-table-column prop="ip" :sortable="true" label="访问IP"></el-table-column>
<el-table-column prop="intro" label="操作说明" :show-overflow-tooltip='true' ></el-table-column>
<el-table-column prop="created_at" :sortable="true" label="操作时间">
</el-table-column>
</el-table>
<div style="text-align: right;">
<el-pagination @current-change="handleCurrentChange" :current-page.sync="request_params.page"
:page-size="request_params.limit" layout="total, prev, pager, next" :total="request_params.total">
</el-pagination>
</div>
</div>
</el-card>
</div>
<el-dialog title="提示" :visible.sync="is_dialogVisible" width="60%" :before-close="handleClose">
<div>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="handleClose">取 消</el-button>
<el-button type="primary" @click="submitData">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import TableHead from '@/components/TableHead/index';
import { system_log_index, search_system_log } from '@/api/system';
const standard_template = {
id: null,
father_id: -1,//父级id
is_show: false,//是否展示为菜单
name: null,//英文名称
name_zh: null,//中文名称
path: null,//路由路径
sort: null,//排序
status: 1,//状态
type: 1,//类型:菜单/按钮
view_path: null,//视图路径
icon: null,//图标
}
export default {
data() {
return {
//头部按钮
head_data: {
is_search_show: true,
// search_placeholder: "学员姓名/手机号",
right_buttons: [
{
text: '新增',
icon: 'el-icon-document-add',
event: 'add',
}
],
},
//初始化请求参数
request_params: {
page: 1,
limit: 10,
total: 1,
username:'',
title:'',
intro:'',
category:'',
level:'',
type:'',
start_time:[],
field:'id',
order:'desc',
},
is_loading: false,
tableData: [],
is_dialogVisible: false,
is_updata_type: 'add',
level_options:[
{
value: '1',
label: '1'
},
{
value: '2',
label: '2'
},
{
value: '3',
label: '3'
},
{
value: '4',
label: '4'
},
{
value: '5',
label: '5'
},
]
//
};
},
components: { TableHead },
computed: {},
mounted() {
this.init()
},
methods: {
changeSort(val) {
this.request_params.field = val.prop; //字段
this.request_params.order = val.order == 'ascending'?'asc':'desc'; //字段
this.init()
},
searchEvent(val) {
console.log('搜索');
console.log(val);
search_system_log({ val: val }).then(res => {
console.log('搜索');
console.log(res);
this.tableData = res.data;
this.request_params.total = res.total;
this.is_loading = false;
})
},
resetting(val) {
console.log('重置');
console.log(val);
search_system_log({ val: val }).then(res => {
console.log('搜索');
console.log(res);
this.tableData = res.data;
this.request_params.total = res.total;
this.is_loading = false;
})
},
btnClick(val) {
console.log('右侧按钮');
console.log(val);
},
init() {
this.getSystemLog();
},
//获取列表
getSystemLog() {
let params = {
...this.request_params
}
this.is_loading = true;
system_log_index(params).then(res => {
console.log('获取列表');
console.log(res);
this.tableData = res.data;
this.request_params.total = res.total;
this.is_loading = false;
})
},
//翻页
handleCurrentChange(val) {
this.request_params.page = val;
this.getSystemLog();
},
//取消
handleClose() {
this.is_dialogVisible = false;
},
//提交
submitData() {
},
},
}
</script>
<style lang="scss" scoped></style>
......@@ -387,14 +387,17 @@ export default {
},
//删除烟草信息
deleteTobacco(item) {
let id = item.id;
let data = {
id: item.id,
sign: this.$Aesencrypt(item.id+''),
};
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
delete_tobacco_breed(id).then((res) => {
delete_tobacco_breed(data).then((res) => {
if (res.code == 200) {
this.$message.success(res.message);
this.init();
......
......@@ -309,14 +309,17 @@ export default {
},
//删除
deleteInformation(item) {
let id = item.id;
let data = {
id: item.id,
sign: this.$Aesencrypt(item.id+''),
};
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
delete_read_over(id).then((res) => {
delete_read_over(data).then((res) => {
if (res.code == 200) {
this.$message.success(res.message);
this.init();
......
......@@ -526,14 +526,17 @@ export default {
},
//删除
deleteInformation(item) {
let id = item.id;
let data = {
id: item.id,
sign: this.$Aesencrypt(item.id+''),
};
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
delete_examination_question_detail(id).then((res) => {
delete_examination_question_detail(data).then((res) => {
if (res.code == 200) {
this.$message.success(res.message);
this.init();
......
......@@ -603,14 +603,17 @@ export default {
},
//删除
deleteInformation(item) {
let id = item.id;
let data = {
id: item.id,
sign: this.$Aesencrypt(item.id+''),
};
this.$confirm('此试题将停止使用, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
delete_examination_questions(id).then((res) => {
delete_examination_questions(data).then((res) => {
if (res.code == 200) {
this.$message.success(res.message);
this.init();
......
......@@ -91,8 +91,7 @@
type="text"
style="color: #f56c6c"
@click="deleteInformation(scope.row)"
>禁用</el-button
>
>禁用</el-button>
</template>
</el-table-column>
</el-table>
......@@ -296,11 +295,13 @@
<el-button type="primary" @click="submitData">确 定</el-button>
</span>
</el-dialog>
<VerificationPassword ref="VerificationPassword"></VerificationPassword>
</div>
</template>
<script>
import TableHead from '@/components/TableHead/index';
import VerificationPassword from '@/components/VerificationPassword/index';
import {
get_province_list,
get_student_list,
......@@ -379,7 +380,7 @@ export default {
};
},
components: { TableHead },
components: { TableHead,VerificationPassword },
computed: {},
......@@ -418,7 +419,11 @@ export default {
},
//提交
submitData() {
let params = this.$handleParams(this.detailed_information);
let data={...this.detailed_information}
data.password=data.password?this.$Aesencrypt(data.password):null
data.phone=this.$Aesencrypt(data.phone)
data.idcard=this.$Aesencrypt(data.idcard)
let params = this.$handleParams(data);
console.log('要提交的数据');
console.log(params);
if (this.is_updata_type == 'add') {
......@@ -485,12 +490,20 @@ export default {
},
//新增信息
addInformation() {
if(!this.$refs.VerificationPassword.is_password){
this.$refs.VerificationPassword.show_password()
return
}
this.is_updata_type = 'add';
this.detailed_information = { ...standard_template };
this.is_dialogVisible = true;
},
//修改信息
updateInformation(item) {
if(!this.$refs.VerificationPassword.is_password){
this.$refs.VerificationPassword.show_password()
return
}
this.is_updata_type = 'edit';
let id = item.id;
//获取详情
......@@ -526,14 +539,21 @@ export default {
},
//删除
deleteInformation(item) {
let id = item.id;
if(!this.$refs.VerificationPassword.is_password){
this.$refs.VerificationPassword.show_password()
return
}
let data = {
id: item.id,
sign: this.$Aesencrypt(item.id+''),
};
this.$confirm('是否禁用此用户?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
delete_student(id).then((res) => {
delete_student(data).then((res) => {
if (res.code == 200) {
this.$message.success(res.message);
this.init();
......
......@@ -329,14 +329,17 @@ export default {
},
//删除
deleteTobaccoGrades(item) {
let id = item.id;
let data = {
id: item.id,
sign: this.$Aesencrypt(item.id+''),
};
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
delete_tobacco_grades(id).then((res) => {
delete_tobacco_grades(data).then((res) => {
if (res.code == 200) {
this.$message.success(res.message);
this.init();
......
......@@ -24,14 +24,12 @@
style="width: 100%"
height="650"
>
<el-table-column prop="id" label="编号"></el-table-column>
<el-table-column width="80" prop="id" label="序号"></el-table-column>
<el-table-column width="160" prop="user_code" label="编号"></el-table-column>
<el-table-column prop="name" label="名称"></el-table-column>
<el-table-column prop="email" label="邮箱"></el-table-column>
<el-table-column prop="phone" label="手机号"></el-table-column>
<el-table-column
prop="created_at"
label="创建时间"
></el-table-column>
<el-table-column width="160" prop="created_at" label="创建时间"></el-table-column>
<el-table-column prop="status" label="状态">
<template slot-scope="scope">
<div>
......@@ -50,6 +48,7 @@
</div>
</template>
</el-table-column>
<el-table-column prop="login_at" width="160" label="上次登录时间"></el-table-column>
<el-table-column prop="address" label="操作">
<template slot-scope="scope">
<div>
......@@ -133,7 +132,7 @@
:disabled="is_type == 'add' ? false : true"
></el-input>
</el-form-item>
<el-form-item label="手机号" prop="phone" v-if="user_type == 1">
<el-form-item label="手机号" prop="phone" >
<el-input
v-model="administrators_info.phone"
placeholder="请输入手机号"
......@@ -171,7 +170,7 @@
<el-radio-group v-model="administrators_info.status">
<el-radio :label="1">正常</el-radio>
<el-radio :label="2">禁止</el-radio>
<el-radio :label="3">失效</el-radio>
<!-- <el-radio :label="3">失效</el-radio> -->
</el-radio-group>
</el-form-item>
<el-form-item label="角色" prop="password">
......@@ -197,6 +196,7 @@
<el-button type="primary" @click="submitInfo">确 定</el-button>
</span>
</el-dialog>
<VerificationPassword ref="VerificationPassword"></VerificationPassword>
</div>
</template>
......@@ -215,6 +215,7 @@ import TableHead from '@/components/TableHead/index';
import { get_department_list } from '@/api/system';
import Treeselect from '@riophae/vue-treeselect';
import '@riophae/vue-treeselect/dist/vue-treeselect.css';
import VerificationPassword from '@/components/VerificationPassword/index';
const admin_info = {
id: null,
......@@ -270,7 +271,7 @@ export default {
};
},
components: { TableHead, Treeselect },
components: { TableHead, Treeselect ,VerificationPassword},
computed: {},
......@@ -337,6 +338,10 @@ export default {
},
//新增修改
infoUpdata(item) {
if(!this.$refs.VerificationPassword.is_password){
this.$refs.VerificationPassword.show_password()
return
}
console.log(item);
if (item) {
//修改
......@@ -356,14 +361,21 @@ export default {
//删除
deleteAdmin(item) {
let id = item.id;
if(!this.$refs.VerificationPassword.is_password){
this.$refs.VerificationPassword.show_password()
return
}
let data = {
id: item.id,
sign: this.$Aesencrypt(item.id+''),
};
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
delete_administrators(id).then((res) => {
delete_administrators(data).then((res) => {
console.log('删除回调');
console.log(res);
if (res.code == 200) {
......@@ -414,7 +426,7 @@ export default {
name: this.administrators_info.name,
phone: this.administrators_info.phone,
email: this.administrators_info.email,
password: this.administrators_info.password,
password: this.administrators_info.password?this.$Aesencrypt(this.administrators_info.password):null,
roles: this.administrators_info.role_id,
image: this.administrators_info.image,
status: this.administrators_info.status,
......@@ -438,8 +450,9 @@ export default {
//创建老师用户
let temporary = {
name: this.administrators_info.name,
password: this.administrators_info.password,
password: this.administrators_info.password?this.$Aesencrypt(this.administrators_info.password):null,
roles: this.administrators_info.role_id,
phone: this.administrators_info.phone,
department_id: this.administrators_info.department_id,
};
let temporary_data = this.$handleParams(temporary);
......
......@@ -332,14 +332,17 @@ export default {
},
//删除
deleteDepartment(item) {
let id = item.id;
let data = {
id: item.id,
sign: this.$Aesencrypt(item.id+''),
};
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
delete_department(id).then((res) => {
delete_department(data).then((res) => {
if (res.code == 200) {
this.$message.success(res.message);
this.init();
......
......@@ -134,6 +134,7 @@
<el-button type="primary" @click="submitData">确 定</el-button>
</span>
</el-dialog>
<VerificationPassword ref="VerificationPassword"></VerificationPassword>
</div>
</template>
......@@ -141,6 +142,7 @@
import TableHead from '@/components/TableHead/index';
import { get_permission_tree, get_permission_btn_menu, add_permission_menu, delete_permission_menu, edit_permission_menu } from '@/api/system';
import Treeselect from "@riophae/vue-treeselect";
import VerificationPassword from '@/components/VerificationPassword/index';
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
const standard_template = {
id: null,
......@@ -184,7 +186,7 @@ export default {
};
},
components: { Treeselect, TableHead },
components: { Treeselect, TableHead,VerificationPassword },
computed: {},
......@@ -255,6 +257,10 @@ export default {
},
//新增
addMenu(item) {
if(!this.$refs.VerificationPassword.is_password){
this.$refs.VerificationPassword.show_password()
return
}
this.is_updata_type = 'add';
if (item) {//有父级的新增
this.menu_info = { ...standard_template };
......@@ -267,6 +273,10 @@ export default {
},
//编辑
editMenu(item) {
if(!this.$refs.VerificationPassword.is_password){
this.$refs.VerificationPassword.show_password()
return
}
this.is_updata_type = 'edit';
this.menu_info = { ...item };
this.is_dialogVisible = true;
......@@ -317,13 +327,20 @@ export default {
},
//删除菜单
deleteMenu(item) {
let id = item.id;
if(!this.$refs.VerificationPassword.is_password){
this.$refs.VerificationPassword.show_password()
return
}
let data = {
id: item.id,
sign: this.$Aesencrypt(item.id+''),
};
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delete_permission_menu(id).then(res => {
delete_permission_menu(data).then(res => {
if (res.code == 200) {
this.$message.success(res.message);
this.init();
......
......@@ -28,7 +28,8 @@
</el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button
<el-button
v-if="scope.row.name!='系统管理员' && scope.row.name!='审计管理员'"
size="mini"
type="text"
style="color: #000"
......@@ -36,6 +37,7 @@
>编辑</el-button
>
<el-button
v-if="scope.row.name!='系统管理员' && scope.row.name!='审计管理员'"
size="mini"
type="text"
style="color: #f56c6c"
......@@ -108,6 +110,7 @@
<el-button type="primary" @click="submitData">确 定</el-button>
</span>
</el-dialog>
<VerificationPassword ref="VerificationPassword"></VerificationPassword>
</div>
</template>
......@@ -122,6 +125,7 @@ import {
} from '@/api/role';
import { get_permission_btn_menu } from '@/api/system';
import { button_tree_add, route_tree_all } from '@/utils/route-handle';
import VerificationPassword from '@/components/VerificationPassword/index';
const standard_template = {
id: null,
name: '',
......@@ -168,7 +172,7 @@ export default {
};
},
components: { TableHead },
components: { TableHead,VerificationPassword },
computed: {},
......@@ -287,12 +291,20 @@ export default {
},
//新增
addRoles() {
if(!this.$refs.VerificationPassword.is_password){
this.$refs.VerificationPassword.show_password()
return
}
this.is_updata_type = 'add';
this.is_dialogVisible = true;
this.roles_info = { ...standard_template };
},
//修改
editRoles(item) {
if(!this.$refs.VerificationPassword.is_password){
this.$refs.VerificationPassword.show_password()
return
}
this.is_updata_type = 'edit';
//序号获取详情
get_permission_detail(item.id).then((res) => {
......@@ -302,14 +314,21 @@ export default {
},
//删除
deleteRoles(item) {
let id = item.id;
if(!this.$refs.VerificationPassword.is_password){
this.$refs.VerificationPassword.show_password()
return
}
let data = {
id: item.id,
sign: this.$Aesencrypt(item.id+''),
};
this.$confirm('此操作将永久删除该角色, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
delete_roles(id).then((res) => {
delete_roles(data).then((res) => {
if (res.code == 200) {
this.$message.success(res.message);
this.getPermissionList();
......
<!--
* @Author: czj
* @Date: 2023-02-28 18:37:15
* @Description:
* @FilePath: \AdministrationHome\src\views\system\administrators\index.vue
-->
<!-- -->
<template>
<div>
<div class="card_container">
<el-card class="box-card" style="padding:50px">
<div>
<el-row >
<el-col :span="10" v-if="user_type == 1">
<div class="head_container">
<el-upload
class="avatar-uploader"
:action="upload_action"
:show-file-list="false"
accept="image/png,image/jpeg,image/jpg"
:http-request="sliderRequest"
>
<img
v-if="administrators_info.image"
:src="upload_action + administrators_info.image"
class="avatar"
/>
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
<div class="prompt_text">只能上传jpg/png文件,且不超过500kb</div>
</div>
</el-col>
<el-col :span="14">
<el-form
:model="administrators_info"
:rules="info_rules"
ref="ruleForm"
label-width="100px"
class="demo-ruleForm"
>
<el-form-item label="名称" prop="name">
<el-input
v-model="administrators_info.name"
placeholder="请输入名称"
:disabled="true"
></el-input>
</el-form-item>
<el-form-item label="手机号" prop="phone" >
<el-input
v-model="administrators_info.phone"
placeholder="请输入手机号"
></el-input>
</el-form-item>
<el-form-item label="邮箱" prop="email" >
<el-input
v-model="administrators_info.email"
placeholder="请输入邮箱"
></el-input>
</el-form-item>
<el-form-item label="密码" prop="password">
<el-input
v-model="administrators_info.password"
placeholder="请输入密码"
:type="passwordType"
>
<i
slot="suffix"
class="el-input__icon el-icon-view"
@click="showPwd"
></i>
</el-input>
</el-form-item>
</el-form>
</el-col>
</el-row>
<div slot="footer" class="dialog-footer" style="text-align: center;">
<el-button type="primary" style="width:300px" @click="submitInfo">保 存</el-button>
</div>
</div>
</el-card>
</div>
</div>
</template>
<script>
import Treeselect from '@riophae/vue-treeselect';
import '@riophae/vue-treeselect/dist/vue-treeselect.css';
import {upload_head,} from '@/api/system.js';
import {resetPassword} from '@/api/user.js';
const admin_info = {
id: null,
name: null,
phone: null,
email: null,
password: null,
image: '',
};
export default {
data() {
return {
is_loading: false,
administrators_list: [],
is_dialogVisible: false,
is_type: 'add',
administrators_info: { ...admin_info },
info_rules: {
name: [{ required: true, message: '请输入名称', trigger: 'blur' }],
// phone: [{ required: true, message: '请输入手机号', trigger: 'blur' }],
// email: [{ required: true, message: '请输入邮箱', trigger: 'blur' }],
// password: [
// { required: true, message: '请输入密码', trigger: 'blur' },
// ],
},
upload_action: `${process.env.VUE_APP_BASE_API}`,
passwordType: 'password', //输入框的类型,密码框
user_type: 1, //创建用户类型 老师,普通用户
roles_list: [],
//树菜单选择
tree_select_list: [],
};
},
components: { Treeselect },
computed: {},
mounted() {
this.getInfo()
},
methods: {
getInfo(){
this.$store.dispatch('user/getInfo').then((res) => {
this.administrators_info.name=res.name
this.administrators_info.phone=res.phone
this.administrators_info.email=res.email
this.administrators_info.image=res.image
})
},
//密码框和输入框切换
showPwd() {
if (this.passwordType === 'password') {
this.passwordType = '';
} else {
this.passwordType = 'password';
}
},
//上传
sliderRequest(upload) {
console.log('上传');
console.log(upload);
const formData = new FormData();
formData.append('image', upload.file);
upload_head(formData).then((res) => {
console.log('上传回调');
console.log(res);
if (res.err_code == 200) {
this.administrators_info.image = res.message;
this.$message.success('上传成功');
}
});
},
//提交
submitInfo() {
this.$refs['ruleForm'].validate((valid) => {
if (valid) {
let data = {
name: this.administrators_info.name,
phone: this.administrators_info.phone,
email: this.administrators_info.email,
password: this.administrators_info.password?this.$Aesencrypt(this.administrators_info.password):null,
image: this.administrators_info.image,
};
let params = this.$handleParams(data);
let id = this.administrators_info.id;
resetPassword(params).then((res) => {
if (res.code == 200) {
this.$message.success(res.message);
this.getInfo();
}
});
} else {
console.log('error submit!!');
return false;
}
});
},
},
};
</script>
<style lang="scss" scoped>
.search_box {
width: 200px;
margin-right: 15px;
}
.avatar-uploader {
display: inline-block;
border: 1px dashed #8c939d;
.el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
.el-upload:hover {
border-color: #409eff;
}
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 148px;
height: 148px;
line-height: 148px;
text-align: center;
}
.avatar {
width: 148px;
height: 148px;
display: block;
}
}
.head_container {
text-align: center;
margin: 30px 0;
.prompt_text {
font-size: 12px;
color: #606266;
margin-top: 15px;
text-align: center;
}
}
</style>
\ No newline at end of file
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论