Commit c34d7f19 authored by 罗超's avatar 罗超

新增数据的绑定

parent 68ef6584
<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()
......
......@@ -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()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment