vue2-client 1.9.40 → 1.9.42

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,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2-client",
3
- "version": "1.9.40",
3
+ "version": "1.9.42",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
@@ -5,8 +5,8 @@ import { getConfigByNameAsync } from '@vue2-client/services/api/common'
5
5
  export default {
6
6
  name: 'Demo',
7
7
  components: { XAddNativeForm },
8
- created () {
9
- getConfigByNameAsync('orderRepairHandlerForm', 'af-revenue').then(res => {
8
+ mounted () {
9
+ getConfigByNameAsync('outpatientfeesForm', 'af-his').then(res => {
10
10
  this.$refs.xAddFrom.init(res)
11
11
  })
12
12
  },
@@ -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 { upload, getConfigByName, runLogic, getConfigByNameAsync } from '@vue2-client/services/api/common'
586
- import util, { uuid } from '.././../../../utils/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
- async created () {
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,11 +920,7 @@ export default {
930
920
  xxl: 6
931
921
  }
932
922
  }
933
- if (this.attr.type === 'radio') {
934
- this.initRadioValue()
935
- } else if (this.attr.type === 'richText') {
936
- this.initRichText()
937
- } else if (this.attr.keyName && typeof this.attr.keyName === 'string') {
923
+ if (this.attr.keyName && typeof this.attr.keyName === 'string') {
938
924
  if (this.attr.keyName.indexOf('logic@') !== -1) {
939
925
  this.getData({}, res => this.getDataCallback(res))
940
926
  } else if (this.attr.keyName.indexOf('search@') !== -1) {
@@ -1000,74 +986,14 @@ export default {
1000
986
  },
1001
987
  initRadioValue () {
1002
988
  const model = this.attr.model
1003
- if (this.mode === '新增/修改' && this.attr.type === 'radio' && !this.form[model] && !this.attr.prop) {
1004
- if (this.attr.keys && this.attr.keys.length > 0) {
989
+ if (this.mode === '新增/修改' && this.attr.type === 'radio' && (this.form[model] === undefined || this.form[model] === null) && !this.attr.prop) {
990
+ if (this.attr.keys && this.attr.keys.length > 1) {
1005
991
  this.form[model] = this.attr.keys[0].value
1006
- } else if (this.option && this.option.length > 0) {
992
+ } else if (this.option.length > 1) {
1007
993
  this.form[model] = this.option[0].value
1008
- } else if (this.attr.keyName) {
1009
- const list = this.$appdata.getDictionaryList(this.attr.keyName)
1010
- if (list.length > 0) {
1011
- this.form[model] = list[0].value
1012
- }
1013
994
  }
1014
995
  }
1015
996
  },
1016
- async initRichText () {
1017
- const logicName = this.attr.keyName
1018
- if (logicName) {
1019
- this.getData({}, async res => {
1020
- try {
1021
- const response = await fetch(res.url) // 等待 fetch 完成
1022
- if (response.ok) {
1023
- const data = await response.text() // 等待解析为文本内容
1024
- const richText = JSON.parse(data)
1025
- this.$refs.richTextModal.init({
1026
- richText: richText
1027
- })
1028
- } else {
1029
- this.$message.error('富文本读取失败,请求结果:' + response.statusText)
1030
- }
1031
- } catch (error) {
1032
- this.$message.error('富文本读取失败,请求结果:' + error)
1033
- }
1034
- })
1035
- }
1036
- },
1037
- async getRichValue () {
1038
- if (this.$refs.richTextModal) {
1039
- const richText = this.$refs.richTextModal.getValue()
1040
- console.log('>>>> richText: ', richText)
1041
- const fileContent = JSON.stringify(richText)
1042
- const fileName = uuid() + '.txt'
1043
- // 创建一个 Blob 对象,类型为 text/plain
1044
- const blob = new Blob([fileContent], { type: 'text/plain' })
1045
- // 创建一个 File 对象(可选,但有助于保持一致性,因为 File 继承自 Blob)
1046
- const file = new File([blob], fileName, { type: blob.type })
1047
- // 组装上传数据
1048
- const headers = {
1049
- 'Content-Type': 'multipart/form-data',
1050
- }
1051
- const formData = new FormData()
1052
- formData.append('avatar', file)
1053
- formData.append('resUploadMode', 'server')
1054
- formData.append('pathKey', 'Default')
1055
- formData.append('formType', 'file')
1056
- formData.append('useType', 'Default')
1057
- formData.append('filename', fileName)
1058
- formData.append('filesize', (blob.size / 1024 / 1024).toFixed(4))
1059
- formData.append('f_operator', this.currUser ? this.currUser.username : '')
1060
-
1061
- // 上传文件
1062
- await upload(formData, this.serviceName, { headers, timeout: 600 * 1000 }, this.env === 'dev').then(res => {
1063
- this.form[this.attr.model] = res.data.id
1064
- this.form.t_f_path = res.data.f_downloadpath
1065
- }).catch(error => {
1066
- // 处理上传错误
1067
- console.error(error)
1068
- })
1069
- }
1070
- },
1071
997
  openChangeOne (status) {
1072
998
  if (status) {
1073
999
  this.yearShowOne = true
@@ -2,9 +2,10 @@
2
2
  <div>
3
3
  <!-- 树形选择框 -->
4
4
  <a-form-model-item :ref="model" :label="attr.name" :prop="model">
5
- <a-spin v-if="!loaded" size="small"/>
5
+ <a-spin v-show="!loaded" size="small"/>
6
6
  <a-tree-select
7
- v-else
7
+ v-show="loaded"
8
+ ref="tree-select"
8
9
  v-model="localValue"
9
10
  :disabled="disabled"
10
11
  :tree-data="getTreeData()"
@@ -298,9 +298,6 @@ export default {
298
298
  }
299
299
  },
300
300
  },
301
- created () {
302
- this.initConfig()
303
- },
304
301
  methods: {
305
302
  runLogic,
306
303
  getConfigByNameAsync,
@@ -356,7 +353,6 @@ export default {
356
353
  getDataParams: this.getDataParams,
357
354
  env: this.env
358
355
  })
359
- console.log('res', res)
360
356
  // 设置添加按钮对应的配置名
361
357
  this.moveconfig = res.moveconfig
362
358
  // 初始化 xTable 子组件
@@ -616,6 +612,7 @@ export default {
616
612
  }
617
613
  },
618
614
  mounted () {
615
+ this.initConfig()
619
616
  if (this.getSelectedData && typeof this.getSelectedData === 'function') {
620
617
  const selectedId = this.getSelectedData()
621
618
  if (typeof selectedId === 'object') {
@@ -222,26 +222,25 @@
222
222
  @close="onClose"
223
223
  >
224
224
  <template>
225
- <div>
226
- <a-statistic
227
- v-for="(f,index) in summaryData"
228
- :key="index"
229
- :title="f.title + ':'"
230
- :value="f.value"
231
- :precision="2"
232
- style="margin-right: 50px">
233
- <template #prefix>
234
- <a-spin :spinning="f.loading">
235
- </a-spin>
236
- </template>
237
- <template #suffix>
238
- <a-icon
239
- v-show="!f.loading"
240
- :type="f.success !== false ? 'check-circle' : 'close-circle'"
241
- :style="{color: f.success !== false ? 'green' : 'red'}"/>
242
- </template>
243
- </a-statistic>
244
- </div>
225
+ <a-row>
226
+ <a-col :span="8" v-for="(f,index) in summaryData" :key="index">
227
+ <a-statistic
228
+ :title="f.title + ':'"
229
+ :value="f.value"
230
+ :precision="2">
231
+ <template #prefix>
232
+ <a-spin :spinning="f.loading">
233
+ </a-spin>
234
+ </template>
235
+ <template #suffix>
236
+ <a-icon
237
+ v-show="!f.loading"
238
+ :type="f.success !== false ? 'check-circle' : 'close-circle'"
239
+ :style="{color: f.success !== false ? 'green' : 'red'}"/>
240
+ </template>
241
+ </a-statistic>
242
+ </a-col>
243
+ </a-row>
245
244
  </template>
246
245
  </a-drawer>
247
246
  <x-import-excel
@@ -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)
package/src/main.js CHANGED
@@ -3,12 +3,12 @@ import App from './App.vue'
3
3
  import Router from 'vue-router'
4
4
  import Vuex from 'vuex'
5
5
  import { routerOptions, modules, i18n, message, bootstrap } from '../index'
6
- import eventLogPlugin from '@/plugins/EventLogPlugin'
6
+ // import eventLogPlugin from '@/plugins/EventLogPlugin'
7
7
  import findParentData from '@/plugins/FindParentsData'
8
8
 
9
9
  Vue.use(Router)
10
10
  Vue.use(Vuex)
11
- Vue.use(eventLogPlugin)
11
+ // Vue.use(eventLogPlugin)
12
12
  Vue.use(findParentData)
13
13
 
14
14
  // 创建router store
@@ -6,7 +6,7 @@ const EventLogger = {
6
6
  // 排除 一些 vue 框架 / 前端脚手架 底层的一些事件日志
7
7
  const exclude = ['menuSelect', 'menuDeselect', 'popupScroll', 'popupFocus', 'mouseenter',
8
8
  'mouseleave', 'popupVisibleChange', 'popupScroll', 'click', 'keypress', 'keydown ', 'input ',
9
- 'change', 'popupVisibleChange', 'beforeCreate', 'created', 'beforeMount', 'mounted', 'componentDidMounted',
9
+ 'change', 'popupVisibleChange', 'beforeCreate', 'created', 'beforeMount', 'mounted', 'componentDidMounted', 'update:visible',
10
10
  ]
11
11
  // 劫持 $emit
12
12
  Vue.prototype.$emit = function (eventName, ...args) {
@@ -83,9 +83,9 @@ routerResource.example = {
83
83
  {
84
84
  path: 'default',
85
85
  name: '示例页面',
86
- // component: () => import('@vue2-client/base-client/components/common/XAddNativeForm/demo.vue'),
86
+ component: () => import('@vue2-client/base-client/components/common/XAddNativeForm/demo.vue'),
87
87
  // component: () => import('@vue2-client/base-client/components/common/XReport/XReportDemo.vue'),
88
- component: () => import('@vue2-client/base-client/components/common/XFormTable/demo.vue'),
88
+ // component: () => import('@vue2-client/base-client/components/common/XFormTable/demo.vue'),
89
89
  // component: () => import('@vue2-client/base-client/components/common/XTab/XTabDemo.vue'),
90
90
  // component: () => import('@vue2-client/base-client/components/common/XReportGrid/XReportDemo.vue'),
91
91
  // component: () => import('@vue2-client/pages/WorkflowDetail/WorkFlowDemo.vue'),
@@ -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 = {