feat: 引擎版本详情

master
031026 2024-05-08 22:40:46 +08:00
commit 0a0211e366
4 changed files with 90 additions and 79 deletions

View File

@ -175,3 +175,10 @@ export function modification(data){
data data
}) })
} }
//获取数据结构
export function information(){
return request({
url:'/source/source/information',
method:'get'
})
}

View File

@ -32,10 +32,11 @@ export function getRuleContent(ruleId) {
}) })
} }
export function loader(ruleId) { export function loader(data) {
return request({ return request({
url: `/rule/rule/loader?ruleId=`+ruleId, url: `/rule/rule/loader`,
method: 'get' method: 'post',
data
}) })
} }

View File

@ -184,67 +184,72 @@
<editor style="margin-top: 10px" :read-only="true" :min-height="105" v-model="ruleEngineVersionInfoAndTest.description"></editor> <editor style="margin-top: 10px" :read-only="true" :min-height="105" v-model="ruleEngineVersionInfoAndTest.description"></editor>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<encoding style="margin-top: 20px" v-model="ruleEngineVersionInfoAndTest.codeIng" :read-only="true"></encoding> <encoding style="margin-top: 20px" v-model="ruleEngineVersionInfoAndTest.codeIng" :read-only="true"></encoding>
</el-col> </el-col>
<!-- <el-col :span="12">-->
<!-- <el-col :span="assetStructure == null ? 24 : 12">--> <el-col :span="12">
<!-- <el-card class="box-card">--> <el-col :span="assetStructure == null ? 24 : 12">
<!-- <div slot="header" class="clearfix">--> <el-card class="box-card">
<!-- <span>选择数据接入</span>--> <div slot="header" class="clearfix">
<!-- </div>--> <span>选择数据接入</span>
<!-- <el-select v-model="assetStructure" style="width: 100%;">--> </div>
<!-- <el-option v-for="_assetStructure in assetStructureList"--> <el-select v-model="assetStructure" style="width: 100%;">
<!-- :key="_assetStructure.name"--> <el-option v-for="_assetStructure in assetStructureList"
<!-- :value="_assetStructure.name"--> :key="_assetStructure.dataSource.accessSourceName"
<!-- :label="_assetStructure.name+'('+_assetStructure.systemName+')'"--> :value="_assetStructure.dataSource.accessSourceName"
<!-- ></el-option>--> :label="_assetStructure.dataSource.accessSourceName+'('+_assetStructure.dataSource.dataSourceSystemName+')'"
<!-- </el-select>--> ></el-option>
<!-- </el-card>--> </el-select>
<!-- </el-col>--> </el-card>
<!-- <el-col :span="12" v-if="assetStructure != null">--> </el-col>
<!-- <el-card class="box-card" >--> <el-col :span="12" v-if="assetStructure != null">
<!-- <div slot="header" class="clearfix">--> <el-card class="box-card" >
<!-- <span>选择资产结构</span>--> <div slot="header" class="clearfix">
<!-- </div>--> <span>选择资产结构</span>
<!-- <el-select v-model="assets" style="width: 100%;">--> </div>
<!-- <el-option v-for="_assets in assetsList"--> <el-select v-model="assets" style="width: 100%;">
<!-- :key="_assets.name"--> <el-option v-for="_valueList in assetsList"
<!-- :value="_assets.name"--> :key="_valueList.name"
<!-- :label="_assets.name+'('+_assets.as+')'"--> :value="_valueList.name"
<!-- ></el-option>--> :label="_valueList.name+'('+_valueList.as+')'"
<!-- </el-select>--> ></el-option>
<!-- </el-card>--> </el-select>
<!-- </el-col>--> </el-card>
<!-- <el-col :span="24">--> </el-col>
<!-- <el-card class="box-card" v-if="assets != null">--> <el-col :span="24">
<!-- <div slot="header" class="clearfix">--> <el-card class="box-card" v-if="assets != null">
<!-- <span>选择资产模型</span>--> <div slot="header" class="clearfix">
<!-- </div>--> <span>选择资产模型</span>
</div>
<!-- <el-descriptions direction="vertical" :column="3" border>--> <!-- <el-descriptions direction="vertical" :column="3" border>-->
<!-- <el-descriptions-item v-for="_dataModel in dataModelList"--> <!-- <el-descriptions-item v-for="_dataModel in dataModelList"-->
<!-- :label='_dataModel.name + "("+_dataModel.comment+")"'>--> <!-- :label='_dataModel.name + "("+_dataModel.comment+")"'>-->
<!-- <el-radio v-model="dataMode" :label="_dataModel.name" :value="_dataModel.id">{{dataModeMap[_dataModel.name]}}</el-radio>--> <!-- <el-radio v-model="dataMode" :label="_dataModel.name" :value="_dataModel.id">{{dataModeMap[_dataModel.name]}}</el-radio>-->
<!-- </el-descriptions-item>--> <!-- </el-descriptions-item>-->
<!-- </el-descriptions>--> <!-- </el-descriptions>-->
<!-- </el-card>--> </el-card>
<!-- </el-col>--> </el-col>
<!-- <el-col :span="24" style="margin-top: 10px" v-if="dataMode != null">--> <!-- <el-col :span="24" style="margin-top: 10px" v-if="dataMode != null">-->
<!-- <el-button>测试</el-button>--> <!-- <el-button>测试</el-button>-->
<!-- <el-input style="margin-top: 10px" v-model="testResult" type="textarea" placeholder="请点击测试" />--> <!-- <el-input style="margin-top: 10px" v-model="testResult" type="textarea" placeholder="请点击测试" />-->
<!-- </el-col>--> <!-- </el-col>-->
<!-- </el-col>--> </el-col>
</el-row> </el-row>
</el-drawer> </el-drawer>
</div> </div>
</template> </template>
<script> <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 Encoding from "@/components/Encoding/index.vue";
import { information } from '@/api/dataSource/source'
export default { export default {
name: "EngineVersion", name: "EngineVersion",
computed: {},
components: {Encoding}, 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'], dicts: ['rule_engine_activate_status', 'rule_engine_type', 'sys_normal_disable', 'rule_engine_level', 'rule_engine_version_status','rule_engine_activate_is_test'],
data() { data() {
@ -278,7 +283,11 @@ export default {
isTest:"0" isTest:"0"
}, },
assetStructure:null, assetStructure:null,
assets:null,
//
assetStructureList:[], assetStructureList:[],
//
assetsList:[],
// //
ruleEngineVersionInfoStatus: false, ruleEngineVersionInfoStatus: false,
// //
@ -291,10 +300,34 @@ export default {
}, },
created() { created() {
this.initRuleEngine(); 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: { methods: {
// //
saveCoding: function() { saveCoding: function() {
this.ruleEngineVersionInfoAndTest.status = "1" this.ruleEngineVersionInfoAndTest.status = "1"
console.log(this.ruleEngineVersionInfoAndTest) console.log(this.ruleEngineVersionInfoAndTest)
@ -306,13 +339,12 @@ export default {
this.$message.success(res.msg) this.$message.success(res.msg)
ruleengine(this.ruleContentReq).then( ruleengine(this.ruleContentReq).then(
res=>{ res=>{
this.$message.error(res.msg) this.$message.success(res.msg)
this.ruleEngineVersionInfoStatus=false this.ruleEngineVersionInfoStatus=false
this.initRuleEngine(this.ruleEngineId) this.initRuleEngine(this.ruleEngineId)
this.ruleEngineVersionInfoAndTest={} this.ruleEngineVersionInfoAndTest={}
} }
) )
}else { }else {
this.$message.error(res.msg) this.$message.error(res.msg)
this.initRuleEngine(this.ruleEngineId) this.initRuleEngine(this.ruleEngineId)
@ -470,6 +502,12 @@ public class ${this.engineVersionForm.versionCode} extends ${parentClass} {
details(this.$route.params.id).then(res=>{ details(this.$route.params.id).then(res=>{
this.ruleEngineInfo=res.data this.ruleEngineInfo=res.data
}) })
},
SourceList(){
information().then(res=>{
this.assetStructureList=res.data
console.log("数据结构",this.assetStructureList)
})
} }
} }

View File

@ -316,41 +316,6 @@ export default {
this.getList(); this.getList();
}, },
methods: { 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) { toEngineVersion(row) {
console.log(row) console.log(row)
this.$router.push({ path: `/ruleengine/engineVersion/${row.id}`}); this.$router.push({ path: `/ruleengine/engineVersion/${row.id}`});