Merge remote-tracking branch 'origin/master'
commit
6a6cd790cf
|
@ -0,0 +1,42 @@
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
//查询规则引擎列表
|
||||||
|
export function list(){
|
||||||
|
return request({
|
||||||
|
url: "/engine/type/list",
|
||||||
|
method: "post"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function insert(data){
|
||||||
|
return request({
|
||||||
|
url: "/engine/type/add",
|
||||||
|
method: "post",
|
||||||
|
data:data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function update(data){
|
||||||
|
return request({
|
||||||
|
url: "/engine/type/update",
|
||||||
|
method: "post",
|
||||||
|
data:data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function del(id){
|
||||||
|
return request({
|
||||||
|
url: "/engine/type/delete/" + id,
|
||||||
|
method: "post",
|
||||||
|
data:id
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function exports(data){
|
||||||
|
return request({
|
||||||
|
url: "/engine/type/export",
|
||||||
|
method: "post",
|
||||||
|
data:data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
|
@ -1,16 +1,18 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<el-row>
|
<el-row :gutter="50">
|
||||||
<el-col :span="8" v-for="(o, index) in 2" :key="o" :offset="index > 0 ? 2 : 0">
|
<el-col :span="7" v-for="connector in connectorList" v-if="connectorList.length !== 0">
|
||||||
<el-card :body-style="{ padding: '0px' }">
|
<el-card class="box-card" style="margin-top: 15px;width: 500px; height: 700px;" shadow="hover">
|
||||||
<img src="https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png" class="image">
|
<div slot="header" class="clearfix">
|
||||||
<div style="padding: 14px;">
|
<h1 style="font-weight: bold">{{connector.connectorName}}</h1>
|
||||||
<span>好吃的汉堡</span>
|
<el-button type="primary" style="float: right; padding: 10px 10px" @click="buyPhone(index)">购买</el-button>
|
||||||
<div class="bottom clearfix">
|
|
||||||
<time class="time">{{ currentDate }}</time>
|
|
||||||
<el-button type="text" class="button">操作按钮</el-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
<span style="font-weight: bold;font-size: 20px">产品图片:</span><br>
|
||||||
|
<el-image style="width: 300px; height: 300px" :src="connector.connectorPicture" :fit="fit"></el-image><br>
|
||||||
|
<span style="font-weight: bold;font-size: 20px">产品介绍:</span>
|
||||||
|
{{connector.connectorDescribe}}<br>
|
||||||
|
<span style="font-weight: bold;font-size: 20px">价格:</span>
|
||||||
|
{{connector.connectorPrice}}
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
@ -21,6 +23,7 @@
|
||||||
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等),
|
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等),
|
||||||
//例如:import 《组件名称》 from '《组件路径》,
|
//例如:import 《组件名称》 from '《组件路径》,
|
||||||
import {findConnectorList} from "@/api/port/port";
|
import {findConnectorList} from "@/api/port/port";
|
||||||
|
import index from "vuex";
|
||||||
export default {
|
export default {
|
||||||
//import引入的组件需要注入到对象中才能使用"
|
//import引入的组件需要注入到对象中才能使用"
|
||||||
components: {},
|
components: {},
|
||||||
|
@ -29,24 +32,33 @@ export default {
|
||||||
//这里存放数据"
|
//这里存放数据"
|
||||||
|
|
||||||
return {
|
return {
|
||||||
ConnectorList:[],
|
connectorList:[],
|
||||||
form:{},
|
form:{},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
//计算属性 类似于data概念",
|
//计算属性 类似于data概念",
|
||||||
computed: {},
|
computed: {
|
||||||
|
index() {
|
||||||
|
return index
|
||||||
|
},
|
||||||
|
node() {
|
||||||
|
return node
|
||||||
|
}
|
||||||
|
},
|
||||||
//监控data中的数据变化",
|
//监控data中的数据变化",
|
||||||
watch: {},
|
watch: {},
|
||||||
//方法集合",
|
//方法集合",
|
||||||
methods: {
|
methods: {
|
||||||
findConnectorList(){
|
findConnectorList(){
|
||||||
findConnectorList(this.form).then((res)=>{
|
findConnectorList(this.form).then((res)=>{
|
||||||
this.ConnectorList=res.data;
|
this.connectorList=res.data;
|
||||||
|
console.log(res.data);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
//生命周期 - 创建完成(可以访问当前this实例)",
|
//生命周期 - 创建完成(可以访问当前this实例)",
|
||||||
created() {
|
created() {
|
||||||
|
this.findConnectorList();
|
||||||
},
|
},
|
||||||
//生命周期 - 挂载完成(可以访问DOM元素)",
|
//生命周期 - 挂载完成(可以访问DOM元素)",
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|
|
@ -0,0 +1,120 @@
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 添加或修改规则引擎对话框 -->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<el-button type="text" @click="dialogFormVisible = true">添加规则类型</el-button>
|
||||||
|
|
||||||
|
<el-dialog title="添加规则" :visible.sync="dialogFormVisible">
|
||||||
|
|
||||||
|
<el-form :model="type">
|
||||||
|
|
||||||
|
<el-form-item label="规则名称" :label-width="formLabelWidth">
|
||||||
|
|
||||||
|
<el-input v-model="form.name" autocomplete="off"></el-input>
|
||||||
|
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="dialogFormVisible = false">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<el-table :data="arr" 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="类型名称" width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span style="margin-left: 10px">{{ scope.row.name }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="操作">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="danger"
|
||||||
|
@click="handleDelete(scope.row.id)">删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import {del, insert, list} from "@/api/type/type";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
//import引入的组件需要注入到对象中才能使用"
|
||||||
|
components: {},
|
||||||
|
props: {},
|
||||||
|
data() {
|
||||||
|
//这里存放数据"
|
||||||
|
return {
|
||||||
|
arr:[],
|
||||||
|
type:{},
|
||||||
|
rules: {
|
||||||
|
name: [{required: true, message: '请输入规则名称', trigger: 'blur'}]
|
||||||
|
},
|
||||||
|
dialogFormVisible:false,
|
||||||
|
form: {
|
||||||
|
name: '',
|
||||||
|
region: '',
|
||||||
|
date1: '',
|
||||||
|
date2: '',
|
||||||
|
delivery: false,
|
||||||
|
type: [],
|
||||||
|
resource: '',
|
||||||
|
desc: ''
|
||||||
|
},
|
||||||
|
formLabelWidth: '120px'
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
List(){
|
||||||
|
list().then(res =>{
|
||||||
|
this.arr = res;
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleDelete(id){
|
||||||
|
if (confirm("你确定删除吗?")){
|
||||||
|
del(id).then(res =>{
|
||||||
|
this.$message.success(res.msg || "删除成功")
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
submitForm(){
|
||||||
|
this.type = {}
|
||||||
|
this.dialogFormVisible=true
|
||||||
|
insert(this.type).then(res =>{
|
||||||
|
this.$message.success(res.msg || "添加成功")
|
||||||
|
})
|
||||||
|
this.dialogFormVisible = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//生命周期 - 创建完成(可以访问当前this实例)",
|
||||||
|
created() {
|
||||||
|
this.List();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
</style>
|
Loading…
Reference in New Issue