Merge branch 'dev' of github.com:jetlinks/jetlinks-ui-vue into dev
This commit is contained in:
commit
0b9b78ca40
|
@ -20,13 +20,15 @@ import { CSSProperties, PropType } from 'vue';
|
|||
import AMap, { initAMapApiLoader } from '@vuemap/vue-amap';
|
||||
import '@vuemap/vue-amap/dist/style.css';
|
||||
import { getAMapUiPromise } from './utils';
|
||||
import { useSystem } from '@/store/system';
|
||||
|
||||
const system = useSystem();
|
||||
interface AMapProps {
|
||||
style?: CSSProperties;
|
||||
class?: string;
|
||||
AMapUI?: string | boolean;
|
||||
}
|
||||
const amapKey = localStorage.getItem('amap_key')
|
||||
const amapKey = system.$state.configInfo.amap?.apiKey;
|
||||
|
||||
initAMapApiLoader({
|
||||
key: amapKey || '',
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { ProductItem } from "@/views/device/Product/typings";
|
||||
import { defineStore } from "pinia";
|
||||
import { detail , getDeviceNumber} from '@/api/device/product'
|
||||
import { detail, getDeviceNumber } from '@/api/device/product'
|
||||
import encodeQuery from "@/utils/encodeQuery";
|
||||
|
||||
export const useProductStore = defineStore({
|
||||
|
@ -17,22 +17,24 @@ export const useProductStore = defineStore({
|
|||
},
|
||||
async getDetail(id: string) {
|
||||
const resp = await detail(id)
|
||||
if(resp.status === 200){
|
||||
this.current = resp.result
|
||||
if (resp.status === 200) {
|
||||
this.current = {
|
||||
...this.current,...resp.result
|
||||
}
|
||||
this.detail = resp.result
|
||||
}
|
||||
},
|
||||
async refresh(id: string) {
|
||||
this.getDetail(id)
|
||||
const res = await getDeviceNumber(encodeQuery({ terms: { productId: id } }))
|
||||
if(res.status === 200){
|
||||
if (res.status === 200) {
|
||||
this.current.count = res.result
|
||||
}
|
||||
},
|
||||
setTabActiveKey(key: string) {
|
||||
this.tabActiveKey = key
|
||||
},
|
||||
reSet(){
|
||||
reSet() {
|
||||
this.current = {} as ProductItem
|
||||
this.detail = {} as ProductItem
|
||||
}
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
:request="queryTree"
|
||||
model="TABLE"
|
||||
type="TREE"
|
||||
v-model:expandedRowKeys="expandedRowKeys"
|
||||
:scroll="{ y: 550 }"
|
||||
:defaultParams="{
|
||||
paging: false,
|
||||
|
@ -128,6 +129,7 @@ let params = ref();
|
|||
*/
|
||||
const handleSearch = (e: any) => {
|
||||
params.value = e;
|
||||
expandedRowKeys.value = []
|
||||
};
|
||||
/**
|
||||
* 操作栏按钮
|
||||
|
|
|
@ -83,7 +83,9 @@ import type { Footer } from '@/views/device/DashBoard/typings';
|
|||
import TopCard from '@/views/device/DashBoard/components/TopCard.vue';
|
||||
import { useMenuStore } from '@/store/menu';
|
||||
import Amap from './components/Amap.vue';
|
||||
let AmapKey = localStorage.getItem('amap_key');
|
||||
import { useSystem } from '@/store/system';
|
||||
const system = useSystem();
|
||||
const AmapKey = system.$state.configInfo.amap?.apiKey
|
||||
let productTotal = ref(0);
|
||||
let productFooter = ref<Footer[]>([
|
||||
{
|
||||
|
|
|
@ -907,11 +907,12 @@ const submitData = async () => {
|
|||
productStore.current = { ...res.result };
|
||||
access.value = res.result;
|
||||
message.success('操作成功!');
|
||||
getData(obj.accessId);
|
||||
}
|
||||
visible.value = false;
|
||||
queryParams.value = {};
|
||||
});
|
||||
getData(obj.accessId);
|
||||
|
||||
}
|
||||
} else {
|
||||
message.error('请选择接入方式');
|
||||
|
|
|
@ -163,6 +163,7 @@ watch(
|
|||
productStore.reSet();
|
||||
productStore.tabActiveKey = 'Info';
|
||||
productStore.refresh(newId as string);
|
||||
console.log(productStore);
|
||||
}
|
||||
},
|
||||
{ immediate: true, deep: true },
|
||||
|
|
|
@ -46,6 +46,7 @@
|
|||
v-bind="slotProps"
|
||||
:active="_selectedRowKeys.includes(slotProps.id)"
|
||||
:status="slotProps.state"
|
||||
@click="handleView(slotProps.id)"
|
||||
:statusText="slotProps.state === 1 ? '正常' : '禁用'"
|
||||
:statusNames="{
|
||||
1: 'processing',
|
||||
|
@ -66,7 +67,6 @@
|
|||
<template #content>
|
||||
<Ellipsis style="width: calc(100% - 100px)"
|
||||
><span
|
||||
@click.stop="handleView(slotProps.id)"
|
||||
style="font-weight: 600; font-size: 16px"
|
||||
>
|
||||
{{ slotProps.name }}
|
||||
|
|
|
@ -338,7 +338,7 @@ const saveBasicInfo = () =>{
|
|||
{
|
||||
scope: 'amap',
|
||||
properties: {
|
||||
api: form.value.apikey,
|
||||
apiKey: form.value.apikey,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue