Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
weiqiao-vue
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
金民
weiqiao-vue
Commits
005dcea9
Commit
005dcea9
authored
Mar 06, 2026
by
董晓奇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
基础数据中,生产数据-->采集项中增加字段:是否获取设备数采。选择是否
parent
ac0c5a6d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
155 additions
and
57 deletions
+155
-57
xjrsoft-vue3/src/components/Form/src/types/form.ts
+1
-1
xjrsoft-vue3/src/views/jcsj/cjx/components/Form.vue
+121
-46
xjrsoft-vue3/src/views/jcsj/cjx/components/config.ts
+33
-10
No files found.
xjrsoft-vue3/src/components/Form/src/types/form.ts
View file @
005dcea9
...
...
@@ -144,7 +144,7 @@ export interface FormProps {
formWidth
?:
number
;
isSearch
?:
boolean
;
slots
?:
Slots
;
buttonList
:
buttonListInfo
[];
buttonList
?
:
buttonListInfo
[];
}
export
interface
FormSchema
{
// Field name
...
...
xjrsoft-vue3/src/views/jcsj/cjx/components/Form.vue
View file @
005dcea9
<
template
>
<div
class=
"pt-4"
>
<SimpleForm
ref=
"systemFormRef"
:formProps=
"data.formDataProps"
:formModel=
"state.formModel"
:isWorkFlow=
"props.fromPage
!=
FromPageType.MENU"
:isCamelCase=
"true"
:isWorkFlow=
"props.fromPage
!=
FromPageType.MENU"
:isCamelCase=
"true"
@
model-change=
"handleChange"
/>
</div>
...
...
@@ -15,21 +14,29 @@
import
{
reactive
,
ref
,
onMounted
,
nextTick
,
watch
}
from
'vue'
;
import
{
formProps
,
formEventConfigs
}
from
'./config'
;
import
SimpleForm
from
'/@/components/SimpleForm/src/SimpleForm.vue'
;
import
{
addMesCollectionItem
,
getMesCollectionItem
,
updateMesCollectionItem
}
from
'/@/api/jcsj/cjx'
;
import
{
cloneDeep
,
isString
}
from
'lodash-es'
;
import
{
addMesCollectionItem
,
getMesCollectionItem
,
updateMesCollectionItem
,
}
from
'/@/api/jcsj/cjx'
;
import
{
cloneDeep
,
isString
}
from
'lodash-es'
;
import
{
FormDataProps
}
from
'/@/components/Designer/src/types'
;
import
{
usePermission
}
from
'/@/hooks/web/usePermission'
;
import
CustomButtonModal
from
'/@/components/Form/src/components/CustomButtonModal.vue'
;
import
{
FromPageType
}
from
'/@/enums/workflowEnum'
;
import
{
createFormEvent
,
getFormDataEvent
,
loadFormEvent
,
submitFormEvent
,}
from
'/@/hooks/web/useFormEvent'
;
import
{
createFormEvent
,
getFormDataEvent
,
loadFormEvent
,
submitFormEvent
,
}
from
'/@/hooks/web/useFormEvent'
;
import
{
changeWorkFlowForm
,
changeSchemaDisabled
}
from
'/@/hooks/web/useWorkFlowForm'
;
import
{
WorkFlowFormParams
}
from
'/@/model/workflow/bpmnConfig'
;
import
{
useRouter
}
from
'vue-router'
;
const
{
filterFormSchemaAuth
}
=
usePermission
();
const
RowKey
=
'id'
;
const
emits
=
defineEmits
([
'changeUploadComponentIds'
,
'loadingCompleted'
,
'update:value'
]);
const
emits
=
defineEmits
([
'changeUploadComponentIds'
,
'loadingCompleted'
,
'update:value'
]);
const
props
=
defineProps
({
fromPage
:
{
type
:
Number
,
...
...
@@ -42,34 +49,52 @@
});
const
state
=
reactive
({
formModel
:
{},
formInfo
:
{
formId
:
''
,
formName
:
''
}
formInfo
:
{
formId
:
''
,
formName
:
''
},
});
const
{
currentRoute
}
=
useRouter
();
watch
(
()
=>
state
.
formModel
,
(
val
)
=>
{
(
val
)
=>
{
emits
(
'update:value'
,
val
);
},
{
deep
:
true
,
},
);
onMounted
(
async
()
=>
{
try
{
if
(
props
.
fromPage
==
FromPageType
.
MENU
)
{
setMenuPermission
();
if
(
currentRoute
.
value
.
meta
){
state
.
formInfo
.
formName
=
currentRoute
.
value
.
meta
.
title
&&
isString
(
currentRoute
.
value
.
meta
.
title
)?
currentRoute
.
value
.
meta
.
title
:
''
;
state
.
formInfo
.
formId
=
currentRoute
.
value
.
meta
.
formId
&&
isString
(
currentRoute
.
value
.
meta
.
formId
)?
currentRoute
.
value
.
meta
.
formId
:
''
;
if
(
currentRoute
.
value
.
meta
)
{
state
.
formInfo
.
formName
=
currentRoute
.
value
.
meta
.
title
&&
isString
(
currentRoute
.
value
.
meta
.
title
)
?
currentRoute
.
value
.
meta
.
title
:
''
;
state
.
formInfo
.
formId
=
currentRoute
.
value
.
meta
.
formId
&&
isString
(
currentRoute
.
value
.
meta
.
formId
)
?
currentRoute
.
value
.
meta
.
formId
:
''
;
}
await
createFormEvent
(
formEventConfigs
,
state
.
formModel
,
await
createFormEvent
(
formEventConfigs
,
state
.
formModel
,
systemFormRef
.
value
,
formProps
.
schemas
,
true
,
state
.
formInfo
.
formName
,
state
.
formInfo
.
formId
);
//表单事件:初始化表单
formProps
.
schemas
,
true
,
state
.
formInfo
.
formName
,
state
.
formInfo
.
formId
,
);
//表单事件:初始化表单
await
nextTick
();
await
loadFormEvent
(
formEventConfigs
,
state
.
formModel
,
await
loadFormEvent
(
formEventConfigs
,
state
.
formModel
,
systemFormRef
.
value
,
formProps
.
schemas
,
true
,
state
.
formInfo
.
formName
,
state
.
formInfo
.
formId
);
//表单事件:加载表单
formProps
.
schemas
,
true
,
state
.
formInfo
.
formName
,
state
.
formInfo
.
formId
,
);
//表单事件:加载表单
}
else
if
(
props
.
fromPage
==
FromPageType
.
FLOW
)
{
emits
(
'loadingCompleted'
);
//告诉系统表单已经加载完毕
// loadingCompleted后 工作流页面直接利用Ref调用setWorkFlowForm方法
...
...
@@ -78,15 +103,28 @@
}
else
if
(
props
.
fromPage
==
FromPageType
.
DESKTOP
)
{
// 桌面设计 表单事件需要执行
emits
(
'loadingCompleted'
);
//告诉系统表单已经加载完毕
await
createFormEvent
(
formEventConfigs
,
state
.
formModel
,
await
createFormEvent
(
formEventConfigs
,
state
.
formModel
,
systemFormRef
.
value
,
formProps
.
schemas
,
true
,
state
.
formInfo
.
formName
,
state
.
formInfo
.
formId
);
//表单事件:初始化表单
await
loadFormEvent
(
formEventConfigs
,
state
.
formModel
,
formProps
.
schemas
,
true
,
state
.
formInfo
.
formName
,
state
.
formInfo
.
formId
,
);
//表单事件:初始化表单
await
loadFormEvent
(
formEventConfigs
,
state
.
formModel
,
systemFormRef
.
value
,
formProps
.
schemas
,
true
,
state
.
formInfo
.
formName
,
state
.
formInfo
.
formId
);
//表单事件:加载表单
formProps
.
schemas
,
true
,
state
.
formInfo
.
formName
,
state
.
formInfo
.
formId
,
);
//表单事件:加载表单
}
}
catch
(
error
)
{}
});
// 根据菜单页面权限,设置表单属性(必填,禁用,显示)
function
setMenuPermission
()
{
data
.
formDataProps
.
schemas
=
filterFormSchemaAuth
(
data
.
formDataProps
.
schemas
!
);
...
...
@@ -106,20 +144,26 @@
}
finally
{
}
return
values
;
}
}
// 根据行唯一ID查询行数据,并设置表单数据 【编辑】
async
function
setFormDataFromId
(
rowId
)
{
try
{
const
record
=
await
getMesCollectionItem
(
rowId
);
const
record
=
await
getMesCollectionItem
(
rowId
);
setFieldsValue
(
record
);
state
.
formModel
=
record
;
await
getFormDataEvent
(
formEventConfigs
,
state
.
formModel
,
await
getFormDataEvent
(
formEventConfigs
,
state
.
formModel
,
systemFormRef
.
value
,
formProps
.
schemas
,
true
,
state
.
formInfo
.
formName
,
state
.
formInfo
.
formId
);
//表单事件:获取表单数据
}
catch
(
error
)
{
}
formProps
.
schemas
,
true
,
state
.
formInfo
.
formName
,
state
.
formInfo
.
formId
,
);
//表单事件:获取表单数据
}
catch
(
error
)
{}
}
// 辅助返回表单数据
async
function
getFieldsValue
()
{
let
values
=
[];
...
...
@@ -135,47 +179,66 @@
}
return
values
;
}
// 辅助设置表单数据
function
setFieldsValue
(
record
)
{
systemFormRef
.
value
.
setFieldsValue
(
record
);
}
// 重置表单数据
async
function
resetFields
()
{
await
systemFormRef
.
value
.
resetFields
();
}
// 设置表单数据全部为Disabled 【查看】
async
function
setDisabledForm
(
)
{
async
function
setDisabledForm
()
{
data
.
formDataProps
.
schemas
=
changeSchemaDisabled
(
cloneDeep
(
data
.
formDataProps
.
schemas
));
}
// 获取行键值
function
getRowKey
()
{
return
RowKey
;
}
// 更新api表单数据
async
function
update
({
values
,
rowId
})
{
try
{
values
[
RowKey
]
=
rowId
;
state
.
formModel
=
values
;
let
saveVal
=
await
updateMesCollectionItem
(
values
);
await
submitFormEvent
(
formEventConfigs
,
state
.
formModel
,
await
submitFormEvent
(
formEventConfigs
,
state
.
formModel
,
systemFormRef
.
value
,
formProps
.
schemas
,
true
,
state
.
formInfo
.
formName
,
state
.
formInfo
.
formId
);
//表单事件:提交表单
formProps
.
schemas
,
true
,
state
.
formInfo
.
formName
,
state
.
formInfo
.
formId
,
);
//表单事件:提交表单
return
saveVal
;
}
catch
(
error
)
{}
}
// 新增api表单数据
async
function
add
(
values
)
{
try
{
state
.
formModel
=
values
;
let
saveVal
=
await
addMesCollectionItem
(
values
);
await
submitFormEvent
(
formEventConfigs
,
state
.
formModel
,
await
submitFormEvent
(
formEventConfigs
,
state
.
formModel
,
systemFormRef
.
value
,
formProps
.
schemas
,
true
,
state
.
formInfo
.
formName
,
state
.
formInfo
.
formId
);
//表单事件:提交表单
formProps
.
schemas
,
true
,
state
.
formInfo
.
formName
,
state
.
formInfo
.
formId
,
);
//表单事件:提交表单
return
saveVal
;
}
catch
(
error
)
{}
}
// 根据工作流页面权限,设置表单属性(必填,禁用,显示)
async
function
setWorkFlowForm
(
obj
:
WorkFlowFormParams
)
{
async
function
setWorkFlowForm
(
obj
:
WorkFlowFormParams
)
{
try
{
if
(
obj
.
formId
)
state
.
formInfo
.
formId
=
obj
.
formId
;
if
(
obj
.
formName
)
state
.
formInfo
.
formName
=
obj
.
formName
;
...
...
@@ -189,23 +252,38 @@
state
.
formModel
=
formModels
;
setFieldsValue
(
formModels
);
}
catch
(
error
)
{}
await
createFormEvent
(
formEventConfigs
,
state
.
formModel
,
await
createFormEvent
(
formEventConfigs
,
state
.
formModel
,
systemFormRef
.
value
,
formProps
.
schemas
,
true
,
state
.
formInfo
.
formName
,
state
.
formInfo
.
formId
);
//表单事件:初始化表单
await
loadFormEvent
(
formEventConfigs
,
state
.
formModel
,
formProps
.
schemas
,
true
,
state
.
formInfo
.
formName
,
state
.
formInfo
.
formId
,
);
//表单事件:初始化表单
await
loadFormEvent
(
formEventConfigs
,
state
.
formModel
,
systemFormRef
.
value
,
formProps
.
schemas
,
true
,
state
.
formInfo
.
formName
,
state
.
formInfo
.
formId
);
//表单事件:加载表单
formProps
.
schemas
,
true
,
state
.
formInfo
.
formName
,
state
.
formInfo
.
formId
,
);
//表单事件:加载表单
}
function
handleChange
(
val
)
{
function
handleChange
(
val
)
{
emits
(
'update:value'
,
val
);
}
async
function
sendMessageForAllIframe
()
{
async
function
sendMessageForAllIframe
()
{
try
{
if
(
systemFormRef
.
value
&&
systemFormRef
.
value
.
sendMessageForAllIframe
)
{
systemFormRef
.
value
.
sendMessageForAllIframe
();
}
}
catch
(
error
)
{}
}
defineExpose
({
setFieldsValue
,
resetFields
,
...
...
@@ -218,8 +296,6 @@
setWorkFlowForm
,
getRowKey
,
getFieldsValue
,
sendMessageForAllIframe
sendMessageForAllIframe
,
});
</
script
>
\ No newline at end of file
xjrsoft-vue3/src/views/jcsj/cjx/components/config.ts
View file @
005dcea9
...
...
@@ -210,9 +210,9 @@ export const formProps: FormProps = {
span
:
8
,
list
:
[
{
label
:
'编号'
,
key
:
'63358dcd4fc24817b7ed628c1628b768'
,
field
:
'code'
,
label
:
'编号'
,
type
:
'auto-code'
,
component
:
'AutoCodeRule'
,
colProps
:
{
span
:
24
},
...
...
@@ -233,9 +233,9 @@ export const formProps: FormProps = {
},
},
{
label
:
'采集内容'
,
key
:
'e7f5cb98a72b435486e7b27202b20314'
,
field
:
'contentType'
,
label
:
'采集内容'
,
type
:
'select'
,
component
:
'XjrSelect'
,
colProps
:
{
span
:
24
},
...
...
@@ -273,9 +273,9 @@ export const formProps: FormProps = {
},
},
{
label
:
'标准值'
,
key
:
'6bcc83ede1a446bd95291c6af00ab4af'
,
field
:
'standardValue'
,
label
:
'标准值'
,
type
:
'input'
,
component
:
'Input'
,
colProps
:
{
span
:
24
},
...
...
@@ -305,15 +305,38 @@ export const formProps: FormProps = {
style
:
{
width
:
'100%'
},
},
},
{
label
:
'获取设备数采'
,
key
:
'781dbbcd076e4d3c87e7f1bef5a237d7'
,
field
:
'deviceAcquisitionData'
,
type
:
'switch'
,
component
:
'Switch'
,
colProps
:
{
span
:
24
},
defaultValue
:
0
,
componentProps
:
{
span
:
7
,
defaultValue
:
0
,
checkedChildren
:
''
,
unCheckedChildren
:
''
,
checkedColor
:
'#4da9ff'
,
unCheckedColor
:
'#6b6b6b'
,
showLabel
:
true
,
disabled
:
false
,
events
:
{},
isShow
:
true
,
tooltipConfig
:
{
visible
:
false
,
title
:
'提示文本'
},
style
:
{},
},
},
],
},
{
span
:
8
,
list
:
[
{
label
:
'名称'
,
key
:
'94675ea0ccc842aaaeec56e898af23ec'
,
field
:
'name'
,
label
:
'名称'
,
type
:
'input'
,
component
:
'Input'
,
colProps
:
{
span
:
24
},
...
...
@@ -344,9 +367,9 @@ export const formProps: FormProps = {
},
},
{
label
:
'项目类别'
,
key
:
'aeef62f898504ee69ec02be990a3e827'
,
field
:
'qualityCategoryId'
,
label
:
'项目类别'
,
type
:
'select'
,
component
:
'XjrSelect'
,
colProps
:
{
span
:
24
},
...
...
@@ -384,9 +407,9 @@ export const formProps: FormProps = {
},
},
{
label
:
'标准上限'
,
key
:
'd1f5113e7e8a462d8b33908230ea7fc3'
,
field
:
'upperValue'
,
label
:
'标准上限'
,
type
:
'number'
,
component
:
'InputNumber'
,
colProps
:
{
span
:
24
},
...
...
@@ -414,9 +437,9 @@ export const formProps: FormProps = {
span
:
8
,
list
:
[
{
label
:
'必填项'
,
key
:
'781dbbcd076e4d3c87e7f1bef5a237d7'
,
field
:
'required'
,
label
:
'必填项'
,
type
:
'switch'
,
component
:
'Switch'
,
colProps
:
{
span
:
24
},
...
...
@@ -437,9 +460,9 @@ export const formProps: FormProps = {
},
},
{
label
:
'数据类型'
,
key
:
'a70a1e8f07f342a5b92de0a9e8bb1777'
,
field
:
'dataType'
,
label
:
'数据类型'
,
type
:
'select'
,
component
:
'XjrSelect'
,
colProps
:
{
span
:
24
},
...
...
@@ -477,9 +500,9 @@ export const formProps: FormProps = {
},
},
{
label
:
'标准下限'
,
key
:
'076321d9eb244b1c9f6e2f9ddc53091e'
,
field
:
'lowerValue'
,
label
:
'标准下限'
,
type
:
'number'
,
component
:
'InputNumber'
,
colProps
:
{
span
:
24
},
...
...
@@ -507,9 +530,9 @@ export const formProps: FormProps = {
span
:
24
,
list
:
[
{
label
:
'备注'
,
key
:
'181de7ae00fd4ffda6cb3a729c65bc58'
,
field
:
'note'
,
label
:
'备注'
,
type
:
'textarea'
,
component
:
'InputTextArea'
,
colProps
:
{
span
:
24
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment