Browse Source

修改bug

zhaoke 1 year ago
parent
commit
44645acae5

+ 5 - 1
src/components/PublicPageDialog/index.vue

@@ -10,7 +10,7 @@
         <template v-if="formAuth">
           <el-button @click="handleClose" size="small">取消</el-button>
           <slot name="d_foot" />
-          <el-button @click="handleSubmit" type="primary" size="small">确定</el-button>
+          <el-button @click="handleSubmit" :loading="dialogLoading" type="primary" size="small">确定</el-button>
         </template>
       </div>
     </el-drawer>
@@ -40,6 +40,10 @@ export default {
     dialogSize: {
       type: String | Number,
       default: '350px'
+    },
+    dialogLoading: {
+      type: Boolean,
+      default: false
     }
   },
   methods: {

+ 3 - 0
src/components/publicPageForm/index.vue

@@ -301,6 +301,9 @@ export default {
       this.$refs["ruleForm"].validate((valid) => {
         if (valid) {
           flag = true
+          if (this.tableForm.hasOwnProperty('passparameters') && !this.tableForm.passparameters) {
+            delete this.tableForm.passparameters
+          }
           this.clearTypeUpload(nload)
         } else {
           flag = false;

+ 1 - 0
src/views/dataAccessPage/components/accessPageForm.vue

@@ -188,6 +188,7 @@ export default {
     },
     // 新增/编辑-确认
     submitClickHandler () {
+      if (this.tableForm.algorithmtype) delete this.tableForm.algorithmtype
       let flag = false
       this.$refs["ruleForm"].validate((valid) => {
         if (valid) {

+ 6 - 1
src/views/dataAccessPage/components/accessPageTable.vue

@@ -7,7 +7,7 @@
       <PublicPageTable :loading="loading" :table-cols="tableCols" :table-btns="authBtns" :data="tableData" @mounted="tableMountedHandler" @load="load" @handleEdit="handleEdit" @handleOther="handleOther" @handleRemove="handleRemove" />
     </div>
     <div class="accessPageTable_dialog">
-      <PublicPageDialog :dialog-title="tableTitle" dialogSize="630px" :dialog-drawer="flag" @handleClose="submitClickClose('ruleForm')" @handleSubmit="submitClickHandler">
+      <PublicPageDialog :dialog-loading="dialogLoading" :dialog-title="tableTitle" dialogSize="630px" :dialog-drawer="flag" @handleClose="submitClickClose('ruleForm')" @handleSubmit="submitClickHandler">
         <PublicPageForm ref="ruleForm" :label-width="labelWidth" :form-data="tableForm" />
       </PublicPageDialog>
     </div>
@@ -40,6 +40,7 @@ export default {
       page: 0, //当前table页面
       noMore: false, //当前table是否加载到最后开关
       loading: false, //页面加载
+      dialogLoading: false,
       dialogFlag: false,
       pageTitle: '', //页面名称
       tableCols: [], //表头数据
@@ -252,6 +253,7 @@ export default {
     },
     //表格-增/删/改
     async generalDataReception (event, data, key) {
+      this.dialogLoading = true
       try {
         const params = {
           serviceid: this.pageServiceId,
@@ -270,6 +272,7 @@ export default {
           this.rmFlag = false
           this.tableObj = {}
           this.tableForm = {}
+          this.dialogLoading = false
           this.resetTable()
           this.load()
           // this.$router.go(0);
@@ -277,12 +280,14 @@ export default {
           this.$message.error("操作失败")
           this.flag = false
           this.rmFlag = false
+          this.dialogLoading = false
           this.tableObj = {}
           this.tableForm = {}
         }
       } catch (error) {
         this.flag = false
         this.rmFlag = false
+        this.dialogLoading = false
         this.tableObj = {}
         this.tableForm = {}
       }

+ 8 - 5
src/views/dataAccessPage/components/accessPageTree.vue

@@ -23,7 +23,7 @@
       </el-scrollbar>
     </div>
     <div class="publicPageTree_dialog">
-      <PublicPageDialog :dialog-title="tableTitle" dialogSize="630px" :dialog-drawer="flag" @handleClose="submitClickClose('ruleForm')" @handleSubmit="submitClickHandler">
+      <PublicPageDialog :dialog-loading="dialogLoading" :dialog-title="tableTitle" dialogSize="630px" :dialog-drawer="flag" @handleClose="submitClickClose('ruleForm')" @handleSubmit="submitClickHandler">
         <PublicPageForm ref="ruleForm" :label-width="labelWidth" :form-item="formItem" :form-data="tableForm" />
       </PublicPageDialog>
     </div>
@@ -45,6 +45,7 @@ export default {
   data () {
     return {
       loading: false,
+      dialogLoading: false,
       filterText: '',
       data: [],
       defaultProps: {
@@ -141,10 +142,11 @@ export default {
     },
 
     restData () {
-      this.flag = false;
-      this.rmFlag = false;
-      this.tableObj = {};
-      this.tableForm = {};
+      this.flag = false
+      this.rmFlag = false
+      this.dialogLoading = false
+      this.tableObj = {}
+      this.tableForm = {}
       this.queryTreeData(this.pageServiceId)
     },
 
@@ -173,6 +175,7 @@ export default {
 
     //表格-增/删/改
     async generalDataReception (event, data, key) {
+      this.dialogLoading = true
       try {
         const params = {
           serviceid: this.pageServiceId,

+ 19 - 14
src/views/tablePage/index.vue

@@ -16,7 +16,7 @@
     </div>
     <div class="TablePage_dialog">
       <!--新增/编辑-->
-      <PublicPageDialog :dialog-title="tableTitle" dialogSize="630px" :form-auth="formAuth" :dialog-drawer="flag" @handleClose="submitClickClose('ruleForm')" @handleSubmit="submitClickHandler">
+      <PublicPageDialog :dialog-loading="dialogLoading" :dialog-title="tableTitle" dialogSize="630px" :form-auth="formAuth" :dialog-drawer="flag" @handleClose="submitClickClose('ruleForm')" @handleSubmit="submitClickHandler">
         <PublicPageForm ref="ruleForm" :label-width="labelWidth" :form-pass="tableData" :form-type="tableType" :form-item="formItem" :form-data="tableForm" />
       </PublicPageDialog>
       <!--高级查询-->
@@ -64,6 +64,7 @@ export default {
       page: 0, //当前table页面
       noMore: false, //当前table是否加载到最后开关
       loading: false, //页面加载
+      dialogLoading: false, //新增/编辑确认按钮禁用
       advancedDrawer: false, //高级查询弹框开关
       defaultfilter: { 1: 1 }, //默认查询参数
       pageQuery: {},
@@ -384,6 +385,7 @@ export default {
     },
     //表格-增/删/改
     async generalDataReception (event, data, key) {
+      this.dialogLoading = true
       try {
         const params = {
           serviceid: this.pageServiceId,
@@ -397,27 +399,30 @@ export default {
               ? await modifyData(params)
               : await moveData(params);
         if (code == 0) {
-          this.$message.success("操作成功");
-          this.flag = false;
-          this.rmFlag = false;
-          this.tableObj = {};
-          this.tableForm = {};
-          this.resetTable();
+          this.$message.success("操作成功")
+          this.flag = false
+          this.rmFlag = false
+          this.dialogLoading = false
+          this.tableObj = {}
+          this.tableForm = {}
+          this.resetTable()
           this.load();
-          this.depMath = Math.random();
+          this.depMath = Math.random()
           // this.$router.go(0);
         } else {
           this.$message.error("操作失败");
-          this.flag = false;
-          this.rmFlag = false;
+          this.flag = false
+          this.rmFlag = false
+          this.dialogLoading = false
           this.tableObj = {};
           this.tableForm = {};
         }
       } catch (error) {
-        this.flag = false;
-        this.rmFlag = false;
-        this.tableObj = {};
-        this.tableForm = {};
+        this.flag = false
+        this.rmFlag = false
+        this.dialogLoading = false
+        this.tableObj = {}
+        this.tableForm = {}
       }
     },
     autoBtnClick (id, url, passparameters, row = {}) {