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
0
Merge Requests
0
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
ae410d79
Commit
ae410d79
authored
Jan 21, 2026
by
宋春膨
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/weiqiao-vue3' into weiqiao-vue3
parents
6469fdb9
e6814e4a
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
1268 additions
and
0 deletions
+1268
-0
xjrsoft-vue3/src/api/sbgl/shebeigl/index.ts
+93
-0
xjrsoft-vue3/src/api/sbgl/shebeigl/model/ShebeiglModel.ts
+137
-0
xjrsoft-vue3/src/views/sbgl/shebeigl/components/Form.vue
+226
-0
xjrsoft-vue3/src/views/sbgl/shebeigl/components/ShebeiglModal.vue
+139
-0
xjrsoft-vue3/src/views/sbgl/shebeigl/components/config.ts
+0
-0
xjrsoft-vue3/src/views/sbgl/shebeigl/components/workflowPermission.ts
+287
-0
xjrsoft-vue3/src/views/sbgl/shebeigl/index.vue
+386
-0
No files found.
xjrsoft-vue3/src/api/sbgl/shebeigl/index.ts
0 → 100644
View file @
ae410d79
import
{
MesEquipmentPageModel
,
MesEquipmentPageParams
,
MesEquipmentPageResult
}
from
'./model/ShebeiglModel'
;
import
{
defHttp
}
from
'/@/utils/http/axios'
;
import
{
ErrorMessageMode
}
from
'/#/axios'
;
enum
Api
{
Page
=
'/sbgl/shebeigl/page'
,
List
=
'/sbgl/shebeigl/list'
,
Info
=
'/sbgl/shebeigl/info'
,
MesEquipment
=
'/sbgl/shebeigl'
,
}
/**
* @description: 查询MesEquipment分页列表
*/
export
async
function
getMesEquipmentPage
(
params
:
MesEquipmentPageParams
,
mode
:
ErrorMessageMode
=
'modal'
)
{
return
defHttp
.
get
<
MesEquipmentPageResult
>
(
{
url
:
Api
.
Page
,
params
,
},
{
errorMessageMode
:
mode
,
},
);
}
/**
* @description: 获取MesEquipment信息
*/
export
async
function
getMesEquipment
(
id
:
String
,
mode
:
ErrorMessageMode
=
'modal'
)
{
return
defHttp
.
get
<
MesEquipmentPageModel
>
(
{
url
:
Api
.
Info
,
params
:
{
id
},
},
{
errorMessageMode
:
mode
,
},
);
}
/**
* @description: 新增MesEquipment
*/
export
async
function
addMesEquipment
(
mesEquipment
:
Recordable
,
mode
:
ErrorMessageMode
=
'modal'
)
{
return
defHttp
.
post
<
boolean
>
(
{
url
:
Api
.
MesEquipment
,
params
:
mesEquipment
,
},
{
errorMessageMode
:
mode
,
},
);
}
/**
* @description: 更新MesEquipment
*/
export
async
function
updateMesEquipment
(
mesEquipment
:
Recordable
,
mode
:
ErrorMessageMode
=
'modal'
)
{
return
defHttp
.
put
<
boolean
>
(
{
url
:
Api
.
MesEquipment
,
params
:
mesEquipment
,
},
{
errorMessageMode
:
mode
,
},
);
}
/**
* @description: 删除MesEquipment(批量删除)
*/
export
async
function
deleteMesEquipment
(
ids
:
string
[],
mode
:
ErrorMessageMode
=
'modal'
)
{
return
defHttp
.
delete
<
boolean
>
(
{
url
:
Api
.
MesEquipment
,
data
:
ids
,
},
{
errorMessageMode
:
mode
,
},
);
}
xjrsoft-vue3/src/api/sbgl/shebeigl/model/ShebeiglModel.ts
0 → 100644
View file @
ae410d79
import
{
BasicPageParams
,
BasicFetchResult
}
from
'/@/api/model/baseModel'
;
/**
* @description: MesEquipment分页参数 模型
*/
export
interface
MesEquipmentPageParams
extends
BasicPageParams
{
name
:
string
;
code
:
string
;
eState
:
string
;
}
/**
* @description: MesEquipment分页返回值模型
*/
export
interface
MesEquipmentPageModel
{
id
:
string
;
name
:
string
;
specification
:
string
;
code
:
string
;
categoryId
:
string
;
userId
:
string
;
eState
:
string
;
companyId
:
string
;
}
/**
* @description: MesEquipment表类型
*/
export
interface
MesEquipmentModel
{
id
:
string
;
deleteMark
:
string
;
messageMainAttachmentId
:
string
;
name
:
string
;
code
:
string
;
categoryId
:
string
;
active
:
string
;
workCenterId
:
string
;
lastSpotDate
:
string
;
location
:
string
;
indexCode
:
string
;
manufacturer
:
string
;
manufacturerCode
:
string
;
specification
:
string
;
manufactureDate
:
string
;
warrantyDate
:
string
;
registerCode
:
string
;
createArchivesUserId
:
string
;
archivesCode
:
string
;
archivesDate
:
string
;
usePermitCode
:
string
;
testOrgId
:
string
;
lastTestDate
:
string
;
nextTestDate
:
string
;
userId
:
string
;
note
:
string
;
inRepair
:
string
;
isPart
:
string
;
parentEqptId
:
string
;
eState
:
string
;
companyId
:
string
;
isHasScrapped
:
string
;
price
:
string
;
p1
:
string
;
p2
:
string
;
p3
:
string
;
p4
:
string
;
p5
:
string
;
p6
:
string
;
p7
:
string
;
p8
:
string
;
p9
:
string
;
p10
:
string
;
createDate
:
string
;
createUserId
:
string
;
modifyDate
:
string
;
modifyUserId
:
string
;
}
/**
* @description: MesEquipment分页返回值结构
*/
export
type
MesEquipmentPageResult
=
BasicFetchResult
<
MesEquipmentPageModel
>
;
xjrsoft-vue3/src/views/sbgl/shebeigl/components/Form.vue
0 → 100644
View file @
ae410d79
<
template
>
<div
class=
"pt-4"
>
<SimpleForm
ref=
"systemFormRef"
:formProps=
"data.formDataProps"
:formModel=
"state.formModel"
:isWorkFlow=
"props.fromPage!=FromPageType.MENU"
:isCamelCase=
"true"
@
model-change=
"handleChange"
/>
</div>
</
template
>
<
script
lang=
"ts"
setup
>
import
{
reactive
,
ref
,
onMounted
,
nextTick
,
watch
}
from
'vue'
;
import
{
formProps
,
formEventConfigs
}
from
'./config'
;
import
SimpleForm
from
'/@/components/SimpleForm/src/SimpleForm.vue'
;
import
{
addMesEquipment
,
getMesEquipment
,
updateMesEquipment
}
from
'/@/api/sbgl/shebeigl'
;
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
{
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
props
=
defineProps
({
fromPage
:
{
type
:
Number
,
default
:
FromPageType
.
MENU
,
},
});
const
systemFormRef
=
ref
();
const
data
:
{
formDataProps
:
FormDataProps
}
=
reactive
({
formDataProps
:
cloneDeep
(
formProps
),
});
const
state
=
reactive
({
formModel
:
{},
formInfo
:{
formId
:
''
,
formName
:
''
}
});
const
{
currentRoute
}
=
useRouter
();
watch
(
()
=>
state
.
formModel
,
(
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
:
''
;
}
await
createFormEvent
(
formEventConfigs
,
state
.
formModel
,
systemFormRef
.
value
,
formProps
.
schemas
,
true
,
state
.
formInfo
.
formName
,
state
.
formInfo
.
formId
);
//表单事件:初始化表单
await
nextTick
();
await
loadFormEvent
(
formEventConfigs
,
state
.
formModel
,
systemFormRef
.
value
,
formProps
.
schemas
,
true
,
state
.
formInfo
.
formName
,
state
.
formInfo
.
formId
);
//表单事件:加载表单
}
else
if
(
props
.
fromPage
==
FromPageType
.
FLOW
)
{
emits
(
'loadingCompleted'
);
//告诉系统表单已经加载完毕
// loadingCompleted后 工作流页面直接利用Ref调用setWorkFlowForm方法
}
else
if
(
props
.
fromPage
==
FromPageType
.
PREVIEW
)
{
// 预览 无需权限,表单事件也无需执行
}
else
if
(
props
.
fromPage
==
FromPageType
.
DESKTOP
)
{
// 桌面设计 表单事件需要执行
emits
(
'loadingCompleted'
);
//告诉系统表单已经加载完毕
await
createFormEvent
(
formEventConfigs
,
state
.
formModel
,
systemFormRef
.
value
,
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
);
//表单事件:加载表单
}
}
catch
(
error
)
{}
});
// 根据菜单页面权限,设置表单属性(必填,禁用,显示)
function
setMenuPermission
()
{
data
.
formDataProps
.
schemas
=
filterFormSchemaAuth
(
data
.
formDataProps
.
schemas
!
);
}
// 校验form 通过返回表单数据
async
function
validate
()
{
let
values
=
[];
try
{
values
=
await
systemFormRef
.
value
?.
validate
();
//添加隐藏组件
if
(
data
.
formDataProps
.
hiddenComponent
?.
length
)
{
data
.
formDataProps
.
hiddenComponent
.
forEach
((
component
)
=>
{
values
[
component
.
bindField
]
=
component
.
value
;
});
}
}
finally
{
}
return
values
;
}
// 根据行唯一ID查询行数据,并设置表单数据 【编辑】
async
function
setFormDataFromId
(
rowId
)
{
try
{
const
record
=
await
getMesEquipment
(
rowId
);
setFieldsValue
(
record
);
state
.
formModel
=
record
;
await
getFormDataEvent
(
formEventConfigs
,
state
.
formModel
,
systemFormRef
.
value
,
formProps
.
schemas
,
true
,
state
.
formInfo
.
formName
,
state
.
formInfo
.
formId
);
//表单事件:获取表单数据
}
catch
(
error
)
{
}
}
// 辅助返回表单数据
async
function
getFieldsValue
()
{
let
values
=
[];
try
{
values
=
await
systemFormRef
.
value
?.
getFieldsValue
();
//添加隐藏组件
if
(
data
.
formDataProps
.
hiddenComponent
?.
length
)
{
data
.
formDataProps
.
hiddenComponent
.
forEach
((
component
)
=>
{
values
[
component
.
bindField
]
=
component
.
value
;
});
}
}
finally
{
}
return
values
;
}
// 辅助设置表单数据
function
setFieldsValue
(
record
)
{
systemFormRef
.
value
.
setFieldsValue
(
record
);
}
// 重置表单数据
async
function
resetFields
()
{
await
systemFormRef
.
value
.
resetFields
();
}
// 设置表单数据全部为Disabled 【查看】
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
updateMesEquipment
(
values
);
await
submitFormEvent
(
formEventConfigs
,
state
.
formModel
,
systemFormRef
.
value
,
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
addMesEquipment
(
values
);
await
submitFormEvent
(
formEventConfigs
,
state
.
formModel
,
systemFormRef
.
value
,
formProps
.
schemas
,
true
,
state
.
formInfo
.
formName
,
state
.
formInfo
.
formId
);
//表单事件:提交表单
return
saveVal
;
}
catch
(
error
)
{}
}
// 根据工作流页面权限,设置表单属性(必填,禁用,显示)
async
function
setWorkFlowForm
(
obj
:
WorkFlowFormParams
)
{
try
{
if
(
obj
.
formId
)
state
.
formInfo
.
formId
=
obj
.
formId
;
if
(
obj
.
formName
)
state
.
formInfo
.
formName
=
obj
.
formName
;
let
flowData
=
await
changeWorkFlowForm
(
cloneDeep
(
formProps
),
obj
);
let
{
buildOptionJson
,
uploadComponentIds
,
formModels
,
isViewProcess
}
=
flowData
;
data
.
formDataProps
=
buildOptionJson
;
emits
(
'changeUploadComponentIds'
,
uploadComponentIds
);
//工作流中必须保存上传组件id【附件汇总需要】
if
(
isViewProcess
)
{
setDisabledForm
();
//查看
}
state
.
formModel
=
formModels
;
setFieldsValue
(
formModels
);
}
catch
(
error
)
{}
await
createFormEvent
(
formEventConfigs
,
state
.
formModel
,
systemFormRef
.
value
,
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
);
//表单事件:加载表单
}
function
handleChange
(
val
)
{
emits
(
'update:value'
,
val
);
}
async
function
sendMessageForAllIframe
()
{
try
{
if
(
systemFormRef
.
value
&&
systemFormRef
.
value
.
sendMessageForAllIframe
)
{
systemFormRef
.
value
.
sendMessageForAllIframe
();
}
}
catch
(
error
)
{}
}
defineExpose
({
setFieldsValue
,
resetFields
,
validate
,
add
,
update
,
setFormDataFromId
,
setDisabledForm
,
setMenuPermission
,
setWorkFlowForm
,
getRowKey
,
getFieldsValue
,
sendMessageForAllIframe
});
</
script
>
\ No newline at end of file
xjrsoft-vue3/src/views/sbgl/shebeigl/components/ShebeiglModal.vue
0 → 100644
View file @
ae410d79
<
template
>
<BasicModal
:height=
"500"
v-bind=
"$attrs"
@
register=
"registerModal"
:title=
"getTitle"
@
ok=
"handleSubmit"
@
cancel=
"handleClose"
>
<ModalForm
ref=
"formRef"
v-model:value=
"state.formModel"
:fromPage=
"FromPageType.MENU"
/>
</BasicModal>
</
template
>
<
script
lang=
"ts"
setup
>
import
{
ref
,
computed
,
reactive
,
provide
,
Ref
}
from
'vue'
;
import
{
BasicModal
,
useModalInner
}
from
'/@/components/Modal'
;
import
{
useMessage
}
from
'/@/hooks/web/useMessage'
;
import
{
useI18n
}
from
'/@/hooks/web/useI18n'
;
import
{
formProps
}
from
'./config'
;
import
ModalForm
from
'./Form.vue'
;
import
{
FromPageType
}
from
'/@/enums/workflowEnum'
;
const
emit
=
defineEmits
([
'success'
,
'register'
]);
const
{
notification
}
=
useMessage
();
const
formRef
=
ref
();
const
isCopy
=
ref
<
boolean
>
(
false
)
const
state
=
reactive
({
formModel
:
{},
isUpdate
:
true
,
isView
:
false
,
rowId
:
''
,
});
provide
<
Ref
<
boolean
>>
(
'isCopy'
,
isCopy
);
const
{
t
}
=
useI18n
();
const
[
registerModal
,
{
setModalProps
,
closeModal
}]
=
useModalInner
(
async
(
data
)
=>
{
await
handleInner
(
data
);
});
const
getTitle
=
computed
(()
=>
(
state
.
isView
?
'查看'
:
state
.
isUpdate
?
'编辑'
:
isCopy
.
value
?
'复制数据'
:
'新增'
));
async
function
handleInner
(
data
){
state
.
isUpdate
=
!!
data
?.
isUpdate
;
state
.
isView
=
!!
data
?.
isView
;
isCopy
.
value
=
!!
data
?.
isCopy
;
setModalProps
({
destroyOnClose
:
true
,
maskClosable
:
false
,
showCancelBtn
:
!
state
.
isView
,
showOkBtn
:
!
state
.
isView
,
canFullscreen
:
true
,
width
:
900
,
footer
:
state
.
isView
?
null
:
undefined
,
defaultFullscreen
:
true
,
});
if
(
state
.
isUpdate
||
state
.
isView
||
isCopy
.
value
)
{
state
.
rowId
=
data
.
id
;
if
(
state
.
isView
)
{
await
formRef
.
value
.
setDisabledForm
();
}
await
formRef
.
value
.
setFormDataFromId
(
state
.
rowId
);
}
else
{
formRef
.
value
.
resetFields
();
}
}
async
function
saveModal
()
{
let
saveSuccess
=
false
;
try
{
const
values
=
await
formRef
.
value
?.
validate
();
//添加隐藏组件
if
(
formProps
.
hiddenComponent
?.
length
)
{
formProps
.
hiddenComponent
.
forEach
((
component
)
=>
{
values
[
component
.
bindField
]
=
component
.
value
;
});
}
if
(
values
!==
false
)
{
try
{
if
(
!
state
.
isUpdate
||
isCopy
.
value
)
{
saveSuccess
=
await
formRef
.
value
.
add
(
values
);
}
else
{
saveSuccess
=
await
formRef
.
value
.
update
({
values
,
rowId
:
state
.
rowId
});
}
return
saveSuccess
;
}
catch
(
error
)
{}
}
}
catch
(
error
)
{
return
saveSuccess
;
}
}
async
function
handleSubmit
()
{
try
{
const
saveSuccess
=
await
saveModal
();
setModalProps
({
confirmLoading
:
true
});
if
(
saveSuccess
)
{
if
(
!
state
.
isUpdate
||
isCopy
.
value
)
{
//false 新增
notification
.
success
({
message
:
'Tip'
,
description
:
isCopy
.
value
?
'复制成功'
:
t
(
'新增成功!'
),
});
//提示消息
}
else
{
notification
.
success
({
message
:
'Tip'
,
description
:
t
(
'修改成功!'
),
});
//提示消息
}
closeModal
();
formRef
.
value
.
resetFields
();
emit
(
'success'
);
}
}
finally
{
setModalProps
({
confirmLoading
:
false
});
}
}
function
handleClose
()
{
formRef
.
value
.
resetFields
();
}
</
script
>
\ No newline at end of file
xjrsoft-vue3/src/views/sbgl/shebeigl/components/config.ts
0 → 100644
View file @
ae410d79
This diff is collapsed.
Click to expand it.
xjrsoft-vue3/src/views/sbgl/shebeigl/components/workflowPermission.ts
0 → 100644
View file @
ae410d79
export
const
permissionList
=
[
{
required
:
true
,
view
:
true
,
edit
:
true
,
disabled
:
false
,
isSaveTable
:
false
,
tableName
:
''
,
fieldName
:
'设备名称'
,
fieldId
:
'name'
,
isSubTable
:
false
,
showChildren
:
true
,
type
:
'input'
,
key
:
'4e1454bda93646cbadc549e60817f521'
,
children
:
[],
options
:
{},
defaultValue
:
''
,
},
{
required
:
false
,
view
:
true
,
edit
:
true
,
disabled
:
false
,
isSaveTable
:
false
,
tableName
:
''
,
fieldName
:
'工作中心'
,
fieldId
:
'workCenterId'
,
isSubTable
:
false
,
showChildren
:
true
,
type
:
'select'
,
key
:
'e44a37abbb9e49558c70632186e574c6'
,
children
:
[],
options
:
{},
},
{
required
:
false
,
view
:
true
,
edit
:
true
,
disabled
:
false
,
isSaveTable
:
false
,
tableName
:
''
,
fieldName
:
'规格型号'
,
fieldId
:
'specification'
,
isSubTable
:
false
,
showChildren
:
true
,
type
:
'input'
,
key
:
'fabd7a4f3c5341dc8a2f29c251a87e15'
,
children
:
[],
options
:
{},
defaultValue
:
''
,
},
{
required
:
false
,
view
:
true
,
edit
:
true
,
disabled
:
false
,
isSaveTable
:
false
,
tableName
:
''
,
fieldName
:
'建档号'
,
fieldId
:
'archivesCode'
,
isSubTable
:
false
,
showChildren
:
true
,
type
:
'input'
,
key
:
'8b7ea6c93e554e2f8624822089a7aba1'
,
children
:
[],
options
:
{},
defaultValue
:
''
,
},
{
required
:
false
,
view
:
true
,
edit
:
false
,
disabled
:
true
,
isSaveTable
:
false
,
tableName
:
''
,
fieldName
:
'内部编号'
,
fieldId
:
'code'
,
isSubTable
:
false
,
showChildren
:
true
,
type
:
'auto-code'
,
key
:
'50abeb905e2e4f67adb855ffe71108a4'
,
children
:
[],
options
:
{},
},
{
required
:
false
,
view
:
true
,
edit
:
true
,
disabled
:
false
,
isSaveTable
:
false
,
tableName
:
''
,
fieldName
:
'当前位置'
,
fieldId
:
'location'
,
isSubTable
:
false
,
showChildren
:
true
,
type
:
'input'
,
key
:
'5f7b92f076bb490fa135b133b948d046'
,
children
:
[],
options
:
{},
defaultValue
:
''
,
},
{
required
:
false
,
view
:
true
,
edit
:
true
,
disabled
:
false
,
isSaveTable
:
false
,
tableName
:
''
,
fieldName
:
'注册代码'
,
fieldId
:
'registerCode'
,
isSubTable
:
false
,
showChildren
:
true
,
type
:
'input'
,
key
:
'4b580ceda42a410e949fc3930f5df91a'
,
children
:
[],
options
:
{},
defaultValue
:
''
,
},
{
required
:
false
,
view
:
true
,
edit
:
true
,
disabled
:
false
,
isSaveTable
:
false
,
tableName
:
''
,
fieldName
:
'建档人'
,
fieldId
:
'createArchivesUserId'
,
isSubTable
:
false
,
showChildren
:
true
,
type
:
'user'
,
key
:
'de0cf6d1a54c42e0b3dbe4a845bd1859'
,
children
:
[],
options
:
{},
defaultValue
:
''
,
},
{
required
:
false
,
view
:
true
,
edit
:
true
,
disabled
:
false
,
isSaveTable
:
false
,
tableName
:
''
,
fieldName
:
'设备类别'
,
fieldId
:
'categoryId'
,
isSubTable
:
false
,
showChildren
:
true
,
type
:
'select'
,
key
:
'a04838e334944caf887c2a9549de5fee'
,
children
:
[],
options
:
{},
},
{
required
:
false
,
view
:
true
,
edit
:
true
,
disabled
:
false
,
isSaveTable
:
false
,
tableName
:
''
,
fieldName
:
'负责人'
,
fieldId
:
'userId'
,
isSubTable
:
false
,
showChildren
:
true
,
type
:
'user'
,
key
:
'452e4fe97dfc477e8651b153c5fe8cf4'
,
children
:
[],
options
:
{},
defaultValue
:
''
,
},
{
required
:
false
,
view
:
true
,
edit
:
true
,
disabled
:
false
,
isSaveTable
:
false
,
tableName
:
''
,
fieldName
:
'使用证编号'
,
fieldId
:
'usePermitCode'
,
isSubTable
:
false
,
showChildren
:
true
,
type
:
'input'
,
key
:
'8d615ed0f2d549c6a029b7720953ac9a'
,
children
:
[],
options
:
{},
defaultValue
:
''
,
},
{
required
:
false
,
view
:
true
,
edit
:
true
,
disabled
:
false
,
isSaveTable
:
false
,
tableName
:
''
,
fieldName
:
'厂家'
,
fieldId
:
'manufacturer'
,
isSubTable
:
false
,
showChildren
:
true
,
type
:
'input'
,
key
:
'8a823e5c3a5e44ffa918582bfb74ba3e'
,
children
:
[],
options
:
{},
defaultValue
:
''
,
},
{
required
:
false
,
view
:
true
,
edit
:
true
,
disabled
:
false
,
isSaveTable
:
false
,
tableName
:
''
,
fieldName
:
'设备状态'
,
fieldId
:
'eState'
,
isSubTable
:
false
,
showChildren
:
true
,
type
:
'select'
,
key
:
'158003e17bcc402f818250c939367ffe'
,
children
:
[],
options
:
{},
defaultValue
:
'2'
,
},
{
required
:
false
,
view
:
true
,
edit
:
true
,
disabled
:
false
,
isSaveTable
:
false
,
tableName
:
''
,
fieldName
:
'公司'
,
fieldId
:
'companyId'
,
isSubTable
:
false
,
showChildren
:
true
,
type
:
'select'
,
key
:
'25184c444b82451c970b1b6702aa7fa9'
,
children
:
[],
options
:
{},
},
{
required
:
false
,
view
:
true
,
edit
:
true
,
disabled
:
false
,
isSaveTable
:
false
,
tableName
:
''
,
fieldName
:
'整机编号'
,
fieldId
:
'indexCode'
,
isSubTable
:
false
,
showChildren
:
true
,
type
:
'input'
,
key
:
'45fb316373fa4a9390907b157823eef3'
,
children
:
[],
options
:
{},
defaultValue
:
''
,
},
{
required
:
false
,
view
:
true
,
edit
:
true
,
disabled
:
false
,
isSaveTable
:
false
,
tableName
:
''
,
fieldName
:
'生产日期'
,
fieldId
:
'manufactureDate'
,
isSubTable
:
false
,
showChildren
:
true
,
type
:
'date'
,
key
:
'6fcb84a124a741deb3b3d6d17553b39e'
,
children
:
[],
options
:
{},
defaultValue
:
''
,
},
{
required
:
false
,
view
:
true
,
edit
:
false
,
disabled
:
true
,
isSaveTable
:
false
,
tableName
:
''
,
fieldName
:
'设备二维码'
,
fieldId
:
''
,
isSubTable
:
false
,
showChildren
:
true
,
type
:
'qrcode'
,
key
:
'5a4372bc13d147ad9de505bd53ed966d'
,
children
:
[],
options
:
{},
defaultValue
:
''
,
},
];
xjrsoft-vue3/src/views/sbgl/shebeigl/index.vue
0 → 100644
View file @
ae410d79
<
template
>
<ResizePageWrapper
:hasLeft=
"false"
>
<template
#
resizeRight
>
<BasicTable
@
register=
"registerTable"
isMenuTable
ref=
"tableRef"
>
<template
#
toolbar
>
<template
v-for=
"button in tableButtonConfig"
:key=
"button.code"
>
<a-button
v-if=
"button.isDefault"
type=
"primary"
@
click=
"buttonClick(button.code)"
>
<template
#
icon
><Icon
:icon=
"button.icon"
/></
template
>
{{ button.name }}
</a-button>
<CustomButtonModal
v-else-if=
"button.buttonType == 'modal'"
:info=
"button"
/>
<a-button
v-else
:type=
"button.buttonType === 'danger' ? 'default' : button.buttonType || 'primary'"
:danger=
"button.buttonType === 'danger'"
>
<
template
#
icon
><Icon
:icon=
"button.icon"
/></
template
>
{{ button.name }}
</a-button>
</template>
</template>
<
template
#
bodyCell=
"{ column, record }"
>
<template
v-if=
"column.dataIndex === 'action'"
>
<TableAction
:actions=
"getLessActions(record)"
:dropDownActions=
"getMoreActions(record)"
/>
</
template
>
<
template
v-else-if=
"column.dataIndex && column?.listStyle"
>
<span
:style=
"executeListStyle(getValue(record, column, 'style'), column?.listStyle)"
>
{{
getValue
(
record
,
column
,
'value'
)
}}
</span>
</
template
>
</template>
</BasicTable>
</template>
<ShebeiglModal
@
register=
"registerModal"
@
success=
"handleFormSuccess"
@
cancel=
"handleFormCancel"
/>
</ResizePageWrapper>
</template>
<
script
lang=
"ts"
setup
>
import
{
ref
,
computed
,
provide
,
Ref
,
createVNode
,
}
from
'vue'
;
import
{
Modal
}
from
'ant-design-vue'
;
import
{
ExclamationCircleOutlined
}
from
'@ant-design/icons-vue'
;
import
{
BasicTable
,
useTable
,
TableAction
,
ActionItem
}
from
'/@/components/Table'
;
import
{
getMesEquipmentPage
,
deleteMesEquipment
}
from
'/@/api/sbgl/shebeigl'
;
import
{
ResizePageWrapper
}
from
'/@/components/Page'
;
import
{
useMessage
}
from
'/@/hooks/web/useMessage'
;
import
{
useI18n
}
from
'/@/hooks/web/useI18n'
;
import
{
usePermission
}
from
'/@/hooks/web/usePermission'
;
import
CustomButtonModal
from
'/@/components/Form/src/components/CustomButtonModal.vue'
;
import
{
executeListStyle
,
getValue
}
from
'/@/hooks/web/useListStyle'
;
//列表样式配置
import
{
useRouter
}
from
'vue-router'
;
import
{
useModal
}
from
'/@/components/Modal'
;
import
ShebeiglModal
from
'./components/ShebeiglModal.vue'
;
import
{
searchFormSchema
,
columns
}
from
'./components/config'
;
import
Icon
from
'/@/components/Icon/index'
;
const
listSpliceNum
=
ref
(
3
);
//操作列最先展示几个
import
{
useConcurrentLock
}
from
'/@/hooks/web/useConcurrentLock'
;
const
pageParamsInfo
=
ref
<
any
>
({});
const
{
enableLockeData
,
handleOpenFormEnableLockeData
,
handleCloseFormEnableLocke
,
handleHasEnableLocke
}
=
useConcurrentLock
();
const
{
notification
}
=
useMessage
();
const
{
t
}
=
useI18n
();
defineEmits
([
'register'
]);
const
{
filterColumnAuth
,
filterButtonAuth
,
hasPermission
}
=
usePermission
();
const
filterColumns
=
filterColumnAuth
(
columns
);
const
tableRef
=
ref
();
//展示在列表内的按钮
const
actionButtons
=
ref
<
string
[]
>
([
"view"
,
"edit"
,
"delete"
]);
const
buttonConfigs
=
computed
(()
=>
{
const
list
=
[{
"isUse"
:
true
,
"name"
:
"查看"
,
"code"
:
"view"
,
"icon"
:
"ant-design:eye-outlined"
,
"isDefault"
:
true
},{
"isUse"
:
true
,
"name"
:
"新增"
,
"code"
:
"add"
,
"icon"
:
"ant-design:plus-outlined"
,
"isDefault"
:
true
},{
"isUse"
:
true
,
"name"
:
"编辑"
,
"code"
:
"edit"
,
"icon"
:
"ant-design:form-outlined"
,
"isDefault"
:
true
,
"isEnableLock"
:
true
},{
"isUse"
:
true
,
"name"
:
"删除"
,
"code"
:
"delete"
,
"icon"
:
"ant-design:delete-outlined"
,
"isDefault"
:
true
}]
return
filterButtonAuth
(
list
);
})
const
tableButtonConfig
=
computed
(()
=>
{
return
buttonConfigs
.
value
?.
filter
((
x
)
=>
!
actionButtons
.
value
.
includes
(
x
.
code
));
});
const
actionButtonConfig
=
computed
(()
=>
{
return
buttonConfigs
.
value
?.
filter
((
x
)
=>
actionButtons
.
value
.
includes
(
x
.
code
));
});
const
btnEvent
=
{
view
:
handleView
,
add
:
handleAdd
,
edit
:
handleEdit
,
delete
:
handleDelete
,}
const
{
currentRoute
}
=
useRouter
();
const
formIdComputedRef
=
computed
(()
=>
currentRoute
.
value
.
meta
.
formId
as
string
);
provide
<
Ref
<
string
>>
(
'currentFormId'
,
formIdComputedRef
);
const
[
registerModal
,
{
openModal
}]
=
useModal
();
const
[
registerTable
,
{
reload
,
}]
=
useTable
({
title
:
'Shebeigl列表'
,
api
:
getMesEquipmentPage
,
rowKey
:
'id'
,
columns
:
filterColumns
,
pagination
:
{
pageSize
:
10
,
},
formConfig
:
{
labelWidth
:
100
,
schemas
:
searchFormSchema
,
fieldMapToTime
:
[],
showResetButton
:
false
,
},
bordered
:
false
,
beforeFetch
:
(
params
)
=>
{
pageParamsInfo
.
value
=
{...
params
,
FormId
:
formIdComputedRef
.
value
,
PK
:
'id'
}
return
pageParamsInfo
.
value
;
},
afterFetch
:
(
res
)
=>
{
},
useSearchForm
:
true
,
showTableSetting
:
true
,
striped
:
false
,
actionColumn
:
{
width
:
195
,
title
:
'操作'
,
dataIndex
:
'action'
,
slots
:
{
customRender
:
'action'
},
},
tableSetting
:
{
size
:
false
,
},
customRow
,
isAdvancedQuery
:
false
,
querySelectOption
:
JSON
.
stringify
(
searchFormSchema
),
objectId
:
formIdComputedRef
.
value
,
////系统表单formId,自定义表单releaseId的id值
});
function
buttonClick
(
code
)
{
btnEvent
[
code
]();
}
function
handleAdd
()
{
openModal
(
true
,
{
isUpdate
:
false
,
});
}
async
function
handleEdit
(
record
:
Recordable
)
{
let
field
=
'id'
;
try
{
let
hasIn
=
handleHasEnableLocke
(
buttonConfigs
.
value
,
'edit'
);
if
(
hasIn
)
{
let
res
=
await
handleOpenFormEnableLockeData
(
record
[
field
],
formIdComputedRef
.
value
,
);
if
(
res
!==
null
)
{
return
;
}
}
let
info
=
{
id
:
record
[
field
],
isUpdate
:
true
,
};
openModal
(
true
,
info
);
}
catch
(
error
)
{}
}
function
handleDelete
(
record
:
Recordable
)
{
deleteList
([
record
.
id
]);
}
function
deleteList
(
ids
)
{
Modal
.
confirm
({
title
:
'提示信息'
,
icon
:
createVNode
(
ExclamationCircleOutlined
),
content
:
'是否确认删除?'
,
okText
:
'确认'
,
cancelText
:
'取消'
,
onOk
()
{
deleteMesEquipment
(
ids
).
then
((
_
)
=>
{
handleSuccess
();
notification
.
success
({
message
:
'Tip'
,
description
:
t
(
'删除成功!'
),
});
});
},
onCancel
()
{},
});
}
function
customRow
(
record
:
Recordable
)
{
return
{
ondblclick
:
()
=>
{
if
(
record
.
isCanEdit
&&
hasPermission
(
"shebeigl:edit"
))
{
handleEdit
(
record
);
}
},
};
}
function
handleSuccess
()
{
reload
();
}
function
handleFormSuccess
()
{
handleSuccess
();
handleCloseFormEnableLocke
(
buttonConfigs
.
value
,
'edit'
);
}
function
handleFormCancel
()
{
handleCloseFormEnableLocke
(
buttonConfigs
.
value
,
'edit'
);
}
function
handleView
(
record
:
Recordable
)
{
let
info
=
{
isView
:
true
,
id
:
record
.
id
,
}
openModal
(
true
,
info
);
}
function
getLessActions
(
record
:
Recordable
)
{
let
list
=
getActions
(
record
);
return
list
.
slice
(
0
,
listSpliceNum
.
value
);
}
function
getMoreActions
(
record
:
Recordable
)
{
let
list
=
getActions
(
record
);
return
list
.
slice
(
listSpliceNum
.
value
);
}
function
getActions
(
record
:
Recordable
):
ActionItem
[]
{
record
.
isCanEdit
=
false
;
let
actionsList
:
ActionItem
[]
=
[];
actionButtonConfig
.
value
?.
map
((
button
)
=>
{
if
(
!
record
?.
workflowData
?.
processId
)
{
record
.
isCanEdit
=
true
;
actionsList
.
push
({
...
button
,
auth
:
`shebeigl:
${
button
.
code
}
`
,
label
:
button
?.
name
,
color
:
button
.
code
===
'delete'
?
'error'
:
undefined
,
onClick
:
btnEvent
[
button
.
code
]?.
bind
(
null
,
record
),
});
}
else
{
if
(
!
[
'edit'
,
'delete'
].
includes
(
button
.
code
))
{
actionsList
.
push
({
auth
:
`shebeigl:
${
button
.
code
}
`
,
label
:
button
?.
name
,
onClick
:
btnEvent
[
button
.
code
]?.
bind
(
null
,
record
),
});
}
}
});
return
actionsList
;
}
</
script
>
<
style
lang=
"less"
scoped
>
:deep
(
.ant-table-selection-col
)
{
width
:
50px
;
}
.show
{
display
:
flex
;
}
.hide
{
display
:
none
!important
;
}
</
style
>
\ No newline at end of file
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