Commit dfe125c9 by 史敦盼

fixed bug

1 parent 06db696a
...@@ -6,13 +6,71 @@ const initDrawioGraph = function (that) { ...@@ -6,13 +6,71 @@ const initDrawioGraph = function (that) {
that.loadFile(`-2`, true, file) that.loadFile(`-2`, true, file)
} else { } else {
// const jsonToGraph = JSON.parse(localStorage.getItem('jsonToGraph'))
// console.log('jsonToGraph', JSON.parse(jsonToGraph))
// console.log('that', that)
const xmlData = localStorage.getItem('xmlData') const xmlData = localStorage.getItem('xmlData')
const xmlTitle = localStorage.getItem('xmlTitle') const xmlTitle = localStorage.getItem('xmlTitle')
const file = new LocalFile(that, xmlData, xmlTitle, that.mode) const file = new LocalFile(that, xmlData, xmlTitle, that.mode)
that.loadFile(`-1`, true, file) that.loadFile(`-1`, true, file)
// return
// const xmlCellList = []
// jsonToGraph.forEach(v => {
// let cellObj = {
// sourceIconName: null,
// targetIconName: null
// }
// for (const key in v) {
// if (Object.hasOwnProperty.call(v, key)) {
// const element = v[key];
// if(key === 'sourceIconName' || key === 'targetIconName'){
// var xml = atob(element)
// var doc = mxUtils.parseXml(xml);
// var node = Editor.extractGraphModel(doc.documentElement, true);
// console.log('node', node);
// const xmlData = node.outerHTML
// console.log('xmlData', node.outerHTML)
// const file = new LocalFile(that, xmlData, xmlTitle, that.mode)
// that.loadFile(`-1`, true, file)
// const allCell = that.editor.graph.getDefaultParent().children
// cellObj[key] = allCell[0]
// }
// }
// }
// xmlCellList.push(cellObj)
// })
// console.log('xmlCellList', xmlCellList)
// return
// var xml = atob('PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2ZXJzaW9uPSIxLjEiIHdpZHRoPSI3MXB4IiBoZWlnaHQ9IjQxcHgiIHZpZXdCb3g9Ii0wLjUgLTAuNSA3MSA0MSIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6IHJnYigyNTUsIDI1NSwgMjU1KTsiPjxkZWZzLz48Zz48cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iNzAiIGhlaWdodD0iNDAiIHJ4PSI2IiByeT0iNiIgZmlsbD0iI2ZmZmU1NSIgc3Ryb2tlPSIjYjA5NTAwIiBwb2ludGVyLWV2ZW50cz0iYWxsIi8+PHBhdGggZD0iTSA2MCAxNCBMIDY1IDQgTCA3MCAxNCBaIiBmaWxsPSJyZ2IoMjU1LCAyNTUsIDI1NSkiIHN0cm9rZT0icmdiKDAsIDAsIDApIiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIHBvaW50ZXItZXZlbnRzPSJhbGwiLz48L2c+PC9zdmc+')
// // var xml = atob('PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IS0tIERvIG5vdCBlZGl0IHRoaXMgZmlsZSB3aXRoIGVkaXRvcnMgb3RoZXIgdGhhbiBkcmF3LmlvIC0tPjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2ZXJzaW9uPSIxLjEiIHdpZHRoPSIxMjJweCIgaGVpZ2h0PSI2MnB4IiB2aWV3Qm94PSItMC41IC0wLjUgMTIyIDYyIiBjb250ZW50PSImbHQ7bXhmaWxlIGhvc3Q9JnF1b3Q7bG9jYWxob3N0JnF1b3Q7IG1vZGlmaWVkPSZxdW90OzIwMjQtMDEtMTVUMDc6MTE6MDQuMTM3WiZxdW90OyBhZ2VudD0mcXVvdDtNb3ppbGxhLzUuMCAoV2luZG93cyBOVCAxMC4wOyBXaW42NDsgeDY0KSBBcHBsZVdlYktpdC81MzcuMzYgKEtIVE1MLCBsaWtlIEdlY2tvKSBDaHJvbWUvMTIwLjAuMC4wIFNhZmFyaS81MzcuMzYgRWRnLzEyMC4wLjAuMCZxdW90OyB2ZXJzaW9uPSZxdW90O0BEUkFXSU8tVkVSU0lPTkAmcXVvdDsgZXRhZz0mcXVvdDtxT0NveS1YVVJURndURVUtWHY2XyZxdW90OyB0eXBlPSZxdW90O2RldmljZSZxdW90OyZndDsmbHQ7ZGlhZ3JhbSBpZD0mcXVvdDtxSTJ3VmFRUXcwX0FvRG1jVHlXaiZxdW90OyBuYW1lPSZxdW90O+esrCAxIOmhtSZxdW90OyZndDtqWlBCYm9Nd0RJYWZodU9taGhTMkhWdGF1c3VrVGEzVTNhYUl1Q1JTSUN3TkEvYjBjeUNVb3FyU1RqaGYvaml4L1JQUXBHaDNobFhpVFhOUVFiamdiVUEzUVJnU0dzYjRjYVFiU0xSOEdVQnVKUGVpQ2V6bEwzaTQ4TFNXSE00em9kVmFXVm5OWWFiTEVqSTdZOHdZM2N4bEo2M210MVlzaHh1d3o1aTZwVWZKclJqb2MvZzA4VmVRdVJodkpyR3ZyMkNqMkZkeUZvenI1Z3JSYlVBVG83VWRvcUpOUUxubWpYMFp6cVYzZGk4UE0xRGEveHc0OHZjVGZCN0FLbDNzeUZmSFB3UThrT1dRNW9lcDJsZnNYMnU3c1FYQ0Znb2pFdEMxcnEyU0pTU1haaThRTmtKYTJGY3NjL29HYllEc0pKVkt0TkttVDBGWGFacXU4R0ZyYkVMbFpFV2JPNzg4TXBNSmlhMEMrc2lxU3NtTVdhbExGT0xxMFBYU0VqM2xnRk42ZFA2dXNXeUVnYk1YSmRTRjl5OWwxdllvV2dmUnh0Y0x4a0o3dDVQa01oODBOdWdDck9sUTRnL1F5SS9VZXpxTS9icVpIRUxHdE9MS0hmRm9URy9LL0pKNm1oc0dmblRqY3JKSXYzZjFvOUh0SHc9PSZsdDsvZGlhZ3JhbSZndDsmbHQ7L214ZmlsZSZndDsiIHN0eWxlPSJiYWNrZ3JvdW5kLWNvbG9yOiByZ2IoMjU1LCAyNTUsIDI1NSk7Ij48ZGVmcy8+PGc+PHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEyMSIgaGVpZ2h0PSI2MSIgZmlsbD0iI0ZGM0IzMCIgc3Ryb2tlPSJyZ2IoMCwgMCwgMCkiIHBvaW50ZXItZXZlbnRzPSJhbGwiLz48cGF0aCBkPSJNIDEwMSA4Ljc1IEwgMTA0Ljc1IDUgTCAxMTYgNSBMIDExNiAxNi4yNSBMIDExMi4yNSAyMCBMIDEwMSAyMCBaIE0gMTAxIDguNzUgTCAxMTIuMjUgOC43NSBMIDExMi4yNSAyMCBNIDExNiA1IEwgMTEyLjI1IDguNzUiIGZpbGw9IiNGRjNCMzAiIHN0cm9rZT0icmdiKDAsIDAsIDApIiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIHBvaW50ZXItZXZlbnRzPSJhbGwiLz48L2c+PC9zdmc+');
// console.log('xml', xml)
// var doc = mxUtils.parseXml(xml);
// var node = Editor.extractGraphModel(doc.documentElement, true);
// // var xmlDoc = node.ownerDocument;
// console.log('node', node);
// // console.log('xmlDoc', xmlDoc);
// // console.log('doc.documentElement', `<mxGraphModel dx="2219" dy="1878" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
// // <root>` + node.innerHTML + `</root></mxGraphModel>`);
// const xmlData2 = node.outerHTML
// // console.log('xmlData', xmlData)
// console.log('xmlData2', node.outerHTML)
// const file2 = new LocalFile(that, xmlData2, xmlTitle, that.mode)
// // graph.setXml(xmlData2)
// that.loadFile(`-1`, true, file2)
// // console.log('getModel', that.editor.graph.getChildCells(that.editor.graph.getDefaultParent(), true, true))
// const allCell = that.editor.graph.getDefaultParent().children
// console.log('allCell', allCell)
// console.log('doc', doc.documentElement, that.editor.graph.getModel())
// console.log('set', Editor.prototype.setGraphXml(doc.documentElement))
// // 从XML数据中还原图形状态
// var decoder = new mxCodec(xmlDoc);
// decoder.decode(xmlDoc, that.editor.graph.getModel());
// // 自适应大小
// that.editor.graph.fit();
} }
window.onmessage = (e) => { window.onmessage = (e) => {
//监听vue页面的图形选择窗口给drawio画布传的属性传递 //监听vue页面的图形选择窗口给drawio画布传的属性传递
if (e.data.type == 'propertyReceive') { if (e.data.type == 'propertyReceive') {
...@@ -248,6 +306,8 @@ const leftCustomGraph = function (that) { ...@@ -248,6 +306,8 @@ const leftCustomGraph = function (that) {
if (joinGraph_.state == 1) { if (joinGraph_.state == 1) {
// 标准图元 // 标准图元
joinGraph.pop() joinGraph.pop()
Sidebar.prototype.sidebarTitles = true;//勾选标签
// Sidebar.prototype.createEdgeTemplateEntry
joinGraph.forEach(function (item, index) { joinGraph.forEach(function (item, index) {
if (item.eleDtos) { if (item.eleDtos) {
if (item.eleDtos.length > 0) { if (item.eleDtos.length > 0) {
...@@ -265,7 +325,7 @@ const leftCustomGraph = function (that) { ...@@ -265,7 +325,7 @@ const leftCustomGraph = function (that) {
var xml = that.createLibraryDataFromImages(images) var xml = that.createLibraryDataFromImages(images)
var file = new LocalLibrary(that, xml, libraryName) var file = new LocalLibrary(that, xml, libraryName)
that.libraryLoaded(file, images, null, false) that.libraryLoaded(file, images, null, true)
} else { } else {
} }
} }
......
...@@ -1041,109 +1041,112 @@ ...@@ -1041,109 +1041,112 @@
} }
} }
} }
// 二次开发-画布只保留五大架构元素关系图标
const joinGraph_ = JSON.parse(localStorage.getItem('joinGraph'));
if(joinGraph_.state == 2) {
this.addGeneralPalette(this.customEntries == null);//通用图形
}
// this.addMiscPalette(false); //杂项图形
// this.addAdvancedPalette(false);//高级图形
// this.addBasicPalette();//基本图形
// this.addStencilPalette('arrows', mxResources.get('arrows'), dir + '/arrows.xml',
// ';html=1;' + mxConstants.STYLE_VERTICAL_LABEL_POSITION + '=bottom;' + mxConstants.STYLE_VERTICAL_ALIGN + '=top;' + mxConstants.STYLE_STROKEWIDTH + '=2;strokeColor=#000000;',
// null, null, null, null, null, 'arrows');
// this.addArrows2Palette();//箭头图形
this.addGeneralPalette(this.customEntries == null);//通用图形 // this.setCurrentSearchEntryLibrary('clipart', 'computer');
this.addMiscPalette(false); //杂项图形 // this.addImagePalette('computer', 'Clipart / Computer', imgDir
this.addAdvancedPalette(false);//高级图形 // + '/lib/clip_art/computers/', '_128x128.png', ['Antivirus',
this.addBasicPalette();//基本图形 // 'Data_Filtering', 'Database', 'Database_Add', 'Database_Minus',
this.addStencilPalette('arrows', mxResources.get('arrows'), dir + '/arrows.xml', // 'Database_Move_Stack', 'Database_Remove', 'Fujitsu_Tablet',
';html=1;' + mxConstants.STYLE_VERTICAL_LABEL_POSITION + '=bottom;' + mxConstants.STYLE_VERTICAL_ALIGN + '=top;' + mxConstants.STYLE_STROKEWIDTH + '=2;strokeColor=#000000;', // 'Harddrive', 'IBM_Tablet', 'iMac', 'iPad', 'Laptop', 'MacBook',
null, null, null, null, null, 'arrows'); // 'Mainframe', 'Monitor', 'Monitor_Tower',
this.addArrows2Palette();//箭头图形 // 'Monitor_Tower_Behind', 'Netbook', 'Network', 'Network_2',
// 'Printer', 'Printer_Commercial', 'Secure_System', 'Server',
// 'Server_Rack', 'Server_Rack_Empty', 'Server_Rack_Partial',
// 'Server_Tower', 'Software', 'Stylus', 'Touch', 'USB_Hub',
// 'Virtual_Application', 'Virtual_Machine', 'Virus',
// 'Workstation' ], [ 'Antivirus', 'Data Filtering', 'Database',
// 'Database Add', 'Database Minus', 'Database Move Stack',
// 'Database Remove', 'Fujitsu Tablet', 'Harddrive', 'IBMTablet',
// 'iMac', 'iPad', 'Laptop', 'MacBook', 'Mainframe', 'Monitor',
// 'Monitor Tower', 'Monitor Tower Behind', 'Netbook', 'Network',
// 'Network 2', 'Printer', 'Printer Commercial', 'Secure System',
// 'Server', 'Server Rack', 'Server Rack Empty', 'Server Rack Partial',
// 'Server Tower', 'Software', 'Stylus', 'Touch', 'USB Hub',
// 'Virtual Application', 'Virtual Machine', 'Virus', 'Workstation']);
this.setCurrentSearchEntryLibrary('clipart', 'computer'); // this.setCurrentSearchEntryLibrary('clipart', 'finance');
this.addImagePalette('computer', 'Clipart / Computer', imgDir // this.addImagePalette('finance', 'Clipart / Finance', imgDir
+ '/lib/clip_art/computers/', '_128x128.png', ['Antivirus', // + '/lib/clip_art/finance/', '_128x128.png', [ 'Arrow_Down',
'Data_Filtering', 'Database', 'Database_Add', 'Database_Minus', // 'Arrow_Up', 'Coins', 'Credit_Card', 'Dollar', 'Graph',
'Database_Move_Stack', 'Database_Remove', 'Fujitsu_Tablet', // 'Pie_Chart', 'Piggy_Bank', 'Safe', 'Shopping_Cart',
'Harddrive', 'IBM_Tablet', 'iMac', 'iPad', 'Laptop', 'MacBook', // 'Stock_Down', 'Stock_Up'], ['Arrow_Down', 'Arrow Up',
'Mainframe', 'Monitor', 'Monitor_Tower', // 'Coins', 'Credit Card', 'Dollar', 'Graph', 'Pie Chart',
'Monitor_Tower_Behind', 'Netbook', 'Network', 'Network_2', // 'Piggy Bank', 'Safe', 'Shopping Basket', 'Stock Down', 'Stock Up']);
'Printer', 'Printer_Commercial', 'Secure_System', 'Server',
'Server_Rack', 'Server_Rack_Empty', 'Server_Rack_Partial',
'Server_Tower', 'Software', 'Stylus', 'Touch', 'USB_Hub',
'Virtual_Application', 'Virtual_Machine', 'Virus',
'Workstation' ], [ 'Antivirus', 'Data Filtering', 'Database',
'Database Add', 'Database Minus', 'Database Move Stack',
'Database Remove', 'Fujitsu Tablet', 'Harddrive', 'IBMTablet',
'iMac', 'iPad', 'Laptop', 'MacBook', 'Mainframe', 'Monitor',
'Monitor Tower', 'Monitor Tower Behind', 'Netbook', 'Network',
'Network 2', 'Printer', 'Printer Commercial', 'Secure System',
'Server', 'Server Rack', 'Server Rack Empty', 'Server Rack Partial',
'Server Tower', 'Software', 'Stylus', 'Touch', 'USB Hub',
'Virtual Application', 'Virtual Machine', 'Virus', 'Workstation']);
this.setCurrentSearchEntryLibrary('clipart', 'finance'); // this.setCurrentSearchEntryLibrary('clipart', 'clipart');
this.addImagePalette('finance', 'Clipart / Finance', imgDir // this.addImagePalette('clipart', 'Clipart / Various', imgDir
+ '/lib/clip_art/finance/', '_128x128.png', [ 'Arrow_Down', // + '/lib/clip_art/general/', '_128x128.png', [ 'Battery_0',
'Arrow_Up', 'Coins', 'Credit_Card', 'Dollar', 'Graph', // 'Battery_100', 'Battery_50', 'Battery_75', 'Battery_allstates',
'Pie_Chart', 'Piggy_Bank', 'Safe', 'Shopping_Cart', // 'Bluetooth', 'Earth_globe', 'Empty_Folder', 'Full_Folder',
'Stock_Down', 'Stock_Up'], ['Arrow_Down', 'Arrow Up', // 'Gear', 'Keys', 'Lock', 'Mouse_Pointer', 'Plug', 'Ships_Wheel',
'Coins', 'Credit Card', 'Dollar', 'Graph', 'Pie Chart', // 'Star', 'Tire' ], [ 'Battery 0%', 'Battery 100%', 'Battery 50%',
'Piggy Bank', 'Safe', 'Shopping Basket', 'Stock Down', 'Stock Up']); // 'Battery 75%', 'Battery', 'Bluetooth', 'Globe',
// 'Empty Folder', 'Full Folder', 'Gear', 'Keys', 'Lock', 'Mousepointer',
// 'Plug', 'Ships Wheel', 'Star', 'Tire']);
this.setCurrentSearchEntryLibrary('clipart', 'clipart'); // this.setCurrentSearchEntryLibrary('clipart', 'networking');
this.addImagePalette('clipart', 'Clipart / Various', imgDir // this.addImagePalette('networking', 'Clipart / Networking', imgDir
+ '/lib/clip_art/general/', '_128x128.png', [ 'Battery_0', // + '/lib/clip_art/networking/', '_128x128.png', ['Bridge',
'Battery_100', 'Battery_50', 'Battery_75', 'Battery_allstates', // 'Certificate', 'Certificate_Off', 'Cloud', 'Cloud_Computer',
'Bluetooth', 'Earth_globe', 'Empty_Folder', 'Full_Folder', // 'Cloud_Computer_Private', 'Cloud_Rack', 'Cloud_Rack_Private',
'Gear', 'Keys', 'Lock', 'Mouse_Pointer', 'Plug', 'Ships_Wheel', // 'Cloud_Server', 'Cloud_Server_Private', 'Cloud_Storage',
'Star', 'Tire' ], [ 'Battery 0%', 'Battery 100%', 'Battery 50%', // 'Concentrator', 'Email', 'Firewall_02', 'Firewall',
'Battery 75%', 'Battery', 'Bluetooth', 'Globe', // 'Firewall-page1', 'Ip_Camera', 'Modem',
'Empty Folder', 'Full Folder', 'Gear', 'Keys', 'Lock', 'Mousepointer', // 'power_distribution_unit', 'Print_Server',
'Plug', 'Ships Wheel', 'Star', 'Tire']); // 'Print_Server_Wireless', 'Repeater', 'Router', 'Router_Icon',
// 'Switch', 'UPS', 'Wireless_Router', 'Wireless_Router_N'],
// ['Bridge', 'Certificate', 'Certificate Off', 'Cloud', 'Cloud Computer',
// 'Cloud Computer Private', 'Cloud Rack', 'Cloud Rack Private',
// 'Cloud Server', 'Cloud Server Private', 'Cloud Storage',
// 'Concentrator', 'Email', 'Firewall 1', 'Firewall 2',
// 'Firewall', 'Camera', 'Modem',
// 'Power Distribution Unit', 'Print Server',
// 'Print Server Wireless', 'Repeater', 'Router', 'Router Icon',
// 'Switch', 'UPS', 'Wireless Router', 'Wireless Router N'],
// {'Wireless_Router': 'wireless router switch wap wifi access point wlan',
// 'Wireless_Router_N': 'wireless router switch wap wifi access point wlan',
// 'Router': 'router switch',
// 'Router_Icon': 'router switch'});
this.setCurrentSearchEntryLibrary('clipart', 'networking'); // this.setCurrentSearchEntryLibrary('clipart', 'people');
this.addImagePalette('networking', 'Clipart / Networking', imgDir // this.addImagePalette('people', 'Clipart / People', imgDir
+ '/lib/clip_art/networking/', '_128x128.png', ['Bridge', // + '/lib/clip_art/people/', '_128x128.png', ['Suit_Man',
'Certificate', 'Certificate_Off', 'Cloud', 'Cloud_Computer', // 'Suit_Man_Black', 'Suit_Man_Blue', 'Suit_Man_Green',
'Cloud_Computer_Private', 'Cloud_Rack', 'Cloud_Rack_Private', // 'Suit_Man_Green_Black', 'Suit_Woman', 'Suit_Woman_Black',
'Cloud_Server', 'Cloud_Server_Private', 'Cloud_Storage', // 'Suit_Woman_Blue', 'Suit_Woman_Green',
'Concentrator', 'Email', 'Firewall_02', 'Firewall', // 'Suit_Woman_Green_Black', 'Construction_Worker_Man',
'Firewall-page1', 'Ip_Camera', 'Modem', // 'Construction_Worker_Man_Black', 'Construction_Worker_Woman',
'power_distribution_unit', 'Print_Server', // 'Construction_Worker_Woman_Black', 'Doctor_Man',
'Print_Server_Wireless', 'Repeater', 'Router', 'Router_Icon', // 'Doctor_Man_Black', 'Doctor_Woman', 'Doctor_Woman_Black',
'Switch', 'UPS', 'Wireless_Router', 'Wireless_Router_N'], // 'Farmer_Man', 'Farmer_Man_Black', 'Farmer_Woman',
['Bridge', 'Certificate', 'Certificate Off', 'Cloud', 'Cloud Computer', // 'Farmer_Woman_Black', 'Nurse_Man', 'Nurse_Man_Black',
'Cloud Computer Private', 'Cloud Rack', 'Cloud Rack Private', // 'Nurse_Woman',
'Cloud Server', 'Cloud Server Private', 'Cloud Storage', // 'Nurse_Woman_Black',
'Concentrator', 'Email', 'Firewall 1', 'Firewall 2', // 'Military_Officer', 'Military_Officer_Black',
'Firewall', 'Camera', 'Modem', // 'Military_Officer_Woman', 'Military_Officer_Woman_Black',
'Power Distribution Unit', 'Print Server', // 'Pilot_Man', 'Pilot_Man_Black', 'Pilot_Woman',
'Print Server Wireless', 'Repeater', 'Router', 'Router Icon', // 'Pilot_Woman_Black', 'Scientist_Man', 'Scientist_Man_Black',
'Switch', 'UPS', 'Wireless Router', 'Wireless Router N'], // 'Scientist_Woman', 'Scientist_Woman_Black', 'Security_Man',
{'Wireless_Router': 'wireless router switch wap wifi access point wlan', // 'Security_Man_Black', 'Security_Woman', 'Security_Woman_Black',
'Wireless_Router_N': 'wireless router switch wap wifi access point wlan', // 'Tech_Man', 'Tech_Man_Black',
'Router': 'router switch', // 'Telesales_Man', 'Telesales_Man_Black', 'Telesales_Woman',
'Router_Icon': 'router switch'}); // 'Telesales_Woman_Black', 'Waiter', 'Waiter_Black',
// 'Waiter_Woman', 'Waiter_Woman_Black', 'Worker_Black',
// 'Worker_Man', 'Worker_Woman', 'Worker_Woman_Black']);
this.setCurrentSearchEntryLibrary('clipart', 'people'); // this.setCurrentSearchEntryLibrary('clipart', 'telco');
this.addImagePalette('people', 'Clipart / People', imgDir
+ '/lib/clip_art/people/', '_128x128.png', ['Suit_Man',
'Suit_Man_Black', 'Suit_Man_Blue', 'Suit_Man_Green',
'Suit_Man_Green_Black', 'Suit_Woman', 'Suit_Woman_Black',
'Suit_Woman_Blue', 'Suit_Woman_Green',
'Suit_Woman_Green_Black', 'Construction_Worker_Man',
'Construction_Worker_Man_Black', 'Construction_Worker_Woman',
'Construction_Worker_Woman_Black', 'Doctor_Man',
'Doctor_Man_Black', 'Doctor_Woman', 'Doctor_Woman_Black',
'Farmer_Man', 'Farmer_Man_Black', 'Farmer_Woman',
'Farmer_Woman_Black', 'Nurse_Man', 'Nurse_Man_Black',
'Nurse_Woman',
'Nurse_Woman_Black',
'Military_Officer', 'Military_Officer_Black',
'Military_Officer_Woman', 'Military_Officer_Woman_Black',
'Pilot_Man', 'Pilot_Man_Black', 'Pilot_Woman',
'Pilot_Woman_Black', 'Scientist_Man', 'Scientist_Man_Black',
'Scientist_Woman', 'Scientist_Woman_Black', 'Security_Man',
'Security_Man_Black', 'Security_Woman', 'Security_Woman_Black',
'Tech_Man', 'Tech_Man_Black',
'Telesales_Man', 'Telesales_Man_Black', 'Telesales_Woman',
'Telesales_Woman_Black', 'Waiter', 'Waiter_Black',
'Waiter_Woman', 'Waiter_Woman_Black', 'Worker_Black',
'Worker_Man', 'Worker_Woman', 'Worker_Woman_Black']);
this.setCurrentSearchEntryLibrary('clipart', 'telco');
this.addImagePalette('telco', 'Clipart / Telecommunication', imgDir this.addImagePalette('telco', 'Clipart / Telecommunication', imgDir
+ '/lib/clip_art/telecommunication/', '_128x128.png', [ + '/lib/clip_art/telecommunication/', '_128x128.png', [
'BlackBerry', 'Cellphone', 'HTC_smartphone', 'iPhone', 'BlackBerry', 'Cellphone', 'HTC_smartphone', 'iPhone',
...@@ -1152,62 +1155,62 @@ ...@@ -1152,62 +1155,62 @@
'Palm Treo', 'Signaltower off', 'Signaltower on']); 'Palm Treo', 'Signaltower off', 'Signaltower on']);
this.setCurrentSearchEntryLibrary(); this.setCurrentSearchEntryLibrary();
this.addFlowchartPalette();//流程图图形 // this.addFlowchartPalette();//流程图图形
this.addActiveDirectoryPalette(); // this.addActiveDirectoryPalette();
this.addAndroidPalette(); // this.addAndroidPalette();
this.addAtlassianPalette(); // this.addAtlassianPalette();
this.addBootstrapPalette(); // this.addBootstrapPalette();
this.addDFDPalette(); // this.addDFDPalette();
this.addErPalette();//实体关系图形 // this.addErPalette();//实体关系图形
this.addIos7Palette(); // this.addIos7Palette();
this.addIosPalette(); // this.addIosPalette();
this.addKubernetesPalette(); // this.addKubernetesPalette();
this.addMockupPalette(); // this.addMockupPalette();
this.addSitemapPalette(); // this.addSitemapPalette();
this.addSalesforcePalette(); // this.addSalesforcePalette();
this.addUml25Palette(); // this.addUml25Palette();
this.addUmlPalette(false);//UML图形 // this.addUmlPalette(false);//UML图形
this.addAlliedTelesisPalette(); // this.addAlliedTelesisPalette();
this.addAWS3Palette(); // this.addAWS3Palette();
this.addAWS4bPalette(); // this.addAWS4bPalette();
this.addAWS4Palette(); // this.addAWS4Palette();
this.addAWS3DPalette(); // this.addAWS3DPalette();
this.addAzurePalette(); // this.addAzurePalette();
this.addAzure2Palette(); // this.addAzure2Palette();
this.addMSCAEPalette(); // this.addMSCAEPalette();
this.addC4Palette(); // this.addC4Palette();
this.addCiscoPalette(cisco, dir); // this.addCiscoPalette(cisco, dir);
this.addCisco19Palette(); // this.addCisco19Palette();
this.addCiscoSafePalette(); // this.addCiscoSafePalette();
this.addCumulusPalette(); // this.addCumulusPalette();
this.addCitrixPalette(); // this.addCitrixPalette();
this.addGCP2Palette(); // this.addGCP2Palette();
this.addGCPIconsPalette(); // this.addGCPIconsPalette();
this.addIBMPalette(); // this.addIBMPalette();
this.addNetworkPalette(); // this.addNetworkPalette();
this.addOfficePalette(); // this.addOfficePalette();
this.addRackPalette(rack, dir); // this.addRackPalette(rack, dir);
this.addVeeamPalette(); // this.addVeeamPalette();
this.addVeeam2Palette(); // this.addVeeam2Palette();
this.addVVDPalette(); // this.addVVDPalette();
this.addArchimate3Palette(); // this.addArchimate3Palette();
// this.addArchimate4Palette(); // // this.addArchimate4Palette();
this.addArchiMatePalette(); // this.addArchiMatePalette();
this.addBpmn2Palette(); // this.addBpmn2Palette();
this.addSysMLPalette(sysml, dir); // this.addSysMLPalette(sysml, dir);
this.addLeanMappingPalette(); // this.addLeanMappingPalette();
this.addCabinetsPalette(); // this.addCabinetsPalette();
this.addInfographicPalette(); // this.addInfographicPalette();
this.addEipPalette(); // this.addEipPalette();
this.addElectricalPalette(); // this.addElectricalPalette();
this.addFloorplanPalette(); // this.addFloorplanPalette();
this.addFluidPowerPalette(); // this.addFluidPowerPalette();
this.addGMDLPalette(); // this.addGMDLPalette();
this.addPidPalette(pids, dir); // this.addPidPalette(pids, dir);
this.addThreatModelingPalette(); // this.addThreatModelingPalette();
this.addWebIconsPalette(); // this.addWebIconsPalette();
this.addWebLogosPalette(); // this.addWebLogosPalette();
this.addSignsPalette(signs, dir); // this.addSignsPalette(signs, dir);
this.addCustomGraph(); //二次开发,增加动态读取架构设计要素 this.addCustomGraph(); //二次开发,增加动态读取架构设计要素
// LATER: Check if conflicts with restore libs after loading file // LATER: Check if conflicts with restore libs after loading file
this.showEntries(); this.showEntries();
......
...@@ -31,9 +31,9 @@ function Sidebar(editorUi, container) ...@@ -31,9 +31,9 @@ function Sidebar(editorUi, container)
this.wrapper.style.boxSizing = 'border-box'; this.wrapper.style.boxSizing = 'border-box';
this.wrapper.style.maxHeight = 'calc(100% - ' + this.moreShapesHeight + 'px)'; this.wrapper.style.maxHeight = 'calc(100% - ' + this.moreShapesHeight + 'px)';
this.container.appendChild(this.wrapper); this.container.appendChild(this.wrapper);
/* 二次开发-去除更多图形按钮 */
var title = this.createMoreShapes(); // var title = this.createMoreShapes();
this.container.appendChild(title); // this.container.appendChild(title);
document.body.appendChild(this.graph.container); document.body.appendChild(this.graph.container);
...@@ -3777,6 +3777,14 @@ Sidebar.prototype.addClickHandler = function(elt, ds, cells, clickFn) ...@@ -3777,6 +3777,14 @@ Sidebar.prototype.addClickHandler = function(elt, ds, cells, clickFn)
// console.log(assetName); // console.log(assetName);
cells[0].value = assetName; cells[0].value = assetName;
} }
// 二次开发-元模型管理详情
console.log(evt, cells[0])
if(evt.target.text) {
cells[0].value = evt.target.text;
cells[0].style = cells[0].style.replace('fontColor=#ffffff;', 'fontColor=#000000')
// cells[0].geometry.x = 0
// cells[0].geometry.y = 0
}
oldMouseDown.apply(this, arguments); oldMouseDown.apply(this, arguments);
first = new mxPoint(mxEvent.getClientX(evt), mxEvent.getClientY(evt)); first = new mxPoint(mxEvent.getClientX(evt), mxEvent.getClientY(evt));
op = elt.style.opacity; op = elt.style.opacity;
......
...@@ -792,6 +792,13 @@ export function updKlPerson(params) { ...@@ -792,6 +792,13 @@ export function updKlPerson(params) {
export function delKlPerson(params) { export function delKlPerson(params) {
return post(EADC_KNOWLEDGE_POOL + '/kl-talent-pool/del', params) return post(EADC_KNOWLEDGE_POOL + '/kl-talent-pool/del', params)
} }
export function getJsonToXml(params) {
return post(EADC_ARRCHITECTURE + '/ele-rel/qEle', params)
}
export function getQryByTree(params) {
return post(EADC_ARRCHITECTURE + '/arc-ast-info/qryByTree', params)
}
export function postRequest(url, params) { export function postRequest(url, params) {
return post(EADC_ARRCHITECTURE + url, params) return post(EADC_ARRCHITECTURE + url, params)
} }
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
v-for="tag in visitedViews" v-for="tag in visitedViews"
ref="tag" ref="tag"
:key="tag.path" :key="tag.path"
:class="isActive(tag) ? 'active' : ''" :class="[isActive(tag) ? 'active' : '', {'length1': visitedViews.length == 1}]"
:to="{ path: tag.path, query: tag.query, fullPath: tag.fullPath }" :to="{ path: tag.path, query: tag.query, fullPath: tag.fullPath }"
tag="span" tag="span"
class="tags-view-item" class="tags-view-item"
...@@ -20,12 +20,12 @@ ...@@ -20,12 +20,12 @@
/> />
</router-link> </router-link>
</scroll-pane> </scroll-pane>
<!-- <ul v-show="visible" :style="{left:left+'px',top:top+'px'}" class="contextmenu"> <ul v-show="visible" :style="{left:left+'px',top:top+'px'}" class="contextmenu">
<li @click="refreshSelectedTag(selectedTag)">Refresh</li> <li @click="refreshSelectedTag(selectedTag)">刷新</li>
<li v-if="!isAffix(selectedTag)" @click="closeSelectedTag(selectedTag)">Close</li> <li v-if="!isAffix(selectedTag)" @click="closeSelectedTag(selectedTag)">关闭</li>
<li @click="closeOthersTags(selectedTag)">Close Others</li> <li @click="closeOthersTags(selectedTag)">关闭其他</li>
<li @click="closeAllTags(selectedTag)">Close All</li> <!-- <li @click="closeAllTags(selectedTag)">关闭所有</li> -->
</ul> --> </ul>
</div> </div>
</template> </template>
...@@ -233,6 +233,9 @@ export default { ...@@ -233,6 +233,9 @@ export default {
/deep/ .scroll-container .el-scrollbar__wrap { /deep/ .scroll-container .el-scrollbar__wrap {
scrollbar-width: none; scrollbar-width: none;
} }
.length1 {
padding-right: 20px!important;
}
.tags-view-container { .tags-view-container {
height: 34px; height: 34px;
width: 100%; width: 100%;
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
class="filter-tree" class="filter-tree"
:data="treeData" :data="treeData"
:highlight-current="true" :highlight-current="true"
:props="{ children: 'subList', label: 'viewName', id: 'viewId' }" :props="{ children: 'children', label: 'viewName', id: 'viewId' }"
node-key="viewId" node-key="viewId"
:default-expanded-keys="treeDefaultExpand" :default-expanded-keys="treeDefaultExpand"
:current-node-key="currentNodekey" :current-node-key="currentNodekey"
...@@ -693,7 +693,7 @@ ...@@ -693,7 +693,7 @@
style="overflow-x: auto; display: flex" style="overflow-x: auto; display: flex"
> >
<el-checkbox <el-checkbox
v-for="city in item.subList" v-for="city in item.children"
:label="city.assetId" :label="city.assetId"
:key="city.assetId" :key="city.assetId"
>{{ city.assetName }}</el-checkbox >{{ city.assetName }}</el-checkbox
...@@ -745,7 +745,7 @@ export default { ...@@ -745,7 +745,7 @@ export default {
{ {
viewId: 0, viewId: 0,
viewName: '系统架构资产', viewName: '系统架构资产',
subList: [], children: [],
}, },
], ],
searchParams: { searchParams: {
...@@ -842,7 +842,28 @@ export default { ...@@ -842,7 +842,28 @@ export default {
this.jianSheLeiXingSelect = res this.jianSheLeiXingSelect = res
}) })
}, },
created() {
// 默认选中第一个系统
this.getDefaultSys()
},
methods: { methods: {
getDefaultSys() {
const params = {
manageOrgId: this.searchParams2.let1,
manageDeptId: this.searchParams2.let2,
appName: this.searchParams2.let3,
buildType: this.searchParams2.let4,
current: this.pager2.current,
pageSize: this.pager2.size,
}
querysystemInfoManageTable(params).then((res) => {
if (res.code == 200) {
this.selectRow2 = [res.data.records[0]]
this.showSelectTitle.title = this.selectRow2[0].appName
this.showSelectTitle.status = this.selectRow2[0].buildType == 1 ? '统推' : '自建'
}
})
},
indexMethod(index) { indexMethod(index) {
return (this.pager.current - 1) * this.pager.size + index + 1 return (this.pager.current - 1) * this.pager.size + index + 1
}, },
...@@ -884,9 +905,9 @@ export default { ...@@ -884,9 +905,9 @@ export default {
this.$refs.tree.setCurrentKey(this.currentNodekey) this.$refs.tree.setCurrentKey(this.currentNodekey)
}) })
res.data.map((item) => { res.data.map((item) => {
item.subList = [] item.children = []
}) })
this.treeData[0].subList = res.data this.treeData[0].children = res.data
this.archiBelongId = res.data[0].viewId this.archiBelongId = res.data[0].viewId
this.archiType = res.data[0].archiType this.archiType = res.data[0].archiType
this.get_table() this.get_table()
...@@ -912,6 +933,7 @@ export default { ...@@ -912,6 +933,7 @@ export default {
pageSize: this.pager.size, pageSize: this.pager.size,
prjId: this.showSelectTitle.prjId, prjId: this.showSelectTitle.prjId,
appId: this.showSelectTitle.appId, appId: this.showSelectTitle.appId,
archiBelongId: this.archiBelongId
} }
this.loading = true this.loading = true
getTotalZiChanJiaGouTable(params).then((res) => { getTotalZiChanJiaGouTable(params).then((res) => {
...@@ -1100,7 +1122,7 @@ export default { ...@@ -1100,7 +1122,7 @@ export default {
handleCheckAllChange(val, item) { handleCheckAllChange(val, item) {
let cityOptions = [] let cityOptions = []
if (val) { if (val) {
item.subList.forEach((item2) => { item.children.forEach((item2) => {
cityOptions.push(item2.assetId) cityOptions.push(item2.assetId)
}) })
} else { } else {
...@@ -1111,9 +1133,9 @@ export default { ...@@ -1111,9 +1133,9 @@ export default {
}, },
handleCheckedCitiesChange(value, item) { handleCheckedCitiesChange(value, item) {
let checkedCount = value.length let checkedCount = value.length
item.checkAll = checkedCount === item.subList.length item.checkAll = checkedCount === item.children.length
item.isIndeterminate = item.isIndeterminate =
checkedCount > 0 && checkedCount < item.subList.length checkedCount > 0 && checkedCount < item.children.length
}, },
getElementTreeData(type) { getElementTreeData(type) {
//查询选择遵从总体架构资产类型数据 //查询选择遵从总体架构资产类型数据
......
<template>
<el-dialog
title="选择图形"
:visible.sync="showDialog"
:close-on-click-modal="false"
width="60%"
@open="handleOpen()"
:before-close="closeGraphDialog"
>
<div>
<el-tabs type="border-card" v-model="tabType">
<el-tab-pane label="常规图元" name="常规图元" style="height: 400px">
<div style="height: 400px; display: flex; align-items: center">
<div
style="
width: 20%;
height: 100%;
border-left: 1px solid #ccc;
border-top: 1px solid #ccc;
border-bottom: 1px solid #ccc;
overflow: auto;
text-align: center;
"
>
<div
:style="{
cursor: 'pointer',
padding: '4px',
'background-color':
nameIndex == index ? 'rgb(13,134,127)' : '#fff',
color: nameIndex == index ? '#fff' : '#000',
}"
v-for="(item, index) in search_select1"
:key="item.belongId"
@click="showCurrentGraph(item.name, index)"
>
{{ item.name }}
</div>
</div>
<div
style="
width: 80%;
height: 100%;
border: 1px solid #ccc;
overflow: auto;
text-align: left;
"
>
<div
:style="{
display: 'inline-block',
margin: '10px',
border: graphIndex == index ? '2px solid #0D867F' : 'none',
padding: '8px',
'border-radius': '6px',
}"
v-for="(item, index) in graphList"
:key="item.graphId"
>
<img
@click="clickGraph(index)"
class="tu_biao_icon"
:src="'data:image/svg+xml;base64,' + item.icon"
alt=""
/>
</div>
</div>
</div>
</el-tab-pane>
</el-tabs>
</div>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="save_graph">确定</el-button>
<el-button @click="closeGraphDialog">取消</el-button>
</span></el-dialog
>
</template>
<script>
import {
query_jia_gou_gui_shu_belong_icon,
query_jia_gou_gui_shu,
} from '@/api/index'
export default {
props: {
visible: {
type: Boolean,
default: false,
},
},
data() {
return {
tabType: '常规图元',
graphIndex: -1,
nameIndex: 0,
search_select1: [],
graphList: [],
}
},
components: {},
computed: {
showDialog: {
get() {
return this.visible
},
set(value) {
this.$emit('update:visible', value)
},
},
},
mounted() {},
methods: {
save_graph() {
//图形选择窗口的保存
if (this.graphIndex == -1 && this.graphIndex2 == -1) {
return this.$message.warning('请选择一种图形')
}
this.showDialog = false
const icon =
'data:image/svg+xml;base64,' + this.graphList[this.graphIndex].icon
const iconName = this.graphList[this.graphIndex].graphName
this.$emit('emitSvg', { icon, iconName })
},
closeGraphDialog() {
//图形选择窗口的取消
this.graphIndex = 0
this.nameIndex = 0
this.showDialog = false
},
showCurrentGraph(name, idx) {
//常规图形选择窗口的文字点击
this.nameIndex = idx
this.graphIndex = -1
const params = {
graphType: name,
}
query_jia_gou_gui_shu_belong_icon(params).then((res) => {
if (res.code == 200) {
this.graphList = res.data
}
})
},
clickGraph(idx) {
//常规图形选择窗口的图形点击
this.graphIndex = idx
},
handleOpen() {
query_jia_gou_gui_shu({}).then((res) => {
if (res.code == 200) {
this.search_select1 = res.data
this.showCurrentGraph(this.search_select1[0].name, 0)
} else {
this.$message.warning(res.msg)
}
})
},
},
}
</script>
<style scoped lang="scss">
@import '@/styles/elementui.scss';
</style>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<div class="search_menu"> <div class="search_menu">
<div class="search_menu_item_container"> <div class="search_menu_item_container">
<div class="search_menu_item"> <div class="search_menu_item">
<span class="search_title">架构组件名称</span> <span class="search_title">资产名称</span>
<el-input <el-input
v-no-backslash v-no-backslash
v-model="searchParams.assetName" v-model="searchParams.assetName"
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
></el-input> ></el-input>
</div> </div>
<div class="search_menu_item"> <div class="search_menu_item">
<span class="search_title">组件类型</span> <span class="search_title">所属元素</span>
<el-select <el-select
filterable filterable
remote remote
...@@ -57,6 +57,23 @@ ...@@ -57,6 +57,23 @@
></el-option> ></el-option>
</el-select> </el-select>
</div> </div>
<div class="search_menu_item">
<span class="search_title">状态</span>
<el-select
filterable
v-model="searchParams.state"
clearable
placeholder="请选择"
class="search_item"
>
<el-option
v-for="item in assetsStatusOptions"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</div>
</div> </div>
<div class="search_menu_btn_container"> <div class="search_menu_btn_container">
<div class="query_btn" @click="search_table"> <div class="query_btn" @click="search_table">
...@@ -141,28 +158,39 @@ ...@@ -141,28 +158,39 @@
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
prop="assetName" prop="assetName"
label="架构组件名称" label="资产名称"
width="300" width="300"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
align="center" align="center"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
prop="eleName" prop="eleName"
label="组件类型" label="所属元素"
align="center" align="center"
show-overflow-tooltip
></el-table-column> ></el-table-column>
<!-- <el-table-column prop="parentAssetName" label="上级架构组件名称" width="300" :show-overflow-tooltip="true" align="center"></el-table-column> --> <!-- <el-table-column prop="parentAssetName" label="上级资产名称" width="300" :show-overflow-tooltip="true" align="center"></el-table-column> -->
<el-table-column <el-table-column
prop="version" prop="version"
label="版本号" label="版本号"
align="center" align="center"
show-overflow-tooltip
></el-table-column> ></el-table-column>
<el-table-column label="状态" align="center"> <el-table-column
<template slot-scope="scope"> label="状态"
<span v-if="scope.row.state == 0">已停用</span> align="center"
<span v-if="scope.row.state == 1">已发布</span> prop="state"
<span v-if="scope.row.state == 2">暂存</span> :formatter="
</template> (row, column, cellValue, index) =>
formatterDept(
row,
column,
cellValue,
index,
'assetsStatusOptions',
)
"
>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="createTime" prop="createTime"
...@@ -242,6 +270,7 @@ ...@@ -242,6 +270,7 @@
:visible.sync="addDialog" :visible.sync="addDialog"
:center="false" :center="false"
:close-on-click-modal="false" :close-on-click-modal="false"
@close="handleDialogClose"
width="70%" width="70%"
> >
<el-form <el-form
...@@ -319,7 +348,6 @@ ...@@ -319,7 +348,6 @@
node-key="assetId" node-key="assetId"
show-checkbox show-checkbox
:check-strictly="true" :check-strictly="true"
lazy
@check="handleCheckChange" @check="handleCheckChange"
:data="treeSelectData" :data="treeSelectData"
:props="{ :props="{
...@@ -327,12 +355,32 @@ ...@@ -327,12 +355,32 @@
label: 'assetName', label: 'assetName',
id: 'assetId', id: 'assetId',
}" }"
:load="loadTreeSelect"
> >
</el-tree> </el-tree>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<div class="dialog_form_item3 m-b-20 flex-c">
<div class="dialog_form_item_title">图标设置:</div>
<div class="flex">
<img
:style="{
width: selectGraphSrc.length > 0 ? '80px' : 0,
height: selectGraphSrc.length > 0 ? '40px' : 0,
}"
:src="selectGraphSrc"
alt=""
/>
<div
style="display: flex"
v-if="is_add_edit == 'view' ? false : true"
>
<el-button type="primary" @click="openGraphDialog"
>图形选择</el-button
>
</div>
</div>
</div>
<el-form-item <el-form-item
class="dynamicFormClass" class="dynamicFormClass"
v-for="(item, index) in ruleForm.dynamicForm0_" v-for="(item, index) in ruleForm.dynamicForm0_"
...@@ -420,7 +468,6 @@ ...@@ -420,7 +468,6 @@
node-key="assetId" node-key="assetId"
show-checkbox show-checkbox
:check-strictly="true" :check-strictly="true"
lazy
@check="handleCheckChange2" @check="handleCheckChange2"
:data="treeSelectData" :data="treeSelectData"
:props="{ :props="{
...@@ -428,13 +475,12 @@ ...@@ -428,13 +475,12 @@
label: 'assetName', label: 'assetName',
id: 'assetId', id: 'assetId',
}" }"
:load="loadTreeSelect"
> >
</el-tree> </el-tree>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="组件类型:" prop="let2"> <el-form-item label="所属元素:" prop="let2">
<el-select <el-select
v-model="ruleForm2.let2" v-model="ruleForm2.let2"
filterable filterable
...@@ -460,17 +506,21 @@ ...@@ -460,17 +506,21 @@
<el-button @click="templateDialog = false">取消</el-button> <el-button @click="templateDialog = false">取消</el-button>
</span> </span>
</el-dialog> </el-dialog>
<!-- 选择图形 -->
<ChooseSvg @emitSvg="getChooseSvg" :visible.sync="chooseSvgVisible" />
</div> </div>
</template> </template>
<script> <script>
import ChooseSvg from './ChooseSvg.vue'
import { import {
getArchiViewManage, getArchiViewManage,
getZiChanJiaGouTable, getZiChanJiaGouTable,
editZiChanJiaGouTable, editZiChanJiaGouTable,
deleteMoreZiChanJiaGouTable, deleteMoreZiChanJiaGouTable,
addMoreZiChanJiaGouTable, addMoreZiChanJiaGouTable,
queryZiChanJiaGouShangJiJieDian, getQryByTree,
queryZiChanJiaGouZuJianLeiXing, queryZiChanJiaGouZuJianLeiXing,
queryZuJianLeiXingBelongForm, queryZuJianLeiXingBelongForm,
exportZhiChanJiaGou, exportZhiChanJiaGou,
...@@ -480,10 +530,12 @@ import { ...@@ -480,10 +530,12 @@ import {
} from '@/api/index.js' } from '@/api/index.js'
import $ from 'jquery' import $ from 'jquery'
import { MessageBox, Message } from 'element-ui' import { MessageBox, Message } from 'element-ui'
import { getDictTypeOptions } from '@/utils'
export default { export default {
name: 'BusiAssetslist', name: 'BusiAssetslist',
components: {}, components: {
ChooseSvg,
},
watch: {}, watch: {},
data() { data() {
return { return {
...@@ -508,11 +560,9 @@ export default { ...@@ -508,11 +560,9 @@ export default {
dynamicForm_: [], dynamicForm_: [],
}, },
rules: { rules: {
let1: [ let1: [{ required: true, message: '请输入资产名称', trigger: 'blur' }],
{ required: true, message: '请输入架构组件名称', trigger: 'blur' },
],
let3: [ let3: [
{ required: true, message: '请选择组件类型', trigger: 'change' }, { required: true, message: '请选择所属元素', trigger: 'change' },
], ],
}, },
rules2: { rules2: {
...@@ -520,7 +570,7 @@ export default { ...@@ -520,7 +570,7 @@ export default {
{ required: true, message: '请选择上级节点', trigger: 'change' }, { required: true, message: '请选择上级节点', trigger: 'change' },
], ],
let2: [ let2: [
{ required: true, message: '请选择组件类型', trigger: 'change' }, { required: true, message: '请选择所属元素', trigger: 'change' },
], ],
}, },
searchParams: { searchParams: {
...@@ -529,6 +579,7 @@ export default { ...@@ -529,6 +579,7 @@ export default {
assetName: null, assetName: null,
createMan: null, createMan: null,
archiEleId: null, archiEleId: null,
state: undefined,
}, },
treeData: [ treeData: [
{ {
...@@ -560,8 +611,15 @@ export default { ...@@ -560,8 +611,15 @@ export default {
// archiAssetTypeId: null, // archiAssetTypeId: null,
treeSelectData: [], treeSelectData: [],
disabled1: false, disabled1: false,
selectGraphSrc: '',
selectGraphShape: '',
chooseSvgVisible: false,
assetsStatusOptions: [],
} }
}, },
created() {
this.getDicts()
},
mounted() { mounted() {
this.getTreeData() this.getTreeData()
window.addEventListener('resize', () => { window.addEventListener('resize', () => {
...@@ -570,6 +628,27 @@ export default { ...@@ -570,6 +628,27 @@ export default {
this.set_table_height() this.set_table_height()
}, },
methods: { methods: {
formatterDept(row, column, cellValue, index, options) {
const obj = this[options]?.find((v) => v.value == cellValue) || {}
return obj.label
},
getDicts() {
getDictTypeOptions('asset_status').then((res) => {
this.assetsStatusOptions = res
})
},
handleDialogClose() {
this.selectGraphSrc = ''
this.selectGraphShape = ''
this.addDialog = false
},
getChooseSvg(svgInfo) {
this.selectGraphSrc = svgInfo.icon
this.selectGraphShape = svgInfo.iconName
},
openGraphDialog() {
this.chooseSvgVisible = true
},
indexMethod(index) { indexMethod(index) {
return (this.pager.current - 1) * this.pager.size + index + 1 return (this.pager.current - 1) * this.pager.size + index + 1
}, },
...@@ -676,6 +755,8 @@ export default { ...@@ -676,6 +755,8 @@ export default {
targetAsset: targetAsset, targetAsset: targetAsset,
assetCode: this.selectCode, assetCode: this.selectCode,
eleName: eleName, eleName: eleName,
icon: this.selectGraphSrc,
iconName: this.selectGraphShape,
} }
const requestParams = const requestParams =
this.is_add_edit == 'add' this.is_add_edit == 'add'
...@@ -762,6 +843,8 @@ export default { ...@@ -762,6 +843,8 @@ export default {
// "archiAssetTypeId": this.archiAssetTypeId, // "archiAssetTypeId": this.archiAssetTypeId,
current: this.pager.current, current: this.pager.current,
pageSize: this.pager.size, pageSize: this.pager.size,
state: this.searchParams.state,
archiBelongId: this.archiBelongId,
} }
this.loading = true this.loading = true
getZiChanJiaGouTable(params).then((res) => { getZiChanJiaGouTable(params).then((res) => {
...@@ -833,6 +916,8 @@ export default { ...@@ -833,6 +916,8 @@ export default {
this.selectCode = row.assetCode this.selectCode = row.assetCode
this.selectLabel = row.parentAssetName this.selectLabel = row.parentAssetName
this.selectValue = row.parentAssetId this.selectValue = row.parentAssetId
this.selectGraphSrc = row.icon
this.selectGraphShape = row.iconName
let targetAsset_id = [] let targetAsset_id = []
if (targetAsset) { if (targetAsset) {
if (targetAsset.length == 4) { if (targetAsset.length == 4) {
...@@ -877,6 +962,8 @@ export default { ...@@ -877,6 +962,8 @@ export default {
this.selectCode = row.assetCode this.selectCode = row.assetCode
this.selectLabel = row.parentAssetName this.selectLabel = row.parentAssetName
this.selectValue = row.parentAssetId this.selectValue = row.parentAssetId
this.selectGraphSrc = row.icon
this.selectGraphShape = row.iconName
this.getZuJianLeiXingSelect(null).then((res) => { this.getZuJianLeiXingSelect(null).then((res) => {
this.zuJianLeiXingSelect = res this.zuJianLeiXingSelect = res
...@@ -948,7 +1035,7 @@ export default { ...@@ -948,7 +1035,7 @@ export default {
archiStage: this.searchParams.archiStage, archiStage: this.searchParams.archiStage,
// archiAssetTypeId: this.archiAssetTypeId, // archiAssetTypeId: this.archiAssetTypeId,
} }
queryZiChanJiaGouShangJiJieDian(params).then((res) => { getQryByTree(params).then((res) => {
if (res.code == 200) { if (res.code == 200) {
resolve(res.data) resolve(res.data)
} }
...@@ -965,7 +1052,7 @@ export default { ...@@ -965,7 +1052,7 @@ export default {
// parentAssetId: this.archiBelongId, // parentAssetId: this.archiBelongId,
// archiAssetTypeId: this.archiAssetTypeId, // archiAssetTypeId: this.archiAssetTypeId,
} }
queryZiChanJiaGouShangJiJieDian(params).then((res) => { getQryByTree(params).then((res) => {
if (res.code == 200) { if (res.code == 200) {
// console.log('上级节点') // console.log('上级节点')
// console.log(res.data) // console.log(res.data)
...@@ -988,7 +1075,7 @@ export default { ...@@ -988,7 +1075,7 @@ export default {
}) })
}, },
zuJianLeiXingSelectChange(data) { zuJianLeiXingSelectChange(data) {
//组件类型选择后 //所属元素选择后
// console.log(data) // console.log(data)
// console.log(this.zuJianLeiXingSelect) // console.log(this.zuJianLeiXingSelect)
const currentItem = this.zuJianLeiXingSelect.find( const currentItem = this.zuJianLeiXingSelect.find(
...@@ -1026,7 +1113,7 @@ export default { ...@@ -1026,7 +1113,7 @@ export default {
} }
}, },
queryZuJianLeiXingSelect(data) { queryZuJianLeiXingSelect(data) {
//组件类型搜索 //所属元素搜索
if (data !== '') { if (data !== '') {
setTimeout(() => { setTimeout(() => {
this.getZuJianLeiXingSelect(data).then((res) => { this.getZuJianLeiXingSelect(data).then((res) => {
...@@ -1040,12 +1127,13 @@ export default { ...@@ -1040,12 +1127,13 @@ export default {
} }
}, },
getZuJianLeiXingSelect(elementName) { getZuJianLeiXingSelect(elementName) {
//组件类型下拉框值 //所属元素下拉框值
const params = { const params = {
state: '1', state: '1',
type: '1', type: '1',
elementName: elementName, elementName: elementName,
archiBelongId: this.archiBelongId, archiBelongId: this.archiBelongId,
scopeList: [1, 3],
} }
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
queryZiChanJiaGouZuJianLeiXing(params).then((res) => { queryZiChanJiaGouZuJianLeiXing(params).then((res) => {
...@@ -1326,6 +1414,12 @@ export default { ...@@ -1326,6 +1414,12 @@ export default {
} }
</style> </style>
<style lang="scss" scoped> <style lang="scss" scoped>
.dialog_form_item_title {
width: 160px;
padding-right: 12px;
box-sizing: border-box;
text-align: right;
}
.filter-tree { .filter-tree {
width: 300px; width: 300px;
height: 100%; height: 100%;
...@@ -1409,7 +1503,7 @@ export default { ...@@ -1409,7 +1503,7 @@ export default {
margin-right: 20px; margin-right: 20px;
} }
.right_container { .right_container {
width: 80%; width: calc(80% - 20px);
} }
.el-button.is-disabled { .el-button.is-disabled {
color: #c0c4cc !important; color: #c0c4cc !important;
...@@ -1420,19 +1514,22 @@ export default { ...@@ -1420,19 +1514,22 @@ export default {
margin-right: 20px; margin-right: 20px;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
flex-wrap: wrap;
} }
.search_menu_item_container { .search_menu_item_container {
display: flex; display: flex;
align-items: center; align-items: center;
width: 80%;
} }
.search_menu_btn_container { .search_menu_btn_container {
display: flex; display: flex;
align-items: center; align-items: center;
width: 20%;
} }
.search_menu_item { .search_menu_item {
display: flex; display: flex;
align-items: center; align-items: center;
width: 344px; width: 25%;
} }
.search_title { .search_title {
/* width: 20%; */ /* width: 20%; */
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Autor: pan * @Autor: pan
* @Date: 2024-03-20 17:53:35 * @Date: 2024-03-20 17:53:35
* @LastEditors: pan * @LastEditors: pan
* @LastEditTime: 2024-03-21 16:03:23 * @LastEditTime: 2024-04-07 20:51:29
--> -->
<template> <template>
...@@ -31,8 +31,8 @@ ...@@ -31,8 +31,8 @@
label="资料类型" label="资料类型"
align="center" align="center"
></el-table-column> ></el-table-column>
<el-table-column label="资料名称" align="center"> <el-table-column label="资料名称" prop="fileName" align="center">
<template slot-scope="scope"> <!-- <template slot-scope="scope">
<el-upload <el-upload
class="upload-demo" class="upload-demo"
action="/eadc-shared-ability/oss/upload" action="/eadc-shared-ability/oss/upload"
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
> >
<el-button size="small" type="primary">点击上传</el-button> <el-button size="small" type="primary">点击上传</el-button>
</el-upload> </el-upload>
</template> </template> -->
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!