|
|
@@ -37,12 +37,12 @@
|
|
|
<el-table-column label="操作" width="300">
|
|
|
<template slot-scope="scope">
|
|
|
<span
|
|
|
- style="color: #409eff; margin-right: 5px"
|
|
|
+ style="color: #409eff; margin-right: 5px; cursor: pointer;"
|
|
|
@click="alter(scope.row)"
|
|
|
>编辑</span
|
|
|
>
|
|
|
<span
|
|
|
- style="color: #409eff; margin-right: 5px"
|
|
|
+ style="color: #409eff; margin-right: 5px; cursor: pointer;"
|
|
|
@click="deletes(scope.row)"
|
|
|
>删除</span
|
|
|
>
|
|
|
@@ -113,7 +113,7 @@ export default {
|
|
|
tableData: [],
|
|
|
queryInfo: {
|
|
|
page: 1,
|
|
|
- inducer_name: ""
|
|
|
+ inducer_name: "",
|
|
|
},
|
|
|
total: 10,
|
|
|
loading: false,
|
|
|
@@ -124,21 +124,21 @@ export default {
|
|
|
inducer_name: "",
|
|
|
expire: "",
|
|
|
messages: "",
|
|
|
- inducer_id: ""
|
|
|
+ inducer_id: "",
|
|
|
},
|
|
|
rules: {
|
|
|
inducer_name: [
|
|
|
- { required: true, message: "请输入活动名称", trigger: "blur" }
|
|
|
+ { required: true, message: "请输入活动名称", trigger: "blur" },
|
|
|
],
|
|
|
expire: [
|
|
|
{ required: true, message: "请输入活动名称", trigger: "blur" },
|
|
|
- { validator: checklnglat, trigger: "blur" }
|
|
|
+ { validator: checklnglat, trigger: "blur" },
|
|
|
],
|
|
|
messages: [
|
|
|
- { required: true, message: "请输入活动名称", trigger: "blur" }
|
|
|
- ]
|
|
|
+ { required: true, message: "请输入活动名称", trigger: "blur" },
|
|
|
+ ],
|
|
|
},
|
|
|
- addtitle: "新增诱剂"
|
|
|
+ addtitle: "新增诱剂",
|
|
|
};
|
|
|
},
|
|
|
//监听属性 类似于data概念
|
|
|
@@ -156,9 +156,9 @@ export default {
|
|
|
data: this.qs.stringify({
|
|
|
page_size: 20,
|
|
|
page: this.queryInfo.page,
|
|
|
- inducer_name: this.queryInfo.inducer_name // 非必传(string) 诱剂名称 搜索项
|
|
|
- })
|
|
|
- }).then(res => {
|
|
|
+ inducer_name: this.queryInfo.inducer_name, // 非必传(string) 诱剂名称 搜索项
|
|
|
+ }),
|
|
|
+ }).then((res) => {
|
|
|
this.loading = false;
|
|
|
console.log(res.data.data);
|
|
|
this.total = res.data.data.total_item;
|
|
|
@@ -191,30 +191,29 @@ export default {
|
|
|
var str = "您确定删除<" + events.inducer_name + ">吗?";
|
|
|
this.$confirm(str, "删除诱剂", {
|
|
|
confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消"
|
|
|
+ cancelButtonText: "取消",
|
|
|
})
|
|
|
.then(() => {
|
|
|
this.$axios({
|
|
|
method: "POST",
|
|
|
- url:
|
|
|
- "/api/api_gateway?method=monitor_manage.maintain.inducer_delete",
|
|
|
+ url: "/api/api_gateway?method=monitor_manage.maintain.inducer_delete",
|
|
|
data: this.qs.stringify({
|
|
|
- inducer_id: events.inducer_id
|
|
|
- })
|
|
|
- }).then(res => {
|
|
|
+ inducer_id: events.inducer_id,
|
|
|
+ }),
|
|
|
+ }).then((res) => {
|
|
|
console.log(res);
|
|
|
if (res.data.data) {
|
|
|
this.$message({
|
|
|
showClose: true,
|
|
|
message: "删除成功!",
|
|
|
- type: "success"
|
|
|
+ type: "success",
|
|
|
});
|
|
|
this.getcbdlist();
|
|
|
} else {
|
|
|
this.$message({
|
|
|
showClose: true,
|
|
|
message: "删除失败," + res.data.message,
|
|
|
- type: "warning"
|
|
|
+ type: "warning",
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
@@ -222,32 +221,31 @@ export default {
|
|
|
.catch(() => {
|
|
|
this.$message({
|
|
|
type: "info",
|
|
|
- message: "已取消删除"
|
|
|
+ message: "已取消删除",
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
submitForm(formName) {
|
|
|
console.log(this.ruleForm);
|
|
|
- this.$refs[formName].validate(valid => {
|
|
|
+ this.$refs[formName].validate((valid) => {
|
|
|
if (valid) {
|
|
|
if (this.addtitle == "修改诱剂") {
|
|
|
this.$axios({
|
|
|
method: "POST",
|
|
|
- url:
|
|
|
- "/api/api_gateway?method=monitor_manage.maintain.inducer_modify",
|
|
|
+ url: "/api/api_gateway?method=monitor_manage.maintain.inducer_modify",
|
|
|
data: this.qs.stringify({
|
|
|
inducer_id: this.ruleForm.inducer_id,
|
|
|
inducer_name: this.ruleForm.inducer_name,
|
|
|
expire: Number(this.ruleForm.expire),
|
|
|
- messages: this.ruleForm.messages
|
|
|
- })
|
|
|
- }).then(res => {
|
|
|
+ messages: this.ruleForm.messages,
|
|
|
+ }),
|
|
|
+ }).then((res) => {
|
|
|
console.log(res);
|
|
|
if (res.data.data) {
|
|
|
this.$message({
|
|
|
showClose: true,
|
|
|
message: "修改成功!",
|
|
|
- type: "success"
|
|
|
+ type: "success",
|
|
|
});
|
|
|
this.addtraptf = false;
|
|
|
this.getcbdlist();
|
|
|
@@ -256,27 +254,26 @@ export default {
|
|
|
this.$message({
|
|
|
showClose: true,
|
|
|
message: "修改失败" + res.data.message,
|
|
|
- type: "warning"
|
|
|
+ type: "warning",
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
} else if (this.addtitle == "新增诱剂") {
|
|
|
this.$axios({
|
|
|
method: "POST",
|
|
|
- url:
|
|
|
- "/api/api_gateway?method=monitor_manage.maintain.inducer_add",
|
|
|
+ url: "/api/api_gateway?method=monitor_manage.maintain.inducer_add",
|
|
|
data: this.qs.stringify({
|
|
|
inducer_name: this.ruleForm.inducer_name,
|
|
|
expire: this.ruleForm.expire,
|
|
|
- messages: this.ruleForm.messages
|
|
|
- })
|
|
|
- }).then(res => {
|
|
|
+ messages: this.ruleForm.messages,
|
|
|
+ }),
|
|
|
+ }).then((res) => {
|
|
|
console.log(res);
|
|
|
if (res.data.data) {
|
|
|
this.$message({
|
|
|
showClose: true,
|
|
|
message: "新增成功!",
|
|
|
- type: "success"
|
|
|
+ type: "success",
|
|
|
});
|
|
|
this.addtraptf = false;
|
|
|
this.getcbdlist();
|
|
|
@@ -285,7 +282,7 @@ export default {
|
|
|
this.$message({
|
|
|
showClose: true,
|
|
|
message: "添加失败" + res.data.message,
|
|
|
- type: "warning"
|
|
|
+ type: "warning",
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
@@ -307,7 +304,7 @@ export default {
|
|
|
dioclose() {
|
|
|
console.log(111);
|
|
|
// this.$refs[formName].resetFields();
|
|
|
- }
|
|
|
+ },
|
|
|
},
|
|
|
beforeCreate() {}, //生命周期 - 创建之前
|
|
|
//生命周期 - 创建完成(可以访问当前this实例)
|
|
|
@@ -321,7 +318,7 @@ export default {
|
|
|
updated() {}, //生命周期 - 更新之后
|
|
|
beforeDestroy() {}, //生命周期 - 销毁之前
|
|
|
destroyed() {}, //生命周期 - 销毁完成
|
|
|
- activated() {} //如果页面有keep-alive缓存功能,这个函数会触发
|
|
|
+ activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
|
|
|
};
|
|
|
</script>
|
|
|
<style scoped lang="less">
|