zx 2 years ago
parent 2cfefe3775
commit f186542b55

@ -86,15 +86,6 @@ const routes = [
},
]
},
{
path: '/starwayInfo',
name: "StarwayInfo",
component: () => import("@/views/StarwayInfo/index.vue"),
meta: {
title: '星途动态',
keepAlive: true
}
},
{
path: '/actRelease',
name: "ActRelease",

@ -3,6 +3,7 @@
<el-tabs v-model="form.status" @tab-change="statusChange">
<el-tab-pane label="任务标签" :name="1"></el-tab-pane>
<el-tab-pane label="车系" :name="2"></el-tab-pane>
<el-tab-pane label="话术词条" :name="3"></el-tab-pane>
</el-tabs>
<div class="button-tab">
<el-popover v-model:visible="visible" placement="bottom" :width="180">
@ -11,10 +12,11 @@
<el-form-item style="width:80%">
<el-input v-if="index == 1" v-model="signForm.title" placeholder="请输入标签名"></el-input>
<el-input v-else-if="index == 2" v-model="brandForm.name" placeholder="请输入车系名"></el-input>
<el-input v-else-if="index == 3" v-model="reasonForm.title" placeholder="请输入话术"></el-input>
</el-form-item>
<el-form-item>
<el-button @click="addConfirm" type="primary">确定</el-button>
<el-button @click="visible = false;signForm.title='';brandForm.name=''">取消</el-button>
<el-button @click="visible = false;signForm.title='';brandForm.name='';reasonForm.bane=''">取消</el-button>
</el-form-item>
</el-form>
<template #reference>
@ -56,6 +58,21 @@
</template>
</el-table-column>
</el-table>
<el-table v-else-if="index == 3" :data="tableData.data" size="default" border :header-cell-style="{background: '#EEE'}">
<el-table-column prop="title" label="话术内容" width="360"></el-table-column>
<el-table-column prop="sortWeight" label="排序">
<template #default="scope">
<el-input v-model="sortValue" @change="handlerChangeSort(value)" style="width: 120px" v-if="isEditing && scope.row.id == activeId"></el-input>
<span v-else>{{scope.row.sortWeight}}</span>
<el-icon @click="handlerSortEdit(scope.row)"><Edit /></el-icon>
</template>
</el-table-column>
<el-table-column prop="action" label="操作" fixed="right" width="240">
<template #default="scope">
<el-link type="danger" @click="singleDel(scope.row.id)"></el-link>
</template>
</el-table-column>
</el-table>
<el-pagination
v-model:currentPage="pagination.current"
v-model:page-size="pagination.pageSize"
@ -83,6 +100,9 @@ export default defineComponent({
const brandForm = reactive({
name: '',
});
const reasonForm = reactive({
title: '',
})
const tableData = reactive({
data: [],
});
@ -98,7 +118,7 @@ export default defineComponent({
const index = ref(1);
const visible = ref(false);
return {
form,proxy,visible,signForm,brandForm,
form,proxy,visible,signForm,brandForm,reasonForm,
index,tableData,pagination,
isEditing,activeId,sortValue,
statusFormatter
@ -137,7 +157,18 @@ export default defineComponent({
this.$message.error(res.msg)
}
}).catch(() => {});
}
} else if (this.index == 3) {
let obj = Object.assign({pageNum: this.pagination.current,pageSize: this.pagination.pageSize})
this.proxy.$post("/commonWords/list", obj).then(res => {
if(res.code == 200) {
const data = res.data
this.tableData.data = data.records;
this.pagination.total = data.total
} else {
this.$message.error(res.msg)
}
}).catch(() => {});
}
},
//
statusChange(index) {
@ -166,6 +197,13 @@ export default defineComponent({
this.visible = false;
this.$message.success(res.data)
}).catch(() => {});
} else if (this.index == 3) {
this.proxy.$post("/commonWords/add", this.reasonForm).then(res => {
this.getData();
this.reasonForm.title = '';
this.visible = false;
this.$message.success(res.data)
}).catch(() => {});
}
},
//
@ -185,6 +223,11 @@ export default defineComponent({
this.getData();
this.$message.success(res.data)
}).catch(() => {});
} else if (this.index == 3) {
this.proxy.$post("/commonWords/del", {id: id}).then(res => {
this.getData();
this.$message.success(res.data)
}).catch(() => {});
}
}).catch(() => {})
},
@ -215,6 +258,15 @@ export default defineComponent({
this.sortValue = undefined;
this.$message.success(res.data)
}).catch(() => {});
} else if (this.index == 3) {
let obj = {id: this.activeId,sortWeight: this.sortValue*1}
this.proxy.$post("/commonWords/updSort", obj).then(res => {
this.getData();
this.isEditing = false;
this.activeId = undefined;
this.sortValue = undefined;
this.$message.success(res.data)
}).catch(() => {});
}
}
}

Loading…
Cancel
Save