no message

dev
853931625@qq.com 2025-12-06 16:16:21 +08:00
parent 97e6788347
commit e03fb16dc7
10 changed files with 162 additions and 39 deletions

View File

@ -49,7 +49,7 @@ module.exports = {
// 开发服务
server: {
// 监听端口号
port: "8080",
port: "8088",
// 服务地址
host: "127.0.0.1",
// 是否自动打开浏览器

View File

@ -44,11 +44,11 @@
<script src="<%= item %>" type="text/javascript"></script>
<% } %>
</head>
<body>
<!-- NOSCRIPT -->
<noscript>此网页需要开启JavaScript功能。</noscript>
<!-- MAIN -->
<% const { root } = $element; %>
<div id="<%= root.id %>" style="width: 100%; height: 100%; position: relative;overflow-y: auto"></div>
<body >
<!-- NOSCRIPT -->
<noscript>此网页需要开启JavaScript功能。</noscript>
<!-- MAIN -->
<% const { root } = $element; %>
<div id="<%= root.id %>" style="width: 100%; height: 100%; position: relative;overflow-y: auto"></div>
</body>
</html>

View File

@ -0,0 +1,6 @@
import { declareRequest } from "@cqsjjb/jjb-dva-runtime";
export const identifyPartList = declareRequest(
"coursewareLoading",
"Post > @/risk/busIdentifyPart/list",
);

62
src/assets/css/common.css Normal file
View File

@ -0,0 +1,62 @@
/* 打印时:隐藏所有内容 */
@media print {
body * {
visibility: hidden;
}
/* 只显示要打印的 div 及其子元素 */
#print-invoice,
#print-invoice * {
visibility: visible;
}
#print-invoice {
position: absolute;
left: 0;
top: 0;
width: 100%;
padding: 1cm;
box-sizing: border-box;
font-size: 12pt;
font-family: 'SimSun', '宋体', serif;
}
/* 隐藏弹窗中的操作按钮(双重保险) */
.no-print {
display: none !important;
}
}
/* 屏幕上正常显示 */
@media screen {
.modal-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
display: flex;
justify-content: center;
align-items: center;
z-index: 1000;
}
.modal-content {
background: white;
padding: 20px;
border-radius: 8px;
width: 80%;
max-width: 600px;
}
.modal-actions {
margin-top: 20px;
text-align: right;
}
.modal-actions button {
margin-left: 10px;
padding: 8px 16px;
}
}

24
src/components/useImportFile/index.d.ts vendored Normal file
View File

@ -0,0 +1,24 @@
export interface UploadFile {
/** 原始文件对象 */
originFileObj?: File;
[key: string]: any;
}
interface UseImportFileOptions {
/** 要上传的文件数组 */
files: UploadFile[];
/** 额外携带的参数对象 */
params?: Record<string, any>;
}
export interface ImportFileOptions {
url: string;
options: UseImportFileOptions;
}
export type ImportFileFunction = (url: string, options: UseImportFileOptions) => Promise<any>;
/**
*
*/
export default function useImportFile(): [boolean, ImportFileFunction];

View File

@ -0,0 +1,44 @@
import {request} from "@cqsjjb/jjb-common-lib/http";
import { useState } from "react";
/**
* 导入文件
*/
export default function useImportFile() {
// loading状态
const [loading, setLoading] = useState(false);
// 导入文件
const importFile = (url, options) => {
setLoading(true);
return new Promise((resolve, reject) => {
const { files = [], params = {} } = options
const formData = new FormData();
// 将文件添加到formData中
files.forEach((f) => {
f.originFileObj && formData.append("file", f.originFileObj);
});
// 将额外携带的参数添加到formData中
Object.keys(params).forEach((key) => {
formData.append(key, params[key]);
});
// 发送请求
request(url, "post", formData, { "Content-Type": "multipart/form-data" })
.then((res) => {
resolve(res);
})
.catch((err) => {
reject(err);
})
.finally(() => {
setLoading(false);
});
});
};
return [loading, importFile];
}

View File

@ -1,17 +1,15 @@
import { setJJBCommonAntdMessage } from "@cqsjjb/jjb-common-lib";
import { setup } from "@cqsjjb/jjb-dva-runtime";
import { message } from "antd";
import dayjs from "dayjs";
import "dayjs/locale/zh-cn";
import "../blessed_by_buddha";
require("antd/dist/reset.css");
dayjs.locale("zh-cn");
setJJBCommonAntdMessage(message);
const app = setup();
// 非底座环境运行

View File

@ -141,15 +141,12 @@ function CorpInfo(props) {
data.license = [data.licenseStart, data.licenseEnd];
data.scaleType = data.scaleType ?? 0;
// 判断是否所有必填字段都有值(基于原始 data + licenseFile
const hasLicenseFile = Array.isArray(licenseFile) && licenseFile.length > 0;
const allRequiredFilled = REQUIRED_FIELDS.every((field) => {
const val = data[field];
return val != null && val !== "" && !(typeof val === "number");
});
// 最终条件:字段都填了 + 营业执照文件存在
setCanShowQrCode(allRequiredFilled && hasLicenseFile);
const values = {

View File

@ -1,6 +1,5 @@
import { ImportCore } from "@cqsjjb/jjb-common-decorator/module";
import { theme as antdTheme, App, ConfigProvider } from "antd";
import language from "antd/locale/zh_CN";
import React from "react";
@ -14,7 +13,10 @@ export default class Container extends React.Component {
};
get token() {
const { colorPrimary, borderRadius } = this.state;
const {
colorPrimary,
borderRadius,
} = this.state;
return {
fontFamily: window.process.env.app.antd.fontFamily,
colorPrimary,
@ -31,9 +33,7 @@ export default class Container extends React.Component {
// eslint-disable-next-line react-web-api/no-leaked-event-listener
window.base.addEventListener("EVENT_THEME_CONTROL", (e) => {
const config = e.data;
this.setState({
[config.field]: config.value,
});
this.setState({ [config.field]: config.value });
});
}
}
@ -48,26 +48,28 @@ export default class Container extends React.Component {
locale={language}
prefixCls={window.process.env.app.antd["ant-prefix"]}
>
<App
style={{
height: "100%",
}}
>
<App style={{ height: "100%" }}>
<AppMiddle {...this.props} />
</App>
</ConfigProvider>
);
}
}
function AppMiddle(props) {
return (
<InjectContext.Provider value={App.useApp()}>
{process.env.NODE_ENV === "development"
? props.children
: <Interceptor>{props.children}</Interceptor>}
: (
<Interceptor>
{props.children}
</Interceptor>
)}
</InjectContext.Provider>
);
}
class Interceptor extends React.Component {
state = {
Component: undefined,
@ -80,9 +82,7 @@ class Interceptor extends React.Component {
from: "https://cdn.cqjjb.cn/jcloud/use/plugin/b31c9840a57f11ef91cf7f3cabbb7484/latest",
}).then(async (res) => {
if (res.status) {
this.setState({
Component: res.module?.PageCover,
});
this.setState({ Component: res.module?.PageCover });
}
});
}
@ -90,11 +90,7 @@ class Interceptor extends React.Component {
render() {
const { Component } = this.state;
return (
Component
&& process.env.app.appKey
&& process.env.NODE_ENV === "development"
)
return (Component && process.env.app.appKey && process.env.NODE_ENV === "development")
? (
<Component appKey={process.env.app.appKey}>
{this.props.children}

View File

@ -1,14 +1,10 @@
export default function () {
return (
<h1>
底座微应用模板技术文档
<a
rel="noreferrer noopener"
href="https://www.yuque.com/buhangjiecheshen-ymbtb/qc0093/gxdun1dphetcurko"
target="_blank"
>
https://www.yuque.com/buhangjiecheshen-ymbtb/qc0093/gxdun1dphetcurko
</a>
<a rel="noreferrer noopener" target="_blank" href="https://www.yuque.com/buhangjiecheshen-ymbtb/qc0093/gxdun1dphetcurko">https://www.yuque.com/buhangjiecheshen-ymbtb/qc0093/gxdun1dphetcurko</a>
</h1>
);
}