@steedos/standard-ui 2.5.12 → 2.5.13-beta.10

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.
@@ -56,9 +56,6 @@ tab_items:
56
56
  admin_datasources:
57
57
  group: object_settings
58
58
  index: 13
59
- admin_queue_import:
60
- group: advanced_settings
61
- index: 38
62
59
  admin_pages:
63
60
  group: user_interface
64
61
  index: 15
@@ -143,6 +140,9 @@ tab_items:
143
140
  admin_autonumber:
144
141
  group: advanced_settings
145
142
  index: 37
143
+ admin_queue_import:
144
+ group: advanced_settings
145
+ index: 38
146
146
  # admin_web_forms:
147
147
  # group: 高级设置
148
148
  # index: 38
@@ -0,0 +1,11 @@
1
+
2
+ Meteor.startup(function(){
3
+ Tracker.autorun(function(){
4
+ const space = db.spaces.findOne(Steedos.getSpaceId());
5
+ if(space && space.favicon){
6
+ const faviconLink = document.querySelector('link[rel="shortcut icon"]');
7
+ faviconLink.href = Steedos.absoluteUrl("/api/files/avatars/"+space.favicon);
8
+ console.log('update faviconLink.href', faviconLink.href)
9
+ }
10
+ })
11
+ })
@@ -2,19 +2,32 @@
2
2
  * @Author: 殷亮辉 yinlianghui@hotoa.com
3
3
  * @Date: 2023-05-16 17:00:38
4
4
  * @LastEditors: 殷亮辉 yinlianghui@hotoa.com
5
- * @LastEditTime: 2023-08-24 16:25:28
5
+ * @LastEditTime: 2023-09-11 17:44:01
6
6
  */
7
7
  var buttonTriggerHistoryPathsChange;
8
8
 
9
9
  let historyPathsStoreKey = "history_paths";
10
10
 
11
11
  // 切换应用、对象、列表视图时清除本地存储中的过滤条件
12
- function clearHistoryFilters(context, lastPath) {
12
+ function clearHistoryFilters(context, lastPath, paths) {
13
13
  const path = context.path;
14
14
  const params = context.params || {};
15
15
  if (!lastPath || lastPath.params.app_id != params.app_id || lastPath.params.object_name != params.object_name || lastPath.params.list_view_id != params.list_view_id) {
16
16
  let listViewPropsStoreKey;
17
17
  if (lastPath) {
18
+ if(lastPath.params.record_id){
19
+ // 是从记录详细界面直接切换到其他对象列表或其他应用时,进一步往上找,找到对象列表的path作为lastPath来清除对应的本地存储
20
+ for(let i = paths.length - 1;i >= 0;i--){
21
+ let tempPath = paths[i];
22
+ // if(!tempPath.params.record_id && tempPath.params.list_view_id){
23
+ // 不可以判断list_view_id表示对象列表,因为有可以从应用程序微页面进入记录详细页面,需要清除应用程序微页面中的对象表格或对象列表组件中本地存储中保存的过滤条件
24
+ if(!tempPath.params.record_id){
25
+ // record_id不存在,list_view_id存在表示对象列表页面
26
+ lastPath = tempPath;
27
+ break;
28
+ }
29
+ }
30
+ }
18
31
  listViewPropsStoreKey = lastPath.path + "/crud";
19
32
  }
20
33
  else {
@@ -229,7 +242,7 @@ FlowRouter.triggers.enter(debounce(function (context, redirect, stop) {
229
242
  }
230
243
  }
231
244
  else {
232
- clearHistoryFilters(context, lastPath);
245
+ clearHistoryFilters(context, lastPath, paths);
233
246
  // 触发广播事件前重置amis变量historyPaths值为空数组,并把当前path和params存入amis变量historyPaths中
234
247
  resetHistoryPath(path, params);
235
248
  }
@@ -0,0 +1,148 @@
1
+ (function(){
2
+ const loadJs = (url, callback)=>{
3
+ let scriptTag = document.createElement("script");
4
+ scriptTag.type = "text/javascript";
5
+ scriptTag.src = url;
6
+ scriptTag.async = false;
7
+ document.getElementsByTagName("head")[0].appendChild(scriptTag);
8
+ scriptTag.onload = function(script){
9
+ if(callback){
10
+ callback(script)
11
+ }
12
+ }
13
+ }
14
+
15
+ const loadCss = (url)=>{
16
+ let styleTag = document.createElement("link");
17
+ styleTag.setAttribute("rel", "stylesheet");
18
+ styleTag.setAttribute("type", "text/css");
19
+ styleTag.setAttribute("href", src);
20
+ document.getElementsByTagName("head")[0].appendChild(styleTag);
21
+ }
22
+
23
+ window.loadJs = loadJs;
24
+ window.loadCss = loadCss;
25
+
26
+
27
+ const STEEDOS_SENTRY_ENABLED = "<%=STEEDOS_SENTRY_ENABLED%>";
28
+ const NODE_ENV = "<%=NODE_ENV%>";
29
+ const STEEDOS_SENTRY_DSN = "<%=STEEDOS_SENTRY_DSN%>";
30
+ const ROOT_URL = "<%=ROOT_URL%>";
31
+ const STEEDOS_UNPKG_URL = "<%=STEEDOS_UNPKG_URL%>";
32
+ const STEEDOS_AMIS_URL = "<%=STEEDOS_AMIS_URL%>";
33
+ const STEEDOS_PUBLIC_SCRIPT_VCONSOLE = "<%=STEEDOS_PUBLIC_SCRIPT_VCONSOLE%>";
34
+ const STEEDOS_PUBLIC_SCRIPT_PLUGINS = "<%=STEEDOS_PUBLIC_SCRIPT_PLUGINS%>";
35
+ const STEEDOS_PUBLIC_STYLE_PLUGINS = "<%=STEEDOS_PUBLIC_STYLE_PLUGINS%>";
36
+ const STEEDOS_VERSION = "<%=STEEDOS_VERSION%>";
37
+ const STEEDOS_LOCALE = "<%=STEEDOS_LOCALE%>";
38
+ const STEEDOS_PUBLIC_PAGE_ASSETURLS = "<%=STEEDOS_PUBLIC_PAGE_ASSETURLS%>";
39
+ const STEEDOS_AMIS_VERSION= "<%=STEEDOS_AMIS_VERSION%>";
40
+
41
+ const platform = <%- JSON.stringify(platform) %>;
42
+
43
+ if (`${STEEDOS_SENTRY_ENABLED}` != 'false') {
44
+ loadJs(`${ROOT_URL}/sentry/sentry.min.js`, (script)=>{
45
+ const nodeEnv = NODE_ENV || 'development';
46
+ const DEFAULT_DSN_JS = {
47
+ 'development': 'https://7c2b864b83bf4361a030a7df9d2ace0c@sentry.steedos.cn/7',
48
+ 'production': 'https://8f3f63d02e8140718a6123b10d49ae2f@sentry.steedos.cn/6'
49
+ }
50
+ var dsn = STEEDOS_SENTRY_DSN || DEFAULT_DSN_JS[nodeEnv];
51
+ Sentry.init({
52
+ dsn: STEEDOS_SENTRY_DSN
53
+ });
54
+ });
55
+ };
56
+
57
+ loadJs(`${STEEDOS_UNPKG_URL}/lodash@4.17.21/lodash.min.js`, ()=>{
58
+ // window._ = window.lodash;
59
+ try {
60
+ if(platform.hostname){
61
+ if (!_.includes(platform.hostname.split(','), window.location.hostname)) {
62
+ setTimeout(function(){
63
+ document.getElementsByClassName("steedos-banners")[0].style.display = 'flex';
64
+ document.getElementsByClassName("steedos-banners")[0].style.justifyContent = 'center';
65
+ console.error(`环境变量ROOT_URL中的hostname(${window.location.hostname})与许可证中设置的不一致,请确认。`)
66
+ }, 1000)
67
+ }
68
+ }
69
+ } catch (error) {
70
+ console.error(error)
71
+ }
72
+
73
+ });
74
+ loadJs(`${STEEDOS_UNPKG_URL}/marked@4.0.17/marked.min.js`);
75
+ loadJs(`${STEEDOS_UNPKG_URL}/crypto-js@4.1.1/crypto-js.js`);
76
+
77
+ loadJs(`${STEEDOS_UNPKG_URL}/@steedos-builder/sdk@0.2.38/dist/index.umd.js`, ()=>{
78
+ window.Builder = BuilderSDK.Builder;
79
+ window.builder = BuilderSDK.builder;
80
+ window.builder.init('steedos');
81
+
82
+ let searchParams = new URLSearchParams(location.search);
83
+ if (searchParams.get('assetUrls')) {
84
+ sessionStorage.setItem('assetUrls', searchParams.get('assetUrls'))
85
+ }
86
+
87
+ let assetUrls = sessionStorage.getItem('assetUrls')? sessionStorage.getItem('assetUrls') : STEEDOS_PUBLIC_PAGE_ASSETURLS
88
+ if(typeof "assetUrls" == 'string'){
89
+ assetUrls = assetUrls.split(',');
90
+ }
91
+
92
+ const getBrowserLocale = function() {
93
+ var l, locale;
94
+ l = window.navigator.userLanguage || window.navigator.language || 'en';
95
+ if (l.indexOf("zh") >= 0) {
96
+ locale = "zh-cn";
97
+ } else {
98
+ locale = "en-us";
99
+ }
100
+ return locale;
101
+ };
102
+
103
+ Builder.set({
104
+ nodeEnv: NODE_ENV,
105
+ rootUrl: ROOT_URL,
106
+ unpkgUrl: STEEDOS_UNPKG_URL,
107
+ steedosVersion: STEEDOS_VERSION,
108
+ assetUrls,
109
+ steedosAmisVersion: STEEDOS_AMIS_VERSION,
110
+ locale: STEEDOS_LOCALE || getBrowserLocale()
111
+ });
112
+ });
113
+
114
+ loadJs(`${STEEDOS_AMIS_URL}/sdk/sdk.js`, ()=>{
115
+ window.axios = amisRequire('axios');
116
+ window.moment = amisRequire('moment');
117
+ window.React = amisRequire('react');
118
+ window.ReactDOM = amisRequire('react-dom');
119
+ window.React17 = window.React;
120
+ window.ReactDOM17 = window.ReactDOM;
121
+ });
122
+
123
+ window.addEventListener('message', function (event) {
124
+ const { data } = event;
125
+ if (data.type === 'Builder.loaded') {
126
+ Builder.registerRemoteAssets(Builder.settings.assetUrls);
127
+ }
128
+ });
129
+
130
+ if (STEEDOS_PUBLIC_SCRIPT_VCONSOLE) {
131
+ loadJs(STEEDOS_PUBLIC_SCRIPT_VCONSOLE, ()=>{
132
+ window.vConsole = new window.VConsole();
133
+ });
134
+ }
135
+
136
+ if (STEEDOS_PUBLIC_SCRIPT_PLUGINS) {
137
+ STEEDOS_PUBLIC_SCRIPT_PLUGINS.split(',').forEach(function (src) {
138
+ loadJs(src)
139
+ })
140
+ }
141
+
142
+ if (STEEDOS_PUBLIC_STYLE_PLUGINS) {
143
+ STEEDOS_PUBLIC_STYLE_PLUGINS.split(',').forEach(function (src) {
144
+ loadCss(src)
145
+ })
146
+ }
147
+
148
+ })();
@@ -0,0 +1,90 @@
1
+ /*
2
+ * @Author: baozhoutao@steedos.com
3
+ * @Date: 2022-04-04 16:34:28
4
+ * @Description:
5
+ */
6
+ const express = require("express");
7
+ const router = express.Router();
8
+ const core = require('@steedos/core');
9
+ const ejs = require('ejs');
10
+ const fs = require('fs');
11
+ const _ = require('lodash');
12
+ const path = require('path');
13
+
14
+ const getConfig = (key, platform)=>{
15
+ if(platform === 'cordova'){
16
+ let value = process.env[key];
17
+ //如果不是以http开头的,就是相对路径, 则加上ROOT_URL
18
+ if(_.startsWith(value, '/')){
19
+ return Meteor.absoluteUrl(value) ;
20
+ }
21
+ return value;
22
+ }else{
23
+ return process.env[key]
24
+ }
25
+ }
26
+
27
+ /**
28
+ * 虽然script 标签的 async = false; 可以解决js之间的依赖顺序问题, 但是它无法做到比 HTML 中其他非动态加载的 script 脚本更早执行
29
+ * 所以调整了meteor 内核加载 bundledJs、staticJs的方式 (creator/packages/boilerplate-generator)
30
+ */
31
+ router.get('/main_head.js', async function (req, res) {
32
+ try {
33
+ const { platform } = req.query;
34
+ res.set('Content-Type', 'application/javascript; charset=UTF-8');
35
+ const filename = path.join(__dirname, 'main_head.ejs');
36
+ const data = {
37
+ ROOT_URL: platform === 'cordova' ? __meteor_runtime_config__.ROOT_URL : '',
38
+ STEEDOS_SENTRY_ENABLED: process.env.STEEDOS_SENTRY_ENABLED,
39
+ NODE_ENV: process.env.NODE_ENV,
40
+ STEEDOS_SENTRY_DSN: process.env.STEEDOS_SENTRY_DSN,
41
+ STEEDOS_UNPKG_URL: getConfig('STEEDOS_UNPKG_URL', platform),
42
+ STEEDOS_AMIS_URL: getConfig('STEEDOS_AMIS_URL', platform),
43
+ STEEDOS_PUBLIC_SCRIPT_VCONSOLE: getConfig('STEEDOS_PUBLIC_SCRIPT_VCONSOLE', platform),
44
+ STEEDOS_PUBLIC_SCRIPT_PLUGINS: getConfig('STEEDOS_PUBLIC_SCRIPT_PLUGINS', platform),
45
+ STEEDOS_PUBLIC_STYLE_PLUGINS: getConfig('STEEDOS_PUBLIC_STYLE_PLUGINS', platform),
46
+ STEEDOS_VERSION: process.env.STEEDOS_VERSION,
47
+ STEEDOS_LOCALE: "",
48
+ STEEDOS_PUBLIC_PAGE_ASSETURLS: process.env.STEEDOS_PUBLIC_PAGE_ASSETURLS,
49
+ STEEDOS_AMIS_VERSION: process.env.STEEDOS_AMIS_VERSION,
50
+ platform: __meteor_runtime_config__.PUBLIC_SETTINGS?.platform || {}
51
+ }
52
+ const options = {}
53
+ ejs.renderFile(filename, data, options, function(err, str){
54
+ // str => Rendered HTML string
55
+ if(err){
56
+ res.send(err);
57
+ }else{
58
+ res.send(str);
59
+ }
60
+ });
61
+
62
+ } catch (error) {
63
+ res.status(500).send({ message: error.message });
64
+ }
65
+
66
+ });
67
+
68
+
69
+
70
+ router.get('/main_head.css', async function(req, res){
71
+ const { platform } = req.query;
72
+
73
+ res.set('Content-Type', 'text/css; charset=UTF-8');
74
+
75
+ const STEEDOS_UNPKG_URL = getConfig('STEEDOS_UNPKG_URL', platform);
76
+ const STEEDOS_AMIS_URL = getConfig('STEEDOS_AMIS_URL', platform);
77
+ const ROOT_URL = platform === 'cordova' ? __meteor_runtime_config__.ROOT_URL : '';
78
+
79
+ res.send(`
80
+ @import url("${STEEDOS_UNPKG_URL}/@salesforce-ux/design-system@2.19.0/assets/styles/salesforce-lightning-design-system.min.css");
81
+ @import url("${STEEDOS_AMIS_URL}/lib/themes/antd.css");
82
+ @import url("${STEEDOS_AMIS_URL}/lib/helper.css");
83
+ @import url("${STEEDOS_AMIS_URL}/sdk/iconfont.css");
84
+ @import url("${STEEDOS_UNPKG_URL}/@fortawesome/fontawesome-free@6.2.0/css/all.min.css");
85
+ @import url("${ROOT_URL}/tailwind/tailwind-steedos.css");
86
+ @import url("${ROOT_URL}/amis/amis.css");
87
+ `);
88
+ })
89
+
90
+ exports.default = router;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steedos/standard-ui",
3
- "version": "2.5.12",
3
+ "version": "2.5.13-beta.10",
4
4
  "main": "package.service.js",
5
5
  "private": false,
6
6
  "publishConfig": {
@@ -12,5 +12,5 @@
12
12
  "description": "steedos package",
13
13
  "repository": {},
14
14
  "license": "MIT",
15
- "gitHead": "cdf06aa70a7b55d8dae3fdd62bb24d8fe004b5c9"
15
+ "gitHead": "f76edf1cd8bc1d159437aee9b83ca981f67dd2a1"
16
16
  }
@@ -1,8 +1,8 @@
1
1
  /*
2
2
  * @Author: sunhaolin@hotoa.com
3
3
  * @Date: 2022-07-29 09:40:31
4
- * @LastEditors: baozhoutao@steedos.com
5
- * @LastEditTime: 2023-08-19 19:56:00
4
+ * @LastEditors: 殷亮辉 yinlianghui@hotoa.com
5
+ * @LastEditTime: 2023-09-11 15:45:29
6
6
  * @Description:
7
7
  */
8
8
  "use strict";
@@ -52,8 +52,9 @@ module.exports = {
52
52
  {
53
53
  objectName: 'space_users',
54
54
  query: {
55
- fields: ['_id', 'user', 'name'],
56
- filters: [["user", "in", userIds]]
55
+ fields: ['_id', 'user', 'name', 'sort_no'],
56
+ filters: [["user", "in", userIds]],
57
+ sort: 'sort_no desc'
57
58
  },
58
59
  }
59
60
  );