diff --git a/Basic/Python程式設計_基本語法/10_python_import模塊amd自己的模塊_20190616.docx b/Basic/Python程式設計_基本語法/10_python_import模塊amd自己的模塊_20190616.docx new file mode 100644 index 0000000..451d4de Binary files /dev/null and b/Basic/Python程式設計_基本語法/10_python_import模塊amd自己的模塊_20190616.docx differ diff --git a/Basic/Python程式設計_基本語法/11_python_continue_break_try...except_20190617.docx b/Basic/Python程式設計_基本語法/11_python_continue_break_try...except_20190617.docx new file mode 100644 index 0000000..8d9f4e8 Binary files /dev/null and b/Basic/Python程式設計_基本語法/11_python_continue_break_try...except_20190617.docx differ diff --git a/Basic/Python程式設計_基本語法/12_python_zip_lambda_map_20190618.docx b/Basic/Python程式設計_基本語法/12_python_zip_lambda_map_20190618.docx new file mode 100644 index 0000000..cac2251 Binary files /dev/null and b/Basic/Python程式設計_基本語法/12_python_zip_lambda_map_20190618.docx differ diff --git a/Basic/Python程式設計_基本語法/13_python_threading_multiprocessing_tkinter窗口_20190619.docx b/Basic/Python程式設計_基本語法/13_python_threading_multiprocessing_tkinter窗口_20190619.docx new file mode 100644 index 0000000..71de610 Binary files /dev/null and b/Basic/Python程式設計_基本語法/13_python_threading_multiprocessing_tkinter窗口_20190619.docx differ diff --git a/Basic/Python程式設計_基本語法/14_python_pickle保存數據_set集合_20190620.docx b/Basic/Python程式設計_基本語法/14_python_pickle保存數據_set集合_20190620.docx new file mode 100644 index 0000000..88b0658 Binary files /dev/null and b/Basic/Python程式設計_基本語法/14_python_pickle保存數據_set集合_20190620.docx differ diff --git a/Basic/Python程式設計_基本語法/15_python_正則表達式_20190621.docx b/Basic/Python程式設計_基本語法/15_python_正則表達式_20190621.docx new file mode 100644 index 0000000..2e0150a Binary files /dev/null and b/Basic/Python程式設計_基本語法/15_python_正則表達式_20190621.docx differ diff --git a/Basic/Python程式設計_基本語法/1_python_安裝部分_print使用_基礎數學運算_變量Variable_20190607.docx b/Basic/Python程式設計_基本語法/1_python_安裝部分_print使用_基礎數學運算_變量Variable_20190607.docx new file mode 100644 index 0000000..701e77d Binary files /dev/null and b/Basic/Python程式設計_基本語法/1_python_安裝部分_print使用_基礎數學運算_變量Variable_20190607.docx differ diff --git a/Basic/Python程式設計_基本語法/2_python_while迴圈_for迴圈_20190608.docx b/Basic/Python程式設計_基本語法/2_python_while迴圈_for迴圈_20190608.docx new file mode 100644 index 0000000..bdc5342 Binary files /dev/null and b/Basic/Python程式設計_基本語法/2_python_while迴圈_for迴圈_20190608.docx differ diff --git a/Basic/Python程式設計_基本語法/3_python_If判斷_If...else判斷_If...elif...else判斷_20190609.docx b/Basic/Python程式設計_基本語法/3_python_If判斷_If...else判斷_If...elif...else判斷_20190609.docx new file mode 100644 index 0000000..64a6f1c Binary files /dev/null and b/Basic/Python程式設計_基本語法/3_python_If判斷_If...else判斷_If...elif...else判斷_20190609.docx differ diff --git a/Basic/Python程式設計_基本語法/4_python_def函數_參數_默認函數參數_20190610.docx b/Basic/Python程式設計_基本語法/4_python_def函數_參數_默認函數參數_20190610.docx new file mode 100644 index 0000000..a526c4a Binary files /dev/null and b/Basic/Python程式設計_基本語法/4_python_def函數_參數_默認函數參數_20190610.docx differ diff --git a/Basic/Python程式設計_基本語法/5_python_全域and區域變量_模塊安裝(外部)_20190611.docx b/Basic/Python程式設計_基本語法/5_python_全域and區域變量_模塊安裝(外部)_20190611.docx new file mode 100644 index 0000000..511dc9d Binary files /dev/null and b/Basic/Python程式設計_基本語法/5_python_全域and區域變量_模塊安裝(外部)_20190611.docx differ diff --git a/Basic/Python程式設計_基本語法/6_python_讀寫文件_20190612.docx b/Basic/Python程式設計_基本語法/6_python_讀寫文件_20190612.docx new file mode 100644 index 0000000..10297ec Binary files /dev/null and b/Basic/Python程式設計_基本語法/6_python_讀寫文件_20190612.docx differ diff --git a/Basic/Python程式設計_基本語法/7_python_class類別_20190613.docx b/Basic/Python程式設計_基本語法/7_python_class類別_20190613.docx new file mode 100644 index 0000000..3d53833 Binary files /dev/null and b/Basic/Python程式設計_基本語法/7_python_class類別_20190613.docx differ diff --git a/Basic/Python程式設計_基本語法/8_python_input輸入_串列序對_20190614.docx b/Basic/Python程式設計_基本語法/8_python_input輸入_串列序對_20190614.docx new file mode 100644 index 0000000..24e3aa8 Binary files /dev/null and b/Basic/Python程式設計_基本語法/8_python_input輸入_串列序對_20190614.docx differ diff --git a/Basic/Python程式設計_基本語法/9_python_二維串列_dict字典_20190615.docx b/Basic/Python程式設計_基本語法/9_python_二維串列_dict字典_20190615.docx new file mode 100644 index 0000000..acc8c83 Binary files /dev/null and b/Basic/Python程式設計_基本語法/9_python_二維串列_dict字典_20190615.docx differ diff --git a/pyqt5/CODE/ROIpractice/.idea/.gitignore b/pyqt5/CODE/ROIpractice/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/pyqt5/CODE/ROIpractice/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/pyqt5/CODE/ROIpractice/.idea/.name b/pyqt5/CODE/ROIpractice/.idea/.name new file mode 100644 index 0000000..11a5d8e --- /dev/null +++ b/pyqt5/CODE/ROIpractice/.idea/.name @@ -0,0 +1 @@ +main.py \ No newline at end of file diff --git a/pyqt5/CODE/ROIpractice/.idea/inspectionProfiles/profiles_settings.xml b/pyqt5/CODE/ROIpractice/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/pyqt5/CODE/ROIpractice/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/pyqt5/CODE/ROIpractice/.idea/misc.xml b/pyqt5/CODE/ROIpractice/.idea/misc.xml new file mode 100644 index 0000000..4b3b5b4 --- /dev/null +++ b/pyqt5/CODE/ROIpractice/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/pyqt5/CODE/ROIpractice/.idea/modules.xml b/pyqt5/CODE/ROIpractice/.idea/modules.xml new file mode 100644 index 0000000..e15ec35 --- /dev/null +++ b/pyqt5/CODE/ROIpractice/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/pyqt5/CODE/ROIpractice/.idea/pythonProject.iml b/pyqt5/CODE/ROIpractice/.idea/pythonProject.iml new file mode 100644 index 0000000..a3a6a10 --- /dev/null +++ b/pyqt5/CODE/ROIpractice/.idea/pythonProject.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/pyqt5/CODE/ROIpractice/Image__2023-06-06__13-52-51.bmp b/pyqt5/CODE/ROIpractice/Image__2023-06-06__13-52-51.bmp new file mode 100644 index 0000000..6a51cd8 Binary files /dev/null and b/pyqt5/CODE/ROIpractice/Image__2023-06-06__13-52-51.bmp differ diff --git a/pyqt5/CODE/ROIpractice/__pycache__/test1.cpython-310.pyc b/pyqt5/CODE/ROIpractice/__pycache__/test1.cpython-310.pyc new file mode 100644 index 0000000..7e68f4e Binary files /dev/null and b/pyqt5/CODE/ROIpractice/__pycache__/test1.cpython-310.pyc differ diff --git a/pyqt5/CODE/ROIpractice/__pycache__/test1.cpython-39.pyc b/pyqt5/CODE/ROIpractice/__pycache__/test1.cpython-39.pyc new file mode 100644 index 0000000..8796e36 Binary files /dev/null and b/pyqt5/CODE/ROIpractice/__pycache__/test1.cpython-39.pyc differ diff --git a/pyqt5/CODE/ROIpractice/main.py b/pyqt5/CODE/ROIpractice/main.py new file mode 100644 index 0000000..107594e --- /dev/null +++ b/pyqt5/CODE/ROIpractice/main.py @@ -0,0 +1,145 @@ +import cv2 +import sys, time, os +import numpy as np +from PyQt5 import QtCore, QtGui, QtWidgets +from PyQt5.QtGui import QColor,QPen,QPainter,QPixmap,QImage,QPainterPath,QPolygonF +from test1 import Ui_MainWindow +from PyQt5.QtCore import QDate,QTime,Qt, QRect, QPoint, pyqtSignal +from PyQt5.QtWidgets import QApplication, QFileDialog, QLabel,QMainWindow, QWidget, QPushButton + + +def original(img): # 原圖 + img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) # QT顏色顯示轉換 + Ny , Nx , _ =img.shape + img = QtGui.QImage(img.data, Nx, Ny, Nx*3 , QtGui.QImage.Format_RGB888) # 須改格式 + return img + +class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow): + def __init__(self, parent=None): #按鍵設定 + super(MainWindow, self).__init__(parent) + self.setupUi(self) + self.PhotoOpen_Btn_1.clicked.connect(self.openfile1) # 按鍵open1 + self.ROI_Btn.clicked.connect(self.showNewWindow) # 按鍵open1 + self.roi_rect = QRect(100, 100, 50, 50) # ROI 的固定座標與大小 (x,y,Rx,Ry) xy為原始圖片的座標位置,RxRy為以座標位置延伸的長寬 + + + # 開啟資料夾 並選擇圖片 + def openfile1(self): + filename, _ = QFileDialog.getOpenFileName(self, 'Open Image') + self.img = cv2.imread(str(filename),cv2.IMREAD_GRAYSCALE) + self.img_original = original(self.img) #original 為轉UI顯示格式 + self.img_view1=self.img_original + self.photoshow1.setPixmap(QtGui.QPixmap.fromImage(self.img_view1)) + #選取ROI 開啟新視窗 + def showNewWindow(self): + self.nw = newWindow(self.img_view1) # 連接新視窗 + self.nw.positionsChanged.connect(self.handlePositionsChanged) # 連接信號 + self.nw.imageSaved.connect(self.receiveImage)# 連接信號 + self.nw.show() # 顯示新視窗 + x = self.nw.pos().x() # 取得新視窗目前 x 座標 + y = self.nw.pos().y() # 取得新視窗目前 y 座標 + self.nw.move(x+20, y) # 移動新視窗位置 + + def handlePositionsChanged(self, positions): + # 這個方法會在 newWindow 實例發出 positionsChanged 信號時被調用 + # positions 參數包含了 newWindow 實例發出信號時傳遞的數據 + self.clicked_positions = positions + print(self.clicked_positions) + + def receiveImage(self, image): + self.photoshow2.setPixmap(QtGui.QPixmap.fromImage(image)) + print(image) + pass +class newWindow(QtWidgets.QMainWindow): + positionsChanged = pyqtSignal(list) + imageSaved = QtCore.pyqtSignal(QtGui.QImage) + def __init__(self,img_view1): + super(newWindow, self).__init__() + self.img_view1 = img_view1 #將主畫面讀到的圖檔拉來子畫面 + self.ui() #子畫面初始化元件 + self.newWindowsize_x =self.img_view1.width() + self.newWindowsize_y =self.img_view1.height() + self.setWindowTitle('newWindow') + self.setFixedSize(800, 800) + self.setMouseTracking(True) + self.shownewWindowlabel1() + self.clicked_positions = [] + + def ui(self): + self.newWindowlabel1 = QtWidgets.QLabel(self) + self.newWindowlabel1.setText('newWindowlabel1') + self.newWindowlabel1.setGeometry(0, 0, 800, 800) + self.newWindowlabel1.setAlignment(QtCore.Qt.AlignTop | QtCore.Qt.AlignLeft) # 設置文本對齊在左上角 + # self.newWindowlabel1.setScaledContents(True) + self.newWindowlabel2 = QtWidgets.QLabel(self) + self.newWindowlabel2.setText('newWindowlabel2') + self.newWindowlabel2.setGeometry(0, 0, 200, 100) + self.newWindowlabel2.setAlignment(QtCore.Qt.AlignTop | QtCore.Qt.AlignLeft) # 設置文本對齊在左上角 + def shownewWindowlabel1(self): + self.img_pixmap = QtGui.QPixmap.fromImage(self.img_view1) + + def paintEvent(self,event): + super().paintEvent(event) + qpainter = QPainter(self) + qpainter.drawPixmap(self.rect(), self.img_pixmap) # 在窗口上繪製圖片,保持原始尺寸 + qpainter.setPen(QPen(QColor('#ff0000'), 5)) + for pos in self.clicked_positions: + x, y = pos + qpainter.drawPoint(x, y) + + if len(self.clicked_positions) == 4: + # 將最後一個點和第一個點連線 + for i in range(len(self.clicked_positions)): + x1, y1 = self.clicked_positions[i] + x2, y2 = self.clicked_positions[(i + 1) % len(self.clicked_positions)] + qpainter.drawLine(x1, y1, x2, y2) + qpainter.end() + self.cropImage() + self.close() + + def cropImage(self): + per_x = self.img_pixmap.size().width() / self.width() + per_y = self.img_pixmap.size().height() / self.height() + x_values = [pos[0] for pos in self.clicked_positions] + y_values = [pos[1] for pos in self.clicked_positions] + self.min_x = int(min(x_values)*per_x) + self.max_x = int(max(x_values)*per_x) + self.min_y = int(min(y_values)*per_y) + self.max_y = int(max(y_values)*per_y) + qimage = self.img_pixmap.toImage() + cropped_qimage = qimage.copy(self.min_x, self.min_y, self.max_x - self.min_x, self.max_y - self.min_y) + self.cropped_pixmap = QPixmap.fromImage(cropped_qimage) + self.cropped_pixmap.save(r"D:\python_code\photo\cropped_image.jpg") # 儲存裁剪後的圖像 + def mousePressEvent(self, event): + if event.button() == 1: + x = event.x() + y = event.y() + self.clicked_positions.append((x, y)) + print(self.clicked_positions) + self.newWindowlabel2.setText(f'{x}, {y}') # 透過 QLabel 顯示滑鼠座標 + self.update() + + def savePaintedPixmap(self): + # 创建新的 QPixmap 对象,并在其上绘制原始图片和红点 + center_x = self.img_pixmap.width() // 2 + center_y = self.img_pixmap.height()// 2 + painted_pixmap = QtGui.QPixmap(self.img_pixmap.size()) + painter = QtGui.QPainter(painted_pixmap) + painted_pixmap.fill(QtCore.Qt.black) + # painter.drawPixmap(self.cropped_pixmap.width(),self.cropped_pixmap.height(), self.cropped_pixmap) + painter.drawPixmap(center_x,center_y, self.cropped_pixmap) + painter.end() + + # 将 QPixmap 转换为 QImage 并发送 + painted_image = painted_pixmap.toImage() + self.imageSaved.emit(painted_image) + + def closeEvent(self, event): + self.savePaintedPixmap() + self.positionsChanged.emit(self.clicked_positions) + +if __name__=='__main__': + app = QtWidgets.QApplication(sys.argv) + win = MainWindow() + win.show() + sys.exit(app.exec_()) diff --git a/pyqt5/CODE/ROIpractice/test1.py b/pyqt5/CODE/ROIpractice/test1.py new file mode 100644 index 0000000..b21d6f9 --- /dev/null +++ b/pyqt5/CODE/ROIpractice/test1.py @@ -0,0 +1,84 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'test1.ui' +# +# Created by: PyQt5 UI code generator 5.15.9 +# +# WARNING: Any manual changes made to this file will be lost when pyuic5 is +# run again. Do not edit this file unless you know what you are doing. + + +from PyQt5 import QtCore, QtGui, QtWidgets + + +class Ui_MainWindow(object): + def setupUi(self, MainWindow): + MainWindow.setObjectName("MainWindow") + MainWindow.resize(1065, 798) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(MainWindow.sizePolicy().hasHeightForWidth()) + MainWindow.setSizePolicy(sizePolicy) + self.centralwidget = QtWidgets.QWidget(MainWindow) + self.centralwidget.setObjectName("centralwidget") + self.PhotoOpen_Btn_1 = QtWidgets.QPushButton(self.centralwidget) + self.PhotoOpen_Btn_1.setGeometry(QtCore.QRect(10, 10, 75, 23)) + self.PhotoOpen_Btn_1.setObjectName("PhotoOpen_Btn_1") + self.photoshow1 = QtWidgets.QLabel(self.centralwidget) + self.photoshow1.setGeometry(QtCore.QRect(60, 130, 431, 571)) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.photoshow1.sizePolicy().hasHeightForWidth()) + self.photoshow1.setSizePolicy(sizePolicy) + self.photoshow1.setScaledContents(True) + self.photoshow1.setObjectName("photoshow1") + self.ROI_Btn = QtWidgets.QPushButton(self.centralwidget) + self.ROI_Btn.setGeometry(QtCore.QRect(10, 60, 75, 23)) + self.ROI_Btn.setObjectName("ROI_Btn") + self.photoshow2 = QtWidgets.QLabel(self.centralwidget) + self.photoshow2.setGeometry(QtCore.QRect(550, 130, 431, 571)) + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.photoshow2.sizePolicy().hasHeightForWidth()) + self.photoshow2.setSizePolicy(sizePolicy) + self.photoshow2.setScaledContents(True) + self.photoshow2.setObjectName("photoshow2") + self.MouseEvent = QtWidgets.QLabel(self.centralwidget) + self.MouseEvent.setGeometry(QtCore.QRect(140, 30, 121, 31)) + font = QtGui.QFont() + font.setBold(False) + font.setItalic(False) + font.setUnderline(False) + font.setWeight(50) + self.MouseEvent.setFont(font) + self.MouseEvent.setMouseTracking(True) + self.MouseEvent.setTabletTracking(True) + self.MouseEvent.setScaledContents(True) + self.MouseEvent.setObjectName("MouseEvent") + MainWindow.setCentralWidget(self.centralwidget) + self.menubar = QtWidgets.QMenuBar(MainWindow) + self.menubar.setGeometry(QtCore.QRect(0, 0, 1065, 21)) + self.menubar.setObjectName("menubar") + MainWindow.setMenuBar(self.menubar) + self.statusbar = QtWidgets.QStatusBar(MainWindow) + self.statusbar.setObjectName("statusbar") + MainWindow.setStatusBar(self.statusbar) + self.toolBar = QtWidgets.QToolBar(MainWindow) + self.toolBar.setObjectName("toolBar") + MainWindow.addToolBar(QtCore.Qt.TopToolBarArea, self.toolBar) + + self.retranslateUi(MainWindow) + QtCore.QMetaObject.connectSlotsByName(MainWindow) + + def retranslateUi(self, MainWindow): + _translate = QtCore.QCoreApplication.translate + MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow")) + self.PhotoOpen_Btn_1.setText(_translate("MainWindow", "開啟圖片1")) + self.photoshow1.setText(_translate("MainWindow", "TextLabel")) + self.ROI_Btn.setText(_translate("MainWindow", "ROI擷取")) + self.photoshow2.setText(_translate("MainWindow", "TextLabel")) + self.MouseEvent.setText(_translate("MainWindow", "MouseEvent")) + self.toolBar.setWindowTitle(_translate("MainWindow", "toolBar")) diff --git a/pyqt5/CODE/ROIpractice/test1.ui b/pyqt5/CODE/ROIpractice/test1.ui new file mode 100644 index 0000000..3940ed8 --- /dev/null +++ b/pyqt5/CODE/ROIpractice/test1.ui @@ -0,0 +1,149 @@ + + + MainWindow + + + + 0 + 0 + 1065 + 798 + + + + + 0 + 0 + + + + MainWindow + + + + + + 10 + 10 + 75 + 23 + + + + 開啟圖片1 + + + + + + 60 + 130 + 431 + 571 + + + + + 0 + 0 + + + + TextLabel + + + true + + + + + + 10 + 60 + 75 + 23 + + + + ROI擷取 + + + + + + 550 + 130 + 431 + 571 + + + + + 0 + 0 + + + + TextLabel + + + true + + + + + + 140 + 30 + 121 + 31 + + + + + 50 + false + false + false + + + + true + + + true + + + MouseEvent + + + true + + + + + + + 0 + 0 + 1065 + 21 + + + + + + + toolBar + + + TopToolBarArea + + + false + + + + + + diff --git a/pyqt5/CODE/VIP_WMS_pyAPI/.idea/.gitignore b/pyqt5/CODE/VIP_WMS_pyAPI/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/pyqt5/CODE/VIP_WMS_pyAPI/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/pyqt5/CODE/VIP_WMS_pyAPI/.idea/.name b/pyqt5/CODE/VIP_WMS_pyAPI/.idea/.name new file mode 100644 index 0000000..11a5d8e --- /dev/null +++ b/pyqt5/CODE/VIP_WMS_pyAPI/.idea/.name @@ -0,0 +1 @@ +main.py \ No newline at end of file diff --git a/pyqt5/CODE/VIP_WMS_pyAPI/.idea/inspectionProfiles/profiles_settings.xml b/pyqt5/CODE/VIP_WMS_pyAPI/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/pyqt5/CODE/VIP_WMS_pyAPI/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/pyqt5/CODE/VIP_WMS_pyAPI/.idea/misc.xml b/pyqt5/CODE/VIP_WMS_pyAPI/.idea/misc.xml new file mode 100644 index 0000000..cfdc777 --- /dev/null +++ b/pyqt5/CODE/VIP_WMS_pyAPI/.idea/misc.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/pyqt5/CODE/VIP_WMS_pyAPI/.idea/modules.xml b/pyqt5/CODE/VIP_WMS_pyAPI/.idea/modules.xml new file mode 100644 index 0000000..6b378dc --- /dev/null +++ b/pyqt5/CODE/VIP_WMS_pyAPI/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/pyqt5/CODE/VIP_WMS_pyAPI/.idea/vcs.xml b/pyqt5/CODE/VIP_WMS_pyAPI/.idea/vcs.xml new file mode 100644 index 0000000..6c0b863 --- /dev/null +++ b/pyqt5/CODE/VIP_WMS_pyAPI/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/pyqt5/CODE/VIP_WMS_pyAPI/.idea/w4.iml b/pyqt5/CODE/VIP_WMS_pyAPI/.idea/w4.iml new file mode 100644 index 0000000..7632568 --- /dev/null +++ b/pyqt5/CODE/VIP_WMS_pyAPI/.idea/w4.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/pyqt5/CODE/VIP_WMS_pyAPI/UI/borrow/__pycache__/borrowui.cpython-39.pyc b/pyqt5/CODE/VIP_WMS_pyAPI/UI/borrow/__pycache__/borrowui.cpython-39.pyc new file mode 100644 index 0000000..3ce04ec Binary files /dev/null and b/pyqt5/CODE/VIP_WMS_pyAPI/UI/borrow/__pycache__/borrowui.cpython-39.pyc differ diff --git a/pyqt5/CODE/VIP_WMS_pyAPI/UI/borrow/borrowui.py b/pyqt5/CODE/VIP_WMS_pyAPI/UI/borrow/borrowui.py new file mode 100644 index 0000000..584bc28 --- /dev/null +++ b/pyqt5/CODE/VIP_WMS_pyAPI/UI/borrow/borrowui.py @@ -0,0 +1,94 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'borrowui.ui' +# +# Created by: PyQt5 UI code generator 5.15.7 +# +# WARNING: Any manual changes made to this file will be lost when pyuic5 is +# run again. Do not edit this file unless you know what you are doing. + + +from PyQt5 import QtCore, QtGui, QtWidgets + + +class Ui_Dialog(object): + def setupUi(self, Dialog): + Dialog.setObjectName("Dialog") + Dialog.resize(276, 214) + self.gridLayout = QtWidgets.QGridLayout(Dialog) + self.gridLayout.setObjectName("gridLayout") + self.verticalLayout = QtWidgets.QVBoxLayout() + self.verticalLayout.setObjectName("verticalLayout") + self.horizontalLayout = QtWidgets.QHBoxLayout() + self.horizontalLayout.setObjectName("horizontalLayout") + self.label = QtWidgets.QLabel(Dialog) + self.label.setObjectName("label") + self.horizontalLayout.addWidget(self.label) + self.comboBox_category = QtWidgets.QComboBox(Dialog) + self.comboBox_category.setMinimumSize(QtCore.QSize(141, 31)) + self.comboBox_category.setMaximumSize(QtCore.QSize(141, 31)) + self.comboBox_category.setObjectName("comboBox_category") + self.comboBox_category.addItem("") + self.comboBox_category.addItem("") + self.comboBox_category.addItem("") + self.comboBox_category.addItem("") + self.horizontalLayout.addWidget(self.comboBox_category) + self.verticalLayout.addLayout(self.horizontalLayout) + self.horizontalLayout_2 = QtWidgets.QHBoxLayout() + self.horizontalLayout_2.setObjectName("horizontalLayout_2") + self.label_2 = QtWidgets.QLabel(Dialog) + self.label_2.setObjectName("label_2") + self.horizontalLayout_2.addWidget(self.label_2) + self.comboBox_2 = QtWidgets.QComboBox(Dialog) + self.comboBox_2.setMinimumSize(QtCore.QSize(141, 31)) + self.comboBox_2.setObjectName("comboBox_2") + self.horizontalLayout_2.addWidget(self.comboBox_2) + self.verticalLayout.addLayout(self.horizontalLayout_2) + self.horizontalLayout_3 = QtWidgets.QHBoxLayout() + self.horizontalLayout_3.setObjectName("horizontalLayout_3") + self.label_4 = QtWidgets.QLabel(Dialog) + self.label_4.setObjectName("label_4") + self.horizontalLayout_3.addWidget(self.label_4) + self.comboBox_3 = QtWidgets.QComboBox(Dialog) + self.comboBox_3.setMinimumSize(QtCore.QSize(141, 31)) + self.comboBox_3.setObjectName("comboBox_3") + self.horizontalLayout_3.addWidget(self.comboBox_3) + self.verticalLayout.addLayout(self.horizontalLayout_3) + self.horizontalLayout_5 = QtWidgets.QHBoxLayout() + self.horizontalLayout_5.setObjectName("horizontalLayout_5") + self.horizontalLayout_4 = QtWidgets.QHBoxLayout() + self.horizontalLayout_4.setObjectName("horizontalLayout_4") + self.label_3 = QtWidgets.QLabel(Dialog) + self.label_3.setObjectName("label_3") + self.horizontalLayout_4.addWidget(self.label_3) + self.spinBox = QtWidgets.QSpinBox(Dialog) + self.spinBox.setMinimumSize(QtCore.QSize(91, 31)) + self.spinBox.setObjectName("spinBox") + self.horizontalLayout_4.addWidget(self.spinBox) + self.horizontalLayout_5.addLayout(self.horizontalLayout_4) + spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + self.horizontalLayout_5.addItem(spacerItem) + self.verticalLayout.addLayout(self.horizontalLayout_5) + self.buttonBox = QtWidgets.QDialogButtonBox(Dialog) + self.buttonBox.setOrientation(QtCore.Qt.Horizontal) + self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok) + self.buttonBox.setObjectName("buttonBox") + self.verticalLayout.addWidget(self.buttonBox) + self.gridLayout.addLayout(self.verticalLayout, 0, 0, 1, 1) + + self.retranslateUi(Dialog) + self.buttonBox.accepted.connect(Dialog.accept) # type: ignore + self.buttonBox.rejected.connect(Dialog.reject) # type: ignore + QtCore.QMetaObject.connectSlotsByName(Dialog) + + def retranslateUi(self, Dialog): + _translate = QtCore.QCoreApplication.translate + Dialog.setWindowTitle(_translate("Dialog", "Dialog")) + self.label.setText(_translate("Dialog", "類別:")) + self.comboBox_category.setItemText(0, _translate("Dialog", "電料類")) + self.comboBox_category.setItemText(1, _translate("Dialog", "線材類")) + self.comboBox_category.setItemText(2, _translate("Dialog", "螺絲類")) + self.comboBox_category.setItemText(3, _translate("Dialog", "相機類")) + self.label_2.setText(_translate("Dialog", "項目:")) + self.label_4.setText(_translate("Dialog", "借用人:")) + self.label_3.setText(_translate("Dialog", "數量:")) diff --git a/pyqt5/CODE/VIP_WMS_pyAPI/UI/borrow/borrowui.ui b/pyqt5/CODE/VIP_WMS_pyAPI/UI/borrow/borrowui.ui new file mode 100644 index 0000000..904ded1 --- /dev/null +++ b/pyqt5/CODE/VIP_WMS_pyAPI/UI/borrow/borrowui.ui @@ -0,0 +1,195 @@ + + + Dialog + + + + 0 + 0 + 276 + 214 + + + + Dialog + + + + + + + + + + 類別: + + + + + + + + 141 + 31 + + + + + 141 + 31 + + + + + 電料類 + + + + + 線材類 + + + + + 螺絲類 + + + + + 相機類 + + + + + + + + + + + + 項目: + + + + + + + + 141 + 31 + + + + + + + + + + + + 借用人: + + + + + + + + 141 + 31 + + + + + + + + + + + + + + 數量: + + + + + + + + 91 + 31 + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + + + buttonBox + accepted() + Dialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + Dialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/pyqt5/CODE/VIP_WMS_pyAPI/UI/create/__pycache__/createui.cpython-39.pyc b/pyqt5/CODE/VIP_WMS_pyAPI/UI/create/__pycache__/createui.cpython-39.pyc new file mode 100644 index 0000000..ac56f84 Binary files /dev/null and b/pyqt5/CODE/VIP_WMS_pyAPI/UI/create/__pycache__/createui.cpython-39.pyc differ diff --git a/pyqt5/CODE/VIP_WMS_pyAPI/UI/create/createui.py b/pyqt5/CODE/VIP_WMS_pyAPI/UI/create/createui.py new file mode 100644 index 0000000..290bcf1 --- /dev/null +++ b/pyqt5/CODE/VIP_WMS_pyAPI/UI/create/createui.py @@ -0,0 +1,127 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'createui.ui' +# +# Created by: PyQt5 UI code generator 5.15.7 +# +# WARNING: Any manual changes made to this file will be lost when pyuic5 is +# run again. Do not edit this file unless you know what you are doing. + + +from PyQt5 import QtCore, QtGui, QtWidgets + + +class Ui_Dialog(object): + def setupUi(self, Dialog): + Dialog.setObjectName("Dialog") + Dialog.resize(255, 286) + Dialog.setModal(True) + self.gridLayout = QtWidgets.QGridLayout(Dialog) + self.gridLayout.setObjectName("gridLayout") + self.verticalLayout_5 = QtWidgets.QVBoxLayout() + self.verticalLayout_5.setObjectName("verticalLayout_5") + spacerItem = QtWidgets.QSpacerItem(248, 17, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + self.verticalLayout_5.addItem(spacerItem) + self.horizontalLayout_6 = QtWidgets.QHBoxLayout() + self.horizontalLayout_6.setObjectName("horizontalLayout_6") + spacerItem1 = QtWidgets.QSpacerItem(20, 238, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + self.horizontalLayout_6.addItem(spacerItem1) + self.verticalLayout_4 = QtWidgets.QVBoxLayout() + self.verticalLayout_4.setObjectName("verticalLayout_4") + self.verticalLayout_3 = QtWidgets.QVBoxLayout() + self.verticalLayout_3.setObjectName("verticalLayout_3") + self.verticalLayout = QtWidgets.QVBoxLayout() + self.verticalLayout.setObjectName("verticalLayout") + self.horizontalLayout_5 = QtWidgets.QHBoxLayout() + self.horizontalLayout_5.setObjectName("horizontalLayout_5") + self.label_5 = QtWidgets.QLabel(Dialog) + self.label_5.setMaximumSize(QtCore.QSize(34, 16)) + self.label_5.setObjectName("label_5") + self.horizontalLayout_5.addWidget(self.label_5) + self.comboBox_category = QtWidgets.QComboBox(Dialog) + self.comboBox_category.setMinimumSize(QtCore.QSize(141, 31)) + self.comboBox_category.setMaximumSize(QtCore.QSize(141, 31)) + self.comboBox_category.setObjectName("comboBox_category") + self.comboBox_category.addItem("") + self.comboBox_category.addItem("") + self.comboBox_category.addItem("") + self.comboBox_category.addItem("") + self.horizontalLayout_5.addWidget(self.comboBox_category) + self.verticalLayout.addLayout(self.horizontalLayout_5) + self.horizontalLayout = QtWidgets.QHBoxLayout() + self.horizontalLayout.setObjectName("horizontalLayout") + self.label = QtWidgets.QLabel(Dialog) + self.label.setObjectName("label") + self.horizontalLayout.addWidget(self.label) + self.textEdit_item = QtWidgets.QTextEdit(Dialog) + self.textEdit_item.setMinimumSize(QtCore.QSize(141, 31)) + self.textEdit_item.setMaximumSize(QtCore.QSize(141, 31)) + self.textEdit_item.setObjectName("textEdit_item") + self.horizontalLayout.addWidget(self.textEdit_item) + self.verticalLayout.addLayout(self.horizontalLayout) + self.verticalLayout_3.addLayout(self.verticalLayout) + self.verticalLayout_2 = QtWidgets.QVBoxLayout() + self.verticalLayout_2.setObjectName("verticalLayout_2") + self.horizontalLayout_2 = QtWidgets.QHBoxLayout() + self.horizontalLayout_2.setObjectName("horizontalLayout_2") + self.label_2 = QtWidgets.QLabel(Dialog) + self.label_2.setObjectName("label_2") + self.horizontalLayout_2.addWidget(self.label_2) + self.textEdit_account = QtWidgets.QTextEdit(Dialog) + self.textEdit_account.setMinimumSize(QtCore.QSize(141, 31)) + self.textEdit_account.setMaximumSize(QtCore.QSize(141, 31)) + self.textEdit_account.setObjectName("textEdit_account") + self.horizontalLayout_2.addWidget(self.textEdit_account) + self.verticalLayout_2.addLayout(self.horizontalLayout_2) + self.horizontalLayout_3 = QtWidgets.QHBoxLayout() + self.horizontalLayout_3.setObjectName("horizontalLayout_3") + self.label_3 = QtWidgets.QLabel(Dialog) + self.label_3.setObjectName("label_3") + self.horizontalLayout_3.addWidget(self.label_3) + self.textEdit_location = QtWidgets.QTextEdit(Dialog) + self.textEdit_location.setMinimumSize(QtCore.QSize(141, 31)) + self.textEdit_location.setMaximumSize(QtCore.QSize(141, 31)) + self.textEdit_location.setObjectName("textEdit_location") + self.horizontalLayout_3.addWidget(self.textEdit_location) + self.verticalLayout_2.addLayout(self.horizontalLayout_3) + self.horizontalLayout_4 = QtWidgets.QHBoxLayout() + self.horizontalLayout_4.setObjectName("horizontalLayout_4") + self.label_4 = QtWidgets.QLabel(Dialog) + self.label_4.setObjectName("label_4") + self.horizontalLayout_4.addWidget(self.label_4) + self.textEdit_image = QtWidgets.QTextEdit(Dialog) + self.textEdit_image.setMinimumSize(QtCore.QSize(141, 31)) + self.textEdit_image.setMaximumSize(QtCore.QSize(141, 31)) + self.textEdit_image.setObjectName("textEdit_image") + self.horizontalLayout_4.addWidget(self.textEdit_image) + self.verticalLayout_2.addLayout(self.horizontalLayout_4) + self.verticalLayout_3.addLayout(self.verticalLayout_2) + self.verticalLayout_4.addLayout(self.verticalLayout_3) + self.buttonBox = QtWidgets.QDialogButtonBox(Dialog) + self.buttonBox.setOrientation(QtCore.Qt.Horizontal) + self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok) + self.buttonBox.setObjectName("buttonBox") + self.verticalLayout_4.addWidget(self.buttonBox) + self.horizontalLayout_6.addLayout(self.verticalLayout_4) + spacerItem2 = QtWidgets.QSpacerItem(17, 17, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + self.horizontalLayout_6.addItem(spacerItem2) + self.verticalLayout_5.addLayout(self.horizontalLayout_6) + self.gridLayout.addLayout(self.verticalLayout_5, 0, 0, 1, 1) + + self.retranslateUi(Dialog) + self.buttonBox.accepted.connect(Dialog.accept) # type: ignore + self.buttonBox.rejected.connect(Dialog.reject) # type: ignore + QtCore.QMetaObject.connectSlotsByName(Dialog) + + def retranslateUi(self, Dialog): + _translate = QtCore.QCoreApplication.translate + Dialog.setWindowTitle(_translate("Dialog", "創建")) + self.label_5.setText(_translate("Dialog", "類別:")) + self.comboBox_category.setItemText(0, _translate("Dialog", "電料類")) + self.comboBox_category.setItemText(1, _translate("Dialog", "線材類")) + self.comboBox_category.setItemText(2, _translate("Dialog", "螺絲類")) + self.comboBox_category.setItemText(3, _translate("Dialog", "相機類")) + self.label.setText(_translate("Dialog", "項目:")) + self.label_2.setText(_translate("Dialog", "數量:")) + self.label_3.setText(_translate("Dialog", "位置:")) + self.label_4.setText(_translate("Dialog", "圖片:")) diff --git a/pyqt5/CODE/VIP_WMS_pyAPI/UI/create/createui.ui b/pyqt5/CODE/VIP_WMS_pyAPI/UI/create/createui.ui new file mode 100644 index 0000000..827e594 --- /dev/null +++ b/pyqt5/CODE/VIP_WMS_pyAPI/UI/create/createui.ui @@ -0,0 +1,291 @@ + + + Dialog + + + + 0 + 0 + 255 + 286 + + + + 創建 + + + true + + + + + + + + Qt::Horizontal + + + + 248 + 17 + + + + + + + + + + Qt::Vertical + + + + 20 + 238 + + + + + + + + + + + + + + + + + 34 + 16 + + + + 類別: + + + + + + + + 141 + 31 + + + + + 141 + 31 + + + + + 電料類 + + + + + 線材類 + + + + + 螺絲類 + + + + + 相機類 + + + + + + + + + + + + 項目: + + + + + + + + 141 + 31 + + + + + 141 + 31 + + + + + + + + + + + + + + + + 數量: + + + + + + + + 141 + 31 + + + + + 141 + 31 + + + + + + + + + + + + 位置: + + + + + + + + 141 + 31 + + + + + 141 + 31 + + + + + + + + + + + + 圖片: + + + + + + + + 141 + 31 + + + + + 141 + 31 + + + + + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + Qt::Horizontal + + + + 17 + 17 + + + + + + + + + + + + + + buttonBox + accepted() + Dialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + Dialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/pyqt5/CODE/VIP_WMS_pyAPI/UI/delete/__pycache__/deleteui.cpython-39.pyc b/pyqt5/CODE/VIP_WMS_pyAPI/UI/delete/__pycache__/deleteui.cpython-39.pyc new file mode 100644 index 0000000..7741aa5 Binary files /dev/null and b/pyqt5/CODE/VIP_WMS_pyAPI/UI/delete/__pycache__/deleteui.cpython-39.pyc differ diff --git a/pyqt5/CODE/VIP_WMS_pyAPI/UI/delete/deleteui.py b/pyqt5/CODE/VIP_WMS_pyAPI/UI/delete/deleteui.py new file mode 100644 index 0000000..3565a8f --- /dev/null +++ b/pyqt5/CODE/VIP_WMS_pyAPI/UI/delete/deleteui.py @@ -0,0 +1,80 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'deleteui.ui' +# +# Created by: PyQt5 UI code generator 5.15.7 +# +# WARNING: Any manual changes made to this file will be lost when pyuic5 is +# run again. Do not edit this file unless you know what you are doing. + + +from PyQt5 import QtCore, QtGui, QtWidgets + + +class Ui_Dialog(object): + def setupUi(self, Dialog): + Dialog.setObjectName("Dialog") + Dialog.resize(293, 145) + self.gridLayout_2 = QtWidgets.QGridLayout(Dialog) + self.gridLayout_2.setObjectName("gridLayout_2") + self.horizontalLayout_4 = QtWidgets.QHBoxLayout() + self.horizontalLayout_4.setObjectName("horizontalLayout_4") + spacerItem = QtWidgets.QSpacerItem(20, 198, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + self.horizontalLayout_4.addItem(spacerItem) + self.gridLayout = QtWidgets.QGridLayout() + self.gridLayout.setObjectName("gridLayout") + spacerItem1 = QtWidgets.QSpacerItem(378, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + self.gridLayout.addItem(spacerItem1, 0, 0, 1, 1) + self.verticalLayout_4 = QtWidgets.QVBoxLayout() + self.verticalLayout_4.setObjectName("verticalLayout_4") + self.horizontalLayout_3 = QtWidgets.QHBoxLayout() + self.horizontalLayout_3.setObjectName("horizontalLayout_3") + self.verticalLayout_2 = QtWidgets.QVBoxLayout() + self.verticalLayout_2.setObjectName("verticalLayout_2") + self.label_3 = QtWidgets.QLabel(Dialog) + self.label_3.setObjectName("label_3") + self.verticalLayout_2.addWidget(self.label_3) + self.label_4 = QtWidgets.QLabel(Dialog) + self.label_4.setObjectName("label_4") + self.verticalLayout_2.addWidget(self.label_4) + self.horizontalLayout_3.addLayout(self.verticalLayout_2) + self.verticalLayout_3 = QtWidgets.QVBoxLayout() + self.verticalLayout_3.setObjectName("verticalLayout_3") + self.comboBox_category = QtWidgets.QComboBox(Dialog) + self.comboBox_category.setMinimumSize(QtCore.QSize(131, 22)) + self.comboBox_category.setMaximumSize(QtCore.QSize(131, 22)) + self.comboBox_category.setObjectName("comboBox_category") + self.comboBox_category.addItem("") + self.comboBox_category.addItem("") + self.comboBox_category.addItem("") + self.comboBox_category.addItem("") + self.verticalLayout_3.addWidget(self.comboBox_category) + self.comboBox_item = QtWidgets.QComboBox(Dialog) + self.comboBox_item.setMinimumSize(QtCore.QSize(191, 22)) + self.comboBox_item.setObjectName("comboBox_item") + self.verticalLayout_3.addWidget(self.comboBox_item) + self.horizontalLayout_3.addLayout(self.verticalLayout_3) + self.verticalLayout_4.addLayout(self.horizontalLayout_3) + self.buttonBox = QtWidgets.QDialogButtonBox(Dialog) + self.buttonBox.setOrientation(QtCore.Qt.Horizontal) + self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok) + self.buttonBox.setObjectName("buttonBox") + self.verticalLayout_4.addWidget(self.buttonBox) + self.gridLayout.addLayout(self.verticalLayout_4, 1, 0, 1, 1) + self.horizontalLayout_4.addLayout(self.gridLayout) + self.gridLayout_2.addLayout(self.horizontalLayout_4, 0, 0, 1, 1) + + self.retranslateUi(Dialog) + self.buttonBox.accepted.connect(Dialog.accept) # type: ignore + self.buttonBox.rejected.connect(Dialog.reject) # type: ignore + QtCore.QMetaObject.connectSlotsByName(Dialog) + + def retranslateUi(self, Dialog): + _translate = QtCore.QCoreApplication.translate + Dialog.setWindowTitle(_translate("Dialog", "刪除")) + self.label_3.setText(_translate("Dialog", "類別:")) + self.label_4.setText(_translate("Dialog", "項目:")) + self.comboBox_category.setItemText(0, _translate("Dialog", "電料類")) + self.comboBox_category.setItemText(1, _translate("Dialog", "線材類")) + self.comboBox_category.setItemText(2, _translate("Dialog", "螺絲類")) + self.comboBox_category.setItemText(3, _translate("Dialog", "相機類")) diff --git a/pyqt5/CODE/VIP_WMS_pyAPI/UI/delete/deleteui.ui b/pyqt5/CODE/VIP_WMS_pyAPI/UI/delete/deleteui.ui new file mode 100644 index 0000000..e2f7473 --- /dev/null +++ b/pyqt5/CODE/VIP_WMS_pyAPI/UI/delete/deleteui.ui @@ -0,0 +1,174 @@ + + + Dialog + + + + 0 + 0 + 293 + 145 + + + + 刪除 + + + + + + + + Qt::Vertical + + + + 20 + 198 + + + + + + + + + + Qt::Horizontal + + + + 378 + 20 + + + + + + + + + + + + + + 類別: + + + + + + + 項目: + + + + + + + + + + + + 131 + 22 + + + + + 131 + 22 + + + + + 電料類 + + + + + 線材類 + + + + + 螺絲類 + + + + + 相機類 + + + + + + + + + 191 + 22 + + + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + + + + + + + buttonBox + accepted() + Dialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + Dialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/pyqt5/CODE/VIP_WMS_pyAPI/UI/history/__pycache__/historyui.cpython-39.pyc b/pyqt5/CODE/VIP_WMS_pyAPI/UI/history/__pycache__/historyui.cpython-39.pyc new file mode 100644 index 0000000..4f233ca Binary files /dev/null and b/pyqt5/CODE/VIP_WMS_pyAPI/UI/history/__pycache__/historyui.cpython-39.pyc differ diff --git a/pyqt5/CODE/VIP_WMS_pyAPI/UI/history/historyui.py b/pyqt5/CODE/VIP_WMS_pyAPI/UI/history/historyui.py new file mode 100644 index 0000000..f84f055 --- /dev/null +++ b/pyqt5/CODE/VIP_WMS_pyAPI/UI/history/historyui.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'historyui.ui' +# +# Created by: PyQt5 UI code generator 5.15.7 +# +# WARNING: Any manual changes made to this file will be lost when pyuic5 is +# run again. Do not edit this file unless you know what you are doing. + + +from PyQt5 import QtCore, QtGui, QtWidgets + + +class Ui_Form(object): + def setupUi(self, Form): + Form.setObjectName("Form") + Form.resize(783, 423) + self.gridLayout = QtWidgets.QGridLayout(Form) + self.gridLayout.setObjectName("gridLayout") + self.tableWidget = QtWidgets.QTableWidget(Form) + self.tableWidget.setMinimumSize(QtCore.QSize(761, 401)) + self.tableWidget.setObjectName("tableWidget") + self.tableWidget.setColumnCount(6) + self.tableWidget.setRowCount(0) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setHorizontalHeaderItem(0, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setHorizontalHeaderItem(1, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setHorizontalHeaderItem(2, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setHorizontalHeaderItem(3, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setHorizontalHeaderItem(4, item) + item = QtWidgets.QTableWidgetItem() + self.tableWidget.setHorizontalHeaderItem(5, item) + self.gridLayout.addWidget(self.tableWidget, 0, 0, 1, 1) + + self.retranslateUi(Form) + QtCore.QMetaObject.connectSlotsByName(Form) + + def retranslateUi(self, Form): + _translate = QtCore.QCoreApplication.translate + Form.setWindowTitle(_translate("Form", "Form")) + item = self.tableWidget.horizontalHeaderItem(0) + item.setText(_translate("Form", "租借日期")) + item = self.tableWidget.horizontalHeaderItem(1) + item.setText(_translate("Form", "歸還日期")) + item = self.tableWidget.horizontalHeaderItem(2) + item.setText(_translate("Form", "租借人")) + item = self.tableWidget.horizontalHeaderItem(3) + item.setText(_translate("Form", "租借類別")) + item = self.tableWidget.horizontalHeaderItem(4) + item.setText(_translate("Form", "租借項目")) + item = self.tableWidget.horizontalHeaderItem(5) + item.setText(_translate("Form", "租借數量")) diff --git a/pyqt5/CODE/VIP_WMS_pyAPI/UI/history/historyui.ui b/pyqt5/CODE/VIP_WMS_pyAPI/UI/history/historyui.ui new file mode 100644 index 0000000..4e79872 --- /dev/null +++ b/pyqt5/CODE/VIP_WMS_pyAPI/UI/history/historyui.ui @@ -0,0 +1,61 @@ + + + Form + + + + 0 + 0 + 783 + 423 + + + + Form + + + + + + + 761 + 401 + + + + + 租借日期 + + + + + 歸還日期 + + + + + 租借人 + + + + + 租借類別 + + + + + 租借項目 + + + + + 租借數量 + + + + + + + + + diff --git a/pyqt5/CODE/VIP_WMS_pyAPI/UI/items/__pycache__/itemsui.cpython-39.pyc b/pyqt5/CODE/VIP_WMS_pyAPI/UI/items/__pycache__/itemsui.cpython-39.pyc new file mode 100644 index 0000000..a9bc9a1 Binary files /dev/null and b/pyqt5/CODE/VIP_WMS_pyAPI/UI/items/__pycache__/itemsui.cpython-39.pyc differ diff --git a/pyqt5/CODE/VIP_WMS_pyAPI/UI/items/itemsui.py b/pyqt5/CODE/VIP_WMS_pyAPI/UI/items/itemsui.py new file mode 100644 index 0000000..6e23d26 --- /dev/null +++ b/pyqt5/CODE/VIP_WMS_pyAPI/UI/items/itemsui.py @@ -0,0 +1,91 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'itemsui.ui' +# +# Created by: PyQt5 UI code generator 5.15.7 +# +# WARNING: Any manual changes made to this file will be lost when pyuic5 is +# run again. Do not edit this file unless you know what you are doing. + + +from PyQt5 import QtCore, QtGui, QtWidgets + + +class Ui_Form(object): + def setupUi(self, Form): + Form.setObjectName("Form") + Form.resize(875, 577) + self.gridLayout = QtWidgets.QGridLayout(Form) + self.gridLayout.setObjectName("gridLayout") + self.horizontalLayout = QtWidgets.QHBoxLayout() + self.horizontalLayout.setObjectName("horizontalLayout") + self.horizontalLayout_3 = QtWidgets.QHBoxLayout() + self.horizontalLayout_3.setObjectName("horizontalLayout_3") + self.comboBox = QtWidgets.QComboBox(Form) + self.comboBox.setMinimumSize(QtCore.QSize(121, 31)) + self.comboBox.setMaximumSize(QtCore.QSize(121, 31)) + self.comboBox.setObjectName("comboBox") + self.comboBox.addItem("") + self.comboBox.addItem("") + self.comboBox.addItem("") + self.comboBox.addItem("") + self.horizontalLayout_3.addWidget(self.comboBox) + self.horizontalLayout.addLayout(self.horizontalLayout_3) + spacerItem = QtWidgets.QSpacerItem(728, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + self.horizontalLayout.addItem(spacerItem) + self.gridLayout.addLayout(self.horizontalLayout, 0, 0, 1, 1) + self.horizontalLayout_2 = QtWidgets.QHBoxLayout() + self.horizontalLayout_2.setObjectName("horizontalLayout_2") + self.tableWidget = QtWidgets.QTableWidget(Form) + self.tableWidget.setMinimumSize(QtCore.QSize(631, 511)) + self.tableWidget.setLineWidth(1) + self.tableWidget.setColumnCount(4) + self.tableWidget.setObjectName("tableWidget") + self.tableWidget.setRowCount(0) + item = QtWidgets.QTableWidgetItem() + item.setTextAlignment(QtCore.Qt.AlignCenter) + self.tableWidget.setHorizontalHeaderItem(0, item) + item = QtWidgets.QTableWidgetItem() + item.setTextAlignment(QtCore.Qt.AlignCenter) + self.tableWidget.setHorizontalHeaderItem(1, item) + item = QtWidgets.QTableWidgetItem() + item.setTextAlignment(QtCore.Qt.AlignCenter) + self.tableWidget.setHorizontalHeaderItem(2, item) + item = QtWidgets.QTableWidgetItem() + item.setTextAlignment(QtCore.Qt.AlignCenter) + self.tableWidget.setHorizontalHeaderItem(3, item) + self.horizontalLayout_2.addWidget(self.tableWidget) + self.verticalLayout = QtWidgets.QVBoxLayout() + self.verticalLayout.setObjectName("verticalLayout") + spacerItem1 = QtWidgets.QSpacerItem(20, 108, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + self.verticalLayout.addItem(spacerItem1) + self.label = QtWidgets.QLabel(Form) + self.label.setMinimumSize(QtCore.QSize(211, 231)) + self.label.setMaximumSize(QtCore.QSize(211, 231)) + self.label.setScaledContents(True) + self.label.setObjectName("label") + self.verticalLayout.addWidget(self.label) + spacerItem2 = QtWidgets.QSpacerItem(20, 108, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + self.verticalLayout.addItem(spacerItem2) + self.horizontalLayout_2.addLayout(self.verticalLayout) + self.gridLayout.addLayout(self.horizontalLayout_2, 1, 0, 1, 1) + + self.retranslateUi(Form) + QtCore.QMetaObject.connectSlotsByName(Form) + + def retranslateUi(self, Form): + _translate = QtCore.QCoreApplication.translate + Form.setWindowTitle(_translate("Form", "Form")) + self.comboBox.setItemText(0, _translate("Form", "電料類")) + self.comboBox.setItemText(1, _translate("Form", "線材類")) + self.comboBox.setItemText(2, _translate("Form", "螺絲類")) + self.comboBox.setItemText(3, _translate("Form", "相機類")) + item = self.tableWidget.horizontalHeaderItem(0) + item.setText(_translate("Form", "項目")) + item = self.tableWidget.horizontalHeaderItem(1) + item.setText(_translate("Form", "數量")) + item = self.tableWidget.horizontalHeaderItem(2) + item.setText(_translate("Form", "位置")) + item = self.tableWidget.horizontalHeaderItem(3) + item.setText(_translate("Form", "圖片")) + self.label.setText(_translate("Form", "TextLabel")) diff --git a/pyqt5/CODE/VIP_WMS_pyAPI/UI/items/itemsui.ui b/pyqt5/CODE/VIP_WMS_pyAPI/UI/items/itemsui.ui new file mode 100644 index 0000000..280b839 --- /dev/null +++ b/pyqt5/CODE/VIP_WMS_pyAPI/UI/items/itemsui.ui @@ -0,0 +1,182 @@ + + + Form + + + + 0 + 0 + 875 + 577 + + + + Form + + + + + + + + + + + 121 + 31 + + + + + 121 + 31 + + + + + 電料類 + + + + + 線材類 + + + + + 螺絲類 + + + + + 相機類 + + + + + + + + + + Qt::Horizontal + + + + 728 + 20 + + + + + + + + + + + + + 631 + 511 + + + + 1 + + + 4 + + + + 項目 + + + AlignCenter + + + + + 數量 + + + AlignCenter + + + + + 位置 + + + AlignCenter + + + + + 圖片 + + + AlignCenter + + + + + + + + + + Qt::Vertical + + + + 20 + 108 + + + + + + + + + 211 + 231 + + + + + 211 + 231 + + + + TextLabel + + + true + + + + + + + Qt::Vertical + + + + 20 + 108 + + + + + + + + + + + + + diff --git a/pyqt5/CODE/VIP_WMS_pyAPI/UI/login/__pycache__/loginui.cpython-39.pyc b/pyqt5/CODE/VIP_WMS_pyAPI/UI/login/__pycache__/loginui.cpython-39.pyc new file mode 100644 index 0000000..ac51a3f Binary files /dev/null and b/pyqt5/CODE/VIP_WMS_pyAPI/UI/login/__pycache__/loginui.cpython-39.pyc differ diff --git a/pyqt5/CODE/VIP_WMS_pyAPI/UI/login/loginui.py b/pyqt5/CODE/VIP_WMS_pyAPI/UI/login/loginui.py new file mode 100644 index 0000000..cf6ed0b --- /dev/null +++ b/pyqt5/CODE/VIP_WMS_pyAPI/UI/login/loginui.py @@ -0,0 +1,78 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'loginui.ui' +# +# Created by: PyQt5 UI code generator 5.15.7 +# +# WARNING: Any manual changes made to this file will be lost when pyuic5 is +# run again. Do not edit this file unless you know what you are doing. + + +from PyQt5 import QtCore, QtGui, QtWidgets + + +class Ui_Dialog(object): + def setupUi(self, Dialog): + Dialog.setObjectName("Dialog") + Dialog.resize(314, 152) + self.gridLayout = QtWidgets.QGridLayout(Dialog) + self.gridLayout.setObjectName("gridLayout") + spacerItem = QtWidgets.QSpacerItem(20, 127, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + self.gridLayout.addItem(spacerItem, 0, 0, 2, 1) + spacerItem1 = QtWidgets.QSpacerItem(259, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + self.gridLayout.addItem(spacerItem1, 0, 1, 1, 1) + self.verticalLayout_2 = QtWidgets.QVBoxLayout() + self.verticalLayout_2.setObjectName("verticalLayout_2") + self.verticalLayout = QtWidgets.QVBoxLayout() + self.verticalLayout.setObjectName("verticalLayout") + self.horizontalLayout = QtWidgets.QHBoxLayout() + self.horizontalLayout.setObjectName("horizontalLayout") + self.label = QtWidgets.QLabel(Dialog) + font = QtGui.QFont() + font.setFamily("Arial") + font.setPointSize(12) + self.label.setFont(font) + self.label.setObjectName("label") + self.horizontalLayout.addWidget(self.label) + self.lineEdit_userid = QtWidgets.QLineEdit(Dialog) + self.lineEdit_userid.setMinimumSize(QtCore.QSize(154, 24)) + self.lineEdit_userid.setObjectName("lineEdit_userid") + self.horizontalLayout.addWidget(self.lineEdit_userid) + self.verticalLayout.addLayout(self.horizontalLayout) + self.horizontalLayout_2 = QtWidgets.QHBoxLayout() + self.horizontalLayout_2.setObjectName("horizontalLayout_2") + self.label_2 = QtWidgets.QLabel(Dialog) + font = QtGui.QFont() + font.setFamily("Arial") + font.setPointSize(12) + self.label_2.setFont(font) + self.label_2.setObjectName("label_2") + self.horizontalLayout_2.addWidget(self.label_2) + self.lineEdit_password = QtWidgets.QLineEdit(Dialog) + self.lineEdit_password.setMinimumSize(QtCore.QSize(155, 24)) + self.lineEdit_password.setObjectName("lineEdit_password") + self.horizontalLayout_2.addWidget(self.lineEdit_password) + self.verticalLayout.addLayout(self.horizontalLayout_2) + self.verticalLayout_2.addLayout(self.verticalLayout) + self.horizontalLayout_3 = QtWidgets.QHBoxLayout() + self.horizontalLayout_3.setObjectName("horizontalLayout_3") + spacerItem2 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + self.horizontalLayout_3.addItem(spacerItem2) + self.btn_login = QtWidgets.QPushButton(Dialog) + self.btn_login.setMinimumSize(QtCore.QSize(141, 28)) + self.btn_login.setObjectName("btn_login") + self.horizontalLayout_3.addWidget(self.btn_login) + spacerItem3 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + self.horizontalLayout_3.addItem(spacerItem3) + self.verticalLayout_2.addLayout(self.horizontalLayout_3) + self.gridLayout.addLayout(self.verticalLayout_2, 1, 1, 1, 1) + + self.retranslateUi(Dialog) + QtCore.QMetaObject.connectSlotsByName(Dialog) + + def retranslateUi(self, Dialog): + _translate = QtCore.QCoreApplication.translate + Dialog.setWindowTitle(_translate("Dialog", "登入")) + self.label.setText(_translate("Dialog", "Username:")) + self.label_2.setText(_translate("Dialog", "Password:")) + self.btn_login.setText(_translate("Dialog", "登入")) diff --git a/pyqt5/CODE/VIP_WMS_pyAPI/UI/login/loginui.ui b/pyqt5/CODE/VIP_WMS_pyAPI/UI/login/loginui.ui new file mode 100644 index 0000000..bf91d84 --- /dev/null +++ b/pyqt5/CODE/VIP_WMS_pyAPI/UI/login/loginui.ui @@ -0,0 +1,152 @@ + + + Dialog + + + + 0 + 0 + 314 + 152 + + + + 登入 + + + + + + Qt::Vertical + + + + 20 + 127 + + + + + + + + Qt::Horizontal + + + + 259 + 20 + + + + + + + + + + + + + + + Arial + 12 + + + + Username: + + + + + + + + 154 + 24 + + + + + + + + + + + + + Arial + 12 + + + + Password: + + + + + + + + 155 + 24 + + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 141 + 28 + + + + 登入 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + diff --git a/pyqt5/CODE/VIP_WMS_pyAPI/UI/main/__pycache__/mainui.cpython-39.pyc b/pyqt5/CODE/VIP_WMS_pyAPI/UI/main/__pycache__/mainui.cpython-39.pyc new file mode 100644 index 0000000..820b65f Binary files /dev/null and b/pyqt5/CODE/VIP_WMS_pyAPI/UI/main/__pycache__/mainui.cpython-39.pyc differ diff --git a/pyqt5/CODE/VIP_WMS_pyAPI/UI/main/mainui.py b/pyqt5/CODE/VIP_WMS_pyAPI/UI/main/mainui.py new file mode 100644 index 0000000..d2702de --- /dev/null +++ b/pyqt5/CODE/VIP_WMS_pyAPI/UI/main/mainui.py @@ -0,0 +1,71 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'mainui.ui' +# +# Created by: PyQt5 UI code generator 5.15.7 +# +# WARNING: Any manual changes made to this file will be lost when pyuic5 is +# run again. Do not edit this file unless you know what you are doing. + + +from PyQt5 import QtCore, QtGui, QtWidgets + + +class Ui_MainWindow(object): + def setupUi(self, MainWindow): + MainWindow.setObjectName("MainWindow") + MainWindow.resize(907, 686) + self.centralwidget = QtWidgets.QWidget(MainWindow) + self.centralwidget.setObjectName("centralwidget") + self.gridLayout = QtWidgets.QGridLayout(self.centralwidget) + self.gridLayout.setObjectName("gridLayout") + self.verticalLayout = QtWidgets.QVBoxLayout() + self.verticalLayout.setObjectName("verticalLayout") + self.horizontalLayout = QtWidgets.QHBoxLayout() + self.horizontalLayout.setObjectName("horizontalLayout") + self.btn_items = QtWidgets.QPushButton(self.centralwidget) + self.btn_items.setObjectName("btn_items") + self.horizontalLayout.addWidget(self.btn_items) + self.btn_history = QtWidgets.QPushButton(self.centralwidget) + self.btn_history.setObjectName("btn_history") + self.horizontalLayout.addWidget(self.btn_history) + self.btn_borrow = QtWidgets.QPushButton(self.centralwidget) + self.btn_borrow.setObjectName("btn_borrow") + self.horizontalLayout.addWidget(self.btn_borrow) + self.btn_return = QtWidgets.QPushButton(self.centralwidget) + self.btn_return.setObjectName("btn_return") + self.horizontalLayout.addWidget(self.btn_return) + self.btn_create = QtWidgets.QPushButton(self.centralwidget) + self.btn_create.setObjectName("btn_create") + self.horizontalLayout.addWidget(self.btn_create) + self.btn_delete = QtWidgets.QPushButton(self.centralwidget) + self.btn_delete.setObjectName("btn_delete") + self.horizontalLayout.addWidget(self.btn_delete) + self.btn_login = QtWidgets.QPushButton(self.centralwidget) + self.btn_login.setObjectName("btn_login") + self.horizontalLayout.addWidget(self.btn_login) + self.verticalLayout.addLayout(self.horizontalLayout) + self.stackedWidget = QtWidgets.QStackedWidget(self.centralwidget) + self.stackedWidget.setMinimumSize(QtCore.QSize(881, 621)) + self.stackedWidget.setObjectName("stackedWidget") + self.verticalLayout.addWidget(self.stackedWidget) + self.gridLayout.addLayout(self.verticalLayout, 0, 0, 1, 1) + MainWindow.setCentralWidget(self.centralwidget) + self.statusbar = QtWidgets.QStatusBar(MainWindow) + self.statusbar.setObjectName("statusbar") + MainWindow.setStatusBar(self.statusbar) + + self.retranslateUi(MainWindow) + self.stackedWidget.setCurrentIndex(-1) + QtCore.QMetaObject.connectSlotsByName(MainWindow) + + def retranslateUi(self, MainWindow): + _translate = QtCore.QCoreApplication.translate + MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow")) + self.btn_items.setText(_translate("MainWindow", "主畫面")) + self.btn_history.setText(_translate("MainWindow", "歷史紀錄")) + self.btn_borrow.setText(_translate("MainWindow", "借用")) + self.btn_return.setText(_translate("MainWindow", "歸還")) + self.btn_create.setText(_translate("MainWindow", "創建")) + self.btn_delete.setText(_translate("MainWindow", "刪除")) + self.btn_login.setText(_translate("MainWindow", "倉管登入")) diff --git a/pyqt5/CODE/VIP_WMS_pyAPI/UI/main/mainui.ui b/pyqt5/CODE/VIP_WMS_pyAPI/UI/main/mainui.ui new file mode 100644 index 0000000..b37f079 --- /dev/null +++ b/pyqt5/CODE/VIP_WMS_pyAPI/UI/main/mainui.ui @@ -0,0 +1,94 @@ + + + MainWindow + + + + 0 + 0 + 907 + 686 + + + + MainWindow + + + + + + + + + + + 主畫面 + + + + + + + 歷史紀錄 + + + + + + + 借用 + + + + + + + 歸還 + + + + + + + 創建 + + + + + + + 刪除 + + + + + + + 倉管登入 + + + + + + + + + + 881 + 621 + + + + -1 + + + + + + + + + + + + diff --git a/pyqt5/CODE/VIP_WMS_pyAPI/UI/rereturn/__pycache__/returnui.cpython-39.pyc b/pyqt5/CODE/VIP_WMS_pyAPI/UI/rereturn/__pycache__/returnui.cpython-39.pyc new file mode 100644 index 0000000..6593860 Binary files /dev/null and b/pyqt5/CODE/VIP_WMS_pyAPI/UI/rereturn/__pycache__/returnui.cpython-39.pyc differ diff --git a/pyqt5/CODE/VIP_WMS_pyAPI/UI/rereturn/returnui.py b/pyqt5/CODE/VIP_WMS_pyAPI/UI/rereturn/returnui.py new file mode 100644 index 0000000..07ba4c6 --- /dev/null +++ b/pyqt5/CODE/VIP_WMS_pyAPI/UI/rereturn/returnui.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'returnui.ui' +# +# Created by: PyQt5 UI code generator 5.15.7 +# +# WARNING: Any manual changes made to this file will be lost when pyuic5 is +# run again. Do not edit this file unless you know what you are doing. + + +from PyQt5 import QtCore, QtGui, QtWidgets + + +class Ui_Dialog(object): + def setupUi(self, Dialog): + Dialog.setObjectName("Dialog") + Dialog.resize(599, 85) + self.gridLayout = QtWidgets.QGridLayout(Dialog) + self.gridLayout.setObjectName("gridLayout") + self.verticalLayout = QtWidgets.QVBoxLayout() + self.verticalLayout.setObjectName("verticalLayout") + self.horizontalLayout = QtWidgets.QHBoxLayout() + self.horizontalLayout.setObjectName("horizontalLayout") + self.label_5 = QtWidgets.QLabel(Dialog) + self.label_5.setObjectName("label_5") + self.horizontalLayout.addWidget(self.label_5) + self.comboBox = QtWidgets.QComboBox(Dialog) + self.comboBox.setMinimumSize(QtCore.QSize(491, 22)) + self.comboBox.setObjectName("comboBox") + self.horizontalLayout.addWidget(self.comboBox) + self.verticalLayout.addLayout(self.horizontalLayout) + self.horizontalLayout_2 = QtWidgets.QHBoxLayout() + self.horizontalLayout_2.setObjectName("horizontalLayout_2") + spacerItem = QtWidgets.QSpacerItem(158, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + self.horizontalLayout_2.addItem(spacerItem) + self.buttonBox = QtWidgets.QDialogButtonBox(Dialog) + self.buttonBox.setOrientation(QtCore.Qt.Horizontal) + self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok) + self.buttonBox.setObjectName("buttonBox") + self.horizontalLayout_2.addWidget(self.buttonBox) + spacerItem1 = QtWidgets.QSpacerItem(178, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) + self.horizontalLayout_2.addItem(spacerItem1) + self.verticalLayout.addLayout(self.horizontalLayout_2) + self.gridLayout.addLayout(self.verticalLayout, 0, 0, 1, 1) + + self.retranslateUi(Dialog) + self.buttonBox.accepted.connect(Dialog.accept) # type: ignore + self.buttonBox.rejected.connect(Dialog.reject) # type: ignore + QtCore.QMetaObject.connectSlotsByName(Dialog) + + def retranslateUi(self, Dialog): + _translate = QtCore.QCoreApplication.translate + Dialog.setWindowTitle(_translate("Dialog", "歸還")) + self.label_5.setText(_translate("Dialog", "借用事件:")) diff --git a/pyqt5/CODE/VIP_WMS_pyAPI/UI/rereturn/returnui.ui b/pyqt5/CODE/VIP_WMS_pyAPI/UI/rereturn/returnui.ui new file mode 100644 index 0000000..cdaf1fa --- /dev/null +++ b/pyqt5/CODE/VIP_WMS_pyAPI/UI/rereturn/returnui.ui @@ -0,0 +1,119 @@ + + + Dialog + + + + 0 + 0 + 599 + 85 + + + + 歸還 + + + + + + + + + + 借用事件: + + + + + + + + 491 + 22 + + + + + + + + + + + + Qt::Horizontal + + + + 158 + 20 + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + Qt::Horizontal + + + + 178 + 20 + + + + + + + + + + + + + + buttonBox + accepted() + Dialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + Dialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/pyqt5/CODE/VIP_WMS_pyAPI/VIP_WMS_api.py b/pyqt5/CODE/VIP_WMS_pyAPI/VIP_WMS_api.py new file mode 100644 index 0000000..eaa404d --- /dev/null +++ b/pyqt5/CODE/VIP_WMS_pyAPI/VIP_WMS_api.py @@ -0,0 +1,117 @@ +import json +import requests +import urllib3 +import time +from requests.structures import CaseInsensitiveDict +import base64 +import pandas as pd +from PyQt5.QtWidgets import QApplication, QWidget, QLabel, QLineEdit, QVBoxLayout, QPushButton, QMessageBox + +request_url="http://140.125.21.70:7071" + +#筆記: +#Parking_spaces_API是通訊底層,headers是令牌,fun是funtion名稱,在使用api時,Parking_spaces_API(fun,headers) +#response函式庫使用,request.get(總URL,data=要放的data) +#http://localhost:7700=>request_url 這個URL已經是固定,所以在底層時就會先寫死 +#/api/Model名稱//{id}=>fun + +#通訊底層 +class WMS_API(): + def __init__(self, Fun, headers, *args): + self.headers = headers + self.Fun = Fun + + def post(self, data): + data_json = json.dumps(data) + response = requests.post(request_url + self.Fun, data=data_json, headers=self.headers, verify=False) + return response + + def get(self): + response = requests.get(request_url + self.Fun, headers=self.headers, verify=False) + if response.status_code == 200: + data = response.json() + df = pd.DataFrame.from_records(data) + return df + else: + return + + def delete(self): + response = requests.delete(request_url + self.Fun, headers=self.headers, verify=False) + return response + + def getSingleData(self): + response = requests.get(request_url + self.Fun, headers=self.headers, verify=False) + if response.status_code == 200: + data = response.json() + df = pd.DataFrame.from_records(data, index=[0]) + return df + else: + return + +#電料類 +class Vip_api(): + def __init__(self,): + self.token=None + pass + def verify(self,username,password): + API = "/Users/Verifypassword" + data = { + 'username': username, + 'password': password + } + headers = {'Content-type': 'application/json'} + response=WMS_API(API,headers).post(data) + if response.status_code == 200: + self.token = response.json().get('token') + return True + else: + return False + def get_token(self): + return self.token + def get_all_data(self,model_name): + API = "/api/"+model_name + headers = CaseInsensitiveDict() + headers['Accept'] = 'application/json' + data = WMS_API(API, headers).get() + return data + + def createitem(self,model_name,item,account,location,itemimage): + self.token=self.get_token() + print(self.token) + API= "/api/"+model_name+"/"+item + headers = { + 'Content-type': 'application/json', + "Authorization": self.token + } + print(headers) + data = { + "item": item, + "account": account, + "location": location, + "itemimage": itemimage + } + + data=WMS_API(API,headers).post(data) + print(data.status_code) + +#登入系統JWT +# class User(): +# def __init__(self,): +# +# def verify(self,username,password): +# API = "/Users/Verifypassword" +# data = { +# 'username': username, +# 'password': password +# } +# headers = {'Content-type': 'application/json'} +# response=WMS_API(API,headers).post(data) +# if response.status_code == 200: +# self.token = response.json().get('token') +# print("Login successful. Token saved.") +# return True +# else: +# print("Login failed.") +# return False +# def get_token(self): +# return self.token diff --git a/pyqt5/CODE/VIP_WMS_pyAPI/__pycache__/VIP_WMS_api.cpython-39.pyc b/pyqt5/CODE/VIP_WMS_pyAPI/__pycache__/VIP_WMS_api.cpython-39.pyc new file mode 100644 index 0000000..0b4ab45 Binary files /dev/null and b/pyqt5/CODE/VIP_WMS_pyAPI/__pycache__/VIP_WMS_api.cpython-39.pyc differ diff --git a/pyqt5/CODE/VIP_WMS_pyAPI/__pycache__/serialportui.cpython-39.pyc b/pyqt5/CODE/VIP_WMS_pyAPI/__pycache__/serialportui.cpython-39.pyc new file mode 100644 index 0000000..81a4b29 Binary files /dev/null and b/pyqt5/CODE/VIP_WMS_pyAPI/__pycache__/serialportui.cpython-39.pyc differ diff --git a/pyqt5/CODE/VIP_WMS_pyAPI/main.py b/pyqt5/CODE/VIP_WMS_pyAPI/main.py new file mode 100644 index 0000000..33890ce --- /dev/null +++ b/pyqt5/CODE/VIP_WMS_pyAPI/main.py @@ -0,0 +1,339 @@ +from multiprocessing import Process,Queue,RLock +from UI.main.mainui import Ui_MainWindow as mainUI +from UI.items.itemsui import Ui_Form as itemsUI +from UI.history.historyui import Ui_Form as historyUI +from UI.create.createui import Ui_Dialog as createUI +from UI.login.loginui import Ui_Dialog as loginUI +from UI.delete.deleteui import Ui_Dialog as deleteUI +from UI.borrow.borrowui import Ui_Dialog as borrowUI +from UI.rereturn.returnui import Ui_Dialog as returnUI +from VIP_WMS_api import Vip_api +import sys +from PyQt5 import QtWidgets, QtGui, QtCore +import configparser +import requests +import base64 +from PyQt5.QtCore import QTimer +from PyQt5.QtGui import QImage, QPixmap +from PyQt5.QtWidgets import QApplication, QWidget, QLabel, QLineEdit, QVBoxLayout, QPushButton, QMessageBox +from datetime import datetime +import os + + +def base64_to_pixmap(base64_str): + # 解码Base64字符串为图像数据 + image_data = base64.b64decode(base64_str) + + # 创建Qt图像对象 + image = QImage.fromData(image_data) + + # 将Qt图像对象转换为QPixmap对象 + pixmap = QPixmap.fromImage(image) + return pixmap +class LoginSuccessSignal(QtCore.QObject): + signal = QtCore.pyqtSignal() +class DeleteUI(QtWidgets.QDialog,deleteUI): + def __init__(self): + super().__init__() + self.setupUi(self) + self.vip_api = Vip_api() # 创建 Vip_api 类的实例 + self.deleteUI=deleteUI() + self.setupcombobox() + self.comboBox_category.currentIndexChanged.connect(self.comboBox_category_changed) + def setupcombobox(self): + data = self.vip_api.get_all_data("Model_em") + len_item = len(data['item']) + for i in range(len_item): + item = data['item'][i] + print(item) + self.comboBox_item.addItem(item) + def comboBox_category_changed(self): + self.comboBox_item.clear() + data=None + category = self.comboBox_category.currentText() + if category == "電料類": + data = self.vip_api.get_all_data("Model_em") + if (category == "線材類"): + data = self.vip_api.get_all_data("Model_line") + if (category == "螺絲類"): + data = self.vip_api.get_all_data("Model_rose") + if (category == "相機類"): + data = self.vip_api.get_all_data("Model_camera") + + + len_item = len(data['item']) + for i in range(len_item): + item = data['item'][i] + print(item) + self.comboBox_item.addItem(item) +class LoginUI(QtWidgets.QDialog,loginUI): + def __init__(self): + super().__init__() + self.setupUi(self) + + self.vip_api = Vip_api() # 创建 Vip_api 类的实例 + self.createUI=createUI() + self.success_signal = LoginSuccessSignal() + self.btn_login.clicked.connect(self.login) + + + def clearlineEdit(self): + self.lineEdit_userid.setText("") + self.lineEdit_password.setText("") + def login(self): + username=self.lineEdit_userid.text() + password=self.lineEdit_password.text() + if self.vip_api.verify(username, password): + token = self.vip_api.token + self.save_token_to_ini(token) + print(token) + QMessageBox.information(self, '成功', '登入成功!') + self.success_signal.signal.emit() # 登录成功后发射信号 + else: + QMessageBox.warning(self, '錯誤', '帳號或密碼錯誤!') + def save_token_to_ini(self, token): + config = configparser.ConfigParser() + config['TokenSection'] = {'token': token} + with open('config.ini', 'w') as configfile: + config.write(configfile) +class CreateUI(QtWidgets.QDialog,createUI): + def __init__(self): + super().__init__() + self.setupUi(self) + self.buttonBox.accepted.connect(self.create) + self.buttonBox.rejected.connect(self.cancel) + def create(self): + category=self.comboBox_category.currentText() + item=self.textEdit_item.toPlainText() + account=self.textEdit_account.toPlainText() + location=self.textEdit_location.toPlainText() + itemimage=self.textEdit_image.toPlainText() + + if (category=="電料類"): + self.vip_api.createitem("Model_em",item,account,location,itemimage) + if (category=="線材類"): + self.vip_api.createitem("Model_line",item,account,location,itemimage) + if (category=="螺絲類"): + self.vip_api.createitem("Model_rose",item,account,location,itemimage) + if (category=="相機類"): + self.vip_api.createitem("Model_camera",item,account,location,itemimage) + def cancel(self): + print("no") +class ItemsUI(QtWidgets.QWidget, itemsUI): + def __init__(self): + super().__init__() + self.setupUi(self) + self.comboBox.currentIndexChanged.connect(self.comboBox_changed) + self.vip_api = Vip_api() # 创建 Vip_api 类的实例 + self.item_init_() + + def item_init_(self): + self.data = self.vip_api.get_all_data("Model_em") + self.item_show(self.data) + def comboBox_changed(self): + # print(self.comboBox.currentText()) + if (self.comboBox.currentText()=="電料類"): + data=self.vip_api.get_all_data("Model_em") + + if (self.comboBox.currentText()=="線材類"): + data=self.vip_api.get_all_data("Model_line") + + if (self.comboBox.currentText() == "螺絲類"): + data=self.vip_api.get_all_data("Model_rose") + + if (self.comboBox.currentText() == "相機類"): + data=self.vip_api.get_all_data("Model_camera") + + self.item_show(data) + def item_show(self,data): + # print(data) + if data.empty or data is None: + self.tableWidget.clearContents() + self.tableWidget.setRowCount(0) + + else: + len_item = len(data['item']) + self.tableWidget.setRowCount(len_item) + + for i in range(len(data['item'])): + item = self.data['item'][i] + account = str(self.data['account'][i]) + location = self.data['location'][i] + + self.tableWidget.setItem(i, 0, QtWidgets.QTableWidgetItem(item)) + self.tableWidget.setItem(i, 1, QtWidgets.QTableWidgetItem(account)) + self.tableWidget.setItem(i, 2, QtWidgets.QTableWidgetItem(location)) + + button = QtWidgets.QPushButton('Show Image', self) + button.clicked.connect(lambda checked, idx=i: self.show_image(idx)) + self.tableWidget.setCellWidget(i, 3, button) + + def show_image(self, index): + image_path = self.data['itemimage'][index] + pixmap = base64_to_pixmap(image_path) + self.label.setPixmap(pixmap) + self.label.setScaledContents(True) # 图片自适应 +class HistoryUI(QtWidgets.QWidget, historyUI): + def __init__(self): + super().__init__() + self.setupUi(self) + self.vip_api = Vip_api() # 创建 Vip_api 类的实例 + self.history_show() + def history_show(self): + data = self.vip_api.get_all_data("Model_rent") + len_borrow_date = len(data['borrow_date']) + borrow_dates_as_datetime = [datetime.strptime(date_str, '%Y-%m-%d %H:%M:%S') for date_str in data['borrow_date']] + sorted_dates = sorted(borrow_dates_as_datetime, reverse=True) + data['borrow_date'] = [date.strftime('%Y-%m-%d %H:%M:%S') for date in sorted_dates] + print(data['borrow_date']) + self.tableWidget.setRowCount(len_borrow_date) + + for i in range(len_borrow_date): + self.tableWidget.resizeColumnsToContents() + borrow_date = data['borrow_date'][i] + return_date = data['return_date'][i] + borrow_man = data['borrow_man'][i] + borrow_category = data['borrow_category'][i] + borrow_item = data['borrow_item'][i] + borrow_account = data['borrow_account'][i] + # 在相应单元格插入数据 + self.tableWidget.setItem(i, 0, QtWidgets.QTableWidgetItem(borrow_date)) + self.tableWidget.setItem(i, 1, QtWidgets.QTableWidgetItem(return_date)) + self.tableWidget.setItem(i, 2, QtWidgets.QTableWidgetItem(borrow_man)) + self.tableWidget.setItem(i, 3, QtWidgets.QTableWidgetItem(borrow_category)) + self.tableWidget.setItem(i, 4, QtWidgets.QTableWidgetItem(borrow_item)) + self.tableWidget.setItem(i, 5, QtWidgets.QTableWidgetItem(str(borrow_account))) +class BorrowUI(QtWidgets.QDialog, borrowUI): + def __init__(self): + super().__init__() + self.vip_api = Vip_api() # 创建 Vip_api 类的实例 + self.setupUi(self) + self.buttonBox.accepted.connect(self.create) + self.buttonBox.rejected.connect(self.cancel) + + def create(self): + pass + + def cancel(self): + print("no") +class ReturnUI(QtWidgets.QDialog, returnUI): + def __init__(self): + super().__init__() + self.vip_api = Vip_api() # 创建 Vip_api 类的实例 + self.setupUi(self) + self.buttonBox.accepted.connect(self.create) + self.buttonBox.rejected.connect(self.cancel) + + def create(self): + pass + def cancel(self): + print("no") +class MainWindow(QtWidgets.QMainWindow, mainUI): + def __init__(self): + super().__init__() + self.setupUi(self) + self.itemsUI= ItemsUI() + self.borrowUI=BorrowUI() + self.returnUI=ReturnUI() + + self.createUI=CreateUI() + self.loginUI=LoginUI() + self.loginUI.success_signal.signal.connect(self.close_login_ui) # 连接登录成功的信号到关闭登录视窗的槽函数 + self.deleteUI=DeleteUI() + + self.vip_api=Vip_api() + # config = configparser.ConfigParser() + self.token=self.vip_api.get_token() + print(self.token) + + self.stackedWidget.addWidget(self.itemsUI) + self.btn_items.clicked.connect(lambda: self.changeIndex(0)) + + self.btn_history.clicked.connect(lambda: self.changeIndex(1)) + self.btn_delete.clicked.connect(self.open_delete_window) + self.btn_create.clicked.connect(self.open_create_window) + self.btn_login.clicked.connect(self.open_login_window) + + self.init_ini_remove() #存在ini檔的token刪除 + + self.btn_login_flag=0 + self.timer = QTimer(self) + self.timer.timeout.connect(self.update_data) + self.timer.start(1000) # 1000 毫秒(即 1 秒) + self.op = QtWidgets.QGraphicsOpacityEffect() #創建畫布 + self.op1 = QtWidgets.QGraphicsOpacityEffect() #創建畫布 + self.op2 = QtWidgets.QGraphicsOpacityEffect() #創建畫布 + self.op.setOpacity(0) #設定畫布透明 + self.op1.setOpacity(0) #設定畫布透明 + self.btn_create.setGraphicsEffect(self.op) #創建按鈕隱藏 + self.btn_create.setEnabled(False) + self.btn_delete.setGraphicsEffect(self.op1) #刪除按鈕隱藏 + self.btn_delete.setEnabled(False) + def init_ini_remove(self): + file_path = 'config.ini' + if os.path.exists(file_path): + os.remove(file_path) + print(f"File {file_path} deleted successfully.") + else: + print(f"File {file_path} does not exist.") + # config['TokenSection'] = {'token': self.token} + # with open('config.ini', 'w') as configfile: + # config.write(configfile) + def update_data(self): + + config = configparser.ConfigParser() + config.read('config.ini') + if 'TokenSection' in config and 'token' in config['TokenSection']: + token = config['TokenSection']['token'] + print(f"从配置文件中获取的 token 为: {token}") + self.op.setOpacity(1) + self.op1.setOpacity(1) + self.op2.setOpacity(0) # 設定畫布透明 + self.btn_create.setGraphicsEffect(self.op) + self.btn_create.setEnabled(True) + self.btn_delete.setGraphicsEffect(self.op1) + self.btn_delete.setEnabled(True) + self.btn_login_flag=1 + else: + print("配置文件中未找到 token") + self.op.setOpacity(0) + self.op1.setOpacity(0) + self.btn_create.setGraphicsEffect(self.op) + self.btn_create.setEnabled(False) + self.btn_delete.setGraphicsEffect(self.op1) + self.btn_delete.setEnabled(False) + self.btn_login_flag=0 + + if self.btn_login_flag==1: #目前為登入狀態 + self.btn_login.setText("倉管登出") + self.btn_login.disconnect() # 断开之前的连接 + self.btn_login.clicked.connect(self.init_ini_remove) + else: + self.btn_login.setText("倉管登入") + self.btn_login.disconnect() # 断开之前的连接 + self.btn_login.clicked.connect(self.open_login_window) + + def open_create_window(self): + + self.createUI.show() + + def open_login_window(self): + self.loginUI.clearlineEdit() + self.loginUI.show() + def close_login_ui(self): + self.loginUI.close() + def open_delete_window(self): + self.deleteUI.show() + + def changeIndex(self,index): + print(index) + if index==1: #index==1時,歷史紀錄頁 + self.historyUI = HistoryUI() + self.stackedWidget.addWidget(self.historyUI) + self.stackedWidget.setCurrentIndex(index) + +if __name__ == "__main__": + app = QtWidgets.QApplication(sys.argv) + mainWin = MainWindow() + mainWin.show() + sys.exit(app.exec_()) \ No newline at end of file