|
@@ -26,8 +26,9 @@ class OaAttachListDialog extends StatefulWidget {
|
|
|
String requestId;
|
|
|
String jobTitle;
|
|
|
String jobDate;
|
|
|
+ bool canEdit = true;
|
|
|
|
|
|
- OaAttachListDialog({required this.requestId, required this.jobTitle, required this.jobDate});
|
|
|
+ OaAttachListDialog({required this.requestId, required this.jobTitle, required this.jobDate, required this.canEdit});
|
|
|
|
|
|
@override
|
|
|
State<OaAttachListDialog> createState() => _AppliedAddStaffState();
|
|
@@ -85,20 +86,24 @@ class _AppliedAddStaffState extends State<OaAttachListDialog> {
|
|
|
}).alignRight(),
|
|
|
],
|
|
|
),
|
|
|
- MyButton(
|
|
|
- type: ClickType.throttle,
|
|
|
- milliseconds: 500,
|
|
|
- onPressed: () {
|
|
|
- controller.pickAttFile();
|
|
|
- },
|
|
|
- text: "Add File".tr,
|
|
|
- minHeight: 35,
|
|
|
- textColor: ColorConstants.white,
|
|
|
- fontSize: 12,
|
|
|
- radius: 20,
|
|
|
- backgroundColor: hexToColor("#FFBB1B"),
|
|
|
- fontWeight: FontWeight.w500,
|
|
|
- ).marginOnly(left: 15, right: 15, top: 5),
|
|
|
+
|
|
|
+ Visibility(
|
|
|
+ visible: widget.canEdit,
|
|
|
+ child: MyButton(
|
|
|
+ type: ClickType.throttle,
|
|
|
+ milliseconds: 500,
|
|
|
+ onPressed: () {
|
|
|
+ controller.pickAttFile();
|
|
|
+ },
|
|
|
+ text: "Add File".tr,
|
|
|
+ minHeight: 35,
|
|
|
+ textColor: ColorConstants.white,
|
|
|
+ fontSize: 12,
|
|
|
+ radius: 20,
|
|
|
+ backgroundColor: hexToColor("#FFBB1B"),
|
|
|
+ fontWeight: FontWeight.w500,
|
|
|
+ ).marginOnly(left: 15, right: 15, top: 5),
|
|
|
+ ),
|
|
|
|
|
|
//工作信息
|
|
|
MyTextView(
|
|
@@ -162,14 +167,14 @@ class _AppliedAddStaffState extends State<OaAttachListDialog> {
|
|
|
successSliverWidget: [
|
|
|
SliverList(
|
|
|
delegate: SliverChildBuilderDelegate(
|
|
|
- (context, index) {
|
|
|
- return _buildStaffItem(controller.datas[index], () {
|
|
|
- //删除
|
|
|
- controller.doDeleteAction(controller.datas[index].id??"", index);
|
|
|
- });
|
|
|
- },
|
|
|
- childCount: controller.datas.length,
|
|
|
- ))
|
|
|
+ (context, index) {
|
|
|
+ return _buildStaffItem(controller.datas[index], () {
|
|
|
+ //删除
|
|
|
+ controller.doDeleteAction(controller.datas[index].id ?? "", index);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ childCount: controller.datas.length,
|
|
|
+ ))
|
|
|
],
|
|
|
),
|
|
|
),
|
|
@@ -205,23 +210,27 @@ class _AppliedAddStaffState extends State<OaAttachListDialog> {
|
|
|
textColor: ColorConstants.string2Color("#06A962"),
|
|
|
fontSize: 12,
|
|
|
onClick: () {
|
|
|
- _openFile(item.attUrl??"");
|
|
|
+ _openFile(item.attUrl ?? "");
|
|
|
},
|
|
|
marginLeft: 10,
|
|
|
isFontRegular: true,
|
|
|
).expanded(),
|
|
|
- MyButton(
|
|
|
- onPressed: () {
|
|
|
- deleteAction.call();
|
|
|
- },
|
|
|
- text: "Delete".tr,
|
|
|
- textColor: ColorConstants.white,
|
|
|
- backgroundColor: ColorConstants.redFF4066,
|
|
|
- radius: 17.25,
|
|
|
- fontSize: 12,
|
|
|
- minWidth: 48,
|
|
|
- minHeight: 30,
|
|
|
- ).marginOnly(left: 10)
|
|
|
+
|
|
|
+ Visibility(
|
|
|
+ visible: widget.canEdit,
|
|
|
+ child: MyButton(
|
|
|
+ onPressed: () {
|
|
|
+ deleteAction.call();
|
|
|
+ },
|
|
|
+ text: "Delete".tr,
|
|
|
+ textColor: ColorConstants.white,
|
|
|
+ backgroundColor: ColorConstants.redFF4066,
|
|
|
+ radius: 17.25,
|
|
|
+ fontSize: 12,
|
|
|
+ minWidth: 48,
|
|
|
+ minHeight: 30,
|
|
|
+ ).marginOnly(left: 10),
|
|
|
+ ),
|
|
|
],
|
|
|
).marginOnly(top: 15),
|
|
|
|