ci-plus 1.9.1 → 1.9.3

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/README.md CHANGED
@@ -1,6 +1,10 @@
1
1
  ## 历史更新
2
2
 
3
3
  ```js
4
+ 1.9.3
5
+ 1、优化uploadV5.vue组件添加必填标识
6
+ 1.9.2
7
+ 1、优化uploadV5.vue组件添加归属公司默认选中的orgname
4
8
  1.9.1
5
9
  1、优化uploadV5.vue组件
6
10
  1.9.0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ci-plus",
3
- "version": "1.9.1",
3
+ "version": "1.9.3",
4
4
  "description": "ci组件库",
5
5
  "main": "./index.ts",
6
6
  "scripts": {
@@ -44,7 +44,10 @@
44
44
  </el-upload>
45
45
 
46
46
  <div class="slot" style="display: flex; flex-direction: column; align-items: flex-end">
47
- <div style="width: 100%; margin: 4px 2px" v-if="ifShowAffiliation">
47
+ <div style="width: 100%; margin: 4px 2px; display: flex" v-if="ifShowAffiliation">
48
+ <span style="line-height: 30px; color: red; margin-right: 4px" v-if="requiredAffiliation"
49
+ >*</span
50
+ >
48
51
  <el-select-v2
49
52
  size="small"
50
53
  v-model="affiliationAll"
@@ -56,7 +59,10 @@
56
59
  @change="changeAll"
57
60
  />
58
61
  </div>
59
- <div style="width: 100%; margin: 4px 2px" v-if="ifShowWarehouse">
62
+ <div style="width: 100%; margin: 4px 2px; display: flex" v-if="ifShowWarehouse">
63
+ <span style="line-height: 30px; color: red; margin-right: 4px" v-if="requiredWarehouse"
64
+ >*</span
65
+ >
60
66
  <el-select-v2
61
67
  size="small"
62
68
  v-model="warehouseAll"
@@ -179,7 +185,7 @@ interface Props {
179
185
  ifShowWarehouse?: boolean // 是否显示仓库
180
186
  requiredWarehouse?: boolean // 是否必选仓库
181
187
  ifDefaultAffiliation?: boolean // 是否默认选中归属工厂默认值true
182
- defaultAffiliationOrgid?: string // 默认选中归属工厂的 orgid(默认值当前登陆账号的单位)
188
+ defaultAffiliation?: { orgid: string; orgname: string } // 默认选中归属工厂的 orgid(默认值当前登陆账号的单位)
183
189
  filePath?: UploadFile[] //UploadRawFile[] // 父组件传递的附件数据,用于显示附件列表和上传附件后传递给父组件附件数据
184
190
  RowIndex?: number // 父组件传递的行索引,用于父组件中删除了附件找到对应的行(用于表格表单中上传附件)
185
191
  templateName?: string //模板名称
@@ -226,8 +232,13 @@ const ifDefaultAffiliation = computed(() => {
226
232
  // 获取本地缓存中当前登陆账号的公司
227
233
  const raw = localStorage.getItem('UserData')
228
234
  const UserData = raw ? JSON.parse(raw) : {}
229
- const defaultAffiliationOrgid = computed(() => {
230
- return props.defaultAffiliationOrgid || UserData?.resOrgId // 默认登陆账号的单位
235
+ const defaultAffiliation = computed<{ orgid: string; orgname: string }>(() => {
236
+ return (
237
+ props.defaultAffiliation || {
238
+ orgid: UserData?.resOrgId || '',
239
+ orgname: UserData?.resOrgName || ''
240
+ }
241
+ ) // 默认登陆账号的单位
231
242
  })
232
243
 
233
244
  const emits = defineEmits<{
@@ -457,8 +468,9 @@ onMounted(async () => {
457
468
 
458
469
  // 判断是否默认选中归属公司
459
470
  if (ifDefaultAffiliation.value) {
460
- affiliationAll.value = defaultAffiliationOrgid.value
461
- datas.value.factory_affiliation_id = defaultAffiliationOrgid.value
471
+ affiliationAll.value = defaultAffiliation.value.orgid // 下拉框赋值
472
+ datas.value.factory_affiliation_id = defaultAffiliation.value.orgid // 赋值给表单
473
+ datas.value.factory_affiliation_name = defaultAffiliation.value.orgname // 赋值给表单
462
474
  }
463
475
  })
464
476
  </script>