cloudroam
2025-06-26 03fbf454453daf7b3a45064ea781cf4bdcc76832
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
<template>
  <el-bus-crud ref="crud" v-bind="tableConfig"/>
</template>
 
<script>
import dayjs from 'dayjs'
import 'dayjs/locale/zh-cn'
 
dayjs.locale('zh-cn')
export default {
  data() {
    return {
      tableConfig: {
        url: 'flower/api/filmLocation/list',
        newUrl: 'flower/api/filmLocation/new',
        editUrl: 'flower/api/filmLocation/edit',
        deleteUrl: 'flower/api/filmLocation/delete',
        dialogNeedRequest: true,
        persistSelection: true,
        columns: [
          {type: 'selection'},
          {label: '拍摄地点名称', prop: 'locationName', minWidth: 120},
          {label: '拍摄地点图片', prop: 'locationUrl', minWidth: 120},
          {label: '省', prop: 'province', minWidth: 120},
          {label: '市', prop: 'city', minWidth: 150},
          {label: '区', prop: 'region'},
          {label: '详细地址', prop: 'address', minWidth: 150},
          {label: '纬度坐标', prop: 'gpsLat', minWidth: 150},
          {label: '经度坐标', prop: 'gpsLng', minWidth: 300},
          {label: '场景类型', prop: 'sceneType'},
          {label: '经典画面描述', prop: 'classicScene', minWidth: 400},
          {label: '开放参观', prop: 'isOpenVisitStr', minWidth: 200},
          {label: '参观提示', prop: 'visitInfo', minWidth: 120},
          {label: '地标性建筑描述', prop: 'landmarkDesc'},
          {label: '停车场信息', prop: 'parkingInfo', minWidth: 80},
          {label: '周边设施描述', prop: 'surroundingFacilities', minWidth: 80},
          {label: 'ARURL', prop: 'arEntry', minWidth: 80},
          {label: '打卡记录量', prop: 'checkinCount', minWidth: 80},
          // { label: '游客实拍图', prop: 'visitorPhotos', minWidth: 80  },
          {label: '景点热度', prop: 'locationWeight', minWidth: 80},
          {label: '运营权重', prop: 'operationWeight', minWidth: 80},
          {
            label: '启用/禁用',
            formatter: (row) => (
              <el-switch
                value={row.isEnabled}
                onChange={this.onEnabledChange.bind(this, row)}
              ></el-switch>
            ),
            minWidth: 120,
            fixed: 'right',
          },
        ],
        searchForm: [
          {
            type: 'row',
            items: [
              {label: '拍摄地点名称', id: 'locationName', type: 'input'},
              {
                label: '启用/禁用',
                id: 'isEnabled',
                type: 'bus-select-dict',
                default: '1',
                el: {
                  code: 'USER_ENABLED_OR_DISABLED',
                  clearable: true,
                  style: 'width:100%',
                },
              },
            ],
          },
        ],
        form: [
          {
            label: '拍摄地点名称:',
            id: 'locationName',
            type: 'input',
            rules: {
              required: true,
              message: '请输入拍摄地点名称',
              trigger: 'blur',
            },
          },
          {
            label: '封面图片:',
            id: 'locationUrl',
            type: 'bus-upload',
            el: {
              listType: 'picture-card',
              limitSize: 2,
              limit: 1,
              tipText: '大小不超过2M',
            },
          },
          {
            label: '省:',
            id: 'province',
            type: 'input',
            rules: {
              required: true,
              message: '请输入省',
              trigger: 'blur',
            },
          },
          {
            label: '市:',
            id: 'city',
            type: 'input',
            rules: {
              required: true,
              message: '请输入市',
              trigger: 'blur',
            },
          },
          {
            label: '区:',
            id: 'region',
            type: 'input',
            rules: {
              required: true,
              message: '请输入区',
              trigger: 'blur',
            },
          },
          {
            label: '详细地址:',
            id: 'address',
            type: 'input',
            rules: {
              required: true,
              message: '请输详细地址',
              trigger: 'blur',
            },
          },
          {
            label: '纬度坐标:',
            id: 'gpsLat',
            type: 'input',
            rules: {
              required: true,
              message: '请输入纬度坐标',
              trigger: 'blur',
            },
          },
          {
            label: '经度坐标:',
            id: 'gpsLng',
            type: 'input',
            rules: {
              required: true,
              message: '请输入经度坐标',
              trigger: 'blur',
            },
          },
          {
            label: '场景类型:',
            id: 'sceneType',
            type: 'input',
            rules: {
              required: true,
              message: '请输入场景类型',
              trigger: 'blur',
            },
          },
          {
            label: '经典画面描述:',
            id: 'classicScene',
            type: 'input',
            rules: {
              required: true,
              message: '请输入经典画面描述',
              trigger: 'blur',
            },
          },
          {
            label: '开放参观:',
            id: 'isOpenVisit',
            type: 'bus-select-dict',
            el: {
              code: 'IS_VISITOR',
              style: 'width:100%',
              clearable: true,
            },
            rules: {
              required: true,
              message: '请选择参观类型',
            },
          },
          {
            label: '参观提示:',
            id: 'visitInfo',
            type: 'input',
            rules: {
              required: true,
              message: '请输入参观提示',
              trigger: 'blur',
            },
          },
          {
            label: '地标性建筑描述:',
            id: 'landmarkDesc',
            type: 'input',
            rules: {
              required: true,
              message: '请输入地标性建筑描述',
              trigger: 'blur',
            },
          },
          {
            label: '停车场信息:',
            id: 'parkingInfo',
            type: 'input',
            rules: {
              required: true,
              message: '请输入停车场信息',
              trigger: 'blur',
            },
          },
          {
            label: '周边设施描述:',
            id: 'surroundingFacilities',
            type: 'input',
            rules: {
              required: true,
              message: '请输入周边设施描述',
              trigger: 'blur',
            },
          },
          {
            label: 'ARURL:',
            id: 'arEntry',
            type: 'input',
            rules: {
              required: false,
              message: '请输入ARURL',
              trigger: 'blur',
            },
          },
          // {
          //   label: '取景地内容:',
          //   id: 'filmContent',
          //   component: 'base-editor',
          //   richText: true,
          //   rules: { required: true, message: '请输入取景地内容', trigger: 'blur' },
          // },
          {
            label: '打卡记录量:',
            id: 'checkinCount',
            type: 'input',
            rules: {
              required: false,
              message: '请输入打卡记录量',
              trigger: 'blur',
            },
          },
          {
            label: '景点热度:',
            id: 'locationWeight',
            type: 'input',
            rules: {
              required: false,
              message: '请输入景点热度',
              trigger: 'blur',
            },
          },
          {
            label: '运营权重:',
            id: 'operationWeight',
            type: 'input',
            rules: {
              required: false,
              message: '请输入运营权重',
              trigger: 'blur',
            },
          },
        ],
        extraButtons: [
          {
            text: '清除热度',
            atClick: async (row) => {
              try {
                await this.$elBusUtil.confirm(`确定要清除热度吗?`)
                const {code} = await this.$elBusHttp.request(
                  'flower/api/filmLocation/setDown',
                  {params: {id: row.id}}
                )
                if (code === 0) {
                  this.$message.success(`清除热度成功`)
                }
              } catch (e) {
                return false
              }
            },
          },
        ],
        headerButtons: [
          {
            text: '合并',
            type: 'primary',
            disabled: (selected) =>
              selected.filter((item) => item.isEnabled)
                .length === 0,
            atClick: async (selected) => {
              const selectedNotice = selected.filter(
                (item) => item.isEnabled
              )
              try {
                await this.$elBusUtil.confirm(
                  `确定要合并这${selectedNotice.length -1}个景点到第一个吗?`
                )
                const {code} = await this.$elBusHttp.request(
                  'flower/api/filmLocation/merge/batch',
                  {
                    method: 'post',
                    data: {
                      ids: selected.map((item) => item.id),
                    },
                  }
                )
                if (code === 0) {
                  this.$message.success('操作成功')
                  this.$refs.crud.clearSelection()
                }
              } catch (e) {
                return false
              }
            },
          },
          {
            text: '批量删除',
            type: 'danger',
            disabled: (selected) => selected.length === 0,
            atClick: async (selected) => {
              try {
                await this.$elBusUtil.confirm(
                  `确定要批量删除这${selected.length}个片场内容吗?`
                )
                const {code} = await this.$elBusHttp.request(
                  'flower/api/filmLocation/delete/batch',
                  {
                    method: 'post',
                    data: {
                      ids: selected.map((item) => item.id),
                    },
                  }
                )
                if (code === 0) {
                  this.$message.success('操作成功')
                  this.$refs.crud.clearSelection()
                }
              } catch (e) {
                return false
              }
            },
          },
        ],
      },
    }
  },
  head() {
    return {
      title: '影视景点管理',
    }
  },
  methods: {
    onEnabledChange(row, e) {
      const url = 'flower/api/filmLocation/isEnable'
      const text = e ? '启用' : '禁用'
      this.$elBusUtil
        .confirm(`确定要${text}这个影视景点吗?`)
        .then(async () => {
          const { code } = await this.$elBusHttp.request(url, {
            params: {
              id: row.id,
            },
          })
          if (code === 0) {
            this.$message.success(`${text}成功`)
            this.$refs.crud.getList()
          }
        })
        .catch(() => { })
    },
 
  },
}
</script>
 
<style lang="scss" scoped>
::v-deep {
  .el-upload {
    &-list__item {
      width: 345px;
      height: 128px;
    }
 
    &.el-upload--picture-card {
      width: 345px;
      height: 128px;
    }
  }
}
</style>