Browse Source

企业说明

master
parent
commit
04b8755d0c
  1. 5
      package.json
  2. 4
      src/BusinessCom/ChooseCompany/index.vue
  3. 32
      src/BusinessCom/ChoosePersonnel/index.vue
  4. 148
      src/api/system/user.js
  5. 27
      src/api/task/index.js
  6. 11
      src/assets/styles/index.scss
  7. 241
      src/assets/styles/ruoyi.scss
  8. 7
      src/components/Editor/index.vue
  9. 2
      src/router/index.js
  10. 171
      src/views/enterprises/component/form.vue
  11. 53
      src/views/enterprises/component/introduce.vue
  12. 319
      src/views/enterprises/index.vue
  13. 1102
      src/views/home/index.vue
  14. 1102
      src/views/index.vue
  15. 92
      src/views/system/enterprises/component/enterpriseInsert.vue
  16. 589
      src/views/system/enterprises/index.vue
  17. 424
      src/views/system/notice/index.vue
  18. 43
      src/views/system/user/enterprisesDetail.vue
  19. 197
      src/views/system/user/examine.vue
  20. 58
      src/views/system/user/examineform.vue
  21. 645
      src/views/system/user/index.vue
  22. 5
      src/views/task/index.vue

5
package.json

@ -44,5 +44,10 @@
"vite": "5.3.2",
"vite-plugin-compression": "0.5.1",
"vite-plugin-svg-icons": "2.0.1"
},
"pnpm": {
"overrides": {
"quill": "2.0.2"
}
}
}

4
src/BusinessCom/ChooseCompany/index.vue

@ -123,6 +123,10 @@ function tableSelect(ids){
console.log(isSelect.value)
}
function submit(){
}
defineExpose({ open });
</script>

32
src/BusinessCom/ChoosePersonnel/index.vue

@ -1,7 +1,6 @@
<template>
<section>
<el-button type="primary" @click="selectPersonnal">选择人员</el-button>
<teleport to="body">
<teleport to="body">
<Transition name="wind">
<section
class="choose-container"
v-if="showChoose"
@ -80,8 +79,8 @@
</section>
</section>
</section>
</teleport>
</section>
</Transition>
</teleport>
</template>
<script setup>
@ -96,9 +95,11 @@ const form = ref({
pageNum: 1,
});
function selectPersonnal() {
function open() {
showChoose.value = true;
}
defineExpose({ open });
</script>
<style scoped lang="scss">
@ -130,15 +131,15 @@ function selectPersonnal() {
grid-area: ischoose;
border: 1px dashed #ccc;
border-radius: var(--el-border-radius-base, 4px);
.none{
height: 100%;
width: 100%;
display: flex;
justify-content: center;
align-items: center;
color: var(--el-text-color-secondary);
font-size: 14px;
}
.none {
height: 100%;
width: 100%;
display: flex;
justify-content: center;
align-items: center;
color: var(--el-text-color-secondary);
font-size: 14px;
}
}
.chooseOption {
@ -146,4 +147,5 @@ function selectPersonnal() {
}
}
}
</style>

148
src/api/system/user.js

@ -1,145 +1,167 @@
import request from '@/utils/request'
import request from "@/utils/request";
import { parseStrEmpty } from "@/utils/ruoyi";
// 查询用户列表
export function listUser(query) {
return request({
url: '/system/user/list',
method: 'get',
params: query
})
url: "/system/user/list",
method: "get",
params: query,
});
}
// 查询用户列表
export function listDeptUser(query) {
return request({
url: '/system/user/listDeptUser',
method: 'get',
params: query
})
url: "/system/user/listDeptUser",
method: "get",
params: query,
});
}
// 查询用户详细
export function getUser(userId) {
return request({
url: '/system/user/' + parseStrEmpty(userId),
method: 'get'
})
url: "/system/user/" + parseStrEmpty(userId),
method: "get",
});
}
// 新增用户
export function addUser(data) {
return request({
url: '/system/user',
method: 'post',
data: data
})
url: "/system/user",
method: "post",
data: data,
});
}
// 修改用户
export function updateUser(data) {
return request({
url: '/system/user',
method: 'put',
data: data
})
url: "/system/user",
method: "put",
data: data,
});
}
// 删除用户
export function delUser(userId) {
return request({
url: '/system/user/' + userId,
method: 'delete'
})
url: "/system/user/" + userId,
method: "delete",
});
}
// 用户密码重置
export function resetUserPwd(userId, password) {
const data = {
userId,
password
}
password,
};
return request({
url: '/system/user/resetPwd',
method: 'put',
data: data
})
url: "/system/user/resetPwd",
method: "put",
data: data,
});
}
// 用户状态修改
export function changeUserStatus(userId, status) {
const data = {
userId,
status
}
status,
};
return request({
url: '/system/user/changeStatus',
method: 'put',
data: data
})
url: "/system/user/changeStatus",
method: "put",
data: data,
});
}
// 查询用户个人信息
export function getUserProfile() {
return request({
url: '/system/user/profile',
method: 'get'
})
url: "/system/user/profile",
method: "get",
});
}
// 修改用户个人信息
export function updateUserProfile(data) {
return request({
url: '/system/user/profile',
method: 'put',
data: data
})
url: "/system/user/profile",
method: "put",
data: data,
});
}
// 用户密码重置
export function updateUserPwd(oldPassword, newPassword) {
const data = {
oldPassword,
newPassword
}
newPassword,
};
return request({
url: '/system/user/profile/updatePwd',
method: 'put',
data: data
})
url: "/system/user/profile/updatePwd",
method: "put",
data: data,
});
}
// 用户头像上传
export function uploadAvatar(data) {
return request({
url: '/system/user/profile/avatar',
method: 'post',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
data: data
})
url: "/system/user/profile/avatar",
method: "post",
headers: { "Content-Type": "application/x-www-form-urlencoded" },
data: data,
});
}
// 查询授权角色
export function getAuthRole(userId) {
return request({
url: '/system/user/authRole/' + userId,
method: 'get'
})
url: "/system/user/authRole/" + userId,
method: "get",
});
}
// 保存授权角色
export function updateAuthRole(data) {
return request({
url: '/system/user/authRole',
method: 'put',
params: data
})
url: "/system/user/authRole",
method: "put",
params: data,
});
}
// 查询部门下拉树结构
export function deptTreeSelect() {
return request({
url: '/system/user/deptTree',
method: 'get'
})
url: "/system/user/deptTree",
method: "get",
});
}
/**
* 查询审核列表
*/
export function getExamieList(query) {
return request({
url: "/system/user/auditList",
method: "get",
params: query,
});
}
/**
* 审核用户
*/
export function examineUser(data) {
return request({
url: "/system/user/auditUser",
method: "put",
data,
});
}

27
src/api/task/index.js

@ -0,0 +1,27 @@
import request from '@/utils/request'
/**
* 查询任务列表
* @param query
* @returns {*}
*/
export function getTaskList(query) {
return request({
url: '/system/enterprises/list',
method: 'get',
params: query
})
}
/**
* 创建任务
* @param id
* @returns {*}
*/
export function createTask(id) {
return request({
url: '/system/enterprises/' + id,
method: 'post'
})
}

11
src/assets/styles/index.scss

@ -182,3 +182,14 @@ aside {
margin-bottom: 10px;
}
}
// 自定义弹窗动画
.wind-enter-active,
.wind-leave-active {
transition: opacity 0.5s ease-in-out;
}
.wind-enter-from,
.wind-leave-to {
opacity: 0;
}

241
src/assets/styles/ruoyi.scss

@ -3,101 +3,113 @@
* Copyright (c) 2019 ruoyi
*/
/** 基础通用 **/
/** 基础通用 **/
.pt5 {
padding-top: 5px;
padding-top: 5px;
}
.pr5 {
padding-right: 5px;
padding-right: 5px;
}
.pb5 {
padding-bottom: 5px;
padding-bottom: 5px;
}
.mt5 {
margin-top: 5px;
margin-top: 5px;
}
.mr5 {
margin-right: 5px;
margin-right: 5px;
}
.mb5 {
margin-bottom: 5px;
margin-bottom: 5px;
}
.mb8 {
margin-bottom: 8px;
margin-bottom: 8px;
}
.ml5 {
margin-left: 5px;
margin-left: 5px;
}
.mt10 {
margin-top: 10px;
margin-top: 10px;
}
.mr10 {
margin-right: 10px;
margin-right: 10px;
}
.mb10 {
margin-bottom: 10px;
margin-bottom: 10px;
}
.ml10 {
margin-left: 10px;
margin-left: 10px;
}
.mt20 {
margin-top: 20px;
margin-top: 20px;
}
.mr20 {
margin-right: 20px;
margin-right: 20px;
}
.mb20 {
margin-bottom: 20px;
margin-bottom: 20px;
}
.ml20 {
margin-left: 20px;
}
.h1, .h2, .h3, .h4, .h5, .h6, h1, h2, h3, h4, h5, h6 {
font-family: inherit;
font-weight: 500;
line-height: 1.1;
color: inherit;
margin-left: 20px;
}
.h1,
.h2,
.h3,
.h4,
.h5,
.h6,
h1,
h2,
h3,
h4,
h5,
h6 {
font-family: inherit;
font-weight: 500;
line-height: 1.1;
color: inherit;
}
.el-form .el-form-item__label {
font-weight: 700;
font-weight: 700;
}
.el-dialog:not(.is-fullscreen) {
margin-top: 6vh !important;
margin-top: 6vh ;
}
.el-dialog.scrollbar .el-dialog__body {
overflow: auto;
overflow-x: hidden;
max-height: 70vh;
padding: 10px 20px 0;
overflow: auto;
overflow-x: hidden;
max-height: 70vh;
padding: 10px 20px 0;
}
.el-table {
.el-table__header-wrapper, .el-table__fixed-header-wrapper {
th {
word-break: break-word;
background-color: #f8f8f9 !important;
color: #515a6e;
height: 40px !important;
font-size: 13px;
}
}
.el-table__body-wrapper {
.el-button [class*="el-icon-"] + span {
margin-left: 1px;
}
}
.el-table__header-wrapper,
.el-table__fixed-header-wrapper {
th {
word-break: break-word;
background-color: #f8f8f9 !important;
color: #515a6e;
height: 40px !important;
font-size: 13px;
}
}
.el-table__body-wrapper {
.el-button [class*="el-icon-"] + span {
margin-left: 1px;
}
}
}
/** 表单布局 **/
.form-header {
font-size:15px;
color:#6379bb;
border-bottom:1px solid #ddd;
margin:8px 10px 25px 10px;
padding-bottom:5px
font-size: 15px;
color: #6379bb;
border-bottom: 1px solid #ddd;
margin: 8px 10px 25px 10px;
padding-bottom: 5px;
}
/** 表格布局 **/
@ -144,155 +156,156 @@
/* tree border */
.tree-border {
margin-top: 5px;
border: 1px solid var(--el-border-color-light, #e5e6e7);
background: var(--el-bg-color, #FFFFFF) none;
border-radius:4px;
width: 100%;
margin-top: 5px;
border: 1px solid var(--el-border-color-light, #e5e6e7);
background: var(--el-bg-color, #ffffff) none;
border-radius: 4px;
width: 100%;
}
.el-table .fixed-width .el-button--small {
padding-left: 0;
padding-right: 0;
width: inherit;
padding-left: 0;
padding-right: 0;
width: inherit;
}
/** 表格更多操作下拉样式 */
.el-table .el-dropdown-link {
cursor: pointer;
color: #409EFF;
margin-left: 10px;
cursor: pointer;
color: #409eff;
margin-left: 10px;
}
.el-table .el-dropdown, .el-icon-arrow-down {
font-size: 12px;
.el-table .el-dropdown,
.el-icon-arrow-down {
font-size: 12px;
}
.el-tree-node__content > .el-checkbox {
margin-right: 8px;
margin-right: 8px;
}
.list-group-striped > .list-group-item {
border-left: 0;
border-right: 0;
border-radius: 0;
padding-left: 0;
padding-right: 0;
border-left: 0;
border-right: 0;
border-radius: 0;
padding-left: 0;
padding-right: 0;
}
.list-group {
padding-left: 0px;
list-style: none;
padding-left: 0px;
list-style: none;
}
.list-group-item {
border-bottom: 1px solid #e7eaec;
border-top: 1px solid #e7eaec;
margin-bottom: -1px;
padding: 11px 0px;
font-size: 13px;
border-bottom: 1px solid #e7eaec;
border-top: 1px solid #e7eaec;
margin-bottom: -1px;
padding: 11px 0px;
font-size: 13px;
}
.pull-right {
float: right !important;
float: right !important;
}
.el-card__header {
padding: 14px 15px 7px !important;
min-height: 40px;
padding: 14px 15px 7px !important;
min-height: 40px;
}
.el-card__body {
padding: 15px 20px 20px 20px !important;
padding: 15px 20px 20px 20px !important;
}
.card-box {
padding-right: 15px;
padding-left: 15px;
margin-bottom: 10px;
padding-right: 15px;
padding-left: 15px;
margin-bottom: 10px;
}
/* button color */
.el-button--cyan.is-active,
.el-button--cyan:active {
background: #20B2AA;
border-color: #20B2AA;
color: #FFFFFF;
background: #20b2aa;
border-color: #20b2aa;
color: #ffffff;
}
.el-button--cyan:focus,
.el-button--cyan:hover {
background: #48D1CC;
border-color: #48D1CC;
color: #FFFFFF;
background: #48d1cc;
border-color: #48d1cc;
color: #ffffff;
}
.el-button--cyan {
background-color: #20B2AA;
border-color: #20B2AA;
color: #FFFFFF;
background-color: #20b2aa;
border-color: #20b2aa;
color: #ffffff;
}
/* text color */
.text-navy {
color: #1ab394;
color: #1ab394;
}
.text-primary {
color: inherit;
color: inherit;
}
.text-success {
color: #1c84c6;
color: #1c84c6;
}
.text-info {
color: #23c6c8;
color: #23c6c8;
}
.text-warning {
color: #f8ac59;
color: #f8ac59;
}
.text-danger {
color: #ed5565;
color: #ed5565;
}
.text-muted {
color: #888888;
color: #888888;
}
/* image */
.img-circle {
border-radius: 50%;
border-radius: 50%;
}
.img-lg {
width: 120px;
height: 120px;
width: 120px;
height: 120px;
}
.avatar-upload-preview {
position: absolute;
top: 50%;
transform: translate(50%, -50%);
width: 200px;
height: 200px;
border-radius: 50%;
box-shadow: 0 0 4px #ccc;
overflow: hidden;
position: absolute;
top: 50%;
transform: translate(50%, -50%);
width: 200px;
height: 200px;
border-radius: 50%;
box-shadow: 0 0 4px #ccc;
overflow: hidden;
}
/* 拖拽列样式 */
.sortable-ghost{
opacity: .8;
color: #fff!important;
background: #42b983!important;
.sortable-ghost {
opacity: 0.8;
color: #fff !important;
background: #42b983 !important;
}
/* 表格右侧工具栏样式 */
.top-right-btn {
margin-left: auto;
margin-left: auto;
}
/* 分割面板样式 */

7
src/components/Editor/index.vue

@ -9,7 +9,7 @@
:show-file-list="false"
:headers="headers"
class="editor-img-uploader"
v-if="type == 'url'"
v-if="type === 'url'"
>
<i ref="uploadRef" class="editor-img-uploader"></i>
</el-upload>
@ -34,7 +34,7 @@ import { getToken } from "@/utils/auth";
const { proxy } = getCurrentInstance();
const quillEditorRef = ref();
const uploadUrl = ref(import.meta.env.VITE_APP_BASE_API + "/common/upload"); //
const uploadUrl = ref(import.meta.env.VITE_APP_BASE_API + "/common_file/upload"); //
const headers = ref({
Authorization: "Bearer " + getToken()
});
@ -151,12 +151,13 @@ function handleBeforeUpload(file) {
function handleUploadSuccess(res, file) {
//
if (res.code == 200) {
console.log(res)
//
let quill = toRaw(quillEditorRef.value).getQuill();
//
let length = quill.selection.savedRange.index;
// res.url
quill.insertEmbed(length, "image", import.meta.env.VITE_APP_BASE_API + res.fileName);
quill.insertEmbed(length, "image", res.data);
//
quill.setSelection(length + 1);
} else {

2
src/router/index.js

@ -64,7 +64,7 @@ export const constantRoutes = [
children: [
{
path: '/index',
component: () => import('@/views/index'),
component: () => import('@/views/home/index.vue'),
name: 'Index',
meta: { title: '首页', icon: 'dashboard', affix: true }
}

171
src/views/enterprises/component/form.vue

@ -0,0 +1,171 @@
<template>
<el-dialog :title="title" v-model="show" width="600px" append-to-body>
<el-form
ref="enterprisesRef"
:model="form"
:rules="rules"
label-width="auto"
>
<el-form-item label="名称" prop="enterprisesName">
<el-input v-model="form.enterprisesName" placeholder="请输入企业名称" />
</el-form-item>
<el-form-item label="类型" prop="type">
<el-select v-model="form.type" placeholder="请输入所属区域">
<el-option
v-for="dict in enterprise_type"
:key="dict.value"
:lable="dict.value"
:value="dict.label"
/>
</el-select>
</el-form-item>
<el-form-item label="所属区域" prop="region">
<el-select v-model="form.region" placeholder="请输入所属区域">
<el-option
v-for="dict in sys_region"
:key="dict.value"
:lable="dict.value"
:value="dict.label"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="地址" prop="address">
<el-input
v-model="form.address"
type="textarea"
placeholder="请输入内容"
/>
</el-form-item>
<el-form-item label="注册号" prop="registrationNumber">
<el-input
v-model="form.registrationNumber"
placeholder="请输入企业注册号"
/>
</el-form-item>
<el-form-item label="成立时间" prop="establishmentDate">
<el-date-picker
clearable
v-model="form.establishmentDate"
type="date"
value-format="YYYY-MM-DD"
placeholder="请选择企业成立时间"
style="width: 100%"
>
</el-date-picker>
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
</template>
<script setup>
import {
addEnterprises,
updateEnterprises,
getEnterprises,
} from "@/api/system/enterprises/enterprises";
const { proxy } = getCurrentInstance();
const { enterprise_type, sys_region } = proxy.useDict(
"enterprise_type",
"sys_region",
);
const title = ref("");
const show = ref(false);
const emits = defineEmits(["success"]);
const data = reactive({
form: {},
rules: {
type: [{ required: true, message: "企业类型", trigger: "change" }],
region: [{ required: true, message: "企业所属区域", trigger: "blur" }],
enterprisesName: [
{
required: true,
message: "企业名称不能为空",
trigger: "blur",
},
],
createTime: [
{
required: true,
message: "创建时间不能为空",
trigger: "blur",
},
],
updateTime: [
{
required: true,
message: "更新时间不能为空",
trigger: "blur",
},
],
},
});
const { form, rules } = toRefs(data);
/** 提交按钮 */
function submitForm() {
proxy.$refs["enterprisesRef"].validate((valid) => {
if (valid) {
if (form.value.id != null) {
updateEnterprises(form.value).then((response) => {
proxy.$modal.msgSuccess("修改成功");
emits('success')
open.value = false;
});
} else {
addEnterprises(form.value).then((response) => {
proxy.$modal.msgSuccess("新增成功");
emits('success')
open.value = false;
});
}
}
});
}
function open(id) {
reset();
if (id) {
title.value = "修改企业基本信息";
getEnterprises(id).then((res) => {
form.value = res.data;
});
} else {
title.value = "新增企业基本信息";
}
show.value = true;
}
//
function reset() {
form.value = {
id: null,
departmentId: null,
userId: null,
type: null,
region: null,
enterprisesName: null,
address: null,
environmentalContactName: null,
environmentalContactPhone: null,
registrationNumber: null,
introduction: null,
establishmentDate: null,
creator: null,
createTime: null,
updateTime: null,
updater: null,
deleted: null,
};
proxy.resetForm("enterprisesRef");
}
defineExpose({ open });
</script>
<style scoped lang="scss"></style>

53
src/views/enterprises/component/introduce.vue

@ -0,0 +1,53 @@
<template>
<el-dialog title="图文介绍" v-model="show" width="780px" append-to-body>
<el-form ref="noticeRef" :model="form">
<el-form-item label="介绍">
<editor v-model="form.introduction" :min-height="192" />
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
</template>
<script setup>
import {
addEnterprises,
updateEnterprises,
getEnterprises,
} from "@/api/system/enterprises/enterprises";
const form = ref({
introduction: null,
id: null,
});
const { proxy } = getCurrentInstance();
const show = ref(false);
function open(id) {
form.value.id = id;
getEnterprises(id).then((res) => {
form.value = res.data;
});
show.value = true;
}
function submitForm() {
updateEnterprises(form.value).then((response) => {
proxy.$modal.msgSuccess("修改成功");
show.value = false;
});
}
function cancel() {
show.value = false;
}
defineExpose({ open });
</script>
<style scoped lang="scss"></style>

319
src/views/enterprises/index.vue

@ -0,0 +1,319 @@
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryRef"
:inline="true"
v-show="showSearch"
>
<el-form-item label="专管员" prop="userId">
<el-input
v-model="queryParams.userId"
placeholder="请输入专管员"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="类型" prop="type">
<el-select
v-model="queryParams.type"
clearable
placeholder="请选择所属区域"
@change="handleQuery"
style="width: 150px"
>
<el-option
v-for="dict in enterprise_type"
:key="dict.value"
:lable="dict.value"
:value="dict.label"
/>
</el-select>
</el-form-item>
<el-form-item label="所属区域" prop="region">
<el-select
v-model="queryParams.region"
clearable
placeholder="请选择所属区域"
@select="handleQuery"
style="width: 150px"
>
<el-option
v-for="dict in sys_region"
:key="dict.value"
:lable="dict.value"
:value="dict.label"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="企业名称" prop="enterprisesName">
<el-input
v-model="queryParams.enterprisesName"
placeholder="请输入企业名称"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="环保负责人" prop="environmentalContactName">
<el-input
v-model="queryParams.environmentalContactName"
placeholder="请输入企业环保负责人姓名"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="注册号" prop="registrationNumber">
<el-input
v-model="queryParams.registrationNumber"
placeholder="请输入企业注册号"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="创建人" prop="creator">
<el-input
v-model="queryParams.creator"
placeholder="请输入创建人"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery"
>搜索</el-button
>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="Plus"
@click="handleAdd"
v-hasPermi="['system:enterprises:add']"
>
新增
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="Download"
@click="handleExport"
v-hasPermi="['system:enterprises:export']"
>导出</el-button
>
</el-col>
<right-toolbar
v-model:showSearch="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="enterprisesList">
<el-table-column
label="名称"
align="center"
prop="enterprisesName"
show-overflow-tooltip
>
<template #default="scope">
<section class="name">
<DictTag :options="enterprise_type" :value="scope.row.region" />
<span>{{ scope.row.enterprisesName }}</span>
</section>
</template>
</el-table-column>
<el-table-column label="所属区域" align="center" prop="region">
<template #default="scope">
<DictTag :options="sys_region" :value="scope.row.region" />
</template>
</el-table-column>
<el-table-column
label="地址"
align="center"
prop="address"
show-overflow-tooltip
/>
<el-table-column label="环保负责人" align="center" prop="" />
<el-table-column
label="专管员"
align="center"
prop="environmentalContactName"
/>
<el-table-column
label="注册号"
align="center"
prop="registrationNumber"
/>
<el-table-column
label="成立时间"
align="center"
prop="establishmentDate"
width="180"
>
<template #default="scope">
<span>
{{ parseTime(scope.row.establishmentDate, "{y}-{m}-{d}") }}
</span>
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
width="300px"
>
<template #default="scope">
<el-button link type="primary" icon="Collection"> 详情 </el-button>
<el-button
link
type="primary"
icon="Document"
@click="introduce(scope.row)"
v-hasPermi="['system:enterprises:remove']"
>
图文介绍
</el-button>
<el-button
link
type="primary"
icon="Delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:enterprises:remove']"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
<EnterprisesFrom ref="enterprisesFromRef" @success="handleQuery" />
<IntroduceForm ref="introduceFormRef" />
</div>
</template>
<script setup name="Enterprises">
import EnterprisesFrom from "./component/form.vue";
import IntroduceForm from "./component/introduce.vue";
import {
listEnterprises,
delEnterprises,
} from "@/api/system/enterprises/enterprises";
import DictTag from "@/components/DictTag/index.vue";
const { proxy } = getCurrentInstance();
const { enterprise_type, sys_region } = proxy.useDict(
"enterprise_type",
"sys_region",
);
const enterprisesList = ref([]);
const loading = ref(true);
const showSearch = ref(true);
const ids = ref([]);
const total = ref(0);
const enterprisesFromRef = ref();
const data = reactive({
queryParams: {
pageNum: 1,
pageSize: 10,
departmentId: null,
userId: null,
type: null,
region: null,
enterprisesName: null,
address: null,
environmentalContactName: null,
environmentalContactPhone: null,
registrationNumber: null,
introduction: null,
establishmentDate: null,
creator: null,
updater: null,
deleted: null,
},
});
const { queryParams } = toRefs(data);
const introduceFormRef = ref();
/** 查询企业列表 */
function getList() {
loading.value = true;
listEnterprises(queryParams.value).then((response) => {
enterprisesList.value = response.rows;
total.value = response.total;
loading.value = false;
});
}
/** 搜索按钮操作 */
function handleQuery() {
queryParams.value.pageNum = 1;
getList();
}
/** 重置按钮操作 */
function resetQuery() {
proxy.resetForm("queryRef");
handleQuery();
}
/** 新增按钮操作 */
function handleAdd() {
unref(enterprisesFromRef).open();
}
/** 删除按钮操作 */
function handleDelete(row) {
const _ids = row.id || ids.value;
proxy.$modal
.confirm('是否确认删除企业编号为"' + _ids + '"的数据项?')
.then(function () {
return delEnterprises(_ids);
})
.then(() => {
getList();
proxy.$modal.msgSuccess("删除成功");
})
.catch(() => {});
}
/** 导出按钮操作 */
function handleExport() {
proxy.download(
"system/enterprises/export",
{
...queryParams.value,
},
`enterprises_${new Date().getTime()}.xlsx`,
);
}
/** 图文介绍按钮操作 */
function introduce(row){
unref(introduceFormRef).open(row.id);
}
getList();
</script>
<style lang="scss" scoped>
.name {
display: flex;
width: fit-content;
gap: 10px;
}
</style>

1102
src/views/home/index.vue

File diff suppressed because it is too large Load Diff

1102
src/views/index.vue

File diff suppressed because it is too large Load Diff

92
src/views/system/enterprises/component/enterpriseInsert.vue

@ -1,92 +0,0 @@
<template>
<el-dialog :title="title" v-model="visible" width="500px" append-to-body>
<el-form ref="formRef" :model="form" :rules="rules" label-width="80px">
<el-form-item label="企业名称" prop="enterprisesName">
<el-input v-model="form.enterprisesName" placeholder="请输入企业名称" />
</el-form-item>
<el-form-item label="企业地址" prop="address">
<el-input v-model="form.address" placeholder="请输入企业地址" />
</el-form-item>
<el-form-item label="企业成立时间" prop="establishmentDate">
<el-date-picker
clearable
v-model="form.establishmentDate"
type="date"
value-format="YYYY-MM-DD"
placeholder="请选择企业成立时间"
/>
</el-form-item>
<!-- 更多表单项 -->
</el-form>
<template #footer>
<el-button type="primary" @click="submit"> </el-button>
<el-button @click="close"> </el-button>
</template>
</el-dialog>
</template>
<script setup>
import { ref } from "vue";
// Props
const props = defineProps({
title: {
type: String,
default: "添加/修改企业",
},
rules: {
type: Object,
default: () => ({}),
},
});
// Emit
const emit = defineEmits(["submit", "cancel"]);
//
const visible = ref(false);
//
const form = ref({
enterprisesName: "",
address: "",
establishmentDate: "",
});
//
const formRef = ref(null);
//
function open(data) {
Object.assign(form.value, data || {});
visible.value = true;
}
//
function close() {
visible.value = false;
emit("cancel");
}
//
function submit() {
formRef.value.validate((valid) => {
if (valid) {
emit("submit", form.value);
close();
}
});
}
//
defineExpose({
open,
});
</script>
<style scoped>
.dialog-footer {
text-align: right;
}
</style>

589
src/views/system/enterprises/index.vue

@ -1,589 +0,0 @@
<template>
<div class="app-container">
<!-- <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="所属部门ID" prop="departmentId">
<el-input
v-model="queryParams.departmentId"
placeholder="请输入所属部门ID"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="管辖人员ID" prop="userId">
<el-input
v-model="queryParams.userId"
placeholder="请输入管辖人员ID"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="企业所属区域:1.东区、2.西区、3.北区、4.南区" prop="region">
<el-input
v-model="queryParams.region"
placeholder="请输入企业所属区域:1.东区、2.西区、3.北区、4.南区"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="企业名称" prop="enterprisesName">
<el-input
v-model="queryParams.enterprisesName"
placeholder="请输入企业名称"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="企业环保负责人姓名" prop="environmentalContactName">
<el-input
v-model="queryParams.environmentalContactName"
placeholder="请输入企业环保负责人姓名"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="企业环保负责人联系电话" prop="environmentalContactPhone">
<el-input
v-model="queryParams.environmentalContactPhone"
placeholder="请输入企业环保负责人联系电话"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="企业注册号" prop="registrationNumber">
<el-input
v-model="queryParams.registrationNumber"
placeholder="请输入企业注册号"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="企业成立时间" prop="establishmentDate">
<el-date-picker clearable
v-model="queryParams.establishmentDate"
type="date"
value-format="YYYY-MM-DD"
placeholder="请选择企业成立时间">
</el-date-picker>
</el-form-item>
<el-form-item label="创建人" prop="creator">
<el-input
v-model="queryParams.creator"
placeholder="请输入创建人"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="修改人" prop="updater">
<el-input
v-model="queryParams.updater"
placeholder="请输入修改人"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="是否删除" prop="deleted">
<el-input
v-model="queryParams.deleted"
placeholder="请输入是否删除"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form> -->
<el-row
:gutter="10"
class="mb8"
>
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="Plus"
@click="handleAdd"
v-hasPermi="['system:enterprises:add']"
>新增</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="Edit"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:enterprises:edit']"
>修改</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="Delete"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:enterprises:remove']"
>删除</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="Download"
@click="handleExport"
v-hasPermi="['system:enterprises:export']"
>导出</el-button
>
</el-col>
<right-toolbar
v-model:showSearch="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="enterprisesList"
@selection-change="handleSelectionChange"
>
<el-table-column
type="selection"
width="55"
align="center"
/>
<!-- <el-table-column label="企业ID,主键" align="center" prop="id" /> -->
<!-- <el-table-column label="所属部门ID" align="center" prop="departmentId" /> -->
<!-- <el-table-column label="管辖人员ID" align="center" prop="userId" /> -->
<el-table-column
label="企业类型"
align="center"
prop="type"
/>
<el-table-column
label="企业所属区域"
align="center"
prop="region"
/>
<el-table-column
label="企业名称"
align="center"
prop="enterprisesName"
/>
<el-table-column
label="企业地址"
align="center"
prop="address"
/>
<el-table-column
label="企业环保负责人姓名"
align="center"
prop="environmentalContactName"
/>
<el-table-column
label="企业注册号"
align="center"
prop="registrationNumber"
/>
<el-table-column
label="企业图文介绍"
align="center"
prop="introduction"
/>
<el-table-column
label="企业成立时间"
align="center"
prop="establishmentDate"
width="180"
>
<template #default="scope">
<span>{{
parseTime(scope.row.establishmentDate, '{y}-{m}-{d}')
}}</span>
</template>
</el-table-column>
<el-table-column
label="创建人"
align="center"
prop="creator"
/>
<el-table-column
label="修改人"
align="center"
prop="updater"
/>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template #default="scope">
<el-button
link
type="primary"
icon="Edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:enterprises:edit']"
>修改</el-button
>
<el-button
link
type="primary"
icon="Delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:enterprises:remove']"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改企业对话框 -->
<el-dialog
:title="title"
v-model="open"
width="800px"
append-to-body
>
<el-form
ref="enterprisesRef"
:model="form"
:rules="rules"
label-width="150px"
>
<!-- <el-form-item label="所属部门ID" prop="departmentId">
<el-input v-model="form.departmentId" placeholder="请输入所属部门ID" />
</el-form-item>
<el-form-item label="管辖人员ID" prop="userId">
<el-input v-model="form.userId" placeholder="请输入管辖人员ID" />
</el-form-item> -->
<el-form-item
label="企业所属区域"
prop="region"
>
<!-- <el-input v-model="form.region" placeholder="请输入企业所属区域:1.东区、2.西区、3.北区、4.南区" /> -->
<el-select
v-model="form.region"
placeholder="请输入企业所属区域:1.东区、2.西区、3.北区、4.南区"
>
<el-option
v-for="dict in enterprise_type"
:key="dict.value"
:lable="dict.value"
:value="dict.label"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item
label="企业名称"
prop="enterprisesName"
>
<el-input
v-model="form.enterprisesName"
placeholder="请输入企业名称"
/>
</el-form-item>
<el-form-item
label="企业地址"
prop="address"
>
<el-input
v-model="form.address"
type="textarea"
placeholder="请输入内容"
/>
</el-form-item>
<el-form-item
label="企业环保负责人姓名"
prop="environmentalContactName"
>
<el-select
v-model="value"
:empty-values="[null, undefined]"
:value-on-clear="null"
clearable
placeholder="Select"
style="width: 240px"
@clear="handleClear"
>
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item
label="企业注册号"
prop="registrationNumber"
>
<el-input
v-model="form.registrationNumber"
placeholder="请输入企业注册号"
/>
</el-form-item>
<el-form-item
label="企业成立时间"
prop="establishmentDate"
>
<el-date-picker
clearable
v-model="form.establishmentDate"
type="date"
value-format="YYYY-MM-DD"
placeholder="请选择企业成立时间"
>
</el-date-picker>
</el-form-item>
<el-form-item
label="企业图文介绍"
prop="introduction"
>
<el-input
v-model="form.introduction"
type="textarea"
placeholder="请输入内容"
/>
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button
type="primary"
@click="submitForm"
> </el-button
>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup name="Enterprises">
import {
listEnterprises,
getEnterprises,
delEnterprises,
addEnterprises,
updateEnterprises,
} from '@/api/system/enterprises/enterprises'
import { listDeptUser } from '@/api/system/user'
const { proxy } = getCurrentInstance()
const { enterprise_type } = proxy.useDict('enterprise_type')
const enterprisesList = ref([])
const open = ref(false)
const loading = ref(true)
const showSearch = ref(true)
const ids = ref([])
const single = ref(true)
const multiple = ref(true)
const total = ref(0)
const title = ref('')
const data = reactive({
form: {},
queryParams: {
pageNum: 1,
pageSize: 10,
departmentId: null,
userId: null,
type: null,
region: null,
enterprisesName: null,
address: null,
environmentalContactName: null,
environmentalContactPhone: null,
registrationNumber: null,
introduction: null,
establishmentDate: null,
creator: null,
updater: null,
deleted: null,
},
rules: {
type: [
{ required: true, message: '企业类型', trigger: 'change' },
],
region: [
{ required: true, message: '企业所属区域', trigger: 'blur' },
],
enterprisesName: [
{
required: true,
message: '企业名称不能为空',
trigger: 'blur',
},
],
createTime: [
{
required: true,
message: '创建时间不能为空',
trigger: 'blur',
},
],
updateTime: [
{
required: true,
message: '更新时间不能为空',
trigger: 'blur',
},
],
},
})
const { queryParams, form, rules } = toRefs(data)
/** 查询企业列表 */
function getList() {
loading.value = true
listEnterprises(queryParams.value).then(response => {
enterprisesList.value = response.rows
total.value = response.total
loading.value = false
})
}
//
function cancel() {
open.value = false
reset()
}
//
function reset() {
form.value = {
id: null,
departmentId: null,
userId: null,
type: null,
region: null,
enterprisesName: null,
address: null,
environmentalContactName: null,
environmentalContactPhone: null,
registrationNumber: null,
introduction: null,
establishmentDate: null,
creator: null,
createTime: null,
updateTime: null,
updater: null,
deleted: null,
}
proxy.resetForm('enterprisesRef')
}
/** 搜索按钮操作 */
function handleQuery() {
queryParams.value.pageNum = 1
getList()
}
/** 重置按钮操作 */
function resetQuery() {
proxy.resetForm('queryRef')
handleQuery()
}
//
function handleSelectionChange(selection) {
ids.value = selection.map(item => item.id)
single.value = selection.length != 1
multiple.value = !selection.length
}
/** 新增按钮操作 */
function handleAdd() {
reset()
userList()
open.value = true
title.value = '添加企业'
}
/** 修改按钮操作 */
function handleUpdate(row) {
reset()
const _id = row.id || ids.value
getEnterprises(_id).then(response => {
form.value = response.data
open.value = true
title.value = '修改企业'
})
}
/** 提交按钮 */
function submitForm() {
proxy.$refs['enterprisesRef'].validate(valid => {
if (valid) {
if (form.value.id != null) {
updateEnterprises(form.value).then(response => {
proxy.$modal.msgSuccess('修改成功')
open.value = false
getList()
})
} else {
addEnterprises(form.value).then(response => {
proxy.$modal.msgSuccess('新增成功')
open.value = false
getList()
})
}
}
})
}
/** 删除按钮操作 */
function handleDelete(row) {
const _ids = row.id || ids.value
proxy.$modal
.confirm('是否确认删除企业编号为"' + _ids + '"的数据项?')
.then(function () {
return delEnterprises(_ids)
})
.then(() => {
getList()
proxy.$modal.msgSuccess('删除成功')
})
.catch(() => {})
}
/** 导出按钮操作 */
function handleExport() {
proxy.download(
'system/enterprises/export',
{
...queryParams.value,
},
`enterprises_${new Date().getTime()}.xlsx`
)
}
function userList() {
listDeptUser().then(res => {
// enterprisesList.value = response.rows;
// total.value = response.total;
// loading.value = false;
console.log('res', res)
})
}
getList()
</script>

424
src/views/system/notice/index.vue

@ -1,168 +1,242 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch">
<el-form-item label="公告标题" prop="noticeTitle">
<el-input
v-model="queryParams.noticeTitle"
placeholder="请输入公告标题"
clearable
style="width: 200px"
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="操作人员" prop="createBy">
<el-input
v-model="queryParams.createBy"
placeholder="请输入操作人员"
clearable
style="width: 200px"
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="类型" prop="noticeType">
<el-select v-model="queryParams.noticeType" placeholder="公告类型" clearable style="width: 200px">
<el-option
<div class="app-container">
<el-form
:model="queryParams"
ref="queryRef"
:inline="true"
v-show="showSearch"
>
<el-form-item label="公告标题" prop="noticeTitle">
<el-input
v-model="queryParams.noticeTitle"
placeholder="请输入公告标题"
clearable
style="width: 200px"
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="操作人员" prop="createBy">
<el-input
v-model="queryParams.createBy"
placeholder="请输入操作人员"
clearable
style="width: 200px"
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="类型" prop="noticeType">
<el-select
v-model="queryParams.noticeType"
placeholder="公告类型"
clearable
style="width: 200px"
>
<el-option
v-for="dict in sys_notice_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery"
>搜索</el-button
>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="Plus"
@click="handleAdd"
v-hasPermi="['system:notice:add']"
>新增</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="Edit"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:notice:edit']"
>修改</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="Delete"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:notice:remove']"
>删除</el-button
>
</el-col>
<right-toolbar
v-model:showSearch="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="noticeList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column
label="序号"
align="center"
prop="noticeId"
width="100"
/>
<el-table-column
label="公告标题"
align="center"
prop="noticeTitle"
:show-overflow-tooltip="true"
/>
<el-table-column
label="公告类型"
align="center"
prop="noticeType"
width="100"
>
<template #default="scope">
<dict-tag :options="sys_notice_type" :value="scope.row.noticeType" />
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="status" width="100">
<template #default="scope">
<dict-tag :options="sys_notice_status" :value="scope.row.status" />
</template>
</el-table-column>
<el-table-column
label="创建者"
align="center"
prop="createBy"
width="100"
/>
<el-table-column
label="创建时间"
align="center"
prop="createTime"
width="100"
>
<template #default="scope">
<span>{{ parseTime(scope.row.createTime, "{y}-{m}-{d}") }}</span>
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template #default="scope">
<el-button
link
type="primary"
icon="Edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:notice:edit']"
>修改</el-button
>
<el-button
link
type="primary"
icon="Delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:notice:remove']"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改公告对话框 -->
<el-dialog :title="title" v-model="open" width="780px" append-to-body>
<el-form ref="noticeRef" :model="form" :rules="rules" label-width="80px">
<el-row>
<el-col :span="12">
<el-form-item label="公告标题" prop="noticeTitle">
<el-input
v-model="form.noticeTitle"
placeholder="请输入公告标题"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="公告类型" prop="noticeType">
<el-select v-model="form.noticeType" placeholder="请选择">
<el-option
v-for="dict in sys_notice_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item>
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="状态">
<el-radio-group v-model="form.status">
<el-radio
v-for="dict in sys_notice_status"
:key="dict.value"
:value="dict.value"
>
{{ dict.label }}
</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="内容">
<editor v-model="form.noticeContent" :min-height="192" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="Plus"
@click="handleAdd"
v-hasPermi="['system:notice:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="Edit"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:notice:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="Delete"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:notice:remove']"
>删除</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="noticeList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" align="center" prop="noticeId" width="100" />
<el-table-column
label="公告标题"
align="center"
prop="noticeTitle"
:show-overflow-tooltip="true"
/>
<el-table-column label="公告类型" align="center" prop="noticeType" width="100">
<template #default="scope">
<dict-tag :options="sys_notice_type" :value="scope.row.noticeType" />
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="status" width="100">
<template #default="scope">
<dict-tag :options="sys_notice_status" :value="scope.row.status" />
</template>
</el-table-column>
<el-table-column label="创建者" align="center" prop="createBy" width="100" />
<el-table-column label="创建时间" align="center" prop="createTime" width="100">
<template #default="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:notice:edit']">修改</el-button>
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:notice:remove']" >删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改公告对话框 -->
<el-dialog :title="title" v-model="open" width="780px" append-to-body>
<el-form ref="noticeRef" :model="form" :rules="rules" label-width="80px">
<el-row>
<el-col :span="12">
<el-form-item label="公告标题" prop="noticeTitle">
<el-input v-model="form.noticeTitle" placeholder="请输入公告标题" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="公告类型" prop="noticeType">
<el-select v-model="form.noticeType" placeholder="请选择">
<el-option
v-for="dict in sys_notice_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="状态">
<el-radio-group v-model="form.status">
<el-radio
v-for="dict in sys_notice_status"
:key="dict.value"
:value="dict.value"
>{{ dict.label }}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="内容">
<editor v-model="form.noticeContent" :min-height="192"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
</div>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup name="Notice">
import { listNotice, getNotice, delNotice, addNotice, updateNotice } from "@/api/system/notice";
import {
listNotice,
getNotice,
delNotice,
addNotice,
updateNotice,
} from "@/api/system/notice";
const { proxy } = getCurrentInstance();
const { sys_notice_status, sys_notice_type } = proxy.useDict("sys_notice_status", "sys_notice_type");
const { sys_notice_status, sys_notice_type } = proxy.useDict(
"sys_notice_status",
"sys_notice_type",
);
const noticeList = ref([]);
const open = ref(false);
@ -181,11 +255,15 @@ const data = reactive({
pageSize: 10,
noticeTitle: undefined,
createBy: undefined,
status: undefined
status: undefined,
},
rules: {
noticeTitle: [{ required: true, message: "公告标题不能为空", trigger: "blur" }],
noticeType: [{ required: true, message: "公告类型不能为空", trigger: "change" }]
noticeTitle: [
{ required: true, message: "公告标题不能为空", trigger: "blur" },
],
noticeType: [
{ required: true, message: "公告类型不能为空", trigger: "change" },
],
},
});
@ -194,7 +272,7 @@ const { queryParams, form, rules } = toRefs(data);
/** 查询公告列表 */
function getList() {
loading.value = true;
listNotice(queryParams.value).then(response => {
listNotice(queryParams.value).then((response) => {
noticeList.value = response.rows;
total.value = response.total;
loading.value = false;
@ -214,7 +292,7 @@ function reset() {
noticeTitle: undefined,
noticeType: undefined,
noticeContent: undefined,
status: "0"
status: "0",
};
proxy.resetForm("noticeRef");
}
@ -233,7 +311,7 @@ function resetQuery() {
/** 多选框选中数据 */
function handleSelectionChange(selection) {
ids.value = selection.map(item => item.noticeId);
ids.value = selection.map((item) => item.noticeId);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
@ -249,7 +327,7 @@ function handleAdd() {
function handleUpdate(row) {
reset();
const noticeId = row.noticeId || ids.value;
getNotice(noticeId).then(response => {
getNotice(noticeId).then((response) => {
form.value = response.data;
open.value = true;
title.value = "修改公告";
@ -258,16 +336,16 @@ function handleUpdate(row) {
/** 提交按钮 */
function submitForm() {
proxy.$refs["noticeRef"].validate(valid => {
proxy.$refs["noticeRef"].validate((valid) => {
if (valid) {
if (form.value.noticeId != undefined) {
updateNotice(form.value).then(response => {
updateNotice(form.value).then((response) => {
proxy.$modal.msgSuccess("修改成功");
open.value = false;
getList();
});
} else {
addNotice(form.value).then(response => {
addNotice(form.value).then((response) => {
proxy.$modal.msgSuccess("新增成功");
open.value = false;
getList();
@ -279,13 +357,17 @@ function submitForm() {
/** 删除按钮操作 */
function handleDelete(row) {
const noticeIds = row.noticeId || ids.value
proxy.$modal.confirm('是否确认删除公告编号为"' + noticeIds + '"的数据项?').then(function() {
return delNotice(noticeIds);
}).then(() => {
getList();
proxy.$modal.msgSuccess("删除成功");
}).catch(() => {});
const noticeIds = row.noticeId || ids.value;
proxy.$modal
.confirm('是否确认删除公告编号为"' + noticeIds + '"的数据项?')
.then(function () {
return delNotice(noticeIds);
})
.then(() => {
getList();
proxy.$modal.msgSuccess("删除成功");
})
.catch(() => {});
}
getList();

43
src/views/system/user/enterprisesDetail.vue

@ -0,0 +1,43 @@
<template>
<el-dialog v-model="show">
<el-descriptions
title="Width vertical list"
direction="vertical"
border
style="margin-top: 20px"
>
<el-descriptions-item
:rowspan="2"
:width="140"
label="Photo"
align="center"
>
<el-image
style="width: 100px; height: 100px"
src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png"
/>
</el-descriptions-item>
<el-descriptions-item label="Username">kooriookami</el-descriptions-item>
<el-descriptions-item label="Telephone">18100000000</el-descriptions-item>
<el-descriptions-item label="Place">Suzhou</el-descriptions-item>
<el-descriptions-item label="Remarks">
<el-tag size="small">School</el-tag>
</el-descriptions-item>
<el-descriptions-item label="Address">
No.1188, Wuzhong Avenue, Wuzhong District, Suzhou, Jiangsu Province
</el-descriptions-item>
</el-descriptions>
</el-dialog>
</template>
<script setup>
const show = ref(false);
function open(id) {
show.value = true;
}
defineExpose({ open });
</script>
<style scoped lang="scss"></style>

197
src/views/system/user/examine.vue

@ -0,0 +1,197 @@
<template>
<section class="app-container">
<el-form
:model="queryParams"
ref="queryRef"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="用户名称" prop="userName">
<el-input
v-model="queryParams.userName"
placeholder="请输入用户名称"
clearable
style="width: 240px"
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="创建时间" style="width: 308px">
<el-date-picker
v-model="dateRange"
value-format="YYYY-MM-DD"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
/>
</el-form-item>
<el-form-item label="审批状态" style="width: 308px">
<el-select placeholder="请选择审批状态" v-model="queryParams.audit">
<el-option
v-for="dict in user_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">
搜索
</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<right-toolbar
v-model:showSearch="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="userList"
@selection-change="handleSelectionChange"
>
<el-table-column
label="姓名"
align="center"
key="realName"
prop="realName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="手机号码"
align="center"
key="phonenumber"
prop="phonenumber"
/>
<el-table-column align="center" key="audit" prop="audit" label="申请角色">
<template #default="scope">
<DictTag :options="user_type" :value="scope.row.userType" />
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime">
<template #default="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="审批状态" align="center" key="audit" prop="audit">
<template #default="scope">
<dict-tag :options="user_status" :value="scope.row.audit" />
</template>
</el-table-column>
<el-table-column
label="审批内容"
align="center"
key="content"
prop="content"
/>
<el-table-column
label="操作"
align="center"
width="250"
class-name="small-padding fixed-width"
>
<template #default="scope">
<el-button
link
type="primary"
v-if="scope.row.userType === '01'"
@click="showDetail"
>
<el-icon style="margin-right: 5px"><OfficeBuilding /></el-icon>
公司信息
</el-button>
<el-button
link
type="danger"
@click="examine(scope.row)"
v-if="scope.row.audit == 1"
>
<el-icon style="margin-right: 5px"><Stamp /></el-icon>
审核
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
</section>
<ExamineForm ref="examineFormRef" @success="handleQuery" />
<EnterprisesDetail ref="enterprisesDetailRef" />
</template>
<script setup>
import { getExamieList } from "@/api/system/user.js";
import ExamineForm from "./examineform.vue";
import EnterprisesDetail from "./enterprisesDetail.vue";
const userList = ref([]);
const loading = ref(true);
const total = ref(0);
const { proxy } = getCurrentInstance();
const { user_status, user_type } = proxy.useDict("user_status", "user_type");
const examineFormRef = ref();
const enterprisesDetailRef = ref();
const data = reactive({
queryParams: {
pageNum: 1,
pageSize: 10,
deptId: undefined,
},
});
const { queryParams } = toRefs(data);
const dateRange = ref([]);
const showSearch = ref(true);
/** 查询用户列表 */
function getList() {
loading.value = true;
getExamieList(proxy.addDateRange(queryParams.value, dateRange.value)).then(
(res) => {
loading.value = false;
userList.value = res.rows;
total.value = res.total;
},
);
}
/** 搜索按钮操作 */
function handleQuery() {
queryParams.value.pageNum = 1;
getList();
}
/** 重置按钮操作 */
function resetQuery() {
dateRange.value = [];
handleQuery();
}
/**
* 查看企业信息
* @param id
*/
function showDetail(id) {
unref(enterprisesDetailRef).open(id);
}
/**
* 审核用户
*/
function examine(row) {
unref(examineFormRef).open(row);
}
getList();
</script>
<style scoped lang="scss"></style>

58
src/views/system/user/examineform.vue

@ -0,0 +1,58 @@
<template>
<el-dialog
v-model="show"
title="审核用户"
width="400px"
style="margin-top: 15vh"
>
<el-input
v-model="form.content"
type="textarea"
:autosize="{
minRows: 4,
}"
placeholder="请输入审核意见"
/>
<template #footer>
<el-button type="success" @click="submit(2)">
<el-icon style="margin-right: 5px"><Select /></el-icon>
通过
</el-button>
<el-button type="danger" @click="submit(3)">
<el-icon style="margin-right: 5px"><Close /></el-icon>
不通过
</el-button>
</template>
</el-dialog>
</template>
<script setup>
import { examineUser } from "@/api/system/user.js";
const { proxy } = getCurrentInstance();
const emits = defineEmits(["success"]);
const show = ref(false);
const form = ref({
content: "",
userId: undefined,
audit: undefined,
});
function open(param) {
form.value.userId = param.userId;
show.value = true;
}
function submit(type) {
form.value.audit = type;
examineUser(form.value).then((res) => {
proxy.$modal.msgSuccess("审批成功");
emits("success");
show.value = false;
});
}
defineExpose({ open });
</script>
<style scoped lang="scss"></style>

645
src/views/system/user/index.vue

@ -1,69 +1,209 @@
<template>
<div class="app-container">
<el-row :gutter="20">
<splitpanes :horizontal="appStore.device === 'mobile'" class="default-theme">
<splitpanes
:horizontal="appStore.device === 'mobile'"
class="default-theme"
>
<!--部门数据-->
<pane size="16">
<el-col>
<div class="head-container">
<el-input v-model="deptName" placeholder="请输入部门名称" clearable prefix-icon="Search" style="margin-bottom: 20px" />
<el-input
v-model="deptName"
placeholder="请输入部门名称"
clearable
prefix-icon="Search"
style="margin-bottom: 20px"
/>
</div>
<div class="head-container">
<el-tree :data="deptOptions" :props="{ label: 'label', children: 'children' }" :expand-on-click-node="false" :filter-node-method="filterNode" ref="deptTreeRef" node-key="id" highlight-current default-expand-all @node-click="handleNodeClick" />
<el-tree
:data="deptOptions"
:props="{ label: 'label', children: 'children' }"
:expand-on-click-node="false"
:filter-node-method="filterNode"
ref="deptTreeRef"
node-key="id"
highlight-current
default-expand-all
@node-click="handleNodeClick"
/>
</div>
</el-col>
</pane>
<!--用户数据-->
<pane size="84">
<el-col>
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
<el-form
:model="queryParams"
ref="queryRef"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="用户名称" prop="userName">
<el-input v-model="queryParams.userName" placeholder="请输入用户名称" clearable style="width: 240px" @keyup.enter="handleQuery" />
<el-input
v-model="queryParams.userName"
placeholder="请输入用户名称"
clearable
style="width: 240px"
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="手机号码" prop="phonenumber">
<el-input v-model="queryParams.phonenumber" placeholder="请输入手机号码" clearable style="width: 240px" @keyup.enter="handleQuery" />
<el-input
v-model="queryParams.phonenumber"
placeholder="请输入手机号码"
clearable
style="width: 240px"
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" placeholder="用户状态" clearable style="width: 240px">
<el-option v-for="dict in sys_normal_disable" :key="dict.value" :label="dict.label" :value="dict.value" />
<el-select
v-model="queryParams.status"
placeholder="用户状态"
clearable
style="width: 240px"
>
<el-option
v-for="dict in sys_normal_disable"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="创建时间" style="width: 308px">
<el-date-picker v-model="dateRange" value-format="YYYY-MM-DD" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
<el-date-picker
v-model="dateRange"
value-format="YYYY-MM-DD"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button type="primary" icon="Search" @click="handleQuery"
>搜索</el-button
>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['system:user:add']">新增</el-button>
<el-button
type="primary"
plain
icon="Plus"
@click="handleAdd"
v-hasPermi="['system:user:add']"
>新增</el-button
>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate" v-hasPermi="['system:user:edit']">修改</el-button>
<el-button
type="success"
plain
icon="Edit"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:user:edit']"
>修改</el-button
>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete" v-hasPermi="['system:user:remove']">删除</el-button>
<el-button
type="danger"
plain
icon="Delete"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:user:remove']"
>删除</el-button
>
</el-col>
<el-col :span="1.5">
<el-button type="info" plain icon="Upload" @click="handleImport" v-hasPermi="['system:user:import']">导入</el-button>
<el-button
type="info"
plain
icon="Upload"
@click="handleImport"
v-hasPermi="['system:user:import']"
>导入</el-button
>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['system:user:export']">导出</el-button>
<el-button
type="warning"
plain
icon="Download"
@click="handleExport"
v-hasPermi="['system:user:export']"
>导出</el-button
>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
<right-toolbar
v-model:showSearch="showSearch"
@queryTable="getList"
:columns="columns"
></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
<el-table
v-loading="loading"
:data="userList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="50" align="center" />
<el-table-column label="用户编号" align="center" key="userId" prop="userId" v-if="columns[0].visible" />
<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" width="120" />
<el-table-column label="状态" align="center" key="status" v-if="columns[5].visible">
<el-table-column
label="用户编号"
align="center"
key="userId"
prop="userId"
v-if="columns[0].visible"
/>
<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"
width="120"
/>
<el-table-column
label="状态"
align="center"
key="status"
v-if="columns[5].visible"
>
<template #default="scope">
<el-switch
v-model="scope.row.status"
@ -73,29 +213,86 @@
></el-switch>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" v-if="columns[6].visible" width="160">
<el-table-column
label="创建时间"
align="center"
prop="createTime"
v-if="columns[6].visible"
width="160"
>
<template #default="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="150" class-name="small-padding fixed-width">
<el-table-column
label="操作"
align="center"
width="150"
class-name="small-padding fixed-width"
>
<template #default="scope">
<el-tooltip content="修改" placement="top" v-if="scope.row.userId !== 1">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:user:edit']"></el-button>
<el-tooltip
content="修改"
placement="top"
v-if="scope.row.userId !== 1"
>
<el-button
link
type="primary"
icon="Edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:user:edit']"
></el-button>
</el-tooltip>
<el-tooltip content="删除" placement="top" v-if="scope.row.userId !== 1">
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:user:remove']"></el-button>
<el-tooltip
content="删除"
placement="top"
v-if="scope.row.userId !== 1"
>
<el-button
link
type="primary"
icon="Delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:user:remove']"
></el-button>
</el-tooltip>
<el-tooltip content="重置密码" placement="top" v-if="scope.row.userId !== 1">
<el-button link type="primary" icon="Key" @click="handleResetPwd(scope.row)" v-hasPermi="['system:user:resetPwd']"></el-button>
<el-tooltip
content="重置密码"
placement="top"
v-if="scope.row.userId !== 1"
>
<el-button
link
type="primary"
icon="Key"
@click="handleResetPwd(scope.row)"
v-hasPermi="['system:user:resetPwd']"
></el-button>
</el-tooltip>
<el-tooltip content="分配角色" placement="top" v-if="scope.row.userId !== 1">
<el-button link type="primary" icon="CircleCheck" @click="handleAuthRole(scope.row)" v-hasPermi="['system:user:edit']"></el-button>
<el-tooltip
content="分配角色"
placement="top"
v-if="scope.row.userId !== 1"
>
<el-button
link
type="primary"
icon="CircleCheck"
@click="handleAuthRole(scope.row)"
v-hasPermi="['system:user:edit']"
></el-button>
</el-tooltip>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
<pagination
v-show="total > 0"
:total="total"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
</el-col>
</pane>
</splitpanes>
@ -107,36 +304,73 @@
<el-row>
<el-col :span="12">
<el-form-item label="用户昵称" prop="nickName">
<el-input v-model="form.nickName" placeholder="请输入用户昵称" maxlength="30" />
<el-input
v-model="form.nickName"
placeholder="请输入用户昵称"
maxlength="30"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="归属部门" prop="deptId">
<el-tree-select v-model="form.deptId" :data="enabledDeptOptions" :props="{ value: 'id', label: 'label', children: 'children' }" value-key="id" placeholder="请选择归属部门" check-strictly />
<el-tree-select
v-model="form.deptId"
:data="enabledDeptOptions"
:props="{ value: 'id', label: 'label', children: 'children' }"
value-key="id"
placeholder="请选择归属部门"
check-strictly
/>
</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-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-input
v-model="form.email"
placeholder="请输入邮箱"
maxlength="50"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item v-if="form.userId == undefined" label="用户名称" prop="userName">
<el-input v-model="form.userName" placeholder="请输入用户名称" maxlength="30" />
<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-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
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>
@ -144,14 +378,24 @@
<el-col :span="12">
<el-form-item label="用户性别">
<el-select v-model="form.sex" placeholder="请选择">
<el-option v-for="dict in sys_user_sex" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
<el-option
v-for="dict in 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-form-item label="状态">
<el-radio-group v-model="form.status">
<el-radio v-for="dict in sys_normal_disable" :key="dict.value" :value="dict.value">{{ dict.label }}</el-radio>
<el-radio
v-for="dict in sys_normal_disable"
:key="dict.value"
:value="dict.value"
>{{ dict.label }}</el-radio
>
</el-radio-group>
</el-form-item>
</el-col>
@ -160,21 +404,38 @@
<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-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-form-item label="角色">
<el-select v-model="form.roleIds" multiple placeholder="请选择">
<el-option v-for="item in roleOptions" :key="item.roleId" :label="item.roleName" :value="item.roleId" :disabled="item.status == 1"></el-option>
<el-option
v-for="item in roleOptions"
:key="item.roleId"
:label="item.roleName"
:value="item.roleId"
:disabled="item.status == 1"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="用户类型">
<el-select v-model="form.userType" placeholder="请选择用户类型">
<el-option v-for="item in user_type" :key="item.value" :label="item.label" :value="item.value" ></el-option>
<el-option
v-for="item in user_type"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
@ -182,7 +443,11 @@
<el-row>
<el-col :span="24">
<el-form-item label="备注">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>
<el-input
v-model="form.remark"
type="textarea"
placeholder="请输入内容"
></el-input>
</el-form-item>
</el-col>
</el-row>
@ -196,17 +461,41 @@
</el-dialog>
<!-- 用户导入对话框 -->
<el-dialog :title="upload.title" v-model="upload.open" width="400px" append-to-body>
<el-upload ref="uploadRef" :limit="1" accept=".xlsx, .xls" :headers="upload.headers" :action="upload.url + '?updateSupport=' + upload.updateSupport" :disabled="upload.isUploading" :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
<el-dialog
:title="upload.title"
v-model="upload.open"
width="400px"
append-to-body
>
<el-upload
ref="uploadRef"
:limit="1"
accept=".xlsx, .xls"
:headers="upload.headers"
:action="upload.url + '?updateSupport=' + upload.updateSupport"
:disabled="upload.isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
:auto-upload="false"
drag
>
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<template #tip>
<div class="el-upload__tip text-center">
<div class="el-upload__tip">
<el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据
<el-checkbox
v-model="upload.updateSupport"
/>
</div>
<span>仅允许导入xlsxlsx格式文件</span>
<el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline" @click="importTemplate">下载模板</el-link>
<el-link
type="primary"
:underline="false"
style="font-size: 12px; vertical-align: baseline"
@click="importTemplate"
>下载模板</el-link
>
</div>
</template>
</el-upload>
@ -222,15 +511,29 @@
<script setup name="User">
import { getToken } from "@/utils/auth";
import useAppStore from '@/store/modules/app'
import { changeUserStatus, listUser, resetUserPwd, delUser, getUser, updateUser, addUser, deptTreeSelect } from "@/api/system/user";
import { Splitpanes, Pane } from "splitpanes"
import "splitpanes/dist/splitpanes.css"
import useAppStore from "@/store/modules/app";
import {
changeUserStatus,
listUser,
resetUserPwd,
delUser,
getUser,
updateUser,
addUser,
deptTreeSelect,
} from "@/api/system/user";
import { Splitpanes, Pane } from "splitpanes";
import "splitpanes/dist/splitpanes.css";
import DictTag from "@/components/DictTag/index.vue";
const router = useRouter();
const appStore = useAppStore()
const appStore = useAppStore();
const { proxy } = getCurrentInstance();
const { sys_normal_disable, sys_user_sex, user_type } = proxy.useDict("sys_normal_disable", "sys_user_sex", "user_type");
const { sys_normal_disable, sys_user_sex, user_type } = proxy.useDict(
"sys_normal_disable",
"sys_user_sex",
"user_type",
);
const userList = ref([]);
const open = ref(false);
@ -261,7 +564,7 @@ const upload = reactive({
//
headers: { Authorization: "Bearer " + getToken() },
//
url: import.meta.env.VITE_APP_BASE_API + "/system/user/importData"
url: import.meta.env.VITE_APP_BASE_API + "/system/user/importData",
});
//
const columns = ref([
@ -271,7 +574,7 @@ const columns = ref([
{ key: 3, label: `部门`, visible: true },
{ key: 4, label: `手机号码`, visible: true },
{ key: 5, label: `状态`, visible: true },
{ key: 6, label: `创建时间`, visible: true }
{ key: 6, label: `创建时间`, visible: true },
]);
const data = reactive({
@ -279,18 +582,54 @@ const data = reactive({
queryParams: {
pageNum: 1,
pageSize: 10,
userType:'00',
userName: undefined,
phonenumber: undefined,
status: undefined,
deptId: undefined
deptId: undefined,
},
rules: {
userName: [{ required: true, message: "用户名称不能为空", trigger: "blur" }, { min: 2, max: 20, message: "用户名称长度必须介于 2 和 20 之间", trigger: "blur" }],
nickName: [{ required: true, message: "用户昵称不能为空", trigger: "blur" }],
password: [{ required: true, message: "用户密码不能为空", trigger: "blur" }, { min: 5, max: 20, message: "用户密码长度必须介于 5 和 20 之间", trigger: "blur" }, { pattern: /^[^<>"'|\\]+$/, message: "不能包含非法字符:< > \" ' \\\ |", trigger: "blur" }],
email: [{ type: "email", message: "请输入正确的邮箱地址", trigger: ["blur", "change"] }],
phonenumber: [{ pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, message: "请输入正确的手机号码", trigger: "blur" }]
}
userName: [
{ required: true, message: "用户名称不能为空", trigger: "blur" },
{
min: 2,
max: 20,
message: "用户名称长度必须介于 2 和 20 之间",
trigger: "blur",
},
],
nickName: [
{ required: true, message: "用户昵称不能为空", trigger: "blur" },
],
password: [
{ required: true, message: "用户密码不能为空", trigger: "blur" },
{
min: 5,
max: 20,
message: "用户密码长度必须介于 5 和 20 之间",
trigger: "blur",
},
{
pattern: /^[^<>"'|\\]+$/,
message: "不能包含非法字符:< > \" ' \\\ |",
trigger: "blur",
},
],
email: [
{
type: "email",
message: "请输入正确的邮箱地址",
trigger: ["blur", "change"],
},
],
phonenumber: [
{
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
message: "请输入正确的手机号码",
trigger: "blur",
},
],
},
});
const { queryParams, form, rules } = toRefs(data);
@ -302,31 +641,35 @@ const filterNode = (value, data) => {
};
/** 根据名称筛选部门树 */
watch(deptName, val => {
watch(deptName, (val) => {
proxy.$refs["deptTreeRef"].filter(val);
});
/** 查询用户列表 */
function getList() {
loading.value = true;
listUser(proxy.addDateRange(queryParams.value, dateRange.value)).then(res => {
loading.value = false;
userList.value = res.rows;
total.value = res.total;
});
};
listUser(proxy.addDateRange(queryParams.value, dateRange.value)).then(
(res) => {
loading.value = false;
userList.value = res.rows;
total.value = res.total;
},
);
}
/** 查询部门下拉树结构 */
function getDeptTree() {
deptTreeSelect().then(response => {
deptTreeSelect().then((response) => {
deptOptions.value = response.data;
enabledDeptOptions.value = filterDisabledDept(JSON.parse(JSON.stringify(response.data)));
enabledDeptOptions.value = filterDisabledDept(
JSON.parse(JSON.stringify(response.data)),
);
});
};
}
/** 过滤禁用的部门 */
function filterDisabledDept(deptList) {
return deptList.filter(dept => {
return deptList.filter((dept) => {
if (dept.disabled) {
return false;
}
@ -335,19 +678,19 @@ function filterDisabledDept(deptList) {
}
return true;
});
};
}
/** 节点单击事件 */
function handleNodeClick(data) {
queryParams.value.deptId = data.id;
handleQuery();
};
}
/** 搜索按钮操作 */
function handleQuery() {
queryParams.value.pageNum = 1;
getList();
};
}
/** 重置按钮操作 */
function resetQuery() {
@ -356,37 +699,49 @@ function resetQuery() {
queryParams.value.deptId = undefined;
proxy.$refs.deptTreeRef.setCurrentKey(null);
handleQuery();
};
}
/** 删除按钮操作 */
function handleDelete(row) {
const userIds = row.userId || ids.value;
proxy.$modal.confirm('是否确认删除用户编号为"' + userIds + '"的数据项?').then(function () {
return delUser(userIds);
}).then(() => {
getList();
proxy.$modal.msgSuccess("删除成功");
}).catch(() => {});
};
proxy.$modal
.confirm('是否确认删除用户编号为"' + userIds + '"的数据项?')
.then(function () {
return delUser(userIds);
})
.then(() => {
getList();
proxy.$modal.msgSuccess("删除成功");
})
.catch(() => {});
}
/** 导出按钮操作 */
function handleExport() {
proxy.download("system/user/export", {
...queryParams.value,
},`user_${new Date().getTime()}.xlsx`);
};
proxy.download(
"system/user/export",
{
...queryParams.value,
},
`user_${new Date().getTime()}.xlsx`,
);
}
/** 用户状态修改 */
function handleStatusChange(row) {
let text = row.status === "0" ? "启用" : "停用";
proxy.$modal.confirm('确认要"' + text + '""' + row.userName + '"用户吗?').then(function () {
return changeUserStatus(row.userId, row.status);
}).then(() => {
proxy.$modal.msgSuccess(text + "成功");
}).catch(function () {
row.status = row.status === "0" ? "1" : "0";
});
};
proxy.$modal
.confirm('确认要"' + text + '""' + row.userName + '"用户吗?')
.then(function () {
return changeUserStatus(row.userId, row.status);
})
.then(() => {
proxy.$modal.msgSuccess(text + "成功");
})
.catch(function () {
row.status = row.status === "0" ? "1" : "0";
});
}
/** 更多操作 */
function handleCommand(command, row) {
@ -400,52 +755,58 @@ function handleCommand(command, row) {
default:
break;
}
};
}
/** 跳转角色分配 */
function handleAuthRole(row) {
const userId = row.userId;
router.push("/system/user-auth/role/" + userId);
};
}
/** 重置密码按钮操作 */
function handleResetPwd(row) {
proxy.$prompt('请输入"' + row.userName + '"的新密码', "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
closeOnClickModal: false,
inputPattern: /^.{5,20}$/,
inputErrorMessage: "用户密码长度必须介于 5 和 20 之间",
inputValidator: (value) => {
if (/<|>|"|'|\||\\/.test(value)) {
return "不能包含非法字符:< > \" ' \\\ |"
}
},
}).then(({ value }) => {
resetUserPwd(row.userId, value).then(response => {
proxy.$modal.msgSuccess("修改成功,新密码是:" + value);
});
}).catch(() => {});
};
proxy
.$prompt('请输入"' + row.userName + '"的新密码', "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
closeOnClickModal: false,
inputPattern: /^.{5,20}$/,
inputErrorMessage: "用户密码长度必须介于 5 和 20 之间",
inputValidator: (value) => {
if (/<|>|"|'|\||\\/.test(value)) {
return "不能包含非法字符:< > \" ' \\\ |";
}
},
})
.then(({ value }) => {
resetUserPwd(row.userId, value).then((response) => {
proxy.$modal.msgSuccess("修改成功,新密码是:" + value);
});
})
.catch(() => {});
}
/** 选择条数 */
function handleSelectionChange(selection) {
ids.value = selection.map(item => item.userId);
ids.value = selection.map((item) => item.userId);
single.value = selection.length != 1;
multiple.value = !selection.length;
};
}
/** 导入按钮操作 */
function handleImport() {
upload.title = "用户导入";
upload.open = true;
};
}
/** 下载模板操作 */
function importTemplate() {
proxy.download("system/user/importTemplate", {
}, `user_template_${new Date().getTime()}.xlsx`);
};
proxy.download(
"system/user/importTemplate",
{},
`user_template_${new Date().getTime()}.xlsx`,
);
}
/**文件上传中处理 */
const handleFileUploadProgress = (event, file, fileList) => {
@ -457,14 +818,20 @@ const handleFileSuccess = (response, file, fileList) => {
upload.open = false;
upload.isUploading = false;
proxy.$refs["uploadRef"].handleRemove(file);
proxy.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
proxy.$alert(
"<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
response.msg +
"</div>",
"导入结果",
{ dangerouslyUseHTMLString: true },
);
getList();
};
/** 提交上传文件 */
function submitFileForm() {
proxy.$refs["uploadRef"].submit();
};
}
/** 重置操作表单 */
function reset() {
@ -480,34 +847,34 @@ function reset() {
status: "0",
remark: undefined,
postIds: [],
roleIds: []
roleIds: [],
};
proxy.resetForm("userRef");
};
}
/** 取消按钮 */
function cancel() {
open.value = false;
reset();
};
}
/** 新增按钮操作 */
function handleAdd() {
reset();
getUser().then(response => {
getUser().then((response) => {
postOptions.value = response.posts;
roleOptions.value = response.roles;
open.value = true;
title.value = "添加用户";
form.value.password = initPassword.value;
});
};
}
/** 修改按钮操作 */
function handleUpdate(row) {
reset();
const userId = row.userId || ids.value;
getUser(userId).then(response => {
getUser(userId).then((response) => {
form.value = response.data;
postOptions.value = response.posts;
roleOptions.value = response.roles;
@ -517,20 +884,20 @@ function handleUpdate(row) {
title.value = "修改用户";
form.password = "";
});
};
}
/** 提交按钮 */
function submitForm() {
proxy.$refs["userRef"].validate(valid => {
proxy.$refs["userRef"].validate((valid) => {
if (valid) {
if (form.value.userId != undefined) {
updateUser(form.value).then(response => {
updateUser(form.value).then((response) => {
proxy.$modal.msgSuccess("修改成功");
open.value = false;
getList();
});
} else {
addUser(form.value).then(response => {
addUser(form.value).then((response) => {
proxy.$modal.msgSuccess("新增成功");
open.value = false;
getList();
@ -538,7 +905,7 @@ function submitForm() {
}
}
});
};
}
getDeptTree();
getList();

5
src/views/task/index.vue

@ -100,12 +100,12 @@
:show-overflow-tooltip="true"
align="center"
/>
<el-table-column label="执行范围" prop="roleSort" align="center">
<template #default>
<el-link type="primary" @click="selectCompany">共200家</el-link>
</template>
</el-table-column>
<el-table-column label="任务状态" align="center" />
<el-table-column
label="操作"
align="center"
@ -206,6 +206,9 @@ function create() {
unref(taskFormRef).open({ title: "新增任务" });
}
/**
* 选择公司
*/
function selectCompany(){
unref(chooseCompanyRef).open({ title: "选择执行范围" });
}

Loading…
Cancel
Save