第一次
parent
5d74a46ba5
commit
3a88d504c0
|
@ -79,6 +79,13 @@ 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 +95,11 @@ export function updateRuleEngine(data) {
|
|||
data: data
|
||||
})
|
||||
}
|
||||
//规则测试
|
||||
export function measurement(data) {
|
||||
return request({
|
||||
url: '/rule/ruleEdition/measurement',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
|
|
@ -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="请选择数据结构" @blur="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,81 @@
|
|||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>选择资产集</span>
|
||||
</div>
|
||||
<span>
|
||||
<template>
|
||||
<el-table
|
||||
:data="tableData"
|
||||
:data="tableOrigin"
|
||||
style="width: 100%">
|
||||
<el-table-column
|
||||
label="日期"
|
||||
label="主键"
|
||||
width="180">
|
||||
<template slot-scope="scope">
|
||||
<i class="el-icon-time"></i>
|
||||
<span style="margin-left: 10px">{{ scope.row.date }}</span>
|
||||
<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()">选择
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</template>
|
||||
</div>
|
||||
<span>
|
||||
|
||||
<el-button type="primary" @click="measurements()">测 试</el-button>
|
||||
</span>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</span>
|
||||
</el-drawer>
|
||||
|
||||
</el-drawer>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
@ -390,8 +442,8 @@ import {
|
|||
disable,
|
||||
enable, findTableIdByParentId,
|
||||
getEditionList,
|
||||
getFindByEditionId, selectById,
|
||||
updateRule, updateRuleEngine
|
||||
getFindByEditionId, selectById, measurement,
|
||||
updateRule, updateRuleEngine, findTableValueByTableName
|
||||
} from "@/api/rule/ruleEdition";
|
||||
|
||||
|
||||
|
@ -419,7 +471,8 @@ export default {
|
|||
theme: "ambiance",
|
||||
lint: true, // 开启语法检查
|
||||
},
|
||||
|
||||
tableData: [],
|
||||
tableDatas: [],
|
||||
ruleAndEditionList: [],
|
||||
//版本
|
||||
ruleAndEdition: {},
|
||||
|
@ -486,8 +539,6 @@ export default {
|
|||
{required: true, message: "是否激活;是否激活不能为空", trigger: "blur"}
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
},
|
||||
created() {
|
||||
|
@ -501,24 +552,44 @@ export default {
|
|||
this.findById();
|
||||
},
|
||||
methods: {
|
||||
//保存代码
|
||||
preserve() {
|
||||
updateRuleEngine(this.form).then(res => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
//表数据
|
||||
handleEditSelect() {
|
||||
findTableValueByTableName(this.tableOrigin.basicId, this.tableOrigin.tableName).then(res => {
|
||||
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() {
|
||||
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 +627,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
|
||||
})
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue