ydb-components-material 0.1.159 → 0.1.161

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.
@@ -128,17 +128,17 @@ var FileItem = function FileItem(_ref) {
128
128
  console.log('prerequisite', prerequisite);
129
129
  if (!prerequisite) {
130
130
  setShowSignBtn(false);
131
- return;
131
+ // return;
132
132
  }
133
133
  // 会签暂时不上线
134
- if (Object.keys(signerInfo).length) {
135
- // 代办场景
136
- setShowSignBtn(!((signatureAgentRole !== null && signatureAgentRole !== void 0 ? signatureAgentRole : []).includes(OTHER) || (signAgentRole !== null && signAgentRole !== void 0 ? signAgentRole : []).includes(OTHER)));
137
- } else {
138
- console.log('signatureSelfRole---', signatureSelfRole);
139
- // 本人场景
140
- setShowSignBtn(!((signatureSelfRole !== null && signatureSelfRole !== void 0 ? signatureSelfRole : []).includes(OTHER) || (signSelfRole !== null && signSelfRole !== void 0 ? signSelfRole : []).includes(OTHER)));
141
- }
134
+ // if (Object.keys(signerInfo).length) {
135
+ // // 代办场景
136
+ // setShowSignBtn(!((signatureAgentRole ?? []).includes(OTHER) || (signAgentRole ?? []).includes(OTHER)));
137
+ // } else {
138
+ // console.log('signatureSelfRole---', signatureSelfRole)
139
+ // // 本人场景
140
+ // setShowSignBtn(!((signatureSelfRole ?? []).includes(OTHER) || (signSelfRole ?? []).includes(OTHER)));
141
+ // }
142
142
  }, [signatureEnable, signEnable, userInfo, signerInfo, signatureAgentRole, signAgentRole, signatureSelfRole, signSelfRole]);
143
143
  var _useState = useState(false),
144
144
  isShowMaterialLib = _useState[0],
@@ -600,7 +600,7 @@ var FileItem = function FileItem(_ref) {
600
600
  }
601
601
  valChange(val, fileIndex, index, subIndex);
602
602
  // invalidHandle()
603
- // needOtherSign && setShowSignerInfo(true)
603
+ needOtherSign && setShowSignerInfo(true);
604
604
  };
605
605
 
606
606
  // 获取签章结果
@@ -617,7 +617,7 @@ var FileItem = function FileItem(_ref) {
617
617
  }
618
618
  valChange(val, fileIndex, index, subIndex);
619
619
  // invalidHandle()
620
- // needOtherSign && setShowSignerInfo(true)
620
+ needOtherSign && setShowSignerInfo(true);
621
621
  }
622
622
  };
623
623
  var queryFileLibs = function queryFileLibs() {
@@ -113,23 +113,26 @@ var SceneTree = function SceneTree(_ref) {
113
113
  targetNodeOfCurTree.children = targetNodeChildList;
114
114
  } else {
115
115
  // 如果已经有子题目 查一下已经存在的子题目中是否有当前选中项的子题目
116
+ // 按 groupId 去重(同一组的子题目视为同一题),无 groupId 时退回按 id
116
117
  console.log('targetNodeOfCurTree---', targetNodeOfCurTree);
118
+ var targetChildGroupId = targetNodeChildList[0].groupId;
117
119
  var alreadyExit = (targetNodeOfCurTree.children || []).find(function (v) {
118
- return v.id === targetNodeChildList[0].id;
120
+ return targetChildGroupId ? v.groupId === targetChildGroupId : v.id === targetNodeChildList[0].id;
119
121
  });
120
122
  if (alreadyExit) {
121
123
  // 如果存在 说明当前带出来的这个子题目已经存在 需要合并两个题目的选项下的children
122
124
 
123
125
  var repeatQuestion = targetNodeChildList[0];
124
126
  // 遍历这两个重复题目的选项 合并每个选项的children
127
+ // 选项匹配与子题目去重同样按 groupId(无 groupId 时退回按 id)
125
128
  alreadyExit.options.forEach(function (o) {
126
129
  var curOption = repeatQuestion.options.find(function (r) {
127
- return r.id === o.id;
130
+ return o.groupId ? r.groupId === o.groupId : r.id === o.id;
128
131
  });
129
132
  if (curOption) {
130
133
  curOption.children.forEach(function (child) {
131
134
  if (!o.children.find(function (c) {
132
- return c.id === child.id;
135
+ return child.groupId ? c.groupId === child.groupId : c.id === child.id;
133
136
  })) {
134
137
  o.children.push(child);
135
138
  }
@@ -134,17 +134,17 @@ var FileItem = function FileItem(_ref) {
134
134
  console.log('prerequisite', prerequisite);
135
135
  if (!prerequisite) {
136
136
  setShowSignBtn(false);
137
- return;
137
+ // return;
138
138
  }
139
139
  // 会签暂时不上线
140
- if (Object.keys(signerInfo).length) {
141
- // 代办场景
142
- setShowSignBtn(!((signatureAgentRole !== null && signatureAgentRole !== void 0 ? signatureAgentRole : []).includes(OTHER) || (signAgentRole !== null && signAgentRole !== void 0 ? signAgentRole : []).includes(OTHER)));
143
- } else {
144
- console.log('signatureSelfRole---', signatureSelfRole);
145
- // 本人场景
146
- setShowSignBtn(!((signatureSelfRole !== null && signatureSelfRole !== void 0 ? signatureSelfRole : []).includes(OTHER) || (signSelfRole !== null && signSelfRole !== void 0 ? signSelfRole : []).includes(OTHER)));
147
- }
140
+ // if (Object.keys(signerInfo).length) {
141
+ // // 代办场景
142
+ // setShowSignBtn(!((signatureAgentRole ?? []).includes(OTHER) || (signAgentRole ?? []).includes(OTHER)));
143
+ // } else {
144
+ // console.log('signatureSelfRole---', signatureSelfRole)
145
+ // // 本人场景
146
+ // setShowSignBtn(!((signatureSelfRole ?? []).includes(OTHER) || (signSelfRole ?? []).includes(OTHER)));
147
+ // }
148
148
  }, [signatureEnable, signEnable, userInfo, signerInfo, signatureAgentRole, signAgentRole, signatureSelfRole, signSelfRole]);
149
149
  var _useState = (0, _react.useState)(false),
150
150
  isShowMaterialLib = _useState[0],
@@ -606,7 +606,7 @@ var FileItem = function FileItem(_ref) {
606
606
  }
607
607
  valChange(val, fileIndex, index, subIndex);
608
608
  // invalidHandle()
609
- // needOtherSign && setShowSignerInfo(true)
609
+ needOtherSign && setShowSignerInfo(true);
610
610
  };
611
611
 
612
612
  // 获取签章结果
@@ -623,7 +623,7 @@ var FileItem = function FileItem(_ref) {
623
623
  }
624
624
  valChange(val, fileIndex, index, subIndex);
625
625
  // invalidHandle()
626
- // needOtherSign && setShowSignerInfo(true)
626
+ needOtherSign && setShowSignerInfo(true);
627
627
  }
628
628
  };
629
629
  var queryFileLibs = function queryFileLibs() {
@@ -119,23 +119,26 @@ var SceneTree = function SceneTree(_ref) {
119
119
  targetNodeOfCurTree.children = targetNodeChildList;
120
120
  } else {
121
121
  // 如果已经有子题目 查一下已经存在的子题目中是否有当前选中项的子题目
122
+ // 按 groupId 去重(同一组的子题目视为同一题),无 groupId 时退回按 id
122
123
  console.log('targetNodeOfCurTree---', targetNodeOfCurTree);
124
+ var targetChildGroupId = targetNodeChildList[0].groupId;
123
125
  var alreadyExit = (targetNodeOfCurTree.children || []).find(function (v) {
124
- return v.id === targetNodeChildList[0].id;
126
+ return targetChildGroupId ? v.groupId === targetChildGroupId : v.id === targetNodeChildList[0].id;
125
127
  });
126
128
  if (alreadyExit) {
127
129
  // 如果存在 说明当前带出来的这个子题目已经存在 需要合并两个题目的选项下的children
128
130
 
129
131
  var repeatQuestion = targetNodeChildList[0];
130
132
  // 遍历这两个重复题目的选项 合并每个选项的children
133
+ // 选项匹配与子题目去重同样按 groupId(无 groupId 时退回按 id)
131
134
  alreadyExit.options.forEach(function (o) {
132
135
  var curOption = repeatQuestion.options.find(function (r) {
133
- return r.id === o.id;
136
+ return o.groupId ? r.groupId === o.groupId : r.id === o.id;
134
137
  });
135
138
  if (curOption) {
136
139
  curOption.children.forEach(function (child) {
137
140
  if (!o.children.find(function (c) {
138
- return c.id === child.id;
141
+ return child.groupId ? c.groupId === child.groupId : c.id === child.id;
139
142
  })) {
140
143
  o.children.push(child);
141
144
  }
@@ -98,7 +98,7 @@ function fillRealVersion(meta, packageName, version, basicLibraryVersion) {
98
98
  packageName = 'ydb-components-material';
99
99
  }
100
100
  if (version === void 0) {
101
- version = '0.1.159';
101
+ version = '0.1.161';
102
102
  }
103
103
  if (basicLibraryVersion === void 0) {
104
104
  basicLibraryVersion = {
@@ -103,7 +103,7 @@ function fillRealVersion(meta, packageName, version, basicLibraryVersion) {
103
103
  packageName = 'ydb-components-material';
104
104
  }
105
105
  if (version === void 0) {
106
- version = '0.1.159';
106
+ version = '0.1.161';
107
107
  }
108
108
  if (basicLibraryVersion === void 0) {
109
109
  basicLibraryVersion = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ydb-components-material",
3
- "version": "0.1.159",
3
+ "version": "0.1.161",
4
4
  "description": "ydb-components-material",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -102,10 +102,10 @@
102
102
  },
103
103
  "componentConfig": {
104
104
  "isComponentLibrary": true,
105
- "materialSchema": "https://unpkg.com/ydb-components-material@0.1.159/build/lowcode/assets-prod.json"
105
+ "materialSchema": "https://unpkg.com/ydb-components-material@0.1.161/build/lowcode/assets-prod.json"
106
106
  },
107
107
  "lcMeta": {
108
108
  "type": "component"
109
109
  },
110
- "homepage": "https://unpkg.com/ydb-components-material@0.1.159/build/index.html"
110
+ "homepage": "https://unpkg.com/ydb-components-material@0.1.161/build/index.html"
111
111
  }