Browse Source

ai视觉服务重启

master
xuhuajiao 5 months ago
parent
commit
2550d261d2
  1. 2
      .env.development
  2. 10
      src/api/stockTask/index.js
  3. 85
      src/views/visualCheck/checkManage/paramSetting/index.vue
  4. 4
      src/views/visualCheck/venueDevice/bookshelfPosition/index.vue

2
.env.development

@ -3,7 +3,7 @@ ENV = 'development'
# 接口地址
# 许镇-本地服地址
VUE_APP_BASE_API = 'http://192.168.99.67:12010'
VUE_APP_BASE_API = 'http://192.168.99.86:12010'
#VUE_APP_BASE_API = 'http://27.19.205.234:17070'

10
src/api/stockTask/index.js

@ -139,4 +139,12 @@ export function FetchShowByBillIdAndShelfIdAndGridShelf(params) {
})
}
export default { add, edit, del, FetchUpdateStockTaskStatus, FetchInitSuggestTilting, FetchInitSetting, FetchEditSetting, FetchInitHomeInfo, FetchInitStockInfo, FetchInitHotBookList, FetchInitHotShelfList, FetchInitBookDetailsByGrids, FetchAITerminalStatusQuery, FetchBillByShelfIdAndGridShelf, FetchIsGoodcutByBillNoAndGridId, FetchInitErrorProbaDesc, FetchShowByBillIdAndShelfIdAndGridShelf }
// 运行/停止图书AI识别程序
export function FetchStartStopBookAIService(params) {
return request({
url: 'api/stocktask-task/startStopBookAIService' + '?' + qs.stringify(params, { indices: false }),
method: 'get'
})
}
export default { add, edit, del, FetchUpdateStockTaskStatus, FetchInitSuggestTilting, FetchInitSetting, FetchEditSetting, FetchInitHomeInfo, FetchInitStockInfo, FetchInitHotBookList, FetchInitHotShelfList, FetchInitBookDetailsByGrids, FetchAITerminalStatusQuery, FetchBillByShelfIdAndGridShelf, FetchIsGoodcutByBillNoAndGridId, FetchInitErrorProbaDesc, FetchShowByBillIdAndShelfIdAndGridShelf, FetchStartStopBookAIService }

85
src/views/visualCheck/checkManage/paramSetting/index.vue

@ -10,6 +10,10 @@
</el-form-item>
<div v-if="form.ip" style="margin-left: 20px; margin-top: 6px; cursor: pointer;" @click="handleService"><i class="iconfont icon-bendiguajie" /></div>
<p style="line-height: 32px; margin-left: 20px; font-size: 12px;">设置成功后方可执行视觉盘点任务</p>
<div style="margin-left: 20px;">
<el-button :loading="resetLoading" @click="toVerify('reset')">重启服务</el-button>
<!-- <el-button>关闭</el-button> -->
</div>
</el-row>
<el-row style="display: flex; justify-content: flex-start;">
<el-form-item label="层位占用上限" prop="maxNum">
@ -19,7 +23,7 @@
</el-row>
</el-form>
<div>
<el-button style="margin-left: 30px;" :loading="crud.status.cu === 2" type="primary" @click="toVerify">保存</el-button>
<el-button style="margin-left: 30px;" :loading="crud.status.cu === 2" type="primary" @click="toVerify('add')">保存</el-button>
<span style="line-height: 32px; margin-left: 20px; font-size: 12px;">设置需要超级管理员权限授权</span>
</div>
</div>
@ -104,7 +108,7 @@
</template>
<script>
import crudStockTask, { FetchAITerminalStatusQuery } from '@/api/stockTask/index'
import crudStockTask, { FetchAITerminalStatusQuery, FetchStartStopBookAIService } from '@/api/stockTask/index'
import { encrypt } from '@/utils/rsaEncrypt'
import { verifyMaintenance } from '@/api/system/param'
import CRUD, { presenter, header, form, crud } from '@crud/crud'
@ -148,7 +152,9 @@ export default {
verfiyForm: {
verifyCode: ''
},
verifyStatus: '',
showVerifyDialog: true,
resetLoading: false,
rules: {
ip: [
{ required: true, message: 'AI处理终端IP不可为空', trigger: 'blur' }
@ -181,12 +187,7 @@ export default {
}
},
created() {
crudStockTask.FetchInitSetting().then(res => {
this.crud.form.ip = res.ip
this.maxNum = res.maxNum
this.crud.form.maxNum = res.maxNum
}).catch(() => {
})
this.initData()
},
beforeDestroy() {
if (this.timer) {
@ -194,6 +195,14 @@ export default {
}
},
methods: {
initData() {
crudStockTask.FetchInitSetting().then(res => {
this.crud.form.ip = res.ip
this.maxNum = res.maxNum
this.crud.form.maxNum = res.maxNum
}).catch(() => {
})
},
handleService() {
this.servicesDisplayed = false
FetchAITerminalStatusQuery({ 'ip': this.crud.form.ip }).then(res => {
@ -280,19 +289,23 @@ export default {
return false
},
toVerify(btn) {
if (this.form.ip) {
if (this.showVerifyDialog) {
//
this.verifyDialogVisible = true
return false
}
this.verifyStatus = btn
if (btn === 'reset') {
this.verifyDialogVisible = true
} else {
this.$refs.form.validateField(['ip'], err => {
console.log('err', err)
if (err) {
return
if (this.form.ip) {
if (this.showVerifyDialog) {
this.verifyDialogVisible = true
return false
}
})
} else {
this.$refs.form.validateField(['ip'], err => {
console.log('err', err)
if (err) {
return
}
})
}
}
},
handleConfirm() {
@ -301,17 +314,39 @@ export default {
this.verifyDialogVisible = false
this.verfiyForm.verifyCode = ''
this.showVerifyDialog = false
crudStockTask.FetchEditSetting(this.crud.form).then(res => {
console.log('res', res)
this.$message({ message: '修改成功', type: 'success', offset: 8 })
this.crud.refresh()
}).catch(() => {
})
if (this.verifyStatus === 'add') {
crudStockTask.FetchEditSetting(this.crud.form).then(res => {
this.$message({ message: '修改成功', type: 'success', offset: 8 })
this.initData()
}).catch(() => {
})
} else {
this.resetLoading = true
//
this.handleConnectAIService()
}
} else {
this.$message({ message: '验证码错误!', type: 'error', offset: 8 })
}
})
},
async handleConnectAIService() {
try {
// //
// const firstRes = await FetchStartStopBookAIService({ runType: 0 })
// console.log('', firstRes)
// this.$message({ message: '', type: 'success', offset: 8 })
//
// 1 2 ()
const secondRes = await FetchStartStopBookAIService({ runType: 1 })
console.log('后开启', secondRes)
this.$message({ message: '重启服务成功', type: 'success', offset: 8 })
this.resetLoading = false
} catch (error) {
this.$message({ message: '请求失败', type: 'error', offset: 8 })
this.resetLoading = false
}
},
handleClose() {
if (this.$refs.verfiyForm) {
this.verfiyForm.verifyCode = ''

4
src/views/visualCheck/venueDevice/bookshelfPosition/index.vue

@ -583,10 +583,6 @@ export default {
.swiper-content{
height: 544px;
}
.swiper-slide-content {
// padding: 0 10px;
// margin: 0 10px 0 0;
}
.view-video{
::v-deep .el-dialog{
width: 1000px !important;

Loading…
Cancel
Save