fei.wang
2025-04-18 11f6acee504c77a8919a4e0ddfe3e70a746e3522
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
<template>
  <!-- <div v-if="role=='访客'" class="app-container">
 <el-empty  description="暂无权限"></el-empty>
</div> -->
  <div class="app-container">
 
    <!-- <el-empty description="描述文字"></el-empty> -->
 
    <el-table v-loading="listLoading" :data="list" element-loading-text="Loading" border fit height="100%"
      class="table-container" highlight-current-row>
      <el-table-column fixed label="ID" width="80" >
        <template slot-scope="scope">
          {{ scope.row.id }}
        </template>
      </el-table-column>
      <el-table-column label="公司名称" width="200">
        <template slot-scope="scope">
          {{ scope.row.companyname }}
        </template>
      </el-table-column>
      <el-table-column label="地图名称" width="90">
        <template slot-scope="scope">
          {{ scope.row.mapname }}
        </template>
      </el-table-column>
      <el-table-column label="地图类型" width="90">
        <template slot-scope="scope">
           在线地图
        </template>
      </el-table-column>
      <el-table-column label="默认显示级别" width="110">
        <template slot-scope="scope">
          {{ scope.row.level }}
        </template>
      </el-table-column>
      <el-table-column label="中心坐标" >
        <template slot-scope="scope">
          {{ scope.row.center}}
        </template>
      </el-table-column>
      <el-table-column label="视角角度"  width="100">
        <template slot-scope="scope">
          {{ scope.row.shijiao}}
        </template>
      </el-table-column>
      <el-table-column label="高度" width="70">
        <template slot-scope="scope">
          {{ scope.row.heig}}
        </template>
      </el-table-column>
      <el-table-column label="瓦片文件" width="120">
        <template slot-scope="scope">
          {{ scope.row.file}}
        </template>
      </el-table-column>
      <el-table-column label="是否显示" width="100">
        <template slot-scope="scope">
          {{ scope.row.ishow}}
        </template>
      </el-table-column>
      <el-table-column label="坐标系" width="70">
        <template slot-scope="scope">
          {{ scope.row.ishow}}
        </template>
      </el-table-column>
      <el-table-column label="更新时间" width="170">
        <template slot-scope="scope">
          {{ scope.row.addtime}}
        </template>
      </el-table-column>
      <el-table-column  label="操作" width="100"  v-if="uupdate=='Yes'">
        <template slot-scope="scope">
          <el-button-group>
            <el-button v-if="uupdate=='Yes'" type="primary" icon="el-icon-edit" size="mini" @click="edit(scope)">
              修改
            </el-button>
           
          </el-button-group>
        </template>
      </el-table-column>
    </el-table>
 
    <pagination v-show="total > 0" :total="total" :page.sync="listQuery.current" :limit.sync="listQuery.size"
      @pagination="fetchData" />
      
    <el-dialog :visible.sync="dialogVisible" :title="dialogType === 'modify' ? '修改' : '新增'">
      <el-form ref="dataForm" :model="temp" label-width="120px" label-position="right">
        <el-form-item label="序号">
          <el-input v-model="temp.id
        " placeholder="请输入提示类型" />
        </el-form-item>
        <el-form-item label="地图名称">
          <el-input v-model="temp.mapname
        " placeholder="请输入地图名称" />
        </el-form-item>
        <el-form-item label="中心坐标">
          <el-input v-model="temp.center
        " placeholder="请输入中心坐标" />
        </el-form-item>
        <el-form-item label="视角角度">
          <el-input v-model="temp.shijiao
        " placeholder="请输入视角角度" />
        </el-form-item>
        <el-form-item label="高度">
          <el-input v-model="temp.heig
        " placeholder="请输入高度" />
        </el-form-item>
      </el-form>
      <div class="text-right">
        <el-button type="danger" @click="dialogVisible = false">
          取消
        </el-button>
        <el-button type="primary" @click="submit">
          确定
        </el-button>
      </div>
    </el-dialog>
  </div>
</template>
 
<script>
 
import Pagination from '@/components/Pagination'
import { getBaidumapPage,  addorupBaidumap,addSystemOperationLog } from '@/api/baidumap'
import { deepClone } from '@/utils'
 
const _temp = {
  id: '',
  hdsv: '',
  mapname: '',
  ndsv: '',
  edsv: '',
}
 
export default {
  components: {
    Pagination
  },
  data() {
    return {
      role:localStorage.getItem('role'),
      uadd:'',
      udelete:'',
      uupdate:'',
      total: 0,
      list: [],
      menus: [],
      listLoading: true,
      listQuery: {
        current: 1,
        size: 20,
        username:localStorage.getItem('username'),
        keyword: undefined,
      },
      uploadUrl: '',
      temp: Object.assign({}, _temp),
      dialogVisible: false,
      dialogType: 'create',
      loading: false
    }
  },
  created() {
    this.fetchData()
  },
  methods: {
    // 搜索
 
    refresh() {
      this.listQuery = {
        current: 1,
        size: 20,
        username:localStorage.getItem('username'),
        keyword: undefined
      }
      this.fetchData()
    },
    // 分页数据
    fetchData() {
      this.uadd = localStorage.getItem('uadd') || '';
      this.udelete = localStorage.getItem('udelete') || '';
      this.uupdate = localStorage.getItem('uupdate') || '';
      this.listLoading = true
      getBaidumapPage(this.listQuery).then(response => {
        this.list = response.data.records
        this.total = response.data.total
        this.listLoading = false
      })
    },
    resetTemp() {
      this.temp = Object.assign({}, _temp)
    },
    edit(scope) {
      this.resetTemp()
      this.dialogVisible = true
      this.dialogType = 'modify'
      this.temp = deepClone(scope.row)
      // this.$nextTick(() => {
      //   this.$refs['dataForm'].clearValidate()
      // })
    },
    changeStatus(value, scope) {
      setTimeout(() => {
        this.list[scope.$index].status = value
        this.$message({
          message: '更新成功',
          type: 'success'
        })
      }, 300)
    },
    // 删除
 
    submit() {
      if (this.loading) {
        return
      }
      this.loading = true
      addorupBaidumap(this.temp).then(() => {
        this.temp.adminname = localStorage.getItem('username') || '';
            const params = { name:  this.temp.adminname, content: '修改了一个地图管理,该地图名称为:'+this.temp.mapname };
            addSystemOperationLog(params).then(response => {
 
                        })
        this.fetchData()
        setTimeout(() => {
          this.$message({
            message: '提交成功',
            type: 'success'
          })
          this.dialogVisible = false
          this.loading = false
        }, 300)
      })
    }
  }
}
</script>
 
 
<style lang="scss" scoped>
.el-upload {
  border: 1px dashed #d9d9d9 !important;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
 
  .el-icon-plus.avatar-uploader-icon {
    border: 1px dashed #d9d9d9 !important;
    border-radius: 6px;
    font-size: 28px;
    color: #8c939d;
    width: 128px;
    height: 128px;
    line-height: 128px;
    text-align: center;
  }
}
 
.avatar-uploader {
  height: 128px;
 
  img {
    width: 128px;
    height: 128px;
  }
}
</style>