0

我有一家租赁公司、租赁价格、租赁类型、租赁期限、租赁开始范围和租赁结束范围,所有这些都计算为租赁费率。我只是不确定使用什么类型的数据结构来轻松存储和查找这些信息。

我有一个 UI,其中包含租赁公司、租赁类型、租赁期限和租赁价格的文本框的下拉菜单。所以,这些是输入。我真的不知道如何存储数据,所以很容易查找。因此,给定租赁类型和租赁期限,我将有一组范围,当租赁价格落在该范围内时,将选择租赁费率。最终结果是

Leasing Company:
<select id="leasing-company"></select>
<br/>

Lease Type:
<select id="lease-type"></select>
<br/>

Lease Term:
<select id="lease-term"></select>
<br/>

// the way I am storing the data to feed to the select options
var dict1 = {
    leasing_company: "XYZ Leasing Company",
    lease_type: ["fmv", "buyout"],
    lease_term: [12, 24, 36, 39, 48]
};

// some example values
var leaseType = ["fmv", "buyout"]
var leaseTerm = [12, 24, 36, 39, 48]
var leaseRanges = [0.00, 1500.00, 3000.00, 5000.00, 10000.00]
var leaseRates = [0.25, 0.20, 0.15, 0.10, 0.05]

我尝试过的一切都需要相当多的循环。我认为必须有更好的方法来从下拉列表中查找数据。

租赁公司 --> 租赁类型 --> 租赁期限 --> 查找租赁范围 --> 输出租赁率

4

0 回答 0