Explorar o código

feat: 联调部分接口

Jack Zhou hai 1 mes
pai
achega
a6b3f8dae8

+ 33 - 0
src/api/module/report.ts

@@ -31,4 +31,37 @@ export const getReportFieldsConfiguration = (params: any, config: any) => {
     },
     config
   )
+}
+
+/**
+ * Create New Report Template页面获取Specific Roles的Party ID数据
+ */
+export const getSpecificRolesPartyID = (params: any, config: any) => {
+  return HttpAxios.post(
+    `${baseUrl}`,
+    {
+      action: 'ajax',
+      operate: 'autody_extend',
+      type: 'apex',
+      ...params
+    },
+    config
+  )
+}
+
+
+/**
+ * Create New Report Template页面获取Specific Roles的Group Name数据
+ */
+export const getSpecificRolesGroupName = (params: any, config: any) => {
+  return HttpAxios.post(
+    `${baseUrl}`,
+    {
+      action: 'ajax',
+      operate: 'autody_extend',
+      type: 'contact_group',
+      ...params
+    },
+    config
+  )
 }

+ 5 - 1
src/views/TemplateManagement/src/components/CreateReportTemplate/src/CreateReportTemplate.vue

@@ -115,6 +115,10 @@ const addNewField = () => {
     return
   }
 }
+// 调整应用字段
+const handleApplay = (data: any) => {
+  console.log('data', data)
+}
 
 const reportAccessControlRadio = ref('All Users')
 const detailRef: Ref<HTMLElement | null> = ref(null)
@@ -314,7 +318,7 @@ const handleRightRemove = () => {}
       </div>
     </div>
 
-    <AdjustmentField @customize="customizeColumns" ref="AdjustmentFieldRef" />
+    <AdjustmentField @apply="handleApplay" ref="AdjustmentFieldRef" />
     <el-dialog
       class="add-new-field-dialog"
       title="Add New Field"

+ 4 - 2
src/views/TemplateManagement/src/components/CreateReportTemplate/src/components/AdjustmentField.vue

@@ -137,7 +137,7 @@ const loading = ref(false)
 // 获取数据
 const getData = async (reset?: string) => {
   loading.value = true
-  let paramsData: any = { ...params.value.getData }
+  let paramsData: any = { ...params.value }
   if (reset === 'yes') {
     paramsData.reset = 'yes'
   }
@@ -295,7 +295,7 @@ const handleMoveDownSelect = (item: any) => {
 }
 
 const emits = defineEmits<{
-  customize: []
+  apply: [selectColumns: any]
   reset: []
 }>()
 const handleReset = () => {
@@ -317,6 +317,8 @@ const handleApply = () => {
   //       dialogVisible.value = false
   //     }
   //   })
+  console.log('selectColumns.value', selectColumns.value)
+  emits('apply', selectColumns.value)
 }
 
 const clearData = () => {

+ 32 - 12
src/views/TemplateManagement/src/components/CreateReportTemplate/src/components/GroupNameSelect.vue

@@ -34,19 +34,39 @@ onMounted(() => {
 
 // 搜索方法
 const remoteMethod = (query: string) => {
-  if (query) {
-    loading.value = true
-    setTimeout(() => {
+  // if (query) {
+  loading.value = true
+  $api
+    .getSpecificRolesGroupName({ term: query })
+    .then((res: any) => {
+      if (res.code == 200) {
+        options.value = res.data.map((item: any) => ({
+          value: item.id,
+          label: item.label,
+          code: item.code,
+          checked: false
+        }))
+      }
+      // list.value = res.data.map((item: string) => ({
+      //   value: item,
+      //   label: item,
+      //   checked: false
+      // }))
+    })
+    .finally(() => {
       loading.value = false
-      options.value = list.value.filter((item) => {
-        return item.label.toLowerCase().includes(query.toLowerCase())
-      })
-      syncCheckedState()
-    }, 200)
-  } else {
-    options.value = [...list.value]
-    syncCheckedState()
-  }
+    })
+  // setTimeout(() => {
+
+  //   options.value = list.value.filter((item) => {
+  //     return item.label.toLowerCase().includes(query.toLowerCase())
+  //   })
+  //   syncCheckedState()
+  // }, 200)
+  // } else {
+  //   options.value = [...list.value]
+  //   syncCheckedState()
+  // }
 }
 
 const syncCheckedState = () => {

+ 30 - 21
src/views/TemplateManagement/src/components/CreateReportTemplate/src/components/PartyIDSelect.vue

@@ -1,7 +1,7 @@
 <script setup lang="ts">
 interface ListItem {
   value: string
-  label: string
+  id: string
   checked: boolean
 }
 
@@ -13,29 +13,38 @@ const loading = ref(false)
 const states = ['Alabama', 'Alaska', 'Arizona', 'Arkansas']
 
 onMounted(() => {
-  list.value = states.map((item) => ({
-    value: `value:${item}`,
-    label: `label:${item}`,
-    checked: false
-  }))
-  options.value = [...list.value]
+  options.value = []
 })
 
 // 搜索方法
 const remoteMethod = (query: string) => {
-  if (query) {
-    loading.value = true
-    setTimeout(() => {
+  // if (query) {
+  loading.value = true
+  $api
+    .getSpecificRolesPartyID({ term: query })
+    .then((res: any) => {
+      if (res.code === 200) {
+        options.value = res.data?.map((item: any) => ({
+          id: item.id,
+          label: item.label,
+          checked: false
+        }))
+      }
+    })
+    .finally(() => {
       loading.value = false
-      options.value = list.value.filter((item) => {
-        return item.label.toLowerCase().includes(query.toLowerCase())
-      })
-      syncCheckedState()
-    }, 200)
-  } else {
-    options.value = [...list.value]
-    syncCheckedState()
-  }
+    })
+  // syncCheckedState()
+  // setTimeout(() => {
+  //   loading.value = false
+  //   options.value = list.value.filter((item) => {
+  //     return item.label.toLowerCase().includes(query.toLowerCase())
+  //   })
+  // }, 200)
+  // } else {
+  //   options.value = [...list.value]
+  //   syncCheckedState()
+  // }
 }
 
 const syncCheckedState = () => {
@@ -78,7 +87,7 @@ const handleCheckboxChange = (item: ListItem) => {
     style="width: 100%"
     popper-class="part-id-select-popper"
   >
-    <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
+    <el-option v-for="item in options" :key="item.id" :label="item.id" :value="item.id">
       <div class="select-option">
         <el-checkbox
           :model-value="item.checked"
@@ -89,7 +98,7 @@ const handleCheckboxChange = (item: ListItem) => {
         >
           {{ item.label }}
         </el-checkbox>
-        <span>{{ item.value }}</span>
+        <span>{{ item.id }}</span>
       </div>
     </el-option>
   </el-select>