fix:项目初始化

This commit is contained in:
ouyangxiu
2025-06-10 17:11:41 +07:00
commit db9bffd2c5
713 changed files with 159746 additions and 0 deletions
@@ -0,0 +1,150 @@
<template>
<el-dialog :title="title" :visible.sync="Visible" width="700px" center class="ac-dialog" :close-on-click-modal="false" @close="close">
<el-form :inline="true" :model="form" class="demo-form-inline" label-width="120px" label-position="right">
<el-row :gutter="24">
<el-col :xs="12" :sm="12" :md="12" :lg="12" :xl="12">
<el-form-item label="渠道id">
<el-input placeholder="请输入渠道id" v-model="form.channelId" />
</el-form-item>
</el-col>
<el-col :xs="12" :sm="12" :md="12" :lg="12" :xl="12">
<el-form-item label="渠道名称">
<el-input placeholder="请输入渠道名字" v-model="form.channelName" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :xs="12" :sm="12" :md="12" :lg="12" :xl="12">
<el-form-item label="提现平台类型">
<el-select placeholder="请选择渠道提现平台类型" size="mini" v-model="form.channelWtdrMode">
<el-option :key="item.value" :label="item.label" :value="item.value" v-for="item in wtdrChannelModeList" />
</el-select>
</el-form-item>
</el-col>
<el-col :xs="12" :sm="12" :md="12" :lg="12" :xl="12">
<el-form-item label="名称">
<el-input placeholder="请输入名称" v-model="form.channelWtdrName" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :xs="12" :sm="12" :md="12" :lg="12" :xl="12">
<el-form-item label="最大支付金额">
<el-input placeholder="请输入支持最大支付金额" v-model.number="form.maxMoney" />
</el-form-item>
</el-col>
<el-col :xs="12" :sm="12" :md="12" :lg="12" :xl="12">
<el-form-item label="最小支付金额">
<el-input placeholder="请输入支持最小支付金额" v-model.number="form.minMoney" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :xs="12" :sm="12" :md="12" :lg="12" :xl="12">
<el-form-item label="渠道费率">
<el-input placeholder="请输入渠道费率" v-model.number="form.rate" />
</el-form-item>
</el-col>
<el-col :xs="12" :sm="12" :md="12" :lg="12" :xl="12">
<el-form-item label="权重">
<el-input placeholder="请输入权重" v-model.number="form.weight" />
</el-form-item>
</el-col>
<el-col :xs="12" :sm="12" :md="12" :lg="12" :xl="12">
<el-form-item label="是否开启" prop="active">
<el-switch v-model="form.active" active-color="#13ce66" inactive-color="#ff4949"></el-switch>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="Visible = false"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</div>
</el-dialog>
</template>
<script>
import {
addwithdrawchannel,
editwithdrawchannel,
} from '@/api/tran/withdrawChannel'
import { wtdrChannelModeList } from '@/filters/tran/withdrawProvider'
export default {
name: 'AddOrEdit',
props: ['data'],
data() {
return {
Visible: true,
title: '',
wtdrChannelModeList: wtdrChannelModeList(),
// 表单数据
form: {
active: undefined,
channelId: undefined,
channelName: undefined,
channelWtdrMode: undefined,
channelWtdrName: undefined,
createdAt: undefined,
id: undefined,
maxMoney: undefined,
minMoney: undefined,
rate: undefined,
weight: undefined,
updatedAt: undefined,
},
}
},
mounted() {
this.title = this.data.title
if (this.title === '编辑') {
this.form = { ...this.data.data }
this.form.maxMoney = this.form.maxMoney / 100
this.form.minMoney = this.form.minMoney / 100
}
},
methods: {
//TODO:新增提现列表数据
add(data) {
addwithdrawchannel(data).then((res) => {
if (res.code === 200) {
this.$message.success('新增成功')
this.Visible = false
} else {
this.$message.error('新增失败')
}
})
},
//TODO:编辑提现列表数据
update(data) {
editwithdrawchannel(data).then((res) => {
if (res.code === 200) {
this.$message.success('更新成功')
this.Visible = false
} else {
this.$message.error('更新失败')
}
})
},
// 提交按钮
submit() {
const data = { ...this.form }
data.maxMoney = data.maxMoney * 100
data.minMoney = data.minMoney * 100
if (this.title === '新增') {
this.add(data)
} else if (this.title === '编辑') {
this.update(data)
}
},
// 关闭编辑
close() {
this.$emit('close')
},
},
}
</script>
+175
View File
@@ -0,0 +1,175 @@
<template>
<div class="pf-warpper">
<el-row class="table-form">
<el-form :inline="true" class="form-inline" label-width="80px" size="mini">
<el-form-item>
<el-button type="primary" icon="el-icon-refresh-right" plain @click="getList()">刷新</el-button>
<el-button @click="add" icon="el-icon-circle-plus-outline" plain type="success">新增</el-button>
</el-form-item>
</el-form>
</el-row>
<el-row>
<el-col>
<el-table :data="list" border height="740" highlight-current-row style="width: 100%" v-loading="loading">
<el-table-column align="center" label="渠道id" width="150">
<template slot-scope="scope">{{ scope.row.channelId }}</template>
</el-table-column>
<el-table-column align="center" label="渠道名称" width="150">
<template slot-scope="scope">{{ scope.row.channelName }}</template>
</el-table-column>
<el-table-column align="center" label="是否激活" width="100">
<template slot-scope="scope">
<el-button :type="scope.row.active ? 'success' : 'danger'" plain size="mini">{{ scope.row.active ? "激活" : "关闭" }}</el-button>
</template>
</el-table-column>
<el-table-column align="center" label="渠道提现平台类型">
<template slot-scope="scope">{{
scope.row.channelWtdrMode | changewtdrChannelMode
}}</template>
</el-table-column>
<el-table-column align="center" label="名称">
<template slot-scope="scope">{{ scope.row.channelWtdrName }}</template>
</el-table-column>
<el-table-column align="center" label="权重">
<template slot-scope="scope">{{ scope.row.weight }}</template>
</el-table-column>
<el-table-column align="center" label="支持最大支付金额" width="170">
<template slot-scope="scope">{{ scope.row.maxMoney | changeMoneyYuan }}</template>
</el-table-column>
<el-table-column align="center" label="支持最小支付金额" width="170">
<template slot-scope="scope">{{ scope.row.minMoney | changeMoneyYuan }}</template>
</el-table-column>
<el-table-column align="center" label="渠道费率">
<template slot-scope="scope">{{ scope.row.rate }}</template>
</el-table-column>
<el-table-column align="center" label="创建时间" width="150">
<template slot-scope="scope">{{
scope.row.createdAt | BeiJingTime
}}</template>
</el-table-column>
<el-table-column align="center" label="修改时间" width="150">
<template slot-scope="scope">{{
scope.row.updatedAt | BeiJingTime
}}</template>
</el-table-column>
<el-table-column align="center" fixed="right" label="操作" width="200">
<template slot-scope="scope">
<el-button @click="handleEdit('edit', scope.row)" icon="el-icon-edit" size="mini" type="primary">编辑</el-button>
<el-button @click="handleDelete(scope.row)" icon="el-icon-delete" size="mini" type="danger">删除</el-button>
</template>
</el-table-column>
</el-table>
</el-col>
</el-row>
<div class="table-pagination">
<el-pagination :current-page="searchData.pageNum" :page-size="searchData.pageSize" :page-sizes="[50, 100, 200, 300, 500]" :total="total" @current-change="handleCurrentChange" @size-change="handleSizeChange" layout="total, sizes, prev, pager, next, jumper" />
</div>
<AddOrEdit :data="editData" v-if="editVisible" @close="closeEdit" ref="addOrEdit"></AddOrEdit>
</div>
</template>
<script>
import {
withdrawchannelList,
delwithdrawchannel,
} from '@/api/tran/withdrawChannel'
import AddOrEdit from './components/AddOrEdit.vue'
export default {
name: 'WithdrawChannel',
components: { AddOrEdit },
data() {
return {
total: 0,
loading: false,
list: [],
editVisible: false,
searchData: {
pageNum: 1,
pageSize: 50,
param: {},
},
// 编辑数据
editData: {
title: '新增',
data: {},
},
}
},
mounted() {
this.getList()
},
methods: {
//TODO:请求提现列表数据
async getList() {
this.loading = true
withdrawchannelList(this.searchData).then((res) => {
if (res.code === 200) {
this.list = res.data.list
this.total = res.data.total
} else {
this.list = []
this.total = 0
this.$message.error('请求列表失败')
}
this.loading = false
})
},
//TODO:删除提现列表数据
handleDelete(row) {
this.$confirm('确认删除当前渠道?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
delwithdrawchannel({ id: row.id }).then((res) => {
if (res.code === 200) {
this.getList()
this.$message.success('删除成功')
} else {
this.$message.error('操作失败')
}
})
})
},
// 关闭编辑弹窗
closeEdit() {
this.editData = {
title: '新增',
data: {},
}
this.editVisible = false
this.getList()
},
// 新增按钮
add() {
this.editData = {
title: '新增',
data: {},
}
this.editVisible = true
},
// 编辑按钮
handleEdit(index, row) {
this.editData = {
title: '编辑',
data: row,
}
this.editVisible = true
},
// 切换每页条数
handleSizeChange(val) {
this.searchData.pageSize = Number(val)
this.getList()
},
// 翻页
handleCurrentChange(val) {
this.searchData.pageNum = Number(val)
this.getList()
},
},
}
</script>