+
+
+
+
+
+
+ {{ mapForChannel(scope.row.processId) }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -456,14 +713,13 @@ export default {
Visible: false
},
ruleForm: {
- resource: "1",
processesList: [],
imgUrl: "",
- data: [],
- radioImg:[],
- radioMusic:[],
- radioVideo:[],
- resourcesList:[]
+ imgUrls: [],
+ radioImg: [],
+ radioMusic: [],
+ radioVideo: [],
+ resourcesList: []
},
dialogVisible: false,
active: "",
@@ -473,9 +729,19 @@ export default {
dialogImageUrl: "",
dataImg: [],
lcData: [],
- radioImg:"1",
- radioMusic:'1',
- radioVideo:"1"
+ radioImg: "1",
+ radioMusic: "1",
+ radioVideo: "1",
+ type: "add",
+ imgData: [],
+ musicData: [],
+ videoData: [],
+ processId: "",
+ process: {
+ Visible: false
+ },
+ list: {},
+ typeUrl: ""
};
},
mounted() {
@@ -483,6 +749,13 @@ export default {
this.queryFindList();
},
methods: {
+ mapForChannel(e) {
+ for (var i = 0; i < this.lcData.length; i++) {
+ if (this.lcData[i].id == e) {
+ return this.lcData[i].title;
+ }
+ }
+ },
//获取列表
async queryList() {
this.loading = true;
@@ -529,34 +802,67 @@ export default {
let res = await queryJbDetail(id);
console.log(res, "详情");
this.ruleForm = res.data;
+ this.ruleForm.radioImg = [];
+ this.ruleForm.radioMusic = [];
+ this.ruleForm.radioVideo = [];
+ let a = res.data.resourcesList.map(n => {
+ if (n.mediaType == 1) {
+ this.ruleForm.radioImg.push(n);
+ this.radioImg = n.sourceType;
+ }
+ if (n.mediaType == 2) {
+ this.ruleForm.radioMusic.push(n);
+ this.radioMusic = n.sourceType;
+ }
+ if (n.mediaType == 3) {
+ this.ruleForm.radioVideo.push(n);
+ this.radioVideo = n.sourceType;
+ }
+ });
+ console.log(this.ruleForm, "处理后详情");
} catch (err) {
console.log(err);
}
},
// 新增
handleAdd() {
+ this.ruleForm = {
+ processesList: [],
+ imgUrl: "",
+ radioImg: [],
+ radioMusic: [],
+ radioVideo: [],
+ resourcesList: []
+ };
+ this.radioMusic = 1;
+ this.radioVideo = 1;
+ this.radioImg = 1;
this.dialog.Visible = true;
+ this.type = "add";
this.dialog.title = "新增剧本";
},
async subMit() {
this.ruleForm.imgUrl = this.dataImg.join(",");
- this.ruleForm.resourcesList = this.ruleForm.resourcesList.concat(this.ruleForm.radioImg).concat(this.ruleForm.radioMusic).concat(this.ruleForm.radioVideo)
+ this.ruleForm.resourcesList = this.ruleForm.resourcesList
+ .concat(this.ruleForm.radioImg)
+ .concat(this.ruleForm.radioMusic)
+ .concat(this.ruleForm.radioVideo);
console.log(this.ruleForm, "参数");
- try{
- let 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"
- });
- }
- }catch(err){
- console.log(err)
- }
+ // try {
+ // let 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"
+ // });
+ // }
+ // } catch (err) {
+ // console.log(err);
+ // }
},
// 编辑
handleEdit(row) {
@@ -568,6 +874,8 @@ export default {
// 查看
handleView(row) {
this.queryListDetail(row.id);
+ this.type = "view";
+ this.dialog.Visible = true;
},
// 删除
async hanDel(row) {
@@ -653,6 +961,16 @@ export default {
this.dialogVisible = true;
this.dialogImageUrl = this.ruleForm.imgUrls[e];
},
+ //资源删除
+ DelImg(index) {
+ this.ruleForm.radioImg.splice(index, 1);
+ },
+ DelMusic(index) {
+ this.ruleForm.radioMusic.splice(index, 1);
+ },
+ DelVideo(index) {
+ this.ruleForm.radioVideo.splice(index, 1);
+ },
// 图片删除
deldialogimg(index) {
this.ruleForm.imgUrls.splice(index, 1);
@@ -673,32 +991,143 @@ export default {
this.radioVideo = val;
},
//新增图片资源
- handleAddImg(){
+ handleAddImg() {
this.ruleForm.radioImg.push({
title: "",
url: "",
- processId:'',
- mediaType:1,
- sourceType:this.radioImg
+ processId: "",
+ mediaType: 1,
+ sourceType: this.radioImg
});
},
handleAddMusic() {
this.ruleForm.radioMusic.push({
title: "",
url: "",
- processId:'',
- mediaType:2,
- sourceType:this.radioMusic
+ processId: "",
+ mediaType: 2,
+ sourceType: this.radioMusic
});
},
handleAddVideo() {
this.ruleForm.radioVideo.push({
title: "",
url: "",
- processId:'',
- mediaType:3,
- sourceType:this.radioVideo
+ processId: "",
+ mediaType: 3,
+ sourceType: this.radioVideo
});
+ },
+ // 上传资源蹄片
+ labeluploadimg({ file }) {
+ const formdata = new FormData();
+ formdata.append("file", file);
+ formdata.append("type", "product");
+
+ uploadFile(formdata).then(res => {
+ this.imgData.push(res.data.wjUrl);
+ // this.ruleForm.radioImg.push({
+ // title:'图片',
+ // url: res.data.wjUrl,
+ // mediaType: 1,
+ // sourceType: this.radioImg
+ // });
+ });
+ },
+ labeluploadmusic({ file }) {
+ const formdata = new FormData();
+ formdata.append("file", file);
+ formdata.append("type", "product");
+
+ uploadFile(formdata).then(res => {
+ this.musicData.push(res.data.wjUrl);
+ // this.ruleForm.radioMusic.push({
+ // title:'音乐',
+ // url: res.data.wjUrl,
+ // mediaType: 2,
+ // sourceType: this.radioMusic
+ // });
+ });
+ },
+ labeluploadvideo({ file }) {
+ const formdata = new FormData();
+ formdata.append("file", file);
+ formdata.append("type", "product");
+
+ uploadFile(formdata).then(res => {
+ this.videoData.push(res.data.wjUrl);
+ // this.ruleForm.radioVideo.push({
+ // title:'视频',
+ // url: res.data.wjUrl,
+ // mediaType: 3,
+ // sourceType: this.radioVideo
+ // });
+ });
+ },
+ // 图片删除
+ deldialogimg(item, index, type) {
+ console.log(index, type);
+ if (type == "img") {
+ this.imgData.splice(index, 1);
+ }
+ if (type == "music") {
+ this.musicData.splice(index, 1);
+ }
+ if (type == "video") {
+ this.videoData.splice(index, 1);
+ }
+ console.log(item);
+ delFile({ wjUrl: item }).then(res => {
+ if (res.code == 200) {
+ this.$message.success("删除成功");
+ }
+ });
+ },
+ //关联流程
+ setLc(item, type) {
+ this.list = item;
+ this.typeUrl = type;
+ console.log(this.typeUrl);
+ this.processId = "";
+ this.process.Visible = true;
+ },
+ subMitLc() {
+ this.process.Visible = false;
+ if (this.typeUrl == "img") {
+ let data = {
+ title: "",
+ url: this.list,
+ processId: this.processId,
+ mediaType: 1,
+ sourceType: this.radioImg
+ };
+ this.ruleForm.radioImg.push(data);
+ }
+ if (this.typeUrl == "music") {
+ let data = {
+ title: "",
+ url: this.list,
+ processId: this.processId,
+ mediaType: 2,
+ sourceType: this.radioMusic
+ };
+ this.ruleForm.radioMusic.push(data);
+ }
+ if (this.typeUrl == "video") {
+ let data = {
+ title: "",
+ url: this.list,
+ processId: this.processId,
+ mediaType: 3,
+ sourceType: this.radioVideo
+ };
+ this.ruleForm.radioVideo.push(data);
+ }
+ console.log(
+ this.ruleForm.radioImg,
+ this.ruleForm.radioVideo,
+ this.ruleForm.radioMusic
+ );
}
}
};
@@ -749,3 +1178,36 @@ export default {
width: 100%;
}
+
diff --git a/src/views/user/index.vue b/src/views/user/index.vue
index ff89716..2bf093f 100644
--- a/src/views/user/index.vue
+++ b/src/views/user/index.vue
@@ -2,49 +2,92 @@
-
+
-
+
-
+
-
+
- 搜索
- 重置
+ 搜索
+ 重置
-
+
-
-
-
-
+
+
+
+
![]()
+
+
+
+
+
+
+
+
- 修改等级
+ 修改等级
+
@@ -66,47 +109,75 @@