Commit 39f5070b by liuyong

修改弹框

1 parent d533039a
...@@ -29,29 +29,9 @@ var exToolbar = function (toolbarContainer) { ...@@ -29,29 +29,9 @@ var exToolbar = function (toolbarContainer) {
// Toggles compact mode // Toggles compact mode
mxEvent.addListener(this.toggleElement, 'click', mxUtils.bind(this, function (evt) { mxEvent.addListener(this.toggleElement, 'click', mxUtils.bind(this, function (evt) {
swal({ title: "版本发布确认", text: '该操作将发布架构设计新版本,请确认是否继续?',confirmButtonColor:'rgb(13,134,127)',icon: "warning", buttons: ["取消", "发布"] }).then(res => {
if(res) { window.parent.postMessage({ type: 'saveVersion' }, '*');
var jsonData = {
"metaModelId": urlParams['id'],
"version": urlParams['version'],
"state": 1
}
$.ajax({
method: "post",
url: "http://43.143.211.42:7003/ynMol/updateYnMol",
contentType : 'application/json',
data: JSON.stringify(jsonData),
success: function( result ) {
swal ( "版本发布" , "发布成功!" );
},
error: function( error ) {
swal ( "版本发布" , "发布失败!" );
}
});
}else {
}
});
})); }));
if (Editor.currentTheme != 'atlas') { if (Editor.currentTheme != 'atlas') {
......
...@@ -387,8 +387,6 @@ ...@@ -387,8 +387,6 @@
<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插件 --> <!-- 二次开发, 引入jquery插件 -->
<script src="plugins/jquery-3.7.1.min.js"></script> <script src="plugins/jquery-3.7.1.min.js"></script>
...@@ -452,22 +450,6 @@ ...@@ -452,22 +450,6 @@
.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)]><!-->
......
...@@ -3738,24 +3738,6 @@ App.prototype.showSplash = function(force) ...@@ -3738,24 +3738,6 @@ App.prototype.showSplash = function(force)
// var node = encoder.encode(this.editor.graph.getModel()); // var node = encoder.encode(this.editor.graph.getModel());
// var xml = mxUtils.getXml(node); // var xml = mxUtils.getXml(node);
// $.ajax({
// method: "get",
// url: "http://192.168.161.129:7001/architecture/vi/file/getById",
// data: { mfId: 5 },
// headers: {
// 'tkv': 'yMCwNqQ9yRQ37K3h2UVw56gwzWpzPxcs50w7nfsmyFGKuUp-LGB_M0sSgCzGqs8xMkXck0CMDupY_5T6My0bt2p4SEHsibGhMsdoNT55-2s-0bGUm_UIZliqXnCJwZJtOUavqh4OrAWgLBEV82RhEJbGuRY-pIrsGtM0jouSkhRyxpek91B0URTRFitm_A_-',
// },
// success: result => {
// console.log(result.data.content)
// // swal ( "文件保存" , "保存成功!" );
// const file = new LocalFile(this, result.data.content, '测试文件', this.mode);
// this.loadFile(`-1`, true, file);
// },
// error: function( error ) {
// // swal ( "文件保存" , "保存失败!" );
// }
// });
if (this.editor.isChromelessView()) if (this.editor.isChromelessView())
{ {
this.handleError({message: mxResources.get('noFileSelected')}, this.handleError({message: mxResources.get('noFileSelected')},
......
...@@ -1911,10 +1911,10 @@ DrawioFile.prototype.saveDraft = function() ...@@ -1911,10 +1911,10 @@ DrawioFile.prototype.saveDraft = function()
// 'Authorization': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJjdXJyZW50VGltZU1pbGxpcyI6IjE3MDA1NTQ5MzQ0MjkiLCJleHAiOjE3MDA2NDEzMzQsImFjY291bnQiOiJ4eGhqZ2drZ2oifQ.Yzjqc5WuVMrSHvz2v3duZL6wzxjghsJnwYn2qP98k0c' // 'Authorization': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJjdXJyZW50VGltZU1pbGxpcyI6IjE3MDA1NTQ5MzQ0MjkiLCJleHAiOjE3MDA2NDEzMzQsImFjY291bnQiOiJ4eGhqZ2drZ2oifQ.Yzjqc5WuVMrSHvz2v3duZL6wzxjghsJnwYn2qP98k0c'
// }, // },
// success: function( result ) { // success: function( result ) {
// // swal ( "文件保存" , "保存成功!" ); //
// }, // },
// error: function( error ) { // error: function( error ) {
// // swal ( "文件保存" , "保存失败!" ); //
// } // }
// }); // });
......
...@@ -5647,7 +5647,7 @@ ...@@ -5647,7 +5647,7 @@
ignoreSelection, null, null, (linkTarget == 'blank') ? '_blank' : ignoreSelection, null, null, (linkTarget == 'blank') ? '_blank' :
((linkTarget == 'self') ? '_top' : null), null, !embedFonts, ((linkTarget == 'self') ? '_top' : null), null, !embedFonts,
theme, exportType); theme, exportType);
// console.log(svgRoot) console.log(svgRoot)
if (addShadow) if (addShadow)
{ {
this.editor.graph.addSvgShadow(svgRoot); this.editor.graph.addSvgShadow(svgRoot);
......
...@@ -4708,8 +4708,12 @@ ...@@ -4708,8 +4708,12 @@
var graph = editorUi.editor.graph; var graph = editorUi.editor.graph;
var svgImage = graph.getSvg('#fff', 1, 0, true, null, true, null, null, null, null, true, 'light', 'diagram');//当前画布的预览图,svg格式 var svgImage = graph.getSvg('#fff', 1, 0, true, null, true, null, null, null, null, true, 'light', 'diagram');//当前画布的预览图,svg格式
// console.log(svgImage); var svgToString = new XMLSerializer().serializeToString(svgImage);
var base64SvgToString = Base64.encode(svgToString);
window.parent.postMessage({ type: 'saveData', data: { mxGraphModel, base64SvgToString } }, '*');
// this.addMenuItems(menu, ['customSubMenu1', 'customSubMenu2']); // this.addMenuItems(menu, ['customSubMenu1', 'customSubMenu2']);
// editorUi.menus.addSubmenu(['customSubMenu1', 'customSubMenu2'], menu, parent); // editorUi.menus.addSubmenu(['customSubMenu1', 'customSubMenu2'], menu, parent);
// menu.addSeparator(parent); // menu.addSeparator(parent);
...@@ -4719,31 +4723,6 @@ ...@@ -4719,31 +4723,6 @@
// const formData = new FormData(); // const formData = new FormData();
// formData.append("file", saveFileData); // formData.append("file", saveFileData);
swal({ title: "文件保存", text: file.title, icon: "success", buttons: ["取消", "确定"] }).then(res => {
if(res) {
$.ajax({
method: "post",
url: "http://43.143.211.42:7003/ynMol/upMxGraph",
data: {
metaModelId: urlParams['id'],
metaModelData: mxGraphModel
},
success: function( result ) {
// console.log(result)
if(result.code == 200) {
swal( "文件保存" , "保存成功!" );
}else {
swal( "文件保存" , result.msg );
}
},
error: function( error ) {
swal( "文件保存" , "保存失败!" );
}
});
}else {
}
});
}))); })));
this.put('extras', new Menu(mxUtils.bind(this, function(menu, parent) this.put('extras', new Menu(mxUtils.bind(this, function(menu, parent)
{ {
......
...@@ -117,4 +117,12 @@ export function getYMXZDGLUpdate(params) { ...@@ -117,4 +117,12 @@ export function getYMXZDGLUpdate(params) {
// 删除字典 // 删除字典
export function getYMXZDGLDel(params) { export function getYMXZDGLDel(params) {
return post('/ynMolDicy/deleteYnMolProy', params); return post('/ynMolDicy/deleteYnMolProy', params);
}
// 自定义保存文件
export function save_drawio_xml_and_svg(params) {
return post('/ynMol/upMxGraph', params);
}
// 版本发布
export function save_drawio_version(params) {
return post('/ynMol/updateYnMol', params);
} }
\ No newline at end of file
...@@ -499,17 +499,6 @@ ...@@ -499,17 +499,6 @@
}; };
}, },
mounted(){ mounted(){
// window.addEventListener("message", event => {//会一直调用
// // console.log(event);
// if(event.data == 'newPage') {
// // this.$router.push( '/main/NewPage', () => {}, () => {} );
// let routeUrl = this.$router.resolve({
// path: "/main/NewPage",
// });
// window.open(routeUrl.href, '_blank');
// this.visible1 = false;
// }
// });
$(".menu_item").hover(function() { $(".menu_item").hover(function() {
$(this).find(".menu_title").css('color', '#0D867F'); $(this).find(".menu_title").css('color', '#0D867F');
$(this).find(".menu_icon").css('display', 'none'); $(this).find(".menu_icon").css('display', 'none');
......
...@@ -51,8 +51,8 @@ ...@@ -51,8 +51,8 @@
<el-table-column prop="archiBelongName" label="架构归属" align="center"></el-table-column> <el-table-column prop="archiBelongName" label="架构归属" align="center"></el-table-column>
<el-table-column prop="content" label="描述" align="center"></el-table-column> <el-table-column prop="content" label="描述" align="center"></el-table-column>
<el-table-column label="图标" align="center"> <el-table-column label="图标" align="center">
<template> <template slot-scope="scope">
<el-button type="text" style="color: #0D867F;">预览</el-button> <img :src="scope.row.icon" alt="" style="width: 50%;">
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="version" label="版本" align="center"></el-table-column> <el-table-column prop="version" label="版本" align="center"></el-table-column>
...@@ -265,7 +265,6 @@ export default { ...@@ -265,7 +265,6 @@ export default {
message: '请选择至少一条数据!' message: '请选择至少一条数据!'
}); });
}else { }else {
let elementIdArray = []; let elementIdArray = [];
this.selectTable.forEach(item => { this.selectTable.forEach(item => {
elementIdArray.push(item.elementId); elementIdArray.push(item.elementId);
...@@ -273,22 +272,35 @@ export default { ...@@ -273,22 +272,35 @@ export default {
const params = { const params = {
elementId: elementIdArray, elementId: elementIdArray,
state: 2 state: 1
}; };
version_release_jia_gou_gui_shu(params).then(res => { MessageBox.confirm('确定停用?', '提示', {
if(res.code == 200) { confirmButtonText: '确定',
this.get_table(); cancelButtonText: '取消',
Message({ customClass: 'messageClass',
type: 'success', confirmButtonClass: 'confirmClass',
message: '版本发布成功!' type: 'warning'
}); }).then(() => {
}else { version_release_jia_gou_gui_shu(params).then(res => {
Message({ if(res.code == 200) {
type: 'error', this.get_table();
message: '版本发布失败!' Message({
}); type: 'success',
} message: '版本发布成功!'
}) });
}else {
Message({
type: 'error',
message: '版本发布失败!'
});
}
})
}).catch(() => {
Message({
type: 'info',
message: '已取消'
});
});
} }
}, },
select_table_rows(data){//表格的勾选 select_table_rows(data){//表格的勾选
...@@ -511,6 +523,8 @@ export default { ...@@ -511,6 +523,8 @@ export default {
MessageBox.confirm('确定停用?', '提示', { MessageBox.confirm('确定停用?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
customClass: 'messageClass',
confirmButtonClass: 'confirmClass',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
const params = { const params = {
...@@ -542,6 +556,8 @@ export default { ...@@ -542,6 +556,8 @@ export default {
MessageBox.confirm('确定发布?', '提示', { MessageBox.confirm('确定发布?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
customClass: 'messageClass',
confirmButtonClass: 'confirmClass',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
const params = { const params = {
...@@ -573,6 +589,8 @@ export default { ...@@ -573,6 +589,8 @@ export default {
MessageBox.confirm('确定删除?', '提示', { MessageBox.confirm('确定删除?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
customClass: 'messageClass',
confirmButtonClass: 'confirmClass',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
const params = { const params = {
...@@ -605,6 +623,14 @@ export default { ...@@ -605,6 +623,14 @@ export default {
} }
} }
</script> </script>
<style>
.confirmClass{
background-color: #0D867F !important;
}
.el-message-box__content{
padding: 60px 15px 60px 15px;
}
</style>
<style scoped> <style scoped>
.archiEleList{ .archiEleList{
width: 100%; width: 100%;
......
...@@ -6,7 +6,11 @@ ...@@ -6,7 +6,11 @@
<script> <script>
import Drawio from '@/components/drawio.vue'; import Drawio from '@/components/drawio.vue';
import { MessageBox, Message } from 'element-ui';
import {
save_drawio_xml_and_svg,
save_drawio_version
} from '@/api/index.js';
export default { export default {
name: 'Canvas', name: 'Canvas',
components: { components: {
...@@ -26,12 +30,97 @@ ...@@ -26,12 +30,97 @@
version, version,
state state
} }
window.addEventListener("message", event => {//会一直调用
if(event.data.type) {
if(event.data.type == 'saveData') {
MessageBox.confirm('确定保存?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
customClass: 'messageClass',
confirmButtonClass: 'confirmClass',
type: 'warning'
}).then(() => {
this.saveCanvas(id, event.data.data.mxGraphModel, event.data.data.base64SvgToString);
}).catch(() => {
Message({
type: 'info',
message: '已取消'
});
});
}
if(event.data.type == 'saveVersion'){
MessageBox.confirm('确定发布版本?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
customClass: 'messageClass',
confirmButtonClass: 'confirmClass',
type: 'warning'
}).then(() => {
this.releaseVersion(id, version);
}).catch(() => {
Message({
type: 'info',
message: '已取消'
});
});
}
}
});
}, },
methods: { methods: {
saveCanvas(id, mxGraphModel, base64SvgToString) {
const params = {
metaModelId: id,
metaModelData: mxGraphModel,
metaModelSvg: base64SvgToString
}
save_drawio_xml_and_svg(params).then(res => {
if(res.code == 200) {
Message({
type: 'success',
message: '保存成功!',
});
}else {
Message({
type: 'error',
message: '保存失败!'
});
}
})
},
releaseVersion(id, version) {
const params = {
metaModelId: id,
version: version,
state: 1
}
save_drawio_version(params).then(res => {
if(res.code == 200) {
Message({
type: 'success',
message: '版本发布成功!',
});
}else {
Message({
type: 'error',
message: '版本发布失败!'
});
}
})
}
} }
} }
</script> </script>
<style>
.confirmClass{
background-color: #0D867F !important;
}
.el-message-box__content{
padding: 60px 15px 60px 15px;
}
</style>
<style scoped> <style scoped>
.canvas{ .canvas{
width: 100%; width: 100%;
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
</div> </div>
<div class="card_container"> <div class="card_container">
<el-card class="card_item" v-for="item in yi_fa_bu" :key="item.metaModelId"> <el-card class="card_item" v-for="item in yi_fa_bu" :key="item.metaModelId">
<img class="card_image" @click="to_current_details(item)" src="@/assets/元模型管理.svg" alt="" /> <img class="card_image" @click="to_current_details(item)" :src="item.metaModelSvg_" alt="" />
<div class="card_info"> <div class="card_info">
<div class="card_title"> <div class="card_title">
<i class="el-icon-location"></i> <i class="el-icon-location"></i>
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
</div> </div>
<div class="card_container"> <div class="card_container">
<el-card class="card_item" v-for="item in zan_cun" :key="item.metaModelId"> <el-card class="card_item" v-for="item in zan_cun" :key="item.metaModelId">
<img class="card_image" @click="to_current_details(item)" src="@/assets/元模型管理.svg" alt="" /> <img class="card_image" @click="to_current_details(item)" :src="item.metaModelSvg_" alt="" />
<div class="card_info"> <div class="card_info">
<div class="card_title"> <div class="card_title">
<i class="el-icon-location"></i> <i class="el-icon-location"></i>
...@@ -79,7 +79,6 @@ ...@@ -79,7 +79,6 @@
<el-button @click="add_dialog = false">取消</el-button> <el-button @click="add_dialog = false">取消</el-button>
</span> </span>
</el-dialog> </el-dialog>
<!-- <img :src="imgS" alt=""> -->
</div> </div>
</template> </template>
...@@ -111,7 +110,6 @@ export default { ...@@ -111,7 +110,6 @@ export default {
}, },
yi_fa_bu: [], yi_fa_bu: [],
zan_cun: [], zan_cun: [],
imgS: ''
}; };
}, },
mounted(){ mounted(){
...@@ -119,22 +117,14 @@ export default { ...@@ -119,22 +117,14 @@ export default {
}, },
methods: { methods: {
search_list() {//搜索 search_list() {//搜索
const params = { this.get_list();
verName: this.query_item1
}
get_yuan_mo_xing_list(params).then(res => {
if(res.code == 200) {
this.yi_fa_bu = res.data.records.filter(item => item.state == 1);
this.zan_cun = res.data.records.filter(item => item.state == 2);
}else {
}
})
}, },
deleteItem(item) {//删除 deleteItem(item) {//删除
MessageBox.confirm('确定删除?', '提示', { MessageBox.confirm('确定删除?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
customClass: 'messageClass',
confirmButtonClass: 'confirmClass',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
const params = { const params = {
...@@ -146,7 +136,7 @@ export default { ...@@ -146,7 +136,7 @@ export default {
this.get_list(); this.get_list();
Message({ Message({
type: 'success', type: 'success',
message: '删除成功!' message: '删除成功!',
}); });
}else { }else {
Message({ Message({
...@@ -163,15 +153,16 @@ export default { ...@@ -163,15 +153,16 @@ export default {
}); });
}, },
get_list() {//查询列表 get_list() {//查询列表
const params = {
verName: this.query_item1
}
get_yuan_mo_xing_list({}).then(res => { get_yuan_mo_xing_list({}).then(res => {
if(res.code == 200) { if(res.code == 200) {
this.yi_fa_bu = res.data.records.filter(item => item.state == 1); this.yi_fa_bu = res.data.records.filter(item => item.state == 1);
this.zan_cun = res.data.records.filter(item => item.state == 2); this.zan_cun = res.data.records.filter(item => item.state == 2);
// const res0 = res.data[0].records[0].metaModelData; res.data.records.map(item => {
// const blob = new Blob([res0], { type: 'application/xml' }); item['metaModelSvg_'] = 'data:image/svg+xml;base64,'+ item.metaModelSvg;
// const imageUrl = (window.URL || window.webkitURL).createObjectURL(blob); });
// console.log(imageUrl)
// this.imgS = imageUrl;
// Message({ // Message({
// type: 'success', // type: 'success',
// message: '版本发布成功!' // message: '版本发布成功!'
...@@ -226,11 +217,20 @@ export default { ...@@ -226,11 +217,20 @@ export default {
} }
} }
</script> </script>
<style>
.confirmClass{
background-color: #0D867F !important;
}
.el-message-box__content{
padding: 60px 15px 60px 15px;
}
</style>
<style scoped> <style scoped>
.greenButton{ .greenButton{
background-color: #0D867F; background-color: #0D867F;
color: #fff; color: #fff;
} }
.version_container{ .version_container{
height: calc(100% - 70px); height: calc(100% - 70px);
overflow: auto; overflow: auto;
...@@ -265,6 +265,7 @@ export default { ...@@ -265,6 +265,7 @@ export default {
} }
.card_image{ .card_image{
width: 165px; width: 165px;
height: 127px;
} }
.metaModelList{ .metaModelList{
width: 100%; width: 100%;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!