@ailaw/venus 1.313.0 → 1.315.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/style.css +1 -1
- package/dist/venus.es.js +67 -15
- package/package.json +1 -1
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! tailwindcss v2.2.17 | MIT License | https://tailwindcss.com *//*! modern-normalize v1.1.0 | MIT License | https://github.com/sindresorhus/modern-normalize */*,:before,:after{box-sizing:border-box}html{-moz-tab-size:4;-o-tab-size:4;tab-size:4}html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}body{font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji"}hr{height:0;color:inherit}abbr[title]{-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}::-moz-focus-inner{border-style:none;padding:0}legend{padding:0}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}button{background-color:transparent;background-image:none}fieldset{margin:0;padding:0}ol,ul{list-style:none;margin:0;padding:0}html{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";line-height:1.5}body{font-family:inherit;line-height:inherit}*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:currentColor}hr{border-top-width:1px}img{border-style:solid}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#a1a1aa}input:-ms-input-placeholder,textarea:-ms-input-placeholder{opacity:1;color:#a1a1aa}input::placeholder,textarea::placeholder{opacity:1;color:#a1a1aa}button,[role=button]{cursor:pointer}table{border-collapse:collapse}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}button,input,optgroup,select,textarea{padding:0;line-height:inherit;color:inherit}pre,code,kbd,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{border-color:currentColor}.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.visible{visibility:visible}.relative{position:relative}.mr-2{margin-right:.5rem}.mb-0{margin-bottom:0}.mb-5{margin-bottom:1.25rem}.ml-2{margin-left:.5rem}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.table{display:table}.contents{display:contents}.hidden{display:none}.h-6{height:1.5rem}.h-screen{height:100vh}.w-6{width:1.5rem}.w-60{width:15rem}.w-72{width:18rem}.flex-1{flex:1 1 0%}@-webkit-keyframes spin{to{transform:rotate(360deg)}}@keyframes spin{to{transform:rotate(360deg)}}@-webkit-keyframes ping{75%,to{transform:scale(2);opacity:0}}@keyframes ping{75%,to{transform:scale(2);opacity:0}}@-webkit-keyframes pulse{50%{opacity:.5}}@keyframes pulse{50%{opacity:.5}}@-webkit-keyframes bounce{0%,to{transform:translateY(-25%);-webkit-animation-timing-function:cubic-bezier(.8,0,1,1);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;-webkit-animation-timing-function:cubic-bezier(0,0,.2,1);animation-timing-function:cubic-bezier(0,0,.2,1)}}@keyframes bounce{0%,to{transform:translateY(-25%);-webkit-animation-timing-function:cubic-bezier(.8,0,1,1);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;-webkit-animation-timing-function:cubic-bezier(0,0,.2,1);animation-timing-function:cubic-bezier(0,0,.2,1)}}.cursor-pointer{cursor:pointer}.items-center{align-items:center}.space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.25rem * var(--tw-space-x-reverse));margin-left:calc(.25rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.rounded{border-radius:.25rem}.border{border-width:1px}.border-solid{border-style:solid}.border-light-purple{--tw-border-opacity: 1;border-color:rgba(192,150,250,var(--tw-border-opacity))}.border-light-blue{--tw-border-opacity: 1;border-color:rgba(145,213,255,var(--tw-border-opacity))}.bg-purple{--tw-bg-opacity: 1;background-color:rgba(249,240,255,var(--tw-bg-opacity))}.bg-blue{--tw-bg-opacity: 1;background-color:rgba(230,247,255,var(--tw-bg-opacity))}.p-4{padding:1rem}.px-2{padding-left:.5rem;padding-right:.5rem}.pt-3{padding-top:.75rem}.pt-3\.5{padding-top:.875rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.font-bold{font-weight:700}.capitalize{text-transform:capitalize}.leading-5{line-height:1.25rem}.text-secondary{--tw-text-opacity: 1;color:rgba(102,102,102,var(--tw-text-opacity))}.text-smart{--tw-text-opacity: 1;color:rgba(114,46,209,var(--tw-text-opacity))}.text-classic{--tw-text-opacity: 1;color:rgba(24,144,255,var(--tw-text-opacity))}*,:before,:after{--tw-shadow: 0 0 #0000}*,:before,:after{--tw-ring-inset: var(--tw-empty, );--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgba(59, 130, 246, .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000}.filter{--tw-blur: var(--tw-empty, );--tw-brightness: var(--tw-empty, );--tw-contrast: var(--tw-empty, );--tw-grayscale: var(--tw-empty, );--tw-hue-rotate: var(--tw-empty, );--tw-invert: var(--tw-empty, );--tw-saturate: var(--tw-empty, );--tw-sepia: var(--tw-empty, );--tw-drop-shadow: var(--tw-empty, );filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.blur{--tw-blur: blur(8px)}.btn-divider[data-v-20a86d10]{margin-bottom:0!important;margin-top:12px!important}.beta[data-v-1114aea6]{line-height:20px;border-radius:15px;background-color:red;color:#fff;padding:0 3.5px;margin:0 5px}.min-w-80[data-v-72ef9bd2]{min-width:320px}.ant-popover{z-index:9999!important}.ant-popover .ant-popover-inner-content{padding:8px 16px}.container[data-v-
|
|
1
|
+
/*! tailwindcss v2.2.17 | MIT License | https://tailwindcss.com *//*! modern-normalize v1.1.0 | MIT License | https://github.com/sindresorhus/modern-normalize */*,:before,:after{box-sizing:border-box}html{-moz-tab-size:4;-o-tab-size:4;tab-size:4}html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}body{font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji"}hr{height:0;color:inherit}abbr[title]{-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}::-moz-focus-inner{border-style:none;padding:0}legend{padding:0}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}button{background-color:transparent;background-image:none}fieldset{margin:0;padding:0}ol,ul{list-style:none;margin:0;padding:0}html{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";line-height:1.5}body{font-family:inherit;line-height:inherit}*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:currentColor}hr{border-top-width:1px}img{border-style:solid}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#a1a1aa}input:-ms-input-placeholder,textarea:-ms-input-placeholder{opacity:1;color:#a1a1aa}input::placeholder,textarea::placeholder{opacity:1;color:#a1a1aa}button,[role=button]{cursor:pointer}table{border-collapse:collapse}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}button,input,optgroup,select,textarea{padding:0;line-height:inherit;color:inherit}pre,code,kbd,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{border-color:currentColor}.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.visible{visibility:visible}.relative{position:relative}.mr-2{margin-right:.5rem}.mb-0{margin-bottom:0}.mb-5{margin-bottom:1.25rem}.ml-2{margin-left:.5rem}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.table{display:table}.contents{display:contents}.hidden{display:none}.h-6{height:1.5rem}.h-screen{height:100vh}.w-6{width:1.5rem}.w-60{width:15rem}.w-72{width:18rem}.flex-1{flex:1 1 0%}@-webkit-keyframes spin{to{transform:rotate(360deg)}}@keyframes spin{to{transform:rotate(360deg)}}@-webkit-keyframes ping{75%,to{transform:scale(2);opacity:0}}@keyframes ping{75%,to{transform:scale(2);opacity:0}}@-webkit-keyframes pulse{50%{opacity:.5}}@keyframes pulse{50%{opacity:.5}}@-webkit-keyframes bounce{0%,to{transform:translateY(-25%);-webkit-animation-timing-function:cubic-bezier(.8,0,1,1);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;-webkit-animation-timing-function:cubic-bezier(0,0,.2,1);animation-timing-function:cubic-bezier(0,0,.2,1)}}@keyframes bounce{0%,to{transform:translateY(-25%);-webkit-animation-timing-function:cubic-bezier(.8,0,1,1);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;-webkit-animation-timing-function:cubic-bezier(0,0,.2,1);animation-timing-function:cubic-bezier(0,0,.2,1)}}.cursor-pointer{cursor:pointer}.items-center{align-items:center}.space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.25rem * var(--tw-space-x-reverse));margin-left:calc(.25rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.rounded{border-radius:.25rem}.border{border-width:1px}.border-solid{border-style:solid}.border-light-purple{--tw-border-opacity: 1;border-color:rgba(192,150,250,var(--tw-border-opacity))}.border-light-blue{--tw-border-opacity: 1;border-color:rgba(145,213,255,var(--tw-border-opacity))}.bg-purple{--tw-bg-opacity: 1;background-color:rgba(249,240,255,var(--tw-bg-opacity))}.bg-blue{--tw-bg-opacity: 1;background-color:rgba(230,247,255,var(--tw-bg-opacity))}.p-4{padding:1rem}.px-2{padding-left:.5rem;padding-right:.5rem}.pt-3{padding-top:.75rem}.pt-3\.5{padding-top:.875rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.font-bold{font-weight:700}.capitalize{text-transform:capitalize}.leading-5{line-height:1.25rem}.text-secondary{--tw-text-opacity: 1;color:rgba(102,102,102,var(--tw-text-opacity))}.text-smart{--tw-text-opacity: 1;color:rgba(114,46,209,var(--tw-text-opacity))}.text-classic{--tw-text-opacity: 1;color:rgba(24,144,255,var(--tw-text-opacity))}*,:before,:after{--tw-shadow: 0 0 #0000}*,:before,:after{--tw-ring-inset: var(--tw-empty, );--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgba(59, 130, 246, .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000}.filter{--tw-blur: var(--tw-empty, );--tw-brightness: var(--tw-empty, );--tw-contrast: var(--tw-empty, );--tw-grayscale: var(--tw-empty, );--tw-hue-rotate: var(--tw-empty, );--tw-invert: var(--tw-empty, );--tw-saturate: var(--tw-empty, );--tw-sepia: var(--tw-empty, );--tw-drop-shadow: var(--tw-empty, );filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.blur{--tw-blur: blur(8px)}.btn-divider[data-v-20a86d10]{margin-bottom:0!important;margin-top:12px!important}.beta[data-v-1114aea6]{line-height:20px;border-radius:15px;background-color:red;color:#fff;padding:0 3.5px;margin:0 5px}.min-w-80[data-v-72ef9bd2]{min-width:320px}.ant-popover{z-index:9999!important}.ant-popover .ant-popover-inner-content{padding:8px 16px}.container[data-v-da174054]{border:1px solid #cccccc;border-radius:6px;padding:0 4px;min-height:30px;cursor:pointer}.block[data-v-da174054]{display:block}.tags-container[data-v-18554545]{word-break:keep-all;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}.taskTemplateInline[data-v-c5d917d8]{float:right}a.taskTemplateInline[data-v-c5d917d8]{margin-left:10px}div.taskTemplateInline[data-v-c5d917d8]{margin-top:5px!important}.task-cart-main-modal[data-v-697d89e6] .ant-modal-body{padding-bottom:0}
|
package/dist/venus.es.js
CHANGED
|
@@ -2056,6 +2056,33 @@ init(defaultConverter, { path: "/" });
|
|
|
2056
2056
|
R.pipe(R.toPairs, R.map(R.join("=")), R.join("&"), R.when(R.complement(R.isEmpty), R.concat("?")));
|
|
2057
2057
|
async function selectFolderTree() {
|
|
2058
2058
|
return new Promise((resolve) => {
|
|
2059
|
+
console.log("selectFolderTree invoked");
|
|
2060
|
+
if (typeof window.showDirectoryPicker === "function") {
|
|
2061
|
+
window.showDirectoryPicker().then(async (dirHandle) => {
|
|
2062
|
+
const zip = new JSZip();
|
|
2063
|
+
const folderSet = new Set();
|
|
2064
|
+
const traverseHandle = async (handle, path2) => {
|
|
2065
|
+
if (handle.kind === "directory") {
|
|
2066
|
+
const currentPath = path2 ? `${path2}/${handle.name}` : handle.name;
|
|
2067
|
+
folderSet.add(currentPath);
|
|
2068
|
+
for await (const entry of handle.entries()) {
|
|
2069
|
+
const childHandle = entry[1];
|
|
2070
|
+
await traverseHandle(childHandle, currentPath);
|
|
2071
|
+
}
|
|
2072
|
+
}
|
|
2073
|
+
};
|
|
2074
|
+
await traverseHandle(dirHandle, "");
|
|
2075
|
+
const filteredDirs = Array.from(folderSet).filter((dir) => !dir.includes(".DS_Store"));
|
|
2076
|
+
filteredDirs.forEach((dir) => zip.folder(dir + "/"));
|
|
2077
|
+
const blob = await zip.generateAsync({ type: "blob" });
|
|
2078
|
+
const file = new File([blob], "folder-structure.zip", { type: "text/plain" });
|
|
2079
|
+
return { file, folderTree: filteredDirs };
|
|
2080
|
+
}).then((result) => resolve(result)).catch((err) => {
|
|
2081
|
+
console.error("Directory picker cancelled or failed", err);
|
|
2082
|
+
resolve(null);
|
|
2083
|
+
});
|
|
2084
|
+
return;
|
|
2085
|
+
}
|
|
2059
2086
|
const el = document.createElement("input");
|
|
2060
2087
|
el.type = "file";
|
|
2061
2088
|
el.style = "display: none";
|
|
@@ -2089,13 +2116,15 @@ async function selectFolderTree() {
|
|
|
2089
2116
|
for (const entry of entries) {
|
|
2090
2117
|
await traverse(entry, "");
|
|
2091
2118
|
}
|
|
2092
|
-
folderSet.
|
|
2119
|
+
const filteredDirs2 = Array.from(folderSet).filter((dir) => !dir.includes(".DS_Store"));
|
|
2120
|
+
filteredDirs2.forEach((dir) => {
|
|
2093
2121
|
zip.folder(dir + "/");
|
|
2094
2122
|
});
|
|
2095
2123
|
const blob = await zip.generateAsync({ type: "blob" });
|
|
2096
|
-
return { zipBlob: blob, folderTree:
|
|
2124
|
+
return { zipBlob: blob, folderTree: filteredDirs2 };
|
|
2097
2125
|
};
|
|
2098
2126
|
el.onchange = async (e) => {
|
|
2127
|
+
console.log("input onchange triggered, files length", el.files.length);
|
|
2099
2128
|
const fileInput = e.target;
|
|
2100
2129
|
const entries = fileInput.webkitEntries || el.webkitEntries || [];
|
|
2101
2130
|
let zipBlob, folderTree;
|
|
@@ -2106,6 +2135,8 @@ async function selectFolderTree() {
|
|
|
2106
2135
|
const zip = new JSZip();
|
|
2107
2136
|
const folderSet = new Set();
|
|
2108
2137
|
files.forEach((file2) => {
|
|
2138
|
+
if (file2.name === ".DS_Store")
|
|
2139
|
+
return;
|
|
2109
2140
|
const path2 = file2.webkitRelativePath;
|
|
2110
2141
|
if (!path2)
|
|
2111
2142
|
return;
|
|
@@ -2115,11 +2146,13 @@ async function selectFolderTree() {
|
|
|
2115
2146
|
folderSet.add(dir);
|
|
2116
2147
|
}
|
|
2117
2148
|
});
|
|
2118
|
-
folderSet.
|
|
2149
|
+
const filteredDirs3 = Array.from(folderSet).filter((dir) => !dir.includes(".DS_Store"));
|
|
2150
|
+
filteredDirs3.forEach((dir) => zip.folder(dir + "/"));
|
|
2119
2151
|
zipBlob = await zip.generateAsync({ type: "blob" });
|
|
2120
|
-
folderTree =
|
|
2152
|
+
folderTree = filteredDirs3;
|
|
2121
2153
|
}
|
|
2122
2154
|
document.body.removeChild(el);
|
|
2155
|
+
console.log("constructing file and resolving promise");
|
|
2123
2156
|
const file = new File([zipBlob], "folder-structure.zip", { type: "application/zip" });
|
|
2124
2157
|
resolve({ file, folderTree });
|
|
2125
2158
|
};
|
|
@@ -2160,6 +2193,8 @@ var __vue2_script$b = defineComponent({
|
|
|
2160
2193
|
}
|
|
2161
2194
|
},
|
|
2162
2195
|
setup(props, { emit }) {
|
|
2196
|
+
const attrs = useAttrs();
|
|
2197
|
+
const resolvedUploadFilesFunc = props.uploadFilesFunc || attrs.uploadfilesfunc || attrs["upload-files-func"];
|
|
2163
2198
|
const me = useMe();
|
|
2164
2199
|
const loading = ref(false);
|
|
2165
2200
|
const changeVal = (k, v) => {
|
|
@@ -2175,7 +2210,7 @@ var __vue2_script$b = defineComponent({
|
|
|
2175
2210
|
if (loading.value)
|
|
2176
2211
|
return false;
|
|
2177
2212
|
loading.value = true;
|
|
2178
|
-
|
|
2213
|
+
resolvedUploadFilesFunc && resolvedUploadFilesFunc(files, {
|
|
2179
2214
|
office_id: (_a = me.value) == null ? void 0 : _a.lawFirmId,
|
|
2180
2215
|
user_id: (_b = me.value) == null ? void 0 : _b.id
|
|
2181
2216
|
}).then((res) => {
|
|
@@ -2211,15 +2246,28 @@ var __vue2_script$b = defineComponent({
|
|
|
2211
2246
|
};
|
|
2212
2247
|
const isImage = (file) => typeOf(file.name) === "img";
|
|
2213
2248
|
const iconOf = (fileName) => icons[typeOf(fileName)];
|
|
2214
|
-
const clickItem = (item, event) => {
|
|
2249
|
+
const clickItem = async (item, event) => {
|
|
2215
2250
|
if (item.isFolderTree || item.name === "folder-structure.zip") {
|
|
2216
2251
|
event.preventDefault();
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2252
|
+
try {
|
|
2253
|
+
const response = await fetch(item.link, { credentials: "include" });
|
|
2254
|
+
if (!response.ok) {
|
|
2255
|
+
window.open(item.link, "_blank");
|
|
2256
|
+
return;
|
|
2257
|
+
}
|
|
2258
|
+
const blob = await response.blob();
|
|
2259
|
+
const url = URL.createObjectURL(blob);
|
|
2260
|
+
const link = document.createElement("a");
|
|
2261
|
+
link.href = url;
|
|
2262
|
+
link.download = item.name || "folder-structure.zip";
|
|
2263
|
+
document.body.appendChild(link);
|
|
2264
|
+
link.click();
|
|
2265
|
+
document.body.removeChild(link);
|
|
2266
|
+
URL.revokeObjectURL(url);
|
|
2267
|
+
} catch (e) {
|
|
2268
|
+
console.error("download folder tree fail", e);
|
|
2269
|
+
window.open(item.link, "_blank");
|
|
2270
|
+
}
|
|
2223
2271
|
return;
|
|
2224
2272
|
}
|
|
2225
2273
|
if (!isImage(item)) {
|
|
@@ -2236,14 +2284,17 @@ var __vue2_script$b = defineComponent({
|
|
|
2236
2284
|
try {
|
|
2237
2285
|
console.log("handleSelectFolderTree click");
|
|
2238
2286
|
const result = await selectFolderTree();
|
|
2239
|
-
console.log("selectFolderTree result", result);
|
|
2287
|
+
console.log("selectFolderTree result", result, "uploadFilesFunc", props.uploadFilesFunc);
|
|
2240
2288
|
if (!result) {
|
|
2241
2289
|
message.warning("No folder selected or folder is empty");
|
|
2242
2290
|
return;
|
|
2243
2291
|
}
|
|
2244
2292
|
if (result && result.file) {
|
|
2245
2293
|
result.file.folderTree = result.folderTree;
|
|
2246
|
-
|
|
2294
|
+
if (!resolvedUploadFilesFunc) {
|
|
2295
|
+
throw new Error("uploadFilesFunc not provided");
|
|
2296
|
+
}
|
|
2297
|
+
const res = await resolvedUploadFilesFunc([result.file], {
|
|
2247
2298
|
office_id: (_a = me.value) == null ? void 0 : _a.lawFirmId,
|
|
2248
2299
|
user_id: (_b = me.value) == null ? void 0 : _b.id
|
|
2249
2300
|
});
|
|
@@ -2272,6 +2323,7 @@ var __vue2_script$b = defineComponent({
|
|
|
2272
2323
|
beforeUpload,
|
|
2273
2324
|
loading,
|
|
2274
2325
|
acceptableFormats,
|
|
2326
|
+
resolvedUploadFilesFunc,
|
|
2275
2327
|
handleSelectFolderTree
|
|
2276
2328
|
};
|
|
2277
2329
|
}
|
|
@@ -2306,7 +2358,7 @@ var render$b = function() {
|
|
|
2306
2358
|
var staticRenderFns$b = [];
|
|
2307
2359
|
var index_vue_vue_type_style_index_0_scoped_true_lang$6 = "";
|
|
2308
2360
|
const __cssModules$b = {};
|
|
2309
|
-
var __component__$b = /* @__PURE__ */ normalizeComponent(__vue2_script$b, render$b, staticRenderFns$b, false, __vue2_injectStyles$b, "
|
|
2361
|
+
var __component__$b = /* @__PURE__ */ normalizeComponent(__vue2_script$b, render$b, staticRenderFns$b, false, __vue2_injectStyles$b, "da174054", null, null);
|
|
2310
2362
|
function __vue2_injectStyles$b(context) {
|
|
2311
2363
|
for (let o in __cssModules$b) {
|
|
2312
2364
|
this[o] = __cssModules$b[o];
|