var L = {"0.2": "极不可能", "0.5": "很不可能，可以设想", "1": "可能性小，完全意外", "3": "可能，但不经常", "6": "相当可能", "10": "完全可以预料"};
var E = {"0.5": "非常罕见暴露", "1": "每年几次暴露", "2": "每月1次暴露", "3": "每周1次，或偶然暴露", "6": "每天工作时间内暴露", "10": "连续暴露"};
var C = {
    "1": "引人注目，不利于基本的安全卫生要求",
    "3": "无人员死亡，致残或重伤，或很小的财产损失",
    "7": "造成3人以下死亡，或者10人以下重伤，或者1000万元以下直接经济损失",
    "15": "造成3人～9人死亡，或者10人～49人重伤，或者1000万元以上5000万元以下直接经济损失",
    "40": "造成10人～29人死亡，或者50人～99人重伤，或者5000万元以上1亿元以下直接经济损失",
    "100": "造成30人以上（含30人）死亡，或者100人以上重伤（包括急性工业中毒，下同），或者1亿元以上直接经济损失"
};
var LKey = "0.2,0.5,1,3,6,10";
var EKey = "0.5,1,2,3,6,10";
var CKey = "1,3,7,15,40,100";

export default {
    L: function (lLeft, lRight) {
        if (null == lLeft || null == lRight) {
            return "";
        }
        var p = 1;
        if (lRight < 1) {
            p = 3;
        }
        var keys = LKey.substring(LKey.indexOf(lLeft), LKey.indexOf(lRight) + p);
        var optionHtml = ``;
        let split = keys.split(",");
        for (var i = 0; i < split.length; i++) {
            var key = split[i];
            var one = L[key];
            optionHtml += `<option value="${key}">(${key}分) ${one}</option>`;
        }
        return optionHtml;
    }, LAll: function () {
        let split = LKey.split(",");
        let lArr = [];
        for (var i = 0; i < split.length; i++) {
            var key = split[i];
            var one = L[key];
            lArr.push({
                value: key,
                text: one,
            });
        }
        return lArr;
    },
    E: function (eLeft, eRight) {
        if (null == eLeft || null == eRight) {
            return "";
        }
        var p = 1;
        if (eRight < 1) {
            p = 3;
        }
        var keys = EKey.substring(EKey.indexOf(eLeft), EKey.indexOf(eRight) + p);
        var optionHtml = ``;
        let split = keys.split(",");
        for (var i = 0; i < split.length; i++) {
            var key = split[i];
            var one = E[key];
            optionHtml += `<option value="${key}">(${key}分)${one}</option>`;
        }
        return optionHtml;
    }, EAll: function () {
        let eArr = [];
        let split = EKey.split(",");
        for (var i = 0; i < split.length; i++) {
            var key = split[i];
            var one = E[key];
            eArr.push({
                value: key,
                text: one,
            });
        }
        return eArr;
    },
    C: function (cLeft, cRight) {
        if (null == cLeft || null == cRight) {
            return "";
        }
        var p = 1;
        if (cRight < 1) {
            p = 3;
        } else if (cRight <= 100 && cRight >= 40) {
            p = 2;
        }
        var keys = CKey.substring(CKey.indexOf(cLeft), CKey.indexOf(cRight) + p);
        var optionHtml = ``;
        let split = keys.split(",");
        for (var i = 0; i < split.length; i++) {
            var key = split[i];
            var one = C[key];
            optionHtml += `<option value="${key}">(${key}分)${one}</option>`;
        }
        return optionHtml;
    }, CAll: function () {
        let cArr = [];
        let split = CKey.split(",");
        for (var i = 0; i < split.length; i++) {
            var key = split[i];
            var one = C[key];
            cArr.push({
                value: key,
                text: one,
            });
        }
        return cArr;
    }
}