9 changed files with 1056 additions and 0 deletions
@ -0,0 +1,44 @@
|
||||
import request from '@/config/axios' |
||||
|
||||
// 企业标签 VO
|
||||
export interface TagLibraryVO { |
||||
id: number // 签的唯一标识,自增主键
|
||||
tagName: string // 标签的名称
|
||||
parentTagId: number // 父标签的ID
|
||||
tagLevel: number // 标签层级(一级、二级、三级)
|
||||
tagType: number // 1、企业标签2、执法标签
|
||||
sort: number |
||||
} |
||||
|
||||
// 企业标签 API
|
||||
export const TagLibraryApi = { |
||||
// 查询企业标签分页
|
||||
getTagLibraryPage: async (params: any) => { |
||||
return await request.get({ url: `/system/tag-library/page`, params }) |
||||
}, |
||||
|
||||
// 查询企业标签详情
|
||||
getTagLibrary: async (id: number) => { |
||||
return await request.get({ url: `/system/tag-library/get?id=` + id }) |
||||
}, |
||||
|
||||
// 新增企业标签
|
||||
createTagLibrary: async (data: TagLibraryVO) => { |
||||
return await request.post({ url: `/system/tag-library/create`, data }) |
||||
}, |
||||
|
||||
// 修改企业标签
|
||||
updateTagLibrary: async (data: TagLibraryVO) => { |
||||
return await request.put({ url: `/system/tag-library/update`, data }) |
||||
}, |
||||
|
||||
// 删除企业标签
|
||||
deleteTagLibrary: async (id: number) => { |
||||
return await request.delete({ url: `/system/tag-library/delete?id=` + id }) |
||||
}, |
||||
|
||||
// 导出企业标签 Excel
|
||||
exportTagLibrary: async (params) => { |
||||
return await request.download({ url: `/system/tag-library/export-excel`, params }) |
||||
}, |
||||
} |
@ -0,0 +1,172 @@
|
||||
<template> |
||||
<Dialog :title="dialogTitle" v-model="dialogVisible"> |
||||
<el-form |
||||
ref="formRef" |
||||
:model="formData" |
||||
:rules="formRules" |
||||
label-width="100px" |
||||
v-loading="formLoading" |
||||
> |
||||
|
||||
<el-form-item label="类型" prop="tagType"> |
||||
<el-select v-model="formData.tagType" placeholder="请选择1、企业标签2、执法标签"> |
||||
<el-option |
||||
v-for="dict in getIntDictOptions(DICT_TYPE.TAG_TYPE)" |
||||
:key="dict.value" |
||||
:label="dict.label" |
||||
:value="dict.value" |
||||
/> |
||||
</el-select> |
||||
</el-form-item> |
||||
|
||||
<el-form-item label="父标签的ID" prop="tagName"> |
||||
<el-select |
||||
v-model="formData.parentId" |
||||
placeholder="请选择标签" |
||||
filterable |
||||
clearable |
||||
> |
||||
<!-- 使用递归方法生成多层级选项 --> |
||||
<template v-for="option in list" :key="option.id"> |
||||
<el-option |
||||
:label="option.tagName" |
||||
:value="option.id" |
||||
:style="{ paddingLeft: option.tag_level * 20 + 'px' }" |
||||
> |
||||
{{ option.tagName }} |
||||
</el-option> |
||||
<!-- 如果有子选项,递归渲染 --> |
||||
<template v-for="child in option.children" :key="child.id"> |
||||
<el-option :label="'-- ' + child.tagName" :value="child.id"> |
||||
{{ '-- ' + child.tagName }} |
||||
</el-option> |
||||
</template> |
||||
</template> |
||||
</el-select> |
||||
</el-form-item> |
||||
|
||||
<el-form-item label="标签的名称" prop="tagName"> |
||||
<el-input v-model="formData.tagName" placeholder="请输入标签的名称" /> |
||||
</el-form-item> |
||||
|
||||
|
||||
<el-form-item label="排序" prop="sort"> |
||||
<el-input v-model="formData.sort" placeholder="排序" /> |
||||
</el-form-item> |
||||
|
||||
</el-form> |
||||
<template #footer> |
||||
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button> |
||||
<el-button @click="dialogVisible = false">取 消</el-button> |
||||
</template> |
||||
</Dialog> |
||||
</template> |
||||
<script setup lang="ts"> |
||||
import { TagLibraryApi, TagLibraryVO } from '@/api/system/taglibrary' |
||||
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict' |
||||
|
||||
|
||||
/** 企业标签 表单 */ |
||||
defineOptions({ name: 'TagLibraryForm' }) |
||||
|
||||
const { t } = useI18n() // 国际化 |
||||
const message = useMessage() // 消息弹窗 |
||||
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示 |
||||
const dialogTitle = ref('') // 弹窗的标题 |
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用 |
||||
const formType = ref('') // 表单的类型:create - 新增;update - 修改 |
||||
const formData = ref({ |
||||
tagId: undefined, |
||||
tagName: undefined, |
||||
parentId: undefined, |
||||
tagLevel: undefined, |
||||
tagType: undefined, |
||||
sort: undefined |
||||
}) |
||||
const formRules = reactive({ |
||||
tagName: [{ required: true, message: '标签的名称不能为空', trigger: 'blur' }], |
||||
tagLevel: [{ required: true, message: '标签层级(一级、二级、三级)不能为空', trigger: 'blur' }], |
||||
}) |
||||
const formRef = ref() // 表单 Ref |
||||
|
||||
|
||||
const queryParams = reactive({ |
||||
pageNo: 1, |
||||
pageSize: 10, |
||||
tagName: undefined, |
||||
parentTagId: undefined, |
||||
tagLevel: undefined, |
||||
tagType: undefined, |
||||
createTime: [], |
||||
}) |
||||
|
||||
/** 打开弹窗 */ |
||||
const open = async (type: string, id?: number) => { |
||||
|
||||
//查询层级 |
||||
levelList() |
||||
|
||||
dialogVisible.value = true |
||||
dialogTitle.value = t('action.' + type) |
||||
formType.value = type |
||||
resetForm() |
||||
// 修改时,设置数据 |
||||
if (id) { |
||||
formLoading.value = true |
||||
try { |
||||
formData.value = await TagLibraryApi.getTagLibrary(id) |
||||
console.log('formData.value=>', formData.value) |
||||
|
||||
} finally { |
||||
formLoading.value = false |
||||
} |
||||
} |
||||
} |
||||
|
||||
const list:any = ref([]) |
||||
|
||||
const levelList =async ()=>{ |
||||
const data = await TagLibraryApi.getTagLibraryPage(queryParams) |
||||
list.value = data |
||||
} |
||||
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗 |
||||
|
||||
/** 提交表单 */ |
||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调 |
||||
const submitForm = async () => { |
||||
// 校验表单 |
||||
await formRef.value.validate() |
||||
// 提交请求 |
||||
formLoading.value = true |
||||
try { |
||||
const data = formData.value as unknown as TagLibraryVO |
||||
if (formType.value === 'create') { |
||||
await TagLibraryApi.createTagLibrary(data) |
||||
message.success(t('common.createSuccess')) |
||||
} else { |
||||
await TagLibraryApi.updateTagLibrary(data) |
||||
message.success(t('common.updateSuccess')) |
||||
} |
||||
dialogVisible.value = false |
||||
// 发送操作成功的事件 |
||||
emit('success') |
||||
} finally { |
||||
formLoading.value = false |
||||
} |
||||
} |
||||
|
||||
/** 重置表单 */ |
||||
const resetForm = () => { |
||||
formData.value = { |
||||
tagId: undefined, |
||||
tagName: undefined, |
||||
parentId: undefined, |
||||
tagLevel: undefined, |
||||
tagType: undefined, |
||||
sort: undefined |
||||
} |
||||
formRef.value?.resetFields() |
||||
} |
||||
</script> |
@ -0,0 +1,186 @@
|
||||
<template> |
||||
<ContentWrap> |
||||
<!-- 搜索工作栏 --> |
||||
<el-form |
||||
class="-mb-15px" |
||||
:model="queryParams" |
||||
ref="queryFormRef" |
||||
:inline="true" |
||||
label-width="68px" |
||||
> |
||||
<el-form-item label="名称" prop="tagName"> |
||||
<el-input |
||||
v-model="queryParams.tagName" |
||||
placeholder="请输入标签的名称" |
||||
clearable |
||||
@keyup.enter="handleQuery" |
||||
class="!w-240px" |
||||
/> |
||||
</el-form-item> |
||||
<el-form-item label="父标签" prop="parentTagId"> |
||||
<el-input |
||||
v-model="queryParams.parentId" |
||||
placeholder="请输入父标签的ID" |
||||
clearable |
||||
@keyup.enter="handleQuery" |
||||
class="!w-240px" |
||||
/> |
||||
</el-form-item> |
||||
<el-form-item label="类型" prop="tagType"> |
||||
<el-select |
||||
v-model="queryParams.tagType" |
||||
placeholder="请选择1、企业标签2、执法标签" |
||||
clearable |
||||
class="!w-240px" |
||||
> |
||||
<el-option label="请选择字典生成" value="" /> |
||||
</el-select> |
||||
</el-form-item> |
||||
<el-form-item> |
||||
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button> |
||||
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button> |
||||
<el-button |
||||
type="primary" |
||||
plain |
||||
@click="openForm('create')" |
||||
> |
||||
<Icon icon="ep:plus" class="mr-5px" /> 新增 |
||||
</el-button> |
||||
<el-button |
||||
type="success" |
||||
plain |
||||
@click="handleExport" |
||||
:loading="exportLoading" |
||||
v-hasPermi="['system:tag-library:export']" |
||||
> |
||||
<Icon icon="ep:download" class="mr-5px" /> 导出 |
||||
</el-button> |
||||
</el-form-item> |
||||
</el-form> |
||||
</ContentWrap> |
||||
|
||||
<!-- 列表 --> |
||||
<ContentWrap> |
||||
<el-tree |
||||
:data="list" |
||||
node-key="id" |
||||
:props="treeProps" |
||||
highlight-current |
||||
default-expand-all |
||||
@node-click="handleNodeClick" |
||||
> |
||||
<template #default="{ node, data }"> |
||||
<span>{{ node.label }}{{ data.tagName }}</span> |
||||
<el-tag size="small" type="info">层级: {{ data.tagLevel }}</el-tag> |
||||
<!-- <el-tag size="small" :type="data.tag_type === 1 ? 'success' : 'warning'"> |
||||
{{ data.tag_type === 1 ? '企业标签' : '执法标签' }} |
||||
</el-tag> --> |
||||
<el-button type="text" @click="openForm('update', data.id)"><el-icon><EditPen /></el-icon></el-button> |
||||
<el-button type="text" @click="handleDelete(data.id)"><el-icon><DeleteFilled /></el-icon></el-button> |
||||
</template> |
||||
</el-tree> |
||||
</ContentWrap> |
||||
|
||||
<!-- 表单弹窗:添加/修改 --> |
||||
<TagLibraryForm ref="formRef" @success="getList" /> |
||||
</template> |
||||
|
||||
<script setup lang="ts"> |
||||
import { dateFormatter } from '@/utils/formatTime' |
||||
import download from '@/utils/download' |
||||
import { TagLibraryApi, TagLibraryVO } from '@/api/system/taglibrary/index' |
||||
import TagLibraryForm from './TagLibraryForm.vue' |
||||
|
||||
/** 企业标签 列表 */ |
||||
defineOptions({ name: 'TagLibrary' }) |
||||
|
||||
const message = useMessage() // 消息弹窗 |
||||
const { t } = useI18n() // 国际化 |
||||
|
||||
const loading = ref(true) // 列表的加载中 |
||||
const list = ref<TagLibraryVO[]>([]) // 列表的数据 |
||||
const total = ref(0) // 列表的总页数 |
||||
const queryParams = reactive({ |
||||
pageNo: 1, |
||||
pageSize: 10, |
||||
tagName: undefined, |
||||
parentId: undefined, |
||||
tagLevel: undefined, |
||||
tagType: undefined, |
||||
createTime: [], |
||||
}) |
||||
const queryFormRef = ref() // 搜索的表单 |
||||
const exportLoading = ref(false) // 导出的加载中 |
||||
|
||||
/** 查询列表 */ |
||||
const getList = async () => { |
||||
loading.value = true |
||||
try { |
||||
const data = await TagLibraryApi.getTagLibraryPage(queryParams) |
||||
list.value = data |
||||
} finally { |
||||
loading.value = false |
||||
} |
||||
} |
||||
|
||||
const treeProps = ref({ |
||||
label: "tag_name", // 标签的显示字段 |
||||
children: "children", // 子节点字段 |
||||
}) |
||||
|
||||
/** 搜索按钮操作 */ |
||||
const handleQuery = () => { |
||||
queryParams.pageNo = 1 |
||||
getList() |
||||
} |
||||
|
||||
/** 重置按钮操作 */ |
||||
const resetQuery = () => { |
||||
queryFormRef.value.resetFields() |
||||
handleQuery() |
||||
} |
||||
|
||||
const handleNodeClick = (node) => { |
||||
console.log("当前点击的标签:", node); |
||||
|
||||
} |
||||
|
||||
/** 添加/修改操作 */ |
||||
const formRef = ref() |
||||
const openForm = (type: string, id?: number) => { |
||||
formRef.value.open(type, id) |
||||
} |
||||
|
||||
/** 删除按钮操作 */ |
||||
const handleDelete = async (id: number) => { |
||||
try { |
||||
// 删除的二次确认 |
||||
await message.delConfirm() |
||||
// 发起删除 |
||||
await TagLibraryApi.deleteTagLibrary(id) |
||||
message.success(t('common.delSuccess')) |
||||
// 刷新列表 |
||||
await getList() |
||||
} catch {} |
||||
} |
||||
|
||||
/** 导出按钮操作 */ |
||||
const handleExport = async () => { |
||||
try { |
||||
// 导出的二次确认 |
||||
await message.exportConfirm() |
||||
// 发起导出 |
||||
exportLoading.value = true |
||||
const data = await TagLibraryApi.exportTagLibrary(queryParams) |
||||
download.excel(data, '企业标签.xls') |
||||
} catch { |
||||
} finally { |
||||
exportLoading.value = false |
||||
} |
||||
} |
||||
|
||||
/** 初始化 **/ |
||||
onMounted(() => { |
||||
getList() |
||||
}) |
||||
</script> |
@ -0,0 +1,118 @@
|
||||
<template> |
||||
<el-dialog :title="title" v-model="show" width="500px" append-to-body> |
||||
<el-form ref="roleRef" :model="form" :rules="rule" label-width="100px"> |
||||
<el-form-item label="任务标题" prop="roleName"> |
||||
<el-input v-model="form.roleName" placeholder="请输入任务标题" /> |
||||
</el-form-item> |
||||
<el-form-item label="任务类型" prop="roleSort"> |
||||
<el-select placeholder="请选择任务类型"> |
||||
<el-option |
||||
v-for="dict in task_type" |
||||
:key="dict.value" |
||||
:label="dict.label" |
||||
:value="dict.value" |
||||
/> |
||||
</el-select> |
||||
</el-form-item> |
||||
<el-form-item label="执行周期"> |
||||
<el-select placeholder="请选择执行周期"> |
||||
<el-option |
||||
v-for="dict in task_period_type" |
||||
:key="dict.value" |
||||
:label="dict.label" |
||||
:value="dict.value" |
||||
/> |
||||
</el-select> |
||||
</el-form-item> |
||||
<el-form-item label="执行日期"> |
||||
<el-date-picker |
||||
type="daterange" |
||||
range-separator="至" |
||||
start-placeholder="请选择开始日期" |
||||
end-placeholder="请选择结束日期" |
||||
/> |
||||
</el-form-item> |
||||
<el-form-item label="任务内容"> |
||||
<el-input |
||||
type="textarea" |
||||
:autosize="{ |
||||
minRows: 2, |
||||
}" |
||||
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> |
||||
</template> |
||||
<script setup> |
||||
const title = ref(""); |
||||
const show = ref(false); |
||||
const form = ref({}); |
||||
const rule = ref({}); |
||||
const { proxy } = getCurrentInstance(); |
||||
|
||||
const { task_period_type, task_type } = proxy.useDict( |
||||
"task_period_type", |
||||
"task_type", |
||||
); |
||||
|
||||
/** 提交按钮 */ |
||||
function submitForm() { |
||||
proxy.$refs["roleRef"].validate((valid) => { |
||||
if (valid) { |
||||
if (form.value.roleId != undefined) { |
||||
form.value.menuIds = getMenuAllCheckedKeys(); |
||||
updateRole(form.value).then((response) => { |
||||
proxy.$modal.msgSuccess("修改成功"); |
||||
open.value = false; |
||||
getList(); |
||||
}); |
||||
} else { |
||||
form.value.menuIds = getMenuAllCheckedKeys(); |
||||
addRole(form.value).then((response) => { |
||||
proxy.$modal.msgSuccess("新增成功"); |
||||
open.value = false; |
||||
getList(); |
||||
}); |
||||
} |
||||
} |
||||
}); |
||||
} |
||||
|
||||
/** 取消按钮 */ |
||||
function cancel() { |
||||
show.value = false; |
||||
reset(); |
||||
} |
||||
|
||||
/** 重置新增的表单以及其他数据 */ |
||||
function reset() { |
||||
form.value = { |
||||
roleId: undefined, |
||||
roleName: undefined, |
||||
roleKey: undefined, |
||||
roleSort: 0, |
||||
status: "0", |
||||
menuIds: [], |
||||
deptIds: [], |
||||
menuCheckStrictly: true, |
||||
deptCheckStrictly: true, |
||||
remark: undefined, |
||||
}; |
||||
proxy.resetForm("roleRef"); |
||||
} |
||||
|
||||
function open(param) { |
||||
title.value = param.title; |
||||
show.value = true; |
||||
} |
||||
|
||||
defineExpose({ open }); |
||||
</script> |
||||
<style scoped lang="scss"></style> |
@ -0,0 +1,217 @@
|
||||
<template> |
||||
<section class="app-container"> |
||||
<el-form |
||||
:model="queryParams" |
||||
ref="queryRef" |
||||
v-show="showSearch" |
||||
:inline="true" |
||||
label-width="auto" |
||||
> |
||||
<el-form-item label="任务标题" prop="roleName"> |
||||
<el-input |
||||
v-model="queryParams.roleName" |
||||
placeholder="请输入角色名称" |
||||
clearable |
||||
style="width: 240px" |
||||
@keyup.enter="handleQuery" |
||||
/> |
||||
</el-form-item> |
||||
<el-form-item label="权限字符" prop="roleKey"> |
||||
<el-input |
||||
v-model="queryParams.roleKey" |
||||
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> |
||||
</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-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="create()" |
||||
>新增</el-button |
||||
> |
||||
</el-col> |
||||
<!-- <el-col :span="1.5">--> |
||||
<!-- <el-button--> |
||||
<!-- type="warning"--> |
||||
<!-- plain--> |
||||
<!-- icon="Download"--> |
||||
<!-- @click="handleExport"--> |
||||
<!-- v-hasPermi="['system:role:export']"--> |
||||
<!-- >导出</el-button--> |
||||
<!-- >--> |
||||
<!-- </el-col>--> |
||||
<right-toolbar |
||||
v-model:showSearch="showSearch" |
||||
@queryTable="getList" |
||||
></right-toolbar> |
||||
</el-row> |
||||
|
||||
<!-- 表格数据 --> |
||||
<el-table v-loading="loading" :data="list"> |
||||
<el-table-column label="任务标题" prop="roleId" align="center" /> |
||||
<el-table-column |
||||
label="执行周期" |
||||
prop="roleName" |
||||
:show-overflow-tooltip="true" |
||||
align="center" |
||||
/> |
||||
<el-table-column |
||||
label="任务类型" |
||||
prop="roleKey" |
||||
:show-overflow-tooltip="true" |
||||
align="center" |
||||
/> |
||||
<el-table-column |
||||
label="进度" |
||||
prop="roleKey" |
||||
: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" |
||||
class-name="small-padding fixed-width" |
||||
> |
||||
<template #default="scope"> |
||||
<el-tooltip content="执行日志" placement="top"> |
||||
<el-button link type="primary" icon="Document"></el-button> |
||||
</el-tooltip> |
||||
<el-tooltip content="修改" placement="top"> |
||||
<el-button link type="primary" icon="Edit"></el-button> |
||||
</el-tooltip> |
||||
<el-tooltip content="删除" placement="top"> |
||||
<el-button link type="primary" icon="Delete"></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" |
||||
/> |
||||
|
||||
<TaskForm ref="taskFormRef" /> |
||||
|
||||
<ChooseCompany ref="chooseCompanyRef"/> |
||||
</section> |
||||
</template> |
||||
|
||||
<script setup> |
||||
import TaskForm from "./form.vue"; |
||||
import ChooseCompany from '@/BusinessCom/ChooseCompany/index.vue' |
||||
|
||||
const { proxy } = getCurrentInstance(); |
||||
const { task_period_type } = proxy.useDict("task_period_type"); |
||||
const chooseCompanyRef=ref() |
||||
const loading = ref(false); |
||||
const showSearch = ref(true); |
||||
const taskFormRef = ref(); |
||||
const data = reactive({ |
||||
form: {}, |
||||
queryParams: { |
||||
pageNum: 1, |
||||
pageSize: 10, |
||||
roleName: undefined, |
||||
roleKey: undefined, |
||||
status: undefined, |
||||
}, |
||||
rules: { |
||||
roleName: [ |
||||
{ required: true, message: "角色名称不能为空", trigger: "blur" }, |
||||
], |
||||
roleKey: [{ required: true, message: "权限字符不能为空", trigger: "blur" }], |
||||
roleSort: [ |
||||
{ required: true, message: "角色顺序不能为空", trigger: "blur" }, |
||||
], |
||||
}, |
||||
}); |
||||
const total = ref(0); |
||||
const { queryParams, form, rules } = toRefs(data); |
||||
const dateRange = ref([]); |
||||
const list = ref([ |
||||
{ |
||||
roleId: 1, |
||||
roleName: "超级管理员", |
||||
roleKey: "admin", |
||||
roleSort: 1, |
||||
roleStatus: "0", |
||||
roleRemark: "超级管理员拥有所有权限", |
||||
}, |
||||
]); |
||||
/** |
||||
* 获取列表 |
||||
*/ |
||||
function getList() {} |
||||
|
||||
/** 重置按钮操作 */ |
||||
function resetQuery() { |
||||
dateRange.value = []; |
||||
proxy.resetForm("queryRef"); |
||||
handleQuery(); |
||||
} |
||||
|
||||
/** 搜索按钮操作 */ |
||||
function handleQuery() { |
||||
queryParams.value.pageNum = 1; |
||||
getList(); |
||||
} |
||||
|
||||
/** |
||||
* 新增任务 |
||||
*/ |
||||
function create() { |
||||
unref(taskFormRef).open({ title: "新增任务" }); |
||||
} |
||||
|
||||
/** |
||||
* 选择公司 |
||||
*/ |
||||
function selectCompany(){ |
||||
unref(chooseCompanyRef).open({ title: "选择执行范围" }); |
||||
} |
||||
</script> |
||||
|
||||
<style scoped lang="scss"></style> |
@ -0,0 +1,44 @@
|
||||
<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> |
@ -0,0 +1,215 @@
|
||||
<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 getIntDictOptions(DICT_TYPE.USER_AUDIT_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"> |
||||
<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="mobile" |
||||
prop="mobile" |
||||
/> |
||||
<el-table-column align="center" key="audit" prop="audit" label="申请角色"> |
||||
<template #default="scope"> |
||||
<dict-tag :type="DICT_TYPE.WX_USER_TYPE" :value="scope.row.userType" /> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column label="创建时间" align="center" prop="createTime"> |
||||
<template #default="scope"> |
||||
<span>{{ scope.row.createTime }}</span> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column label="审批状态" align="center" key="audit" prop="audit"> |
||||
<template #default="scope"> |
||||
<dict-tag :type="DICT_TYPE.USER_AUDIT_TYPE" :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 === 2" |
||||
@click="showDetail(scope.row.id)" |
||||
> |
||||
<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 || scope.row.audit == 3" |
||||
> |
||||
<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 * as UserApi from '@/api/system/user' |
||||
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"); |
||||
|
||||
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict' |
||||
|
||||
const examineFormRef = ref(); |
||||
const enterprisesDetailRef = ref(); |
||||
|
||||
const queryParams = reactive({ |
||||
pageNo: 1, |
||||
pageSize: 10, |
||||
username: undefined, |
||||
mobile: undefined, |
||||
status: undefined, |
||||
deptId: undefined, |
||||
audit: [1,3], |
||||
userType: "1,2", |
||||
createTime: [] |
||||
|
||||
}) |
||||
|
||||
const data = reactive({ |
||||
queryParams: { |
||||
pageNum: 1, |
||||
pageSize: 10, |
||||
deptId: undefined, |
||||
}, |
||||
}); |
||||
// const { queryParams } = toRefs(data); |
||||
const dateRange = ref([]); |
||||
const showSearch = ref(true); |
||||
|
||||
/** 查询用户列表 */ |
||||
|
||||
/** 查询列表 */ |
||||
const getList = async () => { |
||||
loading.value = true |
||||
try { |
||||
const data = await UserApi.getUserPage(queryParams) |
||||
userList.value = data.list |
||||
total.value = data.total |
||||
} finally { |
||||
loading.value = false |
||||
} |
||||
} |
||||
|
||||
/** 搜索按钮操作 */ |
||||
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> |
@ -0,0 +1,59 @@
|
||||
<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 * as UserApi from '@/api/system/user' |
||||
|
||||
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.id; |
||||
show.value = true; |
||||
} |
||||
|
||||
function submit(type) { |
||||
form.value.audit = type; |
||||
|
||||
UserApi.examineUser(form.value).then((res) => { |
||||
proxy.$modal.msgSuccess("审批成功"); |
||||
emits("success"); |
||||
show.value = false; |
||||
}); |
||||
} |
||||
|
||||
defineExpose({ open }); |
||||
</script> |
||||
|
||||
<style scoped lang="scss"></style> |
Loading…
Reference in new issue