|
...
|
...
|
@@ -89,6 +89,9 @@ |
|
89
|
89
|
<Authority value="api:yt:platform:update:update">
|
|
90
|
90
|
<a-button @click="handleUpdateInfo" type="primary" class="mt-4">保存信息</a-button>
|
|
91
|
91
|
</Authority>
|
|
|
92
|
+ <Authority value="api:yt:platform:data_reset:reset">
|
|
|
93
|
+ <a-button @click="handleResetInfo" type="primary" class="ml-4">恢复默认设置</a-button>
|
|
|
94
|
+ </Authority>
|
|
92
|
95
|
</div>
|
|
93
|
96
|
</template>
|
|
94
|
97
|
|
|
...
|
...
|
@@ -100,7 +103,14 @@ |
|
100
|
103
|
import { Loading } from '/@/components/Loading/index';
|
|
101
|
104
|
import { useMessage } from '/@/hooks/web/useMessage';
|
|
102
|
105
|
import type { FileItem } from '/@/components/Upload/src/typing';
|
|
103
|
|
- import { logoUpload, iconUpload, bgUpload, getPlatForm, updatePlatForm } from '/@/api/oem/index';
|
|
|
106
|
+ import {
|
|
|
107
|
+ logoUpload,
|
|
|
108
|
+ iconUpload,
|
|
|
109
|
+ bgUpload,
|
|
|
110
|
+ getPlatForm,
|
|
|
111
|
+ updatePlatForm,
|
|
|
112
|
+ resetPlateInfo,
|
|
|
113
|
+ } from '/@/api/oem/index';
|
|
104
|
114
|
import { PlusOutlined, LoadingOutlined } from '@ant-design/icons-vue';
|
|
105
|
115
|
import { useUserStore } from '/@/store/modules/user';
|
|
106
|
116
|
import { createLocalStorage } from '/@/utils/cache/index';
|
|
...
|
...
|
@@ -120,7 +130,7 @@ |
|
120
|
130
|
setup() {
|
|
121
|
131
|
const loading = ref(false);
|
|
122
|
132
|
const loading1 = ref(false);
|
|
123
|
|
- const loading2= ref(false);
|
|
|
133
|
+ const loading2 = ref(false);
|
|
124
|
134
|
const compState = ref({
|
|
125
|
135
|
absolute: false,
|
|
126
|
136
|
loading: false,
|
|
...
|
...
|
@@ -129,7 +139,7 @@ |
|
129
|
139
|
const { createMessage } = useMessage();
|
|
130
|
140
|
const userStore = useUserStore();
|
|
131
|
141
|
const storage = createLocalStorage();
|
|
132
|
|
- const [registerForm, { getFieldsValue, setFieldsValue }] = useForm({
|
|
|
142
|
+ const [registerForm, { getFieldsValue, setFieldsValue, resetFields }] = useForm({
|
|
133
|
143
|
schemas,
|
|
134
|
144
|
showSubmitButton: false,
|
|
135
|
145
|
showResetButton: false,
|
|
...
|
...
|
@@ -253,6 +263,23 @@ |
|
253
|
263
|
iconPic.value = res.icon;
|
|
254
|
264
|
bgPic.value = res.background;
|
|
255
|
265
|
});
|
|
|
266
|
+ const handleResetInfo = async () => {
|
|
|
267
|
+ try {
|
|
|
268
|
+ compState.value.loading = true;
|
|
|
269
|
+ await resetPlateInfo();
|
|
|
270
|
+ compState.value.loading = false;
|
|
|
271
|
+ createMessage.success('恢复出厂设置成功');
|
|
|
272
|
+ resetFields();
|
|
|
273
|
+ const res = await getPlatForm();
|
|
|
274
|
+ setFieldsValue(res);
|
|
|
275
|
+ logoPic.value = res.logo;
|
|
|
276
|
+ iconPic.value = res.icon;
|
|
|
277
|
+ bgPic.value = res.background;
|
|
|
278
|
+ } catch (e) {
|
|
|
279
|
+ compState.value.loading = false;
|
|
|
280
|
+ createMessage.error('恢复出厂设置失败');
|
|
|
281
|
+ }
|
|
|
282
|
+ };
|
|
256
|
283
|
return {
|
|
257
|
284
|
registerForm,
|
|
258
|
285
|
logoPic,
|
|
...
|
...
|
@@ -269,6 +296,7 @@ |
|
269
|
296
|
loading,
|
|
270
|
297
|
loading1,
|
|
271
|
298
|
loading2,
|
|
|
299
|
+ handleResetInfo,
|
|
272
|
300
|
};
|
|
273
|
301
|
},
|
|
274
|
302
|
});
|
...
|
...
|
|