Browse Source

fix:坐标管理重置功能;环境变量增加pre

master
guoapeng 4 months ago
parent
commit
f40616414c
  1. 6
      .env.pre
  2. 2
      .env.test
  3. 1
      package.json
  4. 1
      src/apis/point.ts
  5. 40
      src/views/point/index.vue
  6. 4
      vite.config.ts

6
.env.pre

@ -0,0 +1,6 @@
# 预发环境
FT_NODE_ENV=pre
FT_WS_URL=ws://192.168.100.140:8080/ws
FT_PROXY=http://192.168.1.140

2
.env.test

@ -3,4 +3,4 @@
FT_NODE_ENV=test
FT_WS_URL=ws://192.168.1.200:8080/ws
FT_PROXY=http://192.168.1.199:8080
FT_PROXY=http://192.168.1.200:8080

1
package.json

@ -14,6 +14,7 @@
"build": "vite build --mode dev",
"build:test": "vite build --mode test",
"build:prod": "vite build --mode prod",
"build:pre": "vite build --mode pre",
"build:dev": "vite build --mode dev",
"prepare": "husky",
"lint:lint-staged": "lint-staged",

1
src/apis/point.ts

@ -4,3 +4,4 @@ export const list = (params: any): Promise<any> => http.post('position/list', pa
export const add = (params: any): Promise<any> => http.post('position/add', params)
export const update = (params: any): Promise<any> => http.put('position', params)
export const del = (ids: string): Promise<any> => http.delete(`position/${ids}`)
export const reset = (): Promise<any> => http.get(`sys/reset`)

40
src/views/point/index.vue

@ -1,9 +1,11 @@
<script setup lang="ts">
import type { MatrixQuery } from 'apis/matrix'
import { list } from 'apis/point'
import { list, reset } from 'apis/point'
import FtButton from 'components/common/FTButton/index.vue'
import Edit from 'components/point/Edit/index.vue'
import { ElMessageBox } from 'element-plus'
import { FtMessage } from 'libs/message'
import { useSystemStore } from 'stores/useSystemStore'
import { onMounted, ref } from 'vue'
@ -59,23 +61,22 @@ const editHandle = () => {
addVisible.value = true
}
// const delHandle = async () => {
// const ids = selectedData.value.map((item: any) => item.id)
// ElMessageBox.confirm('', '', {
// type: 'warning',
// confirmButtonText: '',
// cancelButtonText: '',
// showCancelButton: true,
// showClose: false,
// closeOnClickModal: false,
// closeOnPressEscape: false,
// closeOnHashChange: false,
// }).then(async () => {
// await del(ids.join(','))
// FtMessage.success('')
// await getList()
// })
// }
const resetHandle = async () => {
ElMessageBox.confirm('重置后所有坐标数据都将恢复默认值, 确认?', '提示', {
type: 'warning',
confirmButtonText: '确定',
cancelButtonText: '取消',
showCancelButton: true,
showClose: false,
closeOnClickModal: false,
closeOnPressEscape: false,
closeOnHashChange: false,
}).then(async () => {
await reset()
FtMessage.success('重置成功')
await getList()
})
}
</script>
<template>
@ -90,6 +91,9 @@ const editHandle = () => {
<FtButton v-if="systemStore.isDebug" :disabled="selectedData.length !== 1" @click="editHandle">
编辑
</FtButton>
<FtButton v-if="systemStore.isDebug" @click="resetHandle">
重置
</FtButton>
<!-- <FtButton :disabled="selectedData.length === 0" @click="delHandle"> -->
<!-- 删除 -->
<!-- </FtButton> -->

4
vite.config.ts

@ -79,8 +79,8 @@ export default defineConfig({
host: '0.0.0.0',
proxy: {
'/api': {
target: 'http://192.168.1.199:8080',
// target: 'http://192.168.1.200:8080',
// target: 'http://192.168.1.199:8080',
target: 'http://192.168.1.200:8080',
// secure: false,
changeOrigin: true, // 是否跨域
rewrite: path => path.replace(/^\/api/, 'api'),

Loading…
Cancel
Save