Commit 92565c06 by 潘建波

修改未添加任务提示错误问题

1 parent 64a24323
No preview for this file type
...@@ -6,7 +6,8 @@ ...@@ -6,7 +6,8 @@
"serve": "vue-cli-service serve", "serve": "vue-cli-service serve",
"build": "vue-cli-service build", "build": "vue-cli-service build",
"test:unit": "vue-cli-service test:unit", "test:unit": "vue-cli-service test:unit",
"lint": "vue-cli-service lint" "lint": "vue-cli-service lint",
"analyzer": "cross-env use_analyzer=true npm run serve"
}, },
"dependencies": { "dependencies": {
"axios": "^0.19.0", "axios": "^0.19.0",
...@@ -42,7 +43,8 @@ ...@@ -42,7 +43,8 @@
"stylus": "^0.54.7", "stylus": "^0.54.7",
"stylus-loader": "^3.0.2", "stylus-loader": "^3.0.2",
"vue-particles": "^1.0.9", "vue-particles": "^1.0.9",
"vue-template-compiler": "^2.6.10" "vue-template-compiler": "^2.6.10",
"webpack-bundle-analyzer": "^3.8.0"
}, },
"eslintConfig": { "eslintConfig": {
"root": true, "root": true,
......
...@@ -273,7 +273,7 @@ body{ ...@@ -273,7 +273,7 @@ body{
} }
.statusbox { .statusbox {
display: inline-block; display: inline-block;
width: 60px; min-width: 60px;
border-radius: 2px; border-radius: 2px;
background:rgba(204,204,204,1); background:rgba(204,204,204,1);
color: #fff; color: #fff;
......
...@@ -149,15 +149,17 @@ export default { ...@@ -149,15 +149,17 @@ export default {
if (!this.formData.store_conf.unid) { if (!this.formData.store_conf.unid) {
return callback(new Error("存储配置不能为空")); return callback(new Error("存储配置不能为空"));
} else { } else {
callback() callback();
} }
}; };
return { return {
setvisible: false, setvisible: false,
timer: ["00:00:00", "23:59:59"], timer: ["00:00:00", "23:59:59"],
backpdata: "",
formData: { formData: {
task_name: "", task_name: "",
task_algo_type: "", task_algo_type: "",
is_send: 0,
store_conf: { store_conf: {
unid: "" unid: ""
}, },
...@@ -178,7 +180,9 @@ export default { ...@@ -178,7 +180,9 @@ export default {
resource_use: [ resource_use: [
{ required: true, message: "场景占用不能为空!", trigger: "change" } { required: true, message: "场景占用不能为空!", trigger: "change" }
], ],
store_conf_unid: [{ required: true, validator: checkStore, trigger: "change" }] store_conf_unid: [
{ required: true, validator: checkStore, trigger: "change" }
]
} }
}; };
}, },
...@@ -232,7 +236,8 @@ export default { ...@@ -232,7 +236,8 @@ export default {
} else { } else {
this.timer = null; this.timer = null;
} }
this.formData = pdata; this.formData = JSON.parse(JSON.stringify(pdata));
this.backpdata = JSON.parse(JSON.stringify(pdata));
this.$api.task.getSubTask(pdata.task_id).then(res => { this.$api.task.getSubTask(pdata.task_id).then(res => {
let ary = []; let ary = [];
let data = res.list_data; let data = res.list_data;
...@@ -314,11 +319,27 @@ export default { ...@@ -314,11 +319,27 @@ export default {
}); });
}, },
editTask(data) { editTask(data) {
data.is_send = this.sendstatus(data);
this.$api.task.editTask(data, this.formData.task_id).then(res => { this.$api.task.editTask(data, this.formData.task_id).then(res => {
this.setvisible = false; this.setvisible = false;
this.$emit("refresh"); this.$emit("refresh");
}); });
}, },
sendstatus(data) {
let status = 0;
if (
data.task_algo_type != this.backpdata.task_algo_type ||
data.start_time != this.backpdata.start_time ||
data.end_time != this.backpdata.end_time ||
data.plate_type != this.backpdata.plate_type ||
data.resource_use != this.backpdata.resource_use ||
data.priority != this.backpdata.priority ||
data.store_conf_unid != this.backpdata.store_conf.unid
) {
status = 1;
}
return status;
},
getStore() { getStore() {
let params = { let params = {
offset: 0, offset: 0,
......
...@@ -245,7 +245,7 @@ export default { ...@@ -245,7 +245,7 @@ export default {
this.$api.task this.$api.task
.addSubtaskList(this.editData.task_id, subData) .addSubtaskList(this.editData.task_id, subData)
.then(res => { .then(res => {
if (res && res.ecode != "500") { if (res && !res.ecode && res.length > 0) {
this.$message({ this.$message({
message: "添加成功", message: "添加成功",
type: "success" type: "success"
...@@ -253,14 +253,27 @@ export default { ...@@ -253,14 +253,27 @@ export default {
this.setvisible = false; this.setvisible = false;
this.$emit("refresh"); this.$emit("refresh");
} else { } else {
if (res.length == 0) {
this.setvisible = false; //未添加新任务
} else {
this.$message.error(res.enote); this.$message.error(res.enote);
} }
}
}); });
}, },
playVideo(data) { playVideo(data) {
console.log("b", data); console.log("b", data);
}, },
delFun(index, data, action = "tree") { delFun(index, data, action = "tree") {
if (!data.subtask_id) {
this.tableData.forEach((ele, i) => {
if (ele.vchan_refid == data.vchan_refid) {
this.tableData.splice(i, 1);
this.checkvckan();
}
});
return;
}
this.$store.commit("setocxstate", 0); this.$store.commit("setocxstate", 0);
this.$confirm("删除视频源, 是否继续?", "提示", { this.$confirm("删除视频源, 是否继续?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
......
...@@ -337,6 +337,8 @@ export default { ...@@ -337,6 +337,8 @@ export default {
return "<span class='errorbox statusbox'>异常</span>"; return "<span class='errorbox statusbox'>异常</span>";
} else if (row.status == "Deleted") { } else if (row.status == "Deleted") {
return "<span class='deletebox statusbox'>已删除</span>"; return "<span class='deletebox statusbox'>已删除</span>";
} else if (row.status == "NotInTimeOfDay") {
return "<span class='deletebox statusbox'>不在时间范围</span>";
} else { } else {
return "<span class='nomoralbox statusbox'>未部署</span>"; return "<span class='nomoralbox statusbox'>未部署</span>";
} }
......
...@@ -40,6 +40,9 @@ ...@@ -40,6 +40,9 @@
// }; // };
// var options = { encoding: 'UTF-8', mode: 438 /*=0666*/, flag: 'w' }; // var options = { encoding: 'UTF-8', mode: 438 /*=0666*/, flag: 'w' };
// fs.writeFileSync(verinfo, JSON.stringify(obj), options); // fs.writeFileSync(verinfo, JSON.stringify(obj), options);
const BundleAnalyzerPlugin = require("webpack-bundle-analyzer")
.BundleAnalyzerPlugin;
module.exports = { module.exports = {
lintOnSave: false, lintOnSave: false,
publicPath: process.env.NODE_ENV === "production" ? "./" : "/", publicPath: process.env.NODE_ENV === "production" ? "./" : "/",
...@@ -51,6 +54,13 @@ module.exports = { ...@@ -51,6 +54,13 @@ module.exports = {
} }
} }
}, },
chainWebpack: config => {
if (process.env.use_analyzer) { // 分析
config
.plugin('webpack-bundle-analyzer')
.use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin)
}
},
pluginOptions: { pluginOptions: {
// 第三方插件配置 // 第三方插件配置
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!