mirror of
https://github.com/certd/certd.git
synced 2026-05-15 20:47:31 +08:00
pref: 优化插件store
This commit is contained in:
@@ -14,8 +14,8 @@
|
||||
<script setup lang="tsx">
|
||||
import { IframeClient } from "@certd/lib-iframe";
|
||||
import { computed, onMounted, ref } from "vue";
|
||||
import { useUserStore } from "/@/store/modules/user";
|
||||
import { useSettingStore } from "/@/store/modules/settings";
|
||||
import { useUserStore } from "/@/store/user";
|
||||
import { useSettingStore } from "/@/store/settings";
|
||||
import * as api from "./api";
|
||||
import { notification } from "ant-design-vue";
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import * as api from "./api";
|
||||
import { AddReq, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, EditReq, UserPageQuery, UserPageRes } from "@fast-crud/fast-crud";
|
||||
import { useUserStore } from "/@/store/modules/user";
|
||||
import { useUserStore } from "/@/store/user";
|
||||
|
||||
export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
||||
const pageRequest = async (query: UserPageQuery): Promise<UserPageRes> => {
|
||||
|
||||
@@ -3,8 +3,8 @@ import { useI18n } from "vue-i18n";
|
||||
import { computed, Ref, ref } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import { AddReq, compute, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, EditReq, UserPageQuery, UserPageRes, utils } from "@fast-crud/fast-crud";
|
||||
import { useUserStore } from "/@/store/modules/user";
|
||||
import { useSettingStore } from "/@/store/modules/settings";
|
||||
import { useUserStore } from "/@/store/user";
|
||||
import { useSettingStore } from "/@/store/settings";
|
||||
import { Modal } from "ant-design-vue";
|
||||
|
||||
export default function ({ crudExpose, context }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
||||
|
||||
@@ -3,8 +3,6 @@ import { useI18n } from "vue-i18n";
|
||||
import { Ref, ref } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import { AddReq, compute, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, EditReq, UserPageQuery, UserPageRes } from "@fast-crud/fast-crud";
|
||||
import { useUserStore } from "/src/store/modules/user";
|
||||
import { useSettingStore } from "/src/store/modules/settings";
|
||||
import { Modal } from "ant-design-vue";
|
||||
//@ts-ignore
|
||||
import yaml from "js-yaml";
|
||||
@@ -29,8 +27,6 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
return res;
|
||||
};
|
||||
|
||||
const userStore = useUserStore();
|
||||
const settingStore = useSettingStore();
|
||||
const selectedRowKeys: Ref<any[]> = ref([]);
|
||||
context.selectedRowKeys = selectedRowKeys;
|
||||
|
||||
|
||||
@@ -54,6 +54,7 @@ defineOptions({
|
||||
});
|
||||
const route = useRoute();
|
||||
|
||||
const pluginStore = usePluginStore();
|
||||
const plugin = ref<any>({});
|
||||
const formOptionsRef: Ref = ref();
|
||||
const baseFormRef: Ref = ref({});
|
||||
@@ -145,6 +146,7 @@ async function doSave() {
|
||||
notification.success({
|
||||
message: "保存成功",
|
||||
});
|
||||
pluginStore.clear();
|
||||
} finally {
|
||||
saveLoading.value = false;
|
||||
}
|
||||
|
||||
@@ -8,16 +8,7 @@
|
||||
</template>
|
||||
|
||||
<div class="flex-o">
|
||||
<a-form
|
||||
:model="formState"
|
||||
name="basic"
|
||||
:label-col="{ span: 8 }"
|
||||
:wrapper-col="{ span: 16 }"
|
||||
autocomplete="off"
|
||||
class="email-form-box"
|
||||
@finish="onFinish"
|
||||
@finish-failed="onFinishFailed"
|
||||
>
|
||||
<a-form :model="formState" name="basic" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }" autocomplete="off" class="email-form-box" @finish="onFinish" @finish-failed="onFinishFailed">
|
||||
<div v-if="!formState.usePlus" class="email-form">
|
||||
<a-form-item label="使用自定义邮件服务器"> </a-form-item>
|
||||
<a-form-item label="SMTP域名" name="host" :rules="[{ required: true, message: '请输入smtp域名或ip' }]">
|
||||
@@ -80,13 +71,12 @@
|
||||
<script setup lang="ts">
|
||||
import { reactive } from "vue";
|
||||
import * as api from "../api";
|
||||
import { EmailSettingsSave, SettingKeys } from "../api";
|
||||
import * as emailApi from "./api.email";
|
||||
import { notification } from "ant-design-vue";
|
||||
import { useSettingStore } from "/src/store/modules/settings";
|
||||
import { useSettingStore } from "/src/store/settings";
|
||||
import * as _ from "lodash-es";
|
||||
defineOptions({
|
||||
name: "EmailSetting"
|
||||
name: "EmailSetting",
|
||||
});
|
||||
|
||||
interface FormState {
|
||||
@@ -108,10 +98,10 @@ interface FormState {
|
||||
const formState = reactive<Partial<FormState>>({
|
||||
auth: {
|
||||
user: "",
|
||||
pass: ""
|
||||
pass: "",
|
||||
},
|
||||
tls: {},
|
||||
usePlus: false
|
||||
usePlus: false,
|
||||
});
|
||||
|
||||
async function load() {
|
||||
@@ -125,7 +115,7 @@ const onFinish = async (form: any) => {
|
||||
console.log("Success:", form);
|
||||
await api.EmailSettingsSave(form);
|
||||
notification.success({
|
||||
message: "保存成功"
|
||||
message: "保存成功",
|
||||
});
|
||||
};
|
||||
|
||||
@@ -143,14 +133,14 @@ interface TestFormState {
|
||||
}
|
||||
const testFormState = reactive<TestFormState>({
|
||||
receiver: "",
|
||||
loading: false
|
||||
loading: false,
|
||||
});
|
||||
async function onTestSend() {
|
||||
testFormState.loading = true;
|
||||
try {
|
||||
await emailApi.TestSend(testFormState.receiver);
|
||||
notification.success({
|
||||
message: "发送成功"
|
||||
message: "发送成功",
|
||||
});
|
||||
} finally {
|
||||
testFormState.loading = false;
|
||||
|
||||
@@ -2,7 +2,7 @@ import { useI18n } from "vue-i18n";
|
||||
import { Ref, ref } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import { AddReq, compute, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, EditReq, UserPageQuery, UserPageRes } from "@fast-crud/fast-crud";
|
||||
import { useSettingStore } from "/@/store/modules/settings";
|
||||
import { useSettingStore } from "/@/store/settings";
|
||||
import { cloneDeep, find, merge, remove } from "lodash-es";
|
||||
import { nanoid } from "nanoid";
|
||||
import { HeaderMenusSettingsSave, SettingsSave } from "../api";
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
import { onActivated, onMounted } from "vue";
|
||||
import { useFs } from "@fast-crud/fast-crud";
|
||||
import createCrudOptions from "./crud";
|
||||
import { useSettingStore } from "/@/store/modules/settings";
|
||||
import { useSettingStore } from "/@/store/settings";
|
||||
|
||||
defineOptions({
|
||||
name: "SettingsHeaderMenus",
|
||||
|
||||
@@ -25,7 +25,7 @@ import SettingRegister from "/@/views/sys/settings/tabs/register.vue";
|
||||
import SettingPayment from "/@/views/sys/settings/tabs/payment.vue";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import { ref } from "vue";
|
||||
import { useSettingStore } from "/@/store/modules/settings";
|
||||
import { useSettingStore } from "/@/store/settings";
|
||||
defineOptions({
|
||||
name: "SysSettings",
|
||||
});
|
||||
|
||||
@@ -48,7 +48,7 @@ import { reactive, ref } from "vue";
|
||||
import { SysSettings } from "/@/views/sys/settings/api";
|
||||
import * as api from "/@/views/sys/settings/api";
|
||||
import { merge } from "lodash-es";
|
||||
import { useSettingStore } from "/@/store/modules/settings";
|
||||
import { useSettingStore } from "/@/store/settings";
|
||||
import { notification } from "ant-design-vue";
|
||||
import { util } from "/@/utils";
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ import { reactive, ref, Ref } from "vue";
|
||||
import { GetSmsTypeDefine, SysSettings } from "/@/views/sys/settings/api";
|
||||
import * as api from "/@/views/sys/settings/api";
|
||||
import { merge } from "lodash-es";
|
||||
import { useSettingStore } from "/@/store/modules/settings";
|
||||
import { useSettingStore } from "/@/store/settings";
|
||||
import { notification } from "ant-design-vue";
|
||||
|
||||
defineOptions({
|
||||
|
||||
@@ -42,8 +42,8 @@
|
||||
import { reactive, ref } from "vue";
|
||||
import * as api from "./api";
|
||||
import { notification } from "ant-design-vue";
|
||||
import { useSettingStore } from "/src/store/modules/settings";
|
||||
import { useUserStore } from "/@/store/modules/user";
|
||||
import { useSettingStore } from "/src/store/settings";
|
||||
import { useUserStore } from "/@/store/user";
|
||||
import { merge } from "lodash-es";
|
||||
|
||||
defineOptions({
|
||||
|
||||
@@ -46,7 +46,7 @@ import { notification } from "ant-design-vue";
|
||||
import { request } from "/@/api/service";
|
||||
import SuiteDurationSelector from "/@/views/sys/suite/setting/suite-duration-selector.vue";
|
||||
import ProductManager from "/@/views/sys/suite/product/index.vue";
|
||||
import { useSettingStore } from "/@/store/modules/settings";
|
||||
import { useSettingStore } from "/@/store/settings";
|
||||
|
||||
defineOptions({
|
||||
name: "SettingsSuite"
|
||||
|
||||
@@ -3,8 +3,8 @@ import { useI18n } from "vue-i18n";
|
||||
import { computed, Ref, ref } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import { AddReq, compute, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, EditReq, UserPageQuery, UserPageRes, utils } from "@fast-crud/fast-crud";
|
||||
import { useUserStore } from "/@/store/modules/user";
|
||||
import { useSettingStore } from "/@/store/modules/settings";
|
||||
import { useUserStore } from "/@/store/user";
|
||||
import { useSettingStore } from "/@/store/settings";
|
||||
import { Modal } from "ant-design-vue";
|
||||
import DurationValue from "/@/views/sys/suite/product/duration-value.vue";
|
||||
import PriceInput from "/@/views/sys/suite/product/price-input.vue";
|
||||
|
||||
Reference in New Issue
Block a user