浏览代码

修改严格检测

huangbin 4 年之前
父节点
当前提交
7de11a4ceb

+ 3 - 3
src/goServiceAPI/commonService/index.ts

@@ -66,7 +66,7 @@ export function queryNoticeReaded(noticeID: number): Promise<string> {
 /**
  * 通知公告系统消息查询
  */
-export function queryNotice(): Promise<type.queryNoticeRsp[]> {
+export function queryNotice(): Promise<type.QueryNoticeRsp[]> {
     const param = { loginID: Number(getLongTypeLoginID()) };
     return commonSearch_go('/Common/QueryNotice', param).catch((err: Error) => {
         throw new Error(`通知公告系统消息查询失败:${err.message}`);
@@ -95,14 +95,14 @@ export function GetPCMenus(): Promise<string> {
  * 查询交易端列表头信息
  * @returns 
  */
-export function QueryTableDefine(): Promise<string> {
+export function QueryTableDefine(): Promise<type.TableDefineRsp[]> {
     const param = {
         tableType: 2, // 列表类型 - 1:管理端 2:H5终端 3:移动终端
     };
     return commonSearch_go('/Common/QueryTableDefine', param)
         .then((res) => {
             console.log('查询交易端列表头信息', res);
-            return 'ok';
+            return res;
         })
         .catch((err: Error) => {
             throw new Error(`查询交易端列表头信息:${err.message}`);

+ 30 - 1
src/goServiceAPI/commonService/interface.ts

@@ -14,7 +14,7 @@ export interface AllEnums {
     param2: string; //参数1[币种:币种显示单位]
     remark: string; //备注
 }
-export interface queryNoticeRsp {
+export interface QueryNoticeRsp {
     auditoruserid: number; //审核人
     auditremark: string; //审核备注
     audittime: string; //审核日期
@@ -44,3 +44,32 @@ export interface OperationTabMenu {
     type: number; //类型,1:菜单 2:按钮
     children: OperationTabMenu[];
 }
+
+export interface Column {
+    aligntype: number;//对齐方式 - 1:居中对齐 2:左对齐 3:右对齐
+    autoid: number;//AutoID
+    columnfield: string;//列字段
+    columntitle: string;//列Title
+    columnwidth: string;//列宽
+    formatter: string;
+    //	:string;//格式化字符
+    formattertype: string;//格式化类型
+    groupname: string;//表头分组名称
+    isshow: number;//是否显示 - number;
+    //:不显示 1:显示
+    needsummary: number;//是否需要汇总 - number;
+    //:不需要 1:需要
+    orderindex: number;//顺序
+    remark: string;//备注
+    summarytype: number;//汇总类型 - 1:加总 2:最后一个
+    tablekey: string;//列表Key
+}
+
+export interface TableDefineRsp {
+    columns: Column[], // 列头信息数组
+    remark: string;//Remark
+    tabelmenu: string;//列表菜单
+    tablekey: string;//列表Key
+    tablename: string;//列表名称
+    tabletype: number;//列表类型 - 1:管理端 2:终端
+}

+ 2 - 1
src/services/bus/login.ts

@@ -1,4 +1,4 @@
-import { GetPCMenus, getServerTime } from '@/goServiceAPI/commonService/index';
+import { GetPCMenus, getServerTime, QueryTableDefine } from '@/goServiceAPI/commonService/index';
 import { GetLoginID, LoginQuery } from '@/goServiceAPI/useInfo/index';
 import APP from '@/services';
 import { checkTokenLoop } from '@/services/bus/token';
@@ -23,6 +23,7 @@ export const login = async (logidCode: string, password: String, byteArr: Uint8A
         // localstorage 缓存登录信息,处理页面刷新
         setLoginData(loginData);
         await GetPCMenus();
+        await QueryTableDefine();
         // 获取服务时间
         await getServerTime();
         // getAllEnums();/

+ 15 - 12
src/services/dataCenter/index.ts

@@ -1,10 +1,11 @@
 import { reactive, toRefs } from 'vue';
 import { LastUpdateTimeModel, LoginaccountModel, TradeDateModel, userAccountModel, UserInfoModel } from './initDataModel/account';
-import { needClearSourceDataType, noClearSourceDataType } from './interface';
+import { NeedClearSourceDataType, NoClearSourceDataType } from './interface';
+
 /**
  * 需要清空数据中心
  */
-const needClearSourceData: needClearSourceDataType = {
+const needClearSourceData: NeedClearSourceDataType = {
     systemDate: '',
     externalexchange: [],
     goodsgroups: [], // 商品组
@@ -15,6 +16,8 @@ const needClearSourceData: needClearSourceDataType = {
     userInfo: new UserInfoModel(), // 用户信息
     username: '',
     menus: [],
+    tableHead: [],
+
 
     queryClientFixedADConfigs: [],
     checkTokenTimeDiff: Math.floor(Math.random() * 6 + 5) * 60 * 1000,
@@ -34,33 +37,33 @@ const needClearSourceData: needClearSourceDataType = {
 /**
  * 不需要清空的数据
  */
-const noClearSourceData: noClearSourceDataType = {
+const noClearSourceData: NoClearSourceDataType = {
     touristToken: 'c886a057f3d820d4dbc41473686c7c2d',
 };
 class DataCenter {
-    private data = toRefs<needClearSourceDataType>(reactive(Object.assign({}, needClearSourceData)));
-    private noClearData = toRefs<noClearSourceDataType>(reactive(Object.assign({}, noClearSourceData)));
+    private data = toRefs<NeedClearSourceDataType>(reactive(Object.assign({}, needClearSourceData)));
+    private noClearData = toRefs<NoClearSourceDataType>(reactive(Object.assign({}, noClearSourceData)));
 
     /** 重置所有数据 */
     public reset(): void {
-        this.data = toRefs<needClearSourceDataType>(reactive(Object.assign({}, needClearSourceData)));
+        this.data = toRefs<NeedClearSourceDataType>(reactive(Object.assign({}, needClearSourceData)));
     }
 
     /** 设置键对应的值 */
-    public setOneOf(props: keyof (needClearSourceDataType & noClearSourceDataType), value: any) {
+    public setOneOf(props: keyof (NeedClearSourceDataType & NoClearSourceDataType), value: any) {
         if (Reflect.has(noClearSourceData, props)) {
-            this.noClearData[props as keyof noClearSourceDataType].value = value;
+            this.noClearData[props as keyof NoClearSourceDataType].value = value;
         } else if (Reflect.has(needClearSourceData, props)) {
-            this.data[props as keyof needClearSourceDataType].value = value;
+            this.data[props as keyof NeedClearSourceDataType].value = value;
         }
     }
 
     /** 获取其中之一 */
-    public getOneOf(props: keyof (needClearSourceDataType & noClearSourceDataType)): any {
+    public getOneOf(props: keyof (NeedClearSourceDataType & NoClearSourceDataType)): any {
         if (Reflect.has(noClearSourceData, props)) {
-            return this.noClearData[props as keyof noClearSourceDataType];
+            return this.noClearData[props as keyof NoClearSourceDataType];
         } else if (Reflect.has(needClearSourceData, props)) {
-            return this.data[props as keyof needClearSourceDataType];
+            return this.data[props as keyof NeedClearSourceDataType];
         }
     }
 

+ 5 - 3
src/services/dataCenter/interface.ts

@@ -1,4 +1,4 @@
-import { OperationTabMenu } from '@/goServiceAPI/commonService/interface';
+import { OperationTabMenu, TableDefineRsp } from '@/goServiceAPI/commonService/interface';
 import * as useInfo from '@/goServiceAPI/useInfo/interface';
 import * as mineType from '@/services/http/mine/interface';
 import * as Type from '@/services/http/notice/interface';
@@ -15,14 +15,14 @@ import { SystemParam } from './interafce/error';
 /**
  * 不需要清空数据中心
  */
-export interface noClearSourceDataType {
+export interface NoClearSourceDataType {
     touristToken: string; // 游客Token
 }
 
 /**
  * 需要清空数据中心
  */
-export interface needClearSourceDataType {
+export interface NeedClearSourceDataType {
     systemDate: string; // 系统时间
     externalexchange: useInfo.Externalexchange[]; // 外部交易所
     goodsgroups: useInfo.Goodsgroup[]; // 商品组
@@ -33,6 +33,8 @@ export interface needClearSourceDataType {
     userInfo: useInfo.Userinfo; // 用户信息
     username: string;
     menus: OperationTabMenu[]; // 交易端菜单
+    tableHead: TableDefineRsp[]; // 动态表头
+
 
     queryClientFixedADConfigs: advert.fixedADConfigs[]; //首页图片广告
     checkTokenTimeDiff: number; // 轮休校验token时间差

+ 12 - 12
src/services/index.ts

@@ -1,13 +1,13 @@
-import { MTP2WebSocket, Callback, ReconnectChangeState } from '@/utils/websocket/index';
-import { Package40, Package50 } from '@/utils/websocket/package';
+import { funCode } from '@/funcode/index';
+import { checkTokenLoop } from '@/services/bus/token';
+import { NeedClearSourceDataType, NoClearSourceDataType } from '@/services/dataCenter/interface';
 import { serviceURL } from '@/utils/request/index';
-import DataCenter from './dataCenter/index';
-import { noClearSourceDataType, needClearSourceDataType } from '@/services/dataCenter/interface';
 import timerUtil from '@/utils/tool/timerUtil';
-import { checkTokenLoop } from '@/services/bus/token';
-import { funCode } from '@/funcode/index';
-import { noticeParseRsp } from './socket/protobuf/buildReq';
+import { Callback, MTP2WebSocket, ReconnectChangeState } from '@/utils/websocket/index';
+import { Package40, Package50 } from '@/utils/websocket/package';
 import eventBus from '../utils/eventBus';
+import DataCenter from './dataCenter/index';
+import { noticeParseRsp } from './socket/protobuf/buildReq';
 /** 行情和交易长链 */
 interface LongLink {
     /** 行情长链 */
@@ -29,16 +29,16 @@ export default new (class LifeCycleCtr {
         trade: new MTP2WebSocket<Package50>(1),
     };
 
-    constructor() {}
+    constructor() { }
 
     /** 数据中心初始化 */
-    initDataCenter(): void {}
+    initDataCenter(): void { }
 
     /**
      * 从数据中心获取普通数据
      * @param key needClearSourceDataType | noClearSourceDataType
      */
-    get(key: keyof (needClearSourceDataType & noClearSourceDataType)) {
+    get(key: keyof (NeedClearSourceDataType & NoClearSourceDataType)) {
         return this.dataCenter.getOneOf(key).value;
     }
 
@@ -46,7 +46,7 @@ export default new (class LifeCycleCtr {
      * 从数据中心获取数据响应式数据
      * @param key needClearSourceDataType | noClearSourceDataType
      */
-    getRef(key: keyof (needClearSourceDataType & noClearSourceDataType)) {
+    getRef(key: keyof (NeedClearSourceDataType & NoClearSourceDataType)) {
         return this.dataCenter.getOneOf(key);
     }
     /**
@@ -61,7 +61,7 @@ export default new (class LifeCycleCtr {
      * @param key needClearSourceDataType | noClearSourceDataType
      * @param value any
      */
-    set(key: keyof (needClearSourceDataType & noClearSourceDataType), value: any) {
+    set(key: keyof (NeedClearSourceDataType & NoClearSourceDataType), value: any) {
         return this.dataCenter.setOneOf(key, value);
     }
 

+ 76 - 0
src/views/information/custom/compoments/filterTable/index.vue

@@ -0,0 +1,76 @@
+<template>
+  <!-- 过滤客户资料表格 -->
+  <div class="filter-custom-table">
+    <a-select label-in-value
+              v-model:value="userinfotype"
+              placeholder="全部客户类型"
+              style="width: 120px"
+              @change="handleChange">
+      <a-select-option value="1">个人</a-select-option>
+      <a-select-option value="2">企业</a-select-option>
+    </a-select>
+    <a-input v-model:value="nickname"
+             style="width: 140px"
+             placeholder="模糊搜索客户简称" />
+    <a-input v-model:value="name"
+             style="width: 140px"
+             placeholder="模糊搜索客户名称" />
+    <a-input v-model:value="phone"
+             style="width: 140px"
+             placeholder="模糊搜索手机号码" />
+    <a-button @click="search">查询</a-button>
+    <a-button @click="reset">重置</a-button>
+    <a-button @click="add">新增</a-button>
+  </div>
+</template>
+
+<script lang="ts">
+import { defineComponent, ref } from 'vue';
+
+// 处理 客户类型
+function handleUserInfoType() {
+    interface Value {
+        key?: string;
+        label?: string;
+    }
+    const userinfotype = ref<number>(0);
+    function handleChange(value: Value) {
+        console.log(value);
+    }
+    return { userinfotype, handleChange };
+}
+
+// 搜索
+function handleSearch() {
+    const nickname = ref<string>('');
+    const name = ref<string>('');
+    const phone = ref<string>('');
+    function search() {}
+    function reset() {
+        nickname.value = '';
+        name.value = '';
+        phone.value = '';
+    }
+    return { nickname, name, phone, search, reset };
+}
+
+export default defineComponent({
+    name: 'filter-custom-table',
+    components: {},
+    setup(props, context) {
+        function add() {
+            context.emit('add');
+        }
+        return {
+            ...handleUserInfoType(),
+            ...handleSearch(),
+            add,
+        };
+    },
+});
+</script>
+
+<style lang="less">
+.filter-custom-table {
+}
+</style>;

+ 51 - 45
src/views/information/custom/list/normal-use/index.vue

@@ -1,12 +1,7 @@
 <template>
   <!-- 客户信息: 正常 -->
   <div class="custom-normal">
-    客户信息: 正常
-    <div class="table-operations">
-      <a-button>查询</a-button>
-      <a-button>重置</a-button>
-      <a-button>新增</a-button>
-    </div>
+    <filterCustomTable @add="add" />
     <!-- <a-table :columns="columns"
              :data-source="data"
              @change="handleChange" /> -->
@@ -15,51 +10,53 @@
 
 <script lang="ts">
 import { computed, defineComponent, ref } from 'vue';
+import { QueryTableDefine } from '@/goServiceAPI/commonService/index';
 
 import { initData } from '@/setup/methods/index';
 import { QueryCustomInfo } from '@/goServiceAPI/ermcp/customInfo/index';
 import { QueryCustomInfoType } from '@/goServiceAPI/ermcp/customInfo/interface';
+import filterCustomTable from '@/views/information/custom/compoments/filterTable/index.vue';
 import { message } from 'ant-design-vue';
 
 // 查询客户资料列表
 function getCustomList() {
-    // const filteredInfo = ref();
-    // const sortedInfo = ref();
-    // const columns = computed(() => {
-    //     const filtered = filteredInfo.value || {};
-    //     const sorted = sortedInfo.value || {};
-    //     return [
-    //         {
-    //             title: '序号',
-    //             dataIndex: 'index',
-    //             key: 'index',
-    //             align: 'center',
-    //             width: 50,
-    //             customRender: (param: any) => `${param.index + 1}`,
-    //         },
-    //         {
-    //             title: 'Age',
-    //             dataIndex: 'age',
-    //             key: 'age',
-    //             sorter: (a: DataItem, b: DataItem) => a.age - b.age,
-    //             sortOrder: sorted.columnKey === 'age' && sorted.order,
-    //         },
-    //         {
-    //             title: 'Address',
-    //             dataIndex: 'address',
-    //             key: 'address',
-    //             filters: [
-    //                 { text: 'London', value: 'London' },
-    //                 { text: 'New York', value: 'New York' },
-    //             ],
-    //             filteredValue: filtered.address || null,
-    //             onFilter: (value: string, record: DataItem) => record.address.includes(value),
-    //             sorter: (a: DataItem, b: DataItem) => a.address.length - b.address.length,
-    //             sortOrder: sorted.columnKey === 'address' && sorted.order,
-    //             ellipsis: true,
-    //         },
-    //     ];
-    // });
+    const filteredInfo = ref();
+    const sortedInfo = ref();
+    const columns = computed(() => {
+        // const filtered = filteredInfo.value || {};
+        // const sorted = sortedInfo.value || {};
+        // return [
+        //     {
+        //         title: '序号',
+        //         dataIndex: 'index',
+        //         key: 'index',
+        //         align: 'center',
+        //         width: 50,
+        //         customRender: (param: any) => `${param.index + 1}`,
+        //     },
+        //     {
+        //         title: 'Age',
+        //         dataIndex: 'age',
+        //         key: 'age',
+        //         sorter: (a: DataItem, b: DataItem) => a.age - b.age,
+        //         sortOrder: sorted.columnKey === 'age' && sorted.order,
+        //     },
+        //     {
+        //         title: 'Address',
+        //         dataIndex: 'address',
+        //         key: 'address',
+        //         filters: [
+        //             { text: 'London', value: 'London' },
+        //             { text: 'New York', value: 'New York' },
+        //         ],
+        //         filteredValue: filtered.address || null,
+        //         onFilter: (value: string, record: DataItem) => record.address.includes(value),
+        //         sorter: (a: DataItem, b: DataItem) => a.address.length - b.address.length,
+        //         sortOrder: sorted.columnKey === 'address' && sorted.order,
+        //         ellipsis: true,
+        //     },
+        // ];
+    });
     const customList = ref<QueryCustomInfoType[]>([]);
     function actionQuery() {
         QueryCustomInfo(3)
@@ -72,16 +69,25 @@ function getCustomList() {
     return { customList, actionQuery };
 }
 
+function add() {
+    console.log('add');
+}
 export default defineComponent({
     name: 'custom-normal',
-    components: {},
+    components: {
+        filterCustomTable,
+    },
     setup() {
         const { customList, actionQuery } = getCustomList();
+
         initData(() => {
             actionQuery();
+            QueryTableDefine().then((res) => {
+                console.log('QueryTableDefine', res[0]);
+            });
             // 加载数据在这里
         });
-        return { customList };
+        return { customList, add };
     },
 });
 </script>

+ 30 - 28
src/views/setting/notice/components/noticeContent.vue

@@ -1,34 +1,36 @@
 <template>
-    <div class="notice-content">
-        <aside>
-            <a-list item-layout="horizontal" :data-source="noticeList">
-                <template #renderItem="{ item }">
-                    <a-list-item @click="choose(item)">
-                        <a-list-item-meta :description="item.createtime">
-                            <template #title>
-                                <a :style="{color: item.readed ? '#88A0AE' : '#E5E5E5'}" href="javascript:;">{{ item.title }}</a>
-                            </template>
-                            <template #avatar>
-                                <a-badge :color="item.readed ? '#88A0AE' : 'orange'" />
-                            </template>
-                        </a-list-item-meta>
-                    </a-list-item>
-                </template>
-            </a-list>
-        </aside>
-        <main>
-            <h4>{{chooseItemNotice.title}}</h4>
-            <p>{{chooseItemNotice.createtime}}</p>
-            <div>
-                {{chooseItemNotice.content}}
-            </div>
-        </main>
-    </div>
+  <div class="notice-content">
+    <aside>
+      <a-list item-layout="horizontal"
+              :data-source="noticeList">
+        <template #renderItem="{ item }">
+          <a-list-item @click="choose(item)">
+            <a-list-item-meta :description="item.createtime">
+              <template #title>
+                <a :style="{color: item.readed ? '#88A0AE' : '#E5E5E5'}"
+                   href="javascript:;">{{ item.title }}</a>
+              </template>
+              <template #avatar>
+                <a-badge :color="item.readed ? '#88A0AE' : 'orange'" />
+              </template>
+            </a-list-item-meta>
+          </a-list-item>
+        </template>
+      </a-list>
+    </aside>
+    <main>
+      <h4>{{chooseItemNotice.title}}</h4>
+      <p>{{chooseItemNotice.createtime}}</p>
+      <div>
+        {{chooseItemNotice.content}}
+      </div>
+    </main>
+  </div>
 </template>
 
 <script lang="ts">
 import { defineComponent, PropType, reactive, computed } from 'vue';
-import { queryNoticeRsp } from '@/goServiceAPI/commonService/interface';
+import { QueryNoticeRsp } from '@/goServiceAPI/commonService/interface';
 import { mergeObjSameProperty } from '@/utils/tool/set';
 
 function chooseNotice() {
@@ -42,7 +44,7 @@ function chooseNotice() {
         content: '',
         createtime: '',
     });
-    function choose(item: queryNoticeRsp) {
+    function choose(item: QueryNoticeRsp) {
         mergeObjSameProperty(chooseItemNotice, item);
     }
     return { chooseItemNotice, choose };
@@ -52,7 +54,7 @@ export default defineComponent({
     name: 'notice',
     props: {
         noticeList: {
-            type: Object as PropType<queryNoticeRsp[]>,
+            type: Object as PropType<QueryNoticeRsp[]>,
             default: [],
         },
     },

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

@@ -36,7 +36,7 @@ import { closeModal } from '@/setup/controlModal/index';
 import NoticeContent from './components/noticeContent.vue';
 import { initData } from '@/setup/methods/index';
 import { queryNotice } from '@/goServiceAPI/commonService/index';
-import { queryNoticeRsp } from '@/goServiceAPI/commonService/interface';
+import { QueryNoticeRsp } from '@/goServiceAPI/commonService/interface';
 
 export default defineComponent({
     name: 'notice',
@@ -46,7 +46,7 @@ export default defineComponent({
     setup() {
         const { visible, cancel, handleOk } = closeModal('notice');
         // 公告消息
-        const noticeList = ref<queryNoticeRsp[]>([]);
+        const noticeList = ref<QueryNoticeRsp[]>([]);
 
         initData(() => {
             queryNotice().then((res) => {

+ 5 - 28
swagger-to-ts/swagger.ts

@@ -1,30 +1,7 @@
 export interface Name{
-address	:string;//通讯地址
-attachment1	:string;//附件1
-audittime	:string;//审核时间
-cardbackphotourl	:string;//证件反面图片地址
-cardfrontphotourl	:string;//证件正面图片地址
-cardnum	:string;//证件号码
-cardtype	:number;//证件类型
-cardtypename	:string;//证件类型名称
-cityid	:number;//市
-contactname	:string;//联系人
-countryid	:number;//国家
-createtime	:string;//创建时间
-customername	:string;//企业名称
-districtid	:number;//区域
-email	:string;//邮件
-legalpersonname	:string;//法人姓名(企业)
-memberuserid	:number;//所属机构ID
-mobile	:string;//手机号码
-modifytime	:string;//修改时间
-nickname	:string;//昵称
-provinceid	:number;//省
-remark	:string;//备注
-status	:number;//账户状态 - 1:待激活 2:待审核 3:待复审 4:正常 5:审核拒绝 6:注销
-statusdesc	:string;//账户状态中文描述
-taxpayernum	:string;//纳税人识别号
-telphone	:string;//联系电话
-userid	:number;//用户ID
-userinfotype	:string;//客户类型
+remark	:string;//Remark
+tabelmenu	:string;//列表菜单
+tablekey	:string;//列表Key
+tablename	:string;//列表名称
+tabletype	:number;//列表类型 - 1:管理端 2:终端
 }

+ 9 - 78
swagger-to-ts/swagger.txt

@@ -1,85 +1,16 @@
 {
-address	string
-通讯地址
-
-attachment1	string
-附件1
-
-audittime	string
-审核时间
-
-cardbackphotourl	string
-证件反面图片地址
-
-cardfrontphotourl	string
-证件正面图片地址
-
-cardnum	string
-证件号码
-
-cardtype	integer
-证件类型
-
-cardtypename	string
-证件类型名称
-
-cityid	integer
-市
-
-contactname	string
-联系人
-
-countryid	integer
-国家
-
-createtime	string
-创建时间
-
-customername	string
-企业名称
-
-districtid	integer
-区域
-
-email	string
-邮件
-
-legalpersonname	string
-法人姓名(企业)
-
-memberuserid	integer
-所属机构ID
-
-mobile	string
-手机号码
-
-modifytime	string
-修改时间
-
-nickname	string
-昵称
-
-provinceid	integer
-省
-
 remark	string
-备注
-
-status	integer
-账户状态 - 1:待激活 2:待审核 3:待复审 4:正常 5:审核拒绝 6:注销
-
-statusdesc	string
-账户状态中文描述
+Remark
 
-taxpayernum	string
-纳税人识别号
+tabelmenu	string
+列表菜单
 
-telphone	string
-联系电话
+tablekey*	string
+列表Key
 
-userid	integer
-用户ID
+tablename	string
+列表名称
 
-userinfotype	string
-客户类型
+tabletype	integer
+列表类型 - 1:管理端 2:终端
 }