From 6a776e92656afa651d2ef83885121c9c438c7391 Mon Sep 17 00:00:00 2001 From: yms Date: Fri, 19 Jul 2024 16:59:37 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E9=83=A8=E7=BD=B2?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitmodules | 3 ++ Dockerfile | 19 +++++++++ builder.sh | 16 ++++++++ config/nginx.conf | 41 +++++++++++++++++++ docker-compose.yml | 17 ++++++++ docker_start.sh | 9 ++++ regist-to-eureka | 1 + .../components/DatePicker/index.tsx | 2 +- src/customForm/components/Select/index.tsx | 2 +- .../components/imageUpload/index.tsx | 2 +- src/customForm/interfaces.ts | 1 - src/pages/ApplicationMaterial/attachment.tsx | 5 ++- .../ApplicationMaterial/components/card.tsx | 1 - src/pages/ApplicationMaterial/index.tsx | 2 +- src/pages/ApplicationMaterial/timeLine.tsx | 6 +-- src/pages/Login/login.tsx | 2 +- src/pages/Management/Main/itemCard.tsx | 3 +- src/pages/Setting/Flow/index.tsx | 2 +- src/pages/Setting/FormMatch/complex-table.tsx | 2 +- src/pages/Setting/FormMatch/index.tsx | 2 - src/pages/User/Main/subExtend.tsx | 2 +- src/pages/User/ReviewProcess/index.tsx | 2 +- .../User/ReviewProcess/progress-item.tsx | 2 +- 23 files changed, 123 insertions(+), 21 deletions(-) create mode 100644 .gitmodules create mode 100644 Dockerfile create mode 100755 builder.sh create mode 100644 config/nginx.conf create mode 100644 docker-compose.yml create mode 100644 docker_start.sh create mode 160000 regist-to-eureka diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..ad6daf3 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "regist-to-eureka"] + path = regist-to-eureka + url = ssh://git@171.217.92.33:2224/qc/regist-to-eureka.git diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..99c1457 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM nginx:1.23.1 + +WORKDIR /usr/src/app/ + +COPY ./config/nginx.conf /etc/nginx/conf.d/default.conf + +COPY ./dist /usr/share/nginx/html/ + +COPY ./docker_start.sh /usr/bin/docker_start.sh + +COPY ./regist-to-eureka /opt/regist-to-eureka + +EXPOSE 80 + +RUN chmod +x /usr/bin/docker_start.sh && \ + chmod +x /opt/regist-to-eureka/*.sh && \ + cp /opt/regist-to-eureka/*.sh /usr/bin + +CMD ["docker_start.sh"] diff --git a/builder.sh b/builder.sh new file mode 100755 index 0000000..8dfd432 --- /dev/null +++ b/builder.sh @@ -0,0 +1,16 @@ +#!/bin/bash +git checkout $gitTag + +repo=registry.hncy.info/hncy/approval-pass-web +tag=${1:-$gitTag} +echo $tag +git submodule update --init --recursive +if [ ! -f regist-to-eureka/reg2eureka.sh ]; then + exit 1 +fi +rm -rf dist +pnpm i +pnpm run build +docker buildx use desktop-linux +docker buildx build --platform linux/amd64 -t $repo:$tag . --push + diff --git a/config/nginx.conf b/config/nginx.conf new file mode 100644 index 0000000..de0f94f --- /dev/null +++ b/config/nginx.conf @@ -0,0 +1,41 @@ + server { + listen 80; + fastcgi_buffers 8 256k; + send_timeout 60; + gzip on; + gzip_min_length 1k; + gzip_comp_level 9; + gzip_types text/plain text/css text/javascript application/json application/javascript application/x-javascript application/xml; + gzip_vary on; + gzip_disable "MSIE [1-6]\."; + # 本地测试 + # root html/dist; + # 生产 + root /usr/share/nginx/html; + + location = /favicon.ico { + allow all; + } + + location / { + try_files $uri $uri/ /index.html; + } + + location /apis { + rewrite ^/apis/(.*)$ /$1 break; + add_header Access-Control-Allow-Origin *; + add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS'; + add_header Access-Control-Allow-Headers 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization'; + proxy_pass http://PROXY_WEB_SERVICE; + proxy_redirect default; + } + + location /login { + rewrite ^/login/(.*)$ /$1 break; + add_header Access-Control-Allow-Origin *; + add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS'; + add_header Access-Control-Allow-Headers 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization'; + proxy_pass http://PROXY_LOGIN_SERVICE; + proxy_redirect default; + } +} diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..a365bbd --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,17 @@ +approval-pass-web: + image: registry.hncy.info/hncy/youPorjectName:1.0.0 + container_name: "youPorjectName" + ports: + - 3688:80 + network_mode: "bridge" + environment: + - TZ=Asia/Shanghai + - PROXY_WEB_SERVICE=192.168.2.21:8000 + - PROXY_LOGIN_SERVICE=192.168.2.21:21590 + - SERVICE_NAME=approval-pass-web + - CROSS_HEADER=true + - EXTERNAL_HOST=${STAGE_WEBAPPS_IP} + - EXTERNAL_PORT=53102 + - EUREKA_SERVER=${STAGE_WEBAPPS_IP}:7777 +# eureka 仓库地址 +# git submodule add ssh://git@171.217.92.33:2224/qc/regist-to-eureka.git diff --git a/docker_start.sh b/docker_start.sh new file mode 100644 index 0000000..88bf20e --- /dev/null +++ b/docker_start.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +source utils.sh + +replace $NGINX_DEFAULT_CONFIG PROXY_ +# replace "umi.*.js" WS_SERVER_URL /usr/share/nginx/html + +bash -c "/usr/bin/reg2eureka.sh &" +nginx -g 'daemon off;' diff --git a/regist-to-eureka b/regist-to-eureka new file mode 160000 index 0000000..18d1101 --- /dev/null +++ b/regist-to-eureka @@ -0,0 +1 @@ +Subproject commit 18d1101b4fe5259dad814f28865c1b4c27f1fd5a diff --git a/src/customForm/components/DatePicker/index.tsx b/src/customForm/components/DatePicker/index.tsx index 0efc7d3..de05d6e 100644 --- a/src/customForm/components/DatePicker/index.tsx +++ b/src/customForm/components/DatePicker/index.tsx @@ -1,4 +1,4 @@ -import { DatePicker, Radio } from "antd"; +import { DatePicker } from "antd"; import React from "react"; interface HnDatePickerProps { diff --git a/src/customForm/components/Select/index.tsx b/src/customForm/components/Select/index.tsx index af76974..ff0db41 100644 --- a/src/customForm/components/Select/index.tsx +++ b/src/customForm/components/Select/index.tsx @@ -1,5 +1,5 @@ import { Select } from "antd"; -import { useEffect, useMemo } from "react"; +import { useMemo } from "react"; interface HnSelectProps { value?: any; diff --git a/src/customForm/components/imageUpload/index.tsx b/src/customForm/components/imageUpload/index.tsx index d79a49b..b9367ec 100644 --- a/src/customForm/components/imageUpload/index.tsx +++ b/src/customForm/components/imageUpload/index.tsx @@ -21,7 +21,7 @@ const getBase64 = (file: FileType): Promise => }); const ImageUpload: React.FC = (props) => { - const { placeholder, value, onChange } = props; + const { value, onChange } = props; const [previewOpen, setPreviewOpen] = useState(false); const [previewImage, setPreviewImage] = useState(""); diff --git a/src/customForm/interfaces.ts b/src/customForm/interfaces.ts index 03c7cc5..f878bc4 100644 --- a/src/customForm/interfaces.ts +++ b/src/customForm/interfaces.ts @@ -1,4 +1,3 @@ -import { Components } from "@/customForm/registry"; import BaseFormComponent, { BaseConfig } from "./entity/base"; /** diff --git a/src/pages/ApplicationMaterial/attachment.tsx b/src/pages/ApplicationMaterial/attachment.tsx index 23bf52a..f02df18 100644 --- a/src/pages/ApplicationMaterial/attachment.tsx +++ b/src/pages/ApplicationMaterial/attachment.tsx @@ -1,5 +1,5 @@ -import { Button, Empty, Flex, Image, Space } from "antd"; -import uploadSuccessIcon from "@/assets/images/form/dui.png"; +import { Empty, Flex, Image } from "antd"; + import styles from "./attachment.module.css"; import classNames from "classnames"; import { useMemo } from "react"; @@ -92,6 +92,7 @@ const Attachment = (props: AttachmentProps) => { const reportContents = data?.reportContents ?? []; return reportContents.find((v: any) => v.contentId === key)?.content; }; + return (
{hasAttachmentConfig.length === 0 && } diff --git a/src/pages/ApplicationMaterial/components/card.tsx b/src/pages/ApplicationMaterial/components/card.tsx index 46ff4e4..797b42f 100644 --- a/src/pages/ApplicationMaterial/components/card.tsx +++ b/src/pages/ApplicationMaterial/components/card.tsx @@ -1,6 +1,5 @@ import React, { PropsWithChildren } from "react"; import styles from "./card.module.css"; -import { VerticalAlignBottomOutlined } from "@ant-design/icons"; interface CardProps { title: string; diff --git a/src/pages/ApplicationMaterial/index.tsx b/src/pages/ApplicationMaterial/index.tsx index 7ee4de4..ccbc35d 100644 --- a/src/pages/ApplicationMaterial/index.tsx +++ b/src/pages/ApplicationMaterial/index.tsx @@ -1,5 +1,5 @@ import BasicModal from "@/components/BasicModal"; -import React, { useEffect, useMemo, useState } from "react"; +import React, { useEffect, useState } from "react"; import styles from "./index.module.css"; import wodeshengqing from "@/assets/images/applyRecord/wodeshengqing.png"; import { Button, Flex, Space, message } from "antd"; diff --git a/src/pages/ApplicationMaterial/timeLine.tsx b/src/pages/ApplicationMaterial/timeLine.tsx index 487b30e..bd2252b 100644 --- a/src/pages/ApplicationMaterial/timeLine.tsx +++ b/src/pages/ApplicationMaterial/timeLine.tsx @@ -1,4 +1,4 @@ -import { Button, Flex, Timeline, Image } from "antd"; +import { Flex, Timeline, Image } from "antd"; import DecoratePoint from "./components/decoratePoint"; import styles from "./timeLine.module.css"; import service from "@/service"; @@ -28,7 +28,7 @@ const ProcessTimeLine = (props: ProcessTimeLineProps) => { }; const items = useMemo(() => { - return dataSource.map((v, i) => { + return dataSource.map((v) => { let status = false; if (v.current) { @@ -61,7 +61,7 @@ const ProcessTimeLine = (props: ProcessTimeLineProps) => { >
{v.approveComment}
- {attachments?.map((attachment: any, i: number) => { + {attachments?.map((attachment: any) => { let fileType = "none"; if (attachment && attachment.length > 0) { const extra = attachment.split(".")[1]; diff --git a/src/pages/Login/login.tsx b/src/pages/Login/login.tsx index 6b97425..59999f5 100644 --- a/src/pages/Login/login.tsx +++ b/src/pages/Login/login.tsx @@ -20,7 +20,7 @@ import { useBoolean } from "ahooks"; import service from "@/service"; import useUserStore from "@/store/useUserStore"; import { useEffect, useState } from "react"; -import { DownOutlined, LogoutOutlined, SmileOutlined } from "@ant-design/icons"; +import { LogoutOutlined } from "@ant-design/icons"; const Login: React.FC = () => { const [visible, { setFalse, setTrue }] = useBoolean(false); diff --git a/src/pages/Management/Main/itemCard.tsx b/src/pages/Management/Main/itemCard.tsx index 9b2fe93..431eb1f 100644 --- a/src/pages/Management/Main/itemCard.tsx +++ b/src/pages/Management/Main/itemCard.tsx @@ -1,9 +1,8 @@ import { Flex, Space } from "antd"; import styles from "./itemCard.module.css"; import icon from "@/assets/images/icon/icon1.png"; -import { useNavigate, useNavigation } from "react-router-dom"; +import { useNavigate } from "react-router-dom"; import ArrowTag from "@/components/ArrowTag"; -import useUserStore from "@/store/useUserStore"; const ItemCard: React.FC<{ data: any }> = (props) => { const { data } = props; diff --git a/src/pages/Setting/Flow/index.tsx b/src/pages/Setting/Flow/index.tsx index 96679fa..c74d549 100644 --- a/src/pages/Setting/Flow/index.tsx +++ b/src/pages/Setting/Flow/index.tsx @@ -1,4 +1,4 @@ -import { Button, Empty, Modal, Popover, message, notification } from "antd"; +import { Button, Empty, Modal, Popover, notification } from "antd"; import styles from "./index.module.css"; import plus from "@/assets/images/setting/plus.png"; import { CloseOutlined, RightOutlined } from "@ant-design/icons"; diff --git a/src/pages/Setting/FormMatch/complex-table.tsx b/src/pages/Setting/FormMatch/complex-table.tsx index db14c08..43e75f1 100644 --- a/src/pages/Setting/FormMatch/complex-table.tsx +++ b/src/pages/Setting/FormMatch/complex-table.tsx @@ -160,7 +160,7 @@ const ComplexTable = ({ onClickRow, activeRow }: ComplexTableProps) => { // return "无"; // }, - render(value, record) { + render(_, record) { if (record.componentType === "Branch") { return ( ) => { const FormMatch = () => { /** 当前选中/操作的对象 */ const [selectRow, setSelectRow] = useState(); - /** 需要删除的对象 */ - const [deleteList, setDeleteList] = useState(); /** 当前操作的对象 */ const actionObjMetadata = useMemo( diff --git a/src/pages/User/Main/subExtend.tsx b/src/pages/User/Main/subExtend.tsx index 773ae85..3a93450 100644 --- a/src/pages/User/Main/subExtend.tsx +++ b/src/pages/User/Main/subExtend.tsx @@ -1,4 +1,4 @@ -import { Button, Flex, Space } from "antd"; +import { Button, Flex } from "antd"; import { useEffect, useState } from "react"; import BasicModal from "@/components/BasicModal"; diff --git a/src/pages/User/ReviewProcess/index.tsx b/src/pages/User/ReviewProcess/index.tsx index 113ec80..94601fa 100644 --- a/src/pages/User/ReviewProcess/index.tsx +++ b/src/pages/User/ReviewProcess/index.tsx @@ -75,7 +75,7 @@ const ReviewProcess = () => {
我的申请
- {progressRecord?.map((v, i) => { + {progressRecord?.map((v) => { return (