...
|
...
|
@@ -7,6 +7,7 @@ |
7
|
7
|
@register="registerDrawer"
|
8
|
8
|
:title="getTitle"
|
9
|
9
|
width="1000px"
|
|
10
|
+ @cancel="handleCancel"
|
10
|
11
|
>
|
11
|
12
|
<div class="step-form-form">
|
12
|
13
|
<a-steps :current="current">
|
...
|
...
|
@@ -25,7 +26,7 @@ |
25
|
26
|
@prevSon="handlePrev"
|
26
|
27
|
/></div>
|
27
|
28
|
</div>
|
28
|
|
- <div style="float: right">
|
|
29
|
+ <div style="float: right" v-if="isViewStatus">
|
29
|
30
|
<Button type="primary" @click="handleSubmit" class="mr-2">确认</Button>
|
30
|
31
|
<Button type="default" @click="handleCancel" class="mr-2">取消</Button>
|
31
|
32
|
</div>
|
...
|
...
|
@@ -33,15 +34,7 @@ |
33
|
34
|
</div>
|
34
|
35
|
</template>
|
35
|
36
|
<script lang="ts">
|
36
|
|
- import {
|
37
|
|
- defineComponent,
|
38
|
|
- reactive,
|
39
|
|
- ref,
|
40
|
|
- computed,
|
41
|
|
- unref,
|
42
|
|
- getCurrentInstance,
|
43
|
|
- nextTick,
|
44
|
|
- } from 'vue';
|
|
37
|
+ import { defineComponent, reactive, ref, unref, getCurrentInstance, nextTick } from 'vue';
|
45
|
38
|
import { BasicModal, useModalInner } from '/@/components/Modal';
|
46
|
39
|
import { Steps } from 'ant-design-vue';
|
47
|
40
|
import TransferConfigMode from './cpns/transferConfigMode.vue';
|
...
|
...
|
@@ -62,6 +55,7 @@ |
62
|
55
|
},
|
63
|
56
|
emits: ['success', 'register'],
|
64
|
57
|
setup(_, { emit }) {
|
|
58
|
+ const isViewStatus = ref(false);
|
65
|
59
|
const { createMessage } = useMessage();
|
66
|
60
|
const { proxy } = getCurrentInstance() as any;
|
67
|
61
|
let allPostForm: any = reactive({});
|
...
|
...
|
@@ -82,8 +76,8 @@ |
82
|
76
|
const refTransferConfigParams = ref(null);
|
83
|
77
|
const refTransferConfigMode = ref(null);
|
84
|
78
|
const getModeSelectVal = ref({});
|
85
|
|
- const isUpdate = ref(true);
|
86
|
|
- const getTitle = computed(() => (!unref(isUpdate) ? '新增流转配置' : '编辑数据流转'));
|
|
79
|
+ const isUpdate: any = ref(true);
|
|
80
|
+ const getTitle = ref('');
|
87
|
81
|
const current = ref(0);
|
88
|
82
|
const editPostId = ref('');
|
89
|
83
|
const editType = reactive({
|
...
|
...
|
@@ -104,26 +98,40 @@ |
104
|
98
|
};
|
105
|
99
|
|
106
|
100
|
const [registerDrawer, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
107
|
|
- isUpdate.value = !!data?.isUpdate;
|
|
101
|
+ isUpdate.value = data?.isUpdate;
|
108
|
102
|
current.value = 0;
|
109
|
103
|
setModalProps({ confirmLoading: false });
|
110
|
|
-
|
111
|
|
- if (unref(isUpdate)) {
|
|
104
|
+ function commonViewOrEditFunc() {
|
112
|
105
|
editPostId.value = data.record.id;
|
113
|
106
|
editNextType.type = data.record.type;
|
114
|
107
|
editNextType.configuration = data.record;
|
115
|
108
|
editNextType.name = data.record.name;
|
116
|
109
|
editNextType.remark = data.record.remark;
|
117
|
110
|
proxy.$refs.refTransferConfigMode.setStepOneFieldsValueFunc(editNextType);
|
118
|
|
- } else {
|
119
|
|
- nextTick(() => {
|
|
111
|
+ }
|
|
112
|
+ switch (unref(isUpdate)) {
|
|
113
|
+ case 'view':
|
|
114
|
+ commonViewOrEditFunc();
|
|
115
|
+ isViewStatus.value = false;
|
|
116
|
+ getTitle.value = '查看流转配置';
|
|
117
|
+ break;
|
|
118
|
+ case true:
|
|
119
|
+ commonViewOrEditFunc();
|
|
120
|
+ isViewStatus.value = true;
|
|
121
|
+ getTitle.value = '编辑流转配置';
|
|
122
|
+ break;
|
|
123
|
+ case false:
|
120
|
124
|
proxy.$refs.refTransferConfigMode?.customResetStepOneFunc();
|
121
|
|
- });
|
|
125
|
+ isViewStatus.value = true;
|
|
126
|
+ getTitle.value = '新增流转配置';
|
|
127
|
+ break;
|
122
|
128
|
}
|
123
|
129
|
});
|
124
|
130
|
const handleCancel = () => {
|
125
|
|
- defineClearFunc();
|
126
|
|
- closeModal();
|
|
131
|
+ nextTick(() => {
|
|
132
|
+ defineClearFunc();
|
|
133
|
+ closeModal();
|
|
134
|
+ });
|
127
|
135
|
};
|
128
|
136
|
const defineClearFunc = () => {
|
129
|
137
|
nextTick(() => {
|
...
|
...
|
@@ -149,6 +157,8 @@ |
149
|
157
|
} catch (e) {
|
150
|
158
|
return e;
|
151
|
159
|
}
|
|
160
|
+ } else {
|
|
161
|
+ proxy.$refs.refTransferConfigParams.editSonValueDataFunc({});
|
152
|
162
|
}
|
153
|
163
|
};
|
154
|
164
|
const handlePrev = () => {
|
...
|
...
|
@@ -248,6 +258,7 @@ |
248
|
258
|
getModeSelectVal,
|
249
|
259
|
refTransferConfigParams,
|
250
|
260
|
refTransferConfigMode,
|
|
261
|
+ isViewStatus,
|
251
|
262
|
};
|
252
|
263
|
},
|
253
|
264
|
});
|
...
|
...
|
|