This commit is contained in:
guochunsi
2025-12-31 17:40:01 +08:00
parent 6d94e91b70
commit 74c06bb8a0
713 changed files with 115034 additions and 46 deletions

View File

@@ -0,0 +1,58 @@
<template>
<el-tag
v-if="currentOption"
:type="currentOption.type"
:class="{ 'audit-state-tag': showIcon && currentOption.icon }"
>
<i v-if="showIcon && currentOption.icon" :class="currentOption.icon" style="margin-right: 4px;"></i>
{{ currentOption.label }}
</el-tag>
<span v-else>{{ emptyText }}</span>
</template>
<script setup lang="ts">
import { computed } from 'vue'
export interface StateOption {
value: string | number;
label: string;
type: 'success' | 'danger' | 'warning' | 'info' | '';
icon?: string;
}
interface Props {
state?: string | number;
options?: StateOption[];
showIcon?: boolean;
emptyText?: string;
}
const props = withDefaults(defineProps<Props>(), {
state: '',
options: () => [
{ value: '1', label: '通过', type: 'success', icon: 'fa-solid fa-circle-check' },
{ value: '-2', label: '驳回', type: 'danger', icon: 'fa-solid fa-circle-xmark' },
{ value: '0', label: '待审核', type: 'warning', icon: 'fa-regular fa-clock' }
],
showIcon: true,
emptyText: '-'
})
// 根据 state 值查找对应的配置
const currentOption = computed(() => {
if (!props.state && props.state !== 0 && props.state !== '0') {
return null
}
return props.options.find(option => {
return String(option.value) === String(props.state)
}) || null
})
</script>
<style scoped>
.audit-state-tag {
display: inline-flex;
align-items: center;
}
</style>

View File

@@ -6,7 +6,7 @@
:pager-count="5"
:page-sizes="props.pageSizes"
:current-page="props.current"
background
:background="props.background"
:page-size="props.size"
:layout="props.layout"
:total="props.total"
@@ -40,6 +40,10 @@ const props = defineProps({
type: String,
default: 'total, sizes, prev, pager, next, jumper',
},
background: {
type: Boolean,
default: false,
},
});
// 分页改变
const sizeChangeHandle = (val: number) => {

View File

@@ -0,0 +1,176 @@
<template>
<div class="search-form-container">
<el-form :model="formModel" ref="formRef" :inline="true" @keyup.enter="handleKeyupEnter" class="search-form-inline">
<!-- 直接展示的表单项 -->
<slot :visible="true" :expanded="isExpanded"></slot>
<!-- 可折叠的表单项区域 - 使用 display: contents 确保不影响布局 -->
<div v-show="isExpanded" class="collapsible-content">
<slot :visible="false" :expanded="isExpanded" @has-content="hasCollapsibleContent = true"></slot>
</div>
<!-- 隐藏的检测元素用于检测是否有可折叠内容 -->
<div v-show="false" ref="detectionWrapperRef" class="detection-wrapper">
<slot :visible="false" :expanded="true">
<!-- 如果插槽有内容这里会被渲染我们可以通过检查这个元素来判断 -->
</slot>
</div>
<!-- 操作按钮插槽查询重置等 -->
<slot name="actions"></slot>
<!-- 展开/收起按钮在操作按钮之后 -->
<el-form-item v-if="hasCollapsibleItems" class="collapse-trigger-item">
<el-button
link
type="primary"
@click="toggleExpand"
class="toggle-btn"
>
<el-icon style="margin-right: 4px">
<ArrowUp v-if="isExpanded" />
<ArrowDown v-else />
</el-icon>
{{ isExpanded ? '收起' : '展开更多' }}
</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script setup lang="ts" name="search-form">
import { ref, watch, computed, onMounted, nextTick } from 'vue';
import { ArrowUp, ArrowDown } from '@element-plus/icons-vue';
const props = defineProps({
/**
* 表单数据模型
*/
model: {
type: Object,
required: true,
},
/**
* 是否默认展开折叠区域
*/
defaultExpanded: {
type: Boolean,
default: false,
},
/**
* 是否显示展开/折叠按钮
* 如果不设置将自动检测是否有可折叠内容visible=false 的插槽)
*/
showCollapse: {
type: Boolean,
default: undefined,
},
});
const emit = defineEmits(['expand-change', 'keyup-enter']);
const formModel = props.model;
const formRef = ref();
const isExpanded = ref(props.defaultExpanded);
const hasCollapsibleContent = ref(false);
const detectionWrapperRef = ref<HTMLElement | null>(null);
// 检测是否有可折叠内容
const checkCollapsibleContent = () => {
// 如果 showCollapse 明确指定,则使用指定值
if (props.showCollapse !== undefined) {
hasCollapsibleContent.value = props.showCollapse
return
}
// 否则,通过检查隐藏的检测元素是否有内容来判断
// 需要等待 DOM 渲染完成
nextTick(() => {
if (detectionWrapperRef.value) {
// 检查检测元素是否有子元素(排除文本节点)
const hasContent = detectionWrapperRef.value.children.length > 0 ||
(!!detectionWrapperRef.value.textContent && detectionWrapperRef.value.textContent.trim() !== '')
hasCollapsibleContent.value = hasContent
} else {
hasCollapsibleContent.value = false
}
})
}
// 是否有需要折叠的项
const hasCollapsibleItems = computed(() => {
if (props.showCollapse !== undefined) {
return props.showCollapse
}
return hasCollapsibleContent.value
});
// 处理回车键
const handleKeyupEnter = () => {
emit('keyup-enter');
};
// 切换展开/收起状态
const toggleExpand = () => {
isExpanded.value = !isExpanded.value;
emit('expand-change', isExpanded.value);
};
// 监听 defaultExpanded 变化
watch(
() => props.defaultExpanded,
(newVal) => {
isExpanded.value = newVal;
}
);
// 监听 showCollapse 变化
watch(
() => props.showCollapse,
() => {
checkCollapsibleContent()
}
);
// 初始化时检测
onMounted(() => {
checkCollapsibleContent()
});
// 暴露方法供外部调用
defineExpose({
formRef,
toggleExpand,
expand: () => {
isExpanded.value = true;
emit('expand-change', true);
},
collapse: () => {
isExpanded.value = false;
emit('expand-change', false);
},
});
</script>
<style lang="scss" scoped>
.search-form-container {
:deep(.search-form-inline) {
.collapse-trigger-item {
margin-left: 0;
margin-bottom: 0;
}
.toggle-btn {
padding: 0;
font-size: 14px;
}
}
// 可折叠内容区域 - 使用 contents 让包装器不影响布局
.collapsible-content {
display: contents;
}
}
</style>

View File

@@ -0,0 +1,107 @@
<template>
<!-- 方案1: 姓名用 tag工号普通文本 -->
<div v-if="variant === 'tag-name'" class="teacher-name-no">
<el-tag size="small" type="primary" effect="plain">{{ name || '-' }}</el-tag>
<span class="separator">/</span>
<span class="no">{{ no || '-' }}</span>
</div>
<!-- 方案2: 工号用 tag姓名普通文本推荐 -->
<div v-else-if="variant === 'tag-no'" class="teacher-name-no">
<span class="name">{{ name || '-' }}</span>
<span class="separator">/</span>
<el-tag size="small" type="primary" effect="plain">{{ no || '-' }}</el-tag>
</div>
<!-- 方案3: 姓名和工号都用 tag -->
<div v-else-if="variant === 'tag-both'" class="teacher-name-no">
<el-tag size="small" type="primary" effect="plain">{{ name || '-' }}</el-tag>
<span class="separator">/</span>
<el-tag size="small" type="info" effect="plain">{{ no || '-' }}</el-tag>
</div>
<!-- 方案4: 姓名用 tag实心工号普通文本 -->
<div v-else-if="variant === 'tag-name-solid'" class="teacher-name-no">
<el-tag size="small" type="primary">{{ name || '-' }}</el-tag>
<span class="separator">/</span>
<span class="no">{{ no || '-' }}</span>
</div>
<!-- 方案5: 姓名用彩色背景工号普通文本 -->
<div v-else-if="variant === 'badge-name'" class="teacher-name-no">
<span class="name-badge">{{ name || '-' }}</span>
<span class="separator">/</span>
<span class="no">{{ no || '-' }}</span>
</div>
<!-- 默认方案: 姓名普通文本工号轻量徽章推荐与页面协调 -->
<div v-else class="teacher-name-no">
<span class="name">{{ name || '-' }}</span>
<span class="separator">/</span>
<span class="no-badge">{{ no || '-' }}</span>
</div>
</template>
<script setup lang="ts">
interface Props {
name?: string;
no?: string;
variant?: 'default' | 'tag-name' | 'tag-no' | 'tag-both' | 'tag-name-solid' | 'badge-name';
}
withDefaults(defineProps<Props>(), {
variant: 'default'
});
</script>
<style scoped>
.teacher-name-no {
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
}
.name {
font-weight: 500;
color: #303133;
}
.separator {
font-size: 12px;
color: #909399;
}
.no {
font-size: 12px;
color: #606266;
}
.no-primary {
font-size: 12px;
color: var(--el-color-primary, #667eea);
font-weight: 500;
}
.no-badge {
display: inline-block;
padding: 2px 6px;
border-radius: 3px;
font-size: 12px;
font-weight: 500;
background: var(--el-color-primary-light-9, #ecf5ff);
color: var(--el-color-primary, #667eea);
line-height: 1.2;
}
.name-badge {
display: inline-block;
padding: 2px 8px;
border-radius: 4px;
font-weight: 500;
font-size: 12px;
background: var(--el-color-primary-light-9, #ecf5ff);
color: var(--el-color-primary, #667eea);
}
</style>

View File

@@ -1,5 +1,6 @@
import Pagination from '/@/components/Pagination/index.vue';
import RightToolbar from '/@/components/RightToolbar/index.vue';
import SearchForm from '/@/components/SearchForm/index.vue';
import DictTag from '/@/components/DictTag/index.vue';
import DictSelect from '/@/components/DictTag/Select.vue';
import UploadExcel from '/@/components/Upload/Excel.vue';
@@ -42,6 +43,7 @@ export default {
app.component('DictSelect', DictSelect);
app.component('Pagination', Pagination);
app.component('RightToolbar', RightToolbar);
app.component('SearchForm', SearchForm);
app.component('uploadExcel', UploadExcel);
app.component('UploadFile', UploadFile);
app.component('UploadImg', UploadImg);

View File

@@ -0,0 +1,93 @@
<template>
<div style="width: 100%;height: 100%;">
<viewer :images="[authSrc]" v-if="!showIframe">
<img v-if="!showIframe" ref="imgRef" :width="imgWidth || '100%'" :height="imgHeight || '100%'" :src="authSrc" />
</viewer>
<iframe v-if="showIframe" ref="authIframeRef" style="width: 100%;height: 100%;" >
</iframe>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, nextTick } from 'vue';
import { Session } from "/@/utils/storage";
// 定义 props
const props = defineProps<{
authSrc: string;
imgWidth?: string;
imgHeight?: string;
}>();
// 定义响应式数据
const showIframe = ref(false);
const imgRef = ref<HTMLImageElement | null>(null);
const authIframeRef = ref<HTMLIFrameElement | null>(null);
// 携带token请求img的src
const getImgSrcByToken = (src?: string) => {
if (props.authSrc.indexOf(".pdf") >= 0) {
showIframe.value = true;
nextTick(() => {
const imgSrc = src || props.authSrc;
const tenantId = Session.getTenant();
const iframe = authIframeRef.value;
if (!iframe) return;
const request = new XMLHttpRequest();
request.responseType = 'blob';
request.open('get', imgSrc, true);
request.setRequestHeader('Authorization', "Bearer " + Session.getToken());
request.setRequestHeader('TENANT-ID', tenantId);
request.onreadystatechange = () => {
if (request.readyState == XMLHttpRequest.DONE && request.status == 200) {
const binaryData: BlobPart[] = [];
binaryData.push(request.response);
iframe.src = window.URL.createObjectURL(new Blob(binaryData, { type: 'application/pdf' }));
iframe.onload = () => {
URL.revokeObjectURL(iframe.src);
};
}
};
request.send(null);
});
} else {
// 图片处理逻辑(已注释,如需要可取消注释并更新)
// showIframe.value = false;
// const imgSrc = src || props.authSrc;
// const tenantId = Session.getTenant();
// const img = imgRef.value;
// if (!img) return;
//
// const request = new XMLHttpRequest();
// request.responseType = 'blob';
// request.open('get', imgSrc, true);
// request.setRequestHeader('Authorization', "Bearer " + Session.getToken());
// request.setRequestHeader('TENANT-ID', tenantId);
// request.onreadystatechange = () => {
// if (request.readyState == XMLHttpRequest.DONE && request.status == 200) {
// img.src = URL.createObjectURL(request.response);
// img.onload = () => {
// URL.revokeObjectURL(img.src);
// }
// }
// };
// request.send(null);
}
};
// 刷新图片
const refreshImg = (src?: string) => {
getImgSrcByToken(src);
};
// 暴露方法供外部调用
defineExpose({
refreshImg
});
// 组件挂载时执行
onMounted(() => {
getImgSrcByToken();
});
</script>

View File

@@ -0,0 +1,981 @@
<!--
- Copyright (c) 2018-2025, lengleng All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- Neither the name of the pig4cloud.com developer nor the names of its
- contributors may be used to endorse or promote products derived from
- this software without specific prior written permission.
- Author: lengleng (493840844@qq.com)
-->
<script>
const HEATH='heath'
const TEACHER_CATE='teacher_cate'
const EXAM_STATUS="EXAM_STATUS"
//技能提升
const PROJECT_UP ='457a3c52eb9642649321f2d40b2783bc'
//第三方认证
const PROJECT_OTHER ='cf8766a8b05f02335f5f95803bd976d8'
//非税测试地址
// const TAX_BASE_URL = 'http://titan.finstone.com.cn/nontax/login2'
//用户同步接口
// const TAX_USER_SYNC_URL = 'http://titan.finstone.com.cn/fs-gateway/autosyn/h5Data'
//const TAX_BASE_URL = 'http://titan.finstone.com.cn/nontax/login2/'
const TAX_BASE_URL = 'http://58.216.242.31:8098/nontax/login2/'
const TAX_USER_SYNC_URL = 'http://58.216.242.31:8098/fs-gateway/autosyn/h5Data'
//地区码
const ADM_DIV_CODE = '320400'
//单位代码
const AGENCY_CODE = '039003'
//测试token
const TEST_TOKEN = 'cztoken'
//主题管理
const METHOD_THEME = 'sfztgl'
//业务办理
const METHOD_BUSINESS = 'ywbl'
//业务查询
const METHOD_BUSINESS_SEARCH = 'jfcl'
//缴费处理
const METHOD_PAY = 'djtzdjfKjsq'
const KNOWLEDGE_EXAM = "knowledge_exam"
//生成tax请求地址
function combineTaxUrl(arr) {
return TAX_BASE_URL+arr.join('/')
}
function getTaxUrl(token,taxMethod) {
let arr = [ADM_DIV_CODE,
token,
taxMethod,
AGENCY_CODE
]
return TAX_BASE_URL+'/'+arr.join('/')
}
//人事审核通过 通用
function changeState(row,val,method,_this){
let data={}
data.id=row.id
data.state=val;
let str="";
if(val === 1){
str="通过"
}
if(val === -2){
str="驳回"
}
_this.$confirm('是否确认'+str +row.realName+"的申请" , '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function() {
return method(data)
}).then(data => {
_this.$message({
showClose: true,
message: '操作成功',
type: 'success'
})
_this.getList(_this.page)
}).catch(function(err) { })
}
const YES_OR_NO=[
{
label:'是',
value:'1'
},
{
label:'否',
value:'0'
},
]
const YES_OR_NO_INT=[
{
label:'是',
value: 1
},
{
label:'否',
value: 0
},
]
const LOCK_STATUS=[
{
label:'锁定',
value:'1'
},
{
label:'未锁定',
value:'0'
},
]
const RECORD_STATUS=[
{
label:'已录',
value:'1'
},
{
label:'未录',
value:'0'
},
]
const COURSE_SIGN_STATUS=[
{
label:'未开启',
value:'0'
},
{
label:'开启',
value:'1'
},
]
const COURSE_OPEND_STATUS=[
{
label:'未开课',
value:'0'
},
{
label:'已开课',
value:'1'
},
]
const SCORE_LEVEL_INT=[
{
label:'优秀',
value:1
},
{
label:'良好',
value:2
},
{
label:'合格',
value:3
},
{
label:'不合格',
value:4
},
{
label:'中等',
value:5
}
]
const POINT_SYSTEM=[
{
label:'百分制',
value:'1'
},
{
label:'等級制',
value:'2'
}
]
const invalidState=[
{
label:'正常',
value:'0'
},
{
label:'报废中',
value:'1'
}
]
const transferState=[
{
label:'正常',
value:'0'
},
{
label:'调拨中',
value:'1'
}
]
const all_room_type_id=[
{
label:'实训室',
value:'0'
},
{
label:'办公室',
value:'1'
},
{
label:'教室',
value:'2'
},
{
label:'宿舍',
value:'3'
},{
label:'会议室',
value:'4'
},
{
label:'仓库',
value:'5'
},
{
label:'阶梯教室',
value:'7'
},
{
label:'弱电间',
value:'8'
},
{
label:'其他',
value:'6'
}
]
const all_room_type=[
{
label:'实训室',
value:'0'
},
{
label:'办公室',
value:'1'
},
{
label:'教室',
value:'2'
},
{
label:'宿舍',
value:'3'
},{
label:'会议室',
value:'4'
},
{
label:'仓库',
value:'5'
},
{
label:'阶梯教室',
value:'7'
},
{
label:'弱电间',
value:'8'
},
{
label:'其他',
value:'6'
}
]
const room_type=[
{
label:'实训室',
value:'0'
},
{
label:'办公室',
value:'1'
},
{
label:'会议室',
value:'4'
},
{
label:'仓库',
value:'5'
},
{
label:'阶梯教室',
value:'7'
},
{
label:'弱电间',
value:'8'
},
{
label:'其他',
value:'6'
}
]
const assets_code=[{label:"教学设备",value:"0"},{label:"家具、用具",value:"1"},{label:"课桌椅",value:"2"},{label:"电器设备",value:"3"}
,{label:"办公自动化设备",value:"4"},{label:"电脑",value:"5"},{label:"笔记本电脑",value:"6"},{label:"专用设备",value:"7"},
,{label:"房屋建筑",value:"8"},{label:"图书及设备",value:"9"},{label:"其他",value:"10"}
]
const LEARN_TERM=[
{
label:'第一学期',
value:'1'
},
{
label:'第二学期',
value:'2'
}
]
const purchasingType=[
{
label:'货物类',
value:'0'
},
{
label:'服务类',
value:'1'
},
{
label:'工程类',
value:'2'
},
]
const ckSure=[
{
label:'仓库待确认',
value:'0'
},{
label:'仓库已确认',
value:'1'
}
]
const lvBack=[
{
label:'未回退',
value:'0'
},{
label:'仓库待确认',
value:'1'
},{
label:'仓库已确认 ',
value:'2'
},
]
const lyExamState=[
{
label:'待教研室确认',
value:'-1'
},
{
label:'待教务审核',
value:'0'
},{
label:'通过',
value:'1'
},{
label:'驳回',
value:'2'
},{
label:'撤回',
value:'3'
},
]
const pdState=[
{
label:'已盘点',
value:'0'
},
{
label:'待审核',
value:'1'
},
{
label:'通过',
value:'2'
},
{
label:'驳回',
value:'3'
},
{
label:'待盘点',
value:'4'
}
]
const STATION_TYPE = [
{
label:'专技',
value:'专技'
},{
label:'管理',
value:'管理'
},{
label:'工勤',
value:'工勤'
},
]
const SCORE_TYPE=[
{
label:'总评成绩',
value:'total_mark'
},
{
label:'平时成绩',
value:'normal_score'
},
{
label:'期中成绩',
value:'midterm_score'
},
{
label:'期末成绩',
value:'final_score'
}
]
const assets_type=[
{label:"通用设备",value:"1"},
{label:"专用设备",value:"2"},
{label:"图书档案",value:"3"},
{label:"家具用具装具及动植物",value:"4"},
{label:"文物和陈列品",value:"5"},
{label:"房屋及构筑物",value:"6"},
{label:"信息数据",value:"7"},
{label: "车辆", value: "8"}
]
const LEARN_TERM_FOR_INT=[
{
label:'第一学期',
value:1
},
{
label:'第二学期',
value:2
}
]
const TEACH_PLAN_ASSIGN_CHECK_STATUS=[
{
label:'未锁定',
value:'0'
},
{
label:'锁定',
value:'10'
}
]
const REXAM_TYPE=[
{
label:'补考',
value:'1'
},
{
label:'重修',
value:'2'
}
]
const ABNORMAL_TYPE=[
{
label:'作弊',
value:1
},
{
label:'免修',
value:2
},
{
label:'取消资格',
value:3
},
{
label:'旷考',
value:4
},
{
label:'违纪',
value:20
},
{
label:'缓考',
value:5
},
{
label:'退学',
value:10
},
{
label:'休学',
value:11
}
]
const MY_ABNORMAL_TYPE=[
{
label:1,
value:'作弊'
},
{
label:2,
value:'免修'
},
{
label:3,
value:'取消资格'
},
{
label:4,
value:'旷考'
},
{
label:20,
value:'违纪'
},
{
label:5,
value:'缓考'
},
{
label:10,
value:'退学'
},
{
label:11,
value:'休学'
}
]
// const SCORE_LEVEL_AND_ABNORMAL=[
// {
// value:'优秀',
// label:0
// },
// {
// value:'良好',
// label:1
// },
// {
// value:'合格',
// label:2
// },
// {
// value:'不合格',
// label:3
// },
// {
// label:4,
// value:'作弊'
// },
// {
// label:5,
// value:'免修'
// },
// {
// label:6,
// value:'取消资格'
// },
// {
// label:7,
// value:'旷考'
// },
// {
// label:8,
// value:'缓考'
// }
// ]
const POINT_TYPE=[
{
label:'百分制',
value:"0"
},
{
label:'等级制',
value:"1"
}
]
const SCORE_LEVEL=[
{
label:'优秀',
value:"1"
},
{
label:'良好',
value:"2"
},
{
label:'合格',
value:"3"
},
{
label:'不合格',
value:"4"
},
{
label:'中等',
value:"5"
}
]
const SORT_MENU=[
{
label:'正序',
value:0
},
{
label:'倒序',
value:1
}
]
const TYPE_MENU=[
{
label:'校内',
value:'0'
},
{
label:'校外',
value:'1'
}
]
const CLASS_STATUS=[
{label:"在校",value:"0"},
{label:"顶岗",value:"1"},
{label:"更岗",value:"2"},
{label:"离校",value:"3"}
]
const DICT_DORM_SIGN_STATUS=[
{label:"已到",value:"0"},
{label:"未到",value:"1"},
{label:"请假",value:"2"},
{label:"未点名",value:"3"},
]
const DICT_DORM_SIGN_TYPE=[
{label:"住宿点名",value:"1"},
{label:"留宿点名",value:"2"},
]
const DEVICE_IN_OUT_FLAG= [
{label: "出", value: "1"},
{label: "进", value: "0"}
]
const DEVICE_ILLEGAL_OPTION=[
{label: '是', value: '1'},
{label: '否', value: '0'}
]
const POSITION_TYPE_DATA=[
{label:"大门",value:"1"},
{label:"宿舍",value:"2"},
]
const ORDER_BATCH_STATUS_DATA=[
{label:'已提交,未付讫',value:'1'},
{label:'已付讫',value:'2'}
]
const DICT_ACESS_DEPT_TYPE=[
{label:"部门",value:"1"},
{label:"单位",value:"2"},
]
const STU_GRADU_CHECK_DIC=[
{label:"待审核",value:"0"},
{label:"通过",value:"1"},
{label:"驳回",value:"-1"},
]
const WORKSTUDY_ATTENDANCE=[
{label:'到岗',value:'1'},
{label:'未到岗',value:'2'},
{label:'请假',value:'3'},
]
const INTERVIEW_DIC = [
{label:'未面试',value:'0'},
{label:'面试通过',value:'1'},
{label:'面试未通过',value:'-1'},
]
const ZLSH =[
{label:'未填写',value:'0'},
{label:'待审核',value:'1'},
{label:'通过',value:'2'},
{label:'驳回',value:'3'},
]
const TEACHER_EVALUATE_STATUS=[
{label:'未跟踪',value:'0'},
{label:'已跟踪',value:'100'},
{label:'驳回',value:'-1'},
]
function showSuccessInfo(obj,msg){
obj.$notify({
title: '成功',
message: msg,
type: 'success',
});
}
function showErrorInfo(obj,msg,time){
obj.$notify.error({
title: '错误',
message: msg,
duration: time
});
}
function showToastErrorInfo(obj,msg,time){
obj.$notify.error({
title: '错误',
dangerouslyUseHTMLString:true,
message: msg,
duration: time
});
}
function showErrorInfoForSelfTitle(obj,msg,time,title){
obj.$notify.error({
title: title,
message: msg,
duration: time
});
}
function showWarningInfo(obj,msg,time){
obj.$notify({
title: '警告',
message: msg,
type: 'warning',
duration: time
});
}
function compareDate (d1, d2) {
let reg = new RegExp('-', 'g')
return ((new Date(d1.replace(reg, '/'))) > (new Date(d2.replace(reg, '/'))))
}
function exportExcelForModel(form,url) {
return axios({ // 用axios发送post请求
method: 'post',
url: url, // 请求地址
data: form, // 参数
responseType: 'blob', // 表明返回服务器返回的数据类型
headers: {
'Content-Type': 'application/json'
}
})
}
// //导出
function exportForModel(params,fileNameStr,url){
exportExcelForModel(params,url).then(res => { // 处理返回的文件流
console.log(res)
const blob = new Blob([res.data]);
const fileName = fileNameStr;
const elink = document.createElement('a');
elink.download = fileName;
elink.style.display = 'none';
elink.href = URL.createObjectURL(blob);
document.body.appendChild(elink);
elink.click();
URL.revokeObjectURL(elink.href); // 释放URL 对象
document.body.removeChild(elink);
})
}
function exportForModelGet(params,fileNameStr,url){
exportExcelForModelGet(params,url).then(res => { // 处理返回的文件流
console.log(res)
const blob = new Blob([res.data]);
const fileName = fileNameStr;
const elink = document.createElement('a');
elink.download = fileName;
elink.style.display = 'none';
elink.href = URL.createObjectURL(blob);
document.body.appendChild(elink);
elink.click();
URL.revokeObjectURL(elink.href); // 释放URL 对象
document.body.removeChild(elink);
})
}
function exportExcelForModelGet(form,url) {
return axios({ // 用axios发送post请求
method: 'get',
url: url, // 请求地址
responseType: 'blob', // 表明返回服务器返回的数据类型
headers: {
'Content-Type': 'application/json'
}
})
}
function checkAbnormalType(type) {
ABNORMAL_TYPE.forEach(item => {
if (type === item.value){
return item.label
}
})
}
function getSqlSort(sort){
let sortRet = "";
if(sort == 'descending'){
sortRet = 'desc'
}else{
sortRet = 'asc'
}
return sortRet;
}
function copyText(data,that){
let url = data
let oInput = document.createElement('input')
oInput.value = url
document.body.appendChild(oInput)
oInput.select() // 选择对象
document.execCommand("Copy") // 执行浏览器复制命令
showSuccessInfo(that,"复制成功")
oInput.remove()
}
//根据字典集合 和 字典key 查找label值
function getLabelValue(list,key){
for(let i in list){
if(list[i].value==key){
return list[i].label
}
}
}
//根据字典集合 和 字典key 查找label值
function getLabelValueByArr(list,key){
let arr = key.split(",")
let backValue="";
for(let i in arr){
for (let j in list){
if(list[j].value==arr[i]){
backValue=backValue+","+list[j].label
}
}
}
return backValue==""?"":backValue.substring(1,backValue.length);
}
function getLabelValueByPropes(list,key,props){
for(let i in list){
if(list[i][props.key]==key){
return list[i][props.value]
}
}
}
function getLabelValueByPropes2(list,key,props){
for(let i in list){
if(list[i][props.key]==key){
return list[i][props.value]+' || '+list[i]['xz']+" 年制"
}
}
}
export default
{
HEATH,
TEACHER_CATE,
changeState,
YES_OR_NO,
YES_OR_NO_INT,
LOCK_STATUS,
RECORD_STATUS,
LEARN_TERM,
purchasingType,
pdState,
lyExamState,
lvBack,
ckSure,
STATION_TYPE,
assets_type,
assets_code,
room_type,
all_room_type,
all_room_type_id,
transferState,
invalidState,
POINT_SYSTEM,
SCORE_TYPE,
ABNORMAL_TYPE,
MY_ABNORMAL_TYPE,
LEARN_TERM_FOR_INT,
TEACH_PLAN_ASSIGN_CHECK_STATUS,
SORT_MENU,
TYPE_MENU,
PROJECT_UP,
PROJECT_OTHER,
combineTaxUrl,
getTaxUrl,
TAX_BASE_URL,
TAX_USER_SYNC_URL,
ADM_DIV_CODE,
AGENCY_CODE,
TEST_TOKEN,
METHOD_THEME,
METHOD_BUSINESS,
METHOD_BUSINESS_SEARCH,
METHOD_PAY,
showSuccessInfo,
showErrorInfo,
showToastErrorInfo,
showErrorInfoForSelfTitle,
showWarningInfo,
compareDate,
checkAbnormalType,
COURSE_SIGN_STATUS,
COURSE_OPEND_STATUS,
SCORE_LEVEL,
SCORE_LEVEL_INT,
EXAM_STATUS,
REXAM_TYPE,
exportForModel,
exportForModelGet,
getSqlSort,
POINT_TYPE,
CLASS_STATUS,
KNOWLEDGE_EXAM,
copyText,
getLabelValue,
getLabelValueByArr,
getLabelValueByPropes,
getLabelValueByPropes2,
DICT_DORM_SIGN_STATUS,
DICT_DORM_SIGN_TYPE,
DEVICE_IN_OUT_FLAG,
DEVICE_ILLEGAL_OPTION,
POSITION_TYPE_DATA,
ORDER_BATCH_STATUS_DATA,
DICT_ACESS_DEPT_TYPE,
STU_GRADU_CHECK_DIC,
WORKSTUDY_ATTENDANCE,
INTERVIEW_DIC,
ZLSH,
TEACHER_EVALUATE_STATUS
}
</script>

View File

@@ -0,0 +1,707 @@
<template>
<div class="drawer-container">
<!-- 遮罩层 -->
<div
v-show="visible"
:class="['drawer-mask', { 'drawer-mask-show': visible, 'drawer-mask-hide': !visible }]"
@click="closeByMask"
></div>
<!-- 抽屉内容 -->
<div
:class="['drawer-main', `drawer-${direction}`, { 'drawer-main-show': visible, 'drawer-main-hide': !visible }]"
:style="mainStyle"
>
<div class="drawer-header">
<span class="drawer-title">{{ title }}</span>
<el-button
v-if="showClose"
class="drawer-close-btn"
icon="el-icon-close"
type="text"
@click="closeByButton"
></el-button>
</div>
<div class="drawer-body">
<div style="display: none;">
<!--学生请假审批-->
<stu-leave-apply ref="stuApplyRef" v-if="permissions.stuwork_pending_work_stuleaveapply"></stu-leave-apply>
<!--班级请假审批-->
<class-leave-apply ref="classLeaveRef" v-if="permissions.stuwork_pending_work_stuleaveapply"></class-leave-apply>
<!--留宿申请审批-->
<dorm-live-apply ref="dormLiveApplyRef" v-if="permissions.stuwork_pending_work_dormliveapply"></dorm-live-apply>
<!-- 顶岗申请审批 -->
<company-change ref="companyChangeRef"></company-change>
<!-- 场地使用申请审批 -->
<building-assembly-room-apply ref="buildingAssemblyRoomApplyRef"></building-assembly-room-apply>
<!-- 固定资产调拨 -->
<asset-d-b ref="assetDB" v-if="permissions.asset_assetassetstransfer_edit"></asset-d-b>
<!-- 资产报废 -->
<asset-b-f ref="assetBF" v-if="permissions.asset_assetassetsinvalid_edit"></asset-b-f>
<!-- 资产预报废 -->
<asset-y-b-f ref="assetYBF" v-if="permissions.asset_assetassetsinvalid_add"></asset-y-b-f>
<!-- 入库单待处理 -->
<asset-in ref="assetIn" v-if="permissions.asset_assetinbound_exam_dept || permissions.asset_assetinbound_exam_hq "></asset-in>
<!-- 出库单待处理 -->
<asset-out ref="assetOut" v-if="permissions.asset_assetassetsdetail_edit || permissions.asset_assetassets_exam"></asset-out>
<!-- 采购申请单-->
<purchasingrequisition ref="purchasingrequisition" ></purchasingrequisition>
<!-- 采购流转单-->
<purchasingwander ref="purchasingwander" v-if="permissions.finance_purchasingrequisition_look"></purchasingwander>
<!-- 履约验收-->
<purchasinglyys ref="purchasinglyys" v-if="permissions.finance_purchasinglypj_look"></purchasinglyys>
<!-- 省常技12345-->
<schoolBully ref="schoolBully" v-if="permissions.stuwork_schoolbully_look"></schoolBully>
<!-- 培训项目审核 -->
<train-project-apply ref="trainProjectApplyRef"></train-project-apply>
<!--培训项目到账-->
<train-project-arrived-apply ref="trainProjectArrivedApplyRef"></train-project-arrived-apply>
</div>
<el-tabs v-model="activeName" @tab-click="changeTaskTab">
<el-tab-pane label="已订阅任务" name="1">
<el-table :data="tableData" height="150" border v-loading="tableLoading">
<el-table-column prop="label" label="任务类型" min-width="100" align="center"></el-table-column>
<el-table-column prop="value" label="待办" min-width="80" align="center">
<template v-slot="scope">
<el-tag size="mini" type="danger" v-if="taskNumMap[scope.row.type]">{{taskNumMap[scope.row.type]}}</el-tag>
</template>
</el-table-column>
<el-table-column label="操作" align="center" min-width="150">
<template v-slot="scope">
<el-button type="text" size="mini" @click="handleShowDetail(scope.row)" icon="el-icon-view">查看</el-button>
<el-button type="text" size="mini" @click="handleIgnoreTask(scope.row,scope.$index)" icon="el-icon-close" >不再提醒</el-button>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane label="已取消订阅" name="2">
<el-table :data="ignoreTask" border height="150" v-loading="tableLoading">
<el-table-column label="任务类型" prop="label" min-width="100" align="center"></el-table-column>
<el-table-column label="操作" min-width="150" align="center">
<template v-slot="scope">
<el-button type="text" size="mini" @click="handleCancleIgnore(scope.row,scope.$index)" icon="el-icon-check">恢复</el-button>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
</el-tabs>
</div>
</div>
</div>
</template>
<script>
import StuLeaveApply from "@/page/task/stuLeaveApply.vue";
import ClassLeaveApply from "@/page/task/classLeaveApply.vue";
import {mapGetters} from "vuex";
import {getStuLeaveApplyTask} from "@/api/stuwork/stuleaveapply";
import {getClassLeaveApplyTask} from "@/api/stuwork/classleaveapply";
import {getStore, setStore} from "@/util/store";
import DormLiveApply from "@/page/task/dormLiveApply.vue";
import {getDormLiveApplyTask} from "@/api/stuwork/dormliveapply";
import * as taskApi from "@/api/activiti/task";
import purchasingrequisition from "@/page/task/purchasingrequisition.vue";
import assetOut from "@/page/task/assetOut.vue";
import purchasingwander from "@/page/task/purchasingwander.vue";
import CompanyChange from "@/page/task/companyChange.vue";
import assetIn from "@/page/task/assetIn.vue";
import buildingAssemblyRoomApply from "@/page/task/buildingAssemblyRoomApply.vue";
import schoolBully from "@/page/task/schoolBully.vue";
import assetYBF from "@/page/task/assetYBF.vue";
import purchasinglyys from "@/page/task/purchasinglyys.vue";
import assetDB from "@/page/task/assetDB.vue";
import assetBF from "@/page/task/assetBF.vue";
import {hasTimeOut} from "@/api/asset/assets/assetassets";
import {fetchListPage} from "@/api/asset/assetinbound/assetinbound";
import {pageIndex} from "@/api/asset/assetoutbound/assetoutbound";
import {waitingList} from "@/api/finance/purchasinglypj";
import {fetchList} from "@/api/stuwork/schoolbully";
import trainProjectApply from "@/page/task/trainProjectApply.vue";
import trainProjectArrivedApply from "@/page/task/trainProjectArrivedApply.vue";
export default {
name: 'CustomDrawer',
components: {
trainProjectArrivedApply,
trainProjectApply,
assetBF,
assetDB,
purchasinglyys,
assetYBF,
schoolBully,
buildingAssemblyRoomApply,
assetIn,
CompanyChange,
purchasingwander,
assetOut,
purchasingrequisition,
DormLiveApply, ClassLeaveApply, StuLeaveApply},
data() {
return {
timer:Object,
activeName: '1',
deleteTaskType:[],
showCompent:{},
taskNumMap:{},
allTaskTable:[
{label:"学生请假",type:"1",value:0},
{label:"班级请假",type:"2",value:0},
{label:"留宿申请",type:"3",value:0},
{label:"单位申请",type:"4",value:0},
{label:"场地使用申请",type:"5",value:0},
{label:"资产调拨申请",type:"6",value:0},
{label:"资产报废申请",type:"7",value:0},
{label:"资产预报废",type:"8",value:0},
{label:"资产入库申请",type:"9",value:0},
{label:"资产出库申请",type:"10",value:0},
{label:"采购申请",type:"11",value:0},
{label:"采购审核",type:"12",value:0},
{label:"履约验收",type:"13",value:0},
{label:"省常技12345",type:"14",value:0},
{label:"培训项目审核",type:"15",value:0},
{label:"培训到账审核",type:"16",value:0},
],
normalTaskTable:[],
tableData:[
],
ignoreTask:[
],
tableLoading:false
};
},
props: {
visible: { // 控制抽屉显示
type: Boolean,
default: false
},
title: { // 抽屉标题
type: String,
default: '标题'
},
direction: { // 抽屉方向
type: String,
default: 'right', // 可选 'left', 'right', 'top', 'bottom'
validator: (value) => ['left', 'right', 'top', 'bottom'].includes(value)
},
width: { // 抽屉宽度(左右方向时有效)
type: String,
default: '400px'
},
height: { // 抽屉高度(上下方向时有效)
type: String,
default: '300px'
},
showClose: { // 是否显示关闭按钮
type: Boolean,
default: true
},
maskClosable: { // 点击遮罩层是否可关闭
type: Boolean,
default: true
},
withHeader: { // 是否显示头部
type: Boolean,
default: true
}
},
computed: {
...mapGetters(['permissions']),
mainStyle() {
// 根据方向设置宽度或高度
const style = {};
if (this.direction === 'left' || this.direction === 'right') {
style.width = this.width;
} else {
style.height = this.height;
}
return style;
}
},
watch:{
visible:{
immediate: true,
handler(val){
if (val){
//初始化已订阅任务
this.activeName='1'
this.initNormalTask();
//初始化未订阅任务
this.$nextTick(()=>{
this.initTaskTableData()
})
}
}
}
},
methods: {
initTaskTableData(){
this.tableLoading=this
this.tableData=[]
//查询已订阅任务的 任务值 将任务数为0的忽略掉
let ignoreTypeList = getStore({name:"myTaskTable_ignore"})
if (undefined == ignoreTypeList) {
ignoreTypeList = [];
}
if (!ignoreTypeList.includes("1")) {
if (this.$refs.stuApplyRef) {
this.getStuLeaveData();
}
}
if (!ignoreTypeList.includes("2")) {
if(this.$refs.classLeaveRef){
this.getClassLeaveData()
}
}
if (!ignoreTypeList.includes("3")) {
if (this.$refs.dormLiveApplyRef) {
this.getDormApply()
}
}
if (!ignoreTypeList.includes("4")) {
if (this.$refs.companyChangeRef) {
this.getCompanyChangeTask()
}
}
if (!ignoreTypeList.includes("5")) {
if (this.$refs.buildingAssemblyRoomApplyRef) {
this.getBuildingAssemblyRoomApply();
}
}
if (!ignoreTypeList.includes("6")) {
if (this.$refs.assetDB) {
this.getAssesstsTransferTask()
}
}
if (!ignoreTypeList.includes("7")) {
if (this.$refs.assetBF) {
this.getAssetBfList();
}
}
if (!ignoreTypeList.includes("8")) {
if (this.$refs.assetYBF) {
this.getYbFData()
}
}
if (!ignoreTypeList.includes("9")) {
if (this.$refs.assetIn) {
this.getAssetInList()
}
}
if (!ignoreTypeList.includes("10")) {
if (this.$refs.assetOut) {
this.getAssetOutList()
}
}
if (!ignoreTypeList.includes("11")) {
if (this.$refs.purchasingrequisition) {
this.getPurchaseList()
}
}
if (!ignoreTypeList.includes("12")) {
if (this.$refs.purchasingwander) {
this.getPruchaseWarningList()
}
}
if (!ignoreTypeList.includes("13")) {
if (this.$refs.purchasinglyys) {
this.getPurchaseLyysData();
}
}
if (!ignoreTypeList.includes("14")) {
if (this.$refs.schoolBully) {
this.getSchoolBully()
}
}
if (!ignoreTypeList.includes("15")) {
if (this.$refs.trainProjectApplyRef) {
this.getTrainProjectApply()
}
}
if (!ignoreTypeList.includes("16")) {
if (this.$refs.trainProjectArrivedApplyRef) {
this.getTrainProjectArrived()
}
}
setTimeout(()=>{
this.tableLoading=false
},1500);
},
changeTaskTab(tab){
if (tab.name == '1') {
this.initNormalTask()
this.initTaskTableData()
}
if (tab.name == '2') {
this.initIgnoreTask();
}
},
initNormalTask(){
this.normalTaskTable=[]
let ignoreTypeList = getStore({name:"myTaskTable_ignore"})
for (let item of this.allTaskTable) {
if (!ignoreTypeList||!ignoreTypeList.includes(item.type)) {
this.normalTaskTable.push(item)
}
}
this.initIgnoreTask();
},
initIgnoreTask(){
this.ignoreTask=[]
//存在忽略的订阅任务 则清除数据
let ignoreTypeList = getStore({name:"myTaskTable_ignore"})
for (let item of this.allTaskTable) {
if (ignoreTypeList && ignoreTypeList.includes(item.type)) {
this.ignoreTask.push(item)
}
}
},
//任务查询集合 start
getStuLeaveData() {
getStuLeaveApplyTask({}).then(response => {
this.taskNumMap['1']=response.data.data.length
//忽略 没有任务数的 订阅任务
this.removeTaskTableColumen(response.data.data, "1")
})
},
getClassLeaveData(){
getClassLeaveApplyTask().then(response=>{
this.taskNumMap['2']=response.data.data.length
//忽略 没有任务数的 订阅任务
this.removeTaskTableColumen(response.data.data, "2")
})
},
getDormApply(){
getDormLiveApplyTask().then(response => {
this.taskNumMap['3']=response.data.data.length
//忽略 没有任务数的 订阅任务
this.removeTaskTableColumen(response.data.data, "3")
})
},
getCompanyChangeTask(){
taskApi.fetchList({"current":1,"size":9999,"procDefKey":"work_stu_company_change"}).then(response => {
this.taskNumMap['4']=response.data.data.records.length
//忽略 没有任务数的 订阅任务
this.removeTaskTableColumen(response.data.data.records, "4")
})
},
getBuildingAssemblyRoomApply(){
taskApi.fetchList({"current":1,"size":9999,"procDefKey":"building_assembly_room_apply"}).then(response => {
this.taskNumMap['5']=response.data.data.records.length
//忽略 没有任务数的 订阅任务
this.removeTaskTableColumen(response.data.data.records, "5")
})
},
getAssesstsTransferTask(){
taskApi.fetchList({"current":1,"size":9999,"procDefKey":"assetsTransfer"}).then(response => {
this.taskNumMap['6']=response.data.data.records.length
//忽略 没有任务数的 订阅任务
this.removeTaskTableColumen(response.data.data.records, "6")
})
},
getAssetBfList(){
taskApi.fetchList({"current":1,"size":9999,"procDefKey":"asset_invalid"}).then(response => {
this.taskNumMap['7']=response.data.data.records.length
//忽略 没有任务数的 订阅任务
this.removeTaskTableColumen(response.data.data.records, "7")
})
},
getYbFData(){
let page={currentPage:1,pageSize:10}
hasTimeOut(Object.assign({
current: page.currentPage,
size: page.pageSize
}, {})).then(response => {
this.taskNumMap['8']=response.data.data.total
//忽略 没有任务数的 订阅任务
this.removeTaskTableColumenForLength(response.data.data.total, "8")
})
},
getAssetInList(){
let page={currentPage:1,pageSize:10}
fetchListPage(Object.assign({
current: page.currentPage,
size: page.pageSize
}, {})).then(response => {
this.taskNumMap['9']=response.data.data.total
//忽略 没有任务数的 订阅任务
this.removeTaskTableColumenForLength(response.data.data.total, "9")
})
},
getAssetOutList(){
let page={currentPage:1,pageSize:10}
pageIndex(Object.assign({
current: page.currentPage,
size: page.pageSize
}, {})).then(response => {
this.taskNumMap['10']=response.data.data.total
//忽略 没有任务数的 订阅任务
this.removeTaskTableColumenForLength(response.data.data.total, "10")
})
},
getPurchaseList(){
taskApi.fetchList({"current":1,"size":9999,"procDefKey":"process"}).then(response => {
this.taskNumMap['11']=response.data.data.records.length
//忽略 没有任务数的 订阅任务
this.removeTaskTableColumen(response.data.data.records, "11")
})
},
getPruchaseWarningList(){
taskApi.fetchList({"current":1,"size":9999,"procDefKey":"processWander"}).then(response => {
this.taskNumMap['12']=response.data.data.records.length
//忽略 没有任务数的 订阅任务
this.removeTaskTableColumen(response.data.data.records, "12")
})
},
getPurchaseLyysData(){
waitingList().then(response => {
this.taskNumMap['13']=response.data.data.length
//忽略 没有任务数的 订阅任务
this.removeTaskTableColumen(response.data.data, "13")
});
},
getSchoolBully(){
let page={currentPage:1,pageSize:10}
fetchList(Object.assign({
current: page.currentPage,
size: page.pageSize
}, {isContact:0})).then(response => {
this.taskNumMap['14']=response.data.data.total
//忽略 没有任务数的 订阅任务
this.removeTaskTableColumenForLength(response.data.data.total, "14")
})
},
getTrainProjectApply(){
taskApi.fetchList({"current":1,"size":9999,"procDefKey":"train_project_approval"}).then(response => {
this.taskNumMap['15']=response.data.data.records.length
//忽略 没有任务数的 订阅任务
this.removeTaskTableColumen(response.data.data.records, "15")
})
},
getTrainProjectArrived(){
taskApi.fetchList({"current":1,"size":9999,"procDefKey":"train_project_money_arrived"}).then(response => {
this.taskNumMap['16']=response.data.data.records.length
//忽略 没有任务数的 订阅任务
this.removeTaskTableColumen(response.data.data.records, "16")
})
},
removeTaskTableColumen( data,targetType){
if (data.length > 0) {
for (let index in this.normalTaskTable) {
if (this.normalTaskTable[index].type == targetType) {
this.tableData.push(this.normalTaskTable[index])
}
}
}
},
removeTaskTableColumenForLength( dataLength,targetType){
if (dataLength >0) {
for (let index in this.normalTaskTable) {
if (this.normalTaskTable[index].type == targetType) {
this.tableData.push(this.normalTaskTable[index])
}
}
}
},
handleShowDetail(row){
if (row.type == '1') {
this.$refs.stuApplyRef.handleShowList();
}
if (row.type == '2') {
this.$refs.classLeaveRef.handleShowList();
}
if (row.type == '3') {
this.$refs.dormLiveApplyRef.handleShowList();
}
if (row.type == '4') {
this.$refs.companyChangeRef.handleShowList();
}
if (row.type == '5') {
this.$refs.buildingAssemblyRoomApplyRef.handleShowList();
}
if (row.type == '6') {
this.$refs.assetDB.handleShowList();
}
if (row.type == '7') {
this.$refs.assetBF.handleShowList();
}
if (row.type == '8') {
this.$refs.assetYBF.handleShowList();
}
if (row.type == '9') {
this.$refs.assetIn.handleShowList();
}
if (row.type == '10') {
this.$refs.assetOut.handleShowList();
}
if (row.type == '11') {
this.$refs.purchasingrequisition.handleShowList();
}
if (row.type == '12') {
this.$refs.purchasingwander.handleShowList();
}
if (row.type == '13') {
this.$refs.purchasinglyys.handleShowList();
}
if (row.type == '14') {
this.$refs.schoolBully.handleShowList();
}
if (row.type == '15') {
this.$refs.trainProjectApplyRef.handleShowList();
}
if (row.type == '16') {
this.$refs.trainProjectArrivedApplyRef.handleShowList();
}
},
handleIgnoreTask(row,index){
let ignoreTypeList = getStore({name:"myTaskTable_ignore"})
if (undefined == ignoreTypeList) {
ignoreTypeList = [];
}
ignoreTypeList.push(row.type);
setStore({name:"myTaskTable_ignore",content:ignoreTypeList, type: "session"});
this.tableData.splice(index,1)
},
handleCancleIgnore(row,index){
let ignoreTask = getStore({name:"myTaskTable_ignore"})
if (ignoreTask) {
let index=ignoreTask.indexOf(row.type)
ignoreTask.splice(index,1)
}
setStore({name:"myTaskTable_ignore",content:ignoreTask, type: "session"});
this.ignoreTask.splice(index,1)
},
handleClick(){
},
closeByMask() {
if (this.maskClosable) {
this.$emit('update:visible', false); // 支持 .sync 修饰符
this.$emit('close', 'mask');
}
},
closeByButton() {
this.$emit('update:visible', false);
this.$emit('close', 'button');
}
}
};
</script>
<style scoped>
.drawer-container {
font-family: inherit; /* 继承 Element UI 的字体 */
}
.drawer-mask {
//position: fixed;
//top: 0;
//left: 0;
//width: 100%;
//height: 100%;
//background-color: rgba(0, 0, 0, 0.5);
//z-index: 2000; /* 确保遮罩层在抽屉之下,但在其他页面内容之上 */
//transition: opacity 0.3s ease;
}
.drawer-mask-show {
opacity: 1;
}
.drawer-mask-hide {
opacity: 0;
pointer-events: none; /* 隐藏时不允许交互 */
}
.drawer-main {
position: fixed;
z-index: 2001; /* 在遮罩层之上 */
background: #fff;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
transition: all 0.3s ease;
overflow: hidden;
display: flex;
flex-direction: column;
}
.drawer-right {
top: 65%;
right: 0;
height: 34%;
transform: translateX(100%);
}
.drawer-left {
top: 0;
left: 0;
height: 30%;
transform: translateX(-100%);
}
.drawer-top {
top: 0;
left: 0;
width: 100%;
transform: translateY(-100%);
}
.drawer-bottom {
bottom: 0;
left: 0;
width: 100%;
transform: translateY(100%);
}
.drawer-main-show {
transform: translateX(0) translateY(0); /* 显示时复位 */
opacity: 1;
}
.drawer-main-hide {
/* 根据方向隐藏 */
opacity: 0;
pointer-events: none;
}
.drawer-right.drawer-main-hide {
transform: translateX(100%);
}
.drawer-left.drawer-main-hide {
transform: translateX(-100%);
}
.drawer-top.drawer-main-hide {
transform: translateY(-100%);
}
.drawer-bottom.drawer-main-hide {
transform: translateY(100%);
}
.drawer-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px 10px;
border-bottom: 1px solid #ebeef5;
font-size: 14px;
font-weight: bold;
color: #303133;
flex-shrink: 0; /* 防止头部被压缩 */
}
.drawer-title {
line-height: 1;
}
.drawer-close-btn {
padding: 0;
margin-left: auto; /* 将关闭按钮推到右侧 */
}
.drawer-body {
flex: 1; /* 占据剩余空间 */
padding: 10px;
overflow-y: auto; /* 内容过多时允许滚动 */
}
</style>

View File

@@ -0,0 +1,139 @@
<!-- 敏感信息授权按钮组件 -->
<template>
<div>
<el-button class="grant-btn" type="text" @click="grantPrivilege">敏感信息授权</el-button>
<el-dialog append-to-body title="敏感信息短信授权"
v-model:visible="dialogVisible">
<el-form>
<el-form-item label="手机号">
<el-row>{{mobile}}</el-row>
</el-form-item>
<el-form-item label="验证码">
<el-col :span="11">
<el-input type="number" style="display: inline-block" maxlength="6" placeholder="请输入验证码" v-model="form.code"></el-input>
</el-col>
<el-col :span="5">
<el-button style="display: inline;margin-left: 5px;" plain type="text" @click.prevent="getCode()">{{title}}</el-button>
</el-col>
</el-form-item>
<el-alert :closable="false">验证通过后将去除脱敏有效期为30分钟请尽快操作</el-alert>
<el-alert type="warning" :closable="false">手机号码登记后统一维护如有修改请联系相关部门教职工(组织人事处) 学生(班主任) 驻校人员(后勤处)</el-alert>
</el-form>
<template v-slot:footer>
<span class="dialog-footer" style="text-aligin:center">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="checkCode"> </el-button>
</span>
</template>
</el-dialog>
</div>
</template>
<script>
import request from '@/router/axios'
export default {
name: "sensitive",
data(){
return{
dialogVisible: false,
second: '', //倒计时
disabled: false, //是否禁用按钮
timer: null, //计时器
form:{
code:''
},
mobile:'**'
}
},
computed: {
title() {
return this.disabled ? `重新获取 ( ${this.second} ) s` : '获取验证码';
},
},
methods:{
grantPrivilege(){
this.dialogVisible = true
this.form.code = ''
this.getMobile()
},
getCode() {
// console.log('点击')
let that = this
let s = 60 //倒计时间
if (!that.timer) {
that.second = s
that.disabled = true
that.timer = setInterval(() => {
if (that.second > 0 && this.second <= s) {
that.second--
} else {
that.disabled = false
clearInterval(that.timer)
this.timer = null
}
}, 1000)
that.sendCode()
}
},
getMobile(){
request({
url: '/admin/mobile/getMobile',
method: 'get'
}).then(response => {
console.log(response.data)
if (response.data.data) {
this.mobile = response.data.data
} else {
this.$message.error(response.data.msg)
}
})
},
sendCode(){
request({
url: '/admin/mobile/codeSensitive',
method: 'get'
}).then(response => {
console.log(response.data)
if (response.data.data) {
this.$message.success("短信发送成功")
} else {
this.$message.error(response.data.msg)
}
})
},
checkCode(){
request({
url: '/admin/mobile/checkSensitiveCode',
method: 'post',
data:{'code':this.form.code}
}).then(response => {
console.log(response.data)
if (response.data.data) {
this.dialogVisible = false
this.$message.success("校验通过")
} else {
this.$message.error("校验失败")
}
})
}
}
}
</script>
<style scoped lang="scss">
.wrapper {
display: inline-block;
}
.grant-btn{
marigin: 0px 5px !important;
color: #f39217;
}
</style>

View File

@@ -0,0 +1,179 @@
<!--
* @FileDescription: 富文本框
* @Author: ztc
* @Date: 2023年03月22日
* @Params(调用时 v-model 绑定 父组件值)
* @Params(needImage) 是否需要 上传图片 默认关闭
* @Params(imageUrl) 图片上传地址
* @Params(data key-val 键值对) 图片上传附加参数
-->
<template>
<div class="w_editor">
<!-- 富文本编辑器 -->
<div ref="w_view"></div>
</div>
</template>
<script>
//自定义字体类型
/*富文本编辑图片上传配置*/
const uploadConfig = {
action: '' // 必填参数 图片上传地址
};
// 引入富文本
import WE from "wangeditor";
// 引入elementUI Message模块用于提示信息
import { Message } from "element-ui";
export default {
name: "wangEditor",
model: {
prop: 'desc',
event:'change'
},
props:{
desc:{
type:String,
default:""
},
//业务中我们经常会有添加操作和编辑操作,添加操作时,我们需清除上一操作留下的缓存
isClear:{
type:Boolean,
default:false
},
needImage:'',
imageUrl:'',
data:{},
showFullScreen: {
type:Boolean,
default:true
}
},
data() {
return {
info_:null,
isChange:false,
// 编辑器实例
editor: null,
// 富文本菜单选项配置
menuItem: [
"head",
"bold",
"fontSize",
"fontName",
"italic",
"underline",
"indent",
"lineHeight",
"foreColor",
"backColor",
"link",
"list",
"justify"
]
};
},
watch: {
// 监听默认值
isClear(val){
// console.log(val)
if (val){
this.editor.txt.clear()
}
},
//接收父组件传递过来的值
desc(value){
//判断父组件传递过来的值跟当前编辑器内容是否一样
if (value != this.editor.txt.html()) {
this.editor.txt.html(this.desc)
}
}
},
mounted() {
this.initEditor();
if(this.editor){
this.editor.txt.html(this.desc)
}
},
methods: {
clearText(){
if (this.editor) {
this.editor.txt.clear()
}
},
// 初始化编辑器
initEditor() {
if(this.needImage){
this.menuItem.push("image")
}
// 获取编辑器dom节点
const editor = new WE(this.$refs.w_view);
// 配置编辑器
editor.config.showLinkImg = false; /* 隐藏插入网络图片的功能 */
editor.config.onchangeTimeout = 5000; /* 配置触发 onchange 的时间频率,默认为 200ms */
editor.config.uploadImgMaxLength = 1; /* 限制一次最多能传几张图片 */
editor.config.showFullScreen = this.showFullScreen; /* 配置全屏功能按钮是否展示 */
editor.config.menus = [...this.menuItem]; /* 自定义系统菜单 */
// editor.config.uploadImgMaxSize = 5 * 1024 * 1024 /* 限制图片大小 */;
editor.config.customAlert = err => {
Message.error(err);
};
// 监控变化,同步更新数据
editor.config.onchange = newHtml => {
// this.isChange = true;
// // 异步更新组件富文本值的变化
// // this.defaultText=newHtml
// this.$emit("update:rich-text", newHtml);
this.info_ = newHtml // 绑定当前逐渐地值
this.$emit('change', this.info_) // 将内容同步到父组件中
};
// 自定义上传图片
editor.config.customUploadImg = (resultFiles, insertImgFn) => {
let param = new FormData(); // 创建form对象
param.append("filename", "test");
param.append("file", resultFiles[0]);
for(let i in this.data){
param.append(this.data[i].key,this.data[i].val)
}
// 一般项目中都会封装好发送请求得方法,我这为了通用直接用axios
axios.post(this.imageUrl, param).then(res => {
// res是上传成功后返回的数据,返回的数据中需要有上传图片的路径,
// 通过insert方法将路径传入,即可将图片在富文本中插入
if (res.status === 200) {
// 我这返回的是JSON数据,需要解析
let path = res.data.data.fileUrl
// 上传代码返回结果之后,将图片插入到编辑器中
insertImgFn(path);
}
});
};
// 创建编辑器
editor.create();
this.editor = editor;
}
},
beforeUnmount() {
// 销毁编辑器
this.editor.destroy();
this.editor = null;
},
};
</script>
<style>
.w-e-toolbar{
z-index: 1 !important;
}
.w-e-menu {
z-index: 2 !important;
}
.w-e-text-container {
z-index: 1 !important;
height: auto;
}
</style>