'use strict';

/**
 *
 *
 * @author Mai
 * @date 2018/6/22
 * @version
 */

const ruleType = {
    measure: 1,
    change: 2,
};
const ruleField = [];
ruleField[ruleType.measure] = 'm_rule';
ruleField[ruleType.change] = 'c_rule';
const ruleString = [];
ruleString[ruleType.measure] = 'measure';
ruleString[ruleType.change] = 'change';

// 中间计量编号规则
const measure = {
    ruleType: {
        tenderName: 1,
        text: 2,
        inDate: 3,
        addNo: 4,
    },
    ruleString: [],
    connectorType: {
        dash: 1,
        underscore: 2,
        nothing: 3,
    },
    connectorString: [],
};
measure.ruleString[measure.ruleType.tenderName] = '标段名称';
measure.ruleString[measure.ruleType.text] = '文本';
measure.ruleString[measure.ruleType.inDate] = '当前年月';
measure.ruleString[measure.ruleType.addNo] = '自增编号';

measure.connectorString[measure.connectorType.dash] = '-';
measure.connectorString[measure.connectorType.underscore] = '_';
measure.connectorString[measure.connectorType.nothing] = '无';

measure.defaultRule = [
    { ruleType: measure.ruleType.tenderName },
    { ruleType: measure.ruleType.text, text: 'WJQR1' },
    { ruleType: measure.ruleType.inDate },
    { ruleType: measure.ruleType.addNo, format: 3, start: 1 },
];

module.exports = {
    ruleType,
    ruleField,
    ruleString,
    measure,
};
