邹畅 3 years ago
parent
commit
78afe558e2
3 changed files with 142 additions and 64 deletions
  1. 183
      src/views/sce/sceInfo/index.vue
  2. 21
      src/views/sce/tips/index.vue
  3. 2
      src/views/user/index.vue

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

@ -76,7 +76,9 @@
<el-button type="text" size="mini" @click="handleEdit(scope.row)"
>编辑</el-button
>
<el-button type="text" size="mini">Tips维护</el-button>
<el-button type="text" size="mini" @click="handleTips(scope.row)"
>Tips维护</el-button
>
<el-button type="text" size="mini" @click="hanDel(scope.row)"
>删除</el-button
>
@ -92,7 +94,7 @@
/>
</div>
<!-- 新增表单 -->
<el-dialog :title="dialog.title" :visible.sync="dialog.Visible" width="70%">
<el-dialog :title="dialog.title" :visible.sync="dialog.Visible" width="1000px">
<el-form
ref="ruleForm"
:model="ruleForm"
@ -265,6 +267,7 @@
</div>
</div>
<el-upload
v-if="type != 'view'"
class="avatar-uploader"
style="float:left;margin-left:60px"
action
@ -406,6 +409,7 @@
</div>
</div>
<el-upload
v-if="type != 'view'"
class="avatar-uploader"
style="float:left;margin-left:60px"
action
@ -550,6 +554,7 @@
</div>
</div>
<el-upload
v-if="type != 'view'"
class="avatar-uploader"
style="float:left;margin-left:60px"
action
@ -678,7 +683,12 @@
>
<el-form>
<el-form-item label="关联流程">
<el-select v-model="processId" clearable placeholder="请选择流程">
<el-select
v-model="processId"
clearable
multiple
placeholder="请选择流程"
>
<el-option
v-for="item in ruleForm.processesList"
:key="item.value"
@ -759,7 +769,7 @@ export default {
imgData: [],
musicData: [],
videoData: [],
processId: "",
processId: [],
process: {
Visible: false
},
@ -787,11 +797,14 @@ export default {
}
},
ForChannel(e) {
console.log(e);
console.log(this.ruleForm.processesList);
var a = e.split(",");
var tmp = [];
for (var i = 0; i < this.ruleForm.processesList.length; i++) {
if (this.ruleForm.processesList[i].code == e) {
return this.ruleForm.processesList[i].title;
for (var s = 0; s < a.length; s++) {
if (this.ruleForm.processesList[i].code == e[s]) {
tmp.push(this.ruleForm.processesList[i].title);
return tmp;
}
}
}
},
@ -825,6 +838,13 @@ export default {
};
this.queryList();
},
//Tips
handleTips(row) {
this.$router.push({
name: "Tips/index",
query: { scenarioId: row.id, type: "sceinfo" }
});
},
//
async queryFindList() {
try {
@ -838,70 +858,89 @@ export default {
//
async queryListDetail(id) {
try {
this.ruleForm = {
studioName: "",
title: "",
labelName: "",
imgUrl: "",
cover: "",
introduction: "",
processesList: [],
imgUrl: "",
radioImg: [],
radioMusic: [],
radioVideo: [],
resourcesList: []
};
let res = await queryJbDetail(id);
console.log(res, "详情");
this.ruleForm = res.data;
this.ruleForm.radioImg = [];
this.ruleForm.radioMusic = [];
this.ruleForm.radioVideo = [];
res.data.resourcesList.map(n => {
var a = []
var b = []
var c = []
var a = [];
var b = [];
var c = [];
if (n.mediaType == 1 && n.sourceType == 2) {
a.push(n)
a.push(n);
this.ruleForm.radioImg = a.map(n => {
return {
mediaType: n.mediaType,
sourceType: n.sourceType,
title: n.title,
url: n.url,
processId: n.processId.split(',')
processId: n.processId.split(",")
};
});
this.radioImg = n.sourceType;
} else if (n.mediaType == 1 && n.sourceType == 1) {
a.push(n);
var tmp = []
this.imgData = a
this.radioImg = n.sourceType;
}
if (n.mediaType == 2 && n.sourceType == 1) {
b.push(n)
this.musicData = b
b.push(n);
this.musicData = b;
this.radioMusic = n.sourceType;
} else if (n.mediaType == 2 && n.sourceType == 2) {
console.log('进来了1')
b.push(n)
console.log("进来了1");
b.push(n);
this.ruleForm.radioMusic = b.map(n => {
return {
mediaType: n.mediaType,
sourceType: n.sourceType,
title: n.title,
url: n.url,
processId: n.processId.split(',')
processId: n.processId.split(",")
};
});
});
this.radioMusic = n.sourceType;
}
if (n.mediaType == 3 && n.sourceType == 1) {
c.push(n)
this.videoData = c
c.push(n);
this.videoData = c;
this.radioVideo = n.sourceType;
} else if (n.mediaType == 3 && n.sourceType == 2) {
c.push(n)
c.push(n);
this.ruleForm.radioVideo = c.map(n => {
return {
mediaType: n.mediaType,
sourceType: n.sourceType,
title: n.title,
url: n.url,
processId: n.processId.split(',')
processId: n.processId.split(",")
};
});
this.radioVideo = n.sourceType;
}
});
console.log(this.ruleForm, "处理后详情");
console.log(
this.ruleForm,
this.musicData,
this.imgData,
this.videoData,
"处理后详情"
);
} catch (err) {
console.log(err);
}
@ -909,6 +948,12 @@ export default {
//
handleAdd() {
this.ruleForm = {
studioName: "",
title: "",
labelName: "",
imgUrl: "",
cover: "",
introduction: "",
processesList: [],
imgUrl: "",
radioImg: [],
@ -916,6 +961,9 @@ export default {
radioVideo: [],
resourcesList: []
};
this.imgData = []
this.musicData = []
this.videoData = []
this.radioMusic = 1;
this.radioVideo = 1;
this.radioImg = 1;
@ -981,20 +1029,20 @@ export default {
this.$refs["ruleForm"].validate(async valid => {
if (valid) {
if (this.type == "add") {
var res = await addJbInfo(this.ruleForm);
var res = await addJbInfo(this.ruleForm);
} else if (this.type == "edit") {
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"
});
}
}
});
} catch (err) {
@ -1192,7 +1240,7 @@ export default {
this.imgData.push({
url: res.data.wjUrl,
processName: "",
title: ""
title: res.data.wjDx
});
this.imgType = true;
});
@ -1205,7 +1253,7 @@ export default {
this.musicData.push({
url: res.data.wjUrl,
processName: "",
title: ""
title: res.data.wjDx
});
this.musicType = true;
});
@ -1218,9 +1266,9 @@ export default {
this.videoData.push({
url: res.data.wjUrl,
processName: "",
title: ""
title: res.data.wjDx
});
this.musicType = true;
this.radioType = true;
});
},
//
@ -1255,7 +1303,7 @@ export default {
if (type == "img") {
this.imgIndex = i;
} else if (type == "music") {
this.musicIdnex = i;
this.musicIndex = i;
} else if (type == "video") {
this.videoIndex = i;
}
@ -1268,30 +1316,49 @@ export default {
this.process.Visible = false;
if (this.typeUrl == "img") {
this.imgType = false;
this.imgData[this.imgIndex].processName = this.ForChannel(
this.processId
);
this.imgData[this.imgIndex].processId = [this.processId];
var tmp = [];
for (var i = 0; i < this.ruleForm.processesList.length; i++) {
for (var s = 0; s < this.processId.length; s++) {
if (this.ruleForm.processesList[i].code == this.processId[s]) {
tmp.push(this.ruleForm.processesList[i].title);
}
}
}
this.imgData[this.imgIndex].processName = tmp.join(",");
this.imgData[this.imgIndex].processId = this.processId;
this.imgData[this.imgIndex].mediaType = 1;
this.imgData[this.imgIndex].sourceType = this.radioImg;
console.log(this.imgData, "处理后img数据");
}
if (this.typeUrl == "music") {
this.musicType = false;
this.musicData[this.imgIndex].processName = this.ForChannel(
this.processId
);
this.musicData[this.musicIndex].processId = [this.processId];
var tmp = [];
for (var i = 0; i < this.ruleForm.processesList.length; i++) {
for (var s = 0; s < this.processId.length; s++) {
if (this.ruleForm.processesList[i].code == this.processId[s]) {
tmp.push(this.ruleForm.processesList[i].title);
}
}
}
this.musicData[this.musicIndex].processName = tmp.join(",");
this.musicData[this.musicIndex].processId = this.processId;
this.musicData[this.musicIndex].mediaType = 2;
this.musicData[this.musicIndex].sourceType = this.radioImg;
this.musicData[this.musicIndex].sourceType = this.radioMusic;
}
if (this.typeUrl == "video") {
this.videoType = false;
this.videoData[this.videoIndex].processName = this.ForChannel(
this.processId
);
this.videoData[this.videoIndex].processId = [this.processId];
var tmp = [];
for (var i = 0; i < this.ruleForm.processesList.length; i++) {
for (var s = 0; s < this.processId.length; s++) {
if (this.ruleForm.processesList[i].code == this.processId[s]) {
tmp.push(this.ruleForm.processesList[i].title);
}
}
}
this.videoData[this.videoIndex].processName = tmp.join(",");
this.videoData[this.videoIndex].processId = this.processId;
this.videoData[this.videoIndex].mediaType = 3;
this.videoData[this.videoIndex].sourceType = this.radioImg;
this.videoData[this.videoIndex].sourceType = this.radioVideo;
}
}
}

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

@ -122,10 +122,10 @@
:title="dialog.title"
:visible.sync="dialog.Visible"
center
width="35%"
width="500px"
>
<el-form ref="form" :model="form" :inline="true">
<el-form-item label="剧本标题:" prop="name" style="width:100%">
<el-form ref="form" :model="form" :inline="true" :rules="rules">
<el-form-item label="剧本标题:" prop="scenarioId" style="width:100%">
<el-select
:disabled="disabled"
v-model="form.scenarioId"
@ -143,7 +143,7 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item label="流程标题:" style="width:100%">
<el-form-item label="流程标题:" style="width:100%" prop="processId">
<el-select
:disabled="disabled"
v-model="form.processId"
@ -159,7 +159,7 @@
/>
</el-select>
</el-form-item>
<el-form-item label="Tips内容:" style="width:100%">
<el-form-item label="Tips内容:" style="width:100%" prop="content">
<el-input
:disabled="disabled"
style="width:300px"
@ -201,6 +201,13 @@ export default {
content: undefined
}
},
rules: {
scenarioId: [{ required: true, message: "请选择剧本", trigger: "blur" }],
processId: [
{ required: true, message: "请选择流程", trigger: "blur" }
],
content: [{ required: true, message: "请输入内容", trigger: "blur" }]
},
form: {},
disabled: false,
dialog: {
@ -255,6 +262,10 @@ export default {
//Tips
async queryTipsList() {
this.loading = true;
console.log(this.$route.query.type,41231231)
if(this.$route.query.type == 'sceinfo'){
this.queryParams.query.scenarioId = this.$route.query.scenarioId
}
try {
let res = await queryTipsList(this.queryParams);
this.tableData = res.data.rows;

2
src/views/user/index.vue

@ -130,7 +130,7 @@
:title="dialog.title"
:visible.sync="dialog.Visible"
center
width="30%"
width="350px"
>
<el-form :model="form" :inline="true">
<div v-if="type == 'level'">

Loading…
Cancel
Save