-
-
-
-
-
-
+
+
+
+ Click to add filter options
+
+
-
+
-
@@ -435,8 +382,7 @@
@page-changed="handlePageChange"
/>
-
-
+
@@ -460,6 +406,7 @@ import CustomTableRow from 'app/components/custom-table-row.vue'
import ComboBox from 'app/components/combo-box.vue'
import DialogModal from 'app/components/dialog-modal.vue'
import ExpandableSidebar from 'app/components/expandable-sidebar.vue'
+import MultiInputDialogue from 'app/components/multi-input-dialogue.vue'
import { popArr, convertToCSV, exportCSV } from 'modules/summary/utils/utils.js'
@@ -475,7 +422,8 @@ export default {
'expandable-sidebar': ExpandableSidebar,
'dialog-modal': DialogModal,
'base-input-select': BaseInputSelect,
- 'base-input-text' : BaseInputText
+ 'base-input-text' : BaseInputText,
+ 'multi-input-dia' : MultiInputDialogue
},
props: {
@@ -502,6 +450,7 @@ export default {
beamLines: [],
searchedSamplePrefix: [],
selectedColumns: [],
+ multiInputDicts: [],
operands: [
{
"title": "greater than",
@@ -717,6 +666,7 @@ export default {
this.addFormatOption()
this.toggleSidebar()
this.popSelectedColumns()
+ this.updateMultiInputDicts();
},
mounted() {
window.onerror = (msg) => {
@@ -739,7 +689,8 @@ export default {
"operand": "",
"value": "",
"checked": true,
- "data": [] };
+ "data": [],
+ };
})
},
addFilterOption(event) {
@@ -789,6 +740,41 @@ export default {
}
},
+ createMultiInputDict(filterItem) {
+ let resultDict = {
+ selected: filterItem.selected,
+ operand: filterItem.operand,
+ value: filterItem.value
+ };
+
+ // Spread values from selectedArr into the result dictionary
+ filterItem.selectedArr.forEach((item, index) => {
+ resultDict[`selectedArr${index + 1}`] = item;
+ });
+
+ return resultDict;
+ },
+ updateMultiInputDicts() {
+ this.multiInputDicts = this.filters.map(filterItem => {
+ let resultDict = {
+ selected: filterItem.title,
+ operand: filterItem.operand,
+ value: filterItem.value
+ };
+
+ // Spread values from selectedArr into the result dictionary
+ filterItem.selectedArr.forEach((item, index) => {
+ // Check if the item is an object and has a property matching filterItem.valueField
+ if (typeof item === 'object' && item[filterItem.valueField]) {
+ resultDict[`selectedArr${index + 1}`] = item[filterItem.valueField];
+ } else {
+ resultDict[`selectedArr${index + 1}`] = item;
+ }
+ });
+
+ return resultDict;
+ });
+ },
async searchProposal() {
// gets proposal list from proposal endpoint for combo box from proposal collection
@@ -1286,14 +1272,7 @@ export default {
this.$refs.iframeref[index].setAttribute('src', src)
}
-
- }
-
-
-
- },
- computed: {
-
+ },
},
watch: {
windowWidth: {
@@ -1320,6 +1299,8 @@ export default {
}
}
}
+
+ this.updateMultiInputDicts();
},
deep: true
},
@@ -1359,8 +1340,8 @@ export default {
.combo-box {
font-size: small;
- position: absolute;
- width: 15%
+ position: relative;
+ width: 200px;
}
.combo-box-description {
@@ -1369,7 +1350,7 @@ export default {
}
.input-description {
- width: 170px;
+ width: 200px;
font-size: small;
}