Skip to content

Commit

Permalink
[Feature]: 台账附件子表,增加第一层文件夹,名称是对象名 #6956
Browse files Browse the repository at this point in the history
  • Loading branch information
sunhaolin committed Jul 2, 2024
1 parent 62801a6 commit ad8d13c
Show file tree
Hide file tree
Showing 14 changed files with 132 additions and 118 deletions.
10 changes: 8 additions & 2 deletions creator/packages/steedos-objects-core/cfs/stores.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,25 @@ _.each stores, (store_name)->
filename = fileObj.name();
filenameInStore = fileObj.name({store: store_name})

metadata = fileObj.metadata || {};
objectName = metadata.object_name;
objectFoldPath = ''
if objectName
objectFoldPath = objectName + '/'

now = new Date
year = now.getFullYear()
month = now.getMonth() + 1
path = require('path')
mkdirp = require('mkdirp')
pathname = path.join(process.env.STEEDOS_STORAGE_DIR, "files/#{store_name}/" + year + '/' + month)
pathname = path.join(process.env.STEEDOS_STORAGE_DIR, "files/#{store_name}/" + objectFoldPath + year + '/' + month)
# Set absolute path
absolutePath = path.resolve(pathname)
# Ensure the path exists
mkdirp.sync(absolutePath)

# If no store key found we resolve / generate a key
return year + '/' + month + '/' + fileObj.collectionName + '-' + fileObj._id + '-' + (filenameInStore || filename)
return objectFoldPath + year + '/' + month + '/' + fileObj.collectionName + '-' + fileObj._id + '-' + (filenameInStore || filename)

})

Expand Down
26 changes: 13 additions & 13 deletions server/bundle/programs/server/packages/modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ module.useNode();
//
module.exports = {
"name": "@steedos/objectql",
"version": "2.7.1-beta.21",
"version": "2.7.2-beta.2",
"main": "lib/index.js"
};

Expand All @@ -490,7 +490,7 @@ module.useNode();
//
module.exports = {
"name": "@steedos/i18n",
"version": "2.7.1-beta.21",
"version": "2.7.2-beta.2",
"main": "lib/index.js"
};

Expand All @@ -517,7 +517,7 @@ module.useNode();
//
module.exports = {
"name": "@steedos/core",
"version": "2.7.1-beta.21",
"version": "2.7.2-beta.2",
"main": "lib/index.js"
};

Expand All @@ -544,7 +544,7 @@ module.useNode();
//
module.exports = {
"name": "@steedos/service-meteor-package-loader",
"version": "2.7.1-beta.21",
"version": "2.7.2-beta.2",
"main": "index.js"
};

Expand All @@ -571,7 +571,7 @@ module.useNode();
//
module.exports = {
"name": "@steedos/service-api",
"version": "2.7.1-beta.21",
"version": "2.7.2-beta.2",
"main": "index.js"
};

Expand All @@ -598,7 +598,7 @@ module.useNode();
//
module.exports = {
"name": "@steedos/service-metadata-server",
"version": "2.7.1-beta.21",
"version": "2.7.2-beta.2",
"main": "index.js"
};

Expand All @@ -625,7 +625,7 @@ module.useNode();
//
module.exports = {
"name": "@steedos/service-package-registry",
"version": "2.7.1-beta.21",
"version": "2.7.2-beta.2",
"main": "package.service.js"
};

Expand All @@ -652,7 +652,7 @@ module.useNode();
//
module.exports = {
"name": "@steedos/service-objectql",
"version": "2.7.1-beta.21",
"version": "2.7.2-beta.2",
"main": "package.service.js"
};

Expand All @@ -679,7 +679,7 @@ module.useNode();
//
module.exports = {
"name": "@steedos/service-ui",
"version": "2.7.1-beta.21",
"version": "2.7.2-beta.2",
"main": "package.service.js"
};

Expand All @@ -706,7 +706,7 @@ module.useNode();
//
module.exports = {
"name": "@steedos/service-pages",
"version": "2.7.1-beta.21",
"version": "2.7.2-beta.2",
"main": "package.service.js"
};

Expand All @@ -733,7 +733,7 @@ module.useNode();
//
module.exports = {
"name": "@steedos/router",
"version": "2.7.1-beta.21",
"version": "2.7.2-beta.2",
"main": "lib/index.js"
};

Expand All @@ -760,7 +760,7 @@ module.useNode();
//
module.exports = {
"name": "@steedos/auth",
"version": "2.7.1-beta.21",
"version": "2.7.2-beta.2",
"main": "lib/index.js"
};

Expand All @@ -787,7 +787,7 @@ module.useNode();
//
module.exports = {
"name": "@steedos/workflow",
"version": "2.7.1-beta.21",
"version": "2.7.2-beta.2",
"main": "index.js"
};

Expand Down
72 changes: 40 additions & 32 deletions server/bundle/programs/server/packages/steedos_objects-core.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
"name": "standard-minifier-js",
"version": "2.6.0"
},
"totalMinifiedBytes": 4306472,
"totalMinifiedGzipBytes": 1084969,
"totalMinifiedBytes": 4306549,
"totalMinifiedGzipBytes": 1085000,
"minifiedBytesByPackage": {
"packages/meteor.js": 9504,
"packages/coffeescript.js": 32,
"packages/blaze-html-templates.js": 40,
"packages/modules-runtime.js": 4269,
"packages/modules.js": [
928386,
928402,
{
"node_modules": {
"meteor": {
Expand Down Expand Up @@ -273,11 +273,11 @@
},
"buffer": {
"package.json": 76,
"index.js": 20102
"index.js": 20122
},
"base64-js": {
"package.json": 79,
"index.js": 1448
"index.js": 1446
},
"ieee754": {
"package.json": 78,
Expand Down Expand Up @@ -741,7 +741,7 @@
},
"@steedos": {
"i18n": {
"package.json": 95,
"package.json": 94,
"lib": {
"index.js": 2137,
"i18n": {
Expand Down Expand Up @@ -936,7 +936,7 @@
}
},
"cachers": {
"package.json": 98,
"package.json": 97,
"lib": {
"index.js": 412,
"memory.js": 501,
Expand Down Expand Up @@ -2233,7 +2233,7 @@
"packages/steedos_cfs-collection-filters.js": 2446,
"packages/steedos_cfs-worker.js": 38,
"packages/steedos_objects-core.js": [
8293,
8354,
{
"node_modules": {
"meteor": {
Expand All @@ -2242,7 +2242,7 @@
"cfs": {
"cfs.coffee": 2148,
"cfs_fix.coffee": 361,
"stores.coffee": 1684
"stores.coffee": 1745
}
}
}
Expand Down
18 changes: 9 additions & 9 deletions server/bundle/programs/web.browser.legacy/program.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@
"format": "web-program-pre1",
"manifest": [
{
"path": "e98f74acd4a07c9307c152159dd33468ab267999.js",
"path": "2cf5415595901c3ab2f6b261688c462760871d39.js",
"where": "client",
"type": "js",
"cacheable": true,
"url": "/e98f74acd4a07c9307c152159dd33468ab267999.js?meteor_js_resource=true",
"size": 4306472,
"hash": "e98f74acd4a07c9307c152159dd33468ab267999",
"sri": "WyXZP7Wm6h7KpW4hjCyWQ7hhasaFslnVTURUF9vMCVZPS5YMjxQZQGDS6AnEIZ2TXkKmdw6hkDdnCjTBNuIvZQ=="
"url": "/2cf5415595901c3ab2f6b261688c462760871d39.js?meteor_js_resource=true",
"size": 4306549,
"hash": "2cf5415595901c3ab2f6b261688c462760871d39",
"sri": "qs56MKx1+oB5q0TC5ylZkV/dDRywt22+e6n5+dHnj/RC4TlTvnliuKAIvgu06yGNDVQTghYLgGeZCHdWCFBlew=="
},
{
"path": "e98f74acd4a07c9307c152159dd33468ab267999.stats.json",
"path": "2cf5415595901c3ab2f6b261688c462760871d39.stats.json",
"where": "client",
"type": "json",
"cacheable": true,
"url": "/e98f74acd4a07c9307c152159dd33468ab267999.stats.json?meteor_js_resource=true",
"url": "/2cf5415595901c3ab2f6b261688c462760871d39.stats.json?meteor_js_resource=true",
"size": 92684,
"hash": "1a7feb447e72800fe3b91012edb66f094cb41ed2",
"sri": "VAbV7y7lPH4xNrG1DuNh038cIKgCl7tOSV7y/doGv5daycTSq94MCCy6GWhXkBqQpvPhxy0i0LRygQNjnP4E0Q=="
"hash": "7d4c4988cca9dd5cbe5991a56238ab3fb3ec353d",
"sri": "WTZCIKuoh0YRngx94BWDS97zCvfcLY9TyavFl7zsPUBn1YhwssgL3+eSoJpKccy1atwkp0l21fO9Lql8BLQHPA=="
},
{
"path": "dynamic/node_modules/@steedos/form-builder/dist/form-builder.min.js",
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
"name": "standard-minifier-js",
"version": "2.6.0"
},
"totalMinifiedBytes": 4306472,
"totalMinifiedGzipBytes": 1084969,
"totalMinifiedBytes": 4306549,
"totalMinifiedGzipBytes": 1085000,
"minifiedBytesByPackage": {
"packages/meteor.js": 9504,
"packages/coffeescript.js": 32,
"packages/blaze-html-templates.js": 40,
"packages/modules-runtime.js": 4269,
"packages/modules.js": [
928386,
928402,
{
"node_modules": {
"meteor": {
Expand Down Expand Up @@ -273,11 +273,11 @@
},
"buffer": {
"package.json": 76,
"index.js": 20102
"index.js": 20122
},
"base64-js": {
"package.json": 79,
"index.js": 1448
"index.js": 1446
},
"ieee754": {
"package.json": 78,
Expand Down Expand Up @@ -741,7 +741,7 @@
},
"@steedos": {
"i18n": {
"package.json": 95,
"package.json": 94,
"lib": {
"index.js": 2137,
"i18n": {
Expand Down Expand Up @@ -936,7 +936,7 @@
}
},
"cachers": {
"package.json": 98,
"package.json": 97,
"lib": {
"index.js": 412,
"memory.js": 501,
Expand Down Expand Up @@ -2233,7 +2233,7 @@
"packages/steedos_cfs-collection-filters.js": 2446,
"packages/steedos_cfs-worker.js": 38,
"packages/steedos_objects-core.js": [
8293,
8354,
{
"node_modules": {
"meteor": {
Expand All @@ -2242,7 +2242,7 @@
"cfs": {
"cfs.coffee": 2148,
"cfs_fix.coffee": 361,
"stores.coffee": 1684
"stores.coffee": 1745
}
}
}
Expand Down
18 changes: 9 additions & 9 deletions server/bundle/programs/web.browser/program.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@
"format": "web-program-pre1",
"manifest": [
{
"path": "e98f74acd4a07c9307c152159dd33468ab267999.js",
"path": "2cf5415595901c3ab2f6b261688c462760871d39.js",
"where": "client",
"type": "js",
"cacheable": true,
"url": "/e98f74acd4a07c9307c152159dd33468ab267999.js?meteor_js_resource=true",
"size": 4306472,
"hash": "e98f74acd4a07c9307c152159dd33468ab267999",
"sri": "WyXZP7Wm6h7KpW4hjCyWQ7hhasaFslnVTURUF9vMCVZPS5YMjxQZQGDS6AnEIZ2TXkKmdw6hkDdnCjTBNuIvZQ=="
"url": "/2cf5415595901c3ab2f6b261688c462760871d39.js?meteor_js_resource=true",
"size": 4306549,
"hash": "2cf5415595901c3ab2f6b261688c462760871d39",
"sri": "qs56MKx1+oB5q0TC5ylZkV/dDRywt22+e6n5+dHnj/RC4TlTvnliuKAIvgu06yGNDVQTghYLgGeZCHdWCFBlew=="
},
{
"path": "e98f74acd4a07c9307c152159dd33468ab267999.stats.json",
"path": "2cf5415595901c3ab2f6b261688c462760871d39.stats.json",
"where": "client",
"type": "json",
"cacheable": true,
"url": "/e98f74acd4a07c9307c152159dd33468ab267999.stats.json?meteor_js_resource=true",
"url": "/2cf5415595901c3ab2f6b261688c462760871d39.stats.json?meteor_js_resource=true",
"size": 92684,
"hash": "1a7feb447e72800fe3b91012edb66f094cb41ed2",
"sri": "VAbV7y7lPH4xNrG1DuNh038cIKgCl7tOSV7y/doGv5daycTSq94MCCy6GWhXkBqQpvPhxy0i0LRygQNjnP4E0Q=="
"hash": "7d4c4988cca9dd5cbe5991a56238ab3fb3ec353d",
"sri": "WTZCIKuoh0YRngx94BWDS97zCvfcLY9TyavFl7zsPUBn1YhwssgL3+eSoJpKccy1atwkp0l21fO9Lql8BLQHPA=="
},
{
"path": "dynamic/node_modules/@steedos/form-builder/dist/form-builder.min.js",
Expand Down

Large diffs are not rendered by default.

Loading

0 comments on commit ad8d13c

Please sign in to comment.