1.优化显示
This commit is contained in:
parent
e553dfb10c
commit
3c5582d526
@ -93,71 +93,68 @@ def chkData(data):
|
|||||||
if 'pass_why' in res1:
|
if 'pass_why' in res1:
|
||||||
key16 = res1['pass_why']
|
key16 = res1['pass_why']
|
||||||
res1['pass_why'] = pass_why_dict.get(key16, '')
|
res1['pass_why'] = pass_why_dict.get(key16, '')
|
||||||
if 'work_list' in res1:
|
try:
|
||||||
work_list = res1['work_list']
|
if 'work_list' in res1:
|
||||||
if work_list:
|
work_list = res1['work_list']
|
||||||
work_list = [json.loads(i) for i in work_list]
|
if work_list:
|
||||||
if isinstance(work_list[0], str):
|
work_list = [json.loads(i) for i in work_list]
|
||||||
work_list = [eval(i) for i in work_list]
|
if isinstance(work_list[0], str):
|
||||||
if len(work_list) > 1:
|
work_list = [eval(i) for i in work_list]
|
||||||
true_index = 0
|
if len(work_list) > 1:
|
||||||
for index, i in enumerate(work_list):
|
true_index = 0
|
||||||
if index == 0:
|
for index, i in enumerate(work_list):
|
||||||
continue
|
if index == 0:
|
||||||
split_str1 = ''
|
continue
|
||||||
split_str2 = ''
|
split_str1 = ''
|
||||||
if '-' in i['time']:
|
split_str2 = ''
|
||||||
split_str1 = '-'
|
if '-' in i['time']:
|
||||||
if '-' in work_list[true_index]['time']:
|
split_str1 = '-'
|
||||||
split_str2 = '-'
|
if '-' in work_list[true_index]['time']:
|
||||||
if '–' in i['time']:
|
split_str2 = '-'
|
||||||
split_str1 = '–'
|
if '–' in i['time']:
|
||||||
if '–' in work_list[true_index]['time']:
|
split_str1 = '–'
|
||||||
split_str2 = '–'
|
if '–' in work_list[true_index]['time']:
|
||||||
if '―' in i['time']:
|
split_str2 = '–'
|
||||||
split_str1 = '―'
|
if '―' in i['time']:
|
||||||
if '―' in work_list[true_index]['time']:
|
split_str1 = '―'
|
||||||
split_str2 = '―'
|
if '―' in work_list[true_index]['time']:
|
||||||
if '—' in i['time']:
|
split_str2 = '―'
|
||||||
split_str1 = '—'
|
if '—' in i['time']:
|
||||||
if '—' in work_list[true_index]['time']:
|
split_str1 = '—'
|
||||||
split_str2 = '—'
|
if '—' in work_list[true_index]['time']:
|
||||||
try:
|
split_str2 = '—'
|
||||||
if int(i['time'].split(split_str1)[0].replace('.', '').replace('/', '')) > int(
|
if int(i['time'].split(split_str1)[0].replace('.', '').replace('/', '')) > int(
|
||||||
work_list[true_index]['time'].split(split_str2)[0].replace('.', '').replace('/', '')):
|
work_list[true_index]['time'].split(split_str2)[0].replace('.', '').replace('/', '')):
|
||||||
true_index = index
|
true_index = index
|
||||||
except:
|
work_dict = work_list[true_index]
|
||||||
true_index = index
|
work_list = [work_dict]
|
||||||
# if int(i['time'].split(split_str1)[0].replace('.', '').replace('/', '')) > int(
|
bast_index = 0
|
||||||
# work_list[true_index]['time'].split(split_str2)[0].replace('.', '').replace('/', '')):
|
bast_time = 0
|
||||||
# true_index = index
|
for index, i in enumerate(work_list):
|
||||||
work_dict = work_list[true_index]
|
time = i.get('time' '').replace('.', '/')
|
||||||
work_list = [work_dict]
|
if time:
|
||||||
bast_index = 0
|
split_str3 = ''
|
||||||
bast_time = 0
|
if '-' in time:
|
||||||
for index, i in enumerate(work_list):
|
split_str3 = '-'
|
||||||
time = i.get('time' '').replace('.', '/')
|
if '–' in time:
|
||||||
if time:
|
split_str3 = '–'
|
||||||
split_str3 = ''
|
if '―' in time:
|
||||||
if '-' in time:
|
split_str3 = '―'
|
||||||
split_str3 = '-'
|
if '—' in time:
|
||||||
if '–' in time:
|
split_str3 = '—'
|
||||||
split_str3 = '–'
|
if time.split(split_str3)[-1].split('/')[0].strip().isdigit():
|
||||||
if '―' in time:
|
chk_time = int(time.split('-')[-1].split('/')[0])
|
||||||
split_str3 = '―'
|
else:
|
||||||
if '—' in time:
|
chk_time = int(datetime.now().year)
|
||||||
split_str3 = '—'
|
if chk_time > bast_time:
|
||||||
if time.split(split_str3)[-1].split('/')[0].strip().isdigit():
|
bast_time = chk_time
|
||||||
chk_time = int(time.split('-')[-1].split('/')[0])
|
bast_index = index
|
||||||
else:
|
res1['firm'] = work_list[bast_index]['company_name']
|
||||||
chk_time = int(datetime.now().year)
|
else:
|
||||||
if chk_time > bast_time:
|
work_list = []
|
||||||
bast_time = chk_time
|
res1['work_list'] = work_list
|
||||||
bast_index = index
|
except:
|
||||||
res1['firm'] = work_list[bast_index]['company_name']
|
res1['work_list'] = []
|
||||||
else:
|
|
||||||
work_list = []
|
|
||||||
res1['work_list'] = work_list
|
|
||||||
if 'project_undergo' in res1:
|
if 'project_undergo' in res1:
|
||||||
project_undergo = res1['project_undergo']
|
project_undergo = res1['project_undergo']
|
||||||
if project_undergo:
|
if project_undergo:
|
||||||
|
Loading…
Reference in New Issue
Block a user