card上边的边距及标题文字颜色
This commit is contained in:
@ -1,5 +1,291 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div class="app-container">
|
||||||
解读
|
<el-card shadow="never">
|
||||||
|
<div>
|
||||||
|
<i class="el-icon-search"></i>
|
||||||
|
<span>筛选搜索</span>
|
||||||
|
<div style="float:right">
|
||||||
|
<el-button type="primary" @click="handleSearchList" size="small">
|
||||||
|
查询
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="margin-top: 15px">
|
||||||
|
<el-form
|
||||||
|
size="small"
|
||||||
|
:model="queryParams"
|
||||||
|
ref="queryForm"
|
||||||
|
:inline="true"
|
||||||
|
@submit.native.prevent
|
||||||
|
>
|
||||||
|
<el-form-item label="政策标题">
|
||||||
|
<el-input v-model="queryParams.title" placeholder="请输入" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
<el-card class="operate-container" shadow="never">
|
||||||
|
<i class="el-icon-tickets"></i>
|
||||||
|
<span>数据列表</span>
|
||||||
|
<el-button class="btn-add" @click="handleAdd" size="mini">
|
||||||
|
添加分类
|
||||||
|
</el-button>
|
||||||
|
</el-card>
|
||||||
|
<el-table style="width: 100%" class="table-container" :data="categoryList">
|
||||||
|
<el-table-column
|
||||||
|
label="序号"
|
||||||
|
align="center"
|
||||||
|
type="index"
|
||||||
|
></el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="标签分类"
|
||||||
|
prop="name"
|
||||||
|
align="center"
|
||||||
|
></el-table-column>
|
||||||
|
<el-table-column label="标签" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
plain
|
||||||
|
:disabled="scope.row.name == '类型' ? true : false"
|
||||||
|
size="mini"
|
||||||
|
@click="handleAddTag(scope.row.id)"
|
||||||
|
>添加标签</el-button
|
||||||
|
>
|
||||||
|
<el-button plain size="mini" @click="handleLook(scope.row.id)"
|
||||||
|
>查看标签</el-button
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
@click="editDialog(scope.row)"
|
||||||
|
type="text"
|
||||||
|
size="small"
|
||||||
|
:disabled="scope.row.name == '类型' ? true : false"
|
||||||
|
>编辑</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
@click="handleDelete(scope.row.id)"
|
||||||
|
:disabled="scope.row.name == '类型' ? true : false"
|
||||||
|
type="text"
|
||||||
|
size="small"
|
||||||
|
>删除</el-button
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<!-- 添加修改 -->
|
||||||
|
<el-dialog :title="str" :visible.sync="addDialog" width="500px">
|
||||||
|
<el-form :model="form" ref="form" :rules="rules" @submit.native.prevent>
|
||||||
|
<el-form-item label="名称" prop="name" label-width="80px">
|
||||||
|
<el-input v-model="form.name"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="addDialog = false">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
<!-- 查看可删除 -->
|
||||||
|
<el-dialog title="查看标签" :visible.sync="lookDialog" width="300px">
|
||||||
|
<div v-for="(tag, index) in tagList" :key="tag.id">
|
||||||
|
<el-input
|
||||||
|
style="margin-top:10px;"
|
||||||
|
v-if="editable[index]"
|
||||||
|
v-model="tag.name"
|
||||||
|
:ref="'editableInput' + index"
|
||||||
|
size="small"
|
||||||
|
placeholder="请输入标签信息"
|
||||||
|
@keyup.enter.native="handleEditableInputConfirm(tag, index)"
|
||||||
|
@change="handleEditableInputConfirm(tag, index)"
|
||||||
|
@blur="handleEditableInputBlur(tag, index)"
|
||||||
|
show-word-limit
|
||||||
|
></el-input>
|
||||||
|
<div v-else>
|
||||||
|
<span style="margin-right:10px">{{ index + 1 }}</span>
|
||||||
|
<el-tag
|
||||||
|
style="margin-top:10px;"
|
||||||
|
@click="showEditTagInput(index)"
|
||||||
|
closable
|
||||||
|
@close="handleClose(tag.id, index)"
|
||||||
|
>{{ tag.name }}</el-tag
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- <el-tag
|
||||||
|
v-for="(tag,index) in tagList"
|
||||||
|
:key="tag.id"
|
||||||
|
closable
|
||||||
|
@click="showEditTagInput(index)"
|
||||||
|
@close="closeTag(tag, index)"
|
||||||
|
>
|
||||||
|
{{tag.name}}
|
||||||
|
</el-tag> -->
|
||||||
|
<!-- <div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="lookDialog = false">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="handleTag">确 定</el-button>
|
||||||
|
</div> -->
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
getCategory,
|
||||||
|
addCategory,
|
||||||
|
addLabel,
|
||||||
|
getLabel,
|
||||||
|
update,
|
||||||
|
del
|
||||||
|
} from '@/api/policy/tag';
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 100
|
||||||
|
},
|
||||||
|
// total:0,
|
||||||
|
categoryList: [],
|
||||||
|
form: {
|
||||||
|
name: ''
|
||||||
|
},
|
||||||
|
addDialog: false,
|
||||||
|
lookDialog: false,
|
||||||
|
tagList: [],
|
||||||
|
// 当前行
|
||||||
|
rowId: null,
|
||||||
|
// 弹出层标题
|
||||||
|
str: '',
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
name: [{ required: true, message: '名称不能为空', trigger: 'blur' }]
|
||||||
|
},
|
||||||
|
editable: []
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getList() {
|
||||||
|
getCategory(this.queryParams).then(({ data }) => {
|
||||||
|
this.categoryList = data.list;
|
||||||
|
// this.total = data.total
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
handleAdd() {
|
||||||
|
this.reset();
|
||||||
|
this.addDialog = true;
|
||||||
|
this.str = '添加标签分类';
|
||||||
|
},
|
||||||
|
handleAddTag(id) {
|
||||||
|
this.handleAdd();
|
||||||
|
this.str = '添加标签';
|
||||||
|
this.rowId = id;
|
||||||
|
},
|
||||||
|
/** 表单重置 */
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
name: ''
|
||||||
|
};
|
||||||
|
this.resetForm('form');
|
||||||
|
},
|
||||||
|
/** 提交表单 */
|
||||||
|
submitForm() {
|
||||||
|
this.$refs['form'].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.str === '添加标签分类') {
|
||||||
|
addCategory(this.form).then(({ message }) => {
|
||||||
|
this.msgSuccess(message);
|
||||||
|
this.addDialog = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
} else if (this.str === '添加标签') {
|
||||||
|
addLabel(Object.assign({}, { id: this.rowId }, this.form)).then(
|
||||||
|
({ message }) => {
|
||||||
|
this.msgSuccess(message);
|
||||||
|
this.addDialog = false;
|
||||||
|
this.getList();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
update(this.form).then(({ message }) => {
|
||||||
|
this.msgSuccess(message);
|
||||||
|
this.addDialog = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
// addLabel(Object.assign({},{id:this.rowId},this.form)).then(({message}) => {
|
||||||
|
// this.msgSuccess(message);
|
||||||
|
// this.addDialog = false;
|
||||||
|
// this.getList();
|
||||||
|
// });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 查看标签 */
|
||||||
|
handleLook(id) {
|
||||||
|
this.lookDialog = true;
|
||||||
|
getLabel(Object.assign({}, { id }, this.queryParams)).then(({ data }) => {
|
||||||
|
this.tagList = data.list;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 编辑 input发生改变
|
||||||
|
handleEditableInputConfirm(item, index) {
|
||||||
|
if (item.name) {
|
||||||
|
// 把当前修改的发送
|
||||||
|
update(item).then(res => {
|
||||||
|
this.$set(this.editable, index, false);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.$message({ message: '请输入标签信息', type: 'info' });
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//编辑 input失去焦点
|
||||||
|
handleEditableInputBlur(item, index) {
|
||||||
|
this.handleEditableInputConfirm(item, index);
|
||||||
|
},
|
||||||
|
// 编辑 input显示
|
||||||
|
showEditTagInput(index) {
|
||||||
|
this.$set(this.editable, index, true);
|
||||||
|
this.$nextTick(_ => {
|
||||||
|
let editableInput = 'editableInput' + index;
|
||||||
|
this.$refs[editableInput][0].$refs.input.focus();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleClose(id, i) {
|
||||||
|
del({ id }).then(res => {
|
||||||
|
this.tagList.splice(i, 1);
|
||||||
|
});
|
||||||
|
// this.tagList.splice(this.tagList.indexOf(id), 1);
|
||||||
|
},
|
||||||
|
editDialog(row) {
|
||||||
|
this.form = Object.assign({}, row);
|
||||||
|
this.addDialog = true;
|
||||||
|
this.str = '修改标签分类';
|
||||||
|
},
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete(id) {
|
||||||
|
this.$confirm('确认删除该分类?', '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
})
|
||||||
|
.then(function() {
|
||||||
|
return del({ id });
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.msgSuccess('删除成功');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
// .el-tag + .el-tag {
|
||||||
|
// margin-left: 10px;
|
||||||
|
// }
|
||||||
|
</style>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-card class="operate-container" shadow="never">
|
<el-card shadow="never">
|
||||||
<div>
|
<div>
|
||||||
<i class="el-icon-search"></i>
|
<i class="el-icon-search"></i>
|
||||||
<span>筛选搜索</span>
|
<span>筛选搜索</span>
|
||||||
@ -22,7 +22,6 @@
|
|||||||
v-model="queryParams.title"
|
v-model="queryParams.title"
|
||||||
placeholder="请输入"
|
placeholder="请输入"
|
||||||
clearable
|
clearable
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="产出">
|
<el-form-item label="产出">
|
||||||
@ -102,7 +101,13 @@
|
|||||||
}}
|
}}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="政策标题" align="center" prop="title" />
|
<el-table-column label="政策标题" align="center" prop="title">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-link type="primary" :underline="false">{{
|
||||||
|
scope.row.title
|
||||||
|
}}</el-link>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="级别" align="center" prop="level" width="150">
|
<el-table-column label="级别" align="center" prop="level" width="150">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span v-if="scope.row.level == 1">省级</span>
|
<span v-if="scope.row.level == 1">省级</span>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-card class="operate-container" shadow="never">
|
<el-card shadow="never">
|
||||||
<i class="el-icon-tickets"></i>
|
<i class="el-icon-tickets"></i>
|
||||||
<span>数据列表</span>
|
<span>数据列表</span>
|
||||||
<el-button class="btn-add" @click="handleAdd" size="mini">
|
<el-button class="btn-add" @click="handleAdd" size="mini">
|
||||||
@ -8,28 +8,42 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
</el-card>
|
</el-card>
|
||||||
<el-table style="width: 100%" class="table-container" :data="categoryList">
|
<el-table style="width: 100%" class="table-container" :data="categoryList">
|
||||||
<el-table-column label="序号" align="center" type="index"></el-table-column>
|
<el-table-column
|
||||||
|
label="序号"
|
||||||
|
align="center"
|
||||||
|
type="index"
|
||||||
|
></el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="标签分类"
|
label="标签分类"
|
||||||
prop="name"
|
prop="name"
|
||||||
align="center"
|
align="center"
|
||||||
></el-table-column>
|
></el-table-column>
|
||||||
<el-table-column
|
<el-table-column label="标签" align="center">
|
||||||
label="标签"
|
<template slot-scope="scope">
|
||||||
align="center"
|
<el-button
|
||||||
>
|
plain
|
||||||
<template slot-scope="scope">
|
:disabled="scope.row.name == '类型' ? true : false"
|
||||||
<el-button plain :disabled="scope.row.name=='类型'?true:false" size="mini" @click="handleAddTag(scope.row.id)">添加标签</el-button>
|
size="mini"
|
||||||
<el-button plain size="mini" @click="handleLook(scope.row.id)">查看标签</el-button>
|
@click="handleAddTag(scope.row.id)"
|
||||||
</template>
|
>添加标签</el-button
|
||||||
|
>
|
||||||
|
<el-button plain size="mini" @click="handleLook(scope.row.id)"
|
||||||
|
>查看标签</el-button
|
||||||
|
>
|
||||||
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" align="center">
|
<el-table-column label="操作" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button @click="editDialog(scope.row)" type="text" size="small" :disabled="scope.row.name=='类型'?true:false"
|
<el-button
|
||||||
|
@click="editDialog(scope.row)"
|
||||||
|
type="text"
|
||||||
|
size="small"
|
||||||
|
:disabled="scope.row.name == '类型' ? true : false"
|
||||||
>编辑</el-button
|
>编辑</el-button
|
||||||
>
|
>
|
||||||
<el-button
|
<el-button
|
||||||
@click="handleDelete(scope.row.id)" :disabled="scope.row.name=='类型'?true:false"
|
@click="handleDelete(scope.row.id)"
|
||||||
|
:disabled="scope.row.name == '类型' ? true : false"
|
||||||
type="text"
|
type="text"
|
||||||
size="small"
|
size="small"
|
||||||
>删除</el-button
|
>删除</el-button
|
||||||
@ -52,20 +66,20 @@
|
|||||||
<!-- 查看可删除 -->
|
<!-- 查看可删除 -->
|
||||||
<el-dialog title="查看标签" :visible.sync="lookDialog" width="300px">
|
<el-dialog title="查看标签" :visible.sync="lookDialog" width="300px">
|
||||||
<div v-for="(tag, index) in tagList" :key="tag.id">
|
<div v-for="(tag, index) in tagList" :key="tag.id">
|
||||||
<el-input
|
<el-input
|
||||||
style="margin-top:10px;"
|
style="margin-top:10px;"
|
||||||
v-if="editable[index]"
|
v-if="editable[index]"
|
||||||
v-model="tag.name"
|
v-model="tag.name"
|
||||||
:ref="'editableInput' + index"
|
:ref="'editableInput' + index"
|
||||||
size="small"
|
size="small"
|
||||||
placeholder="请输入标签信息"
|
placeholder="请输入标签信息"
|
||||||
@keyup.enter.native="handleEditableInputConfirm(tag, index)"
|
@keyup.enter.native="handleEditableInputConfirm(tag, index)"
|
||||||
@change="handleEditableInputConfirm(tag, index)"
|
@change="handleEditableInputConfirm(tag, index)"
|
||||||
@blur="handleEditableInputBlur(tag, index)"
|
@blur="handleEditableInputBlur(tag, index)"
|
||||||
show-word-limit
|
show-word-limit
|
||||||
></el-input>
|
></el-input>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<span style="margin-right:10px">{{index+1}}</span>
|
<span style="margin-right:10px">{{ index + 1 }}</span>
|
||||||
<el-tag
|
<el-tag
|
||||||
style="margin-top:10px;"
|
style="margin-top:10px;"
|
||||||
@click="showEditTagInput(index)"
|
@click="showEditTagInput(index)"
|
||||||
@ -73,8 +87,8 @@
|
|||||||
@close="handleClose(tag.id, index)"
|
@close="handleClose(tag.id, index)"
|
||||||
>{{ tag.name }}</el-tag
|
>{{ tag.name }}</el-tag
|
||||||
>
|
>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<!-- <el-tag
|
<!-- <el-tag
|
||||||
v-for="(tag,index) in tagList"
|
v-for="(tag,index) in tagList"
|
||||||
:key="tag.id"
|
:key="tag.id"
|
||||||
@ -92,7 +106,14 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { getCategory,addCategory,addLabel,getLabel,update,del } from '@/api/policy/tag';
|
import {
|
||||||
|
getCategory,
|
||||||
|
addCategory,
|
||||||
|
addLabel,
|
||||||
|
getLabel,
|
||||||
|
update,
|
||||||
|
del
|
||||||
|
} from '@/api/policy/tag';
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -101,30 +122,28 @@ export default {
|
|||||||
pageSize: 100
|
pageSize: 100
|
||||||
},
|
},
|
||||||
// total:0,
|
// total:0,
|
||||||
categoryList:[],
|
categoryList: [],
|
||||||
form: {
|
form: {
|
||||||
name: '',
|
name: ''
|
||||||
},
|
},
|
||||||
addDialog: false,
|
addDialog: false,
|
||||||
lookDialog:false,
|
lookDialog: false,
|
||||||
tagList:[],
|
tagList: [],
|
||||||
// 当前行
|
// 当前行
|
||||||
rowId:null,
|
rowId: null,
|
||||||
// 弹出层标题
|
// 弹出层标题
|
||||||
str: "",
|
str: '',
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
name: [
|
name: [{ required: true, message: '名称不能为空', trigger: 'blur' }]
|
||||||
{ required: true, message: "名称不能为空", trigger: "blur" }
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
editable: [],
|
editable: []
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods:{
|
methods: {
|
||||||
getList(){
|
getList() {
|
||||||
getCategory(this.queryParams).then(({data}) => {
|
getCategory(this.queryParams).then(({ data }) => {
|
||||||
this.categoryList = data.list
|
this.categoryList = data.list;
|
||||||
// this.total = data.total
|
// this.total = data.total
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -132,42 +151,44 @@ export default {
|
|||||||
handleAdd() {
|
handleAdd() {
|
||||||
this.reset();
|
this.reset();
|
||||||
this.addDialog = true;
|
this.addDialog = true;
|
||||||
this.str = "添加标签分类";
|
this.str = '添加标签分类';
|
||||||
},
|
},
|
||||||
handleAddTag(id){
|
handleAddTag(id) {
|
||||||
this.handleAdd()
|
this.handleAdd();
|
||||||
this.str = "添加标签";
|
this.str = '添加标签';
|
||||||
this.rowId = id
|
this.rowId = id;
|
||||||
},
|
},
|
||||||
/** 表单重置 */
|
/** 表单重置 */
|
||||||
reset() {
|
reset() {
|
||||||
this.form = {
|
this.form = {
|
||||||
name: '',
|
name: ''
|
||||||
};
|
};
|
||||||
this.resetForm("form");
|
this.resetForm('form');
|
||||||
},
|
},
|
||||||
/** 提交表单 */
|
/** 提交表单 */
|
||||||
submitForm(){
|
submitForm() {
|
||||||
this.$refs["form"].validate(valid => {
|
this.$refs['form'].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (this.str === '添加标签分类') {
|
if (this.str === '添加标签分类') {
|
||||||
addCategory(this.form).then(({message}) => {
|
addCategory(this.form).then(({ message }) => {
|
||||||
this.msgSuccess(message);
|
this.msgSuccess(message);
|
||||||
this.addDialog = false;
|
this.addDialog = false;
|
||||||
this.getList();
|
this.getList();
|
||||||
});
|
});
|
||||||
} else if((this.str === '添加标签')) {
|
} else if (this.str === '添加标签') {
|
||||||
addLabel(Object.assign({},{id:this.rowId},this.form)).then(({message}) => {
|
addLabel(Object.assign({}, { id: this.rowId }, this.form)).then(
|
||||||
|
({ message }) => {
|
||||||
|
this.msgSuccess(message);
|
||||||
|
this.addDialog = false;
|
||||||
|
this.getList();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
update(this.form).then(({ message }) => {
|
||||||
this.msgSuccess(message);
|
this.msgSuccess(message);
|
||||||
this.addDialog = false;
|
this.addDialog = false;
|
||||||
this.getList();
|
this.getList();
|
||||||
});
|
});
|
||||||
}else{
|
|
||||||
update(this.form).then(({message})=>{
|
|
||||||
this.msgSuccess(message);
|
|
||||||
this.addDialog = false;
|
|
||||||
this.getList()
|
|
||||||
})
|
|
||||||
// addLabel(Object.assign({},{id:this.rowId},this.form)).then(({message}) => {
|
// addLabel(Object.assign({},{id:this.rowId},this.form)).then(({message}) => {
|
||||||
// this.msgSuccess(message);
|
// this.msgSuccess(message);
|
||||||
// this.addDialog = false;
|
// this.addDialog = false;
|
||||||
@ -178,67 +199,69 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
/** 查看标签 */
|
/** 查看标签 */
|
||||||
handleLook(id){
|
handleLook(id) {
|
||||||
this.lookDialog = true
|
this.lookDialog = true;
|
||||||
getLabel(Object.assign({},{id},this.queryParams)).then(({data})=>{
|
getLabel(Object.assign({}, { id }, this.queryParams)).then(({ data }) => {
|
||||||
this.tagList = data.list
|
this.tagList = data.list;
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
// 编辑 input发生改变
|
// 编辑 input发生改变
|
||||||
handleEditableInputConfirm(item, index){
|
handleEditableInputConfirm(item, index) {
|
||||||
if (item.name) {
|
if (item.name) {
|
||||||
// 把当前修改的发送
|
// 把当前修改的发送
|
||||||
update(item).then(res=>{
|
update(item).then(res => {
|
||||||
this.$set(this.editable, index, false);
|
this.$set(this.editable, index, false);
|
||||||
})
|
});
|
||||||
} else {
|
} else {
|
||||||
this.$message({ message: "请输入标签信息", type: "info" });
|
this.$message({ message: '请输入标签信息', type: 'info' });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
//编辑 input失去焦点
|
//编辑 input失去焦点
|
||||||
handleEditableInputBlur(item, index){
|
handleEditableInputBlur(item, index) {
|
||||||
this.handleEditableInputConfirm(item, index)
|
this.handleEditableInputConfirm(item, index);
|
||||||
},
|
},
|
||||||
// 编辑 input显示
|
// 编辑 input显示
|
||||||
showEditTagInput(index){
|
showEditTagInput(index) {
|
||||||
this.$set(this.editable, index, true);
|
this.$set(this.editable, index, true);
|
||||||
this.$nextTick((_) => {
|
this.$nextTick(_ => {
|
||||||
let editableInput = "editableInput" + index;
|
let editableInput = 'editableInput' + index;
|
||||||
this.$refs[editableInput][0].$refs.input.focus();
|
this.$refs[editableInput][0].$refs.input.focus();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleClose(id,i){
|
handleClose(id, i) {
|
||||||
del({id}).then(res=>{
|
del({ id }).then(res => {
|
||||||
this.tagList.splice(i,1);
|
this.tagList.splice(i, 1);
|
||||||
})
|
});
|
||||||
// this.tagList.splice(this.tagList.indexOf(id), 1);
|
// this.tagList.splice(this.tagList.indexOf(id), 1);
|
||||||
},
|
},
|
||||||
editDialog(row){
|
editDialog(row) {
|
||||||
this.form = Object.assign({}, row);
|
this.form = Object.assign({}, row);
|
||||||
this.addDialog = true;
|
this.addDialog = true;
|
||||||
this.str = "修改标签分类";
|
this.str = '修改标签分类';
|
||||||
},
|
},
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(id) {
|
handleDelete(id) {
|
||||||
this.$confirm('确认删除该分类?', "提示", {
|
this.$confirm('确认删除该分类?', '提示', {
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: "取消",
|
cancelButtonText: '取消',
|
||||||
type: "warning"
|
type: 'warning'
|
||||||
}).then(function() {
|
})
|
||||||
return del({id});
|
.then(function() {
|
||||||
}).then(() => {
|
return del({ id });
|
||||||
this.getList();
|
|
||||||
this.msgSuccess("删除成功");
|
|
||||||
})
|
})
|
||||||
},
|
.then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.msgSuccess('删除成功');
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList()
|
this.getList();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
// .el-tag + .el-tag {
|
// .el-tag + .el-tag {
|
||||||
// margin-left: 10px;
|
// margin-left: 10px;
|
||||||
// }
|
// }
|
||||||
</style>
|
</style>
|
||||||
|
Reference in New Issue
Block a user