Commit 92565c06 by 潘建波

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

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