parent
2425f0cc08
commit
28c04093bb
@ -1,7 +0,0 @@
|
|||||||
import DataSetLabelManagement from './src/index.vue'
|
|
||||||
|
|
||||||
DataSetLabelManagement.install = function (Vue) {
|
|
||||||
Vue.component(DataSetLabelManagement.name, DataSetLabelManagement)
|
|
||||||
}
|
|
||||||
|
|
||||||
export default DataSetLabelManagement
|
|
@ -0,0 +1,223 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog
|
||||||
|
class="bs-dialog-wrap bs-el-dialog"
|
||||||
|
:append-to-body="true"
|
||||||
|
:before-close="cancel"
|
||||||
|
:title="dataForm.id!==''?'编辑标签':'新增标签'"
|
||||||
|
:visible.sync="formVisible"
|
||||||
|
>
|
||||||
|
<el-form
|
||||||
|
ref="ruleForm"
|
||||||
|
:model="dataForm"
|
||||||
|
:rules="rules"
|
||||||
|
label-position="right"
|
||||||
|
label-width="90px"
|
||||||
|
class="form-container"
|
||||||
|
>
|
||||||
|
<el-form-item
|
||||||
|
label="标签名称"
|
||||||
|
prop="labelName"
|
||||||
|
>
|
||||||
|
<el-input
|
||||||
|
v-model="dataForm.labelName"
|
||||||
|
class="bs-el-input"
|
||||||
|
clearable
|
||||||
|
placeholder="请输入标签名称"
|
||||||
|
maxlength="200"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item
|
||||||
|
label="标签类型"
|
||||||
|
prop="labelType"
|
||||||
|
>
|
||||||
|
<el-select
|
||||||
|
ref="searchSelect"
|
||||||
|
v-model="dataForm.labelType"
|
||||||
|
class="bs-el-select"
|
||||||
|
popper-class="bs-el-select"
|
||||||
|
allow-create
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
placeholder="请选择或输入标签类型"
|
||||||
|
@blur="selectBlur"
|
||||||
|
@input.native="filterData"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="(item,K) in labelTypeList"
|
||||||
|
:key="K"
|
||||||
|
:label="item"
|
||||||
|
:value="item"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item
|
||||||
|
label="标签说明"
|
||||||
|
prop="labelDesc"
|
||||||
|
>
|
||||||
|
<el-input
|
||||||
|
v-model="dataForm.labelDesc"
|
||||||
|
clearable
|
||||||
|
placeholder="请输入标签说明"
|
||||||
|
class="bs-el-input"
|
||||||
|
type="text"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<span
|
||||||
|
slot="footer"
|
||||||
|
class="dialog-footer"
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
class="bs-el-button-default"
|
||||||
|
@click="cancel"
|
||||||
|
>
|
||||||
|
取消
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
@click="submitForm('ruleForm')"
|
||||||
|
>
|
||||||
|
确定
|
||||||
|
</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { addOrUpdateLabel, checkRepeatLabel } from 'packages/js/utils/LabelConfigService'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'LabelEdit',
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
loading: false,
|
||||||
|
datasetList: [],
|
||||||
|
typeId: '',
|
||||||
|
dataForm: {
|
||||||
|
id: '',
|
||||||
|
labelName: '',
|
||||||
|
labelType: '',
|
||||||
|
labelDesc: '',
|
||||||
|
relList: []
|
||||||
|
},
|
||||||
|
formVisible: true,
|
||||||
|
rules: {
|
||||||
|
labelName: [
|
||||||
|
{ required: true, message: '标签名称不能为空', trigger: 'blur' },
|
||||||
|
{ validator: this.validateLabelName, trigger: 'blur' }
|
||||||
|
],
|
||||||
|
labelType: [
|
||||||
|
{ required: true, message: '标签类型不能为空', trigger: 'change' }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
// 分类树数据
|
||||||
|
categoryData: [],
|
||||||
|
relVisible: false,
|
||||||
|
// 标签分类列表
|
||||||
|
labelTypeList: [],
|
||||||
|
// 选中的数据集id列表
|
||||||
|
datasetIdList: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
'dataForm.labelType': function (val) {
|
||||||
|
if (val.length > 20) {
|
||||||
|
this.dataForm.labelType = val.substring(0, 20)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/**
|
||||||
|
* 初始化
|
||||||
|
* @param row 标签信息
|
||||||
|
*/
|
||||||
|
init (row) {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.ruleForm.clearValidate()
|
||||||
|
})
|
||||||
|
this.dataForm.id = row ? row.id : ''
|
||||||
|
this.formVisible = true
|
||||||
|
if (row) {
|
||||||
|
this.dataForm.id = row.id
|
||||||
|
this.dataForm.labelName = row.labelName
|
||||||
|
this.dataForm.labelType = row.labelType
|
||||||
|
this.dataForm.labelDesc = row.labelDesc
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 标签名称校验
|
||||||
|
* @param rule
|
||||||
|
* @param value
|
||||||
|
* @param callback
|
||||||
|
*/
|
||||||
|
validateLabelName (rule, value, callback) {
|
||||||
|
checkRepeatLabel({ id: this.dataForm.id, labelName: this.dataForm.labelName }).then(repeat => {
|
||||||
|
if (repeat) {
|
||||||
|
callback(new Error('标签名称已存在'))
|
||||||
|
} else {
|
||||||
|
callback()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 表单关闭
|
||||||
|
*/
|
||||||
|
handleClose () {
|
||||||
|
this.$parent.editFormVisible = false
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 取消按钮
|
||||||
|
*/
|
||||||
|
cancel () {
|
||||||
|
this.formVisible = false
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.handleClose()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 提交按钮
|
||||||
|
* @param formName
|
||||||
|
*/
|
||||||
|
submitForm (formName) {
|
||||||
|
this.$refs[formName].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
this.saveForm(true)
|
||||||
|
} else {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 保存标签信息
|
||||||
|
* @param flag
|
||||||
|
*/
|
||||||
|
saveForm (flag) {
|
||||||
|
addOrUpdateLabel(this.dataForm).then((r) => {
|
||||||
|
this.$message.success('保存成功')
|
||||||
|
this.cancel()
|
||||||
|
this.$emit('afterEdit')
|
||||||
|
})
|
||||||
|
},
|
||||||
|
selectBlur (e) {
|
||||||
|
this.dataForm.labelType = e.target.value
|
||||||
|
},
|
||||||
|
// 对输入字符串控制
|
||||||
|
filterData () {
|
||||||
|
// 此属性得到输入的文字
|
||||||
|
const str = this.$refs.searchSelect.$data.selectedLabel
|
||||||
|
// 控制的js
|
||||||
|
if (str.length > 20) {
|
||||||
|
this.$refs.searchSelect.$data.selectedLabel = str.substr(0, 20)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.form-container{
|
||||||
|
padding: 0 8px;
|
||||||
|
}
|
||||||
|
</style>
|
@ -1,167 +0,0 @@
|
|||||||
<template>
|
|
||||||
<el-tree
|
|
||||||
:ref="treeRef"
|
|
||||||
class="bs-el-tree"
|
|
||||||
:data="treeData"
|
|
||||||
:default-expand-all="expandAll"
|
|
||||||
:expand-on-click-node="false"
|
|
||||||
:filter-node-method="filterNode"
|
|
||||||
:highlight-current="true"
|
|
||||||
:indent="0"
|
|
||||||
:props="defaultProps"
|
|
||||||
node-key="id"
|
|
||||||
style="width: fit-content;min-width: 100%;"
|
|
||||||
@node-click="handleNodeClick"
|
|
||||||
@node-contextmenu="rihgtClick"
|
|
||||||
>
|
|
||||||
<span
|
|
||||||
slot-scope="{ node,data }"
|
|
||||||
class="custom-tree-node"
|
|
||||||
style="width: 100%;position: relative;"
|
|
||||||
@mouseenter="mouseEnter(data)"
|
|
||||||
@mouseleave="mouseLeave(data)"
|
|
||||||
>
|
|
||||||
<span :style="data.children && data.children.length ? {} : {'padding-left': '12px'}">
|
|
||||||
<i
|
|
||||||
:class="data.children && data.children.length ? 'el-icon el-icon-folder': 'el-icon el-icon-document'"
|
|
||||||
style="margin-right: 8px;"
|
|
||||||
/>
|
|
||||||
<span class="nodeText">{{ data.name }}</span>
|
|
||||||
</span>
|
|
||||||
<span
|
|
||||||
v-if="optionShow"
|
|
||||||
class="options"
|
|
||||||
>
|
|
||||||
<el-dropdown @command="(command) => { treeCommand(command, data) }">
|
|
||||||
<i class="el-icon-more" />
|
|
||||||
<el-dropdown-menu slot="dropdown">
|
|
||||||
<slot name="options" />
|
|
||||||
</el-dropdown-menu>
|
|
||||||
</el-dropdown>
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
</el-tree>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: 'Tree',
|
|
||||||
props: {
|
|
||||||
treeData: {
|
|
||||||
type: Array,
|
|
||||||
default: () => ([])
|
|
||||||
},
|
|
||||||
treeRef: {
|
|
||||||
type: String,
|
|
||||||
default: 'tree'
|
|
||||||
},
|
|
||||||
nodeWidth: {
|
|
||||||
type: String,
|
|
||||||
default: '280px'
|
|
||||||
},
|
|
||||||
expandAll: {
|
|
||||||
type: Boolean,
|
|
||||||
default: true
|
|
||||||
},
|
|
||||||
filterText: {
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
optionShow: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data () {
|
|
||||||
return {
|
|
||||||
defaultProps: {
|
|
||||||
children: 'children',
|
|
||||||
label: 'name'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
treeData: function (val) {
|
|
||||||
// console.log('valx', val)
|
|
||||||
},
|
|
||||||
filterText (val) {
|
|
||||||
this.$refs[this.treeRef].filter(val)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
treeCommand (command, nodeData) {
|
|
||||||
this.$emit('treeCommand', command, nodeData)
|
|
||||||
},
|
|
||||||
filterNode (value, data) {
|
|
||||||
if (!value) return true
|
|
||||||
return data.name.indexOf(value) !== -1
|
|
||||||
},
|
|
||||||
// 节点点击
|
|
||||||
handleNodeClick (row, value) {
|
|
||||||
this.$emit('handleNodeClick', row, value)
|
|
||||||
},
|
|
||||||
// 节点右键
|
|
||||||
rihgtClick (event, object, value, element) {
|
|
||||||
this.$emit('rihgtClick', event, object, value, element)
|
|
||||||
},
|
|
||||||
mouseEnter (data) {
|
|
||||||
// this.$set(data, 'show', true)
|
|
||||||
// 弹射节点数据
|
|
||||||
this.$emit('mouseEnter', data)
|
|
||||||
},
|
|
||||||
mouseLeave (data) {
|
|
||||||
// this.$set(data, 'show', false)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
::v-deep .el-tree-node {
|
|
||||||
display: block;
|
|
||||||
min-width: 270px;
|
|
||||||
|
|
||||||
.el-tree-node__content {
|
|
||||||
width: 270px;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-tree-node__children {
|
|
||||||
.el-tree-node {
|
|
||||||
display: block;
|
|
||||||
min-width: 270px;
|
|
||||||
|
|
||||||
.el-tree-node__content {
|
|
||||||
width: 270px;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.custom-tree-node {
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
.nodeText {
|
|
||||||
display: inline-block;
|
|
||||||
width: 225px;
|
|
||||||
white-space: nowrap;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
line-height: 14px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.options {
|
|
||||||
position: absolute;
|
|
||||||
right: 30px;
|
|
||||||
height: 16px;
|
|
||||||
top: 2px;
|
|
||||||
line-height: 16px;
|
|
||||||
transform: rotate(90deg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ::v-deep .is-current .options{
|
|
||||||
// background: #fff;
|
|
||||||
// }
|
|
||||||
</style>
|
|
@ -1,311 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="bs-container">
|
|
||||||
<div
|
|
||||||
v-if="labelVisible"
|
|
||||||
class="inner-container"
|
|
||||||
>
|
|
||||||
<el-form
|
|
||||||
ref="queryForm"
|
|
||||||
:model="queryForm"
|
|
||||||
class="filter-container"
|
|
||||||
>
|
|
||||||
<el-form-item
|
|
||||||
class="filter-item"
|
|
||||||
prop="labelName"
|
|
||||||
>
|
|
||||||
<el-input
|
|
||||||
v-model="queryForm.labelName"
|
|
||||||
class="bs-el-input"
|
|
||||||
clearable
|
|
||||||
placeholder="请输入标签名称"
|
|
||||||
@clear="reSearch()"
|
|
||||||
@keyup.enter.native="reSearch()"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item
|
|
||||||
class="filter-item"
|
|
||||||
prop="labelType"
|
|
||||||
>
|
|
||||||
<el-select
|
|
||||||
v-model="queryForm.labelType"
|
|
||||||
clearable
|
|
||||||
filterable
|
|
||||||
class="bs-el-select"
|
|
||||||
popper-class="bs-el-select"
|
|
||||||
placeholder="请选择标签类型"
|
|
||||||
@change="reSearch()"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
key="all"
|
|
||||||
label="全部"
|
|
||||||
value=""
|
|
||||||
/>
|
|
||||||
<el-option
|
|
||||||
v-for="labelType in labelTypeList"
|
|
||||||
:key="labelType"
|
|
||||||
:label="labelType"
|
|
||||||
:value="labelType"
|
|
||||||
>
|
|
||||||
<span>
|
|
||||||
{{ labelType }}
|
|
||||||
</span>
|
|
||||||
<span style="float: right;padding-right: 20px">
|
|
||||||
<el-button
|
|
||||||
class="bs-el-button-default"
|
|
||||||
icon="el-icon-edit"
|
|
||||||
type="text"
|
|
||||||
@click.stop="editLabelType(labelType)"
|
|
||||||
/>
|
|
||||||
<el-button
|
|
||||||
class="bs-el-button-default"
|
|
||||||
icon="el-icon-delete"
|
|
||||||
type="text"
|
|
||||||
@click.stop="deleteLabelType(labelType)"
|
|
||||||
/>
|
|
||||||
</span>
|
|
||||||
</el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item class="filter-item">
|
|
||||||
<el-button
|
|
||||||
:loading="dataListLoading"
|
|
||||||
icon="el-icon-search"
|
|
||||||
type="primary"
|
|
||||||
@click="reSearch"
|
|
||||||
>
|
|
||||||
查询
|
|
||||||
</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item
|
|
||||||
class="filter-item"
|
|
||||||
>
|
|
||||||
<el-button
|
|
||||||
type="primary"
|
|
||||||
class="bs-el-button-default"
|
|
||||||
@click="addOrUpdateLabel(undefined)"
|
|
||||||
>
|
|
||||||
新增
|
|
||||||
</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<div class="bs-table-box">
|
|
||||||
<el-table
|
|
||||||
v-table
|
|
||||||
v-loading="dataListLoading"
|
|
||||||
height="0"
|
|
||||||
:data="tableData"
|
|
||||||
class="bs-el-table bs-scrollbar"
|
|
||||||
:element-loading-text="loadingText"
|
|
||||||
:header-cell-style="sortStyle"
|
|
||||||
@sort-change="reSort"
|
|
||||||
>
|
|
||||||
<el-empty slot="empty" />
|
|
||||||
<el-table-column
|
|
||||||
label="标签名称"
|
|
||||||
prop="labelName"
|
|
||||||
show-overflow-tooltip
|
|
||||||
/>
|
|
||||||
<el-table-column
|
|
||||||
label="标签类型"
|
|
||||||
prop="labelType"
|
|
||||||
show-overflow-tooltip
|
|
||||||
/>
|
|
||||||
<el-table-column
|
|
||||||
label="标签说明"
|
|
||||||
prop="labelDesc"
|
|
||||||
show-overflow-tooltip
|
|
||||||
/>
|
|
||||||
<el-table-column
|
|
||||||
align="center"
|
|
||||||
label="操作"
|
|
||||||
width="200"
|
|
||||||
>
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-button
|
|
||||||
class="bs-el-button-default"
|
|
||||||
@click="getDetail(scope.row)"
|
|
||||||
>
|
|
||||||
详情
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
|
||||||
class="bs-el-button-default"
|
|
||||||
@click="addOrUpdateLabel(scope.row)"
|
|
||||||
>
|
|
||||||
编辑
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
|
||||||
class="bs-el-button-default"
|
|
||||||
@click="handleDelete(scope.row.id)"
|
|
||||||
>
|
|
||||||
删除
|
|
||||||
</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
</div>
|
|
||||||
<div class="bs-pagination">
|
|
||||||
<el-pagination
|
|
||||||
class="bs-el-pagination"
|
|
||||||
popper-class="bs-el-pagination"
|
|
||||||
:current-page="current"
|
|
||||||
:next-text="nextText"
|
|
||||||
:page-size="size"
|
|
||||||
:page-sizes="[10, 20, 50, 100]"
|
|
||||||
:prev-text="prevText"
|
|
||||||
:total="totalCount"
|
|
||||||
background
|
|
||||||
layout="total, prev, pager, next, sizes"
|
|
||||||
@size-change="sizeChangeHandle"
|
|
||||||
@current-change="currentChangeHandle"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<label-config-add-or-update
|
|
||||||
v-if="addOrUpdateVisible"
|
|
||||||
ref="LabelConfigAddOrUpdate"
|
|
||||||
/>
|
|
||||||
<label-type-edit
|
|
||||||
v-if="labelTypeEditVisible"
|
|
||||||
ref="LabelTypeEdit"
|
|
||||||
/>
|
|
||||||
<label-config-details
|
|
||||||
ref="LabelConfigDetails"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import table from 'packages/js/utils/table.js'
|
|
||||||
import { pageMixins } from 'packages/js/mixins/page'
|
|
||||||
import LabelConfigAddOrUpdate from './LabelConfigAddOrUpdate.vue'
|
|
||||||
import LabelConfigDetails from './LabelConfigDetails.vue'
|
|
||||||
import LabelTypeEdit from './LabelTypeEdit.vue'
|
|
||||||
import { getLabelType, labelList, removeLabel, removeLabelByType } from 'packages/js/utils/LabelConfigService'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'LabelConfig',
|
|
||||||
directives: {
|
|
||||||
table // 注册自定义指令
|
|
||||||
},
|
|
||||||
mixins: [pageMixins],
|
|
||||||
components: {
|
|
||||||
LabelConfigDetails,
|
|
||||||
LabelConfigAddOrUpdate,
|
|
||||||
LabelTypeEdit
|
|
||||||
},
|
|
||||||
data () {
|
|
||||||
return {
|
|
||||||
tableData: [],
|
|
||||||
addOrUpdateVisible: false,
|
|
||||||
addOrUpdateDetailVisible: false,
|
|
||||||
labelTypeEditVisible: false,
|
|
||||||
labelVisible: true,
|
|
||||||
labelTypeList: [],
|
|
||||||
dataListLoading: false,
|
|
||||||
loadingText: '',
|
|
||||||
queryForm: {
|
|
||||||
labelName: '',
|
|
||||||
labelType: ''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {},
|
|
||||||
mounted () {
|
|
||||||
this.getDataList()
|
|
||||||
this.getLabelType()
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
deleteLabelType (labelType) {
|
|
||||||
this.$confirm('是否删除当前标签类型? ', '提示', {
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
cancelButtonText: '取消',
|
|
||||||
type: 'warning'
|
|
||||||
}).then(() => {
|
|
||||||
removeLabelByType({ labelType: labelType }).then(() => {
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.reSearch()
|
|
||||||
this.getLabelType()
|
|
||||||
this.$message.success('删除成功')
|
|
||||||
})
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
editLabelType (labelType) {
|
|
||||||
this.labelTypeEditVisible = true
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs.LabelTypeEdit.dialogFormVisible = true
|
|
||||||
this.$refs.LabelTypeEdit.init(labelType)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
handleDelete (id) {
|
|
||||||
this.$confirm('确定删除当前标签吗?', '提示', {
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
cancelButtonText: '取消',
|
|
||||||
type: 'warning'
|
|
||||||
}).then(() => {
|
|
||||||
removeLabel(id).then(() => {
|
|
||||||
this.getDataList()
|
|
||||||
this.$message.success('删除成功')
|
|
||||||
})
|
|
||||||
}).catch(() => {
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 新增/编辑
|
|
||||||
addOrUpdateLabel (row) {
|
|
||||||
this.addOrUpdateVisible = true
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs.LabelConfigAddOrUpdate.labelTypeList = this.labelTypeList
|
|
||||||
this.$refs.LabelConfigAddOrUpdate.init(row)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 查看详情
|
|
||||||
getDetail (row) {
|
|
||||||
this.addOrUpdateDetailVisible = true
|
|
||||||
this.labelVisible = false
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs.LabelConfigDetails.init(row)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 获取标签列表
|
|
||||||
getLabelType () {
|
|
||||||
getLabelType().then((data) => {
|
|
||||||
this.labelTypeList = data
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 获取列表方法
|
|
||||||
getDataList () {
|
|
||||||
this.dataListLoading = true
|
|
||||||
this.loadingText = '正在查询数据...'
|
|
||||||
const params = {
|
|
||||||
current: this.current,
|
|
||||||
size: this.size,
|
|
||||||
...this.queryForm
|
|
||||||
}
|
|
||||||
labelList(params).then((data) => {
|
|
||||||
this.totalCount = data.totalCount
|
|
||||||
this.tableData = data.list
|
|
||||||
this.dataListLoading = false
|
|
||||||
}).catch(() => {
|
|
||||||
this.dataListLoading = false
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 查询事件
|
|
||||||
reSearch () {
|
|
||||||
// 从第一页
|
|
||||||
this.current = 1
|
|
||||||
this.getDataList()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
@import '../../assets/style/bsTheme.scss';
|
|
||||||
|
|
||||||
.bs-pagination {
|
|
||||||
::v-deep .el-input__inner {
|
|
||||||
width: 110px !important;
|
|
||||||
border: none;
|
|
||||||
background: var(--bs-el-background-1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
Loading…
Reference in New Issue