zhaoke 1 vuosi sitten
vanhempi
commit
4a4d41ea9e

+ 2 - 1
src/views/dataAccessPage/components/accessPageNode.vue

@@ -331,7 +331,8 @@ export default {
           parametername: event == 1 ? item.name : item.parametername,
           subscriptionexpressions: event == 1 ? item.code : item.subscriptionexpressions,
           datasource: item.datasource,
-          parametertype: event == 1 ? item.datatype : item.parametertype
+          parametertype: event == 1 ? item.datatype : item.parametertype,
+          datasourcekey: item.datasourcekey
         }
         const itemData = event == 1 ? formatChange(nobj, event, key) : formatChange(item, event, key)
         const nitem = itemData[0] || {}

+ 2 - 1
src/views/dataAccessPage/components/nodeForm.vue

@@ -34,7 +34,8 @@
             <el-input size="small" type="textarea" v-model="tableForm.preconditions"></el-input>
           </el-form-item>
         </el-col>
-        <el-col v-if="formatData(algorithmtype) == 'js'" :span="24">
+        <!-- v-if="formatData(algorithmtype) == 'js'" :span="24" -->
+        <el-col>
           <el-form-item prop="computingexpression" label="计算表达式">
             <el-input size="small" type="textarea" v-model="tableForm.computingexpression"></el-input>
           </el-form-item>

+ 13 - 7
src/views/dataAccessPage/components/nodeTable.vue

@@ -23,7 +23,10 @@
         </el-table-column>
         <el-table-column prop="subscriptionexpressions" label="参数订阅规则">
           <template slot-scope="scope">
-            <el-input size="small" v-model="scope.row.subscriptionexpressions" placeholder="请输入参数订阅规则" />
+            <el-select v-if="scope.row.datasourcekey" size="small" v-model="scope.row.subscriptionexpressions" placeholder="请选择">
+              <el-option v-for="(item,index) in subsCols" :key="index" :label="item.datasourcedescribe" :value="formatString(item.datasourceid)"></el-option>
+            </el-select>
+            <el-input v-else size="small" v-model="scope.row.subscriptionexpressions" placeholder="请输入参数订阅规则" />
           </template>
         </el-table-column>
       </el-table>
@@ -51,7 +54,10 @@
         </el-table-column>
         <el-table-column prop="code" label="参数订阅规则">
           <template slot-scope="scope">
-            <el-input size="small" v-model="scope.row.code" placeholder="请输入参数订阅规则" />
+            <el-select v-if="scope.row.datasourcekey" size="small" v-model="scope.row.code" placeholder="请选择">
+              <el-option v-for="(item,index) in subsCols" :key="index" :label="item.datasourcedescribe" :value="formatString(item.datasourceid)"></el-option>
+            </el-select>
+            <el-input v-else size="small" v-model="scope.row.code" placeholder="请输入参数订阅规则" />
           </template>
         </el-table-column>
       </el-table>
@@ -60,14 +66,13 @@
 </template>
 
 <script>
-import { getTableCols } from '@/utils/validate'
 import { getQueryData } from '../utils/index'
 export default {
   name: 'NodeTable',
   props: ['queryId', 'type'],
   data () {
     return {
-      tableCols: [],
+      subsCols: [],
       tableData: [],
       datasources: [],
       datatypes: []
@@ -86,9 +91,6 @@ export default {
       immediate: true
     }
   },
-  mounted () {
-    this.tableCols = getTableCols(233)
-  },
   methods: {
     async getTableData (pagecode, id, datacontent) {
       const { code, returnData } = await getQueryData(id, datacontent)
@@ -97,6 +99,7 @@ export default {
         if (pagecode == 'tabledata') {
           this.getTableData('datasource', 19, { type: "datasource" })
           this.getTableData('datatype', 19, { type: "algorithmlibraryParamenterType" })
+          this.getTableData('subs', 12, { 1: 1 })
         }
       }
     },
@@ -122,6 +125,9 @@ export default {
         case 'tabledata':
           this.tableData = [...returnData]
           break;
+        case 'subs':
+          this.subsCols = [...returnData]
+          break;
         default:
           break;
       }