Commit ba465d50 authored by tjy's avatar tjy

调整timeRange方法,输出时间戳

parent 2bfa621e
{"userRegister":{"useType":{"memberType":[{"id":1,"typeName":"企业会员"},{"id":2,"typeName":"企业个人会员"},{"id":3,"typeName":"渠道企业会员"},{"id":4,"typeName":"渠道个人会员"}],"businessType":[{"id":1,"typeName":"采购"},{"id":2,"typeName":"商品销售"},{"id":3,"typeName":"加工服务"},{"id":4,"typeName":"物流服务"},{"id":5,"typeName":"金融服务"},{"id":6,"typeName":"保险服务"},{"id":7,"typeName":"1"},{"id":8,"typeName":"2"},{"id":9,"typeName":"3"},{"id":10,"typeName":"4"},{"id":11,"typeName":"23"},{"id":12,"typeName":"6"},{"id":13,"typeName":"5"},{"id":14,"typeName":"11111111111111111111111111"}]},"useDetail":[{"groupName":"联系信息","elements":[{"id":26,"fieldName":"contact","fieldCNName":"联系人","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":27,"fieldName":"fixed_contact_number","fieldCNName":"固定联系电话","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":28,"fieldName":"phone_number","fieldCNName":"手机号码","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":29,"fieldName":"fax_number","fieldCNName":"传真号码","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":30,"fieldName":"address","fieldCNName":"地址","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":31,"fieldName":"zip_code","fieldCNName":"邮编","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":32,"fieldName":"url","fieldCNName":"网址","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":33,"fieldName":"email","fieldCNName":"邮箱","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]}]},{"groupName":"营业执照信息","elements":[{"id":10,"fieldName":"company_name","fieldCNName":"公司名称","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":11,"fieldName":"enterprise_type","fieldCNName":"企业类型","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":12,"fieldName":"residence","fieldCNName":"住所","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":13,"fieldName":"legal_representative","fieldCNName":"法定代表人","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":14,"fieldName":"register_capital","fieldCNName":"注册资本","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":15,"fieldName":"establish_date","fieldCNName":"成立日期","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":16,"fieldName":"business_term","fieldCNName":"营业期限","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":17,"fieldName":"business_scope","fieldCNName":"经营范围","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":18,"fieldName":"registration_authority","fieldCNName":"登记机关","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":19,"fieldName":"registration_time","fieldCNName":"登记时间","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":20,"fieldName":"unified_social_credit_code","fieldCNName":"统一社会信用代码","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":21,"fieldName":"business_license","fieldCNName":"营业执照","fieldType":"file","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]}]},{"groupName":"填写会员基本信息","elements":[{"id":1,"fieldName":"member_type","fieldCNName":"会员类型","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":2,"fieldName":"MEMBER_ROLE","fieldCNName":"会员角色","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":3,"fieldName":"member_level","fieldCNName":"会员等级","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":4,"fieldName":"REGISTER_PHONE","fieldCNName":"注册手机号","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":5,"fieldName":"register_email","fieldCNName":"注册邮箱","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]}]},{"groupName":"法定代表人信息","elements":[{"id":22,"fieldName":"legal_name","fieldCNName":"法人姓名","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":23,"fieldName":"legal_phone","fieldCNName":"法人手机号","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":24,"fieldName":"legal_id_card","fieldCNName":"法人身份证号","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":25,"fieldName":"legal_id_card_information","fieldCNName":"法人身份证信息","fieldType":"file","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]}]},{"groupName":"填写渠道信息","elements":[{"id":6,"fieldName":"channel_level","fieldCNName":"渠道级别","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":7,"fieldName":"channel_type","fieldCNName":"渠道类型","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":8,"fieldName":"agent_city","fieldCNName":"代理地市","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":9,"fieldName":"channel_describe","fieldCNName":"渠道描述","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]}]}]},"global":{"logo":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/logo.png","countryList":[{"name":"简体中文-ZH","key":"cn","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/china.png"},{"name":"English-EN","key":"en","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/us.png"},{"name":"日本語-JP","key":"jp","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/japen.png"},{"name":"한국어-KO","key":"ko","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/koren.png"}]}}
{"userRegister":{"useType":{"memberType":[{"id":1,"typeName":"企业会员"},{"id":2,"typeName":"企业个人会员"},{"id":3,"typeName":"渠道企业会员"},{"id":4,"typeName":"渠道个人会员"}],"businessType":[{"id":1,"typeName":"采购"},{"id":2,"typeName":"商品销售"},{"id":3,"typeName":"加工服务"},{"id":4,"typeName":"物流服务"},{"id":5,"typeName":"金融服务"},{"id":6,"typeName":"保险服务"},{"id":7,"typeName":"1"},{"id":8,"typeName":"2"},{"id":9,"typeName":"3"},{"id":10,"typeName":"4"},{"id":11,"typeName":"23"},{"id":12,"typeName":"6"},{"id":13,"typeName":"5"},{"id":14,"typeName":"11111111111111111111111111"},{"id":16,"typeName":"44"},{"id":17,"typeName":"33"},{"id":18,"typeName":"32"},{"id":19,"typeName":"33333"}]},"useDetail":[{"groupName":"联系信息","elements":[{"id":26,"fieldName":"contact","fieldCNName":"联系人","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":27,"fieldName":"fixed_contact_number","fieldCNName":"固定联系电话","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":28,"fieldName":"phone_number","fieldCNName":"手机号码","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":29,"fieldName":"fax_number","fieldCNName":"传真号码","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":30,"fieldName":"address","fieldCNName":"地址","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":31,"fieldName":"zip_code","fieldCNName":"邮编","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":32,"fieldName":"url","fieldCNName":"网址","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":33,"fieldName":"email","fieldCNName":"邮箱","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]}]},{"groupName":"营业执照信息","elements":[{"id":10,"fieldName":"company_name","fieldCNName":"公司名称","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":11,"fieldName":"enterprise_type","fieldCNName":"企业类型","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":12,"fieldName":"residence","fieldCNName":"住所","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":13,"fieldName":"legal_representative","fieldCNName":"法定代表人","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":14,"fieldName":"register_capital","fieldCNName":"注册资本","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":15,"fieldName":"establish_date","fieldCNName":"成立日期","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":16,"fieldName":"business_term","fieldCNName":"营业期限","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":17,"fieldName":"business_scope","fieldCNName":"经营范围","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":18,"fieldName":"registration_authority","fieldCNName":"登记机关","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":19,"fieldName":"registration_time","fieldCNName":"登记时间","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":20,"fieldName":"unified_social_credit_code","fieldCNName":"统一社会信用代码","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":21,"fieldName":"business_license","fieldCNName":"营业执照","fieldType":"file","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":35,"fieldName":" C_COMPANY_KIND","fieldCNName":"企业类型1","fieldType":"file","fieldLength":66,"fieldEmpty":1,"fieldOrder":2,"fieldRemark":"","checkRules":[]}]},{"groupName":"填写会员基本信息","elements":[{"id":1,"fieldName":"member_type","fieldCNName":"会员类型","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":2,"fieldName":"MEMBER_ROLE","fieldCNName":"会员角色","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":3,"fieldName":"member_level","fieldCNName":"会员等级","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":4,"fieldName":"REGISTER_PHONE","fieldCNName":"注册手机号","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":5,"fieldName":"register_email","fieldCNName":"注册邮箱","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]}]},{"groupName":"法定代表人信息","elements":[{"id":22,"fieldName":"legal_name","fieldCNName":"法人姓名","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":23,"fieldName":"legal_phone","fieldCNName":"法人手机号","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":24,"fieldName":"legal_id_card","fieldCNName":"法人身份证号","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":25,"fieldName":"legal_id_card_information","fieldCNName":"法人身份证信息","fieldType":"file","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]}]},{"groupName":"填写渠道信息","elements":[{"id":6,"fieldName":"channel_level","fieldCNName":"渠道级别","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":7,"fieldName":"channel_type","fieldCNName":"渠道类型","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":8,"fieldName":"agent_city","fieldCNName":"代理地市","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":9,"fieldName":"channel_describe","fieldCNName":"渠道描述","fieldType":"String","fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]}]}]},"global":{"logo":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/logo.png","countryList":[{"name":"简体中文-ZH","key":"cn","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/china.png"},{"name":"English-EN","key":"en","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/us.png"},{"name":"日本語-JP","key":"jp","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/japen.png"},{"name":"한국어-KO","key":"ko","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/koren.png"}]}}
......@@ -291,11 +291,7 @@ const memberMaintain: React.FC<[]> = () => {
useEffect(() => {
if (!isFirst) return;
let timeRanges = timeRange(searchForm.timeRange);
if (searchForm.timeRange == 0) {
setIsFirst(false);
} else {
setIsFirst(false);
}
setSearchForm({
...searchForm,
startDate: timeRanges.st,
......
......@@ -9,68 +9,97 @@ function isObject(obj: any) {
}
export function timeRange(val: number) {
let st = '', et = '';
let st, et;
switch (val) {
case 0:
st = et = ''
break
st = et = '';
break;
case 1:
st = et = moment()
st = moment(
moment()
.startOf('days')
.format('YYYY-MM-DD');
break
.format('YYYY-MM-DD HH:mm:ss'),
).unix();
et = moment(
moment()
.endOf('days')
.format('YYYY-MM-DD HH:mm:ss'),
).unix();
break;
case 2:
st = moment()
.subtract(6, 'days')
.format('YYYY-MM-DD');
et = moment()
.startOf('days')
.format('YYYY-MM-DD');
break
st = moment(
moment()
.subtract(7, 'days')
.format('YYYY-MM-DD') + ' 00:00:00',
).unix();
et = moment(
moment()
.endOf('days')
.format('YYYY-MM-DD HH:mm:ss'),
).unix();
break;
case 3:
st = moment()
.startOf('month')
.format('YYYY-MM-DD');
et = moment()
.startOf('days')
.format('YYYY-MM-DD');
break
st = moment(
moment()
.subtract(29, 'days')
.format('YYYY-MM-DD') + ' 00:00:00',
).unix();
et = moment(
moment()
.endOf('days')
.format('YYYY-MM-DD HH:mm:ss'),
).unix();
break;
case 4:
st =
st = moment(
moment()
.subtract(2, 'month')
.format('YYYY-MM') + '-01';
et = moment()
.startOf('days')
.format('YYYY-MM-DD');
break
.subtract(89, 'days')
.format('YYYY-MM-DD') + ' 00:00:00',
).unix();
et = moment(
moment()
.endOf('days')
.format('YYYY-MM-DD HH:mm:ss'),
).unix();
break;
case 5:
st =
st = moment(
moment()
.subtract(5, 'month')
.format('YYYY-MM') + '-01';
et = moment()
.startOf('days')
.format('YYYY-MM-DD');
break
.subtract(179, 'days')
.format('YYYY-MM-DD') + ' 00:00:00',
).unix();
et = moment(
moment()
.endOf('days')
.format('YYYY-MM-DD HH:mm:ss'),
).unix();
break;
case 6:
st = moment()
.startOf('year')
.format('YYYY-MM-DD');
et = moment()
.startOf('days')
.format('YYYY-MM-DD');
break
st = moment(
moment()
.subtract(364, 'days')
.format('YYYY-MM-DD') + ' 00:00:00',
).unix();
et = moment(
moment()
.endOf('days')
.format('YYYY-MM-DD HH:mm:ss'),
).unix();
break;
case 7:
st = moment()
.years(moment().years() - 1)
st = moment(
moment()
.year(moment().year() - 1)
.startOf('year')
.format('YYYY-MM-DD');
et = moment()
.years(moment().years() - 1)
.format('YYYY-MM-DD HH:mm:ss'),
).unix();
et = moment(
moment()
.year(moment().year() - 1)
.endOf('year')
.format('YYYY-MM-DD');
break
.format('YYYY-MM-DD HH:mm:ss'),
).unix();
break;
}
return { st, et }
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment