n20-common-lib 3.2.44 → 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.
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "n20-common-lib",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.45",
|
|
4
4
|
"private": false,
|
|
5
5
|
"scripts": {
|
|
6
|
-
"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",
|
|
@@ -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="
|
|
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
|
-
|
|
794
|
-
FD.append('file', item
|
|
794
|
+
file.forEach((item) => {
|
|
795
|
+
FD.append('file', item)
|
|
795
796
|
})
|
|
796
797
|
|
|
797
|
-
let
|
|
798
|
-
|
|
799
|
-
|
|
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 = {
|