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
04990a39
Commit
04990a39
authored
Jan 14, 2026
by
张恒
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/weiqiao-vue3' into weiqiao-vue3
parents
7d52d946
f9a08a86
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
108 additions
and
134 deletions
+108
-134
xjrsoft-vue3/src/views/scgl/scjh/index.vue
+108
-134
No files found.
xjrsoft-vue3/src/views/scgl/scjh/index.vue
View file @
04990a39
<
template
>
<ResizePageWrapper
:hasLeft=
"false"
>
<ResizePageWrapper
:hasLeft=
"false"
>
<template
#
resizeRight
>
<BasicTable
@
register=
"registerTable"
isMenuTable
ref=
"tableRef"
:row-selection=
"
{ selectedRowKeys: selectedKeys, onChange: onSelectChange }"
<BasicTable
@
register=
"registerTable"
isMenuTable
ref=
"tableRef"
:row-selection=
"
{ selectedRowKeys: selectedKeys, onChange: onSelectChange }"
>
<template
#
toolbar
>
<template
v-for=
"button in tableButtonConfig"
:key=
"button.code"
>
<a-button
v-if=
"button.isDefault"
type=
"primary"
@
click=
"buttonClick(button.code)"
>
...
...
@@ -17,18 +14,18 @@
{{ 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'"
>
<a-button
v-else
:type=
"button.buttonType === 'danger' ? 'default' : button.buttonType || 'primary'"
:danger=
"button.buttonType === 'danger'"
@
click=
"buttonClick(button.code)"
>
<
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)"
...
...
@@ -41,81 +38,48 @@
}}
</span>
</
template
>
</template>
</BasicTable>
</template>
<ScjhModal
@
register=
"registerModal"
@
success=
"handleFormSuccess"
@
cancel=
"handleFormCancel"
/>
</ResizePageWrapper>
<ScjhModal
@
register=
"registerModal"
@
success=
"handleFormSuccess"
@
cancel=
"handleFormCancel"
/>
</ResizePageWrapper>
</template>
<
script
lang=
"ts"
setup
>
import
{
ref
,
computed
,
provide
,
Ref
,
createVNode
,
}
from
'vue'
;
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
{
getMesProductionPlanPage
,
deleteMesProductionPlan
}
from
'/@/api/scgl/scjh'
;
import
{
getMesProductionPlanPage
,
deleteMesProductionPlan
}
from
'/@/api/scgl/scjh'
;
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
{
executeListStyle
,
getValue
}
from
'/@/hooks/web/useListStyle'
;
//列表样式配置
import
{
useRouter
}
from
'vue-router'
;
import
{
useModal
}
from
'/@/components/Modal'
;
import
ScjhModal
from
'./components/ScjhModal.vue'
;
import
{
searchFormSchema
,
columns
}
from
'./components/config'
;
import
Icon
from
'/@/components/Icon/index'
;
const
listSpliceNum
=
ref
(
3
);
//操作列最先展示几个
import
{
useConcurrentLock
}
from
'/@/hooks/web/useConcurrentLock'
;
import
axios
from
'axios'
;
import
{
useUserStore
}
from
'/@/store/modules/user'
;
const
pageParamsInfo
=
ref
<
any
>
({});
const
{
enableLockeData
,
handleOpenFormEnableLockeData
,
handleCloseFormEnableLocke
,
handleHasEnableLocke
}
=
useConcurrentLock
();
const
{
enableLockeData
,
handleOpenFormEnableLockeData
,
handleCloseFormEnableLocke
,
handleHasEnableLocke
,
}
=
useConcurrentLock
();
const
{
notification
}
=
useMessage
();
const
{
t
}
=
useI18n
();
...
...
@@ -125,17 +89,57 @@
const
filterColumns
=
filterColumnAuth
(
columns
);
const
tableRef
=
ref
();
//展示在列表内的按钮
const
actionButtons
=
ref
<
string
[]
>
([
"view"
,
"edit"
,
"delete"
]);
const
buttonConfigs
=
computed
(()
=>
{
const
list
=
[{
"buttonId"
:
"2004396569122545664"
,
"name"
:
"查看"
,
"code"
:
"view"
,
"icon"
:
"ant-design:eye-outlined"
,
"isDefault"
:
true
,
"isUse"
:
true
},{
"buttonId"
:
"2004396569122545665"
,
"name"
:
"新增"
,
"code"
:
"add"
,
"icon"
:
"ant-design:plus-outlined"
,
"isDefault"
:
true
,
"isUse"
:
true
},{
"buttonId"
:
"2004396569122545666"
,
"name"
:
"编辑"
,
"code"
:
"edit"
,
"icon"
:
"ant-design:form-outlined"
,
"isDefault"
:
true
,
"isUse"
:
true
,
"isEnableLock"
:
true
},{
"buttonId"
:
"2004471125057142784"
,
"name"
:
"下发任务"
,
"code"
:
"xiafa"
,
"icon"
:
"ant-design:export-outlined"
,
"isDefault"
:
false
,
"isUse"
:
true
,
"setting"
:[],
"showType"
:
"top"
,
"buttonType"
:
"primary"
},{
"buttonId"
:
"2004396569122545667"
,
"name"
:
"删除"
,
"code"
:
"delete"
,
"icon"
:
"ant-design:delete-outlined"
,
"isDefault"
:
true
,
"isUse"
:
true
}]
const
actionButtons
=
ref
<
string
[]
>
([
'view'
,
'edit'
,
'delete'
]);
const
buttonConfigs
=
computed
(()
=>
{
const
list
=
[
{
buttonId
:
'2004396569122545664'
,
name
:
'查看'
,
code
:
'view'
,
icon
:
'ant-design:eye-outlined'
,
isDefault
:
true
,
isUse
:
true
,
},
{
buttonId
:
'2004396569122545665'
,
name
:
'新增'
,
code
:
'add'
,
icon
:
'ant-design:plus-outlined'
,
isDefault
:
true
,
isUse
:
true
,
},
{
buttonId
:
'2004396569122545666'
,
name
:
'编辑'
,
code
:
'edit'
,
icon
:
'ant-design:form-outlined'
,
isDefault
:
true
,
isUse
:
true
,
isEnableLock
:
true
,
},
{
buttonId
:
'2004471125057142784'
,
name
:
'下发任务'
,
code
:
'xiafa'
,
icon
:
'ant-design:export-outlined'
,
isDefault
:
false
,
isUse
:
true
,
setting
:
[],
showType
:
'top'
,
buttonType
:
'primary'
,
},
{
buttonId
:
'2004396569122545667'
,
name
:
'删除'
,
code
:
'delete'
,
icon
:
'ant-design:delete-outlined'
,
isDefault
:
true
,
isUse
:
true
,
},
];
return
filterButtonAuth
(
list
);
})
})
;
const
tableButtonConfig
=
computed
(()
=>
{
return
buttonConfigs
.
value
?.
filter
((
x
)
=>
!
actionButtons
.
value
.
includes
(
x
.
code
));
...
...
@@ -145,29 +149,19 @@
return
buttonConfigs
.
value
?.
filter
((
x
)
=>
actionButtons
.
value
.
includes
(
x
.
code
));
});
const
btnEvent
=
{
view
:
handleView
,
add
:
handleAdd
,
edit
:
handleEdit
,
delete
:
handleDelete
,}
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
selectedKeys
=
ref
<
string
[]
>
([]);
const
selectedRowsData
=
ref
<
any
[]
>
([]);
const
[
registerModal
,
{
openModal
}]
=
useModal
();
const
[
registerTable
,
{
reload
,
}]
=
useTable
({
const
[
registerTable
,
{
reload
}]
=
useTable
({
title
:
'Scjh列表'
,
api
:
getMesProductionPlanPage
,
rowKey
:
'id'
,
...
...
@@ -181,25 +175,18 @@
fieldMapToTime
:
[],
showResetButton
:
false
,
},
bordered
:
false
,
bordered
:
false
,
beforeFetch
:
(
params
)
=>
{
pageParamsInfo
.
value
=
{
...
params
,
FormId
:
formIdComputedRef
.
value
,
PK
:
'id'
}
pageParamsInfo
.
value
=
{
...
params
,
FormId
:
formIdComputedRef
.
value
,
PK
:
'id'
};
return
pageParamsInfo
.
value
;
},
afterFetch
:
(
res
)
=>
{
selectedKeys
.
value
=
[];
selectedRowsData
.
value
=
[];
},
useSearchForm
:
true
,
showTableSetting
:
true
,
striped
:
false
,
actionColumn
:
{
width
:
195
,
...
...
@@ -216,32 +203,44 @@
objectId
:
formIdComputedRef
.
value
,
////系统表单formId,自定义表单releaseId的id值
});
function
buttonClick
(
code
)
{
const
store
=
useUserStore
()
const
ids
=
selectedRowsData
.
value
.
map
((
x
)
=>
x
.
id
)
if
(
code
===
'xiafa'
)
{
Modal
.
confirm
({
title
:
'提示信息'
,
icon
:
createVNode
(
ExclamationCircleOutlined
),
content
:
'是否确认下发任务?'
,
okText
:
'确认'
,
cancelText
:
'取消'
,
onOk
()
{
axios
.
post
(
'http://localhost:8053/scgl/scjh/issue'
,
{
ids
}
,
{
headers
:
{
Authorization
:
'Bearer '
+
store
.
getToken
}
})
.
then
((
res
)
=>
{
if
(
res
.
data
===
'下发成功'
)
{
notification
.
success
({
message
:
'提示信息'
,
description
:
res
.
data
,
});
}
});
},
});
}
btnEvent
[
code
]();
}
function
handleAdd
()
{
openModal
(
true
,
{
isUpdate
:
false
,
});
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
,
);
let
res
=
await
handleOpenFormEnableLockeData
(
record
[
field
],
formIdComputedRef
.
value
);
if
(
res
!==
null
)
{
return
;
}
...
...
@@ -251,16 +250,12 @@
id
:
record
[
field
],
isUpdate
:
true
,
};
openModal
(
true
,
info
);
}
catch
(
error
)
{}
}
function
handleDelete
(
record
:
Recordable
)
{
deleteList
([
record
.
id
]);
}
...
...
@@ -285,10 +280,6 @@
});
}
function
onSelectChange
(
selectedRowKeys
:
[],
selectedRows
)
{
selectedKeys
.
value
=
selectedRowKeys
;
selectedRowsData
.
value
=
selectedRows
;
...
...
@@ -296,7 +287,6 @@
function
customRow
(
record
:
Recordable
)
{
return
{
onClick
:
()
=>
{
let
selectedRowKeys
=
[...
selectedKeys
.
value
];
if
(
selectedRowKeys
.
indexOf
(
record
.
id
)
>=
0
)
{
...
...
@@ -308,7 +298,7 @@
selectedKeys
.
value
=
selectedRowKeys
;
},
ondblclick
:
()
=>
{
if
(
record
.
isCanEdit
&&
hasPermission
(
"scjh:edit"
))
{
if
(
record
.
isCanEdit
&&
hasPermission
(
'scjh:edit'
))
{
handleEdit
(
record
);
}
},
...
...
@@ -316,15 +306,11 @@
}
function
handleSuccess
()
{
selectedKeys
.
value
=
[];
selectedRowsData
.
value
=
[];
reload
();
}
function
handleFormSuccess
()
{
handleSuccess
();
handleCloseFormEnableLocke
(
buttonConfigs
.
value
,
'edit'
);
...
...
@@ -333,19 +319,15 @@
handleCloseFormEnableLocke
(
buttonConfigs
.
value
,
'edit'
);
}
function
handleView
(
record
:
Recordable
)
{
let
info
=
{
let
info
=
{
isView
:
true
,
id
:
record
.
id
,
}
}
;
openModal
(
true
,
info
);
}
function
getLessActions
(
record
:
Recordable
)
{
let
list
=
getActions
(
record
);
return
list
.
slice
(
0
,
listSpliceNum
.
value
);
...
...
@@ -354,7 +336,7 @@
let
list
=
getActions
(
record
);
return
list
.
slice
(
listSpliceNum
.
value
);
}
function
getActions
(
record
:
Recordable
):
ActionItem
[]
{
function
getActions
(
record
:
Recordable
):
ActionItem
[]
{
record
.
isCanEdit
=
false
;
let
actionsList
:
ActionItem
[]
=
[];
...
...
@@ -372,7 +354,6 @@
}
else
{
if
(
!
[
'edit'
,
'delete'
].
includes
(
button
.
code
))
{
actionsList
.
push
({
auth
:
`scjh:
${
button
.
code
}
`
,
label
:
button
?.
name
,
onClick
:
btnEvent
[
button
.
code
]?.
bind
(
null
,
record
),
...
...
@@ -382,24 +363,17 @@
});
return
actionsList
;
}
</
script
>
<
style
lang=
"less"
scoped
>
:deep
(
.ant-table-selection-col
)
{
width
:
50px
;
}
.show
{
.show
{
display
:
flex
;
}
.hide
{
.hide
{
display
:
none
!important
;
}
</
style
>
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