Commit 937271b3 authored by 姬鋆屾's avatar 姬鋆屾

pref:优化列表查询功能

parent 58052829
<template>
<div class="page">
<LayoutTable ref="layouttable" :data="tableData" :config="tableConfig" notDel notAdd>
<LayoutTable
ref="layouttable"
:data="tableData"
:config="tableConfig"
notDel
notAdd
>
<!-- 热门0为非热门1为热门 -->
<div slot="table-search-left" class="onlyhot">
<el-checkbox
......@@ -14,28 +20,26 @@
</div>
</LayoutTable>
<drawer-show ref="drawerform" @ok="getData" />
</div>
</template>
<script>
/** 表单弹出框模式需引入 */
import drawerShow from "./drawershow";
import table from "@/assets/mixins/table";
export default {
/** 表单弹出框模式需引入 */
import drawerShow from "./drawershow";
import table from "@/assets/mixins/table";
export default {
name: "FeedbackList",
components: {
drawerShow
drawerShow,
},
mixins: [table],
created() {
},
created() {},
mounted() {
// 重写查询
this.$refs.layouttable.$refs.searchform.onSubmit = this.onSearch
this.$refs.layouttable.$refs.searchform.onSubmit = this.onSearch;
// 重写搜索清除
this.$refs.layouttable.$refs.searchform.cleanForm = this.cleanForm
this.$refs.layouttable.$refs.searchform.cleanForm = this.cleanForm;
},
methods: {
/** 重写新增方法 */
......@@ -51,33 +55,47 @@
this.$refs.drawerform.view(row);
},
// 重写查询
onSearch(){
if(this.isreply){
this.$refs.layouttable.$refs.searchform.form = Object.assign({}, this.$refs.layouttable.$refs.searchform.form, {reply:1})
onSearch() {
// 是否显示未回复得数据
if (this.isreply) {
this.$refs.layouttable.$refs.searchform.form = Object.assign(
{},
this.$refs.layouttable.$refs.searchform.form,
{ reply: 0 }
);
} else {
this.$refs.layouttable.$refs.searchform.form = Object.assign(
{},
this.$refs.layouttable.$refs.searchform.form,
{ reply: "" }
);
}
let { path, query } = this.$refs.layouttable.$refs.searchform.$route;
let data = this.$refs.layouttable.$refs.searchform.decode(this.$refs.layouttable.$refs.searchform.form);
let data = this.$refs.layouttable.$refs.searchform.decode(
this.$refs.layouttable.$refs.searchform.form
);
this.$refs.layouttable.$refs.searchform.$router.push({
path: path,
query: Object.assign({}, query, data),
});
},
// 重写搜索清除
cleanForm(){
this.isreply = false
this.$refs.layouttable.$refs.searchform.form.reply = undefined
this.$forceUpdate()
cleanForm() {
this.isreply = false;
this.$refs.layouttable.$refs.searchform.form.reply = undefined;
this.$forceUpdate();
this.$refs.layouttable.$refs.searchform.clean();
this.$refs.layouttable.$refs.searchform.onSubmit();
},
changeIsReply(val){
this.isreply = val
// 点击只看未回复操作
changeIsReply(val) {
this.isreply = val;
this.onSearch();
},
},
data() {
return {
isreply:false,
isreply: false,
config: {
search: [
// {
......@@ -102,25 +120,30 @@
],
columns: [
// {type: "selection", width: 60},
{type: "index",label: "序号",width: 50},
{ type: "index", label: "序号", width: 50 },
{ label: "内容", prop: "content", formatter: this.formatter },
{label: "内容", prop: "content",formatter: this.formatter},
{label: "真实姓名", prop: "feedbackName",formatter: this.formatter},
{label: "联系电话", prop: "contactInfo",formatter: this.formatter},
{label: "单位名称", prop: "companyName",formatter: this.formatter},
{
label: "真实姓名",
prop: "feedbackName",
formatter: this.formatter,
},
{ label: "联系电话", prop: "contactInfo", formatter: this.formatter },
{label: "邮箱地址", prop: "email",formatter: this.formatter},
{ label: "单位名称", prop: "companyName", formatter: this.formatter },
{label: "提交时间", prop: "createTime", formatter: this.formatterDate},
{ label: "邮箱地址", prop: "email", formatter: this.formatter },
{
label: "提交时间",
prop: "createTime",
formatter: this.formatterDate,
},
{label: "是否回复 ", prop: "reply",formatter: this.formatter},
{ label: "是否回复 ", prop: "reply", formatter: this.formatter },
{label: "回复人", prop: "replyPerson",formatter: this.formatter},
{ label: "回复人", prop: "replyPerson", formatter: this.formatter },
// {label: "反馈类型 ", prop: "feedbackType",formatter: this.formatter},
......@@ -134,21 +157,35 @@
// {label: "处理意见", prop: "processComments"},
{label: "回复时间", prop: "processTime", formatter: this.formatterDate},
{
label: "回复时间",
prop: "processTime",
formatter: this.formatterDate,
},
// {label: "创建用户", prop: "createUserId", formatter: this.formatter},
{
label: "操作",
width: 240,
formatter: row => {
formatter: (row) => {
return (
<el-button type="text" icon="el-icon-edit" size='mini' onClick={()=>{this.toEdit(row)}} title="详情">详情</el-button>
<el-button
type="text"
icon="el-icon-edit"
size="mini"
onClick={() => {
this.toEdit(row);
}}
title="详情"
>
详情
</el-button>
);
}
}
]
}
};
}
},
},
],
},
};
},
};
</script>
......@@ -77,6 +77,12 @@ export default {
this.$refs.layouttable.$refs.searchform.form,
{ hot: 1 }
);
} else {
this.$refs.layouttable.$refs.searchform.form = Object.assign(
{},
this.$refs.layouttable.$refs.searchform.form,
{ hot: "" }
);
}
let { path, query } = this.$refs.layouttable.$refs.searchform.$route;
let data = this.$refs.layouttable.$refs.searchform.decode(
......@@ -97,6 +103,7 @@ export default {
},
changeIshot(val) {
this.ishot = val;
this.onSearch();
},
},
data() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment