Ver código fonte

number处理

yangfan 4 meses atrás
pai
commit
9117f28225

+ 13 - 11
src/mixins/generator/common.js

@@ -62,17 +62,19 @@ export default {
     },
     onDbSource(val) {
       this.loading = true
-      listViewsByDataSource({ datasourceId: val, current: 1, size: 10000 }).then((res) => {
-        if(res.data.data && res.data.data.records && res.data.data.records.length) {
-          this.tableList = res.data.data.records
-          this.loading = false
-        }else {
-          this.tableList = []
+      listViewsByDataSource({ datasourceId: val, current: 1, size: 10000 })
+        .then((res) => {
+          if (res.data.data && res.data.data.records && res.data.data.records.length) {
+            this.tableList = res.data.data.records
+            this.loading = false
+          } else {
+            this.tableList = []
+            this.loading = false
+          }
+        })
+        .catch((e) => {
           this.loading = false
-        }
-      }).catch((e)=>{
-        this.loading = false
-      })
+        })
     },
     onTableViewName(val) {
       this.loading = true
@@ -94,7 +96,7 @@ export default {
       param.append('modelId', this.columnData.modelId)
       param.append('modelName', this.dataForm.fullName)
       createCubeByTable(param).then((res) => {
-        this.dataForm.dbLinkId = Number(res.data.data.id)
+        this.dataForm.dbLinkId = res.data.data.id
         this.onDbChange(res.data.data.id)
       })
     },

+ 4 - 4
src/mixins/generator/form.js

@@ -133,10 +133,10 @@ export default {
               this.tables = (this.dataForm.visualdevTables && JSON.parse(this.dataForm.visualdevTables)) || []
               // this.updateFields()
               this.loading = false
-              this.dataForm.dbLinkId = Number(res.data.data.dbLinkId)
-              this.dataForm.dbSourceId = Number(res.data.data.dbSourceId)
-              this.dataForm.Strategy = Number(res.data.data.primaryStrategy)
-              this.dataForm.modeType = Number(res.data.data.modeType)
+              this.dataForm.dbLinkId = res.data.data.dbLinkId
+              this.dataForm.dbSourceId = res.data.data.dbSourceId
+              this.dataForm.Strategy = res.data.data.primaryStrategy
+              this.dataForm.modeType = res.data.data.modeType
               this.$nextTick(() => {
                 this.onDbSource(this.dataForm.dbSourceId)
                 this.onDbChange(this.dataForm.dbLinkId)

+ 3 - 3
src/views/form/webDesign/customEventExpression.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-<!--    <el-button @click="addFuncClick">新增自定义事件</el-button>-->
+    <!--    <el-button @click="addFuncClick">新增自定义事件</el-button>-->
     <el-dialog
       :close-on-click-modal="false"
       :close-on-press-escape="false"
@@ -18,7 +18,7 @@
             前置执行
             <el-tooltip style="cursor: pointer" effect="dark" placement="top">
               <div slot="content">
-                注:前置事件必须返回一行一列数据,当返回值为0允许继续执行,非0时终止执行;<br/>
+                注:前置事件必须返回一行一列数据,当返回值为0允许继续执行,非0时终止执行;<br />
                 例句:select count(*) from v_user where username='[username]'
               </div>
               <i class="el-icon-question" />
@@ -210,7 +210,7 @@ export default {
     },
     addFuncClick(row) {
       this.showEditComputedField = true
-      this.datasourceId = this.datasourceId && Number(this.datasourceId)
+      this.datasourceId = this.datasourceId && this.datasourceId
       this.$nextTick(() => {
         if (row && row.id) {
           this.eventName = row.eventName

+ 2 - 2
src/views/form/webDesign/tabManage.vue

@@ -179,8 +179,8 @@ export default {
           this.addForm[key] = newRow[key]
         }
         this.addForm.tableName = this.primaryTableName
-        this.addForm.fieldId = Number(row.fieldId)
-        this.addForm.tabFieldId = Number(row.tabFieldId)
+        this.addForm.fieldId = row.fieldId
+        this.addForm.tabFieldId = row.tabFieldId
       })
     },
     //  删除页签