Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
web-project
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
海康威视
web-project
Commits
16670525
Commit
16670525
authored
Sep 13, 2024
by
hubaoshan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面的token Bug
parent
b074febb
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
152 additions
and
62 deletions
+152
-62
ExtinguisherNewDataPage.vue
...ws/AIStation/ExtinguisherPage/ExtinguisherNewDataPage.vue
+8
-11
index.vue
src/views/AIStation/ExtinguisherPage/index.vue
+17
-31
MoveMonitorNewDataPage.vue
...iews/AIStation/MoveMonitorPage/MoveMonitorNewDataPage.vue
+12
-1
index.vue
src/views/AIStation/MoveMonitorPage/index.vue
+31
-4
PipelineTempNewDataPage.vue
...ws/AIStation/PipelineTempPage/PipelineTempNewDataPage.vue
+10
-2
index.vue
src/views/AIStation/PipelineTempPage/index.vue
+32
-6
TransTempNewDataPage.vue
src/views/AIStation/TransTempPage/TransTempNewDataPage.vue
+10
-2
index.vue
src/views/AIStation/TransTempPage/index.vue
+32
-5
No files found.
src/views/AIStation/ExtinguisherPage/ExtinguisherNewDataPage.vue
View file @
16670525
...
@@ -53,8 +53,10 @@ function detail(row) {
...
@@ -53,8 +53,10 @@ function detail(row) {
detailOpen
.
value
=
true
detailOpen
.
value
=
true
}
}
getData
()
// getData()
if
(
localStorage
.
getItem
(
'AIToken'
)){
getData
()
}
function
getData
()
{
function
getData
()
{
const
item
=
reactive
({
const
item
=
reactive
({
page
:
Page
.
page
,
page
:
Page
.
page
,
...
@@ -87,15 +89,7 @@ watch(
...
@@ -87,15 +89,7 @@ watch(
getDataNew
(
params
.
value
)
getDataNew
(
params
.
value
)
}
}
)
)
watch
(
()
=>
props
.
searchData
,
(
newData
)
=>
{
console
.
log
(
'ppppppppppp'
,
props
.
searchData
)
if
(
props
.
searchData
.
includes
(
1
)){
getData
()
}
},{
immediate
:
true
}
)
// TODO 等待后续优化
function
getDataNew
(
item
)
{
function
getDataNew
(
item
)
{
getListNewData
(
item
).
then
(
res
=>
{
getListNewData
(
item
).
then
(
res
=>
{
...
@@ -104,6 +98,9 @@ function getDataNew(item) {
...
@@ -104,6 +98,9 @@ function getDataNew(item) {
Page
.
rows
=
res
.
pageSize
Page
.
rows
=
res
.
pageSize
})
})
}
}
defineExpose
({
getData
});
</
script
>
</
script
>
<
template
>
<
template
>
...
...
src/views/AIStation/ExtinguisherPage/index.vue
View file @
16670525
...
@@ -17,7 +17,7 @@ import {useRoute} from "vue-router";
...
@@ -17,7 +17,7 @@ import {useRoute} from "vue-router";
const
options
=
ref
([]);
const
options
=
ref
([]);
const
enterpriseId
=
ref
();
const
enterpriseId
=
ref
();
const
props
=
{
multiple
:
true
,
emitPath
:
false
}
const
props
=
{
multiple
:
true
,
emitPath
:
false
}
const
dynamicComponent
=
ref
(
ExtinguisherNewDataPage
);
// 初始化选中的标签页
// 初始化选中的标签页
onMounted
(()
=>
{
onMounted
(()
=>
{
...
@@ -26,6 +26,13 @@ onMounted(() => {
...
@@ -26,6 +26,13 @@ onMounted(() => {
selectedBtn
.
value
=
topBtn
.
value
[
0
].
id
;
selectedBtn
.
value
=
topBtn
.
value
[
0
].
id
;
getSupplys
()
getSupplys
()
});
});
const
childComponentRef
=
ref
(
null
);
const
getData
=
()
=>
{
if
(
childComponentRef
.
value
&&
childComponentRef
.
value
.
getData
)
{
console
.
log
(
'能不能成功啊'
)
childComponentRef
.
value
.
getData
();
// 调用子组件的 getData 方法
}
};
const
{
proxy
}
=
getCurrentInstance
();
const
{
proxy
}
=
getCurrentInstance
();
// 列表
// 列表
const
topBtn
=
ref
([
const
topBtn
=
ref
([
...
@@ -100,11 +107,11 @@ const search = () => {
...
@@ -100,11 +107,11 @@ const search = () => {
console
.
log
(
'查询:'
,
item
);
console
.
log
(
'查询:'
,
item
);
}
}
function
getNumber
()
{
function
getNumber
()
{
getAlarmNumData
().
then
(
res
=>
{
getAlarmNumData
().
then
(
res
=>
{
console
.
log
(
'123123123123-----------'
,
res
.
data
)
console
.
log
(
'123123123123-----------'
,
res
.
data
)
alarmNum
.
value
=
res
.
data
alarmNum
.
value
=
res
.
data
iop
.
value
=
res
.
data
})
})
}
}
...
@@ -230,45 +237,24 @@ function getSupplys() {
...
@@ -230,45 +237,24 @@ function getSupplys() {
}
}
const
route
=
useRoute
()
const
route
=
useRoute
()
const
number
=
ref
(
0
)
watch
(
watch
(
()
=>
route
.
path
,
// 只监听路径变化
()
=>
route
.
path
,
// 只监听路径变化
()
=>
{
()
=>
{
if
(
route
.
path
===
'/AIStation/Extinguisher'
)
{
if
(
route
.
path
===
'/AIStation/Extinguisher'
)
{
// 路由变化,执行相应操作
// 路由变化,执行相应操作
handleGetAIToken
();
handleGetAIToken
();
number
.
value
=
1
setTimeout
(()
=>
{
console
.
log
(
'11111ppppppppppppp1'
,
number
.
value
)
if
(
localStorage
.
getItem
(
'AIToken'
)){
getNumber
()
getNumber
()
getData
()
}
},
500
);
console
.
log
(
'route.path'
,
route
.
path
)
console
.
log
(
'route.path'
,
route
.
path
)
}
}
},
},
{
immediate
:
true
}
// 只在路径变化时触发
{
immediate
:
true
}
// 只在路径变化时触发
)
)
watch
(
()
=>
number
.
value
,
()
=>
{
console
.
log
(
'0000000000000'
,
number
.
value
);
if
(
number
.
value
===
1
)
{
console
.
log
(
']]]]]]]]]]]]]]]]]]]]]]'
);
searchData
.
value
.
push
(
1
);
console
.
log
(
'searchData.value'
,
searchData
.
value
)
}
},
{
immediate
:
true
}
);
function
ChildMethod
()
{
if
(
dynamicComponent
)
{
console
.
log
(
'selectedComponent.value'
,
dynamicComponent
.
value
);
if
(
typeof
dynamicComponent
.
value
.
getData
===
'function'
)
{
console
.
log
(
'子组件方法存在,开始调用...'
);
dynamicComponent
.
value
.
getData
();
}
else
{
console
.
error
(
'子组件方法不存在'
);
}
}
}
</
script
>
</
script
>
<
template
>
<
template
>
<div
class=
"app-content"
>
<div
class=
"app-content"
>
...
@@ -330,7 +316,7 @@ function ChildMethod() {
...
@@ -330,7 +316,7 @@ function ChildMethod() {
>
>
</el-tab-pane>
</el-tab-pane>
</el-tabs>
</el-tabs>
<component
:is=
"selectedComponent"
:queryParams=
'childParams'
:search-data=
"searchData"
></component>
<component
:is=
"selectedComponent"
ref=
"childComponentRef"
:queryParams=
'childParams'
:search-data=
"searchData"
></component>
</div>
</div>
</div>
</div>
...
...
src/views/AIStation/MoveMonitorPage/MoveMonitorNewDataPage.vue
View file @
16670525
...
@@ -49,11 +49,18 @@ function getDataByParams(){
...
@@ -49,11 +49,18 @@ function getDataByParams(){
}
}
//子组件接收父组件传递过来的值
//子组件接收父组件传递过来的值
const
props
=
defineProps
({
const
props
=
defineProps
({
searchData
:
{
type
:
Array
,
required
:
true
},
queryParams
:
{
queryParams
:
{
type
:
Object
,
type
:
Object
,
required
:
true
required
:
true
}
}
});
});
if
(
localStorage
.
getItem
(
'AIToken'
)){
getData
()
}
watch
(
watch
(
()
=>
props
.
queryParams
,
()
=>
props
.
queryParams
,
(
newData
)
=>
{
(
newData
)
=>
{
...
@@ -63,7 +70,8 @@ watch(
...
@@ -63,7 +70,8 @@ watch(
console
.
log
(
'值ooo'
,
props
.
queryParams
)
console
.
log
(
'值ooo'
,
props
.
queryParams
)
}
}
)
)
getData
()
function
getData
(){
function
getData
(){
const
item
=
reactive
({
const
item
=
reactive
({
page
:
Page
.
page
,
page
:
Page
.
page
,
...
@@ -154,6 +162,9 @@ function getSupplys() {
...
@@ -154,6 +162,9 @@ function getSupplys() {
}
}
getSupplys
()
getSupplys
()
defineExpose
({
getData
});
</
script
>
</
script
>
<
template
>
<
template
>
...
...
src/views/AIStation/MoveMonitorPage/index.vue
View file @
16670525
<
script
setup
>
<
script
setup
>
import
{
getCurrentInstance
,
onMounted
,
reactive
,
ref
}
from
'vue'
import
{
getCurrentInstance
,
onMounted
,
reactive
,
ref
,
watch
}
from
'vue'
import
MoveMonitorNewDataPage
from
'./MoveMonitorNewDataPage.vue'
// 导入组件
import
MoveMonitorNewDataPage
from
'./MoveMonitorNewDataPage.vue'
// 导入组件
import
MoveMonitorHistoryPage
from
'./MoveMonitorHistoryPage.vue'
// 导入组件
import
MoveMonitorHistoryPage
from
'./MoveMonitorHistoryPage.vue'
// 导入组件
import
MoveMonitorAlarmPage
from
'./MoveMonitorAlarmPage.vue'
// 导入组件
import
MoveMonitorAlarmPage
from
'./MoveMonitorAlarmPage.vue'
// 导入组件
...
@@ -11,12 +11,21 @@ import {
...
@@ -11,12 +11,21 @@ import {
exportMoveMonitorHistoryData
,
exportMoveMonitorHistoryData
,
exportMoveMonitorAlarmData
,
exportMoveMonitorAlarmData
,
}
from
"../../../api/AIStation/MoveMonitor.js"
;
}
from
"../../../api/AIStation/MoveMonitor.js"
;
import
{
useRoute
}
from
"vue-router"
;
import
{
handleGetAIToken
}
from
"../AItoken.js"
;
const
options
=
ref
([]);
const
options
=
ref
([]);
const
enterpriseId
=
ref
();
const
enterpriseId
=
ref
();
const
props
=
{
multiple
:
true
,
emitPath
:
false
}
const
props
=
{
multiple
:
true
,
emitPath
:
false
}
const
{
proxy
}
=
getCurrentInstance
();
const
{
proxy
}
=
getCurrentInstance
();
const
childComponentRef
=
ref
(
null
);
const
getData
=
()
=>
{
if
(
childComponentRef
.
value
&&
childComponentRef
.
value
.
getData
)
{
console
.
log
(
'能不能成功啊'
)
childComponentRef
.
value
.
getData
();
// 调用子组件的 getData 方法
}
};
// 列表
// 列表
const
topBtn
=
ref
([
const
topBtn
=
ref
([
{
id
:
1
,
name
:
'最新数据'
,
component
:
MoveMonitorNewDataPage
},
{
id
:
1
,
name
:
'最新数据'
,
component
:
MoveMonitorNewDataPage
},
...
@@ -36,7 +45,7 @@ const activeName = ref(MoveMonitorNewDataPage);
...
@@ -36,7 +45,7 @@ const activeName = ref(MoveMonitorNewDataPage);
const
alarmNum
=
ref
(
0
);
const
alarmNum
=
ref
(
0
);
// 查询结果数据
// 查询结果数据
const
searchData
=
ref
(
{}
);
const
searchData
=
ref
(
[]
);
// 点击标签页切换事件
// 点击标签页切换事件
const
handleTabClick
=
(
tab
,
event
)
=>
{
const
handleTabClick
=
(
tab
,
event
)
=>
{
console
.
log
(
'id'
,
tab
)
console
.
log
(
'id'
,
tab
)
...
@@ -93,7 +102,6 @@ const search = () => {
...
@@ -93,7 +102,6 @@ const search = () => {
}
}
console
.
log
(
'查询:'
,
item
);
console
.
log
(
'查询:'
,
item
);
};
};
getNumber
()
function
getNumber
()
{
function
getNumber
()
{
getMoveAlarmNumber
().
then
(
res
=>
{
getMoveAlarmNumber
().
then
(
res
=>
{
...
@@ -227,6 +235,25 @@ function getSupplys() {
...
@@ -227,6 +235,25 @@ function getSupplys() {
getSupplys
();
getSupplys
();
const
route
=
useRoute
()
const
number
=
ref
(
0
)
watch
(
()
=>
route
.
path
,
// 只监听路径变化
()
=>
{
if
(
route
.
path
===
'/AIStation/MoveMonitor'
)
{
// 路由变化,执行相应操作
handleGetAIToken
();
setTimeout
(()
=>
{
if
(
localStorage
.
getItem
(
'AIToken'
)){
getNumber
()
getData
()
}
},
500
);
console
.
log
(
'route.path'
,
route
.
path
)
}
},
{
immediate
:
true
}
// 只在路径变化时触发
)
</
script
>
</
script
>
<
template
>
<
template
>
<div
class=
"app-content"
>
<div
class=
"app-content"
>
...
@@ -288,7 +315,7 @@ getSupplys();
...
@@ -288,7 +315,7 @@ getSupplys();
>
>
</el-tab-pane>
</el-tab-pane>
</el-tabs>
</el-tabs>
<component
:is=
"selectedComponent"
:queryParams=
'childParams'
></component>
<component
:is=
"selectedComponent"
ref=
"childComponentRef"
:queryParams=
'childParams'
:search-data=
"searchData"
></component>
</div>
</div>
</div>
</div>
...
...
src/views/AIStation/PipelineTempPage/PipelineTempNewDataPage.vue
View file @
16670525
...
@@ -36,12 +36,18 @@ function detail(row) {
...
@@ -36,12 +36,18 @@ function detail(row) {
//子组件接收父组件传递过来的值
//子组件接收父组件传递过来的值
const
props
=
defineProps
({
const
props
=
defineProps
({
searchData
:{
type
:
Array
,
required
:
true
},
queryParams
:
{
queryParams
:
{
type
:
Object
,
type
:
Object
,
required
:
true
required
:
true
}
}
});
});
if
(
localStorage
.
getItem
(
'AIToken'
)){
getData
()
}
watch
(
watch
(
()
=>
props
.
queryParams
,
()
=>
props
.
queryParams
,
(
newData
)
=>
{
(
newData
)
=>
{
...
@@ -55,7 +61,6 @@ watch(
...
@@ -55,7 +61,6 @@ watch(
}
}
)
)
getData
()
function
getData
()
{
function
getData
()
{
const
item
=
reactive
({
const
item
=
reactive
({
...
@@ -160,6 +165,9 @@ function getSupplys() {
...
@@ -160,6 +165,9 @@ function getSupplys() {
}
}
getSupplys
()
getSupplys
()
defineExpose
({
getData
});
</
script
>
</
script
>
<
template
>
<
template
>
...
...
src/views/AIStation/PipelineTempPage/index.vue
View file @
16670525
<
script
setup
>
<
script
setup
>
import
{
getCurrentInstance
,
onMounted
,
reactive
,
ref
}
from
'vue'
import
{
getCurrentInstance
,
onMounted
,
reactive
,
ref
,
watch
}
from
'vue'
import
PipelineTempNewDataPage
from
'./PipelineTempNewDataPage.vue'
// 导入组件
import
PipelineTempNewDataPage
from
'./PipelineTempNewDataPage.vue'
// 导入组件
import
PipelineTempHistoryPage
from
'./PipelineTempHistoryPage.vue'
// 导入组件
import
PipelineTempHistoryPage
from
'./PipelineTempHistoryPage.vue'
// 导入组件
import
PipelineTempAlarmPage
from
'./PipelineTempAlarmPage.vue'
// 导入组件
import
PipelineTempAlarmPage
from
'./PipelineTempAlarmPage.vue'
// 导入组件
...
@@ -12,6 +12,8 @@ import {
...
@@ -12,6 +12,8 @@ import {
exportPipelineTempHistoryData
,
exportPipelineTempHistoryData
,
exportPipelineTempAlarmData
exportPipelineTempAlarmData
}
from
"../../../api/AIStation/PipelineTemp.js"
;
}
from
"../../../api/AIStation/PipelineTemp.js"
;
import
{
useRoute
}
from
"vue-router"
;
import
{
handleGetAIToken
}
from
"../AItoken.js"
;
const
{
proxy
}
=
getCurrentInstance
();
const
{
proxy
}
=
getCurrentInstance
();
...
@@ -22,8 +24,13 @@ const topBtn = ref([
...
@@ -22,8 +24,13 @@ const topBtn = ref([
{
id
:
3
,
name
:
'报警信息'
,
component
:
PipelineTempAlarmPage
}
{
id
:
3
,
name
:
'报警信息'
,
component
:
PipelineTempAlarmPage
}
]);
]);
const
selectedBtn
=
ref
(
null
);
const
selectedBtn
=
ref
(
null
);
const
dateRange
=
ref
([])
const
childComponentRef
=
ref
(
null
);
const
optionsList
=
ref
([])
const
getData
=
()
=>
{
if
(
childComponentRef
.
value
&&
childComponentRef
.
value
.
getData
)
{
console
.
log
(
'能不能成功啊'
)
childComponentRef
.
value
.
getData
();
// 调用子组件的 getData 方法
}
};
// 默认显示的组件页面
// 默认显示的组件页面
const
selectedComponent
=
ref
(
PipelineTempNewDataPage
);
const
selectedComponent
=
ref
(
PipelineTempNewDataPage
);
...
@@ -71,7 +78,7 @@ const queryParams = reactive({
...
@@ -71,7 +78,7 @@ const queryParams = reactive({
endTime
:
''
,
endTime
:
''
,
});
});
const
Page
=
reactive
({
total
:
0
,
rows
:
20
,
page
:
1
});
const
Page
=
reactive
({
total
:
0
,
rows
:
20
,
page
:
1
});
const
searchData
=
ref
(
{}
);
const
searchData
=
ref
(
[]
);
const
thermalAlarmTypeList
=
[
const
thermalAlarmTypeList
=
[
{
{
label
:
'定温报警'
,
label
:
'定温报警'
,
...
@@ -119,7 +126,6 @@ const search = () => {
...
@@ -119,7 +126,6 @@ const search = () => {
}
}
console
.
log
(
'查询:'
,
item
);
console
.
log
(
'查询:'
,
item
);
};
};
getNumber
()
function
getNumber
()
{
function
getNumber
()
{
getPipAlarmNumber
().
then
(
res
=>
{
getPipAlarmNumber
().
then
(
res
=>
{
...
@@ -254,6 +260,26 @@ function getSupplys() {
...
@@ -254,6 +260,26 @@ function getSupplys() {
getSupplys
();
getSupplys
();
const
route
=
useRoute
()
const
number
=
ref
(
0
)
watch
(
()
=>
route
.
path
,
// 只监听路径变化
()
=>
{
if
(
route
.
path
===
'/AIStation/PipelineTemp'
)
{
// 路由变化,执行相应操作
handleGetAIToken
();
setTimeout
(()
=>
{
if
(
localStorage
.
getItem
(
'AIToken'
)){
getNumber
()
getData
()
}
},
500
);
console
.
log
(
'route.path'
,
route
.
path
)
}
},
{
immediate
:
true
}
// 只在路径变化时触发
)
</
script
>
</
script
>
<
template
>
<
template
>
<div
class=
"app-content"
>
<div
class=
"app-content"
>
...
@@ -320,7 +346,7 @@ getSupplys();
...
@@ -320,7 +346,7 @@ getSupplys();
>
>
</el-tab-pane>
</el-tab-pane>
</el-tabs>
</el-tabs>
<component
:is=
"selectedComponent"
:queryParams=
'childParams'
></component>
<component
:is=
"selectedComponent"
ref=
"childComponentRef"
:queryParams=
'childParams'
:search-data=
"searchData"
></component>
</div>
</div>
</div>
</div>
</
template
>
</
template
>
...
...
src/views/AIStation/TransTempPage/TransTempNewDataPage.vue
View file @
16670525
...
@@ -44,12 +44,18 @@ function detail(row) {
...
@@ -44,12 +44,18 @@ function detail(row) {
//子组件接收父组件传递过来的值
//子组件接收父组件传递过来的值
const
props
=
defineProps
({
const
props
=
defineProps
({
searchData
:{
type
:
Array
,
required
:
true
},
queryParams
:
{
queryParams
:
{
type
:
Object
,
type
:
Object
,
required
:
true
required
:
true
}
}
});
});
if
(
localStorage
.
getItem
(
'AIToken'
)){
getData
()
}
watch
(
watch
(
()
=>
props
.
queryParams
,
()
=>
props
.
queryParams
,
(
newData
)
=>
{
(
newData
)
=>
{
...
@@ -59,7 +65,6 @@ watch(
...
@@ -59,7 +65,6 @@ watch(
console
.
log
(
'值ooo'
,
props
.
queryParams
)
console
.
log
(
'值ooo'
,
props
.
queryParams
)
}
}
)
)
getData
()
function
getData
()
{
function
getData
()
{
const
item
=
reactive
({
const
item
=
reactive
({
...
@@ -160,6 +165,9 @@ function getSupplys() {
...
@@ -160,6 +165,9 @@ function getSupplys() {
}
}
getSupplys
()
getSupplys
()
defineExpose
({
getData
});
</
script
>
</
script
>
<
template
>
<
template
>
...
...
src/views/AIStation/TransTempPage/index.vue
View file @
16670525
<
script
setup
>
<
script
setup
>
import
{
getCurrentInstance
,
onMounted
,
reactive
,
ref
}
from
'vue'
import
{
getCurrentInstance
,
onMounted
,
reactive
,
ref
,
watch
}
from
'vue'
import
TransTempNewDataPage
from
'./TransTempNewDataPage.vue'
// 导入组件
import
TransTempNewDataPage
from
'./TransTempNewDataPage.vue'
// 导入组件
import
TransTempHistoryPage
from
'./TransTempHistoryPage.vue'
// 导入组件
import
TransTempHistoryPage
from
'./TransTempHistoryPage.vue'
// 导入组件
import
TransTempAlarmPage
from
'./TransTempAlarmPage.vue'
// 导入组件
import
TransTempAlarmPage
from
'./TransTempAlarmPage.vue'
// 导入组件
...
@@ -21,6 +21,8 @@ import {
...
@@ -21,6 +21,8 @@ import {
exportTransTempAlarmData
exportTransTempAlarmData
}
from
"../../../api/AIStation/TransTemp.js"
;
}
from
"../../../api/AIStation/TransTemp.js"
;
import
{
getPipAlarmNumber
}
from
"../../../api/AIStation/PipelineTemp.js"
;
import
{
getPipAlarmNumber
}
from
"../../../api/AIStation/PipelineTemp.js"
;
import
{
useRoute
}
from
"vue-router"
;
import
{
handleGetAIToken
}
from
"../AItoken.js"
;
const
{
proxy
}
=
getCurrentInstance
();
const
{
proxy
}
=
getCurrentInstance
();
// 列表
// 列表
...
@@ -30,7 +32,13 @@ const topBtn = ref([
...
@@ -30,7 +32,13 @@ const topBtn = ref([
{
id
:
3
,
name
:
'报警信息'
,
component
:
TransTempAlarmPage
}
{
id
:
3
,
name
:
'报警信息'
,
component
:
TransTempAlarmPage
}
]);
]);
const
selectedBtn
=
ref
(
null
);
const
selectedBtn
=
ref
(
null
);
const
optionsList
=
ref
([])
const
childComponentRef
=
ref
(
null
);
const
getData
=
()
=>
{
if
(
childComponentRef
.
value
&&
childComponentRef
.
value
.
getData
)
{
console
.
log
(
'能不能成功啊'
)
childComponentRef
.
value
.
getData
();
// 调用子组件的 getData 方法
}
};
const
childParams
=
ref
({})
const
childParams
=
ref
({})
// 默认显示的组件页面
// 默认显示的组件页面
...
@@ -106,7 +114,7 @@ const queryParams = reactive({
...
@@ -106,7 +114,7 @@ const queryParams = reactive({
});
});
const
Page
=
reactive
({
total
:
0
,
rows
:
20
,
page
:
1
});
const
Page
=
reactive
({
total
:
0
,
rows
:
20
,
page
:
1
});
const
searchData
=
ref
(
{}
);
const
searchData
=
ref
(
[]
);
const
search
=
()
=>
{
const
search
=
()
=>
{
const
item
=
{
const
item
=
{
page
:
Page
.
page
,
page
:
Page
.
page
,
...
@@ -126,7 +134,6 @@ const search = () => {
...
@@ -126,7 +134,6 @@ const search = () => {
}
}
console
.
log
(
'查询:'
,
item
);
console
.
log
(
'查询:'
,
item
);
};
};
getNumber
()
function
getNumber
()
{
function
getNumber
()
{
getTransAlarmNumber
().
then
(
res
=>
{
getTransAlarmNumber
().
then
(
res
=>
{
...
@@ -261,7 +268,27 @@ function getSupplys() {
...
@@ -261,7 +268,27 @@ function getSupplys() {
}
}
getSupplys
();
getSupplys
();
getNumber
()
const
route
=
useRoute
()
const
number
=
ref
(
0
)
watch
(
()
=>
route
.
path
,
// 只监听路径变化
()
=>
{
if
(
route
.
path
===
'/AIStation/TransTemp'
)
{
// 路由变化,执行相应操作
handleGetAIToken
();
setTimeout
(()
=>
{
if
(
localStorage
.
getItem
(
'AIToken'
)){
getNumber
()
getData
()
}
},
500
);
console
.
log
(
'route.path'
,
route
.
path
)
}
},
{
immediate
:
true
}
// 只在路径变化时触发
)
</
script
>
</
script
>
<
template
>
<
template
>
<div
class=
"app-content"
>
<div
class=
"app-content"
>
...
@@ -328,7 +355,7 @@ getSupplys();
...
@@ -328,7 +355,7 @@ getSupplys();
>
>
</el-tab-pane>
</el-tab-pane>
</el-tabs>
</el-tabs>
<component
:is=
"selectedComponent"
:queryParams=
'childParams'
></component>
<component
:is=
"selectedComponent"
ref=
"childComponentRef"
:queryParams=
'childParams'
:search-data=
"searchData"
></component>
</div>
</div>
</div>
</div>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment