diff --git a/src/views/sce/sceInfo/index.vue b/src/views/sce/sceInfo/index.vue
index 8f377c5..59e3b36 100644
--- a/src/views/sce/sceInfo/index.vue
+++ b/src/views/sce/sceInfo/index.vue
@@ -112,10 +112,7 @@
-
-
-
+
-
+
-
+
新建新增
@@ -240,13 +242,12 @@
- {{ item.processName }}
+
+
+ 关联流程
@@ -310,6 +314,8 @@
新建新增
@@ -373,7 +379,7 @@
@@ -382,13 +388,19 @@
- {{ item.processName }}
+
+
+ 关联流程
@@ -443,6 +455,8 @@
新建新增
@@ -509,7 +523,7 @@
@@ -524,7 +538,13 @@
- {{ item.processName }}
+
+
+ 关联流程
@@ -579,6 +599,8 @@
新建新增
@@ -706,7 +728,8 @@ export default {
title: [{ required: true, message: "请输入标题名称", trigger: "blur" }],
labelName: [
{ required: true, message: "请输入标签名称", trigger: "blur" }
- ]
+ ],
+ cover: [{ required: true, message: "请选择封面", trigger: "blur" }]
},
dialog: {
title: "新增剧本",
@@ -741,7 +764,14 @@ export default {
Visible: false
},
list: {},
- typeUrl: ""
+ typeUrl: "",
+ imgType: false,
+ musicType: false,
+ videoType: false,
+ imgIndex: "",
+ musicIdnex: "",
+ videoIndex: "",
+ dataList: {}
};
},
mounted() {
@@ -756,6 +786,15 @@ export default {
}
}
},
+ ForChannel(e) {
+ console.log(e);
+ console.log(this.ruleForm.processesList);
+ for (var i = 0; i < this.ruleForm.processesList.length; i++) {
+ if (this.ruleForm.processesList[i].code == e) {
+ return this.ruleForm.processesList[i].title;
+ }
+ }
+ },
//获取列表
async queryList() {
this.loading = true;
@@ -805,17 +844,60 @@ export default {
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);
+ res.data.resourcesList.map(n => {
+ var a = []
+ var b = []
+ var c = []
+ if (n.mediaType == 1 && n.sourceType == 2) {
+ 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(',')
+ };
+ });
+ this.radioImg = n.sourceType;
+ } else if (n.mediaType == 1 && n.sourceType == 1) {
+ a.push(n);
+ this.imgData = a
this.radioImg = n.sourceType;
}
- if (n.mediaType == 2) {
- this.ruleForm.radioMusic.push(n);
+ if (n.mediaType == 2 && n.sourceType == 1) {
+ b.push(n)
+ this.musicData = b
+ this.radioMusic = n.sourceType;
+ } else if (n.mediaType == 2 && n.sourceType == 2) {
+ 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(',')
+ };
+ });
this.radioMusic = n.sourceType;
}
- if (n.mediaType == 3) {
- this.ruleForm.radioVideo.push(n);
+ if (n.mediaType == 3 && n.sourceType == 1) {
+ c.push(n)
+ this.videoData = c
+ this.radioVideo = n.sourceType;
+ } else if (n.mediaType == 3 && n.sourceType == 2) {
+ 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(',')
+ };
+ });
this.radioVideo = n.sourceType;
}
});
@@ -842,34 +924,102 @@ export default {
this.dialog.title = "新增剧本";
},
async subMit() {
+ console.log(this.imgType, this.musicType, this.videoType);
+ console.log(this.radioImg, this.radioMusic, this.radioVideo);
+ if (this.imgType == true && this.radioImg == 1) {
+ this.$message({
+ message: "请绑定图片相关流程",
+ type: "error"
+ });
+ return false;
+ }
+ if (this.musicType == true && this.radioMusic == 1) {
+ this.$message({
+ message: "请绑定音频相关流程",
+ type: "error"
+ });
+ return false;
+ }
+ if (this.videoType == true && this.radioVideo == 1) {
+ this.$message({
+ message: "请绑定视频相关流程",
+ type: "error"
+ });
+ return false;
+ }
this.ruleForm.imgUrl = this.dataImg.join(",");
- this.ruleForm.resourcesList = this.ruleForm.resourcesList
- .concat(this.ruleForm.radioImg)
+ if (this.radioImg == 1) {
+ this.ruleForm.radioImg = this.imgData;
+ }
+ if (this.radioMusic == 1) {
+ this.ruleForm.radioMusic = this.musicData;
+ }
+ if (this.radioVideo == 1) {
+ this.ruleForm.radioVideo = this.videoData;
+ }
+ let data = this.ruleForm.radioImg
.concat(this.ruleForm.radioMusic)
.concat(this.ruleForm.radioVideo);
+ let list = [];
+ data.map(n => {
+ if (n.url != "") {
+ list.push(n);
+ }
+ });
+ this.ruleForm.resourcesList = list.map(n => {
+ return {
+ mediaType: n.mediaType,
+ sourceType: n.sourceType,
+ title: n.title,
+ url: n.url,
+ processId: n.processId.join(",")
+ };
+ });
+ console.log(this.imgData, "有变化吗");
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 {
+ this.$refs["ruleForm"].validate(async valid => {
+ if (valid) {
+ if (this.type == "add") {
+ var res = await addJbInfo(this.ruleForm);
+ } else if (this.type == "edit") {
+ 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"
+ });
+ }
+ }
+ });
+ } catch (err) {
+ console.log(err);
+ }
+ },
+ dealRdata(attchments, keyname) {
+ //attchments:数组,键值
+ let list = [...attchments];
+ let result = [];
+ let obj = {};
+ for (let i = 0; i < list.length; i++) {
+ if (!obj[list[i][keyname]]) {
+ result.push(list[i]);
+ obj[list[i].wjDx] = true;
+ }
+ }
+ return result;
},
// 编辑
handleEdit(row) {
- console.log(row);
+ this.queryListDetail(row.id);
this.dialog.Visible = true;
+ this.type = "edit";
this.dialog.title = "编辑剧本";
- this.ruleForm = row;
},
// 查看
handleView(row) {
@@ -983,19 +1133,34 @@ export default {
},
changeImg(val) {
this.radioImg = val;
+ this.ruleForm.radioImg = [];
+ this.imgData = [];
},
changeMusic(val) {
this.radioMusic = val;
+ this.ruleForm.radioMusic = [];
+ this.musicData = [];
},
changeVideo(val) {
this.radioVideo = val;
+ this.ruleForm.radioVideo = [];
+ this.videoData = [];
+ },
+ changePro(type) {
+ if (type == "img") {
+ this.imgType = false;
+ } else if (type == "music") {
+ this.musicType = false;
+ } else if (type == "video") {
+ this.videoType = false;
+ }
},
//新增图片资源
handleAddImg() {
this.ruleForm.radioImg.push({
title: "",
url: "",
- processId: "",
+ processId: [],
mediaType: 1,
sourceType: this.radioImg
});
@@ -1004,7 +1169,7 @@ export default {
this.ruleForm.radioMusic.push({
title: "",
url: "",
- processId: "",
+ processId: [],
mediaType: 2,
sourceType: this.radioMusic
});
@@ -1013,7 +1178,7 @@ export default {
this.ruleForm.radioVideo.push({
title: "",
url: "",
- processId: "",
+ processId: [],
mediaType: 3,
sourceType: this.radioVideo
});
@@ -1023,45 +1188,39 @@ export default {
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
- // });
+ this.imgData.push({
+ url: res.data.wjUrl,
+ processName: "",
+ title: ""
+ });
+ this.imgType = true;
});
},
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
- // });
+ this.musicData.push({
+ url: res.data.wjUrl,
+ processName: "",
+ title: ""
+ });
+ this.musicType = true;
});
},
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
- // });
+ this.videoData.push({
+ url: res.data.wjUrl,
+ processName: "",
+ title: ""
+ });
+ this.musicType = true;
});
},
// 图片删除
@@ -1077,57 +1236,63 @@ export default {
this.videoData.splice(index, 1);
}
console.log(item);
- delFile({ wjUrl: item }).then(res => {
+ delFile({ wjUrl: item.url }).then(res => {
if (res.code == 200) {
this.$message.success("删除成功");
}
});
},
//关联流程
- setLc(item, type) {
+ setLc(item, i, type) {
+ console.log(item, i, this.imgData);
+ if (this.ruleForm.processesList.length == 0) {
+ this.$message({
+ message: "请新建流程",
+ type: "error"
+ });
+ return false;
+ }
+ if (type == "img") {
+ this.imgIndex = i;
+ } else if (type == "music") {
+ this.musicIdnex = i;
+ } else if (type == "video") {
+ this.videoIndex = i;
+ }
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);
+ this.imgType = false;
+ this.imgData[this.imgIndex].processName = this.ForChannel(
+ this.processId
+ );
+ this.imgData[this.imgIndex].processId = [this.processId];
+ this.imgData[this.imgIndex].mediaType = 1;
+ this.imgData[this.imgIndex].sourceType = this.radioImg;
}
if (this.typeUrl == "music") {
- let data = {
- title: "",
- url: this.list,
- processId: this.processId,
- mediaType: 2,
- sourceType: this.radioMusic
- };
- this.ruleForm.radioMusic.push(data);
+ this.musicType = false;
+ this.musicData[this.imgIndex].processName = this.ForChannel(
+ this.processId
+ );
+ this.musicData[this.musicIndex].processId = [this.processId];
+ this.musicData[this.musicIndex].mediaType = 2;
+ this.musicData[this.musicIndex].sourceType = this.radioImg;
}
if (this.typeUrl == "video") {
- let data = {
- title: "",
- url: this.list,
- processId: this.processId,
- mediaType: 3,
- sourceType: this.radioVideo
- };
- this.ruleForm.radioVideo.push(data);
+ this.videoType = false;
+ this.videoData[this.videoIndex].processName = this.ForChannel(
+ this.processId
+ );
+ this.videoData[this.videoIndex].processId = [this.processId];
+ this.videoData[this.videoIndex].mediaType = 3;
+ this.videoData[this.videoIndex].sourceType = this.radioImg;
}
- console.log(
- this.ruleForm.radioImg,
- this.ruleForm.radioVideo,
- this.ruleForm.radioMusic
- );
}
}
};
diff --git a/src/views/sce/tips/index.vue b/src/views/sce/tips/index.vue
index 44dc977..6c3530e 100644
--- a/src/views/sce/tips/index.vue
+++ b/src/views/sce/tips/index.vue
@@ -8,6 +8,8 @@
v-model="queryParams.query.scenarioId"
clearable
placeholder="请选择剧本标题"
+ @change="chageLc"
+ @visible-change='foucsLc'
>
-
-
-
-
-
- {{ form.date }}
-
-
-
- {{ form.level }}
-
-
-
-
-
-
-
+
+
+
+
+
+ {{ data.nickName }}
+
+
+ {{ levelormat(data) }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -128,21 +187,35 @@ export default {
query: {
nickName: undefined,
code: undefined,
- phonenumber: undefined
- },
- params: {
- beginTime: undefined,
- endTime: undefined
+ phonenumber: undefined,
+ params: {
+ beginTime: undefined,
+ endTime: undefined
}
+ },
},
+ time: [],
total: 0,
tableData: [],
- form: {},
+ form: {
+ userId: ""
+ },
dialog: {
- Visible: false
- }
+ Visible: false,
+ title: ""
+ },
+ level: [],
+ data: {},
+ type: "level"
};
},
+ created() {
+ this.getDicts("jbs_user_level").then(res => {
+ console.log(res, 412312);
+ this.level = res.data;
+ console.log(this.level, "字典");
+ });
+ },
mounted() {
this.queryUserInfo();
},
@@ -152,21 +225,120 @@ export default {
this.loading = true;
try {
let res = await queryUserInfo(this.queryParams);
- console.log(res)
- if(res.code == 200){
+ if (res.code == 200) {
this.loading = false;
- this.tableData = res.data.rows;
- this.total = res.data.total;
+ this.tableData = res.rows;
+ this.total = res.total;
}
-
} catch (err) {
console.log(err);
}
},
+ //搜索
+ search() {
+ if (this.time != null) {
+ if (this.time.length > 0) {
+ this.queryParams.query.params.beginTime = this.time[0];
+ this.queryParams.query.params.endTime = this.time[1];
+ }
+ } else {
+ this.time = [];
+ this.queryParams.query.params.beginTime = undefined;
+ this.queryParams.query.params.endTime = undefined;
+ }
+ console.log(this.time);
+ console.log(this.queryParams);
+ this.queryUserInfo()
+ },
+ //重置
+ refresh() {
+ this.time = []
+ this.queryParams = {
+ pageNum: 1,
+ pageSize: 15,
+ query: {
+ nickName: undefined,
+ code: undefined,
+ phonenumber: undefined
+ },
+ params: {
+ beginTime: undefined,
+ endTime: undefined
+ }
+ }
+ this.queryUserInfo()
+ },
+ // 任务组名字典翻译
+ levelormat(row, column) {
+ return this.selectDictLabel(this.level, row.level);
+ },
// 编辑用户等级
handleEdit(row) {
+ this.form = {}
this.dialog.Visible = true;
- this.form = row;
+ this.dialog.title = "修改用户等级";
+ this.type = "level";
+ this.form.userId = row.userId;
+ this.data = row;
+ },
+ //编辑用户编号
+ handleEditCode(row) {
+ this.form = {}
+ this.dialog.Visible = true;
+ this.dialog.title = "修改用户编号";
+ this.form.userId = row.userId;
+ this.type = "code";
+ this.data = row;
+ },
+ //编辑客户备注
+ handleEditRemark(row) {
+ this.form = {}
+ this.dialog.Visible = true;
+ this.dialog.title = "修改用户备注";
+ this.form.userId = row.userId;
+ this.type = "remark";
+ this.data = row;
+ },
+ //提交表单
+ async subMit() {
+ if(this.type == "level"){
+ if(this.form.level == undefined || this.form.level == ''){
+ this.$message({
+ message: '请选择用户等级',
+ type: "error"
+ });
+ return false;
+ }
+ }
+ if(this.type == "code"){
+ console.log(this.form.code,312321)
+ if(this.form.code == undefined || this.form.code == ''){
+ this.$message({
+ message: '请输入用户编号',
+ type: "error"
+ });
+ return false;
+ }
+ }
+ if(this.type == "remark"){
+ if(this.form.remark == undefined || this.form.remark == ''){
+ this.$message({
+ message: '请输入用户备注',
+ type: "error"
+ });
+ return false;
+ }
+ }
+ try {
+ let res = await updateUserInfo(this.form);
+ if (res.code == 200) {
+ this.$message.success("修改成功");
+ this.dialog.Visible = false;
+ this.queryUserInfo();
+ }
+ } catch (err) {
+ console.log(err);
+ }
}
}
};