活动介绍

element-plus el-date-picker更改背景色

时间: 2025-01-30 09:40:40 浏览: 93
### 自定义Element Plus `el-date-picker` 组件的背景色 为了实现对 Element Plus 的 `el-date-picker` 组件背景颜色的自定义,可以采用多种方法来确保样式能够正确应用并覆盖默认样式。以下是具体的方法: #### 方法一:通过SCSS变量覆盖 如果项目中使用了 SCSS 并且已经安装了 Element Plus 主题编译工具,则可以通过重写主题中的 SCSS 变量来进行全局样式的调整。 ```scss // home.scss 文件内添加如下代码 @import "~element-plus/packages/theme-chalk/src/date-picker"; $--date-picker-background-color: #002450; $--picker-border-color: #1384b4; @include b(datePicker) { @include e(picker-panel) { color: #fff; // 设置当前面板的月份字体为白色 background: $--date-picker-background-color !important; border: 1px solid $--picker-border-color; &__icon-btn { color: #ffffff; } &__header-label { color: #ffffff; } .el-date-table th { color: #ffffff; } } } ``` 这种方法利用了 Element Plus 提供的主题定制功能,使得更改更加优雅且易于维护[^1]。 #### 方法二:直接在CSS/SCSS中覆写类名 当不想依赖于特定构建工具链时,可以直接在项目的 CSS 或者 SCSS 文件里针对 `.el-date-picker` 类及其子元素编写更具体的样式规则,并加上 `!important` 来提高优先级以确保这些新样式能生效。 ```scss /* 在home.scss文件中 */ .el-date-picker, .el-popper.is-customized { --el-bg-color-overlay: rgba(0, 36, 80, 0.9); /* 半透明背景色 */ } .el-date-picker.el-picker-panel { color: #fff; background: var(--el-bg-color-overlay); border: 1px solid #1384b4; .el-picker-panel__icon-btn { color: #ffffff; } .el-date-picker__header-label { color: #ffffff; } .el-date-table th { color: #ffffff; } } ``` 这里不仅设置了基础的选择器还加入了带有前缀 `-is-customized` 的选择器用于处理可能出现的不同层次结构下的背景色问题[^2]。 #### 方法三:局部作用域内的特殊日期样式 对于某些特殊情况比如想要改变某个特定时间点的颜色而不影响整个控件外观的情况下,可以在 HTML 结构基础上进一步细化 CSS Selectors: ```html <!-- 假设这是模板部分 --> <template> <!-- ... --> </template> <style scoped lang="scss"> td.available.current.stopColor span { background-color: rgb(248, 6, 6)!important; color: #FFFFFF!important; } td.available.current.okColor span { background-color: #07BF08!important; color: #FFFFFF!important; } </style> ``` 此片段展示了如何为目标日期单元格设置不同的背景色和文字颜色,适用于需要高亮显示重要日子的应用场景[^3]。 #### 修改占位符颜色 最后,关于输入框内部提示文字即 placeholder 颜色也可以按照下面的方式进行修改: ```scss .form-items { .el-input__inner, .el-date-editor .el-range-input { color: #409eff; &:placeholder-shown::before { content: attr(data-placeholder); display: inline-block; opacity: 0.5; transition: all ease-in-out 0.3s; } ::placeholder { color: #606266; } :-ms-input-placeholder { color: #606266; } ::-moz-placeholder { color: #606266; } :-moz-placeholder { color: #606266; } ::-webkit-input-placeholder { color: #606266; } } } ``` 这段代码确保了不同浏览器环境下都能正常渲染预期的文字颜色[^4]。
阅读全文

相关推荐

<template> <el-container style="height: 100vh; overflow: hidden;"> <el-aside width="200px" style="background-color: #304156;"> <el-menu default-active="1" class="el-menu-vertical-demo" background-color="#304156" text-color="#bfcbd9" active-text-color="#409EFF"> <el-menu-item index="1"> 员工管理 </el-menu-item> </el-menu> </el-aside> <el-container> <el-header class="app-header"> 员工管理系统 </el-header> <el-main class="app-content"> <el-row :gutter="20"> <el-col :span="4"> <el-input v-model="queryParams.name" placeholder="请输入姓名" clearable /> </el-col> <el-col :span="4"> <el-select v-model="queryParams.gender" placeholder="请选择性别" clearable> <el-option label="男" :value="0" /> <el-option label="女" :value="1" /> </el-select> </el-col> <el-col :span="4"> <el-select v-model="queryParams.job" placeholder="请选择职位" clearable> <el-option v-for="item in jobOptions" :key="item.value" :label="item.label" :value="item.value" /> </el-select> </el-col> <el-col :span="6"> <el-date-picker v-model="queryParams.dateRange" type="daterange" start-placeholder="开始日期" end-placeholder="结束日期" format="YYYY-MM-DD" value-format="YYYY-MM-DD" /> </el-col> <el-col :span="6" class="action-buttons"> <el-button type="primary" @click="fetchData" icon="el-icon-search">搜索</el-button> <el-button type="success" @click="showAddDialog" icon="el-icon-plus">新增</el-button> <el-button type="danger" @click="batchDelete" icon="el-icon-delete">批量删除</el-button> </el-col> </el-row> <el-table :data="tableData" border stripe style="width: 100%" @selection-change="handleSelectionChange"> <el-table-column type="selection" width="55" align="center" /> <el-table-column prop="id" label="ID" width="80" align="center" /> <el-table-column prop="name" label="姓名" width="120" /> <el-table-column label="头像" width="100" align="center"> <template #default="scope"> <el-avatar v-if="scope.row.image" :src="scope.row.image" :size="50" shape="square" :preview-src-list="[scope.row.image]" /> <el-avatar v-else :size="50" shape="square"> </el-avatar> </template> </el-table-column> <el-table-column prop="gender" label="性别" width="80" align="center"> <template #default="scope"> <el-tag :type="scope.row.gender === 0 ? 'primary' : 'danger'"> {{ scope.row.gender === 0 ? '男' : '女' }} </el-tag> </template> </el-table-column> <el-table-column prop="job" label="职位" width="150"> <template #default="scope"> <el-tag :type="getJobTagType(scope.row.job)"> {{ jobMap[scope.row.job] || '未知' }} </el-tag> </template> </el-table-column> <el-table-column prop="entrydate" label="入职时间" width="120" align="center" /> <el-table-column prop="createTime" label="创建时间" width="180" align="center" /> <el-table-column prop="updateTime" label="最后修改时间" width="180" align="center" /> <el-table-column label="操作" width="200" align="center" fixed="right"> <template #default="scope"> <el-button size="small" type="primary" icon="el-icon-edit" @click="handleEdit(scope.row)">编辑</el-button> <el-button size="small" type="danger" icon="el-icon-delete" @click="handleDelete(scope.row.id)">删除</el-button> </template> </el-table-column> </el-table> <el-pagination background layout="total, prev, pager, next, sizes" :total="total" :page-sizes="[5, 10, 20, 50]" :page-size="queryParams.pageSize" v-model:current-page="queryParams.pageNum" @current-change="fetchData" @size-change="handleSizeChange" /> </el-main> </el-container> </el-container> <el-dialog v-model="dialogVisible" :title="dialogTitle" width="700px" :close-on-click-modal="false"> <el-form :model="form" ref="formRef" :rules="formRules" label-width="100px" label-position="left"> <el-row :gutter="20"> <el-col :span="12"> <el-form-item label="姓名" prop="name"> <el-input v-model="form.name" /> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="用户名" prop="username"> <el-input v-model="form.username" /> </el-form-item> </el-col> </el-row> <el-row :gutter="20"> <el-col :span="12"> <el-form-item label="性别" prop="gender"> <el-select v-model="form.gender" placeholder="请选择性别" style="width: 100%"> <el-option label="男" :value="0" /> <el-option label="女" :value="1" /> </el-select> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="职位" prop="job"> <el-select v-model="form.job" placeholder="请选择职位" style="width: 100%"> <el-option v-for="item in jobOptions" :key="item.value" :label="item.label" :value="item.value" /> </el-select> </el-form-item> </el-col> </el-row> <el-row :gutter="20"> <el-col :span="12"> <el-form-item label="密码" prop="password" v-if="!isEdit"> <el-input v-model="form.password" show-password /> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="入职时间" prop="entrydate"> <el-date-picker v-model="form.entrydate" type="date" placeholder="选择日期" format="YYYY-MM-DD" value-format="YYYY-MM-DD" style="width: 100%" /> </el-form-item> </el-col> </el-row> <el-form-item label="头像链接" prop="image"> <el-input v-model="form.image" placeholder="请输入图片URL" /> <el-image :src="form.image" fit="cover" style="width: 100px; height: 100px; margin-top: 10px;" :preview-src-list="[form.image]" /> </el-form-item> <el-form-item class="form-actions"> <el-button type="primary" @click="submitForm">提交</el-button> <el-button @click="dialogVisible = false">取消</el-button> </el-form-item> </el-form> </el-dialog> </template> <script setup> import { ref, reactive, onMounted } from 'vue'; import axios from 'axios'; import { ElMessage, ElMessageBox } from 'element-plus'; // 设置 axios 实例 const apiClient = axios.create({ baseURL: 'http://localhost:8080/emps', timeout: 5000, }); // 表格数据 const tableData = ref([]); const total = ref(0); const selectedRows = ref([]); const formRef = ref(null); // 查询参数 const queryParams = reactive({ pageNum: 1, pageSize: 5, name: '', gender: null, job: null, dateRange: [] }); // 表单数据 const form = reactive({ id: null, username: '', password: '', name: '', gender: null, job: null, image: '', entrydate: '' }); // 表单验证规则 const formRules = { name: [{ required: true, message: '请输入姓名', trigger: 'blur' }], username: [{ required: true, message: '请输入用户名', trigger: 'blur' }], gender: [{ required: true, message: '请选择性别', trigger: 'change' }], job: [{ required: true, message: '请选择职位', trigger: 'change' }], password: [{ required: true, message: '请输入密码', trigger: 'blur' }], entrydate: [{ required: true, message: '请选择入职日期', trigger: 'change' }] }; // 对话框控制 const dialogVisible = ref(false); const dialogTitle = ref('新增员工'); const isEdit = ref(false); // 职位映射表 const jobMap = { 1: '班主任', 2: '讲师', 3: '学工主管', 4: '教研主管', 5: '咨询师' }; // 职位选项 const jobOptions = [ { label: '班主任', value: 1 }, { label: '讲师', value: 2 }, { label: '学工主管', value: 3 }, { label: '教研主管', value: 4 }, { label: '咨询师', value: 5 } ]; // 获取职位标签类型 const getJobTagType = (job) => { const types = ['', 'success', 'warning', 'danger', 'info', 'primary']; return types[job] || 'info'; }; // 获取数据 const fetchData = async () => { const params = { page: queryParams.pageNum, pageSize: queryParams.pageSize, name: queryParams.name, gender: queryParams.gender, job: queryParams.job, begin: queryParams.dateRange[0] || '', end: queryParams.dateRange[1] || '' }; try { const res = await apiClient.get('', { params }); if (res.data.code === 1) { tableData.value = res.data.data.rows.map(item => ({ ...item, // 格式化最后修改时间 updateTime: formatDateTime(item.updateTime) })); total.value = res.data.data.total; } else { ElMessage.error('获取数据失败:' + res.data.msg); } } catch (error) { console.error('请求出错:', error); ElMessage.error('网络请求失败,请检查后端是否运行正常'); } }; // 时间格式化函数 const formatDateTime = (dateTime) => { if (!dateTime) return ''; // 如果是字符串直接返回 if (typeof dateTime === 'string') { // 尝试解析ISO格式时间 try { const date = new Date(dateTime); return date.toLocaleString('zh-CN', { year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit', second: '2-digit' }).replace(/\//g, '-'); } catch (e) { return dateTime; } } // 如果是Date对象或时间戳 const date = new Date(dateTime); return date.toLocaleString('zh-CN', { year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit', second: '2-digit' }).replace(/\//g, '-'); }; // 显示新增对话框 const showAddDialog = () => { dialogTitle.value = '新增员工'; isEdit.value = false; Object.assign(form, { id: null, username: '', password: '', name: '', gender: null, job: null, image: '', entrydate: '' }); dialogVisible.value = true; }; // 显示编辑对话框 const handleEdit = (row) => { dialogTitle.value = '编辑员工'; isEdit.value = true; Object.assign(form, { ...row }); dialogVisible.value = true; }; // 提交表单 const submitForm = async () => { try { await formRef.value.validate(); if (isEdit.value) { await apiClient.put('', form); ElMessage.success('员工信息更新成功'); } else { await apiClient.post('', form); ElMessage.success('员工添加成功'); } dialogVisible.value = false; fetchData(); } catch (error) { if (error.name !== 'Error') { console.error('保存失败:', error); ElMessage.error('操作失败:' + (error.response?.data?.message || error.message)); } } }; // 删除员工 const handleDelete = async (id) => { try { await ElMessageBox.confirm(确认删除ID为 ${id} 的员工吗?, '删除确认', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }); await apiClient.delete(/${[id]}); ElMessage.success('删除成功'); fetchData(); } catch (error) { if (error !== 'cancel') { console.error('删除失败:', error); ElMessage.error('删除失败:' + (error.response?.data?.message || error.message)); } } }; // 批量删除 const batchDelete = async () => { if (selectedRows.value.length === 0) { ElMessage.warning('请至少选择一条记录'); return; } try { const ids = selectedRows.value.map(item => item.id); await ElMessageBox.confirm(确认删除选中的 ${ids.length} 条员工吗?, '批量删除确认', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }); await apiClient.delete(/${ids}); ElMessage.success(成功删除 ${ids.length} 条记录); fetchData(); } catch (error) { if (error !== 'cancel') { console.error('批量删除失败:', error); ElMessage.error('删除失败:' + (error.response?.data?.message || error.message)); } } }; // 表格选择监听 const handleSelectionChange = (rows) => { selectedRows.value = rows; }; // 处理分页大小变化 const handleSizeChange = (size) => { queryParams.pageSize = size; fetchData(); }; // 初始化加载数据 onMounted(() => { fetchData(); }); </script> <style scoped> /* 全局样式 */ .app-header { background-color: #fff; box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08); display: flex; align-items: center; padding: 0 20px; z-index: 1; } .app-title { margin: 0; font-size: 18px; font-weight: 600; color: #333; } .app-content { padding: 20px; background-color: #f0f2f5; height: calc(100vh - 60px); overflow-y: auto; } .query-section { background: #fff; padding: 20px; border-radius: 4px; margin-bottom: 20px; box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); } .table-section { background: #fff; padding: 20px; border-radius: 4px; margin-bottom: 20px; box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); } .pagination-section { display: flex; justify-content: center; background: #fff; padding: 15px 0; border-radius: 4px; box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); } .action-buttons { display: flex; justify-content: flex-end; } .form-actions { display: flex; justify-content: center; margin-top: 20px; } .avatar-preview { display: flex; justify-content: center; margin-top: 10px; } .el-avatar { background-color: #f5f7fa; display: flex; align-items: center; justify-content: center; } .el-avatar i { color: #909399; } /* 优化对话框样式 */ .el-dialog__body { padding: 20px 25px; } /* 调整操作列按钮间距 */ .el-table .el-button { margin: 0 5px; } /* 确保选择器宽度100% */ .el-select { width: 100%; } </style> 优化一下代码去除无用代码使代码更简洁,优化一下样式,创建时间和最后修改时间显示的效果不同 创建时间2025-06-26T09:12:34 最后修改时间2025-06-29 21:47:21 优化成最后修改时间这种显示效果

<template> <a-card :class="$style.wrapHeight"> <a-card :class="$style.searchWrap"> <a-form-model ref="searchForm" class="ant-advanced-search-form" :model="factConfirmAdvSearchForm" :rules="rules" v-bind="formItemLayout" > <a-row> <a-col :span="8"> <a-form-model-item :label="'\u2002年度'" prop="timeRange" > <AuditRangePicker ref = "rangePicker" v-model="factConfirmAdvSearchForm.timeRange" :time-range.sync="factConfirmAdvSearchForm.timeRange" /> </a-form-model-item> </a-col> <a-col :span="8"> <a-form-model-item label="审计机构" prop="unitNames"> <AuditGroupPicker ref="unitNames" v-model="factConfirmAdvSearchForm.unitNames" :single="false" :read-only="false" :root-node="rootNode" /> </a-form-model-item> </a-col> <a-col :span="8"> <a-form-model-item label="项目名称" prop="projectName"> <a-input v-model="factConfirmAdvSearchForm.projectName" /> </a-form-model-item> </a-col> </a-row> <a-row> <a-col :span="8"> <a-form-model-item :label="'\u2002\u2002被审计部门'" prop="auditedUnitNames"> <sd-group-picker v-model="factConfirmAdvSearchForm.auditedUnitNames" /> </a-form-model-item> </a-col> <a-col :span="8"> <a-form-model-item label="问题名称" prop="problemName"> <a-input v-model="factConfirmAdvSearchForm.problemName" /> </a-form-model-item> </a-col> <a-col :span="8"> <a-form-model-item label="业务类别" prop="problemType"> <a-input v-model="factConfirmAdvSearchForm.problemType" /> </a-form-model-item> </a-col> </a-row> <a-row> <a-col :span="8"> <a-form-model-item :label="'\u2002\u2002\u2002\u2002风险等级'" prop="riskLevel"> <sd-select v-model="factConfirmAdvSearchForm.riskLevel" :options="riskLevelOption" :class="$style.select" allowClear /> </a-form-model-item> </a-col> <a-col :span="8"> <a-form-model-item label="新老问题" prop="isNewproblems"> <sd-select v-model="factConfirmAdvSearchForm.isNewproblems" :options="isNewproblemsOption" :class="$style.select" allowClear /> </a-form-model-item> </a-col> <a-col :span="8"> <a-form-model-item label="问题来源" prop="problemSource"> <sd-select v-model="factConfirmAdvSearchForm.problemSource" :options="problemSourceOption" :class="$style.select" allowClear /> </a-form-model-item> </a-col> </a-row> <a-row> <a-col :span="8"> <a-form-model-item label="问题确认状态" prop="feedbackStatus"> <sd-select v-model="factConfirmAdvSearchForm.feedbackStatus" :options="feedbackStatusOption" :class="$style.select" allowClear /> </a-form-model-item> </a-col> <a-col :span="8"> <a-form-model-item label="项目来源" prop="projectSourceType"> <a-radio-group v-model="factConfirmAdvSearchForm.projectSourceType"> <a-radio v-for="option in projectSourceOptions" :key="option.id" :value="option.id"> {{ option.text }} </a-radio> </a-radio-group> </a-form-model-item> </a-col> <a-col :span="8" :class="$style.searchbutton"> <a-button @click="handleReset">重置</a-button> <a-button type="primary" @click="advSJBGSearch">查询</a-button> <a-button type="primary" @click="exportData">导出</a-button> </a-col> </a-row> </a-form-model> </a-card> <a-card class="reporttablecardxm"> <sd-data-table ref="SJBGDataTable" :columns="columns" :filter-expressions="expressions" data-url="api/xcoa-mobile/v1/audit-fact-confirm/searchList" > </sd-data-table> </a-card> </a-card> </template> <script> import iamAuditWorkMixins from '@product/iam/audit/work/iam-audit-work-mixins' import axios from '@/common/services/axios-instance' import { getUserInfo } from '@/common/store-mixin' import auditAdvancedQuery from '../../components/audit-advanced-query.vue' import AuditGroupPicker from '../../components/picker/audit-group-picker.vue' import auditAdvancedQueryMixins from '../../components/audit-advanced-query-mixins' import components from './_import-components/audit-statistics-confirm--list-import' import StatisticsService from './statistics-service' import AuditRangePicker from '@product/iam/components/picker/audit-range-picker.vue' import download from '@/common/services/download' import TableActionTypes from '@/common/services/table-action-types' import moment from 'moment' export default { name: 'AuditStatisticsConfirmList', metaInfo: { title: '事实确认查询', }, components: { AuditRangePicker, auditAdvancedQuery, AuditGroupPicker, ...components, }, mixins: [auditAdvancedQueryMixins, iamAuditWorkMixins], data() { return { rootNode: {}, currentYear: new Date().getFullYear(), projectId: this.$route.query.projectId, activeKey: '1', expressions: [], auditTypeOptions: [], formItemLayout: { labelCol: { span: 6 }, wrapperCol: { span: 14 }, }, rules: { timeRange: [{ required: true, message: '请选择统计时间', trigger: 'change' }], unitNames: [{ required: true, message: '请选择审计机构', trigger: 'change' }], }, factConfirmAdvSearchForm: { timeRange: [moment(), moment()], dateStart: '', dateEnd: '', auditedUnitIds: '', unitIds: '', auditedUnitNames: [], unitNames: [], problemName: '', projectName: '', problemType: '', riskLevel: '', isAccountability: '', isNewproblems: [], problemSource: [], feedbackStatus: [], projectSourceType: '', }, riskLevelOption: [], problemTypeOption: [], isAccountabilityOption: [], projectSourceOptions: [ { text: '内部审计项目', id: '1' }, { text: '外部审计项目', id: '2' } ], columns: [ { title: '序号', customRender: (text, record, index) => ${index + 1}, width: '80px', }, { title: '项目名称', dataIndex: 'projectname', width: '200px', }, { title: '问题名称', dataIndex: 'problemname', scopedSlots: { customRender: 'islink' }, }, { title: '业务类型', dataIndex: 'problemtype', }, { title: '风险等级', dataIndex: 'risklevel', }, { title: '问题来源', dataIndex: 'problemsource', }, { title: '新老问题', dataIndex: 'isnewproblems', }, { title: '问题描述', dataIndex: 'problemdesc', }, { title: '被审计部门反馈意见', dataIndex: 'feedbackopinion', }, { title: '问题原因', dataIndex: 'problemreason', width: '200px', }, { title: '问题整改措施', dataIndex: 'measure', width: '200px', }, { title: '问题涉及部门', dataIndex: 'involveddepartmentnames', }, { title: '问题涉及联系人', dataIndex: 'involvedcontactsnames', }, { title: '问题确认状态', dataIndex: 'feedbackstatus', }, ], actions: [ { label: '导出', id: 'export', type: TableActionTypes.primary, permission: null, callback: () => { this.exportData() }, }, ], itemStatusOptions: [], auditModeOptions: [], changeTypeOptions: [], showOpinionModal: false, problemSourceOption: [], feedbackStatusOption: [ { id: '未确认', name: '未确认' }, { id: '已确认', name: '已确认' }, ], isNewproblemsOption: [], pending: [], batchSubmitSucceed: [], batchsubmitFailed: [], } }, created() { let userInfo = getUserInfo() const params = { orgId: userInfo.deptId, } axios({ url: 'api/xcoa-mobile/v1/iamorg/getCurrentUserGroup', method: 'get', }).then((res) => { userInfo = res.data params.orgId = res.data.id axios({ url: 'api/xcoa-mobile/v1/iamorg/findIamOrgId', method: 'post', params, }).then((res) => { this.id = res.data const deptCode = userInfo.id.toString() const deptName = userInfo.name this.rootNode = { code: deptCode, name: deptName, id: this.id } }) }) }, mounted() { StatisticsService.getDictionary('GY_PROBLEM_TYPE').then((res) => { this.riskLevelOption = res.data }) StatisticsService.getDictionary('GY_PROBLEM_SOURCE').then((res) => { this.problemSourceOption = res.data }) StatisticsService.getDictionary('GY_NEW_PROBLEM').then((res) => { this.isNewproblemsOption = res.data }) this.$nextTick(() => { if (this.$refs.rangePicker) { this.$refs.rangePicker.value = this.factConfirmAdvSearchForm.timeRange } }) }, methods: { getSelectIdValue(selectValue) { if (!selectValue) return null; if (Array.isArray(selectValue) && selectValue.length > 0 && selectValue[0].id) { return selectValue[0].id; } if (typeof selectValue === 'object' && selectValue.id) { return selectValue.id; } return null; }, // 重置 handleReset() { this.factConfirmAdvSearchForm = { timeRange: [], dateStart: '', dateEnd: '', auditedUnitIds: '', unitIds: '', auditedUnitNames: [], unitNames: [], problemName: '', projectName: '', problemType: '', riskLevel: '', isAccountability: '', isNewproblems: [], problemSource: [], feedbackStatus: [], projectSourceType: '', } this.$refs.searchForm.resetFields(); }, // 导出数据 exportData() { this.$refs.searchForm.validate((valid) => { if (valid) { this.advSJBGSearch() const url = api/xcoa-mobile/v1/audit-fact-confirm/export const fname = '事实确认列表.xls' download({ url, method: 'post', data: { expressions: this.expressions, maxResults: -1 } }, fname) } }) }, // 查看当前登录人是否项目成员 inProjectUser(userList) { return userList.some(item => item.userAccount === getUserInfo().account); }, // 刷新列表 refresh() { this.$refs.SJBGDataTable.refresh() }, // 查询方法 advSJBGSearch() { this.$refs.searchForm.validate((valid) => { if (valid) { this.expressions = [] // 修改时间范围处理逻辑 if (this.factConfirmAdvSearchForm.timeRange && Array.isArray(this.factConfirmAdvSearchForm.timeRange) && this.factConfirmAdvSearchForm.timeRange.length >= 2) { const [startDate, endDate] = this.factConfirmAdvSearchForm.timeRange if (startDate && endDate) { this.expressions.push({ dataType: 'str', name: 'dateStart', op: 'eq', stringValue: moment(startDate).year() + '', }) this.expressions.push({ dataType: 'str', name: 'dateEnd', op: 'eq', stringValue: moment(endDate).year() + '', }) } } // 审计机构 if (this.factConfirmAdvSearchForm.unitNames) { const codes = this.factConfirmAdvSearchForm.unitNames.map(item => item.code); this.expressions.push({ dataType: 'str', name: 'unitIds', op: 'eq', stringValue: ${codes.join(',')}, }) } // 被审计单位 if (this.factConfirmAdvSearchForm.auditedUnitNames) { const codes = this.factConfirmAdvSearchForm.auditedUnitNames.map(item => item.code); this.expressions.push({ dataType: 'str', name: 'auditedUnitIds', op: 'eq', stringValue: ${codes.join(',')}, }) } if (this.factConfirmAdvSearchForm.problemName) { this.expressions.push({ dataType: 'str', name: 'problemName', op: 'like', stringValue: %${this.factConfirmAdvSearchForm.problemName}%, }) } if (this.factConfirmAdvSearchForm.projectName) { this.expressions.push({ dataType: 'str', name: 'projectName', op: 'like', stringValue: %${this.factConfirmAdvSearchForm.projectName}%, }) } if (this.factConfirmAdvSearchForm.problemType) { this.expressions.push({ dataType: 'str', name: 'problemType', op: 'eq', stringValue: ${this.factConfirmAdvSearchForm.problemType}, }) } const riskLevelId = this.getSelectIdValue(this.factConfirmAdvSearchForm.riskLevel); console.log('风险等级'+riskLevelId) if (riskLevelId) { this.expressions.push({ dataType: 'str', name: 'riskLevel', op: 'eq', stringValue: riskLevelId, }) } if (this.factConfirmAdvSearchForm.isAccountability) { this.expressions.push({ dataType: 'str', name: 'isAccountability', op: 'eq', stringValue: ${this.factConfirmAdvSearchForm.isAccountability}, }) } const isNewproblemsId = this.getSelectIdValue(this.factConfirmAdvSearchForm.isNewproblems); console.log('是否新问题'+isNewproblemsId) if (isNewproblemsId) { this.expressions.push({ dataType: 'str', name: 'isNewproblems', op: 'eq', stringValue: isNewproblemsId, }) } const problemSourceId = this.getSelectIdValue(this.factConfirmAdvSearchForm.problemSource); console.log('问题来源'+problemSourceId) if (problemSourceId) { this.expressions.push({ dataType: 'str', name: 'problemSource', op: 'eq', stringValue: problemSourceId, }) } const feedbackStatusId = this.getSelectIdValue(this.factConfirmAdvSearchForm.feedbackStatus); console.log('问题反馈状态'+problemSourceId) if (feedbackStatusId) { this.expressions.push({ dataType: 'str', name: 'feedbackStatus', op: 'eq', stringValue: feedbackStatusId, }) } // 新增项目来源筛选 if (this.factConfirmAdvSearchForm.projectSourceType) { this.expressions.push({ dataType: 'str', name: 'projectSource', op: 'eq', stringValue: ${this.factConfirmAdvSearchForm.projectSourceType}, }) } } }) }, }, } </script> <style module lang="scss"> @use '@/common/design' as *; /* 为下拉框添加清除按钮后的样式调整 */ .select { :global { .ant-select-selection--single { padding-right: 24px; /* 为清除按钮留出空间 */ } .ant-select-arrow { right: 11px; /* 调整箭头位置 */ } } } </style> 加一个表头冻结功能

大家在看

recommend-type

商品条形码及生产日期识别数据集

商品条形码及生产日期识别数据集,数据集样本数量为2156,所有图片已标注为YOLO txt格式,划分为训练集、验证集和测试集,能直接用于YOLO算法的训练。可用于跟本识别目标相关的蓝桥杯比赛项目
recommend-type

7.0 root.rar

Android 7.0 MTK MT8167 user 版本root权限修改,super权限修改,当第三方APP想要获取root权限时,会弹出窗口访问是否给与改APP root权限,同意后该APP可以得到root权限,并操作相关内容
recommend-type

RK3308开发资料

RK3308全套资料,《06 RK3308 硬件设计介绍》《07 RK3308 软件方案介绍》《08 RK3308 Audio开发介绍》《09 RK3308 WIFI-BT功能及开发介绍》
recommend-type

即时记截图精灵 v2.00.rar

即时记截图精灵是一款方便易用,功能强大的专业截图软件。   软件当前版本提供以下功能:   1. 可以通过鼠标选择截图区域,选择区域后仍可通过鼠标进行边缘拉动或拖拽来调整所选区域的大小和位置。   2. 可以将截图复制到剪切板,或者保存为图片文件,或者自动打开windows画图程序进行编辑。   3. 保存文件支持bmp,jpg,png,gif和tif等图片类型。   4. 新增新浪分享按钮。
recommend-type

WinUSB4NuVCOM_NUC970+NuWriter.rar

NUC970 USB启动所需的USB驱动,已经下载工具NuWriter,可以用于裸机启动NUC970调试,将USB接电脑后需要先安装WinUSB4NuVCOM_NUC970驱动,然后使用NuWriter初始化硬件,之后就可以使用jlink或者ulink调试。

最新推荐

recommend-type

C#类库封装:简化SDK调用实现多功能集成,构建地磅无人值守系统

内容概要:本文介绍了利用C#类库封装多个硬件设备的SDK接口,实现一系列复杂功能的一键式调用。具体功能包括身份证信息读取、人证识别、车牌识别(支持臻识和海康摄像头)、LED显示屏文字输出、称重数据读取、二维码扫描以及语音播报。所有功能均被封装为简单的API,极大降低了开发者的工作量和技术门槛。文中详细展示了各个功能的具体实现方式及其应用场景,如身份证读取、人证核验、车牌识别等,并最终将这些功能整合到一起,形成了一套完整的地磅称重无人值守系统解决方案。 适合人群:具有一定C#编程经验的技术人员,尤其是需要快速集成多种硬件设备SDK的应用开发者。 使用场景及目标:适用于需要高效集成多种硬件设备SDK的项目,特别是那些涉及身份验证、车辆管理、物流仓储等领域的企业级应用。通过使用这些封装好的API,可以大大缩短开发周期,降低维护成本,提高系统的稳定性和易用性。 其他说明:虽然封装后的API极大地简化了开发流程,但对于一些特殊的业务需求,仍然可能需要深入研究底层SDK。此外,在实际部署过程中,还需考虑网络环境、硬件兼容性等因素的影响。
recommend-type

基于STM32F1的BLDC无刷直流电机与PMSM永磁同步电机源码解析:传感器与无传感器驱动详解

基于STM32F1的BLDC无刷直流电机和PMSM永磁同步电机的驱动实现方法,涵盖了有传感器和无传感两种驱动方式。对于BLDC电机,有传感器部分采用霍尔传感器进行六步换相,无传感部分则利用反电动势过零点检测实现换相。对于PMSM电机,有传感器部分包括霍尔传感器和编码器的方式,无传感部分则采用了滑模观测器进行矢量控制(FOC)。文中不仅提供了详细的代码片段,还分享了许多调试经验和技巧。 适合人群:具有一定嵌入式系统和电机控制基础知识的研发人员和技术爱好者。 使用场景及目标:适用于需要深入了解和实现BLDC和PMSM电机驱动的开发者,帮助他们掌握不同传感器条件下的电机控制技术和优化方法。 其他说明:文章强调了实际调试过程中可能遇到的问题及其解决方案,如霍尔传感器的中断触发换相、反电动势过零点检测的采样时机、滑模观测器的参数调整以及编码器的ABZ解码等。
recommend-type

基于Java的跨平台图像处理软件ImageJ:多功能图像编辑与分析工具

内容概要:本文介绍了基于Java的图像处理软件ImageJ,详细阐述了它的跨平台特性、多线程处理能力及其丰富的图像处理功能。ImageJ由美国国立卫生研究院开发,能够在多种操作系统上运行,包括Windows、Mac OS、Linux等。它支持多种图像格式,如TIFF、PNG、GIF、JPEG、BMP、DICOM、FITS等,并提供图像栈功能,允许多个图像在同一窗口中进行并行处理。此外,ImageJ还提供了诸如缩放、旋转、扭曲、平滑处理等基本操作,以及区域和像素统计、间距、角度计算等高级功能。这些特性使ImageJ成为科研、医学、生物等多个领域的理想选择。 适合人群:需要进行图像处理的专业人士,如科研人员、医生、生物学家,以及对图像处理感兴趣的普通用户。 使用场景及目标:适用于需要高效处理大量图像数据的场合,特别是在科研、医学、生物学等领域。用户可以通过ImageJ进行图像的编辑、分析、处理和保存,提高工作效率。 其他说明:ImageJ不仅功能强大,而且操作简单,用户无需安装额外的运行环境即可直接使用。其基于Java的开发方式确保了不同操作系统之间的兼容性和一致性。
recommend-type

MATLAB语音识别系统:基于GUI的数字0-9识别及深度学习模型应用 · GUI v1.2

内容概要:本文介绍了一款基于MATLAB的语音识别系统,主要功能是识别数字0到9。该系统采用图形用户界面(GUI),方便用户操作,并配有详尽的代码注释和开发报告。文中详细描述了系统的各个组成部分,包括音频采集、信号处理、特征提取、模型训练和预测等关键环节。此外,还讨论了MATLAB在此项目中的优势及其面临的挑战,如提高识别率和处理背景噪音等问题。最后,通过对各模块的工作原理和技术细节的总结,为未来的研究和发展提供了宝贵的参考资料。 适合人群:对语音识别技术和MATLAB感兴趣的初学者、学生或研究人员。 使用场景及目标:适用于希望深入了解语音识别技术原理的人群,特别是希望通过实际案例掌握MATLAB编程技巧的学习者。目标是在实践中学习如何构建简单的语音识别应用程序。 其他说明:该程序需要MATLAB 2019b及以上版本才能正常运行,建议使用者确保软件环境符合要求。
recommend-type

c语言通讯录管理系统源码.zip

C语言项目源码
recommend-type

Teleport Pro教程:轻松复制网站内容

标题中提到的“复制别人网站的软件”指向的是一种能够下载整个网站或者网站的特定部分,然后在本地或者另一个服务器上重建该网站的技术或工具。这类软件通常被称作网站克隆工具或者网站镜像工具。 描述中提到了一个具体的教程网址,并提到了“天天给力信誉店”,这可能意味着有相关的教程或资源可以在这个网店中获取。但是这里并没有提供实际的教程内容,仅给出了网店的链接。需要注意的是,根据互联网法律法规,复制他人网站内容并用于自己的商业目的可能构成侵权,因此在此类工具的使用中需要谨慎,并确保遵守相关法律法规。 标签“复制 别人 网站 软件”明确指出了这个工具的主要功能,即复制他人网站的软件。 文件名称列表中列出了“Teleport Pro”,这是一款具体的网站下载工具。Teleport Pro是由Tennyson Maxwell公司开发的网站镜像工具,允许用户下载一个网站的本地副本,包括HTML页面、图片和其他资源文件。用户可以通过指定开始的URL,并设置各种选项来决定下载网站的哪些部分。该工具能够帮助开发者、设计师或内容分析人员在没有互联网连接的情况下对网站进行离线浏览和分析。 从知识点的角度来看,Teleport Pro作为一个网站克隆工具,具备以下功能和知识点: 1. 网站下载:Teleport Pro可以下载整个网站或特定网页。用户可以设定下载的深度,例如仅下载首页及其链接的页面,或者下载所有可访问的页面。 2. 断点续传:如果在下载过程中发生中断,Teleport Pro可以从中断的地方继续下载,无需重新开始。 3. 过滤器设置:用户可以根据特定的规则过滤下载内容,如排除某些文件类型或域名。 4. 网站结构分析:Teleport Pro可以分析网站的链接结构,并允许用户查看网站的结构图。 5. 自定义下载:用户可以自定义下载任务,例如仅下载图片、视频或其他特定类型的文件。 6. 多任务处理:Teleport Pro支持多线程下载,用户可以同时启动多个下载任务来提高效率。 7. 编辑和管理下载内容:Teleport Pro具备编辑网站镜像的能力,并可以查看、修改下载的文件。 8. 离线浏览:下载的网站可以在离线状态下浏览,这对于需要测试网站在不同环境下的表现的情况十分有用。 9. 备份功能:Teleport Pro可以用来备份网站,确保重要数据的安全。 在实际使用此类工具时,需要注意以下几点: - 著作权法:复制网站内容可能侵犯原作者的版权,因此在使用此类工具时,必须确保有合法权利去下载和使用目标网站的内容。 - 服务条款:许多网站的服务条款明确禁止未经授权的网站克隆。因此,在使用此类软件之前,应当仔细阅读并遵守目标网站的服务条款。 - 数据隐私:下载含有个人数据的网站可能触及隐私保护法律,特别是在欧洲通用数据保护条例(GDPR)等法规的环境下。 - 网络安全:随意下载网站可能导致恶意软件和病毒的传播,用户应当使用最新的反病毒软件,并在安全的环境中进行操作。 综上所述,虽然“复制别人网站的软件”在技术上是可行的,且可以用于多种正当目的,但在使用此类工具时,必须遵守法律法规和道德规范,不可侵犯他人的合法权益。
recommend-type

【跨平台开发者的必读】:解决Qt5Widgetsd.lib目标计算机类型冲突终极指南

# 1. 跨平台开发与Qt框架简介 跨平台开发已经成为现代软件开发中不可或缺的一部分,它使得开发者能够构建出能够在多种操作系统上运行的应用程序,从而触及更广泛的用户群体。在这其中,Qt框架作为一套成熟的跨平台应用程序和用户界面框架,扮演着关键角色。Qt不仅仅是一个跨平台的工具集,它的设计哲学还包含了模块化和可扩展性,使其能够适应各种规模和复杂度的项目。本章节我们将简要介绍
recommend-type

普通RNN结构和特点

<think>首先,用户的问题是:“我想了解普通RNN的结构及其特点请问RNN循环神经网络结构特点工作原理”。这涉及到RNN的结构、特点和工作原理。根据系统级指令:-所有行内数学表达式必须使用$...$格式。-独立公式必须使用$$...$$格式并单独成段。-LaTeX语法正确。-使用中文回答。-生成相关问题。-回答中引用的段落末尾自然地添加引用标识。用户可见层指令:-回答结构清晰,帮助用户逐步解决问题。-保证回答真实可靠。参考站内引用:-引用[1]:关于RNN的基本介绍,为什么需要RNN。-引用[2]:关于RNN的工作原理、结构图,以及与其他网络的比较。用户上一次的问题和我的回答:用户是第一次
recommend-type

探讨通用数据连接池的核心机制与应用

根据给定的信息,我们能够推断出讨论的主题是“通用数据连接池”,这是一个在软件开发和数据库管理中经常用到的重要概念。在这个主题下,我们可以详细阐述以下几个知识点: 1. **连接池的定义**: 连接池是一种用于管理数据库连接的技术,通过维护一定数量的数据库连接,使得连接的创建和销毁操作更加高效。开发者可以在应用程序启动时预先创建一定数量的连接,并将它们保存在一个池中,当需要数据库连接时,可以直接从池中获取,从而降低数据库连接的开销。 2. **通用数据连接池的概念**: 当提到“通用数据连接池”时,它意味着这种连接池不仅支持单一类型的数据库(如MySQL、Oracle等),而且能够适应多种不同数据库系统。设计一个通用的数据连接池通常需要抽象出一套通用的接口和协议,使得连接池可以兼容不同的数据库驱动和连接方式。 3. **连接池的优点**: - **提升性能**:由于数据库连接创建是一个耗时的操作,连接池能够减少应用程序建立新连接的时间,从而提高性能。 - **资源复用**:数据库连接是昂贵的资源,通过连接池,可以最大化现有连接的使用,避免了连接频繁创建和销毁导致的资源浪费。 - **控制并发连接数**:连接池可以限制对数据库的并发访问,防止过载,确保数据库系统的稳定运行。 4. **连接池的关键参数**: - **最大连接数**:池中能够创建的最大连接数。 - **最小空闲连接数**:池中保持的最小空闲连接数,以应对突发的连接请求。 - **连接超时时间**:连接在池中保持空闲的最大时间。 - **事务处理**:连接池需要能够管理不同事务的上下文,保证事务的正确执行。 5. **实现通用数据连接池的挑战**: 实现一个通用的连接池需要考虑到不同数据库的连接协议和操作差异。例如,不同的数据库可能有不同的SQL方言、认证机制、连接属性设置等。因此,通用连接池需要能够提供足够的灵活性,允许用户配置特定数据库的参数。 6. **数据连接池的应用场景**: - **Web应用**:在Web应用中,为了处理大量的用户请求,数据库连接池可以保证数据库连接的快速复用。 - **批处理应用**:在需要大量读写数据库的批处理作业中,连接池有助于提高整体作业的效率。 - **微服务架构**:在微服务架构中,每个服务可能都需要与数据库进行交互,通用连接池能够帮助简化服务的数据库连接管理。 7. **常见的通用数据连接池技术**: - **Apache DBCP**:Apache的一个Java数据库连接池库。 - **C3P0**:一个提供数据库连接池和控制工具的开源Java框架。 - **HikariCP**:目前性能最好的开源Java数据库连接池之一。 - **BoneCP**:一个高性能的开源Java数据库连接池。 - **Druid**:阿里巴巴开源的一个数据库连接池,提供了对性能监控的高级特性。 8. **连接池的管理与监控**: 为了保证连接池的稳定运行,开发者需要对连接池的状态进行监控,并对其进行适当的管理。监控指标可能包括当前活动的连接数、空闲的连接数、等待获取连接的请求队列长度等。一些连接池提供了监控工具或与监控系统集成的能力。 9. **连接池的配置和优化**: 连接池的性能与连接池的配置密切相关。需要根据实际的应用负载和数据库性能来调整连接池的参数。例如,在高并发的场景下,可能需要增加连接池中连接的数量。另外,适当的线程池策略也可以帮助连接池更好地服务于多线程环境。 10. **连接池的应用案例**: 一个典型的案例是电商平台在大型促销活动期间,用户访问量激增,此时通用数据连接池能够保证数据库操作的快速响应,减少因数据库连接问题导致的系统瓶颈。 总结来说,通用数据连接池是现代软件架构中的重要组件,它通过提供高效的数据库连接管理,增强了软件系统的性能和稳定性。了解和掌握连接池的原理及实践,对于任何涉及数据库交互的应用开发都至关重要。在实现和应用连接池时,需要关注其设计的通用性、配置的合理性以及管理的有效性,确保在不同的应用场景下都能发挥出最大的效能。
recommend-type

【LabVIEW网络通讯终极指南】:7个技巧提升UDP性能和安全性

# 摘要 本文系统介绍了LabVIEW在网络通讯中的应用,尤其是针对UDP协议的研究与优化。首先,阐述了UDP的原理、特点及其在LabVIEW中的基础应用。随后,本文深入探讨了通过调整数据包大小、实现并发通信及优化缓冲区管理等技巧来优化UDP性能的LabVIEW方法。接着,文章聚焦于提升UDP通信安全性,介绍了加密技术和认证授权机制在LabVIEW中的实现,以及防御网络攻击的策略。最后,通过具体案例展示了LabVIEW在实时数据采集和远程控制系统中的高级应用,并展望了LabVIEW与UDP通讯技术的未来发展趋势及新兴技术的影响。 # 关键字 LabVIEW;UDP网络通讯;性能优化;安全性;