vue2-client 1.18.45 → 1.18.46

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.
@@ -84,7 +84,7 @@ export default {
84
84
  },
85
85
  fixedQueryForm: {
86
86
  type: Object,
87
- default: { condition: '1=1' }
87
+ default: () => ({ condition: '1=1' })
88
88
  }
89
89
  },
90
90
  inject: ['getComponentByName'],
@@ -7,12 +7,7 @@
7
7
  </span>
8
8
  </div>
9
9
  <div class="tree-list">
10
- <tree-node
11
- v-for="node in showData"
12
- :key="node.id"
13
- :node="node"
14
- :selected="node.selected"
15
- @toggle="toggleNode"/>
10
+ <tree-node v-for="node in showData" :key="node.id" :node="node" :selected="node.selected" @toggle="toggleNode" />
16
11
  </div>
17
12
  </div>
18
13
  </template>
@@ -44,10 +39,10 @@ export default {
44
39
  // 父组件索引
45
40
  ipanelIndex: {
46
41
  type: Number,
47
- default: ''
42
+ default: 0
48
43
  }
49
44
  },
50
- data () {
45
+ data() {
51
46
  return {
52
47
  treeData: [
53
48
  // {
@@ -102,12 +97,10 @@ export default {
102
97
  },
103
98
  computed: {
104
99
  // 基于 $attrs 的样式类开关(参考 XInput.vue 模式)
105
- wrapperClassObject () {
100
+ wrapperClassObject() {
106
101
  const attrs = this.$attrs || {}
107
102
  const classes = {}
108
- const booleanStyleKeys = [
109
- 'user-entry'
110
- ]
103
+ const booleanStyleKeys = ['user-entry']
111
104
  booleanStyleKeys.forEach(key => {
112
105
  const val = attrs[key]
113
106
  const truthy = val === true || val === '' || val === 'true'
@@ -118,7 +111,7 @@ export default {
118
111
  return classes
119
112
  }
120
113
  },
121
- mounted () {
114
+ mounted() {
122
115
  console.log('实例化')
123
116
  this.$emit('component-mounted', this) // 向父组件发送实例
124
117
  },
@@ -130,7 +123,7 @@ export default {
130
123
  * @param {Array} path 当前路径
131
124
  * @returns {Object|null} 包含节点和路径的对象
132
125
  */
133
- findNodeAndPathByTitle (nodes, title, path = []) {
126
+ findNodeAndPathByTitle(nodes, title, path = []) {
134
127
  for (const node of nodes) {
135
128
  const currentPath = [...path, node]
136
129
  if (node.title === title) {
@@ -148,13 +141,13 @@ export default {
148
141
  * 展开节点路径
149
142
  * @param {Array} path 节点路径
150
143
  */
151
- expandNodePath (path) {
144
+ expandNodePath(path) {
152
145
  // 展开除最后一个节点外的所有节点(即所有父节点)
153
146
  for (let i = 0; i < path.length - 1; i++) {
154
147
  path[i].expanded = true
155
148
  }
156
149
  },
157
- searchTitleToggle (title) {
150
+ searchTitleToggle(title) {
158
151
  // 清除之前选中的节点
159
152
  if (this.lastSelectedNode) {
160
153
  this.$set(this.lastSelectedNode, 'selected', false) // 改用Vue.set
@@ -184,22 +177,22 @@ export default {
184
177
  * 滚动到指定节点
185
178
  * @param {string} nodeId 节点ID
186
179
  */
187
- scrollToNode (nodeId) {
180
+ scrollToNode(nodeId) {
188
181
  const nodeElement = document.querySelector(`[data-node-id="${nodeId}"]`)
189
182
  if (nodeElement) {
190
183
  nodeElement.scrollIntoView({ behavior: 'smooth', block: 'nearest' })
191
184
  }
192
185
  },
193
- toggleNode (node) {
186
+ toggleNode(node) {
194
187
  node.expanded = !node.expanded
195
188
  this.$emit('node-toggle', node)
196
189
  },
197
- isToOpenAll () {
190
+ isToOpenAll() {
198
191
  this.isExpanded = !this.isExpanded
199
192
  this.expandAllNodes(this.showData, this.isExpanded)
200
193
  this.$emit('isOpenAll', this.isExpanded)
201
194
  },
202
- expandAllNodes (nodes, expand) {
195
+ expandAllNodes(nodes, expand) {
203
196
  nodes.forEach(node => {
204
197
  if (node.children && node.children.length > 0) {
205
198
  node.expanded = expand
@@ -213,17 +206,17 @@ export default {
213
206
  * @param gid 根节点id
214
207
  * @returns {*|*[]}
215
208
  */
216
- buildTreeByRootId (allData, gid) {
209
+ buildTreeByRootId(allData, gid) {
217
210
  // 1. 找到所有直接子节点
218
211
  const directChildren = allData.filter(item => item.pid === gid)
219
212
  if (directChildren.length === 0) return [] // 如果没有子节点,返回空数组
220
213
  // 2. 递归构建子树
221
- const buildTree = (parentId) => {
214
+ const buildTree = parentId => {
222
215
  const children = allData.filter(item => item.pid === parentId)
223
216
  return children.map(child => ({
224
217
  title: child.label,
225
218
  id: child.value,
226
- children: buildTree(child.value), // 递归处理子节点
219
+ children: buildTree(child.value) // 递归处理子节点
227
220
  }))
228
221
  }
229
222
  // 3. 返回直接子节点的完整子树
@@ -234,7 +227,7 @@ export default {
234
227
  expanded: false
235
228
  }))
236
229
  },
237
- init (config, parameterData) {
230
+ init(config, parameterData) {
238
231
  getConfigByName(config, 'af-his', res => {
239
232
  this.isShowOpen = res.isShowOpen
240
233
  this.title = res.title
@@ -245,7 +238,8 @@ export default {
245
238
  }
246
239
  const parameter = { ...parameterData, ...this.parameter }
247
240
  runLogic(res.logicName, parameter, 'af-his').then(result => {
248
- if (result.isConstruction) { // 对数据重新构造
241
+ if (result.isConstruction) {
242
+ // 对数据重新构造
249
243
  this.showData = this.buildTreeByRootId(result.allData, result.gId)
250
244
  } else {
251
245
  this.showData = result
@@ -257,7 +251,7 @@ export default {
257
251
  watch: {
258
252
  queryParamsName: {
259
253
  immediate: true,
260
- handler (newValue) {
254
+ handler(newValue) {
261
255
  console.log(newValue)
262
256
  this.init(newValue, {})
263
257
  },
@@ -306,7 +300,7 @@ export default {
306
300
  .tree-title {
307
301
  font-size: 16px;
308
302
  font-weight: 700;
309
- color:#5D5C5C;
303
+ color: #5d5c5c;
310
304
  }
311
305
 
312
306
  .tree-expand-all {
@@ -314,7 +308,7 @@ export default {
314
308
  margin-right: 15px;
315
309
  font-size: 14px;
316
310
  font-weight: 400;
317
- color: #5D5C5C;
311
+ color: #5d5c5c;
318
312
  cursor: pointer;
319
313
  user-select: none;
320
314
  }
@@ -325,17 +319,17 @@ export default {
325
319
 
326
320
  /* user-entry 样式:字体与内容区域边距(参考需求) */
327
321
  .x-tree-rows-wrapper {
328
- &.xtreerows-user-entry{
329
- padding: 14px 0 20px 47px;
330
- .tree-list {
331
- font-family: 'Source Han Sans', sans-serif;
332
- font-size: 16px;
333
- font-weight: normal;
334
- line-height: 18px;
335
- letter-spacing: 0em;
336
- font-feature-settings: "kern" on;
337
- color: #313131;
338
- }
339
- }
322
+ &.xtreerows-user-entry {
323
+ padding: 14px 0 20px 47px;
324
+ .tree-list {
325
+ font-family: 'Source Han Sans', sans-serif;
326
+ font-size: 16px;
327
+ font-weight: normal;
328
+ line-height: 18px;
329
+ letter-spacing: 0em;
330
+ font-feature-settings: 'kern' on;
331
+ color: #313131;
332
+ }
333
+ }
340
334
  }
341
335
  </style>
@@ -3,12 +3,13 @@
3
3
  <div class="filter-bar">
4
4
  <a-date-picker v-model="upload_date" placeholder="上传日期" @change="selfSearch" />
5
5
  <a-select
6
- style="width: 200px;"
6
+ style="width: 200px"
7
7
  v-model="fusetype"
8
8
  :options="fusetypes"
9
9
  placeholder="分类"
10
10
  @change="selfSearch"
11
- allow-clear />
11
+ allow-clear
12
+ />
12
13
  <a-button type="primary" @click="selfSearch">查询</a-button>
13
14
  </div>
14
15
  <a-list bordered>
@@ -17,7 +18,13 @@
17
18
  <h4>{{ item.days }}</h4>
18
19
  <div class="file-items">
19
20
  <div v-for="file in item.arrays" :key="file.id" class="file-card">
20
- <img :src="getFileUrl(file.f_downloadpath)" class="file-image" v-if="file.f_filetype.includes('jpg') || file.f_filetype.includes('png')" @click="openPreview(file.f_downloadpath)" style="cursor:pointer" />
21
+ <img
22
+ :src="getFileUrl(file.f_downloadpath)"
23
+ class="file-image"
24
+ v-if="file.f_filetype.includes('jpg') || file.f_filetype.includes('png')"
25
+ @click="openPreview(file.f_downloadpath)"
26
+ style="cursor: pointer"
27
+ />
21
28
  <p>上传时间: {{ file.f_uploaddate }}</p>
22
29
  <p>操作员: {{ file.f_username }}</p>
23
30
  <p>分类: {{ file.fusetype }}</p>
@@ -45,7 +52,7 @@ export default {
45
52
  }
46
53
  },
47
54
  components: { ImagePreview },
48
- data () {
55
+ data() {
49
56
  return {
50
57
  upload_date: null,
51
58
  fusetype: null,
@@ -57,12 +64,12 @@ export default {
57
64
  }
58
65
  },
59
66
  methods: {
60
- async getfusetypes () {
67
+ async getfusetypes() {
61
68
  this.fusetypes = [{ label: '全部', value: '' }]
62
69
  const res = await post('/api/af-revenue/logic/getFileUseType', {})
63
70
  this.fusetypes.push(...res.map(item => ({ label: item.fusetype, value: item.fusetype })))
64
71
  },
65
- async getFiles () {
72
+ async getFiles() {
66
73
  if (!this.currUserInfo) return
67
74
  this.files = []
68
75
  let condition = `f_blobid = '${this.currUserInfo.f_userinfo_id}'`
@@ -78,18 +85,18 @@ export default {
78
85
  arrays: res.array.filter(file => file.uploadday === day.uploadday)
79
86
  }))
80
87
  },
81
- async delet (fileId) {
88
+ async delet(fileId) {
82
89
  await del('api/af-revenue/entity/save/t_files', { id: fileId }, { resolveMsg: '删除成功', rejectMsg: '删除失败' })
83
90
  this.getFiles()
84
91
  },
85
- selfSearch () {
92
+ selfSearch() {
86
93
  this.getFiles()
87
94
  },
88
- openPreview (src) {
95
+ openPreview(src) {
89
96
  this.previewImg = this.getFileUrl(src)
90
97
  this.previewVisible = true
91
98
  },
92
- getFileUrl (path) {
99
+ getFileUrl(path) {
93
100
  if (!path) return ''
94
101
 
95
102
  console.log('原始路径:', path)
@@ -98,7 +105,7 @@ export default {
98
105
  const baseUrl = `${window.location.protocol}//${window.location.host}`
99
106
 
100
107
  // 如果是本地文件路径,转换为新的转发路径
101
- if (path.match(/^[A-Za-z]:[\/\\]/)) {
108
+ if (path.match(/^[A-Za-z]:[/\\]/)) {
102
109
  // 提取文件名
103
110
  const fileName = path.split(/[/\\]/).pop()
104
111
  const newUrl = `${baseUrl}/rs/image/file/${fileName}`
@@ -120,7 +127,7 @@ export default {
120
127
  return path
121
128
  }
122
129
  },
123
- mounted () {
130
+ mounted() {
124
131
  if (this.$login.r.includes('上传附件删除')) {
125
132
  this.isDelete = '1'
126
133
  }
@@ -56,7 +56,8 @@ path: 'example',
56
56
  // component: () => import('@vue2-client/base-client/components/common/XDescriptions/demo.vue'),
57
57
  // component: () => import('@vue2-client/base-client/components/his/HChart/demo.vue'),
58
58
  // component: () => import('@vue2-client/pages/WorkflowDetail/WorkFlowDemo.vue'),
59
- component: () => import('@vue2-client/base-client/components/common/XFormTable/demo.vue'),
59
+ // component: () => import('@vue2-client/base-client/components/common/XFormTable/demo.vue'),
60
+ component: () => import('@vue2-client/base-client/components/common/ImagePreviewModal/demo.vue'),
60
61
  // component: () => import('@vue2-client/components/xScrollBox/example.vue'),
61
62
  // component: () => import('@vue2-client/pages/WorkflowDetail/WorkFlowDemo.vue'),
62
63
  // component: () => import('@vue2-client/pages/addressSelect/addressDemo.vue'),