From 072282cf394f30f6c2c9f8377099b9b3ab666e88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8C=BF=E5=B0=8F=E5=A4=A9?= <1638245306@qq.com> Date: Fri, 19 Aug 2022 15:58:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=8F=98=E5=8C=96:=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E-=E7=B3=BB=E7=BB=9F=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E7=9A=84=E5=88=A0=E9=99=A4=E5=92=8C=E7=BC=96=E8=BE=91=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/config/components/formContent.vue | 74 +++++++++++++++++-- 1 file changed, 66 insertions(+), 8 deletions(-) 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 () {