hookehuyr

🎉 init: 初始化

Showing 99 changed files with 3839 additions and 0 deletions
1 +# port
2 +VITE_PORT = 8308
3 +
4 +# 反向代理服务器地址
5 +VITE_PROXY_TARGET = https://oa.onwall.cn
6 +
7 +# API请求前缀
8 +VITE_PROXY_PREFIX = /srv/
9 +
10 +# 打包输出文件夹名称
11 +VITE_OUTDIR = sku_request
12 +
13 +# 是否开启调试
14 +VITE_CONSOLE = 0
15 +
16 +# appID相关
17 +VITE_APPID=微信appID
1 +# 资源公共路径
2 +VITE_BASE = /
3 +
4 +# 测试open-id
5 +# VITE_OPENID = api-test-openid
6 +# VITE_OPENID = o8BRf1gLDWieH3Y3JvbrI_4IjaME
7 +# VITE_OPENID = oJLZq5t9PIKLW9tm1oSUNAuPwssA
8 +# VITE_OPENID = oJLZq5uT_6GwIh2tQWh1F9IoHZ3U
9 +VITE_OPENID =
10 +
11 +# B端账号
12 +VITE_ID = 13761653761
13 +
14 +# 验证码
15 +VITE_PIN =
16 +
17 +# 反向代理服务器地址
18 +# VITE_PROXY_TARGET = https://oa.anxinchashi.com/
19 +VITE_PROXY_TARGET = http://oa-dev.onwall.cn
20 +# VITE_PROXY_TARGET = https://www.wxgzjs.cn/
21 +
22 +# PC端地址
23 +VITE_MOBILE_URL = http://localhost:5173/
1 +###
2 + # @Date: 2024-07-23 10:29:03
3 + # @LastEditors: hookehuyr hookehuyr@gmail.com
4 + # @LastEditTime: 2024-07-26 18:06:52
5 + # @FilePath: /temple_material_request/.env.production
6 + # @Description: 文件描述
7 +###
8 +# 资源公共路径
9 +VITE_BASE = /f/main/sku_request/
10 +
11 +# 测试open-id
12 +VITE_APP_OPENID =
13 +
14 +# B端账号
15 +VITE_APP_ID =
16 +
17 +# 验证码
18 +VITE_APP_PIN =
19 +
20 +# 反向代理服务器地址
21 +VITE_PROXY_TARGET = http://oa.onwall.cn
22 +
23 +# PC端地址
24 +# VITE_MOBILE_URL = http://oa.onwall.cn/f/guanzong/web/
25 +# VITE_MOBILE_URL = http://guanzong.onwall.cn/f/guanzong/web/
1 +{
2 + "globals": {
3 + "EffectScope": true,
4 + "computed": true,
5 + "createApp": true,
6 + "customRef": true,
7 + "defineAsyncComponent": true,
8 + "defineComponent": true,
9 + "effectScope": true,
10 + "getCurrentInstance": true,
11 + "getCurrentScope": true,
12 + "h": true,
13 + "inject": true,
14 + "isProxy": true,
15 + "isReactive": true,
16 + "isReadonly": true,
17 + "isRef": true,
18 + "markRaw": true,
19 + "nextTick": true,
20 + "onActivated": true,
21 + "onBeforeMount": true,
22 + "onBeforeUnmount": true,
23 + "onBeforeUpdate": true,
24 + "onDeactivated": true,
25 + "onErrorCaptured": true,
26 + "onMounted": true,
27 + "onRenderTracked": true,
28 + "onRenderTriggered": true,
29 + "onScopeDispose": true,
30 + "onServerPrefetch": true,
31 + "onUnmounted": true,
32 + "onUpdated": true,
33 + "provide": true,
34 + "reactive": true,
35 + "readonly": true,
36 + "ref": true,
37 + "resolveComponent": true,
38 + "shallowReactive": true,
39 + "shallowReadonly": true,
40 + "shallowRef": true,
41 + "toRaw": true,
42 + "toRef": true,
43 + "toRefs": true,
44 + "triggerRef": true,
45 + "unref": true,
46 + "useAttrs": true,
47 + "useCssModule": true,
48 + "useCssVars": true,
49 + "useRoute": true,
50 + "useRouter": true,
51 + "useSlots": true,
52 + "watch": true,
53 + "watchEffect": true,
54 + "watchPostEffect": true,
55 + "watchSyncEffect": true
56 + }
57 +}
...\ No newline at end of file ...\ No newline at end of file
1 +/*
2 + * @Author: hookehuyr hookehuyr@gmail.com
3 + * @Date: 2022-05-27 08:59:09
4 + * @LastEditors: hookehuyr hookehuyr@gmail.com
5 + * @LastEditTime: 2022-07-08 18:15:20
6 + * @FilePath: /tswj/.eslintrc.js
7 + * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
8 + */
9 +module.exports = {
10 + // parser: '@typescript-eslint/parser',
11 + parser: 'vue-eslint-parser',
12 + parserOptions: {
13 + parser: 'babel-eslint',
14 + // parser: '@typescript-eslint/parser',
15 + },
16 + extends: [
17 + // add more generic rule sets here, such as:
18 + // 'eslint:recommended',
19 + 'plugin:vue/vue3-recommended',
20 + './.eslintrc-auto-import.json'
21 + // 'plugin:vue/recommended' // Use this if you are using Vue.js 2.x.
22 + ],
23 + rules: {
24 + // override/add rules settings here, such as:
25 + // 'vue/no-unused-vars': 'error'
26 + "vue/max-attributes-per-line": ["error", {
27 + "singleline": {
28 + "max": 20
29 + },
30 + "multiline": {
31 + "max": 10
32 + }
33 + }],
34 + "vue/singleline-html-element-content-newline": 0, // 在单行元素的内容之前和之后需要换行符
35 + "vue/first-attribute-linebreak": 0, // 强制第一个属性需要换行
36 + "vue/multi-word-component-names": 0, // 要求组件名称始终为多字
37 + "vue/html-indent": 0, // 执行一致的缩进
38 + "vue/html-closing-bracket-newline": 0, // 在标签的右括号之前要求或禁止换行
39 + },
40 + overrides: [
41 + {
42 + files: ['*.ts'],
43 + parser: '@typescript-eslint/parser',
44 + plugins: ['@typescript-eslint'],
45 + extends: ['plugin:@typescript-eslint/recommended'],
46 + },
47 + ],
48 +}
1 +node_modules
2 +.DS_Store
3 +dist
4 +dist-ssr
5 +*.local
6 +.history
7 +doc
8 +.vscode
9 +publish.sh
10 +src/views/test/*
11 +src/store/test.js
12 +cypress
13 +src/test/mocha/test.js
14 +cypress.json
15 +src/test
16 +.idea
17 +sku_request
1 +{
2 + "esversion": 11,
3 + "asi": true
4 +}
...\ No newline at end of file ...\ No newline at end of file
1 +export function createProxy(prefix, target) {
2 + const ret = {};
3 + ret[prefix] = {
4 + target,
5 + changeOrigin: true,
6 + ws: true,
7 + // rewrite: (path) => path.replace(/^\/api/, '')
8 + // rewrite: (path) => path.replace(new RegExp(`^${prefix}`), ''),
9 + }
10 + return ret
11 +}
1 +// generated by unplugin-vue-components
2 +// We suggest you to commit this file into source control
3 +// Read more: https://github.com/vuejs/core/pull/3399
4 +import '@vue/runtime-core'
5 +
6 +export {}
7 +
8 +declare module '@vue/runtime-core' {
9 + export interface GlobalComponents {
10 + AppointmentField: typeof import('./src/components/AppointmentField/index.vue')['default']
11 + AreaPickerField: typeof import('./src/components/AreaPickerField/index.vue')['default']
12 + ButtonField: typeof import('./src/components/ButtonField/index.vue')['default']
13 + CalendarField: typeof import('./src/components/CalendarField/index.vue')['default']
14 + CheckboxField: typeof import('./src/components/CheckboxField/index.vue')['default']
15 + ContactField: typeof import('./src/components/ContactField/index.vue')['default']
16 + CustomField: typeof import('./src/components/CustomField/index.vue')['default']
17 + DatePickerField: typeof import('./src/components/DatePickerField/index.vue')['default']
18 + DateTimePickerField: typeof import('./src/components/DateTimePickerField/index.vue')['default']
19 + DesField: typeof import('./src/components/DesField/index.vue')['default']
20 + DividerField: typeof import('./src/components/DividerField/index.vue')['default']
21 + EmailField: typeof import('./src/components/EmailField/index.vue')['default']
22 + FileUploaderField: typeof import('./src/components/FileUploaderField/index.vue')['default']
23 + GenderField: typeof import('./src/components/GenderField/index.vue')['default']
24 + GroupField: typeof import('./src/components/GroupField/index.vue')['default']
25 + IdentityField: typeof import('./src/components/IdentityField/index.vue')['default']
26 + ImageUploaderField: typeof import('./src/components/ImageUploaderField/index.vue')['default']
27 + LoginBox: typeof import('./src/components/LoginBox/index.vue')['default']
28 + MarqueeField: typeof import('./src/components/MarqueeField/index.vue')['default']
29 + MultiRuleField: typeof import('./src/components/MultiRuleField/index.vue')['default']
30 + MyComponent: typeof import('./src/components/AppointmentField/MyComponent.vue')['default']
31 + NameField: typeof import('./src/components/NameField/index.vue')['default']
32 + NoteField: typeof import('./src/components/NoteField/index.vue')['default']
33 + NumberField: typeof import('./src/components/NumberField/index.vue')['default']
34 + OrgPickerField: typeof import('./src/components/OrgPickerField/index.vue')['default']
35 + PhoneField: typeof import('./src/components/PhoneField/index.vue')['default']
36 + PickerField: typeof import('./src/components/PickerField/index.vue')['default']
37 + RadioField: typeof import('./src/components/RadioField/index.vue')['default']
38 + RatePickerField: typeof import('./src/components/RatePickerField/index.vue')['default']
39 + RouterLink: typeof import('vue-router')['RouterLink']
40 + RouterView: typeof import('vue-router')['RouterView']
41 + RuleField: typeof import('./src/components/RuleField/index.vue')['default']
42 + SignField: typeof import('./src/components/SignField/index.vue')['default']
43 + TableField: typeof import('./src/components/TableField/index.vue')['default']
44 + Test: typeof import('./src/components/LoginBox/test.vue')['default']
45 + TextareaField: typeof import('./src/components/TextareaField/index.vue')['default']
46 + TextField: typeof import('./src/components/TextField/index.vue')['default']
47 + TimePickerField: typeof import('./src/components/TimePickerField/index.vue')['default']
48 + VideoField: typeof import('./src/components/VideoField/index.vue')['default']
49 + VolunteerGroupField: typeof import('./src/components/VolunteerGroupField/index.vue')['default']
50 + }
51 +}
1 +<!--
2 + * @Date: 2023-02-13 14:56:34
3 + * @LastEditors: hookehuyr hookehuyr@gmail.com
4 + * @LastEditTime: 2024-07-16 16:12:12
5 + * @FilePath: /data-table/index.html
6 + * @Description: 文件描述
7 +-->
8 +<!DOCTYPE html>
9 +<html lang='zh'>
10 +<head>
11 + <meta charset="UTF-8">
12 + <!-- <link rel="icon" type="image/svg+xml" href="http://www.wxgzjs.cn/template/default/static/images/favicon.ico" /> -->
13 + <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover" />
14 + <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
15 + <meta http-equiv="Pragma" content="no-cache">
16 + <meta http-equiv="Expires" content="0">
17 + <link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
18 + <title></title>
19 + <!-- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.compat.css" /> -->
20 +</head>
21 +<body>
22 + <div id="app"></div>
23 + <script src="https://cdn.ipadbiz.cn/custom_form/tinymce/tinymce.min.js"></script>
24 + <script type="module" src="/src/main.js"></script>
25 +</body>
26 +</html>
This diff could not be displayed because it is too large.
1 +{
2 + "name": "temple_material_request",
3 + "description": "西园寺物资申请系统",
4 + "version": "1.0.0",
5 + "scripts": {
6 + "dev": "vite",
7 + "start": "vite --host 0.0.0.0",
8 + "build": "vite build",
9 + "build-watch": "vite build --watch",
10 + "build-ts": "vue-tsc --noEmit && vite build",
11 + "serve": "vite preview",
12 + "cypress:open": "cypress open",
13 + "tar": "tar -czvpf dist.tar.gz sku_request",
14 + "build_tar": "npm run build && npm run tar",
15 + "scp-dev": "scp dist.tar.gz ipadbiz-inner:/opt/space-dev/f/main",
16 + "dec-dev": "ssh ipadbiz-inner 'cd /opt/space-dev/f/main && tar -xzvf dist.tar.gz && rm -rf dist.tar.gz'",
17 + "scp-oa": "scp dist.tar.gz ipadbiz-inner:/opt/oa/f/main",
18 + "dec-oa": "ssh ipadbiz-inner 'cd /opt/oa/f/main && tar -xzvf dist.tar.gz && rm -rf dist.tar.gz'",
19 + "scp-mituo": "scp dist.tar.gz itomix@ipadbiz.cn:/opt/mituo/f/main",
20 + "dec-mituo": "ssh itomix@ipadbiz.cn 'cd /opt/mituo/f/main && tar -xzvf dist.tar.gz && rm -rf dist.tar.gz'",
21 + "scp-guanzong": "scp dist.tar.gz itomix@ipadbiz.cn:/opt/guanzong/f/main",
22 + "dec-guanzong": "ssh itomix@ipadbiz.cn 'cd /opt/guanzong/f/main && tar -xzvf dist.tar.gz && rm -rf dist.tar.gz'",
23 + "scp-xys": "scp -P 12101 dist.tar.gz zhsy@oa.jcedu.org:/home/www/f/main",
24 + "dec-xys": "ssh -p 12101 zhsy@oa.jcedu.org 'cd /home/www/f/main && tar -xzvf dist.tar.gz && rm -rf dist.tar.gz'",
25 + "scp-zentea": "scp dist.tar.gz zentea@anxinchashi.com:/data/www/zentea/f/main",
26 + "dec-zentea": "ssh zentea@anxinchashi.com 'cd /data/www/zentea/f/main && tar -xzvf dist.tar.gz && rm -rf dist.tar.gz'",
27 + "remove_tar": "rm -rf dist.tar.gz",
28 + "remove_dist": "rm -rf sku_request",
29 + "dev_upload": "npm run build_tar && npm run scp-dev && npm run dec-dev && npm run remove_tar && npm run remove_dist",
30 + "oa_upload": "npm run build_tar && npm run scp-oa && npm run dec-oa && npm run remove_tar",
31 + "mituo_upload": "npm run build_tar && npm run scp-mituo && npm run dec-mituo && npm run remove_tar",
32 + "guanzong_upload": "npm run build_tar && npm run scp-guanzong && npm run dec-guanzong && npm run remove_tar",
33 + "xys_upload": "npm run build_tar && npm run scp-xys && npm run dec-xys && npm run remove_tar",
34 + "zentea_upload": "npm run build_tar && npm run scp-zentea && npm run dec-zentea && npm run remove_tar",
35 + "all_upload": "npm run dev_upload && npm run oa_upload"
36 + },
37 + "dependencies": {
38 + "@dedisuryadi/json-form-data": "^0.1.1",
39 + "@tinymce/tinymce-vue": "4.0.7",
40 + "@vant/area-data": "^1.3.1",
41 + "@vant/touch-emulator": "^1.4.0",
42 + "@vitejs/plugin-legacy": "^1.8.2",
43 + "@vueuse/core": "^8.5.0",
44 + "@wsfe/vue-tree": "^3.2.0",
45 + "animate.css": "^4.1.1",
46 + "browser-md5-file": "^1.1.1",
47 + "dayjs": "^1.11.3",
48 + "default-passive-events": "^2.0.0",
49 + "element-plus": "^2.8.1",
50 + "global": "^4.4.0",
51 + "html2canvas": "^1.4.1",
52 + "idcard": "^4.2.0",
53 + "jquery": "^3.6.0",
54 + "js-cookie": "^3.0.1",
55 + "js-sha1": "^0.6.0",
56 + "lodash": "^4.17.21",
57 + "moment": "^2.29.3",
58 + "mui-player": "^1.7.0",
59 + "sha1": "^1.1.1",
60 + "tinymce": "5.10.9",
61 + "typescript": "^4.7.3",
62 + "uuid": "^8.3.2",
63 + "vant": "^4.9.1",
64 + "vconsole": "^3.14.6",
65 + "vite-plugin-dynamic-import": "^0.9.6",
66 + "vite-plugin-mp": "^1.6.1",
67 + "vue": "3.2.36",
68 + "weixin-js-sdk": "^1.6.0"
69 + },
70 + "devDependencies": {
71 + "@types/jquery": "^3.5.14",
72 + "@types/lodash": "^4.14.182",
73 + "@types/moment": "^2.13.0",
74 + "@typescript-eslint/parser": "^5.27.1",
75 + "@vitejs/plugin-vue": "^2.3.3",
76 + "axios": "^0.27.2",
77 + "chai": "^4.3.6",
78 + "cypress": "^9.7.0",
79 + "eslint-plugin-vue": "^9.0.1",
80 + "less": "^4.1.2",
81 + "mocha": "^10.0.0",
82 + "pinia": "^2.0.14",
83 + "postcss-px-to-viewport": "^1.1.1",
84 + "qs": "^6.10.3",
85 + "tslint": "^6.1.3",
86 + "unplugin-auto-import": "^0.8.8",
87 + "unplugin-vue-components": "^0.23.0",
88 + "unplugin-vue-define-options": "^0.6.1",
89 + "vite": "^2.9.9",
90 + "vite-plugin-style-import": "1.4.1",
91 + "vue-esign": "^1.1.4",
92 + "vue-router": "^4.0.15"
93 + }
94 +}
1 +module.exports = {
2 + printWidth: 100, // 代码行的宽度,通用建议每行最大长度建议为100/120,但最好不超过这两个数。
3 + tabWidth: 2, // 指定每次缩进的空格数。
4 + semi: true, // 是否在代码语句结尾添加分号。
5 + vueIndentScriptAndStyle: true,
6 + singleQuote: true, // 是否使用单引号,JSX单独设置。
7 + trailingComma: 'all', // 在多行以逗号分割的句法中尽可能补充尾行逗号。
8 + bracketSpacing: true, // 是否在对象属性与大括号之间填充空格。
9 + bracketSameLine: false, // 开始标签的右尖括号是否跟随在最后一行属性末尾。
10 + proseWrap: 'never',
11 + htmlWhitespaceSensitivity: 'strict',
12 + endOfLine: 'auto', // 设置换行风格,避免不同操作系统造成的大量代码diff。
13 + singleAttributePerLine: false // 在Html,Vue,JSX中是否强制每条属性占用一行。
14 +};
1 +#!/usr/bin/env sh
2 +# -----------------------------------------------
3 +# Filename: publish.sh
4 +# Revision: 1.0
5 +# Date: 2022年5月20日
6 +# Author: Hooke
7 +# Description: **** 根据php项目相应特征书写项目发布流程
8 +# -----------------------------------------------
9 +
10 +# 当发生错误时中止脚本
11 +set -e
12 +
13 +# 本地Git服务器目录路径
14 +PHP_PATH=/Users/huyirui/program/itomix/git/isp/f/custom_form
15 +
16 +# 编译输出文件夹
17 +OUTPUT=sku_request
18 +
19 +# 打包
20 +npm run build
21 +
22 +# 移除Git服务器目录下项目文件夹
23 +rm -r $PHP_PATH"/${OUTPUT:?}"
24 +
25 +# 把本地编译输出文件夹添加到服务器目录
26 +mv "${OUTPUT:?}/" $PHP_PATH
27 +
28 +# 提交到Git服务器
29 +cd $PHP_PATH"/${OUTPUT:?}"
30 +git checkout custom_form
31 +git pull
32 +git add -A
33 +git commit -m '自定义表单-前端网页更新'
34 +git push
35 +
36 +git checkout develop;
37 +git pull origin develop;
38 +git merge --no-edit custom_form;
39 +git push origin develop;
40 +
41 +# 更新SSH服务器上文件
42 +ssh -p 22 itomix@ipadbiz.cn '
43 + cd /opt/space-dev/;
44 + git pull origin develop;
45 +'
46 +
47 +git checkout custom_form;
1 +#!/usr/bin/env sh
2 +# -----------------------------------------------
3 +# Filename: publish.sh
4 +# Revision: 1.0
5 +# Date: 2022年5月20日
6 +# Author: Hooke
7 +# Description: **** 根据php项目相应特征书写项目发布流程
8 +# -----------------------------------------------
9 +
10 +# 当发生错误时中止脚本
11 +set -e
12 +
13 +# 记录当前开发的绝对路径
14 +CURR_PATH=$(pwd)
15 +
16 +# 本地Git服务器目录路径
17 +PHP_PATH=/Users/huyirui/program/itomix/git/isp/f/custom_form
18 +
19 +# 编译输出文件夹
20 +output=sku_request
21 +
22 +# 打包
23 +rm -rf sku_request
24 +npm run build
25 +
26 +# 删除 PHP 项目里的编译产物
27 +cd $PHP_PATH
28 +git checkout custom_form
29 +rm -rf $PHP_PATH"/${output:?}"
30 +# 把编译产物复制到 PHP 项目
31 +cd $CURR_PATH
32 +cp -r "${output:?}/" $PHP_PATH"/${output:?}"
33 +
34 +# PHP 项目的编译产物提交到 Git 服务器
35 +cd $PHP_PATH
36 +git pull
37 +git add -A
38 +git commit -m '自定义表单-前端网页更新'
39 +git push
40 +
41 +# 更新其他分支数据
42 +# git checkout master
43 +# git pull origin master
44 +# git merge --no-edit custom_form
45 +# git push origin master
46 +
47 +# git checkout guanzong
48 +# git pull origin guanzong
49 +# git merge --no-edit custom_form
50 +# git push origin guanzong
51 +
52 +git checkout mituo
53 +git pull origin mituo
54 +git merge --no-edit custom_form
55 +git push origin mituo
56 +
57 +# ssh -p 22 itomix@ipadbiz.cn '
58 +# cd /opt/oa;
59 +# git pull origin master;
60 +# cd /opt/guanzong;
61 +# git pull origin guanzong;
62 +# cd /opt/mituo;
63 +# git pull origin mituo;
64 +# '
65 +ssh -p 22 itomix@ipadbiz.cn '
66 + cd /opt/mituo;
67 + git pull origin mituo;
68 +'
69 +
70 +git checkout custom_form;
1 +#!/usr/bin/env sh
2 +# -----------------------------------------------
3 +# Filename: publish.sh
4 +# Revision: 1.0
5 +# Date: 2022年5月20日
6 +# Author: Hooke
7 +# Description: DEV环境已经打包推送后,编译产物存在。
8 +# -----------------------------------------------
9 +
10 +# 当发生错误时中止脚本
11 +set -e
12 +
13 +# 本地Git服务器目录路径
14 +PHP_PATH=/Users/huyirui/program/itomix/git/isp/f/custom_form
15 +
16 +# 更新其他分支数据
17 +cd $PHP_PATH
18 +git checkout master
19 +git pull origin master
20 +git merge --no-edit custom_form
21 +git push origin master
22 +
23 +git checkout guanzong
24 +git pull origin guanzong
25 +git merge --no-edit custom_form
26 +git push origin guanzong
27 +
28 +git checkout mituo
29 +git pull origin mituo
30 +git merge --no-edit custom_form
31 +git push origin mituo
32 +
33 +ssh -p 22 itomix@ipadbiz.cn '
34 + cd /opt/oa;
35 + git pull origin master;
36 + cd /opt/guanzong;
37 + git pull origin guanzong;
38 + cd /opt/mituo;
39 + git pull origin mituo;
40 +'
41 +
42 +git checkout custom_form;
1 +export interface commentListType {
2 + id: string;
3 + avatar: string;
4 + name: string;
5 + kg_name: string;
6 + comment_time: string;
7 + note: string;
8 + c_action: string;
9 + c_name: string;
10 + cover: string;
11 + prod_id: string;
12 + perf_id: string;
13 + book_id: string;
14 + perf_name: string;
15 + book_name: string;
16 + localism_type: string;
17 + is_new: number;
18 +}
1 +<!--
2 + * @Author: hookehuyr hookehuyr@gmail.com
3 + * @Date: 2022-05-26 23:52:36
4 + * @LastEditors: hookehuyr hookehuyr@gmail.com
5 + * @LastEditTime: 2024-09-06 17:27:15
6 + * @FilePath: /custom_table/src/App.vue
7 + * @Description:
8 +-->
9 +<template>
10 + <router-view></router-view>
11 +</template>
12 +
13 +<script setup>
14 +import { mainStore, useTitle } from "@/utils/generatePackage";
15 +import { computed, watchEffect, onMounted } from "vue";
16 +import { useRoute, useRouter } from "vue-router";
17 +import { Toast } from "vant";
18 +// 会根据配置判断是否显示调试控件
19 +// eslint-disable-next-line no-unused-vars
20 +import vConsole from "@/utils/vconsole";
21 +// 初始化WX环境
22 +import wx from 'weixin-js-sdk'
23 +import { wxJsAPI } from '@/api/wx/config'
24 +import { apiList } from '@/api/wx/jsApiList.js'
25 +import { wxInfo, getUrlParams, stringifyQuery } from "@/utils/tools";
26 +import { styleColor } from "@/constant.js";
27 +import { getFormSettingAPI } from "@/api/form.js";
28 +import { showDialog, showConfirmDialog } from 'vant';
29 +import fp3 from '@/utils/fp3';
30 +import { Updater } from '@/utils/versionUpdater';
31 +
32 +// 使用 include + pinia 状态管理动态缓存页面
33 +const store = mainStore();
34 +const keepPages = computed(() => store.getKeepPages);
35 +
36 +const $route = useRoute();
37 +// watchEffect(() => useTitle("表单标题"));
38 +// 监听路由变化
39 +// 切换路由页面返回顶部
40 +const $router = useRouter();
41 +
42 +onMounted(async () => {
43 +
44 + // TAG:检查是否更新
45 + if (import.meta.env.PROD) {
46 + const upDater = new Updater({
47 + time: 30000
48 + })
49 + upDater.on('no-update', () => {
50 + // console.log('还没更新')
51 + })
52 + upDater.on('update', () => {
53 + showConfirmDialog({
54 + title: '温馨提示',
55 + message: '检测到新版本,是否刷新页面!',
56 + confirmButtonColor: styleColor.baseColor
57 + }).then(() => {
58 + window.location.reload();
59 + });
60 + })
61 + }
62 +});
63 +</script>
64 +
65 +<style lang="less">
66 +@prefix: ~"@{namespace}-x";
67 +
68 +html,
69 +body {
70 + width: 100%;
71 + // height: 100%;
72 + color: @base-font-color;
73 + // background-color: #f7f8fa;
74 + // background-color: #fff9ef;
75 + padding: 0;
76 + margin: 0;
77 +}
78 +
79 +body {
80 + position: relative;
81 + // display: flex;
82 + // justify-content: center;
83 +
84 + p {
85 + margin: 0;
86 + padding: 0;
87 + }
88 +}
89 +
90 +#app {
91 + min-height: calc(100vh);
92 + // max-width: 800px;
93 + position: relative;
94 +}
95 +
96 +.@{prefix} {
97 + color: red;
98 +}
99 +
100 +.global-center {
101 + position: relative;
102 + top: 50%;
103 + transform: translateY(-50%);
104 +}
105 +
106 +.zIndex {
107 + z-index: 4500 !important;
108 +}
109 +</style>
1 +/*
2 + * @Date: 2022-06-17 14:54:29
3 + * @LastEditors: hookehuyr hookehuyr@gmail.com
4 + * @LastEditTime: 2022-12-01 16:26:27
5 + * @FilePath: /data-table/src/api/common.js
6 + * @Description: 通用接口
7 + */
8 +import { fn, fetch, uploadFn } from '@/api/fn';
9 +
10 +const Api = {
11 + SMS: '/srv/?a=sms',
12 + TOKEN: '/srv/?a=upload',
13 + SAVE_FILE: '/srv/?a=upload&t=save_file',
14 +}
15 +
16 +/**
17 + * @description: 发送验证码
18 + * @param {*} phone 手机号码
19 + * @returns
20 + */
21 +export const smsAPI = (params) => fn(fetch.post(Api.SMS, params));
22 +
23 +/**
24 + * @description: 获取七牛token
25 + * @returns
26 + */
27 +export const qiniuTokenAPI = (params) => fn(fetch.stringifyPost(Api.TOKEN, params));
28 +
29 +/**
30 + * @description: 上传七牛
31 + * @param {*}
32 + * @returns
33 + */
34 +export const qiniuUploadAPI = (url, data, config) => uploadFn(fetch.basePost(url, data, config));
35 +
36 +/**
37 + * @description: 保存图片
38 + * @param {*} format
39 + * @param {*} hash
40 + * @param {*} height
41 + * @param {*} width
42 + * @param {*} filekey
43 + * @returns
44 + */
45 +export const saveFileAPI = (params) => fn(fetch.stringifyPost(Api.SAVE_FILE, params));
1 +/*
2 + * @Date: 2022-06-17 14:54:29
3 + * @LastEditors: hookehuyr hookehuyr@gmail.com
4 + * @LastEditTime: 2024-06-05 10:12:06
5 + * @FilePath: /data-table/src/api/component.js
6 + * @Description: 组件接口
7 + */
8 +import { fn, fetch } from '@/api/fn';
9 +
10 +const Api = {
11 + QUERY_COMPONENT: '/srv/?a=query_component',
12 + FLOW_DEPT_LIST: '/srv/?a=flow_setting&t=flow_dept_list',
13 + FLOW_ROLE_LIST: '/srv/?a=flow_setting&t=flow_role_list',
14 + SEARCH_USER_DEPT_ROLE: '/srv/?a=flow_setting&t=search_user_dept_role',
15 +}
16 +
17 +/**
18 + * @description: 查询组件
19 + * @param: group_code 分组标识
20 + * @param: component_code 组件标识
21 + * @param: name 组件名称;条件:模糊查询;
22 + */
23 +export const getComponentAPI = (params) => fn(fetch.get(Api.QUERY_COMPONENT, params));
24 +
25 +/**
26 + * @description: 查询部门列表
27 + * @param: form_code 表单code
28 + */
29 +export const getFlowDeptListAPI = (params) => fn(fetch.get(Api.FLOW_DEPT_LIST, params));
30 +
31 +/**
32 + * @description: 查询角色列表
33 + * @param: form_code 表单code
34 + */
35 +export const getFlowRoleListAPI = (params) => fn(fetch.get(Api.FLOW_ROLE_LIST, params));
36 +
37 +/**
38 + * @description: 查询用户部门角色
39 + * @param: form_code 表单code
40 + * @param: word 搜索内容
41 + */
42 +export const searchUserDeptRoleAPI = (params) => fn(fetch.get(Api.SEARCH_USER_DEPT_ROLE, params));
1 +/*
2 + * @Date: 2022-06-17 14:54:29
3 + * @LastEditors: hookehuyr hookehuyr@gmail.com
4 + * @LastEditTime: 2024-07-04 17:05:30
5 + * @FilePath: /data-table/src/api/data.js
6 + * @Description: 表单数据接口
7 + */
8 +import { fn, fetch } from '@/api/fn';
9 +
10 +const Api = {
11 + ADD_FORM_DATA: '/srv/?a=add_formdata',
12 + QUERY_FORM_DATA: '/srv/?a=query_formdata',
13 + MODI_FORM_DATA: '/srv/?a=modi_formdata',
14 + FLOW_FORM_DATA: '/srv/?a=flow_formdata',
15 +}
16 +/**
17 + * @description: 添加表单数据
18 + * @param: form_code 表单唯一标识
19 + * @param: data 待添加的数据,json对象结构;键值对记录变更的字段和值;
20 + */
21 +export const addFormDataAPI = (params) => fn(fetch.post(Api.ADD_FORM_DATA, params));
22 +
23 +/**
24 + * @description: 查询表单数据
25 + * @param: form_code 表单唯一标识
26 + * @param: id 数据ID
27 + */
28 +export const queryFormDataAPI = (params) => fn(fetch.get(Api.QUERY_FORM_DATA, params));
29 +
30 +/**
31 + * @description: 修改表单数据
32 + * @param: form_code 表单唯一标识
33 + * @param: id 数据ID
34 + * @param: data 待添加的数据,json对象结构;键值对记录变更的字段和值;
35 + */
36 +export const modiFormDataAPI = (params) => fn(fetch.post(Api.MODI_FORM_DATA, params));
37 +
38 +/**
39 + * @description: 流程表单数据
40 + * @param: form_code 表单唯一标识
41 + * @param: data_id 数据ID
42 + * @param: data 待添加的数据,json对象结构;键值对记录变更的字段和值;
43 + * @param: flow_node_code 流程节点
44 + * @param: flow_node_action_id 用户点击的流程节点按钮ID
45 + * @param: flow_content 流程审批的文本意见
46 + */
47 +export const flowFormDataAPI = (params) => fn(fetch.post(Api.FLOW_FORM_DATA, params));
1 +/*
2 + * @Date: 2022-05-18 22:56:08
3 + * @LastEditors: hookehuyr hookehuyr@gmail.com
4 + * @LastEditTime: 2023-02-10 15:13:01
5 + * @FilePath: /data-table/src/api/fn.js
6 + * @Description: 文件描述
7 + */
8 +import axios from '@/utils/axios';
9 +import qs from 'Qs'
10 +import { showSuccessToast, showFailToast } from 'vant';
11 +
12 +/**
13 + * 网络请求功能函数
14 + * @param {*} api 请求axios接口
15 + * @returns 请求成功后,获取数据
16 + */
17 +export const fn = (api) => {
18 + return api
19 + .then(res => {
20 + if (res.data.code === 1) {
21 + return res.data || true;
22 + } else {
23 + // tslint:disable-next-line: no-console
24 + // if (!res.data.show) return false;
25 + showFailToast(res.data.msg);
26 + return false;
27 + }
28 + })
29 + .catch(err => {
30 + // tslint:disable-next-line: no-console
31 + console.error(err);
32 + return false;
33 + })
34 + .finally(() => { // 最终执行
35 + })
36 +}
37 +
38 +/**
39 + * 七牛返回格式
40 + * @param {*} api
41 + * @returns
42 + */
43 +export const uploadFn = (api) => {
44 + return api
45 + .then(res => {
46 + if (res.status === 200) {
47 + return res.data || true;
48 + } else {
49 + // tslint:disable-next-line: no-console
50 + console.warn(res);
51 + if (!res.data.show) return false;
52 + Toast({
53 + icon: 'close',
54 + message: res.data.msg,
55 + });
56 + return false;
57 + }
58 + })
59 + .catch(err => {
60 + // tslint:disable-next-line: no-console
61 + console.error(err);
62 + return false;
63 + })
64 +}
65 +
66 +/**
67 + * 统一 GET/POST 不同传参形式
68 + */
69 +export const fetch = {
70 + get: function (api, params) {
71 + return axios.get(api, { params })
72 + },
73 + post: function (api, params) {
74 + return axios.post(api, params)
75 + },
76 + stringifyPost: function (api, params) {
77 + return axios.post(api, qs.stringify(params))
78 + },
79 + basePost: function (url, data, config) {
80 + return axios.post(url, data, config)
81 + }
82 +}
1 +/*
2 + * @Date: 2022-06-17 14:54:29
3 + * @LastEditors: hookehuyr hookehuyr@gmail.com
4 + * @LastEditTime: 2023-02-07 13:23:19
5 + * @FilePath: /data-table/src/api/form.js
6 + * @Description: 表单接口
7 + */
8 +import { fn, fetch } from '@/api/fn';
9 +
10 +const Api = {
11 + FORM_ADD: '/srv/?a=add_form',
12 + FORM_QUERY: '/srv/?a=query_form_all_field',
13 + ADD_FORM_FIELD: '/srv/?a=add_form_field',
14 + ADD_FORM_SETTING: '/srv/?a=add_form_setting',
15 + QUERY_FORM_SETTING: '/srv/?a=query_form_setting',
16 + VERIFY_PASSWORD: '/srv/?a=verify_password',
17 +};
18 +
19 +/**
20 + * @description: 新增表单
21 + * @param: client_id 主体客户id
22 + * @param: name 表单名称
23 + * @param: note 表单描述
24 + */
25 +export const addFormAPI = (params) => fn(fetch.post(Api.FORM_ADD, params));
26 +
27 +/**
28 + * @description: 查询表单
29 + * @param: client_id 主体客户id
30 + * @param: form_code 表单唯一标识
31 + * @param: name 表单名称,模糊查询
32 + */
33 +export const queryFormAPI = (params) => fn(fetch.get(Api.FORM_QUERY, params));
34 +
35 +/**
36 + * @description: 添加表单字段
37 + * @param: form_code 表单唯一标识
38 + * @param: component_code 组件标识
39 + */
40 +export const addFormFieldAPI = (params) => fn(fetch.post(Api.ADD_FORM_FIELD, params));
41 +
42 +/**
43 + * @description: 添加或修改表单字段属性设置
44 + * @param: form_code 表单唯一标识
45 + * @param: field_name 表单字段名。如果设置表单级(非字段级)的属性,可为空。
46 + * @param: component_code 组件标识
47 + * @param: property_code 属性标识
48 + * @param: setting_value 待设置的属性值。json数组,内部必须双引号。如果属性值是单值,数组只有一个元素。
49 + */
50 +export const addFormSettingAPI = (params) => fn(fetch.post(Api.ADD_FORM_SETTING, params));
51 +
52 +/**
53 + * @description: 查询表单的设置类组件的属性值
54 + * @param: form_code 表单唯一标识
55 + * @returns: enable 开启/停止表单 0=停止表单,1=开启表单
56 + * @returns: is_time_range 是否设定开启/停止时间 0=不设定,1=设定
57 + * @returns: is_count_down 是否显示停止倒计时 0=不显示,1-显示
58 + * @returns: begin_time 开启时间
59 + * @returns: end_time 停止时间
60 + */
61 +export const getFormSettingAPI = (params) => fn(fetch.get(Api.QUERY_FORM_SETTING, params));
62 +
63 +/**
64 + * @description: 验证便当密码
65 + * @param: form_code 表单唯一标识
66 + * @param: mmtx_password 用户输入的密码
67 + * @returns:
68 + */
69 +export const postVerifyPasswordAPI = (params) => fn(fetch.post(Api.VERIFY_PASSWORD, params));
1 +/*
2 + * @Date: 2022-06-17 14:54:29
3 + * @LastEditors: hookehuyr hookehuyr@gmail.com
4 + * @LastEditTime: 2022-11-17 13:46:01
5 + * @FilePath: /data-table/src/api/index.js
6 + * @Description: 首页接口
7 + */
8 +import { fn, fetch } from '@/api/fn';
9 +
10 +const Api = {
11 + INDEX: '/srv/?a=home_page',
12 +}
13 +/**
14 + * @description: 首页接口
15 + * @returns HOMEBANNER 轮播区
16 + * @returns HOMEZIXUN 观宗资讯
17 + * @returns HOMEVIDEO 视频展示
18 + * @returns HOMEKAISHI 本源法师开示
19 + * @returns spec_list 专题报告
20 + */
21 +export const indexAPI = (params) => fn(fetch.get(Api.INDEX, params));
1 +/*
2 + * @Date: 2022-06-17 14:54:29
3 + * @LastEditors: hookehuyr hookehuyr@gmail.com
4 + * @LastEditTime: 2024-07-26 11:34:18
5 + * @FilePath: /temple_material_request/src/api/material.js
6 + * @Description: 物资申请接口
7 + */
8 +import { fn, fetch } from '@/api/fn';
9 +
10 +const Api = {
11 + ACTIVITY_DEPTS: '/srv/?a=activity_depts',
12 + GOOD_USE_LIST: '/srv/?a=good_use_list',
13 + CART_LIST: '/srv/?a=cart_list',
14 + CART_ADD: '/srv/?a=cart_add',
15 + CART_EDIT: '/srv/?a=cart_edit',
16 + CART_DEL: '/srv/?a=cart_del',
17 + MY_DEPTS: '/srv/?a=my_depts',
18 + MY_USER: '/srv/?a=my_user',
19 + USE_ORDER_ADD: '/srv/?a=use_order_add',
20 + SKU_LIST: '/srv/?a=sku_list',
21 + SKU_INFO: '/srv/?a=sku_info',
22 +};
23 +
24 +/**
25 + * @description: 获取活动组别列表
26 + * @param: activity_id 活动ID
27 + * @param: is_previous 是否获取同类型上次活动的部门列表。1=是,0=否
28 + * @param: only_my_dept 是否只获取我所在的部门列表。1=是,0=否
29 + * @returns: dept_id 活动组别ID
30 + * @returns: dept_name 活动组别名称
31 + */
32 +export const getActivityDeptsAPI = (params) => fn(fetch.get(Api.ACTIVITY_DEPTS, params));
33 +
34 +/**
35 + * @description: 获取组别领用的物资列表
36 + * @param: activity_id 活动ID
37 + * @param: dept_id 活动组别ID
38 + * @param: is_previous 是否获取同类型上次活动的部门列表。1=是,0=否
39 + * @param: offset
40 + * @param: limit
41 + */
42 +export const getGoodUseListAPI = (params) => fn(fetch.get(Api.GOOD_USE_LIST, params));
43 +
44 +/**
45 + * @description: 获取购物车列表
46 + * @param: activity_id 活动ID
47 + * @returns: good_id 物资ID
48 + * @returns: product_name 物资名称
49 + * @returns: spec 物资规格
50 + * @returns: apply_number 申请数量
51 + */
52 +export const getCartListAPI = (params) => fn(fetch.get(Api.CART_LIST, params));
53 +
54 +/**
55 + * @description: 加入购物车
56 + * @param: activity_id 活动ID
57 + */
58 +export const addCartAPI = (params) => fn(fetch.post(Api.CART_ADD, params));
59 +
60 +/**
61 + * @description: 编辑购物车
62 + * @param: activity_id 活动ID
63 + * @param: good_list [{good_id,apply_number}]
64 + */
65 +export const editCartAPI = (params) => fn(fetch.post(Api.CART_EDIT, params));
66 +
67 +/**
68 + * @description: 删除购物车
69 + * @param: activity_id 活动ID
70 + * @param: good_ids 物资ID数组
71 + */
72 +export const delCartAPI = (params) => fn(fetch.post(Api.CART_DEL, params));
73 +
74 +/**
75 + * @description: 获取我的组别列表
76 + * @returns: dept_id 活动组别ID
77 + * @returns: dept_name 活动组别名称
78 + */
79 +export const myDeptsAPI = (params) => fn(fetch.get(Api.MY_DEPTS, params));
80 +
81 +/**
82 + * @description: 获取我的用户信息
83 + * @param: contact_name 领用人姓名
84 + * @param: contact_phone 领用人电话
85 + */
86 +export const myUserAPI = (params) => fn(fetch.get(Api.MY_USER, params));
87 +
88 +/**
89 + * @description: 提交物资申领
90 + * @param: activity_id 活动ID
91 + * @param: dept_id 活动的组别ID
92 + * @param: contact_name 领用人姓名
93 + * @param: contact_phone 领用人电话
94 + * @param: use_time 使用时间
95 + * @param: good_list [good_id 物资ID, apply_number 申请数量] 如果为空,就自动查询购物车中的物资
96 + */
97 +export const addUseOrderAPI = (params) => fn(fetch.post(Api.USE_ORDER_ADD, params));
98 +
99 +/**
100 + * @description: 规格物资列表
101 + * @param: k 搜索物资的名称和规格
102 + * @param: exclude_activity_id 活动ID
103 + * @param: offset
104 + * @param: limit
105 + */
106 +export const getSkuListAPI = (params) => fn(fetch.get(Api.SKU_LIST, params));
107 +
108 +/**
109 + * @description: 规格物资详情
110 + * @param: i 规格物资ID
111 + */
112 +export const getSkuInfoAPI = (params) => fn(fetch.get(Api.SKU_INFO, params));
1 +/*
2 + * @Author: hookehuyr hookehuyr@gmail.com
3 + * @Date: 2022-06-09 13:32:44
4 + * @LastEditors: hookehuyr hookehuyr@gmail.com
5 + * @LastEditTime: 2023-02-23 18:42:57
6 + * @FilePath: /data-table/src/api/wx/config.js
7 + * @Description:
8 + */
9 +import { fn, fetch } from '@/api/fn';
10 +
11 +const Api = {
12 + WX_JSAPI: '/srv/?a=wx_share',
13 +}
14 +
15 +/**
16 + * @description 获取微信CONFIG配置文件
17 + * @param {*} url
18 + * @returns {*} cfg
19 + */
20 +export const wxJsAPI = (params) => fn(fetch.get(Api.WX_JSAPI, params));
1 +/*
2 + * @Date: 2022-06-13 14:18:57
3 + * @LastEditors: hookehuyr hookehuyr@gmail.com
4 + * @LastEditTime: 2022-06-13 14:27:21
5 + * @FilePath: /tswj/src/api/wx/jsApiList.js
6 + * @Description: 文件描述
7 + */
8 +export const apiList = [
9 + // "updateAppMessageShareData",
10 + // "updateTimelineShareData",
11 + "onMenuShareTimeline",
12 + "onMenuShareAppMessage",
13 + "onMenuShareQQ",
14 + "onMenuShareWeibo",
15 + "onMenuShareQZone",
16 + "startRecord",
17 + "stopRecord",
18 + "onVoiceRecordEnd",
19 + "playVoice",
20 + "pauseVoice",
21 + "stopVoice",
22 + "onVoicePlayEnd",
23 + "uploadVoice",
24 + "downloadVoice",
25 + "chooseImage",
26 + "previewImage",
27 + "uploadImage",
28 + "downloadImage",
29 + "translateVoice",
30 + "getNetworkType",
31 + "openLocation",
32 + "getLocation",
33 + "hideOptionMenu",
34 + "showOptionMenu",
35 + "hideMenuItems",
36 + "showMenuItems",
37 + "hideAllNonBaseMenuItem",
38 + "showAllNonBaseMenuItem",
39 + "closeWindow",
40 + "scanQRCode",
41 + "chooseWXPay",
42 + "openProductSpecificView",
43 + "addCard",
44 + "chooseCard",
45 + "openCard"
46 +]
1 +/*
2 + * @Author: hookehuyr hookehuyr@gmail.com
3 + * @Date: 2022-06-09 13:32:44
4 + * @LastEditors: hookehuyr hookehuyr@gmail.com
5 + * @LastEditTime: 2022-06-09 13:42:06
6 + * @FilePath: /tswj/src/api/wx/config.js
7 + * @Description:
8 + */
9 +import { fn, fetch } from '@/api/fn';
10 +
11 +const Api = {
12 + WX_PAY: 'c/bill_paymentForBill.do',
13 +}
14 +
15 +/**
16 + * @description 微信支付接口
17 + * @param {*}
18 + * @returns {*}
19 + */
20 +export const wxPayAPI = (params) => fn(fetch.get(Api.WX_PAY, params));
1 +
2 +.modify-top {
3 + z-index: 36;
4 + position: absolute;
5 + left: 0;
6 + top: 0;
7 + width: 100%;
8 + height: 10px;
9 + background-image: url('http://gyzs.onwall.cn/top-xian%402x.png');
10 + background-size: contain;
11 +}
12 +.content-bg {
13 + /**
14 + * background-color and background-image 共存,不能使用渐变色
15 + * 图片铺平当时精度提高看看效果
16 + * 直接用渐变色
17 + * 不使用渐变色背景
18 + */
19 + height: 100%;
20 + min-height: 100vh;
21 + // background-image: url('@images/bg-yellow-duan@2x.png');
22 + background-image: url('http://gyzs.onwall.cn/bg-yellow-duan%402x.png');
23 + // background-size: cover;
24 + // background: linear-gradient(360deg, #FDD347 0%, #FFED6D 100%) ;
25 +}
1 +@namespace: 'wxggzs';
2 +
3 +/* ============ 颜色 ============ */
4 +
5 +// 主色调
6 +@base-color: #8F652E;
7 +
8 +// 文字颜色
9 +@base-font-color: #333333;
10 +@sub-font-color: #999999;
11 +
12 +// 定义一个映射
13 +#colors() {
14 + base-color: @base-color;
15 + base-font-color: @base-font-color;
16 +}
17 +
18 +// 混合
19 +.width100 {
20 + width: 100%;
21 +}
22 +
23 +.van-multi-ellipsis--l4 {
24 + display: -webkit-box;
25 + overflow: hidden;
26 + text-overflow: ellipsis;
27 + -webkit-line-clamp: 4;
28 + -webkit-box-orient: vertical;
29 +}
30 +
31 +.van-multi-ellipsis--l5 {
32 + display: -webkit-box;
33 + overflow: hidden;
34 + text-overflow: ellipsis;
35 + -webkit-line-clamp: 5;
36 + -webkit-box-orient: vertical;
37 +}
38 +
39 +.van-multi-ellipsis--l6 {
40 + display: -webkit-box;
41 + overflow: hidden;
42 + text-overflow: ellipsis;
43 + -webkit-line-clamp: 6;
44 + -webkit-box-orient: vertical;
45 +}
46 +
47 +// 自定义图片显示
48 +:deep(.van-image.custom-image) {
49 + img {
50 + border-radius: 5px;
51 + }
52 +}
53 +
54 +.multi-ellipsis--l1 {
55 + display: -webkit-box;
56 + overflow: hidden;
57 + text-overflow: ellipsis;
58 + -webkit-line-clamp: 1;
59 + -webkit-box-orient: vertical;
60 +}
61 +
62 +.multi-ellipsis--l2 {
63 + display: -webkit-box;
64 + overflow: hidden;
65 + text-overflow: ellipsis;
66 + -webkit-line-clamp: 2;
67 + -webkit-box-orient: vertical;
68 +}
69 +
70 +.multi-ellipsis--l3 {
71 + display: -webkit-box;
72 + overflow: hidden;
73 + text-overflow: ellipsis;
74 + -webkit-line-clamp: 3;
75 + -webkit-box-orient: vertical;
76 +}
77 +
78 +.multi-ellipsis--l4 {
79 + display: -webkit-box;
80 + overflow: hidden;
81 + text-overflow: ellipsis;
82 + -webkit-line-clamp: 4;
83 + -webkit-box-orient: vertical;
84 +}
85 +
86 +.multi-ellipsis--l5 {
87 + display: -webkit-box;
88 + overflow: hidden;
89 + text-overflow: ellipsis;
90 + -webkit-line-clamp: 5;
91 + -webkit-box-orient: vertical;
92 +}
93 +
94 +.multi-ellipsis--l6 {
95 + display: -webkit-box;
96 + overflow: hidden;
97 + text-overflow: ellipsis;
98 + -webkit-line-clamp: 6;
99 + -webkit-box-orient: vertical;
100 +}
1 +// Generated by 'unplugin-auto-import'
2 +export {}
3 +declare global {
4 + const EffectScope: typeof import('vue')['EffectScope']
5 + const computed: typeof import('vue')['computed']
6 + const createApp: typeof import('vue')['createApp']
7 + const customRef: typeof import('vue')['customRef']
8 + const defineAsyncComponent: typeof import('vue')['defineAsyncComponent']
9 + const defineComponent: typeof import('vue')['defineComponent']
10 + const effectScope: typeof import('vue')['effectScope']
11 + const getCurrentInstance: typeof import('vue')['getCurrentInstance']
12 + const getCurrentScope: typeof import('vue')['getCurrentScope']
13 + const h: typeof import('vue')['h']
14 + const inject: typeof import('vue')['inject']
15 + const isProxy: typeof import('vue')['isProxy']
16 + const isReactive: typeof import('vue')['isReactive']
17 + const isReadonly: typeof import('vue')['isReadonly']
18 + const isRef: typeof import('vue')['isRef']
19 + const markRaw: typeof import('vue')['markRaw']
20 + const nextTick: typeof import('vue')['nextTick']
21 + const onActivated: typeof import('vue')['onActivated']
22 + const onBeforeMount: typeof import('vue')['onBeforeMount']
23 + const onBeforeUnmount: typeof import('vue')['onBeforeUnmount']
24 + const onBeforeUpdate: typeof import('vue')['onBeforeUpdate']
25 + const onDeactivated: typeof import('vue')['onDeactivated']
26 + const onErrorCaptured: typeof import('vue')['onErrorCaptured']
27 + const onMounted: typeof import('vue')['onMounted']
28 + const onRenderTracked: typeof import('vue')['onRenderTracked']
29 + const onRenderTriggered: typeof import('vue')['onRenderTriggered']
30 + const onScopeDispose: typeof import('vue')['onScopeDispose']
31 + const onServerPrefetch: typeof import('vue')['onServerPrefetch']
32 + const onUnmounted: typeof import('vue')['onUnmounted']
33 + const onUpdated: typeof import('vue')['onUpdated']
34 + const provide: typeof import('vue')['provide']
35 + const reactive: typeof import('vue')['reactive']
36 + const readonly: typeof import('vue')['readonly']
37 + const ref: typeof import('vue')['ref']
38 + const resolveComponent: typeof import('vue')['resolveComponent']
39 + const shallowReactive: typeof import('vue')['shallowReactive']
40 + const shallowReadonly: typeof import('vue')['shallowReadonly']
41 + const shallowRef: typeof import('vue')['shallowRef']
42 + const toRaw: typeof import('vue')['toRaw']
43 + const toRef: typeof import('vue')['toRef']
44 + const toRefs: typeof import('vue')['toRefs']
45 + const triggerRef: typeof import('vue')['triggerRef']
46 + const unref: typeof import('vue')['unref']
47 + const useAttrs: typeof import('vue')['useAttrs']
48 + const useCssModule: typeof import('vue')['useCssModule']
49 + const useCssVars: typeof import('vue')['useCssVars']
50 + const useRoute: typeof import('vue-router')['useRoute']
51 + const useRouter: typeof import('vue-router')['useRouter']
52 + const useSlots: typeof import('vue')['useSlots']
53 + const watch: typeof import('vue')['watch']
54 + const watchEffect: typeof import('vue')['watchEffect']
55 + const watchPostEffect: typeof import('vue')['watchPostEffect']
56 + const watchSyncEffect: typeof import('vue')['watchSyncEffect']
57 +}
1 +/**
2 + * 判断多行省略文本
3 + * @param {*} id 目标dom标签
4 + * @returns
5 + */
6 +const hasEllipsis = (id) => {
7 + let oDiv = document.getElementById(id);
8 + let flag = false
9 + if (oDiv.scrollHeight > oDiv.clientHeight) {
10 + flag = true
11 + }
12 + return flag
13 +}
14 +
15 +export default {
16 + hasEllipsis
17 +}
...\ No newline at end of file ...\ No newline at end of file
1 +import { ref } from 'vue'
2 +import { useBrowserLocation, useEventListener, useTitle, useUrlSearchParams, useWindowScroll, logicAnd } from '@vueuse/core'
3 +export const fn = () => {
4 + // const location = useBrowserLocation()
5 + // console.warn(location.value);
6 +
7 + // useEventListener(window, 'scroll', (evt) => {
8 + // const { x, y } = useWindowScroll()
9 + // // console.warn(x.value);
10 + // console.warn(y.value);
11 + // })
12 +
13 + // useTitle('New Title')
14 +
15 + const a = ref(true)
16 + const b = ref(true)
17 + const flag = a.value && b.value
18 + console.warn(flag);
19 +
20 +}
1 +/*
2 + * @Author: hookehuyr hookehuyr@gmail.com
3 + * @Date: 2022-05-17 12:13:13
4 + * @LastEditors: hookehuyr hookehuyr@gmail.com
5 + * @LastEditTime: 2022-07-19 10:33:36
6 + * @FilePath: /front/src/composables/index.js
7 + * @Description:
8 + */
9 +import { onMounted, onUnmounted } from 'vue'
10 +
11 +/**
12 + * 添加和清除 DOM 事件监听器
13 + * @param {*} target
14 + * @param {*} event
15 + * @param {*} callback
16 + */
17 +export function useEventListener(target, event, callback) {
18 + onMounted(() => target?.addEventListener(event, callback))
19 + onUnmounted(() => target?.removeEventListener(event, callback))
20 +}
1 +/*
2 + * @Date: 2022-06-13 17:42:32
3 + * @LastEditors: hookehuyr hookehuyr@gmail.com
4 + * @LastEditTime: 2023-03-03 17:51:55
5 + * @FilePath: /data-table/src/composables/useShare.js
6 + * @Description: 文件描述
7 + */
8 +import wx from 'weixin-js-sdk';
9 +// import { Toast } from 'vant';
10 +
11 +/**
12 + * @description: 微信分享功能
13 + * @param {*} title 标题
14 + * @param {*} desc 描述
15 + * @param {*} imgUrl 图标
16 + * @return {*}
17 + */
18 +export const sharePage = ({title = '自定义表单', desc = '数据收集', imgUrl = ''}) => {
19 + const shareData = {
20 + title, // 分享标题
21 + desc, // 分享描述
22 + link: location.origin + location.pathname + location.hash, // 分享链接,该链接域名或路径必须与当前页面对应的公众号 JS 安全域名一致
23 + imgUrl, // 分享图标
24 + success: function () {
25 + console.warn('设置成功');
26 + }
27 + }
28 + // 分享好友(微信好友或qq好友)
29 + // wx.updateAppMessageShareData(shareData);
30 + wx.onMenuShareAppMessage(shareData);
31 + // 分享到朋友圈或qq空间
32 + // wx.updateTimelineShareData(shareData);
33 + wx.onMenuShareTimeline(shareData);
34 + // 分享到腾讯微博
35 + wx.onMenuShareWeibo(shareData);
36 + // // 获取“分享给朋友”按钮点击状态及自定义分享内容接口(即将废弃)
37 + // wx.onMenuShareAppMessage(shareData);
38 + // // 获取“分享到朋友圈”按钮点击状态及自定义分享内容接口(即将废弃)
39 + // wx.onMenuShareTimeline(shareData);
40 + // // 获取“分享到QQ”按钮点击状态及自定义分享内容接口(即将废弃)
41 + // wx.onMenuShareQQ(shareData);
42 +}
1 +/*
2 + * @Date: 2022-07-18 10:22:22
3 + * @LastEditors: hookehuyr hookehuyr@gmail.com
4 + * @LastEditTime: 2022-08-05 17:17:15
5 + * @FilePath: /front/src/constant.js
6 + * @Description: 文件描述
7 + */
8 +// 颜色变量
9 +export const styleColor = {
10 + baseColor: '#C2915F',
11 + backgroundColor: '#FFF9EF',
12 +}
1 +/*
2 + * @Author: hookehuyr hookehuyr@gmail.com
3 + * @Date: 2022-05-14 23:28:39
4 + * @LastEditors: hookehuyr hookehuyr@gmail.com
5 + * @LastEditTime: 2022-06-07 22:49:56
6 + * @FilePath: /tswj/src/env.d.ts
7 + * @Description:
8 + */
9 +interface ImportMetaEnv extends Readonly<Record<string, string>> {
10 + readonly VITE_OPENID: string;
11 + readonly VITE_ID: string;
12 + readonly VITE_PIN: string;
13 + readonly VITE_APPID: string;
14 +}
15 +
16 +interface ImportMeta {
17 + readonly env: ImportMetaEnv
18 +}
1 +/**
2 + * 依赖注入命名集合
3 + */
4 +export const myInjectionKey = Symbol()
5 +export const fooInjectionKey = Symbol()
1 +import _ from 'lodash'
2 +import TableField from '@/components/TableField/index.vue'
3 +import TextField from '@/components/TextField/index.vue'
4 +import TextareaField from '@/components/TextareaField/index.vue'
5 +import RadioField from '@/components/RadioField/index.vue'
6 +import CheckboxField from '@/components/CheckboxField/index.vue'
7 +import PickerField from '@/components/PickerField/index.vue'
8 +import AreaPickerField from '@/components/AreaPickerField/index.vue'
9 +import DatePickerField from '@/components/DatePickerField/index.vue'
10 +import TimePickerField from '@/components/TimePickerField/index.vue'
11 +import DateTimePickerField from '@/components/DateTimePickerField/index.vue'
12 +import ImageUploaderField from '@/components/ImageUploaderField/index.vue'
13 +import FileUploaderField from '@/components/FileUploaderField/index.vue'
14 +import PhoneField from '@/components/PhoneField/index.vue'
15 +import EmailField from '@/components/EmailField/index.vue'
16 +import SignField from '@/components/SignField/index.vue'
17 +import RatePickerField from '@/components/RatePickerField/index.vue'
18 +import CalendarField from '@/components/CalendarField/index.vue'
19 +import IdentityField from '@/components/IdentityField/index.vue'
20 +import NumberField from '@/components/NumberField/index.vue'
21 +import DesField from '@/components/DesField/index.vue'
22 +import DividerField from '@/components/DividerField/index.vue'
23 +import VideoField from '@/components/VideoField/index.vue'
24 +import MarqueeField from '@/components/MarqueeField/index.vue'
25 +import ContactField from '@/components/ContactField/index.vue'
26 +import RuleField from '@/components/RuleField/index.vue'
27 +import MultiRuleField from '@/components/MultiRuleField/index.vue'
28 +import ButtonField from '@/components/ButtonField/index.vue'
29 +import NoteField from '@/components/NoteField/index.vue';
30 +import NameField from '@/components/NameField/index.vue';
31 +import GenderField from '@/components/GenderField/index.vue';
32 +import AppointmentField from '@/components/AppointmentField/index.vue';
33 +import CustomField from '@/components/CustomField/index.vue';
34 +import GroupField from '@/components/GroupField/index.vue';
35 +import OrgPickerField from '@/components/OrgPickerField/index.vue';
36 +import VolunteerGroupField from '@/components/VolunteerGroupField/index.vue';
37 +
38 +/**
39 + * 生成自定义组件类型
40 + * @param {*} data
41 + * @type input 单行文本 TextField
42 + * @type textarea 多行文本 TextareaField
43 + * @type radio 单项选择 RadioField
44 + * @type checkbox 多项选择 CheckboxField
45 + * @type select 单列选择器 PickerField
46 + * @type area_picker 地址选择器 AreaPickerField
47 + * @type date_picker 日期选择器 DatePickerField
48 + * @type time_picker 时间选择器 TimePickerField
49 + * @type datetime_picker 日期时间选择器 DateTimePickerField
50 + * @type image_uploader 图片上传 ImageUploaderField
51 + * @type phone 手机输入框 PhoneField
52 + * @type email 邮箱输入框 EmailField
53 + * @type sign 电子签名输入框 SignField
54 + * @type rate_picker 评分选择器 RatePickerField
55 + * @type calendar 日历选择器 CalendarField
56 + * @type id_code 身份证输入框 IdentityField
57 + * @type desc 文字描述 DesField
58 + * @type divider 分割线 DividerField
59 + * @type video 视频控件 VideoField
60 + * @type marquee 跑马灯控件 MarqueeField
61 + * @type rule 活动规则控件 RuleField
62 + * @type multi_rule 活动规则控件 MultiRuleField
63 + * @type note 富文本控件 NoteField
64 + * @type name 姓名控件 NameField
65 + * @type gender 性别控件 GenderField
66 + * @type appointment 预约控件 AppointmentField
67 + * @type group 组集合输入控件 GroupField
68 + * @type org_picker 树形选择控件 OrgPickerField
69 + * @type volunteer_group 义工组别选择控件 VolunteerGroupField
70 + */
71 +export function createComponentType(data) {
72 + // 判断类型和使用组件
73 + _.each(data, (item, index) => {
74 + // 必填项规则添加
75 + if (item.component_props.required) {
76 + item.rules = [{ required: true, message: item.placeholder ? item.placeholder : '必填项不能为空' }]
77 + }
78 + if (item.component_props.tag === 'input') {
79 + item.type = 'text';
80 + item.name = item.key;
81 + item.component = TextField;
82 + }
83 + if (item.component_props.tag === 'textarea') {
84 + item.type = 'textarea';
85 + item.name = item.key;
86 + // item.rows = 10;
87 + item.autosize = true;
88 + item.component = TextareaField;
89 + }
90 + if (item.component_props.tag === 'number') {
91 + item.name = item.key;
92 + item.component = NumberField;
93 + }
94 + if (item.component_props.tag === 'radio') {
95 + item.component = RadioField;
96 + }
97 + if (item.component_props.tag === 'checkbox') {
98 + item.component = CheckboxField;
99 + }
100 + if (item.component_props.tag === 'select') {
101 + item.component = PickerField;
102 + }
103 + if (item.component_props.tag === 'address') {
104 + item.component = AreaPickerField;
105 + }
106 + if (item.component_props.tag === 'date') {
107 + item.component = DatePickerField;
108 + }
109 + if (item.component_props.tag === 'time') {
110 + item.component = TimePickerField;
111 + }
112 + if (item.component_props.tag === 'datetime') {
113 + item.component = DateTimePickerField;
114 + }
115 + if (item.component_props.tag === 'image_uploader') {
116 + item.component = ImageUploaderField;
117 + }
118 + if (item.component_props.tag === 'file_uploader') {
119 + item.component = FileUploaderField;
120 + }
121 + if (item.component_props.tag === 'phone') {
122 + item.name = item.key;
123 + item.component = PhoneField;
124 + }
125 + if (item.component_props.tag === 'email') {
126 + item.name = item.key;
127 + item.component = EmailField;
128 + }
129 + if (item.component_props.tag === 'sign') {
130 + item.name = item.key;
131 + item.component = SignField;
132 + }
133 + if (item.component_props.tag === 'rate') {
134 + item.name = item.key;
135 + item.component = RatePickerField;
136 + }
137 + if (item.component_props.tag === 'calendar') {
138 + item.name = item.key;
139 + item.component = CalendarField;
140 + }
141 + if (item.component_props.tag === 'id_card') {
142 + item.name = item.key;
143 + item.component = IdentityField;
144 + }
145 + if (item.component_props.tag === 'desc') {
146 + item.name = item.key;
147 + item.component = DesField;
148 + }
149 + if (item.component_props.tag === 'divider') {
150 + item.name = item.key;
151 + item.component = DividerField;
152 + }
153 + if (item.component_props.tag === 'video') {
154 + item.name = item.key;
155 + item.component = VideoField;
156 + }
157 + if (item.component_props.tag === 'marquee') {
158 + item.name = item.key;
159 + item.component = MarqueeField;
160 + }
161 + if (item.component_props.tag === 'contact') {
162 + item.name = item.key;
163 + item.component = ContactField;
164 + }
165 + if (item.component_props.tag === 'rule') {
166 + item.name = item.key;
167 + item.component = RuleField;
168 + }
169 + if (item.component_props.tag === 'button') {
170 + item.name = item.key;
171 + item.component = ButtonField;
172 + }
173 + if (item.component_props.tag === 'multi_rule') {
174 + item.name = item.key;
175 + item.value = [];
176 + item.component = MultiRuleField;
177 + }
178 + if (item.component_props.tag === 'note') {
179 + item.name = item.key;
180 + item.component = NoteField;
181 + }
182 + if (item.component_props.tag === 'name') {
183 + item.name = item.key;
184 + item.component = NameField;
185 + }
186 + if (item.component_props.tag === 'gender') {
187 + item.name = item.key;
188 + item.component = GenderField;
189 + }
190 + if (item.component_props.tag === 'appointment') {
191 + item.name = item.key;
192 + item.component = AppointmentField;
193 + }
194 + if (item.component_props.tag === 'custom') {
195 + item.name = item.key;
196 + item.component = CustomField;
197 + }
198 + if (item.component_props.tag === 'group') {
199 + item.name = item.key;
200 + item.component = GroupField;
201 + }
202 + if (item.component_props.tag === 'org_picker') {
203 + item.name = item.key;
204 + item.component = OrgPickerField;
205 + }
206 + if (item.component_props.tag === 'volunteer_group') {
207 + item.component = VolunteerGroupField;
208 + }
209 + })
210 +}
1 +import { provide, inject } from "vue";
2 +
3 +// const key = Symbol();
4 +
5 +/**
6 + * 创建全局变量
7 + * @param {*} context
8 + * @param {*} key
9 + */
10 +export function createContext(context, key) {
11 + provide(key, context)
12 +}
13 +/**
14 + * 使用全局变量
15 + * @param {*} key
16 + * @returns
17 + */
18 +export function useContext(key) {
19 + return inject(key)
20 +}
1 +/*
2 + * @Author: hookehuyr hookehuyr@gmail.com
3 + * @Date: 2022-05-28 22:31:25
4 + * @LastEditors: hookehuyr hookehuyr@gmail.com
5 + * @LastEditTime: 2022-05-30 10:18:09
6 + * @FilePath: /tswj/src/hooks/useDebounce.js
7 + * @Description:
8 + */
9 +import _ from 'lodash';
10 +/**
11 + * 封装lodash防抖
12 + * @param {*} fn 执行函数
13 + * @param {*} timestamp 执行间隔
14 + * @param {*} options 函数配置 - 在延迟开始前调用,在延迟结束后不调用
15 + * @returns 返回新的 debounced(防抖动)函数。
16 + */
17 +export const useDebounce = (fn, timestamp = 500, options = { leading: true, trailing: false }) => {
18 + return _.debounce(fn, timestamp, options);
19 +}
1 +
2 +/**
3 + * @description 封装简化滚动查询列表执行流程
4 + * @param {*} data 接口返回列表数据
5 + * @param {*} list 自定义列表
6 + * @param {*} offset
7 + * @param {*} loading
8 + * @param {*} finished
9 + * @param {*} finishedTextStatus
10 + * @param {*} emptyStatus
11 + */
12 +import _ from 'lodash'
13 +
14 +export const flowFn = (data, list, offset, loading, finished, finishedTextStatus, emptyStatus) => {
15 + list.value = _.concat(list.value, data);
16 + list.value = _.uniqBy(list.value, 'id');
17 + offset.value = list.value.length;
18 + loading.value = false;
19 + // 数据全部加载完成
20 + if (!data.length) {
21 + // 加载状态结束
22 + finished.value = true;
23 + }
24 + // 空数据提示
25 + if (!list.value.length) {
26 + finishedTextStatus.value = false;
27 + }
28 + emptyStatus.value = Object.is(list.value.length, 0);
29 +}
1 +/*
2 + * @Date: 2022-07-21 13:28:05
3 + * @LastEditors: hookehuyr hookehuyr@gmail.com
4 + * @LastEditTime: 2022-08-22 09:51:52
5 + * @FilePath: /front/src/hooks/useGo.js
6 + * @Description: 文件描述
7 + */
8 +import { useRouter } from 'vue-router';
9 +import { getArticleAPI } from '@/api'
10 +import { Cookies } from '@/utils/generatePackage'
11 +import { parseQueryString } from '@/utils/tools'
12 +
13 +/**
14 + * 封装路由跳转方便行内调用
15 + * @returns
16 + */
17 +export function useGo () {
18 + let router = useRouter()
19 + function go (path, query) {
20 + router.push({
21 + path: path,
22 + query: query
23 + })
24 + }
25 + return go
26 +}
27 +
28 +/**
29 + * 封装跳转文章详情页
30 + * @param id 文章ID
31 + * @param cid 栏目ID
32 + * @param column 栏目名称
33 + * @param section 二级栏目名称
34 + * @param name 子栏目名称
35 + * @returns
36 + */
37 +export function useGoTo () {
38 + let router = useRouter()
39 + // function detail({ id, cid, column, section, name, post_link }) {
40 + function detail(item) {
41 + // 保存点击位置
42 + // Cookies.set('scrollTop', getScrollTop());
43 + // Cookies.set('scrollTopId', id);
44 + // 判断是否跳转URL
45 + // const { code, data } = await getArticleAPI({ f: 'article', i: id, cid });
46 + // if (code) {
47 + // if (data.post_link) { // 优先显示链接文章
48 + // location.href = data.post_link;
49 + // return false;
50 + // }
51 + // router.push({
52 + // path: '/detail',
53 + // query: { cid, id, column, section, name }
54 + // });
55 + // }
56 + if (item) {
57 + if (item.post_link) {
58 + if (item.post_link.indexOf('f/guanzong/web')) {
59 + item.post_link = item.post_link.replace('web', 'front');
60 + }
61 + if (item.post_link.indexOf('f/guanzong/web/#/list') > 0 || item.post_link.indexOf('f/guanzong/front/#/list') > 0) {
62 + router.push({
63 + path: '/list',
64 + query: parseQueryString(item.post_link)
65 + });
66 + return false;
67 + } else if (item.post_link) { // 优先显示链接文章
68 + location.href = item.post_link;
69 + return false;
70 + }
71 + } else {
72 + router.push({
73 + path: '/detail',
74 + query: { cid: item.item, id: item.id, column: item.column, section: item.section, name: item.name }
75 + });
76 + }
77 + }
78 + }
79 + return detail
80 +}
81 +
82 +export function useReplace () {
83 + let router = useRouter()
84 + function replace (path, query) {
85 + router.replace({
86 + path: path,
87 + query: query
88 + })
89 + }
90 + return replace
91 +}
92 +
93 +export function getScrollTop () {
94 + var scroll_top = 0;
95 + if (document.documentElement && document.documentElement.scrollTop) {
96 + scroll_top = document.documentElement.scrollTop;
97 + }
98 + else if (document.body) {
99 + scroll_top = document.body.scrollTop;
100 + }
101 + return scroll_top;
102 +}
1 +import { mainStore } from '@/utils/generatePackage.js'
2 +
3 +// 删除 keep-alive 缓存
4 +export const store = mainStore();
5 +
6 +export const killPages = () => {
7 + store.changeKeepPages();
8 +}
9 +
10 +export const addPages = () => {
11 + store.keepThisPage();
12 +}
1 +/*
2 + * @Author: hookehuyr hookehuyr@gmail.com
3 + * @Date: 2022-05-31 12:06:19
4 + * @LastEditors: hookehuyr hookehuyr@gmail.com
5 + * @LastEditTime: 2024-09-06 17:39:52
6 + * @FilePath: /custom_table/src/main.js
7 + * @Description:
8 + */
9 +import { createApp } from 'vue';
10 +import router from './router';
11 +import ElementPlus from 'element-plus'
12 +import 'element-plus/dist/index.css'
13 +import App from './App.vue';
14 +// import axios from './utils/axios';
15 +import axios from '@/utils/axios';
16 +// import 'default-passive-events'; // 解决Chrome控制台non-passive event listener输出问题
17 +import { createPinia } from 'pinia';
18 +
19 +const pinia = createPinia();
20 +const app = createApp(App);
21 +
22 +// 屏蔽警告信息
23 +app.config.warnHandler = () => null;
24 +
25 +app.config.globalProperties.$http = axios; // 关键语句
26 +
27 +app.use(pinia).use(router).use(ElementPlus)
28 +app.mount('#app');
This diff is collapsed. Click to expand it.
1 +/*
2 + * @Date: 2022-07-18 12:57:31
3 + * @LastEditors: hookehuyr hookehuyr@gmail.com
4 + * @LastEditTime: 2022-07-21 17:03:02
5 + * @FilePath: /front/src/mock/nav.js
6 + * @Description: 文件描述
7 + */
8 +const data = [{
9 + title: '首页',
10 + link: '/',
11 + sub: []
12 +}, {
13 + title: '走进寺院',
14 + link: '/temple',
15 + sub: []
16 +}, {
17 + title: '寺院新闻',
18 + link: '',
19 + sub: [{
20 + id: 'xxx',
21 + title: '公告',
22 + link: '/column'
23 + }, {
24 + title: '招聘',
25 + link: ''
26 + }, {
27 + title: '新闻',
28 + link: ''
29 + }]
30 +}, {
31 + title: '智慧课堂',
32 + link: '',
33 + sub: [{
34 + title: '活动与咨询',
35 + link: ''
36 + }, {
37 + title: '福田功德',
38 + link: ''
39 + }, {
40 + title: '广结善缘',
41 + link: ''
42 + }]
43 +}, {
44 + title: '弘法利生',
45 + link: '',
46 + sub: [{
47 + title: '法务活动',
48 + link: ''
49 + }, {
50 + title: '本源法师开示',
51 + link: ''
52 + }, {
53 + title: '短期出家',
54 + link: ''
55 + }, {
56 + title: '闻思修慧',
57 + link: ''
58 + }, {
59 + title: '素食护生',
60 + link: ''
61 + }, {
62 + title: '妙智学堂',
63 + link: ''
64 + }]
65 +}, {
66 + title: '义工之家',
67 + link: '',
68 + sub: [{
69 + title: '义工之家',
70 + link: ''
71 + }]
72 +}, {
73 + title: '普明慈善基金会',
74 + link: '/foundation',
75 + sub: []
76 +}, {
77 + title: '生命关怀',
78 + link: '',
79 + sub: [{
80 + title: '生命关怀',
81 + link: ''
82 + }]
83 +}]
84 +
85 +export default data
1 +const routes = [{
2 + path: '/image',
3 + redirect: '',
4 + name: 'html转图片',
5 + component: 'html2canvas',
6 + keepAlive: '',
7 + meta: {
8 + title: 'html转图片',
9 + name: ''
10 + },
11 + children: [{
12 + path: 'children',
13 + redirect: '',
14 + name: 'html转图片',
15 + component: 'children-test',
16 + keepAlive: '',
17 + meta: {
18 + title: 'html转图片',
19 + name: ''
20 + }
21 + }]
22 +}]
23 +// const routes = []
24 +
25 +export default routes
1 +/*
2 + * @Date: 2022-07-18 15:05:39
3 + * @LastEditors: hookehuyr hookehuyr@gmail.com
4 + * @LastEditTime: 2022-07-22 14:34:25
5 + * @FilePath: /front/src/mock/swipe.js
6 + * @Description: 文件描述
7 + */
8 +const data = [{
9 + id: '1',
10 + src: 'https://fastly.jsdelivr.net/npm/@vant/assets/cat.jpeg',
11 + title: '文章1',
12 + link: '/detail'
13 +}, {
14 + id: '2',
15 + src: 'https://fastly.jsdelivr.net/npm/@vant/assets/cat.jpeg',
16 + title: '文章2',
17 + link: '/detail'
18 +}, {
19 + id: '3',
20 + src: 'https://fastly.jsdelivr.net/npm/@vant/assets/cat.jpeg',
21 + title: '文章3',
22 + link: '/detail'
23 +}]
24 +export default data
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
1 +<template>
2 + <router-view></router-view>
3 +</template>
4 +
5 +<script>
6 +export default {
7 + data () {
8 + return {
9 +
10 + }
11 + },
12 + mounted () {
13 +
14 + },
15 + methods: {
16 +
17 + }
18 +}
19 +</script>
1 +<!DOCTYPE html>
2 +<html lang="en">
3 + <head>
4 + <meta charset="UTF-8" />
5 + <link rel="icon" href="/favicon.ico" />
6 + <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7 + <title>Vite App1</title>
8 + </head>
9 + <body>
10 + <div id="app"></div>
11 + <script type="module" src="./main.js"></script>
12 + </body>
13 +</html>
1 +import { createApp } from 'vue';
2 +import App from './App.vue';
3 +// import store, { key } from './store/index';
4 +import router from './router';
5 +
6 +createApp(App).use(router).mount('#app');
1 +import { createRouter, createWebHashHistory } from 'vue-router';
2 +
3 +const router = createRouter({
4 + history: createWebHashHistory('/index.html'),
5 + routes: [
6 + {
7 + path: '/',
8 + name: 'mono2',
9 + component: () => import('./views/index.vue'),
10 + },
11 + ],
12 +});
13 +
14 +export default router;
1 +<template>
2 + <div class="">456</div>
3 +</template>
4 +
5 +<script>
6 +export default {
7 + data () {
8 + return {
9 +
10 + }
11 + },
12 + mounted () {
13 +
14 + },
15 + methods: {
16 +
17 + }
18 +}
19 +</script>
20 +
21 +<style lang="less" scoped>
22 +
23 +</style>
1 +<template>
2 + <router-view></router-view>
3 +</template>
4 +
5 +<script>
6 +export default {
7 + data () {
8 + return {
9 +
10 + }
11 + },
12 + mounted () {
13 +
14 + },
15 + methods: {
16 +
17 + }
18 +}
19 +</script>
1 +<!DOCTYPE html>
2 +<html lang="en">
3 + <head>
4 + <meta charset="UTF-8" />
5 + <link rel="icon" href="/favicon.ico" />
6 + <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7 + <title>Vite App1</title>
8 + </head>
9 + <body>
10 + <div id="app"></div>
11 + <script type="module" src="./main.js"></script>
12 + </body>
13 +</html>
1 +import { createApp } from 'vue';
2 +import App from './App.vue';
3 +// import store, { key } from './store/index';
4 +import router from './router';
5 +
6 +createApp(App).use(router).mount('#app');
1 +import { createRouter, createWebHashHistory } from 'vue-router';
2 +
3 +const router = createRouter({
4 + history: createWebHashHistory('/index.html'),
5 + routes: [
6 + {
7 + path: '/',
8 + name: 'mono2',
9 + component: () => import('./views/index.vue'),
10 + },
11 + ],
12 +});
13 +
14 +export default router;
1 +<template>
2 + <div class="">123</div>
3 +</template>
4 +
5 +<script>
6 +export default {
7 + data () {
8 + return {
9 +
10 + }
11 + },
12 + mounted () {
13 +
14 + },
15 + methods: {
16 +
17 + }
18 +}
19 +</script>
20 +
21 +<style lang="less" scoped>
22 +
23 +</style>
1 +/*
2 + * @Date: 2023-09-01 10:29:30
3 + * @LastEditors: hookehuyr hookehuyr@gmail.com
4 + * @LastEditTime: 2024-09-06 17:26:37
5 + * @FilePath: /custom_table/src/route.js
6 + * @Description: 文件描述
7 + */
8 +export default [{
9 + path: '/',
10 + component: () => import('@/views/index.vue'),
11 + meta: {
12 + title: '首页',
13 + }
14 +}, {
15 + path: '/success',
16 + component: () => import('@/views/success.vue'),
17 + meta: {
18 + title: '申领成功',
19 + }
20 +}, {
21 + path: '/auth',
22 + component: () => import('@/views/auth.vue'),
23 + meta: {
24 + title: '授权页面',
25 + }
26 +}];
1 +/*
2 + * @Date: 2022-05-26 13:57:28
3 + * @LastEditors: hookehuyr hookehuyr@gmail.com
4 + * @LastEditTime: 2022-06-29 21:36:59
5 + * @FilePath: /tswj/src/router.js
6 + * @Description: 文件描述
7 + */
8 +import { createRouter, createWebHashHistory } from 'vue-router';
9 +import RootRoute from './route.js';
10 +import asyncRoutesArr from "./mock/routes"
11 +import generateRoutes from './utils/generateRoute'
12 +
13 +// TAG: 路由配置表
14 +/**
15 + * 把项目独有的路由配置到相应的路径,默认路由文件只放公用部分
16 + * 但是 vue 文件内容还是要事先准备好
17 + */
18 +const modules = import.meta.globEager('@/router/routes/modules/**/*.js'); // Vite 支持使用特殊的 import.meta.glob 函数从文件系统导入多个模块
19 +const routeModuleList = [];
20 +
21 +Object.keys(modules).forEach((key) => {
22 + const mod = modules[key].default || {};
23 + const modList = Array.isArray(mod) ? [...mod] : [mod];
24 + routeModuleList.push(...modList);
25 +});
26 +
27 +// 创建路由实例并传递 `routes` 配置
28 +const router = createRouter({
29 + history: createWebHashHistory('/index.html'),
30 + routes: [...RootRoute, ...routeModuleList]
31 +});
32 +
33 +// TAG: 动态生成路由
34 +/**
35 + * generateRoute 负责把后台返回数据拼接成项目需要的路由结构,动态添加到路由表里面
36 + */
37 +router.beforeEach((to, from, next) => {
38 + // 使用404为中转页面,避免动态路由没有渲染出来,控制台报警告问题
39 + if (to.path == '/404' && to.redirectedFrom != undefined) {
40 + // 模拟异步操作
41 + setTimeout(() => {
42 + if (!asyncRoutesArr.length) return; // 没有动态路由避免报错
43 + const arr = generateRoutes(asyncRoutesArr); // 在路由守卫处生成,避免有子路由时刷新白屏问题。
44 + arr.forEach(item => {
45 + router.addRoute(item) // 新增路由
46 + })
47 + // 重写被404覆盖路由信息
48 + next({ ...to.redirectedFrom, replace: true });
49 + }, 1000);
50 + } else {
51 + next()
52 + }
53 +})
54 +
55 +router.afterEach(() => {
56 + // console.warn(to);
57 + // console.warn(wx);
58 + // share(to)
59 +})
60 +
61 +export default router;
1 +const index = [{
2 + path: '/auth',
3 + name: '授权跳转页',
4 + component: () => import('@/views/auth.vue'),
5 + meta: {
6 + title: '微信授权'
7 + },
8 + children: []
9 +}]
10 +
11 +export default index;
1 +/*
2 + * @Date: 2022-06-15 17:09:03
3 + * @LastEditors: hookehuyr hookehuyr@gmail.com
4 + * @LastEditTime: 2022-07-18 10:54:32
5 + * @FilePath: /front/src/router/routes/modules/common/index.js
6 + * @Description: 文件描述
7 + */
8 +const index = [{ // 配置404为动态路由中转页面
9 + path: '/:pathMatch(.*)*',
10 + redirect: '/404'
11 +}, {
12 + path: '/404',
13 + name: '404',
14 + component: () => import('@/views/404.vue'),
15 + meta: {
16 + icon: '',
17 + title: '404',
18 + },
19 + children: [],
20 +}];
21 +
22 +export default index;
1 +export default {
2 + defaultPageSize: 10,
3 +}
1 +/*
2 + * @Author: hookehuyr hookehuyr@gmail.com
3 + * @Date: 2022-05-26 10:08:06
4 + * @LastEditors: hookehuyr hookehuyr@gmail.com
5 + * @LastEditTime: 2022-06-02 22:50:53
6 + * @FilePath: /tswj/src/settings/designSetting.js
7 + * @Description:
8 + */
9 +import { ref } from 'vue';
10 +import { styleColor } from '@/constant.js';
11 +
12 +export const styleObject1 = ref({
13 + backgroundColor: styleColor.baseFontColor,
14 + color: styleColor.baseColor,
15 + borderColor: styleColor.baseColor
16 +})
17 +
18 +export const styleObject2 = ref({
19 + backgroundColor: styleColor.baseColor,
20 + color: styleColor.baseFontColor,
21 + borderColor: styleColor.baseColor
22 +})
23 +
24 +export const styleObject3 = ref({
25 + // backgroundColor: '#6D97D2',
26 + backgroundColor: '#F4675A',
27 + color: styleColor.baseFontColor,
28 + // borderColor: '#6D97D2'
29 + borderColor: '#F4675A'
30 +})
31 +
32 +export const styleObject4 = ref({
33 + backgroundColor: styleColor.baseFontColor,
34 + color: '#713610',
35 + borderColor: '#713610'
36 +})
37 +
38 +export const styleObject5 = ref({
39 + backgroundColor: styleColor.baseFontColor,
40 + color: '#FDD347',
41 + borderColor: '#FDD347'
42 +})
43 +
44 +export const styleObject6 = ref({
45 + backgroundColor: styleColor.baseFontColor,
46 + color: '#777777',
47 + borderColor: '#777777'
48 +})
49 +
50 +export const styleObject7 = ref({
51 + backgroundColor: styleColor.baseFontColor,
52 + color: '#0B3A72',
53 + borderColor: '#0B3A72'
54 +})
1 +/*
2 + * @Author: hookehuyr hookehuyr@gmail.com
3 + * @Date: 2022-06-07 22:46:46
4 + * @LastEditors: hookehuyr hookehuyr@gmail.com
5 + * @LastEditTime: 2022-06-08 05:34:56
6 + * @FilePath: /tswj/src/shims-vue.d.ts
7 + * @Description:
8 + */
9 +declare module '*.vue' {
10 + import type { DefineComponent } from 'vue';
11 + const component: DefineComponent;
12 + export default component;
13 +}
1 +/*
2 + * @Date: 2022-04-18 15:59:42
3 + * @LastEditors: hookehuyr hookehuyr@gmail.com
4 + * @LastEditTime: 2023-03-03 10:10:27
5 + * @FilePath: /data-table/src/store/index.js
6 + * @Description: 文件描述
7 + */
8 +import { defineStore } from 'pinia';
9 +// import { testStore } from './test'; // 另一个store
10 +import _ from 'lodash';
11 +import { useRouter } from 'vue-router'
12 +
13 +export const mainStore = defineStore('main', {
14 + state: () => {
15 + return {
16 + msg: 'Hello world',
17 + count: 0,
18 + auth: false,
19 + comment_num: 0,
20 + video_detail: {},
21 + scrollTop: 0,
22 + scrollTopCollection: 0,
23 + scrollTopLike: 0,
24 + scrollTopPerson: 0,
25 + keepPages: ['default'], // 很坑爹,空值全部都缓存
26 + fieldName: '',
27 + formInfo: {}, // 表单字段信息
28 + formSetting: {}, // 表单数据收集设置
29 + successInfo: {}, // 表单提交返回值
30 + };
31 + },
32 + getters: {
33 + getKeepPages () {
34 + return this.keepPages
35 + },
36 + // getTestStoreList () {
37 + // return testStore().list // 返回另一个store的值
38 + // }
39 + },
40 + actions: {
41 + changeState (state) {
42 + this.auth = state;
43 + },
44 + changeCommentNum (num) {
45 + this.comment_num = num;
46 + },
47 + changeVideoDetail (v) {
48 + this.video_detail = v;
49 + },
50 + changeScrollTop (v) {
51 + this.scrollTop = v;
52 + },
53 + changeScrollTopCollection (v) {
54 + this.scrollTopCollection = v;
55 + },
56 + changeScrollTopLike (v) {
57 + this.scrollTopLike = v;
58 + },
59 + changeScrollTopPerson (v) {
60 + this.scrollTopPerson = v;
61 + },
62 + changeKeepPages () { // 清空所有缓存,用一个不存在的值覆盖
63 + this.keepPages = ['default'];
64 + },
65 + keepThisPage () { // 新增缓存页
66 + const $router = useRouter();
67 + const page = $router.currentRoute.value.meta.name;
68 + this.keepPages.push(page);
69 + },
70 + removeThisPage () { // 删除缓存页
71 + const $router = useRouter();
72 + const page = $router.currentRoute.value.meta.name;
73 + _.remove(this.keepPages, item => item === page)
74 + },
75 + changeFieldName (v) {
76 + this.fieldName = v;
77 + },
78 + changeFormInfo (v) {
79 + this.formInfo = v;
80 + },
81 + changeFormSetting (v) {
82 + this.formSetting = v;
83 + },
84 + changeSuccessInfo (v) {
85 + this.successInfo = v;
86 + },
87 + },
88 +});
1 +/*
2 + * @Date: 2022-07-18 10:22:22
3 + * @LastEditors: hookehuyr hookehuyr@gmail.com
4 + * @LastEditTime: 2022-07-18 10:42:46
5 + * @FilePath: /front/src/theme-vars.js
6 + * @Description: 文件描述
7 + */
1 +/*
2 + * @Date: 2022-06-20 01:22:50
3 + * @LastEditors: hookehuyr hookehuyr@gmail.com
4 + * @LastEditTime: 2022-06-20 01:23:18
5 + * @FilePath: /tswj/src/composables/useMonitorKeyboard.js
6 + * @Description: 文件描述
7 + */
8 +/**
9 + * @class 监听虚拟键盘
10 + * @classdesc 监听虚拟键盘弹出隐藏
11 + * @public onEnd 结束监听虚拟键盘
12 + * @public onShow 传递一个回调 监听虚拟键盘弹出
13 + * @public onHidden 传递一个回调 监听虚拟键盘隐藏
14 + */
15 +class MonitorKeyboard {
16 + constructor() {
17 + this.type = this.IsIA();
18 + this.originalHeight = window.innerHeight;
19 + }
20 +
21 + /**
22 + * @function IsIA 获取设备类型
23 + * @param 1 Android 2 iOS
24 + */
25 + IsIA = () => {
26 + const userAgent = typeof window === 'object' ? window.navigator.userAgent : '';
27 + if (/android/i.test(userAgent)) {
28 + return 1;
29 + } else if (/iPhone|iPod|iPad/i.test(userAgent)) {
30 + return 2;
31 + }
32 + }
33 +
34 + // Android系统
35 + onResize = () => {
36 + //键盘弹起与隐藏都会引起窗口的高度发生变化
37 + const resizeHeight = window.innerHeight;
38 +
39 + if (this.originalHeight - resizeHeight > 50) {
40 + this.show('Android系统: 软键盘弹出');
41 + } else {
42 + this.hidden('Android系统: 软键盘收起');
43 + }
44 + }
45 +
46 + // iOS获取焦点
47 + onFocusin = () => {
48 + this.show('iOS系统:软键盘弹出');
49 + }
50 +
51 + // iOS失去焦点
52 + onFocusout = () => {
53 + this.hidden('iOS系统:软键盘收起');
54 + }
55 +
56 + /**
57 + * @function onStart 开始监听虚拟键盘
58 + */
59 + onStart = () => {
60 + if (this.type == 1) {
61 + // 获取窗口的高度
62 + window.addEventListener('resize', this.onResize);
63 + }
64 + if (this.type == 2) {
65 + // iOS系统
66 + window.addEventListener('focusin', this.onFocusin);
67 + window.addEventListener('focusout', this.onFocusout);
68 + }
69 + }
70 +
71 + /**
72 + * @function onEnd 结束监听虚拟键盘
73 + */
74 + onEnd = () => {
75 + if (this.type == 1) {
76 + //获取窗口的高度
77 + window.removeEventListener('resize', this.onResize);
78 + }
79 + if (this.type == 2) {
80 + window.removeEventListener('focusin', this.onFocusin);
81 + window.removeEventListener('focusout', this.onFocusout);
82 + }
83 + }
84 +
85 + /**
86 + * @function onShow 传递一个回调函数
87 + * @param 虚拟键盘弹出时触发
88 + */
89 + onShow = (fn) => {
90 + this.show = fn;
91 + }
92 +
93 + /**
94 + * @function onHidden 传递一个回调函数
95 + * @param 虚拟键盘隐藏时触发
96 + */
97 + onHidden = (fn) => {
98 + this.hidden = fn;
99 + }
100 +}
101 +
102 +export default MonitorKeyboard
1 +/*
2 + * @Author: hookehuyr hookehuyr@gmail.com
3 + * @Date: 2022-05-28 10:17:40
4 + * @LastEditors: hookehuyr hookehuyr@gmail.com
5 + * @LastEditTime: 2024-07-25 09:46:46
6 + * @FilePath: /temple_material_request/src/utils/axios.js
7 + * @Description:
8 + */
9 +import axios from 'axios';
10 +import router from '@/router';
11 +import qs from 'Qs'
12 +import { strExist } from '@/utils/tools'
13 +// import { parseQueryString } from '@/utils/tools'
14 +
15 +axios.defaults.params = {
16 + f: 'good',
17 +};
18 +
19 +/**
20 + * @description 请求拦截器
21 + */
22 +axios.interceptors.request.use(
23 + config => {
24 + // const url_params = parseQueryString(location.href);
25 + // GET请求默认打上时间戳,避免从缓存中拿数据。
26 + const timestamp = config.method === 'get' ? (new Date()).valueOf() : '';
27 + /**
28 + * POST PHP需要修改数据格式
29 + * 序列化POST请求时需要屏蔽上传相关接口,上传相关接口序列化后报错
30 + */
31 + // config.data = config.method === 'post' && !strExist(['a=upload', 'upload.qiniup.com'], config.url) ? qs.stringify(config.data) : config.data;
32 + // 绑定默认请求头
33 + config.params = { ...config.params, timestamp }
34 + return config;
35 + },
36 + error => {
37 + // 请求错误处理
38 + return Promise.reject(error);
39 + });
40 +
41 +/**
42 + * @description 响应拦截器
43 + */
44 +axios.interceptors.response.use(
45 + response => {
46 + return response;
47 + },
48 + error => {
49 + return Promise.reject(error);
50 + });
51 +
52 +export default axios;
This diff is collapsed. Click to expand it.
1 +/*
2 + * @Date: 2022-07-18 10:22:22
3 + * @LastEditors: hookehuyr hookehuyr@gmail.com
4 + * @LastEditTime: 2022-08-22 18:23:07
5 + * @FilePath: /front/src/utils/generateIcons.js
6 + * @Description: 文件描述
7 + */
8 +import icon_nav from '@images/icon/nav.png'
9 +import icon_gz from '@images/icon/icon_gz.png'
10 +
11 +export {
12 + icon_nav,
13 + icon_gz,
14 +}
1 +/*
2 + * @Author: hookehuyr hookehuyr@gmail.com
3 + * @Date: 2022-05-17 11:17:58
4 + * @LastEditors: hookehuyr hookehuyr@gmail.com
5 + * @LastEditTime: 2022-07-18 10:42:12
6 + * @FilePath: /front/src/utils/generateModules.js
7 + * @Description:
8 + */
9 +import MuiVideo from '@/components/MuiVideo/index.vue'
10 +
11 +export {
12 + MuiVideo,
13 +}
1 +/*
2 + * @Date: 2022-05-17 11:26:03
3 + * @LastEditors: hookehuyr hookehuyr@gmail.com
4 + * @LastEditTime: 2022-08-05 15:18:06
5 + * @FilePath: /front/src/utils/generatePackage.js
6 + * @Description: 文件描述
7 + */
8 +import Cookies from 'js-cookie'
9 +import $ from 'jquery'
10 +import _ from 'lodash'
11 +import dayjs from 'dayjs'
12 +import axios from '@/utils/axios';
13 +import { storeToRefs } from 'pinia'
14 +import { mainStore } from '@/store'
15 +import { Toast, Dialog } from 'vant';
16 +import { wxInfo, hasEllipsis } from '@/utils/tools';
17 +import { useTitle } from '@vueuse/core'
18 +
19 +export {
20 + Cookies,
21 + $,
22 + _,
23 + axios,
24 + storeToRefs,
25 + mainStore,
26 + Toast,
27 + Dialog,
28 + wxInfo,
29 + hasEllipsis,
30 + useTitle,
31 + dayjs
32 +}
1 +/*
2 + * @Date: 2022-05-16 17:21:45
3 + * @LastEditors: hookehuyr hookehuyr@gmail.com
4 + * @LastEditTime: 2022-06-29 17:00:15
5 + * @FilePath: /tswj/src/utils/generateRoute.js
6 + * @Description: 文件描述
7 + */
8 +
9 +/**
10 + * 根据后台返回的路径,生成页面的组件模版
11 + * @param {*} component
12 + * @returns 模版地址
13 + */
14 +function loadView(component) {
15 + return () => import(`../views/${component}.vue`)
16 +}
17 +
18 +/**
19 + * 生成路由结构
20 + * @param {*} routes
21 + */
22 +const generateRoutes = (routes) => {
23 + const arr = []
24 + routes.forEach(route => {
25 + const router = {}
26 + const {
27 + path,
28 + redirect,
29 + name,
30 + component,
31 + keepAlive,
32 + meta,
33 + children
34 + } = route
35 +
36 + router.path = path
37 + redirect && (router.redirect = redirect)
38 + name && (router.name = name)
39 + router.component = loadView(component)
40 + keepAlive && (router.keepAlive = keepAlive)
41 + meta && (router.meta = meta)
42 + router.children = !Array.isArray(children) || generateRoutes(children);
43 + arr.push(router)
44 + })
45 + return arr
46 +}
47 +
48 +export default generateRoutes;
1 +import sha1 from "js-sha1";
2 +
3 +function getEtag(buffer, callback) {
4 + // sha1算法
5 + var shA1 = sha1.digest;
6 +
7 + // 以4M为单位分割
8 + var blockSize = 4 * 1024 * 1024;
9 + var sha1String = [];
10 + var prefix = 0x16;
11 + var blockCount = 0;
12 +
13 + var bufferSize = buffer.size || buffer.length || buffer.byteLength;
14 + blockCount = Math.ceil(bufferSize / blockSize);
15 +
16 + for (var i = 0; i < blockCount; i++) {
17 + sha1String.push(shA1(buffer.slice(i * blockSize, (i + 1) * blockSize)));
18 + }
19 + function concatArr2Uint8(s) {//Array 2 Uint8Array
20 + var tmp = [];
21 + for (var i of s) tmp = tmp.concat(i);
22 + return new Uint8Array(tmp);
23 + }
24 + function Uint8ToBase64(u8Arr, urisafe) {//Uint8Array 2 Base64
25 + var CHUNK_SIZE = 0x8000; //arbitrary number
26 + var index = 0;
27 + var length = u8Arr.length;
28 + var result = '';
29 + var slice;
30 + while (index < length) {
31 + slice = u8Arr.subarray(index, Math.min(index + CHUNK_SIZE, length));
32 + result += String.fromCharCode.apply(null, slice);
33 + index += CHUNK_SIZE;
34 + }
35 + return urisafe ? btoa(result).replace(/\//g, '_').replace(/\+/g, '-') : btoa(result);
36 + }
37 + function calcEtag() {
38 + if (!sha1String.length) return 'Fto5o-5ea0sNMlW_75VgGJCv2AcJ';
39 + var sha1Buffer = concatArr2Uint8(sha1String);
40 + // 如果大于4M,则对各个块的sha1结果再次sha1
41 + if (blockCount > 1) {
42 + prefix = 0x96;
43 + sha1Buffer = shA1(sha1Buffer.buffer);
44 + } else {
45 + sha1Buffer = Array.apply([], sha1Buffer);
46 + }
47 + sha1Buffer = concatArr2Uint8([[prefix], sha1Buffer]);
48 + return Uint8ToBase64(sha1Buffer, true);
49 + }
50 + return (calcEtag());
51 +}
52 +
53 +export { getEtag }
This diff is collapsed. Click to expand it.
1 +/*
2 + * @Date: 2022-04-18 15:59:42
3 + * @LastEditors: hookehuyr hookehuyr@gmail.com
4 + * @LastEditTime: 2023-02-24 16:13:06
5 + * @FilePath: /data-table/src/utils/tools.js
6 + * @Description: 文件描述
7 + */
8 +import dayjs from 'dayjs';
9 +
10 +// 格式化时间
11 +const formatDate = (date) => {
12 + return dayjs(date).format('YYYY-MM-DD HH:mm');
13 +};
14 +
15 +/**
16 + * @description 判断浏览器属于平台
17 + * @returns
18 + */
19 +const wxInfo = () => {
20 + let u = navigator.userAgent;
21 + let isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; //android终端或者uc浏览器
22 + let isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
23 + let isMobile = u.indexOf('Android') > -1 || u.indexOf('iPhone') > -1 || u.indexOf('iPad') > -1; // 移动端平台
24 + let isIpad = u.indexOf('iPad') > -1; // iPad平台
25 + let uAgent = navigator.userAgent.toLowerCase();
26 + let isWeiXin = (uAgent.match(/MicroMessenger/i) == 'micromessenger') ? true : false;
27 + let isPC = (uAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone|micromessenger)/i)) ? false : true;
28 + return {
29 + isAndroid,
30 + isiOS,
31 + isWeiXin,
32 + isMobile,
33 + isIpad,
34 + isPC
35 + };
36 +};
37 +
38 +/**
39 + * @description 判断多行省略文本
40 + * @param {*} id 目标dom标签
41 + * @returns
42 + */
43 +const hasEllipsis = (id) => {
44 + let oDiv = document.getElementById(id);
45 + let flag = false;
46 + if (oDiv.scrollHeight > oDiv.clientHeight) {
47 + flag = true
48 + }
49 + return flag
50 +}
51 +
52 +/**
53 + * @description 解析URL参数
54 + * @param {*} url
55 + * @returns
56 + */
57 +const parseQueryString = url => {
58 + var json = {};
59 + var arr = url.indexOf('?') >= 0 ? url.substr(url.indexOf('?') + 1).split('&') : [];
60 + arr.forEach(item => {
61 + var tmp = item.split('=');
62 + json[tmp[0]] = decodeURIComponent(tmp[1]);
63 + });
64 + return json;
65 +}
66 +
67 +/**
68 + * 字符串包含字符数组中字符的状态
69 + * @param {*} array 字符数组
70 + * @param {*} str 字符串
71 + * @returns 包含状态
72 + */
73 +const strExist = (array, str) => {
74 + const exist = array.filter(arr => {
75 + if (str.indexOf(arr) >= 0) return str;
76 + })
77 + return exist.length > 0
78 +}
79 +
80 +/**
81 + * 自定义替换参数
82 + * @param {*} url
83 + * @param {*} arg
84 + * @param {*} arg_val
85 + * @returns
86 + */
87 +const changeURLArg = (url, arg, arg_val) => {
88 + var pattern = arg + '=([^&]*)';
89 + var replaceText = arg + '=' + arg_val;
90 + if (url.match(pattern)) {
91 + var tmp = '/(' + arg + '=)([^&]*)/gi';
92 + tmp = url.replace(eval(tmp), replaceText);
93 + return tmp;
94 + } else {
95 + if (url.match('[\?]')) {
96 + return url + '&' + replaceText;
97 + } else {
98 + return url + '?' + replaceText;
99 + }
100 + }
101 + return url + '\n' + arg + '\n' + arg_val;
102 +}
103 +
104 +// 获取参数key/value值对
105 +const getUrlParams = (url) => {
106 + // 没有参数处理
107 + if (url.split('?').length === 1) return false;
108 + let arr = url.split('?');
109 + let res = arr[1].split('&');
110 + let items = {};
111 + for (let i = 0; i < res.length; i++) {
112 + let [key, value] = res[i].split('=');
113 + items[key] = value;
114 + }
115 + return items
116 +}
117 +
118 +// 格式化URL参数为字符串
119 +const stringifyQuery = (params) => {
120 + const queryString = [];
121 + Object.keys(params || {}).forEach((k) => {
122 + queryString.push(k + '=' + params[k]);
123 + });
124 +
125 + return '?' + queryString.join('&');
126 +};
127 +
128 +export {
129 + formatDate,
130 + wxInfo,
131 + hasEllipsis,
132 + parseQueryString,
133 + strExist,
134 + changeURLArg,
135 + getUrlParams,
136 + stringifyQuery,
137 +};
1 +import VConsole from 'vconsole';
2 +
3 +// const vConsole = new VConsole();
4 +let vConsole = '';
5 +// 或者使用配置参数来初始化,详情见文档
6 +if (+import.meta.env.VITE_CONSOLE) {
7 + vConsole = new VConsole({ theme: 'dark' });
8 +}
9 +
10 +export default vConsole
1 +/*
2 + * @Date: 2024-02-06 11:38:13
3 + * @LastEditors: hookehuyr hookehuyr@gmail.com
4 + * @LastEditTime: 2024-02-06 13:04:25
5 + * @FilePath: /xysBooking/src/utils/versionUpdater.js
6 + * @Description:
7 + */
8 +/* eslint-disable */
9 +/**
10 + * @description: 版本更新检查
11 + * @param {*} time 阈值
12 + * @return {*}
13 + */
14 +export class Updater {
15 + constructor(options = {}) {
16 + this.oldScript = [];
17 + this.newScript = [];
18 + this.dispatch = {};
19 + this.init(); //初始化
20 + this.timing(options.time); //轮询
21 + }
22 +
23 + async init() {
24 + const html = await this.getHtml();
25 + this.oldScript = this.parserScript(html);
26 + }
27 +
28 + async getHtml() {
29 + // TAG: html的位置需要动态修改
30 + const html = await fetch(import.meta.env.VITE_BASE).then((res) => res.text()); //读取index html
31 + return html;
32 + }
33 +
34 + parserScript(html) {
35 + const reg = new RegExp(/<script(?:\s+[^>]*)?>(.*?)<\/script\s*>/gi); //script正则
36 + return html.match(reg); //匹配script标签
37 + }
38 +
39 + //发布订阅通知
40 + on(key, fn) {
41 + (this.dispatch[key] || (this.dispatch[key] = [])).push(fn);
42 + return this;
43 + }
44 +
45 + compare(oldArr, newArr) {
46 + const base = oldArr.length;
47 + // 去重
48 + const arr = Array.from(new Set(oldArr.concat(newArr)));
49 + //如果新旧length 一样无更新
50 + if (arr.length === base) {
51 + this.dispatch['no-update'].forEach((fn) => {
52 + fn();
53 + });
54 + } else {
55 + //否则通知更新
56 + this.dispatch['update'].forEach((fn) => {
57 + fn();
58 + });
59 + }
60 + }
61 +
62 + timing(time = 10000) {
63 + //轮询
64 + setInterval(async () => {
65 + const newHtml = await this.getHtml();
66 + this.newScript = this.parserScript(newHtml);
67 + this.compare(this.oldScript, this.newScript);
68 + }, time);
69 + }
70 +}
1 +<!--
2 + * @Date: 2022-06-29 18:18:02
3 + * @LastEditors: hookehuyr hookehuyr@gmail.com
4 + * @LastEditTime: 2022-06-29 18:18:09
5 + * @FilePath: /tswj/src/views/test/404.vue
6 + * @Description: 文件描述
7 +-->
8 +<template>
9 + <div class="">404</div>
10 +</template>
11 +
12 +<script setup>
13 +import { ref } from 'vue'
14 +import { useRoute, useRouter } from 'vue-router'
15 +
16 +import { Cookies, $, _, axios, storeToRefs, mainStore, Toast, useTitle } from '@/utils/generatePackage.js'
17 +//import { } from '@/utils/generateModules.js'
18 +//import { } from '@/utils/generateIcons.js'
19 +//import { } from '@/composables'
20 +const $route = useRoute();
21 +const $router = useRouter();
22 +useTitle($route.meta.title);
23 +
24 +</script>
25 +
26 +<style lang="less" scoped>
27 +
28 +</style>
1 +<template>
2 + <div />
3 +</template>
4 +
5 +<script setup lang="ts">
6 +// 类装饰器、方法装饰器、属性装饰器、参数装饰器
7 +// function addAge(constructor: Function) {
8 +// constructor.prototype.age = 18
9 +// }
10 +// @addAge
11 +// class Person {
12 +// name: string;
13 +// age!: number;
14 +// constructor() {
15 +// this.name = 'abc'
16 +// }
17 +// say () {
18 +// console.warn('xxx')
19 +// }
20 +// }
21 +// let person = new Person();
22 +// console.warn(person);
23 +// 属性/方法装饰器
24 +// 声明装饰器修饰方法
25 +// function method(target: any, propertyKey: string, descriptor: PropertyDescriptor) {
26 +// console.warn(target);
27 +// console.warn('prop ' + propertyKey);
28 +// console.warn('desc ' + JSON.stringify(descriptor));
29 +// descriptor.writable = false;
30 +// }
31 +// // 声明装饰器修饰属性
32 +// function prop(target: any, key: string): any {
33 +// console.warn(target);
34 +// console.warn('prop ' + key);
35 +// const descriptor: PropertyDescriptor = {
36 +// writable: true,
37 +// configurable: true,
38 +// enumerable: true,
39 +// value: 'abc'
40 +// };
41 +// return descriptor;
42 +// }
43 +// // 类
44 +// class Person {
45 +// // @prop
46 +// name: string;
47 +// constructor() {
48 +// this.name = 'xxx'
49 +// }
50 +// @method
51 +// say() {
52 +// return 'instance method'
53 +// }
54 +// @method
55 +// static run() {
56 +// return 'static method'
57 +// }
58 +// }
59 +// const person = new Person()
60 +// person.name
61 +// Person.run()
62 +// 参数装饰器
63 +// function logParameter(target: Object, propertyKey: string, index: number) {
64 +// console.log(target, propertyKey, index);
65 +// }
66 +
67 +// class Person {
68 +// greet(@logParameter message: string, @logParameter name: string): string {
69 +// return `${message} ${name}`;
70 +// }
71 +// }
72 +// const p = new Person('');
73 +// p.greet('hello', 'randy');
74 +// class Person {
75 +// name = 'abc'
76 +// constructor (name) {
77 +// this.name = name;
78 +// }
79 +// say() {
80 +// console.warn('');
81 +// }
82 +// }
83 +// import Person from '@/Person'
84 +// class Son extends Person {
85 +// say () {
86 +// return ''
87 +// }
88 +// }
89 +// const person = new Son('')
90 +// console.warn(person);
91 +// type E3 = NonNullable<string | number | null | undefined>
92 +// // let e1: E3 = 1
93 +// let e2: E3 = undefined
94 +// console.warn(e2);
95 +// function getUserInfo () {
96 +// return 'abc'
97 +// }
98 +// type E = ReturnType<typeof getUserInfo>
99 +// const user: E = {}
100 +// console.warn(user);
101 +// interface A {
102 +// a: string;
103 +// b: number;
104 +// d: boolean;
105 +// }
106 +// type aPartial = Partial<A>
107 +// type Point = 'x';
108 +// type PointList = Record<Point, { key: number }>
109 +// const z: PointList = {
110 +// x: {
111 +// key: 1
112 +// }
113 +// }
114 +</script>
115 +
116 +<style lang="less" scoped>
117 +</style>
1 +<!--
2 + * @Date: 2022-08-29 13:55:31
3 + * @LastEditors: hookehuyr hookehuyr@gmail.com
4 + * @LastEditTime: 2022-12-06 20:56:54
5 + * @FilePath: /data-table/src/views/auth.vue
6 + * @Description: 授权模块
7 +-->
8 +<template>
9 + <div />
10 +</template>
11 +
12 +<script setup>
13 +import { onMounted } from 'vue'
14 +import { useRoute } from 'vue-router'
15 +
16 +const $route = useRoute();
17 +
18 +onMounted(() => {
19 + // php需要先跳转链接获取openid
20 + /**
21 + * encodeURIComponent() 函数可把字符串作为 URI 组件进行编码。
22 + * 该方法不会对 ASCII 字母和数字进行编码,也不会对这些 ASCII 标点符号进行编码: - _ . ! ~ * ' ( ) 。
23 + * 其他字符(比如 :;/?:@&=+$,# 这些用于分隔 URI 组件的标点符号),都是由一个或多个十六进制的转义序列替换的。
24 + */
25 + let raw_url = encodeURIComponent(location.origin + location.pathname + $route.query.href); // 未授权的地址
26 + // TAG: 开发环境测试数据
27 + const short_url = `/srv/?f=custom_form&a=openid&res=${raw_url}&form_code=${$route.query.code}`;
28 + location.href = import.meta.env.DEV
29 + ? `${short_url}&openid=${import.meta.env.VITE_OPENID}`
30 + : `${short_url}`;
31 +})
32 +</script>
1 +<!--
2 + * @Date: 2024-07-23 10:34:37
3 + * @LastEditors: hookehuyr hookehuyr@gmail.com
4 + * @LastEditTime: 2024-09-06 17:35:34
5 + * @FilePath: /custom_table/src/views/index.vue
6 + * @Description: 文件描述
7 +-->
8 +<template>
9 + <el-table :data="tableData" style="width: 100%">
10 + <el-table-column prop="date" label="Date" width="180" />
11 + <el-table-column prop="name" label="Name" width="180" />
12 + <el-table-column prop="address" label="Address" />
13 + </el-table>
14 +</template>
15 +
16 +<script setup>
17 +import { ref } from 'vue'
18 +import { useRoute, useRouter } from 'vue-router'
19 +
20 +import { Cookies, $, _, axios, storeToRefs, mainStore, Toast, useTitle } from '@/utils/generatePackage.js'
21 +//import { } from '@/utils/generateModules.js'
22 +//import { } from '@/utils/generateIcons.js'
23 +//import { } from '@/composables'
24 +const $route = useRoute();
25 +const $router = useRouter();
26 +useTitle($route.meta.title);
27 +
28 +const tableData = [
29 + {
30 + date: '2016-05-03',
31 + name: 'Tom',
32 + address: 'No. 189, Grove St, Los Angeles',
33 + },
34 + {
35 + date: '2016-05-02',
36 + name: 'Tom',
37 + address: 'No. 189, Grove St, Los Angeles',
38 + },
39 + {
40 + date: '2016-05-04',
41 + name: 'Tom',
42 + address: 'No. 189, Grove St, Los Angeles',
43 + },
44 + {
45 + date: '2016-05-01',
46 + name: 'Tom',
47 + address: 'No. 189, Grove St, Los Angeles',
48 + },
49 +]
50 +
51 +</script>
52 +
53 +<style lang="less" scoped>
54 +
55 +</style>
1 +<!--
2 + * @Date: 2022-06-29 18:18:02
3 + * @LastEditors: hookehuyr hookehuyr@gmail.com
4 + * @LastEditTime: 2024-07-22 13:24:19
5 + * @FilePath: /data-table/src/views/no_auth.vue
6 + * @Description: 文件描述
7 +-->
8 +<template>
9 + <div class="table-box" :style="{ margin: is_pc ? '1rem 0' : '1rem', overflow: 'auto' }">
10 + <div class="text-box">
11 + <van-icon name="warning" color="red" size="1.25rem" />&nbsp;您暂无权限访问该页面
12 + </div>
13 + <div style="font-size: 15px; color: #525967; text-align: center; margin: 1rem auto;">{{ formSetting.auth_error }}</div>
14 + </div>
15 +</template>
16 +
17 +<script setup>
18 +import { ref } from 'vue'
19 +import { useRoute, useRouter } from 'vue-router'
20 +
21 +import { Cookies, $, _, axios, storeToRefs, mainStore, Toast, useTitle } from '@/utils/generatePackage.js'
22 +//import { } from '@/utils/generateModules.js'
23 +//import { } from '@/utils/generateIcons.js'
24 +//import { } from '@/composables'
25 +import { styleColor } from "@/constant.js";
26 +import { wxInfo, getUrlParams } from "@/utils/tools";
27 +
28 +const $route = useRoute();
29 +const $router = useRouter();
30 +useTitle($route.meta.title);
31 +
32 +// 获取表单设置
33 +const store = mainStore();
34 +const { formSetting } = storeToRefs(store);
35 +
36 +const is_pc = computed(() => wxInfo().isPC);
37 +
38 +onMounted(() => {
39 + // TAG: 全局背景色
40 + document
41 + .querySelector("body")
42 + .setAttribute("style", `background-color: ${styleColor.backgroundColor}`);
43 +})
44 +
45 +</script>
46 +
47 +<style lang="less" scoped>
48 +.table-box {
49 + background-color: #ffffff;
50 + padding: 1rem;
51 + border-radius: 5px;
52 + max-width: 800px;
53 + min-width: 20rem;
54 + .text-box {
55 + text-align: center;
56 + color: red;
57 + overflow: hidden;
58 + }
59 +}
60 +</style>
1 +<!--
2 + * @Date: 2022-06-29 18:18:02
3 + * @LastEditors: hookehuyr hookehuyr@gmail.com
4 + * @LastEditTime: 2022-06-29 18:18:09
5 + * @FilePath: /tswj/src/views/test/404.vue
6 + * @Description: 文件描述
7 +-->
8 +<template>
9 + <div class="stop-page">
10 + <div style="padding-top: 2rem; padding-bottom: 2rem; text-align: center">
11 + <van-image
12 + round
13 + width="10rem"
14 + height="10rem"
15 + style="vertical-align: bottom"
16 + :src="icon_success"
17 + />
18 + <p style="font-size: 1.05rem; margin: 0.5rem; font-weight: bold">
19 + <span v-if="status === 'apply'">表单未开始</span>
20 + <span v-if="status === 'finish'">表单已结束</span>
21 + <span v-if="status === 'disable'">表单已关闭</span>
22 + </p>
23 + <!-- <p style="font-size: 0.9rem; margin-bottom: 0.5rem">您的作品正在审核中</p> -->
24 + <!-- <p style="font-size: 0.9rem">请耐心等待~~</p> -->
25 + </div>
26 + <!-- <div style="padding: 0 15% 1rem 15%">
27 + <div class="button-plain" :style="styleObj" @click="handle">返回</div>
28 + </div> -->
29 + </div>
30 +</template>
31 +
32 +<script setup>
33 +import { ref } from "vue";
34 +import { useRoute, useRouter } from "vue-router";
35 +import { styleColor } from "@/constant.js";
36 +import icon_success from "@images/que-sucess@2x.png";
37 +
38 +import {
39 + Cookies,
40 + $,
41 + _,
42 + axios,
43 + storeToRefs,
44 + mainStore,
45 + Toast,
46 + useTitle,
47 +} from "@/utils/generatePackage.js";
48 +//import { } from '@/utils/generateModules.js'
49 +//import { } from '@/utils/generateIcons.js'
50 +//import { } from '@/composables'
51 +const $route = useRoute();
52 +const $router = useRouter();
53 +useTitle($route.meta.title);
54 +
55 +const styleObj = {
56 + background: styleColor.baseColor,
57 + border: styleColor.baseColor,
58 + color: "#FFFFFF",
59 +};
60 +
61 +const status = $route.query.status;
62 +
63 +onMounted(() => {});
64 +
65 +const handle = () => {
66 + $router.go(-1);
67 +};
68 +</script>
69 +
70 +<style lang="less" scoped>
71 +.stop-page {
72 + .button-plain {
73 + width: auto;
74 + height: auto;
75 + text-align: center;
76 + padding: 0.6rem;
77 + margin: 0.5rem;
78 + font-size: 1rem;
79 + // background: @base-font-color;
80 + border-radius: 24px;
81 + // border: 1px solid @base-color;
82 + // color: @base-color;
83 + font-weight: bold;
84 + }
85 +}
86 +</style>
1 +<!--
2 + * @Date: 2022-06-29 18:18:02
3 + * @LastEditors: hookehuyr hookehuyr@gmail.com
4 + * @LastEditTime: 2024-08-02 18:44:30
5 + * @FilePath: /temple_material_request/src/views/success.vue
6 + * @Description: 文件描述
7 +-->
8 +<template>
9 + <div class="success-page">
10 + <div class="text-wrapper">
11 + <van-image
12 + width="15rem"
13 + height="10rem"
14 + style="vertical-align: bottom"
15 + :src="icon_success"
16 + />
17 + <div style="font-size: 1.5rem; color: #A67939; margin-top: 2rem;">物资申领成功</div>
18 + </div>
19 + <div style="border: 1px dashed #A67939;"></div>
20 + <div style="padding: 3rem 4rem;">
21 + <van-button plain block :color="styleColor.baseColor" style="margin-bottom: 1.5rem;" @click="goTo('activity')">回到活动主页</van-button>
22 + <van-button plain block :color="styleColor.baseColor" @click="goTo('home')">返回首页</van-button>
23 + </div>
24 + </div>
25 +</template>
26 +
27 +<script setup>
28 +import { ref } from "vue";
29 +import { useRoute, useRouter } from "vue-router";
30 +import { styleColor } from "@/constant.js";
31 +import icon_success from "@images/que-sucess@2x.png";
32 +
33 +import {
34 + Cookies,
35 + $,
36 + _,
37 + axios,
38 + storeToRefs,
39 + mainStore,
40 + Toast,
41 + useTitle,
42 +} from "@/utils/generatePackage.js";
43 +//import { } from '@/utils/generateModules.js'
44 +//import { } from '@/utils/generateIcons.js'
45 +//import { } from '@/composables'
46 +const $route = useRoute();
47 +const $router = useRouter();
48 +useTitle($route.meta.title);
49 +
50 +const activity_id = $route.query.activity_id ? $route.query.activity_id : '';
51 +const form_id = $route.query.form_id ? $route.query.form_id : '';
52 +const client_id = $route.query.client_id ? $route.query.client_id : '';
53 +
54 +const styleObj = {
55 + background: styleColor.baseColor,
56 + border: styleColor.baseColor,
57 + color: "#FFFFFF",
58 +};
59 +
60 +onMounted(() => {
61 + $('body').css('backgroundColor', 'white');
62 +});
63 +
64 +const handle = () => {
65 + $router.go(-1);
66 +};
67 +
68 +const goTo = (type) => {
69 + if (type === 'home') { // 返回首页
70 + location.href = `../../../?p=volunteer_home&t=volunteer&c=${client_id}`;
71 + } else { // 返回活动主页
72 + location.href = `../?p=activity&form_id=${form_id}&i=${activity_id}`;
73 + }
74 +}
75 +</script>
76 +
77 +<style lang="less" scoped>
78 +.success-page {
79 + .text-wrapper {
80 + padding-top: 2rem;
81 + padding-bottom: 2rem;
82 + text-align: center;
83 + .name {
84 + font-size: 1.25rem;
85 + margin: 0.5rem;
86 + font-weight: bold;
87 + }
88 + .text {
89 + font-size: 1.05rem;
90 + margin: 0.5rem;
91 + font-weight: bold;
92 + }
93 + }
94 + .rich-text {
95 + padding: 1rem 2rem;
96 + white-space: pre-wrap;
97 + :deep(img) {
98 + width: 100%;
99 + }
100 + }
101 + .button-plain {
102 + width: auto;
103 + height: auto;
104 + text-align: center;
105 + padding: 0.6rem;
106 + margin: 0.5rem;
107 + font-size: 1rem;
108 + // background: @base-font-color;
109 + border-radius: 24px;
110 + // border: 1px solid @base-color;
111 + // color: @base-color;
112 + font-weight: bold;
113 + }
114 +}
115 +</style>
1 +<!--
2 + * @Date: 2024-07-23 10:29:03
3 + * @LastEditors: hookehuyr hookehuyr@gmail.com
4 + * @LastEditTime: 2024-07-26 18:02:58
5 + * @FilePath: /temple_material_request/src/views/test.vue
6 + * @Description: 文件描述
7 +-->
8 +<template>
9 + <div class="tinymce-box">
10 + <!-- <TEditor ref="refEdit" ></TEditor> -->
11 + <div @click="getValue">获取内容</div>
12 + <div @click="setValue">设置内容</div>
13 + </div>
14 +</template>
15 +
16 +<script setup>
17 + // import TEditor from "@/components/TEditor/index.vue";
18 +
19 + const refEdit = ref(null);
20 +
21 + // refEdit.value.handleGetContent()
22 + const getValue = () => {
23 + console.warn(refEdit.value.handleGetContent());
24 + }
25 +
26 + const setValue = () => {
27 + refEdit.value.handleSetContent('<p>test</p>')
28 + }
29 +</script>
30 +
31 +<style>
32 +.tinymce-box {
33 + width: 100%;
34 +}
35 +</style>
1 +{
2 + "compilerOptions": {
3 + /* 基本选项 */
4 + "target": "esnext", // 指定 ECMAScript 目标版本: 'ES3' (default), 'ES5', 'ES6'/'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'
5 + "module": "CommonJS", // 指定使用模块: 'commonjs', 'amd', 'system', 'umd' or 'es2015'
6 + "lib": [ // 指定要包含在编译中的库文件
7 + "esnext",
8 + "dom",
9 + "dom.iterable",
10 + "scripthost"
11 + ],
12 + "allowJs": true, // 允许编译 javascript 文件
13 + // "checkJs": true, // 报告 javascript 文件中的错误
14 + "jsx": "preserve", // 指定 jsx 代码的生成: 'preserve', 'react-native', or 'react'
15 + // "declaration": true, // 生成相应的 '.d.ts' 文件
16 + // "sourceMap": true, // 生成相应的 '.map' 文件
17 + // "outFile": "./", // 将输出文件合并为一个文件
18 + "outDir": "./", // 指定输出目录
19 + // "rootDir": "./", // 用来控制输出目录结构 --outDir.
20 + "removeComments": true, // 删除编译后的所有的注释
21 + // "noEmit": true, // 不生成输出文件
22 + "importHelpers": true, // tslib 导入辅助工具函数
23 + "isolatedModules": false, // 将每个文件做为单独的模块 (与 'ts.transpileModule' 类似)
24 +
25 + /* 严格的类型检查选项 */
26 + "strict": true, // 启用所有严格类型检查选项
27 + // "noImplicitAny": true, // 在表达式和声明上有隐含的 any类型时报错
28 + // "strictNullChecks": true, // 启用严格的 null 检查
29 + // "noImplicitThis": true, // this 表达式值为 any 类型的时候,生成一个错误
30 + // "alwaysStrict": true, // 以严格模式检查每个模块,并在每个文件里加入 'use strict'
31 +
32 + /* 额外的检查 */
33 + "noUnusedLocals": true, // 有未使用的变量时,抛出错误
34 + "noUnusedParameters": true, // 有未使用的参数时,抛出错误
35 + "noImplicitReturns": true, // 并不是所有函数里的代码都有返回值时,抛出错误
36 + "noFallthroughCasesInSwitch": true, // 报告 switch 语句的 fallthrough 错误。(即,不允许 switch case 语句贯穿)
37 +
38 + /* 模块解析选项 */
39 + "moduleResolution": "node", // 选择模块解析策略: 'node' (Node.js) or 'classic' (TypeScript pre-1.6)
40 + "baseUrl": ".", // 用于解析非相对模块名称的基目录
41 + "paths": { // 模块名到基于 baseUrl 的路径映射的列表
42 + "@/*": [
43 + "src/*"
44 + ]
45 + },
46 + // "rootDirs": [], // 根文件夹列表,其组合内容表示项目运行时的结构内容
47 + // "typeRoots": [], // 包含类型声明的文件列表
48 + "types": [ // 需要包含的类型声明文件名列表
49 + // "webpack-env",
50 + "vite/client",
51 + "lodash",
52 + "moment",
53 + "node",
54 + "jquery",
55 + "element-plus/global"
56 + ],
57 + "allowSyntheticDefaultImports": true, // 允许从没有设置默认导出的模块中默认导入。
58 +
59 + /* Source Map Options */
60 + // "sourceRoot": "./", // 指定调试器应该找到 TypeScript 文件而不是源文件的位置
61 + // "mapRoot": "./", // 指定调试器应该找到映射文件而不是生成文件的位置
62 + // "inlineSourceMap": true, // 生成单个 sourcemaps 文件,而不是将 sourcemaps 生成不同的文件
63 + // "inlineSources": true, // 将代码与 sourcemaps 生成到一个文件中,要求同时设置了 --inlineSourceMap --sourceMap 属性
64 +
65 + /* 其他选项 */
66 + "experimentalDecorators": true, // 启用装饰器
67 + // "emitDecoratorMetadata": true, // 为装饰器提供元数据的支持
68 +
69 + "esModuleInterop": true, // 可以在es6中导入commonjs
70 + },
71 + "include": [
72 + "src/**/*"
73 + ],
74 + "exclude": [
75 + "node_modules",
76 + "dist"
77 + ],
78 + "vueCompilerOptions": {
79 + "target": 2,
80 + "experimentalSuppressInvalidJsxElementTypeErrors": true
81 + }
82 +}
1 +{
2 + "defaultSeverity": "warning",
3 + "extends": [
4 + "tslint:recommended"
5 + ],
6 + "linterOptions": {
7 + "exclude": [
8 + "node_modules/**"
9 + ]
10 + },
11 + "rules": {
12 + "quotemark": [
13 + true,
14 + "single"
15 + ],
16 + "indent": [
17 + true,
18 + "spaces",
19 + 2
20 + ],
21 + "interface-name": false,
22 + "ordered-imports": false,
23 + "object-literal-sort-keys": false,
24 + "no-consecutive-blank-lines": false,
25 + "no-console": true
26 + }
27 +}
1 +/*
2 + * @Date: 2022-06-13 10:39:44
3 + * @LastEditors: hookehuyr hookehuyr@gmail.com
4 + * @LastEditTime: 2022-06-13 10:41:43
5 + * @FilePath: /tswj/typings/index.d.ts
6 + * @Description: 文件描述
7 + */
8 +export {};
9 +
10 +// => 全局类型声明
11 +declare global {
12 + interface Window {
13 + _hmt: any;
14 + wx: any;
15 + AlipayJSBridge: any;
16 + }
17 + namespace GD {
18 + interface BaseResponse<T = any> {
19 + code: number;
20 + data: T;
21 + msg: string;
22 + page: {
23 + pageNo: number;
24 + pageSize: number;
25 + pages: number;
26 + total: number;
27 + };
28 + }
29 + }
30 +}
31 +
32 +// const response = GD.BaseResponse<{name: string}>
1 +import vue from '@vitejs/plugin-vue';
2 +import dynamicImport from 'vite-plugin-dynamic-import';
3 +// import legacy from '@vitejs/plugin-legacy';
4 +// import styleImport, { VantResolve } from 'vite-plugin-style-import';
5 +import Components from 'unplugin-vue-components/vite';
6 +// import { VantResolver } from 'unplugin-vue-components/resolvers';
7 +import { defineConfig, loadEnv } from 'vite';
8 +import { createProxy } from './build/proxy'
9 +import DefineOptions from 'unplugin-vue-define-options/vite';
10 +import AutoImport from 'unplugin-auto-import/vite';
11 +import postcsspxtoviewport from 'postcss-px-to-viewport'
12 +
13 +var path = require('path');
14 +
15 +export default ({ command, mode }) => {
16 + const root = process.cwd();
17 +
18 + const viteEnv = loadEnv(mode, root);
19 + // let isProd = (command === 'serve'); // 情景配置是否为开发模式 serve 或 build
20 +
21 + return defineConfig({
22 + // root: '',
23 + // root: './src/packages', // 多页面应用配置入口根目录
24 + base: viteEnv.VITE_BASE, // 开发或生产环境服务的公共基础路径。
25 + // base: isProd ? '/' : '/f/voice/', // 开发或生产环境服务的公共基础路径。
26 + // mode: '', // 在配置中指明将会把 serve 和 build 时的模式 都 覆盖掉。也可以通过命令行 --mode 选项来重写。
27 + // define: '', // 定义全局常量替换方式。其中每项在开发环境下会被定义在全局,而在构建时被静态替换。
28 + plugins: [ // 将要用到的插件数组。Falsy 虚值的插件将被忽略,插件数组将被扁平化(flatten)。查看 插件 API 获取 Vite 插件的更多细节。
29 + vue(),
30 + // Components({
31 + // // resolvers: [VantResolver()],
32 + // }),
33 + // styleImport({
34 + // resolves: [VantResolve()],
35 + // libs: [
36 + // {
37 + // libraryName: 'vant',
38 + // esModule: true,
39 + // resolveStyle: name => `../es/${name}/style`
40 + // }
41 + // ]
42 + // }), // 按需引入 vant 位置报错问题
43 + dynamicImport(), // 增强 Vite 内置的 dynamic import, 支持在 import() 中使用别名
44 + // legacy({
45 + // targets: ['defaults', 'not IE 11']
46 + // }), // Vite 的默认旧版浏览器支持时提供此插件本机ESM的支持。
47 + DefineOptions(), // TAG: 插件来对组件名进行注册的, 解决setup没法写name的问题
48 + AutoImport({ // API 自动导入
49 + // 可以自定义文件生成的位置,默认是根目录下,使用ts的建议放src目录下
50 + dts: 'src/auto-imports.d.ts',
51 + imports: ['vue', 'vue-router'],
52 + // 解决eslint报错问题
53 + eslintrc: {
54 + enabled: true
55 + }
56 + }),
57 + ],
58 + publicDir: 'public', // 作为静态资源服务的文件夹。这个目录中的文件会在开发中被服务于 /,在开发模式时,会被拷贝到 outDir 的根目录,并没有转换,永远只是复制到这里。该值可以是文件系统的绝对路径,也可以是相对于项目的根目录路径。
59 + // cacheDir: '', // 存储缓存文件的目录。此目录下会存储预打包的依赖项或 vite 生成的某些缓存文件,使用缓存可以提高性能。如需重新生成缓存文件,你可以使用 --force 命令行选项或手动删除目录。此选项的值可以是文件的绝对路径,也可以是以项目根目录为基准的相对路径。
60 + resolve: {
61 + alias: { // 将会被传递到 @rollup/plugin-alias 作为 entries 的选项。也可以是一个对象,或一个 { find, replacement } 的数组. 当使用文件系统路径的别名时,请始终使用绝对路径。相对路径的别名值会被原封不动地使用,因此无法被正常解析。 更高级的自定义解析方法可以通过 插件 实现。
62 + "@": path.resolve(__dirname, "src"),
63 + "@components": path.resolve(__dirname, "src/components"),
64 + "@composables": path.resolve(__dirname, "src/composables"),
65 + "@utils": path.resolve(__dirname, "src/utils"),
66 + "@images": path.resolve(__dirname, "src/assets/images"),
67 + "@css": path.resolve(__dirname, "src/assets/css"),
68 + "@mock": path.resolve(__dirname, "src/assets/mock"),
69 + "common": path.resolve(__dirname, "src/common"),
70 + "@api": path.resolve(__dirname, "src/api"),
71 + },
72 + dedupe: ['vue'], // 如果你在你的应用程序中有相同依赖的副本(比如 monorepos),使用这个选项来强制 Vite 总是将列出的依赖关系解析到相同的副本(从项目根目录)。
73 + // conditions: [''], // 在解析包的 情景导出 时允许的附加条件。
74 + // mainFields: [''], // package.json 中,在解析包的入口点时尝试的字段列表。注意,这比从 exports 字段解析的情景导出优先级低:如果一个入口点从 exports 成功解析,主字段将被忽略。
75 + extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue'], // 导入时想要省略的扩展名列表。注意,不 建议忽略自定义导入类型的扩展名(例如:.vue),因为它会干扰 IDE 和类型支持。
76 + },
77 + css: {
78 + modules: '', // 配置 CSS modules 的行为。选项将被传递给 postcss-modules。
79 + postcss: { // 内联的 PostCSS 配置(格式同 postcss.config.js),或者一个(默认基于项目根目录的)自定义的 PostCSS 配置路径。其路径搜索是通过 postcss-load-config 实现的。 注意,如果提供了该内联配置,Vite 将不会搜索其他 PostCSS 配置源。
80 + plugins: [
81 + // postcsspxtoviewport({
82 + // unitToConvert: 'px', // 要转化的单位
83 + // viewportWidth: 375, // UI设计稿的宽度
84 + // unitPrecision: 6, // 转换后的精度,即小数点位数
85 + // propList: ['*'], // 指定转换的css属性的单位,*代表全部css属性的单位都进行转换
86 + // viewportUnit: 'vw', // 指定需要转换成的视窗单位,默认vw
87 + // fontViewportUnit: 'vw', // 指定字体需要转换成的视窗单位,默认vw
88 + // selectorBlackList: ['ignore-'], // 指定不转换为视窗单位的类名,
89 + // minPixelValue: 1, // 默认值1,小于或等于1px则不进行转换
90 + // mediaQuery: true, // 是否在媒体查询的css代码中也进行转换,默认false
91 + // replace: true, // 是否转换后直接更换属性值
92 + // // exclude: [/node_modules/], // 设置忽略文件,用正则做目录名匹配
93 + // exclude: [],
94 + // landscape: false // 是否处理横屏情况
95 + // })
96 + ]
97 + },
98 + preprocessorOptions: {
99 + less: {
100 + javascriptEnabled: true,
101 + additionalData: `@import "${path.resolve(__dirname, 'src/assets/styles/base.less')}";`
102 + }
103 + } // 指定传递给 CSS 预处理器的选项。
104 + },
105 + // json: {
106 + // namedExports: true, // 是否支持从 .json 文件中进行按名导入。
107 + // stringify: false, // 若设置为 true,导入的 JSON 会被转换为 export default JSON.parse("...") 会比转译成对象字面量性能更好,尤其是当 JSON 文件较大的时候。 开启此项,则会禁用按名导入。
108 + // },
109 + // esbuild: false, //
110 + // assetsInclude: '', // 指定其他文件类型作为静态资源处理
111 + logLevel: 'info', // 调整控制台输出的级别,默认为 'info'。
112 + // clearScreen: true, // 设为 false 可以避免 Vite 清屏而错过在终端中打印某些关键信息。命令行模式下请通过 --clearScreen false 设置。
113 + server: {
114 + host: '0.0.0.0',
115 + port: viteEnv.VITE_PORT, // 本地服务端口
116 + // strictPort: true, // 设为true时若端口已被占用则会直接退出, 而不是尝试下一个可用端口
117 + // https: '',
118 + // open: false, // 在服务器启动时自动在浏览器中打开应用程序. 当此值为字符串时, 会被当作URL的路径名.
119 + // proxy: { // 代理
120 + // '/srv/': {
121 + // // target: 'http://voice.onwall.cn',
122 + // target: viteEnv.VITE_PROXY_TARGET,
123 + // changeOrigin: true,
124 + // // rewrite: (path) => path.replace(/^\/api/, '')
125 + // },
126 + // },
127 + proxy: createProxy(viteEnv.VITE_PROXY_PREFIX, viteEnv.VITE_PROXY_TARGET),
128 + // cors: '', // 为开发服务器配置 CORS。默认启用并允许任何源,传递一个 选项对象 来调整行为或设为 false 表示禁用。
129 + // force: '', // 设置为 true 强制使依赖预构建。
130 + // hmr: '', // 禁用或配置 HMR 连接(用于 HMR websocket 必须使用不同的 http 服务器地址的情况)。 设置 server.hmr.overlay 为 false 可以禁用服务器错误遮罩层。
131 + // watch: '', // 传递给 chokidar 的文件系统监视器选项。
132 + },
133 + build: {
134 + // outDir: 'voice', // 指定输出路径(相对于项目根目录).
135 + outDir: viteEnv.VITE_OUTDIR, // 指定输出路径(相对于项目根目录).
136 + assetsDir: 'static',
137 + rollupOptions: {
138 + output: {
139 + chunkFileNames: 'static/js/[name]-[hash].js',
140 + entryFileNames: 'static/js/[name]-[hash].js',
141 + assetFileNames: 'static/[ext]/[name]-[hash].[ext]',
142 + },
143 + input: { // 多页面应用模式, 打包时配置,运行配置要处理root
144 + main: path.resolve(__dirname, 'index.html'),
145 + // mono1: path.resolve(__dirname, 'src/packages/mono1/index.html'),
146 + // mono2: path.resolve(__dirname, 'src/packages/mono2/index.html'),
147 + }
148 + },
149 + },
150 + optimizeDeps: {
151 + // entries: '',
152 + // exclude: [],
153 + include: ['jquery', 'lodash', 'moment', 'axios', 'pinia', 'vue-router', 'vant'], // 默认情况下,不在 node_modules 中的,链接的包不会被预构建。使用此选项可强制预构建链接的包。
154 + // keepNames: false, // 打包器有时需要重命名符号以避免冲突。 设置此项为 true 可以在函数和类上保留 name 属性。 若想获取更多详情,请参阅 keepNames
155 + }
156 + });
157 +};
This diff could not be displayed because it is too large.