初始化
This commit is contained in:
6
seeyon/WEB-INF/cfgHome/component/esign/pluginCfg.xml
Normal file
6
seeyon/WEB-INF/cfgHome/component/esign/pluginCfg.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<plugin>
|
||||
<id>esign</id>
|
||||
<name>致远E签宝集成封装</name>
|
||||
<category>20260122</category>
|
||||
</plugin>
|
||||
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
|
||||
<beans default-autowire="byName">
|
||||
<bean id="esignConfigProvider" class="com.seeyon.apps.esign.config.EsignConfigProvider" />
|
||||
<bean id="sealDocSyncJob" class="com.seeyon.apps.esign.job.SealDocSyncJob" />
|
||||
<bean id="contractCompareFieldCtrl" class="com.seeyon.apps.esign.fieldCtrl.ContractCompareFieldCtrl" />
|
||||
<bean id="esignMultipleSignerNode" class="com.seeyon.apps.esign.node.EsignMultipleSignerNode" />
|
||||
<bean id="esignOneSignerNode" class="com.seeyon.apps.esign.node.EsignOneSignerNode" />
|
||||
<bean id="esignUploadFileService" class="com.seeyon.apps.esign.service.EsignUploadFileService" />
|
||||
<bean id="defaultSignerBuilder" class="com.seeyon.apps.esign.po.signer.DefaultSignerBuilder" />
|
||||
<bean id="esignByTemplateService" class="com.seeyon.apps.esign.service.EsignByTemplateService" />
|
||||
<bean id="flowFormSignParamBuildFactory" class="com.seeyon.apps.esign.service.FlowFormSignParamBuildFactory" />
|
||||
<bean id="normalFormSignParamBuildFactory" class="com.seeyon.apps.esign.service.NormalFormSignParamBuildFactory" />
|
||||
<bean id="sealService" class="com.seeyon.apps.esign.service.SealService" />
|
||||
<bean id="signLinkService" class="com.seeyon.apps.esign.service.SignLinkService" />
|
||||
<bean id="tokenCacheManager" class="com.seeyon.apps.esign.service.TokenCacheManager" />
|
||||
<bean id="esignFlowQueryService" class="com.seeyon.apps.esign.service.EsignFlowQueryService" />
|
||||
<bean id="protUtil" class="com.seeyon.apps.esign.utils.ProtUtil" />
|
||||
<!-- 定义接口实现类 -->
|
||||
<bean id="esignCallbackFlowBizService" class="com.seeyon.apps.esign.service.EsignCallbackFlowBizService"/>
|
||||
<!-- 注入数组类型的Bean -->
|
||||
<bean id="esignPluginApi" class="com.seeyon.apps.esign.EsignPluginApi"/>
|
||||
<bean name="contractCreateService" class="com.seeyon.apps.esign.service.ContractCreateService">
|
||||
<property name="signParamBuildFactories">
|
||||
<list>
|
||||
<ref bean="flowFormSignParamBuildFactory"/>
|
||||
<ref bean="normalFormSignParamBuildFactory"/>
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
</beans>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
|
||||
<beans default-autowire="byName">
|
||||
<bean name="/esigncallback.do" class="com.seeyon.apps.esign.controller.DefaultEsignCallBackController">
|
||||
</bean>
|
||||
</beans>
|
||||
@@ -0,0 +1,36 @@
|
||||
.customButton_class_box {
|
||||
width: 35%;
|
||||
line-height: 24px;
|
||||
height:24px;
|
||||
color: #1f85ec;
|
||||
cursor: pointer;
|
||||
font-family: "Microsoft YaHei"!important;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
word-break:keep-all;
|
||||
box-sizing: border-box;
|
||||
-webkit-box-sizing : border-box;
|
||||
-moz-box-sizing : border-box;
|
||||
text-align: center;
|
||||
outline: none;
|
||||
border: 1px solid #1f85ec;
|
||||
background-color: #fff;
|
||||
border-radius: 15px;
|
||||
-webkit-border-radius: 15px;
|
||||
-moz-border-radius: 15px;
|
||||
}
|
||||
.customInputArea{
|
||||
width: 65%;
|
||||
height:auto;
|
||||
color: #1f85ec;
|
||||
font-family: "Microsoft YaHei"!important;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
word-break:keep-all;
|
||||
}
|
||||
.customButton_box_content{
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 101 KiB |
@@ -0,0 +1,104 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>e签宝合同比对</title>
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<style>
|
||||
body {
|
||||
height: 100vh;
|
||||
margin: 0;
|
||||
font-family: Arial, sans-serif;
|
||||
background: #f5f5f7;
|
||||
}
|
||||
|
||||
#content {
|
||||
padding: 20px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.file-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 10px;
|
||||
background: white;
|
||||
border-radius: 8px;
|
||||
margin-bottom: 10px;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.file-item input {
|
||||
margin-right: 12px;
|
||||
}
|
||||
|
||||
.search-bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 20px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.search-bar input {
|
||||
width: 400px;
|
||||
padding: 10px;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
button {
|
||||
padding: 10px 20px;
|
||||
background-color: #4A90E2;
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 5px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
button:hover {
|
||||
background-color: #0056b3;
|
||||
}
|
||||
|
||||
#confirm {
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
.pagination {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.pagination button {
|
||||
margin: 0 5px;
|
||||
padding: 4px 8px;
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="content">
|
||||
<div id="file-list"></div>
|
||||
<div id="file-pagination" class="pagination"></div>
|
||||
</div>
|
||||
|
||||
<script src="../js/compareBiz.js"></script>
|
||||
<script>
|
||||
function OK() {
|
||||
var ids = '';
|
||||
const checkList = $('#file-list input:checked');
|
||||
console.log('checkList:' + checkList)
|
||||
if (checkList.length === 0) {
|
||||
console.log('没有选中的文件');
|
||||
return ''; // 如果没有选中的复选框,直接返回空字符串
|
||||
}
|
||||
|
||||
checkList.each(function() {
|
||||
ids += $(this).val(); // 拼接 id
|
||||
});
|
||||
return ids;
|
||||
}
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,99 @@
|
||||
$(document).ready(async function() {
|
||||
const apiBaseUrl = window.location.origin;
|
||||
let currentFilePage = 1;
|
||||
let totalFilePages = 1;
|
||||
let searchKeyword;
|
||||
const filePageSize = 10;
|
||||
|
||||
const dataList = await pageQueryTemplates();
|
||||
renderTemplates(dataList);
|
||||
|
||||
|
||||
function renderTemplates(list) {
|
||||
const container = $('#file-list');
|
||||
container.empty();
|
||||
list.forEach(file => {
|
||||
const fileItem = $(`
|
||||
<div class="file-item">
|
||||
<input type="radio" value=${file.signTemplateId} title=${file.signTemplateName}> ${file.signTemplateName}
|
||||
</div>
|
||||
`);
|
||||
container.append(fileItem);
|
||||
});
|
||||
filePagination()
|
||||
}
|
||||
|
||||
async function pageQueryTemplates() {
|
||||
const pageIndex = currentFilePage;
|
||||
const response = await fetch(
|
||||
`${apiBaseUrl}/seeyon/rest/cap4/etemplate/querypage?pageNum=${pageIndex}`, {}
|
||||
);
|
||||
const res = await response.json();
|
||||
// 校验返回值
|
||||
|
||||
console.log(res)
|
||||
let respData = res.data;
|
||||
totalFilePages = Math.ceil(respData.total / filePageSize);
|
||||
return res.data.templateList;
|
||||
}
|
||||
|
||||
async function getContractCompareUrl(templateId,templateFileId) {
|
||||
const response = await fetch(
|
||||
`${apiBaseUrl}/seeyon/rest/cap4/etemplate/compareurl?templateId=${templateId}&templateFileId=${templateFileId}`, {}
|
||||
);
|
||||
const res = await response.json();
|
||||
// 校验返回值
|
||||
}
|
||||
|
||||
function filePagination() {
|
||||
// 分页逻辑
|
||||
const pagination = $('#file-pagination');
|
||||
pagination.empty();
|
||||
|
||||
const firstBtn = $('<button>首页</button>');
|
||||
const prevBtn = $('<button>上一页</button>');
|
||||
const nextBtn = $('<button>下一页</button>');
|
||||
const pageInfo = $(`<span>第 ${currentFilePage} 页</span>`);
|
||||
|
||||
// 判断是否禁用按钮
|
||||
prevBtn.prop('disabled', currentFilePage === 1);
|
||||
|
||||
// 首页按钮点击事件
|
||||
firstBtn.click(async () => {
|
||||
currentFilePage = 1; // 跳转到第一页
|
||||
await loadTemplates(); // 加载文件
|
||||
});
|
||||
|
||||
// 上一页按钮点击事件
|
||||
prevBtn.click(async () => {
|
||||
if (currentFilePage <= 1) return; // 防止重复请求
|
||||
currentFilePage--; // 页码减一
|
||||
await loadTemplates(); // 加载文件
|
||||
});
|
||||
|
||||
// 下一页按钮点击事件
|
||||
nextBtn.click(async () => {
|
||||
currentFilePage++; // 页码加一
|
||||
await loadTemplates(); // 加载文件
|
||||
});
|
||||
|
||||
// 加载文件的逻辑
|
||||
async function loadTemplates() {
|
||||
let tempTemplateList;
|
||||
|
||||
tempTemplateList = await pageQueryTemplates();
|
||||
|
||||
renderTemplates(tempFileList); // 渲染文件列表
|
||||
pageInfo.text(`第 ${currentFilePage} 页`); // 更新页数信息
|
||||
}
|
||||
|
||||
// 添加按钮到分页容器
|
||||
pagination.append(firstBtn, prevBtn, pageInfo, nextBtn);
|
||||
}
|
||||
|
||||
function getCookie(name) {
|
||||
const value = `; ${document.cookie}`;
|
||||
const parts = value.split(`; ${name}=`);
|
||||
if (parts.length === 2) return parts.pop().split(';').shift();
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,207 @@
|
||||
(function(factory) {
|
||||
var nameSpace = 'field_8899554679928334458';
|
||||
if (!window[nameSpace]) {
|
||||
console.log("开始实例化控件")
|
||||
var Builder = factory();
|
||||
window[nameSpace] = {
|
||||
instance: {}
|
||||
};
|
||||
window[nameSpace].init = function(options) {
|
||||
window[nameSpace].instance[options.privateId] = new Builder(options);
|
||||
};
|
||||
}
|
||||
})(function() {
|
||||
function App(options) {
|
||||
var self = this;
|
||||
self.initParams(options);
|
||||
//初始化dom
|
||||
self.initDom();
|
||||
//事件
|
||||
self.events();
|
||||
}
|
||||
|
||||
App.prototype = {
|
||||
initParams: function(options) {
|
||||
console.log("开始初始化参数")
|
||||
var self = this;
|
||||
self.adaptation = options.adaptation;
|
||||
self.privateId = options.privateId;
|
||||
self.preUrl = options.url_prefix;
|
||||
self.adaptation.formMessage = options.formMessage;
|
||||
self.messageObj = options.getData;
|
||||
console.log(self.messageObj)
|
||||
},
|
||||
initDom: function() {
|
||||
var self = this;
|
||||
console.log("开始渲染dom")
|
||||
dynamicLoading.css(self.preUrl + '/css/contractCompareBtn.css');
|
||||
self.appendChildDom();
|
||||
},
|
||||
events: function() {
|
||||
var self = this;
|
||||
// 监听是否数据刷新
|
||||
console.log("设置事件监听")
|
||||
self.adaptation.ObserverEvent.listen('Event' + self.privateId, function() {
|
||||
self.messageObj = self.adaptation.childrenGetData(self.privateId);
|
||||
self.appendChildDom();
|
||||
});
|
||||
},
|
||||
openCompareUrl: function(privateId, messageObj, adaptation) {
|
||||
// 实际的业务代码方法
|
||||
messageObj = adaptation.childrenGetData(privateId);
|
||||
const targetObj = messageObj.formdata.formmains[adaptation.formMessage.tableName]
|
||||
//backFill(ids, messageObj.id, messageObj.display, privateId,messageObj, adaptation);
|
||||
//dialog.close()
|
||||
console.log(targetObj)
|
||||
if (targetObj) {
|
||||
let contractRefId;
|
||||
let templateRefId;
|
||||
for (const key in targetObj) {
|
||||
if (targetObj.hasOwnProperty(key) && !/^auxiliary/.test(key)) {
|
||||
if (targetObj[key].display === "合同审批附件") {
|
||||
console.log(targetObj[key])
|
||||
contractRefId = targetObj[key].showValue;
|
||||
console.log("合同附件refId: " + contractRefId)
|
||||
|
||||
|
||||
}
|
||||
if (targetObj[key].display === "原始合同模板文件") {
|
||||
console.log(targetObj[key])
|
||||
templateRefId = targetObj[key].showValue;
|
||||
console.log("模板文件refId: " + templateRefId)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: '/seeyon/rest/cap4/etemplate/compareurl?templateRefId=' +
|
||||
templateRefId + '&contractRefId=' +
|
||||
contractRefId,
|
||||
data: {},
|
||||
dataType: "json",
|
||||
contentType: 'application/json;charset=UTF-8',
|
||||
success: function(res) {
|
||||
// 后台解析数据后 将数据填写到表单中
|
||||
if (res.code == 0) {
|
||||
window.open(res.data, "_blank");
|
||||
} else {
|
||||
// 报错
|
||||
$.alert(res.message);
|
||||
}
|
||||
},
|
||||
complete: function() {},
|
||||
error: function(e) {
|
||||
top.$.error(e.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
appendChildDom: function() {
|
||||
var self = this;
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
console.log(params)
|
||||
const openFrom = params.get('openFrom'); // 返回"2025"
|
||||
const type = params.get('type');
|
||||
var edit = !((openFrom != null && (openFrom == 'listPending' || openFrom == 'listDone' ||
|
||||
openFrom == 'listSent')) || (type != null && type == 'browse'));
|
||||
console.log(edit)
|
||||
var domStructure = '<section class="customButton_box_content">' +
|
||||
'<div>' +
|
||||
'<button class = "customButton_class_box ' + self.privateId + '">' +
|
||||
self.messageObj.display.escapeHTML() +
|
||||
'</button>' +
|
||||
'</div>' +
|
||||
'</section>';
|
||||
document.querySelector('#' + self.privateId).innerHTML = domStructure;
|
||||
var compare = function() {
|
||||
self.openCompareUrl(self.privateId, self.messageObj, self.adaptation)
|
||||
}
|
||||
|
||||
var content = self.messageObj.formdata.content;
|
||||
const picker = document.querySelector('.customButton_class_box' + '.' + self.privateId);
|
||||
if (picker) {
|
||||
document.querySelector('.customButton_class_box' + '.' + self.privateId)
|
||||
.removeEventListener(
|
||||
'click', compare);
|
||||
document.querySelector('.customButton_class_box' + '.' + self.privateId).addEventListener(
|
||||
'click', compare);
|
||||
}
|
||||
const goNewPages = document.querySelectorAll('.goToNewPage');
|
||||
if (goNewPages.length > 0) {
|
||||
goNewPages.forEach(element => {
|
||||
element.addEventListener('click', function(e) {
|
||||
window.open(e.currentTarget.dataset.href, '_blank'); //
|
||||
});
|
||||
});
|
||||
}
|
||||
//渲染隐藏权限
|
||||
if (self.messageObj.auth === 'hide') {
|
||||
document.querySelector('#' + self.privateId).innerHTML =
|
||||
'<div class="cap4-text__browse" style="line-height: 1.8; color: rgb(0, 0, 0) !important;">***</div>';
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
function backFill(ids, fieldName, fieldDisplay, privateId, messageObj, adaptation) {
|
||||
var param = new Object();
|
||||
param.masterId = messageObj.formdata.content.contentDataId;
|
||||
param.ids = ids;
|
||||
param.formId = messageObj.formdata.content.contentTemplateId;
|
||||
param.fieldName = fieldName;
|
||||
param.fieldDisplay = fieldDisplay;
|
||||
param.masterId = messageObj.formdata.content.contentDataId;
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: '/seeyon/rest/cap4/hywp/fileref',
|
||||
data: JSON.stringify(param),
|
||||
dataType: "json",
|
||||
contentType: 'application/json;charset=UTF-8',
|
||||
success: function(res) {
|
||||
// 后台解析数据后 将数据填写到表单中
|
||||
if (res.code == 0) {
|
||||
var backfill = {};
|
||||
backfill.tableName = adaptation.formMessage.tableName;
|
||||
// 回填主表
|
||||
backfill.tableCategory = 'formmain';
|
||||
// 后台组装的data数据
|
||||
console.log(res.data)
|
||||
backfill.updateData = res.data;
|
||||
adaptation.backfillFormControlData(backfill, privateId);
|
||||
} else {
|
||||
// 报错
|
||||
$.alert(res.message);
|
||||
}
|
||||
},
|
||||
complete: function() {},
|
||||
error: function(e) {
|
||||
top.$.error(e.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
var dynamicLoading = {
|
||||
css: function(path) {
|
||||
if (!path || path.length === 0) {
|
||||
throw new Error('argument "path" is required !');
|
||||
}
|
||||
var head = document.getElementsByTagName('head')[0];
|
||||
var link = document.createElement('link');
|
||||
link.href = path;
|
||||
link.rel = 'stylesheet';
|
||||
link.type = 'text/css';
|
||||
head.appendChild(link);
|
||||
},
|
||||
js: function(path) {
|
||||
if (!path || path.length === 0) {
|
||||
throw new Error('argument "path" is required !');
|
||||
}
|
||||
var head = document.getElementsByTagName('head')[0];
|
||||
var script = document.createElement('script');
|
||||
script.src = path;
|
||||
script.type = 'text/javascript';
|
||||
head.appendChild(script);
|
||||
}
|
||||
}
|
||||
return App;
|
||||
});
|
||||
Reference in New Issue
Block a user