保存json文件到本地
This commit is contained in:
parent
82eff5bf84
commit
ce81a142a7
@ -4,7 +4,7 @@ NODE_ENV=development
|
|||||||
VITE_DEV=true
|
VITE_DEV=true
|
||||||
|
|
||||||
# 请求路径
|
# 请求路径
|
||||||
VITE_BASE_URL='http://192.168.0.74:48080'
|
VITE_BASE_URL='http://192.168.0.66:48080'
|
||||||
# VITE_BASE_URL='http://192.168.0.189:48080'
|
# VITE_BASE_URL='http://192.168.0.189:48080'
|
||||||
|
|
||||||
# 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持 S3 服务
|
# 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持 S3 服务
|
||||||
|
@ -99,7 +99,7 @@
|
|||||||
class="map-box-inner-dot"
|
class="map-box-inner-dot"
|
||||||
@click="mapClick"
|
@click="mapClick"
|
||||||
:class="state.isShowGrid ? 'grid-show' : ''"
|
:class="state.isShowGrid ? 'grid-show' : ''"
|
||||||
v-if="test"
|
v-if="interfaceRefreshed"
|
||||||
>
|
>
|
||||||
<VueDragResizeRotate
|
<VueDragResizeRotate
|
||||||
v-for="(item, index) in allHistoryList[currentIndex]"
|
v-for="(item, index) in allHistoryList[currentIndex]"
|
||||||
@ -209,10 +209,9 @@ const getMapData = async (item) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 缩放停止
|
// 缩放停止
|
||||||
const test = ref(true)
|
const interfaceRefreshed = ref(true)
|
||||||
|
|
||||||
const resizeEnd = (x, y, w, h, item, index) => {
|
const resizeEnd = (x, y, w, h, item, index) => {
|
||||||
test.value = false
|
interfaceRefreshed.value = false
|
||||||
console.log('缩放', w, h)
|
console.log('缩放', w, h)
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
imgList.value[index].x = x
|
imgList.value[index].x = x
|
||||||
@ -263,13 +262,8 @@ const addEditHistory = () => {
|
|||||||
} else {
|
} else {
|
||||||
allHistoryList.value.push(JSON.parse(JSON.stringify(imgList.value)))
|
allHistoryList.value.push(JSON.parse(JSON.stringify(imgList.value)))
|
||||||
currentIndex.value++
|
currentIndex.value++
|
||||||
console.log(currentIndex.value)
|
|
||||||
console.log(
|
|
||||||
allHistoryList.value[currentIndex.value][currentItemIndex.value],
|
|
||||||
allHistoryList.value[currentIndex.value][currentItemIndex.value]
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
test.value = true
|
interfaceRefreshed.value = true
|
||||||
console.log(allHistoryList.value, 'allHistoryList')
|
console.log(allHistoryList.value, 'allHistoryList')
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -544,6 +538,20 @@ const toolbarClick = (item) => {
|
|||||||
saveMap()
|
saveMap()
|
||||||
break
|
break
|
||||||
case 3:
|
case 3:
|
||||||
|
//另存为 存为json文件 无法直接访问用户的文件系统 不能选择存在那个文件夹里面
|
||||||
|
const jsonString = JSON.stringify(allHistoryList.value[currentIndex.value], null, 2)
|
||||||
|
const blob = new Blob([jsonString], { type: 'application/json' })
|
||||||
|
const url = URL.createObjectURL(blob)
|
||||||
|
|
||||||
|
const a = document.createElement('a')
|
||||||
|
a.href = url
|
||||||
|
a.download = 'mapJson.json'
|
||||||
|
document.body.appendChild(a)
|
||||||
|
a.click()
|
||||||
|
document.body.removeChild(a)
|
||||||
|
URL.revokeObjectURL(url)
|
||||||
|
|
||||||
|
message.success('下载成功')
|
||||||
break
|
break
|
||||||
case 4:
|
case 4:
|
||||||
break
|
break
|
||||||
@ -583,7 +591,6 @@ const toolbarClick = (item) => {
|
|||||||
case 13:
|
case 13:
|
||||||
//文字
|
//文字
|
||||||
textFormToolDialogRef.value.open()
|
textFormToolDialogRef.value.open()
|
||||||
|
|
||||||
// if (toolbarTypeIndex.value === 13) {
|
// if (toolbarTypeIndex.value === 13) {
|
||||||
// state.cursorStyle = `url('${cursorCollection.input}'),auto`
|
// state.cursorStyle = `url('${cursorCollection.input}'),auto`
|
||||||
// } else {
|
// } else {
|
||||||
|
Loading…
Reference in New Issue
Block a user