This commit is contained in:
2020-07-28 21:00:51 +00:00
parent 2c850d68ab
commit 65e3540b59
7 changed files with 59 additions and 29 deletions

View File

@@ -161,8 +161,6 @@ export default {
}
},
closeChip(item) {
// console.log(item);
// debugger;
let i = this.toUsers.findIndex(z => z.id == item.id);
if (i != -1) {
this.toUsers.splice(i, 1);
@@ -318,7 +316,17 @@ async function fetchTranslatedText(vm) {
// Pre fill if pre-selected users
//
async function preFillSelection(vm) {
let l = vm.$route.params.userIdList.split(",").map(z => parseInt(z, 10));
var idParam = vm.$route.params.userIdList;
let l = [];
if (idParam.includes(",")) {
//just a random list of user ids seperated by commas
l = idParam.split(",").map(z => parseInt(z, 10));
} else {
//single value
l.push(parseInt(idParam, 10));
}
//l = window.$gz._.uniq(l);
//iterate the array, fetch and store each user returned from
//pick-list/List?ayaType=3&preId=[IDVALUE]
//into vm.toUsers
@@ -327,7 +335,7 @@ async function preFillSelection(vm) {
continue;
}
let res = await window.$gz.api.get("pick-list/List?ayaType=3&preId=" + i);
if (res.data) {
if (res.data && res.data.length > 0) {
vm.toUsers.push(res.data[0]);
}
}