init
This commit is contained in:
@@ -25,6 +25,14 @@ export function userForbid(data) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function userResetAvatar(id) {
|
||||||
|
return request({
|
||||||
|
url: '/cai/user/resetAvatar',
|
||||||
|
method: 'post',
|
||||||
|
data: {id}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
export function resetUserMobile(data) {
|
export function resetUserMobile(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/cai/user/updateMobile',
|
url: '/cai/user/updateMobile',
|
||||||
|
|||||||
@@ -242,3 +242,8 @@ export const rankDrawList = [
|
|||||||
{ value: true, label: '已领奖',listClass: listClass.primary},
|
{ value: true, label: '已领奖',listClass: listClass.primary},
|
||||||
{ value: false, label: '未领奖',listClass: listClass.warning},
|
{ value: false, label: '未领奖',listClass: listClass.warning},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
export const payConfigTypeList = [
|
||||||
|
{ value: 1, label: '支付宝',listClass: listClass.primary},
|
||||||
|
{ value: 2, label: '微信',listClass: listClass.success},
|
||||||
|
]
|
||||||
|
|||||||
@@ -1,62 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
<el-form-item label="" prop="name">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.name"
|
|
||||||
placeholder="请输入"
|
|
||||||
clearable
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="" prop="wxMcid">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.wxMcid"
|
|
||||||
placeholder="请输入"
|
|
||||||
clearable
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="" prop="wxKey">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.wxKey"
|
|
||||||
placeholder="请输入"
|
|
||||||
clearable
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="" prop="appid">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.appid"
|
|
||||||
placeholder="请输入"
|
|
||||||
clearable
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="" prop="privateKey">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.privateKey"
|
|
||||||
placeholder="请输入"
|
|
||||||
clearable
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="" prop="publicKey">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.publicKey"
|
|
||||||
placeholder="请输入"
|
|
||||||
clearable
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="" prop="notifyUrl">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.notifyUrl"
|
|
||||||
placeholder="请输入"
|
|
||||||
clearable
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
<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-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
@@ -85,44 +29,32 @@
|
|||||||
v-hasPermi="['cai:payConfig:edit']"
|
v-hasPermi="['cai:payConfig:edit']"
|
||||||
>修改</el-button>
|
>修改</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="danger"
|
|
||||||
plain
|
|
||||||
icon="el-icon-delete"
|
|
||||||
size="mini"
|
|
||||||
:disabled="multiple"
|
|
||||||
@click="handleDelete"
|
|
||||||
v-hasPermi="['cai:payConfig: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="['cai:payConfig:export']"
|
|
||||||
>导出</el-button>
|
|
||||||
</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="payConfigList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="payConfigList" @selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="" align="center" prop="id" v-if="true"/>
|
<el-table-column label="名称" align="center" prop="name" />
|
||||||
<el-table-column label="1支付宝2微信" align="center" prop="payType" />
|
<el-table-column label="支付方式" align="center" prop="payType" >
|
||||||
<el-table-column label="" align="center" prop="name" />
|
<template v-slot="scope">
|
||||||
<el-table-column label="" align="center" prop="wxMcid" />
|
<cai-dict-tag :options="payConfigTypeList" :value="scope.row.payType"/>
|
||||||
<el-table-column label="" align="center" prop="wxKey" />
|
</template>
|
||||||
<el-table-column label="" align="center" prop="appid" />
|
</el-table-column>
|
||||||
<el-table-column label="" align="center" prop="privateKey" />
|
<el-table-column label="支付宝AppId" align="center" prop="appid" />
|
||||||
<el-table-column label="" align="center" prop="publicKey" />
|
<el-table-column label="微信商户号" align="center" prop="wxMcid" />
|
||||||
<el-table-column label="" align="center" prop="notifyUrl" />
|
<el-table-column label="回调地址" align="center" prop="notifyUrl" show-overflow-tooltip/>
|
||||||
<el-table-column label="" align="center" prop="enableStatus" />
|
<el-table-column label="开启状态" align="center" prop="enableStatus">
|
||||||
|
<template v-slot="scope">
|
||||||
|
<el-switch
|
||||||
|
v-model="scope.row.enableStatus"
|
||||||
|
:active-value="1"
|
||||||
|
:inactive-value="0"
|
||||||
|
@change="handleEnableStatusChange(scope.row)"
|
||||||
|
></el-switch>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template v-slot="scope">
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
@@ -149,48 +81,24 @@
|
|||||||
@pagination="getList"
|
@pagination="getList"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- 添加或修改支付配置对话框 -->
|
<pay-config-add-or-update-dialog v-if="payConfigAddOrUpdateDialogVisible" ref="payConfigAddOrUpdateDialog" @refreshDataList="getList"/>
|
||||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
||||||
<el-form-item label="" prop="name">
|
|
||||||
<el-input v-model="form.name" placeholder="请输入" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="" prop="wxMcid">
|
|
||||||
<el-input v-model="form.wxMcid" placeholder="请输入" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="" prop="wxKey">
|
|
||||||
<el-input v-model="form.wxKey" placeholder="请输入" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="" prop="appid">
|
|
||||||
<el-input v-model="form.appid" placeholder="请输入" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="" prop="privateKey">
|
|
||||||
<el-input v-model="form.privateKey" type="textarea" placeholder="请输入内容" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="" prop="publicKey">
|
|
||||||
<el-input v-model="form.publicKey" type="textarea" placeholder="请输入内容" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="" prop="notifyUrl">
|
|
||||||
<el-input v-model="form.notifyUrl" type="textarea" placeholder="请输入内容" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<div slot="footer" class="dialog-footer">
|
|
||||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
|
||||||
<el-button @click="cancel">取 消</el-button>
|
|
||||||
</div>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listPayConfig, getPayConfig, delPayConfig, addPayConfig, updatePayConfig } from "@/api/cai/payConfig";
|
import {delPayConfig, listPayConfig, updatePayConfig} from "@/api/cai/payConfig";
|
||||||
|
import {payConfigTypeList} from "@/constant/statusMap";
|
||||||
|
import PayConfigAddOrUpdateDialog from "@/views/cai/payConfig/pay-config-add-or-update-dialog";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "PayConfig",
|
name: "PayConfig",
|
||||||
|
components: {
|
||||||
|
PayConfigAddOrUpdateDialog
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// 按钮loading
|
payConfigTypeList,
|
||||||
buttonLoading: false,
|
payConfigAddOrUpdateDialogVisible: false,
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
loading: true,
|
loading: true,
|
||||||
// 选中数组
|
// 选中数组
|
||||||
@@ -205,62 +113,11 @@ export default {
|
|||||||
total: 0,
|
total: 0,
|
||||||
// 支付配置表格数据
|
// 支付配置表格数据
|
||||||
payConfigList: [],
|
payConfigList: [],
|
||||||
// 弹出层标题
|
|
||||||
title: "",
|
|
||||||
// 是否显示弹出层
|
|
||||||
open: false,
|
|
||||||
// 查询参数
|
// 查询参数
|
||||||
queryParams: {
|
queryParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
payType: undefined,
|
|
||||||
name: undefined,
|
|
||||||
wxMcid: undefined,
|
|
||||||
wxKey: undefined,
|
|
||||||
appid: undefined,
|
|
||||||
privateKey: undefined,
|
|
||||||
publicKey: undefined,
|
|
||||||
notifyUrl: undefined,
|
|
||||||
enableStatus: undefined,
|
|
||||||
},
|
},
|
||||||
// 表单参数
|
|
||||||
form: {},
|
|
||||||
// 表单校验
|
|
||||||
rules: {
|
|
||||||
id: [
|
|
||||||
{ required: true, message: "不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
payType: [
|
|
||||||
{ required: true, message: "1支付宝2微信不能为空", trigger: "change" }
|
|
||||||
],
|
|
||||||
name: [
|
|
||||||
{ required: true, message: "不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
wxMcid: [
|
|
||||||
{ required: true, message: "不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
wxKey: [
|
|
||||||
{ required: true, message: "不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
appid: [
|
|
||||||
{ required: true, message: "不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
privateKey: [
|
|
||||||
{ required: true, message: "不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
publicKey: [
|
|
||||||
{ required: true, message: "不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
notifyUrl: [
|
|
||||||
{ required: true, message: "不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
enableStatus: [
|
|
||||||
{ required: true, message: "不能为空", trigger: "change" }
|
|
||||||
],
|
|
||||||
createTime: [
|
|
||||||
{ required: true, message: "不能为空", trigger: "blur" }
|
|
||||||
]
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@@ -276,28 +133,6 @@ export default {
|
|||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 取消按钮
|
|
||||||
cancel() {
|
|
||||||
this.open = false;
|
|
||||||
this.reset();
|
|
||||||
},
|
|
||||||
// 表单重置
|
|
||||||
reset() {
|
|
||||||
this.form = {
|
|
||||||
id: undefined,
|
|
||||||
payType: undefined,
|
|
||||||
name: undefined,
|
|
||||||
wxMcid: undefined,
|
|
||||||
wxKey: undefined,
|
|
||||||
appid: undefined,
|
|
||||||
privateKey: undefined,
|
|
||||||
publicKey: undefined,
|
|
||||||
notifyUrl: undefined,
|
|
||||||
enableStatus: undefined,
|
|
||||||
createTime: undefined
|
|
||||||
};
|
|
||||||
this.resetForm("form");
|
|
||||||
},
|
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
handleQuery() {
|
handleQuery() {
|
||||||
this.queryParams.pageNum = 1;
|
this.queryParams.pageNum = 1;
|
||||||
@@ -316,53 +151,37 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
this.reset();
|
this.payConfigAddOrUpdateDialogVisible = true
|
||||||
this.open = true;
|
this.$nextTick(() => {
|
||||||
this.title = "添加支付配置";
|
this.$refs.payConfigAddOrUpdateDialog.init()
|
||||||
|
})
|
||||||
},
|
},
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
this.loading = true;
|
this.payConfigAddOrUpdateDialogVisible = true
|
||||||
this.reset();
|
this.$nextTick(() => {
|
||||||
const id = row.id || this.ids
|
this.$refs.payConfigAddOrUpdateDialog.init(row.id)
|
||||||
getPayConfig(id).then(response => {
|
})
|
||||||
this.loading = false;
|
|
||||||
this.form = response.data;
|
|
||||||
this.open = true;
|
|
||||||
this.title = "修改支付配置";
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
/** 提交按钮 */
|
handleEnableStatusChange(row){
|
||||||
submitForm() {
|
let text = row.enableStatus === 0 ? '关闭' : '开启'
|
||||||
this.$refs["form"].validate(valid => {
|
this.$confirm('确认要' + text + '[' + row.name + ']的支付配置吗?', '警告', {
|
||||||
if (valid) {
|
confirmButtonText: '确定',
|
||||||
this.buttonLoading = true;
|
cancelButtonText: '取消',
|
||||||
if (this.form.id != null) {
|
type: 'warning'
|
||||||
updatePayConfig(this.form).then(response => {
|
}).then(() => {
|
||||||
this.$modal.msgSuccess("修改成功");
|
return updatePayConfig({ id: row.id, enableStatus: row.enableStatus })
|
||||||
this.open = false;
|
}).then(() => {
|
||||||
this.getList();
|
this.$modal.msgSuccess(text + '成功')
|
||||||
}).finally(() => {
|
}).catch(function() {
|
||||||
this.buttonLoading = false;
|
row.enableStatus = row.enableStatus === 0 ? 1 : 0
|
||||||
});
|
})
|
||||||
} else {
|
|
||||||
addPayConfig(this.form).then(response => {
|
|
||||||
this.$modal.msgSuccess("新增成功");
|
|
||||||
this.open = false;
|
|
||||||
this.getList();
|
|
||||||
}).finally(() => {
|
|
||||||
this.buttonLoading = false;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
const ids = row.id || this.ids;
|
this.$modal.confirm('是否确认删除支付配置名称为"' + row.name + '"的数据项?').then(() => {
|
||||||
this.$modal.confirm('是否确认删除支付配置编号为"' + ids + '"的数据项?').then(() => {
|
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
return delPayConfig(ids);
|
return delPayConfig(row.id);
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.getList();
|
this.getList();
|
||||||
@@ -372,12 +191,6 @@ export default {
|
|||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/** 导出按钮操作 */
|
|
||||||
handleExport() {
|
|
||||||
this.download('cai/payConfig/export', {
|
|
||||||
...this.queryParams
|
|
||||||
}, `payConfig_${new Date().getTime()}.xlsx`)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
139
src/views/cai/payConfig/pay-config-add-or-update-dialog.vue
Normal file
139
src/views/cai/payConfig/pay-config-add-or-update-dialog.vue
Normal file
@@ -0,0 +1,139 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog :title="title" :close-on-click-modal="false" :visible.sync="open" width="800px" append-to-body>
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="110px">
|
||||||
|
<el-form-item label="名称" prop="name">
|
||||||
|
<el-input v-model="form.name" placeholder="请输入名称" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="支付方式" prop="payType">
|
||||||
|
<el-select :disabled="form.id" v-model="form.payType" placeholder="支付方式" clearable size="small" style="width: 99%">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in payConfigTypeList"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="商户号" prop="wxMcid" v-if="form.payType === 2">
|
||||||
|
<el-input v-model="form.wxMcid" placeholder="请输入商户号" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="微信key" prop="wxKey" v-if="form.payType === 2">
|
||||||
|
<el-input v-model="form.wxKey" placeholder="请输入微信key" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="支付宝AppId" prop="appid" v-if="form.payType === 1">
|
||||||
|
<el-input v-model="form.appid" placeholder="请输入AppId" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="私钥" prop="privateKey" v-if="form.payType === 1">
|
||||||
|
<el-input v-model="form.privateKey" placeholder="请输入秘钥" type="textarea" :rows="5"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="公钥" prop="publicKey" v-if="form.payType === 1">
|
||||||
|
<el-input v-model="form.publicKey" placeholder="请输入公钥" type="textarea" :rows="3" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="回调地址" prop="notifyUrl" >
|
||||||
|
<el-input v-model="form.notifyUrl" placeholder="请输入回调地址" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="open = false">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {payConfigTypeList} from "@/constant/statusMap";
|
||||||
|
import {addPayConfig, getPayConfig, updatePayConfig} from "@/api/cai/payConfig";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
},
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
payConfigTypeList,
|
||||||
|
open: false,
|
||||||
|
title: '',
|
||||||
|
form:{
|
||||||
|
id: undefined,
|
||||||
|
name: undefined,
|
||||||
|
payType: 1,
|
||||||
|
appid: undefined,
|
||||||
|
wxMcid: undefined,
|
||||||
|
wxKey: undefined,
|
||||||
|
privateKey: undefined,
|
||||||
|
publicKey: undefined,
|
||||||
|
notifyUrl: undefined
|
||||||
|
},
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
name: [
|
||||||
|
{ required: true, message: "数据不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
payType: [
|
||||||
|
{ required: true, message: "数据不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
appid: [
|
||||||
|
{ required: true, message: "回调地址不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
wxMcid: [
|
||||||
|
{ required: true, message: "数据不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
wxKey: [
|
||||||
|
{ required: true, message: "数据不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
privateKey: [
|
||||||
|
{ required: true, message: "数据不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
publicKey: [
|
||||||
|
{ required: true, message: "数据不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
},
|
||||||
|
buttonLoading: false,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
init (id) {
|
||||||
|
this.form.id = id || undefined;
|
||||||
|
this.title = (id ? "修改" : "新增") + "支付配置";
|
||||||
|
this.open = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs['form'].resetFields();
|
||||||
|
if(this.form.id){
|
||||||
|
getPayConfig(id).then(response => {
|
||||||
|
this.form = response.data;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 表单提交
|
||||||
|
submitForm () {
|
||||||
|
this.$refs['form'].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
this.buttonLoading = true;
|
||||||
|
if (this.form.id != null) {
|
||||||
|
updatePayConfig(this.form).then(data => {
|
||||||
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
this.$modal.buttonLoading = false;
|
||||||
|
this.open = false
|
||||||
|
this.$emit('refreshDataList')
|
||||||
|
}).finally(() => {
|
||||||
|
this.buttonLoading = false;
|
||||||
|
});
|
||||||
|
}else{
|
||||||
|
addPayConfig(this.form).then(data => {
|
||||||
|
this.$modal.msgSuccess("新增成功");
|
||||||
|
this.buttonLoading = false;
|
||||||
|
this.open = false
|
||||||
|
this.$emit('refreshDataList')
|
||||||
|
}).finally(() => {
|
||||||
|
this.buttonLoading = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -128,6 +128,7 @@
|
|||||||
<el-dropdown-item command="handleResetPwd" icon="el-icon-key">重置密码</el-dropdown-item>
|
<el-dropdown-item command="handleResetPwd" icon="el-icon-key">重置密码</el-dropdown-item>
|
||||||
<el-dropdown-item command="handleResetMobile" icon="el-icon-phone">修改手机</el-dropdown-item>
|
<el-dropdown-item command="handleResetMobile" icon="el-icon-phone">修改手机</el-dropdown-item>
|
||||||
<el-dropdown-item command="handleUserForbid" icon="el-icon-lock">封禁</el-dropdown-item>
|
<el-dropdown-item command="handleUserForbid" icon="el-icon-lock">封禁</el-dropdown-item>
|
||||||
|
<el-dropdown-item command="handleUserResetAvatar" icon="el-icon-lock">重置头像</el-dropdown-item>
|
||||||
<el-dropdown-item command="handleDelete" icon="el-icon-delete" v-hasPermi="['cai:user:remove']">删除</el-dropdown-item>
|
<el-dropdown-item command="handleDelete" icon="el-icon-delete" v-hasPermi="['cai:user:remove']">删除</el-dropdown-item>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
@@ -150,11 +151,12 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {delUser, getFullUser, listUser, resetUserMobile, resetUserPassword} from '@/api/cai/user'
|
import {delUser, getFullUser, listUser, resetUserMobile, resetUserPassword, userResetAvatar} from '@/api/cai/user'
|
||||||
import {authList, genderList, userStatusList, isAnchorList, videoStatusList} from '@/constant/statusMap'
|
import {authList, genderList, isAnchorList, userStatusList, videoStatusList} from '@/constant/statusMap'
|
||||||
import UserAddUpdateDialog from '@/views/cai/user/user-add-update-dialog.vue'
|
import UserAddUpdateDialog from '@/views/cai/user/user-add-update-dialog.vue'
|
||||||
import UserInfoDialog from "@/views/cai/user/user-info-dialog";
|
import UserInfoDialog from "@/views/cai/user/user-info-dialog";
|
||||||
import UserForbidDialog from "@/views/cai/user/user-forbid-dialog";
|
import UserForbidDialog from "@/views/cai/user/user-forbid-dialog";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "User",
|
name: "User",
|
||||||
components:{
|
components:{
|
||||||
@@ -310,6 +312,19 @@ export default {
|
|||||||
this.$refs.userForbid.init(row)
|
this.$refs.userForbid.init(row)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
handleUserResetAvatar(row){
|
||||||
|
this.$modal.confirm('是否确认重置用户"' + row.nickname + '"的头像?').then(() => {
|
||||||
|
this.loading = true;
|
||||||
|
return userResetAvatar(row.id);
|
||||||
|
}).then(() => {
|
||||||
|
this.loading = false;
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess("重置成功");
|
||||||
|
}).catch(() => {
|
||||||
|
}).finally(() => {
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
handleCommand(command, row) {
|
handleCommand(command, row) {
|
||||||
switch (command) {
|
switch (command) {
|
||||||
case "handleDelete":
|
case "handleDelete":
|
||||||
@@ -324,6 +339,9 @@ export default {
|
|||||||
case "handleUserForbid":
|
case "handleUserForbid":
|
||||||
this.handleUserForbid(row);
|
this.handleUserForbid(row);
|
||||||
break;
|
break;
|
||||||
|
case "handleUserResetAvatar":
|
||||||
|
this.handleUserResetAvatar(row);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user