diff --git a/web/src/views/system/config/components/formContent.vue b/web/src/views/system/config/components/formContent.vue index 970cfdb..7dcd28f 100644 --- a/web/src/views/system/config/components/formContent.vue +++ b/web/src/views/system/config/components/formContent.vue @@ -2,16 +2,22 @@
变量标题 - 变量值 - 变量名 + 变量值 + 变量名 + 状态 + 操作 - + - + + 删除后无法恢复,确定删除吗?

取消 - 确定 + 确定
删除 @@ -195,7 +201,34 @@
- {{ editableTabsItem.key }}.{{ item.key }} + + + + + {{ editableTabsItem.key }}.{{ item.key }} + + + + + + + + + + + + + 确定 @@ -382,11 +415,17 @@ export default { } }, // 子表删除 - onRemoveChild (row, index) { + onRemoveChild (row, index, refName) { + console.log(row, index) if (row.id) { - console.log(1, 'ok') + api.DelObj(row.id).then(res => { + this.refreshView() + }) } else { this.childTableData.splice(index, 1) + const tableName = 'xTable_' + refName + const tableData = this.$refs[tableName][0].remove(row) + console.log(tableData) } }, // 图片预览 @@ -445,6 +484,25 @@ export default { if (value.uid === file.uid) index = inx }) this.form[key].splice(index, 1) + }, + // 配置的行删除 + onDelRow (obj) { + api.DelObj(obj.id).then(res => { + this.refreshView() + }) + }, + // 行编辑 + onEdit (index) { + const that = this + that.$set(that.formList[index], 'new_key', that.formList[index].key) + that.$set(that.formList[index], 'edit', true) + }, + // 行编辑保存 + onEditSave (obj) { + obj.key = JSON.parse(JSON.stringify(obj.new_key)) + api.UpdateObj(obj).then(res => { + this.refreshView() + }) } }, mounted () {