cnhis-design-vue 3.1.16-beta.0 → 3.1.16-beta.1

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.
@@ -14,7 +14,7 @@ const ScaleViewInit = (props, state, emit, config) => {
14
14
  const { formatRules } = ScaleViewValidate(props, state, config);
15
15
  const { nextLogicEvent } = useEvent(props, state);
16
16
  const setEvaluateStartTime = (evaluateResultSetting) => {
17
- let evaluateStartTime = evaluateResultSetting == null ? void 0 : evaluateResultSetting.evaluateStartTime;
17
+ const evaluateStartTime = evaluateResultSetting == null ? void 0 : evaluateResultSetting.evaluateStartTime;
18
18
  if (!evaluateStartTime)
19
19
  return;
20
20
  if (!vexutils.isValidDate(new Date(evaluateStartTime)) && vexutils.isValidDate(new Date(Number(evaluateStartTime)))) {
@@ -57,12 +57,12 @@ const ScaleViewInit = (props, state, emit, config) => {
57
57
  state.showEvaluateCountdownWrap = true;
58
58
  return;
59
59
  }
60
- let { evaluateResultSetting = {} } = state.config;
60
+ const { evaluateResultSetting = {} } = state.config;
61
61
  if (!evaluateResultSetting || !Object.keys(evaluateResultSetting).length)
62
62
  return;
63
63
  state.showEvaluateCountdownWrap = true;
64
- let { evaluateStartTime } = evaluateResultSetting;
65
- let { evaluateName } = ((_a = state.originConfig) == null ? void 0 : _a.evaluateResultSetting) || {};
64
+ const { evaluateStartTime } = evaluateResultSetting;
65
+ const { evaluateName } = ((_a = state.originConfig) == null ? void 0 : _a.evaluateResultSetting) || {};
66
66
  if (!evaluateStartTime) {
67
67
  state.showEvaluatePage = true;
68
68
  return;
@@ -76,7 +76,7 @@ const ScaleViewInit = (props, state, emit, config) => {
76
76
  const initForm = (data) => {
77
77
  var _a;
78
78
  let { list = [], map = {}, isFinished = false } = data;
79
- let curUrl = handleFrontAddress(list);
79
+ const curUrl = handleFrontAddress(list);
80
80
  if (curUrl) {
81
81
  window.location.href = curUrl;
82
82
  return;
@@ -112,13 +112,13 @@ const ScaleViewInit = (props, state, emit, config) => {
112
112
  }
113
113
  state.originConfig = JSON.parse(JSON.stringify(state.config));
114
114
  if (props.params && Object.keys(props.params).length) {
115
- let res = handleBtnParamsEvaluate(props.params);
115
+ const res = handleBtnParamsEvaluate(props.params);
116
116
  res && Object.keys(res).length && (state.paramsEvaluate = res);
117
117
  }
118
118
  handleEvaluateParams(state.config.evaluateResultSetting);
119
119
  handleShowEvaluate();
120
120
  state.defaultFormArray = JSON.parse(JSON.stringify(list));
121
- let filterArr = state.filterArr;
121
+ const filterArr = state.filterArr;
122
122
  list = list.filter((v) => !filterArr.includes(v.type));
123
123
  state.formArray = formatArray(list || []);
124
124
  state.form = defaultFormValue(state.formArray);
@@ -128,13 +128,13 @@ const ScaleViewInit = (props, state, emit, config) => {
128
128
  state.hasFrontAddress = false;
129
129
  };
130
130
  const replaceConditionItem = (options, value) => {
131
- let matchOption = options.find((v) => value === v.value);
131
+ const matchOption = options.find((v) => value === v.value);
132
132
  if (!matchOption)
133
133
  return value;
134
134
  return matchOption.key;
135
135
  };
136
136
  const isRadioOrCheckBox = (options, type) => {
137
- let typeArr = ["RADIO_BLOCK", "CHECKBOX_BLOCK"];
137
+ const typeArr = ["RADIO_BLOCK", "CHECKBOX_BLOCK"];
138
138
  if (!typeArr.includes(type))
139
139
  return;
140
140
  if (!options)
@@ -147,10 +147,10 @@ const ScaleViewInit = (props, state, emit, config) => {
147
147
  return true;
148
148
  };
149
149
  const handLenextLogic = (item) => {
150
- let { nextLogic, options, type } = item || {};
150
+ const { nextLogic, options, type } = item || {};
151
151
  if (!nextLogic || !isRadioOrCheckBox(options, type))
152
152
  return;
153
- let { condition } = nextLogic || {};
153
+ const { condition } = nextLogic || {};
154
154
  if (!condition || !condition.length)
155
155
  return;
156
156
  condition.forEach((c) => {
@@ -166,12 +166,12 @@ const ScaleViewInit = (props, state, emit, config) => {
166
166
  });
167
167
  };
168
168
  const handleRelationLogic = (list, item) => {
169
- let relationLogicObj = vexutils.isString(item.relationLogic) ? JSON.parse(item.relationLogic) : item.relationLogic;
170
- let { condition } = relationLogicObj || {};
169
+ const relationLogicObj = vexutils.isString(item.relationLogic) ? JSON.parse(item.relationLogic) : item.relationLogic;
170
+ const { condition } = relationLogicObj || {};
171
171
  if (!condition || !condition.length)
172
172
  return;
173
173
  condition.forEach((c) => {
174
- let matchItem = list.find((f) => f.seq == c.subject_seq);
174
+ const matchItem = list.find((f) => f.seq == c.subject_seq);
175
175
  if (!matchItem)
176
176
  return;
177
177
  if (!isRadioOrCheckBox(matchItem.options, matchItem.type))
@@ -192,10 +192,10 @@ const ScaleViewInit = (props, state, emit, config) => {
192
192
  var _a, _b;
193
193
  if (!list || !list.length)
194
194
  return;
195
- let query = handleQueryParams();
195
+ const query = handleQueryParams();
196
196
  if ((props == null ? void 0 : props.noBtn) || (query == null ? void 0 : query.noBtn))
197
197
  return;
198
- let matchItem = list.find((item) => item.type === "FRONT_ADDRESS");
198
+ const matchItem = list.find((item) => item.type === "FRONT_ADDRESS");
199
199
  if (!matchItem || !Object.keys(matchItem).length)
200
200
  return;
201
201
  let setting;
@@ -206,22 +206,22 @@ const ScaleViewInit = (props, state, emit, config) => {
206
206
  return;
207
207
  if ((query == null ? void 0 : query.redirect) == 1 || ((_a = props.params) == null ? void 0 : _a.redirect) == 1 || query.isEdit == 3 || ((_b = props.params) == null ? void 0 : _b.isEdit) == 3)
208
208
  return;
209
- let { frontAddress } = setting;
209
+ const { frontAddress } = setting;
210
210
  if (frontAddress) {
211
- let urlHref = window.location.href;
211
+ const urlHref = window.location.href;
212
212
  let preStr = "?";
213
213
  if (frontAddress.includes("?")) {
214
214
  preStr = "&";
215
215
  }
216
- let curUrl = `${frontAddress}${preStr}redirect_url=${encodeURIComponent(urlHref)}`;
216
+ const curUrl = `${frontAddress}${preStr}redirect_url=${encodeURIComponent(urlHref)}`;
217
217
  return curUrl;
218
218
  }
219
219
  };
220
220
  const handleBtnParamsEvaluate = (params) => {
221
- let defaultVariable = ["evaname", "evadesc", "evast", "evadur", "evaan"];
222
- let res = {};
223
- for (let key in params) {
224
- let value = params[key];
221
+ const defaultVariable = ["evaname", "evadesc", "evast", "evadur", "evaan"];
222
+ const res = {};
223
+ for (const key in params) {
224
+ const value = params[key];
225
225
  if (defaultVariable.includes(key) && value) {
226
226
  res[key] = value;
227
227
  }
@@ -235,18 +235,18 @@ const ScaleViewInit = (props, state, emit, config) => {
235
235
  if (hasparamsEvaluate.value) {
236
236
  query = state.paramsEvaluate;
237
237
  }
238
- let obj = {
238
+ const obj = {
239
239
  evaluateName: "evaname",
240
240
  evaluateExplain: "evadesc",
241
241
  evaluateStartTime: "evast",
242
242
  evaluateTime: "evadur",
243
243
  evaluateAnswer: "evaan"
244
244
  };
245
- for (let key in evaluateResultSetting) {
246
- let value = evaluateResultSetting[key];
247
- let isParseKey = value && key != "evaluateAnswer" && typeof value === "string" && value.includes("${");
245
+ for (const key in evaluateResultSetting) {
246
+ const value = evaluateResultSetting[key];
247
+ const isParseKey = value && key != "evaluateAnswer" && typeof value === "string" && value.includes("${");
248
248
  if (isParseKey) {
249
- let parseValue = value.replace(/\$\{([^}]+)\}/g, (_v, $1) => {
249
+ const parseValue = value.replace(/\$\{([^}]+)\}/g, (_v, $1) => {
250
250
  let param;
251
251
  if ($1.startsWith("form.")) {
252
252
  param = query[$1.split(".")[1]];
@@ -263,8 +263,8 @@ const ScaleViewInit = (props, state, emit, config) => {
263
263
  }
264
264
  }
265
265
  if (hasDefault.value) {
266
- let defaultVariable = ["evaname", "evadesc", "evast", "evadur", "evaan"];
267
- let defObj = {
266
+ const defaultVariable = ["evaname", "evadesc", "evast", "evadur", "evaan"];
267
+ const defObj = {
268
268
  evaname: "evaluateName",
269
269
  evadesc: "evaluateExplain",
270
270
  evast: "evaluateStartTime",
@@ -272,7 +272,7 @@ const ScaleViewInit = (props, state, emit, config) => {
272
272
  evaan: "evaluateAnswer"
273
273
  };
274
274
  defaultVariable.forEach((item) => {
275
- let key = defObj[item];
275
+ const key = defObj[item];
276
276
  if (!evaluateResultSetting[key]) {
277
277
  let val = query[item];
278
278
  if (item == "evaan") {
@@ -354,12 +354,12 @@ const ScaleViewInit = (props, state, emit, config) => {
354
354
  defValue = item.dbValue;
355
355
  } else {
356
356
  if (((_a = item.setting) == null ? void 0 : _a.defValType) == 3) {
357
- let urlKey = (_c = (_b = item.setting) == null ? void 0 : _b.outDefaultValue) == null ? void 0 : _c.urlKey;
357
+ const urlKey = (_c = (_b = item.setting) == null ? void 0 : _b.outDefaultValue) == null ? void 0 : _c.urlKey;
358
358
  if (urlKey) {
359
- let list = urlKey.split(",");
359
+ const list = urlKey.split(",");
360
360
  if (list.length > 1) {
361
- let val2 = list.map((l) => {
362
- let tempV = getQueryVariable(l, state, props.params);
361
+ const val2 = list.map((l) => {
362
+ const tempV = getQueryVariable(l, state, props.params);
363
363
  if (tempV)
364
364
  return decodeURIComponent(tempV);
365
365
  return null;