Merge remote-tracking branch 'origin/master'

master
面包骑士 2024-09-10 00:00:34 +08:00
commit 10f8364946
3 changed files with 150 additions and 38 deletions

View File

@ -79,6 +79,14 @@ export function findTableIdByParentId(id) {
method: 'post',
})
}
//表
export function findTableValueByTableName(basicId,tableName) {
return request({
url: `/source/value/findTableValueByTableName?basicId=`+basicId+'&&tableName='+tableName,
method: 'post',
})
}
//保存代码
export function updateRuleEngine(data) {
@ -88,3 +96,11 @@ export function updateRuleEngine(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"-->
<!-- />-->
<br><br>
<el-row :gutter="10">
<!-- <el-empty description="暂无支付客户" v-if="customerList.length === 0"></el-empty>-->
@ -260,9 +261,8 @@
<el-input v-model="form.ruleId" disabled placeholder="请输入版本"/>
</el-form-item>
<el-button type="primary" @click="submitForm()"></el-button>
<!-- 前台web编写代码-->
<el-form-item label="引擎编码" prop="ruleCoding">
<el-form-item label="引擎编码" prop="ruleEngine">
<codemirror ref="ruleEngine" :value="form.ruleEngine" :options="cmOptions" class="code">
</codemirror>
</el-form-item>
@ -312,13 +312,15 @@
<el-input v-model="form.ruleId" disabled placeholder="请输入版本"/>
</el-form-item>
<!-- 前台web编写代码-->
<el-form-item label="引擎编码" prop="ruleCoding">
<codemirror ref="ruleEngine" :value="form.ruleEngine" :options="cmOptions" class="code">
<el-form-item label="引擎编码" prop="ruleEngine">
<codemirror ref="ruleEngine" :value="form.ruleEngine" v-model="form.ruleEngine" :options="cmOptions"
class="code">
</codemirror>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="preserve()"></el-button>
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
@ -342,7 +344,7 @@
<span>选择资产结构</span>
</div>
<span>
<el-select v-model="dataOrigin.tableId" placeholder="请选择数据接入" @blur="ch()">
<el-select v-model="dataOrigin.tableId" placeholder="请选择数据结构" @change="ch()">
<el-option v-for="i in tableOrigin" :label="i.tableName" :value="i.id" :key="i.id"></el-option>
</el-select>
</span>
@ -353,31 +355,104 @@
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>选择资产集</span>
</div>
<span>
<template>
<el-table
:data="tableData"
style="width: 100%">
<!-- <el-table-->
<!-- :data="tableOrigin"-->
<!-- style="width: 100%">-->
<!-- <el-table-column-->
<!-- label="主键"-->
<!-- width="180">-->
<!-- <template slot-scope="scope">-->
<!-- <span style="margin-left: 10px">{{ scope.row.id }}</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>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="操作">-->
<!-- <template slot-scope="scope">-->
<!-- <el-button-->
<!-- size="mini"-->
<!-- @click="handleEditSelect(scope.row)">选择-->
<!-- </el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- </el-table>-->
{{tableDatas}}
<el-table>
<el-table-column
label="日期"
v-for="tableData in tableDatas"
:key="key"
:label="tableData.label"
:prop="tableData.value"
width="180">
</el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<i class="el-icon-time"></i>
<span style="margin-left: 10px">{{ scope.row.date }}</span>
<el-button
size="mini"
@click="handleEditSelect(scope.row)">选择
</el-button>
</template>
</el-table-column>
</el-table>
</template>
</div>
<span>
<template slot-scope="scope">
<el-button
type="primary"
@click="measurements(scope.row)">测试
</el-button>
</template>
</span>
</el-card>
</el-col>
</span>
</el-drawer>
</el-drawer>
</div>
</template>
@ -390,8 +465,8 @@ import {
disable,
enable, findTableIdByParentId,
getEditionList,
getFindByEditionId, selectById,
updateRule, updateRuleEngine
getFindByEditionId, selectById, measurement,
updateRule, updateRuleEngine, findTableValueByTableName
} from "@/api/rule/ruleEdition";
@ -419,7 +494,8 @@ export default {
theme: "ambiance",
lint: true, //
},
tableData: [],
tableDatas: [],
ruleAndEditionList: [],
//
ruleAndEdition: {},
@ -486,8 +562,6 @@ export default {
{required: true, message: "是否激活;是否激活不能为空", trigger: "blur"}
],
}
};
},
created() {
@ -495,30 +569,52 @@ export default {
this.findById();
this.findList()
this.getDataOrigin()
this.findTableValueByTableName();
},
// - 访DOM",
mounted() {
this.findById();
},
methods: {
//
preserve() {
updateRuleEngine(this.form).then(res => {
this.$modal.msgSuccess("修改成功");
//
handleEditSelect(data) {
findTableValueByTableName(data.basicId, data.tableName).then(res => {
console.log(res.data)
this.tableDatas = res.data
alert(res.data)
})
},
//
measurements(data) {
this.tableDatas=data
measurement(data).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() {
selectById(this.dataOrigin).then(res => {
this.origins = res.data
console.log("origins", this.origins)
// console.log("origins", this.origins)
})
},
chanChild() {
findTableIdByParentId(this.dataOrigin.sourceId).then(res => {
this.tableOrigin = res.data
console.log("tableOrigin", this.tableOrigin)
// console.log(this.tableOrigin)
})
},
//
@ -556,8 +652,9 @@ export default {
addGenerate(this.form).then(res => {
this.form.ruleKind = res.data.ruleKind
this.form.ruleEngine = res.data.ruleEngine
alert(this.form.ruleKind)
alert(this.form.ruleEngine)
this.showCode = true
this.findList()
debugger
})
},

View File

@ -178,14 +178,12 @@
<el-form-item label="最大等待次数" prop="maxWaitSize">
<el-input v-model="form.maxWaitSize" placeholder="请输入最大等待次数" />
</el-form-item>
<el-form-item label="驱动" prop="driverName">
<el-input v-model="form.driverName" placeholder="请输入驱动名称" />
</el-form-item>
<el-form-item label="是否初始化" prop="isInit">
<!-- <el-input v-model="form.isInit" placeholder="请输入是否初始化" />-->
<el-radio v-model="form.isInit" label="Y"></el-radio>
<el-radio v-model="form.isInit" label="N"></el-radio>
<!-- <el-radio-group v-model="form.isInit">-->
<!-- <el-radio label="Y"></el-radio>-->
<!-- <el-radio label="N"></el-radio>-->
<!-- </el-radio-group>-->
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入是否初始化" />
@ -285,6 +283,7 @@ export default {
maxNum: null,
maxWaitTime: null,
maxWaitSize: null,
driverName: null,
createBy: null,
createTime: null,
updateBy: null,