增加数据集市接口相关
parent
10ebafddf3
commit
16e525655d
|
@ -0,0 +1,44 @@
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询接口列表
|
||||||
|
export function listApitype(query) {
|
||||||
|
return request({
|
||||||
|
url: '/market/apitype/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询接口详细
|
||||||
|
export function getApitype(sysId) {
|
||||||
|
return request({
|
||||||
|
url: '/market/apitype/' + sysId,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增接口
|
||||||
|
export function addApitype(data) {
|
||||||
|
return request({
|
||||||
|
url: '/market/apitype',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改接口
|
||||||
|
export function updateApitype(data) {
|
||||||
|
return request({
|
||||||
|
url: '/market/apitype',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除接口
|
||||||
|
export function delApitype(sysId) {
|
||||||
|
return request({
|
||||||
|
url: '/market/apitype/' + sysId,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
|
@ -0,0 +1,344 @@
|
||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
|
<el-form-item label="产品编号" prop="sysSerial">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.sysSerial"
|
||||||
|
placeholder="请输入产品编号"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="简介" prop="sysIntro">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.sysIntro"
|
||||||
|
placeholder="请输入简介"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="产品状态" prop="sysTypes">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.sysTypes"
|
||||||
|
placeholder="请输入产品状态"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注" prop="sysBeihzu">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.sysBeihzu"
|
||||||
|
placeholder="请输入备注"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="类型选择" prop="sysLeixingpick">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.sysLeixingpick"
|
||||||
|
placeholder="请输入类型选择"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="次/元 时间" prop="sysNumber">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.sysNumber"
|
||||||
|
placeholder="请输入次/元 时间"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
icon="el-icon-plus"
|
||||||
|
size="mini"
|
||||||
|
@click="handleAdd"
|
||||||
|
v-hasPermi="['market:apitype:add']"
|
||||||
|
>新增</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="['market:apitype: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="['market:apitype: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="['market:apitype:export']"
|
||||||
|
>导出</el-button>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-row :gutter="10">
|
||||||
|
<el-empty description="暂无支付客户" v-if="apitypeList.length == 0"></el-empty>
|
||||||
|
<el-col :span="8" v-for="customer in apitypeList" v-if="apitypeList.length != 0">
|
||||||
|
<el-card class="box-card">
|
||||||
|
<div slot="header" class="clearfix">
|
||||||
|
<span style="font-size: 18px;font-weight: 900;">{{customer.sysIntro}}</span>
|
||||||
|
<el-switch
|
||||||
|
style="float: right;padding: 5px; margin: 4px 5px 0;"
|
||||||
|
v-model="customer.sysTypes"
|
||||||
|
active-value="1"
|
||||||
|
inactive-value="2"
|
||||||
|
active-color="#13ce66"
|
||||||
|
inactive-color="#ff4949"
|
||||||
|
@change="handleStatusChange(customer)"
|
||||||
|
>
|
||||||
|
</el-switch>
|
||||||
|
|
||||||
|
|
||||||
|
<el-button
|
||||||
|
style="float: right;padding: 5px; margin: 0 5px" type="primary" icon="el-icon-edit" circle
|
||||||
|
@click="handleUpdate(customer)"
|
||||||
|
v-hasPermi="['market:apitype:edit']"
|
||||||
|
></el-button>
|
||||||
|
<el-button
|
||||||
|
style="float: right;padding: 5px; margin: 0 5px" type="danger" icon="el-icon-delete" circle
|
||||||
|
@click="handleDelete(customer)"
|
||||||
|
v-hasPermi="['market:apitype:remove']"
|
||||||
|
></el-button>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div >
|
||||||
|
<el-descriptions class="margin-top" :column="1" :size="size" border>
|
||||||
|
<el-descriptions-item>
|
||||||
|
<template slot="label">
|
||||||
|
<i class="el-icon-user"> </i>产品编号</template>
|
||||||
|
{{customer.sysSerial}}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item>
|
||||||
|
<template slot="label">
|
||||||
|
<i class="el-icon-user"> </i>元/次</template>
|
||||||
|
{{customer.sysNumber}}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item>
|
||||||
|
<template slot="label">
|
||||||
|
<i class="el-icon-user"> </i>备注</template>
|
||||||
|
{{customer.sysBeihzu}}
|
||||||
|
</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<pagination
|
||||||
|
v-show="total>0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="queryParams.pageNum"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- 添加或修改接口对话框 -->
|
||||||
|
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body :close-on-click-modal="false">
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||||
|
<el-form-item label="产品编号" prop="sysSerial">
|
||||||
|
<el-input v-model="form.sysSerial" placeholder="请输入产品编号" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="简介" prop="sysIntro">
|
||||||
|
<el-input v-model="form.sysIntro" placeholder="请输入简介" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="产品状态" prop="sysTypes">
|
||||||
|
<el-input v-model="form.sysTypes" placeholder="请输入产品状态" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注" prop="sysBeihzu">
|
||||||
|
<el-input v-model="form.sysBeihzu" placeholder="请输入备注" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="类型选择" prop="sysLeixingpick">
|
||||||
|
<el-input v-model="form.sysLeixingpick" placeholder="请输入类型选择" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="次/元 时间" prop="sysNumber">
|
||||||
|
<el-input v-model="form.sysNumber" placeholder="请输入次/元 时间" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { listApitype, getApitype, delApitype, addApitype, updateApitype } from "@/api/market/apitype";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "Apitype",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
// 选中数组
|
||||||
|
ids: [],
|
||||||
|
// 非单个禁用
|
||||||
|
single: true,
|
||||||
|
// 非多个禁用
|
||||||
|
multiple: true,
|
||||||
|
// 显示搜索条件
|
||||||
|
showSearch: true,
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
// 接口表格数据
|
||||||
|
apitypeList: [],
|
||||||
|
// 弹出层标题
|
||||||
|
title: "",
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
sysSerial: null,
|
||||||
|
sysIntro: null,
|
||||||
|
sysTypes: null,
|
||||||
|
sysBeihzu: null,
|
||||||
|
sysLeixingpick: null,
|
||||||
|
sysNumber: null
|
||||||
|
},
|
||||||
|
// 表单参数
|
||||||
|
form: {},
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/** 查询接口列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
listApitype(this.queryParams).then(response => {
|
||||||
|
console.log(response);
|
||||||
|
if(200==response.code){
|
||||||
|
this.apitypeList = response.data.rows;
|
||||||
|
this.total = response.data.total;
|
||||||
|
this.loading = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 取消按钮
|
||||||
|
cancel() {
|
||||||
|
this.open = false;
|
||||||
|
this.reset();
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
sysId: null,
|
||||||
|
sysSerial: null,
|
||||||
|
sysIntro: null,
|
||||||
|
sysTypes: null,
|
||||||
|
sysBeihzu: null,
|
||||||
|
sysLeixingpick: null,
|
||||||
|
sysNumber: null
|
||||||
|
};
|
||||||
|
this.resetForm("form");
|
||||||
|
},
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
handleQuery() {
|
||||||
|
this.queryParams.pageNum = 1;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
resetQuery() {
|
||||||
|
this.resetForm("queryForm");
|
||||||
|
this.handleQuery();
|
||||||
|
},
|
||||||
|
// 多选框选中数据
|
||||||
|
handleSelectionChange(selection) {
|
||||||
|
this.ids = selection.map(item => item.sysId)
|
||||||
|
this.single = selection.length!==1
|
||||||
|
this.multiple = !selection.length
|
||||||
|
},
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
handleAdd() {
|
||||||
|
this.reset();
|
||||||
|
this.open = true;
|
||||||
|
this.title = "添加接口";
|
||||||
|
},
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.reset();
|
||||||
|
const sysId = row.sysId || this.ids
|
||||||
|
getApitype(sysId).then(response => {
|
||||||
|
this.form = response.data;
|
||||||
|
this.open = true;
|
||||||
|
this.title = "修改接口";
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm() {
|
||||||
|
this.$refs["form"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.form.sysId != null) {
|
||||||
|
updateApitype(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
addApitype(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("新增成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete(row) {
|
||||||
|
const sysIds = row.sysId || this.ids;
|
||||||
|
this.$modal.confirm('是否确认删除接口编号为"' + sysIds + '"的数据项?').then(function() {
|
||||||
|
return delApitype(sysIds);
|
||||||
|
}).then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess("删除成功");
|
||||||
|
}).catch(() => {});
|
||||||
|
},
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
handleExport() {
|
||||||
|
this.download('market/apitype/export', {
|
||||||
|
...this.queryParams
|
||||||
|
}, `apitype_${new Date().getTime()}.xlsx`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
Loading…
Reference in New Issue