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

pref:优化列表查询功能

parent 58052829
<template> <template>
<div class="page"> <div class="page">
<LayoutTable ref="layouttable" :data="tableData" :config="tableConfig" notDel notAdd> <LayoutTable
ref="layouttable"
:data="tableData"
:config="tableConfig"
notDel
notAdd
>
<!-- 热门0为非热门1为热门 --> <!-- 热门0为非热门1为热门 -->
<div slot="table-search-left" class="onlyhot"> <div slot="table-search-left" class="onlyhot">
<el-checkbox <el-checkbox
...@@ -14,28 +20,26 @@ ...@@ -14,28 +20,26 @@
</div> </div>
</LayoutTable> </LayoutTable>
<drawer-show ref="drawerform" @ok="getData" /> <drawer-show ref="drawerform" @ok="getData" />
</div> </div>
</template> </template>
<script> <script>
/** 表单弹出框模式需引入 */ /** 表单弹出框模式需引入 */
import drawerShow from "./drawershow"; import drawerShow from "./drawershow";
import table from "@/assets/mixins/table"; import table from "@/assets/mixins/table";
export default { export default {
name: "FeedbackList", name: "FeedbackList",
components: { components: {
drawerShow drawerShow,
}, },
mixins: [table], mixins: [table],
created() { created() {},
},
mounted() { 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: { methods: {
/** 重写新增方法 */ /** 重写新增方法 */
...@@ -51,33 +55,47 @@ ...@@ -51,33 +55,47 @@
this.$refs.drawerform.view(row); this.$refs.drawerform.view(row);
}, },
// 重写查询 // 重写查询
onSearch(){ onSearch() {
if(this.isreply){ // 是否显示未回复得数据
this.$refs.layouttable.$refs.searchform.form = Object.assign({}, this.$refs.layouttable.$refs.searchform.form, {reply:1}) 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 { 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({ this.$refs.layouttable.$refs.searchform.$router.push({
path: path, path: path,
query: Object.assign({}, query, data), query: Object.assign({}, query, data),
}); });
}, },
// 重写搜索清除 // 重写搜索清除
cleanForm(){ cleanForm() {
this.isreply = false this.isreply = false;
this.$refs.layouttable.$refs.searchform.form.reply = undefined this.$refs.layouttable.$refs.searchform.form.reply = undefined;
this.$forceUpdate() this.$forceUpdate();
this.$refs.layouttable.$refs.searchform.clean(); this.$refs.layouttable.$refs.searchform.clean();
this.$refs.layouttable.$refs.searchform.onSubmit(); this.$refs.layouttable.$refs.searchform.onSubmit();
}, },
changeIsReply(val){ // 点击只看未回复操作
this.isreply = val changeIsReply(val) {
this.isreply = val;
this.onSearch();
}, },
}, },
data() { data() {
return { return {
isreply:false, isreply: false,
config: { config: {
search: [ search: [
// { // {
...@@ -102,25 +120,30 @@ ...@@ -102,25 +120,30 @@
], ],
columns: [ columns: [
// {type: "selection", width: 60}, // {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: "真实姓名",
{label: "真实姓名", prop: "feedbackName",formatter: this.formatter}, prop: "feedbackName",
{label: "联系电话", prop: "contactInfo",formatter: this.formatter}, formatter: this.formatter,
},
{label: "单位名称", prop: "companyName",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}, // {label: "反馈类型 ", prop: "feedbackType",formatter: this.formatter},
...@@ -134,21 +157,35 @@ ...@@ -134,21 +157,35 @@
// {label: "处理意见", prop: "processComments"}, // {label: "处理意见", prop: "processComments"},
{label: "回复时间", prop: "processTime", formatter: this.formatterDate}, {
label: "回复时间",
prop: "processTime",
formatter: this.formatterDate,
},
// {label: "创建用户", prop: "createUserId", formatter: this.formatter}, // {label: "创建用户", prop: "createUserId", formatter: this.formatter},
{ {
label: "操作", label: "操作",
width: 240, width: 240,
formatter: row => { formatter: (row) => {
return ( 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> </script>
...@@ -77,6 +77,12 @@ export default { ...@@ -77,6 +77,12 @@ export default {
this.$refs.layouttable.$refs.searchform.form, this.$refs.layouttable.$refs.searchform.form,
{ hot: 1 } { 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 { path, query } = this.$refs.layouttable.$refs.searchform.$route;
let data = this.$refs.layouttable.$refs.searchform.decode( let data = this.$refs.layouttable.$refs.searchform.decode(
...@@ -97,6 +103,7 @@ export default { ...@@ -97,6 +103,7 @@ export default {
}, },
changeIshot(val) { changeIshot(val) {
this.ishot = val; this.ishot = val;
this.onSearch();
}, },
}, },
data() { 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