邹畅 4 years ago
parent
commit
267ea61afc
3 changed files with 76 additions and 52 deletions
  1. 2
      src/api/sce/sce.js
  2. 51
      src/views/sce/sceInfo/index.vue
  3. 75
      src/views/sce/tips/index.vue

2
src/api/sce/sce.js

@ -83,7 +83,7 @@ export function updateTipsList(data) {
//删除Tips列表 //删除Tips列表
export function deteleTipsList(id) { export function deteleTipsList(id) {
return request({ return request({
url: 'tips/info/detele',
url: 'tips/info/delete',
method: 'post', method: 'post',
data:{id} data:{id}
}) })

51
src/views/sce/sceInfo/index.vue

@ -247,7 +247,7 @@
<div style="margin-top:15px;" v-if="type != 'view'"> <div style="margin-top:15px;" v-if="type != 'view'">
<el-button <el-button
type="success" type="success"
:disabled='disabledButton'
:disabled="disabledButton"
style="height:36px;width:100px;margin-left:30px;color:#fff;background:#33DB99" style="height:36px;width:100px;margin-left:30px;color:#fff;background:#33DB99"
@click="handleAddK" @click="handleAddK"
>新增</el-button >新增</el-button
@ -827,7 +827,7 @@ export default {
videoIndex: "", videoIndex: "",
dataList: {}, dataList: {},
disabled: false, disabled: false,
disabledButton:false
disabledButton: false
}; };
}, },
mounted() { mounted() {
@ -872,9 +872,9 @@ export default {
message: "输入的流程编号有重复,请重新输入", message: "输入的流程编号有重复,请重新输入",
type: "error" type: "error"
}); });
this.disabledButton = true
}else{
this.disabledButton = false
this.disabledButton = true;
} else {
this.disabledButton = false;
} }
} }
} }
@ -1105,33 +1105,50 @@ export default {
} }
}); });
this.ruleForm.resourcesList = list.map(n => { this.ruleForm.resourcesList = list.map(n => {
let type = typeof n.processId;
var processId = "";
if (type == "string") {
processId = n.processId;
} else if (type == "object") {
processId = n.processId.join(",");
}
return { return {
mediaType: n.mediaType, mediaType: n.mediaType,
sourceType: n.sourceType, sourceType: n.sourceType,
title: n.title, title: n.title,
url: n.url, url: n.url,
processId: n.processId.join(",")
processId: processId
}; };
}); });
console.log(this.imgData, "有变化吗");
console.log(this.ruleForm, "参数"); console.log(this.ruleForm, "参数");
try { try {
this.$refs["ruleForm"].validate(async valid => { this.$refs["ruleForm"].validate(async valid => {
if (valid) { if (valid) {
if (this.type == "add") { if (this.type == "add") {
var res = await addJbInfo(this.ruleForm); var res = await addJbInfo(this.ruleForm);
if (res.code == 200) {
this.$message.success("新增成功");
this.dialog.Visible = false;
this.queryList();
} else {
this.$message({
message: res.msg,
type: "error"
});
}
} else if (this.type == "edit") { } else if (this.type == "edit") {
console.log(this.ruleForm, "参数");
var res = await updateJbInfo(this.ruleForm); var res = await updateJbInfo(this.ruleForm);
}
if (res.code == 200) {
this.$message.success("新增成功");
this.dialog.Visible = false;
this.queryList();
} else {
this.$message({
message: res.msg,
type: "error"
});
if (res.code == 200) {
this.$message.success("编辑成功");
this.dialog.Visible = false;
this.queryList();
} else {
this.$message({
message: res.msg,
type: "error"
});
}
} }
} }
}); });

75
src/views/sce/tips/index.vue

@ -9,7 +9,7 @@
clearable clearable
placeholder="请选择剧本标题" placeholder="请选择剧本标题"
@change="queryLc" @change="queryLc"
@visible-change='foucsLc'
@visible-change="foucsLc"
> >
<el-option <el-option
v-for="item in jbData" v-for="item in jbData"
@ -173,7 +173,9 @@
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="dialog.Visible = false"> </el-button> <el-button @click="dialog.Visible = false"> </el-button>
<el-button v-if="type != 'view'" type="primary" @click="subMitForm()"> </el-button>
<el-button v-if="type != 'view'" type="primary" @click="subMitForm()"
> </el-button
>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
@ -202,10 +204,10 @@ export default {
} }
}, },
rules: { rules: {
scenarioId: [{ required: true, message: "请选择剧本", trigger: "blur" }],
processId: [
{ required: true, message: "请选择流程", trigger: "blur" }
scenarioId: [
{ required: true, message: "请选择剧本", trigger: "blur" }
], ],
processId: [{ required: true, message: "请选择流程", trigger: "blur" }],
content: [{ required: true, message: "请输入内容", trigger: "blur" }] content: [{ required: true, message: "请输入内容", trigger: "blur" }]
}, },
form: {}, form: {},
@ -219,7 +221,7 @@ export default {
lcData: [], lcData: [],
total: 0, total: 0,
type: "add", type: "add",
data:{}
data: {}
}; };
}, },
mounted() { mounted() {
@ -240,7 +242,6 @@ export default {
}, },
// //
async queryFindList() { async queryFindList() {
try { try {
let res = await queryFindList(this.data); let res = await queryFindList(this.data);
// console.log(res.data, ""); // console.log(res.data, "");
@ -249,31 +250,31 @@ export default {
console.log(err); console.log(err);
} }
}, },
queryLc(val){
queryLc(val) {
this.data = { this.data = {
scenarioId:val
}
delete this.queryParams.query.processId
this.queryFindList()
scenarioId: val
};
delete this.queryParams.query.processId;
this.queryFindList();
}, },
chageLc(val){
console.log(val)
chageLc(val) {
console.log(val);
this.data = { this.data = {
scenarioId:val
}
delete this.form.processId
// this.form.processId =
this.queryFindList()
scenarioId: val
};
delete this.form.processId;
// this.form.processId =
this.queryFindList();
}, },
foucsLc(){
console.log(11110)
foucsLc() {
console.log(11110);
}, },
//Tips //Tips
async queryTipsList() { async queryTipsList() {
this.loading = true; this.loading = true;
console.log(this.$route.query.type,41231231)
if(this.$route.query.type == 'sceinfo'){
this.queryParams.query.scenarioId = this.$route.query.scenarioId
console.log(this.$route.query.type, 41231231);
if (this.$route.query.type == "sceinfo") {
this.queryParams.query.scenarioId = this.$route.query.scenarioId;
} }
try { try {
let res = await queryTipsList(this.queryParams); let res = await queryTipsList(this.queryParams);
@ -298,15 +299,15 @@ export default {
content: undefined content: undefined
} }
}; };
this.data = {}
this.queryFindList()
this.data = {};
this.queryFindList();
this.queryTipsList(); this.queryTipsList();
}, },
// //
handleAdd() { handleAdd() {
this.dialog.title = "新增"; this.dialog.title = "新增";
this.type = 'add'
this.form = {}
this.type = "add";
this.form = {};
this.disabled = false; this.disabled = false;
this.dialog.Visible = true; this.dialog.Visible = true;
}, },
@ -329,7 +330,7 @@ export default {
}); });
} }
} }
if(this.type == 'edit'){
if (this.type == "edit") {
let res = await updateTipsList(this.form); let res = await updateTipsList(this.form);
if (res.code == 200) { if (res.code == 200) {
this.$message.success("编辑成功"); this.$message.success("编辑成功");
@ -370,10 +371,16 @@ export default {
// //
handleEdit(row) { handleEdit(row) {
this.queryTipsDetail(row.id); this.queryTipsDetail(row.id);
this.dialog.title = "编辑";
this.type = "edit";
this.disabled = false;
this.dialog.Visible = true;
this.data = {
scenarioId: row.scenarioId
};
this.queryFindList();
setTimeout(() => {
this.dialog.title = "编辑";
this.type = "edit";
this.disabled = false;
this.dialog.Visible = true;
}, 500);
}, },
// //
async hanDel(row) { async hanDel(row) {
@ -386,7 +393,7 @@ export default {
let res = await deteleTipsList(row.id); let res = await deteleTipsList(row.id);
if (res.code == 200) { if (res.code == 200) {
this.$message.success("删除成功"); this.$message.success("删除成功");
this.queryList();
this.queryTipsList();
} else { } else {
this.$message({ this.$message({
message: res.msg, message: res.msg,

Loading…
Cancel
Save