@bsgoal/common 2.15.9 → 2.15.11

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": "@bsgoal/common",
3
- "version": "2.15.9",
3
+ "version": "2.15.11",
4
4
  "private": false,
5
5
  "files": [
6
6
  "dist",
@@ -2,7 +2,7 @@
2
2
  * @Author: canlong.shen
3
3
  * @Date: 2023-04-10 15:00:00
4
4
  * @LastEditors: canlong.shen
5
- * @LastEditTime: 2023-06-30 08:59:19
5
+ * @LastEditTime: 2023-06-30 14:21:51
6
6
  * @FilePath: \common\src\components\bsgoal-base-form\demo.vue
7
7
  * @Description: 表单公共组件演示组件
8
8
  *
@@ -20,9 +20,7 @@ defineOptions({
20
20
  })
21
21
 
22
22
  const values = ref({
23
- prop1: '222',
24
- prop2: 'select1',
25
- prop20: ''
23
+ residentialName: '1111'
26
24
  })
27
25
 
28
26
  const BSGOAL_BASE_FORM_REF = ref(null)
@@ -40,6 +38,8 @@ const bindModel = ref({ prop1: '111', prop99: 1, prop101: '否', prop102: '0', _
40
38
 
41
39
  // 配置项
42
40
  const configOptions = ref([
41
+ // { label: '名称', prop: 'residentialName', limit: 5, readonly: true }
42
+
43
43
  {
44
44
  label: 'prop104',
45
45
  prop: '_prop104',
@@ -252,10 +252,16 @@ const configOptions = ref([
252
252
  prop: 'prop16'
253
253
  }
254
254
  ])
255
+
256
+ const changeValues = (params = '') => {
257
+ values.value = {
258
+ residentialName: '2222'
259
+ }
260
+ }
255
261
  </script>
256
262
  <template>
257
263
  <div class="bsgoal-base-form-demo">
258
- {{ bindModel }}
264
+ {{ values }}
259
265
  <BsgoalBaseForm
260
266
  ref="BSGOAL_BASE_FORM_REF"
261
267
  readonly
@@ -263,12 +269,13 @@ const configOptions = ref([
263
269
  :itemStyler="{ marginBottom: '8px' }"
264
270
  :limits="10"
265
271
  :config-options="configOptions"
266
- :bind-model="bindModel"
272
+ :bind-model="values"
267
273
  >
268
274
  <template #_prop104> 6666 </template>
269
275
  </BsgoalBaseForm>
270
276
  <el-button type="primary" @click="confirm">提交</el-button>
271
277
  <el-button type="primary" @click="resetFields">重置</el-button>
278
+ <el-button type="primary" @click="changeValues">改变值</el-button>
272
279
  </div>
273
280
  </template>
274
281
  <style lang="scss" scoped>
@@ -2,7 +2,7 @@
2
2
  * @Author: canlong.shen
3
3
  * @Date: 2023-04-17 11:44:29
4
4
  * @LastEditors: canlong.shen
5
- * @LastEditTime: 2023-06-30 09:19:56
5
+ * @LastEditTime: 2023-06-30 14:20:25
6
6
  * @FilePath: \common\src\components\bsgoal-base-form\index.vue
7
7
  * @Description: 表单公共组件
8
8
  *
@@ -122,10 +122,16 @@ const EL_FORM_REF = ref(null)
122
122
  // 自定义指令
123
123
  const vAlign = baseDirective.align
124
124
 
125
- const model = ref(props.bindModel)
125
+ const model = ref()
126
126
  const watchPropList = []
127
127
 
128
128
  // ---> S 初始值 <---
129
+
130
+ watchEffect(() => {
131
+ const { bindModel = {} } = props
132
+ model.value = bindModel
133
+ })
134
+
129
135
  /**
130
136
  * @Author: canlong.shen
131
137
  * @description:
@@ -166,10 +172,16 @@ watchEffect(() => {
166
172
  if (![ComponentTypeEnums.INPUT, ComponentTypeEnums.INPUT_TEXT_AREA].includes(type)) {
167
173
  watchPropList.push(prop)
168
174
  }
169
- const bindValue = unref(model)[prop]
175
+ const bindValue = model.value[prop]
170
176
  if (prop.startsWith('_')) {
171
177
  model.value[prop] = `${prop}`
172
178
  } else {
179
+ console.log('bindValue', bindValue)
180
+ console.log('valuesModel[prop]', valuesModel[prop])
181
+ console.log(
182
+ 'bindValue || valuesModel[prop] || value',
183
+ bindValue || valuesModel[prop] || value
184
+ )
173
185
  model.value[prop] = bindValue || valuesModel[prop] || value
174
186
  }
175
187
 
@@ -341,8 +353,8 @@ const filterSlotProps = (model = {}) => {
341
353
  for (const prop of Object.keys(model)) {
342
354
  if (!prop.startsWith('_')) {
343
355
  const value = model[prop]
344
- const valueInt = Number.parseInt(value);
345
- rebuildModel[prop] = valueInt || ['0', 0].includes(value) ? valueInt : value;
356
+ const valueInt = Number.parseInt(value)
357
+ rebuildModel[prop] = valueInt || ['0', 0].includes(value) ? valueInt : value
346
358
  }
347
359
  }
348
360
  return rebuildModel
@@ -409,7 +421,7 @@ defineExpose({
409
421
  triggerOperationClear,
410
422
  triggerOperationForm,
411
423
  validateForm,
412
- resetFields:triggerOperationClear
424
+ resetFields: triggerOperationClear
413
425
  })
414
426
  </script>
415
427
  <template>
@@ -2,7 +2,7 @@
2
2
  * @Author: canlong.shen
3
3
  * @Date: 2023-04-10 11:29:04
4
4
  * @LastEditors: canlong.shen
5
- * @LastEditTime: 2023-06-30 09:56:18
5
+ * @LastEditTime: 2023-06-30 10:33:45
6
6
  * @FilePath: \common\src\components\bsgoal-base-table\index.vue
7
7
  * @Description:
8
8
  *
@@ -298,10 +298,7 @@ const summaryMethod = (columns = '') => {
298
298
  })
299
299
  calcResultList[index] = sum
300
300
  })
301
-
302
- console.log('calcResultList',calcResultList);
303
-
304
- return ['合计', ...calcResultList.slice(1)]
301
+ return ['合计', ...calcResultList]
305
302
  }
306
303
 
307
304
  // ---> E 表格绑定的方法 <---