diff --git a/XVBA/新版着工要因閲覧シート/vba-files/Module/Module1.bas b/XVBA/新版着工要因閲覧シート/vba-files/Module/Module1.bas index 213805f4..84a064c2 100644 --- a/XVBA/新版着工要因閲覧シート/vba-files/Module/Module1.bas +++ b/XVBA/新版着工要因閲覧シート/vba-files/Module/Module1.bas @@ -257,6 +257,42 @@ Private Function CollectionToArray(Byval col As Collection) As Variant CollectionToArray = arr End Function +'****************************************************************************** +'{V[gFilter\(F2:G2oAF3ȍ~f[^)ESorter\(H2:I2oAH3ȍ~f[^)ǂݎA +'APINGXgViewp[^ɓnDictionarygݗĂB +'FilterESorterƂ0̏ꍇNothingԂiViewp[^̂t^Ȃ߁j +Function BuildViewFromSheet() As Object + Dim colFilter As New Dictionary + Dim r As Long + r = 3 + Do While Trim(defaultSh.Cells(r, "F").Value) <> "" + colFilter.Add defaultSh.Cells(r, "F").Value, defaultSh.Cells(r, "G").Value + r = r + 1 + Loop + + Dim colSorter As New Dictionary + r = 3 + Do While Trim(defaultSh.Cells(r, "H").Value) <> "" + colSorter.Add defaultSh.Cells(r, "H").Value, defaultSh.Cells(r, "I").Value + r = r + 1 + Loop + + If colFilter.count = 0 And colSorter.count = 0 Then + Set BuildViewFromSheet = Nothing + Exit Function + End If + + Dim viewObj As New Dictionary + If colFilter.count > 0 Then + viewObj.Add "ColumnFilterHash", colFilter + End If + If colSorter.count > 0 Then + viewObj.Add "ColumnSorterHash", colSorter + End If + + Set BuildViewFromSheet = viewObj +End Function + '****************************************************************************** 'REST APIďo '@method@GetPOST