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
<!-- 热门0为非热门1为热门 --> ref="layouttable"
<div slot="table-search-left" class="onlyhot"> :data="tableData"
<el-checkbox :config="tableConfig"
:key="0" notDel
v-model="isreply" notAdd
:checked="isreply" >
@change="changeIsReply" <!-- 热门0为非热门1为热门 -->
> <div slot="table-search-left" class="onlyhot">
</el-checkbox> <el-checkbox
只看未回复 :key="0"
</div> v-model="isreply"
</LayoutTable> :checked="isreply"
@change="changeIsReply"
>
<drawer-show ref="drawerform" @ok="getData" /> </el-checkbox>
</div> 只看未回复
</div>
</LayoutTable>
<drawer-show ref="drawerform" @ok="getData" />
</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: { /** 重写新增方法 */
/** 重写新增方法 */ toAdd(row) {
toAdd(row) { this.$refs.drawerform.add(row);
this.$refs.drawerform.add(row); },
}, /** 重写编辑方法 */
/** 重写编辑方法 */ toEdit(row) {
toEdit(row) { this.$refs.drawerform.edit(row);
this.$refs.drawerform.edit(row); },
}, /** 重写查看方法 */
/** 重写查看方法 */ toView(row) {
toView(row) { this.$refs.drawerform.view(row);
this.$refs.drawerform.view(row); },
}, // 重写查询
// 重写查询 onSearch() {
onSearch(){ // 是否显示未回复得数据
if(this.isreply){ if (this.isreply) {
this.$refs.layouttable.$refs.searchform.form = Object.assign({}, this.$refs.layouttable.$refs.searchform.form, {reply:1}) this.$refs.layouttable.$refs.searchform.form = Object.assign(
} {},
let { path, query } = this.$refs.layouttable.$refs.searchform.$route; this.$refs.layouttable.$refs.searchform.form,
let data = this.$refs.layouttable.$refs.searchform.decode(this.$refs.layouttable.$refs.searchform.form); { reply: 0 }
this.$refs.layouttable.$refs.searchform.$router.push({ );
path: path, } else {
query: Object.assign({}, query, data), this.$refs.layouttable.$refs.searchform.form = Object.assign(
}); {},
}, this.$refs.layouttable.$refs.searchform.form,
// 重写搜索清除 { reply: "" }
cleanForm(){ );
this.isreply = false }
this.$refs.layouttable.$refs.searchform.form.reply = undefined let { path, query } = this.$refs.layouttable.$refs.searchform.$route;
this.$forceUpdate() let data = this.$refs.layouttable.$refs.searchform.decode(
this.$refs.layouttable.$refs.searchform.clean(); this.$refs.layouttable.$refs.searchform.form
this.$refs.layouttable.$refs.searchform.onSubmit(); );
}, this.$refs.layouttable.$refs.searchform.$router.push({
changeIsReply(val){ path: path,
this.isreply = val query: Object.assign({}, query, data),
});
},
// 重写搜索清除
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;
this.onSearch();
},
},
data() {
return {
isreply: false,
config: {
search: [
// {
// name: "createTime",
// type: "date",
// label: "提交时间",
// fuzzy: true,
// valueFormat:"yyyy-MM-dd"
// },
{
name: "content",
type: "text",
label: "内容",
fuzzy: true,
},
{
name: "feedbackName",
type: "text",
label: "真实姓名",
fuzzy: true,
},
],
columns: [
// {type: "selection", width: 60},
{ type: "index", label: "序号", width: 50 },
{ 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: "email", formatter: this.formatter },
{
label: "提交时间",
prop: "createTime",
formatter: this.formatterDate,
},
{ label: "是否回复 ", prop: "reply", formatter: this.formatter },
{ label: "回复人", prop: "replyPerson", formatter: this.formatter },
// {label: "反馈类型 ", prop: "feedbackType",formatter: this.formatter},
// {label: "附件名称,多个逗号分割", prop: "fileName"},
// {label: "附件地址,多个逗号分割", prop: "filePath"},
// {label: "处理人名称", prop: "processName"},
// {label: "处理状态", prop: "processStatus",formatter: this.formatter},
// {label: "处理意见", prop: "processComments"},
{
label: "回复时间",
prop: "processTime",
formatter: this.formatterDate,
},
// {label: "创建用户", prop: "createUserId", formatter: this.formatter},
{
label: "操作",
width: 240,
formatter: (row) => {
return (
<el-button
type="text"
icon="el-icon-edit"
size="mini"
onClick={() => {
this.toEdit(row);
}}
title="详情"
>
详情
</el-button>
);
}, },
},
}, ],
data() { },
return {
isreply:false,
config: {
search: [
// {
// name: "createTime",
// type: "date",
// label: "提交时间",
// fuzzy: true,
// valueFormat:"yyyy-MM-dd"
// },
{
name: "content",
type: "text",
label: "内容",
fuzzy: true,
},
{
name: "feedbackName",
type: "text",
label: "真实姓名",
fuzzy: true,
},
],
columns: [
// {type: "selection", width: 60},
{type: "index",label: "序号",width: 50},
{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: "email",formatter: this.formatter},
{label: "提交时间", prop: "createTime", formatter: this.formatterDate},
{label: "是否回复 ", prop: "reply",formatter: this.formatter},
{label: "回复人", prop: "replyPerson",formatter: this.formatter},
// {label: "反馈类型 ", prop: "feedbackType",formatter: this.formatter},
// {label: "附件名称,多个逗号分割", prop: "fileName"},
// {label: "附件地址,多个逗号分割", prop: "filePath"},
// {label: "处理人名称", prop: "processName"},
// {label: "处理状态", prop: "processStatus",formatter: this.formatter},
// {label: "处理意见", prop: "processComments"},
{label: "回复时间", prop: "processTime", formatter: this.formatterDate},
// {label: "创建用户", prop: "createUserId", formatter: this.formatter},
{
label: "操作",
width: 240,
formatter: row => {
return (
<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