Merge remote-tracking branch 'origin/master'
commit
119f9b3529
|
@ -49,6 +49,7 @@
|
||||||
"@vue/composition-api": "^1.7.2",
|
"@vue/composition-api": "^1.7.2",
|
||||||
"axios": "0.24.0",
|
"axios": "0.24.0",
|
||||||
"clipboard": "2.0.8",
|
"clipboard": "2.0.8",
|
||||||
|
"codemirror": "^5.65.12",
|
||||||
"core-js": "3.25.3",
|
"core-js": "3.25.3",
|
||||||
"echarts": "5.4.0",
|
"echarts": "5.4.0",
|
||||||
"element-ui": "2.9.1",
|
"element-ui": "2.9.1",
|
||||||
|
|
|
@ -79,7 +79,7 @@ export function findById(id) {
|
||||||
//通过id删除数据
|
//通过id删除数据
|
||||||
export function dels(id) {
|
export function dels(id) {
|
||||||
return request({
|
return request({
|
||||||
url: '/engine/engine/delete/' + id,
|
url: '/engine/version/delete/' + id,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: id
|
data: id
|
||||||
})
|
})
|
||||||
|
@ -107,5 +107,13 @@ export function selectEngineById(id){
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//根据版本id查询版本信息
|
||||||
|
export function sel(id){
|
||||||
|
return request({
|
||||||
|
url: "/engine/version/selectListById/" + id,
|
||||||
|
method: "post"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -79,3 +79,11 @@ export function doBuyInterface(data) {
|
||||||
data:data
|
data:data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
//资产列表
|
||||||
|
export function findConnectorUserList(data) {
|
||||||
|
return request({
|
||||||
|
url: '/mart/connector/findConnectorUserList',
|
||||||
|
method: 'post',
|
||||||
|
data:data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
|
@ -77,5 +77,15 @@ export function findByNodeId(nodeId) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//联查记录添加
|
||||||
|
export function addTaskJoin(data) {
|
||||||
|
return request({
|
||||||
|
url: "/task/taskJoin/addTaskJoin/",
|
||||||
|
method: "POST",
|
||||||
|
data:data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,57 @@
|
||||||
|
<template>
|
||||||
|
<codemirror ref="mycode" :value="curCode" :options="cmOptions" class="code" v-show="aaa">
|
||||||
|
</codemirror>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { codemirror } from 'vue-codemirror'
|
||||||
|
import "codemirror/theme/ambiance.css"; // 这里引入的是主题样式,根据设置的theme的主题引入,一定要引入!!
|
||||||
|
require("codemirror/mode/javascript/javascript"); // 这里引入的模式的js,根据设置的mode引入,一定要引入!!
|
||||||
|
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'ExecuteAction',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
curCode: '测试',
|
||||||
|
cmOptions: {
|
||||||
|
// autorefresh: true,
|
||||||
|
// tabSize: 4,
|
||||||
|
// mode: 'text/x-properties',
|
||||||
|
// theme: 'ayu-mirage',
|
||||||
|
// line: true,
|
||||||
|
// viewportMargin: Infinity, //处理高度自适应时搭配使用
|
||||||
|
// highlightDifferences: true,
|
||||||
|
// autofocus: false,
|
||||||
|
// indentUnit: 2,
|
||||||
|
// smartIndent: true,
|
||||||
|
// readOnly: true, // 只读
|
||||||
|
// showCursorWhenSelecting: true,
|
||||||
|
// firstLineNumber: 1
|
||||||
|
lineNumbers: true, // 显示行号
|
||||||
|
mode: 'text/x-yaml', // 语法model
|
||||||
|
gutters: ['CodeMirror-lint-markers'], // 语法检查器
|
||||||
|
theme: "ambiance",
|
||||||
|
lint: true, // 开启语法检查
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
codemirror
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.information-box>>>.CodeMirror {
|
||||||
|
font-family: monospace;
|
||||||
|
height: 71vh;
|
||||||
|
direction: ltr;
|
||||||
|
}
|
||||||
|
</style>
|
17
src/main.js
17
src/main.js
|
@ -1,6 +1,23 @@
|
||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
|
|
||||||
import Cookies from 'js-cookie'
|
import Cookies from 'js-cookie'
|
||||||
|
//引入文件、、
|
||||||
|
import VueCodeMirror from 'vue-codemirror'
|
||||||
|
import 'codemirror/lib/codemirror.css'
|
||||||
|
Vue.use(VueCodeMirror)
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
//codemirror
|
||||||
|
import VueCodemirror from 'vue-codemirror'
|
||||||
|
import 'codemirror/lib/codemirror.css'
|
||||||
|
Vue.use(VueCodemirror)
|
||||||
|
|
||||||
|
import 'codemirror/lib/codemirror.css'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import Element from 'element-ui'
|
import Element from 'element-ui'
|
||||||
import './assets/styles/element-variables.scss'
|
import './assets/styles/element-variables.scss'
|
||||||
|
|
|
@ -97,7 +97,7 @@
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="处理规则" width="100">
|
<el-table-column label="处理规则" width="200">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-select v-model="taskInputReq.fieldAsEngineId" multiple placeholder="请选择">
|
<el-select v-model="taskInputReq.fieldAsEngineId" multiple placeholder="请选择">
|
||||||
<el-option value="">请选择</el-option>
|
<el-option value="">请选择</el-option>
|
||||||
|
@ -112,10 +112,10 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="表别名"
|
label="字段别名"
|
||||||
width="100">
|
width="200">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-input v-model="scope.row.fieldAsEngineId"></el-input>
|
<el-input v-model="scope.row.tableAsField = tableInfo.tableAsName+'_'+scope.row.columnName"></el-input>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
@ -125,37 +125,11 @@
|
||||||
<el-button type="primary" @click="columnAddGood()">确 定</el-button>
|
<el-button type="primary" @click="columnAddGood()">确 定</el-button>
|
||||||
</div>
|
</div>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<!-- 联查模块表单-->
|
|
||||||
<span v-if="taskInputJoin">
|
|
||||||
<el-form label-width="80px" :model="joinSelect" ref="queryForm" :inline="true" class="demo-form-inline" size="small">
|
|
||||||
<el-form-item label="联查方式">
|
|
||||||
<el-select v-model="tableInfo.tableName" placeholder="请选择">
|
|
||||||
<el-option style="height: 100%" label="左联查" value="1"/>
|
|
||||||
<el-option style="height: 100%" label="右联查" value="2"/>
|
|
||||||
<el-option style="height: 100%" label="内联查" value="3"/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item label="关联字段">
|
|
||||||
<el-select v-model="tableInfo.tableName" placeholder="请选择">
|
|
||||||
<el-option style="height: 100%" label="内联查" value="3"/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div slot="footer" class="dialog-footer">
|
|
||||||
<el-button @click="taskInputAdd = false">取 消</el-button>
|
|
||||||
<el-button type="primary" @click="addTaskInput()">下一步</el-button>
|
|
||||||
</div>
|
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { addTaskInput, findByTableId, findStructureList, tableInfoList } from '@/api/task/task'
|
import { addTaskInput} from '@/api/task/task'
|
||||||
import { findStructureByTableId, findTableInfoList } from '@/api/etl/switch'
|
import { findStructureByTableId, findTableInfoList } from '@/api/etl/switch'
|
||||||
import { selectEngineList } from '@/api/engine/engine'
|
import { selectEngineList } from '@/api/engine/engine'
|
||||||
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等),
|
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等),
|
||||||
|
@ -163,7 +137,7 @@ import { selectEngineList } from '@/api/engine/engine'
|
||||||
export default {
|
export default {
|
||||||
//import引入的组件需要注入到对象中才能使用"
|
//import引入的组件需要注入到对象中才能使用"
|
||||||
components: {},
|
components: {},
|
||||||
props:['graph','nodeId','taskInputForm','tableInfo'],
|
props:['graph','nodeId','taskInputForm','tableInfo','nodeName'],
|
||||||
data() {
|
data() {
|
||||||
//这里存放数据"
|
//这里存放数据"
|
||||||
|
|
||||||
|
@ -173,7 +147,6 @@ export default {
|
||||||
dialogFormVisible:true,
|
dialogFormVisible:true,
|
||||||
//任务设计添加表弹窗
|
//任务设计添加表弹窗
|
||||||
taskInputAdd:false,
|
taskInputAdd:false,
|
||||||
taskInputForm:true,
|
|
||||||
//选择字段弹窗
|
//选择字段弹窗
|
||||||
taskInputFieldAdd:false,
|
taskInputFieldAdd:false,
|
||||||
taskInputTable:false,
|
taskInputTable:false,
|
||||||
|
@ -203,9 +176,6 @@ export default {
|
||||||
tableList:[],
|
tableList:[],
|
||||||
columnList:[],
|
columnList:[],
|
||||||
structureList:[],
|
structureList:[],
|
||||||
tableInfo:{
|
|
||||||
taskId:this.$route.params.id,
|
|
||||||
},
|
|
||||||
itemId:0,
|
itemId:0,
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -234,8 +204,6 @@ export default {
|
||||||
//确定选择的字段
|
//确定选择的字段
|
||||||
columnAddGood(){
|
columnAddGood(){
|
||||||
this.taskInputTable = false;
|
this.taskInputTable = false;
|
||||||
this.tableInfo.tableField = JSON.stringify(this.tableInfo.columnList)
|
|
||||||
this.tableInfo.tableAsField = "[{name:'aa',sex:'as'}]";
|
|
||||||
this.tableInfo.fieldAsEngineId = "[{1,3,4},{1,2,3}]";
|
this.tableInfo.fieldAsEngineId = "[{1,3,4},{1,2,3}]";
|
||||||
this.$emit('taskInputForm', false);
|
this.$emit('taskInputForm', false);
|
||||||
addTaskInput({
|
addTaskInput({
|
||||||
|
@ -245,10 +213,11 @@ export default {
|
||||||
"databaseId":this.tableInfo.parentId,
|
"databaseId":this.tableInfo.parentId,
|
||||||
"tableName":this.tableInfo.tableName,
|
"tableName":this.tableInfo.tableName,
|
||||||
"tableAsName":this.tableInfo.tableAsName,
|
"tableAsName":this.tableInfo.tableAsName,
|
||||||
"tableField":this.tableInfo.tableField,
|
"tableField": this.tableInfo.tableField.substring(1),
|
||||||
"tableAsField":this.tableInfo.tableAsField,
|
"tableAsField":this.tableInfo.tableAsField.substring(1),
|
||||||
"fieldAsEngineId":this.tableInfo.fieldAsEngineId
|
"fieldAsEngineId":this.tableInfo.fieldAsEngineId
|
||||||
}).then(res=>{
|
}).then(res=>{
|
||||||
|
|
||||||
alert(res.msg);
|
alert(res.msg);
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -266,8 +235,14 @@ export default {
|
||||||
val = this.tableInfo.columnList;
|
val = this.tableInfo.columnList;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.tableInfo.columnList = val;
|
this.tableInfo.tableField = "";
|
||||||
console.log(this.tableInfo.columnList );
|
this.tableInfo.tableAsField = "";
|
||||||
|
val.forEach(item=>{
|
||||||
|
this.tableInfo.tableField +=','+ item.columnName;
|
||||||
|
this.tableInfo.tableAsField +=','+ item.tableAsField;
|
||||||
|
})
|
||||||
|
|
||||||
|
console.log(this.tableInfo.tableField);
|
||||||
},
|
},
|
||||||
|
|
||||||
//根据树状下拉的选择赋值字段信息
|
//根据树状下拉的选择赋值字段信息
|
||||||
|
|
|
@ -0,0 +1,75 @@
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<!-- 数据输出表单-->
|
||||||
|
<span v-if="taskDataOutPut">
|
||||||
|
<el-select v-model="tableInfo.tableName" placeholder="请选择数据库">
|
||||||
|
<el-option style="height: 100%" :value="tableInfo.tableName">
|
||||||
|
<el-aside width="100%">
|
||||||
|
<el-tree :data="data" :props="defaultProps" @node-click="handleNodeClick"></el-tree>
|
||||||
|
</el-aside>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等),
|
||||||
|
//例如:import 《组件名称》 from '《组件路径》,
|
||||||
|
export default {
|
||||||
|
//import引入的组件需要注入到对象中才能使用"
|
||||||
|
components: {},
|
||||||
|
props:['graph','nodeId','nodeName','taskId','taskDataOutPut'],
|
||||||
|
data() {
|
||||||
|
//这里存放数据"
|
||||||
|
|
||||||
|
return {
|
||||||
|
|
||||||
|
//树状图
|
||||||
|
data:[],
|
||||||
|
defaultProps:{
|
||||||
|
children:"children",
|
||||||
|
label:'tableName'
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
//计算属性 类似于data概念",
|
||||||
|
computed: {},
|
||||||
|
//监控data中的数据变化",
|
||||||
|
watch: {},
|
||||||
|
//方法集合",
|
||||||
|
methods: {
|
||||||
|
//字段多选框选择赋值
|
||||||
|
handleSelectionChange(val) {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
//生命周期 - 创建完成(可以访问当前this实例)",
|
||||||
|
created() {
|
||||||
|
this.findAllTable();
|
||||||
|
},
|
||||||
|
//生命周期 - 挂载完成(可以访问DOM元素)",
|
||||||
|
mounted() {
|
||||||
|
|
||||||
|
},
|
||||||
|
beforeCreate() {
|
||||||
|
}, //生命周期 - 创建之前",
|
||||||
|
beforeMount() {
|
||||||
|
}, //生命周期 - 挂载之前",
|
||||||
|
beforeUpdate() {
|
||||||
|
}, //生命周期 - 更新之前",
|
||||||
|
updated() {
|
||||||
|
}, //生命周期 - 更新之后",
|
||||||
|
beforeDestroy() {
|
||||||
|
}, //生命周期 - 销毁之前",
|
||||||
|
destroyed() {
|
||||||
|
}, //生命周期 - 销毁完成",
|
||||||
|
activated() {
|
||||||
|
} //如果页面有keep-alive缓存功能,这个函数会触发",
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
|
@ -0,0 +1,135 @@
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<!-- 联查模块表单-->
|
||||||
|
<span v-if="taskInputJoin">
|
||||||
|
<el-form label-width="80px" :model="formJoin" ref="queryForm" :inline="true" class="demo-form-inline" size="small">
|
||||||
|
<el-form-item label="联查方式">
|
||||||
|
<el-select v-model="formJoin.joinType" placeholder="请选择">
|
||||||
|
<el-option style="height: 100%" label="左联查" value="1"/>
|
||||||
|
<el-option style="height: 100%" label="右联查" value="2"/>
|
||||||
|
<el-option style="height: 100%" label="内联查" value="3"/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<br>
|
||||||
|
|
||||||
|
<el-form-item label="关联字段">
|
||||||
|
<el-select v-model="formJoin.leftJoinField" placeholder="请选择">
|
||||||
|
<span v-for="item in oneFieldList.split(',')">
|
||||||
|
<el-option style="height: 100%"
|
||||||
|
:label="item"
|
||||||
|
:value="item"
|
||||||
|
:key="item"/>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
</el-select>
|
||||||
|
|
||||||
|
<el-select v-model="formJoin.rightJoinField" placeholder="请选择">
|
||||||
|
<span v-for="item in twoFieldList.split(',')">
|
||||||
|
<el-option style="height: 100%"
|
||||||
|
:label="item"
|
||||||
|
:value="item"
|
||||||
|
:key="item"/>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="taskInputJoin == false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="saveTaskJoin()">确 定</el-button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- <div slot="footer" class="dialog-footer">-->
|
||||||
|
<!-- <el-button @click="taskInputAdd = false">取 消</el-button>-->
|
||||||
|
<!-- <el-button type="primary" @click="addTaskInput()">下一步</el-button>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { addTaskJoin, findByNodeId } from '@/api/task/task'
|
||||||
|
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等),
|
||||||
|
//例如:import 《组件名称》 from '《组件路径》,
|
||||||
|
export default {
|
||||||
|
//import引入的组件需要注入到对象中才能使用"
|
||||||
|
components: {},
|
||||||
|
props:['graph','nodeId','nodeName','taskId','taskInputJoin','neighbors'],
|
||||||
|
data() {
|
||||||
|
//这里存放数据"
|
||||||
|
|
||||||
|
return {
|
||||||
|
taskInputJoin: true,
|
||||||
|
formJoin: {},
|
||||||
|
oneFieldList:'',
|
||||||
|
twoFieldList:'',
|
||||||
|
};
|
||||||
|
},
|
||||||
|
//计算属性 类似于data概念",
|
||||||
|
computed: {},
|
||||||
|
//监控data中的数据变化",
|
||||||
|
watch: {},
|
||||||
|
//方法集合",
|
||||||
|
methods: {
|
||||||
|
//添加任务联查方式
|
||||||
|
saveTaskJoin(){
|
||||||
|
this.taskInputJoin = false;
|
||||||
|
this.$emit('saveTaskJoin', false);
|
||||||
|
addTaskJoin(
|
||||||
|
{
|
||||||
|
"nodeId":this.nodeId,
|
||||||
|
"nodeName":this.nodeName,
|
||||||
|
"taskId":this.taskId,
|
||||||
|
"joinType":this.formJoin.joinType,
|
||||||
|
"leftJoinField":this.formJoin.leftJoinField,
|
||||||
|
"rightJoinField":this.formJoin.rightJoinField
|
||||||
|
}
|
||||||
|
).then(res=>{
|
||||||
|
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
//拿到连线节点的数据
|
||||||
|
findAllTable(){
|
||||||
|
alert(this.neighbors)
|
||||||
|
findByNodeId(this.neighbors[0]).then(res=>{
|
||||||
|
this.oneFieldList = res.data.tableAsField;
|
||||||
|
console.log(this.oneFieldList)
|
||||||
|
})
|
||||||
|
findByNodeId(this.neighbors[1]).then(res=>{
|
||||||
|
this.twoFieldList = res.data.tableAsField;
|
||||||
|
console.log(this.twoFieldList)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
//生命周期 - 创建完成(可以访问当前this实例)",
|
||||||
|
created() {
|
||||||
|
this.findAllTable();
|
||||||
|
},
|
||||||
|
//生命周期 - 挂载完成(可以访问DOM元素)",
|
||||||
|
mounted() {
|
||||||
|
|
||||||
|
},
|
||||||
|
beforeCreate() {
|
||||||
|
}, //生命周期 - 创建之前",
|
||||||
|
beforeMount() {
|
||||||
|
}, //生命周期 - 挂载之前",
|
||||||
|
beforeUpdate() {
|
||||||
|
}, //生命周期 - 更新之前",
|
||||||
|
updated() {
|
||||||
|
}, //生命周期 - 更新之后",
|
||||||
|
beforeDestroy() {
|
||||||
|
}, //生命周期 - 销毁之前",
|
||||||
|
destroyed() {
|
||||||
|
}, //生命周期 - 销毁完成",
|
||||||
|
activated() {
|
||||||
|
} //如果页面有keep-alive缓存功能,这个函数会触发",
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
|
@ -66,17 +66,21 @@
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="findSelectSourceExport"
|
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="findSelectSourceExport"
|
||||||
|
|
||||||
v-hasPermi="['source:data:export']">导出
|
v-hasPermi="['source:data:export']">导出
|
||||||
|
|
||||||
</el-button>
|
</el-button>
|
||||||
|
|
||||||
<!-- 添加按钮 /-->
|
<!-- 添加按钮 /-->
|
||||||
|
|
||||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['source:data:add']">
|
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['source:data:add']">
|
||||||
|
|
||||||
新增
|
新增
|
||||||
|
|
||||||
</el-button>
|
</el-button>
|
||||||
|
|
||||||
<!-- 添加或修改规则引擎对话框 -->
|
<!-- 添加或修改规则引擎对话框 -->
|
||||||
|
|
||||||
<el-dialog :title="title" :visible.sync="open" width="80%" append-to-body>
|
<el-dialog :title="title" :visible.sync="open" width="80%" append-to-body>
|
||||||
|
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
|
@ -564,8 +568,6 @@ export default {
|
||||||
|
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
|
|
||||||
// this.reset();
|
|
||||||
|
|
||||||
this.open = true;
|
this.open = true;
|
||||||
|
|
||||||
this.title = "添加规则引擎";
|
this.title = "添加规则引擎";
|
||||||
|
@ -576,8 +578,6 @@ export default {
|
||||||
|
|
||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
|
|
||||||
// this.reset();
|
|
||||||
|
|
||||||
this.form = row;
|
this.form = row;
|
||||||
|
|
||||||
this.open = true;
|
this.open = true;
|
||||||
|
@ -673,20 +673,35 @@ export default {
|
||||||
beforeCreate() {
|
beforeCreate() {
|
||||||
|
|
||||||
}, //生命周期 - 创建之前",
|
}, //生命周期 - 创建之前",
|
||||||
|
|
||||||
beforeMount() {
|
beforeMount() {
|
||||||
|
|
||||||
}, //生命周期 - 挂载之前",
|
}, //生命周期 - 挂载之前",
|
||||||
|
|
||||||
beforeUpdate() {
|
beforeUpdate() {
|
||||||
|
|
||||||
}, //生命周期 - 更新之前",
|
}, //生命周期 - 更新之前",
|
||||||
|
|
||||||
updated() {
|
updated() {
|
||||||
|
|
||||||
}, //生命周期 - 更新之后",
|
}, //生命周期 - 更新之后",
|
||||||
|
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
|
|
||||||
}, //生命周期 - 销毁之前",
|
}, //生命周期 - 销毁之前",
|
||||||
|
|
||||||
destroyed() {
|
destroyed() {
|
||||||
|
|
||||||
}, //生命周期 - 销毁完成",
|
}, //生命周期 - 销毁完成",
|
||||||
|
|
||||||
activated() {
|
activated() {
|
||||||
|
|
||||||
} //如果页面有keep-alive缓存功能,这个函数会触发",
|
} //如果页面有keep-alive缓存功能,这个函数会触发",
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -2,119 +2,232 @@
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
|
|
||||||
<el-button type="text" @click="dialogFormVisible = true">新增</el-button>
|
<el-button type="text" @click="addVersion()">新增</el-button>
|
||||||
|
|
||||||
<el-dialog title="添加版本信息" :visible.sync="dialogFormVisible">
|
<el-dialog title="添加版本信息" :visible.sync="dialogFormVisible">
|
||||||
|
|
||||||
<el-form :model="versions">
|
<el-form :model="versions">
|
||||||
|
|
||||||
<el-form-item label="版本类名" :label-width="formLabelWidth">
|
<el-form-item label="版本类名" :label-width="formLabelWidth">
|
||||||
|
|
||||||
<el-input v-model="versions.versionClass" autocomplete="off"></el-input>
|
<el-input v-model="versions.versionClass" autocomplete="off"></el-input>
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="版本名称" :label-width="formLabelWidth">
|
<el-form-item label="版本名称" :label-width="formLabelWidth">
|
||||||
|
|
||||||
<el-input v-model="versions.name" autocomplete="off"></el-input>
|
<el-input v-model="versions.name" autocomplete="off"></el-input>
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="版本编码" :label-width="formLabelWidth">
|
<el-form-item label="版本编码" :label-width="formLabelWidth">
|
||||||
|
|
||||||
<el-input v-model="versions.versionCode" autocomplete="off"></el-input>
|
<el-input v-model="versions.versionCode" autocomplete="off"></el-input>
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="是否激活" :label-width="formLabelWidth">
|
<el-form-item label="是否激活" :label-width="formLabelWidth">
|
||||||
<el-input v-model="versions.isActivate" autocomplete="off"></el-input>
|
|
||||||
|
<el-input v-model="versions.isActivate" disabled autocomplete="off"></el-input>
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="版本状态" :label-width="formLabelWidth">
|
<el-form-item label="版本状态" :label-width="formLabelWidth">
|
||||||
<el-input v-model="versions.status" autocomplete="off"></el-input>
|
|
||||||
|
<el-input v-model="versions.status" disabled autocomplete="off"></el-input>
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="版本测试状态" :label-width="formLabelWidth">
|
<el-form-item label="是否测试" :label-width="formLabelWidth">
|
||||||
<el-input v-model="versions.testStatus" autocomplete="off"></el-input>
|
|
||||||
|
<el-input v-model="versions.testStatus" disabled autocomplete="off"></el-input>
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="规则内容" :label-width="formLabelWidth">
|
<el-form-item label="版本描述" :label-width="formLabelWidth">
|
||||||
<el-input v-model="versions.ruleContent" autocomplete="off"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item label="引擎维护编号" :label-width="formLabelWidth">
|
|
||||||
<el-input v-model="versions.engineMaintenanceId" autocomplete="off"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item label="描述" :label-width="formLabelWidth">
|
|
||||||
<el-input v-model="versions.description" autocomplete="off"></el-input>
|
<el-input v-model="versions.description" autocomplete="off"></el-input>
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<!-- ref="mycode" :value="curCode" class="code"-->
|
||||||
|
<codemirror :options="cmOptions" v-show="opens">
|
||||||
|
|
||||||
|
|
||||||
|
</codemirror>
|
||||||
|
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
|
|
||||||
<el-button @click="dialogFormVisible = false">取 消</el-button>
|
<el-button @click="dialogFormVisible = false">取 消</el-button>
|
||||||
|
|
||||||
<el-button type="primary" @click=handleInsert()>确 定</el-button>
|
<el-button type="primary" @click=handleInsert()>确 定</el-button>
|
||||||
|
|
||||||
|
<el-button type="primary" @click=showCode()>生成引擎类</el-button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<el-table :data="maintenance.engineMaintenanceList" style="width: 100%">
|
<el-table :data="maintenance.engineMaintenanceList" style="width: 100%">
|
||||||
|
|
||||||
<el-table-column prop="id" label="编号"></el-table-column>
|
|
||||||
<el-table-column prop="versionClass" label="版本类名"></el-table-column>
|
<el-table-column prop="versionClass" label="版本类名"></el-table-column>
|
||||||
|
|
||||||
<el-table-column prop="name" label="版本名称"></el-table-column>
|
<el-table-column prop="name" label="版本名称"></el-table-column>
|
||||||
|
|
||||||
<el-table-column prop="versionCode" label="版本编码"></el-table-column>
|
<el-table-column prop="versionCode" label="版本编码"></el-table-column>
|
||||||
|
|
||||||
<el-table-column prop="isActivate" label="是否激活">
|
<el-table-column prop="isActivate" label="是否激活">
|
||||||
|
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
|
|
||||||
<span v-if="scope.row.isActivate==1">正常</span>
|
<span v-if="scope.row.isActivate==1">正常</span>
|
||||||
|
|
||||||
<span v-if="scope.row.isActivate==2">停用</span>
|
<span v-if="scope.row.isActivate==2">停用</span>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column prop="status" label="版本状态">
|
<el-table-column prop="status" label="版本状态">
|
||||||
|
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
|
|
||||||
<span v-if="scope.row.status===1">正常</span>
|
<span v-if="scope.row.status===1">正常</span>
|
||||||
|
|
||||||
<span v-if="scope.row.status===2">异常</span>
|
<span v-if="scope.row.status===2">异常</span>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column prop="testStatus" label="版本测试状态">
|
<el-table-column prop="testStatus" label="版本测试状态">
|
||||||
|
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
|
|
||||||
<span v-if="scope.row.testStatus===1">数据字段</span>
|
<span v-if="scope.row.testStatus===1">数据字段</span>
|
||||||
|
|
||||||
<span v-if="scope.row.testStatus===2">数据类型</span>
|
<span v-if="scope.row.testStatus===2">数据类型</span>
|
||||||
|
|
||||||
<span v-if="scope.row.testStatus===3">数据格式</span>
|
<span v-if="scope.row.testStatus===3">数据格式</span>
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="ruleContent" label="规则内容"></el-table-column>
|
|
||||||
<el-table-column prop="engineMaintenanceId" label="引擎维护编号"></el-table-column>
|
|
||||||
<el-table-column prop="description" label="描述"></el-table-column>
|
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column fixed="right" label="操作" width="120">
|
<el-table-column fixed="right" label="操作" width="120">
|
||||||
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
|
||||||
<el-button @click.native.prevent="del(scope.row.id)" type="text" size="small">
|
<el-button @click.native.prevent="del(scope.row.id)" type="text" size="small">
|
||||||
|
|
||||||
删除
|
删除
|
||||||
|
|
||||||
</el-button>
|
</el-button>
|
||||||
|
|
||||||
<el-button v-show="scope.row.isActivate==1" @click="forbiddenEngines(scope.row.id)" type="text" size="small">关闭引擎</el-button>
|
<el-button v-show="scope.row.isActivate==1" @click="forbiddenEngines(scope.row.id)" type="text" size="small">
|
||||||
|
|
||||||
|
关闭引擎
|
||||||
|
|
||||||
<el-button v-show="scope.row.isActivate==2" @click="onEngines(scope.row.id)" type="text" size="small">开启引擎</el-button>
|
</el-button>
|
||||||
|
|
||||||
|
<el-button v-show="scope.row.isActivate==2" @click="onEngines(scope.row.id)" type="text" size="small">
|
||||||
|
|
||||||
|
开启引擎
|
||||||
|
|
||||||
|
</el-button>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column fixed="right" label="操作" width="120">
|
<el-table-column fixed="right" label="操作" width="120">
|
||||||
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
|
||||||
<el-button @click.native.prevent="selectEngineById(scope.row.id)" type="text" size="small">
|
<el-button @click.native.prevent="selectEngineById(scope.row.id)" type="text" size="small">
|
||||||
|
|
||||||
规则详情
|
规则详情
|
||||||
|
|
||||||
</el-button>
|
</el-button>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
|
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
|
<!--回显-->
|
||||||
|
|
||||||
|
<el-dialog title="收货地址" :visible.sync="versionFormVisible">
|
||||||
|
|
||||||
|
<el-form :model="versions">
|
||||||
|
|
||||||
|
<el-form-item label="版本类名" :label-width="formLabelWidth">
|
||||||
|
|
||||||
|
<el-input v-model="versions.versionClass" disabled autocomplete="off"></el-input>
|
||||||
|
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="版本名称" :label-width="formLabelWidth">
|
||||||
|
|
||||||
|
<el-input v-model="versions.name" disabled autocomplete="off"></el-input>
|
||||||
|
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="版本编码" :label-width="formLabelWidth">
|
||||||
|
|
||||||
|
<el-input v-model="versions.versionCode" disabled autocomplete="off"></el-input>
|
||||||
|
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="是否激活" :label-width="formLabelWidth">
|
||||||
|
|
||||||
|
<el-input v-model="versions.isActivate" disabled autocomplete="off"></el-input>
|
||||||
|
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="版本状态" :label-width="formLabelWidth">
|
||||||
|
|
||||||
|
<el-input v-model="versions.status" disabled autocomplete="off"></el-input>
|
||||||
|
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="版本测试" :label-width="formLabelWidth">
|
||||||
|
|
||||||
|
<el-input v-model="versions.testStatus" disabled autocomplete="off"></el-input>
|
||||||
|
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
|
||||||
|
<el-button @click="dialogFormVisible = false">取 消</el-button>
|
||||||
|
|
||||||
|
<el-button type="primary" @click="back()">确 定</el-button>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
import {add, dels, findById, forbiddenEngine, onEngine, selectEngineById} from "@/api/engine/engine";
|
import {add, dels, findById, forbiddenEngine, onEngine, sel, selectEngineById} from "@/api/engine/engine";
|
||||||
|
|
||||||
|
import Java from "@/components/JavaIDE.vue/java.vue";
|
||||||
|
|
||||||
|
import {codemirror} from 'vue-codemirror'
|
||||||
|
|
||||||
|
import "codemirror/theme/ambiance.css"; // 这里引入的是主题样式,根据设置的theme的主题引入,一定要引入!!
|
||||||
|
|
||||||
|
require("codemirror/mode/javascript/javascript"); // 这里引入的模式的js,根据设置的mode引入,一定要引入!!
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
||||||
|
@ -122,7 +235,10 @@ export default {
|
||||||
|
|
||||||
//import引入的组件需要注入到对象中才能使用"
|
//import引入的组件需要注入到对象中才能使用"
|
||||||
|
|
||||||
components: {},
|
components: {
|
||||||
|
codemirror,
|
||||||
|
Java
|
||||||
|
},
|
||||||
|
|
||||||
props: {},
|
props: {},
|
||||||
|
|
||||||
|
@ -133,12 +249,39 @@ export default {
|
||||||
return {
|
return {
|
||||||
|
|
||||||
direction: 'rtl',
|
direction: 'rtl',
|
||||||
|
|
||||||
|
versionFormVisible: false,
|
||||||
|
|
||||||
maintenance: {
|
maintenance: {
|
||||||
|
|
||||||
engineMaintenanceList: [],
|
engineMaintenanceList: [],
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
opens: false,
|
||||||
|
|
||||||
|
javaClass: "package com.muyu.rule.engine.custom;\n" +
|
||||||
|
"\n" +
|
||||||
|
"import com.muyu.engine.action.ActionDiscard;\n" +
|
||||||
|
"import com.muyu.engine.scope.DataModelEngine;\n" +
|
||||||
|
"\n" +
|
||||||
|
"/**\n" +
|
||||||
|
" * @Author: DongZeLiang\n" +
|
||||||
|
" * @date: 2024/5/6\n" +
|
||||||
|
" * @Description: 231-231\n" +
|
||||||
|
" * @Version: 1.0\n" +
|
||||||
|
" */\n" +
|
||||||
|
"public class undefined_231 extends DataModelEngine {\n" +
|
||||||
|
" @Override\n" +
|
||||||
|
" public void execution () {\n" +
|
||||||
|
" Object value = getValue();\n" +
|
||||||
|
"\n" +
|
||||||
|
" if (value == null || \"\".equals(value) || \"null\".equals(value)) {\n" +
|
||||||
|
" throw new ActionDiscard();\n" +
|
||||||
|
" }\n" +
|
||||||
|
" }\n" +
|
||||||
|
"}",
|
||||||
|
|
||||||
title: "",
|
title: "",
|
||||||
|
|
||||||
open: false,
|
open: false,
|
||||||
|
@ -147,6 +290,51 @@ export default {
|
||||||
|
|
||||||
versions: {
|
versions: {
|
||||||
|
|
||||||
|
isActivate: '未激活',
|
||||||
|
|
||||||
|
testStatus: '未测试',
|
||||||
|
|
||||||
|
status: '初始化'
|
||||||
|
},
|
||||||
|
|
||||||
|
cmOptions: {
|
||||||
|
|
||||||
|
// autorefresh: true,
|
||||||
|
|
||||||
|
// tabSize: 4,
|
||||||
|
|
||||||
|
// mode: 'text/x-properties',
|
||||||
|
|
||||||
|
// theme: 'ayu-mirage',
|
||||||
|
|
||||||
|
// line: true,
|
||||||
|
|
||||||
|
// viewportMargin: Infinity, //处理高度自适应时搭配使用
|
||||||
|
|
||||||
|
// highlightDifferences: true,
|
||||||
|
|
||||||
|
// autofocus: false,
|
||||||
|
|
||||||
|
// indentUnit: 2,
|
||||||
|
|
||||||
|
// smartIndent: true,
|
||||||
|
|
||||||
|
// readOnly: true, // 只读
|
||||||
|
|
||||||
|
// showCursorWhenSelecting: true,
|
||||||
|
|
||||||
|
// firstLineNumber: 1
|
||||||
|
|
||||||
|
lineNumbers: true, // 显示行号
|
||||||
|
|
||||||
|
mode: 'text/x-yaml', // 语法model
|
||||||
|
|
||||||
|
gutters: ['CodeMirror-lint-markers'], // 语法检查器
|
||||||
|
|
||||||
|
theme: "ambiance",
|
||||||
|
|
||||||
|
lint: true, // 开启语法检查
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
size: '',
|
size: '',
|
||||||
|
@ -155,25 +343,75 @@ export default {
|
||||||
|
|
||||||
formLabelWidth: '120px',
|
formLabelWidth: '120px',
|
||||||
|
|
||||||
arr:[]
|
arr: []
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
selectEngineById,
|
|
||||||
|
showCode() {
|
||||||
|
|
||||||
|
this.opens = true
|
||||||
|
|
||||||
|
this.javaClass;
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
//添加弹窗
|
||||||
|
|
||||||
|
addVersion() {
|
||||||
|
|
||||||
|
this.versions = {},
|
||||||
|
|
||||||
|
this.versions.isActivate = '未激活',
|
||||||
|
|
||||||
|
this.versions.testStatus = '未测试',
|
||||||
|
|
||||||
|
this.versions.status = '初始化';
|
||||||
|
|
||||||
|
this.dialogFormVisible = true
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
back() {
|
||||||
|
|
||||||
|
this.versionFormVisible = false;
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
//根据id查询回显
|
||||||
|
|
||||||
|
selectEngineById(id) {
|
||||||
|
|
||||||
|
this.versionFormVisible = true;
|
||||||
|
|
||||||
|
sel(id).then(res => {
|
||||||
|
|
||||||
|
this.versions = res.data;
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
handleInsert() {
|
handleInsert() {
|
||||||
this.dialogFormVisible = true
|
|
||||||
|
this.dialogFormVisible = false;
|
||||||
|
|
||||||
|
this.versions.isActivate = 1
|
||||||
|
|
||||||
|
this.versions.testStatus = 1
|
||||||
|
|
||||||
|
this.versions.status = 1
|
||||||
|
|
||||||
add(this.versions).then(res => {
|
add(this.versions).then(res => {
|
||||||
|
|
||||||
this.$modal.msgSuccess(res.msg || "新增成功")
|
this.$modal.msgSuccess(res.msg || "新增成功")
|
||||||
|
|
||||||
})
|
})
|
||||||
this.dialogFormVisible=false;
|
|
||||||
this.List();
|
this.findById();
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -184,7 +422,7 @@ export default {
|
||||||
this.$message.success(res.msg || "开启成功")
|
this.$message.success(res.msg || "开启成功")
|
||||||
|
|
||||||
})
|
})
|
||||||
this.List();
|
this.findById();
|
||||||
|
|
||||||
},
|
},
|
||||||
forbiddenEngines(id) {
|
forbiddenEngines(id) {
|
||||||
|
@ -208,8 +446,8 @@ export default {
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
selectEngine(){
|
selectEngine() {
|
||||||
selectEngineById(this.maintenance.id).then(res =>{
|
selectEngineById(this.maintenance.id).then(res => {
|
||||||
this.arr = res.data
|
this.arr = res.data
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -247,4 +485,16 @@ export default {
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|
||||||
|
.information-box >>> .CodeMirror {
|
||||||
|
|
||||||
|
font-family: monospace;
|
||||||
|
|
||||||
|
height: 71vh;
|
||||||
|
|
||||||
|
direction: ltr;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,140 @@
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<p style="font-weight: bold;font-size: 20px">余额:{{ userBalanceData.userBalance || '加载中...' }}</p>
|
||||||
|
<el-table
|
||||||
|
:data="tableData"
|
||||||
|
style="width: 100%">
|
||||||
|
<el-table-column
|
||||||
|
label="编号"
|
||||||
|
width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span style="margin-left: 10px">{{ scope.row.connectorUserId }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="用户"
|
||||||
|
width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span style="margin-left: 10px">{{ scope.row.userName }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="接口"
|
||||||
|
width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span style="margin-left: 10px">{{ scope.row.connectorName }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="剩余次数"
|
||||||
|
width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span style="margin-left: 10px">{{ scope.row.connectorResidueDegree }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="购买次数"
|
||||||
|
width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span style="margin-left: 10px">{{ scope.row.connectorFrequency }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="操作">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
@click="handleEdit(scope.$index, scope.row)">编辑</el-button>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="danger"
|
||||||
|
@click="handleDelete(scope.$index, scope.row)">删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等),
|
||||||
|
//例如:import 《组件名称》 from '《组件路径》,
|
||||||
|
import {findConnectorUserList} from "@/api/port/port";
|
||||||
|
import {userBalance} from "@/api/system/user";
|
||||||
|
export default {
|
||||||
|
//import引入的组件需要注入到对象中才能使用"
|
||||||
|
components: {},
|
||||||
|
props: {},
|
||||||
|
data() {
|
||||||
|
//这里存放数据"
|
||||||
|
|
||||||
|
return {
|
||||||
|
userBalanceData: {
|
||||||
|
userBalance: '加载中...'
|
||||||
|
},
|
||||||
|
tableData:[],
|
||||||
|
form:{},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
//计算属性 类似于data概念",
|
||||||
|
computed: {},
|
||||||
|
//监控data中的数据变化",
|
||||||
|
watch: {},
|
||||||
|
//方法集合",
|
||||||
|
methods: {
|
||||||
|
findConnectorUserList(){
|
||||||
|
findConnectorUserList(this.form).then((res)=>{
|
||||||
|
this.tableData=res.data;
|
||||||
|
})
|
||||||
|
},
|
||||||
|
async fetchUserBalance() {
|
||||||
|
try {
|
||||||
|
const userId = localStorage.getItem('userId');
|
||||||
|
console.log(userId)// 登录后把userId存到了localStorage
|
||||||
|
if (!userId) {
|
||||||
|
this.userBalanceData = {userBalance: '未登录'};
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const response = await userBalance(userId);
|
||||||
|
if (response.data) {
|
||||||
|
console.log(response.data)
|
||||||
|
this.userBalanceData.userBalance = response.data;
|
||||||
|
} else {
|
||||||
|
this.userBalanceData.userBalance = {userBalance: '获取失败'};
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
this.userBalanceData = {userBalance: '获取失败'};
|
||||||
|
console.error('Error fetching user balance:', error);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
//生命周期 - 创建完成(可以访问当前this实例)",
|
||||||
|
created() {
|
||||||
|
this.fetchUserBalance();
|
||||||
|
this.findConnectorUserList();
|
||||||
|
},
|
||||||
|
//生命周期 - 挂载完成(可以访问DOM元素)",
|
||||||
|
mounted() {
|
||||||
|
},
|
||||||
|
beforeCreate() {
|
||||||
|
}, //生命周期 - 创建之前",
|
||||||
|
beforeMount() {
|
||||||
|
}, //生命周期 - 挂载之前",
|
||||||
|
beforeUpdate() {
|
||||||
|
}, //生命周期 - 更新之前",
|
||||||
|
updated() {
|
||||||
|
}, //生命周期 - 更新之后",
|
||||||
|
beforeDestroy() {
|
||||||
|
}, //生命周期 - 销毁之前",
|
||||||
|
destroyed() {
|
||||||
|
}, //生命周期 - 销毁完成",
|
||||||
|
activated() {
|
||||||
|
} //如果页面有keep-alive缓存功能,这个函数会触发",
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
|
@ -180,8 +180,10 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="购买次数" :label-width="formLabelWidth">
|
<el-form-item label="购买次数" :label-width="formLabelWidth">
|
||||||
<el-input-number v-model="buyForm.connectorFrequency" controls-position="right" @change="handleChange" :min="1" :max="10"></el-input-number>
|
<el-input-number v-model="buyForm.connectorFrequency" controls-position="right" @change="handleChange" :min="1"></el-input-number>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<p style="font-weight: bold;font-size: 20px">余额:{{ userBalanceData.userBalance || '加载中...' }}</p>
|
||||||
|
<span style="font-weight: bold;font-size: 20px">共计:{{buyForm.connectorPrice*buyForm.connectorFrequency}}元</span>
|
||||||
|
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
|
@ -204,6 +206,7 @@ import {getBirthday} from "@/api/port/port";
|
||||||
import {getPostcode} from "@/api/port/port";
|
import {getPostcode} from "@/api/port/port";
|
||||||
import {getWeather} from "@/api/port/port";
|
import {getWeather} from "@/api/port/port";
|
||||||
import {doBuyInterface} from "@/api/port/port";
|
import {doBuyInterface} from "@/api/port/port";
|
||||||
|
import {userBalance} from "@/api/system/user";
|
||||||
export default {
|
export default {
|
||||||
//import引入的组件需要注入到对象中才能使用"
|
//import引入的组件需要注入到对象中才能使用"
|
||||||
components: {},
|
components: {},
|
||||||
|
@ -212,6 +215,9 @@ export default {
|
||||||
//这里存放数据"
|
//这里存放数据"
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
userBalanceData: {
|
||||||
|
userBalance: '加载中...'
|
||||||
|
},
|
||||||
formWeather:{},
|
formWeather:{},
|
||||||
data:[],
|
data:[],
|
||||||
defaultProps: {
|
defaultProps: {
|
||||||
|
@ -305,6 +311,26 @@ export default {
|
||||||
watch: {},
|
watch: {},
|
||||||
//方法集合",
|
//方法集合",
|
||||||
methods: {
|
methods: {
|
||||||
|
async fetchUserBalance() {
|
||||||
|
try {
|
||||||
|
const userId = localStorage.getItem('userId');
|
||||||
|
console.log(userId)// 登录后把userId存到了localStorage
|
||||||
|
if (!userId) {
|
||||||
|
this.userBalanceData = {userBalance: '未登录'};
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const response = await userBalance(userId);
|
||||||
|
if (response.data) {
|
||||||
|
console.log(response.data)
|
||||||
|
this.userBalanceData.userBalance = response.data;
|
||||||
|
} else {
|
||||||
|
this.userBalanceData.userBalance = {userBalance: '获取失败'};
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
this.userBalanceData = {userBalance: '获取失败'};
|
||||||
|
console.error('Error fetching user balance:', error);
|
||||||
|
}
|
||||||
|
},
|
||||||
buyInterface(){
|
buyInterface(){
|
||||||
doBuyInterface(this.buyForm).then((res)=>{
|
doBuyInterface(this.buyForm).then((res)=>{
|
||||||
console.log(res);
|
console.log(res);
|
||||||
|
@ -414,6 +440,7 @@ export default {
|
||||||
},
|
},
|
||||||
//生命周期 - 创建完成(可以访问当前this实例)",
|
//生命周期 - 创建完成(可以访问当前this实例)",
|
||||||
created() {
|
created() {
|
||||||
|
this.fetchUserBalance();
|
||||||
this.findConnectorList();
|
this.findConnectorList();
|
||||||
},
|
},
|
||||||
//生命周期 - 挂载完成(可以访问DOM元素)",
|
//生命周期 - 挂载完成(可以访问DOM元素)",
|
||||||
|
|
|
@ -20,7 +20,20 @@
|
||||||
|
|
||||||
<!-- 添加任务详情设计-->
|
<!-- 添加任务详情设计-->
|
||||||
<el-dialog title="添加表" :visible.sync="taskInputForm" width="70%">
|
<el-dialog title="添加表" :visible.sync="taskInputForm" width="70%">
|
||||||
<formData v-if="this.formData" :group="graph" :node-id="nodeId" :taskInputForm="taskInputForm" :tableInfo="tableInfo" @taskInputForm="findFormValue"></formData>
|
<formData v-if="formData" :group="graph" :node-id="nodeId" :taskInputForm="taskInputForm"
|
||||||
|
:nodeName="nodeName" :tableInfo="tableInfo" @taskInputForm="findFormValue"></formData>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
<!-- 联查弹窗-->
|
||||||
|
<el-dialog title="联查" :visible.sync="taskInputJoin" width="70%">
|
||||||
|
<formJoin v-if="formJoin" :group="graph" :node-id="nodeId"
|
||||||
|
:nodeName="nodeName" :neighbors="neighbors"
|
||||||
|
:taskId="taskId" :taskInputJoin="taskInputJoin" @saveTaskJoin="findFormValue"></formJoin>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
<!-- 数据输出弹窗-->
|
||||||
|
<el-dialog title="数据输出" :visible.sync="taskDataOutPut" width="70%">
|
||||||
|
<dataOutInput v-if="formOut" taskDataOutPut:taskDataOutPut></dataOutInput>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
|
||||||
|
@ -30,52 +43,33 @@
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
import { Graph } from "@antv/x6";
|
import { Graph } from "@antv/x6";
|
||||||
import { addTaskInput, findByNodeId, findByTableId, findStructureList, tableInfoList } from '@/api/task/task'
|
import { findByNodeId } from '@/api/task/task'
|
||||||
import { findStructureByTableId, findTableInfoList } from '@/api/etl/switch'
|
|
||||||
import { selectEngineList } from '@/api/engine/engine'
|
|
||||||
import formData from '/src/views/components/task/formData.vue'
|
import formData from '/src/views/components/task/formData.vue'
|
||||||
|
import formJoin from '/src/views/components/task/formJoin.vue'
|
||||||
|
import dataOutInput from '/src/views/components/task/formDataOut.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "antvX6",
|
name: "antvX6",
|
||||||
components:{
|
components:{
|
||||||
formData
|
formData,
|
||||||
|
formJoin,
|
||||||
|
dataOutInput,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
dialogFormVisible:false,
|
//数据输出弹窗界面
|
||||||
|
taskDataOutPut:false,
|
||||||
//任务设计添加表弹窗
|
//任务设计添加表弹窗
|
||||||
taskInputAdd:false,
|
taskInputAdd:false,
|
||||||
|
//联查界面
|
||||||
|
taskInputJoin:false,
|
||||||
//选择字段弹窗
|
//选择字段弹窗
|
||||||
taskInputFieldAdd:false,
|
taskInputFieldAdd:false,
|
||||||
taskReq:{
|
//连再联查的节点id
|
||||||
|
neighbors:[],
|
||||||
},
|
//记录表信息
|
||||||
taskAddReq:{},
|
tableInfo:{},
|
||||||
taskInputReq:{},
|
//画布节点选项
|
||||||
engineReq:{
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 100
|
|
||||||
},
|
|
||||||
taskList:[],
|
|
||||||
//级联选择器
|
|
||||||
value:[],
|
|
||||||
|
|
||||||
engineList:[],
|
|
||||||
|
|
||||||
//树状图
|
|
||||||
data:[],
|
|
||||||
defaultProps:{
|
|
||||||
children:"children",
|
|
||||||
label:'tableName'
|
|
||||||
},
|
|
||||||
|
|
||||||
tableList:[],
|
|
||||||
columnList:[],
|
|
||||||
structureList:[],
|
|
||||||
tableInfo:{
|
|
||||||
taskId:this.$route.params.id,
|
|
||||||
},
|
|
||||||
itemId:0,
|
|
||||||
moduleList: [
|
moduleList: [
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
|
@ -101,16 +95,23 @@ export default {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 4,
|
id: 4,
|
||||||
name: "结束",
|
name: "数据输出",
|
||||||
image: require("@/assets/img/4.png"),
|
image: require("@/assets/img/4.png"),
|
||||||
data:{}
|
data:{}
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
//画布
|
||||||
graph:null,
|
graph:null,
|
||||||
|
//节点id
|
||||||
nodeId:null,
|
nodeId:null,
|
||||||
nodeName:null,
|
nodeName:null,
|
||||||
|
|
||||||
|
//添加表弹窗
|
||||||
taskInputForm:false,
|
taskInputForm:false,
|
||||||
formData:false,
|
formData:false,
|
||||||
|
formJoin:false,
|
||||||
|
formOut:false,
|
||||||
|
taskId:this.$route.params.id,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
//初始化
|
//初始化
|
||||||
|
@ -121,6 +122,7 @@ export default {
|
||||||
findFormValue(){
|
findFormValue(){
|
||||||
this.formData=false;
|
this.formData=false;
|
||||||
this.taskInputForm=false;
|
this.taskInputForm=false;
|
||||||
|
this.taskInputJoin=false;
|
||||||
},
|
},
|
||||||
|
|
||||||
//保存画布,并提交
|
//保存画布,并提交
|
||||||
|
@ -140,14 +142,18 @@ export default {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
//左键单击事件
|
//左键单击事件
|
||||||
this.graph.on("node:click",(evt)=>{
|
this.graph.on("node:click",(evt)=>{
|
||||||
const data = evt.node.store.data;
|
const data = evt.node.store.data;
|
||||||
const thisData = data.attrs.label.textWrap.text;
|
const thisData = data.attrs.label.textWrap.text;
|
||||||
if(thisData == "表"){
|
|
||||||
this.nodeId = data.id;
|
this.nodeId = data.id;
|
||||||
|
this.nodeName = thisData;
|
||||||
|
if(thisData == "表"){
|
||||||
findByNodeId(this.nodeId).then(res=>{
|
findByNodeId(this.nodeId).then(res=>{
|
||||||
if(res.code == 200){
|
this.tableInfo={};
|
||||||
|
this.tableInfo.taskId = this.taskId;
|
||||||
|
if(res.code == 200 && res.data!=null){
|
||||||
this.tableInfo = res.data;
|
this.tableInfo = res.data;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -155,7 +161,33 @@ export default {
|
||||||
this.taskInputForm = true;
|
this.taskInputForm = true;
|
||||||
this.formData = true;
|
this.formData = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(thisData == "联查"){
|
||||||
|
// 获取与当前节点相连的所有边
|
||||||
|
const edges = this.graph.getEdges().filter(edge => {
|
||||||
|
return edge.getSourceNode().id === data.id || edge.getTargetNode().id === data.id;
|
||||||
});
|
});
|
||||||
|
// 遍历边,找到相连的节点(注意排除当前节点本身)
|
||||||
|
const neighbors = [];
|
||||||
|
edges.forEach(edge => {
|
||||||
|
const otherNodeId = edge.getSourceNode().id === data.id ? edge.getTargetNode().id : edge.getSourceNode().id;
|
||||||
|
if (!neighbors.includes(otherNodeId)) {
|
||||||
|
neighbors.push(otherNodeId); // 或者你可以推送整个节点对象,而不是仅ID
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// 现在neighbors数组包含了所有与当前节点相连的节点的ID
|
||||||
|
console.log('相连节点的ID:', neighbors);
|
||||||
|
this.neighbors = neighbors;
|
||||||
|
this.taskInputJoin = true;
|
||||||
|
this.formJoin = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(thisData == "数据输出"){
|
||||||
|
this.taskDataOutPut = true;
|
||||||
|
this.formOut = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
this.graph.on("node:mouseenter", () => {
|
this.graph.on("node:mouseenter", () => {
|
||||||
changePortsVisible(true);
|
changePortsVisible(true);
|
||||||
|
|
|
@ -399,7 +399,7 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
//跳转到任务设计界面
|
//跳转到任务设计界面
|
||||||
toDesign(row){
|
toDesign(row){
|
||||||
this.$router.push({path:'/easyFlow/index/:'+row.id});
|
this.$router.push({path:'/easyFlow/index/'+row.id, query:{name:row.name}});
|
||||||
},
|
},
|
||||||
|
|
||||||
//选择数据表改变数据
|
//选择数据表改变数据
|
||||||
|
|
Loading…
Reference in New Issue