<template>
|
<div class="query-class-set">
|
<el-dialog title="查询分类设置" :visible.sync="editConfig.visible" :width="dialogWidth" :before-close="handleClose">
|
<el-table :data="tableData" style="width: 100%" :header-cell-style="{ background: '#f4f8fe' }">
|
<el-table-column label="分类名称" prop="className"> </el-table-column>
|
<el-table-column label="操作" width="200px">
|
<template slot-scope="scope">
|
<i class="el-icon-edit common-style first" title="编辑" @click="editClick(scope.$index, scope.row)"></i>
|
<i class="el-icon-document-copy common-style" title="复制" @click="copyClick(scope.$index, scope.row)"></i>
|
<i
|
v-if="scope.$index !== 0 && scope.$index !== tableData.length - 1"
|
class="el-icon-bottom common-style"
|
title="下移"
|
@click="moveDownClick(scope.$index, scope.row)"
|
></i>
|
<i
|
v-if="scope.$index !== 0 && scope.$index !== 1"
|
class="el-icon-top common-style"
|
title="上移"
|
@click="moveUpClick(scope.$index, scope.row)"
|
></i>
|
<i
|
v-if="scope.$index !== 0"
|
class="el-icon-delete common-style"
|
title="删除"
|
@click="deleteClick(scope.$index, scope.row)"
|
></i>
|
</template>
|
</el-table-column>
|
</el-table>
|
<div style="padding: 10px">
|
<el-button type="primary" size="mini">新建分类</el-button>
|
</div>
|
<div slot="footer" class="dialog-footer">
|
<el-button type="primary" size="small" @click="editConfig.visible = false">保存</el-button>
|
<el-button size="small" @click="editConfig.visible = false">取消</el-button>
|
</div>
|
</el-dialog>
|
</div>
|
</template>
|
|
<script>
|
export default {
|
name: "QueryClassSettingDialog",
|
props: {
|
editCommonConfig: {
|
type: Object,
|
default: () => {
|
return {
|
visible: false,
|
infomation: {}
|
}
|
}
|
}
|
},
|
components: {},
|
computed: {},
|
data() {
|
return {
|
dialogWidth: "30%",
|
editConfig: this.editCommonConfig,
|
tableData: [
|
{
|
className: "全部"
|
},
|
{
|
className: "过期未满60天"
|
},
|
{
|
className: "过期未满30天"
|
},
|
{
|
className: "已过期"
|
}
|
]
|
}
|
},
|
created() {},
|
methods: {
|
handleClose() {
|
this.editConfig.visible = false
|
},
|
// 编辑
|
editClick(index, row) {
|
console.log(index, row)
|
},
|
// 复制
|
copyClick() {},
|
// 上移
|
moveUpClick(index) {
|
var that = this
|
if (index > 1) {
|
const upData = that.tableData[index - 1]
|
that.tableData.splice(index - 1, 1)
|
that.tableData.splice(index, 0, upData)
|
}
|
},
|
// 下移
|
moveDownClick(index) {
|
var that = this
|
const downData = that.tableData[index + 1]
|
that.tableData.splice(index + 1, 1)
|
that.tableData.splice(index, 0, downData)
|
},
|
// 删除
|
deleteClick() {}
|
}
|
}
|
</script>
|
|
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
<style lang="scss" scoped>
|
.query-class-set {
|
.common-style {
|
font-size: 16px;
|
margin-left: 10px;
|
cursor: pointer;
|
}
|
.first {
|
margin-left: 0px;
|
}
|
.dialog-footer {
|
background-color: #f5f5f5;
|
height: 55px;
|
line-height: 55px;
|
}
|
}
|
</style>
|