added new category to FDD rule in API & Admin UI

pull/42/MERGE
13621160019@163.com 2021-06-17 16:06:18 +08:00
parent 7271ae38f8
commit afc3ea98b4
3 changed files with 10 additions and 3 deletions

View File

@ -25,6 +25,7 @@
<option value="SHOPFLOOR">SHOPFLOOR</option> <option value="SHOPFLOOR">SHOPFLOOR</option>
<option value="EQUIPMENT">EQUIPMENT</option> <option value="EQUIPMENT">EQUIPMENT</option>
<option value="COMBINEDEQUIPMENT">COMBINEDEQUIPMENT</option> <option value="COMBINEDEQUIPMENT">COMBINEDEQUIPMENT</option>
<option value="VIRTUALMETER">VIRTUALMETER</option>
</select> </select>
<div class="m-t-xs" ng-show="form_rule.category.$invalid && form_rule.category.$dirty"> <div class="m-t-xs" ng-show="form_rule.category.$invalid && form_rule.category.$dirty">
<small class="text-danger" ng-show="form_rule.category.$error.required">-</small> <small class="text-danger" ng-show="form_rule.category.$error.required">-</small>
@ -66,6 +67,10 @@
<option value="COMBINEDEQUIPMENT02">COMBINEDEQUIPMENT02</option> <option value="COMBINEDEQUIPMENT02">COMBINEDEQUIPMENT02</option>
<option value="COMBINEDEQUIPMENT03">COMBINEDEQUIPMENT03</option> <option value="COMBINEDEQUIPMENT03">COMBINEDEQUIPMENT03</option>
<option value="COMBINEDEQUIPMENT04">COMBINEDEQUIPMENT04</option> <option value="COMBINEDEQUIPMENT04">COMBINEDEQUIPMENT04</option>
<option value="VIRTUALMETER01">VIRTUALMETER01</option>
<option value="VIRTUALMETER02">VIRTUALMETER02</option>
<option value="VIRTUALMETER03">VIRTUALMETER03</option>
<option value="VIRTUALMETER04">VIRTUALMETER04</option>
</select> </select>
<div class="m-t-xs" ng-show="form_rule.fdd_code.$invalid && form_rule.fdd_code.$dirty"> <div class="m-t-xs" ng-show="form_rule.fdd_code.$invalid && form_rule.fdd_code.$dirty">
<small class="text-danger" ng-show="form_rule.fdd_code.$error.required">-</small> <small class="text-danger" ng-show="form_rule.fdd_code.$error.required">-</small>

View File

@ -162,7 +162,9 @@ class EmailMessageItem:
raise falcon.HTTPError(falcon.HTTP_500, title='API.DATABASE_ERROR', description=str(e)) raise falcon.HTTPError(falcon.HTTP_500, title='API.DATABASE_ERROR', description=str(e))
try: try:
cursor.execute(" SELECT id FROM tbl_email_messages WHERE id = %s ", (id_,)) cursor.execute(" SELECT id "
" FROM tbl_email_messages "
" WHERE id = %s ", (id_,))
row = cursor.fetchone() row = cursor.fetchone()
except Exception as e: except Exception as e:
if cursor: if cursor:

View File

@ -75,7 +75,7 @@ class RuleCollection:
len(str.strip(new_values['data']['category'])) == 0 or \ len(str.strip(new_values['data']['category'])) == 0 or \
str.strip(new_values['data']['category']) not in \ str.strip(new_values['data']['category']) not in \
('SYSTEM', 'REALTIME', 'SPACE', 'METER', 'TENANT', 'STORE', 'SHOPFLOOR', 'EQUIPMENT', ('SYSTEM', 'REALTIME', 'SPACE', 'METER', 'TENANT', 'STORE', 'SHOPFLOOR', 'EQUIPMENT',
'COMBINEDEQUIPMENT'): 'COMBINEDEQUIPMENT', 'VIRTUALMETER'):
raise falcon.HTTPError(falcon.HTTP_400, raise falcon.HTTPError(falcon.HTTP_400,
title='API.BAD_REQUEST', title='API.BAD_REQUEST',
description='API.INVALID_CATEGORY') description='API.INVALID_CATEGORY')
@ -270,7 +270,7 @@ class RuleItem:
len(str.strip(new_values['data']['category'])) == 0 or \ len(str.strip(new_values['data']['category'])) == 0 or \
str.strip(new_values['data']['category']) not in \ str.strip(new_values['data']['category']) not in \
('SYSTEM', 'REALTIME', 'SPACE', 'METER', 'TENANT', 'STORE', 'SHOPFLOOR', 'EQUIPMENT', ('SYSTEM', 'REALTIME', 'SPACE', 'METER', 'TENANT', 'STORE', 'SHOPFLOOR', 'EQUIPMENT',
'COMBINEDEQUIPMENT'): 'COMBINEDEQUIPMENT', 'VIRTUALMETER'):
raise falcon.HTTPError(falcon.HTTP_400, raise falcon.HTTPError(falcon.HTTP_400,
title='API.BAD_REQUEST', title='API.BAD_REQUEST',
description='API.INVALID_CATEGORY') description='API.INVALID_CATEGORY')