Explorar el Código

🎨 未完待续。。

晓晓晓晓丶vv hace 4 años
padre
commit
5e574a59eb
Se han modificado 3 ficheros con 24 adiciones y 6 borrados
  1. 3 3
      src/store/modules/app/_module.ts
  2. 19 1
      src/views/put/index.vue
  3. 2 2
      src/views/put/put-book.tsx

+ 3 - 3
src/store/modules/app/_module.ts

@@ -10,7 +10,7 @@ import { RootState } from "@/store";
 export type AugmentedActionContext = {
 export type AugmentedActionContext = {
   commit<M extends keyof Mutations>(
   commit<M extends keyof Mutations>(
     key: M,
     key: M,
-    payload: Parameters<Mutations[M]>[1]
+    payload?: Parameters<Mutations[M]>[1]
   ): ReturnType<Mutations[M]>;
   ): ReturnType<Mutations[M]>;
 } & Omit<ActionContext<State, RootState>, "commit">;
 } & Omit<ActionContext<State, RootState>, "commit">;
 
 
@@ -20,13 +20,13 @@ export type Store<S = State> = Omit<
 > & {
 > & {
   commit<M extends keyof Mutations, P extends Parameters<Mutations[M]>[1]>(
   commit<M extends keyof Mutations, P extends Parameters<Mutations[M]>[1]>(
     key: M,
     key: M,
-    payload: P,
+    payload?: P,
     options?: CommitOptions
     options?: CommitOptions
   ): ReturnType<Mutations[M]>;
   ): ReturnType<Mutations[M]>;
 } & {
 } & {
   dispatch<A extends keyof Actions>(
   dispatch<A extends keyof Actions>(
     key: A,
     key: A,
-    payload: Parameters<Actions[A]>[1],
+    payload?: Parameters<Actions[A]>[1],
     options?: DispatchOptions
     options?: DispatchOptions
   ): ReturnType<Actions[A]>;
   ): ReturnType<Actions[A]>;
 } & {
 } & {

+ 19 - 1
src/views/put/index.vue

@@ -1,3 +1,21 @@
 <template>
 <template>
   <router-view></router-view>
   <router-view></router-view>
-</template>
+</template>
+
+<script lang="ts">
+import { defineComponent } from "vue";
+
+import useStore from "@/hooks/useStore";
+
+import { getOfficialSimpleAccount } from "@/api";
+import { ActionType } from "@/store/modules/app/_type";
+
+const PutIndex = defineComponent({
+  setup() {
+    const store = useStore();
+    store.dispatch(ActionType.doSaveOfficial);
+  },
+});
+
+export default PutIndex;
+</script>

+ 2 - 2
src/views/put/put-book.tsx

@@ -60,7 +60,7 @@ const PutBooks = defineComponent({
         addFormState.books.push(...data.list);
         addFormState.books.push(...data.list);
       }, 500);
       }, 500);
 
 
-      const onBookCheck = (value: any, options: any) => {
+      const onBookCheck = (value: number, options: any) => {
         addFormState.book = options.key;
         addFormState.book = options.key;
       };
       };
 
 
@@ -98,10 +98,10 @@ const PutBooks = defineComponent({
               <a-select
               <a-select
                 show-search
                 show-search
                 placeholder="请输入要搜索的书名"
                 placeholder="请输入要搜索的书名"
+                not-found-content="暂无数据"
                 default-active-first-option={false}
                 default-active-first-option={false}
                 filter-option={false}
                 filter-option={false}
                 show-arrow={false}
                 show-arrow={false}
-                not-found-content="暂无数据"
                 value={addFormState.book.bid}
                 value={addFormState.book.bid}
                 onSearch={onBookSearch}
                 onSearch={onBookSearch}
                 onChange={onBookCheck}
                 onChange={onBookCheck}