feat(标签): 标签添加是否显示字段

dev
zjb 7 months ago
parent a0eb4f0e3a
commit e4bad6aa88

@ -18,8 +18,8 @@ module.exports = {
proxyTable: {
"/": {
// target: 'http://39.103.180.196:9011', // 接口域名
// target: "http://localhost:9011", // 接口域名
target: "http://testapi.indie.cn:9012", // 接口域名
target: "http://localhost:9011", // 接口域名
// target: "http://testapi.indie.cn:9012", // 接口域名
changeOrigin: true, //是否跨域
pathRewrite: {
"^/": "/" //需要rewrite重写的,

@ -70,6 +70,18 @@ export default {
method: "put"
});
},
/**
* 更新标签是否显示
* @param {*} id
* @param {*} show
* @returns
*/
updateShow(id, show) {
return request({
url: `/luoo-tag/tag/show/${id}?show=${show}`,
method: "put"
});
},
/**
* 删除标签
* @param {*} params

@ -164,6 +164,19 @@
></el-switch>
</template>
</el-table-column>
<el-table-column fixed="right" label="是否显示" width="100">
<template slot-scope="scope">
<el-switch
style="margin-bottom: 4px;"
v-model="scope.row.isShow"
active-color="#13ce66"
@change="handleTableRowShowChange($event, scope.row)"
:active-value="1"
:inactive-value="0"
size="mini"
></el-switch>
</template>
</el-table-column>
<el-table-column
fixed="right"
label="操作"
@ -621,6 +634,20 @@ export default {
this.fetchData(this.queryForm.lastQuery);
});
},
/**
* 表格内显示滑块切换事件
*/
handleTableRowShowChange($event, row) {
tagApi.updateShow(row.id, $event).then(res => {
if (res.code === 200) {
this.$message.success(res.message);
} else {
this.$message.error(res.message);
}
this.fetchData(this.queryForm.lastQuery);
});
},
/**
* 弹窗取消按扭点击事件
*/

Loading…
Cancel
Save