feat: 引擎版本详情
commit
0a0211e366
|
@ -175,3 +175,10 @@ export function modification(data){
|
|||
data
|
||||
})
|
||||
}
|
||||
//获取数据结构
|
||||
export function information(){
|
||||
return request({
|
||||
url:'/source/source/information',
|
||||
method:'get'
|
||||
})
|
||||
}
|
||||
|
|
|
@ -32,10 +32,11 @@ export function getRuleContent(ruleId) {
|
|||
})
|
||||
}
|
||||
|
||||
export function loader(ruleId) {
|
||||
export function loader(data) {
|
||||
return request({
|
||||
url: `/rule/rule/loader?ruleId=`+ruleId,
|
||||
method: 'get'
|
||||
url: `/rule/rule/loader`,
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -184,67 +184,72 @@
|
|||
<editor style="margin-top: 10px" :read-only="true" :min-height="105" v-model="ruleEngineVersionInfoAndTest.description"></editor>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
|
||||
<el-col :span="12">
|
||||
<encoding style="margin-top: 20px" v-model="ruleEngineVersionInfoAndTest.codeIng" :read-only="true"></encoding>
|
||||
</el-col>
|
||||
<!-- <el-col :span="12">-->
|
||||
<!-- <el-col :span="assetStructure == null ? 24 : 12">-->
|
||||
<!-- <el-card class="box-card">-->
|
||||
<!-- <div slot="header" class="clearfix">-->
|
||||
<!-- <span>选择数据接入</span>-->
|
||||
<!-- </div>-->
|
||||
<!-- <el-select v-model="assetStructure" style="width: 100%;">-->
|
||||
<!-- <el-option v-for="_assetStructure in assetStructureList"-->
|
||||
<!-- :key="_assetStructure.name"-->
|
||||
<!-- :value="_assetStructure.name"-->
|
||||
<!-- :label="_assetStructure.name+'('+_assetStructure.systemName+')'"-->
|
||||
<!-- ></el-option>-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </el-card>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <el-col :span="12" v-if="assetStructure != null">-->
|
||||
<!-- <el-card class="box-card" >-->
|
||||
<!-- <div slot="header" class="clearfix">-->
|
||||
<!-- <span>选择资产结构</span>-->
|
||||
<!-- </div>-->
|
||||
<!-- <el-select v-model="assets" style="width: 100%;">-->
|
||||
<!-- <el-option v-for="_assets in assetsList"-->
|
||||
<!-- :key="_assets.name"-->
|
||||
<!-- :value="_assets.name"-->
|
||||
<!-- :label="_assets.name+'('+_assets.as+')'"-->
|
||||
<!-- ></el-option>-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </el-card>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <el-col :span="24">-->
|
||||
<!-- <el-card class="box-card" v-if="assets != null">-->
|
||||
<!-- <div slot="header" class="clearfix">-->
|
||||
<!-- <span>选择资产模型</span>-->
|
||||
<!-- </div>-->
|
||||
|
||||
<el-col :span="12">
|
||||
<el-col :span="assetStructure == null ? 24 : 12">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>选择数据接入</span>
|
||||
</div>
|
||||
<el-select v-model="assetStructure" style="width: 100%;">
|
||||
<el-option v-for="_assetStructure in assetStructureList"
|
||||
:key="_assetStructure.dataSource.accessSourceName"
|
||||
:value="_assetStructure.dataSource.accessSourceName"
|
||||
:label="_assetStructure.dataSource.accessSourceName+'('+_assetStructure.dataSource.dataSourceSystemName+')'"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="12" v-if="assetStructure != null">
|
||||
<el-card class="box-card" >
|
||||
<div slot="header" class="clearfix">
|
||||
<span>选择资产结构</span>
|
||||
</div>
|
||||
<el-select v-model="assets" style="width: 100%;">
|
||||
<el-option v-for="_valueList in assetsList"
|
||||
:key="_valueList.name"
|
||||
:value="_valueList.name"
|
||||
:label="_valueList.name+'('+_valueList.as+')'"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-card class="box-card" v-if="assets != null">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>选择资产模型</span>
|
||||
</div>
|
||||
<!-- <el-descriptions direction="vertical" :column="3" border>-->
|
||||
<!-- <el-descriptions-item v-for="_dataModel in dataModelList"-->
|
||||
<!-- :label='_dataModel.name + "("+_dataModel.comment+")"'>-->
|
||||
<!-- <el-radio v-model="dataMode" :label="_dataModel.name" :value="_dataModel.id">{{dataModeMap[_dataModel.name]}}</el-radio>-->
|
||||
<!-- </el-descriptions-item>-->
|
||||
<!-- </el-descriptions>-->
|
||||
<!-- </el-card>-->
|
||||
<!-- </el-col>-->
|
||||
</el-card>
|
||||
</el-col>
|
||||
<!-- <el-col :span="24" style="margin-top: 10px" v-if="dataMode != null">-->
|
||||
<!-- <el-button>测试</el-button>-->
|
||||
<!-- <el-input style="margin-top: 10px" v-model="testResult" type="textarea" placeholder="请点击测试" />-->
|
||||
<!-- </el-col>-->
|
||||
<!-- </el-col>-->
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-drawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { details, versionsAdd, engineOnOff, statusOnOff, versionsUpd, ruleengine } from '@/api/rule/maintenance'
|
||||
import { details, versionsAdd, engineOnOff, statusOnOff, versionsUpd, ruleengine, loader } from '@/api/rule/maintenance'
|
||||
import Encoding from "@/components/Encoding/index.vue";
|
||||
import { information } from '@/api/dataSource/source'
|
||||
export default {
|
||||
name: "EngineVersion",
|
||||
computed: {},
|
||||
components: {Encoding},
|
||||
dicts: ['rule_engine_activate_status', 'rule_engine_type', 'sys_normal_disable', 'rule_engine_level', 'rule_engine_version_status','rule_engine_activate_is_test'],
|
||||
data() {
|
||||
|
@ -278,7 +283,11 @@ export default {
|
|||
isTest:"0"
|
||||
},
|
||||
assetStructure:null,
|
||||
assets:null,
|
||||
//结构集合
|
||||
assetStructureList:[],
|
||||
//表集合
|
||||
assetsList:[],
|
||||
// 详情抽屉状态
|
||||
ruleEngineVersionInfoStatus: false,
|
||||
// 测试抽屉状态
|
||||
|
@ -291,10 +300,34 @@ export default {
|
|||
},
|
||||
created() {
|
||||
this.initRuleEngine();
|
||||
this.SourceList();
|
||||
},
|
||||
watch:{
|
||||
"assetStructure":{
|
||||
handler(val){
|
||||
console.log("assetStructure监听",val)
|
||||
this.assetStructureList.forEach(res => {
|
||||
if (res.dataSource.accessSourceName === val) {
|
||||
res.databaseTableInformationList.forEach(value=>{
|
||||
if (res.dataSource.databaseName === value.databaseName) {
|
||||
this.assetsList = res.databaseTableInformationList
|
||||
console.log("this.assetsList",this.assetsList)
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
"assets":{
|
||||
handler(val){
|
||||
console.log("assets监听",val)
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
//保存代码
|
||||
|
||||
saveCoding: function() {
|
||||
this.ruleEngineVersionInfoAndTest.status = "1"
|
||||
console.log(this.ruleEngineVersionInfoAndTest)
|
||||
|
@ -306,13 +339,12 @@ export default {
|
|||
this.$message.success(res.msg)
|
||||
ruleengine(this.ruleContentReq).then(
|
||||
res=>{
|
||||
this.$message.error(res.msg)
|
||||
this.$message.success(res.msg)
|
||||
this.ruleEngineVersionInfoStatus=false
|
||||
this.initRuleEngine(this.ruleEngineId)
|
||||
this.ruleEngineVersionInfoAndTest={}
|
||||
}
|
||||
)
|
||||
|
||||
}else {
|
||||
this.$message.error(res.msg)
|
||||
this.initRuleEngine(this.ruleEngineId)
|
||||
|
@ -470,6 +502,12 @@ public class ${this.engineVersionForm.versionCode} extends ${parentClass} {
|
|||
details(this.$route.params.id).then(res=>{
|
||||
this.ruleEngineInfo=res.data
|
||||
})
|
||||
},
|
||||
SourceList(){
|
||||
information().then(res=>{
|
||||
this.assetStructureList=res.data
|
||||
console.log("数据结构",this.assetStructureList)
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -316,41 +316,6 @@ export default {
|
|||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
//代码编辑
|
||||
// addEngine(row) {
|
||||
// this.ruleContentReq.ruleId=row.id
|
||||
// this.isEditorVisible = true
|
||||
// this.dialogVisible = true;
|
||||
// // 初始化 CodeMirror(如果尚未初始化)
|
||||
// if (!this.editor) {
|
||||
// this.$nextTick(() => {
|
||||
// this.editor = CodeMirror(this.$refs.editor, {
|
||||
// value: "public class Test {\n public boolean execute(String name) {\n if (name == null || name.length() == 0) {\n System.out.println(\"哈哈哈哈\");\n return true;\n }\n return false;\n }\n}",
|
||||
// mode: "javascript",
|
||||
// lineNumbers: true,
|
||||
// });
|
||||
// });
|
||||
// }
|
||||
// },
|
||||
//引擎记载
|
||||
// loader(row){
|
||||
// loader(row.id).then(
|
||||
// res=>{
|
||||
// this.$message.success(res.data)
|
||||
// }
|
||||
// )
|
||||
// },
|
||||
//编辑代码
|
||||
tosend(){
|
||||
const code = this.editor.getValue();
|
||||
this.ruleContentReq.ruleContent=code
|
||||
console.log(this.ruleContentReq)
|
||||
ruleengine(this.ruleContentReq).then(
|
||||
res=>{
|
||||
this.$message.success(res.data)
|
||||
}
|
||||
)
|
||||
},
|
||||
toEngineVersion(row) {
|
||||
console.log(row)
|
||||
this.$router.push({ path: `/ruleengine/engineVersion/${row.id}`});
|
||||
|
|
Loading…
Reference in New Issue