Merge branch 'dev-hub' into dev
This commit is contained in:
commit
407f3a8758
|
@ -99,8 +99,8 @@
|
||||||
@click="handleClick"
|
@click="handleClick"
|
||||||
:active="_selectedRowKeys.includes(slotProps.id)"
|
:active="_selectedRowKeys.includes(slotProps.id)"
|
||||||
class="card-box"
|
class="card-box"
|
||||||
:status="getState(slotProps).value"
|
:status="slotProps?.runningState?.value"
|
||||||
:statusText="getState(slotProps)?.text"
|
:statusText="slotProps?.runningState?.text"
|
||||||
:statusNames="Object.fromEntries(colorMap.entries())"
|
:statusNames="Object.fromEntries(colorMap.entries())"
|
||||||
>
|
>
|
||||||
<template #title>
|
<template #title>
|
||||||
|
@ -282,7 +282,7 @@ import BatchUpdate from './components/BatchUpdate/index.vue';
|
||||||
import SaveModBus from './Save/SaveModBus.vue';
|
import SaveModBus from './Save/SaveModBus.vue';
|
||||||
import SaveOPCUA from './Save/SaveOPCUA.vue';
|
import SaveOPCUA from './Save/SaveOPCUA.vue';
|
||||||
import Scan from './Scan/index.vue';
|
import Scan from './Scan/index.vue';
|
||||||
import { colorMap, getState } from '../data.ts';
|
import { colorMap } from '../data.ts';
|
||||||
import { cloneDeep, isNumber } from 'lodash-es';
|
import { cloneDeep, isNumber } from 'lodash-es';
|
||||||
import { getWebSocket } from '@/utils/websocket';
|
import { getWebSocket } from '@/utils/websocket';
|
||||||
import { map } from 'rxjs/operators';
|
import { map } from 'rxjs/operators';
|
||||||
|
|
|
@ -38,8 +38,14 @@
|
||||||
<j-tag
|
<j-tag
|
||||||
class="tree-left-tag"
|
class="tree-left-tag"
|
||||||
v-if="data.id !== '*'"
|
v-if="data.id !== '*'"
|
||||||
:color="colorMap.get(getState(data)?.value)"
|
:color="colorMap.get(data?.runningState?.value)"
|
||||||
>{{ getState(data)?.text }}</j-tag
|
>{{ data?.runningState?.text }}</j-tag
|
||||||
|
>
|
||||||
|
<j-tag
|
||||||
|
class="tree-left-tag2"
|
||||||
|
v-if="data.id !== '*'"
|
||||||
|
:color="colorMap.get(data?.state?.value)"
|
||||||
|
>{{ data?.state?.text }}</j-tag
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
v-if="data.id !== '*'"
|
v-if="data.id !== '*'"
|
||||||
|
@ -119,7 +125,7 @@ import Save from './Save/index.vue';
|
||||||
import { onlyMessage } from '@/utils/comm';
|
import { onlyMessage } from '@/utils/comm';
|
||||||
import { Store } from 'jetlinks-store';
|
import { Store } from 'jetlinks-store';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import { colorMap, getState } from '../data.ts';
|
import { colorMap } from '../data.ts';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
data: {
|
data: {
|
||||||
|
@ -285,7 +291,7 @@ watch(
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
.tree-container {
|
.tree-container {
|
||||||
padding-right: 24px;
|
padding-right: 24px;
|
||||||
width: 350px;
|
width: 370px;
|
||||||
.add-btn {
|
.add-btn {
|
||||||
margin: 10px 0;
|
margin: 10px 0;
|
||||||
|
|
||||||
|
@ -311,6 +317,11 @@ watch(
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
.tree-left-tag2 {
|
||||||
|
width: 50px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
.func-btns {
|
.func-btns {
|
||||||
// display: none;
|
// display: none;
|
||||||
display: block;
|
display: block;
|
||||||
|
|
|
@ -4,6 +4,8 @@ colorMap.set('partialError', 'warning');
|
||||||
colorMap.set('failed', 'error');
|
colorMap.set('failed', 'error');
|
||||||
colorMap.set('stopped', 'default');
|
colorMap.set('stopped', 'default');
|
||||||
colorMap.set('processing', '#cccccc');
|
colorMap.set('processing', '#cccccc');
|
||||||
|
colorMap.set('enabled', 'processing');
|
||||||
|
colorMap.set('disabled', 'error');
|
||||||
|
|
||||||
export const getState = (record: any) => {
|
export const getState = (record: any) => {
|
||||||
const enabled = record?.state?.value === 'enabled';
|
const enabled = record?.state?.value === 'enabled';
|
||||||
|
|
|
@ -36,9 +36,9 @@ const changeTree = (row: any) => {
|
||||||
min-height: calc(100vh - 180px);
|
min-height: calc(100vh - 180px);
|
||||||
width: 100%;
|
width: 100%;
|
||||||
.left {
|
.left {
|
||||||
width: 350px;
|
width: 370px;
|
||||||
border-right: 1px #eeeeee solid;
|
border-right: 1px #eeeeee solid;
|
||||||
margin: 10px;
|
margin: 10px 10px 0 0;
|
||||||
}
|
}
|
||||||
.right {
|
.right {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
|
|
@ -1021,7 +1021,9 @@
|
||||||
type="primary"
|
type="primary"
|
||||||
@click="saveData"
|
@click="saveData"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
:hasPermission="`link/Type:${id ? 'update' : 'add'}`"
|
:hasPermission="`link/Type:${
|
||||||
|
id !== ':id' ? 'update' : 'add'
|
||||||
|
}`"
|
||||||
>
|
>
|
||||||
保存
|
保存
|
||||||
</PermissionButton>
|
</PermissionButton>
|
||||||
|
@ -1219,7 +1221,9 @@ const saveData = async () => {
|
||||||
|
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
const resp: any =
|
const resp: any =
|
||||||
id === ':id' ? await save(params) : await update({ ...params, id });
|
id === ':id'
|
||||||
|
? await save(params).catch(() => {})
|
||||||
|
: await update({ ...params, id }).catch(() => {});
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
if (resp?.status === 200) {
|
if (resp?.status === 200) {
|
||||||
onlyMessage('操作成功', 'success');
|
onlyMessage('操作成功', 'success');
|
||||||
|
|
Loading…
Reference in New Issue