fix: 优化物模型配置按钮样式

This commit is contained in:
XieYongHong 2023-10-24 10:24:13 +08:00
parent 09d77f4b07
commit 16d9f5a158
8 changed files with 60 additions and 43 deletions

2
.npmrc
View File

@ -1,2 +1,2 @@
always-auth=true
registry=http://registry.jetlinks.cn/
registry=https://registry.npmjs.org/

View File

@ -25,7 +25,7 @@
"event-source-polyfill": "^1.0.31",
"global": "^4.4.0",
"jetlinks-store": "^0.0.3",
"jetlinks-ui-components": "^1.0.33",
"jetlinks-ui-components": "^1.0.34",
"js-cookie": "^3.0.1",
"jsencrypt": "^3.3.2",
"less": "^4.1.3",

View File

@ -65,16 +65,13 @@
<AIcon type="SettingOutlined" />
配置
</j-button>
</j-tooltip>
<PermissionButton
v-else
:has-permission="`${permission}:update`"
type="link"
key="inputs"
>
<InputParams v-model:value="data.record.inputs" />
</PermissionButton>
<InputParams
v-else
v-model:value="data.record.inputs"
:has-permission="`${permission}:update`"
/>
</template>
<template #output="{ data }">
{{ data.record.output?.type }}
@ -99,14 +96,11 @@
配置
</j-button>
</j-tooltip>
<PermissionButton
v-else
:has-permission="`${permission}:update`"
type="link"
key="properties"
>
<ConfigParams v-model:value="data.record.valueType" />
</PermissionButton>
<ConfigParams
v-else
v-model:value="data.record.valueType"
:has-permission="`${permission}:update`"
/>
</template>
<template #outInput>
object
@ -127,22 +121,17 @@
配置
</j-button> -->
<!-- </j-tooltip> -->
<PermissionButton
:has-permission="`${permission}:update`"
type="link"
key="setting"
:tooltip="target === 'device' && productNoEdit.id?.includes?.(data.record.id) ? {
title: '继承自产品物模型的数据不支持删除',
} : undefined"
>
<OtherSetting
<OtherSetting
v-model:value="data.record.expands"
:id="data.record.id"
:disabled="target === 'device' && productNoEdit.id?.includes?.(data.record.id)"
:record="data.record"
:type="data.record.valueType.type"
:has-permission="`${permission}:update`"
:tooltip="target === 'device' && productNoEdit.id?.includes?.(data.record.id) ? {
title: '继承自产品物模型的数据不支持删除',
} : undefined"
/>
</PermissionButton>
</template>
<template #action="{data}">
@ -563,4 +552,4 @@ onBeforeRouteLeave((to, from, next) => { // 设备管理外路由跳转
justify-content: space-between;
padding-bottom: 16px;
}
</style>
</style>

View File

@ -6,7 +6,15 @@
<template #config="{ data }">
<ConfigModal v-model:value="data.record.valueType" :showOther="false" />
</template>
<ModelButton />
<PermissionButton
key="properties"
:has-permission="hasPermission"
style="padding-left: 0;"
type="link"
>
<AIcon type="SettingOutlined" />
配置
</PermissionButton>
</DataTableObject>
</template>
@ -23,7 +31,7 @@ import {omit} from "lodash-es";
import {TypeStringMap, validatorConfig} from "../../columns";
const columns = [
{
{
title: '参数标识',
dataIndex: 'id',
type: 'text',
@ -52,7 +60,7 @@ const columns = [
]
}
},
{
{
title: '参数名称',
dataIndex: 'name',
type: 'text',
@ -139,6 +147,7 @@ const props = defineProps({
type: Array as PropType<{ label: string; value: string }[]>,
default: () => [],
},
hasPermission: String,
});
const value = ref(props.value.properties);
@ -151,7 +160,7 @@ const confirm = (data: any) => {
})
console.log('ConfigParams',newObject)
emit('update:value', {
properties: newObject,
type: 'object',

View File

@ -9,7 +9,14 @@
<template #config="{ data }">
<ConfigModal v-model:value="data.record.valueType" :showOther="false" />
</template>
<ModelButton />
<PermissionButton
key="properties"
:has-permission="hasPermission"
type="link"
>
<AIcon type="SettingOutlined" />
配置
</PermissionButton>
</DataTableObject>
</template>
@ -43,6 +50,7 @@ const props = defineProps({
type: Array as PropType<{ label: string; value: string }[]>,
default: () => [],
},
hasPermission: String,
});
const formItemContext = Form.useInjectFormItemContext();

View File

@ -17,4 +17,4 @@ const props = defineProps({
<style scoped>
</style>
</style>

View File

@ -51,8 +51,17 @@
/>
</div>
</template>
<ModelButton :disabled="disabled"/>
<PermissionButton
key="setting"
:disabled="disabled"
:has-permission="hasPermission"
:tooltip="tooltip"
style="padding-left: 0;"
type="link"
>
<AIcon type="SettingOutlined" />
配置
</PermissionButton>
</j-popconfirm-modal>
</template>
@ -88,6 +97,8 @@ const props = defineProps({
type: Object,
default: () => ({})
},
hasPermission: String,
tooltip: Object
})
const fullRef = inject(FULL_CODE);
@ -225,4 +236,4 @@ watch(() => props.value, () => {
<style scoped>
</style>
</style>

View File

@ -3738,10 +3738,10 @@ jetlinks-store@^0.0.3:
resolved "https://registry.npmjs.org/jetlinks-store/-/jetlinks-store-0.0.3.tgz"
integrity sha512-AZf/soh1hmmwjBZ00fr1emuMEydeReaI6IBTGByQYhTmK1Zd5pQAxC7WLek2snRAn/HHDgJfVz2hjditKThl6Q==
jetlinks-ui-components@^1.0.33:
version "1.0.33"
resolved "http://registry.jetlinks.cn/jetlinks-ui-components/-/jetlinks-ui-components-1.0.33.tgz#49ce2b8c1e7be66272864728d5df82f834ec4490"
integrity sha512-vYUP4MhzO6r0golmKqO8lHk8w5ldhAkgXWZfFII1Zoa7JtUwveqpSywTU23iSmCN+4muPaSLvHw713k6OdzLmg==
jetlinks-ui-components@^1.0.34:
version "1.0.34"
resolved "https://registry.npmjs.org/jetlinks-ui-components/-/jetlinks-ui-components-1.0.34.tgz#e158f87cf626904fd97b63fa379dbea12dc0230f"
integrity sha512-1O41g3VYrwnHJ3AWCbfbTaq62B55EwLvOC9frbiF1y/Lf+GZBkK1D1R4+gFQF/pgDdonlZoaT5pE1mdZWXrfHQ==
dependencies:
"@vueuse/core" "^9.12.0"
"@vueuse/router" "^9.13.0"