Selaa lähdekoodia

Merge branch 'master' of http://10.1.235.20:3000/asiainfo/ebc

wangchao 4 vuotta sitten
vanhempi
commit
41aea6126c

+ 22 - 18
ebc-middle-platform/src/modules/attendance/attendance.vue

@ -4,13 +4,14 @@
4 4
      <div class="search-ctn">
5 5
        <div>
6 6
          <t-button-group>
7
            <t-button :class="timeType.day?'active':''" color="secondary" @click="changeType('day')">日</t-button>
7
            <!-- <t-button :class="timeType.day?'active':''" color="secondary" @click="changeType('day')">日</t-button>
8 8
            <t-button :class="timeType.week?'active':''" color="secondary" @click="changeType('week')">月</t-button>
9
            <t-button :class="timeType.month?'active':''" color="secondary" @click="changeType('month')">年</t-button>
9
            <t-button :class="timeType.month?'active':''" color="secondary" @click="changeType('month')">年</t-button> -->
10
            <t-button v-for="(item,index) in queryCondition.type" :class="index==queryCondition.currentIndex?'active':''" :key="index" color="secondary" @click="changeType(index)">{{ item }}</t-button>
10 11
          </t-button-group>
11 12
        </div>
12 13
        <div>
13
          <t-date-picker v-model="singleDateVal" style="width:120px" placeholder="时间" @date-change="onChangeDate"
14
          <t-date-picker v-model="queryCondition.singleDateVal" style="width:120px" placeholder="时间" @date-change="onChangeDate"
14 15
          ></t-date-picker>
15 16
        </div>
16 17
        <div>
@ -33,10 +34,10 @@
33 34
      <t-table :data="table.data">
34 35
        <t-table-column prop="name" label="姓名"></t-table-column>
35 36
        <t-table-column prop="job" label="职务"></t-table-column>
36
        <t-table-column v-if="timeType.day" prop="time" label="打卡时间"></t-table-column>
37
        <t-table-column v-if="!timeType.day" prop="attendance" label="出勤天数(天)"></t-table-column>
37
        <t-table-column v-if="queryCondition.currentIndex === 0" prop="time" label="打卡时间"></t-table-column>
38
        <t-table-column v-if="queryCondition.currentIndex !== 0" prop="attendance" label="出勤天数(天)"></t-table-column>
38 39
        <t-table-column
39
          v-if="!timeType.day"
40
          v-if="queryCondition.currentIndex !== 0"
40 41
          fixed="right"
41 42
          label="操作"
42 43
          width="120"
@ -76,11 +77,6 @@ import './attendance.scss'
76 77
export default {
77 78
  data() {
78 79
    return {
79
      timeType: {
80
        day: true,
81
        week: false,
82
        month: false
83
      },
84 80
      table: {
85 81
        data: [
86 82
          {
@ -109,10 +105,13 @@ export default {
109 105
        }
110 106
      },
111 107
      queryCondition: {
112
        type: '',
108
        type: [
109
          '日', '月', '年'
110
        ],
111
        currentIndex: 0,
112
        singleDateVal: '',
113 113
        alarmPerson: ''
114 114
      },
115
      singleDateVal: '',
116 115
      modal: false,
117 116
      modalData: {
118 117
        table: [{
@ -145,10 +144,8 @@ export default {
145 144
    this.table.pager.total = this.table.data.length
146 145
  },
147 146
  methods: {
148
    changeType(type) {
149
      Object.keys(this.timeType).forEach((value, key) => {
150
        this.timeType[value] = value === type
151
      })
147
    changeType(index) {
148
      this.queryCondition.currentIndex = index
152 149
    },
153 150
    onChangeDate(value) {
154 151
      console.log(value)
@ -158,7 +155,14 @@ export default {
158 155
      console.log('date change:' + value)
159 156
    },
160 157
    onReset() {
161
158
      this.queryCondition = {
159
        type: [
160
          '日', '月', '年'
161
        ],
162
        currentIndex: 0,
163
        singleDateVal: '',
164
        alarmPerson: ''
165
      }
162 166
    },
163 167
    onSearch() {
164 168

+ 7 - 5
ebc-middle-platform/src/modules/attendance/track.vue

@ -4,7 +4,7 @@
4 4
      <div class="search-ctn">
5 5
        <div>
6 6
          <div class="input-rule">
7
            <t-date-picker v-model="rangeDate" limit-date="10" type="dateRange" style="width:250px" placeholder="选择时间段" @date-change="onChange"></t-date-picker>
7
            <t-date-picker v-model="queryCondition.rangeDate" limit-date="10" type="dateRange" style="width:250px" placeholder="选择时间段" @date-change="onChange"></t-date-picker>
8 8
          </div>
9 9
        </div>
10 10
        <div>
@ -83,10 +83,9 @@ export default {
83 83
        }
84 84
      },
85 85
      queryCondition: {
86
        type: '',
86
        rangeDate: [],
87 87
        alarmPerson: ''
88
      },
89
      rangeDate: ''
88
      }
90 89
    }
91 90
  },
92 91
  mounted() {
@ -96,7 +95,10 @@ export default {
96 95
      console.log('date change:' + value)
97 96
    },
98 97
    onReset() {
99
98
      this.queryCondition = {
99
        rangeDate: [],
100
        alarmPerson: ''
101
      }
100 102
    },
101 103
    onSearch() {
102 104

+ 5 - 5
ebc-middle-platform/src/modules/call-help/current.scss

@ -1,11 +1,11 @@
1 1
.current-container{
2 2
  display: flex;
3
  width: "100%";
4
  height: 700px;
3
  width: 100%;
4
  height: 100%;
5 5
  .left{
6 6
    margin-top: 30px;
7 7
    width: 360px;
8
    height: 700px;
8
    height: 100%;
9 9
    .item{
10 10
      width: 300px;
11 11
      margin: 10px 30px;
@ -80,7 +80,7 @@
80 80
    padding: 40px 30px 0 0;
81 81
    #current-map{
82 82
      width: 100%;
83
      height: 700px;
83
      height: 100%;
84 84
    }
85 85
  }
86 86
}
@ -128,7 +128,7 @@
128 128
    }
129 129
    .hand-alarm{
130 130
      color: #FAAD14;
131
      background-color: #FFF7E8;
131
      background-color: #495571;
132 132
      margin: 7.5px 0 0 5px;
133 133
      padding: 0 5px;
134 134
      font-size: 8px;

+ 125 - 32
ebc-middle-platform/src/modules/call-help/current.vue

@ -14,7 +14,7 @@
14 14
          </div>
15 15
          <div class="row">
16 16
            <div>救援人</div>
17
            <div>{{ item.rescue }}</div>
17
            <div>{{ item.rescue==''?'--':item.rescue }}</div>
18 18
          </div>
19 19
          <div class="row">
20 20
            <div>报警时间</div>
@ -26,14 +26,28 @@
26 26
          </div>
27 27
        </div>
28 28
        <div class="footer">
29
          <t-button icon="user-outline" color="primary">指派</t-button>
30
          <t-button icon="close" color="primary">关闭</t-button>
29
          <t-button v-show="item.rescue==''" icon="user-outline" color="primary" @click="showModal(item)">指派</t-button>
30
          <t-button icon="close" color="primary" @click="close(item)">关闭</t-button>
31 31
        </div>
32 32
      </div>
33 33
    </t-scroll-bar>
34 34
    <div class="right">
35 35
      <div id="current-map"></div>
36 36
    </div>
37
    <t-modal :visibled.sync="modal" title="指派救援人员" >
38
      <t-form ref="formValidate" :model="formValidate" :rules="ruleValidate" :label-width="80" label-position="left">
39
        <t-form-item label="救援人员" prop="rescue">
40
          <t-select v-model="formValidate.rescue" placeholder="请选择">
41
            <t-option>张三</t-option>
42
            <t-option>李四</t-option>
43
          </t-select>
44
        </t-form-item>
45
      </t-form>
46
      <div slot="footer">
47
        <t-button @click="cancel">取消</t-button>
48
        <t-button class="submit-button" @click="appoint()">指派</t-button>
49
      </div>
50
    </t-modal>
37 51
  </div>
38 52
</template>
39 53
<script>
@ -46,7 +60,7 @@ export default {
46 60
          name: '张三',
47 61
          type: 1,
48 62
          number: 'ZDBH0001',
49
          rescue: '--',
63
          rescue: '',
50 64
          alarmTime: '2020.08.13 08:24:32',
51 65
          positionTime: '2020.08.13 08:24:32'
52 66
        },
@ -54,7 +68,7 @@ export default {
54 68
          name: '张三',
55 69
          type: 2,
56 70
          number: 'ZDBH0001',
57
          rescue: '--',
71
          rescue: '',
58 72
          alarmTime: '2020.08.13 08:24:32',
59 73
          positionTime: '2020.08.13 08:24:32'
60 74
        },
@ -62,7 +76,7 @@ export default {
62 76
          name: '张三',
63 77
          type: 2,
64 78
          number: 'ZDBH0001',
65
          rescue: '--',
79
          rescue: '海事局A',
66 80
          alarmTime: '2020.08.13 08:24:32',
67 81
          positionTime: '2020.08.13 08:24:32'
68 82
        },
@ -70,17 +84,32 @@ export default {
70 84
          name: '张三',
71 85
          type: 2,
72 86
          number: 'ZDBH0001',
73
          rescue: '--',
87
          rescue: '',
74 88
          alarmTime: '2020.08.13 08:24:32',
75 89
          positionTime: '2020.08.13 08:24:32'
76 90
        }
77 91
      ],
78
      activeIndex: 0
92
      activeIndex: 0,
93
      modal: false,
94
      formValidate: {
95
        rescue: ''
96
      },
97
      ruleValidate: {
98
        rescue: [{
99
          required: true,
100
          message: '救援人员不能为空',
101
          trigger: 'blur'
102
        }]
103
      },
104
      map: null,
105
      alarmPoint: null,
106
      rescuePoint: null,
107
      polyline: null
79 108
    }
80 109
  },
81 110
  mounted() {
82 111
    this.map = new Ai.Map('current-map', {
83
      ak: 'MTYwMDkMTAwMU1UWXdNRGs1T0RZeE1EZzNPU014TnpRdw__',
112
      ak: 'MTYwMTMMTAwMU1UWXdNVE0wTlRNMU16WTBNeU14TnpRdw__',
84 113
      center: [39.915599, 116.406568],
85 114
      zoom: 5
86 115
    })
@ -89,18 +118,31 @@ export default {
89 118
    this.map.addLayer(maplayer)
90 119
    var la = Ai.WMTSLayer('http://192.168.74.216:5071/gisserver/dzht:dzht/wmts')
91 120
    this.map.addLayer(la)
92
    var icon = Ai.Icon({
121
  },
122
  methods: {
123
    choose(item, index) {
124
      this.activeIndex = index
125
      if (this.map.hasLayer(this.alarmPoint)) {
126
        this.map.removeLayer(this.alarmPoint)
127
      }
128
      if (this.map.hasLayer(this.rescuePoint)) {
129
        this.map.removeLayer(this.rescuePoint)
130
      }
131
      if (this.map.hasLayer(this.polyline)) {
132
        this.map.removeLayer(this.polyline)
133
      }
134
      var icon = Ai.Icon({
93 135
      // 设置图标URL路径
94
      iconUrl: '/static/images/worker.png',
95
      // 设置图标大小
96
      iconSize: [20, 20],
97
      // 设置点对象和图标的相对偏移量
98
      iconAnchor: [0, 0]
99
    })
100
    var point = Ai.Point([32.12222, 116.222157], {icon: icon})
101
    point.on('click', (e) => {
102
      console.log(e)
103
      var content = '<div class="tips-item"><div class="top"><div class="user-pic"><t-icon icon="user-outline"></t-icon></div><div>张三</div><div class="alarm">落水报警</div></div><div class="middle"><div class="row">' +
136
        iconUrl: '/static/images/worker(1).png',
137
        // 设置图标大小
138
        iconSize: [20, 20],
139
        // 设置点对象和图标的相对偏移量
140
        iconAnchor: [0, 0]
141
      })
142
      this.alarmPoint = Ai.Point([29.86089241772908, 122.09930419921876], {icon: icon})
143
      this.alarmPoint.on('click', (e) => {
144
        console.log(e)
145
        var content = '<div class="tips-item"><div class="top"><div class="user-pic"><t-icon icon="user-outline"></t-icon></div><div>张三</div><div class="hand-alarm">救援人员</div></div><div class="middle"><div class="row">' +
104 146
            '<div>终端编号</div>' +
105 147
            '<div>ZDBH0001</div>' +
106 148
          '</div>' +
@ -108,18 +150,69 @@ export default {
108 150
            '<div>最新定位时间</div>' +
109 151
            '<div>2020.08.13 08:24:32</div>' +
110 152
          '</div></div></div>'
111
      var popup = Ai.Popup({minWidth: 300, offset: [0, -10]})
112
      // 设置弹出框弹出位置
113
        .setLatLng({lat: 32.12222, lng: 116.222157})
114
      // 设置弹出框弹出内容
115
        .setContent(content)
116
        .openOn(this.map)
117
    })
118
    this.map.addLayer(point)
119
  },
120
  methods: {
121
    choose(item, index) {
122
      this.activeIndex = index
153
        var popup = Ai.Popup({minWidth: 300, offset: [0, -10], autoClose: false})
154
        // 设置弹出框弹出位置
155
          .setLatLng({lat: 29.86089241772908, lng: 122.09930419921876})
156
        // 设置弹出框弹出内容
157
          .setContent(content)
158
          .openOn(this.map)
159
      })
160
      this.map.addLayer(this.alarmPoint)
161
      this.rescuePoint = Ai.Point([29.388158098102554, 122.45361328125], {icon: Ai.Icon({
162
      // 设置图标URL路径
163
        iconUrl: '/static/images/worker.png',
164
        // 设置图标大小
165
        iconSize: [20, 20],
166
        // 设置点对象和图标的相对偏移量
167
        iconAnchor: [0, 0]
168
      })})
169
      this.rescuePoint.on('click', (e) => {
170
        console.log(e)
171
        var content = '<div class="tips-item"><div class="top"><div class="user-pic"><t-icon icon="user-outline"></t-icon></div><div>张三</div><div class="alarm">报警人员</div></div><div class="middle"><div class="row">' +
172
            '<div>终端编号</div>' +
173
            '<div>ZDBH0001</div>' +
174
          '</div>' +
175
          '<div class="row">' +
176
            '<div>最新定位时间</div>' +
177
            '<div>2020.08.13 08:24:32</div>' +
178
          '</div></div></div>'
179
        var popup = Ai.Popup({minWidth: 300, offset: [0, -10], autoClose: false})
180
        // 设置弹出框弹出位置
181
          .setLatLng({lat: 29.388158098102554, lng: 122.45361328125})
182
        // 设置弹出框弹出内容
183
          .setContent(content)
184
          .openOn(this.map)
185
      })
186
      this.map.addLayer(this.rescuePoint)
187
      var lineWktstr = 'LINESTRING ( 122.09930419921876 29.86089241772908,122.18582153320314 29.6913335169976,122.21878051757814 29.42494595179543,122.45361328125 29.388158098102554)'
188
      this.polyline = Ai.Polyline(lineWktstr, {color: 'red'})
189
      this.map.addLayer(this.polyline)
190
      this.map.on('click', function(evt) {
191
        var lat = evt.latlng.lat // 点击地图时的纬度
192
        var lng = evt.latlng.lng // 点击地图时的经度
193
        console.log(lng, lat)
194
      })
195
    },
196
    showModal(item) {
197
      this.modal = true
198
    },
199
    cancel() {
200
      this.modal = false
201
    },
202
    appoint() {
203
204
    },
205
    close(item) {
206
      this.$Confirm.confirm({
207
        title: '确认要关闭张三落水报警吗?',
208
        content: '关闭后将不再进行报警显示',
209
        ok: () => {
210
          console.log('点击了确定')
211
        },
212
        cancel: () => {
213
          console.log('点击了取消')
214
        }
215
      })
123 216
    }
124 217
  }
125 218
}

+ 97 - 67
ebc-middle-platform/src/modules/call-help/history.vue

@ -22,7 +22,7 @@
22 22
        </li>
23 23
        <li>
24 24
          <div class="input-rule">
25
            <t-date-picker v-model="rangeDate" limit-date="10" type="dateRange" style="width:250px" placeholder="选择时间段" @date-change="onChange"></t-date-picker>
25
            <t-date-picker v-model="queryCondition.rangeDate" limit-date="10" type="dateRange" style="width:250px" placeholder="选择时间段" @date-change="onChange"></t-date-picker>
26 26
          </div>
27 27
        </li>
28 28
        <div class="btns">
@ -50,7 +50,7 @@
50 50
        >
51 51
          <template slot-scope="scope">
52 52
            <a href="javascript:void(0)" size="sm" @click="rescuePlayback(scope.row)">救援回放</a>
53
            <a href="javascript:void(0)" size="sm" @click="remove(scope.$index)">删除</a>
53
            <a href="javascript:void(0)" size="sm" @click="deleteHistory(scope.row)">删除</a>
54 54
          </template>
55 55
        </t-table-column>
56 56
      </t-table>
@ -201,11 +201,15 @@ export default {
201 201
      },
202 202
      queryCondition: {
203 203
        type: '',
204
        alarmPerson: ''
204
        alarmPerson: '',
205
        rangeDate: []
205 206
      },
206
      rangeDate: '',
207 207
      modal: false,
208
      speed: '1'
208
      speed: '1',
209
      map: null,
210
      alarmPoint: null,
211
      rescuePoint: null,
212
      polyline: null
209 213
    }
210 214
  },
211 215
  mounted() {
@ -219,74 +223,17 @@ export default {
219 223
    this.map.addLayer(maplayer)
220 224
    var la = Ai.WMTSLayer('http://192.168.74.216:5071/gisserver/dzht:dzht/wmts')
221 225
    this.map.addLayer(la)
222
    var icon = Ai.Icon({
223
      // 设置图标URL路径
224
      iconUrl: '/static/images/worker(1).png',
225
      // 设置图标大小
226
      iconSize: [20, 20],
227
      // 设置点对象和图标的相对偏移量
228
      iconAnchor: [0, 0]
229
    })
230
    var point = Ai.Point([29.86089241772908, 122.09930419921876], {icon: icon})
231
    point.on('click', (e) => {
232
      console.log(e)
233
      var content = '<div class="tips-item"><div class="top"><div class="user-pic"><t-icon icon="user-outline"></t-icon></div><div>张三</div><div class="hand-alarm">救援人员</div></div><div class="middle"><div class="row">' +
234
            '<div>终端编号</div>' +
235
            '<div>ZDBH0001</div>' +
236
          '</div>' +
237
          '<div class="row">' +
238
            '<div>最新定位时间</div>' +
239
            '<div>2020.08.13 08:24:32</div>' +
240
          '</div></div></div>'
241
      var popup = Ai.Popup({minWidth: 300, offset: [0, -10], autoClose: false})
242
      // 设置弹出框弹出位置
243
        .setLatLng({lat: 29.86089241772908, lng: 122.09930419921876})
244
      // 设置弹出框弹出内容
245
        .setContent(content)
246
        .openOn(this.map)
247
    })
248
    this.map.addLayer(point)
249
    point = Ai.Point([29.388158098102554, 122.45361328125], {icon: Ai.Icon({
250
      // 设置图标URL路径
251
      iconUrl: '/static/images/worker.png',
252
      // 设置图标大小
253
      iconSize: [20, 20],
254
      // 设置点对象和图标的相对偏移量
255
      iconAnchor: [0, 0]
256
    })})
257
    point.on('click', (e) => {
258
      console.log(e)
259
      var content = '<div class="tips-item"><div class="top"><div class="user-pic"><t-icon icon="user-outline"></t-icon></div><div>张三</div><div class="alarm">报警人员</div></div><div class="middle"><div class="row">' +
260
            '<div>终端编号</div>' +
261
            '<div>ZDBH0001</div>' +
262
          '</div>' +
263
          '<div class="row">' +
264
            '<div>最新定位时间</div>' +
265
            '<div>2020.08.13 08:24:32</div>' +
266
          '</div></div></div>'
267
      var popup = Ai.Popup({minWidth: 300, offset: [0, -10], autoClose: false})
268
      // 设置弹出框弹出位置
269
        .setLatLng({lat: 29.388158098102554, lng: 122.45361328125})
270
      // 设置弹出框弹出内容
271
        .setContent(content)
272
        .openOn(this.map)
273
    })
274
    this.map.addLayer(point)
275
    var lineWktstr = 'LINESTRING ( 122.09930419921876 29.86089241772908,122.18582153320314 29.6913335169976,122.21878051757814 29.42494595179543,122.45361328125 29.388158098102554)'
276
    var polyline = Ai.Polyline(lineWktstr, {color: 'red'})
277
    this.map.addLayer(polyline)
278
    this.map.on('click', function(evt) {
279
      var lat = evt.latlng.lat // 点击地图时的纬度
280
      var lng = evt.latlng.lng // 点击地图时的经度
281
      console.log(lng, lat)
282
    })
283 226
  },
284 227
  methods: {
285 228
    onChange(value) {
286 229
      console.log('date change:' + value)
287 230
    },
288 231
    onReset() {
289
232
      this.queryCondition = {
233
        type: '',
234
        alarmPerson: '',
235
        rangeDate: []
236
      }
290 237
    },
291 238
    onSearch() {
292 239
@ -302,6 +249,89 @@ export default {
302 249
    },
303 250
    rescuePlayback(row) {
304 251
      this.modal = true
252
      if (this.map.hasLayer(this.alarmPoint)) {
253
        this.map.removeLayer(this.alarmPoint)
254
      }
255
      if (this.map.hasLayer(this.rescuePoint)) {
256
        this.map.removeLayer(this.rescuePoint)
257
      }
258
      if (this.map.hasLayer(this.polyline)) {
259
        this.map.removeLayer(this.polyline)
260
      }
261
      var icon = Ai.Icon({
262
      // 设置图标URL路径
263
        iconUrl: '/static/images/worker(1).png',
264
        // 设置图标大小
265
        iconSize: [20, 20],
266
        // 设置点对象和图标的相对偏移量
267
        iconAnchor: [0, 0]
268
      })
269
      this.alarmPoint = Ai.Point([29.86089241772908, 122.09930419921876], {icon: icon})
270
      this.alarmPoint.on('click', (e) => {
271
        console.log(e)
272
        var content = '<div class="tips-item"><div class="top"><div class="user-pic"><t-icon icon="user-outline"></t-icon></div><div>张三</div><div class="hand-alarm">救援人员</div></div><div class="middle"><div class="row">' +
273
            '<div>终端编号</div>' +
274
            '<div>ZDBH0001</div>' +
275
          '</div>' +
276
          '<div class="row">' +
277
            '<div>最新定位时间</div>' +
278
            '<div>2020.08.13 08:24:32</div>' +
279
          '</div></div></div>'
280
        var popup = Ai.Popup({minWidth: 300, offset: [0, -10], autoClose: false})
281
        // 设置弹出框弹出位置
282
          .setLatLng({lat: 29.86089241772908, lng: 122.09930419921876})
283
        // 设置弹出框弹出内容
284
          .setContent(content)
285
          .openOn(this.map)
286
      })
287
      this.map.addLayer(this.alarmPoint)
288
      this.rescuePoint = Ai.Point([29.388158098102554, 122.45361328125], {icon: Ai.Icon({
289
      // 设置图标URL路径
290
        iconUrl: '/static/images/worker.png',
291
        // 设置图标大小
292
        iconSize: [20, 20],
293
        // 设置点对象和图标的相对偏移量
294
        iconAnchor: [0, 0]
295
      })})
296
      this.rescuePoint.on('click', (e) => {
297
        console.log(e)
298
        var content = '<div class="tips-item"><div class="top"><div class="user-pic"><t-icon icon="user-outline"></t-icon></div><div>张三</div><div class="alarm">报警人员</div></div><div class="middle"><div class="row">' +
299
            '<div>终端编号</div>' +
300
            '<div>ZDBH0001</div>' +
301
          '</div>' +
302
          '<div class="row">' +
303
            '<div>最新定位时间</div>' +
304
            '<div>2020.08.13 08:24:32</div>' +
305
          '</div></div></div>'
306
        var popup = Ai.Popup({minWidth: 300, offset: [0, -10], autoClose: false})
307
        // 设置弹出框弹出位置
308
          .setLatLng({lat: 29.388158098102554, lng: 122.45361328125})
309
        // 设置弹出框弹出内容
310
          .setContent(content)
311
          .openOn(this.map)
312
      })
313
      this.map.addLayer(this.rescuePoint)
314
      var lineWktstr = 'LINESTRING ( 122.09930419921876 29.86089241772908,122.18582153320314 29.6913335169976,122.21878051757814 29.42494595179543,122.45361328125 29.388158098102554)'
315
      this.polyline = Ai.Polyline(lineWktstr, {color: 'red'})
316
      this.map.addLayer(this.polyline)
317
      this.map.on('click', function(evt) {
318
        var lat = evt.latlng.lat // 点击地图时的纬度
319
        var lng = evt.latlng.lng // 点击地图时的经度
320
        console.log(lng, lat)
321
      })
322
    },
323
    deleteHistory(row) {
324
      console.log(1)
325
      this.$Confirm.confirm({
326
        title: '确认要删除改历史报警吗?',
327
        content: '删除后不可恢复',
328
        ok: () => {
329
          console.log('点击了确定')
330
        },
331
        cancel: () => {
332
          console.log('点击了取消')
333
        }
334
      })
305 335
    }
306 336
  }
307 337
}

+ 83 - 8
ebc-middle-platform/src/modules/orientation/orientation.scss

@ -11,11 +11,17 @@
11 11
    }
12 12
    .oparate-btn{
13 13
      position: absolute;
14
      float: left;
15
      margin-top: -450px;
16 14
      z-index: 10;
15
      left:40px;
16
      top: 120px;
17
      bottom: 0;
18
      margin: auto;
19
      height: 60px;
17 20
    }
18 21
}
22
.tabs-content{
23
  height: 100%;
24
}
19 25
20 26
.demo__slipbox .slipbox__header{
21 27
    text-align: left;
@ -44,12 +50,81 @@
44 50
  padding: 10px;
45 51
46 52
}
47
  .normalCss{
48
    border-color: rgba(141, 138, 138, 0.63);
49
    border-width:0.5px;
50
  }
51
  .moveCss{
52
    border-color: #19bb20;
53
.normalCss{
54
  border-color: rgba(141, 138, 138, 0.63);
55
  border-width:0.5px;
56
}
57
.moveCss{
58
  border-color: #19bb20;
53 59
60
}
61
.tips-item{
62
  // width: 300px;
63
  // margin: 10px 30px;
64
  // border: 1px solid #E0E0E0;
65
  border-radius: 5px;
66
  background: #344979;
67
  .top{
68
    display: flex;
69
    border-bottom: 1px solid #99A3BA;
70
    height: 40px;
71
    line-height: 40px;
72
    padding-left: 20px;
73
    font-size: 12px;
74
    color: #ffffff;
75
    .user-pic{
76
      width: 25px;
77
      height: 25px;
78
      border-radius: 50%;
79
      background-image: url('/static/images/user.png');
80
      background-size: 100% 100%;
81
      margin: 7.5px 5px 0 0;
82
    }
83
    .alarm{
84
      color: #F5222D;
85
      background-color: #343E6B;
86
      margin: 7.5px 0 0 5px;
87
      padding: 0 5px;
88
      font-size: 8px;
89
      height: 25px;
90
      line-height: 25px;
91
    }
92
    .hand-alarm{
93
      color: #FAAD14;
94
      background-color:#495571;
95
      margin: 7.5px 0 0 5px;
96
      padding: 0 5px;
97
      font-size: 8px;
98
      height: 25px;
99
      line-height: 25px;
100
    }
101
  }
102
  .middle{
103
    padding-left: 20px;
104
    line-height: 30px;
105
    font-size: 10px;
106
    color: #ffffff;
107
    .row{
108
      display: flex;
109
      margin: 0;
110
      justify-content: space-between;
111
      >div{
112
        flex: 1;
113
        text-align: left;
114
      }
115
    }
54 116
  }
117
  .footer{
118
    height: 40px;
119
    border-top: 1px solid #E0E0E0;
120
    display: flex;
121
    justify-content: flex-end;
122
    button{
123
      height: 25px;
124
      line-height: 25px;
125
      margin: 7.5px 10px 0 0;
126
    }
127
  }
128
}
129
  
55 130
  

+ 54 - 20
ebc-middle-platform/src/modules/orientation/orientation.vue

@ -35,9 +35,9 @@
35 35
          <div class="slipbox__header"></div>
36 36
        </template>
37 37
        <template>
38
          <t-tabs>
39
            <t-tab-panel label="全部" panel-id="tab-1">
40
              <t-scroll-bar style="height:550px;" :auto-hide="false">
38
          <t-tabs style="height:100%">
39
            <t-tab-panel label="全部" panel-id="tab-1" style="height:100%;">
40
              <t-scroll-bar style="height:100%;" :auto-hide="false">
41 41
                <ul style="padding-left: 0px;">
42 42
                  <li
43 43
                    class="liCss"
@ -76,7 +76,7 @@
76 76
              </t-scroll-bar>
77 77
            </t-tab-panel>
78 78
            <t-tab-panel label="在线" panel-id="tab-2" icon="home">
79
              <t-scroll-bar style="height:550px;" :auto-hide="false">
79
              <t-scroll-bar  style="height:100%" :auto-hide="false">
80 80
                <ul style="padding-left: 0px;">
81 81
                  <li
82 82
                    class="liCss"
@ -114,8 +114,8 @@
114 114
                </ul>
115 115
              </t-scroll-bar>
116 116
            </t-tab-panel>
117
            <t-tab-panel label="SOS" panel-id="tab-3" icon="home">
118
              <t-scroll-bar style="height:550px;" :auto-hide="false">
117
            <t-tab-panel label="SOS" panel-id="tab-3" icon="home" style="height:100%;">
118
              <t-scroll-bar style="height:100%;" :auto-hide="false">
119 119
                <ul style="padding-left: 0px;">
120 120
                  <li
121 121
                    class="liCss"
@ -153,8 +153,8 @@
153 153
                </ul>
154 154
              </t-scroll-bar>
155 155
            </t-tab-panel>
156
            <t-tab-panel label="离线" panel-id="tab-4" icon="home">
157
              <t-scroll-bar style="height:550px;" :auto-hide="false">
156
            <t-tab-panel label="离线" panel-id="tab-4" icon="home" >
157
              <t-scroll-bar style="height:100%" :auto-hide="false">
158 158
                <ul style="padding-left: 0px;">
159 159
                  <li
160 160
                    class="liCss"
@ -197,25 +197,26 @@
197 197
      </t-slipbox>
198 198
    </div>
199 199
    <div class="oparate-btn">
200
      <t-button v-if="visible" color="info" icon="left-circle-outline" @click.native="hideSlip"></t-button>
201
      <t-button v-else color="info" icon="right-circle-outline" @click.native="showSlip"></t-button>
200
      <t-button v-if="visible" color="info"  style="height:60px" icon="left-circle-outline" @click.native="hideSlip"></t-button>
201
      <t-button v-else color="info" icon="right-circle-outline" style="height:60px" @click.native="showSlip"></t-button>
202 202
    </div>
203 203
  </div>
204 204
</template>
205 205
206 206
<script>
207 207
import "./orientation.scss";
208
import { forEach, filter } from "lodash";
208
import { forEach, filter , find} from "lodash";
209 209
export default {
210 210
  data() {
211 211
    return {
212 212
      map: null,
213
      pointsarr:[],
213
      pointsarr:null,
214 214
      polylinearr: "122.0352 32.4444,122.0372 32.4444,122.0400 32.4366,122.2922 32.4233",
215 215
      polygonarr: "122.2302 32.5444,122.2302 32.3444, 122.4302 32.3444,122.4302 32.6044,122.2302 32.5444",
216
      popup:null,
216 217
      visible: true,
217 218
      shadow: false,
218
      styls: { width: "400px", height: "600px", margin: "120px 0 0 75px" },
219
      styls: { width: "400px", height: "70%", margin: "120px 0 0 75px" },
219 220
      clickActiveName: "",
220 221
      moveActiveName: "",
221 222
      dataList: [
@ -260,7 +261,7 @@ export default {
260 261
          number: "ZDBH0004",
261 262
          type: "离线",
262 263
          Longitude: "32.555",
263
          latitude: "122.0752",
264
          latitude: "121.0752",
264 265
          alarmTime: "2020.7.10 08:21:43",
265 266
          newMarkerTime: "2020.7.10 08:21:43",
266 267
          rescuePerson: "海事局A",
@ -304,6 +305,7 @@ export default {
304 305
    this.pointsSet();
305 306
    this.polyline();
306 307
    this.polygon();
308
     this.map.setZoom(9);
307 309
  },
308 310
  methods: {
309 311
    initMap(value) {
@ -311,20 +313,24 @@ export default {
311 313
        this.map.remove();
312 314
      }
313 315
      this.map = new Ai.Map("div1", {
314
        ak: "MTYwMTEMTAwMU1UWXdNVEV3TXpRek16STVOU014TnpRdw__",
316
        ak: "MTYwMTIMTAwMU1UWXdNVEkxTnpNMk16ZzBPU014TnpRdw__",
317
        center:[39.915599, 122.406568],
318
        
315 319
      });
316 320
      var maplayer = null;
317 321
      maplayer = Ai.TileLayer("http://192.168.74.189:9999/tdtvector");
318 322
      var la = Ai.WMTSLayer('http://192.168.74.216:5071/gisserver/dzht:dzht/wmts');
319 323
      this.map.addLayer(maplayer);
320 324
      this.map.addLayer(la);
321
      this.map.setView([39.915599, 122.406568], 3); //地图定位
325
      
326
      Ai.Scale({position:"bottomright"}).addTo(this.map);
327
      Ai.Zoom({type:"small"}).addTo(this.map);
322 328
    },
323 329
    pointsSet() {
324 330
      var arr = [];
325
      var pointsLayer= new Ai.LayerGroup();
331
      this.pointsLayer= new Ai.FeatureGroup();
326 332
      var icon = (icon = Ai.IconPulse({ iconSize: [13, 13] }));
327
      forEach(this.dataList, function (value) {
333
      forEach(this.dataList, (value)=>{
328 334
        var point1;
329 335
        if (value.type == "落水告警") {
330 336
          point1 = new Ai.Point([value.Longitude, value.latitude], {
@ -334,11 +340,11 @@ export default {
334 340
          point1 = new Ai.Point([value.Longitude, value.latitude]);
335 341
        }
336 342
337
        pointsLayer.addLayer(point1);
343
        this.pointsLayer.addLayer(point1);
338 344
        arr.push(point1);
339 345
        //this.pointsarr.push(point1);
340 346
      });
341
      this.map.addLayer(pointsLayer);
347
      this.map.addLayer(this.pointsLayer);
342 348
      this.map.fitBoundsForLayers(arr);
343 349
    },
344 350
    polyline() {
@ -367,10 +373,38 @@ export default {
367 373
    showSlip() {
368 374
      this.visible = true;
369 375
    },
376
    showPopup(number){
377
      if (this.popup != null && this.popup != "") {
378
              this.popup.closePopup();
379
              this.popup.remove();
380
      }
381
      var data=find(this.dataList,  (o)=> {
382
        return o.number == number;
383
      });
384
      if(data!=null&&data!="")
385
      {
386
        var content = '<div class="tips-item"><div class="top"><div class="user-pic"><t-icon icon="user-outline"></t-icon></div><div>'+data.name+'</div><div class="hand-alarm">'+data.type+'</div></div><div class="middle"><div class="row">' +
387
            '<div>终端编号</div>' +
388
            '<div>'+data.number+'</div>' +
389
          '</div>' +
390
          '<div class="row">' +
391
            '<div>最新定位时间</div>' +
392
            '<div>'+data.newMarkerTime+'</div>' +
393
          '</div></div></div>'
394
         this.popup = Ai.Popup({minWidth: 300, offset: [0, -10], autoClose: false})
395
        // 设置弹出框弹出位置
396
          .setLatLng({lat: data.Longitude, lng: data.latitude})
397
        // 设置弹出框弹出内容
398
          .setContent(content)
399
          .openOn(this.map)
400
401
      }
402
    },
370 403
    hideSlip() {
371 404
      this.visible = false;
372 405
    },
373 406
    changeColor(number) {
407
      this.showPopup(number);
374 408
      this.clickActiveName = number;
375 409
    },
376 410
    changeMoveColor(number) {

+ 6 - 8
ebc-middle-platform/src/modules/system-management/equipment-management.scss

@ -1,4 +1,4 @@
1
.track-container{
1
.equipment-container{
2 2
  width: 97%;
3 3
  margin: 20px auto;
4 4
  padding: 20px;
@ -11,18 +11,13 @@
11 11
      overflow: hidden;
12 12
      margin: 0;
13 13
      padding: 0;
14
      position: relative;
15 14
      display: flex;
16
      justify-content: space-between;
15
      position: relative;
16
      justify-content: flex-start;
17 17
      >div{
18 18
        display: flex; 
19 19
        margin: 0 20px 16px 0;    
20 20
        line-height: 2;
21
        .label-content{
22
          display: flex; 
23
          margin: 0 20px 16px 0;    
24
          line-height: 2;
25
        }
26 21
        .input-rule{
27 22
          flex: 1;
28 23
          margin:0 0 0 20px;
@ -31,6 +26,9 @@
31 26
          }
32 27
        }
33 28
      }
29
      .label{
30
        min-width: 30px;
31
      }
34 32
      .btns button{
35 33
        margin: 0 2px;
36 34
      }

+ 31 - 31
ebc-middle-platform/src/modules/system-management/equipment-management.vue

@ -1,43 +1,43 @@
1 1
<template>
2
  <div class="track-container">
2
  <div class="equipment-container">
3 3
    <div class="search-container">
4 4
      <div class="search-ctn">
5 5
        <div>
6
          <div class="label-content">
7
            <div class="label">设备类型:</div>
8
            <div class="input-rule">
9
              <t-select v-model="queryCondition.alarmPerson" width="200" placeholder="请输入...">
10
                <t-option>张三</t-option>
11
                <t-option>李四</t-option>
12
              </t-select>
13
            </div>
6
          <div class="label">设备类型:</div>
7
          <div class="input-rule">
8
            <t-select v-model="queryCondition.alarmPerson" width="200" placeholder="请输入...">
9
              <t-option>张三</t-option>
10
              <t-option>李四</t-option>
11
            </t-select>
14 12
          </div>
15
          <div class="label-content">
16
            <div class="label">设备名称:</div>
17
            <div class="input-rule">
18
              <t-select v-model="queryCondition.alarmPerson" width="200" placeholder="请输入...">
19
                <t-option>张三</t-option>
20
                <t-option>李四</t-option>
21
              </t-select>
22
            </div>
23
          </div>
24
          <div class="label-content">
25
            <div class="label">设备编号:</div>
26
            <div class="input-rule">
27
              <t-select v-model="queryCondition.alarmPerson" width="200" placeholder="请输入...">
28
                <t-option>张三</t-option>
29
                <t-option>李四</t-option>
30
              </t-select>
31
            </div>
13
        </div>
14
        <div>
15
          <div class="label">设备名称:</div>
16
          <div class="input-rule">
17
            <t-select v-model="queryCondition.alarmPerson" width="200" placeholder="请输入...">
18
              <t-option>张三</t-option>
19
              <t-option>李四</t-option>
20
            </t-select>
32 21
          </div>
33
          <div class="btns">
34
            <t-button color="secondary" class="reset-btn" @click="onReset">重置</t-button>
35
            <t-button color="success" icon="search-outline" @click="onSearch">查询</t-button>
36
            <t-button color="secondary" icon="upload-outline" @click="toExport">导出至Excel</t-button>
37
            <t-button color="secondary" icon="delete-outline" @click="toExport">删除</t-button>
22
        </div>
23
        <div>
24
          <div class="label">设备编号:</div>
25
          <div class="input-rule">
26
            <t-select v-model="queryCondition.alarmPerson" width="200" placeholder="请输入...">
27
              <t-option>张三</t-option>
28
              <t-option>李四</t-option>
29
            </t-select>
38 30
          </div>
39 31
        </div>
40 32
        <div class="btns">
33
          <t-button color="secondary" class="reset-btn" @click="onReset">重置</t-button>
34
          <t-button color="success" icon="search-outline" @click="onSearch">查询</t-button>
35
          <t-button color="secondary" icon="upload-outline" @click="toExport">导出至Excel</t-button>
36
          <t-button color="secondary" icon="delete-outline" @click="toExport">删除</t-button>
37
        </div>
38
      </div>
39
      <div class="search-ctn" style="justify-content: flex-end;">
40
        <div class="btns">
41 41
          <t-button color="success" icon="upload-outline" @click="onReset">导入</t-button>
42 42
          <t-button color="success" icon="download-outline" @click="onReset">下载模板</t-button>
43 43
          <t-button color="success" icon="plus-outline" @click="addEquipment">新增</t-button>

+ 2 - 2
ebc-middle-platform/src/modules/system-management/map-mark.vue

@ -49,7 +49,7 @@
49 49
               @on-change="onPagerChange">
50 50
      </t-pager>
51 51
    </div>
52
    <t-modal :visibled.sync="addMark" :ok="submitMark" :cancel="cancel" class="modal" title="新增标记" ok-text="保存" width="1500px" >
52
    <t-modal :visibled.sync="addMark" :ok="submitMark" :cancel="cancel" class="modal" title="新增标记" ok-text="保存" width="80%" >
53 53
      <div class="top">
54 54
        <div>
55 55
          <div class="label">标记类型:</div>
@ -164,7 +164,7 @@ export default {
164 164
  },
165 165
  mounted() {
166 166
    this.map = new Ai.Map('modalMap', {
167
      ak: 'MTYwMDkMTAwMU1UWXdNRGs1T0RZeE1EZzNPU014TnpRdw__',
167
      ak: 'MTYwMTMMTAwMU1UWXdNVE0wTlRNMU16WTBNeU14TnpRdw__',
168 168
      center: [39.915599, 116.406568],
169 169
      zoom: 5
170 170
    })

+ 3 - 0
ebc-middle-platform/src/modules/system-management/terminal-management.scss

@ -25,6 +25,9 @@
25 25
          }
26 26
        }
27 27
      }
28
      .label{
29
        width: 60px;
30
      }
28 31
      .btns button{
29 32
        margin: 0 2px;
30 33
      }

+ 83 - 3
ebc-middle-platform/src/modules/system-management/terminal-management.vue

@ -27,6 +27,8 @@
27 27
          <t-button color="secondary" icon="unlock-outline" @click="toExport">解绑用户</t-button>
28 28
          <t-button color="secondary" icon="delete-outline" @click="toExport">删除</t-button>
29 29
        </div>
30
      </div>
31
      <div class="search-ctn" style="justify-content: flex-end;">
30 32
        <div class="btns">
31 33
          <t-button color="success" icon="upload-outline" @click="onReset">导入</t-button>
32 34
          <t-button color="success" icon="download-outline" @click="onReset">下载模板</t-button>
@ -60,10 +62,10 @@
60 62
          width="220"
61 63
        >
62 64
          <template slot-scope="scope">
63
            <a href="javascript:void(0)" size="sm" @click="handleClick(scope.row)">关联用户</a>
64
            <a href="javascript:void(0)" size="sm" @click="remove(scope.$index)">解绑用户</a>
65
            <a href="javascript:void(0)" size="sm" @click="() => {relevance = true}">关联用户</a>
66
            <a href="javascript:void(0)" size="sm" @click="solution(scope.$index)">解绑用户</a>
65 67
            <a href="javascript:void(0)" size="sm" @click="handleClick(scope.row)">编辑</a>
66
            <a href="javascript:void(0)" size="sm" @click="remove(scope.$index)">删除</a>
68
            <a href="javascript:void(0)" size="sm" @click="delete(scope.$index)">删除</a>
67 69
          </template>
68 70
        </t-table-column>
69 71
      </t-table>
@ -95,6 +97,32 @@
95 97
        <t-button class="submit-button" @click="submit">保存</t-button>
96 98
      </div>
97 99
    </t-modal>
100
    <t-modal :visibled.sync="relevance" title="关联用户" >
101
      <div>
102
        <t-form ref="relevanceValidate" :model="relevanceValidate" :rules="relevanceRuleValidate" :label-width="80" label-position="left">
103
          <t-form-item label="终端编号" prop="number">
104
            <div>ZDBH002</div>
105
          </t-form-item>
106
          <t-form-item label="关联用户" prop="user">
107
            <div class="row">
108
              <div class="col-9">
109
                <t-form-item>
110
                  <t-select v-model="relevanceValidate.user" placeholder="请选择">
111
                    <t-option>张三</t-option>
112
                    <t-option>李四</t-option>
113
                  </t-select>
114
                </t-form-item>
115
              </div>
116
              <div class="col-3">
117
                <t-form-item>
118
                  <t-button>新增</t-button>
119
                </t-form-item>
120
              </div>
121
            </div>
122
          </t-form-item>
123
        </t-form>
124
      </div>
125
    </t-modal>
98 126
  </div>
99 127
</template>
100 128
<script>
@ -170,6 +198,34 @@ export default {
170 198
            }
171 199
          }
172 200
        ]
201
      },
202
      relevance: false,
203
      relevanceValidate: {
204
        user: ''
205
      },
206
      relevanceRuleValidate: {
207
        user: [
208
          {
209
            required: true,
210
            message: '编号不能为空',
211
            trigger: 'blur'
212
          },
213
          {
214
            message: '张三已关联终端ZDBH001,点击保存更改关联关系',
215
            trigger: 'blur',
216
            validator: function(rule, value, callback) {
217
              if (!/^[a-zA-Z0-9-_#]+$/.test(value)) {
218
                callback(rule.message)
219
              } else {
220
                // TODO 判断编号重复
221
                if (true) {
222
                  rule.message = '编号重复'
223
                  callback(rule.message)
224
                }
225
              }
226
            }
227
          }
228
        ]
173 229
      }
174 230
    }
175 231
  },
@ -215,6 +271,30 @@ export default {
215 271
          this.$Message.danger('表单验证失败!')
216 272
        }
217 273
      })
274
    },
275
    solution(row) {
276
      this.$Confirm.confirm({
277
        title: '确认要解除终端ZDBH001和张三的关联关系吗?',
278
        content: '解绑后将不可通过终端ZDH001获取张三的定位信息',
279
        ok: () => {
280
          console.log('点击了确定')
281
        },
282
        cancel: () => {
283
          console.log('点击了取消')
284
        }
285
      })
286
    },
287
    delete(row) {
288
      this.$Confirm.confirm({
289
        title: '确认要删除终端ZDBH001吗?',
290
        content: '删除后不可恢复',
291
        ok: () => {
292
          console.log('点击了确定')
293
        },
294
        cancel: () => {
295
          console.log('点击了取消')
296
        }
297
      })
218 298
    }
219 299
  }
220 300
}

+ 1 - 1
ebc-middle-platform/src/modules/system-management/user-management.scss

@ -1,4 +1,4 @@
1
.track-container{
1
.user-container{
2 2
  width: 97%;
3 3
  margin: 20px auto;
4 4
  padding: 20px;

+ 85 - 5
ebc-middle-platform/src/modules/system-management/user-management.vue

@ -1,5 +1,5 @@
1 1
<template>
2
  <div class="track-container">
2
  <div class="user-container">
3 3
    <div class="search-container">
4 4
      <div class="search-ctn">
5 5
        <div>
@ -37,6 +37,8 @@
37 37
            <t-button color="secondary" icon="delete-outline" @click="toExport">删除</t-button>
38 38
          </div>
39 39
        </div>
40
      </div>
41
      <div class="search-ctn" style="justify-content: flex-end;">
40 42
        <div class="btns">
41 43
          <t-button color="success" icon="upload-outline" @click="onReset">导入</t-button>
42 44
          <t-button color="success" icon="download-outline" @click="onReset">下载模板</t-button>
@ -59,13 +61,13 @@
59 61
          width="240"
60 62
        >
61 63
          <template slot-scope="scope">
62
            <a href="javascript:void(0)" size="sm" @click="handleClick(scope.row)">关联终端</a>
64
            <a href="javascript:void(0)" size="sm" @click="() => {relevance = true}">关联终端</a>
63 65
            <span class="mod-line">|</span>
64
            <a href="javascript:void(0)" size="sm" @click="remove(scope.$index)">解绑终端</a>
66
            <a href="javascript:void(0)" size="sm" @click="solution(scope.$index)">解绑终端</a>
65 67
            <span class="mod-line">|</span>
66 68
            <a href="javascript:void(0)" size="sm" @click="handleClick(scope.row)">编辑</a>
67 69
            <span class="mod-line">|</span>
68
            <a href="javascript:void(0)" size="sm" @click="remove(scope.$index)">删除</a>
70
            <a href="javascript:void(0)" size="sm" @click="delete(scope.$index)">删除</a>
69 71
          </template>
70 72
        </t-table-column>
71 73
      </t-table>
@ -78,7 +80,7 @@
78 80
               @on-change="onPagerChange">
79 81
      </t-pager>
80 82
    </div>
81
    <t-modal :visibled.sync="modal" title="新增设备" >
83
    <t-modal :visibled.sync="modal" title="新增用户" >
82 84
      <t-form ref="formValidate" :model="formValidate" :rules="ruleValidate" :label-width="80" label-position="left">
83 85
        <t-form-item label="姓名" prop="name">
84 86
          <t-input v-model="formValidate.name" placeholder="请输入风机名称"></t-input>
@ -112,6 +114,32 @@
112 114
        <t-button class="submit-button" @click="submit">保存</t-button>
113 115
      </div>
114 116
    </t-modal>
117
    <t-modal :visibled.sync="relevance" title="关联终端" >
118
      <div>
119
        <t-form ref="relevanceValidate" :model="relevanceValidate" :rules="relevanceRuleValidate" :label-width="80" label-position="left">
120
          <t-form-item label="姓名" prop="number">
121
            <div>李四</div>
122
          </t-form-item>
123
          <t-form-item label="关联终端" prop="terminal">
124
            <div class="row">
125
              <div class="col-9">
126
                <t-form-item>
127
                  <t-select v-model="relevanceValidate.terminal" placeholder="请选择">
128
                    <t-option>张三</t-option>
129
                    <t-option>李四</t-option>
130
                  </t-select>
131
                </t-form-item>
132
              </div>
133
              <div class="col-3">
134
                <t-form-item>
135
                  <t-button>新增</t-button>
136
                </t-form-item>
137
              </div>
138
            </div>
139
          </t-form-item>
140
        </t-form>
141
      </div>
142
    </t-modal>
115 143
  </div>
116 144
</template>
117 145
<script>
@ -242,6 +270,34 @@ export default {
242 270
            }
243 271
          }
244 272
        ]
273
      },
274
      relevance: false,
275
      relevanceValidate: {
276
        terminal: ''
277
      },
278
      relevanceRuleValidate: {
279
        terminal: [
280
          {
281
            required: true,
282
            message: '编号不能为空',
283
            trigger: 'blur'
284
          },
285
          {
286
            message: '张三已关联终端ZDBH001,点击保存更改关联关系',
287
            trigger: 'blur',
288
            validator: function(rule, value, callback) {
289
              if (!/^[a-zA-Z0-9-_#]+$/.test(value)) {
290
                callback(rule.message)
291
              } else {
292
                // TODO 判断编号重复
293
                if (true) {
294
                  rule.message = '编号重复'
295
                  callback(rule.message)
296
                }
297
              }
298
            }
299
          }
300
        ]
245 301
      }
246 302
    }
247 303
  },
@ -282,6 +338,30 @@ export default {
282 338
    },
283 339
    addUser() {
284 340
      this.modal = true
341
    },
342
    solution(row) {
343
      this.$Confirm.confirm({
344
        title: '确认要解除张三和终端ZDBH001的关联关系吗?',
345
        content: '解绑后将不可通过终端ZDH001获取张三的定位信息',
346
        ok: () => {
347
          console.log('点击了确定')
348
        },
349
        cancel: () => {
350
          console.log('点击了取消')
351
        }
352
      })
353
    },
354
    delete(row) {
355
      this.$Confirm.confirm({
356
        title: '确认要删除用户张三吗?',
357
        content: '删除后不可恢复',
358
        ok: () => {
359
          console.log('点击了确定')
360
        },
361
        cancel: () => {
362
          console.log('点击了取消')
363
        }
364
      })
285 365
    }
286 366
  }
287 367
}