当前位置: 首页 > article >正文

使用vue3+element plus 的table自制的穿梭框(支持多列数据)

目录

一、效果图

二、介绍

三、代码区


一、效果图

话不多说,先上图

二、介绍

项目需要:通过穿梭框选择人员信息,可以根据部门、岗位进行筛选,需要显示多列(不光显示姓名,还包括人员的一些基础信息);项目前端用的是vue3+element plus(Transfer 组件 | Element Plus),原来打算使用element的组件 Transfer 穿梭框,发现它只实现简单的单列穿梭,无法满足需求。最后打算自己动手用table来实现:分为左右两个区域,左边查询区+待选数据列表table,右边选中的数据列表,中间两个按钮实现数据的转移。(在看的小伙伴有其他更合适的组件/组件库可以评论区分享)

三、代码区

html

    <el-dialog :title="title" :lock-scroll="false" v-model="open" :fullscreen="fullScreen" :close-on-click-modal="false":close-on-press-escape="false" align-center><el-form ref="formRef" :model="form" :rules="rules" label-width="100px"><el-row :gutter="10"><el-col :lg="6"><el-form-item label="生产线" prop="lineCode"><el-select clearable v-model="form.lineCode" placeholder="请选择生产线" filterable@change="formLineSelectChange" style="width: 100%;"><el-option v-for="item in options.mes_line_list" :key="item.id" :label="item.lineName":value="item.lineCode"><span class="fl">{{ item.innerLineCode }}</span><span class="fr" style="color: var(--el-text-color-secondary);">{{ item.lineName }}</span></el-option></el-select></el-form-item></el-col><el-col :lg="4"><el-form-item label="标准工时" prop="standardWorkHours"><el-input-number v-model="form.standardWorkHours" :min="0" :max="24" :precision="1" placeholder="请输入标准工时"style="width: 100%;" /></el-form-item></el-col><el-col :lg="4"><el-form-item label="日期" prop="workDate"><el-date-picker v-model="form.workDate" type="date" placeholder="日期" value-format="YYYY-MM-DD":shortcuts="shortcutsWorkDate" style="width: 100%;"></el-date-picker></el-form-item></el-col><el-col :lg="4"><el-form-item label="班次" prop="workShift"><el-select clearable v-model="form.workShift" placeholder="请选择生产班次" style="width: 100%;"><el-option v-for="item in options.mes_classes_type" :key="item.dictValue" :label="item.dictLabel":value="item.dictValue"></el-option></el-select></el-form-item></el-col><el-col :lg="6"><el-form-item label="备注信息" prop="remark"><el-input v-model="form.remark" placeholder="请输入备注信息" style="width: 100%;" type="textarea" :rows="2" /></el-form-item></el-col></el-row><el-divider content-position="center">报工人员明细</el-divider><!-- 查询条件 --><el-form :model="queryParamsUserNav" label-position="right" inline ref="queryRefUserNav"><el-form-item label="部门" prop="deptId"><el-tree-select v-model="queryParamsUserNav.deptId" :data="deptOptions":props="{ value: 'id', label: 'label', children: 'children' }" value-key="id" placeholder="请选择归属部门"check-strictly :render-after-expand="false" @change="changeDept($event)" filterable /></el-form-item><el-form-item label="岗位" prop="postId"><el-select v-model="queryParamsUserNav.postId" placeholder="请选择岗位" filterable clearable@change="changePost"><el-option v-for="item in postOptions" :key="item.postId" :label="item.postName" :value="item.postId"><span class="fl">{{ item.postCode }}</span><span class="fr" style="color: var(--el-text-color-secondary);">{{ item.postName }}</span></el-option></el-select></el-form-item><el-form-item label="用户" prop="userId"><el-select v-model="queryParamsUserNav.userId" placeholder="请选择用户" filterable clearable><el-option v-for="item in userOptions" :key="item.userId" :label="item.nickName" :value="item.userId"><span class="fl">{{ item.nickName }}</span><span class="fr" style="color: var(--el-text-color-secondary);">{{ item.userName }}</span></el-option></el-select></el-form-item><el-form-item><el-button icon="search" type="primary" @click="handleQueryUserNav">{{ $t('btn.search') }}</el-button><el-button icon="refresh" @click="resetQueryUserNav">{{ $t('btn.reset') }}</el-button></el-form-item></el-form><!-- 自制穿梭框 --><el-row><!-- 左边table --><el-col :lg="10" style="height: 100%;"><div class="table-container"><el-table :data="dataListLeft" v-loading="loadingLeft" ref="table" borderheader-cell-class-name="el-table-header-cell" highlight-current-row@selection-change="handleSelectionChangeLeft" :height="tableHeight - 40"><el-table-column type="selection" width="50" align="center" /><el-table-column type="index" width="60" label="序号" align="center" /><el-table-column prop="deptName" label="部门" align="center" /><el-table-column prop="userName" label="工号" align="center" /><el-table-column prop="nickName" label="姓名" align="center" /><el-table-column prop="postNames" label="岗位" align="center" /></el-table><pagination :total="totalLeft" v-model:page="queryParamsUserNav.pageNum"v-model:limit="queryParamsUserNav.pageSize" @pagination="handleQueryUserNav" /></div></el-col><!-- 向左箭头 --><el-col :lg="1" align="right"style="margin: 0.5%; display: flex; align-items: center; justify-content: center;"><el-button type="primary" icon="arrow-left" @click="handleLeftArrow"></el-button></el-col><!-- 向右箭头 --><el-col :lg="1" align="left"style="margin: 0.5%; display: flex; align-items: center; justify-content: center;"><el-button type="primary" icon="arrow-right" @click="handleRightArrow"></el-button></el-col><!-- 右边table --><el-col :lg="11" style="height: 100%;"><div class="table-container"><el-table :data="dataListRight" v-loading="loadingRight" ref="table" borderheader-cell-class-name="el-table-header-cell" highlight-current-row@selection-change="handleSelectionChangeRight" :height="tableHeight - 40"><el-table-column type="selection" width="50" align="center" /><el-table-column type="index" width="60" label="序号" align="center" /><el-table-column prop="deptName" label="部门" align="center" /><el-table-column prop="userName" label="工号" align="center" /><el-table-column prop="nickName" label="姓名" align="center" /><el-table-column prop="actualWorkHours" label="实际工时/h" align="center" width="150"><template #default="scope"><el-input-number v-model="scope.row.actualWorkHours" :min="0" :max="24" :precision="1"placeholder="实际工时/h" style="width: 100%;" controls-position="right" /></template></el-table-column><el-table-column prop="standardWorkHours" label="标准工时/h" align="center" width="150" /><el-table-column prop="postNames" label="岗位" align="center" /></el-table></div></el-col></el-row></el-form><template #footer><el-button text @click="cancel">{{ $t('btn.cancel') }}</el-button><el-button type="primary" @click="submitForm">{{ $t('btn.submit') }}</el-button></template></el-dialog>

js

<script setup name="meshumanreport">
import {listMesHumanReport, getMesHumanReportList,addMesHumanReport, delMesHumanReport,updateMesHumanReport, updateMesHumanReportDetailPartial, getMesHumanReport,
}from '@/api/dataReport/meshumanreport.js'
import { getMesLineList } from '@/api/factoryManage/mesline.js'
import { treeselect } from '@/api/system/dept'
import { listPostOptionSelectLimit } from '@/api/system/post.js'
import { getUserListByPost } from '@/api/system/user.js'
import dayjs from 'dayjs';
import auth from '@/plugins/auth'const { proxy } = getCurrentInstance()
const ids = ref([])
const loading = ref(false)
const loadingLeft = ref(false)
const loadingRight = ref(false)const queryParamsUserNav = reactive({pageNum: 1,pageSize: 20,sortType: 'asc',deptId: undefined,postId: undefined,userId: undefined,
})const total = ref(0)
const totalLeft = ref(0)
const totalRight = ref(0)
const dataList = ref([])
const dataListLeft = ref([])
const dataListRight = ref([])
const dataListLeftChosed = ref([])
const dataListRightChosed = ref([])
const queryRef = ref()
const queryRefUserNav = ref()const deptOptions = ref([])
const postOptions = ref([])
const userOptions = ref([])
const standardDisabled = ref(true)
const tableHeight = ref(570)var dictParams = [{ dictType: "mes_classes_type" },
]proxy.getDicts(dictParams).then((response) => {response.data.forEach((element) => {state.options[element.dictType] = element.list})
})//当前时间
const now = new Date();// 设置:subtract往前推 add往后
const dateRangeWorkDate = ref([dayjs().subtract(1, 'day').format('YYYY-MM-DD'), dayjs().format('YYYY-MM-DD')])const shortcutsWorkDate = [{text: '今天',value: new Date(),},{text: '昨天',value: () => {const date = new Date()date.setTime(date.getTime() - 3600 * 1000 * 24)return date},},{text: '一周前',value: () => {const date = new Date()date.setTime(date.getTime() - 3600 * 1000 * 24 * 7)return date},},
]//日期范围变化时,触发表单校验(因为el-date-picker 选中的值不会自动通知表单验证状态,所以这里要单独处理)
function handleDateChange() {dataList.value = []// console.log(dateRangeWorkDate.value)// queryParams.dateRangeWorkDate = dateRangeWorkDate.value// // 查询报表数据// getList()
}// 动态表头生成
// const dateRangeWorkDate = ref([])
const dynamicHeaders = computed(() => {console.log(dateRangeWorkDate.value)if (!dateRangeWorkDate.value || dateRangeWorkDate.value.length !== 2) return []const dates = []const start = new Date(dateRangeWorkDate.value[0])const end = new Date(dateRangeWorkDate.value[1])while (start <= end) {dates.push({date: start.toISOString().split('T')[0],shifts: ['白班', '夜班']})start.setDate(start.getDate() + 1)}console.log(dates)return dates
})/**************************************************** form操作 ****************************************************/
const formRef = ref()
const formRefEdit = ref()
const formRefUserNav = ref()
const title = ref('')
const titleUserNav = ref('')
// 操作类型 1、add 2、edit 3、view
const opertype = ref(0)
const open = ref(false)
const openUserNav = ref(false)
const openEditCell = ref(false)
const state = reactive({single: true,multiple: true,form: {},formUserNav: {},formEdit: {},rules: {//产线lineCode: [{ required: true, message: '请选择产线', trigger: 'change' },],//标准工时standardWorkHours: [{ required: true, message: '请输入标准工时', trigger: ['change', 'blur'] },],
},],workShift: [{ required: true, message: '请选择班次', trigger: 'change' },],},rulesQueryReport: {//产线// lineCode: [{ required: true, message: '请选择产线', trigger: 'change' },],//日期dateRangeWorkDate: [{ required: true, message: '请选择日期范围', trigger: 'blur' },],},rulesEdit: {lineName: [{ required: true, message: '请输入产线', trigger: 'blur' },],userName: [{ required: true, message: '请输入人员', trigger: 'blur' },],workDate: [{ required: true, message: '请选择日期', trigger: 'change' },],workShift: [{ required: true, message: '请选择班次', trigger: 'change' },],standardWorkHours: [{ required: true, message: '请输入标准工时', trigger: 'change' },],actualWorkHours: [{ required: true, message: '请输入实际工时', trigger: 'change' },],},options: {// 产线列表mes_line_list: [],// 班次 选项列表 格式 eg:{ dictLabel: '标签', dictValue: '0'}mes_classes_type: [],}
})const { form, formUserNav, formEdit, rules, rulesQueryReport, rulesEdit, options, single, multiple } = toRefs(state)// 添加按钮操作
function handleAdd() {reset();open.value = truetitle.value = '添加人力报工'opertype.value = 1form.value.standardWorkHours = 12//日期班次默认值var hour = dayjs().get('hour')if (hour >= 0 && hour < 8) {form.value.workDate = dayjs().subtract(1, 'day').format('YYYY-MM-DD')}else {form.value.workDate = dayjs().format('YYYY-MM-DD')}if (hour >= 8 && hour < 20) {form.value.workShift = '白班'}else {form.value.workShift = '夜班'}//查询用户下拉列表getUserDropDownList()
}// 添加&修改 表单提交
function submitForm() {// 校验表单proxy.$refs["formRef"].validate((valid) => {if (valid) {// 校验明细表if (dataListRight.value.length == 0) {proxy.$modal.msgError('请先选择人员信息')return}dataListRight.value.forEach(item => {item.workShopName = form.value.workShopNameitem.lineCode = form.value.lineCodeitem.lineName = form.value.lineNameitem.workDate = form.value.workDateitem.workShift = form.value.workShiftitem.userCode = item.userNameitem.userName = item.nickName})// 提交表单console.log(dataListRight.value)form.value.mesHumanReportDetailNav = dataListRight.valueaddMesHumanReport(form.value).then((res) => {console.log(res)if (res.code == 200) {proxy.$modal.msgSuccess("操作成功!")open.value = false//刷新列表getList()} else {// proxy.$modal.msgError("操作失败")}}).catch(() => {proxy.$modal.msgError("操作失败")})}})
}// 关闭dialog
function cancel() {open.value = falsereset()
}// 重置表单
function reset() {form.value = {id: null,workShopId: null,workShopCode: null,workShopName: null,lineId: null,lineCode: null,lineName: null,standardWorkHours: null,startTime: null,endTime: null,remark: null,};proxy.resetForm("formRef")resetQueryUserNav()dataListLeft.value = []dataListLeftChosed.value = []dataListRight.value = []dataListRightChosed.value = []
}/*** 生产线下拉变更* @param {*} value*/
function formLineSelectChange(value) {let line = state.options.mes_line_list.find(item => item.lineCode == value)console.log(line)form.value.lineId = line.idform.value.lineCode = line.lineCodeform.value.lineName = line.lineNameform.value.workShopId = line.workShopIdform.value.workShopCode = line.workShopCodeform.value.workShopName = line.workShopName
}/********************************************  人力报工-明细子表信息  ***********************************************/
const mesHumanReportDetailList = ref([])
const checkedMesHumanReportDetail = ref([])
const fullScreen = ref(true)
const drawer = ref(false)/** 人力报工-明细序号 */
function rowMesHumanReportDetailIndex({ row, rowIndex }) {row.index = rowIndex + 1;
}/** 复选框选中数据 */
function handleMesHumanReportDetailSelectionChange(selection) {checkedMesHumanReportDetail.value = selection.map(item => item.index)
}//查询用户信息
function handleQueryUserNav() {console.log(queryParamsUserNav)loadingLeft.value = truegetUserListByPost(queryParamsUserNav).then((res) => {console.log(res)const { code, data } = resif (code == 200) {dataListLeft.value = data.resulttotalLeft.value = data.totalNumconsole.log(data.result)//dataListLeft去除掉右边dataListRight的人员dataListLeft.value = dataListLeft.value.filter(item => !dataListRight.value.some(item2 => item2.userId == item.userId))}loadingLeft.value = false}).catch(() => {loadingLeft.value = false})
}//查询用户信息条件清空
function resetQueryUserNav() {queryParamsUserNav.deptId = undefinedqueryParamsUserNav.postId = undefinedqueryParamsUserNav.userId = undefinedqueryParamsUserNav.pageNum = 1queryParamsUserNav.pageSize = 20handleQueryUserNav()
}//部门选择改变
function changeDept(e) {console.log(e)if (e) {queryParamsUserNav.deptId = egetUserDropDownList()}
}//岗位选择改变
function changePost() {getUserDropDownList()
}// 获取人员下拉列表
function getUserDropDownList() {queryParamsUserNav.userId = undefinedvar tmpQueryParams = {deptId: queryParamsUserNav.deptId,postId: queryParamsUserNav.postId,pageNum: 1,pageSize: 99999,}getUserListByPost(tmpQueryParams).then((res) => {console.log(res)const { code, data } = resif (code == 200) {userOptions.value = data.result}})}//箭头向左,取消选中数据
function handleLeftArrow() {if (dataListRightChosed.value.length == 0) {proxy.$modal.msgError('请先勾选要取消选中的人员')} else {dataListRight.value = dataListRight.value.filter(item => !dataListRightChosed.value.some(item2 => item2.userId == item.userId))dataListRightChosed.value = []//左边的数据重新查询handleQueryUserNav()}
}//箭头向右,选中数据
function handleRightArrow() {if (form.value.standardWorkHours) {if (dataListLeftChosed.value.length > 0) {//右边的数据加上左边的选中数据,已经存在的不重复添加dataListRight.value = dataListRight.value.concat(dataListLeftChosed.value.filter(item => !dataListRight.value.some(item2 => item2.userId == item.userId)))console.log(form.value.workDate)dataListRight.value.forEach(item => {item.standardWorkHours = form.value.standardWorkHoursitem.actualWorkHours = form.value.standardWorkHours})dataListLeft.value = dataListLeft.value.filter(item => !dataListLeftChosed.value.some(item2 => item2.userId == item.userId))dataListLeftChosed.value = []} else {proxy.$modal.msgError('请先勾选要添加的人员')}} else {proxy.$modal.msgError('请先设置标准工时')}
}//左侧选择改变
function handleSelectionChangeLeft(selection) {// dataListLeftChosed = selection.map(item => item.userId)dataListLeftChosed.value = selection
}//右侧选择改变
function handleSelectionChangeRight(selection) {dataListRightChosed.value = selection
}/** 查询部门下拉树结构 */
function getDeptTreeselect() {treeselect().then((response) => {deptOptions.value = response.data})
}
function getDropDownList() {// 获取生产线列表getMesLineList().then(res => {console.log(res)const { code, data } = resif (code == 200) {state.options.mes_line_list = data}})// 获取岗位列表listPostOptionSelectLimit().then((res) => {console.log(res)if (res.code == 200) {postOptions.value = res.data}})
}handleQuery()
getDropDownList()
getDeptTreeselect()
</script>

相关文章:

使用vue3+element plus 的table自制的穿梭框(支持多列数据)

目录 一、效果图 二、介绍 三、代码区 一、效果图 话不多说&#xff0c;先上图 二、介绍 项目需要&#xff1a;通过穿梭框选择人员信息&#xff0c;可以根据部门、岗位进行筛选&#xff0c;需要显示多列&#xff08;不光显示姓名&#xff0c;还包括人员的一些基础信息&…...

Java【多线程】(2)线程属性与线程安全

目录 1.前言 2.正文 2.1线程的进阶实现 2.2线程的核心属性 2.3线程安全 2.3.1线程安全问题的原因 2.3.2加锁和互斥 2.3.3可重入&#xff08;如何自己实现可重入锁&#xff09; 2.4.4死锁&#xff08;三种情况&#xff09; 2.4.4.1第一种情况 2.4.4.2第二种情况 2.4…...

后端-Java虚拟机

Java虚拟机 Java虚拟机的组成 Java虚拟机的组成由类加载器ClassLoader、运行时数据区域&#xff08;JVM管理的内存&#xff09;和执行引擎&#xff08;即时遍历器、解释器垃圾回收器&#xff09; 类加载器加载class字节码文件中的内容到内存运行时数据区域负责管理jvm使用到…...

vue These dependencies were not found

These dependencies were not found: * vxe-table in ./src/main.js * vxe-table/lib/style.css in ./src/main.js To install them, you can run: npm install --save vxe-table vxe-table/lib/style.css 解决&#xff1a; nodejs执行以下语句 npm install --save vxe-t…...

Yak 在 AI 浪潮中应该如何存活?

MCP 是 Claude 发起的一个协议&#xff0c;在2024年10月左右发布&#xff0c;在2025年2月开始逐步有大批量的 AI 应用体开始支持这个协议。这个协议目的是让 AI 同时可以感知有什么工具可以用&#xff0c;如果要调用这些工具的话&#xff0c;应该是用什么样的方式。 这个 MCP 协…...

AI是否能真正理解人类情感?从语音助手到情感机器人

引言&#xff1a;AI与情感的交集 在过去的几十年里&#xff0c;人工智能&#xff08;AI&#xff09;的发展速度令人惊叹&#xff0c;从简单的语音识别到如今的深度学习和情感计算&#xff0c;AI已经深入到我们生活的方方面面。尤其是在语音助手和情感机器人领域&#xff0c;AI不…...

大语言模型学习--本地部署DeepSeek

本地部署一个DeepSeek大语言模型 研究学习一下。 本地快速部署大模型的一个工具 先根据操作系统版本下载Ollama客户端 1.Ollama安装 ollama是一个开源的大型语言模型&#xff08;LLM&#xff09;本地化部署与管理工具&#xff0c;旨在简化在本地计算机上运行和管理大语言模型…...

linux上面安装 向量数据库 mlivus和 可视化面板Attu

1. 确保docker(docker 19.0以上即可) 和 docker-compose&#xff08;V2.2.2以上&#xff09; 都已安装 2. 创建milvus工作目录 # 新建一个名为milvus的目录用于存放数据 目录名称可以自定义 mkdir milvus# 进入到新建的目录 cd milvus 3. 下载并编辑docker-compose.yml 在下载…...

虚拟机ip设置

打开上次安装的虚拟机&#xff0c;左上角编辑/虚拟网络编辑器 改地址 地址要看自己电脑情况配置&#xff0c;我这是学校电脑 都是配一样的 然后改虚拟网卡 改和刚刚一样的 是改ipv4 然后启动虚拟机 输入vi /etc/sysconfig/network-scripts/ifcfg-ens33 使用vi编辑器修改其中…...

用工厂函数简化redis配置

工厂函数&#xff08;Factory Function&#xff09;不同于构造函数&#xff0c;工厂函数就是一个普通函数&#xff0c;通常用于创建对象或实例。它的核心思想是通过一个函数来封装对象的创建逻辑&#xff0c;而不是直接使用类的构造函数。工厂函数可以根据输入参数动态地决定创…...

类和对象-继承-C++

1.定义 面向对象的三大特征之一&#xff0c;为了减少重复的代码 2.语法 class 子类 &#xff1a;继承方式 父类 &#xff08;子类也叫派生类&#xff0c;父类也称为基类&#xff09; 例&#xff1a;class age&#xff1a;public person&#xff1b; #include<iostrea…...

使用Maven搭建Spring Boot框架

文章目录 前言1.环境准备2.创建SpringBoot项目3.配置Maven3.1 pom.xml文件3.2 添加其他依赖 4. 编写代码4.1 启动类4.2 控制器4.3 配置文件 5.运行项目6.打包与部署6.1 打包6.2 运行JAR文件 7.总结 前言 Spring Boot 是一个用于快速构建 Spring 应用程序的框架&#xff0c;它简…...

RockyLinux 为 k8s 集群做准备

1.准备VM 镜像 开启虚拟机 选择安装 Rocky linux 9.5 软件选择最小安装就可以了 在 rocky 9 以后版本中 他全部 采用 network manager 去替换老的 network 去实现网络的管理 1.网卡配置 cat /etc/NetworkManager/system-connections/ens160.nmconnection 我们配置了两块网…...

安卓基础组件Looper - 02 native层面的剖析

文章目录 native使用使用总结创建Looper构造函数创建(不推荐)使用举例源代码 Looper::prepare 获取Looper可忽略初始化Looper主动休眠 pollAll主动唤醒 wake 发送消息 sendMessage轮询消息 native使用 Android Native Looper 机制 - 掘金 (juejin.cn) /system/core/libutils/…...

用大白话解释搜索引擎Elasticsearch是什么,有什么用,怎么用

Elasticsearch是什么&#xff1f; Elasticsearch&#xff08;简称ES&#xff09;就像一个“超级智能的图书馆管理系统”&#xff0c;专门帮你从海量数据中快速找到想要的信息。它底层基于倒排索引技术&#xff08;类似书籍的目录页&#xff09;&#xff0c;能秒级搜索和分析万…...

机器学习的三个基本要素

机器学习的基本要素包括模型、学习准则&#xff08;策略&#xff09;和优化算法三个部分。机器学习方法之间的不同&#xff0c;主要来自其模型、学习准则&#xff08;策略&#xff09;、优化算法的不同。 模型 机器学习首要考虑的问题是学习什么样的模型&#xff08;Model&am…...

二十三种设计模式

2 工厂方法模式 工厂模式&#xff08;Factory Pattern&#xff09;是 Java 中最常用的设计模式之一。这种类型的设计模式属于创建型模式&#xff0c;它提供了一种创建对象的最佳方式。 在工厂模式中&#xff0c;我们在创建对象时不会对客户端暴露创建逻辑&#xff0c;并且是通…...

Spring Boot 异步编程深入剖析

Spring Boot 异步编程深入剖析 1. 异步方法的使用 原理深度解析 Spring Boot 的异步方法基于 Spring 的 AOP&#xff08;面向切面编程&#xff09;实现。当在方法上添加 Async 注解时&#xff0c;Spring 会为该方法所在的类创建一个代理对象。当调用该异步方法时&#xff0c…...

SqlSugar 语法糖推荐方式

//方式1&#xff1a;var dd _repository._Db.Queryable<ConfigAggregateRoot, UserRoleEntity>((o, p) > o.Id p.Id).Select((o, p) > new{o.Id,o.Remark,p.RoleId,});//方式2&#xff1a;不推荐使用&#xff0c;建议优先使用 Lambda 表达式&#xff0c;因为它更…...

SQL 全面指南:从基础语法到高级查询与权限控制

SQL&#xff1a;全称 Structured Query Language&#xff0c;结构化查询语言。操作关系型数据库的编程语言&#xff0c;定义了一套操作关系型数据库统一标准 。 一、SQL通用语法 在学习具体的SQL语句之前&#xff0c;先来了解一下SQL语言的同于语法。 1). SQL语句可以单行或多…...

Spring Cloud Gateway 网关的使用

在之前的学习中&#xff0c;所有的微服务接口都是对外开放的&#xff0c;这就意味着用户可以直接访问&#xff0c;为了保证对外服务的安全性&#xff0c;服务端实现的微服务接口都带有一定的权限校验机制&#xff0c;但是由于使用了微服务&#xff0c;就需要每一个服务都进行一…...

【Spring Cloud Alibaba】基于Spring Boot 3.x 搭建教程

目录 前言一、开发环境二、简介 1.主要功能2.组件 三、搭建过程 1 - 主体工程搭建2 - 服务注册与发现组件 —— Nacos的安装3 - 服务注册与发现 —— 服务提供者4 - 服务注册与发现 —— 服务消费者5 - 服务配置中心6 - OpenFeign服务接口调用7 - OpenFeign高级特性8 - Spring…...

JavaWeb-jdk17安装

下载jdk17 地址&#xff1a;https://www.oracle.com/java/technologies/downloads/#jdk17-windows 安装jdk 配置环境变量 右键点击我的电脑>属性>高级系统设置>环境变量 在系统变量Path变量中添加 测试 java -version javac -version...

docker关闭mysql端口映射的使用

需求 项目中的数据库为mysql&#xff0c;如果将端口映射到宿主机上&#xff0c;容易被工具扫描出&#xff0c;且随着国产化的进程推进&#xff0c;mysql将不被允许。为了提高安全性与满足项目需求&#xff0c;这里采用隐藏mysql端口方式&#xff0c;不映射宿主机端口&#xff…...

【银河麒麟高级服务器操作系统】服务器测试业务耗时问题分析及处理全流程分享

更多银河麒麟操作系统产品及技术讨论&#xff0c;欢迎加入银河麒麟操作系统官方论坛 https://forum.kylinos.cn 了解更多银河麒麟操作系统全新产品&#xff0c;请点击访问 麒麟软件产品专区&#xff1a;https://product.kylinos.cn 开发者专区&#xff1a;https://developer…...

算法1-4 蜜蜂路线

题目描述 一只蜜蜂在下图所示的数字蜂房上爬动,已知它只能从标号小的蜂房爬到标号大的相邻蜂房,现在问你&#xff1a;蜜蜂从蜂房 m 开始爬到蜂房 n&#xff0c;m<n&#xff0c;有多少种爬行路线&#xff1f;&#xff08;备注&#xff1a;题面有误&#xff0c;右上角应为 n−…...

Android 常见View的防抖

在开发Android应用时&#xff0c;我们经常会遇到用户快速点击按钮或者频繁触发某个事件的情况。这种行为可能会导致不必要的重复操作&#xff0c;例如多次提交表单、重复加载数据等。为了避免这些问题&#xff0c;我们需要对这些事件进行防抖处理。本文将详细介绍如何在Kotlin中…...

数据库原理SQL查询(习题+知识点)

一、查询学生表所有学生记录 1.题目内容代码编写 select * from stu; 2.知识点提醒 1&#xff09;选择表中的所有属性列有两种方法 在select关键字后列出所有列名若列的显示顺序与其在表中的顺序相同&#xff0c;则也可用 * 表示所有列 二、查询学生表中部分信息 1.题目内…...

安路FPGA开发入门:软件安装与点灯与仿真(TangDynasty ModelSim)

文章目录 前言软件安装开发软件仿真软件 点灯测试代码编写与编译引脚分配固件下载 仿真测试ModelSim添加仿真库TangDynasty仿真设置进行仿真 后记 前言 最近因为工作需要用安路的FPGA&#xff0c;这里对安路FPGA开发相关流程做个记录。作为测试只需要一个核心板&#xff08;我这…...

Java 导出大数据到 Excel 表格

背景 之前的项目一直是用XSSFWorkbook来做 Excel 导出&#xff0c;在遇到大数据导出时&#xff0c;经常会遇到 OOM。在 Apache Poi 3.8 之后的版本提供的 SXSSFWorkbook 可以优雅的解决这个问题。 原理 SXSSFWorkbook 被称为流式 API&#xff0c;主要是因为它采用了流式写入…...