|
@@ -12,10 +12,12 @@ from extract_table import extract_temp_time, extract_pdf_table_to_excel, extract
|
|
|
safe_filename
|
|
safe_filename
|
|
|
from lib import Qiniu
|
|
from lib import Qiniu
|
|
|
from werkzeug.utils import secure_filename
|
|
from werkzeug.utils import secure_filename
|
|
|
|
|
+from flask_cors import CORS
|
|
|
|
|
|
|
|
app = Flask(__name__)
|
|
app = Flask(__name__)
|
|
|
UPLOAD_FOLDER = tempfile.gettempdir()
|
|
UPLOAD_FOLDER = tempfile.gettempdir()
|
|
|
app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER
|
|
app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER
|
|
|
|
|
+CORS(app)
|
|
|
|
|
|
|
|
|
|
|
|
|
@app.route('/add_signature', methods=['POST'])
|
|
@app.route('/add_signature', methods=['POST'])
|
|
@@ -125,7 +127,7 @@ def extract_table():
|
|
|
if "温湿度数据报告" in text:
|
|
if "温湿度数据报告" in text:
|
|
|
df = extract_pdf_table_to_excel(filepath)
|
|
df = extract_pdf_table_to_excel(filepath)
|
|
|
if "历史数据表" in text:
|
|
if "历史数据表" in text:
|
|
|
- df = extract_temp_time(filepath)
|
|
|
|
|
|
|
+ df = extract_temp_time(filepath)
|
|
|
if "设备汇总报告" in text:
|
|
if "设备汇总报告" in text:
|
|
|
df = extract_temp_by_datetime_pattern(filepath)
|
|
df = extract_temp_by_datetime_pattern(filepath)
|
|
|
|
|
|