GetBaseDataSonCode.js 1020 Bytes
Newer Older
wangcong committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
import _ from 'lodash'

/**
 * 前端公式 获取基础数据包含的子基础数据的code
 * @author fengjiansheng
 * @data 2021-08-22
 */
export default {
    execute: function () {
        console.log("s1 GetBaseDataSonCode")
        if (arguments && arguments[0] && arguments[0].length > 1 && arguments[1]) {
            // TODO 参数校验
            if(arguments[0][0] && arguments[0][0].getResult() &&  arguments[0][0].getResult().Value){
                let temp1 = arguments[0][0].getResult().Value
                let temp2 = arguments[0][1].StaticValue.toLowerCase()
                let temp3 = temp1[temp2]
                if (_.isEmpty(temp3)) {
                    temp3 = temp1[arguments[0][1].StaticValue]
                }
                if (_.isEmpty(temp3)) {
                    return null;
                }else{
                    return temp3.split("||")[0]
                }
            }
        }
    },
    getResultType: function () {
        return FMR.ConstDataTypes.String
    }
}