第一次

master
chentaisen 2024-09-08 11:01:42 +08:00
parent 5d74a46ba5
commit 3a88d504c0
2 changed files with 112 additions and 25 deletions

View File

@ -79,6 +79,13 @@ export function findTableIdByParentId(id) {
method: 'post', method: 'post',
}) })
} }
//表
export function findTableValueByTableName(basicId,tableName) {
return request({
url: `/source/value/findTableValueByTableName/?basicId=`+basicId+'&&tableName='+tableName,
method: 'post',
})
}
//保存代码 //保存代码
export function updateRuleEngine(data) { export function updateRuleEngine(data) {
@ -88,3 +95,11 @@ export function updateRuleEngine(data) {
data: data data: data
}) })
} }
//规则测试
export function measurement(data) {
return request({
url: '/rule/ruleEdition/measurement',
method: 'post',
data: data
})
}

View File

@ -118,6 +118,7 @@
<!-- @pagination="getList"--> <!-- @pagination="getList"-->
<!-- />--> <!-- />-->
<br><br> <br><br>
<el-row :gutter="10"> <el-row :gutter="10">
<!-- <el-empty description="暂无支付客户" v-if="customerList.length === 0"></el-empty>--> <!-- <el-empty description="暂无支付客户" v-if="customerList.length === 0"></el-empty>-->
@ -260,9 +261,8 @@
<el-input v-model="form.ruleId" disabled placeholder="请输入版本"/> <el-input v-model="form.ruleId" disabled placeholder="请输入版本"/>
</el-form-item> </el-form-item>
<el-button type="primary" @click="submitForm()"></el-button>
<!-- 前台web编写代码--> <!-- 前台web编写代码-->
<el-form-item label="引擎编码" prop="ruleCoding"> <el-form-item label="引擎编码" prop="ruleEngine">
<codemirror ref="ruleEngine" :value="form.ruleEngine" :options="cmOptions" class="code"> <codemirror ref="ruleEngine" :value="form.ruleEngine" :options="cmOptions" class="code">
</codemirror> </codemirror>
</el-form-item> </el-form-item>
@ -312,13 +312,15 @@
<el-input v-model="form.ruleId" disabled placeholder="请输入版本"/> <el-input v-model="form.ruleId" disabled placeholder="请输入版本"/>
</el-form-item> </el-form-item>
<!-- 前台web编写代码--> <!-- 前台web编写代码-->
<el-form-item label="引擎编码" prop="ruleCoding"> <el-form-item label="引擎编码" prop="ruleEngine">
<codemirror ref="ruleEngine" :value="form.ruleEngine" :options="cmOptions" class="code"> <codemirror ref="ruleEngine" :value="form.ruleEngine" v-model="form.ruleEngine" :options="cmOptions"
class="code">
</codemirror> </codemirror>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="preserve()"></el-button>
<el-button type="primary" @click="submitForm"> </el-button> <el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button> <el-button @click="cancel"> </el-button>
</div> </div>
@ -342,7 +344,7 @@
<span>选择资产结构</span> <span>选择资产结构</span>
</div> </div>
<span> <span>
<el-select v-model="dataOrigin.tableId" placeholder="请选择数据接入" @blur="ch()"> <el-select v-model="dataOrigin.tableId" placeholder="请选择数据结构" @blur="ch()">
<el-option v-for="i in tableOrigin" :label="i.tableName" :value="i.id" :key="i.id"></el-option> <el-option v-for="i in tableOrigin" :label="i.tableName" :value="i.id" :key="i.id"></el-option>
</el-select> </el-select>
</span> </span>
@ -353,31 +355,81 @@
<el-card class="box-card"> <el-card class="box-card">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>选择资产集</span> <span>选择资产集</span>
</div> <template>
<span>
<template>
<el-table <el-table
:data="tableData" :data="tableOrigin"
style="width: 100%"> style="width: 100%">
<el-table-column <el-table-column
label="日期" label="主键"
width="180"> width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<i class="el-icon-time"></i> <span style="margin-left: 10px">{{ scope.row.id }}</span>
<span style="margin-left: 10px">{{ scope.row.date }}</span> </template>
</el-table-column>
<el-table-column
label="数据源ID"
width="180">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.basicId }}</span>
</template>
</el-table-column>
<el-table-column
label="表名称"
width="180">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.tableName }}</span>
</template>
</el-table-column>
<el-table-column
label="表备注"
width="180">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.tableRemark }}</span>
</template>
</el-table-column>
<el-table-column
label="类型"
width="180">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.type }}</span>
</template>
</el-table-column>
<el-table-column
label="数据量"
width="180">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.dataNum }}</span>
</template>
</el-table-column>
<el-table-column
label="是否核心"
width="180">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.center }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button
size="mini"
@click="handleEditSelect()">选择
</el-button>
</template>
</el-table-column>
</el-table> </el-table>
</template> </template>
</div>
<span>
<el-button type="primary" @click="measurements()"> </el-button>
</span> </span>
</el-card> </el-card>
</el-col> </el-col>
</span> </span>
</el-drawer>
</el-drawer>
</div> </div>
</template> </template>
@ -390,8 +442,8 @@ import {
disable, disable,
enable, findTableIdByParentId, enable, findTableIdByParentId,
getEditionList, getEditionList,
getFindByEditionId, selectById, getFindByEditionId, selectById, measurement,
updateRule, updateRuleEngine updateRule, updateRuleEngine, findTableValueByTableName
} from "@/api/rule/ruleEdition"; } from "@/api/rule/ruleEdition";
@ -419,7 +471,8 @@ export default {
theme: "ambiance", theme: "ambiance",
lint: true, // lint: true, //
}, },
tableData: [],
tableDatas: [],
ruleAndEditionList: [], ruleAndEditionList: [],
// //
ruleAndEdition: {}, ruleAndEdition: {},
@ -486,8 +539,6 @@ export default {
{required: true, message: "是否激活;是否激活不能为空", trigger: "blur"} {required: true, message: "是否激活;是否激活不能为空", trigger: "blur"}
], ],
} }
}; };
}, },
created() { created() {
@ -501,24 +552,44 @@ export default {
this.findById(); this.findById();
}, },
methods: { methods: {
// //
preserve() { handleEditSelect() {
updateRuleEngine(this.form).then(res => { findTableValueByTableName(this.tableOrigin.basicId, this.tableOrigin.tableName).then(res => {
this.$modal.msgSuccess("修改成功"); console.log(res.data)
this.tableDatas = res.data
console.log(this.tableDatas)
}) })
}, },
//
measurements() {
measurement(this.form).then(res => {
this.$modal.msgSuccess("操作成功");
})
},
//
preserve() {
this.$refs["form"].validate(valid => {
updateRuleEngine(this.form).then(response => {
alert(this.form.ruleEngine)
// console.log(this.form)
this.$modal.msgSuccess("修改成功");
});
});
},
// //
getDataOrigin() { getDataOrigin() {
selectById(this.dataOrigin).then(res => { selectById(this.dataOrigin).then(res => {
this.origins = res.data this.origins = res.data
console.log("origins", this.origins) // console.log("origins", this.origins)
}) })
}, },
chanChild() { chanChild() {
findTableIdByParentId(this.dataOrigin.sourceId).then(res => { findTableIdByParentId(this.dataOrigin.sourceId).then(res => {
this.tableOrigin = res.data this.tableOrigin = res.data
console.log("tableOrigin", this.tableOrigin) // console.log(this.tableOrigin)
}) })
}, },
// //
@ -556,8 +627,9 @@ export default {
addGenerate(this.form).then(res => { addGenerate(this.form).then(res => {
this.form.ruleKind = res.data.ruleKind this.form.ruleKind = res.data.ruleKind
this.form.ruleEngine = res.data.ruleEngine this.form.ruleEngine = res.data.ruleEngine
alert(this.form.ruleKind) alert(this.form.ruleEngine)
this.showCode = true this.showCode = true
this.findList()
debugger debugger
}) })
}, },