neo-cmp-cli 1.3.9 → 1.3.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neo-cmp-cli",
3
- "version": "1.3.9",
3
+ "version": "1.3.10",
4
4
  "description": "前端脚手架:自定义组件开发工具,支持react 和 vue2.0技术栈。",
5
5
  "keywords": [
6
6
  "neo-cli",
@@ -119,4 +119,27 @@ module.exports = {
119
119
  assetsRoot: resolve('dist') // 上传指定目录下的脚本文件
120
120
  */
121
121
  },
122
+ publishCmp: {
123
+ // 用于构建并发布至 NeoCRM 的相关配置
124
+ credentials: {
125
+ client_id: 'xx', // 客户端 ID,从创建连接器的客户端信息中获取(Client_Id)
126
+ client_secret: 'xxx', // 客户端秘钥,从创建连接器的客户端信息中获取(Client_Secret)
127
+ username: 'xx', // 用户在销售易系统中的用户名
128
+ /**
129
+ * password 为 用户在销售易系统中的账号密码加上 8 位安全令牌。
130
+ * 例如,用户密码为 123456,安全令牌为 ABCDEFGH,则 password 的值应为 123456ABCDEFGH。
131
+ */
132
+ password: 'xx xx' // 用户账户密码 + 8 位安全令牌
133
+ },
134
+ /*
135
+ 【特别说明】以下配置项都自带默认值,非必填。如需自定义请自行配置。
136
+ NODE_ENV: 'production',
137
+ entry: { // 根据 src/components 目录下的文件自动生成 entry 相关配置
138
+ InfoCardModel: './src/components/entity-form/model.ts',
139
+ infoCard: './src/components/entity-form/register.ts'
140
+ },
141
+ cssExtract: false, // 不额外提取css文件
142
+ assetsRoot: resolve('dist') // 上传指定目录下的脚本文件
143
+ */
144
+ },
122
145
  };
@@ -110,8 +110,6 @@ export default class EntityForm extends React.PureComponent<
110
110
  > {
111
111
  constructor(props: EntityFormProps) {
112
112
  super(props);
113
- const { xObjectDataApi } = props;
114
- const { xObjectApiKey } = xObjectDataApi || {};
115
113
 
116
114
  // 初始化组件状态
117
115
  this.state = {
@@ -124,16 +122,21 @@ export default class EntityForm extends React.PureComponent<
124
122
  submitSuccess: false,
125
123
  };
126
124
 
125
+ // 绑定方法上下文
126
+ this.loadFieldList = this.loadFieldList.bind(this);
127
+ this.handleSubmit = this.handleSubmit.bind(this);
128
+ this.handleReset = this.handleReset.bind(this);
129
+ }
130
+
131
+ componentDidMount() {
132
+ const { xObjectDataApi } = this.props;
133
+ const { xObjectApiKey } = xObjectDataApi || {};
134
+
127
135
  if (xObjectApiKey) {
128
136
  // 初始化字段列表和业务类型列表
129
137
  this.getEntityTypeList(xObjectApiKey);
130
138
  this.loadFieldList();
131
139
  }
132
-
133
- // 绑定方法上下文
134
- this.loadFieldList = this.loadFieldList.bind(this);
135
- this.handleSubmit = this.handleSubmit.bind(this);
136
- this.handleReset = this.handleReset.bind(this);
137
140
  }
138
141
 
139
142
  /**
@@ -126,8 +126,8 @@ export default class EntityTable extends React.PureComponent<
126
126
  > {
127
127
  constructor(props: EntityTableProps) {
128
128
  super(props);
129
- const { xObjectDataApi } = props;
130
- const { xObjectApiKey, fields, page, pageSize } = xObjectDataApi || {};
129
+ const { xObjectDataApi } = this.props;
130
+ const { page, pageSize } = xObjectDataApi || {};
131
131
 
132
132
  // 初始化组件状态
133
133
  this.state = {
@@ -147,6 +147,20 @@ export default class EntityTable extends React.PureComponent<
147
147
  entityTypeList: [],
148
148
  };
149
149
 
150
+ // 绑定方法上下文
151
+ this.loadData = this.loadData.bind(this);
152
+ this.handleAdd = this.handleAdd.bind(this);
153
+ this.handleEdit = this.handleEdit.bind(this);
154
+ this.handleDelete = this.handleDelete.bind(this);
155
+ this.handleModalOk = this.handleModalOk.bind(this);
156
+ this.handleModalCancel = this.handleModalCancel.bind(this);
157
+ this.handleTableChange = this.handleTableChange.bind(this);
158
+ }
159
+
160
+ componentDidMount() {
161
+ const { xObjectDataApi } = this.props;
162
+ const { xObjectApiKey, fields, page, pageSize } = xObjectDataApi || {};
163
+
150
164
  if (xObjectApiKey) {
151
165
  // 初始化字段列表、加载数据和业务类型列表
152
166
  this.getEntityTypeList(xObjectApiKey);
@@ -156,15 +170,6 @@ export default class EntityTable extends React.PureComponent<
156
170
  this.loadData(page, pageSize);
157
171
  }
158
172
  }
159
-
160
- // 绑定方法上下文
161
- this.loadData = this.loadData.bind(this);
162
- this.handleAdd = this.handleAdd.bind(this);
163
- this.handleEdit = this.handleEdit.bind(this);
164
- this.handleDelete = this.handleDelete.bind(this);
165
- this.handleModalOk = this.handleModalOk.bind(this);
166
- this.handleModalCancel = this.handleModalCancel.bind(this);
167
- this.handleTableChange = this.handleTableChange.bind(this);
168
173
  }
169
174
 
170
175
  /**