diff --git a/business-css/frontend/src/api/business/database/criticalData/index.ts b/business-css/frontend/src/api/business/database/criticalData/index.ts
index 5910e11..78e46ac 100644
--- a/business-css/frontend/src/api/business/database/criticalData/index.ts
+++ b/business-css/frontend/src/api/business/database/criticalData/index.ts
@@ -50,7 +50,7 @@ export function deleteBatchCriticalData (queryParams:any){
}
// 导出临界数据
export function exportAllExports(deviceType:any){
- let url = '/critical-data/v2/export/?deviceType='+deviceType
+ let url = '/critical-data/v2/export?deviceType='+deviceType
return request({
url: url ,
diff --git a/business-css/frontend/src/api/business/database/device/index.ts b/business-css/frontend/src/api/business/database/device/index.ts
index 771eb05..739a7df 100644
--- a/business-css/frontend/src/api/business/database/device/index.ts
+++ b/business-css/frontend/src/api/business/database/device/index.ts
@@ -61,7 +61,7 @@ export function sizeSchemaAll(queryParams:any){
// 导出全部结果
export function exportAllExports(deviceType:any){
- let url = '/devices/v2/export/?deviceType='+deviceType
+ let url = '/devices/v2/export?deviceType='+deviceType
return request({
url: url ,
diff --git a/business-css/frontend/src/api/business/database/material/index.ts b/business-css/frontend/src/api/business/database/material/index.ts
index c548fff..34f9f47 100644
--- a/business-css/frontend/src/api/business/database/material/index.ts
+++ b/business-css/frontend/src/api/business/database/material/index.ts
@@ -78,4 +78,4 @@ export function materialsById (id:any){
method: 'get'
// params: queryParams
});
-}
\ No newline at end of file
+}
\ No newline at end of file
diff --git a/business-css/frontend/src/views/component/scenario/condition.vue b/business-css/frontend/src/views/component/scenario/condition.vue
index 6c3bb6a..de1f5de 100644
--- a/business-css/frontend/src/views/component/scenario/condition.vue
+++ b/business-css/frontend/src/views/component/scenario/condition.vue
@@ -12,6 +12,7 @@ import { getDictItemById } from '@/api/dict';
import { topologyDevicesLsit } from '@/api/business/project';
import { getToken } from '@/utils/auth';
import { searchEventsByScenarioId } from '@/api/business/event';
+import { sizeSchemaAll } from "@/api/business/database/device";
const url = import.meta.env.VITE_APP_BASE_API;
const conditionData:any = ref([{ // 套件数据
@@ -69,7 +70,7 @@ function initConditionData(){
}
}
if(res.length > 0){
- getDeviceInfo(menuList.value[0].device)
+ getInitDeviceInfo(menuList.value[0].device)
}
})
@@ -78,13 +79,25 @@ onMounted(() => {
DicInit()
initDeviceData()
initConditionData()
+ getSizeSchemaList()
});
+
+//获取所有项目列表
+const sizeSchemaInfo:any = ref({});
+
+async function getSizeSchemaList(){ // 获取所有项目列表
+ let result = await sizeSchemaAll({})
+ sizeSchemaInfo.value = result
+}
+
+
const deviceData:any = ref([]) // 始发设备数据
const attributeData:any = ref([]) // 设备属性数据
const materialData:any = ref([]) // 变化物料数据
const menuList:any = ref([
{
label: '条件1',
+ deviceType: '',
target:{
entityType: '',
entityId: '',
@@ -136,6 +149,7 @@ function addMenu(){ //添加导菜单
menuList.value.push({
label: '条件' + (menuList.value.length + 1),
+ deviceType: '',
target:{
entityType: '',
entityId: '',
@@ -159,18 +173,6 @@ function delMenu(){ // 删除导菜单
// 查询字典项
function DicInit() {
- let params = {
- dictId: 'dc7419e5f8a655966e6bb90b0cb5c0c2',
- size:99,
- current:1
- }
- getDictItemById(params).then((result: any) => {
- attributeData.value = result.data.records;
- }).catch((err: any) => {
- if(menuList.value[menuIndex.value].target.entityType == 'device'){
- getDeviceInfo(menuList.value[menuIndex.value].device)
- }
- });
let paramss = {
dictId: '9d87f873bc80e79c6d399131cbe01016',
size:99,
@@ -179,7 +181,7 @@ function DicInit() {
getDictItemById(paramss).then((result: any) => {
materialData.value = result.data.records;
if(menuList.value[menuIndex.value].target.entityType == 'device'){
- getDeviceInfo(menuList.value[menuIndex.value].device)
+ getInitDeviceInfo(menuList.value[menuIndex.value].device)
}
}).catch((err: any) => {
});
@@ -195,15 +197,13 @@ function changeAttribute(e:any){ // 设备属性改变时,清空变化物料
menuList.value[menuIndex.value].target.entityType = 'device'
menuList.value[menuIndex.value].target.property = e
deviceData.value.forEach((item:any) => {
- if(item.deviceName == menuList.value[menuIndex.value].device){
+ if(item.deviceId == menuList.value[menuIndex.value].device){
menuList.value[menuIndex.value].target.entityId = item.deviceId
}
})
}
-
-
- getDeviceInfo(e)
+ getAttributeMaterial(e)
}
function changeMaterial(e:any){ // 设备属性改变时,清空变化物料
menuList.value[menuIndex.value].target.entityType = ''
@@ -213,14 +213,13 @@ function changeMaterial(e:any){ // 设备属性改变时,清空变化物料
menuList.value[menuIndex.value].target.entityId = ''
deviceData.value.forEach((item:any) => {
- if(item.deviceName == menuList.value[menuIndex.value].device){
+ if(item.deviceId == menuList.value[menuIndex.value].device){
menuList.value[menuIndex.value].target.entityId = item.materialId
}
})
menuList.value[menuIndex.value].target.property = e
}
-
- getDeviceInfo(e)
+ getAttributeMaterial(e)
}
const devicename = ref('') // 选中始发设备
@@ -237,21 +236,61 @@ function getTimelineList(){
})
})
}
-function getDeviceInfo(e:any){ // 获取设备信息
+
+function getDeviceInfo(e:any){ //始发设备(物料) 下来选项
+ devicename.value = ""
+ deviceMaterial.value = ""
+ menuList.value[menuIndex.value].attribute = ""
+ menuList.value[menuIndex.value].material = ""
+ deviceData.value.forEach((item:any) => {
+ if(item.deviceId == menuList.value[menuIndex.value].device){
+ devicename.value = item.deviceName
+ menuList.value[menuIndex.value].deviceType = item.deviceType
+ for(let key in sizeSchemaInfo.value){
+ if(item.deviceType == key){
+ attributeData.value = sizeSchemaInfo.value[key].fields
+ attributeData.value.forEach((item:any) => {
+ item.dictName = item.label,
+ item.itemCode = item.key
+ })
+ }
+
+ }
+ }
+ })
+}
+
+
+function getInitDeviceInfo(e:any){ // 初始化信息
+
devicename.value = ""
deviceMaterial.value = ""
deviceData.value.forEach((item:any) => {
- if(item.deviceName == menuList.value[menuIndex.value].device){
+ if(item.deviceId == menuList.value[menuIndex.value].device){
devicename.value = item.deviceName
+ menuList.value[menuIndex.value].deviceType = item.deviceType
+ for(let key in sizeSchemaInfo.value){
+ if(item.deviceType == key){
+ attributeData.value = sizeSchemaInfo.value[key].fields
+ attributeData.value.forEach((item:any) => {
+ item.dictName = item.label,
+ item.itemCode = item.key
+ })
+ }
+
+ }
+
}
})
-
if(menuList.value[menuIndex.value].target.entityType == 'device'){
attributeData.value.forEach((item:any) => {
if(item.itemCode == menuList.value[menuIndex.value].attribute){
deviceMaterial.value = item.dictName
}
})
+
+ // 获取所有项目列表
+ // getSizeSchemaList()
}
if(menuList.value[menuIndex.value].target.entityType == 'material'){
@@ -265,7 +304,26 @@ function getDeviceInfo(e:any){ // 获取设备信息
}
+function getAttributeMaterial(e:any){ // 获取设备属性或变化物料
+ if(menuList.value[menuIndex.value].target.entityType == 'device'){
+ attributeData.value.forEach((item:any) => {
+ if(item.itemCode == menuList.value[menuIndex.value].attribute){
+ deviceMaterial.value = item.dictName
+ }
+ })
+ // 获取所有项目列表
+ // getSizeSchemaList()
+ }
+
+ if(menuList.value[menuIndex.value].target.entityType == 'material'){
+ materialData.value.forEach((item:any) => {
+ if(item.itemCode == menuList.value[menuIndex.value].material){
+ deviceMaterial.value = item.dictName
+ }
+ })
+ }
+}
const upload:any = ref(null)
function handleSuccess(file: any) {
if(file.code =="0"){
@@ -299,19 +357,24 @@ function handleSuccess(file: any) {