Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pptist
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
viitto
pptist
Commits
c34d7f19
Commit
c34d7f19
authored
Nov 20, 2023
by
罗超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增数据的绑定
parent
68ef6584
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
17 deletions
+36
-17
App.vue
src/App.vue
+21
-13
Index.vue
src/views/Market/Index.vue
+15
-4
No files found.
src/App.vue
View file @
c34d7f19
<
template
>
<Screen
v-if=
"screening"
/>
<Market
v-else-if=
"market"
></Market>
<Editor
v-else-if=
"_isPC"
/>
<Mobile
v-else
/>
<div
v-if=
"isFinish"
>
<Screen
v-if=
"screening"
/>
<Market
v-else-if=
"market"
></Market>
<Editor
v-else-if=
"_isPC"
/>
<Mobile
v-else
/>
</div>
</
template
>
<
script
lang=
"ts"
setup
>
import
{
onMounted
}
from
'vue'
import
{
onMounted
,
ref
}
from
'vue'
import
{
storeToRefs
}
from
'pinia'
import
{
useScreenStore
,
useMainStore
,
useSnapshotStore
}
from
'@/store'
import
{
LOCALSTORAGE_KEY_DISCARDED_DB
}
from
'@/configs/storage'
...
...
@@ -19,6 +21,20 @@ import Screen from './views/Screen/index.vue'
import
Mobile
from
'./views/Mobile/index.vue'
import
Market
from
'./views/Market/Index.vue'
const
isFinish
=
ref
(
false
)
const
userLoginHandler
=
async
()
=>
{
let
param
=
query
()
let
userId
=
1
if
(
param
.
uid
)
userId
=
parseInt
(
param
.
uid
)
try
{
await
userStore
().
setUserLoginAsync
(
userId
)
}
catch
(
error
)
{
}
isFinish
.
value
=
true
}
userLoginHandler
()
const
_isPC
=
isPC
()
const
mainStore
=
useMainStore
()
...
...
@@ -30,14 +46,6 @@ if (process.env.NODE_ENV === 'production') {
window
.
onbeforeunload
=
()
=>
false
}
const
userLoginHandler
=
async
()
=>
{
let
param
=
query
()
let
userId
=
1
if
(
param
.
uid
)
userId
=
parseInt
(
param
.
uid
)
await
userStore
().
setUserLoginAsync
(
userId
)
}
userLoginHandler
()
onMounted
(
async
()
=>
{
await
deleteDiscardedDB
()
snapshotStore
.
initSnapshotDatabase
()
...
...
src/views/Market/Index.vue
View file @
c34d7f19
...
...
@@ -6,7 +6,7 @@
<h1
class=
"alifont"
style=
"font-size:20px;"
>
智慧设计平台
</h1>
</el-col>
<el-col
:span=
"6"
>
<el-input
v-model=
"
searchKey
"
placeholder=
"输入模板关键字快速查找"
class=
"input-with-select"
>
<el-input
v-model=
"
queryObj.Title
"
placeholder=
"输入模板关键字快速查找"
class=
"input-with-select"
>
<template
#
append
>
<el-button
type=
"primary"
@
click=
"queryTemplateBySearchHandler"
>
搜索
</el-button>
</
template
>
...
...
@@ -16,13 +16,19 @@
</el-row>
<div
class=
"q-mt-lg bg-white q-pa-lg rounded"
>
<div
class=
"row text-small items-center"
>
<span
class=
"q-mr-lg
"
>
适用线路:
</span>
<span
style=
"margin-right: 50px;
"
>
适用线路:
</span>
<el-check-tag
:checked=
"queryObj.lineId == 0"
@
change=
"onLineChangeHandler(0)"
class=
"text-small q-mr-md"
>
全部
</el-check-tag>
<el-check-tag
:checked=
"queryObj.lineId == x.LineID"
@
change=
"onLineChangeHandler(x.LineID)"
class=
"text-small q-mr-md"
v-for=
"x in lines"
:key=
"x.LineID"
>
{{x.LineName}}
</el-check-tag>
</div>
<el-divider></el-divider>
<el-divider
style=
"margin:12px 0;border-top-color:#f3f6fb;"
></el-divider>
<div
class=
"row text-small items-center"
>
<span
style=
"margin-right: 50px;"
>
适用国家:
</span>
<el-check-tag
:checked=
"queryObj.CountryName == ''"
@
change=
"onCountryNameChangeHandler('')"
class=
"text-small q-mr-md"
>
通用
</el-check-tag>
<el-check-tag
:checked=
"queryObj.CountryName == x"
@
change=
"onCountryNameChangeHandler(x)"
class=
"text-small q-mr-md"
v-for=
"(x,i) in countries"
:key=
"i"
>
{{x}}
</el-check-tag>
</div>
</div>
</div>
</div>
...
...
@@ -36,15 +42,20 @@ import { storeToRefs } from "pinia";
const
{
userInfo
}
=
storeToRefs
(
userStore
())
const
lines
=
ref
([]
as
Array
<
any
>
)
const
countries
=
ref
([
'日本'
,
'韩国'
,
'老挝'
,
'法国'
,
'意大利'
]
as
Array
<
any
>
)
const
queryObj
=
reactive
({
lineId
:
0
,
searchKey
:
''
Title
:
''
,
CountryName
:
''
})
const
queryTemplateBySearchHandler
=
()
=>
{
}
const
onLineChangeHandler
=
(
lineId
:
number
)
=>
{
queryObj
.
lineId
=
lineId
}
const
onCountryNameChangeHandler
=
(
CountryName
:
string
)
=>
{
queryObj
.
CountryName
=
CountryName
}
const
getLinesHandler
=
async
()
=>
{
try
{
let
response
=
await
LineService
.
GetLineListAsync
()
...
...
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