|
1 | 1 | <template>
|
2 | 2 | <div v-loading="loading">
|
3 | 3 | <el-row>
|
4 |
| - <el-col :xs="20" :sm="12" :md="10" :lg="10" :xl="8" :offset="1"> |
| 4 | + <el-col :xs="20" :sm="12" :md="10" :lg="10" :xl="8"> |
5 | 5 | <el-form>
|
6 | 6 | <el-form-item :label="$t('runtime.version')">
|
7 | 7 | <el-select v-model="versionReq.runtimeID" style="width: 100%">
|
@@ -33,18 +33,14 @@ import { SearchRuntimes } from '@/api/modules/runtime';
|
33 | 33 | import { onMounted, reactive, ref } from 'vue';
|
34 | 34 | import { Runtime } from '@/api/interface/runtime';
|
35 | 35 | import { Website } from '@/api/interface/website';
|
36 |
| -import { ChangePHPVersion } from '@/api/modules/website'; |
| 36 | +import { ChangePHPVersion, GetWebsite } from '@/api/modules/website'; |
37 | 37 | import i18n from '@/lang';
|
38 | 38 | import { MsgSuccess } from '@/utils/message';
|
39 | 39 | const props = defineProps({
|
40 | 40 | id: {
|
41 | 41 | type: Number,
|
42 | 42 | default: 0,
|
43 | 43 | },
|
44 |
| - runtimeID: { |
45 |
| - type: Number, |
46 |
| - default: 0, |
47 |
| - }, |
48 | 44 | });
|
49 | 45 |
|
50 | 46 | const runtimeReq = reactive<Runtime.RuntimeReq>({ page: 1, pageSize: 200, type: 'php' });
|
@@ -92,16 +88,23 @@ const submit = async () => {
|
92 | 88 | try {
|
93 | 89 | await ChangePHPVersion(versionReq);
|
94 | 90 | MsgSuccess(i18n.global.t('commons.msg.updateSuccess'));
|
| 91 | + getWebsiteDetail(); |
95 | 92 | } catch (error) {}
|
96 | 93 | loading.value = false;
|
97 | 94 | });
|
98 | 95 | } catch (error) {}
|
99 | 96 | };
|
100 | 97 |
|
| 98 | +const getWebsiteDetail = async () => { |
| 99 | + const res = await GetWebsite(props.id); |
| 100 | + versionReq.runtimeID = res.data.runtimeID; |
| 101 | + oldRuntimeID.value = res.data.runtimeID; |
| 102 | +}; |
| 103 | +
|
101 | 104 | onMounted(() => {
|
102 |
| - versionReq.runtimeID = props.runtimeID; |
103 | 105 | versionReq.websiteID = props.id;
|
104 |
| - oldRuntimeID.value = props.runtimeID; |
| 106 | +
|
| 107 | + getWebsiteDetail(); |
105 | 108 | getRuntimes();
|
106 | 109 | });
|
107 | 110 | </script>
|
0 commit comments