5 changed files with 607 additions and 0 deletions
@ -0,0 +1,68 @@ |
|||
<template> |
|||
<el-dialog :visible.sync="visible" title="回复" :close-on-click-modal="false" :close-on-press-escape="false"> |
|||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" :label-width="$i18n.locale === 'en-US' ? '120px' : '80px'"> |
|||
<el-form-item label="回复内容" prop="feedbackContent"> |
|||
<el-input type="textarea" autosize v-model="dataForm.feedbackContent" placeholder="请输入回复内容" maxlength="500" show-word-limit></el-input> |
|||
</el-form-item> |
|||
</el-form> |
|||
<template slot="footer"> |
|||
<el-button @click="visible = false">{{ $t('cancel') }}</el-button> |
|||
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script> |
|||
import debounce from 'lodash/debounce' |
|||
export default { |
|||
data () { |
|||
return { |
|||
visible: false, |
|||
dataForm: { |
|||
id: '', |
|||
feedbackContent: '', |
|||
suggestionId: '' |
|||
} |
|||
} |
|||
}, |
|||
computed: { |
|||
dataRule () { |
|||
return { |
|||
feedbackContent: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
] |
|||
} |
|||
} |
|||
}, |
|||
methods: { |
|||
init () { |
|||
this.visible = true |
|||
this.$nextTick(() => { |
|||
this.$refs['dataForm'].resetFields() |
|||
}) |
|||
}, |
|||
// 表单提交 |
|||
dataFormSubmitHandle: debounce(function () { |
|||
this.$refs['dataForm'].validate((valid) => { |
|||
if (!valid) { |
|||
return false |
|||
} |
|||
this.$http[!this.dataForm.id ? 'post' : 'put']('/custom/suggestionfeedback/', this.dataForm).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
this.$message({ |
|||
message: this.$t('prompt.success'), |
|||
type: 'success', |
|||
duration: 500, |
|||
onClose: () => { |
|||
this.visible = false |
|||
this.$emit('refreshDataList') |
|||
} |
|||
}) |
|||
}).catch(() => {}) |
|||
}) |
|||
}, 1000, { 'leading': true, 'trailing': false }) |
|||
} |
|||
} |
|||
</script> |
@ -0,0 +1,229 @@ |
|||
<template> |
|||
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false"> |
|||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" :label-width="$i18n.locale === 'en-US' ? '120px' : '80px'"> |
|||
<el-form-item label="建议类别 关联:epdc_suggestion_type" prop="suggestionTypeId"> |
|||
<el-input v-model="dataForm.suggestionTypeId" placeholder="建议类别 关联:epdc_suggestion_type"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="建议标题" prop="suggestionTitle"> |
|||
<el-input v-model="dataForm.suggestionTitle" placeholder="建议标题"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="建议内容" prop="suggestionContent"> |
|||
<el-input v-model="dataForm.suggestionContent" placeholder="建议内容"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="建议图片 关联:epdc_custom_img 表;最多三张,逗号分隔" prop="suggestionPic"> |
|||
<el-input v-model="dataForm.suggestionPic" placeholder="建议图片 关联:epdc_custom_img 表;最多三张,逗号分隔"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="提意见的用户ID" prop="userId"> |
|||
<el-input v-model="dataForm.userId" placeholder="提意见的用户ID"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="用户昵称" prop="nickname"> |
|||
<el-input v-model="dataForm.nickname" placeholder="用户昵称"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="用户头像" prop="faceImg"> |
|||
<el-input v-model="dataForm.faceImg" placeholder="用户头像"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="手机号" prop="mobile"> |
|||
<el-input v-model="dataForm.mobile" placeholder="手机号"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="是否是党员(0-否,1-是)" prop="partyFlag"> |
|||
<el-input v-model="dataForm.partyFlag" placeholder="是否是党员(0-否,1-是)"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="居住网格id" prop="deptId"> |
|||
<el-input v-model="dataForm.deptId" placeholder="居住网格id"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="居住网格名称" prop="deptName"> |
|||
<el-input v-model="dataForm.deptName" placeholder="居住网格名称"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="父所有部门id" prop="parentDeptIds"> |
|||
<el-input v-model="dataForm.parentDeptIds" placeholder="父所有部门id"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="父所有部门名称" prop="parentDeptNames"> |
|||
<el-input v-model="dataForm.parentDeptNames" placeholder="父所有部门名称"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="所有部门ID" prop="allDeptIds"> |
|||
<el-input v-model="dataForm.allDeptIds" placeholder="所有部门ID"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="所有部门名称" prop="allDeptNames"> |
|||
<el-input v-model="dataForm.allDeptNames" placeholder="所有部门名称"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="是否反馈 0-否,1-是" prop="isFeedback"> |
|||
<el-input v-model="dataForm.isFeedback" placeholder="是否反馈 0-否,1-是"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="删除标识 0-否,1-是" prop="delFlag"> |
|||
<el-input v-model="dataForm.delFlag" placeholder="删除标识 0-否,1-是"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="乐观锁" prop="revision"> |
|||
<el-input v-model="dataForm.revision" placeholder="乐观锁"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="创建人" prop="createdBy"> |
|||
<el-input v-model="dataForm.createdBy" placeholder="创建人"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="创建时间" prop="createdTime"> |
|||
<el-input v-model="dataForm.createdTime" placeholder="创建时间"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="更新人" prop="updatedBy"> |
|||
<el-input v-model="dataForm.updatedBy" placeholder="更新人"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="更新时间" prop="updatedTime"> |
|||
<el-input v-model="dataForm.updatedTime" placeholder="更新时间"></el-input> |
|||
</el-form-item> |
|||
</el-form> |
|||
<template slot="footer"> |
|||
<el-button @click="visible = false">{{ $t('cancel') }}</el-button> |
|||
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script> |
|||
import debounce from 'lodash/debounce' |
|||
export default { |
|||
data () { |
|||
return { |
|||
visible: false, |
|||
dataForm: { |
|||
id: '', |
|||
suggestionTypeId: '', |
|||
suggestionTitle: '', |
|||
suggestionContent: '', |
|||
suggestionPic: '', |
|||
userId: '', |
|||
nickname: '', |
|||
faceImg: '', |
|||
mobile: '', |
|||
partyFlag: '', |
|||
deptId: '', |
|||
deptName: '', |
|||
parentDeptIds: '', |
|||
parentDeptNames: '', |
|||
allDeptIds: '', |
|||
allDeptNames: '', |
|||
isFeedback: '', |
|||
delFlag: '', |
|||
revision: '', |
|||
createdBy: '', |
|||
createdTime: '', |
|||
updatedBy: '', |
|||
updatedTime: '' |
|||
} |
|||
} |
|||
}, |
|||
computed: { |
|||
dataRule () { |
|||
return { |
|||
suggestionTypeId: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
suggestionTitle: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
suggestionContent: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
suggestionPic: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
userId: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
nickname: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
faceImg: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
mobile: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
partyFlag: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
deptId: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
deptName: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
parentDeptIds: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
parentDeptNames: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
allDeptIds: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
allDeptNames: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
isFeedback: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
delFlag: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
revision: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
createdBy: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
createdTime: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
updatedBy: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
updatedTime: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
] |
|||
} |
|||
} |
|||
}, |
|||
methods: { |
|||
init () { |
|||
this.visible = true |
|||
this.$nextTick(() => { |
|||
this.$refs['dataForm'].resetFields() |
|||
if (this.dataForm.id) { |
|||
this.getInfo() |
|||
} |
|||
}) |
|||
}, |
|||
// 获取信息 |
|||
getInfo () { |
|||
this.$http.get(`/custom/suggestionmake/${this.dataForm.id}`).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
this.dataForm = { |
|||
...this.dataForm, |
|||
...res.data |
|||
} |
|||
}).catch(() => {}) |
|||
}, |
|||
// 表单提交 |
|||
dataFormSubmitHandle: debounce(function () { |
|||
this.$refs['dataForm'].validate((valid) => { |
|||
if (!valid) { |
|||
return false |
|||
} |
|||
this.$http[!this.dataForm.id ? 'post' : 'put']('/custom/suggestionmake/', this.dataForm).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
this.$message({ |
|||
message: this.$t('prompt.success'), |
|||
type: 'success', |
|||
duration: 500, |
|||
onClose: () => { |
|||
this.visible = false |
|||
this.$emit('refreshDataList') |
|||
} |
|||
}) |
|||
}).catch(() => {}) |
|||
}) |
|||
}, 1000, { 'leading': true, 'trailing': false }) |
|||
} |
|||
} |
|||
</script> |
@ -0,0 +1,89 @@ |
|||
<template> |
|||
<el-card shadow="never" class="aui-card--fill"> |
|||
<div class="mod-custom__suggestionmake}"> |
|||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> |
|||
<el-form-item> |
|||
<el-input v-model="dataForm.id" placeholder="id" clearable></el-input> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button @click="getDataList()">{{ $t('query') }}</el-button> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button v-if="$hasPermission('custom:suggestionmake:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%;"> |
|||
<el-table-column prop="suggestionTypeId" label="建议类别" header-align="center" align="center"></el-table-column> |
|||
<el-table-column prop="suggestionTitle" label="建议标题" header-align="center" align="center"></el-table-column> |
|||
<el-table-column prop="deptName" label="网格" header-align="center" align="center"></el-table-column> |
|||
<el-table-column prop="nickname" label="建议人" header-align="center" align="center"></el-table-column> |
|||
<el-table-column prop="isFeedback" label="状态" :formatter="formatFeedback" header-align="center" align="center"></el-table-column> |
|||
<el-table-column prop="createdTime" label="提交时间" header-align="center" align="center"></el-table-column> |
|||
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150"> |
|||
<template slot-scope="scope"> |
|||
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">查看</el-button> |
|||
<el-button v-if="$hasPermission('custom:suggestionmake:feedback')" :disabled="scope.row.isFeedback==='1'" |
|||
type="text" size="small" @click="feedbackHandle(scope.row.id)">回复</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<el-pagination |
|||
:current-page="page" |
|||
:page-sizes="[10, 20, 50, 100]" |
|||
:page-size="limit" |
|||
:total="total" |
|||
layout="total, sizes, prev, pager, next, jumper" |
|||
@size-change="pageSizeChangeHandle" |
|||
@current-change="pageCurrentChangeHandle"> |
|||
</el-pagination> |
|||
<!-- 弹窗, 反馈 --> |
|||
<suggestionfeedback-add-or-update v-if="feedbackVisible" |
|||
ref="suggestionfeedbackAddOrUpdate" |
|||
@refreshDataList="getDataList"></suggestionfeedback-add-or-update> |
|||
</div> |
|||
</el-card> |
|||
</template> |
|||
|
|||
<script> |
|||
import mixinViewModule from '@/mixins/view-module' |
|||
import AddOrUpdate from './suggestionmake-add-or-update' |
|||
import suggestionfeedbackAddOrUpdate from './suggestionfeedback-add-or-update' |
|||
export default { |
|||
mixins: [mixinViewModule], |
|||
data () { |
|||
return { |
|||
mixinViewModuleOptions: { |
|||
getDataListURL: '/custom/suggestionmake/page', |
|||
getDataListIsPage: true, |
|||
deleteURL: '/custom/suggestionmake', |
|||
deleteIsBatch: true |
|||
}, |
|||
dataForm: { |
|||
id: '' |
|||
}, |
|||
feedbackVisible: false |
|||
} |
|||
}, |
|||
methods: { |
|||
formatFeedback (row, column) { |
|||
if (row.isFeedback === '0') { |
|||
return '未回复' |
|||
} else if (row.isFeedback === '1') { |
|||
return '已回复' |
|||
} |
|||
}, |
|||
feedbackHandle (id) { |
|||
console.log(id) |
|||
this.feedbackVisible = true |
|||
this.$nextTick(() => { |
|||
this.$refs.suggestionfeedbackAddOrUpdate.dataForm.suggestionId = id |
|||
this.$refs.suggestionfeedbackAddOrUpdate.init() |
|||
}) |
|||
} |
|||
}, |
|||
components: { |
|||
AddOrUpdate, |
|||
suggestionfeedbackAddOrUpdate |
|||
} |
|||
} |
|||
</script> |
@ -0,0 +1,163 @@ |
|||
<template> |
|||
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false"> |
|||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" :label-width="$i18n.locale === 'en-US' ? '120px' : '80px'"> |
|||
<el-form-item label="类别名称" prop="suggestionName"> |
|||
<el-input v-model="dataForm.suggestionName" placeholder="建议类别名称" maxlength="50" show-word-limit></el-input> |
|||
</el-form-item> |
|||
|
|||
<el-form-item prop="pid" label="上级分类" class="category-list"> |
|||
<el-popover v-model="categoryListVisible" ref="categoryListPopover" placement="bottom-start" trigger="click"> |
|||
<el-tree :data="categoryList" |
|||
:props="{ label: 'suggestionName', children: 'children' }" |
|||
node-key="id" |
|||
ref="categoryListTree" |
|||
:highlight-current="true" |
|||
:expand-on-click-node="false" |
|||
accordion |
|||
@current-change="categoryListTreeCurrentChangeHandle"> |
|||
</el-tree> |
|||
</el-popover> |
|||
<el-input v-model="dataForm.parentName" v-popover:categoryListPopover :readonly="true" placeholder="上级分类"> |
|||
<i v-if="dataForm.pid !== '0'" slot="suffix" @click.stop="categoryListTreeSetDefaultHandle()" class="el-icon-circle-close el-input__icon"></i> |
|||
</el-input> |
|||
</el-form-item> |
|||
<el-form-item label="排序"> |
|||
<el-input-number v-model="dataForm.sort" :min="0" :max="999999"></el-input-number> |
|||
</el-form-item> |
|||
<el-form-item label="启用标识" prop="enableFlag"> |
|||
<el-select v-model="dataForm.enableFlag" style="width: 100%;"> |
|||
<el-option |
|||
v-for="item in optionEnableFlag" |
|||
:key="item.value" |
|||
:label="item.label" |
|||
:value="item.value"> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-form> |
|||
<template slot="footer"> |
|||
<el-button @click="visible = false">{{ $t('cancel') }}</el-button> |
|||
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script> |
|||
import debounce from 'lodash/debounce' |
|||
export default { |
|||
data () { |
|||
return { |
|||
visible: false, |
|||
dataForm: { |
|||
id: '', |
|||
suggestionName: '', |
|||
parentName: '', |
|||
pid: '', |
|||
pids: '', |
|||
sort: '', |
|||
enableFlag: '1' |
|||
}, |
|||
optionEnableFlag: [ |
|||
{ |
|||
value: '0', |
|||
label: '否' |
|||
}, |
|||
{ |
|||
value: '1', |
|||
label: '是' |
|||
} |
|||
], |
|||
categoryList: [], |
|||
categoryListVisible: false |
|||
} |
|||
}, |
|||
computed: { |
|||
dataRule () { |
|||
return { |
|||
suggestionName: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
pid: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
enableFlag: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
] |
|||
} |
|||
} |
|||
}, |
|||
methods: { |
|||
init () { |
|||
this.visible = true |
|||
this.$nextTick(() => { |
|||
this.$refs['dataForm'].resetFields() |
|||
this.getcategoryList().then(() => { |
|||
this.categoryListTreeSetDefaultHandle() |
|||
if (this.dataForm.id) { |
|||
this.getInfo() |
|||
} else { |
|||
this.dataForm.pid = '0' |
|||
this.dataForm.sort = 0 |
|||
} |
|||
}) |
|||
}) |
|||
}, |
|||
getcategoryList () { |
|||
return this.$http.get('/custom/suggestiontype/list').then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
this.categoryList = res.data |
|||
}).catch(() => { }) |
|||
}, |
|||
// 获取信息 |
|||
getInfo () { |
|||
this.$http.get(`/custom/suggestiontype/${this.dataForm.id}`).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
this.dataForm = { |
|||
...this.dataForm, |
|||
...res.data |
|||
} |
|||
if (this.dataForm.pid === '0') { |
|||
return this.categoryListTreeSetDefaultHandle() |
|||
} |
|||
this.$refs.categoryListTree.setCurrentKey(this.dataForm.pid) |
|||
}).catch(() => {}) |
|||
}, |
|||
categoryListTreeSetDefaultHandle () { |
|||
this.dataForm.pid = '0' |
|||
this.dataForm.pids = '0' |
|||
this.dataForm.parentName = '一级分类' |
|||
}, |
|||
categoryListTreeCurrentChangeHandle (data) { |
|||
this.dataForm.pid = data.id |
|||
this.dataForm.parentName = data.suggestionName |
|||
this.categoryListVisible = false |
|||
}, |
|||
// 表单提交 |
|||
dataFormSubmitHandle: debounce(function () { |
|||
this.$refs['dataForm'].validate((valid) => { |
|||
if (!valid) { |
|||
return false |
|||
} |
|||
this.$http[!this.dataForm.id ? 'post' : 'put']('/custom/suggestiontype/', this.dataForm).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
this.$message({ |
|||
message: this.$t('prompt.success'), |
|||
type: 'success', |
|||
duration: 500, |
|||
onClose: () => { |
|||
this.visible = false |
|||
this.$emit('refreshDataList') |
|||
} |
|||
}) |
|||
}).catch(() => {}) |
|||
}) |
|||
}, 1000, { 'leading': true, 'trailing': false }) |
|||
} |
|||
} |
|||
</script> |
@ -0,0 +1,58 @@ |
|||
<template> |
|||
<el-card shadow="never" class="aui-card--fill"> |
|||
<div class="mod-custom__suggestiontype}"> |
|||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> |
|||
<el-form-item> |
|||
<el-button v-if="$hasPermission('custom:suggestiontype:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-table v-loading="dataListLoading" :data="dataList" border style="width: 100%;"> |
|||
<table-tree-column prop="suggestionName" label="类别名称" header-align="center"></table-tree-column> |
|||
<el-table-column prop="parentName" label="父名称" header-align="center" align="center"></el-table-column> |
|||
<el-table-column prop="sort" label="排序" header-align="center" align="center" width="100"></el-table-column> |
|||
<el-table-column prop="enableFlag" label="是否启用" header-align="center" align="center" width="100" :formatter="enableFormat"></el-table-column> |
|||
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150"> |
|||
<template slot-scope="scope"> |
|||
<el-button v-if="$hasPermission('custom:suggestiontype:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button> |
|||
<el-button v-if="$hasPermission('custom:suggestiontype:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<!-- 弹窗, 新增 / 修改 --> |
|||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update> |
|||
</div> |
|||
</el-card> |
|||
</template> |
|||
|
|||
<script> |
|||
import mixinViewModule from '@/mixins/view-module' |
|||
import TableTreeColumn from '@/components/table-tree-column' |
|||
import AddOrUpdate from './suggestiontype-add-or-update' |
|||
export default { |
|||
mixins: [mixinViewModule], |
|||
data () { |
|||
return { |
|||
mixinViewModuleOptions: { |
|||
getDataListURL: '/custom/suggestiontype/list', |
|||
deleteURL: '/custom/suggestiontype' |
|||
}, |
|||
dataForm: { |
|||
id: '' |
|||
} |
|||
} |
|||
}, |
|||
methods: { |
|||
enableFormat (row, column) { |
|||
if (row.enableFlag === '0') { |
|||
return '否' |
|||
} else if(row.enableFlag === '1'){ |
|||
return '是' |
|||
} |
|||
} |
|||
}, |
|||
components: { |
|||
TableTreeColumn, |
|||
AddOrUpdate |
|||
} |
|||
} |
|||
</script> |
Loading…
Reference in new issue