Commit 85d62a15 by 李耀琨

更新代码

parent 0c1107b6
......@@ -1068,6 +1068,13 @@ export default {
this.$refs.container.style.background = 'url("./mxgraph/images/grid.gif")';
},
filters: {
interceptionDate: function (value) {
if (!value) return;
return value.split("imgage=");
},
},
methods: {
setXml() {
this.graph.getModel().beginUpdate();
......@@ -1083,6 +1090,11 @@ export default {
excelLnputDetermine() {
this.excelLnput = !this.excelLnput;
for (let name in this.form) {
var edit = new mxCellAttributeChange(this.nodeData,name,this.form[name]);
this.graph.getModel().execute(edit);
}
console.log(edit, 4564564564654);
},
// 子组件发射回来的弹窗变量变为true
fathertrans(res) {
......@@ -1221,6 +1233,7 @@ export default {
}
this.graph.setConnectable(true); // 允许连线
this.graph.setCellsEditable(false); // 不可修改
this.graph.setTooltips(true);
this.graph.setPanning(true);
......@@ -1228,21 +1241,38 @@ export default {
this.graph.setAllowDanglingEdges(false);
this.graph.setDisconnectOnMove(false);
this.graph.setMultigraph(false);
this.graph.convertValueToString = (cell) => {
var label = cell.getAttribute('label');
var icon = cell.getAttribute(cell.style.split("image="))
return label,icon;
// console.log(cell.value.attributes,99999999999999);
// if (cell.title) {
// cell.title = cell.value.attributes.label.value;
// }else{
// if (!cell.title && cell.value) {
// console.log("======11=",cell.value);
// console.log("======22=",cell);
// if(cell.value.attributes["ctype"]){
// cell.title = cell.value.attributes["ctype"]["value"];
// }
// // cell.title = cell.value.attribllutes.label.value;
// }
// cell.ctype = cell.value.attributes.ctype.value;
// let height = cell.geometry.height;
// let width = cell.geometry.width;
// let x = cell.geometry.x;
// let y = cell.geometry.y;
// let imgs = img.split("=");
// // let d = imgs[1]
// console.log(imgs);
// const styleObj = {
// title: cell.title,
......@@ -1254,26 +1284,20 @@ export default {
// verticalAlign: mxConstants.ALIGN_BOTTOM,
// imageAlign: mxConstants.ALIGN_CENTER,
// imageVerticalAlign: mxConstants.ALIGN_TOP,
// image: '192.168.0.44:9888/ETLWEB-SERVER/etlweb/ui/images/GEN.svg?scale=32',
// };
// const style = Object.keys(styleObj)
// .map((attr) => `${attr}=${styleObj[attr]}`)
// .join(";");
// var doc = mxUtils.parseXml(this.blankCanvas);
// cell.style = style
// cell = this.graph.insertVertex(
// this.graph.getDefaultParent(),
// null,
// doc.documentElement,
// x,
// y,
// width,
// height,
// style
// );
// console.log(this.R.prop("title", cell),132132);
return this.R.prop("title", cell);
// return this.R.prop("title", cell);
};
this.graph.addListener(mxEvent.DOUBLE_CLICK, (graph, evt) => {
......@@ -1411,7 +1435,7 @@ export default {
//更新
this.updateVisible = !this.updateVisible;
return;
} else if (cell.ids == "step15") {
} else if (cell.ids == "step14") {
//文本文件输出
this.fileVisible = !this.fileVisible;
return;
......@@ -1423,15 +1447,15 @@ export default {
//插入、更新
this.InsertOrUpdateVisible = !this.InsertOrUpdateVisible;
return;
} else if (cell.ids == "step10") {
} else if (cell.ids == "step11") {
//删除
this.deleteVisible = !this.deleteVisible;
return;
} else if (cell.ids == "step11") {
} else if (cell.ids == "step10") {
//SQL文件输出
this.sqlVisible = !this.sqlVisible;
return;
} else if (cell.ids == "step9" || cell.ctype == "TextFileInput") {
} else if (cell.ids == "step9") {
//Excel输出
this.excelOutPutVisible = !this.excelOutPutVisible;
return;
......@@ -1466,6 +1490,7 @@ export default {
.map((attr) => `${attr}=${styleObj[attr]}`)
.join(";");
this.toolItemData = toolItem
try {
let pameStep = new FormData(); // 创建form对象
pameStep.append("graphXml", this.getXmlVal);
......@@ -1486,7 +1511,9 @@ export default {
height,
style
);
console.log(res, 111111111111111111);
console.log(cell,4564564564);
console.log(toolItem, 111111111111111111);
cell.title = toolItem["title"];
cell.ids = toolItem["id"];
// cell.pluginId = toolItem["pluginId"];
......@@ -1757,10 +1784,10 @@ export default {
save(pamers).then((res) => {
console.log(res);
if (res.success) {
this.$message.success("保存流程成功!暂时请查先看控制台。");
that.$message.success("保存流程成功!暂时请查先看控制台。");
this.createGraph();
} else {
this.$message.error(res.errMsg);
that.$message.error(res.errMsg);
}
});
},
......@@ -1855,7 +1882,6 @@ export default {
//输出组件保存************************
saveOutputDialog(params){
// var graph = getActiveGraph().getGraph();
var outPutForm=params;
this.graph.getModel().beginUpdate();
try
......@@ -1869,7 +1895,6 @@ export default {
{
this.graph.getModel().endUpdate();
}
console.log('保存组件到画布===',this.graph);
}
//输出组件保存******************/
},
......
......@@ -28,7 +28,6 @@
</template>
</el-dropdown-item>
<el-dropdown-item style="text-align:right" @click.native="createFile()">新建目录</el-dropdown-item>
<el-dropdown-item style="text-align:right" @click.native="deleteFile()">删除</el-dropdown-item>
<el-dropdown-item class="text-center">打开</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
......@@ -345,7 +344,7 @@ import dialogRemind from '../dialogs-components/dialog-remind'//删除提示弹
import {explorer,features,remove,checkInit,drop} from "@/api/kettle/file";
import {explorer,features,remove,checkInit} from "@/api/kettle/file";
import {
types,
getLinkList,
......@@ -382,7 +381,6 @@ export default {
props: ["dragItem"],
data() {
return {
curNode:{},//删除资源库文件当前点击的节点
curNodeText:'数据库名称',//当前点击选中的资源库节点
blankCanvas:"",//空白画布xml
graph:null,
......@@ -1220,32 +1218,9 @@ props: ["dragItem"],
}
},
// 删除资源库文件
deleteFile(){
console.log("删除当前节点==========",this.curNode);
var path=this.curNode.data.path;
var type=this.curNode.data.type;
if(type==null){
type=''
}
let pamer = new FormData(); // 创建form对象
pamer.append("path", path);
pamer.append("type", type);
drop(pamer).then(res=>{
if(res){
console.log('删除资源库文件==',res)
this.$message.success('删除成功');
// 刷新
this.explorer('');
}
})
},
handleNodeClick(data,node){
console.log('点击当前节点===',node);
this.curNode=node;//当前选中节点
this.nodePath=data.path;//当前选择数
this.nodePath=data.path;//当前选择数
this.curNodeIconCls=data.iconCls;//当前选中节点
this.nodePath=data.path;
console.log('当前节点的文件夹路径:',this.nodePath);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment