vue2-client 1.9.199 → 1.10.1

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.199",
3
+ "version": "1.10.1",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
@@ -6,7 +6,7 @@ export default {
6
6
  name: 'Demo',
7
7
  components: { XAddNativeForm },
8
8
  mounted () {
9
- getConfigByNameAsync('feeCategories', 'af-his').then(res => {
9
+ getConfigByNameAsync('formtestForm', 'af-system').then(res => {
10
10
  this.$refs.xAddFrom.init(Object.assign(res, {
11
11
  modifyModelData: {
12
12
  data: {
@@ -7,8 +7,6 @@
7
7
  <a-form-model-item
8
8
  :ref="attr.model"
9
9
  :label="showLabel?attr.name:undefined"
10
- :labelCol="layout === 'inline' && attr.occupyCol ? labelAndWrapperCol[attr.occupyCol].labelCol:undefined"
11
- :wrapperCol="layout === 'inline'&& attr.occupyCol ? labelAndWrapperCol[attr.occupyCol].wrapperCol:undefined"
12
10
  :style="layout === 'inline'&& attr.occupyCol && attr.occupyCol > 1? {width:`calc(100% - ${attr.occupyCol * 1.533}rem)`}:{}"
13
11
  :prop="attr.prop ? attr.prop : attr.model">
14
12
  <!-- 如果配置了后置按钮插槽 -->
@@ -363,11 +361,9 @@
363
361
  </a-form-model-item>
364
362
  </x-form-col>
365
363
  <!-- 文本域 -->
366
- <x-form-col v-else-if="attr.type === 'textarea' && show" :flex="attr.flex" :fullWidth="layout === 'inline'">
364
+ <x-form-col v-else-if="attr.type === 'textarea' && show" :flex="attr.flex">
367
365
  <!-- :style="layout === 'inline'?{width:'calc(100% - 60px)'}:{}"-->
368
366
  <a-form-model-item
369
- :labelCol="layout === 'inline'?{span:2}:undefined"
370
- :wrapperCol="layout === 'inline'?{span:22}:undefined"
371
367
  :ref="attr.model"
372
368
  :label="showLabel?attr.name:undefined"
373
369
  :prop="attr.prop ? attr.prop : attr.model">
@@ -382,11 +378,8 @@
382
378
  <!-- 文件上传 -->
383
379
  <x-form-col
384
380
  v-else-if="(attr.type === 'file' || attr.type === 'image') && show"
385
- :flex="attr.flex"
386
- :fullWidth="layout === 'inline'">
381
+ :flex="attr.flex">
387
382
  <a-form-model-item
388
- :labelCol="layout === 'inline'?{span:2}:undefined"
389
- :wrapperCol="layout === 'inline'?{span:22}:undefined"
390
383
  :ref="attr.model"
391
384
  :label="showLabel?attr.name:undefined"
392
385
  :prop="attr.prop ? attr.prop : attr.model">
@@ -425,8 +418,6 @@
425
418
  :ref="attr.model"
426
419
  :label="showLabel?attr.name:undefined"
427
420
  :prop="attr.prop ? attr.prop : attr.model"
428
- :labelCol="layout === 'inline' && attr.occupyCol ? labelAndWrapperCol[attr.occupyCol].labelCol:undefined"
429
- :wrapperCol="layout === 'inline'&& attr.occupyCol ? labelAndWrapperCol[attr.occupyCol].wrapperCol:undefined"
430
421
  :style="layout === 'inline'&& attr.occupyCol && attr.occupyCol > 1? {width:`calc(100% - ${attr.occupyCol * 1.533}rem)`}:{}">
431
422
  <address-search-combobox
432
423
  :emitFunc="emitFunc"
@@ -471,8 +462,6 @@
471
462
  <a-form-model-item
472
463
  :ref="attr.model"
473
464
  :label="showLabel?attr.name:undefined"
474
- :labelCol="layout === 'inline' && attr.occupyCol ? labelAndWrapperCol[attr.occupyCol].labelCol:undefined"
475
- :wrapperCol="layout === 'inline'&& attr.occupyCol ? labelAndWrapperCol[attr.occupyCol].wrapperCol:undefined"
476
465
  :style="layout === 'inline'&& attr.occupyCol && attr.occupyCol > 1? {width:`calc(100% - ${attr.occupyCol * 1.533}rem)`}:{}"
477
466
  :prop="attr.prop ? attr.prop : attr.model">
478
467
  <a-popover
@@ -685,22 +674,6 @@ export default {
685
674
  optionForFunc: [],
686
675
  // 控制当前表单项是否展示
687
676
  show: true,
688
- labelAndWrapperCol: [{
689
- labelCol: undefined,
690
- wrapperCol: undefined
691
- },
692
- {
693
- labelCol: undefined,
694
- wrapperCol: undefined
695
- },
696
- {
697
- labelCol: { span: 3 },
698
- wrapperCol: { span: 21 }
699
- },
700
- {
701
- labelCol: { span: 2 },
702
- wrapperCol: { span: 22 }
703
- }],
704
677
  // moment
705
678
  moment,
706
679
  // 行选择器浮层是否显示
@@ -1054,7 +1027,8 @@ export default {
1054
1027
  md: 24,
1055
1028
  lg: 24,
1056
1029
  xl: 24,
1057
- xxl: 24
1030
+ xxl: 24,
1031
+ fullWidth: true
1058
1032
  }
1059
1033
  } else {
1060
1034
  // 新增修改表单 vertical 模式下默认为1列
@@ -1,6 +1,11 @@
1
1
  <template>
2
2
  <a-col :style="computedStyles">
3
- <slot></slot>
3
+ <div
4
+ class="x-form-col-wrapper"
5
+ :style="computedWrapperStyles"
6
+ >
7
+ <slot></slot>
8
+ </div>
4
9
  </a-col>
5
10
  </template>
6
11
 
@@ -10,7 +15,16 @@ const BREAKPOINTS = {
10
15
  sm: 768,
11
16
  md: 992,
12
17
  lg: 1200,
13
- xl: 1600
18
+ xl: 1600,
19
+ }
20
+
21
+ const defaultFlex = {
22
+ xs: 24,
23
+ sm: 24,
24
+ md: 8,
25
+ lg: 8,
26
+ xl: 6,
27
+ xxl: 6,
14
28
  }
15
29
 
16
30
  function debounce (fn, delay) {
@@ -31,56 +45,68 @@ export default {
31
45
  default: () => ({
32
46
  xs: 24,
33
47
  sm: 24,
34
- md: 12,
35
- lg: 8,
48
+ md: 8,
49
+ lg: 6,
36
50
  xl: 6,
37
51
  xxl: 6,
38
52
  }),
39
53
  },
40
54
  occupyCol: {
41
55
  type: Number,
42
- default: 1
56
+ default: 1,
43
57
  },
44
- fullWidth: {
45
- type: Boolean,
46
- default: false
47
- }
48
58
  },
49
59
  computed: {
50
60
  computedFlex () {
51
61
  const parentWidth = this.parentWidth
52
- if (parentWidth === 0) {
53
- return this.flex.xs
62
+ return this.getFlex(parentWidth, this.flex)
63
+ },
64
+ computedWrapperStyles () {
65
+ const realFlex = this.flex.fullWidth ? this.getFlex(this.parentWidth) : this.computedFlex
66
+ // 1. 计算列数
67
+ const columnsCount = 24 / realFlex
68
+ // 2. 计算基准列宽
69
+ const baseColumnWidth = (this.parentWidth / columnsCount) - ((columnsCount - 1) * 16)
70
+ console.log('调试信息:', {
71
+ parentWidth: this.parentWidth,
72
+ computedFlex: realFlex,
73
+ columnsCount,
74
+ baseColumnWidth,
75
+ })
76
+ // 3. 计算label宽度
77
+ const labelWidth = Math.max(baseColumnWidth / 3, 80)
78
+ return {
79
+ '--form-label-width': `${labelWidth}px`,
54
80
  }
55
- if (parentWidth < BREAKPOINTS.xs) return this.flex.xs
56
- if (parentWidth < BREAKPOINTS.sm) return this.flex.sm
57
- if (parentWidth < BREAKPOINTS.md) return this.flex.md
58
- if (parentWidth < BREAKPOINTS.lg) return this.flex.lg
59
- if (parentWidth < BREAKPOINTS.xl) return this.flex.xl
60
- return this.flex.xxl
61
81
  },
62
82
  computedStyles () {
63
83
  const realFlex = Math.min(this.computedFlex * this.occupyCol, 24)
64
84
  const flexValue = (realFlex / 24) * 100
65
85
 
66
- if (this.fullWidth) {
67
- return {
68
- flex: `0 0 calc(${flexValue}% - 60px)`,
69
- maxWidth: `${flexValue}%`,
70
- }
71
- }
72
86
  return {
73
87
  flex: `0 0 ${flexValue}%`,
74
88
  maxWidth: `${flexValue}%`,
75
89
  }
76
- }
77
-
90
+ },
78
91
  },
79
92
  data () {
80
93
  return {
81
94
  parentWidth: 0,
82
95
  }
83
96
  },
97
+ methods: {
98
+ getFlex (parentWidth, flex = defaultFlex) {
99
+ if (parentWidth === 0) {
100
+ return flex.xs
101
+ }
102
+ if (parentWidth < BREAKPOINTS.xs) return flex.xs
103
+ if (parentWidth < BREAKPOINTS.sm) return flex.sm
104
+ if (parentWidth < BREAKPOINTS.md) return flex.md
105
+ if (parentWidth < BREAKPOINTS.lg) return flex.lg
106
+ if (parentWidth < BREAKPOINTS.xl) return flex.xl
107
+ return flex.xxl
108
+ },
109
+ },
84
110
  mounted () {
85
111
  // 根据父容器宽度响应式
86
112
  this.$nextTick(() => {
@@ -102,6 +128,16 @@ export default {
102
128
  if (this.resizeObserver) {
103
129
  this.resizeObserver.disconnect()
104
130
  }
105
- }
131
+ },
106
132
  }
107
133
  </script>
134
+
135
+ <style lang="less" scoped>
136
+ .x-form-col-wrapper {
137
+ :deep(.ant-form-item) {
138
+ .ant-form-item-label {
139
+ max-width: var(--form-label-width);
140
+ }
141
+ }
142
+ }
143
+ </style>
@@ -47,12 +47,12 @@ export default {
47
47
  // 文件服务器
48
48
  fileServer: {
49
49
  type: String,
50
- default: 'http://123.60.214.109:8406'
50
+ default: 'http://aote-office.8866.org:8406'
51
51
  },
52
52
  // 文档预览服务 API
53
53
  previewDocService: {
54
54
  type: String,
55
- default: 'http://123.60.214.109:8012/onlinePreview?url='
55
+ default: 'http://aote-office.8866.org:32510/onlinePreview?url='
56
56
  }
57
57
  },
58
58
  data () {
@@ -1,181 +1,181 @@
1
- <template>
2
- <div style="position: relative;">
3
- <h2 style="text-align: center">{{ institutionData.f_title }}</h2>
4
- <p>简述: {{ institutionData.f_sketch }}</p>
5
- <p>时间: {{ format(institutionData.f_effective_date) }}</p>
6
- <div v-if="showDocument" class="content">
7
- <iframe :src="institutionDocUrl" frameborder="0" height="100%" width="100%"></iframe>
8
- </div>
9
- <!-- 其他附件 -->
10
- <div class="other-file">
11
- <div class="title">其他信息:</div>
12
- <div v-for="file in otherFiles" :key="file.id">
13
- <a class="file-item">
14
- <span class="file-action" @click="handlePreviewDoc(file.url)">
15
- <a-icon type="link" />{{ file.name }}
16
- </span>
17
- <span class="file-action" @click="handlePreviewDoc(file.url)">
18
- <a-icon type="eye" />预览
19
- </span>
20
- <a class="file-action" target="_blank" @click="handlePreDowDoc(file)"><a-icon type="download" />下载</a>
21
- </a>
22
- </div>
23
- </div>
24
- <!-- 其他附件预览 -->
25
- <a-modal v-model="previewDocVisible" :dialog-style="{ top: '20px' }" :footer="null" :z-index="1001" width="97%">
26
- <div class="preview-doc-container">
27
- <a-spin :spinning="previewDocLoading" size="large" />
28
- <iframe
29
- v-show="!previewDocLoading"
30
- :src="previewDocUrl"
31
- frameborder="0"
32
- height="100%"
33
- width="100%"
34
- @load="previewDocLoading = false" />
35
- </div>
36
- </a-modal>
37
- <a-button class="submit_btn" type="primary" @click="confirm_institution">确认</a-button>
38
- </div>
39
- </template>
40
-
41
- <script>
42
- import { Base64 } from 'js-base64'
43
- import { post } from '@vue2-client/services/api/restTools'
44
- import { formatDate } from '@vue2-client/utils/util'
45
-
46
- export default {
47
- name: 'InstitutionDetail',
48
- props: {
49
- institutionId: {
50
- type: Number,
51
- default: undefined
52
- },
53
- affirmInstitution: {
54
- type: Number,
55
- default: undefined
56
- }
57
- },
58
- data () {
59
- return {
60
- institutionDocUrl: undefined,
61
- showDocument: false,
62
- otherFiles: [],
63
- institutionData: {},
64
- previewDocVisible: false,
65
- previewDocUrl: undefined,
66
- previewDocLoading: false
67
- }
68
- },
69
- watch: {
70
- institutionId () {
71
- this.getDetailData()
72
- }
73
- },
74
- mounted () {
75
- this.getDetailData()
76
- },
77
- methods: {
78
- // 获取详情数据
79
- getDetailData () {
80
- if (!this.institutionId) {
81
- return
82
- }
83
- const otherFiles = []
84
- post('/api/af-system/logic/getInstitutionDetail', {
85
- id: this.institutionId
86
- }).then(res => {
87
- res.files.forEach(item => {
88
- if (item.use_type === '制度文件') {
89
- this.institutionDocUrl = previewDocService + encodeURIComponent(Base64.encode(fileServer + item.url))
90
- this.showDocument = true
91
- } else {
92
- otherFiles.push(item)
93
- }
94
- })
95
- this.institutionData = res.institution
96
- this.otherFiles = otherFiles
97
- })
98
- },
99
- format (dateStr) {
100
- return formatDate(dateStr, 'yyyy-MM-dd')
101
- },
102
- // 其他附件预览
103
- handlePreviewDoc (url) {
104
- const previewDocUrl = previewDocService + encodeURIComponent(Base64.encode(fileServer + url))
105
- if (this.previewDocUrl !== previewDocUrl) {
106
- this.previewDocLoading = true
107
- this.previewDocUrl = previewDocUrl
108
- }
109
- this.previewDocVisible = true
110
- },
111
- // 下载文档
112
- handlePreDowDoc (file) {
113
- const a = document.createElement('a')
114
- a.href = file.url
115
- a.download = file.name
116
- a.click()
117
- },
118
- confirm_institution () {
119
- post('/api/af-system/logic/affirmInstitution', {
120
- data: {
121
- tobe: [
122
- {
123
- id: this.affirmInstitution,
124
- f_affirm_type: '系统确认'
125
- }
126
- ]
127
- }
128
- }).then(res => {
129
- this.$message.success('确认成功')
130
- this.$emit('get_to_be_confirmed')
131
- })
132
- },
133
- }
134
- }
135
- // 文档预览服务 API
136
- const previewDocService = 'http://123.60.214.109:8012/onlinePreview?url='
137
- // 文件服务器地址
138
- const fileServer = 'http://123.60.214.109:8406'
139
- </script>
140
-
141
- <style lang="less" scoped>
142
- .submit_btn{
143
- position: absolute;
144
- right:0;
145
- top: 0;
146
- }
147
- .content {
148
- height: 80vh;
149
- img {
150
- max-width: 100%;
151
- }
152
- }
153
- .other-file {
154
- margin: 16px 0;
155
- .title {
156
- margin-bottom: 6px;
157
- }
158
- }
159
- .file-item {
160
- .file-action {
161
- padding: 3px 4px;
162
- color: #1890ff;
163
- &:hover {
164
- background: #e6f7ff;
165
- }
166
- }
167
- .anticon {
168
- margin-right: 3px;
169
- }
170
- }
171
- .file-list-title {
172
- color: rgba(0, 0, 0, 0.85);
173
- font-weight: bold;
174
- font-size: 16px;
175
- margin-bottom: 8px;
176
- }
177
- .preview-doc-container {
178
- height: calc(100vh - 92px);
179
- padding-top: 20px;
180
- }
181
- </style>
1
+ <template>
2
+ <div style="position: relative;">
3
+ <h2 style="text-align: center">{{ institutionData.f_title }}</h2>
4
+ <p>简述: {{ institutionData.f_sketch }}</p>
5
+ <p>时间: {{ format(institutionData.f_effective_date) }}</p>
6
+ <div v-if="showDocument" class="content">
7
+ <iframe :src="institutionDocUrl" frameborder="0" height="100%" width="100%"></iframe>
8
+ </div>
9
+ <!-- 其他附件 -->
10
+ <div class="other-file">
11
+ <div class="title">其他信息:</div>
12
+ <div v-for="file in otherFiles" :key="file.id">
13
+ <a class="file-item">
14
+ <span class="file-action" @click="handlePreviewDoc(file.url)">
15
+ <a-icon type="link" />{{ file.name }}
16
+ </span>
17
+ <span class="file-action" @click="handlePreviewDoc(file.url)">
18
+ <a-icon type="eye" />预览
19
+ </span>
20
+ <a class="file-action" target="_blank" @click="handlePreDowDoc(file)"><a-icon type="download" />下载</a>
21
+ </a>
22
+ </div>
23
+ </div>
24
+ <!-- 其他附件预览 -->
25
+ <a-modal v-model="previewDocVisible" :dialog-style="{ top: '20px' }" :footer="null" :z-index="1001" width="97%">
26
+ <div class="preview-doc-container">
27
+ <a-spin :spinning="previewDocLoading" size="large" />
28
+ <iframe
29
+ v-show="!previewDocLoading"
30
+ :src="previewDocUrl"
31
+ frameborder="0"
32
+ height="100%"
33
+ width="100%"
34
+ @load="previewDocLoading = false" />
35
+ </div>
36
+ </a-modal>
37
+ <a-button class="submit_btn" type="primary" @click="confirm_institution">确认</a-button>
38
+ </div>
39
+ </template>
40
+
41
+ <script>
42
+ import { Base64 } from 'js-base64'
43
+ import { post } from '@vue2-client/services/api/restTools'
44
+ import { formatDate } from '@vue2-client/utils/util'
45
+
46
+ export default {
47
+ name: 'InstitutionDetail',
48
+ props: {
49
+ institutionId: {
50
+ type: Number,
51
+ default: undefined
52
+ },
53
+ affirmInstitution: {
54
+ type: Number,
55
+ default: undefined
56
+ }
57
+ },
58
+ data () {
59
+ return {
60
+ institutionDocUrl: undefined,
61
+ showDocument: false,
62
+ otherFiles: [],
63
+ institutionData: {},
64
+ previewDocVisible: false,
65
+ previewDocUrl: undefined,
66
+ previewDocLoading: false
67
+ }
68
+ },
69
+ watch: {
70
+ institutionId () {
71
+ this.getDetailData()
72
+ }
73
+ },
74
+ mounted () {
75
+ this.getDetailData()
76
+ },
77
+ methods: {
78
+ // 获取详情数据
79
+ getDetailData () {
80
+ if (!this.institutionId) {
81
+ return
82
+ }
83
+ const otherFiles = []
84
+ post('/api/af-system/logic/getInstitutionDetail', {
85
+ id: this.institutionId
86
+ }).then(res => {
87
+ res.files.forEach(item => {
88
+ if (item.use_type === '制度文件') {
89
+ this.institutionDocUrl = previewDocService + encodeURIComponent(Base64.encode(fileServer + item.url))
90
+ this.showDocument = true
91
+ } else {
92
+ otherFiles.push(item)
93
+ }
94
+ })
95
+ this.institutionData = res.institution
96
+ this.otherFiles = otherFiles
97
+ })
98
+ },
99
+ format (dateStr) {
100
+ return formatDate(dateStr, 'yyyy-MM-dd')
101
+ },
102
+ // 其他附件预览
103
+ handlePreviewDoc (url) {
104
+ const previewDocUrl = previewDocService + encodeURIComponent(Base64.encode(fileServer + url))
105
+ if (this.previewDocUrl !== previewDocUrl) {
106
+ this.previewDocLoading = true
107
+ this.previewDocUrl = previewDocUrl
108
+ }
109
+ this.previewDocVisible = true
110
+ },
111
+ // 下载文档
112
+ handlePreDowDoc (file) {
113
+ const a = document.createElement('a')
114
+ a.href = file.url
115
+ a.download = file.name
116
+ a.click()
117
+ },
118
+ confirm_institution () {
119
+ post('/api/af-system/logic/affirmInstitution', {
120
+ data: {
121
+ tobe: [
122
+ {
123
+ id: this.affirmInstitution,
124
+ f_affirm_type: '系统确认'
125
+ }
126
+ ]
127
+ }
128
+ }).then(res => {
129
+ this.$message.success('确认成功')
130
+ this.$emit('get_to_be_confirmed')
131
+ })
132
+ },
133
+ }
134
+ }
135
+ // 文档预览服务 API
136
+ const previewDocService = 'http://aote-office.8866.org:32510/onlinePreview?url='
137
+ // 文件服务器地址
138
+ const fileServer = 'http://aote-office.8866.org:8406'
139
+ </script>
140
+
141
+ <style lang="less" scoped>
142
+ .submit_btn{
143
+ position: absolute;
144
+ right:0;
145
+ top: 0;
146
+ }
147
+ .content {
148
+ height: 80vh;
149
+ img {
150
+ max-width: 100%;
151
+ }
152
+ }
153
+ .other-file {
154
+ margin: 16px 0;
155
+ .title {
156
+ margin-bottom: 6px;
157
+ }
158
+ }
159
+ .file-item {
160
+ .file-action {
161
+ padding: 3px 4px;
162
+ color: #1890ff;
163
+ &:hover {
164
+ background: #e6f7ff;
165
+ }
166
+ }
167
+ .anticon {
168
+ margin-right: 3px;
169
+ }
170
+ }
171
+ .file-list-title {
172
+ color: rgba(0, 0, 0, 0.85);
173
+ font-weight: bold;
174
+ font-size: 16px;
175
+ margin-bottom: 8px;
176
+ }
177
+ .preview-doc-container {
178
+ height: calc(100vh - 92px);
179
+ padding-top: 20px;
180
+ }
181
+ </style>
@@ -84,7 +84,7 @@ routerResource.example = {
84
84
  path: 'default',
85
85
  name: '示例页面',
86
86
  // component: () => import('@vue2-client/base-client/components/common/XAddNativeForm/demo.vue'),
87
- // component: () => import('@vue2-client/base-client/components/common/XFormGroup/demo.vue'),
87
+ component: () => import('@vue2-client/base-client/components/common/XFormGroup/demo.vue'),
88
88
  // component: () => import('@vue2-client/base-client/components/common/XReport/XReportDemo.vue'),
89
89
  // component: () => import('@vue2-client/base-client/components/common/XFormTable/demo.vue'),
90
90
  // component: () => import('@vue2-client/base-client/components/common/XDatePicker/demo.vue'),
@@ -95,7 +95,7 @@ routerResource.example = {
95
95
  // component: () => import('@vue2-client/base-client/components/common/XButtons/XButtonDemo.vue'),
96
96
  // component: () => import('@vue2-client/base-client/components/common/XLabelSelect/XLabelSelectDemo.vue'),
97
97
  // component: () => import('@vue2-client/base-client/components/common/XCheckList/XCheckList.vue'),
98
- component: () => import('@vue2-client/base-client/components/common/XPrint/Demo.vue'),
98
+ // component: () => import('@vue2-client/base-client/components/common/XPrint/Demo.vue'),
99
99
  // component: () => import('@vue2-client/base-client/components/AI/demo.vue'),
100
100
  // component: () => import('@vue2-client/components/g2Charts/demo.vue'),
101
101
  meta: {