master
chentaisen 2024-08-26 14:25:36 +08:00
parent 594a9c4d32
commit 9cc3a87592
2 changed files with 249 additions and 118 deletions

View File

@ -0,0 +1,47 @@
import request from '@/utils/request'
// // 查询规则列表
// export function listRule(query) {
// return request({
// url: '/rule/rule/list',
// method: 'post',
// params: query
// })
// }
// 查询规则详细
export function getEditionList(id) {
return request({
url: '/rule/ruleEdition/findById/' + id,
method: 'get'
})
}
//
// // 新增规则
// export function addRule(data) {
// return request({
// url: '/rule/rule/insert',
// method: 'post',
// data: data
// })
// }
//
// // 修改规则
// export function updateRule(data) {
// return request({
// url: '/rule/rule/update',
// method: 'put',
// data: data
// })
// }
//
//
// // 删除规则
// export function delRule(id) {
// return request({
// url: '/rule/rule/delete/' + id,
// method: 'delete'
// })
// }

View File

@ -43,42 +43,42 @@
>新增 >新增
</el-button> </el-button>
</el-col> </el-col>
<el-col :span="1.5"> <!-- <el-col :span="1.5">-->
<el-button <!-- <el-button-->
type="success" <!-- type="success"-->
plain <!-- plain-->
icon="el-icon-edit" <!-- icon="el-icon-edit"-->
size="mini" <!-- size="mini"-->
:disabled="single" <!-- :disabled="single"-->
@click="handleUpdate" <!-- @click="handleUpdate"-->
v-hasPermi="['rule:rule:edit']" <!-- v-hasPermi="['rule:rule:edit']"-->
>修改 <!-- >修改-->
</el-button> <!-- </el-button>-->
</el-col> <!-- </el-col>-->
<el-col :span="1.5"> <!-- <el-col :span="1.5">-->
<el-button <!-- <el-button-->
type="danger" <!-- type="danger"-->
plain <!-- plain-->
icon="el-icon-delete" <!-- icon="el-icon-delete"-->
size="mini" <!-- size="mini"-->
:disabled="multiple" <!-- :disabled="multiple"-->
@click="handleDelete" <!-- @click="handleDelete"-->
v-hasPermi="['rule:rule:remove']" <!-- v-hasPermi="['rule:rule:remove']"-->
>删除 <!-- >删除-->
</el-button> <!-- </el-button>-->
</el-col> <!-- </el-col>-->
<el-col :span="1.5"> <!-- <el-col :span="1.5">-->
<el-button <!-- <el-button-->
type="warning" <!-- type="warning"-->
plain <!-- plain-->
icon="el-icon-download" <!-- icon="el-icon-download"-->
size="mini" <!-- size="mini"-->
@click="handleExport" <!-- @click="handleExport"-->
v-hasPermi="['rule:rule:export']" <!-- v-hasPermi="['rule:rule:export']"-->
>导出 <!-- >导出-->
</el-button> <!-- </el-button>-->
</el-col> <!-- </el-col>-->
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
</el-row> </el-row>
<!-- <el-table v-loading="loading" :data="ruleList" @selection-change="handleSelectionChange">--> <!-- <el-table v-loading="loading" :data="ruleList" @selection-change="handleSelectionChange">-->
@ -126,61 +126,133 @@
<i class="el-icon-user"></i> <i class="el-icon-user"></i>
主键 主键
</template> </template>
{{ ruleAndVersion.id }} {{ rule.id }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item> <el-descriptions-item>
<template slot="label"> <template slot="label">
<i class="el-icon-user"></i> <i class="el-icon-user"></i>
规则名称 规则名称
</template> </template>
{{ ruleAndVersion.name }} {{ rule.name }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item> <el-descriptions-item>
<template slot="label"> <template slot="label">
<i class="el-icon-user"></i> <i class="el-icon-user"></i>
规则类型 规则类型
</template> </template>
{{ ruleAndVersion.ruleType }} {{ rule.ruleType }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item> <el-descriptions-item>
<template slot="label"> <template slot="label">
<i class="el-icon-user"></i> <i class="el-icon-user"></i>
是否激活 是否激活
</template> </template>
{{ ruleAndVersion.isActivate }} {{ rule.isActivate }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item> <el-descriptions-item>
<template slot="label"> <template slot="label">
<i class="el-icon-user"></i> <i class="el-icon-user"></i>
规则描述 规则描述
</template> </template>
{{ ruleAndVersion.ruleDesc }} {{ rule.ruleDesc }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item> <el-descriptions-item>
<template slot="label"> <template slot="label">
<i class="el-icon-user"></i> <i class="el-icon-user"></i>
规则代码 规则代码
</template> </template>
{{ ruleAndVersion.ruleCode }} {{ rule.ruleCode }}
</el-descriptions-item> </el-descriptions-item>
</el-descriptions> </el-descriptions>
<pagination <!-- <pagination-->
v-show="total>0" <!-- v-show="total>0"-->
:total="total" <!-- :total="total"-->
:page.sync="queryParams.pageNum" <!-- :page.sync="queryParams.pageNum"-->
:limit.sync="queryParams.pageSize" <!-- :limit.sync="queryParams.pageSize"-->
@pagination="getList" <!-- @pagination="getList"-->
/> <!-- />-->
<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>-->
<!-- <el-col :span="8" v-for="customer in customerList" v-if="customerList.length !== 0">--> <el-col :span="12" v-for="customer in ruleAndEditionList">
<el-card class="box-card"> <el-card class="box-card">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span style="font-size: 18px;font-weight: 900">{{ ruleAndVersion.appName }}</span>
<div>
<el-descriptions class="margin-top" title="带边框列表" :column="3" :size="size" border>
<template slot="extra">
<el-dropdown>
<span class="el-dropdown-link">
下拉菜单<i class="el-icon-arrow-down el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item>
<el-button type="primary" size="small">激活按钮</el-button>
</el-dropdown-item>
<el-dropdown-item>激活按钮</el-dropdown-item>
<el-dropdown-item disabled>双皮奶</el-dropdown-item>
<el-dropdown-item divided>蚵仔煎</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<!-- </el-button>-->
</template>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-user"></i>
版本主键
</template>
{{ customer.id }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-user"></i>
版本类
</template>
{{ customer.ruleKind }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-user"></i>
版本名称
</template>
{{ customer.name }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-user"></i>
编码
</template>
{{ customer.ruleCoding }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-user"></i>
是否激活
</template>
{{ customer.ruleActivate }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-user"></i>
状态
</template>
{{ customer.status }}
</el-descriptions-item>
<el-descriptions-item>
<div>
<editor v-model="customer.ruleContent" :min-height="192"/>
</div>
</el-descriptions-item>
</el-descriptions>
</div>
<!-- <el-switch--> <!-- <el-switch-->
<!-- style="float: right; margin: 4px 5px 0;"--> <!-- style="float: right; margin: 4px 5px 0;"-->
<!-- v-model="customer.status"--> <!-- v-model="customer.status"-->
@ -191,26 +263,23 @@
<!-- @change="handleStatusChange(customer)"--> <!-- @change="handleStatusChange(customer)"-->
<!-- >--> <!-- >-->
<!-- </el-switch>--> <!-- </el-switch>-->
<!-- <el-popconfirm-->
<!-- confirm-button-text='好的'-->
<!-- cancel-button-text='不用了'-->
<!-- icon="el-icon-info"-->
<!-- icon-color="red"-->
<!-- title="这是一段内容确定删除吗?"-->
<!-- @confirm="handleDelete(ruleAndVersion.id)"-->
<!-- >-->
<!-- <el-button style="float: right; padding: 5px ;margin: 0 5px" slot="reference" type="danger"-->
<!-- icon="el-icon-delete" circle></el-button>-->
<!-- </el-popconfirm>-->
<el-popconfirm <!-- <el-button style="float: right; padding: 5px ;margin: 0 5px" type="primary" icon="el-icon-edit"-->
confirm-button-text='好的' <!-- @click="handleUpdate(ruleAndVersion.id)" circle></el-button>-->
cancel-button-text='不用了'
icon="el-icon-info"
icon-color="red"
title="这是一段内容确定删除吗?"
@confirm="handleDelete(ruleAndVersion.id)"
>
<el-button style="float: right; padding: 5px ;margin: 0 5px" slot="reference" type="danger"
icon="el-icon-delete" circle></el-button>
</el-popconfirm>
<el-button style="float: right; padding: 5px ;margin: 0 5px" type="primary" icon="el-icon-edit"
@click="handleUpdate(ruleAndVersion.id)" circle></el-button>
</div> </div>
</el-card> </el-card>
<!-- </el-col>--> </el-col>
</el-row> </el-row>
<!-- 添加或修改规则对话框 --> <!-- 添加或修改规则对话框 -->
@ -239,11 +308,15 @@
<script> <script>
import {listRule, getRule, delRule, addRule, updateRule} from "/src/api/rule/rule"; import {listRule, getRule, delRule, addRule, updateRule} from "/src/api/rule/rule";
import {getEditionList} from "@/api/rule/ruleEdition";
export default { export default {
name: "Rule", name: "Rule",
data() { data() {
return { return {
ruleAndEditionList: [],
//
ruleAndEdition: {},
// //
loading: true, loading: true,
// //
@ -280,6 +353,7 @@ export default {
ruleDesc: "", ruleDesc: "",
ruleCode: "" ruleCode: ""
}, },
rule: {},
// //
form: {}, form: {},
// //
@ -292,27 +366,37 @@ export default {
}, },
created() { created() {
this.ruleAndVersion.id = this.$route.query.id this.ruleAndVersion.id = this.$route.query.id
this.getList(); this.findById();
this.findList()
},
// - 访DOM",
mounted() {
this.findById(); this.findById();
}, },
methods: { methods: {
//card
findList() {
getEditionList(this.ruleAndVersion.id).then(res => {
this.ruleAndEditionList = res.data
})
},
//ID //ID
findById() { findById() {
getRule(this.ruleAndVersion.id).then(res => { getRule(this.ruleAndVersion.id).then(res => {
this.ruleAndVersion = res.data[0] this.rule = res.data[0]
console.log(this.ruleAndVersion) console.log(this.rule)
}) })
}, },
/** 查询规则列表 */ // /** */
getList() { // getList() {
this.loading = true; // this.loading = true;
listRule(this.queryParams).then(response => { // listRule(this.queryParams).then(response => {
this.ruleList = response.data; // this.ruleList = response.data;
this.total = response.data; // this.total = response.data;
this.loading = false; // this.loading = false;
}); // });
}, // },
// //
cancel() { cancel() {
this.open = false; this.open = false;
@ -337,7 +421,7 @@ export default {
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNum = 1; this.queryParams.pageNum = 1;
this.getList(); // this.getList();
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
@ -356,13 +440,13 @@ export default {
this.open = true; this.open = true;
this.title = "添加规则"; this.title = "添加规则";
}, },
/** 规则维护按钮操作 */ // /** */
handleMaintain(row) { // handleMaintain(row) {
this.$router.push({ // this.$router.push({
path: 'version', // path: 'version',
query: {id: row.id} // query: {id: row.id}
}) // })
}, // },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
@ -381,13 +465,13 @@ export default {
updateRule(this.form).then(response => { updateRule(this.form).then(response => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
this.open = false; this.open = false;
this.getList(); // this.getList();
}); });
} else { } else {
addRule(this.form).then(response => { addRule(this.form).then(response => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.open = false; this.open = false;
this.getList(); // this.getList();
}); });
} }
} }
@ -399,7 +483,7 @@ export default {
this.$modal.confirm('是否确认删除规则编号为"' + ids + '"的数据项?').then(function () { this.$modal.confirm('是否确认删除规则编号为"' + ids + '"的数据项?').then(function () {
return delRule(ids); return delRule(ids);
}).then(() => { }).then(() => {
this.getList(); // this.getList();
this.$modal.msgSuccess("删除成功"); this.$modal.msgSuccess("删除成功");
}).catch(() => { }).catch(() => {
}); });