vue2-client 1.9.41 → 1.9.43
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
|
@@ -783,7 +783,11 @@ export default {
|
|
|
783
783
|
this.form = Object.assign(this.form, obj)
|
|
784
784
|
},
|
|
785
785
|
emitFunc (func, data) {
|
|
786
|
-
|
|
786
|
+
if (data.model) {
|
|
787
|
+
this.$emit(func, data, this.form[data.model])
|
|
788
|
+
} else {
|
|
789
|
+
this.$emit(func, data)
|
|
790
|
+
}
|
|
787
791
|
this.$emit('x-form-item-emit-func', func, data)
|
|
788
792
|
},
|
|
789
793
|
close () {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
v-if="attr.inputOnAfterName && attr.inputOnAfterFunc"
|
|
32
32
|
style="flex: 1; width: auto; min-width: 4rem;max-width: 6rem"
|
|
33
33
|
type="primary"
|
|
34
|
-
@click="emitFunc(attr.inputOnAfterFunc,
|
|
34
|
+
@click="emitFunc(attr.inputOnAfterFunc,attr)">
|
|
35
35
|
{{ attr.inputOnAfterName }}
|
|
36
36
|
</a-button>
|
|
37
37
|
<!-- 仅可以配置 一个按钮 以及 一个图标插槽 -->
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
v-if="attr.inputOnAfterIcon"
|
|
41
41
|
:type="attr.inputOnAfterIcon && attr.inputOnAfterName ? 'primary' :''"
|
|
42
42
|
:icon="attr.inputOnAfterIcon || 'question'"
|
|
43
|
-
@click="emitFunc(attr.inputOnAfterIconFunc,
|
|
43
|
+
@click="emitFunc(attr.inputOnAfterIconFunc,attr)">
|
|
44
44
|
</a-button>
|
|
45
45
|
</a-input-group>
|
|
46
46
|
<a-input-number
|
|
@@ -464,14 +464,6 @@
|
|
|
464
464
|
></address-search-combobox>
|
|
465
465
|
</a-form-model-item>
|
|
466
466
|
</x-form-col>
|
|
467
|
-
<!-- 富文本 -->
|
|
468
|
-
<x-form-col
|
|
469
|
-
v-else-if="attr.type === 'richText' && show"
|
|
470
|
-
:flex="attr.flex">
|
|
471
|
-
<a-form-model-item :ref="attr.model" :prop="attr.prop ? attr.prop : attr.model">
|
|
472
|
-
<RichTextModal ref="richTextModal" style="height: 500px"></RichTextModal>
|
|
473
|
-
</a-form-model-item>
|
|
474
|
-
</x-form-col>
|
|
475
467
|
<!-- 人员选择框 -->
|
|
476
468
|
<x-form-col
|
|
477
469
|
v-else-if="attr.type === 'personSetting' && show"
|
|
@@ -582,13 +574,12 @@ import PersonSetting from '@vue2-client/base-client/components/common/PersonSett
|
|
|
582
574
|
import AddressSearchCombobox from '@vue2-client/base-client/components/common/AddressSearchCombobox'
|
|
583
575
|
import Upload from '@vue2-client/base-client/components/common/Upload'
|
|
584
576
|
import moment from 'moment'
|
|
585
|
-
import {
|
|
586
|
-
import util
|
|
577
|
+
import { getConfigByName, runLogic, getConfigByNameAsync } from '@vue2-client/services/api/common'
|
|
578
|
+
import util from '@vue2-client/utils/util'
|
|
587
579
|
import XTreeSelect from '@vue2-client/base-client/components/common/XForm/XTreeSelect'
|
|
588
580
|
import { searchToListOption, searchToOption } from '@vue2-client/services/v3Api'
|
|
589
581
|
import { mapState } from 'vuex'
|
|
590
582
|
import { executeStrFunction } from '@vue2-client/utils/runEvalFunction'
|
|
591
|
-
import RichTextModal from '../richTextModal/index.vue'
|
|
592
583
|
import XLicensePlate from '@vue2-client/base-client/components/common/XLicensePlate/XLicensePlate.vue'
|
|
593
584
|
|
|
594
585
|
export default {
|
|
@@ -601,8 +592,7 @@ export default {
|
|
|
601
592
|
CitySelect,
|
|
602
593
|
PersonSetting,
|
|
603
594
|
AddressSearchCombobox,
|
|
604
|
-
Upload
|
|
605
|
-
RichTextModal
|
|
595
|
+
Upload
|
|
606
596
|
},
|
|
607
597
|
data () {
|
|
608
598
|
// 检索去抖
|
|
@@ -726,7 +716,7 @@ export default {
|
|
|
726
716
|
}
|
|
727
717
|
}
|
|
728
718
|
},
|
|
729
|
-
|
|
719
|
+
created () {
|
|
730
720
|
this.init()
|
|
731
721
|
if (this.attr.keyName && (this.attr?.keyName?.toString().indexOf('async ') !== -1 || this.attr?.keyName?.toString()?.indexOf('function') !== -1)) {
|
|
732
722
|
this.debouncedUpdateOptions = debounce(this.updateOptions, 200)
|
|
@@ -930,9 +920,7 @@ export default {
|
|
|
930
920
|
xxl: 6
|
|
931
921
|
}
|
|
932
922
|
}
|
|
933
|
-
if (this.attr.
|
|
934
|
-
this.initRichText()
|
|
935
|
-
} else if (this.attr.keyName && typeof this.attr.keyName === 'string') {
|
|
923
|
+
if (this.attr.keyName && typeof this.attr.keyName === 'string') {
|
|
936
924
|
if (this.attr.keyName.indexOf('logic@') !== -1) {
|
|
937
925
|
this.getData({}, res => this.getDataCallback(res))
|
|
938
926
|
} else if (this.attr.keyName.indexOf('search@') !== -1) {
|
|
@@ -1006,61 +994,6 @@ export default {
|
|
|
1006
994
|
}
|
|
1007
995
|
}
|
|
1008
996
|
},
|
|
1009
|
-
async initRichText () {
|
|
1010
|
-
const logicName = this.attr.keyName
|
|
1011
|
-
if (logicName) {
|
|
1012
|
-
this.getData({}, async res => {
|
|
1013
|
-
try {
|
|
1014
|
-
const response = await fetch(res.url) // 等待 fetch 完成
|
|
1015
|
-
if (response.ok) {
|
|
1016
|
-
const data = await response.text() // 等待解析为文本内容
|
|
1017
|
-
const richText = JSON.parse(data)
|
|
1018
|
-
this.$refs.richTextModal.init({
|
|
1019
|
-
richText: richText
|
|
1020
|
-
})
|
|
1021
|
-
} else {
|
|
1022
|
-
this.$message.error('富文本读取失败,请求结果:' + response.statusText)
|
|
1023
|
-
}
|
|
1024
|
-
} catch (error) {
|
|
1025
|
-
this.$message.error('富文本读取失败,请求结果:' + error)
|
|
1026
|
-
}
|
|
1027
|
-
})
|
|
1028
|
-
}
|
|
1029
|
-
},
|
|
1030
|
-
async getRichValue () {
|
|
1031
|
-
if (this.$refs.richTextModal) {
|
|
1032
|
-
const richText = this.$refs.richTextModal.getValue()
|
|
1033
|
-
console.log('>>>> richText: ', richText)
|
|
1034
|
-
const fileContent = JSON.stringify(richText)
|
|
1035
|
-
const fileName = uuid() + '.txt'
|
|
1036
|
-
// 创建一个 Blob 对象,类型为 text/plain
|
|
1037
|
-
const blob = new Blob([fileContent], { type: 'text/plain' })
|
|
1038
|
-
// 创建一个 File 对象(可选,但有助于保持一致性,因为 File 继承自 Blob)
|
|
1039
|
-
const file = new File([blob], fileName, { type: blob.type })
|
|
1040
|
-
// 组装上传数据
|
|
1041
|
-
const headers = {
|
|
1042
|
-
'Content-Type': 'multipart/form-data',
|
|
1043
|
-
}
|
|
1044
|
-
const formData = new FormData()
|
|
1045
|
-
formData.append('avatar', file)
|
|
1046
|
-
formData.append('resUploadMode', 'server')
|
|
1047
|
-
formData.append('pathKey', 'Default')
|
|
1048
|
-
formData.append('formType', 'file')
|
|
1049
|
-
formData.append('useType', 'Default')
|
|
1050
|
-
formData.append('filename', fileName)
|
|
1051
|
-
formData.append('filesize', (blob.size / 1024 / 1024).toFixed(4))
|
|
1052
|
-
formData.append('f_operator', this.currUser ? this.currUser.username : '')
|
|
1053
|
-
|
|
1054
|
-
// 上传文件
|
|
1055
|
-
await upload(formData, this.serviceName, { headers, timeout: 600 * 1000 }, this.env === 'dev').then(res => {
|
|
1056
|
-
this.form[this.attr.model] = res.data.id
|
|
1057
|
-
this.form.t_f_path = res.data.f_downloadpath
|
|
1058
|
-
}).catch(error => {
|
|
1059
|
-
// 处理上传错误
|
|
1060
|
-
console.error(error)
|
|
1061
|
-
})
|
|
1062
|
-
}
|
|
1063
|
-
},
|
|
1064
997
|
openChangeOne (status) {
|
|
1065
998
|
if (status) {
|
|
1066
999
|
this.yearShowOne = true
|
|
@@ -86,10 +86,10 @@ const GetAppDataService = {
|
|
|
86
86
|
}
|
|
87
87
|
},
|
|
88
88
|
// 新版获取配置中心字典推荐使用 服务名默认为当前服务
|
|
89
|
-
getDictByKey (dictKey, serviceName = process.env.VUE_APP_SYSTEM_NAME, callback) {
|
|
89
|
+
getDictByKey (dictKey, serviceName = process.env.VUE_APP_SYSTEM_NAME, callback, isDev) {
|
|
90
90
|
getConfigByName(dictKey, undefined, result => {
|
|
91
91
|
callback(result.value)
|
|
92
|
-
})
|
|
92
|
+
}, isDev)
|
|
93
93
|
},
|
|
94
94
|
getParam (key, value, callback) {
|
|
95
95
|
const str = localStorage.getItem(process.env.VUE_APP_BADGE_KEY)
|
|
@@ -140,9 +140,6 @@ routerResource.XReportGrid = () =>
|
|
|
140
140
|
routerResource.XTab = () =>
|
|
141
141
|
import('@vue2-client/base-client/components/common/XTab/XTabDemo')
|
|
142
142
|
|
|
143
|
-
routerResource.RichText = () =>
|
|
144
|
-
import('@vue2-client/base-client/components/common/richTextModal/richDemo.vue')
|
|
145
|
-
|
|
146
143
|
console.log(process.env)
|
|
147
144
|
// 基础路由组件注册
|
|
148
145
|
const routerMap = {
|