init
This commit is contained in:
@@ -1,31 +1,13 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
|
||||||
// 查询协议设置列表
|
|
||||||
export function listAgreementSetting(query) {
|
|
||||||
return request({
|
|
||||||
url: '/xq/agreementSetting/list',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查询协议设置详细
|
// 查询协议设置详细
|
||||||
export function getAgreementSetting(id) {
|
export function getAgreementSetting() {
|
||||||
return request({
|
return request({
|
||||||
url: '/xq/agreementSetting/' + id,
|
url: '/xq/agreementSetting/info',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新增协议设置
|
|
||||||
export function addAgreementSetting(data) {
|
|
||||||
return request({
|
|
||||||
url: '/xq/agreementSetting',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 修改协议设置
|
// 修改协议设置
|
||||||
export function updateAgreementSetting(data) {
|
export function updateAgreementSetting(data) {
|
||||||
return request({
|
return request({
|
||||||
@@ -34,11 +16,3 @@ export function updateAgreementSetting(data) {
|
|||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除协议设置
|
|
||||||
export function delAgreementSetting(id) {
|
|
||||||
return request({
|
|
||||||
url: '/xq/agreementSetting/' + id,
|
|
||||||
method: 'delete'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import request from '@/utils/request'
|
|||||||
// 查询敏感词列表
|
// 查询敏感词列表
|
||||||
export function listWord(query) {
|
export function listWord(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/xq/word/list',
|
url: '/sensitive/word/list',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
params: query
|
||||||
})
|
})
|
||||||
@@ -12,7 +12,7 @@ export function listWord(query) {
|
|||||||
// 查询敏感词详细
|
// 查询敏感词详细
|
||||||
export function getWord(id) {
|
export function getWord(id) {
|
||||||
return request({
|
return request({
|
||||||
url: '/xq/word/' + id,
|
url: '/sensitive/word/' + id,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -20,7 +20,7 @@ export function getWord(id) {
|
|||||||
// 新增敏感词
|
// 新增敏感词
|
||||||
export function addWord(data) {
|
export function addWord(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/xq/word',
|
url: '/sensitive/word',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
@@ -29,7 +29,7 @@ export function addWord(data) {
|
|||||||
// 修改敏感词
|
// 修改敏感词
|
||||||
export function updateWord(data) {
|
export function updateWord(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/xq/word',
|
url: '/sensitive/word',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
@@ -38,7 +38,7 @@ export function updateWord(data) {
|
|||||||
// 删除敏感词
|
// 删除敏感词
|
||||||
export function delWord(id) {
|
export function delWord(id) {
|
||||||
return request({
|
return request({
|
||||||
url: '/xq/word/' + id,
|
url: '/sensitive/word/' + id,
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,298 +1,83 @@
|
|||||||
<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-tabs v-model="activeName" type="card">
|
||||||
<el-form-item label="用户协议" prop="userAgreement">
|
<el-tab-pane label="用户协议" name="loansAgreement">
|
||||||
<el-input
|
<el-button type="primary" size="mini" v-hasPermi="['cai:agreementSetting:edit']" v-if="!userAgreement" @click="showEdit('userAgreement')">编辑</el-button>
|
||||||
v-model="queryParams.userAgreement"
|
<el-button :loading="buttonLoading" v-if="userAgreement" type="primary" size="mini" @click="submitForm2('userAgreement')">保存</el-button>
|
||||||
placeholder="请输入用户协议"
|
<div v-if="!userAgreement" v-html="form.userAgreement" style="width: 98%" />
|
||||||
clearable
|
<wang-edit v-if="userAgreement" v-model="form.userAgreement" :min-height="800" />
|
||||||
@keyup.enter.native="handleQuery"
|
</el-tab-pane>
|
||||||
/>
|
<el-tab-pane label="主播入驻协议" name="anchorJoinAgreement">
|
||||||
</el-form-item>
|
<el-button type="primary" size="mini" v-hasPermi="['cai:agreementSetting:edit']" v-if="!anchorJoinAgreement" @click="showEdit('anchorJoinAgreement')">编辑</el-button>
|
||||||
<el-form-item label="主播入驻协议" prop="anchorJoinAgreement">
|
<el-button :loading="buttonLoading" v-if="anchorJoinAgreement" type="primary" size="mini" @click="submitForm2('anchorJoinAgreement')">保存</el-button>
|
||||||
<el-input
|
<div v-if="!anchorJoinAgreement" v-html="form.anchorJoinAgreement" style="width: 98%" />
|
||||||
v-model="queryParams.anchorJoinAgreement"
|
<editor v-if="anchorJoinAgreement" v-model="form.anchorJoinAgreement" :min-height="192"></editor>
|
||||||
placeholder="请输入主播入驻协议"
|
</el-tab-pane>
|
||||||
clearable
|
<el-tab-pane label="隐私协议" name="privacyAgreement">
|
||||||
@keyup.enter.native="handleQuery"
|
<el-button type="primary" size="mini" v-hasPermi="['cai:agreementSetting:edit']" v-if="!privacyAgreement" @click="showEdit('privacyAgreement')">编辑</el-button>
|
||||||
/>
|
<el-button :loading="buttonLoading" v-if="privacyAgreement" type="primary" size="mini" @click="submitForm2('privacyAgreement')">保存</el-button>
|
||||||
</el-form-item>
|
<div v-if="!privacyAgreement" v-html="form.privacyAgreement" style="width: 98%" />
|
||||||
<el-form-item label="隐私协议" prop="privacyAgreement">
|
<editor v-if="privacyAgreement" v-model="form.privacyAgreement" :min-height="192"></editor>
|
||||||
<el-input
|
</el-tab-pane>
|
||||||
v-model="queryParams.privacyAgreement"
|
</el-tabs>
|
||||||
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="['xq:agreementSetting: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="['xq:agreementSetting: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="['xq:agreementSetting: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="['xq:agreementSetting:export']"
|
|
||||||
>导出</el-button>
|
|
||||||
</el-col>
|
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="agreementSettingList" @selection-change="handleSelectionChange">
|
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
|
||||||
<el-table-column label="ID" align="center" prop="id" v-if="true"/>
|
|
||||||
<el-table-column label="用户协议" align="center" prop="userAgreement" />
|
|
||||||
<el-table-column label="主播入驻协议" align="center" prop="anchorJoinAgreement" />
|
|
||||||
<el-table-column label="隐私协议" align="center" prop="privacyAgreement" />
|
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-button
|
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-edit"
|
|
||||||
@click="handleUpdate(scope.row)"
|
|
||||||
v-hasPermi="['xq:agreementSetting:edit']"
|
|
||||||
>修改</el-button>
|
|
||||||
<el-button
|
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-delete"
|
|
||||||
@click="handleDelete(scope.row)"
|
|
||||||
v-hasPermi="['xq:agreementSetting:remove']"
|
|
||||||
>删除</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
|
|
||||||
<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="500px" append-to-body>
|
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
||||||
<el-form-item label="用户协议" prop="userAgreement">
|
|
||||||
<el-input v-model="form.userAgreement" type="textarea" placeholder="请输入内容" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="主播入驻协议" prop="anchorJoinAgreement">
|
|
||||||
<el-input v-model="form.anchorJoinAgreement" type="textarea" placeholder="请输入内容" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="隐私协议" prop="privacyAgreement">
|
|
||||||
<el-input v-model="form.privacyAgreement" 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 { listAgreementSetting, getAgreementSetting, delAgreementSetting, addAgreementSetting, updateAgreementSetting } from "@/api/xq/agreementSetting";
|
import Editor from '@/components/Editor'
|
||||||
|
import WangEdit from '@/components/WangEdit'
|
||||||
|
import {getAgreementSetting, updateAgreementSetting} from "@/api/xq/agreementSetting";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "AgreementSetting",
|
name: "AgreementSetting",
|
||||||
|
components: {
|
||||||
|
Editor,WangEdit
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// 按钮loading
|
//按钮loading
|
||||||
buttonLoading: false,
|
buttonLoading: false,
|
||||||
// 遮罩层
|
form: {
|
||||||
loading: true,
|
id: undefined,
|
||||||
// 选中数组
|
userAgreement:undefined,
|
||||||
ids: [],
|
anchorJoinAgreement:undefined,
|
||||||
// 非单个禁用
|
privacyAgreement: undefined,
|
||||||
single: true,
|
|
||||||
// 非多个禁用
|
|
||||||
multiple: true,
|
|
||||||
// 显示搜索条件
|
|
||||||
showSearch: true,
|
|
||||||
// 总条数
|
|
||||||
total: 0,
|
|
||||||
// 协议设置表格数据
|
|
||||||
agreementSettingList: [],
|
|
||||||
// 弹出层标题
|
|
||||||
title: "",
|
|
||||||
// 是否显示弹出层
|
|
||||||
open: false,
|
|
||||||
// 查询参数
|
|
||||||
queryParams: {
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
userAgreement: undefined,
|
|
||||||
anchorJoinAgreement: undefined,
|
|
||||||
privacyAgreement: undefined
|
|
||||||
},
|
},
|
||||||
// 表单参数
|
activeName:'loansAgreement',
|
||||||
form: {},
|
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
id: [
|
},
|
||||||
{ required: true, message: "ID不能为空", trigger: "blur" }
|
formDisable:true,
|
||||||
],
|
userAgreement:false,
|
||||||
userAgreement: [
|
anchorJoinAgreement:false,
|
||||||
{ required: true, message: "用户协议不能为空", trigger: "blur" }
|
privacyAgreement: false,
|
||||||
],
|
|
||||||
anchorJoinAgreement: [
|
|
||||||
{ required: true, message: "主播入驻协议不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
privacyAgreement: [
|
|
||||||
{ required: true, message: "隐私协议不能为空", trigger: "blur" }
|
|
||||||
]
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList();
|
this.init();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/** 查询协议设置列表 */
|
init(){
|
||||||
getList() {
|
getAgreementSetting().then(response => {
|
||||||
this.loading = true;
|
|
||||||
listAgreementSetting(this.queryParams).then(response => {
|
|
||||||
this.agreementSettingList = response.rows;
|
|
||||||
this.total = response.total;
|
|
||||||
this.loading = false;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 取消按钮
|
|
||||||
cancel() {
|
|
||||||
this.open = false;
|
|
||||||
this.reset();
|
|
||||||
},
|
|
||||||
// 表单重置
|
|
||||||
reset() {
|
|
||||||
this.form = {
|
|
||||||
id: undefined,
|
|
||||||
userAgreement: undefined,
|
|
||||||
anchorJoinAgreement: undefined,
|
|
||||||
privacyAgreement: undefined
|
|
||||||
};
|
|
||||||
this.resetForm("form");
|
|
||||||
},
|
|
||||||
/** 搜索按钮操作 */
|
|
||||||
handleQuery() {
|
|
||||||
this.queryParams.pageNum = 1;
|
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
/** 重置按钮操作 */
|
|
||||||
resetQuery() {
|
|
||||||
this.resetForm("queryForm");
|
|
||||||
this.handleQuery();
|
|
||||||
},
|
|
||||||
// 多选框选中数据
|
|
||||||
handleSelectionChange(selection) {
|
|
||||||
this.ids = selection.map(item => item.id)
|
|
||||||
this.single = selection.length!==1
|
|
||||||
this.multiple = !selection.length
|
|
||||||
},
|
|
||||||
/** 新增按钮操作 */
|
|
||||||
handleAdd() {
|
|
||||||
this.reset();
|
|
||||||
this.open = true;
|
|
||||||
this.title = "添加协议设置";
|
|
||||||
},
|
|
||||||
/** 修改按钮操作 */
|
|
||||||
handleUpdate(row) {
|
|
||||||
this.loading = true;
|
|
||||||
this.reset();
|
|
||||||
const id = row.id || this.ids
|
|
||||||
getAgreementSetting(id).then(response => {
|
|
||||||
this.loading = false;
|
|
||||||
this.form = response.data;
|
this.form = response.data;
|
||||||
this.open = true;
|
})
|
||||||
this.title = "修改协议设置";
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
/** 提交按钮 */
|
showEdit(key){
|
||||||
submitForm() {
|
this[key] = true;
|
||||||
this.$refs["form"].validate(valid => {
|
|
||||||
if (valid) {
|
|
||||||
this.buttonLoading = true;
|
|
||||||
if (this.form.id != null) {
|
|
||||||
updateAgreementSetting(this.form).then(response => {
|
|
||||||
this.$modal.msgSuccess("修改成功");
|
|
||||||
this.open = false;
|
|
||||||
this.getList();
|
|
||||||
}).finally(() => {
|
|
||||||
this.buttonLoading = false;
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
addAgreementSetting(this.form).then(response => {
|
|
||||||
this.$modal.msgSuccess("新增成功");
|
|
||||||
this.open = false;
|
|
||||||
this.getList();
|
|
||||||
}).finally(() => {
|
|
||||||
this.buttonLoading = false;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
/** 删除按钮操作 */
|
submitForm2(key){
|
||||||
handleDelete(row) {
|
const params = {
|
||||||
const ids = row.id || this.ids;
|
id: this.form.id,
|
||||||
this.$modal.confirm('是否确认删除协议设置编号为"' + ids + '"的数据项?').then(() => {
|
[key]: this.form[key],
|
||||||
this.loading = true;
|
};
|
||||||
return delAgreementSetting(ids);
|
this.buttonLoading = true;
|
||||||
}).then(() => {
|
updateAgreementSetting(params).then(response => {
|
||||||
this.loading = false;
|
this.buttonLoading = false;
|
||||||
this.getList();
|
this[key] = false;
|
||||||
this.$modal.msgSuccess("删除成功");
|
this.msgSuccess("修改成功");
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
}).finally(() => {
|
this.buttonLoading = false;
|
||||||
this.loading = false;
|
|
||||||
});
|
});
|
||||||
},
|
|
||||||
/** 导出按钮操作 */
|
|
||||||
handleExport() {
|
|
||||||
this.download('xq/agreementSetting/export', {
|
|
||||||
...this.queryParams
|
|
||||||
}, `agreementSetting_${new Date().getTime()}.xlsx`)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,14 +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="money">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.money"
|
|
||||||
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>
|
||||||
@@ -18,110 +10,97 @@
|
|||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
plain
|
plain
|
||||||
icon="el-icon-plus"
|
icon="el-icon-plus"
|
||||||
size="mini"
|
size="mini"
|
||||||
@click="handleAdd"
|
@click="handleAdd"
|
||||||
v-hasPermi="['xq:withdrawSetting:add']"
|
v-hasPermi="['xq:withdrawSetting:add']"
|
||||||
>新增</el-button>
|
>新增
|
||||||
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="success"
|
type="success"
|
||||||
plain
|
plain
|
||||||
icon="el-icon-edit"
|
icon="el-icon-edit"
|
||||||
size="mini"
|
size="mini"
|
||||||
:disabled="single"
|
:disabled="single"
|
||||||
@click="handleUpdate"
|
@click="handleUpdate"
|
||||||
v-hasPermi="['xq:withdrawSetting:edit']"
|
v-hasPermi="['xq:withdrawSetting:edit']"
|
||||||
>修改</el-button>
|
>修改
|
||||||
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="danger"
|
type="danger"
|
||||||
plain
|
plain
|
||||||
icon="el-icon-delete"
|
icon="el-icon-delete"
|
||||||
size="mini"
|
size="mini"
|
||||||
:disabled="multiple"
|
:disabled="multiple"
|
||||||
@click="handleDelete"
|
@click="handleDelete"
|
||||||
v-hasPermi="['xq:withdrawSetting:remove']"
|
v-hasPermi="['xq:withdrawSetting:remove']"
|
||||||
>删除</el-button>
|
>删除
|
||||||
</el-col>
|
</el-button>
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="warning"
|
|
||||||
plain
|
|
||||||
icon="el-icon-download"
|
|
||||||
size="mini"
|
|
||||||
@click="handleExport"
|
|
||||||
v-hasPermi="['xq:withdrawSetting:export']"
|
|
||||||
>导出</el-button>
|
|
||||||
</el-col>
|
</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="withdrawSettingList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="withdrawSettingList" @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="money"/>
|
||||||
<el-table-column label="提现金额" align="center" prop="money" />
|
<el-table-column label="状态" align="center" prop="enableStatus">
|
||||||
<el-table-column label="0=开启 1=关闭" align="center" prop="status" />
|
<template v-slot="scope">
|
||||||
<el-table-column label="说明" align="center" prop="remark" />
|
<cai-dict-tag :options="enableStatusList" :value="scope.row.enableStatus"/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="说明" align="center" prop="remark" show-overflow-tooltip/>
|
||||||
<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"
|
||||||
icon="el-icon-edit"
|
icon="el-icon-edit"
|
||||||
@click="handleUpdate(scope.row)"
|
@click="handleUpdate(scope.row)"
|
||||||
v-hasPermi="['xq:withdrawSetting:edit']"
|
v-hasPermi="['xq:withdrawSetting:edit']"
|
||||||
>修改</el-button>
|
>修改
|
||||||
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-delete"
|
icon="el-icon-delete"
|
||||||
@click="handleDelete(scope.row)"
|
@click="handleDelete(scope.row)"
|
||||||
v-hasPermi="['xq:withdrawSetting:remove']"
|
v-hasPermi="['xq:withdrawSetting:remove']"
|
||||||
>删除</el-button>
|
>删除
|
||||||
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<pagination
|
<pagination
|
||||||
v-show="total>0"
|
v-show="total>0"
|
||||||
:total="total"
|
:total="total"
|
||||||
:page.sync="queryParams.pageNum"
|
:page.sync="queryParams.pageNum"
|
||||||
:limit.sync="queryParams.pageSize"
|
:limit.sync="queryParams.pageSize"
|
||||||
@pagination="getList"
|
@pagination="getList"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- 添加或修改提现配置对话框 -->
|
<withdraw-setting-add-update-dialog v-if="withdrawSettingAddUpdateDialogVisible" ref="withdrawSettingAddUpdateDialog" @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="money">
|
|
||||||
<el-input v-model="form.money" placeholder="请输入提现金额" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="说明" prop="remark">
|
|
||||||
<el-input v-model="form.remark" 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 { listWithdrawSetting, getWithdrawSetting, delWithdrawSetting, addWithdrawSetting, updateWithdrawSetting } from "@/api/xq/withdrawSetting";
|
import { delWithdrawSetting, listWithdrawSetting } from '@/api/xq/withdrawSetting'
|
||||||
|
import WithdrawSettingAddUpdateDialog from '@/views/xq/withdrawSetting/withdraw-setting-add-update-dialog.vue'
|
||||||
|
import { enableStatusList } from '@/constant/statusMap'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "WithdrawSetting",
|
name: 'WithdrawSetting',
|
||||||
|
components: { WithdrawSettingAddUpdateDialog },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// 按钮loading
|
enableStatusList,
|
||||||
buttonLoading: false,
|
withdrawSettingAddUpdateDialogVisible: false,
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
loading: true,
|
loading: true,
|
||||||
// 选中数组
|
// 选中数组
|
||||||
@@ -136,144 +115,72 @@ export default {
|
|||||||
total: 0,
|
total: 0,
|
||||||
// 提现配置表格数据
|
// 提现配置表格数据
|
||||||
withdrawSettingList: [],
|
withdrawSettingList: [],
|
||||||
// 弹出层标题
|
|
||||||
title: "",
|
|
||||||
// 是否显示弹出层
|
|
||||||
open: false,
|
|
||||||
// 查询参数
|
// 查询参数
|
||||||
queryParams: {
|
queryParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
money: undefined,
|
enableStatus: undefined
|
||||||
status: undefined,
|
|
||||||
},
|
|
||||||
// 表单参数
|
|
||||||
form: {},
|
|
||||||
// 表单校验
|
|
||||||
rules: {
|
|
||||||
id: [
|
|
||||||
{ required: true, message: "不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
money: [
|
|
||||||
{ required: true, message: "提现金额不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
status: [
|
|
||||||
{ required: true, message: "0=开启 1=关闭不能为空", trigger: "change" }
|
|
||||||
],
|
|
||||||
remark: [
|
|
||||||
{ required: true, message: "说明不能为空", trigger: "blur" }
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList();
|
this.getList()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/** 查询提现配置列表 */
|
/** 查询提现配置列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true
|
||||||
listWithdrawSetting(this.queryParams).then(response => {
|
listWithdrawSetting(this.queryParams).then(response => {
|
||||||
this.withdrawSettingList = response.rows;
|
this.withdrawSettingList = response.rows
|
||||||
this.total = response.total;
|
this.total = response.total
|
||||||
this.loading = false;
|
this.loading = false
|
||||||
});
|
})
|
||||||
},
|
|
||||||
// 取消按钮
|
|
||||||
cancel() {
|
|
||||||
this.open = false;
|
|
||||||
this.reset();
|
|
||||||
},
|
|
||||||
// 表单重置
|
|
||||||
reset() {
|
|
||||||
this.form = {
|
|
||||||
id: undefined,
|
|
||||||
money: undefined,
|
|
||||||
status: undefined,
|
|
||||||
remark: undefined
|
|
||||||
};
|
|
||||||
this.resetForm("form");
|
|
||||||
},
|
},
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
handleQuery() {
|
handleQuery() {
|
||||||
this.queryParams.pageNum = 1;
|
this.queryParams.pageNum = 1
|
||||||
this.getList();
|
this.getList()
|
||||||
},
|
},
|
||||||
/** 重置按钮操作 */
|
/** 重置按钮操作 */
|
||||||
resetQuery() {
|
resetQuery() {
|
||||||
this.resetForm("queryForm");
|
this.resetForm('queryForm')
|
||||||
this.handleQuery();
|
this.handleQuery()
|
||||||
},
|
},
|
||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
handleSelectionChange(selection) {
|
handleSelectionChange(selection) {
|
||||||
this.ids = selection.map(item => item.id)
|
this.ids = selection.map(item => item.id)
|
||||||
this.single = selection.length!==1
|
this.single = selection.length !== 1
|
||||||
this.multiple = !selection.length
|
this.multiple = !selection.length
|
||||||
},
|
},
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
this.reset();
|
this.withdrawSettingAddUpdateDialogVisible = true
|
||||||
this.open = true;
|
this.$nextTick(() => {
|
||||||
this.title = "添加提现配置";
|
this.$refs.withdrawSettingAddUpdateDialog.init()
|
||||||
|
})
|
||||||
},
|
},
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
this.loading = true;
|
this.withdrawSettingAddUpdateDialogVisible = true
|
||||||
this.reset();
|
this.$nextTick(() => {
|
||||||
const id = row.id || this.ids
|
this.$refs.withdrawSettingAddUpdateDialog.init(row.id)
|
||||||
getWithdrawSetting(id).then(response => {
|
})
|
||||||
this.loading = false;
|
|
||||||
this.form = response.data;
|
|
||||||
this.open = true;
|
|
||||||
this.title = "修改提现配置";
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/** 提交按钮 */
|
|
||||||
submitForm() {
|
|
||||||
this.$refs["form"].validate(valid => {
|
|
||||||
if (valid) {
|
|
||||||
this.buttonLoading = true;
|
|
||||||
if (this.form.id != null) {
|
|
||||||
updateWithdrawSetting(this.form).then(response => {
|
|
||||||
this.$modal.msgSuccess("修改成功");
|
|
||||||
this.open = false;
|
|
||||||
this.getList();
|
|
||||||
}).finally(() => {
|
|
||||||
this.buttonLoading = false;
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
addWithdrawSetting(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;
|
const ids = row.id || this.ids
|
||||||
this.$modal.confirm('是否确认删除提现配置编号为"' + ids + '"的数据项?').then(() => {
|
this.$modal.confirm('是否确认删除提现配置编号为"' + ids + '"的数据项?').then(() => {
|
||||||
this.loading = true;
|
this.loading = true
|
||||||
return delWithdrawSetting(ids);
|
return delWithdrawSetting(ids)
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.loading = false;
|
this.loading = false
|
||||||
this.getList();
|
this.getList()
|
||||||
this.$modal.msgSuccess("删除成功");
|
this.$modal.msgSuccess('删除成功')
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
this.loading = false;
|
this.loading = false
|
||||||
});
|
})
|
||||||
},
|
|
||||||
/** 导出按钮操作 */
|
|
||||||
handleExport() {
|
|
||||||
this.download('xq/withdrawSetting/export', {
|
|
||||||
...this.queryParams
|
|
||||||
}, `withdrawSetting_${new Date().getTime()}.xlsx`)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -0,0 +1,104 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog :title="title" :close-on-click-modal="false" :visible.sync="open" width="700px" append-to-body>
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
|
<el-form-item label="提现价格" prop="money">
|
||||||
|
<el-input v-model="form.money" placeholder="请输入提现价格" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="状态" prop="enableStatus">
|
||||||
|
<el-select v-model="form.enableStatus" placeholder="状态" size="small">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in enableStatusList"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input v-model="form.remark" placeholder="请输入备注" type="textarea" :rows="2"/>
|
||||||
|
</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 { enableStatusList } from '@/constant/statusMap'
|
||||||
|
import { addWithdrawSetting, getWithdrawSetting, updateWithdrawSetting } from '@/api/xq/withdrawSetting'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
},
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
enableStatusList,
|
||||||
|
open: false,
|
||||||
|
title: '',
|
||||||
|
form:{
|
||||||
|
id: undefined,
|
||||||
|
money: undefined,
|
||||||
|
remark: undefined,
|
||||||
|
enableStatus: undefined,
|
||||||
|
},
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
money: [
|
||||||
|
{ required: true, message: "数据不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
enableStatus: [
|
||||||
|
{ required: true, message: "数据不能为空", trigger: "change" }
|
||||||
|
],
|
||||||
|
},
|
||||||
|
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){
|
||||||
|
getWithdrawSetting(id).then(response => {
|
||||||
|
this.form = response.data;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 表单提交
|
||||||
|
submitForm () {
|
||||||
|
this.$refs['form'].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
this.buttonLoading = true;
|
||||||
|
if (this.form.id != null) {
|
||||||
|
updateWithdrawSetting(this.form).then(data => {
|
||||||
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
this.$modal.buttonLoading = false;
|
||||||
|
this.open = false
|
||||||
|
this.$emit('refreshDataList')
|
||||||
|
}).finally(() => {
|
||||||
|
this.buttonLoading = false;
|
||||||
|
});
|
||||||
|
}else{
|
||||||
|
addWithdrawSetting(this.form).then(data => {
|
||||||
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
this.buttonLoading = false;
|
||||||
|
this.open = false
|
||||||
|
this.$emit('refreshDataList')
|
||||||
|
}).finally(() => {
|
||||||
|
this.buttonLoading = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -1,310 +0,0 @@
|
|||||||
<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="word">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.word"
|
|
||||||
placeholder="请输入单词"
|
|
||||||
clearable
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="操作员名称" prop="operatorId">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.operatorId"
|
|
||||||
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="['xq:word: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="['xq:word: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="['xq:word: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="['xq:word:export']"
|
|
||||||
>导出</el-button>
|
|
||||||
</el-col>
|
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="wordList" @selection-change="handleSelectionChange">
|
|
||||||
<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="word" />
|
|
||||||
<el-table-column label="1-白名单 2-黑名单" align="center" prop="type" />
|
|
||||||
<el-table-column label="启用状态" align="center" prop="enableStatus" />
|
|
||||||
<el-table-column label="配置描述" align="center" prop="remark" />
|
|
||||||
<el-table-column label="操作员名称" align="center" prop="operatorId" />
|
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-button
|
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-edit"
|
|
||||||
@click="handleUpdate(scope.row)"
|
|
||||||
v-hasPermi="['xq:word:edit']"
|
|
||||||
>修改</el-button>
|
|
||||||
<el-button
|
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-delete"
|
|
||||||
@click="handleDelete(scope.row)"
|
|
||||||
v-hasPermi="['xq:word:remove']"
|
|
||||||
>删除</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
|
|
||||||
<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="500px" append-to-body>
|
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
||||||
<el-form-item label="单词" prop="word">
|
|
||||||
<el-input v-model="form.word" placeholder="请输入单词" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="配置描述" prop="remark">
|
|
||||||
<el-input v-model="form.remark" placeholder="请输入配置描述" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="操作员名称" prop="operatorId">
|
|
||||||
<el-input v-model="form.operatorId" 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>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { listWord, getWord, delWord, addWord, updateWord } from "@/api/xq/word";
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: "Word",
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
// 按钮loading
|
|
||||||
buttonLoading: false,
|
|
||||||
// 遮罩层
|
|
||||||
loading: true,
|
|
||||||
// 选中数组
|
|
||||||
ids: [],
|
|
||||||
// 非单个禁用
|
|
||||||
single: true,
|
|
||||||
// 非多个禁用
|
|
||||||
multiple: true,
|
|
||||||
// 显示搜索条件
|
|
||||||
showSearch: true,
|
|
||||||
// 总条数
|
|
||||||
total: 0,
|
|
||||||
// 敏感词表格数据
|
|
||||||
wordList: [],
|
|
||||||
// 弹出层标题
|
|
||||||
title: "",
|
|
||||||
// 是否显示弹出层
|
|
||||||
open: false,
|
|
||||||
// 查询参数
|
|
||||||
queryParams: {
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
word: undefined,
|
|
||||||
type: undefined,
|
|
||||||
enableStatus: undefined,
|
|
||||||
operatorId: undefined,
|
|
||||||
},
|
|
||||||
// 表单参数
|
|
||||||
form: {},
|
|
||||||
// 表单校验
|
|
||||||
rules: {
|
|
||||||
id: [
|
|
||||||
{ required: true, message: "应用自增主键不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
word: [
|
|
||||||
{ required: true, message: "单词不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
type: [
|
|
||||||
{ required: true, message: "1-白名单 2-黑名单不能为空", trigger: "change" }
|
|
||||||
],
|
|
||||||
enableStatus: [
|
|
||||||
{ required: true, message: "启用状态不能为空", trigger: "change" }
|
|
||||||
],
|
|
||||||
remark: [
|
|
||||||
{ required: true, message: "配置描述不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
operatorId: [
|
|
||||||
{ required: true, message: "操作员名称不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
createTime: [
|
|
||||||
{ required: true, message: "创建时间不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
updateTime: [
|
|
||||||
{ required: true, message: "更新时间不能为空", trigger: "blur" }
|
|
||||||
]
|
|
||||||
}
|
|
||||||
};
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
/** 查询敏感词列表 */
|
|
||||||
getList() {
|
|
||||||
this.loading = true;
|
|
||||||
listWord(this.queryParams).then(response => {
|
|
||||||
this.wordList = response.rows;
|
|
||||||
this.total = response.total;
|
|
||||||
this.loading = false;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 取消按钮
|
|
||||||
cancel() {
|
|
||||||
this.open = false;
|
|
||||||
this.reset();
|
|
||||||
},
|
|
||||||
// 表单重置
|
|
||||||
reset() {
|
|
||||||
this.form = {
|
|
||||||
id: undefined,
|
|
||||||
word: undefined,
|
|
||||||
type: undefined,
|
|
||||||
enableStatus: undefined,
|
|
||||||
remark: undefined,
|
|
||||||
operatorId: undefined,
|
|
||||||
createTime: undefined,
|
|
||||||
updateTime: undefined
|
|
||||||
};
|
|
||||||
this.resetForm("form");
|
|
||||||
},
|
|
||||||
/** 搜索按钮操作 */
|
|
||||||
handleQuery() {
|
|
||||||
this.queryParams.pageNum = 1;
|
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
/** 重置按钮操作 */
|
|
||||||
resetQuery() {
|
|
||||||
this.resetForm("queryForm");
|
|
||||||
this.handleQuery();
|
|
||||||
},
|
|
||||||
// 多选框选中数据
|
|
||||||
handleSelectionChange(selection) {
|
|
||||||
this.ids = selection.map(item => item.id)
|
|
||||||
this.single = selection.length!==1
|
|
||||||
this.multiple = !selection.length
|
|
||||||
},
|
|
||||||
/** 新增按钮操作 */
|
|
||||||
handleAdd() {
|
|
||||||
this.reset();
|
|
||||||
this.open = true;
|
|
||||||
this.title = "添加敏感词";
|
|
||||||
},
|
|
||||||
/** 修改按钮操作 */
|
|
||||||
handleUpdate(row) {
|
|
||||||
this.loading = true;
|
|
||||||
this.reset();
|
|
||||||
const id = row.id || this.ids
|
|
||||||
getWord(id).then(response => {
|
|
||||||
this.loading = false;
|
|
||||||
this.form = response.data;
|
|
||||||
this.open = true;
|
|
||||||
this.title = "修改敏感词";
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/** 提交按钮 */
|
|
||||||
submitForm() {
|
|
||||||
this.$refs["form"].validate(valid => {
|
|
||||||
if (valid) {
|
|
||||||
this.buttonLoading = true;
|
|
||||||
if (this.form.id != null) {
|
|
||||||
updateWord(this.form).then(response => {
|
|
||||||
this.$modal.msgSuccess("修改成功");
|
|
||||||
this.open = false;
|
|
||||||
this.getList();
|
|
||||||
}).finally(() => {
|
|
||||||
this.buttonLoading = false;
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
addWord(this.form).then(response => {
|
|
||||||
this.$modal.msgSuccess("新增成功");
|
|
||||||
this.open = false;
|
|
||||||
this.getList();
|
|
||||||
}).finally(() => {
|
|
||||||
this.buttonLoading = false;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/** 删除按钮操作 */
|
|
||||||
handleDelete(row) {
|
|
||||||
const ids = row.id || this.ids;
|
|
||||||
this.$modal.confirm('是否确认删除敏感词编号为"' + ids + '"的数据项?').then(() => {
|
|
||||||
this.loading = true;
|
|
||||||
return delWord(ids);
|
|
||||||
}).then(() => {
|
|
||||||
this.loading = false;
|
|
||||||
this.getList();
|
|
||||||
this.$modal.msgSuccess("删除成功");
|
|
||||||
}).catch(() => {
|
|
||||||
}).finally(() => {
|
|
||||||
this.loading = false;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/** 导出按钮操作 */
|
|
||||||
handleExport() {
|
|
||||||
this.download('xq/word/export', {
|
|
||||||
...this.queryParams
|
|
||||||
}, `word_${new Date().getTime()}.xlsx`)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
Reference in New Issue
Block a user