临时提交
This commit is contained in:
@@ -87,6 +87,7 @@ export default {
|
||||
this.tableData[k.substring(1) || 0] = item
|
||||
} else if (![columnProp, 'key'].includes(k)) {
|
||||
const index = columns.findIndex(e => k == e)
|
||||
console.log(index)
|
||||
if (index > -1) {
|
||||
const item = this.tableData[index] || {}
|
||||
item[prop] = v
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
<script>
|
||||
import AiDialogBtn from "dui/packages/layout/AiDialogBtn.vue";
|
||||
import Template from "../../../../project/sass/apps/AppAskForm/components/Template.vue";
|
||||
|
||||
export default {
|
||||
name: "tableEditor",
|
||||
components: {AiDialogBtn},
|
||||
components: {Template, AiDialogBtn},
|
||||
model: {
|
||||
event: "input",
|
||||
prop: "tableData"
|
||||
@@ -44,6 +45,7 @@ export default {
|
||||
})
|
||||
}
|
||||
},
|
||||
columns:v=>v.configs
|
||||
},
|
||||
methods: {
|
||||
rowSave(form, done) {
|
||||
@@ -82,6 +84,9 @@ export default {
|
||||
<template>
|
||||
<section class="tableEditor">
|
||||
<avue-crud :option="option" :data="records" @row-save="rowSave" @row-cancel="rowSave" @row-del="rowDel">
|
||||
<template v-for="c in columns" :slot="`${c.prop}Header`" slot-scope="{column = {}}">
|
||||
<el-input class="headerInput" v-model="column.label" clearable placeholder="请输入列名" @change="$emit('update:configs', columns)"/>
|
||||
</template>
|
||||
<template v-if="label" v-slot:menuLeft>
|
||||
<div class="label" v-text="label"/>
|
||||
</template>
|
||||
@@ -155,5 +160,13 @@ export default {
|
||||
&:last-of-type {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
:deep(.headerInput) {
|
||||
.el-input__inner {
|
||||
padding: 0;
|
||||
border: none;
|
||||
background: transparent;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user