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-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['rule:rule:edit']"
>修改
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['rule:rule:remove']"
>删除
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['rule:rule:export']"
>导出
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="success"-->
<!-- plain-->
<!-- icon="el-icon-edit"-->
<!-- size="mini"-->
<!-- :disabled="single"-->
<!-- @click="handleUpdate"-->
<!-- v-hasPermi="['rule:rule:edit']"-->
<!-- >修改-->
<!-- </el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="danger"-->
<!-- plain-->
<!-- icon="el-icon-delete"-->
<!-- size="mini"-->
<!-- :disabled="multiple"-->
<!-- @click="handleDelete"-->
<!-- v-hasPermi="['rule:rule:remove']"-->
<!-- >删除-->
<!-- </el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="warning"-->
<!-- plain-->
<!-- icon="el-icon-download"-->
<!-- size="mini"-->
<!-- @click="handleExport"-->
<!-- v-hasPermi="['rule:rule:export']"-->
<!-- >导出-->
<!-- </el-button>-->
<!-- </el-col>-->
<!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
</el-row>
<!-- <el-table v-loading="loading" :data="ruleList" @selection-change="handleSelectionChange">-->
@ -126,61 +126,133 @@
<i class="el-icon-user"></i>
主键
</template>
{{ ruleAndVersion.id }}
{{ rule.id }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-user"></i>
规则名称
</template>
{{ ruleAndVersion.name }}
{{ rule.name }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-user"></i>
规则类型
</template>
{{ ruleAndVersion.ruleType }}
{{ rule.ruleType }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-user"></i>
是否激活
</template>
{{ ruleAndVersion.isActivate }}
{{ rule.isActivate }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-user"></i>
规则描述
</template>
{{ ruleAndVersion.ruleDesc }}
{{ rule.ruleDesc }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-user"></i>
规则代码
</template>
{{ ruleAndVersion.ruleCode }}
{{ rule.ruleCode }}
</el-descriptions-item>
</el-descriptions>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- <pagination-->
<!-- v-show="total>0"-->
<!-- :total="total"-->
<!-- :page.sync="queryParams.pageNum"-->
<!-- :limit.sync="queryParams.pageSize"-->
<!-- @pagination="getList"-->
<!-- />-->
<br><br>
<el-row :gutter="10">
<!-- <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">
<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-->
<!-- style="float: right; margin: 4px 5px 0;"-->
<!-- v-model="customer.status"-->
@ -191,26 +263,23 @@
<!-- @change="handleStatusChange(customer)"-->
<!-- >-->
<!-- </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
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-button style="float: right; padding: 5px ;margin: 0 5px" type="primary" icon="el-icon-edit"
@click="handleUpdate(ruleAndVersion.id)" circle></el-button>
<!-- <el-button style="float: right; padding: 5px ;margin: 0 5px" type="primary" icon="el-icon-edit"-->
<!-- @click="handleUpdate(ruleAndVersion.id)" circle></el-button>-->
</div>
</el-card>
<!-- </el-col>-->
</el-col>
</el-row>
<!-- 添加或修改规则对话框 -->
@ -239,11 +308,15 @@
<script>
import {listRule, getRule, delRule, addRule, updateRule} from "/src/api/rule/rule";
import {getEditionList} from "@/api/rule/ruleEdition";
export default {
name: "Rule",
data() {
return {
ruleAndEditionList: [],
//
ruleAndEdition: {},
//
loading: true,
//
@ -280,6 +353,7 @@ export default {
ruleDesc: "",
ruleCode: ""
},
rule: {},
//
form: {},
//
@ -292,27 +366,37 @@ export default {
},
created() {
this.ruleAndVersion.id = this.$route.query.id
this.getList();
this.findById();
this.findList()
},
// - 访DOM",
mounted() {
this.findById();
},
methods: {
//card
findList() {
getEditionList(this.ruleAndVersion.id).then(res => {
this.ruleAndEditionList = res.data
})
},
//ID
findById() {
getRule(this.ruleAndVersion.id).then(res => {
this.ruleAndVersion = res.data[0]
console.log(this.ruleAndVersion)
this.rule = res.data[0]
console.log(this.rule)
})
},
/** 查询规则列表 */
getList() {
this.loading = true;
listRule(this.queryParams).then(response => {
this.ruleList = response.data;
this.total = response.data;
this.loading = false;
});
},
// /** */
// getList() {
// this.loading = true;
// listRule(this.queryParams).then(response => {
// this.ruleList = response.data;
// this.total = response.data;
// this.loading = false;
// });
// },
//
cancel() {
this.open = false;
@ -337,7 +421,7 @@ export default {
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
// this.getList();
},
/** 重置按钮操作 */
resetQuery() {
@ -356,13 +440,13 @@ export default {
this.open = true;
this.title = "添加规则";
},
/** 规则维护按钮操作 */
handleMaintain(row) {
this.$router.push({
path: 'version',
query: {id: row.id}
})
},
// /** */
// handleMaintain(row) {
// this.$router.push({
// path: 'version',
// query: {id: row.id}
// })
// },
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
@ -381,13 +465,13 @@ export default {
updateRule(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
// this.getList();
});
} else {
addRule(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
// this.getList();
});
}
}
@ -399,7 +483,7 @@ export default {
this.$modal.confirm('是否确认删除规则编号为"' + ids + '"的数据项?').then(function () {
return delRule(ids);
}).then(() => {
this.getList();
// this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {
});