Merge commit '0968c43f61e0183aaf47e38a482d037bc33fc434' into pro

This commit is contained in:
Pang 2024-03-06 01:05:39 +08:00
commit 3c33f02e9d
5 changed files with 30 additions and 10 deletions

View File

@ -858,7 +858,7 @@ class ApproveController extends AbstractController
BillExport::create()->setTitle($title)->setHeadings($headings)->setData($datas)->setStyles(["A1:Y1" => ["font" => ["bold" => true]]]) BillExport::create()->setTitle($title)->setHeadings($headings)->setData($datas)->setStyles(["A1:Y1" => ["font" => ["bold" => true]]])
]; ];
// //
$fileName = '审批记录_' . Base::time() . '.xls'; $fileName = '审批记录_' . Base::time() . '.xlsx';
$filePath = "temp/approve/export/" . date("Ym", Base::time()); $filePath = "temp/approve/export/" . date("Ym", Base::time());
$export = new BillMultipleExport($sheets); $export = new BillMultipleExport($sheets);
$res = $export->store($filePath . "/" . $fileName); $res = $export->store($filePath . "/" . $fileName);
@ -866,7 +866,7 @@ class ApproveController extends AbstractController
return Base::retError('导出失败,' . $fileName . ''); return Base::retError('导出失败,' . $fileName . '');
} }
$xlsPath = storage_path("app/" . $filePath . "/" . $fileName); $xlsPath = storage_path("app/" . $filePath . "/" . $fileName);
$zipFile = "app/" . $filePath . "/" . Base::rightDelete($fileName, '.xls') . ".zip"; $zipFile = "app/" . $filePath . "/" . Base::rightDelete($fileName, '.xlsx') . ".zip";
$zipPath = storage_path($zipFile); $zipPath = storage_path($zipFile);
if (file_exists($zipPath)) { if (file_exists($zipPath)) {
Base::deleteDirAndFile($zipPath, true); Base::deleteDirAndFile($zipPath, true);

View File

@ -1210,7 +1210,7 @@ class SystemController extends AbstractController
if (count($users) > 1) { if (count($users) > 1) {
$fileName .= "" . count($userid) . "位成员"; $fileName .= "" . count($userid) . "位成员";
} }
$fileName .= '签到记录_' . Base::time() . '.xls'; $fileName .= '签到记录_' . Base::time() . '.xlsx';
$filePath = "temp/checkin/export/" . date("Ym", Base::time()); $filePath = "temp/checkin/export/" . date("Ym", Base::time());
$export = new BillMultipleExport($sheets); $export = new BillMultipleExport($sheets);
$res = $export->store($filePath . "/" . $fileName); $res = $export->store($filePath . "/" . $fileName);
@ -1218,7 +1218,7 @@ class SystemController extends AbstractController
return Base::retError('导出失败,' . $fileName . ''); return Base::retError('导出失败,' . $fileName . '');
} }
$xlsPath = storage_path("app/" . $filePath . "/" . $fileName); $xlsPath = storage_path("app/" . $filePath . "/" . $fileName);
$zipFile = "app/" . $filePath . "/" . Base::rightDelete($fileName, '.xls') . ".zip"; $zipFile = "app/" . $filePath . "/" . Base::rightDelete($fileName, '.xlsx') . ".zip";
$zipPath = storage_path($zipFile); $zipPath = storage_path($zipFile);
if (file_exists($zipPath)) { if (file_exists($zipPath)) {
Base::deleteDirAndFile($zipPath, true); Base::deleteDirAndFile($zipPath, true);

View File

@ -252,7 +252,7 @@ class IndexController extends InvokeController
if ($uploadSuccessFileNum >= $fileNum){ if ($uploadSuccessFileNum >= $fileNum){
$directoryPath = public_path("uploads/desktop"); $directoryPath = public_path("uploads/desktop");
$files = array_filter(scandir($directoryPath), function($file) use($directoryPath) { $files = array_filter(scandir($directoryPath), function($file) use($directoryPath) {
return is_dir($directoryPath . '/' . $file) && $file != '.' && $file != '..'; return preg_match("/^\d+\.\d+\.\d+$/", $file) && is_dir($directoryPath . '/' . $file) && $file != '.' && $file != '..';
}); });
sort($files); sort($files);
foreach ($files as $key => $file) { foreach ($files as $key => $file) {

View File

@ -101,18 +101,18 @@
</div> </div>
<pre v-html="$A.formatTextMsg(msgData.msg.text, userId)"></pre> <pre v-html="$A.formatTextMsg(msgData.msg.text, userId)"></pre>
<template v-if="(msgData.msg.votes || []).filter(h=>h.userid == userId).length == 0"> <template v-if="(msgData.msg.votes || []).filter(h=>h.userid == userId).length == 0">
<RadioGroup v-if="msgData.msg.multiple == 0" v-model="msgData.msg._vote" vertical> <RadioGroup v-if="msgData.msg.multiple == 0" v-model="voteData[msgData.msg.uuid]" vertical>
<Radio v-for="(item,index) in (msgData.msg.list || [])" :label="item.id" :key="index"> <Radio v-for="(item,index) in (msgData.msg.list || [])" :label="item.id" :key="index">
{{item.text}} {{item.text}}
</Radio> </Radio>
</RadioGroup> </RadioGroup>
<CheckboxGroup v-else v-model="msgData.msg._vote"> <CheckboxGroup v-else v-model="voteData[msgData.msg.uuid]">
<Checkbox v-for="(item,index) in (msgData.msg.list || [])" :label="item.id" :key="index"> <Checkbox v-for="(item,index) in (msgData.msg.list || [])" :label="item.id" :key="index">
{{item.text}} {{item.text}}
</Checkbox> </Checkbox>
</CheckboxGroup> </CheckboxGroup>
<div class="btn-row"> <div class="btn-row">
<Button v-if="(msgData.msg._vote || []).length == 0" disabled>{{$L("请选择后投票")}}</Button> <Button v-if="(voteData[msgData.msg.uuid] || []).length == 0" disabled>{{$L("请选择后投票")}}</Button>
<Button v-else type="warning" :loading="msgData.msg._loadIng > 0" @click="onVote('vote',msgData)">{{$L("立即投票")}}</Button> <Button v-else type="warning" :loading="msgData.msg._loadIng > 0" @click="onVote('vote',msgData)">{{$L("立即投票")}}</Button>
</div> </div>
</template> </template>
@ -316,12 +316,17 @@ export default {
todoShow: false, todoShow: false,
todoList: [], todoList: [],
emojiUsersNum: 5 emojiUsersNum: 5,
voteData: {}
} }
}, },
mounted() { mounted() {
this.emojiUsersNum = Math.min(6, Math.max(2, Math.floor((this.windowWidth - 180) / 52))) this.emojiUsersNum = Math.min(6, Math.max(2, Math.floor((this.windowWidth - 180) / 52)))
if (Object.keys(this.voteData).length === 0) {
this.voteData = JSON.parse(window.localStorage.getItem(`__cache:vote__`)) || {};
}
}, },
beforeDestroy() { beforeDestroy() {
@ -411,6 +416,18 @@ export default {
if (val) { if (val) {
setTimeout(_ => this.operateEnter = true, 500) setTimeout(_ => this.operateEnter = true, 500)
} }
},
voteData: {
handler(val) {
const voteData = JSON.parse(window.localStorage.getItem('__cache:vote__')) || {}
for (const key in val) {
voteData[key] = val[key];
}
if (Object.keys(voteData).length > 0) {
window.localStorage.setItem('__cache:vote__', JSON.stringify(voteData))
}
},
deep: true
} }
}, },
@ -614,7 +631,7 @@ export default {
data: { data: {
dialog_id: msgData.dialog_id, dialog_id: msgData.dialog_id,
uuid: msgData.msg.uuid, uuid: msgData.msg.uuid,
vote: msgData.msg._vote || [], vote: this.voteData[msgData.msg.uuid] || [],
type: type type: type
} }
}).then(({ data }) => { }).then(({ data }) => {

View File

@ -1189,7 +1189,10 @@ export default {
// //
this.getUserApproveStatus() this.getUserApproveStatus()
} }
//
this.$store.dispatch('closeDialog', old_id) this.$store.dispatch('closeDialog', old_id)
//
window.localStorage.removeItem('__cache:vote__')
}, },
immediate: true immediate: true
}, },