Commit cd09f252 by liuyong

修改bug

1 parent 7c296fa5
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
<meta name="msapplication-config" content="images/browserconfig.xml"> <meta name="msapplication-config" content="images/browserconfig.xml">
<meta name="mobile-web-app-capable" content="yes"> <meta name="mobile-web-app-capable" content="yes">
<meta name="theme-color" content="#d89000"> <meta name="theme-color" content="#d89000">
<script type="text/javascript"> <script type="text/javascript">
/** /**
* URL Parameters and protocol description are here: * URL Parameters and protocol description are here:
...@@ -386,6 +387,11 @@ ...@@ -386,6 +387,11 @@
<link rel="canonical" href="https://app.diagrams.net"> <link rel="canonical" href="https://app.diagrams.net">
<link rel="manifest" href="images/manifest.json"> <link rel="manifest" href="images/manifest.json">
<link rel="shortcut icon" href="favicon.ico"> <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"> <style type="text/css">
body { overflow:hidden; } body { overflow:hidden; }
div.picker { z-index: 10007; } div.picker { z-index: 10007; }
...@@ -446,6 +452,22 @@ ...@@ -446,6 +452,22 @@
.geToolbarContainer{ .geToolbarContainer{
background-color: #fff; 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> </style>
<!-- Workaround for binary XHR in IE 9/10, see App.loadUrl --> <!-- Workaround for binary XHR in IE 9/10, see App.loadUrl -->
<!--[if (IE 9)|(IE 10)]><!--> <!--[if (IE 9)|(IE 10)]><!-->
......
...@@ -268,7 +268,8 @@ App.DROPBOX_URL = 'js/dropbox/Dropbox-sdk.min.js'; ...@@ -268,7 +268,8 @@ App.DROPBOX_URL = 'js/dropbox/Dropbox-sdk.min.js';
/** /**
* Sets URL to load the Dropbox dropins JS from. * 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 * 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) ...@@ -870,7 +871,8 @@ App.main = function(callback, createUi)
(urlParams['embed'] == '1' && urlParams['gapi'] == '1')) && isSvgBrowser && (urlParams['embed'] == '1' && urlParams['gapi'] == '1')) && isSvgBrowser &&
isLocalStorage && (document.documentMode == null || document.documentMode >= 10)))) 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 // Disables client
else if (typeof window.gapi === 'undefined') else if (typeof window.gapi === 'undefined')
...@@ -7044,83 +7046,110 @@ App.prototype.save = function(name, done) ...@@ -7044,83 +7046,110 @@ App.prototype.save = function(name, done)
{ {
var file = this.getCurrentFile(); var file = this.getCurrentFile();
console.log("保存的文件数据")//二次开发---获取保存文件的内容 // console.log("保存的文件数据")//二次开发---获取保存文件的内容
console.log(file) // console.log(file)
this.spinner.stop();//二次开发,隐藏正在保存...弹出提示
if (file != null && this.spinner.spin(document.body, mxResources.get('saving')))
{
var onerror = mxUtils.bind(this, function(e)
{
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 {
this.handleError(e); }
}); });
this.createTimeout(3 * this.timeout, mxUtils.bind(this, function(timeout) // if (file != null && this.spinner.spin(document.body, mxResources.get('saving')))
{ // {
// this.editor.setStatus(''); // var onerror = mxUtils.bind(this, function(e)
// {
if (this.editor.graph.isEditing())
{
this.editor.graph.stopEditing(); // this.handleError(e);
} // });
var success = mxUtils.bind(this, function() // this.createTimeout(3 * this.timeout, mxUtils.bind(this, function(timeout)
{ // {
if (timeout.clear()) // // this.editor.setStatus('');
{
file.handleFileSuccess(true); // if (this.editor.graph.isEditing())
// {
if (done != null) // this.editor.graph.stopEditing();
{ // }
done(); // var success = mxUtils.bind(this, function()
} // {
} // if (timeout.clear())
}); // {
var error = mxUtils.bind(this, function(err) // file.handleFileSuccess(true);
{
if (timeout.clear()) // if (done != null)
{ // {
if (file.isModified()) // done();
{ // }
// }
// });
Editor.addRetryToError(err, mxUtils.bind(this, function() // var error = mxUtils.bind(this, function(err)
{ // {
this.save(name, done); // if (timeout.clear())
})); // {
}
file.handleFileError(err, err == null || err.name != 'AbortError'); // if (file.isModified())
} // {
});
try // Editor.addRetryToError(err, mxUtils.bind(this, function()
{ // {
if (name == file.getTitle())
{
console.log(2)
this.spinner.stop();//二次开发,隐藏正在保存...弹出提示
// file.save(true, success, error);
}
else
{
file.saveAs(name, success, error) // this.save(name, done);
} // }));
} // }
catch (err)
{ // file.handleFileError(err, err == null || err.name != 'AbortError');
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; ...@@ -9,6 +9,7 @@ Vue.config.productionTip = false;
Vue.use(ElementUI); Vue.use(ElementUI);
new Vue({ new Vue({
router, router,
store, store,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!