Commit ce5eaf94 by zhangxw

图标替换

1 parent 2f6b9d9c
...@@ -3,8 +3,8 @@ module.exports = function (data) { ...@@ -3,8 +3,8 @@ module.exports = function (data) {
const shared = const shared =
`.icon {display: inline-block;background-image: url(I);background-size: Wpx Hpx;}` `.icon {display: inline-block;background-image: url(I);background-size: Wpx Hpx;}`
.replace("I", data.sprites[0].image) .replace("I", data.sprites[0].image)
.replace("W", data.sprites[0].total_width) .replace("W", data.sprites[0].total_width / 2)
.replace("H", data.sprites[0].total_height); .replace("H", data.sprites[0].total_height / 2);
const perSprite = data.sprites const perSprite = data.sprites
.map(function (sprite) { .map(function (sprite) {
...@@ -16,10 +16,10 @@ module.exports = function (data) { ...@@ -16,10 +16,10 @@ module.exports = function (data) {
return style return style
.replace(/N/g, sprite.name) .replace(/N/g, sprite.name)
.replace(/A/g, sprite.name.replace(/\-active$/g, "")) .replace(/A/g, sprite.name.replace(/\-active$/g, ""))
.replace(/W/g, sprite.width) .replace(/W/g, sprite.width / 2)
.replace(/H/g, sprite.height) .replace(/H/g, sprite.height / 2)
.replace(/X/g, sprite.offset_x) .replace(/X/g, sprite.offset_x / 2)
.replace(/Y/g, sprite.offset_y); .replace(/Y/g, sprite.offset_y / 2);
}) })
.join("\n"); .join("\n");
......

768 Bytes | W: | H:

1.55 KB | W: | H:

src/assets/icon/copy.png
src/assets/icon/copy.png
src/assets/icon/copy.png
src/assets/icon/copy.png
  • 2-up
  • Swipe
  • Onion skin

218 Bytes | W: | H:

423 Bytes | W: | H:

src/assets/icon/device.png
src/assets/icon/device.png
src/assets/icon/device.png
src/assets/icon/device.png
  • 2-up
  • Swipe
  • Onion skin

720 Bytes | W: | H:

1.48 KB | W: | H:

src/assets/icon/loc-icon.png
src/assets/icon/loc-icon.png
src/assets/icon/loc-icon.png
src/assets/icon/loc-icon.png
  • 2-up
  • Swipe
  • Onion skin

491 Bytes | W: | H:

1.13 KB | W: | H:

src/assets/icon/locate-sm.png
src/assets/icon/locate-sm.png
src/assets/icon/locate-sm.png
src/assets/icon/locate-sm.png
  • 2-up
  • Swipe
  • Onion skin

656 Bytes | W: | H:

1.31 KB | W: | H:

src/assets/icon/location.png
src/assets/icon/location.png
src/assets/icon/location.png
src/assets/icon/location.png
  • 2-up
  • Swipe
  • Onion skin

853 Bytes | W: | H:

1.74 KB | W: | H:

src/assets/icon/navgation.png
src/assets/icon/navgation.png
src/assets/icon/navgation.png
src/assets/icon/navgation.png
  • 2-up
  • Swipe
  • Onion skin

1.71 KB | W: | H:

3.65 KB | W: | H:

src/assets/icon/off-car.png
src/assets/icon/off-car.png
src/assets/icon/off-car.png
src/assets/icon/off-car.png
  • 2-up
  • Swipe
  • Onion skin

453 Bytes | W: | H:

1.05 KB | W: | H:

src/assets/icon/offline-time.png
src/assets/icon/offline-time.png
src/assets/icon/offline-time.png
src/assets/icon/offline-time.png
  • 2-up
  • Swipe
  • Onion skin

1.61 KB | W: | H:

3.52 KB | W: | H:

src/assets/icon/on-car.png
src/assets/icon/on-car.png
src/assets/icon/on-car.png
src/assets/icon/on-car.png
  • 2-up
  • Swipe
  • Onion skin

389 Bytes | W: | H:

834 Bytes | W: | H:

src/assets/icon/online-time.png
src/assets/icon/online-time.png
src/assets/icon/online-time.png
src/assets/icon/online-time.png
  • 2-up
  • Swipe
  • Onion skin

378 Bytes | W: | H:

743 Bytes | W: | H:

src/assets/icon/put-away.png
src/assets/icon/put-away.png
src/assets/icon/put-away.png
src/assets/icon/put-away.png
  • 2-up
  • Swipe
  • Onion skin

679 Bytes | W: | H:

1.34 KB | W: | H:

src/assets/icon/refresh-car.png
src/assets/icon/refresh-car.png
src/assets/icon/refresh-car.png
src/assets/icon/refresh-car.png
  • 2-up
  • Swipe
  • Onion skin

1.16 KB | W: | H:

2.54 KB | W: | H:

src/assets/icon/replay-pause.png
src/assets/icon/replay-pause.png
src/assets/icon/replay-pause.png
src/assets/icon/replay-pause.png
  • 2-up
  • Swipe
  • Onion skin

1.01 KB | W: | H:

2.32 KB | W: | H:

src/assets/icon/replay-play.png
src/assets/icon/replay-play.png
src/assets/icon/replay-play.png
src/assets/icon/replay-play.png
  • 2-up
  • Swipe
  • Onion skin

1.38 KB | W: | H:

3.17 KB | W: | H:

src/assets/icon/replay-refresh.png
src/assets/icon/replay-refresh.png
src/assets/icon/replay-refresh.png
src/assets/icon/replay-refresh.png
  • 2-up
  • Swipe
  • Onion skin

522 Bytes | W: | H:

1.21 KB | W: | H:

src/assets/icon/setting-btn.png
src/assets/icon/setting-btn.png
src/assets/icon/setting-btn.png
src/assets/icon/setting-btn.png
  • 2-up
  • Swipe
  • Onion skin

434 Bytes | W: | H:

916 Bytes | W: | H:

src/assets/icon/typeList.png
src/assets/icon/typeList.png
src/assets/icon/typeList.png
src/assets/icon/typeList.png
  • 2-up
  • Swipe
  • Onion skin
.icon {display: inline-block;background-image: url(sprite.png);background-size: 232px 186px;}
.icon-begin { width: 52px; height: 72px; background-position: -68px 0px; }
.icon-checked { width: 20px; height: 20px; background-position: -150px -156px; }
.icon-copy { width: 28px; height: 28px; background-position: -172px -112px; }
.icon-device { width: 14px; height: 14px; background-position: -64px -140px; }
.icon-loc-icon { width: 30px; height: 30px; background-position: 0px -156px; }
.icon-locate-sm { width: 14px; height: 14px; background-position: -78px -140px; }
.icon-location { width: 24px; height: 24px; background-position: -30px -156px; }
.icon-navgation { width: 28px; height: 28px; background-position: -200px -112px; }
.icon-off-car { width: 52px; height: 52px; background-position: -172px -60px; }
.icon-off-line { width: 20px; height: 20px; background-position: -170px -156px; }
.icon-offline-time { width: 14px; height: 14px; background-position: -92px -140px; }
.icon-on-car { width: 52px; height: 52px; background-position: -120px -80px; }
.icon-on-line { width: 24px; height: 24px; background-position: -54px -156px; }
.icon-online-time { width: 14px; height: 14px; background-position: -106px -140px; }
.icon-put-away { width: 64px; height: 16px; background-position: 0px -140px; }
.icon-refresh-car { width: 24px; height: 24px; background-position: -78px -156px; }
.icon-replay-pause { width: 60px; height: 60px; background-position: 0px -80px; }
.icon-replay-play { width: 60px; height: 60px; background-position: -60px -80px; }
.icon-replay-refresh { width: 60px; height: 60px; background-position: -172px 0px; }
.icon-resident { width: 52px; height: 72px; background-position: -120px 0px; }
.icon-screen-btn { width: 24px; height: 24px; background-position: -102px -156px; }
.icon-setting-btn { width: 24px; height: 24px; background-position: -126px -156px; }
.icon-share { width: 68px; height: 80px; background-position: 0px 0px; }
.icon-typeList { width: 14px; height: 14px; background-position: -120px -140px; }
\ No newline at end of file \ No newline at end of file
.icon {display: inline-block;background-image: url(sprite.png);background-size: 172px 172px;}
.icon-begin { width: 26px; height: 36px; background-position: 0px -136px; }
.icon-checked { width: 10px; height: 10px; background-position: -106px -120px; }
.icon-copy { width: 28px; height: 28px; background-position: -120px -92px; }
.icon-device { width: 14px; height: 14px; background-position: -154px -52px; }
.icon-loc-icon { width: 30px; height: 30px; background-position: -52px -136px; }
.icon-locate-sm { width: 14px; height: 14px; background-position: -154px -66px; }
.icon-location { width: 24px; height: 24px; background-position: -148px -92px; }
.icon-navgation { width: 28px; height: 28px; background-position: -82px -136px; }
.icon-off-car { width: 52px; height: 52px; background-position: -60px -60px; }
.icon-offline-time { width: 14px; height: 14px; background-position: -64px -120px; }
.icon-on-car { width: 52px; height: 52px; background-position: -120px 0px; }
.icon-online-time { width: 14px; height: 14px; background-position: -78px -120px; }
.icon-put-away { width: 64px; height: 16px; background-position: 0px -120px; }
.icon-refresh-car { width: 24px; height: 24px; background-position: -110px -136px; }
.icon-replay-pause { width: 60px; height: 60px; background-position: 0px 0px; }
.icon-replay-play { width: 60px; height: 60px; background-position: -60px 0px; }
.icon-replay-refresh { width: 60px; height: 60px; background-position: 0px -60px; }
.icon-resident { width: 26px; height: 36px; background-position: -26px -136px; }
.icon-screen-btn { width: 12px; height: 12px; background-position: -154px -80px; }
.icon-setting-btn { width: 24px; height: 24px; background-position: -134px -136px; }
.icon-share { width: 34px; height: 40px; background-position: -120px -52px; }
.icon-typeList { width: 14px; height: 14px; background-position: -92px -120px; }
\ No newline at end of file \ No newline at end of file

21.4 KB | W: | H:

36.4 KB | W: | H:

src/assets/spritesmith-generated/sprite.png
src/assets/spritesmith-generated/sprite.png
src/assets/spritesmith-generated/sprite.png
src/assets/spritesmith-generated/sprite.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -71,7 +71,6 @@ import popup from "@/components/popup.vue"; ...@@ -71,7 +71,6 @@ import popup from "@/components/popup.vue";
import AMapLoader from "@amap/amap-jsapi-loader"; import AMapLoader from "@amap/amap-jsapi-loader";
import { CONSTANT } from "../constant"; import { CONSTANT } from "../constant";
import { Toast, Dialog } from "vant"; import { Toast, Dialog } from "vant";
import ADCODE from "@/utils/adcode";
import { useRoute } from "vue-router"; import { useRoute } from "vue-router";
import "vant/es/toast/style"; import "vant/es/toast/style";
import { GET_CAR_LOCATION_INFO, ADD_FENCE } from "@/api/index"; import { GET_CAR_LOCATION_INFO, ADD_FENCE } from "@/api/index";
...@@ -186,13 +185,9 @@ export default defineComponent({ ...@@ -186,13 +185,9 @@ export default defineComponent({
} }
if (selectedTypeItem.value === 1 && proviceCityType.value) { if (selectedTypeItem.value === 1 && proviceCityType.value) {
getAdcodeByLatlng(currLnglat.value, (obj) => { getAdcodeByLatlng(currLnglat.value, (obj) => {
var adcodeItem = filterAdcodeObj(obj.adcode);
if (proviceCityType.value != adcodeItem.type) {
adcodeItem = filterAdcodeObj(adcodeItem.parentid);
}
ADD_FENCE({ ADD_FENCE({
shapeType: 4, shapeType: 4,
areaCode: adcodeItem.adcode, areaCode: obj.adcode,
lnglat: currLnglat.value.lng + "," + currLnglat.value.lat, lnglat: currLnglat.value.lng + "," + currLnglat.value.lat,
sn: routeQuery.sn, sn: routeQuery.sn,
}).then((res) => { }).then((res) => {
...@@ -200,8 +195,8 @@ export default defineComponent({ ...@@ -200,8 +195,8 @@ export default defineComponent({
Toast( Toast(
`设定${proviceCityType.value === 1 ? "跨省" : "跨市"}围栏成功` `设定${proviceCityType.value === 1 ? "跨省" : "跨市"}围栏成功`
); );
adcodeItemName.value = adcodeItem.name; adcodeItemName.value = obj.adName;
coverArea(adcodeItem.name, currentMap); coverArea(obj.adName, currentMap);
currentMap.setFitView(); currentMap.setFitView();
hasProviceCityFence.value = true; hasProviceCityFence.value = true;
} }
...@@ -249,12 +244,24 @@ export default defineComponent({ ...@@ -249,12 +244,24 @@ export default defineComponent({
if (geocoderValue.value) { if (geocoderValue.value) {
var lnglatXY = [currLnglat.lng, currLnglat.lat]; var lnglatXY = [currLnglat.lng, currLnglat.lat];
geocoderValue.value.getAddress(lnglatXY, function (status, result) { geocoderValue.value.getAddress(lnglatXY, function (status, result) {
var _adcode = ""; let _adcode = "";
let _adName = "";
if (status === "complete" && result.info === "OK") { if (status === "complete" && result.info === "OK") {
_adcode = result.regeocode.addressComponent.adcode; _adcode = result.regeocode.addressComponent.adcode;
_adcode = _adcode.substr(0, 4) + "00"; _adName =
proviceCityType.value == 1
? result.regeocode.addressComponent.province
: proviceCityType.value == 2
? result.regeocode.addressComponent.city
: "";
_adcode =
proviceCityType.value == 1
? _adcode.substr(0, 4) + "00"
: proviceCityType.value == 2
? _adcode.substr(0, 4) + "00"
: "";
} }
cb({ adcode: _adcode }); cb({ adcode: _adcode, adName: _adName });
}); });
} else { } else {
setTimeout(function () { setTimeout(function () {
...@@ -262,17 +269,6 @@ export default defineComponent({ ...@@ -262,17 +269,6 @@ export default defineComponent({
}, 500); }, 500);
} }
}; };
// 省市区code过滤
const filterAdcodeObj = (adcode) => {
adcode = adcode.toString().substr(0, 4) + "00";
for (var i = 0, len = ADCODE.length; i < len; i++) {
var item = ADCODE[i];
if (adcode == item.adcode) {
return item;
}
}
return null;
};
// 添加标记 // 添加标记
const drawMarker = (currLnglat) => { const drawMarker = (currLnglat) => {
new window.AMap.Marker({ new window.AMap.Marker({
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!