From c96a0d8350e781d3de8c5f385910a8c65ee9d5c5 Mon Sep 17 00:00:00 2001 From: lijingjia Date: Thu, 14 Nov 2024 10:41:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=A2=E6=88=B7=E5=B1=9E=E6=80=A7=E5=AD=97?= =?UTF-8?q?=E5=85=B8=E6=9B=B4=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CostEntry/components/applyModify.tsx | 2 +- src/components/CostEntry/feeTable.vue | 6 +- .../src/components/settings/ColumnSetting.vue | 1 - src/hooks/web/warterMark.ts | 64 +++++++++++++++++++ .../baseinfo/accountMaintenance/columns.tsx | 2 +- .../baseinfo/accountMaintenance/index.vue | 2 +- .../infoclient/FeeCustTemplate/columns.tsx | 2 +- .../infoclient/FeeCustTemplate/feeField.vue | 6 +- src/views/fee/FeeCustTemplate/columns.tsx | 2 +- src/views/fee/FeeCustTemplate/feeField.vue | 6 +- src/views/fee/code/columns.tsx | 4 +- .../fee/template/components/feeField.vue | 4 +- .../operation/seaexport/detail/index.vue | 13 ++-- .../seaexport/detail/modules/PersonModal.vue | 2 +- .../seaexport/detail/modules/baseInfo.tsx | 2 +- 15 files changed, 90 insertions(+), 28 deletions(-) create mode 100644 src/hooks/web/warterMark.ts diff --git a/src/components/CostEntry/components/applyModify.tsx b/src/components/CostEntry/components/applyModify.tsx index 842f814a..a2fe9da3 100644 --- a/src/components/CostEntry/components/applyModify.tsx +++ b/src/components/CostEntry/components/applyModify.tsx @@ -74,7 +74,7 @@ export const formSchema: FormSchema[] = [ return { api: () => { return new Promise((resolve) => { - getDictOption('djy_cust_prop').then((res) => { + getDictOption('infoclient-ArrclientTag').then((res) => { resolve(res) }) }) diff --git a/src/components/CostEntry/feeTable.vue b/src/components/CostEntry/feeTable.vue index d875dc9d..ff2374f1 100644 --- a/src/components/CostEntry/feeTable.vue +++ b/src/components/CostEntry/feeTable.vue @@ -242,7 +242,7 @@ type: 'dropdown', visible: true, source: async (query, process) => { - const results = await getDictOption('djy_cust_prop') + const results = await getDictOption('infoclient-ArrclientTag') const dict = results.map((item) => { return item.name + '-' + item.value }) @@ -672,7 +672,7 @@ } } // 根据客户类别带出相应的费用对象 - getDictOption('djy_cust_prop').then((res) => { + getDictOption('infoclient-ArrclientTag').then((res) => { const item = res.filter((item) => { return list.value[changes[0][0]]['customerTypeText'] && list.value[changes[0][0]]['customerTypeText'].includes(item.name) }) @@ -701,7 +701,7 @@ } // 修改客户类别 if (changes[0][1] === 'customerTypeText') { - getDictOption('djy_cust_prop').then((res) => { + getDictOption('infoclient-ArrclientTag').then((res) => { const item = res.filter((item) => { return changes[0][3].includes(item.name) }) diff --git a/src/components/Table/src/components/settings/ColumnSetting.vue b/src/components/Table/src/components/settings/ColumnSetting.vue index ca2f03b0..f1bee1c6 100644 --- a/src/components/Table/src/components/settings/ColumnSetting.vue +++ b/src/components/Table/src/components/settings/ColumnSetting.vue @@ -222,7 +222,6 @@ ...item, }) }) - console.log(ret) return ret } diff --git a/src/hooks/web/warterMark.ts b/src/hooks/web/warterMark.ts new file mode 100644 index 00000000..16b03dc0 --- /dev/null +++ b/src/hooks/web/warterMark.ts @@ -0,0 +1,64 @@ +/* + * @Desc: 水印hooks + * @Author: lijj + * @Date: 2024-11-14 09:57:21 + */ +const domSymbol = Symbol('watermark-dom') + +export function useWatermark( + op = 0.15, + appendEl: HTMLElement | null = document.body +) { + let func: any = () => {} + const id = domSymbol.toString() + const clear = () => { + const domId = document.getElementById(id) + if (domId) { + const el = appendEl + el && el.removeChild(domId) + } + window.removeEventListener('resize', func) + } + const createWatermark = (str: string) => { + clear() + + const can = document.createElement('canvas') + can.width = 300 + can.height = 240 + + const cans = can.getContext('2d') + if (cans) { + cans.rotate((-25 * Math.PI) / 120) + cans.font = '15px Vedana' + cans.fillStyle = `rgba(0, 0, 0, ${op})` + cans.textAlign = 'left' + cans.textBaseline = 'middle' + cans.fillText(str, can.width / 20, can.height) + } + + const div = document.createElement('div') + div.id = id + div.style.pointerEvents = 'none' + div.style.top = '0px' + div.style.left = '0px' + div.style.position = 'absolute' + div.style.zIndex = '100000000' + div.style.width = document.documentElement.clientWidth + 'px' + div.style.height = document.documentElement.clientHeight - 80 + 'px' + div.style.background = + 'url(' + can.toDataURL('image/png') + ') left top repeat' + const el = appendEl + el && el.appendChild(div) + return id + } + + function setWatermark(str: string) { + createWatermark(str) + func = () => { + createWatermark(str) + } + window.addEventListener('resize', func) + } + + return { setWatermark, clear } +} \ No newline at end of file diff --git a/src/views/baseinfo/accountMaintenance/columns.tsx b/src/views/baseinfo/accountMaintenance/columns.tsx index 6f41ef35..9349c0f5 100644 --- a/src/views/baseinfo/accountMaintenance/columns.tsx +++ b/src/views/baseinfo/accountMaintenance/columns.tsx @@ -11,7 +11,7 @@ const accountTypeDict = ref([]) getDictOption('account_type').then((data) => { accountTypeDict.value = data }) -getDictOption('djy_cust_prop').then((data) => { +getDictOption('infoclient-ArrclientTag').then((data) => { customTypeDict.value = data }) // 客户名称下拉框数据 diff --git a/src/views/baseinfo/accountMaintenance/index.vue b/src/views/baseinfo/accountMaintenance/index.vue index c29b0446..a2b37fbb 100644 --- a/src/views/baseinfo/accountMaintenance/index.vue +++ b/src/views/baseinfo/accountMaintenance/index.vue @@ -58,7 +58,7 @@ const res: API.DataResult = await ApiList(p) // 处理下拉框数据 const adicts = await getDictOption('account_type') - const ddicts = await getDictOption('djy_cust_prop') + const ddicts = await getDictOption('infoclient-ArrclientTag') res?.data.forEach((row) => { adicts.forEach((item) => { if (item.value == row.accountType) { diff --git a/src/views/baseinfo/infoclient/FeeCustTemplate/columns.tsx b/src/views/baseinfo/infoclient/FeeCustTemplate/columns.tsx index 035c2ab6..423d1e2b 100644 --- a/src/views/baseinfo/infoclient/FeeCustTemplate/columns.tsx +++ b/src/views/baseinfo/infoclient/FeeCustTemplate/columns.tsx @@ -1219,7 +1219,7 @@ export const detailsFormSchema: FormSchema[] = [ return { api: () => { return new Promise((resolve) => { - getDictOption('djy_cust_prop').then((res) => { + getDictOption('infoclient-ArrclientTag').then((res) => { resolve(res) }) }) diff --git a/src/views/baseinfo/infoclient/FeeCustTemplate/feeField.vue b/src/views/baseinfo/infoclient/FeeCustTemplate/feeField.vue index 42bae383..93efe48b 100644 --- a/src/views/baseinfo/infoclient/FeeCustTemplate/feeField.vue +++ b/src/views/baseinfo/infoclient/FeeCustTemplate/feeField.vue @@ -218,7 +218,7 @@ } const SetData = async (data) => { list.value.splice(0) - const customerTypeList: any = await getDictOption('djy_cust_prop') + const customerTypeList: any = await getDictOption('infoclient-ArrclientTag') const unitList: any = await feeUnitDict2() const unitList2: any = await getDictOption('fee_unit') console.log(unitList, unitList2) @@ -324,7 +324,7 @@ data: 'customerTypeText', type: 'dropdown', source: async (query, process) => { - const results = await getDictOption('djy_cust_prop') + const results = await getDictOption('infoclient-ArrclientTag') console.log(results) const dict = results.map((item) => { return item.value + '-' + item.name @@ -542,7 +542,7 @@ // 修改客户类别 if (changes[0][1] === 'customerTypeText') { - getDictOption('djy_cust_prop').then((res) => { + getDictOption('infoclient-ArrclientTag').then((res) => { const item = res.filter((item) => { return changes[0][3].includes(item.name) }) diff --git a/src/views/fee/FeeCustTemplate/columns.tsx b/src/views/fee/FeeCustTemplate/columns.tsx index 37ac502f..3224188a 100644 --- a/src/views/fee/FeeCustTemplate/columns.tsx +++ b/src/views/fee/FeeCustTemplate/columns.tsx @@ -1507,7 +1507,7 @@ export const detailsFormSchema: FormSchema[] = [ return { api: () => { return new Promise((resolve) => { - getDictOption('djy_cust_prop').then((res) => { + getDictOption('infoclient-ArrclientTag').then((res) => { resolve(res) }) }) diff --git a/src/views/fee/FeeCustTemplate/feeField.vue b/src/views/fee/FeeCustTemplate/feeField.vue index 90251059..031bfac4 100644 --- a/src/views/fee/FeeCustTemplate/feeField.vue +++ b/src/views/fee/FeeCustTemplate/feeField.vue @@ -218,7 +218,7 @@ } const SetData = async (data) => { list.value.splice(0) - const customerTypeList: any = await getDictOption('djy_cust_prop') + const customerTypeList: any = await getDictOption('infoclient-ArrclientTag') const unitList: any = await feeUnitDict2() const unitList2: any = await getDictOption('fee_unit') console.log(unitList, unitList2) @@ -329,7 +329,7 @@ data: 'customerTypeText', type: 'dropdown', source: async (query, process) => { - const results = await getDictOption('djy_cust_prop') + const results = await getDictOption('infoclient-ArrclientTag') const dict = results.map((item) => { return item.value + '-' + item.name }) @@ -546,7 +546,7 @@ // 修改客户类别 if (changes[0][1] === 'customerTypeText') { - getDictOption('djy_cust_prop').then((res) => { + getDictOption('infoclient-ArrclientTag').then((res) => { const item = res.filter((item) => { return changes[0][3].includes(item.name) }) diff --git a/src/views/fee/code/columns.tsx b/src/views/fee/code/columns.tsx index 7fbbc8a2..92100e68 100644 --- a/src/views/fee/code/columns.tsx +++ b/src/views/fee/code/columns.tsx @@ -251,7 +251,7 @@ export const formSchema: FormSchema[] = [ return { api: () => { return new Promise((resolve) => { - getDictOption('djy_cust_prop').then((res) => { + getDictOption('infoclient-ArrclientTag').then((res) => { resolve(res) }) }) @@ -285,7 +285,7 @@ export const formSchema: FormSchema[] = [ return { api: () => { return new Promise((resolve) => { - getDictOption('djy_cust_prop').then((res) => { + getDictOption('infoclient-ArrclientTag').then((res) => { resolve(res) }) }) diff --git a/src/views/fee/template/components/feeField.vue b/src/views/fee/template/components/feeField.vue index 207c84e2..89224dcb 100644 --- a/src/views/fee/template/components/feeField.vue +++ b/src/views/fee/template/components/feeField.vue @@ -156,7 +156,7 @@ data: 'customerTypeText', type: 'dropdown', source: async (query, process) => { - const results = await getDictOption('djy_cust_prop') + const results = await getDictOption('infoclient-ArrclientTag') console.log(results) const dict = results.map((item) => { return item.value + '-' + item.name @@ -462,7 +462,7 @@ } // 修改客户类别 if (changes[0][1] === 'customerTypeText') { - getDictOption('djy_cust_prop').then((res) => { + getDictOption('infoclient-ArrclientTag').then((res) => { const item = res.filter((item) => { return changes[0][3].includes(item.name) }) diff --git a/src/views/operation/seaexport/detail/index.vue b/src/views/operation/seaexport/detail/index.vue index eb236611..f72f146d 100644 --- a/src/views/operation/seaexport/detail/index.vue +++ b/src/views/operation/seaexport/detail/index.vue @@ -4,7 +4,7 @@ * @Date: 2024-04-29 11:54:04 -->