huangbin 4 лет назад
Родитель
Сommit
729cf516e8

+ 7 - 6
src/components/drawer/index.vue

@@ -3,15 +3,16 @@
     <a-drawer :placement="placement"
               :closable="false"
               :visible="visible"
-              class="tradeDialog">  <!-- 摘牌是top  挂牌是bottom 期货交易是tradeDialog -->
+              class="tradeDialog">
+      <!-- 摘牌是top  挂牌是bottom 期货交易是tradeDialog -->
       <div class="collapse"
            @click="cancel"></div>
       <div class="collapseCont">
         <!-- <div class="title">{{ title }}</div> -->
         <div class="content highContent">
-            <!-- <Listed></Listed> -->
-            <!-- <Delisting></Delisting> -->
-            <Trade></Trade>
+          <!-- <Listed></Listed> -->
+          <!-- <Delisting></Delisting> -->
+          <Trade></Trade>
         </div>
       </div>
     </a-drawer>
@@ -49,10 +50,10 @@ export default defineComponent({
     components: {
         Listed,
         Delisting,
-        Trade
+        Trade,
     },
     setup(props, context) {
-        const { visible, cancel, handleOk } = closeModal(props.modalName);
+        const { visible, cancel } = closeModal(props.modalName);
         return {
             visible,
             cancel,

+ 1 - 9
src/setup/controlModal/controlModal.ts

@@ -23,15 +23,7 @@ export function closeModal(modelName: keyof ModalName) {
         visible.value = false;
         show.value = false
     }
-    /**
-     * 带有回调函数关闭弹窗
-     * @param callback 
-     */
-    function handleOk(callback: Function) {
-        cancel();
-        callback && callback()
-    }
-    return { visible, cancel, handleOk }
+    return { visible, cancel }
 }
 
 /**

+ 1 - 0
src/setup/controlModal/interface.ts

@@ -3,4 +3,5 @@ export interface ModalName {
     notice: string; // 消息
     logout: string; // 退出登录
     drawer: string; // 下单通用界面
+    addCustomInfo: string; // 新增客户资料
 }

+ 6 - 3
src/utils/request/serviceURL.ts

@@ -75,7 +75,10 @@ export const setServiceURL = (config: URL): void => {
     serviceURL = config;
 
     // 外网环境(175),外包同事使用
-    serviceURL.goCommonSearchUrl = "http://218.17.158.45:21001/api"
-    serviceURL.quoteUrl = "ws://218.17.158.45:21004"
-    serviceURL.tradeUrl = "ws://218.17.158.45:21005"
+    if (process.env.NODE_ENV === 'development') {
+        serviceURL.goCommonSearchUrl = "http://218.17.158.45:21001/api"
+        serviceURL.quoteUrl = "ws://218.17.158.45:21004"
+        serviceURL.tradeUrl = "ws://218.17.158.45:21005"
+    }
+
 };

+ 20 - 11
src/views/information/custom/compoments/addCustom/index.vue

@@ -1,11 +1,16 @@
 <template>
   <!-- 新增客户资料 -->
   <a-modal class="add-custom"
+           title="新增客户资料"
            v-model:visible="visible"
            @cancel="cancel"
-           width="890px"
-           :footer="null"
-           @ok="handleOk">
+           width="890px">
+    <template #footer>
+      <a-button key="submit"
+                type="primary"
+                :loading="loading"
+                @click="submit">完成</a-button>
+    </template>
     新增客户资料
   </a-modal>
 </template>
@@ -13,23 +18,27 @@
 <script lang="ts">
 import { defineComponent, ref } from 'vue';
 import { closeModal } from '@/setup/controlModal/index';
-import NoticeContent from './components/noticeContent.vue';
 import { initData } from '@/setup/methods/index';
-import { queryNotice } from '@/goServiceAPI/commonService/index';
 
 export default defineComponent({
     name: 'add-custom',
-    components: {
-        NoticeContent,
-    },
+    components: {},
     setup() {
-        const { visible, cancel, handleOk } = closeModal('notice');
-
+        const { visible, cancel } = closeModal('addCustomInfo');
+        const loading = ref<boolean>(false);
+        function submit() {
+            loading.value = true;
+            setTimeout(() => {
+                loading.value = false;
+                cancel();
+            }, 2000);
+        }
         initData(() => {});
         return {
             visible,
             cancel,
-            handleOk,
+            submit,
+            loading,
         };
     },
 });

+ 10 - 2
src/views/information/custom/compoments/filterTable/index.vue

@@ -21,11 +21,15 @@
     <a-button @click="search">查询</a-button>
     <a-button @click="reset">重置</a-button>
     <a-button @click="add">新增</a-button>
+    <!-- 新增弹窗 -->
+    <AddCustom />
   </div>
 </template>
 
 <script lang="ts">
-import { defineComponent, ref, SetupContext, unref } from 'vue';
+import { defineComponent, ref, SetupContext } from 'vue';
+import AddCustom from '../addCustom/index.vue';
+import { openModal } from '@/setup/controlModal/index';
 
 // 搜索
 function handleSearch(context: SetupContext) {
@@ -60,9 +64,13 @@ function handleSearch(context: SetupContext) {
 
 export default defineComponent({
     name: 'filter-custom-table',
-    components: {},
+    components: {
+        AddCustom,
+    },
     setup(props, context) {
+        const { openAction } = openModal('addCustomInfo');
         function add() {
+            openAction();
             context.emit('add');
         }
         return {

+ 3 - 1
src/views/information/custom/list/normal-use/index.vue

@@ -99,6 +99,8 @@ function getCustomList() {
     return { customList, actionQuery, columns, filteredInfo, getColumns, search, loading };
 }
 
+// 处理新增资料
+
 function add() {
     console.log('add');
 }
@@ -115,7 +117,7 @@ export default defineComponent({
             getColumns();
             // 加载数据在这里
         });
-        return { customList, add, columns, search, loading };
+        return { customList, columns, search, loading, add };
     },
 });
 </script>

+ 2 - 4
src/views/setting/logout/index.vue

@@ -3,8 +3,7 @@
            v-model:visible="visible"
            @cancel="cancel"
            width="890px"
-           :footer="null"
-           @ok="handleOk">
+           :footer="null">
     <div>logout</div>
     <div>logout</div>
     <div>logout</div>
@@ -25,13 +24,12 @@ export default defineComponent({
     name: 'logout',
 
     setup() {
-        const { visible, cancel, handleOk } = closeModal('logout');
+        const { visible, cancel } = closeModal('logout');
 
         initData(() => {});
         return {
             visible,
             cancel,
-            handleOk,
         };
     },
 });

+ 2 - 4
src/views/setting/notice/index.vue

@@ -3,8 +3,7 @@
            v-model:visible="visible"
            @cancel="cancel"
            width="890px"
-           :footer="null"
-           @ok="handleOk">
+           :footer="null">
     <a-tabs v-model:activeKey="activeKey">
       <a-tab-pane key="1">
         <template #tab>
@@ -44,7 +43,7 @@ export default defineComponent({
         NoticeContent,
     },
     setup() {
-        const { visible, cancel, handleOk } = closeModal('notice');
+        const { visible, cancel } = closeModal('notice');
         // 公告消息
         const noticeList = ref<QueryNoticeRsp[]>([]);
 
@@ -57,7 +56,6 @@ export default defineComponent({
         return {
             visible,
             cancel,
-            handleOk,
             noticeList,
             activeKey: ref('1'),
         };