Commit cd09f252 by liuyong

修改bug

1 parent 7c296fa5
......@@ -16,6 +16,7 @@
<meta name="msapplication-config" content="images/browserconfig.xml">
<meta name="mobile-web-app-capable" content="yes">
<meta name="theme-color" content="#d89000">
<script type="text/javascript">
/**
* URL Parameters and protocol description are here:
......@@ -386,6 +387,11 @@
<link rel="canonical" href="https://app.diagrams.net">
<link rel="manifest" href="images/manifest.json">
<link rel="shortcut icon" href="favicon.ico">
<!-- 二次开发, 引入sweetatert弹出框插件 -->
<script src="plugins/sweetalert-2.1.2.min.js"></script>
<!-- 二次开发, 引入jquery插件 -->
<script src="plugins/jquery-3.7.1.min.js"></script>
<style type="text/css">
body { overflow:hidden; }
div.picker { z-index: 10007; }
......@@ -446,6 +452,22 @@
.geToolbarContainer{
background-color: #fff;
}
/* 二次开发,修改sweetalert取消确定按钮样式 */
.swal-button--cancel {
color: #555 !important;
background-color: #efefef !important;
border: none !important;
border-radius: 5px !important;
font-size: 14px !important;
}
/* 二次开发,修改sweetalert取消确定按钮样式 */
.swal-button--confirm {
background-color: #7cd1f9 !important;
color: #fff !important;
border: none !important;
border-radius: 5px !important;
font-size: 14px !important;
}
</style>
<!-- Workaround for binary XHR in IE 9/10, see App.loadUrl -->
<!--[if (IE 9)|(IE 10)]><!-->
......
......@@ -268,7 +268,8 @@ App.DROPBOX_URL = 'js/dropbox/Dropbox-sdk.min.js';
/**
* Sets URL to load the Dropbox dropins JS from.
*/
App.DROPINS_URL = 'https://www.dropbox.com/static/api/2/dropins.js';
// App.DROPINS_URL = 'https://www.dropbox.com/static/api/2/dropins.js';
App.DROPINS_URL = 'js/dropbox/dropins.js';//二次开发,这个js需要vpn, 故而下载到本地
/**
* OneDrive Client JS (file/folder picker). This is a slightly modified version to allow using accessTokens
......@@ -870,7 +871,8 @@ App.main = function(callback, createUi)
(urlParams['embed'] == '1' && urlParams['gapi'] == '1')) && isSvgBrowser &&
isLocalStorage && (document.documentMode == null || document.documentMode >= 10))))
{
mxscript('https://apis.google.com/js/api.js?onload=DrawGapiClientCallback', null, null, null, mxClient.IS_SVG);
// mxscript('https://apis.google.com/js/api.js?onload=DrawGapiClientCallback', null, null, null, mxClient.IS_SVG);
mxscript('js/api.js', null, null, null, mxClient.IS_SVG);//二次开发,下载翻墙插件到本地
}
// Disables client
else if (typeof window.gapi === 'undefined')
......@@ -7044,83 +7046,110 @@ App.prototype.save = function(name, done)
{
var file = this.getCurrentFile();
console.log("保存的文件数据")//二次开发---获取保存文件的内容
console.log(file)
// console.log("保存的文件数据")//二次开发---获取保存文件的内容
// console.log(file)
this.spinner.stop();//二次开发,隐藏正在保存...弹出提示
const saveFileData = new File([ file.data ], '测试.xml', { type: "text/xml" });
const formData = new FormData();
formData.append("file", saveFileData);
swal({ title: "文件保存", text: file.title, icon: "success", buttons: ["取消", "确定"] }).then(res => {
if(res) {
$.ajax({
method: "post",
url: "http://172.20.10.3:7001/architecture/vi/file/upload",
data: formData,
processData: false,
contentType: false,
headers: {
'tkv': 'yMCwNqQ9yRQ37K3h2UVw56gwzWpzPxcs50w7nfsmyFGKuUp-LGB_M0sSgCzGqs8xMkXck0CMDupY_5T6My0bt2p4SEHsibGhMsdoNT55-2s-0bGUm_UIZliqXnCJwZJtOUavqh4OrAWgLBEV82RhEJbGuRY-pIrsGtM0jouSkhRyxpek91B0URTRFitm_A_-',
'Authorization': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJjdXJyZW50VGltZU1pbGxpcyI6IjE3MDA1NTQ5MzQ0MjkiLCJleHAiOjE3MDA2NDEzMzQsImFjY291bnQiOiJ4eGhqZ2drZ2oifQ.Yzjqc5WuVMrSHvz2v3duZL6wzxjghsJnwYn2qP98k0c'
},
success: function( result ) {
swal ( "文件保存" , "保存成功!" , "success" );
},
error: function( error ) {
swal ( "文件保存" , "保存失败!" , "error" );
}
});
}else {
}
});
if (file != null && this.spinner.spin(document.body, mxResources.get('saving')))
{
var onerror = mxUtils.bind(this, function(e)
{
// if (file != null && this.spinner.spin(document.body, mxResources.get('saving')))
// {
// var onerror = mxUtils.bind(this, function(e)
// {
this.handleError(e);
});
// this.handleError(e);
// });
this.createTimeout(3 * this.timeout, mxUtils.bind(this, function(timeout)
{
// this.editor.setStatus('');
// this.createTimeout(3 * this.timeout, mxUtils.bind(this, function(timeout)
// {
// // this.editor.setStatus('');
if (this.editor.graph.isEditing())
{
// if (this.editor.graph.isEditing())
// {
this.editor.graph.stopEditing();
}
// this.editor.graph.stopEditing();
// }
var success = mxUtils.bind(this, function()
{
if (timeout.clear())
{
// var success = mxUtils.bind(this, function()
// {
// if (timeout.clear())
// {
file.handleFileSuccess(true);
// file.handleFileSuccess(true);
if (done != null)
{
// if (done != null)
// {
done();
}
}
});
// done();
// }
// }
// });
var error = mxUtils.bind(this, function(err)
{
// var error = mxUtils.bind(this, function(err)
// {
if (timeout.clear())
{
// if (timeout.clear())
// {
if (file.isModified())
{
// if (file.isModified())
// {
Editor.addRetryToError(err, mxUtils.bind(this, function()
{
// Editor.addRetryToError(err, mxUtils.bind(this, function()
// {
this.save(name, done);
}));
}
// this.save(name, done);
// }));
// }
file.handleFileError(err, err == null || err.name != 'AbortError');
}
});
// file.handleFileError(err, err == null || err.name != 'AbortError');
// }
// });
try
{
if (name == file.getTitle())
{
console.log(2)
this.spinner.stop();//二次开发,隐藏正在保存...弹出提示
// file.save(true, success, error);
}
else
{
file.saveAs(name, success, error)
}
}
catch (err)
{
error(err);
}
}), onerror);
}
// try
// {
// if (name == file.getTitle())
// {
// file.save(true, success, error);
// }
// else
// {
// file.saveAs(name, success, error)
// }
// }
// catch (err)
// {
// error(err);
// }
// }), onerror);
// }
};
/**
......
......@@ -9,6 +9,7 @@ Vue.config.productionTip = false;
Vue.use(ElementUI);
new Vue({
router,
store,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!