From b5c1614fe473330ceca8b7cff0f1802e19bd5039 Mon Sep 17 00:00:00 2001 From: Sanakey <714737083@qq.com> Date: 星期一, 30 九月 2024 13:39:08 +0800 Subject: [PATCH] feat:添加部分线索接口,完善客户相关页面 --- src/views/customer/components/drawer/Detail.vue | 2 src/views/customer/components/drawerContacterFormData.tsx | 492 +------- src/views/customer/settings.vue | 121 ++ src/api/sys/onbusUser.ts | 57 src/views/clues/components/drawerFormData.tsx | 118 - src/views/customer/components/drawer/Dynamic.vue | 4 mock/clues/clues-table.ts | 2 src/views/clues/components/DrawerForm.vue | 40 src/views/clues/components/Table.vue | 80 + src/components/TagSelector/src/TagSelector.vue | 108 + src/api/clues/list.ts | 26 src/views/customer/settings/Group.vue | 254 ++++ src/api/base/data.ts | 28 src/settings/projectSetting.ts | 2 src/views/clues/components/drawer/ScheduleDetail.vue | 16 src/views/clues/index.vue | 16 src/views/clues/components/tableData.tsx | 202 +- src/views/customer/components/DrawerForm.vue | 29 src/store/modules/formBaseData.ts | 39 src/views/customer/settings/From.vue | 254 ++++ src/views/clues/components/drawer/Detail.vue | 44 src/views/customer/components/Drawer.vue | 16 src/views/customer/components/drawerFormData.tsx | 512 +++----- src/views/clues/components/drawer/data.tsx | 2 src/views/customer/settings/Tags.vue | 292 ++++ src/views/clues/components/drawer/index.vue | 35 src/utils/auth/jsencrypt.min.js | 2 src/views/customer/settings/PublicPoolRule.vue | 96 + src/views/customer/components/tableData.tsx | 2 src/views/clues/components/Drawer.vue | 72 /dev/null | 11 src/views/sys/login/LoginForm.vue | 20 src/store/modules/cluesRowData.ts | 29 src/api/clues/table.ts | 2 src/api/model/baseModel.ts | 5 src/router/routes/modules/customer.ts | 22 src/views/clues/components/drawerContacterFormData.tsx | 492 +------- src/App.vue | 29 38 files changed, 2,056 insertions(+), 1,517 deletions(-) diff --git a/mock/clues/clues-table.ts b/mock/clues/clues-table.ts index 5b9f27c..8f6f1ea 100644 --- a/mock/clues/clues-table.ts +++ b/mock/clues/clues-table.ts @@ -87,7 +87,7 @@ export default [ { // url: '/basic-api/table/getDemoList', - url: '/basic-api/crm/clues/list', + url: '/basic-api/crm/clues/table', timeout: 100, method: 'get', response: ({ query }) => { diff --git a/src/App.vue b/src/App.vue index 401b213..cfce9cc 100644 --- a/src/App.vue +++ b/src/App.vue @@ -17,16 +17,41 @@ import { computed, ref } from 'vue'; import { getCurrentInstance } from 'vue'; + import { useFormBaseData } from '@/store/modules/formBaseData'; + import {useUserStore} from "@/store/modules/user"; + import {getSysMode} from "@/api/sys/onbusUser"; + + const userStore = useUserStore(); + let userInfo = userStore.getUserInfo; + Logger.log('userInfo...', userInfo); + + // 鑾峰彇琛ㄥ崟鍩虹鏁版嵁 + const userBaseDataStore= useFormBaseData(); + userBaseDataStore.getSelectInfoAction(); + let baseData = userBaseDataStore.getFormBaseData; + Logger.log('getFormBaseData..', baseData); + + // async function getSys(){ + // try { + // let data = await getSysMode(); + // console.log('璇锋眰getSysMode ...',data); + // } catch(e){ + // console.error(e); + // } + // } + // getSys(); // 鑾峰彇褰撳墠瀹炰緥 const instance = getCurrentInstance(); const proxy = instance?.proxy; const setCookie = () => { + // Logger.log('proxy...', 666); // 鍏堟鏌roxy鏄惁瀛樺湪锛屽啀杩涜鎿嶄綔 if (proxy && proxy.$cookies) { - proxy.$cookies.remove('JSESSIONID'); - proxy.$cookies.set('JSESSIONID', '23542F948D2C450599CF5850631B432D.jvm_59_9010', '1d'); + // proxy.$cookies.set('selectDatabase', '82', '1d'); + // proxy.$cookies.remove('JSESSIONID'); + // proxy.$cookies.set('JSESSIONID', 'BB3EE61E63A8E87982BF1658D14788B3.jvm_59_9010', '1d'); } else { console.error('proxy瀵硅薄鏈垵濮嬪寲鎴栦笉鍖呭惈$cookies灞炴��'); } diff --git a/src/api/base/data.ts b/src/api/base/data.ts new file mode 100644 index 0000000..c1e6456 --- /dev/null +++ b/src/api/base/data.ts @@ -0,0 +1,28 @@ +import {defHttp} from '@/utils/http/axios'; +// import {BasicPageParams} from "@/api/model/baseModel"; +// +// type CluesListParams = Partial<BasicPageParams>; + +enum Api { + SELECT_INFO = '/crm/base/selectInfo.do', +} + +/** + * @description: Get sample list value + */ + +export const getSelectInfoApi = (params) => { + // params.pageNo = params.page; + Logger.info('getSelectInfoApi', params); + return defHttp.post({ + url: Api.SELECT_INFO, + params, + // headers: { + // // @ts-ignore + // // ignoreCancelToken: true, + // // 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8', + // }, + }); +} + + diff --git a/src/api/clues/list.ts b/src/api/clues/list.ts new file mode 100644 index 0000000..98c9f2e --- /dev/null +++ b/src/api/clues/list.ts @@ -0,0 +1,26 @@ +import {defHttp} from '@/utils/http/axios'; +import {BasicPageParams} from "@/api/model/baseModel"; + +type CluesListParams = Partial<BasicPageParams>; + +enum Api { + LIST = '/crm/clues/list.do', +} + +/** + * @description: Get sample list value + */ + +export const cluesListApi = (params:CluesListParams) => { + // params.pageNo = params.page; + Logger.info('cluesListApi', params); + return defHttp.post({ + url: Api.LIST, + params, + // headers: { + // // @ts-ignore + // // ignoreCancelToken: true, + // // 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8', + // }, + }); +} diff --git a/src/api/clues/table.ts b/src/api/clues/table.ts index d0ce6d8..0ba9877 100644 --- a/src/api/clues/table.ts +++ b/src/api/clues/table.ts @@ -4,7 +4,7 @@ type CluesListParams = Partial<BasicPageParams>; enum Api { - DEMO_LIST = '/crm/clues/list', + DEMO_LIST = '/crm/clues/table', } /** diff --git a/src/api/model/baseModel.ts b/src/api/model/baseModel.ts index 7379888..263715d 100644 --- a/src/api/model/baseModel.ts +++ b/src/api/model/baseModel.ts @@ -2,6 +2,11 @@ pageNo: number; page: number; pageSize: number; + type: string; + search: { + cluesName: string; + isRead: number; + } } export interface BasicFetchResult<T> { diff --git a/src/api/sys/onbusUser.ts b/src/api/sys/onbusUser.ts new file mode 100644 index 0000000..a739a49 --- /dev/null +++ b/src/api/sys/onbusUser.ts @@ -0,0 +1,57 @@ +import { defHttp } from '@/utils/http/axios'; + +import { ErrorMessageMode } from '#/axios'; +import '@/utils/auth/jsencrypt.min.js'; +enum Api { + GET_SYS = '/getDateDemo.do', + Login = '/login.do', + +} + +/** + * @description: user login api + */ +export function loginDo(params, mode: ErrorMessageMode = 'modal') { + console.log('鐧诲綍鍙傛暟',params); + let rsakey={ + pubkey:"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAkRupiYcKVGGUtDBDoR1t/1zm3ZtZgnte39iTJW6hlqjdY0UagKjpNiIv7J6XjtgfX7SgsR4AWnivqQHAICIvdPKfGZZzIs62OQ19MqrDTMoB/LvK5teNWhClv23WMUfRbP+EHgprT6hTw8U5apw1IB6i/y57NkLav792wiYBYRU4X45NoTaT+aiTSLFEflbfm94EXnhSS3vFkBmrZGy5BRNI8gmzafroslGx2Hk90CqlNdeKYxgZQ6xtvj+u33yrszWvPT6F9fsJT8aMjtvH050iYKRVct+x6Q7VRJgCI4MgvAexnTKdxW54YzvXCuO5bDiy5la7CgerWkTAq9dzXwIDAQAB" + }; + let encrypt = new JSEncrypt(); + encrypt.setPublicKey(rsakey.pubkey); + let encryptPwd = encrypt.encrypt(params.password); + let encryptUser = encrypt.encrypt(params.account); + // console.log('鍔犲瘑鍚庣殑瀵嗙爜',encryptPwd,'鍔犲瘑鍚庣殑鐢ㄦ埛鍚�',encryptUser); + + params = { + account:encryptUser, + pwd:encryptPwd, + dataName: 82, + redirect:'', + cltsn:'', + telephone:'', + phoneCode:'', + }; + return defHttp.post( + { + url: Api.Login, + params, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8', + } + }, + ); +} + +export function getSysMode(params, mode: ErrorMessageMode = 'modal') { + params = { + id: 82, + dataBaseDis: '鐩堟櫒璞崕鐗�', + version:'' + }; + return defHttp.post( + { + url: Api.GET_SYS, + params, + }, + ); +} diff --git a/src/components/TagSelector/src/TagSelector.vue b/src/components/TagSelector/src/TagSelector.vue index 842139c..33261dc 100644 --- a/src/components/TagSelector/src/TagSelector.vue +++ b/src/components/TagSelector/src/TagSelector.vue @@ -1,19 +1,29 @@ <template> <div :class="`relative ${prefixCls}`"> + <div class="mask" v-if="isOpen"></div> + <span class="h-36px lh-36px"> + <template v-for="(item,index) in selectedTags" > + <a-tag :closable="true" :color="item.option.color" style="margin-right: 5px" @close="onCloseTag($event,index)"> + {{ item.option.value }} + </a-tag> + </template> + </span> <Icon icon="uil:focus-add" class="mr-15px cursor-pointer add-tags-icon" - @click="" + @click="isOpen = !isOpen" :style="{ color: 'hotpink' }" :size="20" /> + +<!-- :defaultOpen="false"--> <a-select - v-model:value="tagsValue" + v-model:value="selectedTags" mode="multiple" - style="width: 36px" + style="width: 0px;visibility: hidden;" :searchValue="name" :labelInValue="true" - :defaultOpen="false" + :open="isOpen" :bordered="false" :showSearch="false" :dropdownMatchSelectWidth="false" @@ -29,7 +39,7 @@ <!-- </template>--> <template #dropdownRender="{ menuNode: menu }"> <div class="h-36px lh-36px"> - <template v-for="(item,index) in tagsValue" > + <template v-for="(item,index) in selectedTags" > <a-tag :closable="true" :color="item.option.color" style="margin-right: 5px" @close="onCloseTag($event,index)"> {{ item.option.value }} </a-tag> @@ -45,13 +55,13 @@ </template> 鏂板缓鏍囩 </a-button> - <SettingOutlined class="cursor-pointer" /> + <SettingOutlined @click="goTagsSetting" class="cursor-pointer" /> </a-space> <a-divider style="margin: 4px 0" /> <v-nodes :vnodes="menu" /> <a-row class="m10px" justify="end"> <a-col> - <a-button type="default" class="mr-10px">鍙栨秷</a-button> + <a-button type="default" @click="closeSelector" class="mr-10px">鍙栨秷</a-button> <a-button type="primary" @click="saveTags">淇濆瓨</a-button> </a-col> </a-row> @@ -76,10 +86,37 @@ return this.vnodes; }, }); +// TODO 寰呬紭鍖�,杩樻湁澶ч噺bug +// // 鎺ユ敹鐖剁粍浠朵紶鍙俿electedTags +// const props = defineProps({ +// tagsValue: { +// type: Array, +// default: () => [], +// }, +// }); +// const emits = defineEmits(['update:tagsValue']) + + +// let tagsValue = props.tagsValue; +let tagsValue = ref(['鏈夋剰鍚�','濂借璇�']); +// let tagsValue = ref([]); +// tagsValue.value = tagsValue1.map(item => item); +// Logger.log('tagsValue.map(item => item)',tagsValue1.map(item => item)); let index = 0; -const items = ref([{name:'jack',color:'red'}, {name:'lucy',color:'pink'}]); -const tagsValue = ref(); +const items = ref([{name:'鏈夋剰鍚�',color:'red'}, {name:'濂借璇�',color:'pink'}, {name:'鏈夌ぜ璨�',color:'red'}, {name:'鍒濇鎰忓悜',color:'red'}, {name:'宸茶仈绯�',color:'red'}, {name:'宸叉嫆缁�',color:'red'}]); + +Logger.log('props.tagsValue',tagsValue); +// let tagsValue = ref([]); +// tagsValue.value = ['鏈夋剰鍚�','濂借璇�']; +let selectedTags = ref([]); +// let a = items.value.filter(item => tagsValue.value.includes(item.name)); +// Logger.log('aaa',a); +// for (let i = 0;i<a.length;i++) { +// selectedTags.value.push({option:{value:a[i].name,color:a[i].color}}) +// } +// Logger.log('selectedTags',selectedTags.value); +// // const selectedTags = ref([]); const inputRef = ref(); const name = ref(); @@ -87,6 +124,9 @@ e.preventDefault(); console.log('addItem'); if (!name.value) return; + if (items.value.find(item => item.name === name.value)) { + return; + } items.value.push({name:name.value,color:'red'}); name.value = ''; setTimeout(() => { @@ -100,22 +140,54 @@ function onCloseTag(e,index) { e.preventDefault(); Logger.log('onCloseTag',index); - tagsValue.value.splice(index,1); + selectedTags.value.splice(index,1); } + +const isOpen = ref(false); function saveTags() { - Logger.log('saveTags',tagsValue); + // Logger.log('saveTags',selectedTags); + + // let tagsValue = selectedTags.value.map(item => { + // Logger.log('item',item.option.value); + // return item.option.value + // }).splice(0,1); + + // tagsValue.splice(0,1); + // Logger.log('saveTags',tagsValue); + // emits('update:tagsValue', tagsValue) + closeSelector(); +} +function closeSelector() { + isOpen.value = false; + // selectedTags.value = []; +} + + + +function goTagsSetting() { + Logger.log('goTagsSetting'); + window.open('#/customer/settings?tab=3'); } </script> -<style lang="less"> +<style lang="less" scoped> .tag-selector { - .ant-select-selection-overflow { - display: none; + .mask{ + position: fixed; + top: 0; + bottom: 0; + left: 0; + right: 0; + background: rgba(0, 0, 0, 0); + z-index: 1001; } - .add-tags-icon{ - position: absolute; - left: 10px; - } + //:deep(.ant-select-selection-overflow) { + // display: none; + //} + //:deep(.add-tags-icon){ + // position: absolute; + // left: 10px; + //} } </style> diff --git a/src/router/routes/modules/customer.ts b/src/router/routes/modules/customer.ts index 4fdfa62..b431e0b 100644 --- a/src/router/routes/modules/customer.ts +++ b/src/router/routes/modules/customer.ts @@ -15,7 +15,7 @@ children: [ { path: 'index', - name: 'AccountManagement', + name: 'CustomerList', meta: { title: '瀹㈡埛鍒楄〃', ignoreKeepAlive: false, @@ -53,24 +53,24 @@ // component: () => import('@/views/demo/system/role/index.vue'), // }, // - // { - // path: 'menu', - // name: 'MenuManagement', - // meta: { - // title: '瀹㈡埛鏌ラ噸', - // ignoreKeepAlive: true, - // }, - // component: () => import('@/views/demo/system/menu/index.vue'), - // }, { path: 'dept', name: 'DeptManagement', meta: { - title: '瀹㈡埛璁剧疆', + title: '瀹㈡埛鏌ラ噸', ignoreKeepAlive: true, }, component: () => import('@/views/demo/system/dept/index.vue'), }, + { + path: 'settings', + name: 'CustomerSettings', + meta: { + title: '瀹㈡埛璁剧疆', + ignoreKeepAlive: true, + }, + component: () => import('@/views/customer/settings.vue'), + }, // { // path: 'changePassword', // name: 'ChangePassword', diff --git a/src/settings/projectSetting.ts b/src/settings/projectSetting.ts index 12b128f..bb30f0c 100644 --- a/src/settings/projectSetting.ts +++ b/src/settings/projectSetting.ts @@ -235,7 +235,7 @@ // Use error-handler-plugin // 鏄惁浣跨敤鍏ㄥ眬閿欒鎹曡幏 - useErrorHandle: true, + useErrorHandle: false, // Whether to open back to top // 鏄惁寮�鍚洖鍒伴《閮� diff --git a/src/store/modules/cluesRowData.ts b/src/store/modules/cluesRowData.ts new file mode 100644 index 0000000..edcfa92 --- /dev/null +++ b/src/store/modules/cluesRowData.ts @@ -0,0 +1,29 @@ + +import { defineStore } from 'pinia'; +import { store } from '@/store'; + +export const useCluesRowStore = defineStore({ + id: 'clues-row-data', + state: () => ({ + rowData:{} + }), + getters: { + getRowData(state) { + return state.rowData || {}; + }, + }, + actions: { + /** + * @description: + */ + setRowData(data) { + this.rowData = data; + }, + + }, +}); + +// Need to be used outside the setup +export function useCluesRowStoreWithOut() { + return useCluesRowStore(store); +} diff --git a/src/store/modules/formBaseData.ts b/src/store/modules/formBaseData.ts new file mode 100644 index 0000000..96647b5 --- /dev/null +++ b/src/store/modules/formBaseData.ts @@ -0,0 +1,39 @@ + +import { defineStore } from 'pinia'; +import { store } from '@/store'; + +import {getSelectInfoApi} from "@/api/base/data"; + + +export const useFormBaseData = defineStore({ + id: 'form-base-data', + state: () => ({ + baseData:{} + }), + getters: { + getFormBaseData(state) { + return state.baseData || {}; + }, + }, + actions: { + /** + * @description: logout + */ + async getSelectInfoAction () { + try { + let res = await getSelectInfoApi({}) + Logger.log('getSelectInfoApi...',res); + this.baseData = res?.data || {}; + } catch (e) { + Logger.error(e); + } finally { + } + }, + + }, +}); + +// Need to be used outside the setup +export function useFormBaseDataWithOut() { + return useFormBaseData(store); +} diff --git a/src/utils/auth/jsencrypt.min.js b/src/utils/auth/jsencrypt.min.js new file mode 100644 index 0000000..b36656c --- /dev/null +++ b/src/utils/auth/jsencrypt.min.js @@ -0,0 +1,2 @@ +/*! For license information please see jsencrypt.min.js.LICENSE.txt */ +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.JSEncrypt=e():t.JSEncrypt=e()}(window,(()=>(()=>{var t={155:t=>{var e,i,r=t.exports={};function n(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function o(t){if(e===setTimeout)return setTimeout(t,0);if((e===n||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(i){try{return e.call(null,t,0)}catch(i){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:n}catch(t){e=n}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(t){i=s}}();var h,a=[],u=!1,c=-1;function f(){u&&h&&(u=!1,h.length?a=h.concat(a):c=-1,a.length&&l())}function l(){if(!u){var t=o(f);u=!0;for(var e=a.length;e;){for(h=a,a=[];++c<e;)h&&h[c].run();c=-1,e=a.length}h=null,u=!1,function(t){if(i===clearTimeout)return clearTimeout(t);if((i===s||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(t);try{return i(t)}catch(e){try{return i.call(null,t)}catch(e){return i.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function g(){}r.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)e[i-1]=arguments[i];a.push(new p(t,e)),1!==a.length||u||o(l)},p.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=g,r.addListener=g,r.once=g,r.off=g,r.removeListener=g,r.removeAllListeners=g,r.emit=g,r.prependListener=g,r.prependOnceListener=g,r.listeners=function(t){return[]},r.binding=function(t){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(t){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}}},e={};function i(r){var n=e[r];if(void 0!==n)return n.exports;var s=e[r]={exports:{}};return t[r](s,s.exports,i),s.exports}i.d=(t,e)=>{for(var r in e)i.o(e,r)&&!i.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var r={};return(()=>{"use strict";i.d(r,{default:()=>ct});var t="0123456789abcdefghijklmnopqrstuvwxyz";function e(e){return t.charAt(e)}function n(t,e){return t&e}function s(t,e){return t|e}function o(t,e){return t^e}function h(t,e){return t&~e}function a(t){if(0==t)return-1;var e=0;return 0==(65535&t)&&(t>>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function u(t){for(var e=0;0!=t;)t&=t-1,++e;return e}var c,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l="=";function p(t){var e,i,r="";for(e=0;e+3<=t.length;e+=3)i=parseInt(t.substring(e,e+3),16),r+=f.charAt(i>>6)+f.charAt(63&i);for(e+1==t.length?(i=parseInt(t.substring(e,e+1),16),r+=f.charAt(i<<2)):e+2==t.length&&(i=parseInt(t.substring(e,e+2),16),r+=f.charAt(i>>2)+f.charAt((3&i)<<4));(3&r.length)>0;)r+=l;return r}function g(t){var i,r="",n=0,s=0;for(i=0;i<t.length&&t.charAt(i)!=l;++i){var o=f.indexOf(t.charAt(i));o<0||(0==n?(r+=e(o>>2),s=3&o,n=1):1==n?(r+=e(s<<2|o>>4),s=15&o,n=2):2==n?(r+=e(s),r+=e(o>>2),s=3&o,n=3):(r+=e(s<<2|o>>4),r+=e(15&o),n=0))}return 1==n&&(r+=e(s<<2)),r}var d,v={decode:function(t){var e;if(void 0===d){var i="= \f\n\r\t聽\u2028\u2029";for(d=Object.create(null),e=0;e<64;++e)d["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e)]=e;for(d["-"]=62,d._=63,e=0;e<i.length;++e)d[i.charAt(e)]=-1}var r=[],n=0,s=0;for(e=0;e<t.length;++e){var o=t.charAt(e);if("="==o)break;if(-1!=(o=d[o])){if(void 0===o)throw new Error("Illegal character at offset "+e);n|=o,++s>=4?(r[r.length]=n>>16,r[r.length]=n>>8&255,r[r.length]=255&n,n=0,s=0):n<<=6}}switch(s){case 1:throw new Error("Base64 encoding incomplete: at least 2 bits missing");case 2:r[r.length]=n>>10;break;case 3:r[r.length]=n>>16,r[r.length]=n>>8&255}return r},re:/-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,unarmor:function(t){var e=v.re.exec(t);if(e)if(e[1])t=e[1];else{if(!e[2])throw new Error("RegExp out of sync");t=e[2]}return v.decode(t)}},m=1e13,y=function(){function t(t){this.buf=[+t||0]}return t.prototype.mulAdd=function(t,e){var i,r,n=this.buf,s=n.length;for(i=0;i<s;++i)(r=n[i]*t+e)<m?e=0:r-=(e=0|r/m)*m,n[i]=r;e>0&&(n[i]=e)},t.prototype.sub=function(t){var e,i,r=this.buf,n=r.length;for(e=0;e<n;++e)(i=r[e]-t)<0?(i+=m,t=1):t=0,r[e]=i;for(;0===r[r.length-1];)r.pop()},t.prototype.toString=function(t){if(10!=(t||10))throw new Error("only base 10 is supported");for(var e=this.buf,i=e[e.length-1].toString(),r=e.length-2;r>=0;--r)i+=(m+e[r]).toString().substring(1);return i},t.prototype.valueOf=function(){for(var t=this.buf,e=0,i=t.length-1;i>=0;--i)e=e*m+t[i];return e},t.prototype.simplify=function(){var t=this.buf;return 1==t.length?t[0]:this},t}(),b="鈥�",T=/^(\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/,S=/^(\d\d\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/;function E(t,e){return t.length>e&&(t=t.substring(0,e)+b),t}var w,D=function(){function t(e,i){this.hexDigits="0123456789ABCDEF",e instanceof t?(this.enc=e.enc,this.pos=e.pos):(this.enc=e,this.pos=i)}return t.prototype.get=function(t){if(void 0===t&&(t=this.pos++),t>=this.enc.length)throw new Error("Requesting byte offset ".concat(t," on a stream of length ").concat(this.enc.length));return"string"==typeof this.enc?this.enc.charCodeAt(t):this.enc[t]},t.prototype.hexByte=function(t){return this.hexDigits.charAt(t>>4&15)+this.hexDigits.charAt(15&t)},t.prototype.hexDump=function(t,e,i){for(var r="",n=t;n<e;++n)if(r+=this.hexByte(this.get(n)),!0!==i)switch(15&n){case 7:r+=" ";break;case 15:r+="\n";break;default:r+=" "}return r},t.prototype.isASCII=function(t,e){for(var i=t;i<e;++i){var r=this.get(i);if(r<32||r>176)return!1}return!0},t.prototype.parseStringISO=function(t,e){for(var i="",r=t;r<e;++r)i+=String.fromCharCode(this.get(r));return i},t.prototype.parseStringUTF=function(t,e){for(var i="",r=t;r<e;){var n=this.get(r++);i+=n<128?String.fromCharCode(n):n>191&&n<224?String.fromCharCode((31&n)<<6|63&this.get(r++)):String.fromCharCode((15&n)<<12|(63&this.get(r++))<<6|63&this.get(r++))}return i},t.prototype.parseStringBMP=function(t,e){for(var i,r,n="",s=t;s<e;)i=this.get(s++),r=this.get(s++),n+=String.fromCharCode(i<<8|r);return n},t.prototype.parseTime=function(t,e,i){var r=this.parseStringISO(t,e),n=(i?T:S).exec(r);return n?(i&&(n[1]=+n[1],n[1]+=+n[1]<70?2e3:1900),r=n[1]+"-"+n[2]+"-"+n[3]+" "+n[4],n[5]&&(r+=":"+n[5],n[6]&&(r+=":"+n[6],n[7]&&(r+="."+n[7]))),n[8]&&(r+=" UTC","Z"!=n[8]&&(r+=n[8],n[9]&&(r+=":"+n[9]))),r):"Unrecognized time: "+r},t.prototype.parseInteger=function(t,e){for(var i,r=this.get(t),n=r>127,s=n?255:0,o="";r==s&&++t<e;)r=this.get(t);if(0==(i=e-t))return n?-1:0;if(i>4){for(o=r,i<<=3;0==(128&(+o^s));)o=+o<<1,--i;o="("+i+" bit)\n"}n&&(r-=256);for(var h=new y(r),a=t+1;a<e;++a)h.mulAdd(256,this.get(a));return o+h.toString()},t.prototype.parseBitString=function(t,e,i){for(var r=this.get(t),n="("+((e-t-1<<3)-r)+" bit)\n",s="",o=t+1;o<e;++o){for(var h=this.get(o),a=o==e-1?r:0,u=7;u>=a;--u)s+=h>>u&1?"1":"0";if(s.length>i)return n+E(s,i)}return n+s},t.prototype.parseOctetString=function(t,e,i){if(this.isASCII(t,e))return E(this.parseStringISO(t,e),i);var r=e-t,n="("+r+" byte)\n";r>(i/=2)&&(e=t+i);for(var s=t;s<e;++s)n+=this.hexByte(this.get(s));return r>i&&(n+=b),n},t.prototype.parseOID=function(t,e,i){for(var r="",n=new y,s=0,o=t;o<e;++o){var h=this.get(o);if(n.mulAdd(128,127&h),s+=7,!(128&h)){if(""===r)if((n=n.simplify())instanceof y)n.sub(80),r="2."+n.toString();else{var a=n<80?n<40?0:1:2;r=a+"."+(n-40*a)}else r+="."+n.toString();if(r.length>i)return E(r,i);n=new y,s=0}}return s>0&&(r+=".incomplete"),r},t}(),x=function(){function t(t,e,i,r,n){if(!(r instanceof R))throw new Error("Invalid tag value.");this.stream=t,this.header=e,this.length=i,this.tag=r,this.sub=n}return t.prototype.typeName=function(){switch(this.tag.tagClass){case 0:switch(this.tag.tagNumber){case 0:return"EOC";case 1:return"BOOLEAN";case 2:return"INTEGER";case 3:return"BIT_STRING";case 4:return"OCTET_STRING";case 5:return"NULL";case 6:return"OBJECT_IDENTIFIER";case 7:return"ObjectDescriptor";case 8:return"EXTERNAL";case 9:return"REAL";case 10:return"ENUMERATED";case 11:return"EMBEDDED_PDV";case 12:return"UTF8String";case 16:return"SEQUENCE";case 17:return"SET";case 18:return"NumericString";case 19:return"PrintableString";case 20:return"TeletexString";case 21:return"VideotexString";case 22:return"IA5String";case 23:return"UTCTime";case 24:return"GeneralizedTime";case 25:return"GraphicString";case 26:return"VisibleString";case 27:return"GeneralString";case 28:return"UniversalString";case 30:return"BMPString"}return"Universal_"+this.tag.tagNumber.toString();case 1:return"Application_"+this.tag.tagNumber.toString();case 2:return"["+this.tag.tagNumber.toString()+"]";case 3:return"Private_"+this.tag.tagNumber.toString()}},t.prototype.content=function(t){if(void 0===this.tag)return null;void 0===t&&(t=1/0);var e=this.posContent(),i=Math.abs(this.length);if(!this.tag.isUniversal())return null!==this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(e,e+i,t);switch(this.tag.tagNumber){case 1:return 0===this.stream.get(e)?"false":"true";case 2:return this.stream.parseInteger(e,e+i);case 3:return this.sub?"("+this.sub.length+" elem)":this.stream.parseBitString(e,e+i,t);case 4:return this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(e,e+i,t);case 6:return this.stream.parseOID(e,e+i,t);case 16:case 17:return null!==this.sub?"("+this.sub.length+" elem)":"(no elem)";case 12:return E(this.stream.parseStringUTF(e,e+i),t);case 18:case 19:case 20:case 21:case 22:case 26:return E(this.stream.parseStringISO(e,e+i),t);case 30:return E(this.stream.parseStringBMP(e,e+i),t);case 23:case 24:return this.stream.parseTime(e,e+i,23==this.tag.tagNumber)}return null},t.prototype.toString=function(){return this.typeName()+"@"+this.stream.pos+"[header:"+this.header+",length:"+this.length+",sub:"+(null===this.sub?"null":this.sub.length)+"]"},t.prototype.toPrettyString=function(t){void 0===t&&(t="");var e=t+this.typeName()+" @"+this.stream.pos;if(this.length>=0&&(e+="+"),e+=this.length,this.tag.tagConstructed?e+=" (constructed)":!this.tag.isUniversal()||3!=this.tag.tagNumber&&4!=this.tag.tagNumber||null===this.sub||(e+=" (encapsulates)"),e+="\n",null!==this.sub){t+=" ";for(var i=0,r=this.sub.length;i<r;++i)e+=this.sub[i].toPrettyString(t)}return e},t.prototype.posStart=function(){return this.stream.pos},t.prototype.posContent=function(){return this.stream.pos+this.header},t.prototype.posEnd=function(){return this.stream.pos+this.header+Math.abs(this.length)},t.prototype.toHexString=function(){return this.stream.hexDump(this.posStart(),this.posEnd(),!0)},t.decodeLength=function(t){var e=t.get(),i=127&e;if(i==e)return i;if(i>6)throw new Error("Length over 48 bits not supported at position "+(t.pos-1));if(0===i)return null;e=0;for(var r=0;r<i;++r)e=256*e+t.get();return e},t.prototype.getHexStringValue=function(){var t=this.toHexString(),e=2*this.header,i=2*this.length;return t.substr(e,i)},t.decode=function(e){var i;i=e instanceof D?e:new D(e,0);var r=new D(i),n=new R(i),s=t.decodeLength(i),o=i.pos,h=o-r.pos,a=null,u=function(){var e=[];if(null!==s){for(var r=o+s;i.pos<r;)e[e.length]=t.decode(i);if(i.pos!=r)throw new Error("Content size is not correct for container starting at offset "+o)}else try{for(;;){var n=t.decode(i);if(n.tag.isEOC())break;e[e.length]=n}s=o-i.pos}catch(t){throw new Error("Exception while decoding undefined length content: "+t)}return e};if(n.tagConstructed)a=u();else if(n.isUniversal()&&(3==n.tagNumber||4==n.tagNumber))try{if(3==n.tagNumber&&0!=i.get())throw new Error("BIT STRINGs with unused bits cannot encapsulate.");a=u();for(var c=0;c<a.length;++c)if(a[c].tag.isEOC())throw new Error("EOC is not supposed to be actual content.")}catch(t){a=null}if(null===a){if(null===s)throw new Error("We can't skip over an invalid tag with undefined length at offset "+o);i.pos=o+Math.abs(s)}return new t(r,h,s,n,a)},t}(),R=function(){function t(t){var e=t.get();if(this.tagClass=e>>6,this.tagConstructed=0!=(32&e),this.tagNumber=31&e,31==this.tagNumber){var i=new y;do{e=t.get(),i.mulAdd(128,127&e)}while(128&e);this.tagNumber=i.simplify()}}return t.prototype.isUniversal=function(){return 0===this.tagClass},t.prototype.isEOC=function(){return 0===this.tagClass&&0===this.tagNumber},t}(),B=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],O=(1<<26)/B[B.length-1],A=function(){function t(t,e,i){null!=t&&("number"==typeof t?this.fromNumber(t,e,i):null==e&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,e))}return t.prototype.toString=function(t){if(this.s<0)return"-"+this.negate().toString(t);var i;if(16==t)i=4;else if(8==t)i=3;else if(2==t)i=1;else if(32==t)i=5;else{if(4!=t)return this.toRadix(t);i=2}var r,n=(1<<i)-1,s=!1,o="",h=this.t,a=this.DB-h*this.DB%i;if(h-- >0)for(a<this.DB&&(r=this[h]>>a)>0&&(s=!0,o=e(r));h>=0;)a<i?(r=(this[h]&(1<<a)-1)<<i-a,r|=this[--h]>>(a+=this.DB-i)):(r=this[h]>>(a-=i)&n,a<=0&&(a+=this.DB,--h)),r>0&&(s=!0),s&&(o+=e(r));return s?o:"0"},t.prototype.negate=function(){var e=M();return t.ZERO.subTo(this,e),e},t.prototype.abs=function(){return this.s<0?this.negate():this},t.prototype.compareTo=function(t){var e=this.s-t.s;if(0!=e)return e;var i=this.t;if(0!=(e=i-t.t))return this.s<0?-e:e;for(;--i>=0;)if(0!=(e=this[i]-t[i]))return e;return 0},t.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+K(this[this.t-1]^this.s&this.DM)},t.prototype.mod=function(e){var i=M();return this.abs().divRemTo(e,null,i),this.s<0&&i.compareTo(t.ZERO)>0&&e.subTo(i,i),i},t.prototype.modPowInt=function(t,e){var i;return i=t<256||e.isEven()?new I(e):new N(e),this.exp(t,i)},t.prototype.clone=function(){var t=M();return this.copyTo(t),t},t.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},t.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},t.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},t.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},t.prototype.toByteArray=function(){var t=this.t,e=[];e[0]=this.s;var i,r=this.DB-t*this.DB%8,n=0;if(t-- >0)for(r<this.DB&&(i=this[t]>>r)!=(this.s&this.DM)>>r&&(e[n++]=i|this.s<<this.DB-r);t>=0;)r<8?(i=(this[t]&(1<<r)-1)<<8-r,i|=this[--t]>>(r+=this.DB-8)):(i=this[t]>>(r-=8)&255,r<=0&&(r+=this.DB,--t)),0!=(128&i)&&(i|=-256),0==n&&(128&this.s)!=(128&i)&&++n,(n>0||i!=this.s)&&(e[n++]=i);return e},t.prototype.equals=function(t){return 0==this.compareTo(t)},t.prototype.min=function(t){return this.compareTo(t)<0?this:t},t.prototype.max=function(t){return this.compareTo(t)>0?this:t},t.prototype.and=function(t){var e=M();return this.bitwiseTo(t,n,e),e},t.prototype.or=function(t){var e=M();return this.bitwiseTo(t,s,e),e},t.prototype.xor=function(t){var e=M();return this.bitwiseTo(t,o,e),e},t.prototype.andNot=function(t){var e=M();return this.bitwiseTo(t,h,e),e},t.prototype.not=function(){for(var t=M(),e=0;e<this.t;++e)t[e]=this.DM&~this[e];return t.t=this.t,t.s=~this.s,t},t.prototype.shiftLeft=function(t){var e=M();return t<0?this.rShiftTo(-t,e):this.lShiftTo(t,e),e},t.prototype.shiftRight=function(t){var e=M();return t<0?this.lShiftTo(-t,e):this.rShiftTo(t,e),e},t.prototype.getLowestSetBit=function(){for(var t=0;t<this.t;++t)if(0!=this[t])return t*this.DB+a(this[t]);return this.s<0?this.t*this.DB:-1},t.prototype.bitCount=function(){for(var t=0,e=this.s&this.DM,i=0;i<this.t;++i)t+=u(this[i]^e);return t},t.prototype.testBit=function(t){var e=Math.floor(t/this.DB);return e>=this.t?0!=this.s:0!=(this[e]&1<<t%this.DB)},t.prototype.setBit=function(t){return this.changeBit(t,s)},t.prototype.clearBit=function(t){return this.changeBit(t,h)},t.prototype.flipBit=function(t){return this.changeBit(t,o)},t.prototype.add=function(t){var e=M();return this.addTo(t,e),e},t.prototype.subtract=function(t){var e=M();return this.subTo(t,e),e},t.prototype.multiply=function(t){var e=M();return this.multiplyTo(t,e),e},t.prototype.divide=function(t){var e=M();return this.divRemTo(t,e,null),e},t.prototype.remainder=function(t){var e=M();return this.divRemTo(t,null,e),e},t.prototype.divideAndRemainder=function(t){var e=M(),i=M();return this.divRemTo(t,e,i),[e,i]},t.prototype.modPow=function(t,e){var i,r,n=t.bitLength(),s=U(1);if(n<=0)return s;i=n<18?1:n<48?3:n<144?4:n<768?5:6,r=n<8?new I(e):e.isEven()?new P(e):new N(e);var o=[],h=3,a=i-1,u=(1<<i)-1;if(o[1]=r.convert(this),i>1){var c=M();for(r.sqrTo(o[1],c);h<=u;)o[h]=M(),r.mulTo(c,o[h-2],o[h]),h+=2}var f,l,p=t.t-1,g=!0,d=M();for(n=K(t[p])-1;p>=0;){for(n>=a?f=t[p]>>n-a&u:(f=(t[p]&(1<<n+1)-1)<<a-n,p>0&&(f|=t[p-1]>>this.DB+n-a)),h=i;0==(1&f);)f>>=1,--h;if((n-=h)<0&&(n+=this.DB,--p),g)o[f].copyTo(s),g=!1;else{for(;h>1;)r.sqrTo(s,d),r.sqrTo(d,s),h-=2;h>0?r.sqrTo(s,d):(l=s,s=d,d=l),r.mulTo(d,o[f],s)}for(;p>=0&&0==(t[p]&1<<n);)r.sqrTo(s,d),l=s,s=d,d=l,--n<0&&(n=this.DB-1,--p)}return r.revert(s)},t.prototype.modInverse=function(e){var i=e.isEven();if(this.isEven()&&i||0==e.signum())return t.ZERO;for(var r=e.clone(),n=this.clone(),s=U(1),o=U(0),h=U(0),a=U(1);0!=r.signum();){for(;r.isEven();)r.rShiftTo(1,r),i?(s.isEven()&&o.isEven()||(s.addTo(this,s),o.subTo(e,o)),s.rShiftTo(1,s)):o.isEven()||o.subTo(e,o),o.rShiftTo(1,o);for(;n.isEven();)n.rShiftTo(1,n),i?(h.isEven()&&a.isEven()||(h.addTo(this,h),a.subTo(e,a)),h.rShiftTo(1,h)):a.isEven()||a.subTo(e,a),a.rShiftTo(1,a);r.compareTo(n)>=0?(r.subTo(n,r),i&&s.subTo(h,s),o.subTo(a,o)):(n.subTo(r,n),i&&h.subTo(s,h),a.subTo(o,a))}return 0!=n.compareTo(t.ONE)?t.ZERO:a.compareTo(e)>=0?a.subtract(e):a.signum()<0?(a.addTo(e,a),a.signum()<0?a.add(e):a):a},t.prototype.pow=function(t){return this.exp(t,new V)},t.prototype.gcd=function(t){var e=this.s<0?this.negate():this.clone(),i=t.s<0?t.negate():t.clone();if(e.compareTo(i)<0){var r=e;e=i,i=r}var n=e.getLowestSetBit(),s=i.getLowestSetBit();if(s<0)return e;for(n<s&&(s=n),s>0&&(e.rShiftTo(s,e),i.rShiftTo(s,i));e.signum()>0;)(n=e.getLowestSetBit())>0&&e.rShiftTo(n,e),(n=i.getLowestSetBit())>0&&i.rShiftTo(n,i),e.compareTo(i)>=0?(e.subTo(i,e),e.rShiftTo(1,e)):(i.subTo(e,i),i.rShiftTo(1,i));return s>0&&i.lShiftTo(s,i),i},t.prototype.isProbablePrime=function(t){var e,i=this.abs();if(1==i.t&&i[0]<=B[B.length-1]){for(e=0;e<B.length;++e)if(i[0]==B[e])return!0;return!1}if(i.isEven())return!1;for(e=1;e<B.length;){for(var r=B[e],n=e+1;n<B.length&&r<O;)r*=B[n++];for(r=i.modInt(r);e<n;)if(r%B[e++]==0)return!1}return i.millerRabin(t)},t.prototype.copyTo=function(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s},t.prototype.fromInt=function(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0},t.prototype.fromString=function(e,i){var r;if(16==i)r=4;else if(8==i)r=3;else if(256==i)r=8;else if(2==i)r=1;else if(32==i)r=5;else{if(4!=i)return void this.fromRadix(e,i);r=2}this.t=0,this.s=0;for(var n=e.length,s=!1,o=0;--n>=0;){var h=8==r?255&+e[n]:F(e,n);h<0?"-"==e.charAt(n)&&(s=!0):(s=!1,0==o?this[this.t++]=h:o+r>this.DB?(this[this.t-1]|=(h&(1<<this.DB-o)-1)<<o,this[this.t++]=h>>this.DB-o):this[this.t-1]|=h<<o,(o+=r)>=this.DB&&(o-=this.DB))}8==r&&0!=(128&+e[0])&&(this.s=-1,o>0&&(this[this.t-1]|=(1<<this.DB-o)-1<<o)),this.clamp(),s&&t.ZERO.subTo(this,this)},t.prototype.clamp=function(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t},t.prototype.dlShiftTo=function(t,e){var i;for(i=this.t-1;i>=0;--i)e[i+t]=this[i];for(i=t-1;i>=0;--i)e[i]=0;e.t=this.t+t,e.s=this.s},t.prototype.drShiftTo=function(t,e){for(var i=t;i<this.t;++i)e[i-t]=this[i];e.t=Math.max(this.t-t,0),e.s=this.s},t.prototype.lShiftTo=function(t,e){for(var i=t%this.DB,r=this.DB-i,n=(1<<r)-1,s=Math.floor(t/this.DB),o=this.s<<i&this.DM,h=this.t-1;h>=0;--h)e[h+s+1]=this[h]>>r|o,o=(this[h]&n)<<i;for(h=s-1;h>=0;--h)e[h]=0;e[s]=o,e.t=this.t+s+1,e.s=this.s,e.clamp()},t.prototype.rShiftTo=function(t,e){e.s=this.s;var i=Math.floor(t/this.DB);if(i>=this.t)e.t=0;else{var r=t%this.DB,n=this.DB-r,s=(1<<r)-1;e[0]=this[i]>>r;for(var o=i+1;o<this.t;++o)e[o-i-1]|=(this[o]&s)<<n,e[o-i]=this[o]>>r;r>0&&(e[this.t-i-1]|=(this.s&s)<<n),e.t=this.t-i,e.clamp()}},t.prototype.subTo=function(t,e){for(var i=0,r=0,n=Math.min(t.t,this.t);i<n;)r+=this[i]-t[i],e[i++]=r&this.DM,r>>=this.DB;if(t.t<this.t){for(r-=t.s;i<this.t;)r+=this[i],e[i++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;i<t.t;)r-=t[i],e[i++]=r&this.DM,r>>=this.DB;r-=t.s}e.s=r<0?-1:0,r<-1?e[i++]=this.DV+r:r>0&&(e[i++]=r),e.t=i,e.clamp()},t.prototype.multiplyTo=function(e,i){var r=this.abs(),n=e.abs(),s=r.t;for(i.t=s+n.t;--s>=0;)i[s]=0;for(s=0;s<n.t;++s)i[s+r.t]=r.am(0,n[s],i,s,0,r.t);i.s=0,i.clamp(),this.s!=e.s&&t.ZERO.subTo(i,i)},t.prototype.squareTo=function(t){for(var e=this.abs(),i=t.t=2*e.t;--i>=0;)t[i]=0;for(i=0;i<e.t-1;++i){var r=e.am(i,e[i],t,2*i,0,1);(t[i+e.t]+=e.am(i+1,2*e[i],t,2*i+1,r,e.t-i-1))>=e.DV&&(t[i+e.t]-=e.DV,t[i+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(i,e[i],t,2*i,0,1)),t.s=0,t.clamp()},t.prototype.divRemTo=function(e,i,r){var n=e.abs();if(!(n.t<=0)){var s=this.abs();if(s.t<n.t)return null!=i&&i.fromInt(0),void(null!=r&&this.copyTo(r));null==r&&(r=M());var o=M(),h=this.s,a=e.s,u=this.DB-K(n[n.t-1]);u>0?(n.lShiftTo(u,o),s.lShiftTo(u,r)):(n.copyTo(o),s.copyTo(r));var c=o.t,f=o[c-1];if(0!=f){var l=f*(1<<this.F1)+(c>1?o[c-2]>>this.F2:0),p=this.FV/l,g=(1<<this.F1)/l,d=1<<this.F2,v=r.t,m=v-c,y=null==i?M():i;for(o.dlShiftTo(m,y),r.compareTo(y)>=0&&(r[r.t++]=1,r.subTo(y,r)),t.ONE.dlShiftTo(c,y),y.subTo(o,o);o.t<c;)o[o.t++]=0;for(;--m>=0;){var b=r[--v]==f?this.DM:Math.floor(r[v]*p+(r[v-1]+d)*g);if((r[v]+=o.am(0,b,r,m,0,c))<b)for(o.dlShiftTo(m,y),r.subTo(y,r);r[v]<--b;)r.subTo(y,r)}null!=i&&(r.drShiftTo(c,i),h!=a&&t.ZERO.subTo(i,i)),r.t=c,r.clamp(),u>0&&r.rShiftTo(u,r),h<0&&t.ZERO.subTo(r,r)}}},t.prototype.invDigit=function(){if(this.t<1)return 0;var t=this[0];if(0==(1&t))return 0;var e=3&t;return(e=(e=(e=(e=e*(2-(15&t)*e)&15)*(2-(255&t)*e)&255)*(2-((65535&t)*e&65535))&65535)*(2-t*e%this.DV)%this.DV)>0?this.DV-e:-e},t.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},t.prototype.exp=function(e,i){if(e>4294967295||e<1)return t.ONE;var r=M(),n=M(),s=i.convert(this),o=K(e)-1;for(s.copyTo(r);--o>=0;)if(i.sqrTo(r,n),(e&1<<o)>0)i.mulTo(n,s,r);else{var h=r;r=n,n=h}return i.revert(r)},t.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},t.prototype.toRadix=function(t){if(null==t&&(t=10),0==this.signum()||t<2||t>36)return"0";var e=this.chunkSize(t),i=Math.pow(t,e),r=U(i),n=M(),s=M(),o="";for(this.divRemTo(r,n,s);n.signum()>0;)o=(i+s.intValue()).toString(t).substr(1)+o,n.divRemTo(r,n,s);return s.intValue().toString(t)+o},t.prototype.fromRadix=function(e,i){this.fromInt(0),null==i&&(i=10);for(var r=this.chunkSize(i),n=Math.pow(i,r),s=!1,o=0,h=0,a=0;a<e.length;++a){var u=F(e,a);u<0?"-"==e.charAt(a)&&0==this.signum()&&(s=!0):(h=i*h+u,++o>=r&&(this.dMultiply(n),this.dAddOffset(h,0),o=0,h=0))}o>0&&(this.dMultiply(Math.pow(i,o)),this.dAddOffset(h,0)),s&&t.ZERO.subTo(this,this)},t.prototype.fromNumber=function(e,i,r){if("number"==typeof i)if(e<2)this.fromInt(1);else for(this.fromNumber(e,r),this.testBit(e-1)||this.bitwiseTo(t.ONE.shiftLeft(e-1),s,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(i);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(t.ONE.shiftLeft(e-1),this);else{var n=[],o=7&e;n.length=1+(e>>3),i.nextBytes(n),o>0?n[0]&=(1<<o)-1:n[0]=0,this.fromString(n,256)}},t.prototype.bitwiseTo=function(t,e,i){var r,n,s=Math.min(t.t,this.t);for(r=0;r<s;++r)i[r]=e(this[r],t[r]);if(t.t<this.t){for(n=t.s&this.DM,r=s;r<this.t;++r)i[r]=e(this[r],n);i.t=this.t}else{for(n=this.s&this.DM,r=s;r<t.t;++r)i[r]=e(n,t[r]);i.t=t.t}i.s=e(this.s,t.s),i.clamp()},t.prototype.changeBit=function(e,i){var r=t.ONE.shiftLeft(e);return this.bitwiseTo(r,i,r),r},t.prototype.addTo=function(t,e){for(var i=0,r=0,n=Math.min(t.t,this.t);i<n;)r+=this[i]+t[i],e[i++]=r&this.DM,r>>=this.DB;if(t.t<this.t){for(r+=t.s;i<this.t;)r+=this[i],e[i++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;i<t.t;)r+=t[i],e[i++]=r&this.DM,r>>=this.DB;r+=t.s}e.s=r<0?-1:0,r>0?e[i++]=r:r<-1&&(e[i++]=this.DV+r),e.t=i,e.clamp()},t.prototype.dMultiply=function(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},t.prototype.dAddOffset=function(t,e){if(0!=t){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=t;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}},t.prototype.multiplyLowerTo=function(t,e,i){var r=Math.min(this.t+t.t,e);for(i.s=0,i.t=r;r>0;)i[--r]=0;for(var n=i.t-this.t;r<n;++r)i[r+this.t]=this.am(0,t[r],i,r,0,this.t);for(n=Math.min(t.t,e);r<n;++r)this.am(0,t[r],i,r,0,e-r);i.clamp()},t.prototype.multiplyUpperTo=function(t,e,i){--e;var r=i.t=this.t+t.t-e;for(i.s=0;--r>=0;)i[r]=0;for(r=Math.max(e-this.t,0);r<t.t;++r)i[this.t+r-e]=this.am(e-r,t[r],i,0,0,this.t+r-e);i.clamp(),i.drShiftTo(1,i)},t.prototype.modInt=function(t){if(t<=0)return 0;var e=this.DV%t,i=this.s<0?t-1:0;if(this.t>0)if(0==e)i=this[0]%t;else for(var r=this.t-1;r>=0;--r)i=(e*i+this[r])%t;return i},t.prototype.millerRabin=function(e){var i=this.subtract(t.ONE),r=i.getLowestSetBit();if(r<=0)return!1;var n=i.shiftRight(r);(e=e+1>>1)>B.length&&(e=B.length);for(var s=M(),o=0;o<e;++o){s.fromInt(B[Math.floor(Math.random()*B.length)]);var h=s.modPow(n,this);if(0!=h.compareTo(t.ONE)&&0!=h.compareTo(i)){for(var a=1;a++<r&&0!=h.compareTo(i);)if(0==(h=h.modPowInt(2,this)).compareTo(t.ONE))return!1;if(0!=h.compareTo(i))return!1}}return!0},t.prototype.square=function(){var t=M();return this.squareTo(t),t},t.prototype.gcda=function(t,e){var i=this.s<0?this.negate():this.clone(),r=t.s<0?t.negate():t.clone();if(i.compareTo(r)<0){var n=i;i=r,r=n}var s=i.getLowestSetBit(),o=r.getLowestSetBit();if(o<0)e(i);else{s<o&&(o=s),o>0&&(i.rShiftTo(o,i),r.rShiftTo(o,r));var h=function(){(s=i.getLowestSetBit())>0&&i.rShiftTo(s,i),(s=r.getLowestSetBit())>0&&r.rShiftTo(s,r),i.compareTo(r)>=0?(i.subTo(r,i),i.rShiftTo(1,i)):(r.subTo(i,r),r.rShiftTo(1,r)),i.signum()>0?setTimeout(h,0):(o>0&&r.lShiftTo(o,r),setTimeout((function(){e(r)}),0))};setTimeout(h,10)}},t.prototype.fromNumberAsync=function(e,i,r,n){if("number"==typeof i)if(e<2)this.fromInt(1);else{this.fromNumber(e,r),this.testBit(e-1)||this.bitwiseTo(t.ONE.shiftLeft(e-1),s,this),this.isEven()&&this.dAddOffset(1,0);var o=this,h=function(){o.dAddOffset(2,0),o.bitLength()>e&&o.subTo(t.ONE.shiftLeft(e-1),o),o.isProbablePrime(i)?setTimeout((function(){n()}),0):setTimeout(h,0)};setTimeout(h,0)}else{var a=[],u=7&e;a.length=1+(e>>3),i.nextBytes(a),u>0?a[0]&=(1<<u)-1:a[0]=0,this.fromString(a,256)}},t}(),V=function(){function t(){}return t.prototype.convert=function(t){return t},t.prototype.revert=function(t){return t},t.prototype.mulTo=function(t,e,i){t.multiplyTo(e,i)},t.prototype.sqrTo=function(t,e){t.squareTo(e)},t}(),I=function(){function t(t){this.m=t}return t.prototype.convert=function(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t},t.prototype.revert=function(t){return t},t.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},t.prototype.mulTo=function(t,e,i){t.multiplyTo(e,i),this.reduce(i)},t.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},t}(),N=function(){function t(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}return t.prototype.convert=function(t){var e=M();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(A.ZERO)>0&&this.m.subTo(e,e),e},t.prototype.revert=function(t){var e=M();return t.copyTo(e),this.reduce(e),e},t.prototype.reduce=function(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e<this.m.t;++e){var i=32767&t[e],r=i*this.mpl+((i*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(t[i=e+this.m.t]+=this.m.am(0,r,t,e,0,this.m.t);t[i]>=t.DV;)t[i]-=t.DV,t[++i]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)},t.prototype.mulTo=function(t,e,i){t.multiplyTo(e,i),this.reduce(i)},t.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},t}(),P=function(){function t(t){this.m=t,this.r2=M(),this.q3=M(),A.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t)}return t.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=M();return t.copyTo(e),this.reduce(e),e},t.prototype.revert=function(t){return t},t.prototype.reduce=function(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)},t.prototype.mulTo=function(t,e,i){t.multiplyTo(e,i),this.reduce(i)},t.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},t}();function M(){return new A(null)}function L(t,e){return new A(t,e)}var j="undefined"!=typeof navigator;j&&"Microsoft Internet Explorer"==navigator.appName?(A.prototype.am=function(t,e,i,r,n,s){for(var o=32767&e,h=e>>15;--s>=0;){var a=32767&this[t],u=this[t++]>>15,c=h*a+u*o;n=((a=o*a+((32767&c)<<15)+i[r]+(1073741823&n))>>>30)+(c>>>15)+h*u+(n>>>30),i[r++]=1073741823&a}return n},w=30):j&&"Netscape"!=navigator.appName?(A.prototype.am=function(t,e,i,r,n,s){for(;--s>=0;){var o=e*this[t++]+i[r]+n;n=Math.floor(o/67108864),i[r++]=67108863&o}return n},w=26):(A.prototype.am=function(t,e,i,r,n,s){for(var o=16383&e,h=e>>14;--s>=0;){var a=16383&this[t],u=this[t++]>>14,c=h*a+u*o;n=((a=o*a+((16383&c)<<14)+i[r]+n)>>28)+(c>>14)+h*u,i[r++]=268435455&a}return n},w=28),A.prototype.DB=w,A.prototype.DM=(1<<w)-1,A.prototype.DV=1<<w,A.prototype.FV=Math.pow(2,52),A.prototype.F1=52-w,A.prototype.F2=2*w-52;var q,H,C=[];for(q="0".charCodeAt(0),H=0;H<=9;++H)C[q++]=H;for(q="a".charCodeAt(0),H=10;H<36;++H)C[q++]=H;for(q="A".charCodeAt(0),H=10;H<36;++H)C[q++]=H;function F(t,e){var i=C[t.charCodeAt(e)];return null==i?-1:i}function U(t){var e=M();return e.fromInt(t),e}function K(t){var e,i=1;return 0!=(e=t>>>16)&&(t=e,i+=16),0!=(e=t>>8)&&(t=e,i+=8),0!=(e=t>>4)&&(t=e,i+=4),0!=(e=t>>2)&&(t=e,i+=2),0!=(e=t>>1)&&(t=e,i+=1),i}A.ZERO=U(0),A.ONE=U(1);var k,_,z=function(){function t(){this.i=0,this.j=0,this.S=[]}return t.prototype.init=function(t){var e,i,r;for(e=0;e<256;++e)this.S[e]=e;for(i=0,e=0;e<256;++e)i=i+this.S[e]+t[e%t.length]&255,r=this.S[e],this.S[e]=this.S[i],this.S[i]=r;this.i=0,this.j=0},t.prototype.next=function(){var t;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,t=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=t,this.S[t+this.S[this.i]&255]},t}(),Z=256,G=null;if(null==G){G=[],_=0;var $=void 0;if("undefined"!=typeof window&&window.crypto&&window.crypto.getRandomValues){var Y=new Uint32Array(256);for(window.crypto.getRandomValues(Y),$=0;$<Y.length;++$)G[_++]=255&Y[$]}var J=0,X=function(t){if((J=J||0)>=256||_>=Z)window.removeEventListener?window.removeEventListener("mousemove",X,!1):window.detachEvent&&window.detachEvent("onmousemove",X);else try{var e=t.x+t.y;G[_++]=255&e,J+=1}catch(t){}};"undefined"!=typeof window&&(window.addEventListener?window.addEventListener("mousemove",X,!1):window.attachEvent&&window.attachEvent("onmousemove",X))}function Q(){if(null==k){for(k=new z;_<Z;){var t=Math.floor(65536*Math.random());G[_++]=255&t}for(k.init(G),_=0;_<G.length;++_)G[_]=0;_=0}return k.next()}var W=function(){function t(){}return t.prototype.nextBytes=function(t){for(var e=0;e<t.length;++e)t[e]=Q()},t}(),tt=function(){function t(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}return t.prototype.doPublic=function(t){return t.modPowInt(this.e,this.n)},t.prototype.doPrivate=function(t){if(null==this.p||null==this.q)return t.modPow(this.d,this.n);for(var e=t.mod(this.p).modPow(this.dmp1,this.p),i=t.mod(this.q).modPow(this.dmq1,this.q);e.compareTo(i)<0;)e=e.add(this.p);return e.subtract(i).multiply(this.coeff).mod(this.p).multiply(this.q).add(i)},t.prototype.setPublic=function(t,e){null!=t&&null!=e&&t.length>0&&e.length>0?(this.n=L(t,16),this.e=parseInt(e,16)):console.error("Invalid RSA public key")},t.prototype.encrypt=function(t){var e=this.n.bitLength()+7>>3,i=function(t,e){if(e<t.length+11)return console.error("Message too long for RSA"),null;for(var i=[],r=t.length-1;r>=0&&e>0;){var n=t.charCodeAt(r--);n<128?i[--e]=n:n>127&&n<2048?(i[--e]=63&n|128,i[--e]=n>>6|192):(i[--e]=63&n|128,i[--e]=n>>6&63|128,i[--e]=n>>12|224)}i[--e]=0;for(var s=new W,o=[];e>2;){for(o[0]=0;0==o[0];)s.nextBytes(o);i[--e]=o[0]}return i[--e]=2,i[--e]=0,new A(i)}(t,e);if(null==i)return null;var r=this.doPublic(i);if(null==r)return null;for(var n=r.toString(16),s=n.length,o=0;o<2*e-s;o++)n="0"+n;return n},t.prototype.setPrivate=function(t,e,i){null!=t&&null!=e&&t.length>0&&e.length>0?(this.n=L(t,16),this.e=parseInt(e,16),this.d=L(i,16)):console.error("Invalid RSA private key")},t.prototype.setPrivateEx=function(t,e,i,r,n,s,o,h){null!=t&&null!=e&&t.length>0&&e.length>0?(this.n=L(t,16),this.e=parseInt(e,16),this.d=L(i,16),this.p=L(r,16),this.q=L(n,16),this.dmp1=L(s,16),this.dmq1=L(o,16),this.coeff=L(h,16)):console.error("Invalid RSA private key")},t.prototype.generate=function(t,e){var i=new W,r=t>>1;this.e=parseInt(e,16);for(var n=new A(e,16);;){for(;this.p=new A(t-r,1,i),0!=this.p.subtract(A.ONE).gcd(n).compareTo(A.ONE)||!this.p.isProbablePrime(10););for(;this.q=new A(r,1,i),0!=this.q.subtract(A.ONE).gcd(n).compareTo(A.ONE)||!this.q.isProbablePrime(10););if(this.p.compareTo(this.q)<=0){var s=this.p;this.p=this.q,this.q=s}var o=this.p.subtract(A.ONE),h=this.q.subtract(A.ONE),a=o.multiply(h);if(0==a.gcd(n).compareTo(A.ONE)){this.n=this.p.multiply(this.q),this.d=n.modInverse(a),this.dmp1=this.d.mod(o),this.dmq1=this.d.mod(h),this.coeff=this.q.modInverse(this.p);break}}},t.prototype.decrypt=function(t){var e=L(t,16),i=this.doPrivate(e);return null==i?null:function(t,e){for(var i=t.toByteArray(),r=0;r<i.length&&0==i[r];)++r;if(i.length-r!=e-1||2!=i[r])return null;for(++r;0!=i[r];)if(++r>=i.length)return null;for(var n="";++r<i.length;){var s=255&i[r];s<128?n+=String.fromCharCode(s):s>191&&s<224?(n+=String.fromCharCode((31&s)<<6|63&i[r+1]),++r):(n+=String.fromCharCode((15&s)<<12|(63&i[r+1])<<6|63&i[r+2]),r+=2)}return n}(i,this.n.bitLength()+7>>3)},t.prototype.generateAsync=function(t,e,i){var r=new W,n=t>>1;this.e=parseInt(e,16);var s=new A(e,16),o=this,h=function(){var e=function(){if(o.p.compareTo(o.q)<=0){var t=o.p;o.p=o.q,o.q=t}var e=o.p.subtract(A.ONE),r=o.q.subtract(A.ONE),n=e.multiply(r);0==n.gcd(s).compareTo(A.ONE)?(o.n=o.p.multiply(o.q),o.d=s.modInverse(n),o.dmp1=o.d.mod(e),o.dmq1=o.d.mod(r),o.coeff=o.q.modInverse(o.p),setTimeout((function(){i()}),0)):setTimeout(h,0)},a=function(){o.q=M(),o.q.fromNumberAsync(n,1,r,(function(){o.q.subtract(A.ONE).gcda(s,(function(t){0==t.compareTo(A.ONE)&&o.q.isProbablePrime(10)?setTimeout(e,0):setTimeout(a,0)}))}))},u=function(){o.p=M(),o.p.fromNumberAsync(t-n,1,r,(function(){o.p.subtract(A.ONE).gcda(s,(function(t){0==t.compareTo(A.ONE)&&o.p.isProbablePrime(10)?setTimeout(a,0):setTimeout(u,0)}))}))};setTimeout(u,0)};setTimeout(h,0)},t.prototype.sign=function(t,e,i){var r=function(t,e){if(e<t.length+22)return console.error("Message too long for RSA"),null;for(var i=e-t.length-6,r="",n=0;n<i;n+=2)r+="ff";return L("0001"+r+"00"+t,16)}((et[i]||"")+e(t).toString(),this.n.bitLength()/4);if(null==r)return null;var n=this.doPrivate(r);if(null==n)return null;var s=n.toString(16);return 0==(1&s.length)?s:"0"+s},t.prototype.verify=function(t,e,i){var r=L(e,16),n=this.doPublic(r);return null==n?null:function(t){for(var e in et)if(et.hasOwnProperty(e)){var i=et[e],r=i.length;if(t.substr(0,r)==i)return t.substr(r)}return t}(n.toString(16).replace(/^1f+00/,""))==i(t).toString()},t}(),et={md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",ripemd160:"3021300906052b2403020105000414"},it={};it.lang={extend:function(t,e,i){if(!e||!t)throw new Error("YAHOO.lang.extend failed, please check that all dependencies are included.");var r=function(){};if(r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t,t.superclass=e.prototype,e.prototype.constructor==Object.prototype.constructor&&(e.prototype.constructor=e),i){var n;for(n in i)t.prototype[n]=i[n];var s=function(){},o=["toString","valueOf"];try{/MSIE/.test(navigator.userAgent)&&(s=function(t,e){for(n=0;n<o.length;n+=1){var i=o[n],r=e[i];"function"==typeof r&&r!=Object.prototype[i]&&(t[i]=r)}})}catch(t){}s(t.prototype,i)}}};var rt={};void 0!==rt.asn1&&rt.asn1||(rt.asn1={}),rt.asn1.ASN1Util=new function(){this.integerToByteHex=function(t){var e=t.toString(16);return e.length%2==1&&(e="0"+e),e},this.bigIntToMinTwosComplementsHex=function(t){var e=t.toString(16);if("-"!=e.substr(0,1))e.length%2==1?e="0"+e:e.match(/^[0-7]/)||(e="00"+e);else{var i=e.substr(1).length;i%2==1?i+=1:e.match(/^[0-7]/)||(i+=2);for(var r="",n=0;n<i;n++)r+="f";e=new A(r,16).xor(t).add(A.ONE).toString(16).replace(/^-/,"")}return e},this.getPEMStringFromHex=function(t,e){return hextopem(t,e)},this.newObject=function(t){var e=rt.asn1,i=e.DERBoolean,r=e.DERInteger,n=e.DERBitString,s=e.DEROctetString,o=e.DERNull,h=e.DERObjectIdentifier,a=e.DEREnumerated,u=e.DERUTF8String,c=e.DERNumericString,f=e.DERPrintableString,l=e.DERTeletexString,p=e.DERIA5String,g=e.DERUTCTime,d=e.DERGeneralizedTime,v=e.DERSequence,m=e.DERSet,y=e.DERTaggedObject,b=e.ASN1Util.newObject,T=Object.keys(t);if(1!=T.length)throw"key of param shall be only one.";var S=T[0];if(-1==":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":"+S+":"))throw"undefined key: "+S;if("bool"==S)return new i(t[S]);if("int"==S)return new r(t[S]);if("bitstr"==S)return new n(t[S]);if("octstr"==S)return new s(t[S]);if("null"==S)return new o(t[S]);if("oid"==S)return new h(t[S]);if("enum"==S)return new a(t[S]);if("utf8str"==S)return new u(t[S]);if("numstr"==S)return new c(t[S]);if("prnstr"==S)return new f(t[S]);if("telstr"==S)return new l(t[S]);if("ia5str"==S)return new p(t[S]);if("utctime"==S)return new g(t[S]);if("gentime"==S)return new d(t[S]);if("seq"==S){for(var E=t[S],w=[],D=0;D<E.length;D++){var x=b(E[D]);w.push(x)}return new v({array:w})}if("set"==S){for(E=t[S],w=[],D=0;D<E.length;D++)x=b(E[D]),w.push(x);return new m({array:w})}if("tag"==S){var R=t[S];if("[object Array]"===Object.prototype.toString.call(R)&&3==R.length){var B=b(R[2]);return new y({tag:R[0],explicit:R[1],obj:B})}var O={};if(void 0!==R.explicit&&(O.explicit=R.explicit),void 0!==R.tag&&(O.tag=R.tag),void 0===R.obj)throw"obj shall be specified for 'tag'.";return O.obj=b(R.obj),new y(O)}},this.jsonToASN1HEX=function(t){return this.newObject(t).getEncodedHex()}},rt.asn1.ASN1Util.oidHexToInt=function(t){for(var e="",i=parseInt(t.substr(0,2),16),r=(e=Math.floor(i/40)+"."+i%40,""),n=2;n<t.length;n+=2){var s=("00000000"+parseInt(t.substr(n,2),16).toString(2)).slice(-8);r+=s.substr(1,7),"0"==s.substr(0,1)&&(e=e+"."+new A(r,2).toString(10),r="")}return e},rt.asn1.ASN1Util.oidIntToHex=function(t){var e=function(t){var e=t.toString(16);return 1==e.length&&(e="0"+e),e},i=function(t){var i="",r=new A(t,10).toString(2),n=7-r.length%7;7==n&&(n=0);for(var s="",o=0;o<n;o++)s+="0";for(r=s+r,o=0;o<r.length-1;o+=7){var h=r.substr(o,7);o!=r.length-7&&(h="1"+h),i+=e(parseInt(h,2))}return i};if(!t.match(/^[0-9.]+$/))throw"malformed oid string: "+t;var r="",n=t.split("."),s=40*parseInt(n[0])+parseInt(n[1]);r+=e(s),n.splice(0,2);for(var o=0;o<n.length;o++)r+=i(n[o]);return r},rt.asn1.ASN1Object=function(){this.getLengthHexFromValue=function(){if(void 0===this.hV||null==this.hV)throw"this.hV is null or undefined.";if(this.hV.length%2==1)throw"value hex must be even length: n="+"".length+",v="+this.hV;var t=this.hV.length/2,e=t.toString(16);if(e.length%2==1&&(e="0"+e),t<128)return e;var i=e.length/2;if(i>15)throw"ASN.1 length too long to represent by 8x: n = "+t.toString(16);return(128+i).toString(16)+e},this.getEncodedHex=function(){return(null==this.hTLV||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getValueHex=function(){return this.getEncodedHex(),this.hV},this.getFreshValueHex=function(){return""}},rt.asn1.DERAbstractString=function(t){rt.asn1.DERAbstractString.superclass.constructor.call(this),this.getString=function(){return this.s},this.setString=function(t){this.hTLV=null,this.isModified=!0,this.s=t,this.hV=stohex(this.s)},this.setStringHex=function(t){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&("string"==typeof t?this.setString(t):void 0!==t.str?this.setString(t.str):void 0!==t.hex&&this.setStringHex(t.hex))},it.lang.extend(rt.asn1.DERAbstractString,rt.asn1.ASN1Object),rt.asn1.DERAbstractTime=function(t){rt.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(t){return utc=t.getTime()+6e4*t.getTimezoneOffset(),new Date(utc)},this.formatDate=function(t,e,i){var r=this.zeroPadding,n=this.localDateToUTC(t),s=String(n.getFullYear());"utc"==e&&(s=s.substr(2,2));var o=s+r(String(n.getMonth()+1),2)+r(String(n.getDate()),2)+r(String(n.getHours()),2)+r(String(n.getMinutes()),2)+r(String(n.getSeconds()),2);if(!0===i){var h=n.getMilliseconds();if(0!=h){var a=r(String(h),3);o=o+"."+(a=a.replace(/[0]+$/,""))}}return o+"Z"},this.zeroPadding=function(t,e){return t.length>=e?t:new Array(e-t.length+1).join("0")+t},this.getString=function(){return this.s},this.setString=function(t){this.hTLV=null,this.isModified=!0,this.s=t,this.hV=stohex(t)},this.setByDateValue=function(t,e,i,r,n,s){var o=new Date(Date.UTC(t,e-1,i,r,n,s,0));this.setByDate(o)},this.getFreshValueHex=function(){return this.hV}},it.lang.extend(rt.asn1.DERAbstractTime,rt.asn1.ASN1Object),rt.asn1.DERAbstractStructured=function(t){rt.asn1.DERAbstractString.superclass.constructor.call(this),this.setByASN1ObjectArray=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array=t},this.appendASN1Object=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array.push(t)},this.asn1Array=new Array,void 0!==t&&void 0!==t.array&&(this.asn1Array=t.array)},it.lang.extend(rt.asn1.DERAbstractStructured,rt.asn1.ASN1Object),rt.asn1.DERBoolean=function(){rt.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV="0101ff"},it.lang.extend(rt.asn1.DERBoolean,rt.asn1.ASN1Object),rt.asn1.DERInteger=function(t){rt.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=rt.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var e=new A(String(t),10);this.setByBigInteger(e)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&(void 0!==t.bigint?this.setByBigInteger(t.bigint):void 0!==t.int?this.setByInteger(t.int):"number"==typeof t?this.setByInteger(t):void 0!==t.hex&&this.setValueHex(t.hex))},it.lang.extend(rt.asn1.DERInteger,rt.asn1.ASN1Object),rt.asn1.DERBitString=function(t){if(void 0!==t&&void 0!==t.obj){var e=rt.asn1.ASN1Util.newObject(t.obj);t.hex="00"+e.getEncodedHex()}rt.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(t){this.hTLV=null,this.isModified=!0,this.hV=t},this.setUnusedBitsAndHexValue=function(t,e){if(t<0||7<t)throw"unused bits shall be from 0 to 7: u = "+t;var i="0"+t;this.hTLV=null,this.isModified=!0,this.hV=i+e},this.setByBinaryString=function(t){var e=8-(t=t.replace(/0+$/,"")).length%8;8==e&&(e=0);for(var i=0;i<=e;i++)t+="0";var r="";for(i=0;i<t.length-1;i+=8){var n=t.substr(i,8),s=parseInt(n,2).toString(16);1==s.length&&(s="0"+s),r+=s}this.hTLV=null,this.isModified=!0,this.hV="0"+e+r},this.setByBooleanArray=function(t){for(var e="",i=0;i<t.length;i++)1==t[i]?e+="1":e+="0";this.setByBinaryString(e)},this.newFalseArray=function(t){for(var e=new Array(t),i=0;i<t;i++)e[i]=!1;return e},this.getFreshValueHex=function(){return this.hV},void 0!==t&&("string"==typeof t&&t.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(t):void 0!==t.hex?this.setHexValueIncludingUnusedBits(t.hex):void 0!==t.bin?this.setByBinaryString(t.bin):void 0!==t.array&&this.setByBooleanArray(t.array))},it.lang.extend(rt.asn1.DERBitString,rt.asn1.ASN1Object),rt.asn1.DEROctetString=function(t){if(void 0!==t&&void 0!==t.obj){var e=rt.asn1.ASN1Util.newObject(t.obj);t.hex=e.getEncodedHex()}rt.asn1.DEROctetString.superclass.constructor.call(this,t),this.hT="04"},it.lang.extend(rt.asn1.DEROctetString,rt.asn1.DERAbstractString),rt.asn1.DERNull=function(){rt.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},it.lang.extend(rt.asn1.DERNull,rt.asn1.ASN1Object),rt.asn1.DERObjectIdentifier=function(t){var e=function(t){var e=t.toString(16);return 1==e.length&&(e="0"+e),e},i=function(t){var i="",r=new A(t,10).toString(2),n=7-r.length%7;7==n&&(n=0);for(var s="",o=0;o<n;o++)s+="0";for(r=s+r,o=0;o<r.length-1;o+=7){var h=r.substr(o,7);o!=r.length-7&&(h="1"+h),i+=e(parseInt(h,2))}return i};rt.asn1.DERObjectIdentifier.superclass.constructor.call(this),this.hT="06",this.setValueHex=function(t){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.setValueOidString=function(t){if(!t.match(/^[0-9.]+$/))throw"malformed oid string: "+t;var r="",n=t.split("."),s=40*parseInt(n[0])+parseInt(n[1]);r+=e(s),n.splice(0,2);for(var o=0;o<n.length;o++)r+=i(n[o]);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=r},this.setValueName=function(t){var e=rt.asn1.x509.OID.name2oid(t);if(""===e)throw"DERObjectIdentifier oidName undefined: "+t;this.setValueOidString(e)},this.getFreshValueHex=function(){return this.hV},void 0!==t&&("string"==typeof t?t.match(/^[0-2].[0-9.]+$/)?this.setValueOidString(t):this.setValueName(t):void 0!==t.oid?this.setValueOidString(t.oid):void 0!==t.hex?this.setValueHex(t.hex):void 0!==t.name&&this.setValueName(t.name))},it.lang.extend(rt.asn1.DERObjectIdentifier,rt.asn1.ASN1Object),rt.asn1.DEREnumerated=function(t){rt.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=rt.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var e=new A(String(t),10);this.setByBigInteger(e)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&(void 0!==t.int?this.setByInteger(t.int):"number"==typeof t?this.setByInteger(t):void 0!==t.hex&&this.setValueHex(t.hex))},it.lang.extend(rt.asn1.DEREnumerated,rt.asn1.ASN1Object),rt.asn1.DERUTF8String=function(t){rt.asn1.DERUTF8String.superclass.constructor.call(this,t),this.hT="0c"},it.lang.extend(rt.asn1.DERUTF8String,rt.asn1.DERAbstractString),rt.asn1.DERNumericString=function(t){rt.asn1.DERNumericString.superclass.constructor.call(this,t),this.hT="12"},it.lang.extend(rt.asn1.DERNumericString,rt.asn1.DERAbstractString),rt.asn1.DERPrintableString=function(t){rt.asn1.DERPrintableString.superclass.constructor.call(this,t),this.hT="13"},it.lang.extend(rt.asn1.DERPrintableString,rt.asn1.DERAbstractString),rt.asn1.DERTeletexString=function(t){rt.asn1.DERTeletexString.superclass.constructor.call(this,t),this.hT="14"},it.lang.extend(rt.asn1.DERTeletexString,rt.asn1.DERAbstractString),rt.asn1.DERIA5String=function(t){rt.asn1.DERIA5String.superclass.constructor.call(this,t),this.hT="16"},it.lang.extend(rt.asn1.DERIA5String,rt.asn1.DERAbstractString),rt.asn1.DERUTCTime=function(t){rt.asn1.DERUTCTime.superclass.constructor.call(this,t),this.hT="17",this.setByDate=function(t){this.hTLV=null,this.isModified=!0,this.date=t,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)},this.getFreshValueHex=function(){return void 0===this.date&&void 0===this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)),this.hV},void 0!==t&&(void 0!==t.str?this.setString(t.str):"string"==typeof t&&t.match(/^[0-9]{12}Z$/)?this.setString(t):void 0!==t.hex?this.setStringHex(t.hex):void 0!==t.date&&this.setByDate(t.date))},it.lang.extend(rt.asn1.DERUTCTime,rt.asn1.DERAbstractTime),rt.asn1.DERGeneralizedTime=function(t){rt.asn1.DERGeneralizedTime.superclass.constructor.call(this,t),this.hT="18",this.withMillis=!1,this.setByDate=function(t){this.hTLV=null,this.isModified=!0,this.date=t,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)},this.getFreshValueHex=function(){return void 0===this.date&&void 0===this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)),this.hV},void 0!==t&&(void 0!==t.str?this.setString(t.str):"string"==typeof t&&t.match(/^[0-9]{14}Z$/)?this.setString(t):void 0!==t.hex?this.setStringHex(t.hex):void 0!==t.date&&this.setByDate(t.date),!0===t.millis&&(this.withMillis=!0))},it.lang.extend(rt.asn1.DERGeneralizedTime,rt.asn1.DERAbstractTime),rt.asn1.DERSequence=function(t){rt.asn1.DERSequence.superclass.constructor.call(this,t),this.hT="30",this.getFreshValueHex=function(){for(var t="",e=0;e<this.asn1Array.length;e++)t+=this.asn1Array[e].getEncodedHex();return this.hV=t,this.hV}},it.lang.extend(rt.asn1.DERSequence,rt.asn1.DERAbstractStructured),rt.asn1.DERSet=function(t){rt.asn1.DERSet.superclass.constructor.call(this,t),this.hT="31",this.sortFlag=!0,this.getFreshValueHex=function(){for(var t=new Array,e=0;e<this.asn1Array.length;e++){var i=this.asn1Array[e];t.push(i.getEncodedHex())}return 1==this.sortFlag&&t.sort(),this.hV=t.join(""),this.hV},void 0!==t&&void 0!==t.sortflag&&0==t.sortflag&&(this.sortFlag=!1)},it.lang.extend(rt.asn1.DERSet,rt.asn1.DERAbstractStructured),rt.asn1.DERTaggedObject=function(t){rt.asn1.DERTaggedObject.superclass.constructor.call(this),this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.setASN1Object=function(t,e,i){this.hT=e,this.isExplicit=t,this.asn1Object=i,this.isExplicit?(this.hV=this.asn1Object.getEncodedHex(),this.hTLV=null,this.isModified=!0):(this.hV=null,this.hTLV=i.getEncodedHex(),this.hTLV=this.hTLV.replace(/^../,e),this.isModified=!1)},this.getFreshValueHex=function(){return this.hV},void 0!==t&&(void 0!==t.tag&&(this.hT=t.tag),void 0!==t.explicit&&(this.isExplicit=t.explicit),void 0!==t.obj&&(this.asn1Object=t.obj,this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)))},it.lang.extend(rt.asn1.DERTaggedObject,rt.asn1.ASN1Object);var nt,st,ot=(nt=function(t,e){return nt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},nt(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}nt(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),ht=function(t){function e(i){var r=t.call(this)||this;return i&&("string"==typeof i?r.parseKey(i):(e.hasPrivateKeyProperty(i)||e.hasPublicKeyProperty(i))&&r.parsePropertiesFrom(i)),r}return ot(e,t),e.prototype.parseKey=function(t){try{var e=0,i=0,r=/^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/.test(t)?function(t){var e;if(void 0===c){var i="0123456789ABCDEF",r=" \f\n\r\t聽\u2028\u2029";for(c={},e=0;e<16;++e)c[i.charAt(e)]=e;for(i=i.toLowerCase(),e=10;e<16;++e)c[i.charAt(e)]=e;for(e=0;e<r.length;++e)c[r.charAt(e)]=-1}var n=[],s=0,o=0;for(e=0;e<t.length;++e){var h=t.charAt(e);if("="==h)break;if(-1!=(h=c[h])){if(void 0===h)throw new Error("Illegal character at offset "+e);s|=h,++o>=2?(n[n.length]=s,s=0,o=0):s<<=4}}if(o)throw new Error("Hex encoding incomplete: 4 bits missing");return n}(t):v.unarmor(t),n=x.decode(r);if(3===n.sub.length&&(n=n.sub[2].sub[0]),9===n.sub.length){e=n.sub[1].getHexStringValue(),this.n=L(e,16),i=n.sub[2].getHexStringValue(),this.e=parseInt(i,16);var s=n.sub[3].getHexStringValue();this.d=L(s,16);var o=n.sub[4].getHexStringValue();this.p=L(o,16);var h=n.sub[5].getHexStringValue();this.q=L(h,16);var a=n.sub[6].getHexStringValue();this.dmp1=L(a,16);var u=n.sub[7].getHexStringValue();this.dmq1=L(u,16);var f=n.sub[8].getHexStringValue();this.coeff=L(f,16)}else{if(2!==n.sub.length)return!1;if(n.sub[0].sub){var l=n.sub[1].sub[0];e=l.sub[0].getHexStringValue(),this.n=L(e,16),i=l.sub[1].getHexStringValue(),this.e=parseInt(i,16)}else e=n.sub[0].getHexStringValue(),this.n=L(e,16),i=n.sub[1].getHexStringValue(),this.e=parseInt(i,16)}return!0}catch(t){return!1}},e.prototype.getPrivateBaseKey=function(){var t={array:[new rt.asn1.DERInteger({int:0}),new rt.asn1.DERInteger({bigint:this.n}),new rt.asn1.DERInteger({int:this.e}),new rt.asn1.DERInteger({bigint:this.d}),new rt.asn1.DERInteger({bigint:this.p}),new rt.asn1.DERInteger({bigint:this.q}),new rt.asn1.DERInteger({bigint:this.dmp1}),new rt.asn1.DERInteger({bigint:this.dmq1}),new rt.asn1.DERInteger({bigint:this.coeff})]};return new rt.asn1.DERSequence(t).getEncodedHex()},e.prototype.getPrivateBaseKeyB64=function(){return p(this.getPrivateBaseKey())},e.prototype.getPublicBaseKey=function(){var t=new rt.asn1.DERSequence({array:[new rt.asn1.DERObjectIdentifier({oid:"1.2.840.113549.1.1.1"}),new rt.asn1.DERNull]}),e=new rt.asn1.DERSequence({array:[new rt.asn1.DERInteger({bigint:this.n}),new rt.asn1.DERInteger({int:this.e})]}),i=new rt.asn1.DERBitString({hex:"00"+e.getEncodedHex()});return new rt.asn1.DERSequence({array:[t,i]}).getEncodedHex()},e.prototype.getPublicBaseKeyB64=function(){return p(this.getPublicBaseKey())},e.wordwrap=function(t,e){if(!t)return t;var i="(.{1,"+(e=e||64)+"})( +|$\n?)|(.{1,"+e+"})";return t.match(RegExp(i,"g")).join("\n")},e.prototype.getPrivateKey=function(){var t="-----BEGIN RSA PRIVATE KEY-----\n";return(t+=e.wordwrap(this.getPrivateBaseKeyB64())+"\n")+"-----END RSA PRIVATE KEY-----"},e.prototype.getPublicKey=function(){var t="-----BEGIN PUBLIC KEY-----\n";return(t+=e.wordwrap(this.getPublicBaseKeyB64())+"\n")+"-----END PUBLIC KEY-----"},e.hasPublicKeyProperty=function(t){return(t=t||{}).hasOwnProperty("n")&&t.hasOwnProperty("e")},e.hasPrivateKeyProperty=function(t){return(t=t||{}).hasOwnProperty("n")&&t.hasOwnProperty("e")&&t.hasOwnProperty("d")&&t.hasOwnProperty("p")&&t.hasOwnProperty("q")&&t.hasOwnProperty("dmp1")&&t.hasOwnProperty("dmq1")&&t.hasOwnProperty("coeff")},e.prototype.parsePropertiesFrom=function(t){this.n=t.n,this.e=t.e,t.hasOwnProperty("d")&&(this.d=t.d,this.p=t.p,this.q=t.q,this.dmp1=t.dmp1,this.dmq1=t.dmq1,this.coeff=t.coeff)},e}(tt),at=i(155),ut=void 0!==at?null===(st=at.env)||void 0===st?void 0:"3.3.2":void 0;const ct=function(){function t(t){void 0===t&&(t={}),t=t||{},this.default_key_size=t.default_key_size?parseInt(t.default_key_size,10):1024,this.default_public_exponent=t.default_public_exponent||"010001",this.log=t.log||!1,this.key=null}return t.prototype.setKey=function(t){this.log&&this.key&&console.warn("A key was already set, overriding existing."),this.key=new ht(t)},t.prototype.setPrivateKey=function(t){this.setKey(t)},t.prototype.setPublicKey=function(t){this.setKey(t)},t.prototype.decrypt=function(t){try{return this.getKey().decrypt(g(t))}catch(t){return!1}},t.prototype.encrypt=function(t){try{return p(this.getKey().encrypt(t))}catch(t){return!1}},t.prototype.sign=function(t,e,i){try{return p(this.getKey().sign(t,e,i))}catch(t){return!1}},t.prototype.verify=function(t,e,i){try{return this.getKey().verify(t,g(e),i)}catch(t){return!1}},t.prototype.getKey=function(t){if(!this.key){if(this.key=new ht,t&&"[object Function]"==={}.toString.call(t))return void this.key.generateAsync(this.default_key_size,this.default_public_exponent,t);this.key.generate(this.default_key_size,this.default_public_exponent)}return this.key},t.prototype.getPrivateKey=function(){return this.getKey().getPrivateKey()},t.prototype.getPrivateKeyB64=function(){return this.getKey().getPrivateBaseKeyB64()},t.prototype.getPublicKey=function(){return this.getKey().getPublicKey()},t.prototype.getPublicKeyB64=function(){return this.getKey().getPublicBaseKeyB64()},t.version=ut,t}()})(),r.default})())); \ No newline at end of file diff --git a/src/views/clues/components/Drawer.vue b/src/views/clues/components/Drawer.vue index ec71ae4..b158188 100644 --- a/src/views/clues/components/Drawer.vue +++ b/src/views/clues/components/Drawer.vue @@ -1,8 +1,8 @@ <template> <BasicDrawer - class="basic-drawer-1" + class="clues-detail-drawer" v-bind="$attrs" - title="Basic Drawer" + title="绾跨储璇︽儏" @register="registerDrawer" :maskClosable="false" :keyboard="false" @@ -11,19 +11,19 @@ <template #title> <div class="text-right"> <span> - <Tooltip title="宸插叧娉�"> + <Tooltip v-if="isFollow" title="宸插叧娉�"> <Icon icon="mingcute:heart-fill" - class="mr-15px cursor-pointer" - @click="" + class="mr-15px cursor-pointer c-red-5" + @click="handleCancelFollow" :size="20" /> </Tooltip> - <Tooltip title="鏈叧娉�"> + <Tooltip v-else title="鏈叧娉�"> <Icon icon="mingcute:heart-line" class="mr-15px cursor-pointer" - @click="" + @click="handleFollow" :size="20" /> </Tooltip> @@ -31,7 +31,7 @@ <Icon icon="ri:edit-line" class="mr-15px cursor-pointer" - @click="" + @click="handleEditCluesForm" :size="20" /> <Icon @@ -40,12 +40,26 @@ @click="" :size="20" /> - <Icon - icon="gg:add-r" - class="mr-15px cursor-pointer" - @click="" - :size="20" - /> + <a-dropdown :trigger="['click']"> + <Icon + icon="gg:add-r" + class="mr-15px cursor-pointer" + @click="" + :size="20" + /> + <template #overlay> + <a-menu> + <a-menu-item key="0" @click="handleNewSchedule"> + <span >鏂板缓鏃ョ▼</span> + </a-menu-item> + <a-menu-item key="1" > + <span>杞寲涓哄鎴�</span> + </a-menu-item> + <!-- <a-menu-divider />--> + <a-menu-item key="2">杞寲涓哄凡鏈夊鎴�</a-menu-item> + </a-menu> + </template> + </a-dropdown> <a-dropdown :trigger="['click']"> <Icon icon="ri:more-2-fill" @@ -64,7 +78,10 @@ <!-- <a-menu-divider />--> <a-menu-item key="2">鍚堝苟绾跨储</a-menu-item> <a-menu-item key="3">鏃犳晥</a-menu-item> - <a-menu-item key="4">鍒犻櫎</a-menu-item> + <a-popconfirm title="纭畾鍒犻櫎褰撳墠绾跨储鍚楋紵" placement="top" @confirm="handleDeleteClues" ok-text="纭畾" cancel-text="鍙栨秷"> + <a-menu-item key="4">鍒犻櫎</a-menu-item> + </a-popconfirm> + </a-menu> </template> </a-dropdown> @@ -83,7 +100,7 @@ import {Tooltip} from "ant-design-vue"; import Content from "./drawer/index.vue"; import EventBus from "@/utils/eventBus"; - import {reactive, defineEmits} from 'vue'; + import {reactive, defineEmits, ref} from 'vue'; const emit = defineEmits(['success', 'register']); @@ -106,10 +123,33 @@ // }); }); + function handleEditCluesForm() { + Logger.log('鐐瑰嚮浜嗙紪杈戣〃鍗�', currentClues); + EventBus.emit('openCluesFormDrawer', currentClues); + } function handleReallocate() { Logger.log('鐐瑰嚮浜嗛噸鏂板垎閰�', currentClues); EventBus.emit('openReallocateModal', currentClues); } + function handleDeleteClues() { + Logger.log('鐐瑰嚮浜嗗垹闄ょ嚎绱�', currentClues); + } + function handleNewSchedule() { + Logger.log('鐐瑰嚮浜嗘柊寤烘棩绋�', currentClues); + EventBus.emit('openScheduleModal',{ + title:'鏂板缓鏃ョ▼12', + }); + } + + const isFollow = ref(false); + function handleFollow() { + Logger.log('鍏虫敞'); + isFollow.value = true; + } + function handleCancelFollow() { + Logger.log('鍙栨秷鍏虫敞'); + isFollow.value = false; + } </script> diff --git a/src/views/clues/components/DrawerForm.vue b/src/views/clues/components/DrawerForm.vue index 2a10462..f685273 100644 --- a/src/views/clues/components/DrawerForm.vue +++ b/src/views/clues/components/DrawerForm.vue @@ -14,14 +14,14 @@ <div>{{ getTitle }}</div> <div class="text-right"> <span> - <Tooltip title="宸插叧娉�"> - <Icon - icon="mingcute:heart-fill" - class="mr-15px cursor-pointer" - @click="" - :size="20" - /> - </Tooltip> +<!-- <Tooltip title="宸插叧娉�">--> +<!-- <Icon--> +<!-- icon="mingcute:heart-fill"--> +<!-- class="mr-15px cursor-pointer"--> +<!-- @click=""--> +<!-- :size="20"--> +<!-- />--> +<!-- </Tooltip>--> <Tooltip title="鏈叧娉�"> <Icon icon="mingcute:heart-line" @@ -78,6 +78,7 @@ import {BasicForm, useForm} from "@/components/Form"; import {schemas} from './drawerFormData' import {schemas as schemas2} from './drawerContacterFormData' + import {useFormBaseData} from '@/store/modules/formBaseData'; const emit = defineEmits(['success', 'register']); const isUpdate = ref(true); @@ -96,7 +97,7 @@ // 宸︿晶琛ㄥ崟 const [ registerForm, - { resetFields, setFieldsValue, validate } + { resetFields, setFieldsValue,updateSchema,validate } // { // // setFieldsValue, // // setProps @@ -115,6 +116,11 @@ span: 24, }, }); + + const userBaseDataStore= useFormBaseData(); + let baseData = userBaseDataStore.getFormBaseData; + Logger.log('鏇存柊 getFormBaseData..', baseData); + // 鍙充晶琛ㄥ崟 const [ @@ -143,6 +149,22 @@ const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => { Logger.log('鎵撳紑浜咲rawerForm', data); isUpdate.value = !!data?.isUpdate; + + Logger.log('鏇存柊 getFormBaseData.. 骞撮噰璐', baseData.annualProcurement); + updateSchema({ + field: 'annualPurchaseAmount', + componentProps: { + // 淇敼baseData.annualProcurement鍐呮暟鎹弬鏁板悕锛宯ame淇敼涓簂abel,id淇敼涓簐alue + options: baseData.annualProcurement.map((item) => ({ + label: item.name, + value: item.id, + })), + // resultField: 'list', + labelField: 'name', + valueField: 'id', + }, + }); + // // 鏂瑰紡1 // setFieldsValue({ // field2: data.data, diff --git a/src/views/clues/components/Table.vue b/src/views/clues/components/Table.vue index 0b62f07..0bbf3be 100644 --- a/src/views/clues/components/Table.vue +++ b/src/views/clues/components/Table.vue @@ -1,6 +1,6 @@ <template> <div class="p-4 flex flex-col"> - <Drawer @register="registerDrawer" @success="handleSuccess"/> + <Drawer :destroyOnClose="true" @register="registerDrawer" @success="handleSuccess"/> <!-- <div class="mb-4">--> <!-- <a-button class="mr-2" @click="reloadTable"> 杩樺師 </a-button>--> <!-- <a-button class="mr-2" @click="changeLoading"> 寮�鍚痩oading </a-button>--> @@ -23,6 +23,7 @@ @edit-end="handleEditEnd" @edit-cancel="handleEditCancel" :beforeEditSubmit="beforeEditSubmit" + :searchInfo="searchInfo" > <template #bodyCell="{ column, record }"> <template v-if="column.key === 'tags'"> @@ -86,17 +87,17 @@ </div> </template> <script lang="ts" setup> -import {ref,} from 'vue'; +import {reactive, ref,} from 'vue'; import { BasicTable, ColumnChangeParam, TableAction, useTable } from '@/components/Table'; -import {getEditCellColumns, getFormConfig} from './tableData'; +import {getEditCellColumns} from './tableData'; import {useMessage} from '@/hooks/web/useMessage'; import {Tag} from 'ant-design-vue'; -import {cluesListApi} from "@/api/clues/table"; +import {cluesListApi} from "@/api/clues/list"; // import {useModal} from "@/components/Modal"; import Drawer from "./Drawer.vue"; import {useDrawer} from "@/components/Drawer"; @@ -105,6 +106,9 @@ // import {Dropdown, type DropMenu} from "@/components/Dropdown"; // const [register, { openModal: openModal }] = useModal(); // const [registerPersonnelModal, { openModal: openPersonnelModal }] = useModal(); + +import {useCluesRowStore} from "@/store/modules/cluesRowData"; + const [registerDrawer, {openDrawer}] = useDrawer(); const {createMessage} = useMessage(); @@ -169,7 +173,7 @@ // // return dropMenuList; // }); - +const searchInfo = reactive<Recordable>({}); function onChange() { console.log('onChange', arguments); @@ -196,11 +200,31 @@ // title: 'useTable绀轰緥', // titleHelpMessage: '浣跨敤useTable璋冪敤琛ㄦ牸鍐呮柟娉�', api: cluesListApi, - // beforeFetch: (params) => { - // console.log('beforeFetch', params); - // params.pageNo = params.page; - // // return Promise.resolve(params); - // }, + beforeFetch: (params) => { + Logger.log('beforeFetch', params); + // params.pageNo = params.page; + params.type = 'all'; + // params.searchTxt = { + // cluesName: '', + // isRead: 1, + // } + // delete params.page; + // return Promise.resolve(params); + }, + fetchSetting: { + pageField: 'pageNo', + }, + afterFetch: () => { + const result = getRawDataSource(); + Logger.log('afterFetch', result); + // setTimeout(() => { + // setPagination({ + // total: 100, + // }); + // }, 1000); + return result.data.data; + + }, columns: getEditCellColumns(), // defSort: { // pageNo: 1, @@ -213,7 +237,36 @@ showIndexColumn: false, // 鏄惁鏄剧ず搴忓彿鍒� useSearchForm: true, // 浣跨敤鎼滅储琛ㄥ崟 clickToRowSelect: false, - formConfig: getFormConfig(), // 鎼滅储琛ㄥ崟閰嶇疆 + formConfig: { + labelWidth: 100, + layout: 'horizontal', + rowProps: { + justify: 'end', + }, + showResetButton: false, + showSubmitButton: false, + autoSubmitOnEnter: true, + schemas: [ + { + field: `searchTxt.cluesName`, + label: `鎼滅储`, + component: 'Input', + colProps: { + xl: 12, + xxl: 8, + }, + // componentProps: { + // onSearch: (value) => { + // console.log(value); + // }, + // }, + }, + ], + }, // 鎼滅储琛ㄥ崟閰嶇疆 + handleSearchInfoFn(info) { + console.log('handleSearchInfoFn', info); + return info; + }, tableSetting: { // 鏄惁鏄剧ず鍒锋柊鎸夐挳 redo: true, @@ -225,6 +278,7 @@ fullScreen: true }, pagination: { + total: 0, // pageSize: 20, pageSizeOptions: ['10', '20', '50', '100'], defaultPageSize: 20, @@ -345,9 +399,11 @@ function handleRowClick(data) { Logger.log('handleRowClick', data); openDrawer(true, { - isUpdate: false, + isUpdate: true, clue: data }); + const cluesRowStore= useCluesRowStore(); + cluesRowStore.setRowData(data); } function handleCellClick() { diff --git a/src/views/clues/components/drawer/Detail.vue b/src/views/clues/components/drawer/Detail.vue index 0f5f09e..cef49f1 100644 --- a/src/views/clues/components/drawer/Detail.vue +++ b/src/views/clues/components/drawer/Detail.vue @@ -1,18 +1,18 @@ <template> <div :class="prefixCls"> - <BasicForm @register="registerForm"></BasicForm> +<!-- <BasicForm @register="registerForm"></BasicForm>--> <div class="mb-15px"> <div class="mb-15px "> <div :class="`${prefixCls}__label`">绯荤粺鏍囩</div> - <div>鏆傛棤鏁版嵁</div> + <div>{{'鏆傛棤鏁版嵁'}}</div> </div> <div class="mb-15px"> <div :class="`${prefixCls}__label`">棣栨璺熻繘鏃堕棿</div> - <div>鏆傛棤鏁版嵁</div> + <div>{{cluesData.enterDate||'鏆傛棤鏁版嵁'}}</div> </div> <div class=""> <div :class="`${prefixCls}__label`">鏈仈绯诲ぉ鏁�</div> - <div>10</div> + <div>{{'鏆傛棤鏁版嵁'}}</div> </div> </div> <Divider /> @@ -34,6 +34,12 @@ import {treeOptionsListApi} from "@/api/demo/tree"; import {getAllRoleList} from "@/api/demo/system"; import {DescItem, Description, useDescription} from "@/components/Description"; + import {useCluesRowStore} from "@/store/modules/cluesRowData"; + import {ref} from "vue"; + + let cluesData = ref({}); + const cluesRowStore= useCluesRowStore(); + cluesData.value = cluesRowStore.getRowData; const formSchema: FormSchema[] = [ { @@ -104,17 +110,17 @@ }, ]; - const mockData: Recordable = { - cluesName: 'test', - nickName: 'VB', - age: '123', - phone: '15695909xxx', - email: '190848757@qq.com', - companyname: '鍏徃鍚嶇О111', - sex: '鐢�', - certy: '3504256199xxxxxxxxx', - tag: 'orange', - }; + // const mockData: Recordable = { + // cluesName: 'test', + // nickName: 'VB', + // age: '123', + // phone: '15695909xxx', + // email: '190848757@qq.com', + // companyname: '鍏徃鍚嶇О111', + // sex: '鐢�', + // certy: '3504256199xxxxxxxxx', + // tag: 'orange', + // }; const schema: DescItem[] = [ { @@ -127,7 +133,7 @@ label: '鍏徃鍚嶇О', }, { - field: 'phone', + field: 'tel', label: '鑱旂郴鐢佃瘽', }, { @@ -135,10 +141,10 @@ label: '閭', }, { - field: 'phone', + field: 'tel', label: '搴ф満', render: (curVal, data) => { - return `${data.nickName}-${curVal}`; + return `${data.telAreaCode}-${curVal}`; }, }, ]; @@ -159,7 +165,7 @@ color: '#909090', // fontSize: '12px', }, - data: mockData, + data: cluesData, schema: schema, }); diff --git a/src/views/clues/components/drawer/ScheduleDetail.vue b/src/views/clues/components/drawer/ScheduleDetail.vue index 2ed0d52..b0d1eba 100644 --- a/src/views/clues/components/drawer/ScheduleDetail.vue +++ b/src/views/clues/components/drawer/ScheduleDetail.vue @@ -27,8 +27,10 @@ <Row class="c-gray ml-22px">浠婂ぉ</Row> </Col> <Col span="4" class="font-bold text-right"> - <HeartOutlined class="font-size-18px" /> - <HeartFilled class="font-size-18px c-red-5" /> + <div class="cursor-pointer"> + <HeartFilled v-if="isFollow" @click="handleCancelFollow" class="font-size-18px c-red-5" /> + <HeartOutlined v-else @click="handleFollow" class="font-size-18px "/> + </div> </Col> </Row> </div> @@ -226,6 +228,16 @@ function handleVisibleChange(v) { v && props.userData && nextTick(() => onDataReceive(props.userData)); } + + const isFollow = ref(false); + function handleFollow() { + Logger.log('鍏虫敞'); + isFollow.value = true; + } + function handleCancelFollow() { + Logger.log('鍙栨秷鍏虫敞'); + isFollow.value = false; + } </script> <style lang="less"> .schedule-detail-modal { diff --git a/src/views/clues/components/drawer/data.tsx b/src/views/clues/components/drawer/data.tsx index 117a6ef..f21f54d 100644 --- a/src/views/clues/components/drawer/data.tsx +++ b/src/views/clues/components/drawer/data.tsx @@ -67,7 +67,7 @@ }, ]; -export const achieveList: TabItem[] = [ +export const tabList: TabItem[] = [ { key: '1', name: '璧勬枡', diff --git a/src/views/clues/components/drawer/index.vue b/src/views/clues/components/drawer/index.vue index c7dc367..34747e8 100644 --- a/src/views/clues/components/drawer/index.vue +++ b/src/views/clues/components/drawer/index.vue @@ -9,7 +9,7 @@ <Col :span="20" :class="`${prefixCls}-col`"> <div class="mb-10px"> <div class="mb-5px"> - Vben + {{cluesData.homepage || cluesData.cluesName}} <Icon icon="majesticons:open" class="mr-15px cursor-pointer" @@ -18,25 +18,25 @@ :size="16" /> </div> - <div>娴风撼鐧惧窛锛屾湁瀹逛箖澶�</div> + <div>{{cluesData.cluesName}}</div> </div> <div class="mb-10px flex"> <div> <span>璺熻繘浜猴細</span> - <span>111</span> + <span>{{cluesData.createUserName||'--'}}</span> </div> <div class="ml-10px flex"> <span>绾跨储璇勫垎<BasicHelp :text="['璇勫垎瑙勫垯锛�1锛岃瘎鍒�=鍚勭淮搴﹀垎鏁帮紙鎵�鎵撳垎鏁�*璇ョ淮搴︽潈閲嶏級鐨勬�诲拰锛�', '2锛屽鍙湁棣栨璇勫垎锛屽垯浠ラ娆¤瘎鍒嗕负鍑嗭紱濡傛湁涓ゆ璇勫垎锛屽垯鍙栦袱娆¤瘎鍒嗙殑骞冲潎鍊笺��']"/>锛�</span> - <span>10</span> + <span>{{'--'}}</span> </div> </div> <div class=""> - <template v-for="tag in tags" :key="tag"> - <Tag class="mb-2"> - {{ tag }} + <template v-for="tag in cluesData.tagList" :key="tag"> + <Tag class="mb-2" :color="tag.color"> + {{ tag.name }} </Tag> </template> - <TagSelector class="pb-10px inline-block mt-10px"></TagSelector> + <TagSelector v-model:tags-value="tagsValue" class="pb-10px inline-block mt-10px"></TagSelector> </div> </Col> @@ -51,7 +51,7 @@ </Row> <div :class="`${prefixCls}-bottom`"> <Tabs> - <template v-for="item in achieveList" :key="item.key"> + <template v-for="item in tabList" :key="item.key"> <TabPane :tab="item.name"> <ScrollContainer class="scroll-wrap"> @@ -68,17 +68,18 @@ <script lang="ts" setup> import Icon from '@/components/Icon/Icon.vue'; import { Col, Row, Tabs, Tag } from 'ant-design-vue'; - import { computed } from 'vue'; + import {computed,ref} from 'vue'; import Dynamic from './Dynamic.vue'; import Detail from './Detail.vue'; import Schedule from './Schedule.vue'; import headerImg from '@/assets/images/header.jpg'; import { useUserStore } from '@/store/modules/user'; - import { achieveList, tags } from './data'; + import { tabList, tags } from './data'; import {BasicHelp} from "@/components/Basic"; import ScrollContainer from "@/components/Container/src/ScrollContainer.vue"; import {TagSelector} from "@/components/TagSelector"; + import {useCluesRowStore} from "@/store/modules/cluesRowData"; const userStore = useUserStore(); const TabPane = Tabs.TabPane; @@ -89,6 +90,18 @@ }; const prefixCls = 'clues-drawer'; const avatar = computed(() => userStore.getUserInfo.avatar || headerImg); + + let cluesData = ref({}); + const cluesRowStore= useCluesRowStore(); + cluesData.value = cluesRowStore.getRowData; + Logger.log('鐖剁粍浠禼luesData',cluesData); + + + + let tagsValue = ref([]); + const selectedTags = ref([{name:'濂借璇�',color:'pink'}, {name:'鏈夌ぜ璨�',color:'red'}, {name:'鍒濇鎰忓悜',color:'red'}, {name:'宸茶仈绯�',color:'red'}]); + tagsValue.value = selectedTags.value.map((item) => item.name); + Logger.log('鐖剁粍浠秚agsValue',tagsValue.value); </script> <style lang="less" scoped> .clues-drawer { diff --git a/src/views/clues/components/drawerContacterFormData.tsx b/src/views/clues/components/drawerContacterFormData.tsx index b672008..97ee9ae 100644 --- a/src/views/clues/components/drawerContacterFormData.tsx +++ b/src/views/clues/components/drawerContacterFormData.tsx @@ -217,209 +217,33 @@ // }, // }, { - field: 'cluesFrom', - component: 'ApiTreeSelect', - label: '绾跨储鏉ユ簮', - componentProps: { - api: treeOptionsListApi, - treeCheckable: true, - treeCheckStrictly: true, // 鐖跺瓙鑺傜偣鏄惁涓嶅啀鍏宠仈 - resultField: 'list', - onChange: (e, v) => { - console.log('ApiTreeSelect====>:', e, v); - }, - }, - colProps: { - span: 24, - }, - }, - { - field: 'abbreviation', + field: 'position', component: 'Input', - label: '绠�绉�', - colProps: { - span: 24, - }, - }, - { - field: 'field8', - component: 'ApiCascader', - label: '鍥藉鍦板尯', - colProps: { - span: 16, - }, - componentProps: { - api: areaRecord, - apiParamKey: 'parentCode', - // dataField: 'data', - labelField: 'name', - valueField: 'code', - initFetchParams: { - parentCode: '', - }, - isLeaf: (record) => { - return !(record.levelType < 3); - }, - onChange: (e, ...v) => { - console.log('ApiCascader====>:', e, v); - }, - }, - }, - // { - // field: 'field9', - // component: 'ApiCascader', - // label: '鑱斿姩ApiCascader', - // required: true, - // colProps: { - // span: 8, - // }, - // componentProps: { - // api: areaRecord, - // apiParamKey: 'parentCode', - // // dataField: 'data', - // labelField: 'name', - // valueField: 'code', - // initFetchParams: { - // parentCode: '', - // }, - // isLeaf: (record) => { - // return !(record.levelType < 3); - // }, - // onChange: (e, ...v) => { - // console.log('ApiCascader====>:', e, v); - // }, - // }, - // }, - { - field: 'field30', - component: 'ApiSelect', - label: '绾跨储鏍囩', - // required: true, - componentProps: { - // more details see /src/components/Form/src/components/ApiSelect.vue - api: optionsListApi, - params: { - id: 1, - }, - mode: 'multiple', - resultField: 'list', - // use name as label - labelField: 'name', - // use id as value - valueField: 'id', - // not request untill to select - immediate: true, - onChange: (e, v) => { - console.log('ApiSelect====>:', e, v); - }, - // atfer request callback - onOptionsChange: (options) => { - // console.log('get options', options.length, options); - }, - }, - colProps: { - span: 16, - }, - // defaultValue: '0', - }, - { - field: 'companyName', - component: 'Input', - label: '鍏徃鍚嶇О', + label: '鑱屼綅', colProps: { span: 16, }, }, - { - field: 'customerCode', - component: 'Input', - label: '瀹㈡埛浠g爜锛堜笌鐢熶骇鍗曠殑瀹㈡埛浠g爜涓�鑷达級', + field: 'remark', + component: 'InputTextArea', + label: '澶囨敞', colProps: { span: 24, }, }, { - field: '', - defaultValue: '', - component: 'Input', - // label: 'renderColContent娓叉煋', - /**!!!renderColContent 娌℃湁FormItem 鍖呰9, 鑻ユ兂瑕� Form 鎻愪氦闇�瑕佸甫涓婃暟鎹』 <FormItem name={}></FormItem> 鍖呰9锛� 绀轰緥濡備笅*/ - renderColContent({model, field}, {disabled}) { - return ( - <div class="font-size-16px mb-10px">鍏朵粬</div> - ); - }, - colProps: { - span: 24, - }, - }, - { - component: 'Select', - label: '鍏徃绫诲瀷', - field: 'companyType', - colProps: {span: 16}, - componentProps: { - options: companyType, - }, - // defaultValue: '1' - }, - { - component: 'Select', - label: '閲囪喘鎰忓悜', - field: 'purchasingIntention', - colProps: {span: 16}, + field: 'gender', + component: 'RadioGroup', + defaultValue: '0', + label: '鎬у埆', componentProps: { options: [ - { - label: '鏈煡', - value: '1', - }, - { - label: '浣�', - value: '2', - }, - { - label: '涓�', - value: '3', - }, - { - label: '楂�', - value: '4', - }, + {label: '涓嶈缃�', value: '0'}, + {label: '鐢�', value: '1'}, + {label: '濂�', value: '1'}, ], }, - }, - { - component: 'Select', - label: '骞撮噰璐', - field: 'annualPurchaseAmount', - colProps: {span: 16}, - componentProps: { - options: annualPurchaseAmount, - }, - }, - { - component: 'Select', - label: '鏃跺尯', - field: 'timeZone', - colProps: {span: 16}, - componentProps: { - options: timeZone, - }, - }, - { - field: 'searchKeywords', - component: 'Input', - label: '鎼滅储鍏抽敭璇�', - colProps: { - span: 16, - }, - }, - { - field: 'detailedAddress', - component: 'Input', - label: '璇︾粏鍦板潃', colProps: { span: 24, }, @@ -427,7 +251,7 @@ { field: 'image', component: 'ImageUpload', - label: '涓婁紶鍥剧墖', + label: '鍥剧墖', subLabel: '(鍗曞紶鍥剧墖鏈�澶�3M锛屾渶澶氫笂浼�5寮犲浘鐗�)', // required: true, defaultValue: [ @@ -455,245 +279,71 @@ // ], }, { - field: 'cluesNotes', - component: 'InputTextArea', - label: '绾跨储澶囨敞', - colProps: { - span: 24, - }, - }, - { - component: 'Select', - label: '瑙勬ā', - field: 'numberOfPeople', - colProps: {span: 16}, + field: 'birthday', + label: '鐢熸棩', + component: 'DatePicker', componentProps: { - options: [ - { - label: '灏戜簬59浜�', - value: '1', - }, - { - label: '60-149浜�', - value: '2', - }, - { - label: '150-499浜�', - value: '3', - }, - { - label: '500-999浜�', - value: '4', - }, - { - label: '1000-4999浜�', - value: '5', - }, - { - label: '5000浜轰互涓�', - value: '6', - }, - ], - }, - }, - { - field: 'salesman', - component: 'Input', - label: '涓氬姟鍛�', - colProps: { - span: 16, - }, - }, - { - component: 'Select', - label: '璁块棶鏉ユ簮', - field: 'visitSource', - colProps: {span: 24}, - componentProps: { - options: [ - { - label: '骞垮憡鎶曟斁', - value: '1', - }, - { - label: '鑷劧娴侀噺', - value: '2', - }, - { - label: '绀句氦缃戠珯', - value: '3', - }, - { - label: '鐩存帴璁块棶', - value: '4', - }, - { - label: '閭欢', - value: '5', - }, - { - label: '鍏朵粬', - value: '6', - }, - ], - }, - }, - { - field: 'field12', - component: 'ApiCascader', - label: '涓昏惀浜у搧', - colProps: { span: 24 }, - componentProps: { - api: areaRecord, - apiParamKey: 'parentCode', - showCheckedStrategy: 'SHOW_CHILD', - labelField: 'name', - valueField: 'code', - multiple: true, - initFetchParams: { - parentCode: '', - }, - isLeaf: (record) => { - return !(record.levelType < 3); - }, - onChange: (e, ...v) => { - Logger.log('ApiCascader====> e:', e); - Logger.log('ApiCascader====> v:', v); - }, - }, - }, - { - field: 'ipAddress', - component: 'ApiSelect', - label: '璁垮IP鎵�鍦ㄥ湴', - // required: true, - componentProps: { - // more details see /src/components/Form/src/components/ApiSelect.vue - api: optionsListApi, - params: { - id: 1, - }, - resultField: 'list', - // use name as label - labelField: 'name', - // use id as value - valueField: 'id', - // not request untill to select - immediate: true, - onChange: (e, v) => { - console.log('ApiSelect====>:', e, v); - }, - // atfer request callback - onOptionsChange: (options) => { - // console.log('get options', options.length, options); - }, - }, - colProps: { - span: 20, - }, - // defaultValue: '0', - }, - { - field: 'field1', - component: 'RadioButtonGroup', - componentProps: { - options: [ - {label: 'Apple', value: 'Apple'}, - {label: 'Pear', value: 'Pear'}, - {label: 'Orange', value: 'Orange', disabled: true}, - ], - }, - - label: '', - colProps: { - span: 24, - }, - }, - { - field: 'field2', - component: 'Checkbox', - // suffix:'鍏ㄥぉ浜嬩欢', - subLabel: '', - colProps: { - span: 6, - }, - renderComponentContent: '鍏ㄥぉ浜嬩欢', - // componentProps: { - // options: [ - // { - // label: '鍏ㄥぉ浜嬩欢', - // value: '1', - // } - // ], - // }, - }, - { - field: '[startDate, endDate]', - label: '璧锋鏃堕棿', - component: 'RangePicker', - componentProps: { + style: 'width: 100%;', format: 'YYYY-MM-DD', - placeholder: ['寮�濮嬫棩鏈�', '缁撴潫鏃ユ湡'], }, + colProps: {span: 16}, + }, + { + component: 'Select', + label: '鑱岀骇', + field: 'rank', colProps: {span: 24}, - }, - - { - field: 'field3', - component: 'DatePicker', - label: '鐩村埌', - colProps: { - span: 10, - offset: 2, - }, componentProps: { - style: {width: '100%'}, - disabledDate: (currentDate) => { - // Logger.log('currentDate',currentDate) - // 绂佺敤浠婂ぉ涔嬪墠鐨勫ぉ鏁� - return currentDate && currentDate < dayjs().subtract(1, 'day'); - } - }, - required: true, - ifShow: ({values}) => { - // Logger.log('vvv',values) - return ['2', '3', '4'].includes(values.date1); - }, - }, - { - field: 'remindTime2', - component: 'DatePicker', - label: '', - colProps: { - span: 6, - offset: 2, - }, - componentProps: { - // disabledDate:(currentDate)=>{ - // // Logger.log('currentDate',currentDate) - // // 绂佺敤浠婂ぉ涔嬪墠鐨勫ぉ鏁� - // return currentDate && currentDate < dayjs().subtract(1, 'day'); - // } - }, - dynamicRules: ({values}) => { - return [ + options: [ { - // required: true, - validator: (_, value) => { - if (values.remindTime === '6') { - if (!value) { - return Promise.reject('涓嶈兘涓虹┖'); - } - } - - return Promise.resolve(); - }, + label: '鏅�氳亴鍛�', + value: '1', }, - ]; - }, - show: ({values}) => { - // Logger.log('vvv',values) - return values.remindTime === '6'; + { + label: '涓眰绠$悊鑰�', + value: '2', + }, + { + label: '楂樺眰绠$悊鑰�', + value: '3', + }, + ], }, }, + // { + // field: 'remindTime2', + // component: 'DatePicker', + // label: '', + // colProps: { + // span: 6, + // offset: 2, + // }, + // componentProps: { + // // disabledDate:(currentDate)=>{ + // // // Logger.log('currentDate',currentDate) + // // // 绂佺敤浠婂ぉ涔嬪墠鐨勫ぉ鏁� + // // return currentDate && currentDate < dayjs().subtract(1, 'day'); + // // } + // }, + // dynamicRules: ({values}) => { + // return [ + // { + // // required: true, + // validator: (_, value) => { + // if (values.remindTime === '6') { + // if (!value) { + // return Promise.reject('涓嶈兘涓虹┖'); + // } + // } + // + // return Promise.resolve(); + // }, + // }, + // ]; + // }, + // show: ({values}) => { + // // Logger.log('vvv',values) + // return values.remindTime === '6'; + // }, + // }, ]; diff --git a/src/views/clues/components/drawerFormData.tsx b/src/views/clues/components/drawerFormData.tsx index a0f63ee..2b114f4 100644 --- a/src/views/clues/components/drawerFormData.tsx +++ b/src/views/clues/components/drawerFormData.tsx @@ -11,6 +11,18 @@ import timeZone from './drawer-form/timeZone'; import {uploadApi} from "@/api/sys/upload"; +// import {useFormBaseData} from '@/store/modules/formBaseData'; +// let baseData = useFormBaseData.getFormBaseData; +// Logger.log('....getFormBaseData.!!!.', baseData); + +// const userBaseDataStore= useFormBaseData(); +// let baseData = {}; +// userBaseDataStore.getSelectInfoAction().then((res) => { +// baseData = userBaseDataStore.getFormBaseData; +// Logger.log('!!!getFormBaseData..', baseData); +// }); + + // const custom_typeKey2typeValueRules = (model) => { // return [ // { @@ -280,7 +292,8 @@ field: 'annualPurchaseAmount', colProps: {span: 16}, componentProps: { - options: annualPurchaseAmount, + // options: annualPurchaseAmount, + // options: baseData?.annualProcurement, }, }, { @@ -476,108 +489,5 @@ span: 20, }, // defaultValue: '0', - }, - { - field: 'field1', - component: 'RadioButtonGroup', - componentProps: { - options: [ - {label: 'Apple', value: 'Apple'}, - {label: 'Pear', value: 'Pear'}, - {label: 'Orange', value: 'Orange', disabled: true}, - ], - }, - - label: '', - colProps: { - span: 24, - }, - }, - { - field: 'field2', - component: 'Checkbox', - // suffix:'鍏ㄥぉ浜嬩欢', - subLabel: '', - colProps: { - span: 6, - }, - renderComponentContent: '鍏ㄥぉ浜嬩欢', - // componentProps: { - // options: [ - // { - // label: '鍏ㄥぉ浜嬩欢', - // value: '1', - // } - // ], - // }, - }, - { - field: '[startDate, endDate]', - label: '璧锋鏃堕棿', - component: 'RangePicker', - componentProps: { - format: 'YYYY-MM-DD', - placeholder: ['寮�濮嬫棩鏈�', '缁撴潫鏃ユ湡'], - }, - colProps: {span: 24}, - }, - - { - field: 'field3', - component: 'DatePicker', - label: '鐩村埌', - colProps: { - span: 10, - offset: 2, - }, - componentProps: { - style: {width: '100%'}, - disabledDate: (currentDate) => { - // Logger.log('currentDate',currentDate) - // 绂佺敤浠婂ぉ涔嬪墠鐨勫ぉ鏁� - return currentDate && currentDate < dayjs().subtract(1, 'day'); - } - }, - required: true, - ifShow: ({values}) => { - // Logger.log('vvv',values) - return ['2', '3', '4'].includes(values.date1); - }, - }, - { - field: 'remindTime2', - component: 'DatePicker', - label: '', - colProps: { - span: 6, - offset: 2, - }, - componentProps: { - // disabledDate:(currentDate)=>{ - // // Logger.log('currentDate',currentDate) - // // 绂佺敤浠婂ぉ涔嬪墠鐨勫ぉ鏁� - // return currentDate && currentDate < dayjs().subtract(1, 'day'); - // } - }, - dynamicRules: ({values}) => { - return [ - { - // required: true, - validator: (_, value) => { - if (values.remindTime === '6') { - if (!value) { - return Promise.reject('涓嶈兘涓虹┖'); - } - } - - return Promise.resolve(); - }, - }, - ]; - }, - show: ({values}) => { - // Logger.log('vvv',values) - return values.remindTime === '6'; - }, }, ]; diff --git a/src/views/clues/components/tableData.tsx b/src/views/clues/components/tableData.tsx index a6bb685..7642bd3 100644 --- a/src/views/clues/components/tableData.tsx +++ b/src/views/clues/components/tableData.tsx @@ -12,82 +12,6 @@ width: 200 }, { - title: '瀛樻。鏃堕棿', - dataIndex: 'archiveTime', - sorter: true, - width: 200, - }, - { - title: '鐘舵�乮d', - dataIndex: 'statusId', - width: 200, - }, - { - title: '鐘舵�佸唴瀹�', - dataIndex: 'status', - width: 200, - }, - { - title: '璺熻繘鏃堕棿', - dataIndex: 'followUpTime', - width: 200, - }, - { - title: '鏃犳晥绫诲瀷', - dataIndex: 'failType', - width: 200, - }, - { - title: '鏃犳晥鐘舵��', - dataIndex: 'failStatus', - width: 200, - }, - { - title: '鏃犳晥鐘舵�佸唴瀹�', - dataIndex: 'failStatusName', - width: 200, - }, - { - title: '鏃犳晥鍘熷洜', - dataIndex: 'failReason', - width: 200, - }, - { - title: '杩涘叆绉佹捣鏃堕棿', - dataIndex: 'privateTime', - width: 200, - }, - { - title: '杩涘叆鍏捣鏃堕棿', - dataIndex: 'publicTime', - width: 200, - }, - { - title: '鏄惁涓哄叕娴风嚎绱�', - dataIndex: 'isPublic', - width: 200, - }, - { - title: '璇勫垎', - dataIndex: 'star', - width: 200, - }, - { - title: '涓嬫璺熻繘鏃堕棿', - dataIndex: 'nextFollowUpTime', - width: 200, - }, - { - title: '鏄惁鏈夐噸澶嶅唴瀹�', - dataIndex: 'duplicateFlag', - width: 200, - }, - { - title: '鏍囩', - dataIndex: 'tagList', - width: 200, - }, - { title: '鍏徃缃戝潃', dataIndex: 'homepage', width: 200, @@ -230,7 +154,82 @@ }, width: 200, }, - + { + title: '瀛樻。鏃堕棿', + dataIndex: 'archiveTime', + sorter: true, + width: 200, + }, + { + title: '鐘舵�乮d', + dataIndex: 'statusId', + width: 200, + }, + { + title: '鐘舵�佸唴瀹�', + dataIndex: 'status', + width: 200, + }, + { + title: '璺熻繘鏃堕棿', + dataIndex: 'followUpTime', + width: 200, + }, + { + title: '鏃犳晥绫诲瀷', + dataIndex: 'failType', + width: 200, + }, + { + title: '鏃犳晥鐘舵��', + dataIndex: 'failStatus', + width: 200, + }, + { + title: '鏃犳晥鐘舵�佸唴瀹�', + dataIndex: 'failStatusName', + width: 200, + }, + { + title: '鏃犳晥鍘熷洜', + dataIndex: 'failReason', + width: 200, + }, + { + title: '杩涘叆绉佹捣鏃堕棿', + dataIndex: 'privateTime', + width: 200, + }, + { + title: '杩涘叆鍏捣鏃堕棿', + dataIndex: 'publicTime', + width: 200, + }, + { + title: '鏄惁涓哄叕娴风嚎绱�', + dataIndex: 'isPublic', + width: 200, + }, + { + title: '璇勫垎', + dataIndex: 'star', + width: 200, + }, + { + title: '涓嬫璺熻繘鏃堕棿', + dataIndex: 'nextFollowUpTime', + width: 200, + }, + { + title: '鏄惁鏈夐噸澶嶅唴瀹�', + dataIndex: 'duplicateFlag', + width: 200, + }, + { + title: '鏍囩', + dataIndex: 'tagList', + width: 200, + }, { title: '杩滅▼涓嬫媺鏍�', dataIndex: 'name8', @@ -249,25 +248,30 @@ -export function getFormConfig(): Partial<FormProps> { - return { - labelWidth: 100, - layout: 'horizontal', - rowProps: { - justify: 'end', - }, - showResetButton: false, - showSubmitButton: false, - schemas: [ - { - field: `field11`, - label: `鎼滅储`, - component: 'Input', - colProps: { - xl: 12, - xxl: 8, - }, - }, - ], - }; -} +// export function getFormConfig(): Partial<FormProps> { +// return { +// labelWidth: 100, +// layout: 'horizontal', +// rowProps: { +// justify: 'end', +// }, +// showResetButton: false, +// showSubmitButton: false, +// schemas: [ +// { +// field: `cluesKeyword`, +// label: `鎼滅储`, +// component: 'InputSearch', +// colProps: { +// xl: 12, +// xxl: 8, +// }, +// componentProps: { +// onSearch: (value) => { +// console.log(value); +// }, +// }, +// }, +// ], +// }; +// } diff --git a/src/views/clues/index.vue b/src/views/clues/index.vue index 4c375d2..e5bb9f2 100644 --- a/src/views/clues/index.vue +++ b/src/views/clues/index.vue @@ -53,7 +53,7 @@ import DrawerForm from './components/DrawerForm.vue'; import ScrollContainer from "@/components/Container/src/ScrollContainer.vue"; -const [registerDrawer, { openDrawer }] = useDrawer(); +const [registerDrawer, { openDrawer,setDrawerProps}] = useDrawer(); function handleSuccess() { Logger.log('鎻愪氦drawer鎴愬姛') } @@ -106,6 +106,17 @@ onMounted(() => { Logger.log('Hello, 绾跨储椤�'); + EventBus.on('openCluesFormDrawer', (data) => { + Logger.log('鐩戝惉openCluesFormDrawer',data); + setDrawerProps({ + zIndex: 100001, + }) + openDrawer(true, { + // data: 'content2', + // info: 'Info', + }); + }); + EventBus.on('openScheduleModal', (data) => { Logger.log('鐩戝惉openScheduleModal',data); setScheduleModalProps({ @@ -143,6 +154,9 @@ }); onUnmounted(() => { Logger.log('Goodbye, 绾跨储椤�'); + EventBus.off('openCluesFormDrawer',() => { + Logger.log('鍙栨秷鐩戝惉openCluesFormDrawer'); + }); EventBus.off('openScheduleModal',() => { Logger.log('鍙栨秷鐩戝惉openScheduleModal'); }); diff --git a/src/views/customer/components/Drawer.vue b/src/views/customer/components/Drawer.vue index 5d0baf4..410a192 100644 --- a/src/views/customer/components/Drawer.vue +++ b/src/views/customer/components/Drawer.vue @@ -10,14 +10,14 @@ <template #title> <div class="text-right"> <span> - <Tooltip title="宸插叧娉�"> - <Icon - icon="mingcute:heart-fill" - class="mr-15px cursor-pointer" - @click="" - :size="20" - /> - </Tooltip> +<!-- <Tooltip title="宸插叧娉�">--> +<!-- <Icon--> +<!-- icon="mingcute:heart-fill"--> +<!-- class="mr-15px cursor-pointer"--> +<!-- @click=""--> +<!-- :size="20"--> +<!-- />--> +<!-- </Tooltip>--> <Tooltip title="鏈叧娉�"> <Icon icon="mingcute:heart-line" diff --git a/src/views/customer/components/DrawerForm.vue b/src/views/customer/components/DrawerForm.vue index 257e29c..89728ac 100644 --- a/src/views/customer/components/DrawerForm.vue +++ b/src/views/customer/components/DrawerForm.vue @@ -14,14 +14,14 @@ <div>{{ getTitle }}</div> <div class="text-right"> <span> - <Tooltip title="宸插叧娉�"> - <Icon - icon="mingcute:heart-fill" - class="mr-15px cursor-pointer" - @click="" - :size="20" - /> - </Tooltip> +<!-- <Tooltip title="宸插叧娉�">--> +<!-- <Icon--> +<!-- icon="mingcute:heart-fill"--> +<!-- class="mr-15px cursor-pointer"--> +<!-- @click=""--> +<!-- :size="20"--> +<!-- />--> +<!-- </Tooltip>--> <Tooltip title="鏈叧娉�"> <Icon icon="mingcute:heart-line" @@ -38,18 +38,9 @@ </template> <!-- <Content :schemas="schemas"></Content>--> <div :class="prefixCls"> - <Alert - v-if="visible" - message="绾跨储澧炲己锛氬~鍐欏叕鍙哥綉鍧�鎴栭偖绠卞悗缂�鍚庯紝濡傜郴缁熻兘鏌ユ壘鍒拌鍏徃鐨勫叾浠栨洿澶氫俊鎭紝鍒欎細涓烘偍鑷姩琛ュ叏銆�" - type="info" - show-icon - closable - :after-close="handleClose" - class="mb-10px" - /> <Row :class="`${prefixCls}-top`"> <Col :span="11" :class="`${prefixCls}-col`"> - <div class="mb-10px font-size-16px">甯哥敤淇℃伅</div> + <div class="mb-10px font-size-16px">鍏徃甯哥敤淇℃伅</div> <div class="pt-3px pr-3px"> <BasicForm @register="registerForm" :model="modelRef" /> </div> @@ -81,7 +72,7 @@ const emit = defineEmits(['success', 'register']); const isUpdate = ref(true); - const getTitle = computed(() => (!unref(isUpdate) ? '鏂板缓绾跨储' : '缂栬緫绾跨储')); + const getTitle = computed(() => (!unref(isUpdate) ? '鏂板缓瀹㈡埛' : '缂栬緫瀹㈡埛')); // const [registerForm, { setFieldsValue, }] = useForm({ // labelWidth: 90, diff --git a/src/views/customer/components/drawer/Detail.vue b/src/views/customer/components/drawer/Detail.vue index 0f5f09e..174534c 100644 --- a/src/views/customer/components/drawer/Detail.vue +++ b/src/views/customer/components/drawer/Detail.vue @@ -1,6 +1,6 @@ <template> <div :class="prefixCls"> - <BasicForm @register="registerForm"></BasicForm> +<!-- <BasicForm @register="registerForm"></BasicForm>--> <div class="mb-15px"> <div class="mb-15px "> <div :class="`${prefixCls}__label`">绯荤粺鏍囩</div> diff --git a/src/views/customer/components/drawer/Dynamic.vue b/src/views/customer/components/drawer/Dynamic.vue index 1d81243..297e151 100644 --- a/src/views/customer/components/drawer/Dynamic.vue +++ b/src/views/customer/components/drawer/Dynamic.vue @@ -209,7 +209,7 @@ // let _this = getCurrentInstance(); let businessTitle = ref('鏂板晢鏈�'); - let selectedBusinessTitleKeys = ref('1'); + let selectedBusinessTitleKeys = ref(['1']); let businessTitleArray = ref([ { key: '1', @@ -234,7 +234,7 @@ ]); function handleBusinessTitleClick(e){ Logger.log('handleBusinessTitleClick',e); - selectedBusinessTitleKeys.value = e?.key; + selectedBusinessTitleKeys.value = [e?.key]; businessTitle.value = e?.item?.title; } diff --git a/src/views/customer/components/drawerContacterFormData.tsx b/src/views/customer/components/drawerContacterFormData.tsx index b672008..97ee9ae 100644 --- a/src/views/customer/components/drawerContacterFormData.tsx +++ b/src/views/customer/components/drawerContacterFormData.tsx @@ -217,209 +217,33 @@ // }, // }, { - field: 'cluesFrom', - component: 'ApiTreeSelect', - label: '绾跨储鏉ユ簮', - componentProps: { - api: treeOptionsListApi, - treeCheckable: true, - treeCheckStrictly: true, // 鐖跺瓙鑺傜偣鏄惁涓嶅啀鍏宠仈 - resultField: 'list', - onChange: (e, v) => { - console.log('ApiTreeSelect====>:', e, v); - }, - }, - colProps: { - span: 24, - }, - }, - { - field: 'abbreviation', + field: 'position', component: 'Input', - label: '绠�绉�', - colProps: { - span: 24, - }, - }, - { - field: 'field8', - component: 'ApiCascader', - label: '鍥藉鍦板尯', - colProps: { - span: 16, - }, - componentProps: { - api: areaRecord, - apiParamKey: 'parentCode', - // dataField: 'data', - labelField: 'name', - valueField: 'code', - initFetchParams: { - parentCode: '', - }, - isLeaf: (record) => { - return !(record.levelType < 3); - }, - onChange: (e, ...v) => { - console.log('ApiCascader====>:', e, v); - }, - }, - }, - // { - // field: 'field9', - // component: 'ApiCascader', - // label: '鑱斿姩ApiCascader', - // required: true, - // colProps: { - // span: 8, - // }, - // componentProps: { - // api: areaRecord, - // apiParamKey: 'parentCode', - // // dataField: 'data', - // labelField: 'name', - // valueField: 'code', - // initFetchParams: { - // parentCode: '', - // }, - // isLeaf: (record) => { - // return !(record.levelType < 3); - // }, - // onChange: (e, ...v) => { - // console.log('ApiCascader====>:', e, v); - // }, - // }, - // }, - { - field: 'field30', - component: 'ApiSelect', - label: '绾跨储鏍囩', - // required: true, - componentProps: { - // more details see /src/components/Form/src/components/ApiSelect.vue - api: optionsListApi, - params: { - id: 1, - }, - mode: 'multiple', - resultField: 'list', - // use name as label - labelField: 'name', - // use id as value - valueField: 'id', - // not request untill to select - immediate: true, - onChange: (e, v) => { - console.log('ApiSelect====>:', e, v); - }, - // atfer request callback - onOptionsChange: (options) => { - // console.log('get options', options.length, options); - }, - }, - colProps: { - span: 16, - }, - // defaultValue: '0', - }, - { - field: 'companyName', - component: 'Input', - label: '鍏徃鍚嶇О', + label: '鑱屼綅', colProps: { span: 16, }, }, - { - field: 'customerCode', - component: 'Input', - label: '瀹㈡埛浠g爜锛堜笌鐢熶骇鍗曠殑瀹㈡埛浠g爜涓�鑷达級', + field: 'remark', + component: 'InputTextArea', + label: '澶囨敞', colProps: { span: 24, }, }, { - field: '', - defaultValue: '', - component: 'Input', - // label: 'renderColContent娓叉煋', - /**!!!renderColContent 娌℃湁FormItem 鍖呰9, 鑻ユ兂瑕� Form 鎻愪氦闇�瑕佸甫涓婃暟鎹』 <FormItem name={}></FormItem> 鍖呰9锛� 绀轰緥濡備笅*/ - renderColContent({model, field}, {disabled}) { - return ( - <div class="font-size-16px mb-10px">鍏朵粬</div> - ); - }, - colProps: { - span: 24, - }, - }, - { - component: 'Select', - label: '鍏徃绫诲瀷', - field: 'companyType', - colProps: {span: 16}, - componentProps: { - options: companyType, - }, - // defaultValue: '1' - }, - { - component: 'Select', - label: '閲囪喘鎰忓悜', - field: 'purchasingIntention', - colProps: {span: 16}, + field: 'gender', + component: 'RadioGroup', + defaultValue: '0', + label: '鎬у埆', componentProps: { options: [ - { - label: '鏈煡', - value: '1', - }, - { - label: '浣�', - value: '2', - }, - { - label: '涓�', - value: '3', - }, - { - label: '楂�', - value: '4', - }, + {label: '涓嶈缃�', value: '0'}, + {label: '鐢�', value: '1'}, + {label: '濂�', value: '1'}, ], }, - }, - { - component: 'Select', - label: '骞撮噰璐', - field: 'annualPurchaseAmount', - colProps: {span: 16}, - componentProps: { - options: annualPurchaseAmount, - }, - }, - { - component: 'Select', - label: '鏃跺尯', - field: 'timeZone', - colProps: {span: 16}, - componentProps: { - options: timeZone, - }, - }, - { - field: 'searchKeywords', - component: 'Input', - label: '鎼滅储鍏抽敭璇�', - colProps: { - span: 16, - }, - }, - { - field: 'detailedAddress', - component: 'Input', - label: '璇︾粏鍦板潃', colProps: { span: 24, }, @@ -427,7 +251,7 @@ { field: 'image', component: 'ImageUpload', - label: '涓婁紶鍥剧墖', + label: '鍥剧墖', subLabel: '(鍗曞紶鍥剧墖鏈�澶�3M锛屾渶澶氫笂浼�5寮犲浘鐗�)', // required: true, defaultValue: [ @@ -455,245 +279,71 @@ // ], }, { - field: 'cluesNotes', - component: 'InputTextArea', - label: '绾跨储澶囨敞', - colProps: { - span: 24, - }, - }, - { - component: 'Select', - label: '瑙勬ā', - field: 'numberOfPeople', - colProps: {span: 16}, + field: 'birthday', + label: '鐢熸棩', + component: 'DatePicker', componentProps: { - options: [ - { - label: '灏戜簬59浜�', - value: '1', - }, - { - label: '60-149浜�', - value: '2', - }, - { - label: '150-499浜�', - value: '3', - }, - { - label: '500-999浜�', - value: '4', - }, - { - label: '1000-4999浜�', - value: '5', - }, - { - label: '5000浜轰互涓�', - value: '6', - }, - ], - }, - }, - { - field: 'salesman', - component: 'Input', - label: '涓氬姟鍛�', - colProps: { - span: 16, - }, - }, - { - component: 'Select', - label: '璁块棶鏉ユ簮', - field: 'visitSource', - colProps: {span: 24}, - componentProps: { - options: [ - { - label: '骞垮憡鎶曟斁', - value: '1', - }, - { - label: '鑷劧娴侀噺', - value: '2', - }, - { - label: '绀句氦缃戠珯', - value: '3', - }, - { - label: '鐩存帴璁块棶', - value: '4', - }, - { - label: '閭欢', - value: '5', - }, - { - label: '鍏朵粬', - value: '6', - }, - ], - }, - }, - { - field: 'field12', - component: 'ApiCascader', - label: '涓昏惀浜у搧', - colProps: { span: 24 }, - componentProps: { - api: areaRecord, - apiParamKey: 'parentCode', - showCheckedStrategy: 'SHOW_CHILD', - labelField: 'name', - valueField: 'code', - multiple: true, - initFetchParams: { - parentCode: '', - }, - isLeaf: (record) => { - return !(record.levelType < 3); - }, - onChange: (e, ...v) => { - Logger.log('ApiCascader====> e:', e); - Logger.log('ApiCascader====> v:', v); - }, - }, - }, - { - field: 'ipAddress', - component: 'ApiSelect', - label: '璁垮IP鎵�鍦ㄥ湴', - // required: true, - componentProps: { - // more details see /src/components/Form/src/components/ApiSelect.vue - api: optionsListApi, - params: { - id: 1, - }, - resultField: 'list', - // use name as label - labelField: 'name', - // use id as value - valueField: 'id', - // not request untill to select - immediate: true, - onChange: (e, v) => { - console.log('ApiSelect====>:', e, v); - }, - // atfer request callback - onOptionsChange: (options) => { - // console.log('get options', options.length, options); - }, - }, - colProps: { - span: 20, - }, - // defaultValue: '0', - }, - { - field: 'field1', - component: 'RadioButtonGroup', - componentProps: { - options: [ - {label: 'Apple', value: 'Apple'}, - {label: 'Pear', value: 'Pear'}, - {label: 'Orange', value: 'Orange', disabled: true}, - ], - }, - - label: '', - colProps: { - span: 24, - }, - }, - { - field: 'field2', - component: 'Checkbox', - // suffix:'鍏ㄥぉ浜嬩欢', - subLabel: '', - colProps: { - span: 6, - }, - renderComponentContent: '鍏ㄥぉ浜嬩欢', - // componentProps: { - // options: [ - // { - // label: '鍏ㄥぉ浜嬩欢', - // value: '1', - // } - // ], - // }, - }, - { - field: '[startDate, endDate]', - label: '璧锋鏃堕棿', - component: 'RangePicker', - componentProps: { + style: 'width: 100%;', format: 'YYYY-MM-DD', - placeholder: ['寮�濮嬫棩鏈�', '缁撴潫鏃ユ湡'], }, + colProps: {span: 16}, + }, + { + component: 'Select', + label: '鑱岀骇', + field: 'rank', colProps: {span: 24}, - }, - - { - field: 'field3', - component: 'DatePicker', - label: '鐩村埌', - colProps: { - span: 10, - offset: 2, - }, componentProps: { - style: {width: '100%'}, - disabledDate: (currentDate) => { - // Logger.log('currentDate',currentDate) - // 绂佺敤浠婂ぉ涔嬪墠鐨勫ぉ鏁� - return currentDate && currentDate < dayjs().subtract(1, 'day'); - } - }, - required: true, - ifShow: ({values}) => { - // Logger.log('vvv',values) - return ['2', '3', '4'].includes(values.date1); - }, - }, - { - field: 'remindTime2', - component: 'DatePicker', - label: '', - colProps: { - span: 6, - offset: 2, - }, - componentProps: { - // disabledDate:(currentDate)=>{ - // // Logger.log('currentDate',currentDate) - // // 绂佺敤浠婂ぉ涔嬪墠鐨勫ぉ鏁� - // return currentDate && currentDate < dayjs().subtract(1, 'day'); - // } - }, - dynamicRules: ({values}) => { - return [ + options: [ { - // required: true, - validator: (_, value) => { - if (values.remindTime === '6') { - if (!value) { - return Promise.reject('涓嶈兘涓虹┖'); - } - } - - return Promise.resolve(); - }, + label: '鏅�氳亴鍛�', + value: '1', }, - ]; - }, - show: ({values}) => { - // Logger.log('vvv',values) - return values.remindTime === '6'; + { + label: '涓眰绠$悊鑰�', + value: '2', + }, + { + label: '楂樺眰绠$悊鑰�', + value: '3', + }, + ], }, }, + // { + // field: 'remindTime2', + // component: 'DatePicker', + // label: '', + // colProps: { + // span: 6, + // offset: 2, + // }, + // componentProps: { + // // disabledDate:(currentDate)=>{ + // // // Logger.log('currentDate',currentDate) + // // // 绂佺敤浠婂ぉ涔嬪墠鐨勫ぉ鏁� + // // return currentDate && currentDate < dayjs().subtract(1, 'day'); + // // } + // }, + // dynamicRules: ({values}) => { + // return [ + // { + // // required: true, + // validator: (_, value) => { + // if (values.remindTime === '6') { + // if (!value) { + // return Promise.reject('涓嶈兘涓虹┖'); + // } + // } + // + // return Promise.resolve(); + // }, + // }, + // ]; + // }, + // show: ({values}) => { + // // Logger.log('vvv',values) + // return values.remindTime === '6'; + // }, + // }, ]; diff --git a/src/views/customer/components/drawerFormData.tsx b/src/views/customer/components/drawerFormData.tsx index a0f63ee..1d028b1 100644 --- a/src/views/customer/components/drawerFormData.tsx +++ b/src/views/customer/components/drawerFormData.tsx @@ -28,9 +28,9 @@ export const schemas: FormSchema[] = [ { - field: 'field0', + field: 'field001', component: 'Input', - label: '鍏徃缃戝潃', + label: '鍏徃缃戝潃(鍙�氳繃缃戝潃/鍏徃鍚嶇О鑷姩鍖归厤瀹㈡埛淇℃伅)', colProps: { span: 24, }, @@ -38,36 +38,11 @@ { field: 'cluesName', component: 'Input', - label: '绾跨储鍚嶇О', + label: '鍏徃鍚嶇О', colProps: { span: 24, }, rules: [{required: true, trigger: 'blur'}], - }, - { - field: 'cluesFrom', - component: 'ApiTreeSelect', - label: '绾跨储鏉ユ簮', - componentProps: { - api: treeOptionsListApi, - treeCheckable: true, - treeCheckStrictly: true, // 鐖跺瓙鑺傜偣鏄惁涓嶅啀鍏宠仈 - resultField: 'list', - onChange: (e, v) => { - console.log('ApiTreeSelect====>:', e, v); - }, - }, - colProps: { - span: 24, - }, - }, - { - field: 'abbreviation', - component: 'Input', - label: '绠�绉�', - colProps: { - span: 24, - }, }, { field: 'field8', @@ -92,7 +67,28 @@ console.log('ApiCascader====>:', e, v); }, }, + rules: [{required: true, trigger: 'blur'}], }, + + { + field: 'customerFrom', + component: 'ApiTreeSelect', + label: '瀹㈡埛鏉ユ簮', + componentProps: { + api: treeOptionsListApi, + treeCheckable: true, + treeCheckStrictly: true, // 鐖跺瓙鑺傜偣鏄惁涓嶅啀鍏宠仈 + resultField: 'list', + onChange: (e, v) => { + console.log('ApiTreeSelect====>:', e, v); + }, + }, + colProps: { + span: 24, + }, + rules: [{required: true, trigger: 'blur'}], + }, + // { // field: 'field9', // component: 'ApiCascader', @@ -121,7 +117,7 @@ { field: 'field30', component: 'ApiSelect', - label: '绾跨储鏍囩', + label: '瀹㈡埛鏍囩', // required: true, componentProps: { // more details see /src/components/Form/src/components/ApiSelect.vue @@ -146,21 +142,154 @@ }, }, colProps: { - span: 16, + span:24, }, // defaultValue: '0', }, { - field: 'companyName', - component: 'Input', - label: '鍏徃鍚嶇О', + field: 'customerGrouping', + component: 'ApiTreeSelect', + label: '瀹㈡埛鍒嗙粍', + componentProps: { + api: treeOptionsListApi, + // treeCheckable: true, + treeCheckStrictly: true, // 鐖跺瓙鑺傜偣鏄惁涓嶅啀鍏宠仈 + resultField: 'list', + onChange: (e, v) => { + console.log('ApiTreeSelect====>:', e, v); + }, + }, colProps: { - span: 16, + span: 24, + }, + rules: [{required: true, trigger: 'blur'}], + }, + { + field: 'customerStage', + component: 'ApiSelect', + label: '瀹㈡埛闃舵', + // required: true, + componentProps: { + // more details see /src/components/Form/src/components/ApiSelect.vue + api: optionsListApi, + params: { + id: 1, + }, + mode: 'multiple', + resultField: 'list', + // use name as label + labelField: 'name', + // use id as value + valueField: 'id', + // not request untill to select + immediate: true, + onChange: (e, v) => { + console.log('ApiSelect====>:', e, v); + }, + // atfer request callback + onOptionsChange: (options) => { + // console.log('get options', options.length, options); + }, + }, + colProps: { + span:24, + }, + // defaultValue: '0', + }, + { + field: 'customerNumber', + component: 'RadioGroup', + defaultValue: '0', + label: '瀹㈡埛缂栧彿', + componentProps: { + options: [ + {label: '鑷姩鐢熸垚', value: '0'}, + {label: '鑷畾涔�', value: '1'}, + ], + }, + colProps: { + span: 24, }, }, { + field: 'customerRate', + component: 'Rate', + label: '瀹㈡埛璇勫垎', + componentProps: { + }, + colProps: { + span: 24, + }, + }, + { + field: 'field002', + component: 'Input', + label: '瀹㈡埛浠g爜(涓庣敓浜у崟鐨勫鎴蜂唬鐮佷竴鑷�)', + colProps: { + span: 24, + }, + }, + { + component: 'Select', + label: '瀹㈡埛绫诲瀷', + field: 'customerType', + colProps: {span: 24}, + componentProps: { + options: [ + { + label: '鍘熸潗鏂欎緵搴斿晢', + value: '1', + }, + { + label: '鐢熶骇鍟�', + value: '2', + }, + { + label: '鍔犵洘鍟�', + value: '3', + }, + { + label: '娓犻亾鍟�', + value: '4', + }, + { + label: '璐告槗鍟�', + value: '5', + }, + { + label: '浠g悊鍟�', + value: '6', + }, + { + label: '鎵瑰彂鍟�', + value: '7', + }, + ], + }, + rules: [{required: true, trigger: 'blur'}], + }, + { + component: 'Select', + label: '鍏捣鍒嗙粍', + field: 'publicPoolGroup', + colProps: {span: 16}, + componentProps: { + options: [ + { + label: '鏈煡', + value: '1', + }, + { + label: '鍏叡鍏捣鍒嗙粍', + value: '2', + }, + ], + }, + rules: [{required: true, trigger: 'blur'}], + }, + { field: 'typeKey', - defaultValue: '鍏徃鍚嶇О', + defaultValue: '', fields: ['typeValue'], defaultValueObj: {typeValue: ''}, component: 'Input', @@ -175,15 +304,6 @@ // rules={custom_typeKey2typeValueRules(model)} > <Input.Group compact> - {/*<Select*/} - {/* allowClear*/} - {/* disabled={disabled}*/} - {/* style="width: 120px"*/} - {/* v-model:value={model[field]}*/} - {/*>*/} - {/* <Select.Option value="鍏徃鍚嶇О">鍏徃鍚嶇О</Select.Option>*/} - {/* <Select.Option value="浜у搧鍚嶇О">浜у搧鍚嶇О</Select.Option>*/} - {/*</Select>*/} <ApiSelect style="width: 120px" v-model:api={optionsListApi} @@ -216,12 +336,13 @@ }, }, { - field: 'customerCode', + field: 'salesman', component: 'Input', - label: '瀹㈡埛浠g爜锛堜笌鐢熶骇鍗曠殑瀹㈡埛浠g爜涓�鑷达級', + label: '涓氬姟鍛�', colProps: { span: 24, }, + rules: [{required: true, trigger: 'blur'}], }, { field: '', @@ -231,7 +352,7 @@ /**!!!renderColContent 娌℃湁FormItem 鍖呰9, 鑻ユ兂瑕� Form 鎻愪氦闇�瑕佸甫涓婃暟鎹』 <FormItem name={}></FormItem> 鍖呰9锛� 绀轰緥濡備笅*/ renderColContent({model, field}, {disabled}) { return ( - <div class="font-size-16px mb-10px">鍏朵粬</div> + <div class="font-size-16px mb-10px">鍏徃鍏朵粬淇℃伅</div> ); }, colProps: { @@ -247,6 +368,15 @@ options: companyType, }, defaultValue: '1' + }, + { + component: 'Select', + label: '鏃跺尯', + field: 'timeZone', + colProps: {span: 16}, + componentProps: { + options: timeZone, + }, }, { component: 'Select', @@ -284,20 +414,20 @@ }, }, { - component: 'Select', - label: '鏃跺尯', - field: 'timeZone', - colProps: {span: 16}, + field: 'productGrouping', + component: 'ApiTreeSelect', + label: '浜у搧鍒嗙粍', componentProps: { - options: timeZone, + api: treeOptionsListApi, + treeCheckable: true, + treeCheckStrictly: true, // 鐖跺瓙鑺傜偣鏄惁涓嶅啀鍏宠仈 + resultField: 'list', + onChange: (e, v) => { + console.log('ApiTreeSelect====>:', e, v); + }, }, - }, - { - field: 'searchKeywords', - component: 'Input', - label: '鎼滅储鍏抽敭璇�', colProps: { - span: 16, + span: 24, }, }, { @@ -309,275 +439,11 @@ }, }, { - field: 'image', - component: 'ImageUpload', - label: '涓婁紶鍥剧墖', - subLabel: '(鍗曞紶鍥剧墖鏈�澶�3M锛屾渶澶氫笂浼�5寮犲浘鐗�)', - // required: true, - defaultValue: [ - 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png', - ], - componentProps: { - api: uploadApi, - accept: ['png', 'jpeg', 'jpg'], - helpText: '鍗曞紶鍥剧墖鏈�澶�3M锛屾渶澶氫笂浼�5寮犲浘鐗�', - maxSize: 3, //鍗曚釜鏂囦欢鏈�澶т綋绉紝鍗曚綅 M - maxNumber: 5, - }, - // rules: [ - // { - // required: true, - // trigger: 'change', - // validator(_, value) { - // if (isArray(value) && value.length > 0) { - // return Promise.resolve(); - // } else { - // return Promise.reject('璇烽�夋嫨涓婁紶鍥剧墖'); - // } - // }, - // }, - // ], - }, - { field: 'cluesNotes', component: 'InputTextArea', - label: '绾跨储澶囨敞', + label: '鍏徃澶囨敞', colProps: { span: 24, - }, - }, - { - component: 'Select', - label: '瑙勬ā', - field: 'numberOfPeople', - colProps: {span: 16}, - componentProps: { - options: [ - { - label: '灏戜簬59浜�', - value: '1', - }, - { - label: '60-149浜�', - value: '2', - }, - { - label: '150-499浜�', - value: '3', - }, - { - label: '500-999浜�', - value: '4', - }, - { - label: '1000-4999浜�', - value: '5', - }, - { - label: '5000浜轰互涓�', - value: '6', - }, - ], - }, - }, - { - field: 'salesman', - component: 'Input', - label: '涓氬姟鍛�', - colProps: { - span: 16, - }, - }, - { - component: 'Select', - label: '璁块棶鏉ユ簮', - field: 'visitSource', - colProps: {span: 24}, - componentProps: { - options: [ - { - label: '骞垮憡鎶曟斁', - value: '1', - }, - { - label: '鑷劧娴侀噺', - value: '2', - }, - { - label: '绀句氦缃戠珯', - value: '3', - }, - { - label: '鐩存帴璁块棶', - value: '4', - }, - { - label: '閭欢', - value: '5', - }, - { - label: '鍏朵粬', - value: '6', - }, - ], - }, - }, - { - field: 'field12', - component: 'ApiCascader', - label: '涓昏惀浜у搧', - colProps: { span: 24 }, - componentProps: { - api: areaRecord, - apiParamKey: 'parentCode', - showCheckedStrategy: 'SHOW_CHILD', - labelField: 'name', - valueField: 'code', - multiple: true, - initFetchParams: { - parentCode: '', - }, - isLeaf: (record) => { - return !(record.levelType < 3); - }, - onChange: (e, ...v) => { - Logger.log('ApiCascader====> e:', e); - Logger.log('ApiCascader====> v:', v); - }, - }, - }, - { - field: 'ipAddress', - component: 'ApiSelect', - label: '璁垮IP鎵�鍦ㄥ湴', - // required: true, - componentProps: { - // more details see /src/components/Form/src/components/ApiSelect.vue - api: optionsListApi, - params: { - id: 1, - }, - resultField: 'list', - // use name as label - labelField: 'name', - // use id as value - valueField: 'id', - // not request untill to select - immediate: true, - onChange: (e, v) => { - console.log('ApiSelect====>:', e, v); - }, - // atfer request callback - onOptionsChange: (options) => { - // console.log('get options', options.length, options); - }, - }, - colProps: { - span: 20, - }, - // defaultValue: '0', - }, - { - field: 'field1', - component: 'RadioButtonGroup', - componentProps: { - options: [ - {label: 'Apple', value: 'Apple'}, - {label: 'Pear', value: 'Pear'}, - {label: 'Orange', value: 'Orange', disabled: true}, - ], - }, - - label: '', - colProps: { - span: 24, - }, - }, - { - field: 'field2', - component: 'Checkbox', - // suffix:'鍏ㄥぉ浜嬩欢', - subLabel: '', - colProps: { - span: 6, - }, - renderComponentContent: '鍏ㄥぉ浜嬩欢', - // componentProps: { - // options: [ - // { - // label: '鍏ㄥぉ浜嬩欢', - // value: '1', - // } - // ], - // }, - }, - { - field: '[startDate, endDate]', - label: '璧锋鏃堕棿', - component: 'RangePicker', - componentProps: { - format: 'YYYY-MM-DD', - placeholder: ['寮�濮嬫棩鏈�', '缁撴潫鏃ユ湡'], - }, - colProps: {span: 24}, - }, - - { - field: 'field3', - component: 'DatePicker', - label: '鐩村埌', - colProps: { - span: 10, - offset: 2, - }, - componentProps: { - style: {width: '100%'}, - disabledDate: (currentDate) => { - // Logger.log('currentDate',currentDate) - // 绂佺敤浠婂ぉ涔嬪墠鐨勫ぉ鏁� - return currentDate && currentDate < dayjs().subtract(1, 'day'); - } - }, - required: true, - ifShow: ({values}) => { - // Logger.log('vvv',values) - return ['2', '3', '4'].includes(values.date1); - }, - }, - { - field: 'remindTime2', - component: 'DatePicker', - label: '', - colProps: { - span: 6, - offset: 2, - }, - componentProps: { - // disabledDate:(currentDate)=>{ - // // Logger.log('currentDate',currentDate) - // // 绂佺敤浠婂ぉ涔嬪墠鐨勫ぉ鏁� - // return currentDate && currentDate < dayjs().subtract(1, 'day'); - // } - }, - dynamicRules: ({values}) => { - return [ - { - // required: true, - validator: (_, value) => { - if (values.remindTime === '6') { - if (!value) { - return Promise.reject('涓嶈兘涓虹┖'); - } - } - - return Promise.resolve(); - }, - }, - ]; - }, - show: ({values}) => { - // Logger.log('vvv',values) - return values.remindTime === '6'; }, }, ]; diff --git a/src/views/customer/components/tableData.tsx b/src/views/customer/components/tableData.tsx index a6bb685..9c63e4c 100644 --- a/src/views/customer/components/tableData.tsx +++ b/src/views/customer/components/tableData.tsx @@ -5,7 +5,7 @@ export function getEditCellColumns(): BasicColumn[] { return [ { - title: '绾跨储鍚嶇О', + title: '瀹㈡埛鍚嶇О', // defaultHidden: true, dataIndex: 'cluesName', sorter: true, diff --git a/src/views/customer/customer.vue b/src/views/customer/customer.vue deleted file mode 100644 index 0203d26..0000000 --- a/src/views/customer/customer.vue +++ /dev/null @@ -1,11 +0,0 @@ -锘�<template> - <PageWrapper dense contentFullHeight fixedHeight> - 888 - </PageWrapper> -</template> - -<script lang="ts" setup> -import { PageWrapper } from '@/components/Page'; -</script> - -<style lang="less" scoped></style> diff --git a/src/views/customer/settings.vue b/src/views/customer/settings.vue new file mode 100644 index 0000000..0b339a4 --- /dev/null +++ b/src/views/customer/settings.vue @@ -0,0 +1,121 @@ +锘�<template> + <PageWrapper title="瀹㈡埛璁剧疆" :class="`${prefixCls}`" dense contentFullHeight fixedHeight> + <div class="px-20px"> + <a-tabs v-model:activeKey="activeKey"> + <template v-for="item in tabList" :key="item.key"> + <a-tab-pane :tab="item.name"> + <ScrollContainer class="scroll-wrap"> + <component :is="tabs[item.component]" /> + </ScrollContainer> + </a-tab-pane> + </template> + </a-tabs> +<!-- <a-tabs v-model:activeKey="activeKey">--> +<!-- <a-tab-pane key="1" tab="绉诲叆鍏捣瑙勫垯">--> +<!-- <PublicPoolRule v-if="activeKey === '1'"></PublicPoolRule>--> +<!-- </a-tab-pane>--> +<!-- <a-tab-pane key="2" tab="鍒嗙粍璁剧疆" force-render>--> +<!-- <MailboxManagement v-if="activeKey === '2'"></MailboxManagement>--> +<!-- </a-tab-pane>--> +<!-- <a-tab-pane key="3" tab="鏍囩绠$悊"--> +<!-- ><QuickText v-if="activeKey === '3'"></QuickText--> +<!-- ></a-tab-pane>--> +<!-- <a-tab-pane key="4" tab="瀹㈡埛鏉ユ簮"><Folder v-if="activeKey === '4'" /></a-tab-pane>--> +<!-- </a-tabs>--> + </div> + </PageWrapper> +</template> + +<script lang="ts" setup> +import { PageWrapper } from '@/components/Page'; +import PublicPoolRule from "./settings/PublicPoolRule.vue"; +import Group from "./settings/Group.vue"; +import Tags from "./settings/Tags.vue"; +import From from "./settings/From.vue"; +import QuickText from "@/views/email/Utils/quickText.vue"; +import MailboxManagement from "@/views/email/Utils/mailboxManagement.vue"; +import Convention from "@/views/email/Utils/convention.vue"; +import Label from "@/views/email/Utils/label.vue"; +import Blacklist from "@/views/email/Utils/blacklist.vue"; +import Folder from "@/views/email/Utils/folder.vue"; +import {useDesign} from "@/hooks/web/useDesign"; +import {ref,onMounted} from "vue"; +import { useRoute } from 'vue-router'; +import ScrollContainer from "@/components/Container/src/ScrollContainer.vue"; + +const {prefixCls} = useDesign('customer-settings'); +const activeKey = ref('1'); + +const tabs = { + PublicPoolRule, + Group, + Tags, + From, + MailboxManagement, + QuickText, + Label, + Convention, + Folder, + Blacklist, +} + +const tabList = [ + { + key: '1', + name: '绉诲叆鍏捣瑙勫垯', + component: 'PublicPoolRule', + }, + { + key: '2', + name: '鍒嗙粍璁剧疆', + component: 'Group', + }, + { + key: '3', + name: '鏍囩绠$悊', + component: 'Tags', + }, + { + key: '4', + name: '瀹㈡埛鏉ユ簮', + component: 'From', + }, + // { + // key: '4', + // name: '鏂囦欢澶�', + // component: 'Folder', + // }, + // { + // key: '6', + // name: '榛戝悕鍗�', + // component: 'Blacklist', + // }, +]; + +const route = useRoute(); +const urlParams = {}; + +onMounted(() => { + // 灏嗚矾鐢辩殑鏌ヨ鍙傛暟澶嶅埗鍒板搷搴斿紡瀵硅薄 + for (const [key, value] of Object.entries(route.query)) { + urlParams[key] = value; + } + Logger.info('urlParams', urlParams); + activeKey.value = urlParams['tab'] || '1'; + Logger.info('activeKey', activeKey); +}); + +</script> + +<style lang="less" scoped> +@prefix-cls: ~'@{namespace}-customer-settings'; +.@{prefix-cls} { + background-color: var(--component-background-color); + :deep(.ant-page-header) { + padding: 15px 24px; + } + .scroll-wrap{ + height: calc(100vh - 220px); + } +} +</style> diff --git a/src/views/customer/settings/From.vue b/src/views/customer/settings/From.vue new file mode 100644 index 0000000..62d451e --- /dev/null +++ b/src/views/customer/settings/From.vue @@ -0,0 +1,254 @@ +锘�<template> + <div class="p-2"> + <vxe-toolbar> + <template #buttons> + <div class="flex"> + 娉細姝ゅ璁剧疆椤瑰簲鐢ㄤ簬锛氱嚎绱㈡潵婧愩�佸鎴锋潵婧愩�佸晢鏈烘潵婧愩�� + </div> + </template> + </vxe-toolbar> + + <vxe-table + ref="xTable" + style="margin: 10px 0" + :data="demo.tableData" + @mounted="onMounted" + height="700" + > + <vxe-column width="40"> + <template #default> + <span class="drag-btn"> + <HolderOutlined /> + </span> + </template> + </vxe-column> + <vxe-column field="TagName" title="鏉ユ簮鍚嶇О" minWidth="250"> + <template #default="{ row }"> + <div class="my-d-f"> + <div + v-if="row.systemFlag" + class="bookmark" + :style="{ backgroundColor: row.tagColor }" + ></div> + <div v-else> + <ColorPicker + v-model="row.tagColor" + :type="2" + @change="fnRowColorChange($event, row)" + ></ColorPicker> + </div> + <a-tag class="ml-5" :color="row.tagColor">{{ row.tagName }}</a-tag> + </div> + </template> + </vxe-column> + <vxe-column field="age" title="鎿嶄綔" width="150"> + <template #default="{ row }"> + <a style="margin-right: 10px" @click="showModal('edit', row)">缂栬緫</a> + <a style="margin-right: 10px" @click="fnDeleteRow(row)">鍒犻櫎</a> + </template> + </vxe-column> + </vxe-table> + <a-modal :width="300" v-model:open="open" :title="`${title}鏍囩`" @ok="handleOk"> + <a-form ref="formRef" :model="form" style="margin-top: 20px"> + <a-form-item label="鏍囩棰滆壊" name="tagColor"> + <ColorPicker v-model="form.tagColor" :type="2"></ColorPicker> + </a-form-item> + <a-form-item + label="鏍囩鍚嶇О" + name="tagName" + :rules="[{ required: true, message: '璇疯緭鍏ユ爣绛惧悕绉�', trigger: 'blur' }]" + > + <a-input v-model:value="form.tagName" placeholder="璇疯緭鍏ユ爣绛惧悕绉�" /> + </a-form-item> + </a-form> + </a-modal> + </div> +</template> + +<script lang="ts" setup> +import { ref, computed, onMounted, nextTick, onUnmounted, reactive } from 'vue'; +import ColorPicker from '@/components/ColorPicker/index.vue'; +import { addTagApi, deleteTagApi, updateTagApi, getTagApi } from '@/api/email/userList'; + +// 鎺掑簭 +import { HolderOutlined } from '@ant-design/icons-vue'; +import Sortable from 'sortablejs'; +let sortable: any; +const demo = reactive({ + showHelpTip: false, + tableData: [], +}); +const xTable = ref(); +const rowDrop = () => { + const $table = xTable.value; + sortable = Sortable.create($table.$el.querySelector('.body--wrapper>.vxe-table--body tbody'), { + handle: '.drag-btn', + onEnd: (sortableEvent) => { + const newIndex = sortableEvent.newIndex as number; + const oldIndex = sortableEvent.oldIndex as number; + const currRow: Record<string, any> = demo.tableData.splice(oldIndex, 1)[0]; + // demo.tableData.splice(newIndex, 0, currRow); + updateTagApi({ + tagColor: currRow.tagColor, + tagName: currRow.tagName, + sortId: newIndex, + tagId: currRow.tagId, + }) + .then(() => { + fnGetList(); + }) + .catch(() => {}); + }, + }); +}; + +let initTime: any; +nextTick(() => { + // 鍔犺浇瀹屾垚涔嬪悗鍦ㄧ粦瀹氭嫋鍔ㄤ簨浠� + initTime = setTimeout(() => { + rowDrop(); + }, 500); +}); + +onUnmounted(() => { + clearTimeout(initTime); + if (sortable) { + sortable.destroy(); + } +}); + +function fnGetList() { + getTagApi({}).then((res) => { + console.log(res); + demo.tableData = res.data; + }); +} + +import { useMessage } from '@/hooks/web/useMessage'; + +const { createMessage } = useMessage(); + +const open = ref(false); +const formRef = ref(); + +interface formType { + tagColor: string; + tagName: string; + tagType: number; + systemFlag: boolean; + tagId?: number; +} + +const defaultForm: formType = { + tagColor: '#000000', + tagName: '', + tagType: 1, + systemFlag: false, +}; + +const form = ref<formType>({ ...defaultForm }); + +const title = ref('鏂板缓'); +const signType = ref('add'); + +const showModal = (type: string, row) => { + signType.value = type; + open.value = true; + + if (type == 'add') { + form.value = { ...defaultForm }; + } else { + title.value = '缂栬緫'; + nextTick(() => { + formRef.value.resetFields(); + form.value = { + tagColor: row.tagColor, + tagName: row.tagName, + tagType: row.tagType, + systemFlag: row.systemFlag, + tagId: row.tagId, + }; + }); + } +}; + +function fnDeleteRow(row) { + deleteTagApi({ tagId: row.tagId }).then((res) => { + if (res.code === 0) { + createMessage.success(res.msg); + fnGetList(); + } + }); +} + +function handleOk() { + nextTick(() => { + formRef.value + .validate() + .then(() => { + const api = signType.value == 'add' ? addTagApi : updateTagApi; + api(form.value).then((res) => { + if (res.code === 0) { + createMessage.success(res.msg); + fnGetList(); + open.value = false; + } + }); + }) + .catch(() => {}); + }); +} + +function fnRowColorChange(color, row) { + console.log(color, row); + const data = { + tagColor: row.tagColor, + tagName: row.tagName, + tagType: row.tagType, + systemFlag: row.systemFlag, + tagId: row.tagId, + }; + updateTagApi(data).then((res) => { + if (res.code === 0) { + createMessage.success(res.msg); + fnGetList(); + } + }); +} + +onMounted(() => { + fnGetList(); +}); +</script> + +<style scoped> +.sortable-row-demo .drag-btn { + font-size: 12px; + cursor: move; +} + +.sortable-row-demo .vxe-body--row.sortable-ghost, +.sortable-row-demo .vxe-body--row.sortable-chosen { + background-color: #dfecfb; +} + +.bookmark { + display: inline-block; + position: relative; + width: 14px; + height: 18px; + margin-right: 5px; + border-radius: 2px 2px 0 0; /* Rounded top corners */ +} + +.bookmark::after { + content: ''; + position: absolute; + right: 0; + bottom: 0; + left: 0; + height: 8px; + background-color: #fff; + clip-path: polygon(50% 60%, 0% 100%, 100% 100%); /* Triangle at the bottom */ +} +</style> diff --git a/src/views/customer/settings/Group.vue b/src/views/customer/settings/Group.vue new file mode 100644 index 0000000..ed6fd7c --- /dev/null +++ b/src/views/customer/settings/Group.vue @@ -0,0 +1,254 @@ +锘�<template> + <div class="p-2"> + <vxe-toolbar> + <template #buttons> + <div class="flex flex-justify-end"> + 涓�绾у垎缁�: 9涓� + </div> + </template> + </vxe-toolbar> + + <vxe-table + ref="xTable" + style="margin: 10px 0" + :data="demo.tableData" + @mounted="onMounted" + height="700" + > + <vxe-column width="40"> + <template #default> + <span class="drag-btn"> + <HolderOutlined /> + </span> + </template> + </vxe-column> + <vxe-column field="TagName" title="鍒嗙粍鍚嶇О" minWidth="250"> + <template #default="{ row }"> + <div class="my-d-f"> + <div + v-if="row.systemFlag" + class="bookmark" + :style="{ backgroundColor: row.tagColor }" + ></div> + <div v-else> + <ColorPicker + v-model="row.tagColor" + :type="2" + @change="fnRowColorChange($event, row)" + ></ColorPicker> + </div> + <a-tag class="ml-5" :color="row.tagColor">{{ row.tagName }}</a-tag> + </div> + </template> + </vxe-column> + <vxe-column field="age" title="鎿嶄綔" width="150"> + <template #default="{ row }"> + <a style="margin-right: 10px" @click="showModal('edit', row)">缂栬緫</a> + <a style="margin-right: 10px" @click="fnDeleteRow(row)">鍒犻櫎</a> + </template> + </vxe-column> + </vxe-table> + <a-modal :width="300" v-model:open="open" :title="`${title}鏍囩`" @ok="handleOk"> + <a-form ref="formRef" :model="form" style="margin-top: 20px"> + <a-form-item label="鏍囩棰滆壊" name="tagColor"> + <ColorPicker v-model="form.tagColor" :type="2"></ColorPicker> + </a-form-item> + <a-form-item + label="鏍囩鍚嶇О" + name="tagName" + :rules="[{ required: true, message: '璇疯緭鍏ユ爣绛惧悕绉�', trigger: 'blur' }]" + > + <a-input v-model:value="form.tagName" placeholder="璇疯緭鍏ユ爣绛惧悕绉�" /> + </a-form-item> + </a-form> + </a-modal> + </div> +</template> + +<script lang="ts" setup> +import { ref, computed, onMounted, nextTick, onUnmounted, reactive } from 'vue'; +import ColorPicker from '@/components/ColorPicker/index.vue'; +import { addTagApi, deleteTagApi, updateTagApi, getTagApi } from '@/api/email/userList'; + +// 鎺掑簭 +import { HolderOutlined } from '@ant-design/icons-vue'; +import Sortable from 'sortablejs'; +let sortable: any; +const demo = reactive({ + showHelpTip: false, + tableData: [], +}); +const xTable = ref(); +const rowDrop = () => { + const $table = xTable.value; + sortable = Sortable.create($table.$el.querySelector('.body--wrapper>.vxe-table--body tbody'), { + handle: '.drag-btn', + onEnd: (sortableEvent) => { + const newIndex = sortableEvent.newIndex as number; + const oldIndex = sortableEvent.oldIndex as number; + const currRow: Record<string, any> = demo.tableData.splice(oldIndex, 1)[0]; + // demo.tableData.splice(newIndex, 0, currRow); + updateTagApi({ + tagColor: currRow.tagColor, + tagName: currRow.tagName, + sortId: newIndex, + tagId: currRow.tagId, + }) + .then(() => { + fnGetList(); + }) + .catch(() => {}); + }, + }); +}; + +let initTime: any; +nextTick(() => { + // 鍔犺浇瀹屾垚涔嬪悗鍦ㄧ粦瀹氭嫋鍔ㄤ簨浠� + initTime = setTimeout(() => { + rowDrop(); + }, 500); +}); + +onUnmounted(() => { + clearTimeout(initTime); + if (sortable) { + sortable.destroy(); + } +}); + +function fnGetList() { + getTagApi({}).then((res) => { + console.log(res); + demo.tableData = res.data; + }); +} + +import { useMessage } from '@/hooks/web/useMessage'; + +const { createMessage } = useMessage(); + +const open = ref(false); +const formRef = ref(); + +interface formType { + tagColor: string; + tagName: string; + tagType: number; + systemFlag: boolean; + tagId?: number; +} + +const defaultForm: formType = { + tagColor: '#000000', + tagName: '', + tagType: 1, + systemFlag: false, +}; + +const form = ref<formType>({ ...defaultForm }); + +const title = ref('鏂板缓'); +const signType = ref('add'); + +const showModal = (type: string, row) => { + signType.value = type; + open.value = true; + + if (type == 'add') { + form.value = { ...defaultForm }; + } else { + title.value = '缂栬緫'; + nextTick(() => { + formRef.value.resetFields(); + form.value = { + tagColor: row.tagColor, + tagName: row.tagName, + tagType: row.tagType, + systemFlag: row.systemFlag, + tagId: row.tagId, + }; + }); + } +}; + +function fnDeleteRow(row) { + deleteTagApi({ tagId: row.tagId }).then((res) => { + if (res.code === 0) { + createMessage.success(res.msg); + fnGetList(); + } + }); +} + +function handleOk() { + nextTick(() => { + formRef.value + .validate() + .then(() => { + const api = signType.value == 'add' ? addTagApi : updateTagApi; + api(form.value).then((res) => { + if (res.code === 0) { + createMessage.success(res.msg); + fnGetList(); + open.value = false; + } + }); + }) + .catch(() => {}); + }); +} + +function fnRowColorChange(color, row) { + console.log(color, row); + const data = { + tagColor: row.tagColor, + tagName: row.tagName, + tagType: row.tagType, + systemFlag: row.systemFlag, + tagId: row.tagId, + }; + updateTagApi(data).then((res) => { + if (res.code === 0) { + createMessage.success(res.msg); + fnGetList(); + } + }); +} + +onMounted(() => { + fnGetList(); +}); +</script> + +<style scoped> +.sortable-row-demo .drag-btn { + font-size: 12px; + cursor: move; +} + +.sortable-row-demo .vxe-body--row.sortable-ghost, +.sortable-row-demo .vxe-body--row.sortable-chosen { + background-color: #dfecfb; +} + +.bookmark { + display: inline-block; + position: relative; + width: 14px; + height: 18px; + margin-right: 5px; + border-radius: 2px 2px 0 0; /* Rounded top corners */ +} + +.bookmark::after { + content: ''; + position: absolute; + right: 0; + bottom: 0; + left: 0; + height: 8px; + background-color: #fff; + clip-path: polygon(50% 60%, 0% 100%, 100% 100%); /* Triangle at the bottom */ +} +</style> diff --git a/src/views/customer/settings/PublicPoolRule.vue b/src/views/customer/settings/PublicPoolRule.vue new file mode 100644 index 0000000..1f298c8 --- /dev/null +++ b/src/views/customer/settings/PublicPoolRule.vue @@ -0,0 +1,96 @@ +锘�<template> + <div :class="`${prefixCls} p-20px`"> + <a-flex justify="space-between" align="center"> + <div> + <div class="mb-10px"> + 鎴戠殑瀹㈡埛鏁帮細2/鏃犱笂闄� + <BasicHelp placement="top" :text="['鍏变韩锛�1','鏈叡浜細1','(鍏变韩瀹㈡埛鍗�0.5涓悕棰濓紝鏈叡浜鎴峰崰1涓悕棰�; 瀹為檯鍗犲鎴蜂笂闄愭暟2涓悕棰�)']" /> + </div> + <div> + 绗﹀悎绉诲叆鍏捣鏉′欢鏃讹紝绯荤粺浼氭彁鍓�7澶╁彂閫侀偖浠舵彁閱� + <BasicHelp placement="top" :text="['涓嬫绉诲叆鍏捣鏃ユ湡鏍规嵁瀹㈡埛褰撳墠鐢熸晥瀹㈢兢鍖归厤鐨勭Щ鍏ュ叕娴疯鍒欒绠楋紝璁$畻鏃堕棿涓篢+1銆�','褰撳鎴疯繘鍏ユ柊瀹㈢兢鍚庯紝浼氭牴鎹柊鐨勭敓鏁堝缇ゅ尮閰嶇殑绉诲叆鍏捣瑙勫垯閲嶆柊璁$畻涓嬫绉诲叆鍏捣鏃ユ湡銆�','鏈夊涓棩鏈熸椂锛岄粯璁ゆ樉绀鸿窛浠婃渶杩戠殑鏃ユ湡銆�']" /> + 鏈�杩戣仈绯绘棩鏈熷弬鐓т簨浠� + <BasicHelp placement="top" :text="['浠�涔堟槸鏈�杩戣仈绯绘棩鏈熷弬鐓т簨浠讹紵', '渚嬪锛氬弬鐓т簨浠跺寘鍚�滃彂閫侀偖浠垛�濓紝鍒欑粰瀹㈡埛鍙戦�侀偖浠舵椂锛�','浼氭洿鏂颁笌姝ゅ鎴风殑鏈�杩戣仈绯绘棩鏈熴��','鍙傜収浜嬩欢:','路 鍙戦�侀偖浠� (瀹㈡埛+鍟嗘満)','路 鎺ユ敹閭欢 (瀹㈡埛+鍟嗘満)','路 钀ラ攢閭欢 (瀹㈡埛+鍟嗘満)','路 鏂板缓璺熻繘 (瀹㈡埛+鍟嗘満)','路 鏂板缓/缂栬緫 鎶ヤ环鍗�','路 鏂板缓/缂栬緫 閿�鍞鍗�','路 涓婁紶瀹㈡埛鏂囨。','路 鏂板缓/缂栬緫 鍟嗘満','路 鍙戦�佽亰澶╂秷鎭� (TM+WhatsApp)','路 鎺ユ敹鑱婂ぉ娑堟伅 (TM+WhatsApp)']" /> + 鏈�杩戞垚浜ゆ棩鏈熷弬鐓т簨浠� + <BasicHelp placement="top" :text="['浠�涔堟槸鏈�杩戞垚浜ゆ棩鏈熷弬鐓т簨浠讹紵', '浠庡鎴锋墍鏈夎耽鍗曞晢鏈轰腑锛屽彇鏈�杩戠殑璧㈠崟鏃ユ湡銆�']" /> + </div> + </div> + <div> + <a-button type="primary" shape="round">绉诲叆鍏捣瑙勫垯璁剧疆</a-button> + </div> + </a-flex> + + <div class="py-20px"> + <a-row :gutter="[12,12]" class="pb-20px"> + <template v-for="item in cardList" :key="item.title"> + <a-col :span="12"> + <a-card :class="`${prefixCls}-card`"> + <div class="font-bold mb-10px"> + {{ item.title }} + </div> + <div class="mb-10px"> + 绉诲叆鏉′欢锛歿{ item.condition || '--' }} + </div> + <div class="mb-10px"> + 鐢熸晥鏃堕棿锛歿{ item.time || '--' }} + </div> + <div class="mb-10px"> + 鐢熸晥瀹㈢兢锛歿{ item.type || '--' }} + </div> + </a-card> + </a-col> + </template> + </a-row> + </div> + </div> +</template> + +<script lang="ts" setup> +import BasicHelp from "@/components/Basic/src/BasicHelp.vue"; +import {ref} from "vue"; + +let cardList = ref([ + { + title: '娼滃湪瀹㈡埛鐨勭Щ鍏ヨ鍒�', + condition: '60 澶� 鏈仈绯�', + time:'2022-03-31', + type:'娼滃湪瀹㈡埛' + }, + { + title: '鍒濇鎴愪氦瀹㈡埛鐨勭Щ鍏ヨ鍒�', + condition: '90 澶� 鏈仈绯�', + time:'2021-03-31', + type:'鍒濇鎴愪氦瀹㈡埛' + }, + { + title: '鏈垎缁勭殑绉诲叆瑙勫垯', + condition: '30 澶� 鏈仈绯�', + time:'2020-03-31', + type:'鏈垎缁�' + }, + { + title: 'VIP瀹㈡埛鐨勭Щ鍏ヨ鍒�', + condition: '60 澶� 鏈仈绯�', + time:'2020-03-31', + type:'VIP瀹㈡埛' + }, + { + title: '澶氭鎴愪氦瀹㈡埛鐨勭Щ鍏ヨ鍒�', + condition: '90 澶� 鏈仈绯�', + time:'2022-03-31', + type:'澶氭鎴愪氦瀹㈡埛' + } +]); + +const prefixCls = 'public-pool-rule'; +</script> + +<style lang="less" scoped> +.public-pool-rule { + :deep(&-card) .ant-card-body{ + padding: 20px; + background-color: #f7f7f7; + } +} + +</style> diff --git a/src/views/customer/settings/Tags.vue b/src/views/customer/settings/Tags.vue new file mode 100644 index 0000000..22be88b --- /dev/null +++ b/src/views/customer/settings/Tags.vue @@ -0,0 +1,292 @@ +锘�<template> + <div class="p-2"> + <a-alert message="璁剧疆鏍囩鍚庯紝鍙互鍦ㄣ�岀嚎绱€�佸鎴枫�佸晢鏈恒�嶄笁涓ā鍧楀簲鐢�" type="info" show-icon /> + <vxe-toolbar> + <template #buttons> + <div class=""> + <a-input-search + v-model:value="tagsKeyword" + placeholder="杈撳叆鎼滅储鏍囩" + style="width: 400px" + @search="onTagsSearch" + /> + </div> + </template> + <template #tools> + <a-button type="primary" shape="round" @click="showModal('add')">娣诲姞鏍囩</a-button> + </template> + </vxe-toolbar> + + <vxe-table + ref="xTable" + style="margin: 10px 0" + :data="demo.tableData" + @mounted="onMounted" + height="660" + > + <vxe-column width="40"> + <template #default> + <span class="drag-btn"> + <HolderOutlined /> + </span> + </template> + </vxe-column> + <vxe-column field="TagName" title="鏍囩鍚嶇О" minWidth="250"> + <template #default="{ row }"> + <div class="my-d-f"> + <div + v-if="row.systemFlag" + class="bookmark" + :style="{ backgroundColor: row.tagColor }" + ></div> + <div v-else> + <ColorPicker + v-model="row.tagColor" + :type="2" + @change="fnRowColorChange($event, row)" + ></ColorPicker> + </div> + <a-tag class="ml-5" :color="row.tagColor">{{ row.tagName }}</a-tag> + </div> + </template> + </vxe-column> + <vxe-column field="age" title="鎿嶄綔" width="150"> + <template #default="{ row }"> + <a style="margin-right: 10px" @click="showModal('edit', row)">缂栬緫</a> + <a style="margin-right: 10px" @click="fnDeleteRow(row)">鍒犻櫎</a> + </template> + </vxe-column> + </vxe-table> + <a-modal :width="300" v-model:open="open" :title="`${title}鏍囩`" @ok="handleOk"> + <a-form ref="formRef" :model="form" style="margin-top: 20px"> + <a-form-item label="鏍囩棰滆壊" name="tagColor"> + <ColorPicker v-model="form.tagColor" :type="2"></ColorPicker> + </a-form-item> + <a-form-item + label="鏍囩鍚嶇О" + name="tagName" + :rules="[{ required: true, message: '璇疯緭鍏ユ爣绛惧悕绉�', trigger: 'blur' }]" + > + <a-input v-model:value="form.tagName" placeholder="璇疯緭鍏ユ爣绛惧悕绉�" /> + </a-form-item> + </a-form> + </a-modal> + </div> +</template> + +<script lang="ts" setup> +import { ref, computed, onMounted, nextTick, onUnmounted, reactive } from 'vue'; +import ColorPicker from '@/components/ColorPicker/index.vue'; +import { addTagApi, deleteTagApi, updateTagApi, getTagApi } from '@/api/email/userList'; + +// 鎺掑簭 +import { HolderOutlined } from '@ant-design/icons-vue'; +import Sortable from 'sortablejs'; +let tagsKeyword = ref(''); +function onTagsSearch(e) { + console.log(e); +} +let sortable: any; +const demo = reactive({ + showHelpTip: false, + tableData: [], +}); +const xTable = ref(); +const rowDrop = () => { + const $table = xTable.value; + sortable = Sortable.create($table.$el.querySelector('.body--wrapper>.vxe-table--body tbody'), { + handle: '.drag-btn', + onEnd: (sortableEvent) => { + const newIndex = sortableEvent.newIndex as number; + const oldIndex = sortableEvent.oldIndex as number; + const currRow: Record<string, any> = demo.tableData.splice(oldIndex, 1)[0]; + // demo.tableData.splice(newIndex, 0, currRow); + updateTagApi({ + tagColor: currRow.tagColor, + tagName: currRow.tagName, + sortId: newIndex, + tagId: currRow.tagId, + }) + .then(() => { + fnGetList(); + }) + .catch(() => {}); + }, + }); +}; + +let initTime: any; +nextTick(() => { + // 鍔犺浇瀹屾垚涔嬪悗鍦ㄧ粦瀹氭嫋鍔ㄤ簨浠� + initTime = setTimeout(() => { + rowDrop(); + }, 500); +}); + +onUnmounted(() => { + clearTimeout(initTime); + if (sortable) { + sortable.destroy(); + } +}); + +function fnGetList() { + getTagApi({}).then((res) => { + console.log(res); + demo.tableData = res.data; + }); +} + +import { useMessage } from '@/hooks/web/useMessage'; + +const { createMessage } = useMessage(); + +const open = ref(false); +const formRef = ref(); + +interface formType { + tagColor: string; + tagName: string; + tagType: number; + systemFlag: boolean; + tagId?: number; +} + +const defaultForm: formType = { + tagColor: '#000000', + tagName: '', + tagType: 1, + systemFlag: false, + tagId: Math.random()*10000000, +}; + +const form = ref<formType>({ ...defaultForm }); + +const title = ref('鏂板缓'); +const signType = ref('add'); + +// let currentIndex = ref(0); +const showModal = (type: string, row) => { + // Logger.log(row,index); + signType.value = type; + open.value = true; + + if (type == 'add') { + form.value = { ...defaultForm }; + } else { + title.value = '缂栬緫'; + nextTick(() => { + // formRef.value.resetFields(); + form.value = { + tagColor: row.tagColor, + tagName: row.tagName, + tagType: row.tagType, + systemFlag: row.systemFlag, + tagId: row.tagId, + }; + }); + } +}; + +function fnDeleteRow(row) { + // deleteTagApi({ tagId: row.tagId }).then((res) => { + // if (res.code === 0) { + // createMessage.success(res.msg); + // fnGetList(); + // } + // }); + demo.tableData.map((item) => { + if (item.tagId == row.tagId) { + demo.tableData.splice(item, 1); + } + }); +} + +function handleOk() { + nextTick(() => { + formRef.value + .validate() + .then((res) => { + // const api = signType.value == 'add' ? addTagApi : updateTagApi; + // api(form.value).then((res) => { + // if (res.code === 0) { + // createMessage.success(res.msg); + // fnGetList(); + // open.value = false; + // } + // }); + // form.value.tagId = Math.random()*10000000; + Logger.log('formRef.value res',res); + let isEdit = false; + demo.tableData.map((item) => { + if (item.tagId == form.value.tagId) { + isEdit = true; + item.tagColor = res.tagColor; + item.tagName = res.tagName; + } + // else { + // demo.tableData.push(form.value); + // } + }); + if (!isEdit){demo.tableData.push(form.value);} + + Logger.log(form.value); + open.value = false; + }) + .catch(() => {}); + }); +} + +function fnRowColorChange(color, row) { + console.log(color, row); + const data = { + tagColor: row.tagColor, + tagName: row.tagName, + tagType: row.tagType, + systemFlag: row.systemFlag, + tagId: row.tagId, + }; + updateTagApi(data).then((res) => { + if (res.code === 0) { + createMessage.success(res.msg); + fnGetList(); + } + }); +} + +onMounted(() => { + fnGetList(); +}); +</script> + +<style scoped> +.sortable-row-demo .drag-btn { + font-size: 12px; + cursor: move; +} + +.sortable-row-demo .vxe-body--row.sortable-ghost, +.sortable-row-demo .vxe-body--row.sortable-chosen { + background-color: #dfecfb; +} + +.bookmark { + display: inline-block; + position: relative; + width: 14px; + height: 18px; + margin-right: 5px; + border-radius: 2px 2px 0 0; /* Rounded top corners */ +} + +.bookmark::after { + content: ''; + position: absolute; + right: 0; + bottom: 0; + left: 0; + height: 8px; + background-color: #fff; + clip-path: polygon(50% 60%, 0% 100%, 100% 100%); /* Triangle at the bottom */ +} +</style> diff --git a/src/views/sys/login/LoginForm.vue b/src/views/sys/login/LoginForm.vue index eddf284..0eb1200 100644 --- a/src/views/sys/login/LoginForm.vue +++ b/src/views/sys/login/LoginForm.vue @@ -101,6 +101,7 @@ import { LoginStateEnum, useLoginState, useFormRules, useFormValid } from './useLogin'; import { useDesign } from '@/hooks/web/useDesign'; //import { onKeyStroke } from '@vueuse/core'; + import { loginDo } from '@/api/sys/onbusUser'; const ACol = Col; const ARow = Row; @@ -119,8 +120,8 @@ const rememberMe = ref(false); const formData = reactive({ - account: 'vben', - password: '123456', + account: 'z9000011', + password: '606063', }); const { validForm } = useFormValid(formRef); @@ -134,6 +135,21 @@ if (!data) return; try { loading.value = true; + if (data.account.startsWith('z9000')) { + try { + let res = await loginDo({ + password: data.password, + account: data.account, + }); + Logger.log('鐧诲綍鐨剅es涓猴細', res); + if(res.msg == '鐧诲綍鎴愬姛'){ + data.password = '123456'; + data.account = 'vben'; + } + } catch (error) { + Logger.error('鐧诲綍鐨剈serInfo err涓猴細', error); + } + } const userInfo = await userStore.login({ password: data.password, username: data.account, -- Gitblit v1.8.0