Commit 81b8fe3f authored by 涂伟's avatar 涂伟
parents 9e2a74f0 dd5d0d74
Pipeline #93550 passed with stages
......@@ -129,7 +129,7 @@
"jszip": "^3.10.1",
"lodash": "4.17.11",
"minimist": "1.2.0",
"panda-xform": "6.10.17",
"panda-xform": "6.10.23",
"parseForm": "^2.3.8",
"prop-types": "15.7.2",
"qrcode.react": "^3.1.0",
......
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>APK下载</title>
<style>
body {
font-family: "Roboto", sans-serif;
margin: 0;
padding: 20px;
background-color: #f4f4f4;
color: #333;
}
.container {
max-width: 600px;
margin: auto;
background: white;
padding: 20px;
border-radius: 10px;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}
.header {
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 20px;
}
.app-icon {
width: 40px; /* 图标大小 */
border: 2px solid #007bff;
border-radius: 10px;
padding: 5px;
background-color: white;
margin-right: 20px; /* 图标和标题之间的间距 */
}
h1 {
color: #007bff;
font-size: 2em;
margin: 0;
}
.download, .version-info, .history {
margin-bottom: 20px;
padding: 15px;
border-radius: 8px;
background-color: #e9ecef;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
.download a {
display: block;
padding: 15px;
background: #007bff;
color: white;
text-align: center;
border-radius: 5px;
text-decoration: none;
transition: background 0.3s;
}
.download a:hover {
background: #0056b3;
}
.history {
max-height: 200px; /* 设置最大高度 */
overflow-y: auto; /* 启用垂直滚动条 */
}
.history-item {
margin: 10px 0;
padding: 10px;
border: 1px solid #ccc;
border-radius: 5px;
background-color: #ffffff;
position: relative;
}
.toggle-button {
margin-left: 10px;
color: #007bff;
cursor: pointer;
font-size: 14px;
text-decoration: underline;
}
.history-details {
display: none;
margin-top: 10px;
padding: 10px;
border: 1px solid #ddd;
border-radius: 5px;
background: #f9f9f9;
}
.history-button {
display: inline-block;
padding: 10px 15px;
background: #007bff;
color: white;
border-radius: 5px;
text-decoration: none;
transition: background 0.3s;
margin-top: 10px;
}
.history-button:hover {
background: #0056b3;
}
.empty-message {
color: #888;
text-align: center;
font-size: 1.2em;
}
ul {
list-style: none; /* 去掉项目符号 */
padding: 0; /* 去掉内边距 */
margin: 0; /* 去掉外边距 */
}
</style>
<script>
function toggleDetails(version) {
const details = document.getElementById("details-" + version);
details.style.display = details.style.display === "block" ? "none" : "block";
}
function generateHistory(versions) {
const historyContainer = document.getElementById("historyList");
const currentVerContainer = document.getElementById("currentVerList");
const bodyContent = document.getElementById("content");
if (versions.length === 0) {
bodyContent.style.display = "none";
const emptyMessage = document.createElement("div");
emptyMessage.className = "empty-message";
emptyMessage.textContent = "没有APP上传数据";
const content = document.getElementById("empty");
content.appendChild(emptyMessage);
return;
}
versions.forEach((v, i) => {
if (i > 0) {
// 历史版本
const item = document.createElement("li");
item.className = "history-item";
const downloadButton = document.createElement("a");
downloadButton.className = "history-button";
downloadButton.href = v.downloadLink;
downloadButton.download = true;
downloadButton.textContent = `点击下载 ${v.version}`;
const toggleButton = document.createElement("span");
toggleButton.className = "toggle-button";
toggleButton.onclick = () => toggleDetails(i);
toggleButton.textContent = "查看说明";
const detailsDiv = document.createElement("div");
detailsDiv.className = "history-details";
detailsDiv.id = "details-" + i;
detailsDiv.innerHTML = `<p>版本: ${v.version}</p>
<p>更新内容: </p><ul>${v.details.map(item => `<li>${item}</li>`).join("")}</ul><p>发版时间: ${v.date} </p>`;
item.appendChild(downloadButton);
item.appendChild(toggleButton);
item.appendChild(detailsDiv);
historyContainer.appendChild(item);
} else {
// 最新版本
document.getElementById("downNewApp").setAttribute("href", v.downloadLink);
const h2 = document.querySelector(".version-info h2");
h2.innerHTML += " " + v.version;
document.getElementById("verTime").innerHTML = `发版时间:${v.date}`;
const detailsDiv = document.createElement("ul");
detailsDiv.innerHTML = `${v.details.filter(x => x).map(item => `<li>${item}</li>`).join("")}`;
currentVerContainer.appendChild(detailsDiv);
}
});
}
window.onload = async () => {
let versions = [];
try {
const response = await fetch(`${window.origin}/PandaOMS/OMS/Mobile/GetAppUploadRecords`);
const resJson = await response.json();
if (resJson.code === 0) {
const records = resJson.data || [];
if (records.length > 0) {
records.forEach(v => {
versions.push({
version: v.Ver,
date: v.UploadTime,
downloadLink: `${window.origin}${v.DownUrl}`,
details: v.UploadLog.split("\n"),
});
});
}
}
} catch (e) {
console.log(e, "请求失败");
}
generateHistory(versions);
};
</script>
</head>
<body>
<div class="container">
<div class="header">
<img src="panda_logo.png" alt="App Icon" class="app-icon" />
<h1>APK下载页</h1>
</div>
<div id="content">
<div class="download">
<h2>最新版本</h2>
<a id="downNewApp">点击下载最新版本</a>
</div>
<div class="version-info">
<h2>版本说明</h2>
<p>本次版本更新了以下内容:</p>
<div id="currentVerList"></div>
<p id="verTime"></p>
</div>
<div class="history">
<h2>历史版本</h2>
<ul id="historyList"></ul>
</div>
</div>
<div id="empty"></div>
</div>
</body>
</html>
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="JSON" path="*.json" verb="GET,POST" modules="IsapiModule" scriptProcessor="C:\Windows\System32\inetsrv\asp.dll" resourceType="File" preCondition="bitness64" />
</handlers>
</system.webServer>
</configuration>
This diff was suppressed by a .gitattributes entry.
......@@ -97,45 +97,6 @@ const FlowChart = props => {
init();
initPalette();
myOverview = objGo(go.Overview, 'myOverviewDiv', { observed: diagram });
// 监听节点或线的删除事件
// diagram.addDiagramListener('SelectionDeleted', e => {
// let delNodes = [];
// let delLinks = [];
// e.subject.each(n => {
// if (n.data.LineId) {
// delLinks.push(n.data.LineId);
// }
// if (n.data.ActivityId) {
// delNodes.push(n.data.ActivityId);
// }
// // 如果删除得节点不是新增得就给id放入到删除节点数组中
// if (n.data.NodeId && !AddNodes.some(item => item === n.data.NodeId)) {
// setTimeout(() => {
// setDeleteNode(n.data.NodeId);
// }, 0);
// }
// if (n.data.LineKey) {
// setTimeout(() => {
// setDeleteLine(n.data.LineId);
// }, 0);
// }
// });
// if (delNodes.length === 0) {
// return;
// }
// DeleteFlowNodes({ ActivityIds: delNodes, LineIds: delLinks }).then(res => {
// if (res.code === 0) {
// message.success('删除成功');
// } else {
// // message.error(res.msg);
// message.error({
// content: <div style={{ whiteSpace: 'pre-line', textAlign: 'justify' }}>{res.msg}</div>,
// });
// }
// });
// console.log(delNodes, delLinks, 'fffff');
// });
// 监听节点或线的删除前事件
diagram.commandHandler.canDeleteSelection = () => {
let delNodes = new Set();
......@@ -155,6 +116,7 @@ const FlowChart = props => {
delLinks.add(item.data.LineId);
}
});
console.log('delNodes', delNodes)
if (delNodes.size === 0) {
delNode([...delNodeIds], [...delNodes], [...delLinks]);
} else {
......@@ -370,15 +332,15 @@ const FlowChart = props => {
okText: '是',
okType: 'primary',
cancelText: '否',
onOk() {
CloseDoingFlowNodes({ activityIds: [...delNodes] }).then(res => {
if (res.code === 0) {
delNode(delNodeIds, delNodes, delLinks);
} else {
message.error(res.msg);
}
});
delNode(delNodeIds, delNodes, delLinks);
// CloseDoingFlowNodes({ activityIds: [...delNodes] }).then(res => {
// if (res.code === 0) {
// delNode(delNodeIds, delNodes, delLinks);
// } else {
// message.error(res.msg);
// }
// });
},
onCancel() { },
});
......@@ -408,20 +370,23 @@ const FlowChart = props => {
diagram.commandHandler.deleteSelection();
return;
}
DeleteFlowNodes({ ActivityIds: delNodes, LineIds: delLinks }).then(res => {
if (res.code === 0) {
diagram.commandHandler.deleteSelection();
diagram.commandHandler.deleteSelection()
setDeleteNode(delNodeIds);
setDeleteLine(delLinks);
// DeleteFlowNodes({ ActivityIds: delNodes, LineIds: delLinks }).then(res => {
// if (res.code === 0) {
// diagram.commandHandler.deleteSelection();
setDeleteNode(delNodeIds);
setDeleteLine(delLinks);
message.success('删除成功');
} else {
// message.error(res.msg);
message.error({
content: <div style={{ whiteSpace: 'pre-line', textAlign: 'justify' }}>{res.msg}</div>,
});
}
});
// setDeleteNode(delNodeIds);
// setDeleteLine(delLinks);
// message.success('删除成功');
// } else {
// // message.error(res.msg);
// message.error({
// content: <div style={{ whiteSpace: 'pre-line', textAlign: 'justify' }}>{res.msg}</div>,
// });
// }
// });
};
const animateFadeDown = e => {
......@@ -1371,7 +1336,7 @@ const FlowChart = props => {
});
SaveNodeChange({
FlowId: flowID,
// DeleteNodes,
DeleteNodes,
CreateUser: sessionStorage.getItem('userName'),
PreviewImage: val.data,
DeleteLines,
......
......@@ -4,6 +4,7 @@ import ProCard from '@ant-design/pro-card';
import PageContainer from '@/components/BasePageContainer';
import SevenParams from './menuconfig/SevenParams';
import VersionPublish from './menuconfig/VersionPublish';
import ApkUpload from './menuconfig/ApkUpload';
import WorkDesign from './menuconfig/WorkDesign';
import { getMiniAppModuleTree, deleteWebsite, deleteMiniMenu } from '@/services/mobileConfig/api';
import { ExclamationCircleOutlined } from '@ant-design/icons';
......@@ -200,6 +201,11 @@ const MobileConfigPage = props => {
{activeKey === tabArr[4].key && tabArr[4].component}
</TabPane>
)}
{showConfig && subType !== 'add' && (
<TabPane tab={tabArr[5].title} key={tabArr[5].key}>
{activeKey === tabArr[5].key && tabArr[5].component}
</TabPane>
)}
</Tabs>
{/* </Spin> */}
</Card>
......@@ -245,6 +251,11 @@ const MobileConfigPage = props => {
key: '4',
component: <WorkDesign />,
},
{
title: 'APP发版',
key: '5',
component: <ApkUpload />,
},
];
return (
<PageContainer>
......
import React, { useEffect, useMemo, useState } from 'react';
import styles from './index.less';
import { Form, Table , Input, message, Button, Upload, Tooltip } from 'antd';
import { getAppUploadRecords, postAppVersionInfo } from '@/services/mobileConfig/api';
import { UploadOutlined } from '@ant-design/icons';
import { request } from '@wisdom-utils/utils/es';
const ApkUpload = props => {
const [loadding, setLoadding] = useState(false);
const [dataSource, setDataSource] = useState([]);
const { TextArea } = Input;
const tailLayout = {
wrapperCol: { offset: 6, span: 12 },
};
const layout = {
labelCol: {
span: 6,
},
wrapperCol: {
span: 12,
},
};
const columns = [
{
title: '版本号',
dataIndex: 'Ver',
key: 'Ver',
},
{
title: '上传时间',
dataIndex: 'UploadTime',
key: 'UploadTime',
},
{
title: '发版日志',
dataIndex: 'UploadLog',
key: 'UploadLog',
render: (text, recore, index) =>
<Tooltip title= {text}>
<div style={{
width: '150px',
whiteSpace: 'nowrap', /* 不换行 */
overflow: 'hidden', /* 超出部分隐藏 */
textOverflow: 'ellipsis' /* 显示省略号 */
}}>
{text}
</div>
</Tooltip>
},
{
title: '下载',
key: 'DownUrl',
dataIndex: 'DownUrl',
render: (text, record, index) => <UploadOutlined onClick={()=> window.open(`${window.origin}${text}`, '_self') }/>
},
];
const [form] = Form.useForm();
useEffect(()=>{
getRecords();
//getAppUploadRecords().then(x=> console.log(x, '上传记录'))
}, [])
const normFile = e => {
if (Array.isArray(e)) {
return e;
}
return e?.fileList;
};
const getRecords = async () => {
const res = await getAppUploadRecords();
if(res.code === 0){
setDataSource(res.data || []);
}
}
const postAPPUploadInfo = async () => {
await form.validateFields();
const formData = form.getFieldsValue();
if (!formData.DownUrl) {
message.error('请上传app');
return;
}
setLoadding(true);
postAppVersionInfo(formData).then(res=> {
if(res.code === 0){
message.success('新版本提交成功!');
getRecords();
form.resetFields()
}else{
message.error(res.msg)
}
}).catch(err=>{
console.log(err, '提交失败')
});
setLoadding(false);
};
return (
<div style={{
display: 'flex',
width: '100%'
}}>
<Form
style={{
width: '50%'
}}
{...layout}
initialValues={{
DownUrl: '',
ApkName: '水务掌天下'
}}
form={form}
name="control-hooks"
onFinish={valus => console.log(valus, '表单完成信息')}
>
<Form.Item name="ApkName" label="应用名称" rules={[{ required: true }]}>
<Input placeholder="请输入应用名称" />
</Form.Item>
<Form.Item name="Ver" label="发布版本号" rules={[{ required: true }]}>
<Input placeholder="请输入发布版本号" />
</Form.Item>
<Form.Item name="UploadLog" label="发版说明" rules={[{ required: true }]}>
<TextArea rows={6} placeholder="请输入发版说明" />
</Form.Item>
<Form.Item name="DownUrl" style={{ display: 'none' }} />
<Form.Item
name="UploadFile"
label="上传APK"
rules={[{ required: true }]}
valuePropName="fileList"
getValueFromEvent={normFile}
>
<Upload
maxCount={1}
onChange={baseFile => {
const file = baseFile.file;
let sourcePath = '';
if (file.status === 'done' && file.response.code === 0) {
sourcePath = `/PandaOMS/OMS/FileCenter/DownLoadFiles?filepath=${file.response.data}`;
message.success('上传成功!');
} else if (file.status === 'done' && file.response.code !== 0) {
message.error('上传失败:' + file.response.msg);
}
form.setFieldsValue({
DownUrl: sourcePath,
});
console.log(file, '上传图片');
}}
name="file"
a
action={`${window.origin}/PandaOMS/OMS/FileCenter/UploadApk`}
accept=".apk"
>
<Button icon={<UploadOutlined />}>上传APK</Button>
</Upload>
</Form.Item>
<Form.Item {...tailLayout}>
<Button
loading={loadding}
type="primary"
onClick={() => {
console.log(form.getFieldsValue(), '表单完成信息');
postAPPUploadInfo();
}}
>
提交
</Button>
</Form.Item>
</Form>
<Table
style={{
width: '50%'
}}
columns={columns}
pagination={{
pageSize: 10
}}
dataSource={dataSource}
/>
</div>
);
};
export default ApkUpload;
......@@ -120,3 +120,7 @@ export const getCardVersion = parmas => get(`${PUBLISH_SERVICE}/WebSite/AppWorkS
//更新版本
export const upgradeCardVersion = parmas => post(`${PUBLISH_SERVICE}/WebSite/AppWorkSpace_UpgradeCardVersion`, parmas);
export const postAppVersionInfo = parmas => post(`${PUBLISH_SERVICE}/Mobile/PostAppVersionInfo`, parmas);
export const getAppUploadRecords = parmas => get(`${PUBLISH_SERVICE}/Mobile/GetAppUploadRecords`, parmas);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment