init
This commit is contained in:
44
src/api/xq/pairSuccess.js
Normal file
44
src/api/xq/pairSuccess.js
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询成功案例列表
|
||||||
|
export function listPairSuccess(query) {
|
||||||
|
return request({
|
||||||
|
url: '/xq/pairSuccess/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询成功案例详细
|
||||||
|
export function getPairSuccess(id) {
|
||||||
|
return request({
|
||||||
|
url: '/xq/pairSuccess/' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增成功案例
|
||||||
|
export function addPairSuccess(data) {
|
||||||
|
return request({
|
||||||
|
url: '/xq/pairSuccess',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改成功案例
|
||||||
|
export function updatePairSuccess(data) {
|
||||||
|
return request({
|
||||||
|
url: '/xq/pairSuccess',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除成功案例
|
||||||
|
export function delPairSuccess(id) {
|
||||||
|
return request({
|
||||||
|
url: '/xq/pairSuccess/' + id,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
176
src/views/xq/pairSuccess/index.vue
Normal file
176
src/views/xq/pairSuccess/index.vue
Normal file
@@ -0,0 +1,176 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
|
<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:pairSuccess:add']"
|
||||||
|
>新增</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:pairSuccess:remove']"
|
||||||
|
>删除</el-button>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table v-loading="loading" :data="pairSuccessList" @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
<el-table-column label="成功案例" align="center" prop="picture" >
|
||||||
|
<template v-slot="scope">
|
||||||
|
<image-preview :src="scope.row.picture" :height="75" :width="120"/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="备注" align="center" prop="remark" />
|
||||||
|
<el-table-column label="状态" align="center" prop="enableStatus" >
|
||||||
|
<template v-slot="scope">
|
||||||
|
<cai-dict-tag :options="enableStatusList" :value="scope.row.enableStatus"/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="排序" align="center" prop="sort"/>
|
||||||
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
|
<template v-slot="scope">
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
@click="handleUpdate(scope.row)"
|
||||||
|
v-hasPermi="['xq:pairSuccess:edit']"
|
||||||
|
>修改</el-button>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
@click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['xq:pairSuccess: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"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<pair-success-add-update-dialog v-if="pairSuccessAddOrUpdateDialogVisible" ref="pairSuccessAddOrUpdateDialog" @refreshDataList="getList" />
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { delPairSuccess, listPairSuccess } from '@/api/xq/pairSuccess'
|
||||||
|
import { enableStatusList } from '@/constant/statusMap'
|
||||||
|
import PairSuccessAddUpdateDialog from '@/views/xq/pairSuccess/pair-success-add-update-dialog.vue'
|
||||||
|
import BannerAddUpdateDialog from '@/views/xq/banner/banner-add-update-dialog.vue'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "PairSuccess",
|
||||||
|
components: { BannerAddUpdateDialog, PairSuccessAddUpdateDialog},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
enableStatusList,
|
||||||
|
pairSuccessAddOrUpdateDialogVisible: false,
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
// 选中数组
|
||||||
|
ids: [],
|
||||||
|
// 非单个禁用
|
||||||
|
single: true,
|
||||||
|
// 非多个禁用
|
||||||
|
multiple: true,
|
||||||
|
// 显示搜索条件
|
||||||
|
showSearch: true,
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
// 成功案例表格数据
|
||||||
|
pairSuccessList: [],
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/** 查询成功案例列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
listPairSuccess(this.queryParams).then(response => {
|
||||||
|
this.pairSuccessList = response.rows;
|
||||||
|
this.total = response.total;
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
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.pairSuccessAddOrUpdateDialogVisible = true
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.pairSuccessAddOrUpdateDialog.init()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.pairSuccessAddOrUpdateDialogVisible = true
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.pairSuccessAddOrUpdateDialog.init(row.id)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete(row) {
|
||||||
|
const ids = row.id || this.ids;
|
||||||
|
this.$modal.confirm('是否确认删除成功案例编号为的数据项?').then(() => {
|
||||||
|
this.loading = true;
|
||||||
|
return delPairSuccess(ids);
|
||||||
|
}).then(() => {
|
||||||
|
this.loading = false;
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess("删除成功");
|
||||||
|
}).catch(() => {
|
||||||
|
}).finally(() => {
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
111
src/views/xq/pairSuccess/pair-success-add-update-dialog.vue
Normal file
111
src/views/xq/pairSuccess/pair-success-add-update-dialog.vue
Normal file
@@ -0,0 +1,111 @@
|
|||||||
|
<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="picture">
|
||||||
|
<image-upload2 v-model="form.picture"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input v-model="form.remark" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="排序" prop="sort">
|
||||||
|
<el-input v-model="form.sort" 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>
|
||||||
|
<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 { addPairSuccess, getPairSuccess, updatePairSuccess } from '@/api/xq/pairSuccess'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
},
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
enableStatusList,
|
||||||
|
open: false,
|
||||||
|
title: '',
|
||||||
|
form:{
|
||||||
|
id: undefined,
|
||||||
|
picture: undefined,
|
||||||
|
sort: undefined,
|
||||||
|
remark: undefined,
|
||||||
|
enableStatus: undefined,
|
||||||
|
},
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
picture: [
|
||||||
|
{ required: true, message: "数据不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
sort: [
|
||||||
|
{ 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){
|
||||||
|
getPairSuccess(id).then(response => {
|
||||||
|
this.form = response.data;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 表单提交
|
||||||
|
submitForm () {
|
||||||
|
this.$refs['form'].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
this.buttonLoading = true;
|
||||||
|
if (this.form.id != null) {
|
||||||
|
updatePairSuccess(this.form).then(data => {
|
||||||
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
this.$modal.buttonLoading = false;
|
||||||
|
this.open = false
|
||||||
|
this.$emit('refreshDataList')
|
||||||
|
}).finally(() => {
|
||||||
|
this.buttonLoading = false;
|
||||||
|
});
|
||||||
|
}else{
|
||||||
|
addPairSuccess(this.form).then(data => {
|
||||||
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
this.buttonLoading = false;
|
||||||
|
this.open = false
|
||||||
|
this.$emit('refreshDataList')
|
||||||
|
}).finally(() => {
|
||||||
|
this.buttonLoading = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -73,6 +73,11 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="年龄" align="center" prop="age" />
|
<el-table-column label="年龄" align="center" prop="age" />
|
||||||
<el-table-column label="居住城市" align="center" prop="residenceCityName" show-overflow-tooltip />
|
<el-table-column label="居住城市" align="center" prop="residenceCityName" show-overflow-tooltip />
|
||||||
|
<el-table-column label="基础资料" align="center" prop="finishBaseStatus" >
|
||||||
|
<template v-slot="scope">
|
||||||
|
<cai-dict-tag :options="finishStatusList" :value="scope.row.finishBaseStatus" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="最后登陆时间" align="center" prop="lastLoginTime" width="140"/>
|
<el-table-column label="最后登陆时间" align="center" prop="lastLoginTime" width="140"/>
|
||||||
<el-table-column label="登陆IP" align="center" prop="lastLoginIp" width="125"/>
|
<el-table-column label="登陆IP" align="center" prop="lastLoginIp" width="125"/>
|
||||||
<el-table-column label="注册时间" align="center" prop="regTime" width="140"/>
|
<el-table-column label="注册时间" align="center" prop="regTime" width="140"/>
|
||||||
@@ -139,7 +144,7 @@ import {
|
|||||||
userResetNickname,
|
userResetNickname,
|
||||||
userLock, userUnlock
|
userLock, userUnlock
|
||||||
} from '@/api/xq/user'
|
} from '@/api/xq/user'
|
||||||
import { appUserTypeList, genderList, userStatusList } from '@/constant/statusMap'
|
import { appUserTypeList, finishStatusList, genderList, userStatusList } from '@/constant/statusMap'
|
||||||
import BindInviteDialog from '@/views/xq/user/bind-invite-dialog.vue'
|
import BindInviteDialog from '@/views/xq/user/bind-invite-dialog.vue'
|
||||||
import UserInfoDialog from '@/views/xq/user/user-info-dialog.vue'
|
import UserInfoDialog from '@/views/xq/user/user-info-dialog.vue'
|
||||||
import AddUserDialog from '@/views/xq/user/add-user-dialog.vue'
|
import AddUserDialog from '@/views/xq/user/add-user-dialog.vue'
|
||||||
@@ -150,7 +155,7 @@ export default {
|
|||||||
components: { BindInviteDialog,UserInfoDialog,AddUserDialog,UpdateUserDialog},
|
components: { BindInviteDialog,UserInfoDialog,AddUserDialog,UpdateUserDialog},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
userStatusList,genderList,appUserTypeList,
|
userStatusList,genderList,appUserTypeList,finishStatusList,
|
||||||
bindInviteDialogVisible: false,
|
bindInviteDialogVisible: false,
|
||||||
userInfoDialogVisible: false,
|
userInfoDialogVisible: false,
|
||||||
addUserDialogVisible: false,
|
addUserDialogVisible: false,
|
||||||
|
|||||||
Reference in New Issue
Block a user