律所标准文件页面接口对接、重要日程提示页面接口对接、权限管理页面接口对接
This commit is contained in:
44
src/api/calibration/lawFirmStandardDocuments/index.ts
Normal file
44
src/api/calibration/lawFirmStandardDocuments/index.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
const AUTH_BASE_URL = '/api2'
|
||||
|
||||
/*
|
||||
* 律所标准文件
|
||||
* */
|
||||
|
||||
// 新增律所标准文件
|
||||
export const BusinessLawyerflie = (data: any) => {
|
||||
const formData = new FormData()
|
||||
formData.append('title', data.title)
|
||||
formData.append('file', data.file)
|
||||
formData.append('remark', data.remark)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/Lawyerflie`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 律所标准文件展示
|
||||
export const BusinessLawdisplay = () => {
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/lawdisplay`,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
// 删除律所标准文件
|
||||
export const BusinessLwaDetail = (id: string) => {
|
||||
const formData = new FormData()
|
||||
formData.append('id', id)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/LwaDetail`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
69
src/api/calibration/lmportantScheduleManagement/index.ts
Normal file
69
src/api/calibration/lmportantScheduleManagement/index.ts
Normal file
@@ -0,0 +1,69 @@
|
||||
import request from '@/utils/request'
|
||||
const AUTH_BASE_URL = '/api2'
|
||||
|
||||
/*
|
||||
* 重要日程提示
|
||||
* */
|
||||
|
||||
// 新增重要日程提示
|
||||
export const BusinessSchedule = (data: any) => {
|
||||
const formData = new FormData()
|
||||
formData.append('title', data.title)
|
||||
if (data.tiems && data.tiems.length) {
|
||||
formData.append('tiems', data.tiems[0])
|
||||
formData.append('end_time', data.tiems[1])
|
||||
}
|
||||
formData.append('remark', data.remark)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/schedule`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 日程展示
|
||||
export const BusinessScheduleDetail = (data: any) => {
|
||||
const formData = new FormData()
|
||||
formData.append('page', data.pageNum)
|
||||
formData.append('per_page', data.pageSize)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/ScheduleDetail`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 删除日程
|
||||
export const BusinessDscheduledetail = (id: string) => {
|
||||
const formData = new FormData()
|
||||
formData.append('id', id)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/scheduledetail`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 完成代办
|
||||
export const BusinessHandleSchedule = (data: any) => {
|
||||
const formData = new FormData()
|
||||
formData.append('id', data.id)
|
||||
formData.append('state', data.state)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/handleSchedule`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
73
src/api/calibration/permissionManagement/index.ts
Normal file
73
src/api/calibration/permissionManagement/index.ts
Normal file
@@ -0,0 +1,73 @@
|
||||
import request from '@/utils/request'
|
||||
const AUTH_BASE_URL = '/api2'
|
||||
|
||||
/*
|
||||
* 权限管理
|
||||
* */
|
||||
|
||||
// 新增权限
|
||||
export const BusinessAddRermission = (data: any) => {
|
||||
const formData = new FormData()
|
||||
formData.append('permission_name', data.permission_name)
|
||||
formData.append('permission_logo', data.permission_logo)
|
||||
formData.append('parent', data.parent)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/addRermission`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 编辑权限
|
||||
export const BusinessEditRermission = (data: any) => {
|
||||
const formData = new FormData()
|
||||
formData.append('id', data.id)
|
||||
formData.append('permission_name', data.permission_name)
|
||||
formData.append('permission_logo', data.permission_logo)
|
||||
formData.append('parent', data.parent)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/editRermission`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 权限展示
|
||||
export const BusinessDisplayRermission = () => {
|
||||
// const formData = new FormData()
|
||||
// formData.append('page', data.pageNum)
|
||||
// formData.append('per_page', data.pageSize)
|
||||
// if (data.times && data.times.length) {
|
||||
// formData.append('times', data.times[0])
|
||||
// formData.append('end_time', data.times[1])
|
||||
// }
|
||||
// formData.append('unit', data.unit)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/displayRermission`,
|
||||
method: 'post'
|
||||
// data: formData,
|
||||
// headers: {
|
||||
// 'Content-Type': 'multipart/form-data'
|
||||
// }
|
||||
})
|
||||
}
|
||||
|
||||
// 删除权限
|
||||
export const BusinessDeleteRermission = (id: string) => {
|
||||
const formData = new FormData()
|
||||
formData.append('id', id)
|
||||
return request({
|
||||
url: `${AUTH_BASE_URL}/business/deleteRermission`,
|
||||
method: 'post',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -78,11 +78,19 @@ export const constantRoutes: RouteRecordRaw[] = [
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'role',
|
||||
name: 'PersonnelRole',
|
||||
path: 'department',
|
||||
name: 'Department',
|
||||
component: () => import('@/views/calibration/department/index.vue'),
|
||||
meta: {
|
||||
title: '角色管理'
|
||||
title: '部门管理'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'permissionManagement',
|
||||
name: 'PermissionManagement',
|
||||
component: () => import('@/views/calibration/permissionManagement/index.vue'),
|
||||
meta: {
|
||||
title: '权限管理'
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -325,17 +333,35 @@ export const constantRoutes: RouteRecordRaw[] = [
|
||||
title: '律所标准文件',
|
||||
icon: 'setting'
|
||||
},
|
||||
redirect: '/lawyer-file/index',
|
||||
children: [
|
||||
{
|
||||
path: 'index',
|
||||
name: 'LawyerFileIndex',
|
||||
component: () => import('@/views/lawyer/index.vue'),
|
||||
path: 'lawFirmStandardDocuments',
|
||||
name: 'LawFirmStandardDocuments',
|
||||
component: () => import('@/views/calibration/lawFirmStandardDocuments/index.vue'),
|
||||
meta: {
|
||||
title: '律所标准文件'
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/lmportantSchedule',
|
||||
name: 'LmportantSchedule',
|
||||
component: Layout,
|
||||
meta: {
|
||||
title: '日程管理',
|
||||
icon: 'setting'
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'lmportantScheduleManagement',
|
||||
name: 'LmportantScheduleManagement',
|
||||
component: () => import('@/views/calibration/lmportantScheduleManagement/index.vue'),
|
||||
meta: {
|
||||
title: '日程管理'
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
@@ -0,0 +1,158 @@
|
||||
<template>
|
||||
<div class="pre-registration-form">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
label-width="auto"
|
||||
label-position="top"
|
||||
>
|
||||
<el-form-item label="标题" prop="title">
|
||||
<el-input v-model="formData.title" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="formData.remark" type="textarea" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
<el-form-item label="附件" prop="file">
|
||||
<el-upload
|
||||
class="avatar-uploader"
|
||||
action="#"
|
||||
:auto-upload="false"
|
||||
:show-file-list="false"
|
||||
:on-change="(file) => handleFileSelect(file, 'file')"
|
||||
:before-upload="handleBeforeUpload"
|
||||
>
|
||||
<div v-if="formData.file" class="upload-preview">
|
||||
<span>{{ formData.file.name }}</span>
|
||||
<el-button type="danger" size="small" @click.stop="removeFile('file')">删除</el-button>
|
||||
</div>
|
||||
<el-button v-else size="small" type="primary">点击选择文件</el-button>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { convertFilePathsToObject, isValidJson } from '@/utils/auxiliaryFunction'
|
||||
|
||||
const props = defineProps({
|
||||
newData: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
const formRef = ref()
|
||||
// 表单数据
|
||||
const formData = reactive<any>({
|
||||
title: '',
|
||||
remark: '',
|
||||
file: undefined
|
||||
})
|
||||
|
||||
const formRules = reactive<any>({
|
||||
title: [{ required: true, message: '请输入', trigger: 'blur' }],
|
||||
remark: [{ required: true, message: '请输入', trigger: 'blur' }],
|
||||
file: [{ required: true, message: '请输入', trigger: 'blur' }]
|
||||
})
|
||||
|
||||
function handleFileSelect(file: any, field: string): void {
|
||||
// 将文件对象保存到表单数据中
|
||||
formData[field] = file.raw // file.raw 是实际的 File 对象
|
||||
formRef.value.clearValidate(field)
|
||||
ElMessage.success('文件选择成功')
|
||||
}
|
||||
|
||||
function handleBeforeUpload(file: File): boolean {
|
||||
// 可以在这里添加文件类型和大小的校验
|
||||
const isLt10M = file.size / 1024 / 1024 < 10
|
||||
if (!isLt10M) {
|
||||
ElMessage.error('上传文件大小不能超过 10MB!')
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
function removeFile(field: string): void {
|
||||
formData[field] = undefined
|
||||
ElMessage.success('文件已删除')
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
setFormData(props.newData)
|
||||
})
|
||||
|
||||
function deepCloneByJSON(obj: any) {
|
||||
try {
|
||||
return JSON.parse(JSON.stringify(obj))
|
||||
} catch (error) {
|
||||
console.error('深拷贝失败:', error)
|
||||
return obj
|
||||
}
|
||||
}
|
||||
|
||||
const setFormData = (data: any) => {
|
||||
if (data && Object.keys(data).length > 0) {
|
||||
const data1 = deepCloneByJSON(data)
|
||||
if (data1.file && isValidJson(data1.file)) {
|
||||
data1.file = convertFilePathsToObject(JSON.parse(data1.file))[0]
|
||||
} else {
|
||||
data1.file = undefined
|
||||
}
|
||||
Object.assign(formData, data1)
|
||||
}
|
||||
}
|
||||
|
||||
const getForm = () => {
|
||||
return formData
|
||||
}
|
||||
|
||||
const submit = (): Promise<boolean> => {
|
||||
return new Promise((resolve, reject) => {
|
||||
formRef.value?.validate((valid: boolean) => {
|
||||
if (valid) {
|
||||
resolve(true)
|
||||
} else {
|
||||
ElMessage.error('请完善必填信息')
|
||||
reject(false)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
defineExpose({
|
||||
submit,
|
||||
getForm
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.pre-registration-form {
|
||||
width: 100%;
|
||||
padding-right: 20px;
|
||||
overflow: hidden;
|
||||
overflow-y: auto;
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-track {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-thumb {
|
||||
background: rgba(0, 0, 0, 0.3);
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-thumb:hover {
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
}
|
||||
.section {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 20px;
|
||||
}
|
||||
</style>
|
||||
211
src/views/calibration/lawFirmStandardDocuments/index.vue
Normal file
211
src/views/calibration/lawFirmStandardDocuments/index.vue
Normal file
@@ -0,0 +1,211 @@
|
||||
<template>
|
||||
<div class="performance-list-container">
|
||||
<el-button type="primary" icon="edit" style="margin-bottom: 20px" @click="handleOpenDialog()">
|
||||
新增律所文件
|
||||
</el-button>
|
||||
<div v-for="(item, index) in performanceList" :key="index" class="performance-item">
|
||||
<div class="item-content">
|
||||
<h3 class="item-title">{{ item.title }}</h3>
|
||||
<p class="item-description">{{ item.remark }}</p>
|
||||
</div>
|
||||
<div class="item-arrow" @click="onUserDeleteDepartment(item.id)">
|
||||
<el-button type="danger" size="large" link @click="handleItemClick(item)">
|
||||
<el-icon><Delete /></el-icon>
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="item-arrow">
|
||||
<el-link
|
||||
v-if="item.file && isValidJson(item.file)"
|
||||
type="primary"
|
||||
:href="getFileInfo(item.file)?.url"
|
||||
target="_blank"
|
||||
:underline="false"
|
||||
>
|
||||
<el-icon><View /></el-icon>
|
||||
</el-link>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue'
|
||||
import { Delete, View } from '@element-plus/icons-vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import {
|
||||
BusinessLawdisplay,
|
||||
BusinessLawyerflie,
|
||||
BusinessLwaDetail
|
||||
} from '@/api/calibration/lawFirmStandardDocuments/index.js'
|
||||
import { BusinessEditBulletin } from '@/api/calibration/announcementManagement'
|
||||
import { functionDialogBox } from '@/utils/functionDialogBox'
|
||||
import LawFirmStandardsForm from './components/LawFirmStandardsForm.vue'
|
||||
import { getFileInfo, isValidJson } from '@/utils/auxiliaryFunction'
|
||||
|
||||
// 定义列表数据
|
||||
const performanceList = ref([])
|
||||
|
||||
// 获取数据
|
||||
function fetchData() {
|
||||
BusinessLawdisplay()
|
||||
.then((res: any) => {
|
||||
performanceList.value = res.data
|
||||
})
|
||||
.finally(() => {})
|
||||
}
|
||||
|
||||
// 重置查询
|
||||
function handleResetQuery() {
|
||||
fetchData()
|
||||
}
|
||||
|
||||
// 打开弹窗
|
||||
function handleOpenDialog(data?: any) {
|
||||
if (data?.id) {
|
||||
functionDialogBox(
|
||||
LawFirmStandardsForm,
|
||||
{
|
||||
newData: data
|
||||
},
|
||||
{
|
||||
title: '编辑律所标准文件',
|
||||
width: '900',
|
||||
ok(value: any) {
|
||||
handleSubmit({ ...value, id: data?.id })
|
||||
}
|
||||
}
|
||||
)
|
||||
} else {
|
||||
functionDialogBox(
|
||||
LawFirmStandardsForm,
|
||||
{},
|
||||
{
|
||||
title: '新增律所标准文件',
|
||||
width: '900',
|
||||
ok(value: any) {
|
||||
handleSubmit(value)
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// 提交表单
|
||||
function handleSubmit(data: any) {
|
||||
const roleId = data.id
|
||||
if (roleId) {
|
||||
BusinessEditBulletin(data)
|
||||
.then(() => {
|
||||
ElMessage.success('修改成功')
|
||||
handleResetQuery()
|
||||
})
|
||||
.finally(() => ({}))
|
||||
} else {
|
||||
BusinessLawyerflie(data)
|
||||
.then(() => {
|
||||
ElMessage.success('新增成功')
|
||||
handleResetQuery()
|
||||
})
|
||||
.finally(() => ({}))
|
||||
}
|
||||
}
|
||||
|
||||
const onUserDeleteDepartment = (id: string) => {
|
||||
ElMessageBox.confirm('确认删除已选中的数据项?', '警告', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(
|
||||
() => {
|
||||
loading.value = true
|
||||
BusinessLwaDetail(id)
|
||||
.then(() => {
|
||||
ElMessage.success('删除成功')
|
||||
handleResetQuery()
|
||||
})
|
||||
.finally(() => (loading.value = false))
|
||||
},
|
||||
() => {
|
||||
ElMessage.info('已取消删除')
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
// 点击事件处理
|
||||
function handleItemClick(item) {
|
||||
ElMessage.info(`您点击了:${item.title}`)
|
||||
|
||||
// 这里可以添加跳转或其他逻辑
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
fetchData()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.performance-list-container {
|
||||
width: 100%;
|
||||
padding: 20px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.performance-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 120px;
|
||||
width: 100%;
|
||||
padding: 15px;
|
||||
margin-bottom: 15px;
|
||||
border: 1px solid #e0e0e0;
|
||||
border-radius: 8px;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
box-sizing: border-box;
|
||||
background-color: #fff;
|
||||
|
||||
&:hover {
|
||||
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
|
||||
border-color: #409eff;
|
||||
}
|
||||
|
||||
.item-header {
|
||||
flex-shrink: 0;
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
.item-image {
|
||||
width: 90px;
|
||||
height: 90px;
|
||||
object-fit: cover;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.item-content {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.item-title {
|
||||
margin: 0 0 8px 0;
|
||||
font-size: 18px;
|
||||
font-weight: 500;
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
.item-description {
|
||||
margin: 0;
|
||||
font-size: 14px;
|
||||
color: #909399;
|
||||
line-height: 1.5;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
}
|
||||
}
|
||||
.item-arrow {
|
||||
margin-right: 20px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,131 @@
|
||||
<template>
|
||||
<div class="pre-registration-form">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
label-width="auto"
|
||||
label-position="top"
|
||||
>
|
||||
<el-form-item label="标题" prop="title">
|
||||
<el-input v-model="formData.title" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
<el-form-item label="内容" prop="remark">
|
||||
<el-input v-model="formData.remark" type="textarea" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="tiems">
|
||||
<el-date-picker
|
||||
v-model="formData.tiems"
|
||||
type="daterange"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="请选择"
|
||||
range-separator="至"
|
||||
start-placeholder="开始时间"
|
||||
end-placeholder="结束时间"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { convertFilePathsToObject, isValidJson } from '@/utils/auxiliaryFunction'
|
||||
|
||||
const props = defineProps({
|
||||
newData: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
const formRef = ref()
|
||||
// 表单数据
|
||||
const formData = reactive<any>({
|
||||
title: '',
|
||||
remark: '',
|
||||
tiems: []
|
||||
})
|
||||
|
||||
const formRules = reactive<any>({
|
||||
title: [{ required: true, message: '请输入', trigger: 'blur' }],
|
||||
remark: [{ required: true, message: '请输入', trigger: 'blur' }],
|
||||
tiems: [{ required: true, message: '请选择', trigger: 'blur' }]
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
setFormData(props.newData)
|
||||
})
|
||||
|
||||
function deepCloneByJSON(obj: any) {
|
||||
try {
|
||||
return JSON.parse(JSON.stringify(obj))
|
||||
} catch (error) {
|
||||
console.error('深拷贝失败:', error)
|
||||
return obj
|
||||
}
|
||||
}
|
||||
|
||||
const setFormData = (data: any) => {
|
||||
if (data && Object.keys(data).length > 0) {
|
||||
const data1 = deepCloneByJSON(data)
|
||||
if (data1.file && isValidJson(data1.file)) {
|
||||
data1.file = convertFilePathsToObject(JSON.parse(data1.file))[0]
|
||||
} else {
|
||||
data1.file = undefined
|
||||
}
|
||||
Object.assign(formData, data1)
|
||||
}
|
||||
}
|
||||
|
||||
const getForm = () => {
|
||||
return formData
|
||||
}
|
||||
|
||||
const submit = (): Promise<boolean> => {
|
||||
return new Promise((resolve, reject) => {
|
||||
formRef.value?.validate((valid: boolean) => {
|
||||
if (valid) {
|
||||
resolve(true)
|
||||
} else {
|
||||
ElMessage.error('请完善必填信息')
|
||||
reject(false)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
defineExpose({
|
||||
submit,
|
||||
getForm
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.pre-registration-form {
|
||||
width: 100%;
|
||||
padding-right: 20px;
|
||||
overflow: hidden;
|
||||
overflow-y: auto;
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-track {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-thumb {
|
||||
background: rgba(0, 0, 0, 0.3);
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-thumb:hover {
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
}
|
||||
.section {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 20px;
|
||||
}
|
||||
</style>
|
||||
276
src/views/calibration/lmportantScheduleManagement/index.vue
Normal file
276
src/views/calibration/lmportantScheduleManagement/index.vue
Normal file
@@ -0,0 +1,276 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card shadow="hover" class="data-table">
|
||||
<div class="data-table__toolbar">
|
||||
<div class="data-table__toolbar--actions">
|
||||
<el-button type="success" icon="plus" @click="handleOpenDialog()">新增</el-button>
|
||||
<el-button
|
||||
type="danger"
|
||||
:disabled="ids.length === 0"
|
||||
icon="delete"
|
||||
@click="handleDelete()"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<el-table
|
||||
ref="dataTableRef"
|
||||
v-loading="loading"
|
||||
:data="roleList"
|
||||
highlight-current-row
|
||||
border
|
||||
class="data-table__content"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="标题" prop="title" />
|
||||
<el-table-column label="内容" prop="remark" />
|
||||
<el-table-column label="是否完成" prop="state" />
|
||||
<el-table-column label="开始时间" prop="tiems" />
|
||||
<el-table-column label="结束时间" prop="end_time" />
|
||||
<el-table-column fixed="right" label="操作" width="240">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
link
|
||||
icon="edit"
|
||||
@click="CompleteTheSchedule(scope.row)"
|
||||
>
|
||||
完成日程
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
link
|
||||
icon="edit"
|
||||
@click="handleOpenDialog(scope.row)"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
type="danger"
|
||||
size="small"
|
||||
link
|
||||
icon="delete"
|
||||
@click="onUserDeleteDepartment(scope.row.id)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-if="total > 0"
|
||||
v-model:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="fetchData"
|
||||
/>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import RoleAPI, { RolePageVO } from '@/api/system/role-api'
|
||||
import { UserPersonneldisplay } from '@/api/calibration/personnelManagement'
|
||||
import { functionDialogBox } from '@/utils/functionDialogBox'
|
||||
import LmportantScheduleForm from './components/LmportantScheduleForm.vue'
|
||||
import { BusinessEditBulletin } from '@/api/calibration/announcementManagement'
|
||||
import {
|
||||
BusinessDscheduledetail,
|
||||
BusinessHandleSchedule,
|
||||
BusinessSchedule,
|
||||
BusinessScheduleDetail
|
||||
} from '@/api/calibration/lmportantScheduleManagement'
|
||||
|
||||
defineOptions({
|
||||
name: 'Role',
|
||||
inheritAttrs: false
|
||||
})
|
||||
|
||||
const queryFormRef = ref()
|
||||
|
||||
const loading = ref(false)
|
||||
const ids = ref<number[]>([])
|
||||
const total = ref(0)
|
||||
const personinchargeList = ref<any[]>([])
|
||||
|
||||
const queryParams = reactive<any>({
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
// times: [],
|
||||
// unit: ''
|
||||
})
|
||||
|
||||
// 表格数据
|
||||
const roleList = ref<RolePageVO[]>()
|
||||
|
||||
// 弹窗
|
||||
const dialog = reactive({
|
||||
title: '',
|
||||
visible: false
|
||||
})
|
||||
|
||||
// 获取数据
|
||||
function fetchData() {
|
||||
loading.value = true
|
||||
BusinessScheduleDetail(queryParams)
|
||||
.then((res: any) => {
|
||||
roleList.value = res.data
|
||||
total.value = res.total
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
// 查询(重置页码后获取数据)
|
||||
function handleQuery() {
|
||||
queryParams.pageNum = 1
|
||||
fetchData()
|
||||
}
|
||||
|
||||
// 重置查询
|
||||
function handleResetQuery() {
|
||||
if (queryFormRef.value) queryFormRef.value.resetFields()
|
||||
queryParams.pageNum = 1
|
||||
fetchData()
|
||||
}
|
||||
|
||||
// 行复选框选中
|
||||
function handleSelectionChange(selection: any) {
|
||||
ids.value = selection.map((item: any) => item.id)
|
||||
}
|
||||
|
||||
// 打开角色弹窗
|
||||
function handleOpenDialog(data?: any) {
|
||||
dialog.visible = true
|
||||
if (data?.id) {
|
||||
functionDialogBox(
|
||||
LmportantScheduleForm,
|
||||
{
|
||||
newData: data
|
||||
},
|
||||
{
|
||||
title: '编辑日程',
|
||||
width: '900',
|
||||
ok(value: any) {
|
||||
handleSubmit({ ...value, id: data?.id })
|
||||
}
|
||||
}
|
||||
)
|
||||
} else {
|
||||
functionDialogBox(
|
||||
LmportantScheduleForm,
|
||||
{},
|
||||
{
|
||||
title: '新增日程',
|
||||
width: '900',
|
||||
ok(value: any) {
|
||||
handleSubmit(value)
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// 提交角色表单
|
||||
function handleSubmit(data: any) {
|
||||
loading.value = true
|
||||
const roleId = data.id
|
||||
if (roleId) {
|
||||
BusinessEditBulletin(data)
|
||||
.then(() => {
|
||||
ElMessage.success('修改成功')
|
||||
handleResetQuery()
|
||||
})
|
||||
.finally(() => (loading.value = false))
|
||||
} else {
|
||||
BusinessSchedule(data)
|
||||
.then(() => {
|
||||
ElMessage.success('新增成功')
|
||||
handleResetQuery()
|
||||
})
|
||||
.finally(() => (loading.value = false))
|
||||
}
|
||||
}
|
||||
|
||||
const onUserDeleteDepartment = (id: string) => {
|
||||
ElMessageBox.confirm('确认删除已选中的数据项?', '警告', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(
|
||||
() => {
|
||||
loading.value = true
|
||||
BusinessDscheduledetail(id)
|
||||
.then(() => {
|
||||
ElMessage.success('删除成功')
|
||||
handleResetQuery()
|
||||
})
|
||||
.finally(() => (loading.value = false))
|
||||
},
|
||||
() => {
|
||||
ElMessage.info('已取消删除')
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
const CompleteTheSchedule = (data) => {
|
||||
ElMessageBox.confirm('确认已经完成该日程吗?', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: ''
|
||||
}).then(() => {
|
||||
loading.value = true
|
||||
BusinessHandleSchedule({ id: data.id, state: '是' })
|
||||
.then((res: any) => {
|
||||
ElMessage.success(res.message)
|
||||
handleResetQuery()
|
||||
})
|
||||
.finally(() => (loading.value = false))
|
||||
})
|
||||
}
|
||||
|
||||
// 删除角色
|
||||
function handleDelete(roleId?: number) {
|
||||
const roleIds = [roleId || ids.value].join(',')
|
||||
if (!roleIds) {
|
||||
ElMessage.warning('请勾选删除项')
|
||||
return
|
||||
}
|
||||
|
||||
ElMessageBox.confirm('确认删除已选中的数据项?', '警告', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(
|
||||
() => {
|
||||
loading.value = true
|
||||
RoleAPI.deleteByIds(roleIds)
|
||||
.then(() => {
|
||||
ElMessage.success('删除成功')
|
||||
handleResetQuery()
|
||||
})
|
||||
.finally(() => (loading.value = false))
|
||||
},
|
||||
() => {
|
||||
ElMessage.info('已取消删除')
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
const DepartmentList = () => {
|
||||
UserPersonneldisplay().then((res: any) => {
|
||||
personinchargeList.value = res.data
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
handleQuery()
|
||||
DepartmentList()
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,134 @@
|
||||
<template>
|
||||
<div class="pre-registration-form">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
label-width="auto"
|
||||
label-position="top"
|
||||
>
|
||||
<!-- <el-form-item label="父级" prop="parent">-->
|
||||
<!-- <el-select v-model="formData.parent" placeholder="请选择">-->
|
||||
<!-- <el-option-->
|
||||
<!-- v-for="(item, index) in parentList"-->
|
||||
<!-- :key="index"-->
|
||||
<!-- :label="item.name"-->
|
||||
<!-- :value="item.value"-->
|
||||
<!-- />-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item label="权限名" prop="permission_name">
|
||||
<el-input v-model="formData.permission_name" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
<el-form-item label="权限标识" prop="permission_logo">
|
||||
<el-input v-model="formData.permission_logo" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { convertFilePathsToObject, isValidJson } from '@/utils/auxiliaryFunction'
|
||||
|
||||
const props = defineProps({
|
||||
newData: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
const formRef = ref()
|
||||
// const parentList = [
|
||||
// {
|
||||
// name: '无',
|
||||
// value: '0'
|
||||
// }
|
||||
// ]
|
||||
// 表单数据
|
||||
const formData = reactive<any>({
|
||||
permission_name: '',
|
||||
permission_logo: ''
|
||||
})
|
||||
|
||||
const formRules = reactive<any>({
|
||||
permission_name: [{ required: true, message: '请输入', trigger: 'blur' }],
|
||||
permission_logo: [{ required: true, message: '请输入', trigger: 'blur' }]
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
setFormData(props.newData)
|
||||
})
|
||||
|
||||
function deepCloneByJSON(obj: any) {
|
||||
try {
|
||||
return JSON.parse(JSON.stringify(obj))
|
||||
} catch (error) {
|
||||
console.error('深拷贝失败:', error)
|
||||
return obj
|
||||
}
|
||||
}
|
||||
|
||||
const setFormData = (data: any) => {
|
||||
if (data && Object.keys(data).length > 0) {
|
||||
const data1 = deepCloneByJSON(data)
|
||||
if (data1.file && isValidJson(data1.file)) {
|
||||
data1.file = convertFilePathsToObject(JSON.parse(data1.file))[0]
|
||||
} else {
|
||||
data1.file = undefined
|
||||
}
|
||||
Object.assign(formData, data1)
|
||||
}
|
||||
}
|
||||
|
||||
const getForm = () => {
|
||||
return formData
|
||||
}
|
||||
|
||||
const submit = (): Promise<boolean> => {
|
||||
return new Promise((resolve, reject) => {
|
||||
formRef.value?.validate((valid: boolean) => {
|
||||
if (valid) {
|
||||
resolve(true)
|
||||
} else {
|
||||
ElMessage.error('请完善必填信息')
|
||||
reject(false)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
defineExpose({
|
||||
submit,
|
||||
getForm
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.pre-registration-form {
|
||||
width: 100%;
|
||||
padding-right: 20px;
|
||||
overflow: hidden;
|
||||
overflow-y: auto;
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-track {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-thumb {
|
||||
background: rgba(0, 0, 0, 0.3);
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-thumb:hover {
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
}
|
||||
.section {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 20px;
|
||||
}
|
||||
</style>
|
||||
289
src/views/calibration/permissionManagement/index.vue
Normal file
289
src/views/calibration/permissionManagement/index.vue
Normal file
@@ -0,0 +1,289 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 搜索区域 -->
|
||||
<!-- <div class="search-container">-->
|
||||
<!-- <el-form ref="queryFormRef" :model="queryParams" :inline="true">-->
|
||||
<!-- <el-form-item prop="unit" label="单位">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.unit"-->
|
||||
<!-- placeholder="请输入"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="创建时间" prop="times">-->
|
||||
<!-- <el-date-picker-->
|
||||
<!-- v-model="queryParams.times"-->
|
||||
<!-- type="daterange"-->
|
||||
<!-- value-format="YYYY-MM-DD"-->
|
||||
<!-- placeholder="请选择创建时间"-->
|
||||
<!-- range-separator="至"-->
|
||||
<!-- start-placeholder="开始时间"-->
|
||||
<!-- end-placeholder="结束时间"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item class="search-buttons">-->
|
||||
<!-- <el-button type="primary" icon="search" @click="handleQuery">搜索</el-button>-->
|
||||
<!-- <el-button icon="refresh" @click="handleResetQuery">重置</el-button>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-form>-->
|
||||
<!-- </div>-->
|
||||
<el-card shadow="hover" class="data-table">
|
||||
<div class="data-table__toolbar">
|
||||
<div class="data-table__toolbar--actions">
|
||||
<el-button type="success" icon="plus" @click="handleOpenDialog({}, '0')">新增</el-button>
|
||||
<el-button
|
||||
type="danger"
|
||||
:disabled="ids.length === 0"
|
||||
icon="delete"
|
||||
@click="handleDelete()"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<el-table
|
||||
ref="dataTableRef"
|
||||
v-loading="loading"
|
||||
:data="roleList"
|
||||
highlight-current-row
|
||||
border
|
||||
class="data-table__content"
|
||||
default-expand-all
|
||||
row-key="id"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<!-- <el-table-column type="selection" width="55" align="center" />-->
|
||||
<el-table-column label="权限名" prop="permission_name" />
|
||||
<el-table-column label="权限标识" prop="permission_logo" />
|
||||
<!-- <el-table-column label="时间" prop="times" />-->
|
||||
<el-table-column fixed="right" label="操作" width="240">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
link
|
||||
icon="edit"
|
||||
@click="handleOpenDialog({}, scope.row.id)"
|
||||
>
|
||||
新增下级
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
link
|
||||
icon="edit"
|
||||
@click="handleOpenDialog(scope.row, scope.row.id)"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
type="danger"
|
||||
size="small"
|
||||
link
|
||||
icon="delete"
|
||||
@click="onUserDeleteDepartment(scope.row.id)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-if="total > 0"
|
||||
v-model:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="fetchData"
|
||||
/>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import RoleAPI, { RolePageVO } from '@/api/system/role-api'
|
||||
import { UserPersonneldisplay } from '@/api/calibration/personnelManagement'
|
||||
import { functionDialogBox } from '@/utils/functionDialogBox'
|
||||
import permissionForm from './components/permissionForm.vue'
|
||||
import {
|
||||
BusinessAddRermission,
|
||||
BusinessDeleteRermission,
|
||||
BusinessDisplayRermission,
|
||||
BusinessEditRermission
|
||||
} from '@/api/calibration/permissionManagement'
|
||||
|
||||
defineOptions({
|
||||
name: 'Role',
|
||||
inheritAttrs: false
|
||||
})
|
||||
|
||||
const queryFormRef = ref()
|
||||
|
||||
const loading = ref(false)
|
||||
const ids = ref<number[]>([])
|
||||
const total = ref(0)
|
||||
const personinchargeList = ref<any[]>([])
|
||||
|
||||
const queryParams = reactive<any>({
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
// times: [],
|
||||
// unit: ''
|
||||
})
|
||||
|
||||
// 表格数据
|
||||
const roleList = ref<RolePageVO[]>()
|
||||
|
||||
// 弹窗
|
||||
const dialog = reactive({
|
||||
title: '',
|
||||
visible: false
|
||||
})
|
||||
|
||||
// 获取数据
|
||||
function fetchData() {
|
||||
loading.value = true
|
||||
BusinessDisplayRermission()
|
||||
.then((res: any) => {
|
||||
roleList.value = res.data
|
||||
total.value = res.total
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
// 查询(重置页码后获取数据)
|
||||
function handleQuery() {
|
||||
queryParams.pageNum = 1
|
||||
fetchData()
|
||||
}
|
||||
|
||||
// 重置查询
|
||||
function handleResetQuery() {
|
||||
if (queryFormRef.value) queryFormRef.value.resetFields()
|
||||
queryParams.pageNum = 1
|
||||
fetchData()
|
||||
}
|
||||
|
||||
// 行复选框选中
|
||||
function handleSelectionChange(selection: any) {
|
||||
ids.value = selection.map((item: any) => item.id)
|
||||
}
|
||||
|
||||
// 打开角色弹窗
|
||||
function handleOpenDialog(data?: any, parentId: string) {
|
||||
dialog.visible = true
|
||||
if (data?.id) {
|
||||
functionDialogBox(
|
||||
permissionForm,
|
||||
{
|
||||
newData: data,
|
||||
parentId
|
||||
},
|
||||
{
|
||||
title: '编辑注册平台登记',
|
||||
width: '900',
|
||||
ok(value: any) {
|
||||
handleSubmit({ ...value, id: data?.id, parent: parentId })
|
||||
}
|
||||
}
|
||||
)
|
||||
} else {
|
||||
functionDialogBox(
|
||||
permissionForm,
|
||||
{
|
||||
parentId
|
||||
},
|
||||
{
|
||||
title: '新增注册平台登记',
|
||||
width: '900',
|
||||
ok(value: any) {
|
||||
handleSubmit({ ...value, parent: parentId })
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// 提交角色表单
|
||||
function handleSubmit(data: any) {
|
||||
loading.value = true
|
||||
const roleId = data.id
|
||||
if (roleId) {
|
||||
BusinessEditRermission(data)
|
||||
.then(() => {
|
||||
ElMessage.success('修改成功')
|
||||
handleResetQuery()
|
||||
})
|
||||
.finally(() => (loading.value = false))
|
||||
} else {
|
||||
BusinessAddRermission(data)
|
||||
.then(() => {
|
||||
ElMessage.success('新增成功')
|
||||
handleResetQuery()
|
||||
})
|
||||
.finally(() => (loading.value = false))
|
||||
}
|
||||
}
|
||||
|
||||
const onUserDeleteDepartment = (id: string) => {
|
||||
ElMessageBox.confirm('确认删除已选中的数据项?', '警告', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(
|
||||
() => {
|
||||
loading.value = true
|
||||
BusinessDeleteRermission(id)
|
||||
.then(() => {
|
||||
ElMessage.success('删除成功')
|
||||
handleResetQuery()
|
||||
})
|
||||
.finally(() => (loading.value = false))
|
||||
},
|
||||
() => {
|
||||
ElMessage.info('已取消删除')
|
||||
}
|
||||
)
|
||||
}
|
||||
// 删除角色
|
||||
function handleDelete(roleId?: number) {
|
||||
const roleIds = [roleId || ids.value].join(',')
|
||||
if (!roleIds) {
|
||||
ElMessage.warning('请勾选删除项')
|
||||
return
|
||||
}
|
||||
|
||||
ElMessageBox.confirm('确认删除已选中的数据项?', '警告', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(
|
||||
() => {
|
||||
loading.value = true
|
||||
RoleAPI.deleteByIds(roleIds)
|
||||
.then(() => {
|
||||
ElMessage.success('删除成功')
|
||||
handleResetQuery()
|
||||
})
|
||||
.finally(() => (loading.value = false))
|
||||
},
|
||||
() => {
|
||||
ElMessage.info('已取消删除')
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
const DepartmentList = () => {
|
||||
UserPersonneldisplay().then((res: any) => {
|
||||
personinchargeList.value = res.data
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
handleQuery()
|
||||
DepartmentList()
|
||||
})
|
||||
</script>
|
||||
Reference in New Issue
Block a user