Browse Source

form

master
maochaoying 2 years ago
parent
commit
5c581ca0a3
  1. 8
      .env
  2. 89
      src/components/Debug.vue
  3. 33
      src/components/User.vue

8
.env

@ -1,8 +1,8 @@
# VITE_BASE_URL=http://192.168.1.194:8899 # VITE_BASE_URL=http://192.168.1.194:8899
# VITE_WEBSOCKET_JAVA_URL=ws://192.168.1.194:8899/websocket/nuclear # VITE_WEBSOCKET_JAVA_URL=ws://192.168.1.194:8899/websocket/nuclear
# # VITE_WEBSOCKET_CAMERA_URL=ws://127.0.0.1:8899/websocket/nuclear # # VITE_WEBSOCKET_CAMERA_URL=ws://127.0.0.1:8899/websocket/nuclear
# VITE_WEBSOCKET_CAMERA_URL=ws://192.168.1.194:8081/ws/cmd
# VITE_HOST_URL=http://192.168.1.194:8081/
VITE_WEBSOCKET_CAMERA_URL=ws://192.168.1.194:8081/ws/cmd
VITE_HOST_URL=http://192.168.1.194:8081/
# VITE_BASE_URL=http://127.0.0.1:8899 # VITE_BASE_URL=http://127.0.0.1:8899
@ -14,5 +14,5 @@
VITE_BASE_URL=http://192.168.1.111:8899 VITE_BASE_URL=http://192.168.1.111:8899
VITE_WEBSOCKET_JAVA_URL=ws://192.168.1.111:8899/websocket/nuclear VITE_WEBSOCKET_JAVA_URL=ws://192.168.1.111:8899/websocket/nuclear
# VITE_WEBSOCKET_CAMERA_URL=ws://127.0.0.1:8899/websocket/nuclear # VITE_WEBSOCKET_CAMERA_URL=ws://127.0.0.1:8899/websocket/nuclear
VITE_WEBSOCKET_CAMERA_URL=ws://192.168.1.111:8081/ws/cmd
VITE_HOST_URL=http://192.168.1.111:8081/
# VITE_WEBSOCKET_CAMERA_URL=ws://192.168.1.111:8081/ws/cmd
# VITE_HOST_URL=http://192.168.1.111:8081/

89
src/components/Debug.vue

@ -72,8 +72,28 @@
</div> </div>
</div> </div>
<div class="identify_results"> <div class="identify_results">
<p class="title">结果</p>
<div class="result">{{ recognitionResult }}</div>
<div class="result_wrap">
<p class="title">结果</p>
<div class="result">{{ recognitionResult }}</div>
</div>
<div class="save_form">
<t-select
v-model="station_core_id"
class="demo-select-base"
clearable
filterable
placeholder="请选择堆芯"
>
<t-option
v-for="item in coreList"
:value="item.id"
:label="item.name"
:key="item.id"
>
{{ item.name }}
</t-option>
</t-select>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -122,10 +142,21 @@ import {
setExposureTimeRaw, setExposureTimeRaw,
getCameraParametersInteger, getCameraParametersInteger,
} from '@/command' } from '@/command'
import { coreListApi } from '@/api/info'
import { MessagePlugin } from 'tdesign-vue-next' import { MessagePlugin } from 'tdesign-vue-next'
const photoUrl = ref('') const photoUrl = ref('')
const recognitionResult = ref('') const recognitionResult = ref('')
const station_core_id = ref('')
const coreList = ref([])
onMounted(async () => {
const res = await coreListApi()
if (res?.code == 200) {
coreList.value = res?.data?.list
}
})
setInterval( setInterval(
() => { () => {
@ -181,26 +212,17 @@ const handleGetCharacterRecognitionResult = () => {
} }
} }
const handleGetMechanicalArmState = () => { const handleGetMechanicalArmState = () => {
if (isCameraOpen.value) {
//
websocketsend(getMechanicalArmState)
} else {
MessagePlugin('error', { content: '请先开启相机' })
}
websocketsend(getMechanicalArmState)
} }
const handleOpenFlashLight = () => { const handleOpenFlashLight = () => {
if (isOpenCamera()) {
if (!flashStatus.value) {
websocketsend(openFlashLight)
}
if (!flashStatus.value) {
websocketsend(openFlashLight)
} }
} }
const handleCloseFlashLight = () => {
if (isOpenCamera()) {
if (flashStatus.value) {
websocketsend(closeFlashLight)
}
const handleCloseFlashLight = flag => {
if (flashStatus.value) {
websocketsend(closeFlashLight)
} }
} }
@ -290,7 +312,7 @@ const websocketonmessage = e => {
break break
} }
} else { } else {
MessagePlugin('error', { content: 'ws发送指令执行错误' })
// MessagePlugin('error', { content: 'ws' })
} }
} }
@ -300,7 +322,7 @@ const websocketonopen = () => {
setTimeout(() => { setTimeout(() => {
websocketsend(getCameraParametersInteger) websocketsend(getCameraParametersInteger)
// //
handleCloseFlashLight()
handleCloseFlashLight(false)
websocketsend(getFlashBrightnessAnalog) websocketsend(getFlashBrightnessAnalog)
}, 1000) }, 1000)
} }
@ -336,15 +358,11 @@ initWebSocket()
// //
const handleExposureTime = value => { const handleExposureTime = value => {
if (isOpenCamera()) {
websocketsend(setExposureTimeRaw(value))
}
websocketsend(setExposureTimeRaw(value))
} }
const handleSimulationBrightness = value => { const handleSimulationBrightness = value => {
if (isOpenCamera()) {
websocketsend(setFlashBrightnessAnalog(value))
}
websocketsend(setFlashBrightnessAnalog(value))
} }
onUnmounted(() => { onUnmounted(() => {
@ -457,14 +475,21 @@ onUnmounted(() => {
} }
.identify_results { .identify_results {
padding-top: 44px; padding-top: 44px;
.title {
font-size: 20px;
font-weight: 500;
letter-spacing: 0.07em;
color: #191919;
display: flex;
.result_wrap {
flex: 1;
.title {
font-size: 20px;
font-weight: 500;
letter-spacing: 0.07em;
color: #191919;
}
.result {
padding: 10px 0;
}
} }
.result {
padding: 10px 0;
.save_form {
flex: 1;
} }
} }
} }

33
src/components/User.vue

@ -45,12 +45,6 @@
> >
</t-input> </t-input>
</t-form-item> </t-form-item>
<t-form-item label="昵称" name="nickname">
<t-input
v-model="formData.nickname"
placeholder="请输入用户名"
></t-input>
</t-form-item>
<t-form-item label="角色权限" name="role"> <t-form-item label="角色权限" name="role">
<t-radio-group v-model="formData.role"> <t-radio-group v-model="formData.role">
<t-radio value="ROLE_ADMIN">管理员</t-radio> <t-radio value="ROLE_ADMIN">管理员</t-radio>
@ -88,7 +82,6 @@ const INITIAL_DATA = {
username: '', username: '',
role: '', role: '',
password: '', password: '',
nickname: '',
} }
export default { export default {
@ -104,27 +97,6 @@ export default {
trigger: 'blur', trigger: 'blur',
}, },
{ whitespace: true, message: '用户名不能为空' }, { whitespace: true, message: '用户名不能为空' },
{
min: 8,
message: '至少需要8个字符,一个中文等于两个字符',
type: 'warning',
trigger: 'blur',
},
],
nickname: [
{
required: true,
message: '昵称不能为空',
type: 'error',
trigger: 'blur',
},
{ whitespace: true, message: '昵称不能为空' },
{
min: 2,
message: '至少需要2个字符,一个中文等于两个字符',
type: 'warning',
trigger: 'blur',
},
], ],
password: [ password: [
{ {
@ -152,11 +124,6 @@ export default {
width: 120, width: 120,
}, },
{ {
colKey: 'nickname',
title: '昵称',
ellipsis: true,
},
{
title: '角色', title: '角色',
colKey: 'role', colKey: 'role',
cell: (h, { row }) => { cell: (h, { row }) => {

Loading…
Cancel
Save