表格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") 删除