@dckj-npm/dc-material 0.1.138 → 0.1.140

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.
@@ -1,53 +1,5 @@
1
1
  import { IPublicTypeComponentMetadata, IPublicTypeSnippet } from '@alilc/lowcode-types'
2
2
 
3
- // 假设这是你的异步函数,用于从服务器获取选项
4
- async function fetchFormOptions(): Promise<{ title: string; value: string }[]> {
5
- // const url = 'https://51ymb.com/source/api/dynamicFormTable/map'
6
- const url = '/source/api/dynamicFormTable/map'
7
-
8
- const params = {
9
- fkProjectSpace: '1046107745394233344',
10
- }
11
- const projectId = new URLSearchParams(location.search.slice(1)).get('projectId') || 'general'
12
- const dcAuthType = 'authToken-' + projectId
13
-
14
- const response = await fetch(url, {
15
- method: 'POST',
16
- // headers: {
17
- // 'Content-Type': 'application/json',
18
- // authtoken: 'd5e654eb19f44b4e94093abcddfeff29',
19
- // 'authtoken-936702478408355840': 'efadae8252af42da94aeea90240ff2dc',
20
- // sitecode: '936702478408355840',
21
- // dcauthtype: 'authToken-936702478408355840',
22
- // },
23
- headers: {
24
- 'Content-Type': 'application/json',
25
- authToken: encodeURIComponent(localStorage.getItem('authToken') || ('' as string)),
26
- siteCode: projectId,
27
- dcAuthType,
28
- [dcAuthType]: encodeURIComponent(localStorage.getItem(dcAuthType) || ('' as string)),
29
- },
30
- body: JSON.stringify(params),
31
- })
32
-
33
- if (!response.ok) {
34
- throw new Error(`HTTP error! status: ${response.status}`)
35
- }
36
-
37
- const data = await response.json()
38
- console.log(
39
- 'data',
40
- data.data.map((item: any) => ({
41
- title: item.tableComment,
42
- value: item.tableName,
43
- })),
44
- )
45
- return data.data.map((item: any) => ({
46
- title: item.tableComment,
47
- value: item.tableName,
48
- }))
49
- }
50
-
51
3
  const DCFormMeta: IPublicTypeComponentMetadata = {
52
4
  componentName: 'DCForm',
53
5
  title: 'DCForm',
@@ -81,6 +33,7 @@ const DCFormMeta: IPublicTypeComponentMetadata = {
81
33
  { label: '字段长度', value: 'columnSize' },
82
34
  { label: '字段类型', value: 'columnType' },
83
35
  { label: '控件类型', value: 'columnKeyType' },
36
+ { label: '控件类型', value: 'columnKeyTypeEnum' },
84
37
  { label: '是否只读', value: 'isOnlyRead' },
85
38
  { label: '是否必填', value: 'isRequired' },
86
39
  { label: '默认值', value: 'defaultValue' },
@@ -90,28 +43,6 @@ const DCFormMeta: IPublicTypeComponentMetadata = {
90
43
  },
91
44
  },
92
45
  },
93
- {
94
- name: '数据源绑定',
95
- setter: {
96
- componentName: 'SetterFormVariable',
97
- props: {
98
- attributes: [
99
- {
100
- label: '图文数据',
101
- value: 'dataList',
102
- children: [
103
- { label: '表单项标题', value: 'title' },
104
- { label: '表单项组件类型', value: 'type' },
105
- { label: '是否只读', value: 'isOnlyRead' },
106
- { label: '是否必填', value: 'isRequired' },
107
- { label: '默认值', value: 'defaultValue' },
108
- { label: '指示词', value: 'guideWords' },
109
- ],
110
- },
111
- ],
112
- },
113
- },
114
- },
115
46
  ],
116
47
  supports: {
117
48
  style: true,
@@ -1,74 +1,4 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
- import _regeneratorRuntime from "@babel/runtime/regenerator";
4
- // 假设这是你的异步函数,用于从服务器获取选项
5
- function fetchFormOptions() {
6
- return _fetchFormOptions.apply(this, arguments);
7
- }
8
- function _fetchFormOptions() {
9
- _fetchFormOptions = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
10
- var _headers;
11
- var url, params, projectId, dcAuthType, response, data;
12
- return _regeneratorRuntime.wrap(function _callee$(_context) {
13
- while (1) switch (_context.prev = _context.next) {
14
- case 0:
15
- // const url = 'https://51ymb.com/source/api/dynamicFormTable/map'
16
- url = '/source/api/dynamicFormTable/map';
17
- params = {
18
- fkProjectSpace: '1046107745394233344'
19
- };
20
- projectId = new URLSearchParams(location.search.slice(1)).get('projectId') || 'general';
21
- dcAuthType = 'authToken-' + projectId;
22
- _context.next = 6;
23
- return fetch(url, {
24
- method: 'POST',
25
- // headers: {
26
- // 'Content-Type': 'application/json',
27
- // authtoken: 'd5e654eb19f44b4e94093abcddfeff29',
28
- // 'authtoken-936702478408355840': 'efadae8252af42da94aeea90240ff2dc',
29
- // sitecode: '936702478408355840',
30
- // dcauthtype: 'authToken-936702478408355840',
31
- // },
32
- headers: (_headers = {
33
- 'Content-Type': 'application/json',
34
- authToken: encodeURIComponent(localStorage.getItem('authToken') || ''),
35
- siteCode: projectId,
36
- dcAuthType: dcAuthType
37
- }, _headers[dcAuthType] = encodeURIComponent(localStorage.getItem(dcAuthType) || ''), _headers),
38
- body: JSON.stringify(params)
39
- });
40
- case 6:
41
- response = _context.sent;
42
- if (response.ok) {
43
- _context.next = 9;
44
- break;
45
- }
46
- throw new Error("HTTP error! status: " + response.status);
47
- case 9:
48
- _context.next = 11;
49
- return response.json();
50
- case 11:
51
- data = _context.sent;
52
- console.log('data', data.data.map(function (item) {
53
- return {
54
- title: item.tableComment,
55
- value: item.tableName
56
- };
57
- }));
58
- return _context.abrupt("return", data.data.map(function (item) {
59
- return {
60
- title: item.tableComment,
61
- value: item.tableName
62
- };
63
- }));
64
- case 14:
65
- case "end":
66
- return _context.stop();
67
- }
68
- }, _callee);
69
- }));
70
- return _fetchFormOptions.apply(this, arguments);
71
- }
72
2
  var DCFormMeta = {
73
3
  componentName: 'DCForm',
74
4
  title: 'DCForm',
@@ -112,32 +42,8 @@ var DCFormMeta = {
112
42
  label: '控件类型',
113
43
  value: 'columnKeyType'
114
44
  }, {
115
- label: '是否只读',
116
- value: 'isOnlyRead'
117
- }, {
118
- label: '是否必填',
119
- value: 'isRequired'
120
- }, {
121
- label: '默认值',
122
- value: 'defaultValue'
123
- }]
124
- }]
125
- }
126
- }
127
- }, {
128
- name: '数据源绑定',
129
- setter: {
130
- componentName: 'SetterFormVariable',
131
- props: {
132
- attributes: [{
133
- label: '图文数据',
134
- value: 'dataList',
135
- children: [{
136
- label: '表单项标题',
137
- value: 'title'
138
- }, {
139
- label: '表单项组件类型',
140
- value: 'type'
45
+ label: '控件类型',
46
+ value: 'columnKeyTypeEnum'
141
47
  }, {
142
48
  label: '是否只读',
143
49
  value: 'isOnlyRead'
@@ -147,9 +53,6 @@ var DCFormMeta = {
147
53
  }, {
148
54
  label: '默认值',
149
55
  value: 'defaultValue'
150
- }, {
151
- label: '指示词',
152
- value: 'guideWords'
153
56
  }]
154
57
  }]
155
58
  }
@@ -95,7 +95,7 @@ function fillRealVersion(meta, packageName, version, basicLibraryVersion) {
95
95
  packageName = '@dckj-npm/dc-material';
96
96
  }
97
97
  if (version === void 0) {
98
- version = '0.1.138';
98
+ version = '0.1.140';
99
99
  }
100
100
  if (basicLibraryVersion === void 0) {
101
101
  basicLibraryVersion = {
@@ -3,77 +3,7 @@
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
4
  exports.__esModule = true;
5
5
  exports["default"] = void 0;
6
- var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
7
6
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
8
- var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
9
- // 假设这是你的异步函数,用于从服务器获取选项
10
- function fetchFormOptions() {
11
- return _fetchFormOptions.apply(this, arguments);
12
- }
13
- function _fetchFormOptions() {
14
- _fetchFormOptions = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee() {
15
- var _headers;
16
- var url, params, projectId, dcAuthType, response, data;
17
- return _regenerator["default"].wrap(function _callee$(_context) {
18
- while (1) switch (_context.prev = _context.next) {
19
- case 0:
20
- // const url = 'https://51ymb.com/source/api/dynamicFormTable/map'
21
- url = '/source/api/dynamicFormTable/map';
22
- params = {
23
- fkProjectSpace: '1046107745394233344'
24
- };
25
- projectId = new URLSearchParams(location.search.slice(1)).get('projectId') || 'general';
26
- dcAuthType = 'authToken-' + projectId;
27
- _context.next = 6;
28
- return fetch(url, {
29
- method: 'POST',
30
- // headers: {
31
- // 'Content-Type': 'application/json',
32
- // authtoken: 'd5e654eb19f44b4e94093abcddfeff29',
33
- // 'authtoken-936702478408355840': 'efadae8252af42da94aeea90240ff2dc',
34
- // sitecode: '936702478408355840',
35
- // dcauthtype: 'authToken-936702478408355840',
36
- // },
37
- headers: (_headers = {
38
- 'Content-Type': 'application/json',
39
- authToken: encodeURIComponent(localStorage.getItem('authToken') || ''),
40
- siteCode: projectId,
41
- dcAuthType: dcAuthType
42
- }, _headers[dcAuthType] = encodeURIComponent(localStorage.getItem(dcAuthType) || ''), _headers),
43
- body: JSON.stringify(params)
44
- });
45
- case 6:
46
- response = _context.sent;
47
- if (response.ok) {
48
- _context.next = 9;
49
- break;
50
- }
51
- throw new Error("HTTP error! status: " + response.status);
52
- case 9:
53
- _context.next = 11;
54
- return response.json();
55
- case 11:
56
- data = _context.sent;
57
- console.log('data', data.data.map(function (item) {
58
- return {
59
- title: item.tableComment,
60
- value: item.tableName
61
- };
62
- }));
63
- return _context.abrupt("return", data.data.map(function (item) {
64
- return {
65
- title: item.tableComment,
66
- value: item.tableName
67
- };
68
- }));
69
- case 14:
70
- case "end":
71
- return _context.stop();
72
- }
73
- }, _callee);
74
- }));
75
- return _fetchFormOptions.apply(this, arguments);
76
- }
77
7
  var DCFormMeta = {
78
8
  componentName: 'DCForm',
79
9
  title: 'DCForm',
@@ -117,32 +47,8 @@ var DCFormMeta = {
117
47
  label: '控件类型',
118
48
  value: 'columnKeyType'
119
49
  }, {
120
- label: '是否只读',
121
- value: 'isOnlyRead'
122
- }, {
123
- label: '是否必填',
124
- value: 'isRequired'
125
- }, {
126
- label: '默认值',
127
- value: 'defaultValue'
128
- }]
129
- }]
130
- }
131
- }
132
- }, {
133
- name: '数据源绑定',
134
- setter: {
135
- componentName: 'SetterFormVariable',
136
- props: {
137
- attributes: [{
138
- label: '图文数据',
139
- value: 'dataList',
140
- children: [{
141
- label: '表单项标题',
142
- value: 'title'
143
- }, {
144
- label: '表单项组件类型',
145
- value: 'type'
50
+ label: '控件类型',
51
+ value: 'columnKeyTypeEnum'
146
52
  }, {
147
53
  label: '是否只读',
148
54
  value: 'isOnlyRead'
@@ -152,9 +58,6 @@ var DCFormMeta = {
152
58
  }, {
153
59
  label: '默认值',
154
60
  value: 'defaultValue'
155
- }, {
156
- label: '指示词',
157
- value: 'guideWords'
158
61
  }]
159
62
  }]
160
63
  }
@@ -100,7 +100,7 @@ function fillRealVersion(meta, packageName, version, basicLibraryVersion) {
100
100
  packageName = '@dckj-npm/dc-material';
101
101
  }
102
102
  if (version === void 0) {
103
- version = '0.1.138';
103
+ version = '0.1.140';
104
104
  }
105
105
  if (basicLibraryVersion === void 0) {
106
106
  basicLibraryVersion = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dckj-npm/dc-material",
3
- "version": "0.1.138",
3
+ "version": "0.1.140",
4
4
  "description": "dc低代码物料",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -103,7 +103,7 @@
103
103
  },
104
104
  "componentConfig": {
105
105
  "isComponentLibrary": true,
106
- "materialSchema": "https://unpkg.com/@dckj-npm/dc-material@0.1.138/build/lowcode/assets-prod.json"
106
+ "materialSchema": "https://unpkg.com/@dckj-npm/dc-material@0.1.140/build/lowcode/assets-prod.json"
107
107
  },
108
108
  "lcMeta": {
109
109
  "type": "component"