vue3 elementui plus 可编辑表格与表单结合 保存时校验

Vue3 + Element-plus + TS —— 动态表格自由编辑 可编辑的 Vue2 、3的表格,自由编辑! 阅读详情
<template>
  <div class="mult_table_box">
    <el-form ref="formRef" :model="formData" >
      <el-table
        ref="tableRef"
        :data="formData.tableDataValue"
        :header-cell-style="{ 'text-align': 'center' }"
        @row-click="handleEdit"
        @selection-change="handleSelectionChange"
        class="mult_table_"
        max-height="540"
      >
        <el-table-column
          type="selection"
          width="55"
          align="center"
          v-if="showCheckbox"
          :selectable="checkSelectable"
        />
        <el-table-column type="index" label="序号" width="80" align="center" />

        <el-table-column
          v-for="(column, index) in columns"
          :key="index"
          :prop="column.prop"
          :label="column.label"
          :width="column.width"
          :show-overflow-tooltip="
            typeof column.showTooltip === 'boolean' ? column.showTooltip : showTooltip
          "
          align="center"
        >
         <template #header>
              <div class="flex_ flex_cetner"
                ><span class="red_" v-if="column.required">*</span
                ><span> {{ column.label }}</span></div
              >
              </template>
          <!-- 多级表头 -->
          <el-table-column
            v-for="(column2, cIndex) in column.children"
            :key="cIndex"
            :prop="column2.prop"
            :label="column2.label"
            :width="column2.width"
            :show-overflow-tooltip="
              typeof column.showTooltip === 'boolean' ? column.showTooltip : showTooltip
            "
          >
            <template #header>
              <div class="flex_ flex_cetner"
                ><span class="red_" v-if="column2.required">*</span
                ><span> {{ column2.label }}</span></div
              >
            </template>
            <template #default="scope">
              <template v-if="scope.row.isEdit && !column2.disabled">
                <el-form-item
                  :prop="'tableDataValue[' + scope.$index + '].' + column.prop"
                  :rules="[
                    { required: column2.required, message: '', trigger: 'blur' }
                  ]"
                >
             
                    <!-- 输入框 -->
                    <el-input
                      v-if="column2.type == 'input'"
                      v-model="scope.row[column2.prop]"
                      :placeholder="`请输入${column2.label}`"
                    />
                    <!-- 下拉 -->
                    <el-select
                      v-else-if="column2.type == 'select'"
                      v-model="scope.row[column2.prop]"
                    >
                      <el-option
                        v-for="option in getColumnOptions(column2)"
                        :key="option.value"
                        :label="option.label"
                        :value="option.value"
                      />
                    </el-select>
                    <!-- 自定义 -->
                    <div v-else-if="column2.type === 'slot'" class="w100">
                      <slot :name="column2.prop + 'Edit'" :row="scope.row" :column="column2"></slot>
                    </div>
                 
                </el-form-item>
              </template>
              <!-- 不编辑展示状态-多层表头 -->
              <template v-else>
                <el-form-item prop="operation">
                  <div v-if="column2.type == 'switch'">
                    <el-switch
                      v-model="scope.row[column2.prop]"
                      active-text=""
                      inactive-text=""
                      disabled
                    />
                  </div>
                  <div
                    v-else-if="column2.type == 'dictSelect' || column2.type == 'dictSelect_string'"
                  >
                    <div v-if="column2.propLable">{{ scope.row[column2.propLable] }}</div>
                    <div v-else>
                      {{ getDictLabel(scope.row[column2.prop], column2.dictName) }}
                    </div>
                  </div>
                  <div v-else-if="column2.type == 'datetime'">
                    {{ formatDate(scope.row[column2.prop]) }}
                  </div>
                  <div v-else-if="column2.type === 'slot'">
                    <slot :name="column2.prop" :row="scope.row" :column="column2"></slot>
                  </div>

                  <div v-else>{{ scope.row[column2.prop] }}</div>
                </el-form-item>
              </template>
            </template>
          </el-table-column>

          <template #default="scope" v-if="!column.children?.length">
            <template v-if="scope.row.isEdit && !column.disabled">
              <el-form-item
                :prop="'tableDataValue[' + scope.$index + '].' + column.prop"
                :rules="[{ required: column.required, message: '', trigger: 'blur' }]"
              >
                <!-- 输入框 -->
                <el-input
                  v-if="column.type == 'input'"
                  v-model="scope.row[column.prop]"
                  :placeholder="`请输入${column.label}`"
                />
                <!-- numner输入框(小数) -->
                <div @click.stop>
                  <el-input-number
                    v-if="column.type == 'input-number'"
                    :placeholder="`请输入${column.label}`"
                    v-model="scope.row[column.prop]"
                    :precision="1"
                    :step="0.1"
                  />
                </div>
                <!-- number输入框(整数) -->
                <div @click.stop>
                  <el-input-number
                    v-if="column.type == 'number'"
                    :placeholder="`请输入${column.label}`"
                    v-model="scope.row[column.prop]"
                    :precision="0"
                    :step="1"
                  />
                </div>
                <!-- 文本域 -->
                <el-input
                  v-if="column.type == 'textarea'"
                  type="textarea"
                  v-model="scope.row[column.prop]"
                  :placeholder="`请输入${column.label}`"
                  resize="vertical"
                  :autosize="{ minRows: 2, maxRows: 4 }"
                  clearable
                />
                <!-- 下拉 -->
                <el-select
                  v-else-if="column.type == 'select'"
                  v-model="scope.row[column.prop]"
                  clearable
                >
                  <el-option
                    v-for="option in getColumnOptions(column)"
                    :key="option.value"
                    :label="option.label"
                    :value="option.value"
                  />
                </el-select>
                <!-- 字典下拉-value为string -->
                <el-select
                  v-else-if="column.type == 'dictSelect_string'"
                  v-model="scope.row[column.prop]"
                  clearable
                >
                  <el-option
                    v-for="dict in getDictOptions(DICT_TYPE[column.dictName])"
                    :key="dict.value"
                    :label="dict.label"
                    :value="dict.value"
                  />
                </el-select>
                <!-- 字典下拉-value为number -->
                <el-select
                  v-else-if="column.type == 'dictSelect'"
                  v-model="scope.row[column.prop]"
                  clearable
                >
                  <el-option
                    v-for="dict in getIntDictOptions(DICT_TYPE[column.dictName])"
                    :key="dict.value"
                    :label="dict.label"
                    :value="dict.value"
                  />
                </el-select>
                <el-date-picker
                  v-else-if="column.type === 'date'"
                  v-model="scope.row[column.prop]"
                  type="date"
                  :placeholder="`请选择${column.label}`"
                  value-format="YYYY-MM-DD"
                  format="YYYY-MM-DD"
                  style="width: 100%"
                />
                <el-date-picker
                  v-else-if="column.type === 'datetime'"
                  v-model="scope.row[column.prop]"
                  type="datetime"
                  :placeholder="`请选择${column.label}`"
                  value-format="YYYY-MM-DD HH:mm:ss"
                  format="YYYY-MM-DD HH:mm:ss"
                  style="width: 100%"
                />
                <el-date-picker
                  v-else-if="column.type === 'timestamp'"
                  v-model="scope.row[column.prop]"
                  value-format="x"
                  type="datetime"
                  :placeholder="`请选择${column.label}`"
                  style="width: 100%"
                />
                <el-switch
                  v-else-if="column.type === 'switch'"
                  v-model="scope.row[column.prop]"
                  active-text=""
                  inactive-text=""
                />
                <div v-else-if="column.type == 'uploadFile'" @click.stop>
                  <UploadFile
                    :is-show-tip="false"
                    v-model="scope.row[column.prop]"
                    :modelValueIsString="true"
                  />
                </div>
                <div v-else-if="column.type == 'uploadImgs'" @click.stop>
                  <UploadImgs
                    v-model="scope.row[column.prop]"
                    :modelValueIsString="true"
                    :limit="9"
                    height="50px"
                    width="50px"
                  />
                </div>
                <div v-else-if="column.type === 'slot'" @click.stop class="w100">
                  <slot :name="column.prop + 'Edit'" :row="scope.row" :column="column"></slot>
                </div>
              </el-form-item>
            </template>
            <!-- 不编辑展示状态 -->
            <template v-else>
              <el-form-item prop="operation">
                <div v-if="column.type == 'switch'">
                  <el-switch
                    v-model="scope.row[column.prop]"
                    active-text=""
                    inactive-text=""
                    disabled
                  />
                </div>
                <div v-else-if="column.type == 'datetime'">
                  {{ formatDate(scope.row[column.prop]) }}
                </div>
                <div v-else-if="column.type == 'timestamp'">
                  {{ formatDate(scope.row[column.prop]) }}
                </div>
                <div v-else-if="column.type == 'uploadFile'">
                  <UploadFile
                    :is-show-tip="false"
                    v-model="scope.row[column.prop]"
                    :disabled="true"
                  />
                </div>
                <div v-else-if="column.type == 'uploadImgs'">
                  <UploadImgs
                    v-model="scope.row[column.prop]"
                    :limit="9"
                    :modelValueIsString="true"
                    height="50px"
                    width="50px"
                    :disabled="true"
                  />
                </div>
                <div v-else-if="column.type == 'dictSelect' || column.type == 'dictSelect_string'">
                  <div v-if="column.propLable">{{ scope.row[column.propLable] }}</div>
                  <div v-else>
                    {{ getDictLabel(scope.row[column.prop], column.dictName) }}
                  </div>
                </div>

                <div v-else-if="column.type === 'slot'">
                  <div v-if="column.propLable">
                    {{ scope.row[column.propLable] }}
                  </div>
                  <slot v-else :name="column.prop" :row="scope.row" :column="column"></slot>
                </div>
                <div v-else>{{ scope.row[column.prop] }}</div>
              </el-form-item>
            </template>
          </template>
        </el-table-column>
        <el-table-column
          fixed="right"
          label="操作"
          prop="city"
          min-width="160"
          v-if="showOperationColumn"
          :width="operationWidth"
        >
          <!-- :width="setOperationBoxWidth()" -->
          <template #default="scope">
            <el-form-item prop="operation">
              <div class="table_btn_box" @click.stop>
                <!-- 表格编辑默认的按钮 -->
                <span id="operationBox" v-if="allowEdit">
                  <el-button
                    link
                    type="primary"
                    size="small"
                    :icon="EditPen"
                    v-if="!scope.row.isEdit"
                    @click.stop="handleEdit(scope.row)"
                    >编辑</el-button
                  >
                  <el-button
                    link
                    type="success"
                    size="small"
                    :icon="Check"
                    v-if="scope.row.isEdit"
                    @click.stop="handleSave(scope.row)"
                    >保存</el-button
                  >
                  <el-button
                    link
                    type="warning"
                    size="small"
                    class="mr12px"
                    :icon="Close"
                    v-if="scope.row.isEdit"
                    @click.stop="handleCancel(scope)"
                    >取消</el-button
                  >
                  <el-button
                    v-if=" !scope.row.isEdit && scope.row?.id"
                    link
                    type="danger"
                    class="mr12px"
                    :icon="Delete"
                    size="small"
                    @click.stop="handleDelete(scope.row)"
                    >删除</el-button
                  >
                </span>
                <!-- 需要把编辑emit出去的按钮 使用弹窗类 -->
                <!-- 其他需要自定义的按钮 -->
                <slot name="operation" :row="scope.row"></slot>
              </div>
            </el-form-item>
          </template>
        </el-table-column>
      </el-table>
    </el-form>

  </div>
</template>
<script lang="ts" setup>
import { Plus, View, Close, EditPen, Delete, Check } from '@element-plus/icons-vue'
import { columnsType } from '@/api/common/types'
import { ElMessageBox, ElMessage, FormInstance } from 'element-plus'
import { formatDate } from '@/utils/formatTime'
import { getDictOptions, getIntDictOptions, getDictObj, DICT_TYPE } from '@/utils/dict'
import * as ProcessInstanceApi from '@/api/bpm/processInstance'
import { cloneDeep } from 'lodash-es'
import ProcessUserSelect from '@/components/approvalComponent/ProcessUserSelect.vue'
import approvalHistoryDialog from '@/views/equipmentManagement/ledger/equipmentLedger/abnormalMovementManagement/approvalHistoryDialog.vue'
import { useRouter } from 'vue-router'
const message = useMessage() // 消息弹窗
const router = useRouter()
const emit = defineEmits([
  'handleEdit',
  'handleEditEmit',
  'handleDelete',
  'handleSave',
  'handleProcessSubmit',
  'handleRefresh'
])
const props = defineProps({
  columns: {
    type: Array as PropType<columnsType[]>,
    required: true,
    default: () => []
  },
  tableData: {
    type: Array,
    required: true,
    default: () => []
  },
  allOptionList: {
    type: Object,
    required: false,
    default: () => {}
  },
  allowEdit: {
    //表格编辑
    type: Boolean,
    default: true
  },
  showOperationColumn: {
    type: Boolean,
    default: true
  },
  operationWidth: {
    type: String,
    default: '160'
  },
  showTooltip: {
    type: Boolean,
    default: true
  },
  showCheckbox: {
    type: Boolean,
    default: true
  },
})


let formRef = ref()
const formData = reactive({
  tableDataValue: []
})

let dataLength = ref(0)
// 监听data变化
watch(
  () => props.tableData,
  (newVal) => {
    // 初次进入给dataLength赋值即可
    if (!dataLength.value) {
      dataLength.value = props.tableData.length
      formData.tableDataValue = newVal
      return
    }
    // 新增、判断是否有正在编辑的行 是-取消新增
    if (dataLength.value == newVal?.length - 1) {
      let dataLenIndex = formData.tableDataValue.length - 1
      if (EditRow.value?.isEdit) {
        formData.tableDataValue.splice(dataLenIndex, 1)
        message.warning('有正在编辑的行,请取消编辑再尝试')
        return
      }

      let newRow = newVal[dataLenIndex]
      EditRow.value = newRow
    }
    // 新增后滚动到底部
    if (dataLength.value && dataLength.value == newVal?.length - 1) {
      scrollToBottom()
    }
    dataLength.value = formData.tableDataValue.length
    formData.tableDataValue = newVal
  },
  { deep: true, immediate: true }
)

onMounted(() => {
  initData()
})

//获取数据
const initData = async () => {}
// 获取列选项
const getColumnOptions = (column: columnsType) => {
  if (column.optionApi) {
    return props.allOptionList[column.optionApi] || []
  }
  // return column.options || []
}

// 表格操作
const multipleSelection = ref([])
const handleSelectionChange = (rows) => {
  multipleSelection.value = rows.map((item) => {
    return item.id
  })
}

//编辑
let originalRow = reactive({}) //原始行,作用:取消编辑时,数据恢复
let EditRow = ref()
const handleEdit = (row: any) => {
  if (EditRow.value?.isEdit && EditRow.value != row) {
    message.warning('有正在编辑的行,请取消编辑再尝试')
    return
  }
    if (props.allowEdit&& props.showOperationColumn) {
      row.isEdit = true
      let nRow = cloneDeep(toRaw(row))
      originalRow = { ...nRow }
      EditRow.value = row
    
  }
}

const handleSave = async (row) => {
  const valid = await formRef.value.validate()
  if (!valid) return
  row.isEdit = false
  EditRow.value = row
  emit('handleSave', row)
}
const handleDelete = (row: any) => {
  ElMessageBox.confirm('确认删除该行数据吗?', '提示', {
    confirmButtonText: '确 认',
    cancelButtonText: '取 消'
  })
    .then(() => {
      //确认
      emit('handleDelete', row)
    })
    .catch(() => console.info('操作取消'))
}

//取消编辑
const handleCancel = (scope) => {
  let index = scope.$index
  if (!scope.row.id) {
    scope.row.isEdit = false
    formData.tableDataValue.splice(index, 1)
  } else {
    originalRow.isEdit = false
    EditRow.value.isEdit = false
    formData.tableDataValue.splice(index, 1, originalRow)
  }
}

const handleEditEmit = (row) => {
  emit('handleEditEmit', row)
}
//#endregion


// 是否可以勾选-ge
const checkSelectable = (row) => {
  if (row.id) {
return true
  } else {
    return false
  }
}
//获取字典lable
const getDictLabel = (value, dictName) => {
  let label = ''
  if (value != null) {
    let option = getDictObj(DICT_TYPE[dictName], value)
    label = option?.label || ''
  }
  return label
}

// 表格滚动到最底部
const tableRef = ref()
const scrollToBottom = async () => {
  nextTick(() => {
    tableRef.value?.setScrollTop(tableRef.value?.$refs.tableBody.scrollHeight)
  })
}

defineExpose({
  multipleSelection
})
</script>

<style lang="scss" scoped>
.mult_table_box {
  margin-top: 10px;
  margin-bottom: 20px;

  .mr10 {
    margin-right: 10px;
  }

  #operationBox {
    // white-space: nowrap;
    // width: auto;
    // overflow: hidden;
  }
  .mr12px {
    // margin-right: 12px;
  }
  .ml15 {
    margin-left: 12px;
  }
  .table_btn_box {
    // display: flex;
    .el-button {
      margin-left: 12px !important;
      margin-right: 0px !important;
    }
  }
  .flex_ {
    display: flex;
    align-items: center;
  }
  .flex_cetner{
  justify-content: center;
  }
  .red_ {
    color: red;
    font-size: 14px;
    margin-right: 5px;
  }
}
</style>

<style lang="scss">
.mult_table_box {
  .el-select {
    .el-select__wrapper {
      height: 30px !important;
    }
  }
  .el-form-item {
    margin-bottom: 1px !important;
    .el-form-item__content {
      font-size: 12px !important;
    }
  }

  .el-date-editor,
  .el-input-number {
    width: 100%;
  }
  .el-scrollbar__bar {
    display: block !important;
  }
  .el-select,
  .w100 {
    width: 100%;
  }
}
</style>


这个是匹配多层表头的表格,看起来有复杂 但是html代码很简单 重复而已,重点看el-form-item的位置
1.from表单包着表格:<el-form ref="formRef" :model="formData" >表格</el-from>
2.el-table-column包着el-form-item 简便写法:看结构

<el-table-column>
 <template #default="scope">
  <el-form-item
     :prop="'tableDataValue[' + scope.$index + '].' + column.prop"
     :rules="[
           { required: column2.required, message: '', trigger: 'blur' }]"
  >
     //编辑 inputi情况
     //编辑 number-input情况
  </el-form-item>
 </template>
</el-table-column>

看完整代码可以发现我也把操作列里面的按钮也用 包住了 不用校验为什么还要包住 是因为保持高度center 不然同一行字有高有低的。

3.看数据结构关系:不然无法校验是否有值

const formData = reactive({
  tableDataValue: []
})

tableDataValue的赋值在watch里面

4.el-from-item上的rule 赋值问题:( column.prop 是字段名称)

<el-form-item
   :prop="'tableDataValue[' + scope.$index + '].' + column.prop"
   :rules="[{ required: column.required, message: '', trigger: 'blur' }]"
              >

这篇是针对保存时校验问题,理解就行了。
完整的组件例子 包括循环的列 都在上一篇文章:
https://blog.youkuaiyun.com/Web_Notes/article/details/160256235?spm=1001.2014.3001.5501

刷机维修进阶教程-----adb禁用错了系统app导致无法开机 如何保数据无损恢复机型 在刷机维修过程中 。我们会遇到一些由于客户使用adb指令来禁用手机app而导致手机无法开机进入系统的故障机型。通常此类问题机型有好几种解决方法。但如果客户需要保数据来恢复机型。其实操作也是很简单的.还有类似误删除应用导致不开机等等如何保数据。  通过博文了解💝💝💝    1💝💝💝----adb禁用或者删除系统app导致无法开机的几种解决方法 2💝💝💝----如何保数据来无损恢复机型 3💝💝💝----其他保数据解决系统类故障无法开机的步骤解析 阅读详情

相关推荐

告别Godot默认编辑器:手把手教你用VSCode配置C#开发环境(附中文注释避坑指南)

本文详细介绍了如何将VSCode配置为Godot引擎的C#开发环境,提升游戏开发效率。从环境准备、扩展配置到解决中文编码问题,提供完整的避坑指南和高级调试技巧,帮助开发者充分利用VSCode的智能补全和调试功能,打造高效工作流。

weixin_30596023的博客 190

vue3 elementui plus 可编辑表格 完整例子

【代码】vue3 elementui plus 可编辑表格 表格与表单结合 保存时校验。

Web_Notes的博客 208

「大模型学习」(14)Long Context之线性插值、NTK-aware、Yarn、LongRoPE

大语言模型长上下文扩展中的位置插值技术 摘要:为解决大语言模型(LLMs)在推理阶段扩展上下文窗口时的位置编码限制,研究人员开发了一系列位置插值技术。这些方法主要针对旋转位置编码(RoPE)机制,通过不同策略调整位置索引以适应超出训练长度的上下文。典型方法包括:基础位置插值(PI)均匀缩放位置索引;NTK-aware插值对不同频率维度差异化处理;NTK-by-parts插值根据波长分段调整;Yarn插值结合温度调节;以及LongRoPE采用非均匀插值策略。这些技术在不修改模型结构的前提下,通过调整位置编码的

qq_43044037的博客 1645

开源了一款基于 Vue 3 的高性能多维表格编辑器

单一数据源所有表格数据统一管理响应式更新基于 Vue 3 响应式系统持久化存储自动同步到 localStorage类型安全完整的 TypeScript 类型定义DOM 复用只渲染可见区域的 DOM 元素预渲染使用 overscan 预渲染额外行防抖处理滚动事件防抖优化内存管理自动回收不可见元素大家可以参考一下,在设计对性能要求比较高的复杂系统时,非常有帮助。组件架构设计App.vue单一职责每个组件只负责一个功能组合优于继承通过组合实现复杂功能Props 向下传递。

2401_86373285的博客 1982

abaqus热力耦合模拟教程学习笔记

学习资源:BV1je4y1a7Ku软件:abaqus2016以m为单位制。

qq_41900477的博客 2万+

STC8单片机低功耗延时优化实践:从循环等待到定时唤醒

本文深入探讨了STC8单片机低功耗延时优化的核心方法,即利用掉电唤醒定时器(WKT)替代传统的循环等待,实现从“空转耗电”到“定时唤醒”的转变。通过实战代码演示了如何编写低功耗延时函数,将待机电流从mA级降至μA级,并分析了精度、唤醒时间等关键权衡点,为电池供电的物联网设备提供了有效的续航优化方案。

pea55的博客 326

Vue3中使用Element Plus实现可编辑表格

在现代Web开发中,使用Vue.js构建的交互式表格是非常常见的需求之一。特别是在涉及到数据管理的应用场景中,能够直接在表格内进行编辑、添加和删除的操作极大地提升了用户体验。本文将介绍如何利用Vue3结合Element Plus来实现一个基本的可编辑表格。

前端学步 4261

Qt开发者必看:QTimer::singleShot的5个实战避坑指南(含lambda和多线程案例)

本文为Qt开发者提供了QTimer::singleShot的5个关键实战避坑指南,涵盖lambda捕获、对象生命周期和多线程安全等核心难点。通过对比错误与正确代码示例,深入解析了如何避免悬空指针、确保线程执行上下文正确以及管理定时任务资源,帮助开发者编写更健壮、可靠的延迟执行代码。

stem5的博客 466

vue3 + Element Plus动态生成表格,并实现内容可编辑

基于 vue3 & element plus 的可编辑表格

ymzhao 5万+

【自适应调制】自适应调制解调通信链路误码率matlab仿真与分析

BPSK中的B是“Binary”的意思,也就是有两个变化状态,比如说相位上的“+90°(代表1)、-90°(代表0)”,一个状态代表的就是一个比特。QPSK的“Q”是“Quadrature”的意思,有四个变化状态,如相位上的“+45°(代表00)、-45°(代表11)、+135°(代表10)、-135°(代表01)”,那么一个状态就代表两个比特的信息,如图2所示。同理8PSK的一个状态代表三个比特。但是功率资源并不是无限的,基站总的发射功率是一定的,为了充分利用所有的功率,采用的就是AMC技术。

FPGA/MATLAB学习教程/源码/项目合作开发 1833

MySQL 一一 MySQL基本使用

1、数据库 简单来说,所谓的数据库就是存储数据的容器,而且是永久存储的。 2、为什么需要数据库 3、为什么要学习MySQL数据库 最早MySQL数据,瑞典AB公司开发的一款开源型的关系型数据库。 随着时间的推移,瑞典AB公司把MySQL数据库转让给Sun公司(Java语言的创始公司) 后来,Sun公司经营不善,又把MySQL数据库转让给甲骨文公司(Oracle数据库) 4、数

Guizy 7万+

【Vue】1883- Vue 可编辑表格:让数据编辑更舒适自如

作者:youth君https://juejin.cn/post/7242140832379584567使用ElementPlus的Table啥都好,就是没有可编辑表格!!!????既然UI库不支持,那我们实现一个可编辑表格是很难的事么?????难么?????不难么?...个人觉得如果是业务固定的可编辑表格,使用ElementPlus实现都不难。但是如果需要的是一个通用的可编辑表格,这好像还真说不好。对于通用的可编辑...

pingan8787 219

RAGFlow 系列教程 第14课:GraphRAG -- 知识图谱增强检索

RAGFlow v0.25.0深度解读了GraphRAG技术,通过构建知识图谱解决传统RAG在多跳推理问题上的局限。系统支持General GraphRAG和Light GraphRAG两种实现,包含四阶段构建流程:实体关系抽取、实体消解、社区检测和图持久化。核心代码位于rag/graphrag目录,采用LLM驱动的抽取机制,结合编辑距离和LLM确认的实体消解策略,以及Leiden社区检测算法。KGSearch模块通过多信号融合检索(实体+关系+N-hop+社区)实现高效查询。该系统将非结构化文本转化为可推

weixin_43674738的博客 101

vue3 + jsx + antDesign 编辑表格、表单组合使用,实现表单动态验证(有对element-plus的补充)

MyTabCard为antd中tab、card、form组件封装而成,tabTable为自定义具名插槽,myTable为表格组件。本文主要总结使用antd中form表单所遇到例如校验不消失。文章最后为总代码。

qq_59499037的博客 537

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain&#39;s apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath(&#39;DeepLearnToolbox&#39;));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand(&#39;state&#39;,0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W&#39;); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand(&#39;state&#39;,0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = &#39;sigm&#39;;%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, &#39;Too big error&#39;);```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand(&#39;state&#39;,0)sae = saesetup([784 100]);sae.ae{1}.activation_function = &#39;sigm&#39;;sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)&#39;)% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = &#39;sigm&#39;;nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, &#39;Too big error&#39;);```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x&#39;,28,28,60000))/255;test_x = double(reshape(test_x&#39;,28,28,10000))/255;train_y = double(train_y&#39;);test_y = double(test_y&#39;);%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you&#39;ll get around 1.2% errorrand(&#39;state&#39;,0)cnn.layers = { struct(&#39;type&#39;, &#39;i&#39;) %input layer struct(&#39;type&#39;, &#39;c&#39;, &#39;outputmaps&#39;, 6, &#39;kernelsize&#39;, 5) %convolution layer struct(&#39;type&#39;, &#39;s&#39;, &#39;scale&#39;, 2) %sub sampling layer struct(&#39;type&#39;, &#39;c&#39;, &#39;outputmaps&#39;, 12, &#39;kernelsize&#39;, 5) %convolution layer struct(&#39;type&#39;, &#39;s&#39;, &#39;scale&#39;, 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, &#39;Too big error&#39;);```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand(&#39;state&#39;,0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, &#39;Too big error&#39;);%% ex2 neural net with L2 weight decayrand(&#39;state&#39;,0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);%% ex3 neural net with dropoutrand(&#39;state&#39;,0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);%% ex4 neural net with sigmoid activation functionrand(&#39;state&#39;,0)nn = nnsetup([784 100 10]);nn.activation_function = &#39;sigm&#39;; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);%% ex5 plotting functionalityrand(&#39;state&#39;,0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = &#39;softmax&#39;; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand(&#39;state&#39;,0)nn = nnsetup([784 20 10]); nn.output = &#39;softmax&#39;; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

efm32 入门.pdf

本PDF共计22页,介绍的是操作驱动API,下载与否自己斟酌。

Axure Element 组件复用:ElementUI/Plus 元件库 + 大厂设计规范技巧

对高频组件(按钮、表单、导航栏)设置交互样式和变量,确保状态切换(hover/active/disabled)与 ElementUI 规范一致。创建自适应模板时,参照大厂的响应式断点规则(例如 Bootstrap 的 576px/768px/992px)。将复用组件分类为原子级(按钮/输入框)、分子级(搜索框/弹窗)、模板级(CRUD 页)三级母版库。利用 Axure 的「样式库」功能保存通用文本样式(字体/行高/字重),匹配 ElementUI 的。

afadssaxasx的博客 259

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

vue3+element plus 如何实现可编辑表格

1.点击表格内容部分,输入框边框显示出来,此时内容可编辑。2.失焦之后,根据失焦事件完成后续样式修改。具体使用详见element plus 官网。

xhjtcflm的博客 9322

Element Plus 封装表格组件、表格查询、表格分页、动态表头,可编辑单元格【常用功能版本】

Element Plus 封装表格、可编辑单元格、表格查询、表格分页、动态表头组件

m0_67584973的博客 1万+

ElementPlus Table 表格实现可编辑单元格

通过基础的Table表格来实现单元格内容的可编辑。

hello,word! 1716

vue3+element-plus 1.动态表格编辑和2.静态表格编辑

【代码】vue3+element-plus 1.动态表格编辑 2.静态表格编辑。

weixin_71155604的博客 2198

基于Element-Plus实现的Excel表格(读取、编辑等功能)

有许多库可以可以实现excel表格的预览、编辑等功能,比如Handsontable、Ag-Grid、Luckysheet等等。但是为什么个人要自己手动实现呢?原因是因为这些库要么停止维护了,要么有些库有问题,用起来很麻烦,更更更重要的是有些库是要付费的(资深白嫖党绝对不能接受!!!),再加上自己的需求和页面风格等等,最后决定自己手动实现。废话少说,先上图,看完图后不想复制代码的可以关闭该标签页了:好了,当你看到这句话时就表明你很大概率想复制代码了,那就开始动手实现吧。

2501_90388262的博客 1263

Vue3+Element+TypeScript可编辑表格

【代码】Vue3+Element+TypeScript可编辑表格。

80岁小姑娘的博客 664

Elementplus_table可编辑模式

在table中添加编辑模式,可修改表格数据并保存

qq_33630600的博客 4224

Vue 可编辑表格:让数据编辑更舒适自如

大厂技术高级前端Node进阶点击上方程序员成长指北,关注公众号回复1,加入高级Node交流群使用ElementPlus的Table啥都好,就是没有可编辑表格!!!????既然UI库不支持,那我们实现一个可编辑表格是很难的事么?????难么?????不难么?...个人觉得如果是业务固定的可编辑表格,使用ElementPlus实现都不难。但是如果需要的是一个通用的可编辑表格,这好像还真说不好。对于通用的可编辑...

程序员成长指北 2169

element plus 表格 el-table 单元格可编辑

1.效果如下,‘内容’列单元格可以实现点击进行编辑。3.点击保存按钮调用接口。

weixin_55659112的博客 2066

element-plus vue3表格可编辑封装

element-plus vue3表格可编辑封装

zrxc001的博客 1265

elementplus修改表格数据

接。

mecende的博客 1217

Vue3 列表与表格最佳实践:分页、筛选、排序、批量操作与 Hook 封装|Vue 核心语法与组件模式篇

本文从列表与表格的选型讲起,对比 Element Plus、Ant Design Vue、vxe-table 三大表格组件,详解前端 / 后端分页、筛选、排序、批量操作等后台表格核心功能。包含参数清洗、日期处理、防抖、跨页选中、性能优化等实战踩坑点,并封装通用 useTable Hook,提供可直接用于生产项目的完整表格模板,帮你写出规范、稳定、易维护的中后台表格页面。

中后台前端工程师,专注技术本质,用通俗语言讲清硬核知识点,持续输出成长干货。 1693
上一篇: vue3 elementui plus 可编辑表格 完整例子
下一篇: 前端压缩包
一个打工仔的笔记
博客等级 码龄6年 1904粉丝 154原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值