6 changed files with 229 additions and 222 deletions
@ -1,235 +1,234 @@ |
|||||
<template> |
<template> |
||||
<div class="g-main"> |
<div class="g-main"> |
||||
<div class="m-search"> |
<div class="m-search"> |
||||
<el-form :inline="true" |
<el-form |
||||
:model="formData" |
:inline="true" |
||||
ref="ref_searchform" |
:model="formData" |
||||
:label-width="'120px'"> |
ref="ref_searchform" |
||||
<el-form-item label="标签名称" |
:label-width="'120px'" |
||||
prop="tagName"> |
> |
||||
<el-input v-model="formData.tagName" |
<el-form-item label="标签名称" prop="tagName"> |
||||
size="small" |
<el-input |
||||
class="u-item-width-normal" |
v-model="formData.tagName" |
||||
clearable |
size="small" |
||||
placeholder="请输入"> |
class="u-item-width-normal" |
||||
|
clearable |
||||
|
placeholder="请输入" |
||||
|
> |
||||
</el-input> |
</el-input> |
||||
|
|
||||
</el-form-item> |
</el-form-item> |
||||
<el-row type="flex" > |
<el-row type="flex"> |
||||
<el-col :span="24" align="right"> |
<el-col :span="24" align="right"> |
||||
<el-button style="margin-left:30px" |
<el-button |
||||
size="small" |
style="margin-left: 30px" |
||||
type="primary " |
size="small" |
||||
@click="handleSearchFrom">查询</el-button> |
type="primary " |
||||
</el-col> |
@click="handleSearchFrom" |
||||
</el-row> |
>查询</el-button |
||||
|
> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
</el-form> |
</el-form> |
||||
</div> |
</div> |
||||
<div class="m-table"> |
<div class="m-table"> |
||||
<div class="div_btn"> |
<div class="div_btn"> |
||||
<el-button |
<el-button |
||||
style="height:32px;" |
style="height: 32px" |
||||
size="small" |
size="small" |
||||
@click="handleAdd({},'add')" |
@click="handleAdd({}, 'add')" |
||||
type="primary" |
type="primary" |
||||
icon="el-icon-plus" |
icon="el-icon-plus" |
||||
> |
> |
||||
新增</el-button |
新增</el-button |
||||
|
> |
||||
|
</div> |
||||
|
<el-table |
||||
|
ref="config_table" |
||||
|
border |
||||
|
:data="tableData" |
||||
|
v-loading="tableLoading" |
||||
|
style="width: 100%" |
||||
|
:height="tableHeight" |
||||
|
> |
||||
|
<el-table-column |
||||
|
label="标签名称" |
||||
|
prop="tagName" |
||||
|
fixed="left" |
||||
|
align="center" |
||||
|
key="tagName" |
||||
|
/> |
||||
|
<el-table-column fixed="right" label="操作" align="center" width="200"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-button |
||||
|
style="margin-right: 10px" |
||||
|
@click="handleAdd(scope.row, 'edit')" |
||||
|
size="small" |
||||
|
type="text" |
||||
|
>修改</el-button |
||||
|
> |
||||
|
<!-- 按钮权限--> |
||||
|
<template> |
||||
|
<el-popconfirm |
||||
|
title="删除之后无法回复,确认删除?" |
||||
|
@onConfirm="handleDel(scope.row)" |
||||
|
> |
||||
|
<el-button size="small" type="text" slot="reference" |
||||
|
>删除</el-button |
||||
> |
> |
||||
</div> |
</el-popconfirm> |
||||
<el-table |
</template> |
||||
ref="config_table" |
</template> |
||||
border |
</el-table-column> |
||||
:data="tableData" |
</el-table> |
||||
v-loading="tableLoading" |
|
||||
style="width: 100%" |
|
||||
:height="tableHeight" |
|
||||
> |
|
||||
<el-table-column |
|
||||
label="标签名称" |
|
||||
prop="tagName" |
|
||||
fixed="left" |
|
||||
align="center" |
|
||||
key="tagName" |
|
||||
/> |
|
||||
<el-table-column fixed="right" label="操作" align="center" width="200"> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-button |
|
||||
style="margin-right: 10px" |
|
||||
@click="handleAdd(scope.row,'edit')" |
|
||||
size="small" |
|
||||
type="text" |
|
||||
>修改</el-button |
|
||||
> |
|
||||
<!-- 按钮权限--> |
|
||||
<template > |
|
||||
|
|
||||
<el-popconfirm |
<div class="div-flex"> |
||||
title="删除之后无法回复,确认删除?" |
<div class="m-page"> |
||||
@onConfirm="handleDel(scope.row)" |
<el-pagination |
||||
> |
@size-change="handleSizeChange" |
||||
<el-button |
@current-change="handleCurrentChange" |
||||
size="small" |
:current-page.sync="pageNo" |
||||
type="text" |
:page-sizes="[20, 50, 100, 200]" |
||||
slot="reference" |
:page-size="pageSize" |
||||
>删除</el-button |
layout="sizes, prev, pager, next, total" |
||||
> |
:total="total" |
||||
</el-popconfirm> |
> |
||||
</template> |
</el-pagination> |
||||
</template> |
|
||||
</el-table-column> |
|
||||
|
|
||||
</el-table> |
|
||||
|
|
||||
<div class="div-flex"> |
|
||||
<div class="m-page"> |
|
||||
<el-pagination |
|
||||
@size-change="handleSizeChange" |
|
||||
@current-change="handleCurrentChange" |
|
||||
:current-page.sync="pageNo" |
|
||||
:page-sizes="[20, 50, 100, 200]" |
|
||||
:page-size="pageSize" |
|
||||
layout="sizes, prev, pager, next, total" |
|
||||
:total="total" |
|
||||
> |
|
||||
</el-pagination> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
</div> |
||||
<el-dialog :visible.sync="formShow" |
</div> |
||||
:close-on-click-modal="false" |
|
||||
:close-on-press-escape="false" |
|
||||
:title="formTitle" |
|
||||
destroy-on-close |
|
||||
width="900px" |
|
||||
top="5vh" |
|
||||
class="dialog-h" |
|
||||
@closed="diaClose" |
|
||||
|
|
||||
> |
|
||||
<add-form |
|
||||
v-if="formShow" |
|
||||
ref="Config_form" |
|
||||
:row-obj="rowObj" |
|
||||
@dialogCancle="addFormCancle" |
|
||||
@dialogOk="addFormOk"></add-form> |
|
||||
</el-dialog> |
|
||||
</div> |
</div> |
||||
|
<el-dialog |
||||
|
:visible.sync="formShow" |
||||
|
:close-on-click-modal="false" |
||||
|
:close-on-press-escape="false" |
||||
|
:title="formTitle" |
||||
|
destroy-on-close |
||||
|
width="950px" |
||||
|
top="5vh" |
||||
|
class="dialog-h" |
||||
|
@closed="diaClose" |
||||
|
> |
||||
|
<add-form |
||||
|
v-if="formShow" |
||||
|
ref="Config_form" |
||||
|
:row-obj="rowObj" |
||||
|
@dialogCancle="addFormCancle" |
||||
|
@dialogOk="addFormOk" |
||||
|
></add-form> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
</template> |
</template> |
||||
|
|
||||
<script> |
<script> |
||||
import { requestPost } from "@/js/dai/request"; |
import { requestPost } from "@/js/dai/request"; |
||||
import { mapGetters } from "vuex"; |
import { mapGetters } from "vuex"; |
||||
import addForm from "./addForm.vue" |
import addForm from "./addForm.vue"; |
||||
export default { |
export default { |
||||
name:"labelConfig", |
name: "labelConfig", |
||||
data(){ |
data() { |
||||
return{ |
return { |
||||
formData:{ |
formData: { |
||||
tagName:"" |
tagName: "", |
||||
}, |
}, |
||||
tableData:[], |
tableData: [], |
||||
pageNo:1, |
pageNo: 1, |
||||
pageSize:20, |
pageSize: 20, |
||||
tableLoading:true, |
tableLoading: true, |
||||
total:0, |
total: 0, |
||||
searchH:115, |
searchH: 115, |
||||
formShow:false, |
formShow: false, |
||||
formTitle:"", |
formTitle: "", |
||||
rowObj:{} |
rowObj: {}, |
||||
} |
}; |
||||
|
}, |
||||
|
created() {}, |
||||
|
components: { addForm }, |
||||
|
methods: { |
||||
|
async getlabelConfigList() { |
||||
|
const url = "/governance/resiSearchTag/listResiSearchTags"; |
||||
|
let params = { |
||||
|
pageNo: this.pageNo, |
||||
|
pageSize: this.pageSize, |
||||
|
tagName: this.formData.tagName, |
||||
|
}; |
||||
|
let { data, msg, code } = await requestPost(url, params); |
||||
|
this.tableLoading = false; |
||||
|
if (code == 0) { |
||||
|
this.tableData = data.list; |
||||
|
this.total = data.total; |
||||
|
} else { |
||||
|
this.$message.error(msg); |
||||
|
} |
||||
}, |
}, |
||||
created(){ |
addFormCancle() { |
||||
|
this.formShow = false; |
||||
}, |
}, |
||||
components:{addForm}, |
addFormOk() { |
||||
methods:{ |
this.formShow = false; |
||||
async getlabelConfigList(){ |
this.getlabelConfigList(); |
||||
const url = "/governance/resiSearchTag/listResiSearchTags" |
}, |
||||
let params = { |
handleAdd(row, type) { |
||||
pageNo:this.pageNo, |
if (type == "add") { |
||||
pageSize:this.pageSize, |
this.formTitle = "新增标签"; |
||||
tagName:this.formData.tagName |
this.formShow = true; |
||||
} |
this.$nextTick(() => { |
||||
let {data,msg,code} = await requestPost(url,params) |
this.$refs.Config_form.initForm(type, row); |
||||
this.tableLoading = false |
}); |
||||
if(code == 0 ){ |
} else { |
||||
this.tableData = data.list |
this.formTitle = "修改标签"; |
||||
this.total = data.total |
this.formShow = true; |
||||
}else{ |
console.log(row); |
||||
this.$message.error(msg) |
this.rowObj = row; |
||||
} |
this.$nextTick(() => { |
||||
}, |
this.$refs.Config_form.initForm(type, row); |
||||
addFormCancle () { |
}); |
||||
this.formShow = false |
} |
||||
}, |
}, |
||||
addFormOk () { |
handleSizeChange(val) { |
||||
this.formShow = false |
console.log(`每页 ${val} 条`); |
||||
this.getlabelConfigList() |
this.pageSize = val; |
||||
}, |
this.getlabelConfigList(); |
||||
handleAdd (row,type) { |
|
||||
if(type=="add"){ |
|
||||
this.formTitle = '新增标签' |
|
||||
this.formShow = true |
|
||||
this.$nextTick(() => { |
|
||||
this.$refs.Config_form.initForm(type, row) |
|
||||
}) |
|
||||
}else { |
|
||||
this.formTitle = '修改标签' |
|
||||
this.formShow = true |
|
||||
console.log(row); |
|
||||
this.rowObj = row |
|
||||
this.$nextTick(() => { |
|
||||
this.$refs.Config_form.initForm(type, row) |
|
||||
}) |
|
||||
} |
|
||||
}, |
|
||||
handleSizeChange(val) { |
|
||||
console.log(`每页 ${val} 条`); |
|
||||
this.pageSize = val; |
|
||||
this.getlabelConfigList() |
|
||||
}, |
|
||||
async handleDel(row){ |
|
||||
const url = `/governance/resiSearchTag/deleteResiSearchTag/${row.tagId}` |
|
||||
let {code,msg} = await requestPost(url) |
|
||||
if(code == 0 ){ |
|
||||
this.$message.success('删除成功') |
|
||||
}else { |
|
||||
this.$message.error(msg) |
|
||||
|
|
||||
} |
|
||||
this.getlabelConfigList() |
|
||||
}, |
|
||||
handleSearchFrom(){ |
|
||||
this.getlabelConfigList() |
|
||||
}, |
|
||||
handleCurrentChange(val) { |
|
||||
this.pageNo = val; |
|
||||
this.getlabelConfigList(); |
|
||||
}, |
|
||||
diaClose () { |
|
||||
this.formShow = false |
|
||||
}, |
|
||||
}, |
}, |
||||
async mounted(){ |
async handleDel(row) { |
||||
this.getlabelConfigList() |
const url = `/governance/resiSearchTag/deleteResiSearchTag/${row.tagId}`; |
||||
|
let { code, msg } = await requestPost(url); |
||||
|
if (code == 0) { |
||||
|
this.$message.success("删除成功"); |
||||
|
} else { |
||||
|
this.$message.error(msg); |
||||
|
} |
||||
|
this.getlabelConfigList(); |
||||
}, |
}, |
||||
computed:{ |
handleSearchFrom() { |
||||
|
this.getlabelConfigList(); |
||||
|
}, |
||||
|
handleCurrentChange(val) { |
||||
|
this.pageNo = val; |
||||
|
this.getlabelConfigList(); |
||||
|
}, |
||||
|
diaClose() { |
||||
|
this.formShow = false; |
||||
|
}, |
||||
|
}, |
||||
|
async mounted() { |
||||
|
this.getlabelConfigList(); |
||||
|
}, |
||||
|
computed: { |
||||
...mapGetters(["clientHeight", "iframeHeight"]), |
...mapGetters(["clientHeight", "iframeHeight"]), |
||||
tableHeight() { |
tableHeight() { |
||||
const h = this.clientHeight - this.searchH - 275 + this.iframeHeight; |
const h = this.clientHeight - this.searchH - 275 + this.iframeHeight; |
||||
const _h = this.clientHeight - 275 - this.searchH; |
const _h = this.clientHeight - 275 - this.searchH; |
||||
return this.$store.state.inIframe ? h : _h; |
return this.$store.state.inIframe ? h : _h; |
||||
}, |
|
||||
}, |
}, |
||||
watch:{} |
}, |
||||
} |
watch: {}, |
||||
|
}; |
||||
</script> |
</script> |
||||
<style lang="scss" scoped> |
<style lang="scss" scoped> |
||||
@import "@/assets/scss/modules/management/list-main.scss"; |
@import "@/assets/scss/modules/management/list-main.scss"; |
||||
.div_btn{ |
.div_btn { |
||||
margin-bottom: 12px; |
margin-bottom: 12px; |
||||
|
} |
||||
|
.dialog-h{ |
||||
|
padding: 0 50px; |
||||
} |
} |
||||
</style> |
</style> |
||||
|
Loading…
Reference in new issue