ci-plus 1.7.8 → 1.8.0

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.8.0
5
+ 1、移除原来标识卡模板组件
6
+ 1.7.9
7
+ 1、导入组件3(uploadV3.vue)中增加中英文切换
4
8
  1.7.8
5
9
  1、导入组件3中优化单选文件的时候覆盖文件逻辑
6
10
  1.7.7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ci-plus",
3
- "version": "1.7.8",
3
+ "version": "1.8.0",
4
4
  "description": "ci组件库",
5
5
  "main": "./index.ts",
6
6
  "scripts": {
@@ -4,22 +4,22 @@
4
4
  * @Author: 导出类型定义
5
5
  * @LastEditTime: 2023-05-22 16:12:52
6
6
  */
7
- import * as components from './index';
7
+ import * as components from './index'
8
8
  declare module '@vue/runtime-core' {
9
9
  export interface GlobalComponents {
10
- EaButton: typeof components.Button;
11
- EaIcon: typeof components.Icon;
12
- EaButtons: typeof components.Buttons;
13
- CiDialog: typeof components.Dialog;
14
- CiApp: typeof components.Ccapp;
10
+ EaButton: typeof components.Button
11
+ EaIcon: typeof components.Icon
12
+ EaButtons: typeof components.Buttons
13
+ CiDialog: typeof components.Dialog
14
+ CiApp: typeof components.Ccapp
15
15
  CiSvgicon: typeof components.Svgicon
16
- CiSuffix: typeof components.Suffix;
17
- CiTable: typeof components.SorTables;
16
+ CiSuffix: typeof components.Suffix
17
+ CiTable: typeof components.SorTables
18
18
  CiHeadbtns: typeof components.Headbtns
19
19
  CiHeaderInput: typeof components.HeaderInput
20
20
  CiSdialog: typeof components.Sdialog
21
21
  CiColumncell: typeof components.Columncell
22
- CiIdentificationCard: typeof components.IdentificationCard
22
+ // CiIdentificationCard: typeof components.IdentificationCard
23
23
  CiQrcode: typeof components.CiQrcode
24
24
 
25
25
  CiSeeFile: typeof components.SeeFile
@@ -34,4 +34,4 @@ declare module '@vue/runtime-core' {
34
34
  // 定义全局的类型
35
35
  declare module 'lodash'
36
36
  declare module 'jsbarcode'
37
- export { };
37
+ export {}
@@ -21,7 +21,7 @@
21
21
  v-model:file-list="fileList"
22
22
  >
23
23
  <template #trigger>
24
- <el-button size="small" type="primary" style="width: 100%" plain> 选择文件 </el-button>
24
+ <el-button size="small" type="primary" style="width: 100%" plain> {{ t('fileRelated.selectFile')}} </el-button>
25
25
  </template>
26
26
  <el-button
27
27
  size="small"
@@ -29,7 +29,7 @@
29
29
  style="float: left; margin: 0 12px 0 0; width: 95px"
30
30
  v-if="url"
31
31
  >
32
- 下载模板
32
+ {{t('fileRelated.downloadTemplate')}}
33
33
  </el-button>
34
34
  </el-upload>
35
35
 
@@ -39,13 +39,13 @@
39
39
  v-model="affiliationAll"
40
40
  filterable
41
41
  :options="affiliationOptions"
42
- placeholder="选择归属公司"
42
+ :placeholder="t('fileRelated.selectCompany')"
43
43
  style="width: 180px; margin-right: 5px"
44
44
  clearable
45
45
  @change="changeAll"
46
46
  />
47
47
  <el-button size="small" type="primary" @click="submitUpload" style="flex: 2">
48
- 上传
48
+ {{t('fileRelated.upload')}}
49
49
  </el-button>
50
50
  </div>
51
51
  <template #reference>
@@ -54,7 +54,7 @@
54
54
  @click="visible = !visible"
55
55
  :size="props.otherConfig?.size || 'small'"
56
56
  >
57
- {{ props.title || '附件上传' }}
57
+ {{ props.title || t('fileRelated.attachmentUpload') }}
58
58
  </el-button>
59
59
  </template>
60
60
  </el-popover>
@@ -99,20 +99,29 @@ const fileArr = (url: string, pathArr: string[]) => {
99
99
  }
100
100
  }
101
101
  }
102
-
103
- import type { AxiosRequestConfig } from 'axios';
104
- import axios from 'axios';
102
+ import t from '../utils/lang/index'
103
+ import type { AxiosRequestConfig } from 'axios'
104
+ import axios from 'axios'
105
105
  import type {
106
106
  UploadFile,
107
107
  UploadFiles,
108
108
  UploadInstance,
109
109
  UploadProps,
110
110
  UploadUserFile
111
- } from 'element-plus';
112
- import { ElButton, ElLoading, ElMessage, ElPopover, ElSelectV2, ElUpload, genFileId, UploadRawFile } from 'element-plus';
113
- import { onMounted, ref } from 'vue';
114
- import ajaxBox from '../utils/ajaxBox';
115
- import getAffiliationOptions from '../utils/getAffiliationOptions.ts';
111
+ } from 'element-plus'
112
+ import {
113
+ ElButton,
114
+ ElLoading,
115
+ ElMessage,
116
+ ElPopover,
117
+ ElSelectV2,
118
+ ElUpload,
119
+ genFileId,
120
+ UploadRawFile
121
+ } from 'element-plus'
122
+ import { onMounted, ref } from 'vue'
123
+ import ajaxBox from '../utils/ajaxBox'
124
+ import getAffiliationOptions from '../utils/getAffiliationOptions.ts'
116
125
  const upload = ref<UploadInstance>()
117
126
  const exporLoading = ref()
118
127
  const visible = ref(false)
@@ -154,7 +163,7 @@ const emits = defineEmits<{
154
163
  console.log('附件props: ', props)
155
164
  const datas: any = ref(props.data)
156
165
  const mymultiple = ref<boolean>(props.multiple)
157
- const mylimit = ref<number>(props.limit as number ||1)
166
+ const mylimit = ref<number>((props.limit as number) || 1)
158
167
  const myfilePath = ref<any>(props.filePath || [])
159
168
  console.log('myfilePath: ', props.filePath)
160
169
 
@@ -174,17 +183,17 @@ console.log('fileList: ', fileList.value)
174
183
 
175
184
  //当超出限制时,执行的钩子函数
176
185
  const handleExceed: UploadProps['onExceed'] = (files) => {
177
- console.log("%c Line:177 🥝 files", "color:#e41a6a", files);
186
+ console.log('%c Line:177 🥝 files', 'color:#e41a6a', files)
178
187
 
179
- if(mylimit?.value === 1){
188
+ if (mylimit?.value === 1) {
180
189
  upload.value!.clearFiles()
181
190
  const file = files[0] as UploadRawFile
182
191
  file.uid = genFileId()
183
192
  upload.value!.handleStart(file)
184
193
  }
185
- if( mylimit?.value > 1){
194
+ if (mylimit?.value > 1) {
186
195
  console.log('超出限制: ', files)
187
- ElMessage.warning(`超出最大文件数:${mylimit?.value}个文件,请重新选择`)
196
+ ElMessage.warning(`${t('fileRelated.exceedFiles')} ${mylimit?.value} ${t('fileRelated.reselect')}`)
188
197
  }
189
198
  }
190
199
 
@@ -208,8 +217,8 @@ const handleRemove: UploadProps['onRemove'] = (file, fileList) => {
208
217
  //上传文件
209
218
  const submitUpload = () => {
210
219
  console.log(fileList.value.length)
211
- if (!fileList.value.length) return ElMessage.warning('请选择文件后在上传12!')
212
- exporLoading.value = ElLoading.service({ text: '导入中...' })
220
+ if (!fileList.value.length) return ElMessage.warning(t('fileRelated.pleaseFile'))
221
+ exporLoading.value = ElLoading.service({ text: t('fileRelated.importing') })
213
222
  console.log('upload.value', upload.value)
214
223
  upload.value!.submit()
215
224
  visible.value = false
@@ -259,7 +268,7 @@ const onSuccess = async (res: any, file: any, fileList: any) => {
259
268
  //文件上传失败回调
260
269
  const onError = (response: any, file: any, fileList: any) => {
261
270
  console.log('上传失败回调: ', response)
262
- ElMessage.error(file.name + '上传失败')
271
+ ElMessage.error(file.name + t('fileRelated.uploadFailed'))
263
272
  // fileList.value.length = 0 // 清空文件列表
264
273
  upload.value!.clearFiles() // 清空文件列表
265
274
  visible.value = false // 关闭上传面板
@@ -307,13 +316,17 @@ const formwork = () => {
307
316
  const params = props.parameter
308
317
  ajaxBox.downFileFetchV2(url, params, {
309
318
  method: 'GET',
310
- fileName: props.templateName || '模板.xlsx'
319
+ fileName: props.templateName || t('fileRelated.template')
311
320
  })
312
321
  }
313
322
 
314
323
  //选择框
315
324
  onMounted(async () => {
316
- affiliationOptions.value = await getAffiliationOptions()
325
+ if (props.url) {
326
+ affiliationOptions.value = await getAffiliationOptions()
327
+ } else {
328
+ affiliationOptions.value = []
329
+ }
317
330
  })
318
331
 
319
332
  // const getAffiliationOptions = async (
@@ -14,7 +14,7 @@
14
14
 
15
15
  <script setup lang="ts">
16
16
  import { onMounted, nextTick, watch } from 'vue'
17
- import JsBarcode from './jsbarcode.js' //'./jsbarcode.js' //'https://cdn.jsdelivr.net/npm/jsbarcode@3.11.6/+esm'
17
+ import JsBarcode from 'jsbarcode' //'./jsbarcode.js' //'https://cdn.jsdelivr.net/npm/jsbarcode@3.11.6/+esm'
18
18
  interface Props {
19
19
  value: String // 条码文本
20
20
  type?: String // 类型
package/src/index.ts CHANGED
@@ -11,7 +11,7 @@ export * from './sortableTable/index/sortableTable' // 导出排序表格
11
11
  export * from './sortableTable/index/sortableTableDialog' // 导出表排序组件
12
12
  export * from './sortableTable/index/sortableTableColumnCell' // 导出表列组件
13
13
 
14
- export * from './identificationCard' // 导出标识卡条形码模板组件
14
+ // export * from './identificationCard' // 导出标识卡条形码模板组件
15
15
  export * from './identificationCard/qrcode' // 导出标识卡二维码模板组件
16
16
 
17
17
  export * from './fileRelated/index/ciseeFile' // 导出附件查看组件
@@ -21,6 +21,18 @@ const en = {
21
21
  last3Month: 'Last 3 Month' // 最近3个月
22
22
  }
23
23
  },
24
+ fileRelated:{
25
+ selectFile:'SELECT FILE',
26
+ downloadTemplate:'Download Template',
27
+ selectCompany:'Choose a company to belong to',
28
+ upload:'Upload',
29
+ attachmentUpload:'Attachment upload',
30
+ exceedFiles:'Exceeded the maximum file count of ',
31
+ reselect:' files, please select again',
32
+ pleaseFile:'Please select the file before uploading!',
33
+ importing:'Importing in progress ···',
34
+ uploadFailed:'Upload failed',
35
+ },
24
36
  public: {
25
37
  placeholders: 'Please choose', // 请选择
26
38
  placeholderi: 'Please fill in', // 请填写
@@ -21,6 +21,19 @@ const zh = {
21
21
  last3Month: '最近3个月'
22
22
  }
23
23
  },
24
+ fileRelated:{
25
+ selectFile:'选择文件',
26
+ downloadTemplate:'下载模板',
27
+ selectCompany:'选择归属公司',
28
+ upload:'上传',
29
+ attachmentUpload:'附件上传',
30
+ exceedFiles:'超出最大文件数 ',
31
+ reselect:' 个文件,请重新选择',
32
+ pleaseFile:'请选择文件后在上传!',
33
+ importing:'导入中···',
34
+ uploadFailed:'上传失败',
35
+ template:'模板.xlsx'
36
+ },
24
37
  public: {
25
38
  placeholders: '请选择',
26
39
  placeholderi: '请填写',