Merge remote-tracking branch 'origin/master'
commit
1ed2f2a6c6
|
@ -65,13 +65,26 @@ export function enable(id) {
|
||||||
url: `/rule/ruleEdition/enable/${id}`,
|
url: `/rule/ruleEdition/enable/${id}`,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
//数据接入
|
||||||
//通过id禁用客户
|
export function selectById() {
|
||||||
export function disable(id) {
|
|
||||||
return request({
|
return request({
|
||||||
url: `/rule/ruleEdition/disable/${id}`,
|
url: `/source/tableInfo/selectById`,
|
||||||
|
method: 'post',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//表
|
||||||
|
export function findTableIdByParentId(id) {
|
||||||
|
return request({
|
||||||
|
url: `/source/tableInfo/findTableIdByParentId/${id}`,
|
||||||
|
method: 'post',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//保存代码
|
||||||
|
export function updateRuleEngine(data) {
|
||||||
|
return request({
|
||||||
|
url: '/rule/ruleEdition/updateRuleEngine',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
|
@ -45,8 +45,22 @@
|
||||||
>新增
|
>新增
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
<el-dropdown-item>开启引擎</el-dropdown-item>
|
<el-dropdown-item>开启引擎
|
||||||
<el-dropdown-item>关闭引擎</el-dropdown-item>
|
<el-dropdown-item>
|
||||||
|
<el-switch
|
||||||
|
style="float: right; margin: 4px 5px 0;"
|
||||||
|
v-model="rule.status"
|
||||||
|
active-color="#13ce66"
|
||||||
|
inactive-color="#ff4949"
|
||||||
|
active-value="Y"
|
||||||
|
inactive-value="N"
|
||||||
|
@change="handleStatus(rule)">
|
||||||
|
</el-switch>
|
||||||
|
</el-dropdown-item>
|
||||||
|
</el-dropdown-item>
|
||||||
|
<el-dropdown-item>关闭引擎
|
||||||
|
|
||||||
|
</el-dropdown-item>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
</template>
|
</template>
|
||||||
|
@ -245,13 +259,16 @@
|
||||||
<el-form-item label="版本" prop="ruleId">
|
<el-form-item label="版本" prop="ruleId">
|
||||||
<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="ruleCoding">
|
||||||
<codemirror ref="ruleEngine" :value="form.ruleEngine" :options="cmOptions" class="code" v-show="showCode">
|
<codemirror ref="ruleEngine" :value="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="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>
|
||||||
|
@ -264,7 +281,7 @@
|
||||||
:visible.sync="drawer"
|
:visible.sync="drawer"
|
||||||
:with-header="false" size="70%">
|
:with-header="false" size="70%">
|
||||||
<span>
|
<span>
|
||||||
<el-button type="primary" @click="generate" style="margin-bottom:70px;">生成版本类</el-button>
|
<!-- <el-button type="primary" @click="generate" style="margin-bottom:70px;">生成版本类</el-button>-->
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
<el-form-item label="版本类" prop="ruleKind">
|
<el-form-item label="版本类" prop="ruleKind">
|
||||||
<el-input v-model="form.ruleKind" disabled/>
|
<el-input v-model="form.ruleKind" disabled/>
|
||||||
|
@ -296,9 +313,10 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- 前台web编写代码-->
|
<!-- 前台web编写代码-->
|
||||||
<el-form-item label="引擎编码" prop="ruleCoding">
|
<el-form-item label="引擎编码" prop="ruleCoding">
|
||||||
<codemirror ref="ruleEngine" :value="form.ruleEngine" :options="cmOptions" class="code" v-show="showCode">
|
<codemirror ref="ruleEngine" :value="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="submitForm">确 定</el-button>
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
@ -307,7 +325,56 @@
|
||||||
</span>
|
</span>
|
||||||
<br>
|
<br>
|
||||||
<span>
|
<span>
|
||||||
11111
|
<el-row>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-card class="box-card">
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<span>选择数据接入</span>
|
||||||
|
</div>
|
||||||
|
<el-select v-model="dataOrigin.sourceId" placeholder="请选择数据接入" @change="chan()">
|
||||||
|
<el-option v-for="i in origins" :label="i.tableName" :value="i.id" :key="i.id"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-card>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12" v-show="selects">
|
||||||
|
<el-card class="box-card">
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<span>选择资产结构</span>
|
||||||
|
</div>
|
||||||
|
<span>
|
||||||
|
<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>
|
||||||
|
</el-card>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-col v-show="selectss">
|
||||||
|
<el-card class="box-card">
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<span>选择资产集</span>
|
||||||
|
</div>
|
||||||
|
<span>
|
||||||
|
<template>
|
||||||
|
<el-table
|
||||||
|
:data="tableData"
|
||||||
|
style="width: 100%">
|
||||||
|
<el-table-column
|
||||||
|
label="日期"
|
||||||
|
width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<i class="el-icon-time"></i>
|
||||||
|
<span style="margin-left: 10px">{{ scope.row.date }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
|
||||||
|
</el-table>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
</span>
|
||||||
|
</el-card>
|
||||||
|
</el-col>
|
||||||
</span>
|
</span>
|
||||||
</el-drawer>
|
</el-drawer>
|
||||||
|
|
||||||
|
@ -321,22 +388,29 @@ import {
|
||||||
addGenerate,
|
addGenerate,
|
||||||
addRule,
|
addRule,
|
||||||
disable,
|
disable,
|
||||||
enable,
|
enable, findTableIdByParentId,
|
||||||
getEditionList,
|
getEditionList,
|
||||||
getFindByEditionId,
|
getFindByEditionId, selectById,
|
||||||
updateRule
|
updateRule, updateRuleEngine
|
||||||
} from "@/api/rule/ruleEdition";
|
} from "@/api/rule/ruleEdition";
|
||||||
|
|
||||||
|
|
||||||
import {codemirror} from 'vue-codemirror'
|
import {codemirror} from 'vue-codemirror'
|
||||||
import "codemirror/theme/ambiance.css"; // 这里引入的是主题样式,根据设置的theme的主题引入,一定要引入!!
|
import "codemirror/theme/ambiance.css";
|
||||||
|
import select from "view-design/src/components/select"; // 这里引入的是主题样式,根据设置的theme的主题引入,一定要引入!!
|
||||||
require("codemirror/mode/javascript/javascript"); // 这里引入的模式的js,根据设置的mode引入,一定要引入!
|
require("codemirror/mode/javascript/javascript"); // 这里引入的模式的js,根据设置的mode引入,一定要引入!
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Rule",
|
name: "Rule",
|
||||||
|
computed: {
|
||||||
|
select() {
|
||||||
|
return select
|
||||||
|
}
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
selects: false,
|
||||||
|
selectss: false,
|
||||||
drawer: false,
|
drawer: false,
|
||||||
cmOptions: {
|
cmOptions: {
|
||||||
lineNumbers: true, // 显示行号
|
lineNumbers: true, // 显示行号
|
||||||
|
@ -346,7 +420,6 @@ export default {
|
||||||
lint: true, // 开启语法检查
|
lint: true, // 开启语法检查
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
ruleAndEditionList: [],
|
ruleAndEditionList: [],
|
||||||
//版本
|
//版本
|
||||||
ruleAndEdition: {},
|
ruleAndEdition: {},
|
||||||
|
@ -362,6 +435,7 @@ export default {
|
||||||
showSearch: true,
|
showSearch: true,
|
||||||
// 总条数
|
// 总条数
|
||||||
total: 0,
|
total: 0,
|
||||||
|
childId: {},
|
||||||
// 规则表格数据
|
// 规则表格数据
|
||||||
ruleList: [],
|
ruleList: [],
|
||||||
// 弹出层标题
|
// 弹出层标题
|
||||||
|
@ -400,7 +474,11 @@ export default {
|
||||||
ruleId: '',
|
ruleId: '',
|
||||||
ruleEngine: '',
|
ruleEngine: '',
|
||||||
},
|
},
|
||||||
|
//数据源
|
||||||
|
dataOrigin: {},
|
||||||
|
origins: [],
|
||||||
|
|
||||||
|
tableOrigin: [],
|
||||||
showCode: false,
|
showCode: false,
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
|
@ -409,18 +487,62 @@ export default {
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.ruleAndVersion.id = this.$route.query.id
|
this.ruleAndVersion.id = this.$route.query.id
|
||||||
this.findById();
|
this.findById();
|
||||||
this.findList()
|
this.findList()
|
||||||
|
this.getDataOrigin()
|
||||||
},
|
},
|
||||||
//生命周期 - 挂载完成(可以访问DOM元素)",
|
//生命周期 - 挂载完成(可以访问DOM元素)",
|
||||||
mounted() {
|
mounted() {
|
||||||
this.findById();
|
this.findById();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
//保存代码
|
||||||
|
preserve() {
|
||||||
|
updateRuleEngine(this.form).then(res => {
|
||||||
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//数据接入源
|
||||||
|
getDataOrigin() {
|
||||||
|
selectById(this.dataOrigin).then(res => {
|
||||||
|
this.origins = res.data
|
||||||
|
console.log("origins", this.origins)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
chanChild() {
|
||||||
|
findTableIdByParentId(this.dataOrigin.sourceId).then(res => {
|
||||||
|
this.tableOrigin = res.data
|
||||||
|
console.log("tableOrigin", this.tableOrigin)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//禁用
|
||||||
|
handleStatus() {
|
||||||
|
if (row.status === "Y") {
|
||||||
|
enable(row.id).then((res) => {
|
||||||
|
this.$modal.msgSuccess("启用成功")
|
||||||
|
this.findList()
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
disable(row.id).then((res) => {
|
||||||
|
this.$modal.msgSuccess("禁用成功")
|
||||||
|
this.findList()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//数据源
|
||||||
|
chan() {
|
||||||
|
this.selects = true
|
||||||
|
this.chanChild()
|
||||||
|
},
|
||||||
|
ch() {
|
||||||
|
this.selectss = true
|
||||||
|
},
|
||||||
//测试规则
|
//测试规则
|
||||||
drawers(id) {
|
drawers(id) {
|
||||||
getFindByEditionId(id).then(res => {
|
getFindByEditionId(id).then(res => {
|
||||||
|
|
Loading…
Reference in New Issue