el-table表格插入el-checkbox、el-input;

表格1(el-checkbox)

el-table(:data="tableData" border height="calc(100vh - 285px)")
  el-table-column(type="index" label="序号" align="center")
  el-table-column(prop="label" label="字段名称" align="center")
  el-table-column(prop="is_require" label="内容是否为必填" align="center")
    template(slot-scope="scope")
      el-checkbox(v-model="scope.row.is_require" @change="changeType")
  //-
  el-table-column(label="快速录入启用" align="center")
    template(slot-scope="scope")
      el-checkbox(v-model="scope.row.type" true-label='select' false-label='input' @change="changeType" :disabled="scope.row.type === 'data'")


  //-
  el-table-column(label="快速录入设置" align="center" )
    template(slot-scope="scope")
      el-button(type="text" :style="{color:scope.row.type === 'select' ? '#303133' : '#d9d9d9' }" :disabled="scope.row.type === 'data'") 设置
  
  el-table-column(prop="is_show" label="页面是否显示" align="center")
    template(slot-scope="scope")
      el-checkbox(v-model="scope.row.is_show")
  //-
  el-table-column(label="是否为日期" align="center")
    template(slot-scope="scope")
      el-checkbox(v-model="scope.row.type" true-label='data' false-label='input' @change="changeType" :disabled="scope.row.type === 'select'")
  
  el-table-column(prop="placeholder" label="字段填写说明" align="center")

数据

tableData: [{
  id:"5d75f0ab0f3e197fd15a5c12",
  label:"案卷号",
  type:"input",
  placeholder:"基建档案",
  options: [],
  is_require:true,
  is_show:true,
},{
  id:"123",
  label:"案卷号1",
  type:"date",
  placeholder:"基建档案1",
  options:[
      "option1", "option2"
  ],
  is_require:false,
  is_show:false
  },{
  id:"aaa",
  label:"案卷号1",
  type:"select",
  placeholder:"基建档案1",
  options:[
      "option1", "option2"
  ],
  is_require:false,
  is_show:false
  },
],

完整代码

<!--
 * @Author: your name
 * @Date: 2021-06-11 12:49:15
 * @LastEditTime: 2021-06-11 17:00:10
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \client-platform-terminal\src\views\electronic-records\component\records.vue
-->
<!--  -->
<template lang="pug">
  .recordsBox 
    .title 案卷记录基础信息
    .table-box
      el-table(:data="tableData" border height="calc(100vh - 285px)")
        el-table-column(type="index" label="序号" align="center")
        el-table-column(prop="label" label="字段名称" align="center")
        el-table-column(prop="is_require" label="内容是否为必填" align="center")
          template(slot-scope="scope")
            el-checkbox(v-model="scope.row.is_require" @change="changeType")
        //-
        el-table-column(label="快速录入启用" align="center")
          template(slot-scope="scope")
            el-checkbox(v-model="scope.row.type" true-label='select' false-label='input' @change="changeType" :disabled="scope.row.type === 'data'")


        //-
        el-table-column(label="快速录入设置" align="center" )
          template(slot-scope="scope")
            el-button(type="text" :style="{color:scope.row.type === 'select' ? '#303133' : '#d9d9d9' }" :disabled="scope.row.type === 'data'") 设置
        
        el-table-column(prop="is_show" label="页面是否显示" align="center")
          template(slot-scope="scope")
            el-checkbox(v-model="scope.row.is_show")
        //-
        el-table-column(label="是否为日期" align="center")
          template(slot-scope="scope")
            el-checkbox(v-model="scope.row.type" true-label='data' false-label='input' @change="changeType" :disabled="scope.row.type === 'select'")
        
        el-table-column(prop="placeholder" label="字段填写说明" align="center")
    .title 案卷记录扩展信息
</template>

<script>
export default {
  name: 'records',
  components: {},
    data() {
    return {
      tableData: [{
        id:"5d75f0ab0f3e197fd15a5c12",
        label:"案卷号",
        type:"input",
        placeholder:"基建档案",
        options: [],
        is_require:true,
        is_show:true,
      },{
        id:"123",
        label:"案卷号1",
        type:"date",
        placeholder:"基建档案1",
        options:[
            "option1", "option2"
        ],
        is_require:false,
        is_show:false
        },{
        id:"aaa",
        label:"案卷号1",
        type:"select",
        placeholder:"基建档案1",
        options:[
            "option1", "option2"
        ],
        is_require:false,
        is_show:false
        },
      ],
    }
    },
  computed: {},
  watch: {},
  methods: {
    changeType(val) {
      // debugger
      // console.log(112333333333333)
      // console.log(this.tableData)
    }
  },
  created() {
  },
  mounted() {
  },
}
</script>
<style lang="scss" scoped>
.recordsBox {
  .title {
    color: #409eff;
    font-size: 18px;
    font-weight: bold;
    padding: 10px;
  }
}
</style>

表格2(el-input;代码详情见链接:https://blog.csdn.net/qq_43780814/article/details/117789744?spm=1001.2014.3001.5501

el-table(:data="tableData1" border height="calc(100vh - 285px)")
          el-table-column(prop="id" label="分类编号" align="center")
            template(slot-scope="scope")
              el-input(v-model="scope.row.id" v-if="isEdit && scope.row.id !== '00'" @input="hasInputChange")
              span(v-html="scope.row.id" v-else)
          el-table-column(prop="name" label="分类名称" align="center")
            template(slot-scope="scope")
              el-input(v-model="scope.row.name" v-if="isEdit && scope.row.id !== '00'" @input="hasInputChange")
              span(v-html="scope.row.name" v-else)
          el-table-column(prop="no" label="档案分类号" align="center")
            template(slot-scope="scope")
              el-input(v-model="scope.row.no" v-if="isEdit && scope.row.id !== '00'" @input="hasInputChange")
              span(v-html="scope.row.no" v-else)
          el-table-column(label="操作" align="center" width="180")
            template(slot-scope="scope")
              span(@click="categoryDelete(scope.$index)" v-if="scope.row.id !== '00'" style="color: #0081f3") 删除
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值