ci-plus 1.1.0 → 1.1.2

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.
@@ -0,0 +1,4 @@
1
+ import _IdentificationCard from './identificationCard.vue'
2
+ import { withInstall } from '../utils/index';
3
+ export const IdentificationCard = withInstall(_IdentificationCard)
4
+ export default IdentificationCard
@@ -0,0 +1,64 @@
1
+ ## 依赖
2
+
3
+ "jsbarcode": "^3.11.6",
4
+
5
+ ## 使用
6
+
7
+ ```js
8
+ <el-dialog
9
+ v-model="store.showTag" //弹窗控制
10
+ title="标签"
11
+ destroy-on-close
12
+ style="width: 580px; height: 630px; overflow: auto" // 弹窗大小
13
+ >
14
+ <identification-card
15
+ :list="printList" // 循环渲染卡片的数据
16
+ :cardName="'库存台账标识卡'" // 卡片名称
17
+ ref="goodsPrintRef" // 控制打印的ref(可调用里面暴露的 打印方法)
18
+ style="width: 100%; height: 500px" // 设置标签的宽高
19
+ ></identification-card>
20
+ </el-dialog>
21
+
22
+
23
+ // 点击按钮弹出标识卡调用的方法
24
+ function handlePrintAll() {
25
+ if (multipleSelection.value.length < 1)
26
+ return ElMessage.warning('请选择要操作的数据!')
27
+ // multipleSelection.value 为要渲染的源数组对象
28
+ // printList.value 为传递到组件的 实际数组对象
29
+ multipleSelection.value.forEach((val) => {
30
+ let obj = {
31
+ serialNumber: val.center_data[0].b2b_batch_number, //'1001', // 条码文本
32
+ qr_code_path: baseUrls + val.qr_code_path, // 二维码图片路径
33
+ material_name: val.material_type, //'文件编号1',
34
+ store_code: val.material_name, //'名称/类型1',
35
+ customer_name: val.material_model, //'产品型号1',
36
+ supplier_name: val.material_code, //'物料编号1',
37
+ material_model: val.center_data[0].flow_lot_number
38
+ ? val.center_data[0].flow_lot_number
39
+ : '', //'批号1',
40
+ card_code: val.card_code, //'标识卡号',
41
+ material_code: val.center_data[0].value, //'规值1',
42
+ location_name: val.center_data[0].supplier_name, //'供应商1',
43
+ data: [
44
+ {
45
+ opt_time: setDate(val.opt_time), // 日期
46
+ sr: val.record_type === 1 ? val.current_inventory : '', // 收入
47
+ fc: val.record_type === 2 ? val.current_inventory : '', // 发出
48
+ balance_count: val.balance_count, //结转
49
+ remark: val.remark, // 签字/备注
50
+ },
51
+ ],
52
+ }
53
+ printList.value.push(obj)
54
+ })
55
+
56
+
57
+ setTimeout(function () {
58
+ // goodsPrintRef.value.print()
59
+ store.showTag = true
60
+ }, 100)
61
+ }
62
+
63
+
64
+ ```
package/src/index.ts CHANGED
@@ -6,6 +6,9 @@ export * from './ccapp';
6
6
  export * from './svgicon';// svg图标
7
7
  export * from './selectSuffix';
8
8
  export * from './sortableTable/index/headButtons'; // 导出排序表头按钮
9
+ export * from './sortableTable/index/headerInput'; // 导出筛选面板
9
10
  export * from './sortableTable/index/sortableTable'; // 导出排序表格
10
11
  export * from './sortableTable/index/sortableTableDialog'; // 导出表排序组件
11
- export * from './sortableTable/index/sortableTableColumnCell'; // 导出表列组件
12
+ export * from './sortableTable/index/sortableTableColumnCell'; // 导出表列组件
13
+ export * from './fileRelated/index/ciupload'; // 导出文件上传组件
14
+ export * from './identificationCard'; // 导出标识卡模板组件
@@ -17,6 +17,7 @@
17
17
  :props="props.prop"
18
18
  :height="200"
19
19
  :disabled="props.disabled"
20
+ :loading="select_loading"
20
21
  v-bind="$attrs"
21
22
  >
22
23
  <template #prefix>
@@ -26,6 +27,11 @@
26
27
  </el-icon>
27
28
  </span>
28
29
  </template>
30
+ <template #loading>
31
+ <svg class="circular" viewBox="0 0 50 50">
32
+ <circle class="path" cx="25" cy="25" r="20" fill="none" />
33
+ </svg>
34
+ </template>
29
35
  </el-select-v2>
30
36
  <el-dialog
31
37
  class="L-dialog"
@@ -160,6 +166,7 @@ const basic = reactive<Basic>({
160
166
  is_dialogTable: false,
161
167
  search: ''
162
168
  })
169
+ const select_loading = ref(false)
163
170
  const is_aim = ref(false)
164
171
  const tagLabel = ref('')
165
172
  const tableData = ref<AnyO[]>([])
@@ -242,7 +249,8 @@ const getTableData = (obj = {}, page1 = false) => {
242
249
  getAxios(obj, page1).then((res) => {
243
250
  if (res.code !== 200) return ElMessage.warning(res.msg)
244
251
  basic.count = res.count
245
- tableData.value = res.data
252
+ if (props.getData) tableData.value = props.getData(res.data) || []
253
+ else tableData.value = res.data || []
246
254
  setCurrent()
247
255
  })
248
256
  }
@@ -291,6 +299,7 @@ const getAxios = async (obj = {}, page1 = false): Promise<any> => {
291
299
  }
292
300
  const getOptions = (val: string) => {
293
301
  if (!val) return
302
+ select_loading.value = true
294
303
  let searchObj: AnyO = {}
295
304
  searchObj[props.searchKey ? props.searchKey : 'search'] = val
296
305
  axios({
@@ -303,10 +312,14 @@ const getOptions = (val: string) => {
303
312
  })
304
313
  .then((res_) => {
305
314
  let res = res_.data
315
+ select_loading.value = false
306
316
  if (res.code !== 200) return ElMessage.warning(res.msg)
317
+ if (props.getData) temporary_options.value = props.getData(res.data) || []
318
+ else temporary_options.value = res.data || []
307
319
  temporary_options.value = res.data
308
320
  })
309
321
  .catch((err) => {
322
+ select_loading.value = false
310
323
  ElMessage.error(err.code)
311
324
  })
312
325
  }
@@ -332,4 +345,21 @@ const getOptions = (val: string) => {
332
345
  .el-table .success-row {
333
346
  --el-table-tr-bg-color: #cdedff;
334
347
  }
348
+
349
+ .circular {
350
+ margin-top: 5px;
351
+ display: inline;
352
+ height: 30px;
353
+ width: 30px;
354
+ animation: loading-rotate 2s linear infinite;
355
+ }
356
+
357
+ .path {
358
+ animation: loading-dash 1.5s ease-in-out infinite;
359
+ stroke-dasharray: 90, 150;
360
+ stroke-dashoffset: 0;
361
+ stroke-width: 2;
362
+ stroke: var(--el-color-primary);
363
+ stroke-linecap: round;
364
+ }
335
365
  </style>
@@ -3,43 +3,44 @@ import { TableColumnInstance, ColumnCls } from 'element-plus'
3
3
  import { AxiosRequestConfig } from 'axios';
4
4
  export type Props<T> = Partial<Omit<T, `$${string}` | `_${string}` | '$' | '_'>>
5
5
  export interface Scope<T> {
6
- row: T,
7
- $index: number,
8
- column: ColumnCls<T>
6
+ row: T,
7
+ $index: number,
8
+ column: ColumnCls<T>
9
9
  }
10
10
  export interface AnyO {
11
- [key: string]: any
11
+ [key: string]: any
12
12
  }
13
13
  export interface SelectColumn {
14
- col: Props<TableColumnInstance>
15
- scope?(props: any): string
16
- component?: (createVNode: typeof h, data: Scope<any>) => ComponentIns
14
+ col: Props<TableColumnInstance>
15
+ scope?(props: any): string
16
+ component?: (createVNode: typeof h, data: Scope<any>) => ComponentIns
17
17
  }
18
18
  export interface SelectSuffix {
19
- title?: string //弹出层标题
20
- modelValue?: string | string[] //下拉框value
21
- columns: SelectColumn[] // 表格列配置
22
- mul?: boolean //多选
23
- aim?: boolean
24
- disabled?: boolean
25
- size?: "" | "default" | "small" | "large"
26
- prop: { //下拉框字段
27
- label: string
28
- value: string
29
- }
30
- where?: { //弹出层打开需要展示Label的请求的params
31
- [key: string]: string
32
- }
33
- axiosConfig: AxiosRequestConfig //Axios请求配置
34
- isExist?: boolean // 是否选中关闭,单选默认true,多选默认false
35
- searchKey?: string // 模糊搜索字段,默认search,
36
- // selectConfig?:Props<ISelectV2Props>
19
+ title?: string //弹出层标题
20
+ modelValue?: string | string[] //下拉框value
21
+ columns: SelectColumn[] // 表格列配置
22
+ mul?: boolean //多选
23
+ aim?: boolean
24
+ disabled?: boolean
25
+ size?: "" | "default" | "small" | "large"
26
+ prop: { //下拉框字段
27
+ label: string
28
+ value: string
29
+ }
30
+ where?: { //弹出层打开需要展示Label的请求的params
31
+ [key: string]: string
32
+ }
33
+ axiosConfig: AxiosRequestConfig //Axios请求配置
34
+ isExist?: boolean // 是否选中关闭,单选默认true,多选默认false
35
+ searchKey?: string // 模糊搜索字段,默认search,
36
+ // selectConfig?:Props<ISelectV2Props>
37
+ getData?: (params: any) => any[] // 获取数据的方法::getData="(data: any) => data.data"
37
38
  }
38
39
  export interface Basic {
39
- page: number
40
- limit: number
41
- count: number
42
- is_dialogTable: boolean
43
- loading: boolean
44
- search: string
40
+ page: number
41
+ limit: number
42
+ count: number
43
+ is_dialogTable: boolean
44
+ loading: boolean
45
+ search: string
45
46
  }