From 09dd596217f08adda497a5cb338752a207c792fd Mon Sep 17 00:00:00 2001 From: X_Rian <904416525@qq.com> Date: Fri, 11 Oct 2024 17:03:53 +0800 Subject: [PATCH] =?UTF-8?q?flx=EF=BC=9A=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../configManage/personnelAccess.vue | 727 ++++++++---------- .../components/overviewProject.vue | 2 +- .../scheduleManage/components/weeklyPlan.vue | 2 +- 3 files changed, 344 insertions(+), 387 deletions(-) diff --git a/src/views/projectFront/configManage/personnelAccess.vue b/src/views/projectFront/configManage/personnelAccess.vue index ffe537dd..e63b9fdf 100644 --- a/src/views/projectFront/configManage/personnelAccess.vue +++ b/src/views/projectFront/configManage/personnelAccess.vue @@ -31,19 +31,8 @@ - - - + + @@ -51,10 +40,7 @@ @@ -62,30 +48,28 @@ {{ $t("message.alarmWarning.query") }}{{ $t('message.alarmWarning.query') }} - {{ - $t("message.alarmValueSet.refresh") - }} + {{ $t('message.alarmValueSet.refresh') }} {{ $t("message.videoManage.add") }}{{ $t('message.videoManage.add') }} - - + + {{ scope.row.projectOrgName }} - - - - - + + + + + + 配置装置 - {{ $t("message.projectInfo.configCompany") }} + {{ $t('message.projectInfo.configCompany') }} - {{ $t("message.projectInfo.configGate") }} + {{ $t('message.projectInfo.configGate') }} - {{ $t("message.projectInfo.configVideo") }} + {{ $t('message.projectInfo.configVideo') }} - - {{ $t("message.alarmValueSet.edit") }} + + {{ $t('message.alarmValueSet.edit') }} - - {{ $t("message.alarmValueSet.delete") }} + + {{ $t('message.alarmValueSet.delete') }} @@ -249,14 +206,8 @@ class="dialogFormBox" :rules="formRules" > - - + + - + - - - - - + + + - - - - + + + @@ -344,34 +258,58 @@ - - + + + + + + + + + + + + {{ $t('message.projectInfo.allChoose') }} + + + + + + + + - + - {{ $t("message.projectInfo.allChoose") }} + {{ $t('message.projectInfo.allChoose') }} @@ -478,30 +404,19 @@ - + - {{ $t("message.projectInfo.allChoose") }} + {{ $t('message.projectInfo.allChoose') }} - + - - {{ city.devName }} + + {{ + city.devName + }} @@ -562,13 +461,11 @@ import { addOrEditUserDevAuthorityApi, selecAllVideoListApi, getTreeGroupApi, -} from "@/assets/js/api/configManage"; -import { - getEnterpriseInfoList, - ufaceDevList, - selectHierarchyEnterpriseListApi, -} from "@/assets/js/api/laborPerson"; -import { deleteSystemUserApi } from "@/assets/js/api/account"; + addSystemUserBindDeviceApi +} from '@/assets/js/api/configManage'; +import { getEnterpriseInfoList, ufaceDevList, selectHierarchyEnterpriseListApi } from '@/assets/js/api/laborPerson'; +import { deleteSystemUserApi } from '@/assets/js/api/account'; +import { getDeviceUnitPage } from '@/assets/js/api/project'; export default { created() { this.getRoleList(); @@ -579,125 +476,122 @@ export default { this.getProjectList(); this.getTreeList(); this.getTreeEnterpriseList(); + this.getDeviceUnitList(); }, data() { return { treeDatas: [], - groupName: "", + groupName: '', defaultExpandArr: [], // 树形对应的字段 defaultTreeProps: { - children: "children", - label: "enterpriseName", + children: 'children', + label: 'enterpriseName' }, // 对应的字段 defaultProps: { - children: "children", - label: "deptName", + children: 'children', + label: 'deptName' }, treeList: [], - selectVal: "", + selectVal: '', selectTreeData: {}, - workerName: "", + workerName: '', addEditForm: { - account: "", - password: "", - xzProjectOrgId: "", - roleId: "", - userId: "", - externalAccount: "", + account: '', + password: '', + xzProjectOrgId: '', + roleId: '', + userId: '', + externalAccount: '' }, screen: [ // {id:0,name:" "}, - { id: 1, name: "专业分包" }, - { id: 2, name: "设备分包" }, - { id: 3, name: "材料分包" }, - { id: 4, name: "后勤服务" }, - { id: 5, name: "特殊设备" }, - { id: 6, name: "劳务分包" }, - { id: 7, name: "监理单位" }, - { id: 8, name: "建设单位" }, - { id: 9, name: "总承包单位" }, - { id: 10, name: "勘查单位" }, - { id: 11, name: "设计单位" }, - { id: 12, name: "其他" }, + { id: 1, name: '专业分包' }, + { id: 2, name: '设备分包' }, + { id: 3, name: '材料分包' }, + { id: 4, name: '后勤服务' }, + { id: 5, name: '特殊设备' }, + { id: 6, name: '劳务分包' }, + { id: 7, name: '监理单位' }, + { id: 8, name: '建设单位' }, + { id: 9, name: '总承包单位' }, + { id: 10, name: '勘查单位' }, + { id: 11, name: '设计单位' }, + { id: 12, name: '其他' } ], - screenStr: "", + screenStr: '', formRules: { account: [ { required: true, - message: this.$t("message.personnelPosition.required"), - trigger: "blur", - }, + message: this.$t('message.personnelPosition.required'), + trigger: 'blur' + } ], password: [ { required: true, - message: this.$t("message.personnelPosition.required"), - trigger: "blur", + message: this.$t('message.personnelPosition.required'), + trigger: 'blur' }, { - pattern: - /^(?=.*\d)(?=.*[a-zA-Z])(?=.*[!@#$%^&*()_+~`\-={}[\]:";'<>?,./])[a-zA-Z\d!@#$%^&*()_+~`\-={}[\]:";'<>?,./]{8,}$/, - message: - "密码必须包含至少一个字母、一个数字、一个特殊字符以及长度至少为8位数", - trigger: "blur", - }, + pattern: /^(?=.*\d)(?=.*[a-zA-Z])(?=.*[!@#$%^&*()_+~`\-={}[\]:";'<>?,./])[a-zA-Z\d!@#$%^&*()_+~`\-={}[\]:";'<>?,./]{8,}$/, + message: '密码必须包含至少一个字母、一个数字、一个特殊字符以及长度至少为8位数', + trigger: 'blur' + } ], showPassword: [ { required: true, - message: this.$t("message.personnelPosition.required"), - trigger: "blur", + message: this.$t('message.personnelPosition.required'), + trigger: 'blur' }, { - pattern: - /^(?=.*\d)(?=.*[a-zA-Z])(?=.*[!@#$%^&*()_+~`\-={}[\]:";'<>?,./])[a-zA-Z\d!@#$%^&*()_+~`\-={}[\]:";'<>?,./]{8,}$/, - message: - "密码必须包含至少一个字母、一个数字、一个特殊字符以及长度至少为8位数", - trigger: "blur", - }, + pattern: /^(?=.*\d)(?=.*[a-zA-Z])(?=.*[!@#$%^&*()_+~`\-={}[\]:";'<>?,./])[a-zA-Z\d!@#$%^&*()_+~`\-={}[\]:";'<>?,./]{8,}$/, + message: '密码必须包含至少一个字母、一个数字、一个特殊字符以及长度至少为8位数', + trigger: 'blur' + } ], xzProjectOrgId: [ { required: true, - message: "请选择", - trigger: "change", - }, + message: '请选择', + trigger: 'change' + } ], userId: [ { required: true, - message: this.$t("message.personnelPosition.required"), - trigger: "change", - }, + message: this.$t('message.personnelPosition.required'), + trigger: 'change' + } ], roleId: [ { required: true, - message: this.$t("message.personnelPosition.required"), - trigger: "change", - }, + message: this.$t('message.personnelPosition.required'), + trigger: 'change' + } ], workerId: [ { required: true, - message: this.$t("message.personnelPosition.required"), - trigger: "change", - }, - ], + message: this.$t('message.personnelPosition.required'), + trigger: 'change' + } + ] }, List: [], Popup: { - type: "add", - show: false, + type: 'add', + show: false }, queryInfo: {}, pagInfo: { pageNo: 1, //页数 pageSize: 10, //条数 - total: 0, //总条数 + total: 0 //总条数 }, personList: [], roleList: [], @@ -706,15 +600,35 @@ export default { companyDialog: false, checkAll: false, isIndeterminate: false, - editComapnyDataId: "", + editComapnyDataId: '', //配置可查看或管理的设备相关参数 allUfaceDev: [], allVideoDev: [], configDevDialog: false, configDevType: 1, //1人脸设备,2视频监控 + + companyDialog1: false, + checkAll1: false, + isIndeterminate1: false, + treeDatas1: [], + // 树形对应的字段 + defaultTreeProps1: { + children: 'children', + label: 'deviceUnitName' + } }; }, methods: { + getDeviceUnitList() { + let param = { + projectSn: this.$store.state.projectSn, + pageNo: 1, + pageSize: -1 + }; + getDeviceUnitPage(param).then(res => { + this.treeDatas1 = res.result.records; + }); + }, // getItemByIdInTree(value,path=""){ // for(var i=0;i { + arr.map(item => { this.$refs.treeRef.setChecked(item.id, true, true); if (item.children && item.children.length) { this.handleTreeCheckAllFn(item.children); } }); }, + handleTreeCheckAllChange1(val) { + this.isIndeterminate1 = false; + if (this.checkAll1 == true) { + for (let i = 0; i < this.treeDatas1.length; i++) { + this.$refs.treeRef1.setChecked(this.treeDatas1[i].id, true, true); + if (this.treeDatas1[i].children) { + this.handleTreeCheckAllFn(this.treeDatas1[i].children); + } + } + } else { + this.$refs.treeRef1.setCheckedKeys([]); + } + }, handleTreeCheckAllChange(val) { this.isIndeterminate = false; if (this.checkAll == true) { @@ -777,25 +704,25 @@ export default { } }, // 检查是否有未勾选的节点 - hasUncheckedNodes(treeData) { - const tree = this.$refs.treeRef; - return treeData.some((node) => { + hasUncheckedNodes(treeData, treeRef) { + const tree = treeRef; + return treeData.some(node => { const isUnchecked = !tree.getNode(node).checked && !tree.getNode(node).indeterminate; if (isUnchecked) return true; if (node.children && node.children.length) { - return this.hasUncheckedNodes(node.children); + return this.hasUncheckedNodes(node.children, treeRef); } return false; }); }, // 检查是否有勾选的节点 - hasCheckedNodes(treeData) { - const tree = this.$refs.treeRef; - return treeData.some((node) => { + hasCheckedNodes(treeData, treeRef) { + const tree = treeRef; + return treeData.some(node => { const isChecked = tree.getNode(node).checked; if (isChecked) return true; if (node.children && node.children.length) { - return this.hasCheckedNodes(node.children); + return this.hasCheckedNodes(node.children, treeRef); } return false; }); @@ -803,7 +730,7 @@ export default { // 检查是否有半选中的节点 hasIndeterminateNodes(treeData) { const tree = this.$refs.treeRef; - return treeData.some((node) => { + return treeData.some(node => { if (tree.getNode(node).indeterminate) return true; if (node.children && node.children.length) { return this.hasIndeterminateNodes(node.children); @@ -812,21 +739,41 @@ export default { }); }, // 获取当前选中的节点 + testCheckChange1() { + // 父子不关联用这套 + this.checkAll1 = true; // 默认先全选 + const tree = this.$refs.treeRef1; + // 使用方法 + const hasUnchecked = this.hasUncheckedNodes(this.treeDatas1, this.$refs.treeRef1); + const hasChecked = this.hasCheckedNodes(this.treeDatas1, this.$refs.treeRef1); + // const hasIndeterminate = this.hasIndeterminateNodes(this.treeDatas); + if (hasUnchecked && hasChecked) { + this.checkAll1 = false; + this.isIndeterminate1 = true; + } else if (!hasUnchecked && hasChecked) { + this.checkAll1 = true; + this.isIndeterminate1 = false; + } else if (!hasChecked) { + this.checkAll1 = false; + this.isIndeterminate1 = false; + } + }, + // 获取当前选中的节点 testCheckChange() { // 父子不关联用这套 this.checkAll = true; // 默认先全选 const tree = this.$refs.treeRef; // 使用方法 - const hasUnchecked = this.hasUncheckedNodes(this.treeDatas); - const hasChecked = this.hasCheckedNodes(this.treeDatas); + const hasUnchecked = this.hasUncheckedNodes(this.treeDatas, this.$refs.treeRef); + const hasChecked = this.hasCheckedNodes(this.treeDatas, this.$refs.treeRef); // const hasIndeterminate = this.hasIndeterminateNodes(this.treeDatas); if (hasUnchecked && hasChecked) { this.checkAll = false; this.isIndeterminate = true; - } else if(!hasUnchecked && hasChecked){ + } else if (!hasUnchecked && hasChecked) { this.checkAll = true; this.isIndeterminate = false; - } else if(!hasChecked){ + } else if (!hasChecked) { this.checkAll = false; this.isIndeterminate = false; } @@ -864,27 +811,28 @@ export default { }, getTreeEnterpriseList() { selectHierarchyEnterpriseListApi({ - projectSn: this.$store.state.projectSn, - }).then((result) => { + projectSn: this.$store.state.projectSn + }).then(result => { if (result.success) { this.treeDatas = result.result; + this.treeDatas1 = result.result; } }); }, workerSelect() { - let findItem = this.personList.find((item) => { + let findItem = this.personList.find(item => { return item.id == this.addEditForm.workerId; }); if (findItem) { this.addEditForm.personMail = findItem.personMail; } else { - this.addEditForm.personMail = ""; + this.addEditForm.personMail = ''; } }, getTreeList() { getTreeGroupApi({ - projectSn: this.$store.state.projectSn, - }).then((result) => { + projectSn: this.$store.state.projectSn + }).then(result => { if (result.success) { this.treeList = result.result; } @@ -894,7 +842,7 @@ export default { treeClick(data) { console.log(data); if (data.status == 1) { - this.$message.warning("无法选中已禁用组织"); + this.$message.warning('无法选中已禁用组织'); } else { this.selectVal = data.deptName; this.selectTreeData = data; @@ -903,15 +851,23 @@ export default { } }, // 配置树形配置 + configTreeDeviceFn(item) { + this.companyDialog1 = true; + this.addEditForm = JSON.parse(JSON.stringify(item)); + this.$nextTick(() => { + this.$refs.treeRef1.setCheckedKeys(item.deviceIdList); + }); + }, + // 配置树形配置 configTreeFn(item) { this.companyDialog = true; this.addEditForm = JSON.parse(JSON.stringify(item)); - selectUserEnterpriseByUserIdApi({ userId: item.userId }).then((res) => { + selectUserEnterpriseByUserIdApi({ userId: item.userId }).then(res => { let arr = []; if (res.result) { let id = res.result.enterpriseId; - for (let i = 0; i < id.split(",").length; i++) { - arr.push(id.split(",")[i]); + for (let i = 0; i < id.split(',').length; i++) { + arr.push(id.split(',')[i]); } this.$nextTick(() => { this.$refs.treeRef.setCheckedKeys(arr); @@ -933,7 +889,7 @@ export default { if (nodes[i].id === id) { return { node: nodes[i], - hasChildren: !!nodes[i].children && nodes[i].children.length > 0, + hasChildren: !!nodes[i].children && nodes[i].children.length > 0 }; } if (nodes[i].children && nodes[i].children.length > 0) { @@ -947,7 +903,7 @@ export default { if (!result.hasChildren) { return id; } else { - return ""; + return ''; } }, // configFn(item) { @@ -986,28 +942,28 @@ export default { this.addEditForm = JSON.parse(JSON.stringify(item)); selectUserDevAuthorityByUserIdApi({ userId: item.userId, - devType: devType, - }).then((res) => { + devType: devType + }).then(res => { if (res.result) { let id = res.result.devId; console.log(res.result.devId); this.editComapnyDataId = res.result.id; - if (id.indexOf(",") != -1) { + if (id.indexOf(',') != -1) { let arr = []; console.log(this.allUfaceDev, this.allVideoDev); if (this.configDevType == 1) { - this.allUfaceDev.forEach((item) => { - for (let i = 0; i < id.split(",").length; i++) { - if (item.id == id.split(",")[i]) { - arr.push(id.split(",")[i]); + this.allUfaceDev.forEach(item => { + for (let i = 0; i < id.split(',').length; i++) { + if (item.id == id.split(',')[i]) { + arr.push(id.split(',')[i]); } } }); } else { - this.allVideoDev.forEach((item) => { - for (let i = 0; i < id.split(",").length; i++) { - if (item.itemId == id.split(",")[i]) { - arr.push(id.split(",")[i]); + this.allVideoDev.forEach(item => { + for (let i = 0; i < id.split(',').length; i++) { + if (item.itemId == id.split(',')[i]) { + arr.push(id.split(',')[i]); } } }); @@ -1020,7 +976,7 @@ export default { } } else { this.selectCompanyData = []; - this.editComapnyDataId = ""; + this.editComapnyDataId = ''; } this.$nextTick(() => { this.handleCheckedCompanyChange(); @@ -1030,12 +986,12 @@ export default { handleCheckAllChange(val) { let arr = []; if (this.companyDialog) { - arr = this.enterpriseListData.map((item) => String(item.id)); + arr = this.enterpriseListData.map(item => String(item.id)); } else { if (this.configDevType == 1) { - arr = this.allUfaceDev.map((item) => String(item.id)); + arr = this.allUfaceDev.map(item => String(item.id)); } else { - arr = this.allVideoDev.map((item) => String(item.itemId)); + arr = this.allVideoDev.map(item => String(item.itemId)); } } this.selectCompanyData = val ? arr : []; @@ -1075,73 +1031,86 @@ export default { // this.companyDialog = false; // }); // }, + saveTreeCompanyFn1() { + const checked = this.$refs.treeRef1.getCheckedNodes(); + const halfChecked = this.$refs.treeRef1.getHalfCheckedNodes(); + const concatArr = checked.concat(halfChecked); + let ids = []; + concatArr.map(item => { + ids.push(item.id); + }); + addSystemUserBindDeviceApi({ + deviceIdList: ids, + userId: this.addEditForm.userId + // id: this.editComapnyDataId + }).then(result => { + this.companyDialog1 = false; + this.getList(); + }); + }, saveTreeCompanyFn() { const checked = this.$refs.treeRef.getCheckedNodes(); const halfChecked = this.$refs.treeRef.getHalfCheckedNodes(); const concatArr = checked.concat(halfChecked); let ids = []; - concatArr.map((item) => { + concatArr.map(item => { ids.push(item.id); }); addOrEditUserEnterpriseApi({ - enterpriseId: ids.join(","), + enterpriseId: ids.join(','), userId: this.addEditForm.userId, - id: this.editComapnyDataId, - }).then((result) => { + id: this.editComapnyDataId + }).then(result => { this.companyDialog = false; }); }, saveDevConfigDataFn() { - let ids = ""; + let ids = ''; if (this.selectCompanyData.length > 0) { - ids = this.selectCompanyData.join(","); + ids = this.selectCompanyData.join(','); } addOrEditUserDevAuthorityApi({ devId: ids, userId: this.addEditForm.userId, id: this.editComapnyDataId, - devType: this.configDevType, - }).then((result) => { + devType: this.configDevType + }).then(result => { this.configDevDialog = false; }); }, //获取企业 || 劳务公司 列表 getProjectList() { let data = { - projectSn: this.$store.state.projectSn, + projectSn: this.$store.state.projectSn // enterpriseName: this.enterpriseName, }; - getEnterpriseInfoList(data).then((res) => { + getEnterpriseInfoList(data).then(res => { this.enterpriseListData = res.result; // console.log(res.result); }); }, //获取所有的闸机设备 getMachineList() { - ufaceDevList({ projectSn: this.$store.state.projectSn }).then((list) => { + ufaceDevList({ projectSn: this.$store.state.projectSn }).then(list => { this.allUfaceDev = list.result; }); }, //获取所有视频设备 getAllVideo() { - selecAllVideoListApi({ projectSn: this.$store.state.projectSn }).then( - (result) => { - this.allVideoDev = result.result; - } - ); + selecAllVideoListApi({ projectSn: this.$store.state.projectSn }).then(result => { + this.allVideoDev = result.result; + }); }, //获取所有角色 getRoleList() { - getBaseRoleListApi({ projectSn: this.$store.state.projectSn }).then( - (result) => { - this.roleList = result.result; - } - ); + getBaseRoleListApi({ projectSn: this.$store.state.projectSn }).then(result => { + this.roleList = result.result; + }); }, loadPersonList() { getLaborManagementInfoListApi({ - projectSn: this.$store.state.projectSn, - }).then((res) => { + projectSn: this.$store.state.projectSn + }).then(res => { this.personList = res.result; }); }, @@ -1149,41 +1118,36 @@ export default { //打开弹窗前的统一处理 this.Popup = { type: type, - show: show, + show: show }; }, query() { - console.log("查询的参数", this.queryInfo); + console.log('查询的参数', this.queryInfo); this.getList(); }, filter() { console.log(this.queryInfo.enterpriseTypeId); getProjectChilderSystemUserListApi({ projectSn: this.$store.state.projectSn, - enterpriseTypeId: this.queryInfo.enterpriseTypeId, - }).then((res) => { - console.log("筛选参数" + res); + enterpriseTypeId: this.queryInfo.enterpriseTypeId + }).then(res => { + console.log('筛选参数' + res); }); }, add() { - this.handle("add", true); + this.handle('add', true); this.$nextTick(() => { this.selectTreeData = {}; - this.selectVal = ""; + this.selectVal = ''; this.defaultExpandArr = []; // this.$refs.groupTree.setCurrentKey(""); }); }, edit(obj) { - console.log("编辑", obj); + console.log('编辑', obj); this.addEditForm = JSON.parse(JSON.stringify(obj)); - if ( - typeof obj.alarmPushWorkerId === "string" && - obj.alarmPushWorkerId != "" - ) { - this.addEditForm.alarmPushWorkerId = obj.alarmPushWorkerId - .split(",") - .map(Number); + if (typeof obj.alarmPushWorkerId === 'string' && obj.alarmPushWorkerId != '') { + this.addEditForm.alarmPushWorkerId = obj.alarmPushWorkerId.split(',').map(Number); } if (this.addEditForm.xzProjectOrgObj) { this.selectTreeData = JSON.parse(this.addEditForm.xzProjectOrgObj); @@ -1191,11 +1155,11 @@ export default { this.defaultExpandArr = [this.selectTreeData.id]; } else { this.selectTreeData = {}; - this.selectVal = ""; + this.selectVal = ''; this.defaultExpandArr = []; } this.addEditForm.roleId = obj.roleId.split(','); - this.handle("edit", true); + this.handle('edit', true); this.$nextTick(() => { if (this.addEditForm.xzProjectOrgObj) { this.$refs.groupTree.setCurrentKey(this.addEditForm.xzProjectOrgId); @@ -1204,25 +1168,18 @@ export default { }); }, deleteDev(obj) { - console.log("删除", obj); + console.log('删除', obj); this.$confirm( - this.$t("message.personnelPosition.beaconManage.table.confirmText") + - "【" + - obj.workerName + - "】?", - this.$t("message.personnelPosition.beaconManage.table.Tips"), + this.$t('message.personnelPosition.beaconManage.table.confirmText') + '【' + obj.workerName + '】?', + this.$t('message.personnelPosition.beaconManage.table.Tips'), { - confirmButtonText: this.$t( - "message.personnelPosition.confirmButtonText" - ), - cancelButtonText: this.$t( - "message.personnelPosition.cancelButtonText" - ), - type: "warning", + confirmButtonText: this.$t('message.personnelPosition.confirmButtonText'), + cancelButtonText: this.$t('message.personnelPosition.cancelButtonText'), + type: 'warning' } ) .then(() => { - deleteSystemUserApi({ id: obj.userId }).then((result) => { + deleteSystemUserApi({ id: obj.userId }).then(result => { if (result.success) { this.$message.success(result.message); this.getList(); @@ -1232,7 +1189,7 @@ export default { .catch(() => {}); }, submit() { - this.$refs["addEditForm"].validate((valid) => { + this.$refs['addEditForm'].validate(valid => { if (valid) { let params = this.addEditForm; // params.alarmPushWorkerId = this.addEditForm.alarmPushWorkerId.join(','); @@ -1240,18 +1197,18 @@ export default { if (this.selectVal) { params.xzProjectOrgObj = JSON.stringify(this.selectTreeData); } - params.roleId = this.addEditForm.roleId.join(","); - if (this.Popup.type === "add") { - addProjectUserApi(params).then((result) => { + params.roleId = this.addEditForm.roleId.join(','); + if (this.Popup.type === 'add') { + addProjectUserApi(params).then(result => { if (result.success) { this.$message.success(result.message); this.getList(); this.Popup.show = false; } }); - } else if (this.Popup.type === "edit") { - console.log("编辑信息", this.addEditForm); - editProjectUserApi(params).then((result) => { + } else if (this.Popup.type === 'edit') { + console.log('编辑信息', this.addEditForm); + editProjectUserApi(params).then(result => { if (result.success) { this.$message.success(result.message); this.getList(); @@ -1260,25 +1217,25 @@ export default { }); } } else { - console.log("error submit!!"); + console.log('error submit!!'); return false; } }); }, refresh() { - this.workerName = ""; - this.screenStr = ""; + this.workerName = ''; + this.screenStr = ''; this.getList(); }, getList() { getProjectChilderSystemUserListApi({ projectSn: this.$store.state.projectSn, enterpriseTypeId: this.screenStr, - workerName: this.workerName, - }).then((result) => { + workerName: this.workerName + }).then(result => { if (result.success) { this.List = result.result; - console.log("列表", result); + console.log('列表', result); } }); }, @@ -1295,8 +1252,8 @@ export default { CurrentChange(val) { this.pagInfo.pageNo = val; this.getList(); - }, - }, + } + } };