n20-common-lib 3.2.43 → 3.2.45

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.
Files changed (26) hide show
  1. package/package.json +3 -2
  2. package/src/components/AdvancedFilter/filterItem.vue +1 -0
  3. package/src/components/DateChoose/index.vue +1 -0
  4. package/src/components/DateSelect/index.vue +1 -0
  5. package/src/components/DateSelect/quarterDatePicker.vue +1 -0
  6. package/src/components/DynamicField/DynamicField.vue +1 -0
  7. package/src/components/DynamicField/DynamicFieldOptions.vue +1 -0
  8. package/src/components/DynamicField/contentPop.vue +1 -0
  9. package/src/components/DynamicField/tableList.vue +1 -0
  10. package/src/components/FileUploadTable/aiCheckDialog.vue +1 -0
  11. package/src/components/FileUploadTable/index.vue +76 -8
  12. package/src/components/Pivot/index.vue +2 -1
  13. package/src/components/ProFilterView/advancedQuery.vue +1 -0
  14. package/src/components/ProFilterView/index.vue +1 -0
  15. package/src/components/SelectDatePickerPro/busiDate.vue +1 -0
  16. package/src/components/SelectDatePickerPro/halfYearPicker.vue +1 -0
  17. package/src/components/SelectDatePickerPro/index.vue +1 -0
  18. package/src/components/SelectDatePickerPro/quarterDatePicker.vue +1 -0
  19. package/src/components/TablePro/filterContent_tree.vue +1 -0
  20. package/src/components/TableTransfer/index.vue +1 -0
  21. package/src/components/WornPagination/index.vue +1 -0
  22. package/src/components/operatingStatus/index.vue +1 -0
  23. package/src/components/v3/TablePro/filterContent_tree.vue +1 -0
  24. package/src/components/v3/UploadList/components/aiCheckDialog.vue +1 -0
  25. package/src/plugins/SetMenuTree/setmenutree.vue +1 -0
  26. package/src/utils/amountInWords.js +1 -0
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "n20-common-lib",
3
- "version": "3.2.43",
3
+ "version": "3.2.45",
4
4
  "private": false,
5
5
  "scripts": {
6
- "serve": "pnpm --dir ../packages/docs run serve",
6
+ "serve": "vue-cli-service serve",
7
+ "serve:docs": "pnpm --dir ../packages/docs run serve",
7
8
  "prepublishOnly": "npm run build:css",
8
9
  "build": "node versionInfo.js && npm run build:css && vue-cli-service build --testTheme",
9
10
  "test:unit": "vue-cli-service test:unit",
@@ -16,6 +16,7 @@
16
16
  </template>
17
17
 
18
18
  <script>
19
+ import { $lc } from '../../utils/i18n/index'
19
20
  import importGlobal from '../../utils/importGlobal.js'
20
21
  export default {
21
22
  name: 'FilterItem',
@@ -119,6 +119,7 @@
119
119
  </template>
120
120
 
121
121
  <script>
122
+ import { $lc } from '../../utils/i18n/index'
122
123
  import Dialog from '../Dialog/index.vue'
123
124
  export default {
124
125
  name: 'DateChoose',
@@ -73,6 +73,7 @@
73
73
 
74
74
  <script>
75
75
  // TODO: 双休绑定数值格式不统一
76
+ import { $lc } from '../../utils/i18n/index'
76
77
  import quarterDatePicker from './quarterDatePicker'
77
78
  import dayjs from 'dayjs'
78
79
 
@@ -93,6 +93,7 @@
93
93
  </template>
94
94
 
95
95
  <script>
96
+ import { $lc } from '../../utils/i18n/index'
96
97
  import quarter from 'dayjs/plugin/quarterOfYear'
97
98
  import dayjs from 'dayjs'
98
99
  dayjs.extend(quarter)
@@ -724,6 +724,7 @@
724
724
  </template>
725
725
 
726
726
  <script>
727
+ import { $lc } from '../../utils/i18n/index'
727
728
  import clAnchorItem from '../Anchor/AnchorItem.vue'
728
729
  import clDatePicker from '../DatePicker/index.vue'
729
730
  import clDatePickerPor from '../DatePicker/por.vue'
@@ -130,6 +130,7 @@
130
130
  </template>
131
131
 
132
132
  <script>
133
+ import { $lc } from '../../utils/i18n/index'
133
134
  import ClPage from '../PageLayout/page.vue'
134
135
  import Sortable from 'sortablejs'
135
136
  import customFormOptionsData from './jsonData/customFormOptionsData.json'
@@ -29,6 +29,7 @@
29
29
  </template>
30
30
 
31
31
  <script>
32
+ import { $lc } from '../../utils/i18n/index'
32
33
  import ClPage from '../PageLayout/page.vue'
33
34
  import ClTablePro from '../TablePro/index.vue'
34
35
  export default {
@@ -74,6 +74,7 @@
74
74
  </template>
75
75
 
76
76
  <script>
77
+ import { $lc } from '../../utils/i18n/index'
77
78
  import DynamicTable from './DynamicTable.vue'
78
79
  import clPage from '../PageLayout/page.vue'
79
80
  import clStatisItem from '../Statis/statisItem.vue'
@@ -35,6 +35,7 @@
35
35
  </template>
36
36
 
37
37
  <script>
38
+ import { $lc } from '../../utils/i18n/index'
38
39
  import Dialog from '../Dialog/index.vue'
39
40
  import Table from '../Table/index.vue'
40
41
  import axios from '../../utils/axios.js'
@@ -57,10 +57,10 @@
57
57
  <span v-if="requiredTypes.includes(row[keys.type])" style="color: red" class="m-r-s">*</span>
58
58
  <el-select
59
59
  v-model="row[keys.type]"
60
- :disabled="row._typeDisabled"
60
+ :disabled="row._typeDisabled || row._typeUpdating"
61
61
  :placeholder="'请选择' | $lc"
62
62
  style="width: calc(100% - 16px)"
63
- @change="$emit('typeChange', row[keys.type])"
63
+ @change="handleTypeChange(row)"
64
64
  >
65
65
  <el-option
66
66
  v-for="item in typeOptions"
@@ -789,14 +789,16 @@ export default {
789
789
  }
790
790
  }
791
791
 
792
+ let file = files.map((item) => item.raw)
792
793
  let FD = new FormData()
793
- files.forEach((item) => {
794
- FD.append('file', item.raw)
794
+ file.forEach((item) => {
795
+ FD.append('file', item)
795
796
  })
796
797
 
797
- let remoteFileUpload = JSON.parse(this.fileData?.data || '{}')
798
- remoteFileUpload.bussValues = this.typeOptions.map((item) => item.type)
799
- FD.append('remoteFileUpload', JSON.stringify(remoteFileUpload))
798
+ let requestData = JSON.parse(this.fileData?.data || '{}')
799
+ requestData.bussId = requestData.bussId ?? this.fileData?.bussId ?? ''
800
+ requestData.bussValues = this.typeOptions.map((item) => item.type)
801
+ FD.append('data', JSON.stringify(requestData))
800
802
 
801
803
  this.batchUploading = true
802
804
  let { data } = await axios.post(
@@ -838,7 +840,12 @@ export default {
838
840
  _name: item.fileName,
839
841
  _percent: 100,
840
842
  _status: 'success',
841
- _typeDisabled: false
843
+ _typeDisabled: false,
844
+ _typeUpdating: false,
845
+ _shouldUpdateFileType: !item.attno,
846
+ _lastFileType: item.attno,
847
+ _lastFileTypeName: item.attname,
848
+ _lastBussValue: item.bussValue
842
849
  }
843
850
  row[this.keys.rowKey] = item.beid
844
851
  row[this.keys.type] = item.attno
@@ -848,6 +855,67 @@ export default {
848
855
  row[this.keys.user] = row[this.keys.user] || userInfo.uname
849
856
  return row
850
857
  },
858
+ handleTypeChange(row) {
859
+ let type = row[this.keys.type]
860
+ this.$emit('typeChange', type)
861
+ if (!row._shouldUpdateFileType || !type) {
862
+ return
863
+ }
864
+ this.updateFileBuss(row, type)
865
+ },
866
+ async updateFileBuss(row, type) {
867
+ let previousType = row._lastFileType
868
+ let previousTypeName = row._lastFileTypeName
869
+ let previousBussValue = row._lastBussValue
870
+ let typeOption = this.typeOptions.find((item) => item.type === type)
871
+ let typeName = typeOption?.attname || typeOption?.label || ''
872
+ let bussValue = typeOption?.bussValue
873
+
874
+ this.$set(row, 'attno', type)
875
+ this.$set(row, 'attname', typeName)
876
+ if (bussValue !== undefined) {
877
+ this.$set(row, 'bussValue', bussValue)
878
+ }
879
+ this.$set(row, '_typeUpdating', true)
880
+
881
+ try {
882
+ await axios.post(
883
+ this.apiPrefix
884
+ ? `${this.apiPrefix}/neams/eamsbaserecord/updateFlieBuss`
885
+ : '/neams/eamsbaserecord/updateFlieBuss',
886
+ [
887
+ {
888
+ beid: row.beid,
889
+ reid: row.reid,
890
+ appno: row.appno,
891
+ syscode: row.syscode,
892
+ bussValue: row.bussValue,
893
+ bussId: row.bussId,
894
+ bussName: row.bussName,
895
+ attno: row.attno,
896
+ attname: row.attname,
897
+ filePath: row.filePath,
898
+ fileName: row.fileName,
899
+ fmid: row.fmid
900
+ }
901
+ ],
902
+ {
903
+ noMsg: true
904
+ }
905
+ )
906
+ this.$set(row, '_lastFileType', type)
907
+ this.$set(row, '_lastFileTypeName', typeName)
908
+ this.$set(row, '_lastBussValue', row.bussValue)
909
+ } catch (err) {
910
+ this.$set(row, this.keys.type, previousType)
911
+ this.$set(row, 'attno', previousType)
912
+ this.$set(row, 'attname', previousTypeName)
913
+ this.$set(row, 'bussValue', previousBussValue)
914
+ this.$message.error(err?.msg || $lc('附件类型更新失败'))
915
+ } finally {
916
+ this.$set(row, '_typeUpdating', false)
917
+ }
918
+ },
851
919
  batchSuccess(response, file, fileList) {
852
920
  // 创建完整的行对象,初始化状态字段
853
921
  let row = {
@@ -113,6 +113,7 @@
113
113
  </template>
114
114
 
115
115
  <script>
116
+ import { $lc } from '../../utils/i18n/index'
116
117
  import XEUtils, { merge } from 'xe-utils'
117
118
 
118
119
  import ChartView from './ChartView.vue'
@@ -1540,4 +1541,4 @@ export default {
1540
1541
  }
1541
1542
  }
1542
1543
  }
1543
- </script>
1544
+ </script>
@@ -180,6 +180,7 @@
180
180
  </template>
181
181
 
182
182
  <script>
183
+ import { $lc } from '../../utils/i18n/index'
183
184
  import axios from '../../utils/axios.js'
184
185
  import ClDatePicker from '../DatePicker/index.vue'
185
186
  import ClDatePickerPor from '../DatePicker/por.vue'
@@ -219,6 +219,7 @@
219
219
  </template>
220
220
 
221
221
  <script>
222
+ import { $lc } from '../../utils/i18n/index'
222
223
  import advancedQuery from './advancedQuery.vue'
223
224
 
224
225
  import axios from '../../utils/axios.js'
@@ -30,6 +30,7 @@
30
30
  </template>
31
31
 
32
32
  <script>
33
+ import { $lc } from '../../utils/i18n/index'
33
34
  import dayjs from 'dayjs'
34
35
  export default {
35
36
  name: 'BusiDatePicker',
@@ -68,6 +68,7 @@
68
68
  </template>
69
69
 
70
70
  <script>
71
+ import { $lc } from '../../utils/i18n/index'
71
72
  export default {
72
73
  name: 'HalfYearPicker',
73
74
  props: {
@@ -76,6 +76,7 @@
76
76
 
77
77
  <script>
78
78
  // TODO: 双向绑定数值格式不统一
79
+ import { $lc } from '../../utils/i18n/index'
79
80
  import dayjs from 'dayjs'
80
81
 
81
82
  import HalfYearPicker from './halfYearPicker'
@@ -93,6 +93,7 @@
93
93
  </template>
94
94
 
95
95
  <script>
96
+ import { $lc } from '../../utils/i18n/index'
96
97
  import quarter from 'dayjs/plugin/quarterOfYear'
97
98
  import dayjs from 'dayjs'
98
99
  dayjs.extend(quarter)
@@ -31,6 +31,7 @@
31
31
  </template>
32
32
 
33
33
  <script>
34
+ import { $lc } from '../../utils/i18n/index'
34
35
  export default {
35
36
  name: 'FilterContent',
36
37
  props: {
@@ -25,6 +25,7 @@
25
25
  </template>
26
26
 
27
27
  <script>
28
+ import { $lc } from '../../utils/i18n/index'
28
29
  export default {
29
30
  name: 'TableTransfer',
30
31
  props: {
@@ -5,6 +5,7 @@
5
5
  </template>
6
6
 
7
7
  <script>
8
+ import { $lc } from '../../utils/i18n/index'
8
9
  import Pagination from '../Pagination/index.vue'
9
10
  export default {
10
11
  name: 'WornPagination',
@@ -10,6 +10,7 @@
10
10
  </template>
11
11
 
12
12
  <script>
13
+ import { $lc } from '../../utils/i18n/index'
13
14
  import XEUtils from 'xe-utils'
14
15
  import getJsonc from '../../assets/getJsonc.js'
15
16
  import axios from '../../utils/axios'
@@ -31,6 +31,7 @@
31
31
  </template>
32
32
 
33
33
  <script>
34
+ import { $lc } from '../../../utils/i18n/index'
34
35
  export default {
35
36
  name: 'FilterContent',
36
37
  props: {
@@ -35,6 +35,7 @@
35
35
  </template>
36
36
 
37
37
  <script>
38
+ import { $lc } from '../../../../utils/i18n/index'
38
39
  import axios from '../../../../utils/axios.js'
39
40
  import Dialog from '../../../Dialog/index.vue'
40
41
  import Table from '../../../Table/index.vue'
@@ -149,6 +149,7 @@
149
149
  <script>
150
150
  /* eslint-disable no-unused-vars */
151
151
 
152
+ import { $lc } from '../../utils/i18n/index'
152
153
  import { nanoid } from 'nanoid'
153
154
  import forEachs from '../../utils/forEachs'
154
155
  import list2tree from '../../utils/list2tree'
@@ -1,3 +1,4 @@
1
+ import { $lc } from './i18n/index'
1
2
  import Nzh from 'nzh'
2
3
 
3
4
  export const convert = (