From 7c575c01cfd8493bee47e170edfbd839fd0d94d6 Mon Sep 17 00:00:00 2001
From: sakuya <81883387@qq.com>
Date: Thu, 8 Jul 2021 23:13:51 +0800
Subject: [PATCH] UP
---
src/views/setting/client/index.vue | 56 ++----------------
src/views/setting/client/save.vue | 92 +++++++++++++++++++-----------
src/views/setting/task/index.vue | 36 ++++--------
src/views/setting/task/save.vue | 76 +++++++++++++++++-------
4 files changed, 131 insertions(+), 129 deletions(-)
diff --git a/src/views/setting/client/index.vue b/src/views/setting/client/index.vue
index bf49a82c..0c6063d4 100644
--- a/src/views/setting/client/index.vue
+++ b/src/views/setting/client/index.vue
@@ -32,13 +32,7 @@
-
-
-
- 取 消
- 保 存
-
-
+
@@ -53,40 +47,17 @@
data(){
return {
apiObj: this.$API.app.list,
- selection: [],
- saveDialogVisible: false,
- saveMode: 'add',
- titleMap: {
- add: "新增",
- edit: "编辑",
- show: "查看"
- },
- isSaveing: false,
+ selection: []
}
},
methods: {
add(){
- this.saveMode = 'add';
- this.saveDialogVisible = true;
+ this.$refs.saveDialog.show()
},
//编辑
table_edit(row){
- this.saveMode = 'edit';
- this.saveDialogVisible = true;
- this.$nextTick(() => {
- //这里应该再次根据ID查询详情接口
- this.$refs.saveDialog.setData(row)
- })
-
- },
- //查看
- table_show(row){
- this.saveMode = 'show';
- this.saveDialogVisible = true;
- this.$nextTick(() => {
- //这里应该再次根据ID查询详情接口
- this.$refs.saveDialog.setData(row)
- })
+ this.$refs.saveDialog.show('edit')
+ this.$refs.saveDialog.setData(row)
},
//删除
async table_del(row, index){
@@ -119,25 +90,10 @@
})
},
- //提交
- saveForm(){
- this.$refs.saveDialog.submit(async (formData) => {
- this.isSaveing = true;
- var res = await this.$API.user.save.post(formData);
- this.isSaveing = false;
- if(res.code == 200){
- //这里选择刷新整个表格 OR 插入/编辑现有表格数据
- this.saveDialogVisible = false;
- this.$message.success("操作成功")
- }else{
- this.$alert(res.message, "提示", {type: 'error'})
- }
- })
- },
//表格选择后回调事件
selectionChange(selection){
this.selection = selection;
- },
+ }
}
}
diff --git a/src/views/setting/client/save.vue b/src/views/setting/client/save.vue
index f10b2cec..9f69c622 100644
--- a/src/views/setting/client/save.vue
+++ b/src/views/setting/client/save.vue
@@ -1,35 +1,43 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 取 消
+ 保 存
+
+