diff --git a/src/views/device/manager/components/preview/AddNuPreviewForm copy.vue b/src/views/device/manager/components/preview/AddNuPreviewForm copy.vue new file mode 100644 index 0000000..191a4c8 --- /dev/null +++ b/src/views/device/manager/components/preview/AddNuPreviewForm copy.vue @@ -0,0 +1,234 @@ + + + + + + + + + + {{item.nuName}} + + + + + + + + + {{item.deviceName}} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/views/device/manager/components/preview/AddNuPreviewForm.vue b/src/views/device/manager/components/preview/AddNuPreviewForm.vue index 191a4c8..bed39bd 100644 --- a/src/views/device/manager/components/preview/AddNuPreviewForm.vue +++ b/src/views/device/manager/components/preview/AddNuPreviewForm.vue @@ -1,93 +1,134 @@ - - - - - - - - {{item.nuName}} - - - - - - - - - {{item.deviceName}} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + 名称:{{ item.nuName }} + NUID:{{ item.nuId }} + + + + + ▲ 收起 + + + ▼ 展开 + + + + + + + + + + 基础功能: + + {{ item2.nuName }} + + + + {{ item2.nuName }}: + + {{ item3.nuName }} + + + + 暂无基础功能 + + + + + + 设备配置 + + + + {{ device.deviceName }} + + {{ device.factory }} | {{ + device.deviceModel }} + + + + setQuantity(item.nuId, device.id, val)" :min="0" :precision="0" :step="1" + :disabled="disabled" :placeholder="'请输入数量'" class="quantity-input" /> + + + + + + + + + + + + +/* 基础卡片样式 */ +.card-3d { + border-radius: 12px; + border: 1px solid #e8eef4; + background: white; + position: relative; + transition: all 0.3s ease; + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03); + overflow: hidden; +} + +/* 鼠标悬停效果 */ +.card-3d:hover { + border-color: #1890ff; + box-shadow: 0 4px 12px rgba(24, 144, 255, 0.1); + transform: translateY(-2px); +} + +/* 收起状态样式 */ +.card-collapsed { + min-height: auto !important; + height: auto !important; + + :deep(.ant-card-body) { + padding: 16px 20px; + } +} + +/* 卡片内容区域 */ +:deep(.ant-card-body) { + padding: 16px 20px; + transition: padding 0.3s ease; +} + +/* 卡片头部 */ +.card-header { + display: flex; + align-items: center; + justify-content: space-between; + cursor: pointer; + user-select: none; +} + +.card-header .left-area { + flex: 1; + display: flex; + flex-direction: row; + align-items: center; + gap: 24px; +} + +.region-name { + font-size: 16px; + font-weight: bold; +} + +.region-code { + font-size: 14px; + font-weight: bold; + color: darkgrey; +} + +.expand-icon { + font-size: 14px; + color: #1890ff; + padding: 4px 12px; + border-radius: 4px; + transition: all 0.2s ease; + + span { + display: inline-flex; + align-items: center; + gap: 4px; + } +} + +.card-header:hover .expand-icon { + background-color: rgba(24, 144, 255, 0.1); +} + +/* 卡片内容容器 */ +.card-content { + display: flex; + flex-direction: column; + gap: 20px; + margin-top: 16px; + padding-top: 16px; + border-top: 1px solid #f0f2f5; +} + +/* 上半部分 - 左右布局 */ +.top-section { + display: flex; + gap: 20px; + min-height: 100px; +} + +.right-area { + flex: 3; + background: #ffffff; + padding: 12px; + border-radius: 10px; + box-shadow: -2px 0 8px rgba(0, 0, 0, 0.02); +} + +/* 下半部分 - 设备配置(无内部滚动) */ +.bottom-section { + .section-title { + font-size: 14px; + font-weight: 600; + color: #1f2f3d; + margin-bottom: 12px; + padding-left: 4px; + border-left: 3px solid #1890ff; + } +} + +.device-list { + display: flex; + flex-direction: column; + gap: 12px; +} + +.device-item { + display: flex; + align-items: center; + justify-content: space-between; + padding: 12px 16px; + background: #fafbfc; + border-radius: 8px; + transition: all 0.2s ease; + + &:hover { + background: #f5f8ff; + transform: translateX(2px); + } +} + +.device-info { + flex: 1; + + .device-name { + font-size: 14px; + font-weight: 600; + color: #1f2f3d; + margin-bottom: 4px; + } + + .device-detail { + font-size: 12px; + color: #8a9aa8; + line-height: 1.4; + } +} + +.device-quantity { + margin-left: 16px; + + .quantity-input { + width: 130px; + + :deep(.ant-input-number-input) { + text-align: center; + } + } +} + +/* 响应式调整 */ +@media (max-width: 768px) { + .top-section { + flex-direction: column; + } + + .device-item { + flex-direction: column; + align-items: flex-start; + gap: 12px; + } + + .device-quantity { + margin-left: 0; + width: 100%; + + .quantity-input { + width: 100%; + } + } +} + +/* 强制 checkbox 文字显示为黑色 */ +.right-area { + :deep(.ant-checkbox-wrapper), + :deep(.ant-checkbox-wrapper-disabled), + :deep(.ant-checkbox + span), + :deep(.ant-checkbox-disabled + span) { + color: rgba(0, 0, 0, 0.88) !important; + } +} + \ No newline at end of file diff --git a/src/views/device/manager/components/preview/preview.api.ts b/src/views/device/manager/components/preview/preview.api.ts index 0917e78..16af8ed 100644 --- a/src/views/device/manager/components/preview/preview.api.ts +++ b/src/views/device/manager/components/preview/preview.api.ts @@ -8,6 +8,9 @@ enum Api { savePreview = '/iot/device/manager/savePreview', updatePreview = '/iot/device/manager/updatePreview', deletePreview = '/iot/device/manager/deletePreview', + batchSave = '/iot/device/manager/batchSave', + queryQuantityByOrgCode = '/iot/device/manager/queryQuantityByOrgCode', + getNuListByOrgCode = '/iot/device/manager/getNuListByOrgCode', } /** @@ -24,8 +27,17 @@ export const nuList = (params) => defHttp.get({ url: Api.nuList, params }); */ export const savePreview = (params, isUpdate) => { let url = isUpdate ? Api.updatePreview : Api.savePreview; - return defHttp.post({url: url, params}); -} + return defHttp.post({ url: url, params }); +}; + +/** + * 批量保存 + * @param params + * @returns + */ +export const batchSave = (params) => { + return defHttp.post({ url: Api.batchSave, params }); +}; /** * 删除 @@ -33,4 +45,10 @@ export const savePreview = (params, isUpdate) => { */ export const deletePreview = (params) => defHttp.post({ url: Api.deletePreview, params }); +export const queryQuantityByOrgCode = (params) => { + return defHttp.get({ url: Api.queryQuantityByOrgCode, params }); +}; +export const getNuListByOrgCode = (params) => { + return defHttp.get({ url: Api.getNuListByOrgCode, params }); +}; \ No newline at end of file