二维码

This commit is contained in:
hezhengao 2024-04-19 09:41:48 +08:00
parent 20299daade
commit 89be263ca7
3 changed files with 45 additions and 84 deletions

View File

@ -56,6 +56,7 @@
"vue-count-to": "1.0.13",
"vue-cropper": "0.5.5",
"vue-meta": "2.4.0",
"vue-print-nb": "^1.7.5",
"vue-qr": "^4.0.9",
"vue-router": "3.4.9",
"vuedraggable": "2.24.3",

View File

@ -75,17 +75,20 @@
</div>
</el-dialog>
<!-- 二维码 -->
<el-dialog :visible.sync="codeOpen" width="250px" append-to-body>
<el-dialog :visible.sync="codeOpen" width="450px" append-to-body>
<div id="printdata">
<div>项目名称<span>{{ this.titles }}</span></div>
<div>
<vue-qr ref="qrCode" :text="texturl" :logoSrc="logoSrc" :color-dark="randomColor"></vue-qr>
<div>项目名称<span>{{ this.titles }}</span></div>
<div>
<vue-qr :width="400" ref="qrCode" :text="texturl" :logoSrc="logoSrc" :color-dark="randomColor" ></vue-qr>
</div>
</div>
</div>
<div slot="footer">
<el-button type="primary" @click="() => { codeOpen = false }">确定</el-button>
<el-button type="text" @click="handlePrint" v-print="'#printdata'" >打印二维码</el-button>
<el-button type="primary" @click="handlePrint" v-print="'#printdata'" >打印二维码</el-button>
</div>
</el-dialog>
@ -308,4 +311,21 @@ export default {
margin-bottom: 20px;
}
}
@media print {
@page {
size: auto; /* 设置打印页面大小为自动 */
margin: 0; /* 设置打印页面的页边距为0去除默认页眉和页脚 */
}
#printdata {
display: flex;
justify-content: center; /* 水平居中 */
align-items: center; /* 垂直居中 */
height: 100vh; /* 设置高度为视口高度,使内容居中显示 */
transform: scale(3); /* 设置二维码放大倍数这里是放大2倍可以根据需要调整 */
}
/* 如果需要额外样式,可以在这里添加 */
}
</style>

View File

@ -3,7 +3,7 @@
<el-row :gutter="20">
<!--部门数据-->
<el-col :span="4" :xs="20">
<div class="head-container">
<!-- <div class="head-container">
<el-input
v-model="deptName"
placeholder="请输入部门名称"
@ -12,8 +12,8 @@
prefix-icon="el-icon-search"
style="margin-bottom: 20px"
/>
</div>
<div class="head-container">
</div> -->
<!-- <div class="head-container">
<el-tree
:data="deptOptions"
:props="defaultProps"
@ -25,7 +25,7 @@
highlight-current
@node-click="handleNodeClick"
/>
</div>
</div> -->
</el-col>
<!--用户数据-->
<el-col :span="20" :xs="24">
@ -113,7 +113,7 @@
v-hasPermi="['system:user:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<!-- <el-col :span="1.5">
<el-button
type="info"
plain
@ -122,7 +122,7 @@
@click="handleImport"
v-hasPermi="['system:user:import']"
>导入</el-button>
</el-col>
</el-col> -->
<el-col :span="1.5">
<el-button
type="warning"
@ -138,11 +138,10 @@
<el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="25" align="center" />
<el-table-column label="用户编号" align="center" key="userId" prop="userId" v-if="columns[0].visible" width="80"/>
<el-table-column label="用户名称" align="center" key="userName" prop="userName" v-if="columns[1].visible" :show-overflow-tooltip="true" />
<el-table-column label="用户昵称" align="center" key="nickName" prop="nickName" v-if="columns[2].visible" :show-overflow-tooltip="true" />
<el-table-column label="部门" align="center" key="deptName" prop="dept.deptName" v-if="columns[3].visible" :show-overflow-tooltip="true" />
<el-table-column label="手机号码" align="center" key="phonenumber" prop="phonenumber" v-if="columns[4].visible" />
<!-- <el-table-column label="用户昵称" align="center" key="nickName" prop="nickName" v-if="columns[2].visible" :show-overflow-tooltip="true" /> -->
<!-- <el-table-column label="部门" align="center" key="deptName" prop="dept.deptName" v-if="columns[3].visible" :show-overflow-tooltip="true" /> -->
<!-- <el-table-column label="手机号码" align="center" key="phonenumber" prop="phonenumber" v-if="columns[4].visible" /> -->
<el-table-column label="OpenID" align="center" prop="openid" v-if="columns[5].visible" :show-overflow-tooltip="true"/>
<el-table-column label="状态" align="center" key="status" v-if="columns[6].visible">
<template slot-scope="scope">
@ -211,58 +210,24 @@
</el-row>
<!-- 添加或修改用户配置对话框 -->
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
<el-dialog :title="title" :visible.sync="open" width="300px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-row>
<el-col :span="12">
<el-form-item label="用户昵称" prop="nickName">
<el-input v-model="form.nickName" placeholder="请输入用户昵称" maxlength="30" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="归属部门" prop="deptId">
<treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="手机号码" prop="phonenumber">
<el-input v-model="form.phonenumber" placeholder="请输入手机号码" maxlength="11" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="邮箱" prop="email">
<el-input v-model="form.email" placeholder="请输入邮箱" maxlength="50" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-col :span="24">
<el-form-item v-if="form.userId == undefined" label="用户名称" prop="userName">
<el-input v-model="form.userName" placeholder="请输入用户名称" maxlength="30" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-col :span="24">
<el-form-item v-if="form.userId == undefined" label="用户密码" prop="password">
<el-input v-model="form.password" placeholder="请输入用户密码" type="password" maxlength="20" show-password/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="用户性别">
<el-select v-model="form.sex" placeholder="请选择性别">
<el-option
v-for="dict in dict.type.sys_user_sex"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-col :span="24">
<el-form-item label="状态">
<el-radio-group v-model="form.status">
<el-radio
@ -273,22 +238,7 @@
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="岗位">
<el-select v-model="form.postIds" multiple placeholder="请选择岗位">
<el-option
v-for="item in postOptions"
:key="item.postId"
:label="item.postName"
:value="item.postId"
:disabled="item.status == 1"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-col :span="24">
<el-form-item label="角色">
<el-select v-model="form.roleIds" multiple placeholder="请选择角色">
<el-option
@ -302,20 +252,7 @@
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="OpenID" prop="openid">
<el-input v-model="form.openid" placeholder="请输入OpenID" maxlength="50" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="备注">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
@ -593,8 +530,11 @@ export default {
this.form.password = this.initPassword;
});
},
/** 修改按钮操作 */
handleUpdate(row) {
console.log(row);
this.reset();
const userId = row.userId || this.ids;
getUser(userId).then(response => {