Compare commits
2 Commits
feat/更新采集模
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
82ae99fca8 | ||
|
|
7ede037dd3 |
5
.env
5
.env
@@ -17,5 +17,8 @@ VUE_APP_I18N_FALLBACK_LOCALE=en
|
||||
VUE_APP_ELEMENT_COLOR=#409EFF
|
||||
|
||||
# 后台接口地址(代理目标)
|
||||
VUE_APP_BASE_URL=http://127.0.0.1:8787/background/
|
||||
VUE_APP_BASE_URL=http://127.0.0.1:22666/background/
|
||||
|
||||
# 部署路径
|
||||
VUE_APP_PUBLIC_PATH=/dist/
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
18.16.0
|
||||
20.19.0
|
||||
|
||||
30
README.md
30
README.md
@@ -10,7 +10,7 @@
|
||||
|
||||
| 工具 | 锁定版本 | 作用 |
|
||||
| --- | --- | --- |
|
||||
| **Node.js** | `18.16.0` | JavaScript 运行时(`.node-version` 文件) |
|
||||
| **Node.js** | `20.19.0` | JavaScript 运行时(`.node-version` 文件) |
|
||||
| **pnpm** | `10.33.0` | 包管理器(`package.json` → `packageManager` 字段) |
|
||||
|
||||
> 配置文件说明:
|
||||
@@ -80,20 +80,20 @@ pnpm --version # 应输出 10.33.0
|
||||
git clone <仓库地址>
|
||||
cd mes-ui
|
||||
|
||||
# Volta 检测到 .node-version 后,自动下载并安装 Node.js 18.16.0
|
||||
# 如果你本机没有这个版本,Volta 会提示 "Fetching node@18.16.0" —— 等它完成即可
|
||||
node --version # 应输出 v18.16.0
|
||||
# Volta 检测到 .node-version 后,自动下载并安装 Node.js 20.19.0
|
||||
# 如果你本机没有这个版本,Volta 会提示 "Fetching node@20.19.0" —— 等它完成即可
|
||||
node --version # 应输出 v20.19.0
|
||||
|
||||
# 安装依赖
|
||||
pnpm install
|
||||
```
|
||||
|
||||
> **没有安装 Node 18.16.0 怎么办?**
|
||||
> **没有安装 Node 20.19.0 怎么办?**
|
||||
> **Volta 用户**:无需手动操作。进入项目目录时 Volta 会自动检测 `.node-version`,如果本机缺这个版本,它会**自动下载安装**,你只需等待几秒终端提示完成即可。
|
||||
> **nvm 用户**:执行 `nvm install 18.16.0 && nvm use 18.16.0`。
|
||||
> **手动安装**:去 [nodejs.org](https://nodejs.org/) 下载 Node.js 18.16.0 安装包。
|
||||
> **nvm 用户**:执行 `nvm install 20.19.0 && nvm use 20.19.0`。
|
||||
> **手动安装**:去 [nodejs.org](https://nodejs.org/) 下载 Node.js 20.19.0 安装包。
|
||||
>
|
||||
> 装完后建议运行 `node --version` 确认输出 `v18.16.0`,否则 `pnpm install` 会因为 `engine-strict=true` 直接报错拒绝安装。
|
||||
> 装完后建议运行 `node --version` 确认输出 `v20.19.0`,否则 `pnpm install` 会因为 `engine-strict=true` 直接报错拒绝安装。
|
||||
|
||||
### 第四步:配置环境变量
|
||||
|
||||
@@ -135,10 +135,10 @@ pnpm serve
|
||||
|
||||
```
|
||||
项目根目录
|
||||
├── .node-version → 18.16.0(Volta 自动读取切换)
|
||||
├── .node-version → 20.19.0(Volta 自动读取切换)
|
||||
```
|
||||
|
||||
- Volta 进入项目目录时自动将 Node.js 切换为 `18.16.0`
|
||||
- Volta 进入项目目录时自动将 Node.js 切换为 `20.19.0`
|
||||
- 如果该版本未安装,Volta 会自动下载并安装
|
||||
- 传统方案(nvm)也兼容:`nvm use` 读取 `.nvmrc`,本项目同时提供 `.node-version` 供 Volta 使用
|
||||
|
||||
@@ -203,7 +203,7 @@ mes-ui/
|
||||
├── .env / .env.development / .env.preview # 环境变量
|
||||
├── .eslintignore / .eslintrc.js # ESLint 配置
|
||||
├── .gitignore # Git 忽略配置
|
||||
├── .node-version # Volta Node.js 版本锁定(18.16.0)
|
||||
├── .node-version # Volta Node.js 版本锁定(20.19.0)
|
||||
├── .npmrc # pnpm 配置(版本强校验)
|
||||
├── .postcssrc.js # PostCSS 配置
|
||||
├── babel.config.js # Babel 配置
|
||||
@@ -307,7 +307,7 @@ mes-ui/
|
||||
**先排查版本:**
|
||||
|
||||
```bash
|
||||
node --version # 项目要求 >=18.16.0 <19
|
||||
node --version # 项目要求 >=20.19.0 <19
|
||||
pnpm --version # 项目要求 >=10.33.0 <11
|
||||
```
|
||||
|
||||
@@ -315,9 +315,9 @@ pnpm --version # 项目要求 >=10.33.0 <11
|
||||
|
||||
| 情景 | 解决办法 |
|
||||
| --- | --- |
|
||||
| **用 Volta**(推荐) | `volta install node@18.16.0` + `volta install pnpm@10.33.0`,进入项目目录自动生效 |
|
||||
| **用 nvm** | `nvm install 18.16.0 && nvm use 18.16.0`,再 `npm install -g pnpm@10.33.0` |
|
||||
| **手动安装** | 去 [nodejs.org](https://nodejs.org/) 下载 18.16.0,再 `npm install -g pnpm@10.33.0` |
|
||||
| **用 Volta**(推荐) | `volta install node@20.19.0` + `volta install pnpm@10.33.0`,进入项目目录自动生效 |
|
||||
| **用 nvm** | `nvm install 20.19.0 && nvm use 20.19.0`,再 `npm install -g pnpm@10.33.0` |
|
||||
| **手动安装** | 去 [nodejs.org](https://nodejs.org/) 下载 20.19.0,再 `npm install -g pnpm@10.33.0` |
|
||||
| **已有正确版本但切换不生效** | 重新打开终端,确保 `volta` / `nvm` 已正确加载 |
|
||||
|
||||
> 版本验证通过后,重新执行 `pnpm install`。
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
import { request } from '@/api/_service'
|
||||
|
||||
const BASE = 'scada_manage/device_gather_management/management/'
|
||||
|
||||
export function getDeviceGatherManagementAll (data) {
|
||||
return request({ url: BASE + 'all', method: 'post', data: { method: 'scada_manage_device_gather_management_management_all', platform: 'background', ...data } })
|
||||
}
|
||||
export function deviceDataExportTask (data) {
|
||||
return request({ url: BASE + 'device_data_export_task', method: 'post', data: { method: 'scada_manage_device_gather_management_management_device_data_export_task', platform: 'background', ...data } })
|
||||
}
|
||||
@@ -1,108 +0,0 @@
|
||||
import axios from 'axios'
|
||||
import { request } from '@/api/_service'
|
||||
|
||||
const EDGE_BASE = process.env.VUE_APP_HSLSERVER_API
|
||||
const EDGE_PASSWORD = process.env.VUE_APP_HSLSERVER_PASSWORD
|
||||
|
||||
function edgeUrl (query = '') {
|
||||
return query ? `${EDGE_BASE}?${query}` : EDGE_BASE
|
||||
}
|
||||
|
||||
export function edgeGet (url) {
|
||||
return axios({ method: 'get', url }).then(res => res.data)
|
||||
}
|
||||
|
||||
export function edgePost (url, data) {
|
||||
return axios({ method: 'post', url, data }).then(res => res.data)
|
||||
}
|
||||
|
||||
export function addNode (data) { return edgePost(EDGE_BASE, data) }
|
||||
export function updateNode (data) { return edgePost(EDGE_BASE, data) }
|
||||
export function removeNode (data) { return edgePost(EDGE_BASE, data) }
|
||||
|
||||
export function getQueryNode (data = {}) {
|
||||
const params = new URLSearchParams()
|
||||
params.set('query', 'nodes')
|
||||
params.set('currentPage', data.currentPage || data.page_no || 1)
|
||||
params.set('pageSize', data.pageSize || data.page_size || 10)
|
||||
params.set('working_subclass', data.working_subclass || '')
|
||||
params.set('category', data.categoryName || data.category || '')
|
||||
return edgeGet(edgeUrl(params.toString()))
|
||||
}
|
||||
|
||||
export function getQueryWorkingSubclasses (data = {}) {
|
||||
const params = new URLSearchParams()
|
||||
params.set('query', 'working_subclasses')
|
||||
if (data.device_code) params.set('device_code', data.device_code)
|
||||
return edgeGet(edgeUrl(params.toString()))
|
||||
}
|
||||
|
||||
export function getQueryCodes (workingSubclass, deviceCode) {
|
||||
const params = new URLSearchParams()
|
||||
params.set('query', 'codes')
|
||||
params.set('working_subclass', workingSubclass || '')
|
||||
if (deviceCode) params.set('device_code', deviceCode)
|
||||
return edgeGet(edgeUrl(params.toString()))
|
||||
}
|
||||
|
||||
export function getNodeValue () { return edgeGet(edgeUrl('query=nodes_value')) }
|
||||
export function getNodeAll () { return edgeGet(edgeUrl('query=nodes_all')) }
|
||||
|
||||
export function getNodeMappingDeviceList (data = {}) {
|
||||
const params = new URLSearchParams()
|
||||
params.set('query', 'node_mapping_device_list')
|
||||
if (data.page_no !== undefined) params.set('currentPage', data.page_no)
|
||||
if (data.page_size !== undefined) params.set('pageSize', data.page_size)
|
||||
if (data.scada_data_capture_node_code) params.set('scada_data_capture_node_code', data.scada_data_capture_node_code)
|
||||
if (data.device_code) params.set('device_code', data.device_code)
|
||||
return edgeGet(edgeUrl(params.toString()))
|
||||
}
|
||||
|
||||
export function addNodeMappingDevice (data) { return edgePost(EDGE_BASE, data) }
|
||||
export function editNodeMappingDevice (data) { return edgePost(EDGE_BASE, data) }
|
||||
export function delNodeMappingDevice (data) { return edgePost(EDGE_BASE, data) }
|
||||
|
||||
export function getExecLog (data = {}) {
|
||||
const params = new URLSearchParams()
|
||||
params.set('query', 'get_exec_log')
|
||||
params.set('page_no', data.page_no || 1)
|
||||
params.set('page_size', data.page_size || 10)
|
||||
if (data.create_date) params.set('create_date', data.create_date)
|
||||
if (data.command) params.set('command', data.command)
|
||||
if (data.server_name) params.set('server_name', data.server_name)
|
||||
if (data.device_name) params.set('device_name', data.device_name)
|
||||
return edgeGet(edgeUrl(params.toString()))
|
||||
}
|
||||
|
||||
export function getQueryNodeData (data = {}) {
|
||||
const params = new URLSearchParams()
|
||||
params.set('query', 'node_data')
|
||||
params.set('startRow', data.startRow || 0)
|
||||
params.set('endRow', data.endRow || 50)
|
||||
params.set('working_subclass', data.workingSubclass || data.working_subclass || '')
|
||||
params.set('wipCode', data.wipCode || '')
|
||||
params.set('start_time', data.startTime || '')
|
||||
params.set('end_time', data.endTime || '')
|
||||
params.set('dedup', data.dedup === undefined ? 1 : data.dedup)
|
||||
if (data.code) params.set('code', Array.isArray(data.code) ? data.code.join(',') : data.code)
|
||||
if (data.device_code) params.set('device_code', data.device_code)
|
||||
return edgeGet(edgeUrl(params.toString()))
|
||||
}
|
||||
|
||||
export function queryServers () { return request({ url: `${EDGE_BASE}?query=servers` }) }
|
||||
export function addServer (data) { return request({ url: EDGE_BASE, method: 'post', data }) }
|
||||
export function updateServer (data) { return request({ url: EDGE_BASE, method: 'post', data }) }
|
||||
export function removeServer (data) { return request({ url: EDGE_BASE, method: 'post', data }) }
|
||||
export function setServerExec (data) { return request({ url: EDGE_BASE, method: 'post', data }) }
|
||||
|
||||
export function verifyServer (url) {
|
||||
return request({ auth: { username: 'admin', password: EDGE_PASSWORD }, method: 'post', url: `${url}/Admin/ServerSettingsRequest` })
|
||||
}
|
||||
|
||||
export function modifyServer (url, data) {
|
||||
return request({ auth: { username: 'admin', password: EDGE_PASSWORD }, method: 'post', url: `${url}/Admin/ServerSettingsModify`, data })
|
||||
}
|
||||
|
||||
export function getServeDeviceMonitoring (url) {
|
||||
return request({ auth: { username: 'admin', password: EDGE_PASSWORD }, url: `${url}/Edge/DeviceData?data=/` })
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
import { request } from '@/api/_service'
|
||||
|
||||
const BASE = 'scada_manage/workshop/config/'
|
||||
|
||||
export function getWorkshopConfigAll (data) {
|
||||
return request({ url: BASE + 'all', method: 'get', params: { method: 'scada_manage_workshop_config_all', platform: 'background', ...data } })
|
||||
}
|
||||
export function getWorkshopConfigList (data) {
|
||||
return request({ url: BASE + 'list', method: 'get', params: { method: 'scada_manage_workshop_config_list', platform: 'background', ...data } })
|
||||
}
|
||||
export function createWorkshopConfig (data) {
|
||||
return request({ url: BASE + 'create', method: 'post', data: { method: 'scada_manage_workshop_config_create', platform: 'background', ...data } })
|
||||
}
|
||||
export function editWorkshopConfig (data) {
|
||||
return request({ url: BASE + 'edit', method: 'put', data: { method: 'scada_manage_workshop_config_edit', platform: 'background', ...data } })
|
||||
}
|
||||
export function deleteWorkshopConfig (data) {
|
||||
return request({ url: BASE + 'delete', method: 'delete', data: { method: 'scada_manage_workshop_config_delete', platform: 'background', ...data } })
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
import { request } from '@/api/_service'
|
||||
|
||||
const BASE = 'scada_manage/workshop/point/'
|
||||
|
||||
export function getWorkshopPointAll (data) {
|
||||
return request({ url: BASE + 'all', method: 'get', params: { method: 'scada_manage_workshop_point_all', platform: 'background', ...data } })
|
||||
}
|
||||
export function getWorkshopPointList (data) {
|
||||
return request({ url: BASE + 'list', method: 'get', params: { method: 'scada_manage_workshop_point_list', platform: 'background', ...data } })
|
||||
}
|
||||
export function createWorkshopPoint (data) {
|
||||
return request({ url: BASE + 'create', method: 'post', data: { method: 'scada_manage_workshop_point_create', platform: 'background', ...data } })
|
||||
}
|
||||
export function editWorkshopPoint (data) {
|
||||
return request({ url: BASE + 'edit', method: 'put', data: { method: 'scada_manage_workshop_point_edit', platform: 'background', ...data } })
|
||||
}
|
||||
export function deleteWorkshopPoint (data) {
|
||||
return request({ url: BASE + 'delete', method: 'delete', data: { method: 'scada_manage_workshop_point_delete', platform: 'background', ...data } })
|
||||
}
|
||||
export function importExcel (data) {
|
||||
return request({ url: BASE + 'import', method: 'post', data: { method: 'scada_manage_workshop_point_delete', platform: 'background', ...data } })
|
||||
}
|
||||
export function getWorkshopNodeAll (data) {
|
||||
return request({ url: BASE + 'node_all', method: 'get', data: { method: 'scada_manage_workshop_point_node_all', platform: 'background', ...data } })
|
||||
}
|
||||
@@ -4877,349 +4877,7 @@
|
||||
"sample_value": "Sample Value"
|
||||
}
|
||||
}
|
||||
,
|
||||
"scada_manage": {
|
||||
"basic_configuration": {
|
||||
"scada_configure": {
|
||||
"search": "Search",
|
||||
"reset": "Reset",
|
||||
"query": "Query",
|
||||
"add": "Add",
|
||||
"edit": "Edit",
|
||||
"delete": "Delete",
|
||||
"operation": "Operation",
|
||||
"confirm": "Confirm",
|
||||
"cancel": "Cancel",
|
||||
"tip": "Tip",
|
||||
"confirm_delete": "Confirm this operation?",
|
||||
"operation_success": "Operation succeeded",
|
||||
"please_select": "Please select records",
|
||||
"sort": "No.",
|
||||
"code": "Code",
|
||||
"name": "Name",
|
||||
"remark": "Remark",
|
||||
"note": "Note",
|
||||
"create_time": "Create Time",
|
||||
"created_time": "Created Time",
|
||||
"add_title": "Add",
|
||||
"edit_title": "Edit",
|
||||
"enter_code": "Enter code",
|
||||
"enter_name": "Enter name",
|
||||
"enter_remark": "Enter remark",
|
||||
"type": "Type",
|
||||
"data_category": "Data Category",
|
||||
"working_subclass": "Process Unit",
|
||||
"data_length": "Data Length",
|
||||
"unit": "Unit",
|
||||
"select_type": "Select type",
|
||||
"select_data_category": "Select data category",
|
||||
"select_working_subclass": "Select process unit",
|
||||
"enter_data_length": "Enter data length",
|
||||
"enter_unit": "Enter unit",
|
||||
"device_status": "Device Status",
|
||||
"item_id_item": "Item ID Item",
|
||||
"device_data": "Device Data",
|
||||
"process_data": "Process Data",
|
||||
"result_data": "Result Data",
|
||||
"statistical_data": "Statistical Data",
|
||||
"inspection_data": "Inspection Data",
|
||||
"batch_import": "Batch Import",
|
||||
"download_template": "Download Template"
|
||||
},
|
||||
"ems_configure": {
|
||||
"search": "Search",
|
||||
"reset": "Reset",
|
||||
"query": "Query",
|
||||
"add": "Add",
|
||||
"edit": "Edit",
|
||||
"delete": "Delete",
|
||||
"operation": "Operation",
|
||||
"confirm": "Confirm",
|
||||
"cancel": "Cancel",
|
||||
"tip": "Tip",
|
||||
"confirm_delete": "Confirm this operation?",
|
||||
"operation_success": "Operation succeeded",
|
||||
"please_select": "Please select records",
|
||||
"sort": "No.",
|
||||
"code": "Code",
|
||||
"name": "Name",
|
||||
"remark": "Remark",
|
||||
"note": "Note",
|
||||
"create_time": "Create Time",
|
||||
"created_time": "Created Time",
|
||||
"add_title": "Add",
|
||||
"edit_title": "Edit",
|
||||
"enter_code": "Enter code",
|
||||
"enter_name": "Enter name",
|
||||
"enter_remark": "Enter remark",
|
||||
"type": "Type",
|
||||
"data_category": "Data Category",
|
||||
"working_subclass": "Process Unit",
|
||||
"data_length": "Data Length",
|
||||
"unit": "Unit",
|
||||
"select_type": "Select type",
|
||||
"select_data_category": "Select data category",
|
||||
"select_working_subclass": "Select process unit",
|
||||
"enter_data_length": "Enter data length",
|
||||
"enter_unit": "Enter unit",
|
||||
"device_status": "Device Status",
|
||||
"item_id_item": "Item ID Item",
|
||||
"device_data": "Device Data",
|
||||
"process_data": "Process Data",
|
||||
"result_data": "Result Data",
|
||||
"statistical_data": "Statistical Data",
|
||||
"inspection_data": "Inspection Data",
|
||||
"batch_import": "Batch Import",
|
||||
"download_template": "Download Template",
|
||||
"environmental_data": "Environmental Data"
|
||||
},
|
||||
"node_mapping_device_code": {
|
||||
"search": "Search",
|
||||
"reset": "Reset",
|
||||
"query": "Query",
|
||||
"add": "Add",
|
||||
"edit": "Edit",
|
||||
"delete": "Delete",
|
||||
"operation": "Operation",
|
||||
"confirm": "Confirm",
|
||||
"cancel": "Cancel",
|
||||
"tip": "Tip",
|
||||
"confirm_delete": "Confirm this operation?",
|
||||
"operation_success": "Operation succeeded",
|
||||
"please_select": "Please select records",
|
||||
"sort": "No.",
|
||||
"code": "Code",
|
||||
"name": "Name",
|
||||
"remark": "Remark",
|
||||
"note": "Note",
|
||||
"create_time": "Create Time",
|
||||
"created_time": "Created Time",
|
||||
"add_title": "Add",
|
||||
"edit_title": "Edit",
|
||||
"enter_code": "Enter code",
|
||||
"enter_name": "Enter name",
|
||||
"enter_remark": "Enter remark",
|
||||
"add_mapping": "Add Mapping",
|
||||
"edit_mapping": "Edit Mapping",
|
||||
"node_code": "Node Code",
|
||||
"enter_node_code": "Enter node code",
|
||||
"node_name": "Node Name",
|
||||
"mapping_device": "Mapping Device",
|
||||
"device_code": "Device Code",
|
||||
"select_device_code": "Select device code",
|
||||
"process_unit": "Process Unit",
|
||||
"select_process_unit": "Select process unit",
|
||||
"data_node": "Data Node",
|
||||
"select_data_node": "Select data node",
|
||||
"enter_note": "Enter note"
|
||||
},
|
||||
"edgeserverconfigure": {
|
||||
"search": "Search",
|
||||
"reset": "Reset",
|
||||
"query": "Query",
|
||||
"add": "Add",
|
||||
"edit": "Edit",
|
||||
"delete": "Delete",
|
||||
"operation": "Operation",
|
||||
"confirm": "Confirm",
|
||||
"cancel": "Cancel",
|
||||
"tip": "Tip",
|
||||
"confirm_delete": "Confirm this operation?",
|
||||
"operation_success": "Operation succeeded",
|
||||
"please_select": "Please select records",
|
||||
"sort": "No.",
|
||||
"code": "Code",
|
||||
"name": "Name",
|
||||
"remark": "Remark",
|
||||
"note": "Note",
|
||||
"create_time": "Create Time",
|
||||
"created_time": "Created Time",
|
||||
"add_title": "Add",
|
||||
"edit_title": "Edit",
|
||||
"enter_code": "Enter code",
|
||||
"enter_name": "Enter name",
|
||||
"enter_remark": "Enter remark",
|
||||
"status": "Status",
|
||||
"updated": "Updated",
|
||||
"changed": "Changed",
|
||||
"port": "Port",
|
||||
"address": "Address",
|
||||
"service_name": "Service Name",
|
||||
"enter_service_name": "Enter service name",
|
||||
"unique_identifier": "Unique Identifier",
|
||||
"unique_identifier_tip": "Returned after test succeeds",
|
||||
"enter_url": "Enter service URL",
|
||||
"enter_port": "Enter port",
|
||||
"enter_address": "Enter binding address",
|
||||
"test": "Test",
|
||||
"test_success": "Test passed",
|
||||
"device_configuration": "Device Configuration",
|
||||
"restart_service": "Restart Service",
|
||||
"confirm_restart": "Restart this service?",
|
||||
"request_success": "Request succeeded and was added to queue",
|
||||
"device_config_tip": "Device configuration is migrated to a drawer and can be extended here."
|
||||
},
|
||||
"edgeservermonitor": {
|
||||
"device_type": "Device Type",
|
||||
"ip_port": "IP/Port",
|
||||
"activity_time": "Activity Time",
|
||||
"success_count": "Success Count",
|
||||
"failure_count": "Failure Count",
|
||||
"device_stop": "Stop",
|
||||
"device_continue": "Start",
|
||||
"request_success": "Request succeeded"
|
||||
},
|
||||
"edgeserver_log": {
|
||||
"search": "Search",
|
||||
"reset": "Reset",
|
||||
"query": "Query",
|
||||
"add": "Add",
|
||||
"edit": "Edit",
|
||||
"delete": "Delete",
|
||||
"operation": "Operation",
|
||||
"confirm": "Confirm",
|
||||
"cancel": "Cancel",
|
||||
"tip": "Tip",
|
||||
"confirm_delete": "Confirm this operation?",
|
||||
"operation_success": "Operation succeeded",
|
||||
"please_select": "Please select records",
|
||||
"sort": "No.",
|
||||
"code": "Code",
|
||||
"name": "Name",
|
||||
"remark": "Remark",
|
||||
"note": "Note",
|
||||
"create_time": "Create Time",
|
||||
"created_time": "Created Time",
|
||||
"add_title": "Add",
|
||||
"edit_title": "Edit",
|
||||
"enter_code": "Enter code",
|
||||
"enter_name": "Enter name",
|
||||
"enter_remark": "Enter remark",
|
||||
"server_name": "Server Name",
|
||||
"device_name": "Device Name",
|
||||
"command": "Command",
|
||||
"status": "Status",
|
||||
"success": "Success",
|
||||
"danger": "Failure",
|
||||
"server_restart": "Restart Server",
|
||||
"server_close": "Close Server",
|
||||
"device_stop": "Stop Device",
|
||||
"device_continue": "Continue Device",
|
||||
"stop_device": "Stop Device",
|
||||
"warning_device": "Warning Device"
|
||||
},
|
||||
"scada_query": {
|
||||
"workingsubclass": "Process Unit",
|
||||
"node_code": "Node Code",
|
||||
"collection_time": "Collection Time",
|
||||
"to": "to",
|
||||
"time_start": "Start Time",
|
||||
"time_end": "End Time",
|
||||
"yes": "Yes",
|
||||
"no": "No",
|
||||
"select_all_nodes": "Select All Nodes",
|
||||
"query": "Query",
|
||||
"export_excel": "Export Excel",
|
||||
"export_task_created": "Export task created"
|
||||
},
|
||||
"ems_query": {
|
||||
"workingsubclass": "Process Unit",
|
||||
"node_code": "Node Code",
|
||||
"collection_time": "Collection Time",
|
||||
"to": "to",
|
||||
"time_start": "Start Time",
|
||||
"time_end": "End Time",
|
||||
"yes": "Yes",
|
||||
"no": "No",
|
||||
"select_all_nodes": "Select All Nodes",
|
||||
"query": "Query",
|
||||
"export_excel": "Export Excel",
|
||||
"export_task_created": "Export task created"
|
||||
}
|
||||
},
|
||||
"workshop_manage": {
|
||||
"workshop_config": {
|
||||
"search": "Search",
|
||||
"reset": "Reset",
|
||||
"query": "Query",
|
||||
"add": "Add",
|
||||
"edit": "Edit",
|
||||
"delete": "Delete",
|
||||
"operation": "Operation",
|
||||
"confirm": "Confirm",
|
||||
"cancel": "Cancel",
|
||||
"tip": "Tip",
|
||||
"confirm_delete": "Confirm this operation?",
|
||||
"operation_success": "Operation succeeded",
|
||||
"please_select": "Please select records",
|
||||
"sort": "No.",
|
||||
"code": "Code",
|
||||
"name": "Name",
|
||||
"remark": "Remark",
|
||||
"note": "Note",
|
||||
"create_time": "Create Time",
|
||||
"created_time": "Created Time",
|
||||
"add_title": "Add",
|
||||
"edit_title": "Edit",
|
||||
"enter_code": "Enter code",
|
||||
"enter_name": "Enter name",
|
||||
"enter_remark": "Enter remark",
|
||||
"building": "Building",
|
||||
"floor": "Floor",
|
||||
"enter_building": "Enter building",
|
||||
"enter_floor": "Enter floor"
|
||||
},
|
||||
"workshop_point": {
|
||||
"search": "Search",
|
||||
"reset": "Reset",
|
||||
"query": "Query",
|
||||
"add": "Add",
|
||||
"edit": "Edit",
|
||||
"delete": "Delete",
|
||||
"operation": "Operation",
|
||||
"confirm": "Confirm",
|
||||
"cancel": "Cancel",
|
||||
"tip": "Tip",
|
||||
"confirm_delete": "Confirm this operation?",
|
||||
"operation_success": "Operation succeeded",
|
||||
"please_select": "Please select records",
|
||||
"sort": "No.",
|
||||
"code": "Code",
|
||||
"name": "Name",
|
||||
"remark": "Remark",
|
||||
"note": "Note",
|
||||
"create_time": "Create Time",
|
||||
"created_time": "Created Time",
|
||||
"add_title": "Add",
|
||||
"edit_title": "Edit",
|
||||
"enter_code": "Enter code",
|
||||
"enter_name": "Enter name",
|
||||
"enter_remark": "Enter remark",
|
||||
"workshop_name": "Workshop",
|
||||
"select_workshop": "Select workshop",
|
||||
"category": "Point Type",
|
||||
"select_category": "Select point type",
|
||||
"workshop_area": "Workshop Area",
|
||||
"single_device": "Single Device",
|
||||
"offline_area": "Offline Area"
|
||||
}
|
||||
},
|
||||
"device_gather": {
|
||||
"battery_device_gather_monitor": {
|
||||
"device_type": "Device Type",
|
||||
"ip_port": "IP/Port",
|
||||
"activity_time": "Activity Time",
|
||||
"success_count": "Success Count",
|
||||
"failure_count": "Failure Count",
|
||||
"device_stop": "Stop",
|
||||
"device_continue": "Start",
|
||||
"request_success": "Request succeeded",
|
||||
"refresh": "Refresh",
|
||||
"last_refresh_time": "Last Refresh Time",
|
||||
"stop_device": "Stop Device"
|
||||
}
|
||||
}
|
||||
}},
|
||||
},
|
||||
"__MENU_TEMP_BEGIN__": "===== 以下为临时菜单翻译,后续统一删除 =====",
|
||||
"设备类型": "Device Type",
|
||||
"首页": "Home",
|
||||
|
||||
@@ -4877,349 +4877,7 @@
|
||||
"sample_value": "样本值"
|
||||
}
|
||||
}
|
||||
,
|
||||
"scada_manage": {
|
||||
"basic_configuration": {
|
||||
"scada_configure": {
|
||||
"search": "查询",
|
||||
"reset": "重置",
|
||||
"query": "查询",
|
||||
"add": "新增",
|
||||
"edit": "编辑",
|
||||
"delete": "删除",
|
||||
"operation": "操作",
|
||||
"confirm": "确定",
|
||||
"cancel": "取消",
|
||||
"tip": "提示",
|
||||
"confirm_delete": "确定要执行该操作吗?",
|
||||
"operation_success": "操作成功",
|
||||
"please_select": "请选择要操作的数据",
|
||||
"sort": "序号",
|
||||
"code": "编码",
|
||||
"name": "名称",
|
||||
"remark": "备注",
|
||||
"note": "备注",
|
||||
"create_time": "创建时间",
|
||||
"created_time": "创建日期",
|
||||
"add_title": "新增",
|
||||
"edit_title": "编辑",
|
||||
"enter_code": "请输入编码",
|
||||
"enter_name": "请输入名称",
|
||||
"enter_remark": "请输入备注",
|
||||
"type": "类型",
|
||||
"data_category": "数据类别",
|
||||
"working_subclass": "工序单元",
|
||||
"data_length": "数据长度",
|
||||
"unit": "单位",
|
||||
"select_type": "请选择类型",
|
||||
"select_data_category": "请选择数据类别",
|
||||
"select_working_subclass": "请选择工序单元",
|
||||
"enter_data_length": "请输入数据长度",
|
||||
"enter_unit": "请输入单位",
|
||||
"device_status": "设备状态",
|
||||
"item_id_item": "条码项",
|
||||
"device_data": "设备数据",
|
||||
"process_data": "过程数据",
|
||||
"result_data": "结果数据",
|
||||
"statistical_data": "统计数据",
|
||||
"inspection_data": "点检数据",
|
||||
"batch_import": "批量导入",
|
||||
"download_template": "下载模板"
|
||||
},
|
||||
"ems_configure": {
|
||||
"search": "查询",
|
||||
"reset": "重置",
|
||||
"query": "查询",
|
||||
"add": "新增",
|
||||
"edit": "编辑",
|
||||
"delete": "删除",
|
||||
"operation": "操作",
|
||||
"confirm": "确定",
|
||||
"cancel": "取消",
|
||||
"tip": "提示",
|
||||
"confirm_delete": "确定要执行该操作吗?",
|
||||
"operation_success": "操作成功",
|
||||
"please_select": "请选择要操作的数据",
|
||||
"sort": "序号",
|
||||
"code": "编码",
|
||||
"name": "名称",
|
||||
"remark": "备注",
|
||||
"note": "备注",
|
||||
"create_time": "创建时间",
|
||||
"created_time": "创建日期",
|
||||
"add_title": "新增",
|
||||
"edit_title": "编辑",
|
||||
"enter_code": "请输入编码",
|
||||
"enter_name": "请输入名称",
|
||||
"enter_remark": "请输入备注",
|
||||
"type": "类型",
|
||||
"data_category": "数据类别",
|
||||
"working_subclass": "工序单元",
|
||||
"data_length": "数据长度",
|
||||
"unit": "单位",
|
||||
"select_type": "请选择类型",
|
||||
"select_data_category": "请选择数据类别",
|
||||
"select_working_subclass": "请选择工序单元",
|
||||
"enter_data_length": "请输入数据长度",
|
||||
"enter_unit": "请输入单位",
|
||||
"device_status": "设备状态",
|
||||
"item_id_item": "条码项",
|
||||
"device_data": "设备数据",
|
||||
"process_data": "过程数据",
|
||||
"result_data": "结果数据",
|
||||
"statistical_data": "统计数据",
|
||||
"inspection_data": "点检数据",
|
||||
"batch_import": "批量导入",
|
||||
"download_template": "下载模板",
|
||||
"environmental_data": "环控数据"
|
||||
},
|
||||
"node_mapping_device_code": {
|
||||
"search": "查询",
|
||||
"reset": "重置",
|
||||
"query": "查询",
|
||||
"add": "新增",
|
||||
"edit": "编辑",
|
||||
"delete": "删除",
|
||||
"operation": "操作",
|
||||
"confirm": "确定",
|
||||
"cancel": "取消",
|
||||
"tip": "提示",
|
||||
"confirm_delete": "确定要执行该操作吗?",
|
||||
"operation_success": "操作成功",
|
||||
"please_select": "请选择要操作的数据",
|
||||
"sort": "序号",
|
||||
"code": "编码",
|
||||
"name": "名称",
|
||||
"remark": "备注",
|
||||
"note": "备注",
|
||||
"create_time": "创建时间",
|
||||
"created_time": "创建日期",
|
||||
"add_title": "新增",
|
||||
"edit_title": "编辑",
|
||||
"enter_code": "请输入编码",
|
||||
"enter_name": "请输入名称",
|
||||
"enter_remark": "请输入备注",
|
||||
"add_mapping": "新增映射",
|
||||
"edit_mapping": "编辑映射",
|
||||
"node_code": "节点编码",
|
||||
"enter_node_code": "请输入节点编码",
|
||||
"node_name": "节点名称",
|
||||
"mapping_device": "映射设备",
|
||||
"device_code": "设备编码",
|
||||
"select_device_code": "请选择设备编码",
|
||||
"process_unit": "工序单元",
|
||||
"select_process_unit": "请选择工序单元",
|
||||
"data_node": "数据节点",
|
||||
"select_data_node": "请选择数据节点",
|
||||
"enter_note": "请输入备注"
|
||||
},
|
||||
"edgeserverconfigure": {
|
||||
"search": "查询",
|
||||
"reset": "重置",
|
||||
"query": "查询",
|
||||
"add": "新增",
|
||||
"edit": "编辑",
|
||||
"delete": "删除",
|
||||
"operation": "操作",
|
||||
"confirm": "确定",
|
||||
"cancel": "取消",
|
||||
"tip": "提示",
|
||||
"confirm_delete": "确定要执行该操作吗?",
|
||||
"operation_success": "操作成功",
|
||||
"please_select": "请选择要操作的数据",
|
||||
"sort": "序号",
|
||||
"code": "编码",
|
||||
"name": "名称",
|
||||
"remark": "备注",
|
||||
"note": "备注",
|
||||
"create_time": "创建时间",
|
||||
"created_time": "创建日期",
|
||||
"add_title": "新增",
|
||||
"edit_title": "编辑",
|
||||
"enter_code": "请输入编码",
|
||||
"enter_name": "请输入名称",
|
||||
"enter_remark": "请输入备注",
|
||||
"status": "状态",
|
||||
"updated": "更新状态",
|
||||
"changed": "已变更",
|
||||
"port": "端口",
|
||||
"address": "地址",
|
||||
"service_name": "服务名称",
|
||||
"enter_service_name": "请输入服务名称",
|
||||
"unique_identifier": "唯一标识",
|
||||
"unique_identifier_tip": "测试成功后返回采集服务唯一标识",
|
||||
"enter_url": "请输入服务地址",
|
||||
"enter_port": "请输入端口",
|
||||
"enter_address": "请输入绑定地址",
|
||||
"test": "测试",
|
||||
"test_success": "测试通过",
|
||||
"device_configuration": "设备配置",
|
||||
"restart_service": "重启服务",
|
||||
"confirm_restart": "确定要重启该服务吗?",
|
||||
"request_success": "请求成功,请求动作已添加至请求队列",
|
||||
"device_config_tip": "设备配置已迁移为独立抽屉,后续可在此扩展采集设备参数。"
|
||||
},
|
||||
"edgeservermonitor": {
|
||||
"device_type": "设备类型",
|
||||
"ip_port": "IP/端口",
|
||||
"activity_time": "活动时间",
|
||||
"success_count": "成功次数",
|
||||
"failure_count": "失败次数",
|
||||
"device_stop": "暂停",
|
||||
"device_continue": "启动",
|
||||
"request_success": "请求成功"
|
||||
},
|
||||
"edgeserver_log": {
|
||||
"search": "查询",
|
||||
"reset": "重置",
|
||||
"query": "查询",
|
||||
"add": "新增",
|
||||
"edit": "编辑",
|
||||
"delete": "删除",
|
||||
"operation": "操作",
|
||||
"confirm": "确定",
|
||||
"cancel": "取消",
|
||||
"tip": "提示",
|
||||
"confirm_delete": "确定要执行该操作吗?",
|
||||
"operation_success": "操作成功",
|
||||
"please_select": "请选择要操作的数据",
|
||||
"sort": "序号",
|
||||
"code": "编码",
|
||||
"name": "名称",
|
||||
"remark": "备注",
|
||||
"note": "备注",
|
||||
"create_time": "创建时间",
|
||||
"created_time": "创建日期",
|
||||
"add_title": "新增",
|
||||
"edit_title": "编辑",
|
||||
"enter_code": "请输入编码",
|
||||
"enter_name": "请输入名称",
|
||||
"enter_remark": "请输入备注",
|
||||
"server_name": "服务名称",
|
||||
"device_name": "设备名称",
|
||||
"command": "命令",
|
||||
"status": "状态",
|
||||
"success": "成功",
|
||||
"danger": "失败",
|
||||
"server_restart": "重启服务",
|
||||
"server_close": "关闭服务",
|
||||
"device_stop": "暂停设备",
|
||||
"device_continue": "启动设备",
|
||||
"stop_device": "停止设备",
|
||||
"warning_device": "告警设备"
|
||||
},
|
||||
"scada_query": {
|
||||
"workingsubclass": "工序单元",
|
||||
"node_code": "节点编码",
|
||||
"collection_time": "采集时间",
|
||||
"to": "至",
|
||||
"time_start": "开始时间",
|
||||
"time_end": "结束时间",
|
||||
"yes": "是",
|
||||
"no": "否",
|
||||
"select_all_nodes": "选择全部节点",
|
||||
"query": "查询",
|
||||
"export_excel": "导出Excel",
|
||||
"export_task_created": "导出任务已创建"
|
||||
},
|
||||
"ems_query": {
|
||||
"workingsubclass": "工序单元",
|
||||
"node_code": "节点编码",
|
||||
"collection_time": "采集时间",
|
||||
"to": "至",
|
||||
"time_start": "开始时间",
|
||||
"time_end": "结束时间",
|
||||
"yes": "是",
|
||||
"no": "否",
|
||||
"select_all_nodes": "选择全部节点",
|
||||
"query": "查询",
|
||||
"export_excel": "导出Excel",
|
||||
"export_task_created": "导出任务已创建"
|
||||
}
|
||||
},
|
||||
"workshop_manage": {
|
||||
"workshop_config": {
|
||||
"search": "查询",
|
||||
"reset": "重置",
|
||||
"query": "查询",
|
||||
"add": "新增",
|
||||
"edit": "编辑",
|
||||
"delete": "删除",
|
||||
"operation": "操作",
|
||||
"confirm": "确定",
|
||||
"cancel": "取消",
|
||||
"tip": "提示",
|
||||
"confirm_delete": "确定要执行该操作吗?",
|
||||
"operation_success": "操作成功",
|
||||
"please_select": "请选择要操作的数据",
|
||||
"sort": "序号",
|
||||
"code": "编码",
|
||||
"name": "名称",
|
||||
"remark": "备注",
|
||||
"note": "备注",
|
||||
"create_time": "创建时间",
|
||||
"created_time": "创建日期",
|
||||
"add_title": "新增",
|
||||
"edit_title": "编辑",
|
||||
"enter_code": "请输入编码",
|
||||
"enter_name": "请输入名称",
|
||||
"enter_remark": "请输入备注",
|
||||
"building": "楼栋",
|
||||
"floor": "楼层",
|
||||
"enter_building": "请输入楼栋",
|
||||
"enter_floor": "请输入楼层"
|
||||
},
|
||||
"workshop_point": {
|
||||
"search": "查询",
|
||||
"reset": "重置",
|
||||
"query": "查询",
|
||||
"add": "新增",
|
||||
"edit": "编辑",
|
||||
"delete": "删除",
|
||||
"operation": "操作",
|
||||
"confirm": "确定",
|
||||
"cancel": "取消",
|
||||
"tip": "提示",
|
||||
"confirm_delete": "确定要执行该操作吗?",
|
||||
"operation_success": "操作成功",
|
||||
"please_select": "请选择要操作的数据",
|
||||
"sort": "序号",
|
||||
"code": "编码",
|
||||
"name": "名称",
|
||||
"remark": "备注",
|
||||
"note": "备注",
|
||||
"create_time": "创建时间",
|
||||
"created_time": "创建日期",
|
||||
"add_title": "新增",
|
||||
"edit_title": "编辑",
|
||||
"enter_code": "请输入编码",
|
||||
"enter_name": "请输入名称",
|
||||
"enter_remark": "请输入备注",
|
||||
"workshop_name": "车间名称",
|
||||
"select_workshop": "请选择车间",
|
||||
"category": "点位类型",
|
||||
"select_category": "请选择点位类型",
|
||||
"workshop_area": "车间区域",
|
||||
"single_device": "单设备",
|
||||
"offline_area": "离线区域"
|
||||
}
|
||||
},
|
||||
"device_gather": {
|
||||
"battery_device_gather_monitor": {
|
||||
"device_type": "设备类型",
|
||||
"ip_port": "IP/端口",
|
||||
"activity_time": "活动时间",
|
||||
"success_count": "成功次数",
|
||||
"failure_count": "失败次数",
|
||||
"device_stop": "暂停",
|
||||
"device_continue": "启动",
|
||||
"request_success": "请求成功",
|
||||
"refresh": "刷新",
|
||||
"last_refresh_time": "最后刷新时间",
|
||||
"stop_device": "停止设备"
|
||||
}
|
||||
}
|
||||
}},
|
||||
},
|
||||
"__MENU_TEMP_BEGIN__": "===== 以下为临时菜单翻译,后续统一删除 =====",
|
||||
"设备类型": "设备类型",
|
||||
"首页": "首页",
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
import layoutHeaderAside from '@/layout/header-aside'
|
||||
|
||||
const meta = { auth: true }
|
||||
const _import = require('@/libs/util.import.' + process.env.NODE_ENV)
|
||||
|
||||
export default {
|
||||
path: '/scada_manage',
|
||||
component: layoutHeaderAside,
|
||||
children: (pre => [
|
||||
{ path: 'index', name: `${pre}index`, meta: { ...meta, cache: true, title: '采集管理', root: '/scada_manage' }, component: _import('system/function/module-index') },
|
||||
{ path: 'basic_configuration/scadaconfigure', name: `${pre}basic_configuration-scadaconfigure`, meta: { ...meta, cache: true, title: 'SCADA节点配置' }, component: _import('scada_manage/basic_configuration/scada_configure') },
|
||||
{ path: 'basic_configuration/scadaquery', name: `${pre}basic_configuration-scadaquery`, meta: { ...meta, cache: true, title: 'SCADA数据查询' }, component: _import('scada_manage/basic_configuration/scada_query') },
|
||||
{ path: 'basic_configuration/node_mapping_device_code', name: `${pre}basic_configuration-node_mapping_device_code`, meta: { ...meta, cache: true, title: '节点设备映射' }, component: _import('scada_manage/basic_configuration/node_mapping_device_code') },
|
||||
{ path: 'basic_configuration/ems_configure', name: `${pre}basic_configuration-ems_configure`, meta: { ...meta, cache: true, title: '环控节点配置' }, component: _import('scada_manage/basic_configuration/ems_configure') },
|
||||
{ path: 'basic_configuration/ems_query', name: `${pre}basic_configuration-ems_query`, meta: { ...meta, cache: true, title: '环控数据查询' }, component: _import('scada_manage/basic_configuration/ems_query') },
|
||||
{ path: 'workshop_manage/workshop_config', name: `${pre}workshop_manage-workshop_config`, meta: { ...meta, cache: true, title: '车间配置' }, component: _import('scada_manage/workshop_manage/workshop_config') },
|
||||
{ path: 'workshop_manage/workshop_point', name: `${pre}workshop_manage-workshop_point`, meta: { ...meta, cache: true, title: '车间点位管理' }, component: _import('scada_manage/workshop_manage/workshop_point') },
|
||||
{ path: 'lecpserver/edgeserverconfigure', name: `${pre}lecpserver-edgeserverconfigure`, meta: { ...meta, cache: true, title: '服务配置' }, component: _import('scada_manage/lecpserver/edgeserverconfigure') },
|
||||
{ path: 'lecpserver/edgeervermonitor', name: `${pre}lecpserver-edgeervermonitor`, meta: { ...meta, cache: true, title: '服务监控' }, component: _import('scada_manage/lecpserver/edgeservermonitor') },
|
||||
{ path: 'lecpserver/edgeserver_log', name: `${pre}lecpserver-edgeserver_log`, meta: { ...meta, cache: true, title: '前置服务日志' }, component: _import('scada_manage/lecpserver/edgeserver_log') },
|
||||
{ path: 'device_gather/battery_device_gather_monitor', name: `${pre}device_gather-battery_device_gather_monitor`, meta: { ...meta, cache: true, title: '实时采集监控' }, component: _import('scada_manage/device_gather/battery_device_gather_monitor') }
|
||||
])('scada_manage-')
|
||||
}
|
||||
@@ -6,7 +6,6 @@ import dataPlatform from './modules/data-platform'
|
||||
import systemAdministration from './modules/system-administration'
|
||||
import equipmentManagement from './modules/equipment-management'
|
||||
import spcQualityManagement from './modules/spc-quality-management'
|
||||
import scadaManagement from './modules/scada-management'
|
||||
|
||||
// 由于懒加载页面太多的话会造成webpack热更新太慢,所以开发环境不使用懒加载,只有生产环境使用懒加载
|
||||
const _import = require('@/libs/util.import.' + process.env.NODE_ENV)
|
||||
@@ -62,8 +61,7 @@ const frameIn = [
|
||||
dataPlatform,
|
||||
systemAdministration,
|
||||
equipmentManagement,
|
||||
spcQualityManagement,
|
||||
scadaManagement
|
||||
spcQualityManagement
|
||||
]
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,198 +0,0 @@
|
||||
<template>
|
||||
<d2-container>
|
||||
<template #header>
|
||||
<el-form :inline="true" size="mini">
|
||||
<el-form-item :label="$t(key('working_subclass'))" v-if="showProcessFilter">
|
||||
<el-select v-model="search.working_subclass" clearable filterable style="width:200px" :placeholder="$t(key('select_working_subclass'))">
|
||||
<el-option v-for="item in workingSubclassOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t(key('data_category'))" v-if="showCategoryFilter">
|
||||
<el-select v-model="search.categoryName" clearable style="width:180px" :placeholder="$t(key('select_data_category'))">
|
||||
<el-option v-for="item in categoryOptions" :key="item.value" :label="$t(item.label)" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="onSearch">{{ $t(key('search')) }}</el-button>
|
||||
<el-button icon="el-icon-refresh" @click="onReset">{{ $t(key('reset')) }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<page-table
|
||||
:columns="columns"
|
||||
:data="tableData"
|
||||
:loading="loading"
|
||||
:toolbar-buttons="toolbarButtons"
|
||||
:row-buttons="rowButtons"
|
||||
:pagination="pagination"
|
||||
auto-height
|
||||
@page-change="onPageChange"
|
||||
/>
|
||||
|
||||
<page-dialog-form
|
||||
ref="dialogForm"
|
||||
:visible.sync="dialogVisible"
|
||||
:title="dialogTitle"
|
||||
width="520px"
|
||||
:form-cols="formCols"
|
||||
:form-data="formData"
|
||||
:rules="rules"
|
||||
:submitting="submitting"
|
||||
:confirm-text="key('confirm')"
|
||||
:cancel-text="key('cancel')"
|
||||
@submit="onDialogSubmit"
|
||||
/>
|
||||
</d2-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { useTableColumns } from '@/composables/useTableColumns'
|
||||
import { useTableButtons } from '@/composables/useTableButtons'
|
||||
import { i18nMixin } from '@/composables/useI18n'
|
||||
import PageTable from '@/components/page-table'
|
||||
import PageDialogForm from '@/components/page-dialog-form'
|
||||
import { getQueryNode, addNode, updateNode, removeNode } from '@/api/scada-manage/edge-manager'
|
||||
import { getWorkingsubclassAll } from '@/api/production-master-data/process-step'
|
||||
import { getWorkshopPointAll } from '@/api/scada-manage/workshop-point'
|
||||
|
||||
export default {
|
||||
name: 'scada-node-config-page',
|
||||
components: { PageTable, PageDialogForm },
|
||||
mixins: [i18nMixin('page.scada_manage.basic_configuration.ems_configure')],
|
||||
data () {
|
||||
return {
|
||||
loading: false,
|
||||
submitting: false,
|
||||
tableData: [],
|
||||
workingSubclassOptions: [],
|
||||
search: { working_subclass: '', categoryName: 'ENVIRONMENTAL_DATA' },
|
||||
pagination: { current: 1, size: 10, total: 0 },
|
||||
dialogVisible: false,
|
||||
dialogTitle: '',
|
||||
handleType: 'create',
|
||||
editRow: null,
|
||||
showProcessFilter: false,
|
||||
showCategoryFilter: false,
|
||||
categoryOptions: [{ value: 'ENVIRONMENTAL_DATA', label: 'page.scada_manage.basic_configuration.ems_configure.environmental_data' }],
|
||||
columns: [],
|
||||
toolbarButtons: [],
|
||||
rowButtons: [],
|
||||
formData: { code: '', name: '', type: 'varchar', category: 'ENVIRONMENTAL_DATA', working_subclass: '', data_length: 1, unit: '', note: '' },
|
||||
rules: {
|
||||
code: [{ required: true, message: this.key('enter_code'), trigger: 'blur' }],
|
||||
name: [{ required: true, message: this.key('enter_name'), trigger: 'blur' }],
|
||||
type: [{ required: true, message: this.key('select_type'), trigger: 'change' }],
|
||||
category: [{ required: true, message: this.key('select_data_category'), trigger: 'change' }],
|
||||
working_subclass: [{ required: true, message: this.key('select_working_subclass'), trigger: 'change' }]
|
||||
},
|
||||
formCols: []
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.columns = useTableColumns([
|
||||
{ prop: 'id', label: this.key('sort'), width: 80 },
|
||||
{ prop: 'code', label: this.key('code'), minWidth: 130 },
|
||||
{ prop: 'name', label: this.key('name'), minWidth: 140 },
|
||||
{ prop: 'type', label: this.key('type'), width: 100 },
|
||||
{ prop: 'categoryName', label: this.key('data_category'), minWidth: 140 },
|
||||
{ prop: 'worksubclass_name', label: this.key('working_subclass'), minWidth: 150 },
|
||||
{ prop: 'data_length', label: this.key('data_length'), width: 100 },
|
||||
{ prop: 'unit', label: this.key('unit'), width: 100 },
|
||||
{ prop: 'create_time', label: this.key('create_time'), minWidth: 160 },
|
||||
{ prop: 'note', label: this.key('remark'), minWidth: 160 },
|
||||
{ prop: '_actions', label: this.key('operation'), width: 160, fixed: 'right' }
|
||||
], { selectionWidth: 0 })
|
||||
const buttons = useTableButtons({
|
||||
toolbar: [{ key: 'add', label: this.key('add'), icon: 'el-icon-plus', type: 'primary', auth: '/scada_manage/basic_configuration/scadaconfigure/add', onClick: this.openAdd }],
|
||||
row: [
|
||||
{ key: 'edit', label: this.key('edit'), icon: 'el-icon-edit', auth: '/scada_manage/basic_configuration/scadaconfigure/edit', onClick: this.openEdit },
|
||||
{ key: 'delete', label: this.key('delete'), icon: 'el-icon-delete', color: 'danger', auth: '/scada_manage/basic_configuration/scadaconfigure/delete', onClick: this.handleDelete }
|
||||
]
|
||||
}, this.$permission)
|
||||
this.toolbarButtons = buttons.toolbarButtons
|
||||
this.rowButtons = buttons.rowButtons
|
||||
this.formCols = this.makeFormCols()
|
||||
this.loadOptions()
|
||||
this.fetchData()
|
||||
},
|
||||
methods: {
|
||||
makeFormCols () {
|
||||
return [
|
||||
[{ type: 'input', prop: 'code', label: this.key('code'), placeholder: this.key('enter_code'), disabled: this.handleType === 'edit' }],
|
||||
[{ type: 'input', prop: 'name', label: this.key('name'), placeholder: this.key('enter_name') }],
|
||||
[{ type: 'select', prop: 'type', label: this.key('type'), placeholder: this.key('select_type'), options: ['varchar', 'text', 'int', 'bigint', 'double', 'real', 'float', 'jsonb', 'bool'].map(v => ({ label: v, value: v })), disabled: this.handleType === 'edit' }],
|
||||
[{ type: 'select', prop: 'category', label: this.key('data_category'), placeholder: this.key('select_data_category'), options: this.categoryOptions.map(item => ({ ...item, label: this.$t(item.label) })), disabled: this.handleType === 'edit' }],
|
||||
[{ type: 'select', prop: 'working_subclass', label: this.key('working_subclass'), placeholder: this.key('select_working_subclass'), options: this.workingSubclassOptions, disabled: this.handleType === 'edit' }],
|
||||
[{ type: 'input', prop: 'data_length', label: this.key('data_length'), placeholder: this.key('enter_data_length') }],
|
||||
[{ type: 'input', prop: 'unit', label: this.key('unit'), placeholder: this.key('enter_unit') }],
|
||||
[{ type: 'input', prop: 'note', label: this.key('remark'), placeholder: this.key('enter_remark'), inputType: 'textarea', autosize: { minRows: 2, maxRows: 4 } }]
|
||||
]
|
||||
},
|
||||
async loadOptions () {
|
||||
try {
|
||||
const loader = true ? getWorkshopPointAll : getWorkingsubclassAll
|
||||
const res = await loader()
|
||||
const list = Array.isArray(res) ? res : (res.data || [])
|
||||
this.workingSubclassOptions = list.map(item => ({ label: item.name || item.code, value: item.code }))
|
||||
this.formCols = this.makeFormCols()
|
||||
} catch (e) {}
|
||||
},
|
||||
categoryText (category) {
|
||||
const item = this.categoryOptions.find(opt => opt.value === category)
|
||||
return item ? this.$t(item.label) : category
|
||||
},
|
||||
workingSubclassText (code) {
|
||||
const item = this.workingSubclassOptions.find(opt => opt.value === code)
|
||||
return item ? item.label : code
|
||||
},
|
||||
async fetchData () {
|
||||
this.loading = true
|
||||
try {
|
||||
const res = await getQueryNode({ currentPage: this.pagination.current, pageSize: this.pagination.size, ...this.search })
|
||||
const list = Array.isArray(res) ? res : (res.data || [])
|
||||
this.tableData = list.map(item => ({ ...item, categoryName: this.categoryText(item.category), worksubclass_name: this.workingSubclassText(item.working_subclass) }))
|
||||
this.pagination.total = Array.isArray(res) ? res.length : (res.total || res.count || 0)
|
||||
} finally { this.loading = false }
|
||||
},
|
||||
onSearch () { this.pagination.current = 1; this.fetchData() },
|
||||
onReset () { this.search = { working_subclass: '', categoryName: 'ENVIRONMENTAL_DATA' }; this.onSearch() },
|
||||
onPageChange (page) { this.pagination.current = page.current; this.pagination.size = page.size; this.fetchData() },
|
||||
openAdd () {
|
||||
this.handleType = 'create'
|
||||
this.dialogTitle = this.key('add_title')
|
||||
this.formData = { code: '', name: '', type: 'varchar', category: 'ENVIRONMENTAL_DATA', working_subclass: '', data_length: 1, unit: '', note: '' }
|
||||
this.formCols = this.makeFormCols()
|
||||
this.dialogVisible = true
|
||||
},
|
||||
openEdit (row) {
|
||||
this.handleType = 'edit'
|
||||
this.dialogTitle = this.key('edit_title')
|
||||
this.editRow = row
|
||||
this.formData = { code: row.code, name: row.name, type: row.type, category: row.category || 'ENVIRONMENTAL_DATA', working_subclass: row.working_subclass, data_length: row.data_length, unit: row.unit, note: row.note }
|
||||
this.formCols = this.makeFormCols()
|
||||
this.dialogVisible = true
|
||||
},
|
||||
async onDialogSubmit () {
|
||||
this.submitting = true
|
||||
try {
|
||||
if (this.handleType === 'create') {
|
||||
await addNode({ action: 'add_node', node_data: JSON.stringify([this.formData]) })
|
||||
} else {
|
||||
await updateNode({ id: this.editRow.id, name: this.formData.name, note: this.formData.note, unit: this.formData.unit, data_length: this.formData.data_length, action: 'update_node' })
|
||||
}
|
||||
this.$message.success(this.$t(this.key('operation_success')))
|
||||
this.dialogVisible = false
|
||||
this.fetchData()
|
||||
} finally { this.submitting = false }
|
||||
},
|
||||
handleDelete (row) {
|
||||
this.$confirm(this.$t(this.key('confirm_delete')), this.$t(this.key('tip')), { type: 'warning' }).then(async () => {
|
||||
await removeNode({ action: 'remove_node', code: row.code, working_subclass: row.working_subclass })
|
||||
this.$message.success(this.$t(this.key('operation_success')))
|
||||
this.fetchData()
|
||||
}).catch(() => {})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -1,21 +0,0 @@
|
||||
<template>
|
||||
<d2-container v-loading="loading">
|
||||
<template #header>
|
||||
<el-form :inline="true" size="mini">
|
||||
<el-form-item :label="$t(key('workingsubclass'))"><el-select v-model="form.workingSubclass" clearable filterable multiple collapse-tags style="width:240px" @change="loadCodes"><el-option v-for="item in workingSubclassOptions" :key="item.value" :label="item.label" :value="item.value" /></el-select></el-form-item>
|
||||
<el-form-item :label="$t(key('node_code'))"><el-select v-model="form.code" clearable filterable multiple collapse-tags style="width:240px"><el-option v-for="item in codeOptions" :key="item.value" :label="item.label" :value="item.value" /></el-select></el-form-item>
|
||||
<el-form-item :label="$t(key('collection_time'))"><el-date-picker v-model="form.time" type="datetimerange" value-format="timestamp" :range-separator="$t(key('to'))" :start-placeholder="$t(key('time_start'))" :end-placeholder="$t(key('time_end'))" /></el-form-item>
|
||||
<el-form-item><el-switch v-model="form.dedup" :active-value="1" :inactive-value="0" :active-text="$t(key('yes'))" :inactive-text="$t(key('no'))" /></el-form-item>
|
||||
<el-form-item><el-button type="primary" @click="selectAll">{{ $t(key('select_all_nodes')) }}</el-button><el-button type="primary" icon="el-icon-search" @click="fetchData">{{ $t(key('query')) }}</el-button><el-button icon="el-icon-download" @click="exportExcel">{{ $t(key('export_excel')) }}</el-button></el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
<el-table :data="tableData" border height="650"><el-table-column v-for="col in columns" :key="col.prop" :prop="col.prop" :label="col.label" width="140" show-overflow-tooltip /></el-table>
|
||||
<el-pagination class="query-pagination" :current-page="pagination.current" :page-size="pagination.size" :page-sizes="[50, 100, 200, 300]" :total="pagination.total" layout="total, sizes, prev, pager, next, jumper" @size-change="onSizeChange" @current-change="onCurrentChange" />
|
||||
</d2-container>
|
||||
</template><script>
|
||||
import { i18nMixin } from '@/composables/useI18n'
|
||||
import { getQueryWorkingSubclasses, getQueryCodes, getQueryNodeData } from '@/api/scada-manage/edge-manager'
|
||||
import { deviceDataExportTask } from '@/api/scada-manage/device-gather-management'
|
||||
const now = Date.now()
|
||||
export default { name: 'ems-query', mixins: [i18nMixin('page.scada_manage.basic_configuration.ems_query')], data () { return { loading: false, workingSubclassOptions: [], codeOptions: [], form: { workingSubclass: [], time: [now - 3600 * 1000 * 24 * 7, now], code: [], dedup: 1 }, pagination: { current: 1, size: 50, total: 0 }, columns: [], tableData: [] } }, created () { this.loadWorkings() }, methods: { async loadWorkings () { const res = await getQueryWorkingSubclasses(); this.workingSubclassOptions = Object.keys(res || {}).map(code => ({ label: res[code], value: code })) }, async loadCodes () { const selected = this.form.workingSubclass || []; const groups = await Promise.all(selected.map(code => getQueryCodes(code))); this.codeOptions = groups.flatMap(group => (Array.isArray(group) ? group : (group.data || [])).map(item => ({ label: item.name, value: item.code }))) }, selectAll () { this.form.code = this.codeOptions.map(item => item.value) }, async fetchData () { this.loading = true; try { const startRow = (this.pagination.current - 1) * this.pagination.size; const res = await getQueryNodeData({ startRow, endRow: startRow + this.pagination.size, workingSubclass: (this.form.workingSubclass || []).join(','), startTime: this.form.time && this.form.time[0], endTime: this.form.time && this.form.time[1], code: this.form.code, dedup: this.form.dedup }); const list = Array.isArray(res) ? res : (res.data || []); this.tableData = list; this.pagination.total = Array.isArray(res) ? res.length : (res.total || res.count || list.length); const fields = list.length ? Object.keys(list[0]) : []; this.columns = fields.map(prop => ({ prop, label: prop })) } finally { this.loading = false } }, onSizeChange (size) { this.pagination.size = size; this.fetchData() }, onCurrentChange (current) { this.pagination.current = current; this.fetchData() }, async exportExcel () { await deviceDataExportTask({ workingSubclass: this.form.workingSubclass, code: this.form.code, time: this.form.time }); this.$message.success(this.$t(this.key('export_task_created'))) } } }
|
||||
</script><style scoped>.query-pagination{margin-top:12px;text-align:right}</style>
|
||||
File diff suppressed because one or more lines are too long
@@ -1,198 +0,0 @@
|
||||
<template>
|
||||
<d2-container>
|
||||
<template #header>
|
||||
<el-form :inline="true" size="mini">
|
||||
<el-form-item :label="$t(key('working_subclass'))" v-if="showProcessFilter">
|
||||
<el-select v-model="search.working_subclass" clearable filterable style="width:200px" :placeholder="$t(key('select_working_subclass'))">
|
||||
<el-option v-for="item in workingSubclassOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t(key('data_category'))" v-if="showCategoryFilter">
|
||||
<el-select v-model="search.categoryName" clearable style="width:180px" :placeholder="$t(key('select_data_category'))">
|
||||
<el-option v-for="item in categoryOptions" :key="item.value" :label="$t(item.label)" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="onSearch">{{ $t(key('search')) }}</el-button>
|
||||
<el-button icon="el-icon-refresh" @click="onReset">{{ $t(key('reset')) }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<page-table
|
||||
:columns="columns"
|
||||
:data="tableData"
|
||||
:loading="loading"
|
||||
:toolbar-buttons="toolbarButtons"
|
||||
:row-buttons="rowButtons"
|
||||
:pagination="pagination"
|
||||
auto-height
|
||||
@page-change="onPageChange"
|
||||
/>
|
||||
|
||||
<page-dialog-form
|
||||
ref="dialogForm"
|
||||
:visible.sync="dialogVisible"
|
||||
:title="dialogTitle"
|
||||
width="520px"
|
||||
:form-cols="formCols"
|
||||
:form-data="formData"
|
||||
:rules="rules"
|
||||
:submitting="submitting"
|
||||
:confirm-text="key('confirm')"
|
||||
:cancel-text="key('cancel')"
|
||||
@submit="onDialogSubmit"
|
||||
/>
|
||||
</d2-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { useTableColumns } from '@/composables/useTableColumns'
|
||||
import { useTableButtons } from '@/composables/useTableButtons'
|
||||
import { i18nMixin } from '@/composables/useI18n'
|
||||
import PageTable from '@/components/page-table'
|
||||
import PageDialogForm from '@/components/page-dialog-form'
|
||||
import { getQueryNode, addNode, updateNode, removeNode } from '@/api/scada-manage/edge-manager'
|
||||
import { getWorkingsubclassAll } from '@/api/production-master-data/process-step'
|
||||
import { getWorkshopPointAll } from '@/api/scada-manage/workshop-point'
|
||||
|
||||
export default {
|
||||
name: 'scada-node-config-page',
|
||||
components: { PageTable, PageDialogForm },
|
||||
mixins: [i18nMixin('page.scada_manage.basic_configuration.scada_configure')],
|
||||
data () {
|
||||
return {
|
||||
loading: false,
|
||||
submitting: false,
|
||||
tableData: [],
|
||||
workingSubclassOptions: [],
|
||||
search: { working_subclass: '', categoryName: '' },
|
||||
pagination: { current: 1, size: 10, total: 0 },
|
||||
dialogVisible: false,
|
||||
dialogTitle: '',
|
||||
handleType: 'create',
|
||||
editRow: null,
|
||||
showProcessFilter: true,
|
||||
showCategoryFilter: true,
|
||||
categoryOptions: [{ value: 'DEVICE_STATUS', label: 'page.scada_manage.basic_configuration.scada_configure.device_status' }, { value: 'ITEM_ID_ITEM', label: 'page.scada_manage.basic_configuration.scada_configure.item_id_item' }, { value: 'DEVICE_DATA', label: 'page.scada_manage.basic_configuration.scada_configure.device_data' }, { value: 'PROCESS_DATA', label: 'page.scada_manage.basic_configuration.scada_configure.process_data' }, { value: 'RESULT_DATA', label: 'page.scada_manage.basic_configuration.scada_configure.result_data' }, { value: 'STATISTICAL_DATA', label: 'page.scada_manage.basic_configuration.scada_configure.statistical_data' }, { value: 'INSPECTION_DATA', label: 'page.scada_manage.basic_configuration.scada_configure.inspection_data' }],
|
||||
columns: [],
|
||||
toolbarButtons: [],
|
||||
rowButtons: [],
|
||||
formData: { code: '', name: '', type: 'varchar', category: '', working_subclass: '', data_length: 1, unit: '', note: '' },
|
||||
rules: {
|
||||
code: [{ required: true, message: this.key('enter_code'), trigger: 'blur' }],
|
||||
name: [{ required: true, message: this.key('enter_name'), trigger: 'blur' }],
|
||||
type: [{ required: true, message: this.key('select_type'), trigger: 'change' }],
|
||||
category: [{ required: true, message: this.key('select_data_category'), trigger: 'change' }],
|
||||
working_subclass: [{ required: true, message: this.key('select_working_subclass'), trigger: 'change' }]
|
||||
},
|
||||
formCols: []
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.columns = useTableColumns([
|
||||
{ prop: 'id', label: this.key('sort'), width: 80 },
|
||||
{ prop: 'code', label: this.key('code'), minWidth: 130 },
|
||||
{ prop: 'name', label: this.key('name'), minWidth: 140 },
|
||||
{ prop: 'type', label: this.key('type'), width: 100 },
|
||||
{ prop: 'categoryName', label: this.key('data_category'), minWidth: 140 },
|
||||
{ prop: 'worksubclass_name', label: this.key('working_subclass'), minWidth: 150 },
|
||||
{ prop: 'data_length', label: this.key('data_length'), width: 100 },
|
||||
{ prop: 'unit', label: this.key('unit'), width: 100 },
|
||||
{ prop: 'create_time', label: this.key('create_time'), minWidth: 160 },
|
||||
{ prop: 'note', label: this.key('remark'), minWidth: 160 },
|
||||
{ prop: '_actions', label: this.key('operation'), width: 160, fixed: 'right' }
|
||||
], { selectionWidth: 0 })
|
||||
const buttons = useTableButtons({
|
||||
toolbar: [{ key: 'add', label: this.key('add'), icon: 'el-icon-plus', type: 'primary', auth: '/scada_manage/basic_configuration/scadaconfigure/add', onClick: this.openAdd }],
|
||||
row: [
|
||||
{ key: 'edit', label: this.key('edit'), icon: 'el-icon-edit', auth: '/scada_manage/basic_configuration/scadaconfigure/edit', onClick: this.openEdit },
|
||||
{ key: 'delete', label: this.key('delete'), icon: 'el-icon-delete', color: 'danger', auth: '/scada_manage/basic_configuration/scadaconfigure/delete', onClick: this.handleDelete }
|
||||
]
|
||||
}, this.$permission)
|
||||
this.toolbarButtons = buttons.toolbarButtons
|
||||
this.rowButtons = buttons.rowButtons
|
||||
this.formCols = this.makeFormCols()
|
||||
this.loadOptions()
|
||||
this.fetchData()
|
||||
},
|
||||
methods: {
|
||||
makeFormCols () {
|
||||
return [
|
||||
[{ type: 'input', prop: 'code', label: this.key('code'), placeholder: this.key('enter_code'), disabled: this.handleType === 'edit' }],
|
||||
[{ type: 'input', prop: 'name', label: this.key('name'), placeholder: this.key('enter_name') }],
|
||||
[{ type: 'select', prop: 'type', label: this.key('type'), placeholder: this.key('select_type'), options: ['varchar', 'text', 'int', 'bigint', 'double', 'real', 'float', 'jsonb', 'bool'].map(v => ({ label: v, value: v })), disabled: this.handleType === 'edit' }],
|
||||
[{ type: 'select', prop: 'category', label: this.key('data_category'), placeholder: this.key('select_data_category'), options: this.categoryOptions.map(item => ({ ...item, label: this.$t(item.label) })), disabled: this.handleType === 'edit' }],
|
||||
[{ type: 'select', prop: 'working_subclass', label: this.key('working_subclass'), placeholder: this.key('select_working_subclass'), options: this.workingSubclassOptions, disabled: this.handleType === 'edit' }],
|
||||
[{ type: 'input', prop: 'data_length', label: this.key('data_length'), placeholder: this.key('enter_data_length') }],
|
||||
[{ type: 'input', prop: 'unit', label: this.key('unit'), placeholder: this.key('enter_unit') }],
|
||||
[{ type: 'input', prop: 'note', label: this.key('remark'), placeholder: this.key('enter_remark'), inputType: 'textarea', autosize: { minRows: 2, maxRows: 4 } }]
|
||||
]
|
||||
},
|
||||
async loadOptions () {
|
||||
try {
|
||||
const loader = false ? getWorkshopPointAll : getWorkingsubclassAll
|
||||
const res = await loader()
|
||||
const list = Array.isArray(res) ? res : (res.data || [])
|
||||
this.workingSubclassOptions = list.map(item => ({ label: item.name || item.code, value: item.code }))
|
||||
this.formCols = this.makeFormCols()
|
||||
} catch (e) {}
|
||||
},
|
||||
categoryText (category) {
|
||||
const item = this.categoryOptions.find(opt => opt.value === category)
|
||||
return item ? this.$t(item.label) : category
|
||||
},
|
||||
workingSubclassText (code) {
|
||||
const item = this.workingSubclassOptions.find(opt => opt.value === code)
|
||||
return item ? item.label : code
|
||||
},
|
||||
async fetchData () {
|
||||
this.loading = true
|
||||
try {
|
||||
const res = await getQueryNode({ currentPage: this.pagination.current, pageSize: this.pagination.size, ...this.search })
|
||||
const list = Array.isArray(res) ? res : (res.data || [])
|
||||
this.tableData = list.map(item => ({ ...item, categoryName: this.categoryText(item.category), worksubclass_name: this.workingSubclassText(item.working_subclass) }))
|
||||
this.pagination.total = Array.isArray(res) ? res.length : (res.total || res.count || 0)
|
||||
} finally { this.loading = false }
|
||||
},
|
||||
onSearch () { this.pagination.current = 1; this.fetchData() },
|
||||
onReset () { this.search = { working_subclass: '', categoryName: '' }; this.onSearch() },
|
||||
onPageChange (page) { this.pagination.current = page.current; this.pagination.size = page.size; this.fetchData() },
|
||||
openAdd () {
|
||||
this.handleType = 'create'
|
||||
this.dialogTitle = this.key('add_title')
|
||||
this.formData = { code: '', name: '', type: 'varchar', category: '', working_subclass: '', data_length: 1, unit: '', note: '' }
|
||||
this.formCols = this.makeFormCols()
|
||||
this.dialogVisible = true
|
||||
},
|
||||
openEdit (row) {
|
||||
this.handleType = 'edit'
|
||||
this.dialogTitle = this.key('edit_title')
|
||||
this.editRow = row
|
||||
this.formData = { code: row.code, name: row.name, type: row.type, category: row.category || '', working_subclass: row.working_subclass, data_length: row.data_length, unit: row.unit, note: row.note }
|
||||
this.formCols = this.makeFormCols()
|
||||
this.dialogVisible = true
|
||||
},
|
||||
async onDialogSubmit () {
|
||||
this.submitting = true
|
||||
try {
|
||||
if (this.handleType === 'create') {
|
||||
await addNode({ action: 'add_node', node_data: JSON.stringify([this.formData]) })
|
||||
} else {
|
||||
await updateNode({ id: this.editRow.id, name: this.formData.name, note: this.formData.note, unit: this.formData.unit, data_length: this.formData.data_length, action: 'update_node' })
|
||||
}
|
||||
this.$message.success(this.$t(this.key('operation_success')))
|
||||
this.dialogVisible = false
|
||||
this.fetchData()
|
||||
} finally { this.submitting = false }
|
||||
},
|
||||
handleDelete (row) {
|
||||
this.$confirm(this.$t(this.key('confirm_delete')), this.$t(this.key('tip')), { type: 'warning' }).then(async () => {
|
||||
await removeNode({ action: 'remove_node', code: row.code, working_subclass: row.working_subclass })
|
||||
this.$message.success(this.$t(this.key('operation_success')))
|
||||
this.fetchData()
|
||||
}).catch(() => {})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -1,21 +0,0 @@
|
||||
<template>
|
||||
<d2-container v-loading="loading">
|
||||
<template #header>
|
||||
<el-form :inline="true" size="mini">
|
||||
<el-form-item :label="$t(key('workingsubclass'))"><el-select v-model="form.workingSubclass" clearable filterable multiple collapse-tags style="width:240px" @change="loadCodes"><el-option v-for="item in workingSubclassOptions" :key="item.value" :label="item.label" :value="item.value" /></el-select></el-form-item>
|
||||
<el-form-item :label="$t(key('node_code'))"><el-select v-model="form.code" clearable filterable multiple collapse-tags style="width:240px"><el-option v-for="item in codeOptions" :key="item.value" :label="item.label" :value="item.value" /></el-select></el-form-item>
|
||||
<el-form-item :label="$t(key('collection_time'))"><el-date-picker v-model="form.time" type="datetimerange" value-format="timestamp" :range-separator="$t(key('to'))" :start-placeholder="$t(key('time_start'))" :end-placeholder="$t(key('time_end'))" /></el-form-item>
|
||||
<el-form-item><el-switch v-model="form.dedup" :active-value="1" :inactive-value="0" :active-text="$t(key('yes'))" :inactive-text="$t(key('no'))" /></el-form-item>
|
||||
<el-form-item><el-button type="primary" @click="selectAll">{{ $t(key('select_all_nodes')) }}</el-button><el-button type="primary" icon="el-icon-search" @click="fetchData">{{ $t(key('query')) }}</el-button><el-button icon="el-icon-download" @click="exportExcel">{{ $t(key('export_excel')) }}</el-button></el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
<el-table :data="tableData" border height="650"><el-table-column v-for="col in columns" :key="col.prop" :prop="col.prop" :label="col.label" width="140" show-overflow-tooltip /></el-table>
|
||||
<el-pagination class="query-pagination" :current-page="pagination.current" :page-size="pagination.size" :page-sizes="[50, 100, 200, 300]" :total="pagination.total" layout="total, sizes, prev, pager, next, jumper" @size-change="onSizeChange" @current-change="onCurrentChange" />
|
||||
</d2-container>
|
||||
</template><script>
|
||||
import { i18nMixin } from '@/composables/useI18n'
|
||||
import { getQueryWorkingSubclasses, getQueryCodes, getQueryNodeData } from '@/api/scada-manage/edge-manager'
|
||||
import { deviceDataExportTask } from '@/api/scada-manage/device-gather-management'
|
||||
const now = Date.now()
|
||||
export default { name: 'scada-query', mixins: [i18nMixin('page.scada_manage.basic_configuration.scada_query')], data () { return { loading: false, workingSubclassOptions: [], codeOptions: [], form: { workingSubclass: [], time: [now - 3600 * 1000 * 24 * 7, now], code: [], dedup: 1 }, pagination: { current: 1, size: 50, total: 0 }, columns: [], tableData: [] } }, created () { this.loadWorkings() }, methods: { async loadWorkings () { const res = await getQueryWorkingSubclasses(); this.workingSubclassOptions = Object.keys(res || {}).map(code => ({ label: res[code], value: code })) }, async loadCodes () { const selected = this.form.workingSubclass || []; const groups = await Promise.all(selected.map(code => getQueryCodes(code))); this.codeOptions = groups.flatMap(group => (Array.isArray(group) ? group : (group.data || [])).map(item => ({ label: item.name, value: item.code }))) }, selectAll () { this.form.code = this.codeOptions.map(item => item.value) }, async fetchData () { this.loading = true; try { const startRow = (this.pagination.current - 1) * this.pagination.size; const res = await getQueryNodeData({ startRow, endRow: startRow + this.pagination.size, workingSubclass: (this.form.workingSubclass || []).join(','), startTime: this.form.time && this.form.time[0], endTime: this.form.time && this.form.time[1], code: this.form.code, dedup: this.form.dedup }); const list = Array.isArray(res) ? res : (res.data || []); this.tableData = list; this.pagination.total = Array.isArray(res) ? res.length : (res.total || res.count || list.length); const fields = list.length ? Object.keys(list[0]) : []; this.columns = fields.map(prop => ({ prop, label: prop })) } finally { this.loading = false } }, onSizeChange (size) { this.pagination.size = size; this.fetchData() }, onCurrentChange (current) { this.pagination.current = current; this.fetchData() }, async exportExcel () { await deviceDataExportTask({ workingSubclass: this.form.workingSubclass, code: this.form.code, time: this.form.time }); this.$message.success(this.$t(this.key('export_task_created'))) } } }
|
||||
</script><style scoped>.query-pagination{margin-top:12px;text-align:right}</style>
|
||||
@@ -1,11 +0,0 @@
|
||||
<template>
|
||||
<d2-container>
|
||||
<div class="monitor-head"><el-button size="mini" icon="el-icon-refresh" :loading="loading" @click="fetchData">{{ $t(key('refresh')) }}</el-button><span>{{ $t(key('last_refresh_time')) }}: {{ lastRefresh }}</span></div>
|
||||
<el-collapse v-model="activeNames"><el-collapse-item v-for="device in devices" :key="device.device_name" :name="device.device_name"><template #title><strong>{{ device.device_name }}</strong><el-tag size="mini" :type="device.status === 'online' ? 'success' : 'info'" class="device-tag">{{ device.status || 'offline' }}</el-tag><el-button v-if="device.server_id" type="danger" size="mini" @click.stop="stopDevice(device)">{{ $t(key('stop_device')) }}</el-button></template><el-descriptions :column="4" border><el-descriptions-item :label="$t(key('device_type'))">{{ device.device_type }}</el-descriptions-item><el-descriptions-item :label="$t(key('ip_port'))">{{ device.config }}</el-descriptions-item><el-descriptions-item :label="$t(key('activity_time'))">{{ device.startTime }}</el-descriptions-item><el-descriptions-item :label="$t(key('success_count'))">{{ device.success }}</el-descriptions-item><el-descriptions-item :label="$t(key('failure_count'))">{{ device.failed }}</el-descriptions-item></el-descriptions></el-collapse-item></el-collapse>
|
||||
</d2-container>
|
||||
</template><script>
|
||||
import { i18nMixin } from '@/composables/useI18n'
|
||||
import { queryServers, getServeDeviceMonitoring, setServerExec } from '@/api/scada-manage/edge-manager'
|
||||
import { unset, map } from 'lodash'
|
||||
export default { name: 'battery-device-gather-monitor', mixins: [i18nMixin('page.scada_manage.device_gather.battery_device_gather_monitor')], data () { return { loading: false, activeNames: [], devices: [], timing: null, lastRefresh: '' } }, mounted () { this.fetchData(); this.timing = setInterval(this.fetchData, 30000) }, beforeDestroy () { clearInterval(this.timing) }, methods: { async fetchData () { this.loading = true; try { const servers = await queryServers(); const list = Array.isArray(servers) ? servers : (servers.data || []); const devices = []; for (const server of list) { try { const status = await getServeDeviceMonitoring(`http://${server.url}:${server.port}`); if (status.IsSuccess) { const data = status.Content; unset(data, '__status'); map(data, item => { const config = (item.__config || '').split(' '); devices.push({ server_id: server.id, status: 'online', config: config.length > 0 ? config[2] : '', startTime: item.__startTime, success: item.__success, failed: item.__failed, device_name: item.__name, device_type: config.length > 0 ? config[0] : '' }) }) } } catch (e) {} } this.devices = devices; this.activeNames = devices.map(item => item.device_name); this.lastRefresh = new Date().toLocaleString() } finally { this.loading = false } }, async stopDevice (device) { await setServerExec({ action: 'exec', server_id: device.server_id, command: 'stop_device', device_name: device.device_name }); this.$message.success(this.$t(this.key('request_success'))); this.fetchData() } } }
|
||||
</script><style scoped>.monitor-head{display:flex;gap:12px;align-items:center;margin-bottom:12px}.device-tag{margin-left:12px}</style>
|
||||
@@ -1,9 +0,0 @@
|
||||
<template>
|
||||
<d2-container><template #header><el-form :inline="true" size="mini"><el-form-item :label="$t(key('server_name'))"><el-input v-model="search.server_name" clearable style="width:200px" /></el-form-item><el-form-item :label="$t(key('device_name'))"><el-input v-model="search.device_name" clearable style="width:200px" /></el-form-item><el-form-item :label="$t(key('command'))"><el-select v-model="search.command" clearable style="width:180px"><el-option v-for="item in commandOptions" :key="item.value" :label="$t(item.label)" :value="item.value" /></el-select></el-form-item><el-form-item><el-button type="primary" icon="el-icon-search" @click="onSearch">{{ $t(key('query')) }}</el-button><el-button icon="el-icon-refresh" @click="onReset">{{ $t(key('reset')) }}</el-button></el-form-item></el-form></template><page-table :columns="columns" :data="tableData" :loading="loading" :pagination="pagination" auto-height @page-change="onPageChange"><template #col-command="{ row }">{{ commandText(row.command) }}</template><template #col-success="{ row }"><el-tag :type="row.success === 't' ? 'success' : 'danger'">{{ row.success === 't' ? $t(key('success')) : $t(key('danger')) }}</el-tag></template></page-table></d2-container>
|
||||
</template><script>
|
||||
import { useTableColumns } from '@/composables/useTableColumns'
|
||||
import { i18nMixin } from '@/composables/useI18n'
|
||||
import PageTable from '@/components/page-table'
|
||||
import { getExecLog } from '@/api/scada-manage/edge-manager'
|
||||
export default { name: 'scada-edgeserver-log', components: { PageTable }, mixins: [i18nMixin('page.scada_manage.basic_configuration.edgeserver_log')], data () { return { loading: false, tableData: [], search: { server_name: '', device_name: '', command: '' }, pagination: { current: 1, size: 10, total: 0 }, commandOptions: ['server_restart', 'server_close', 'device_stop', 'device_continue', 'stop_device', 'warning_device'].map(v => ({ label: this.key(v), value: v })), columns: [] } }, created () { this.columns = useTableColumns([{ prop: 'server_name', label: this.key('server_name'), minWidth: 160 }, { prop: 'device_name', label: this.key('device_name'), minWidth: 160 }, { prop: 'command', label: this.key('command'), minWidth: 160, slot: 'command' }, { prop: 'success', label: this.key('status'), width: 100, slot: 'success' }, { prop: 'create_date', label: this.key('create_date'), minWidth: 160 }], { selectionWidth: 0 }); this.fetchData() }, methods: { commandText (command) { const item = this.commandOptions.find(i => i.value === command); return item ? this.$t(item.label) : command }, async fetchData () { this.loading = true; try { const res = await getExecLog({ ...this.search, page_no: this.pagination.current, page_size: this.pagination.size }); this.tableData = Array.isArray(res) ? res : (res.data || []); this.pagination.total = Array.isArray(res) ? res.length : (res.total || res.count || 0) } finally { this.loading = false } }, onSearch () { this.pagination.current = 1; this.fetchData() }, onReset () { this.search = { server_name: '', device_name: '', command: '' }; this.onSearch() }, onPageChange (p) { this.pagination.current = p.current; this.pagination.size = p.size; this.fetchData() } } }
|
||||
</script>
|
||||
File diff suppressed because one or more lines are too long
@@ -1,8 +0,0 @@
|
||||
<template>
|
||||
<d2-container><div class="monitor-grid"><el-card v-for="server in serverData" :key="server.id || server.name" class="server-card"><div slot="header"><strong>{{ server.name || server.server_name }}</strong><span> ({{ server.url }}:{{ server.port }}) </span><el-tag :type="server.status === 'online' ? 'success' : 'info'">{{ server.status || 'offline' }}</el-tag></div><el-row :gutter="12"><el-col :span="6" v-for="device in server.devices" :key="device.device_name"><el-card :class="device.deviceStatus ? 'device-online' : 'device-offline'"><div slot="header">{{ device.device_name }}</div><p>{{ $t(key('device_type')) }}: {{ device.device_type }}</p><p>{{ $t(key('ip_port')) }}: {{ device.config }}</p><p>{{ $t(key('activity_time')) }}: {{ device.startTime }}</p><p>{{ $t(key('success_count')) }}: {{ device.success }}</p><p>{{ $t(key('failure_count')) }}: {{ device.failed }}</p><el-button size="mini" @click="setDeviceExec(device, 'device_stop', server)">{{ $t(key('device_stop')) }}</el-button><el-button size="mini" type="primary" @click="setDeviceExec(device, 'device_continue', server)">{{ $t(key('device_continue')) }}</el-button></el-card></el-col></el-row></el-card></div></d2-container>
|
||||
</template><script>
|
||||
import { i18nMixin } from '@/composables/useI18n'
|
||||
import { queryServers, getServeDeviceMonitoring, setServerExec } from '@/api/scada-manage/edge-manager'
|
||||
import { unset, map } from 'lodash'
|
||||
export default { name: 'scada-edgeservermonitor', mixins: [i18nMixin('page.scada_manage.basic_configuration.edgeservermonitor')], data () { return { serverData: [], timing: null } }, mounted () { this.getServe(); this.timing = setInterval(this.getServe, 30000) }, beforeDestroy () { clearInterval(this.timing) }, methods: { async setDeviceExec (device, command, server) { await setServerExec({ action: 'exec', server_id: server.id, command, device_name: device.device_name }); this.$message.success(this.$t(this.key('request_success'))); this.getServe() }, async getServe () { const servers = await queryServers(); this.serverData = Array.isArray(servers) ? servers : (servers.data || []); this.serverData.forEach((server, index) => { getServeDeviceMonitoring(`http://${server.url}:${server.port}`).then(status => { if (status.IsSuccess) { const data = status.Content; unset(data, '__status'); const devices = map(data, item => { const config = (item.__config || '').split(' '); return { config: config.length > 0 ? config[2] : '', startTime: item.__startTime, success: item.__success, failed: item.__failed, deviceStatus: item.__requestEnable, device_name: item.__name, device_type: config.length > 0 ? config[0] : '' } }); this.$set(this.serverData[index], 'devices', devices); this.$set(this.serverData[index], 'status', 'online') } }).catch(() => { this.$set(this.serverData[index], 'devices', []); this.$set(this.serverData[index], 'status', 'offline') }) }) } } }
|
||||
</script><style scoped>.server-card{margin-bottom:12px}.device-online{background:#f0f9eb}.device-offline{background:#f5f7fa}</style>
|
||||
@@ -1,28 +0,0 @@
|
||||
<template>
|
||||
<d2-container>
|
||||
<template #header>
|
||||
<el-form :inline="true" size="mini">
|
||||
<el-form-item :label="$t(key('building'))"><el-input v-model="search.building" clearable style="width:180px" :placeholder="$t(key('enter_building'))" @keyup.enter.native="onSearch" /></el-form-item>
|
||||
<el-form-item :label="$t(key('floor'))"><el-input v-model="search.floor" clearable style="width:180px" :placeholder="$t(key('enter_floor'))" @keyup.enter.native="onSearch" /></el-form-item>
|
||||
<el-form-item :label="$t(key('name'))"><el-input v-model="search.name" clearable style="width:180px" :placeholder="$t(key('enter_name'))" @keyup.enter.native="onSearch" /></el-form-item>
|
||||
<el-form-item><el-button type="primary" icon="el-icon-search" @click="onSearch">{{ $t(key('search')) }}</el-button><el-button icon="el-icon-refresh" @click="onReset">{{ $t(key('reset')) }}</el-button></el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
<page-table :columns="columns" :data="tableData" :loading="loading" :toolbar-buttons="toolbarButtons" :row-buttons="rowButtons" :pagination="pagination" auto-height @page-change="onPageChange" @selection-change="onSelect" />
|
||||
<page-dialog-form ref="dialogForm" :visible.sync="dialogVisible" :title="dialogTitle" width="520px" :form-cols="formCols" :form-data="formData" :rules="rules" :submitting="submitting" :confirm-text="key('confirm')" :cancel-text="key('cancel')" @submit="onDialogSubmit" />
|
||||
</d2-container>
|
||||
</template>
|
||||
<script>
|
||||
import { useTableColumns } from '@/composables/useTableColumns'
|
||||
import { useTableButtons } from '@/composables/useTableButtons'
|
||||
import { i18nMixin } from '@/composables/useI18n'
|
||||
import PageTable from '@/components/page-table'
|
||||
import PageDialogForm from '@/components/page-dialog-form'
|
||||
import { getWorkshopConfigList, createWorkshopConfig, editWorkshopConfig, deleteWorkshopConfig } from '@/api/scada-manage/workshop-config'
|
||||
export default {
|
||||
name: 'scada-workshop-config', components: { PageTable, PageDialogForm }, mixins: [i18nMixin('page.scada_manage.workshop_manage.workshop_config')],
|
||||
data () { return { loading: false, submitting: false, tableData: [], selectedRows: [], search: { building: '', floor: '', name: '' }, pagination: { current: 1, size: 10, total: 0 }, dialogVisible: false, dialogTitle: '', handleType: 'create', editId: '', formData: { code: '', name: '', building: '', floor: '' }, rules: { code: [{ required: true, message: this.key('enter_code'), trigger: 'blur' }], name: [{ required: true, message: this.key('enter_name'), trigger: 'blur' }], building: [{ required: true, message: this.key('enter_building'), trigger: 'blur' }], floor: [{ required: true, message: this.key('enter_floor'), trigger: 'blur' }] }, columns: [], toolbarButtons: [], rowButtons: [], formCols: [[{ type: 'input', prop: 'code', label: this.key('code'), placeholder: this.key('enter_code') }], [{ type: 'input', prop: 'name', label: this.key('name'), placeholder: this.key('enter_name') }], [{ type: 'input', prop: 'building', label: this.key('building'), placeholder: this.key('enter_building') }], [{ type: 'input', prop: 'floor', label: this.key('floor'), placeholder: this.key('enter_floor') }]] } },
|
||||
created () { this.columns = useTableColumns([{ prop: 'building', label: this.key('building'), minWidth: 100 }, { prop: 'floor', label: this.key('floor'), minWidth: 100 }, { prop: 'code', label: this.key('code'), minWidth: 120 }, { prop: 'name', label: this.key('name'), minWidth: 140 }, { prop: 'created_time', label: this.key('created_time'), minWidth: 160 }, { prop: '_actions', label: this.key('operation'), width: 160, fixed: 'right' }]); const b = useTableButtons({ toolbar: [{ key: 'add', label: this.key('add'), icon: 'el-icon-plus', type: 'primary', auth: '/scada_manage/workshop_manage/workshop_config/add', onClick: this.openAdd }, { key: 'batchDelete', label: this.key('delete'), icon: 'el-icon-delete', auth: '/scada_manage/workshop_manage/workshop_config/del', needSelection: true, onClick: this.handleBatchDelete }], row: [{ key: 'edit', label: this.key('edit'), icon: 'el-icon-edit', auth: '/scada_manage/workshop_manage/workshop_config/set', onClick: this.openEdit }, { key: 'delete', label: this.key('delete'), icon: 'el-icon-delete', color: 'danger', auth: '/scada_manage/workshop_manage/workshop_config/del', onClick: this.handleDelete }] }, this.$permission); this.toolbarButtons = b.toolbarButtons; this.rowButtons = b.rowButtons; this.fetchData() },
|
||||
methods: { async fetchData () { this.loading = true; try { const res = await getWorkshopConfigList({ ...this.search, page_no: this.pagination.current, page_size: this.pagination.size }); this.tableData = Array.isArray(res) ? res : (res.data || []); this.pagination.total = Array.isArray(res) ? res.length : (res.count || res.total || 0) } finally { this.loading = false } }, onSearch () { this.pagination.current = 1; this.fetchData() }, onReset () { this.search = { building: '', floor: '', name: '' }; this.onSearch() }, onPageChange (p) { this.pagination.current = p.current; this.pagination.size = p.size; this.fetchData() }, onSelect (rows) { this.selectedRows = rows }, openAdd () { this.handleType = 'create'; this.dialogTitle = this.key('add_title'); this.editId = ''; this.formData = { code: '', name: '', building: '', floor: '' }; this.dialogVisible = true }, openEdit (row) { this.handleType = 'edit'; this.dialogTitle = this.key('edit_title'); this.editId = row.id; this.formData = { code: row.code, name: row.name, building: row.building, floor: row.floor }; this.dialogVisible = true }, async onDialogSubmit () { this.submitting = true; try { if (this.handleType === 'create') await createWorkshopConfig(this.formData); else await editWorkshopConfig({ ...this.formData, id: this.editId }); this.$message.success(this.$t(this.key('operation_success'))); this.dialogVisible = false; this.fetchData() } finally { this.submitting = false } }, handleBatchDelete () { this.handleDelete(this.selectedRows) }, handleDelete (row) { const rows = Array.isArray(row) ? row : [row]; if (!rows.length) return this.$message.warning(this.$t(this.key('please_select'))); this.$confirm(this.$t(this.key('confirm_delete')), this.$t(this.key('tip')), { type: 'warning' }).then(async () => { await deleteWorkshopConfig({ id: rows.map(i => i.id) }); this.$message.success(this.$t(this.key('operation_success'))); this.fetchData() }).catch(() => {}) } }
|
||||
}
|
||||
</script>
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user