b76a9d2b by 任超
2 parents a5e0414e a3704cbf
......@@ -16,8 +16,14 @@
placeholder="请输入密码" show-password></el-input>
</el-form-item>
<el-form-item prop="yz">
<el-input class="yz" @keyup.native="login('user')" v-model="user.yz"
placeholder="请输入验证码"></el-input>
<div class="flex-container">
<div class="flex-input">
<el-input class="yz" @keyup.native="login('user')" v-model="user.yz" placeholder="请输入验证码"></el-input>
</div>
<div class="flex-line"></div>
<div class="flex-img"><canvas id="s-canvas" ref="s-canvas"></canvas></div>
<div class="flex-renovate"><font id="renovate" @click="verification">换一批</font></div>
</div>
</el-form-item>
<el-form-item class="login-btn">
<el-button type="primary" style="width: 100%" @click="login('user')">登录</el-button>
......@@ -49,6 +55,7 @@
};
},
created () {
this.verification();
const params = {};
const queryOptions = {
conditionGroup: {
......@@ -79,6 +86,36 @@
// this.checkUserName();
},
methods: {
verification() {
let str = '1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ', code = '', i = 0;
for( ; i++ < 4 ; ) code += str[ Math.floor( Math.random() * ( str.length - 0 ) + 0 ) ];
setTimeout( () => {
let canvas = document.getElementById("s-canvas"), ctx = canvas.getContext("2d");
canvas.width = 80;
canvas.height = 28;
ctx.fillStyle = '#ffffff';
ctx.fillRect( 0, 0, 80, 28 );
for ( i = 0; i < code.length; i++ ) { this.drawText( ctx, code[i], i ); }
}, 0 );
},
drawText(ctx, txt, i) {
ctx.fillStyle = this.randomColor(50, 160);
ctx.font = "18px SimHei";
let x = (i + 1) * (80 / (4 + 1)), y = this.randomNum( 18, 28 - 5 );
ctx.translate(x, y);
ctx.fillText(txt, 0, 0);
ctx.rotate((-0 * Math.PI) / 180);
ctx.translate(-x, -y);
},
randomColor(min, max) {
let r = this.randomNum(min, max);
let g = this.randomNum(min, max);
let b = this.randomNum(min, max);
return "rgb(" + r + "," + g + "," + b + ")";
},
randomNum(min, max) {
return Math.floor(Math.random() * (max - min) + min);
},
//记住用户名
checkUserName: function (flag) {
this.user.checkStatus = flag;
......@@ -128,7 +165,6 @@
.password,
.yz {
position: relative;
&:before {
content: "";
display: block;
......@@ -148,6 +184,40 @@
}
}
.flex-container {
position: relative;
display: -webkit-flex;
display: flex;
}
.flex-input {
width: 100%;
}
.flex-line {
position: absolute;
width: 1px;
height: 64%;
margin: 5px;
right: 36%;
background-color: #CCCCCC;
}
.flex-img {
position: absolute;
margin: 2px;
right: 16%;
}
.flex-renovate {
position: absolute;
margin: 1px;
right: 3%;
}
#renovate {
color: #3F8FEA;
font-size: 16px;
font-weight: 700;
cursor: pointer;
}
.username::before {
background-image: url(../../image/userlogo.png);
}
......
......@@ -2,7 +2,7 @@
* @Author: xiaomiao 1158771342@qq.com
* @Date: 2023-01-30 17:59:51
* @LastEditors: xiaomiao 1158771342@qq.com
* @LastEditTime: 2023-03-21 15:00:39
* @LastEditTime: 2023-03-21 18:34:17
* @FilePath: \监管系统\js-web-jianguan\src\views\system\users\data\index.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
......@@ -32,13 +32,13 @@ class data extends filter {
label: "组织机构"
},
{
prop: "job_group",
label: "职位"
},
{
prop: "telephone",
label: "电话"
}
},
{
prop: "jobLevel",
label: "职位"
},
]
}
}
......
......@@ -61,8 +61,8 @@
</el-row>
<el-row :gutter="24">
<el-col :span="24">
<el-form-item label="组织机构:" label-width="100px">
<el-select class="selbig" v-model="form.departmentName" placeholder="组织机构">
<el-form-item label="组织机构:" label-width="100px" prop="departmentId">
<el-select class="selbig" v-model="form.departmentId" placeholder="组织机构">
<el-option v-for="item in districtAreaList" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
......@@ -93,10 +93,12 @@
districtAreaList: [],
form: {
sex: "0",
departmentId: '',
},
rules: {
name: [{ required: true, message: "请输入姓名", trigger: "blur" }],
code: [{ required: true, message: "请输入工号", trigger: "blur" }],
departmentId: [{ required: true, message: "请选择组织机构", trigger: 'change' }],
mobilePhone: [{ validator: "sddd", trigger: "blur" }],
loginName: [
{ required: true, message: "请输入用户名", trigger: "blur" },
......@@ -109,11 +111,6 @@
dataUrl: api.users
};
},
computed: {
departmentid () {
return this.$store.state.user.userInfo;
},
},
watch: {
value (val) {
this.myValue = val
......@@ -147,17 +144,17 @@
})
}
},
handleChange (value) {
this.form.departmentId = value;
},
// 保存
submitForm () {
this.districtAreaList.forEach((item) => {
if (this.form.departmentId == item.id) {
this.form.organizationId = item.organizationId
}
})
this.$refs.form.validate((valid) => {
if (valid) {
let method = ''
let url = ''
this.form.organizationId = this.departmentid.organizationId;
this.form.departmentId = this.departmentid.departmentId;
const formData = this.form
if (!formData.id) {
method = 'post'
......@@ -166,7 +163,6 @@
method = 'put'
url = `${this.dataUrl}/${formData.id}`
}
httpAction(url, formData, method).then((res) => {
if (res.status === 1) {
this.$message.success({ message: res.message, showClose: true })
......
......@@ -111,6 +111,15 @@
.concat(data.columns())
.concat([
{
label: "职位",
render: (h, scope) => {
return (
<div v-show={scope.row.jobLevel !== null}>{scope.row.jobLevel ? "干事" : "经理"}</div>
)
}
},
{
label: "负责人",
render: (h, scope) => {
return (
......@@ -235,7 +244,6 @@
code: this.form.code,
loginName: this.form.loginName,
};
console.log("this.queryParam", this.queryParam);
getUserLists(this.queryParam).then((res) => {
if (res.status === 1) {
this.loading = false;
......@@ -271,7 +279,6 @@
getAction(api.departments, params).then(
(res) => {
let deptsList = res.content;
console.log(deptsList);
deptsList.forEach((ele) => {
this.tableData.data.forEach((item) => {
if (ele.id == item.departmentId) {
......@@ -367,6 +374,7 @@
// 修改人员信息
handleEdit (row) {
console.log("rowwwww", row);
this.isDialog = true
this.$refs.dialogForm.edit(row);
this.$refs.dialogForm.title = "修改";
......