CzRger месяцев назад: 5
Родитель
Сommit
e452399c9f

+ 1 - 1
src/views/manage/service/detail.vue

@@ -669,7 +669,7 @@ const onSubmit = () => {
       }
       params.requestHeaders = state.params.requestHeaders.data.length > 0 ? JSON.stringify(state.params.requestHeaders.data) : null
       // requestBody
-      if (!state.params.requestBody.data.every(v => proxy.$util.isValue(v.key) && proxy.$util.isValue(v.value) && proxy.$util.isValue(v.label) && proxy.$util.isValue(v.type) && (v.type != 3 || v.type == 3 && v.valueTable.length > 0))) {
+      if (!state.params.requestBody.data.every(v => proxy.$util.isValue(v.key) && (v.type == 2 || v.type != 2 && proxy.$util.isValue(v.value)) && proxy.$util.isValue(v.label) && proxy.$util.isValue(v.type) && (v.type != 3 || v.type == 3 && v.valueTable.length > 0))) {
         ElMessage.error('请完善Request Body参数信息!')
         state.params.tab = 3
         return

+ 5 - 2
src/views/manage/theme/relation-column.vue

@@ -72,7 +72,7 @@ const initText = () => {
   state.query.loading = true
   sysIndexFieldList(proxy.$util.formatGetParam({
     indexId: props.transfer.indexId,
-    type: 'inner_index'
+    type: props.transfer.type
   })).then(res => {
     state.query.result.data = res.data
     state.query.result.defaultShowIds = state.query.result.data.filter(v => v.searchShow == 1).map(v => v.id)
@@ -107,8 +107,11 @@ const onSubmit = () => {
     const arr = state.query.result.data.filter(v => v.searchShow == 1).map((v, i) => ({
       themeId: props.transfer.themeId,
       indexId: props.transfer.indexId,
+      type: props.transfer.type,
       fieldId: v.id,
-      sort: i
+      fieldName: v.fieldName,
+      fieldKey: v.fieldKey,
+      sort: i,
     }))
     state.loading = true
     sysThemeIndexSaveIndexFields(arr).then(res => {

+ 50 - 43
src/views/manage/theme/relation-detail.vue

@@ -303,49 +303,56 @@ const initDetail = () => {
 }
 const initText = (id) => {
   state.textOptions = []
-  if (isIndexCpt.value) {
-    sysIndexFieldList(proxy.$util.formatGetParam({
-      indexId: id,
-      type: 'inner_index'
-    })).then(res => {
-      state.textOptions = res.data
-      state.loading = false
-    })
-  } else {
-    outsideServiceFindById(id).then(res => {
-      const arr: any = []
-      const d = res.data
-      if (d.responseBody) {
-        try {
-          const p = JSON.parse(d.responseBody)
-          if (p.type == 1) {
-            p.json.data.forEach(v => {
-              arr.push({
-                fieldName: v.label,
-                fieldKey: v.key,
-              })
-            })
-          } else if (p.type == 2) {
-            p.text.data.forEach(v => {
-              arr.push({
-                fieldName: v.label,
-                fieldKey: v.key,
-              })
-            })
-          } else if (p.type == 3) {
-            p.other.data.forEach(v => {
-              arr.push({
-                fieldName: v.label,
-                fieldKey: v.key,
-              })
-            })
-          }
-        } catch (e) {}
-      }
-      state.textOptions = arr
-      state.loading = false
-    })
-  }
+  sysIndexFieldList(proxy.$util.formatGetParam({
+    indexId: id,
+    type: props.transfer.type
+  })).then(res => {
+    state.textOptions = res.data
+    state.loading = false
+  })
+  // if (isIndexCpt.value) {
+  //   sysIndexFieldList(proxy.$util.formatGetParam({
+  //     indexId: id,
+  //     type: 'inner_index'
+  //   })).then(res => {
+  //     state.textOptions = res.data
+  //     state.loading = false
+  //   })
+  // } else {
+  //   outsideServiceFindById(id).then(res => {
+  //     const arr: any = []
+  //     const d = res.data
+  //     if (d.responseBody) {
+  //       try {
+  //         const p = JSON.parse(d.responseBody)
+  //         if (p.type == 1) {
+  //           p.json.data.forEach(v => {
+  //             arr.push({
+  //               fieldName: v.label,
+  //               fieldKey: v.key,
+  //             })
+  //           })
+  //         } else if (p.type == 2) {
+  //           p.text.data.forEach(v => {
+  //             arr.push({
+  //               fieldName: v.label,
+  //               fieldKey: v.key,
+  //             })
+  //           })
+  //         } else if (p.type == 3) {
+  //           p.other.data.forEach(v => {
+  //             arr.push({
+  //               fieldName: v.label,
+  //               fieldKey: v.key,
+  //             })
+  //           })
+  //         }
+  //       } catch (e) {}
+  //     }
+  //     state.textOptions = arr
+  //     state.loading = false
+  //   })
+  // }
 }
 const handleChangeCondition = (val) => {
   if (val) {

+ 1 - 1
src/views/manage/theme/relation.vue

@@ -50,7 +50,7 @@
           </template>
           <template #do-column-value="{scope}">
             <CusButton v-if="scope.row.isMain == 1" type="table-add" icon="text" title="主配置" @click="onMain(scope.row)"/>
-            <CusButton v-if="scope.row.type === 'inner_index'" type="table-add" icon="text" title="列配置" @click="onText(scope.row)"/>
+            <CusButton type="table-add" icon="text" title="列配置" @click="onText(scope.row)"/>
             <CusButton type="table-edit" @click="onEdit(scope.row)"/>
             <CusButton type="table-del" @click="onDel(scope.row)"/>
           </template>