This commit is contained in:
cwchen 2025-02-20 19:44:53 +08:00
commit 7ce0661136
6 changed files with 52 additions and 30 deletions

View File

@ -29,6 +29,24 @@ export const encryptCBC = function(word) {
}) })
return encrypted.toString() return encrypted.toString()
} }
/**
* 加密
* @param word
* @returns {string}
*/
export const encryptCBCToken = function(word) {
const srcs = CryptoJS.enc.Utf8.parse(word)
const encrypted = CryptoJS.AES.encrypt(srcs, cbc_key, {
iv: cbc_iv,
mode: CryptoJS.mode.CBC,
padding: CryptoJS.pad.Pkcs7
})
return encrypted.toString()
}
/** /**
* 解密 * 解密
* @param word * @param word

View File

@ -12,7 +12,7 @@
<script> <script>
import { filePreview, lookFaceFile, lookFile, lookMioIoFile,downloadFile } from '@/utils/bns-kkFile-preview' // Assuming Base64 is saved as a separate module import { filePreview, lookFaceFile, lookFile, lookMioIoFile,downloadFile } from '@/utils/bns-kkFile-preview' // Assuming Base64 is saved as a separate module
import useBase64 from '@/utils/base64Utils' import useBase64 from '@/utils/base64Utils'
import { encryptCBC } from '@/utils/aescbc' import { encryptCBC, encryptCBCToken } from '@/utils/aescbc'
export default { export default {
name: 'FileHandler', name: 'FileHandler',
@ -78,7 +78,8 @@ export default {
let fileUploadPath = filePath let fileUploadPath = filePath
let filePreviewPath let filePreviewPath
let time = encryptCBC(Math.floor(Date.now()).toString()) let time = encryptCBCToken(Math.floor(Date.now()).toString())
console.log("time",time)
if (suffix.toLowerCase() === 'pdf') { if (suffix.toLowerCase() === 'pdf') {
filePreviewPath = filePath.includes('http') ? filePath : `${this.lookFile}/${filePath}` filePreviewPath = filePath.includes('http') ? filePath : `${this.lookFile}/${filePath}`
this.showDownloadButton = false this.showDownloadButton = false

View File

@ -951,8 +951,8 @@ export default {
return selectedUserNames.join(", "); return selectedUserNames.join(", ");
}, },
getSelectedUserNameEvecTion() { getSelectedUserNameEvecTion(formData) {
const selectedUserIdsStr = this.form.hostUserId; const selectedUserIdsStr = formData.hostUserId;
// //
const selectedUserIds = selectedUserIdsStr const selectedUserIds = selectedUserIdsStr
.split(",") .split(",")
@ -972,6 +972,7 @@ export default {
console.log(this.form); console.log(this.form);
this.$refs["form"].validate((valid) => { this.$refs["form"].validate((valid) => {
if (valid) { if (valid) {
let formData = _.cloneDeep(this.form);
var lists = this.form.orgHeadUserIdList.join(","); var lists = this.form.orgHeadUserIdList.join(",");
var idsArray = lists.split(","); var idsArray = lists.split(",");
console.log("idsArray", idsArray); console.log("idsArray", idsArray);
@ -992,10 +993,10 @@ export default {
// return ; // return ;
// } // }
console.log(filteredIds); console.log(filteredIds);
this.form.travelers = filteredIds.join(","); formData.travelers = filteredIds.join(",");
console.log(this.form.travelers); console.log(formData.travelers);
var nameList = this.getSelectedUserNames(filteredIds); var nameList = this.getSelectedUserNames(filteredIds);
this.form.travelersName = nameList; formData.travelersName = nameList;
var list = this.form.hostUserId.join(","); var list = this.form.hostUserId.join(",");
// //
@ -1007,19 +1008,19 @@ export default {
this.$modal.msgError("选择’/‘后不能在选择其他人员"); this.$modal.msgError("选择’/‘后不能在选择其他人员");
return; return;
} }
this.form.hostUserId = list; formData.hostUserId = list;
var hostNameList = this.getSelectedUserNameEvecTion(); var hostNameList = this.getSelectedUserNameEvecTion(formData);
this.form.hostUserName = hostNameList; formData.hostUserName = hostNameList;
if (this.form.id != undefined) { if (this.form.id != undefined) {
this.form.examineStatus = 0; formData.examineStatus = 0;
updateEvection(this.form).then((response) => { updateEvection(formData).then((response) => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
this.open = false; this.open = false;
this.getList(); this.getList();
}); });
} else { } else {
addEvection(this.form).then((response) => { addEvection(formData).then((response) => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.open = false; this.open = false;
this.getList(); this.getList();

View File

@ -647,10 +647,10 @@ export default {
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm: function () { submitForm: function () {
console.log(this.form)
this.$refs["form"].validate(valid => { this.$refs["form"].validate(valid => {
if (valid) { if (valid) {
console.log(this.form) console.log(this.form)
let formData = _.cloneDeep(this.form);
var list = this.form.hostUserId.join(","); var list = this.form.hostUserId.join(",");
// //
const userIdArray = list.split(','); const userIdArray = list.split(',');
@ -662,19 +662,19 @@ export default {
return ; return ;
} }
this.form.hostUserId = list; formData.hostUserId = list;
var nameList = this.getSelectedUserNameLeave(); var nameList = this.getSelectedUserNameLeave(formData);
this.form.hostUserName = nameList; formData.hostUserName = nameList;
if (this.form.id != undefined) { if (this.form.id != undefined) {
this.form.examineStatus = 0 formData.examineStatus = 0
updateLeaveReporting(this.form).then(response => { updateLeaveReporting(formData).then(response => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
this.open = false; this.open = false;
this.getList(); this.getList();
}); });
} else { } else {
addLeaveReporting(this.form).then(response => { addLeaveReporting(formData).then(response => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.open = false; this.open = false;
this.getList(); this.getList();
@ -684,8 +684,8 @@ export default {
}); });
}, },
getSelectedUserNameLeave() { getSelectedUserNameLeave(formData) {
const selectedUserIdsStr = this.form.hostUserId; const selectedUserIdsStr = formData.hostUserId;
// //
const selectedUserIds = selectedUserIdsStr.split(',').map(id => parseInt(id.trim(), 10)); const selectedUserIds = selectedUserIdsStr.split(',').map(id => parseInt(id.trim(), 10));

View File

@ -607,6 +607,7 @@ export default {
this.$refs["form"].validate(valid => { this.$refs["form"].validate(valid => {
if (valid) { if (valid) {
console.log(this.form) console.log(this.form)
let formData = _.cloneDeep(this.form);
var list = this.form.hostUserId.join(","); var list = this.form.hostUserId.join(",");
// //
@ -619,16 +620,16 @@ export default {
return; return;
} }
this.form.hostUserId = list; formData.hostUserId = list;
if (this.form.id != undefined) { if (this.form.id != undefined) {
this.form.examineStatus = 0 formData.examineStatus = 0
updateHoliday(this.form).then(response => { updateHoliday(formData).then(response => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
this.open = false; this.open = false;
this.getList(); this.getList();
}); });
} else { } else {
addHoliday(this.form).then(response => { addHoliday(formData).then(response => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.open = false; this.open = false;
this.getList(); this.getList();

View File

@ -573,6 +573,7 @@ export default {
this.$refs['form'].validate(valid => { this.$refs['form'].validate(valid => {
if (valid) { if (valid) {
console.log(this.form) console.log(this.form)
let formData = _.cloneDeep(this.form);
var list = this.form.hostUserId.join(',') var list = this.form.hostUserId.join(',')
// //
@ -585,16 +586,16 @@ export default {
return return
} }
this.form.hostUserId = list formData.hostUserId = list
if (this.form.id != undefined) { if (this.form.id != undefined) {
this.form.examineStatus = 0 formData.examineStatus = 0
updateHoliday(this.form).then(response => { updateHoliday(formData).then(response => {
this.$modal.msgSuccess('修改成功') this.$modal.msgSuccess('修改成功')
this.open = false this.open = false
this.getList() this.getList()
}) })
} else { } else {
addHoliday(this.form).then(response => { addHoliday(formData).then(response => {
this.$modal.msgSuccess('新增成功') this.$modal.msgSuccess('新增成功')
this.open = false this.open = false
this.getList() this.getList()