diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000..b1fac77
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/policeSecurity.iml b/.idea/policeSecurity.iml
new file mode 100644
index 0000000..24643cc
--- /dev/null
+++ b/.idea/policeSecurity.iml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/collect_information/.env.development b/collect_information/.env.development
index c876df6..edad538 100644
--- a/collect_information/.env.development
+++ b/collect_information/.env.development
@@ -1,2 +1,3 @@
+# 配置文档参考 https://taro-docs.jd.com/docs/next/env-mode-config
TARO_APP_ID="wx0acd1c4fcf94bdd3"
TARO_APP_BASE_API="http://172.10.10.93:8765"
diff --git a/collect_information/.env.production b/collect_information/.env.production
index bf2df6e..be6f45e 100644
--- a/collect_information/.env.production
+++ b/collect_information/.env.production
@@ -1,2 +1 @@
-TARO_APP_ID="wx24cc8a872b57ac79"
-TARO_APP_BASE_API="http://172.10.10.207:7000"
+# TARO_APP_ID="生产环境下的小程序appid"
\ No newline at end of file
diff --git a/collect_information/.eslintrc b/collect_information/.eslintrc
index a5306c7..59b61d8 100644
--- a/collect_information/.eslintrc
+++ b/collect_information/.eslintrc
@@ -5,6 +5,15 @@
"taro/vue3"
],
"rules": {
- "vue/multi-word-component-names": "off"
+ // 添加组件命名忽略规则
+ "vue/multi-word-component-names": [
+ "error",
+ {
+ //需要忽略的组件名
+ "ignores": [
+ "index"
+ ]
+ }
+ ]
}
}
diff --git a/collect_information/.gitignore b/collect_information/.gitignore
index e83724e..63712f5 100644
--- a/collect_information/.gitignore
+++ b/collect_information/.gitignore
@@ -5,8 +5,9 @@ deploy_versions/
node_modules/
.DS_Store
.swc
-yarn.lock
-components.d.ts
-package-lock.json
.idea
+
+components.d.ts
+package-lock.json
+yarn.lock
diff --git a/collect_information/config/dev.ts b/collect_information/config/dev.ts
index 83b5450..c37eb43 100644
--- a/collect_information/config/dev.ts
+++ b/collect_information/config/dev.ts
@@ -1,124 +1,9 @@
-// import type { UserConfigExport } from "@tarojs/cli";
-// export default {
-// logger: {
-// quiet: false,
-// stats: true
-// },
-// mini: {},
-// h5: {}
-// } satisfies UserConfigExport
-import {defineConfig, type UserConfigExport} from '@tarojs/cli'
-import TsconfigPathsPlugin from 'tsconfig-paths-webpack-plugin'
-import devConfig from './dev'
-import prodConfig from './prod'
-import ComponentsPlugin from 'unplugin-vue-components/webpack'
-import NutUIResolver from '@nutui/auto-import-resolver'
-
-// https://taro-docs.jd.com/docs/next/config#defineconfig-辅助函数
-export default defineConfig(async (merge, {command, mode}) => {
- const baseConfig: UserConfigExport = {
- projectName: 'collect_information',
- date: '2024-4-12',
- designWidth(input: any) {
- // 配置 NutUI 375 尺寸
- if (input?.file?.replace(/\\+/g, '/').indexOf('@nutui') > -1) {
- return 375
- }
- // 全局使用 Taro 默认的 750 尺寸
- return 750
- },
- deviceRatio: {
- 640: 2.34 / 2,
- 750: 1,
- 828: 1.81 / 2,
- 375: 2
- },
- sourceRoot: 'src',
- outputRoot: 'dist',
- plugins: ['@tarojs/plugin-html'],
- defineConstants: {},
- copy: {
- patterns: [],
- options: {}
- },
- framework: 'vue3',
- compiler: 'webpack5',
- cache: {
- enable: false // Webpack 持久化缓存配置,建议开启。默认配置请参考:https://docs.taro.zone/docs/config-detail#cache
- },
- mini: {
- miniCssExtractPluginOption: {
- ignoreOrder: true
- },
- postcss: {
- pxtransform: {
- enable: true,
- config: {}
- },
- url: {
- enable: true,
- config: {
- limit: 1024 // 设定转换尺寸上限
- }
- },
- cssModules: {
- enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true
- config: {
- namingPattern: 'module', // 转换模式,取值为 global/module
- generateScopedName: '[name]__[local]___[hash:base64:5]'
- }
- }
- },
- webpackChain(chain) {
- chain.resolve.plugin('tsconfig-paths').use(TsconfigPathsPlugin)
- chain.plugin('unplugin-vue-components').use(ComponentsPlugin({
- resolvers: [NutUIResolver({taro: true})]
- }))
- }
- },
- h5: {
- publicPath: '/',
- staticDirectory: 'static',
- output: {
- filename: 'js/[name].[hash:8].js',
- chunkFilename: 'js/[name].[chunkhash:8].js'
- },
- miniCssExtractPluginOption: {
- ignoreOrder: true,
- filename: 'css/[name].[hash].css',
- chunkFilename: 'css/[name].[chunkhash].css'
- },
- postcss: {
- autoprefixer: {
- enable: true,
- config: {}
- },
- cssModules: {
- enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true
- config: {
- namingPattern: 'module', // 转换模式,取值为 global/module
- generateScopedName: '[name]__[local]___[hash:base64:5]'
- }
- }
- },
- webpackChain(chain) {
- chain.resolve.plugin('tsconfig-paths').use(TsconfigPathsPlugin)
- }
- },
- rn: {
- appName: 'taroDemo',
- postcss: {
- cssModules: {
- enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true
- }
- }
- }
- }
- if (process.env.NODE_ENV === 'development') {
- // 本地开发构建配置(不混淆压缩)
- return merge({}, baseConfig, devConfig)
- }
- // 生产构建配置(默认开启压缩混淆等)
- return merge({}, baseConfig, prodConfig)
-})
-
+import type { UserConfigExport } from "@tarojs/cli";
+export default {
+ logger: {
+ quiet: false,
+ stats: true
+ },
+ mini: {},
+ h5: {}
+} satisfies UserConfigExport
diff --git a/collect_information/config/index.ts b/collect_information/config/index.ts
index 54a4b61..3a25c14 100644
--- a/collect_information/config/index.ts
+++ b/collect_information/config/index.ts
@@ -3,13 +3,13 @@ import TsconfigPathsPlugin from 'tsconfig-paths-webpack-plugin'
import devConfig from './dev'
import prodConfig from './prod'
import ComponentsPlugin from 'unplugin-vue-components/webpack'
-import NutUIResolver from '@nutui/auto-import-resolver'
+import NutUIResolver from "@nutui/auto-import-resolver";
// https://taro-docs.jd.com/docs/next/config#defineconfig-辅助函数
export default defineConfig(async (merge, {command, mode}) => {
const baseConfig: UserConfigExport = {
projectName: 'collect_information',
- date: '2024-4-12',
+ date: '2024-9-14',
designWidth(input: any) {
// 配置 NutUI 375 尺寸
if (input?.file?.replace(/\\+/g, '/').indexOf('@nutui') > -1) {
@@ -26,6 +26,7 @@ export default defineConfig(async (merge, {command, mode}) => {
},
sourceRoot: 'src',
outputRoot: 'dist',
+ // 开启 HTML 插件
plugins: ['@tarojs/plugin-html'],
defineConstants: {},
copy: {
diff --git a/collect_information/package.json b/collect_information/package.json
index f7d1452..1830680 100644
--- a/collect_information/package.json
+++ b/collect_information/package.json
@@ -2,7 +2,7 @@
"name": "collect_information",
"version": "1.0.0",
"private": true,
- "description": "警保联勤联动小程序",
+ "description": "警保联动小程序",
"templateInfo": {
"name": "default",
"typescript": true,
@@ -40,47 +40,44 @@
"author": "",
"dependencies": {
"@babel/runtime": "^7.21.5",
- "@nutui/icons-vue-taro": "^0.0.9",
- "@nutui/nutui-taro": "^4.3.5",
- "@tarojs/components": "3.6.25",
- "@tarojs/helper": "3.6.25",
- "@tarojs/plugin-framework-vue3": "3.6.25",
+ "@nutui/nutui-taro": "^4.3.13",
+ "@tarojs/components": "3.6.26",
+ "@tarojs/helper": "3.6.26",
+ "@tarojs/plugin-framework-vue3": "3.6.26",
"@tarojs/plugin-html": "^3.6.26",
- "@tarojs/plugin-platform-alipay": "3.6.25",
- "@tarojs/plugin-platform-h5": "3.6.25",
- "@tarojs/plugin-platform-harmony-hybrid": "3.6.25",
- "@tarojs/plugin-platform-jd": "3.6.25",
- "@tarojs/plugin-platform-qq": "3.6.25",
- "@tarojs/plugin-platform-swan": "3.6.25",
- "@tarojs/plugin-platform-tt": "3.6.25",
- "@tarojs/plugin-platform-weapp": "3.6.25",
- "@tarojs/runtime": "3.6.25",
- "@tarojs/shared": "3.6.25",
- "@tarojs/taro": "3.6.25",
- "dayjs": "^1.11.10",
- "pinia": "^2.1.7",
- "pinia-plugin-persistedstate": "^4.0.1",
+ "@tarojs/plugin-platform-alipay": "3.6.26",
+ "@tarojs/plugin-platform-h5": "3.6.26",
+ "@tarojs/plugin-platform-harmony-hybrid": "3.6.26",
+ "@tarojs/plugin-platform-jd": "3.6.26",
+ "@tarojs/plugin-platform-qq": "3.6.26",
+ "@tarojs/plugin-platform-swan": "3.6.26",
+ "@tarojs/plugin-platform-tt": "3.6.26",
+ "@tarojs/plugin-platform-weapp": "3.6.26",
+ "@tarojs/runtime": "3.6.26",
+ "@tarojs/shared": "3.6.26",
+ "@tarojs/taro": "3.6.26",
+ "dayjs": "^1.11.13",
+ "pinia": "^2.2.2",
"vue": "^3.0.0"
},
"devDependencies": {
"@babel/core": "^7.8.0",
"@nutui/auto-import-resolver": "^1.0.0",
- "@tarojs/cli": "3.6.25",
- "@tarojs/taro-loader": "3.6.25",
+ "@tarojs/cli": "3.6.26",
+ "@tarojs/taro-loader": "3.6.26",
"@tarojs/test-utils-vue3": "^0.1.1",
- "@tarojs/webpack5-runner": "3.6.25",
+ "@tarojs/webpack5-runner": "3.6.26",
"@types/jest": "^29.3.1",
"@types/node": "^18.15.11",
- "@types/qrcode": "^1.5.5",
"@types/webpack-env": "^1.13.6",
"@typescript-eslint/eslint-plugin": "^6.2.0",
"@typescript-eslint/parser": "^6.2.0",
"@vue/babel-plugin-jsx": "^1.0.6",
"@vue/compiler-sfc": "^3.0.0",
- "babel-preset-taro": "3.6.25",
+ "babel-preset-taro": "3.6.26",
"css-loader": "3.4.2",
"eslint": "^8.12.0",
- "eslint-config-taro": "3.6.25",
+ "eslint-config-taro": "3.6.26",
"eslint-plugin-vue": "^8.0.0",
"jest": "^29.3.1",
"jest-environment-jsdom": "^29.5.0",
@@ -90,8 +87,8 @@
"ts-node": "^10.9.1",
"tsconfig-paths-webpack-plugin": "^4.1.0",
"typescript": "^5.1.0",
- "unplugin-vue-components": "^0.26.0",
- "vue-loader": "^17.0.0",
+ "unplugin-vue-components": "^0.27.4",
+ "vue-loader": "^17.1.0",
"webpack": "5.78.0"
}
}
diff --git a/collect_information/project.config.json b/collect_information/project.config.json
index 4959a1d..2d18dde 100644
--- a/collect_information/project.config.json
+++ b/collect_information/project.config.json
@@ -1,32 +1,15 @@
{
- "miniprogramRoot": "dist/",
+ "miniprogramRoot": "./dist",
"projectname": "collect_information",
- "description": "警保联勤联动小程序",
+ "description": "警保联动小程序",
+ "appid": "touristappid",
"setting": {
"urlCheck": false,
"es6": false,
"enhance": false,
- "compileHotReLoad": true,
+ "compileHotReLoad": false,
"postcss": false,
- "minified": false,
- "babelSetting": {
- "ignore": [],
- "disablePlugins": [],
- "outputPath": ""
- },
- "ignoreUploadUnusedFiles": true
+ "minified": false
},
- "compileType": "miniprogram",
- "libVersion": "3.5.0",
- "srcMiniprogramRoot": "dist/",
- "packOptions": {
- "ignore": [],
- "include": []
- },
- "condition": {},
- "editorSetting": {
- "tabIndent": "insertSpaces",
- "tabSize": 2
- },
- "appid": "wx8902ddbfddb820d1"
+ "compileType": "miniprogram"
}
diff --git a/collect_information/project.private.config.json b/collect_information/project.private.config.json
deleted file mode 100644
index 99e9c4e..0000000
--- a/collect_information/project.private.config.json
+++ /dev/null
@@ -1,62 +0,0 @@
-{
- "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
- "projectname": "collect_information",
- "setting": {
- "compileHotReLoad": true
- },
- "condition": {
- "miniprogram": {
- "list": [
- {
- "name": "pages/projectManager/myProject/myProject",
- "pathName": "pages/projectManager/myProject/myProject",
- "query": "",
- "launchMode": "default",
- "scene": null
- },
- {
- "name": "",
- "pathName": "pages/mine/mine",
- "query": "",
- "launchMode": "default",
- "scene": null
- },
- {
- "name": "",
- "pathName": "pages/login/login",
- "query": "",
- "launchMode": "default",
- "scene": null
- },
- {
- "name": "",
- "pathName": "pages/mine/mine",
- "query": "",
- "launchMode": "default",
- "scene": null
- },
- {
- "name": "",
- "pathName": "pages/index/index",
- "query": "",
- "launchMode": "default",
- "scene": null
- },
- {
- "name": "",
- "pathName": "pages/index/dataEntry/buildFloorEntry/buildFloorEntry",
- "query": "",
- "launchMode": "default",
- "scene": null
- },
- {
- "name": "",
- "pathName": "pages/register/register",
- "query": "",
- "launchMode": "default",
- "scene": null
- }
- ]
- }
- }
-}
\ No newline at end of file
diff --git a/collect_information/src/app.config.ts b/collect_information/src/app.config.ts
index c2b33bf..3690c73 100644
--- a/collect_information/src/app.config.ts
+++ b/collect_information/src/app.config.ts
@@ -1,58 +1,38 @@
+import {MINI_PROGRAM_USER_CONFIG} from "@/config";
+
+
+const tabBarItems = Object.values(MINI_PROGRAM_USER_CONFIG).map(item => item.tabBarList).flat()
+
export default defineAppConfig({
pages: [
'pages/login/login',
'pages/register/register',
- 'pages/projectManager/index/index',
- 'pages/policeManager/index/index',
- 'pages/mine/mine',
- 'pages/employeeInfo/employeeInfo',
+ ...tabBarItems.map(i => i.pagePath)
+ ],
+ subPackages: [
+ {
+ root: "subPages/projectManager",
+ pages: [
+ 'myProject/myProject',
+ 'myProject/projectDetails/projectDetails',
+ 'securityUserForm/securityUserForm',
+ ]
+ }, {
+ root: "subPages/police",
+ pages: [
+ 'myEnterprisesUnit/myEnterprisesUnit',
+ 'myEnterprisesUnit/projectDetails/projectDetails'
+ ]
+ }
],
window: {
backgroundTextStyle: 'light',
navigationBarBackgroundColor: '#4e87ff',
navigationBarTitleText: '',
- navigationBarTextStyle:'white',
+ navigationBarTextStyle: 'white',
},
- subpackages: [
- {
- root: "subPages",
- pages: [
- 'pages/policeManager/index',
- 'pages/policeDetails/index',
- 'pages/myProject/myProject',
- 'pages/projectDetails/projectDetails',
- 'pages/form/form'
- ]
- }
- ],
tabBar: {
custom: true,
- list: [
- {
- pagePath: 'pages/projectManager/index/index',
- text: '首页',
- iconPath: "assets/mine/punch.png",
- selectedIconPath: "assets/mine/punch-active.png"
- },
- {
- pagePath: 'pages/policeManager/index/index',
- text: '首页',
- iconPath: "assets/mine/punch.png",
- selectedIconPath: "assets/mine/punch-active.png"
- },
- {
- pagePath: 'pages/employeeInfo/employeeInfo',
- text: '员工信息',
- iconPath: "assets/mine/punch.png",
- selectedIconPath: "assets/mine/punch-active.png"
- },
- {
- pagePath: 'pages/mine/mine',
- text: '我的',
- iconPath: "assets/mine/my.png",
- selectedIconPath: "assets/mine/my-active.png"
- },
- ]
+ list: tabBarItems
}
-
})
diff --git a/collect_information/src/app.scss b/collect_information/src/app.scss
index 0570844..e69de29 100644
--- a/collect_information/src/app.scss
+++ b/collect_information/src/app.scss
@@ -1,4 +0,0 @@
-*{
- margin: 0;
- padding: 0;
-}
diff --git a/collect_information/src/app.ts b/collect_information/src/app.ts
index 95a2ac5..28f74dd 100644
--- a/collect_information/src/app.ts
+++ b/collect_information/src/app.ts
@@ -1,35 +1,28 @@
import {createApp} from 'vue'
-import {createPinia} from 'pinia'
-import {useCounterStore} from '@/store'
-import './app.scss'
-import './assets/scss/colorui.scss'
+import '@/app.scss'
+import '@/assets/css/main.css'
+import {pinia} from "@/store";
import Taro from "@tarojs/taro";
+import {MINI_PROGRAM_USER_CONFIG} from "@/config";
+import {useUserStore} from "@/store/userStore";
+import {initEnum} from "@/enums";
-const pinia = createPinia()
-// import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
-// pinia.use(piniaPluginPersistedstate)
const App = createApp({
- onShow(options) {
- // try {
- // const store = useCounterStore()
- // const token = Taro.getStorageSync('token')
- // console.log(token)
- // if (token) {
- // Taro.switchTab({
- // url: '/pages/mine/mine'
- // // url: '/pages/projectManager/index/index'
- //
- // })
- // store.setSelected(2)
- // } else {
- // console.log(2222)
- // }
- // console.log('App onShow.')
- // } catch (err) {
- // console.log(err)
- //
- // }
-
+ onLaunch(opt) {
+ initEnum()
+ if (opt.path === 'subPages/projectManager/securityUserForm/securityUserForm' && opt.query.type === 'QcCodeInput') {
+ return
+ }
+ const tokenInfo = useUserStore().getTokenInfo();
+ if (tokenInfo) {
+ Taro.switchTab({
+ url: MINI_PROGRAM_USER_CONFIG[tokenInfo.extData.identity.value].toIndex
+ })
+ } else {
+ Taro.navigateTo({
+ url: '/pages/login/login',
+ })
+ }
},
// 入口组件不需要实现 render 方法,即使实现了也会被 taro 所覆盖
})
diff --git a/collect_information/src/assets/scss/colorui.scss b/collect_information/src/assets/css/main.css
similarity index 100%
rename from collect_information/src/assets/scss/colorui.scss
rename to collect_information/src/assets/css/main.css
diff --git a/collect_information/src/assets/images/01.png b/collect_information/src/assets/images/01.png
new file mode 100644
index 0000000..b66fa47
Binary files /dev/null and b/collect_information/src/assets/images/01.png differ
diff --git a/collect_information/src/assets/images/arrow.png b/collect_information/src/assets/images/arrow.png
deleted file mode 100644
index 521b08a..0000000
Binary files a/collect_information/src/assets/images/arrow.png and /dev/null differ
diff --git a/collect_information/src/assets/images/banner.jpg b/collect_information/src/assets/images/banner.jpg
deleted file mode 100644
index f29618c..0000000
Binary files a/collect_information/src/assets/images/banner.jpg and /dev/null differ
diff --git a/collect_information/src/assets/images/project.png b/collect_information/src/assets/images/project.png
new file mode 100644
index 0000000..8de6ed4
Binary files /dev/null and b/collect_information/src/assets/images/project.png differ
diff --git a/collect_information/src/assets/logo/guohui.png b/collect_information/src/assets/logo/guohui.png
new file mode 100644
index 0000000..d06ce3a
Binary files /dev/null and b/collect_information/src/assets/logo/guohui.png differ
diff --git a/collect_information/src/config/index.ts b/collect_information/src/config/index.ts
new file mode 100644
index 0000000..f9bd5c6
--- /dev/null
+++ b/collect_information/src/config/index.ts
@@ -0,0 +1,46 @@
+import {UserConfig} from "@/types/config";
+
+/**
+ * 客户端
+ */
+export const CLIENT_TYPE = 'MINI_PROGRAM'
+
+/**
+ * 小程序用户配置
+ */
+export const MINI_PROGRAM_USER_CONFIG: Record = {
+ police: {
+ toIndex: '/pages/police/index/index',
+ tabBarList: [
+ {
+ pagePath: 'pages/police/index/index',
+ text: '首页',
+ iconPath: "assets/mine/punch.png",
+ selectedIconPath: "assets/mine/punch-active.png"
+ },
+ {
+ pagePath: 'pages/police/mine/index',
+ text: '警察我的',
+ iconPath: "assets/mine/my.png",
+ selectedIconPath: "assets/mine/my-active.png"
+ },
+ ]
+ },
+ project_manager: {
+ toIndex: '/pages/projectManager/index/index',
+ tabBarList: [
+ {
+ pagePath: 'pages/projectManager/index/index',
+ text: '首页',
+ iconPath: "assets/mine/punch.png",
+ selectedIconPath: "assets/mine/punch-active.png"
+ },
+ {
+ pagePath: 'pages/projectManager/mine/index',
+ text: '项目经理我的',
+ iconPath: "assets/mine/my.png",
+ selectedIconPath: "assets/mine/my-active.png"
+ },
+ ]
+ }
+}
diff --git a/collect_information/src/custom-tab-bar/index.json.js b/collect_information/src/custom-tab-bar/index.json.ts
similarity index 100%
rename from collect_information/src/custom-tab-bar/index.json.js
rename to collect_information/src/custom-tab-bar/index.json.ts
diff --git a/collect_information/src/custom-tab-bar/index.vue b/collect_information/src/custom-tab-bar/index.vue
index f2b91fb..8d062e0 100644
--- a/collect_information/src/custom-tab-bar/index.vue
+++ b/collect_information/src/custom-tab-bar/index.vue
@@ -1,34 +1,42 @@
-
-
-
-
-
-
-
- {{ item.text }}
-
-
+
+
+
+
+ {{ item.text }}
+
+
-
@@ -63,12 +71,12 @@ function setSelected(index) {
flex-direction: column;
}
-.tab-bar-item image {
+.tab-bar-item cover-image {
width: 54px;
height: 54px;
}
-.tab-bar-item view {
+.tab-bar-item cover-view {
font-size: 20px;
}
diff --git a/collect_information/src/enums/index.ts b/collect_information/src/enums/index.ts
index 3566495..efdc1ef 100644
--- a/collect_information/src/enums/index.ts
+++ b/collect_information/src/enums/index.ts
@@ -1,34 +1,40 @@
-export const SEX: SelectNode[] = [
- {
- value: 0,
- label: "男",
- },
- {
- value: 1,
- label: "女",
- },
- {
- value: 2,
- label: "隐藏",
+import api from "@/request";
+import Taro from "@tarojs/taro";
+
+type EnumType =
+ 'CheckStatus'
+ | 'DeleteFlag'
+ | 'IsEnable'
+ | 'IsOrNot'
+ | 'Sex'
+ | 'ServiceProjectType'
+ | 'MiniProgramUserIdentity'
+
+export const initEnum = () => {
+ api.get[]>>('/common/enums').then(resp => {
+ Taro.setStorageSync('enumMap', resp.data)
+ })
+};
+
+export const enumSelectNodes = (enumType: EnumType): SelectNodeVo[] => Taro.getStorageSync('enumMap')?.[enumType]
+
+export const getEnumByValue = (enumType: EnumType, value: T): null | SelectNodeVo => {
+ const enumList = enumSelectNodes(enumType);
+ if (!enumList) {
+ return null;
}
-];
-
-export const IDENTITY: SelectNode[] = [
- {
- label: "公安",
- value: "police"
- },
- {
- label: "项目经理",
- value: "project_manager"
- },
-]
-
-export const getLabelByEnumValue = (enums: SelectNode[], value: any): string => {
- for (let i = 0; i < enums.length; i++) {
- if (enums[i].value === value) {
- return enums[i].label
+ for (let i = 0; i < enumList.length; i++) {
+ if (value === enumList[i].value) {
+ return enumList[i]
}
}
- return '-'
-}
+ return null;
+};
+
+export const getEnumLabelByValue = (enumType: EnumType, value: T): string => {
+ const enums = getEnumByValue(enumType, value)
+ if (!enums) {
+ return '-'
+ }
+ return enums.label;
+};
diff --git a/collect_information/src/pages/employeeInfo/employeeInfo.config.ts b/collect_information/src/pages/employeeInfo/employeeInfo.config.ts
deleted file mode 100644
index ca739e2..0000000
--- a/collect_information/src/pages/employeeInfo/employeeInfo.config.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-export default definePageConfig({
- // navigationBarTitleText: '自定义导航栏',
- navigationStyle: "custom"
-})
diff --git a/collect_information/src/pages/employeeInfo/employeeInfo.scss b/collect_information/src/pages/employeeInfo/employeeInfo.scss
deleted file mode 100644
index 139597f..0000000
--- a/collect_information/src/pages/employeeInfo/employeeInfo.scss
+++ /dev/null
@@ -1,2 +0,0 @@
-
-
diff --git a/collect_information/src/pages/employeeInfo/employeeInfo.vue b/collect_information/src/pages/employeeInfo/employeeInfo.vue
deleted file mode 100644
index 77742df..0000000
--- a/collect_information/src/pages/employeeInfo/employeeInfo.vue
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
diff --git a/collect_information/src/pages/login/login.config.ts b/collect_information/src/pages/login/login.config.ts
index 97683f1..9d41d86 100644
--- a/collect_information/src/pages/login/login.config.ts
+++ b/collect_information/src/pages/login/login.config.ts
@@ -1,3 +1,3 @@
export default definePageConfig({
- navigationBarTitleText: '登录',
+ navigationBarTitleText: '登录',
})
diff --git a/collect_information/src/pages/login/login.vue b/collect_information/src/pages/login/login.vue
index 0ebac18..ed09acd 100644
--- a/collect_information/src/pages/login/login.vue
+++ b/collect_information/src/pages/login/login.vue
@@ -1,73 +1,45 @@
-
-
-
-
- Welcome
-
-
-
- 欢迎
-
-
-
-
+
+
+
+
+ 登录
+ 欢迎再次回来~
-
-
- 一键授权
-
+
+
+ 一键登录
+
+
diff --git a/collect_information/src/pages/mine/mine.config.ts b/collect_information/src/pages/mine/mine.config.ts
deleted file mode 100644
index 18e4d2b..0000000
--- a/collect_information/src/pages/mine/mine.config.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-export default definePageConfig({
- navigationBarTitleText: '我的',
- navigationBarBackgroundColor:'#3d69dc',
- navigationBarTextStyle:'white'
-})
diff --git a/collect_information/src/pages/mine/mine.scss b/collect_information/src/pages/mine/mine.scss
deleted file mode 100644
index 810e441..0000000
--- a/collect_information/src/pages/mine/mine.scss
+++ /dev/null
@@ -1,84 +0,0 @@
-.message {
- height: 100vh;
- background-color: #fff;
-}
-
-.login-container {
- height: 205rpx;
- display: flex;
- align-items: center;
- background-image: url('../../assets/images/banner.jpg');
- background-repeat: no-repeat;
- background-position: right;
- overflow: hidden;
- padding: 18rpx;
- box-sizing: border-box;
-
- .contact {
- height: 100rpx;
- width: 100rpx;
- border-radius: 50%;
- border: solid 1px gray;
-
- .image {
- width: 100%;
- height: 100%;
- border-radius: 50%
- }
- }
-
- .tips-text {
- display: flex;
- font-size: 28rpx;
- color: #fff;
- line-height: 50rpx;
- margin-left: 20rpx;
- flex-direction: column;
- justify-content: space-evenly;
- }
-}
-
-.userIndex {
- .exit {
- height: 100rpx;
- line-height: 40px;
- border-bottom: solid 0.5px #ebebf7;
- box-sizing: border-box;
- display: flex;
- justify-content: space-between;
- align-items: center;
- // margin-bottom: 30rpx;
- color: #7d7d7d;
-
- .exitItem {
- display: flex;
- align-items: center;
- margin-left: 30rpx;
- }
-
- .exitItemIndex {
- height: 40rpx;
- width: 40rpx;
- border-radius: 50%;
- // border: solid 1px gray;
- display: block;
- line-height: 48rpx;
-
- image {
- width: 100%;
- height: 100%;
- }
- }
-
- .iconScope {
- width: 8px;
- height: 8px;
- display: inline-block;
- border: solid 2px #ccc;
- -webkit-transform: rotate(45deg);
- transform: rotate(45deg);
- border-bottom: white;
- border-left: white;
- }
- }
-}
diff --git a/collect_information/src/pages/mine/mine.vue b/collect_information/src/pages/mine/mine.vue
deleted file mode 100644
index ba68e5e..0000000
--- a/collect_information/src/pages/mine/mine.vue
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
- 我的我的我的我的
-
-
-
-
-
diff --git a/collect_information/src/pages/policeManager/index/index.config.ts b/collect_information/src/pages/police/index/index.config.ts
similarity index 98%
rename from collect_information/src/pages/policeManager/index/index.config.ts
rename to collect_information/src/pages/police/index/index.config.ts
index 16286d6..a7c25c7 100644
--- a/collect_information/src/pages/policeManager/index/index.config.ts
+++ b/collect_information/src/pages/police/index/index.config.ts
@@ -1,4 +1,3 @@
export default definePageConfig({
navigationBarTitleText: '首页',
-
})
diff --git a/collect_information/src/pages/police/index/index.scss b/collect_information/src/pages/police/index/index.scss
new file mode 100644
index 0000000..650fcb5
--- /dev/null
+++ b/collect_information/src/pages/police/index/index.scss
@@ -0,0 +1,47 @@
+.swiperDemoItem {
+ color: #3886d0;
+ display: flex;
+ padding: 20px 0 0 50px;
+ overflow: hidden;
+ height: 70rpx;
+
+ .swiperDemoIndex {
+ width: 15px;
+ height: 45px;
+ background-image: linear-gradient(to bottom, #5d9cf9, #317ad9);
+ //background: rgb();
+ border-radius: 20px;
+ margin-right: 15px;
+ }
+}
+
+.subModule {
+ display: flex;
+ align-items: center;
+ flex-wrap: wrap;
+ margin-right: -3px;
+ margin-left: -1px;
+
+ .subModuleItem {
+ width: 33%;
+ height: 180rpx;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ padding-bottom: 10rpx;
+ border: 1px solid #ccc;
+ border-left: 0;
+ margin-top: -1px;
+
+ .subModuleIndex {
+ width: 65rpx;
+ height: 65rpx;
+
+ image {
+ width: 100%;
+ height: 100%;
+ }
+ }
+ }
+}
diff --git a/collect_information/src/pages/police/index/index.vue b/collect_information/src/pages/police/index/index.vue
new file mode 100644
index 0000000..9ca7928
--- /dev/null
+++ b/collect_information/src/pages/police/index/index.vue
@@ -0,0 +1,58 @@
+
+
+
+
+
+
+
+
+
+
+
+ 请选择
+
+
+
+
+
+
+
+
+ {{ item.name }}
+
+
+
+
+
+
diff --git a/collect_information/src/pages/police/mine/index.config.ts b/collect_information/src/pages/police/mine/index.config.ts
new file mode 100644
index 0000000..a7c25c7
--- /dev/null
+++ b/collect_information/src/pages/police/mine/index.config.ts
@@ -0,0 +1,3 @@
+export default definePageConfig({
+ navigationBarTitleText: '首页',
+})
diff --git a/collect_information/src/pages/police/mine/index.scss b/collect_information/src/pages/police/mine/index.scss
new file mode 100644
index 0000000..e69de29
diff --git a/collect_information/src/pages/police/mine/index.vue b/collect_information/src/pages/police/mine/index.vue
new file mode 100644
index 0000000..d00e9e3
--- /dev/null
+++ b/collect_information/src/pages/police/mine/index.vue
@@ -0,0 +1,9 @@
+
+
+ 警察我的
+
+
+
+
diff --git a/collect_information/src/pages/policeManager/index/index.scss b/collect_information/src/pages/policeManager/index/index.scss
deleted file mode 100644
index a3b707a..0000000
--- a/collect_information/src/pages/policeManager/index/index.scss
+++ /dev/null
@@ -1,39 +0,0 @@
-page {
- background-color: #f0f0f0;
-}
-
-.content {
- width: 702rpx;
- margin: 10rpx auto;
- background-color: #fff;
- border-radius: 10rpx;
- height: 500rpx;
- display: grid;
- /* 定义两列,每列占据50%的宽度 */
- grid-template-columns: repeat(2, 1fr);
- /* 定义两行,每行占据1fr(分数单位,表示剩余空间的一部分) */
- grid-template-rows: repeat(2, 1fr);
- /* 可选:增加一些间隙 */
- gap: 10px;
-
- .grid-item {
- //width: 100%;
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
-
-
- .grid-item-image {
- height: 150rpx;
- width: 150rpx;
- background-color: #f0f0f0;
- border-radius: 50%;
- }
-
- .grid-item-text {
-
-
- }
- }
-}
diff --git a/collect_information/src/pages/policeManager/index/index.vue b/collect_information/src/pages/policeManager/index/index.vue
deleted file mode 100644
index 94154d2..0000000
--- a/collect_information/src/pages/policeManager/index/index.vue
+++ /dev/null
@@ -1,85 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/collect_information/src/pages/projectManager/index/index.config.ts b/collect_information/src/pages/projectManager/index/index.config.ts
index 6b0b2af..a7c25c7 100644
--- a/collect_information/src/pages/projectManager/index/index.config.ts
+++ b/collect_information/src/pages/projectManager/index/index.config.ts
@@ -1,4 +1,3 @@
-
export default definePageConfig({
- navigationBarTitleText: '首页',
+ navigationBarTitleText: '首页',
})
diff --git a/collect_information/src/pages/projectManager/index/index.scss b/collect_information/src/pages/projectManager/index/index.scss
index e69de29..b802829 100644
--- a/collect_information/src/pages/projectManager/index/index.scss
+++ b/collect_information/src/pages/projectManager/index/index.scss
@@ -0,0 +1,48 @@
+.swiperDemoItem {
+ color: #3886d0;
+ display: flex;
+ padding: 20px 0 0 50px;
+ overflow: hidden;
+ height: 70rpx;
+
+ .swiperDemoIndex {
+ width: 15px;
+ height: 45px;
+ background-image: linear-gradient(to bottom, #5d9cf9, #317ad9);
+ //background: rgb();
+ border-radius: 20px;
+ margin-right: 15px;
+ }
+}
+
+.subModule {
+ display: flex;
+ align-items: center;
+ flex-wrap: wrap;
+ margin-right: -3px;
+ margin-left: -1px;
+
+ .subModuleItem {
+ width: 33%;
+ height: 180rpx;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ padding-bottom: 10rpx;
+ border: 1px solid #ccc;
+ border-left: 0;
+ margin-top: -1px;
+
+ .subModuleIndex {
+ width: 65rpx;
+ height: 65rpx;
+
+ image {
+ width: 100%;
+ height: 100%;
+ }
+ }
+ }
+}
+
diff --git a/collect_information/src/pages/projectManager/index/index.vue b/collect_information/src/pages/projectManager/index/index.vue
index 0ffa443..7455202 100644
--- a/collect_information/src/pages/projectManager/index/index.vue
+++ b/collect_information/src/pages/projectManager/index/index.vue
@@ -1,41 +1,58 @@
-
+
-
-
+
+
-
-
-
-
-
-
-
-
-
+
+
+ 请选择
+
+
+
+
+
+
+
+
+ {{ item.name }}
+
+
-
-
diff --git a/collect_information/src/pages/projectManager/mine/index.config.ts b/collect_information/src/pages/projectManager/mine/index.config.ts
new file mode 100644
index 0000000..b4d3feb
--- /dev/null
+++ b/collect_information/src/pages/projectManager/mine/index.config.ts
@@ -0,0 +1,3 @@
+export default definePageConfig({
+ navigationBarTitleText: '我的',
+})
diff --git a/collect_information/src/pages/projectManager/mine/index.scss b/collect_information/src/pages/projectManager/mine/index.scss
new file mode 100644
index 0000000..e69de29
diff --git a/collect_information/src/pages/projectManager/mine/index.vue b/collect_information/src/pages/projectManager/mine/index.vue
new file mode 100644
index 0000000..55e8097
--- /dev/null
+++ b/collect_information/src/pages/projectManager/mine/index.vue
@@ -0,0 +1,9 @@
+
+
+ 项目经理我的
+
+
+
+
diff --git a/collect_information/src/pages/register/register.config.ts b/collect_information/src/pages/register/register.config.ts
index 7632e93..1c854c8 100644
--- a/collect_information/src/pages/register/register.config.ts
+++ b/collect_information/src/pages/register/register.config.ts
@@ -1,3 +1,3 @@
export default definePageConfig({
- navigationBarTitleText: '用户注册'
+ navigationBarTitleText: '注册'
})
diff --git a/collect_information/src/pages/register/register.scss b/collect_information/src/pages/register/register.scss
index eaa1ebf..d3ec4b4 100644
--- a/collect_information/src/pages/register/register.scss
+++ b/collect_information/src/pages/register/register.scss
@@ -27,7 +27,7 @@
}
.nickNameInput{
- color: black;
+ color: black;
}
.contact {
diff --git a/collect_information/src/pages/register/register.vue b/collect_information/src/pages/register/register.vue
index e3e7fc7..0368d69 100644
--- a/collect_information/src/pages/register/register.vue
+++ b/collect_information/src/pages/register/register.vue
@@ -11,9 +11,9 @@
@@ -26,18 +26,18 @@
{{ item.label }}
@@ -47,21 +47,21 @@
- {{ selectedLabel || '请选择单位'}}
+ {{ selectedLabel || '请选择单位' }}
@@ -75,19 +75,23 @@
-
diff --git a/collect_information/src/request/index.ts b/collect_information/src/request/index.ts
index 0947285..8c22ad3 100644
--- a/collect_information/src/request/index.ts
+++ b/collect_information/src/request/index.ts
@@ -1,26 +1,33 @@
import Taro from "@tarojs/taro";
-import {ApiOptions} from "../../types/request";
-import {type} from "os";
+import {ApiOptions} from "@/types/request";
+import {useUserStore} from "@/store/userStore";
+
+/**
+ * 请求拦截器
+ * @param chain
+ */
const requestInterceptor = (chain: Taro.Chain) => {
const requestParams = chain.requestParams
- const token = Taro.getStorageSync('token')
- if (token) {
- requestParams.header = {
- ...requestParams.header,
- token: token.value
- }
+ const tokenInfo = useUserStore().getTokenInfo()
+ const {header} = requestParams;
+ const customHeader: Record = {}
+ //添加token
+ tokenInfo && (customHeader[tokenInfo.name] = tokenInfo.value);
+ requestParams.header = {
+ ...header,
+ ...customHeader
}
return chain.proceed(requestParams)
}
-class CustomRequest {
- BASE_API: string
+//所有的拦截器
+const interceptors = [requestInterceptor];
+//注册拦截器
+interceptors.forEach((interceptorItem) => Taro.addInterceptor(interceptorItem));
- public constructor() {
- this.BASE_API = process.env.TARO_APP_BASE_API
- Taro.addInterceptor(requestInterceptor)
- }
+class CustomRequest {
+ BASE_API: string = process.env.TARO_APP_BASE_API;
private request(url: string, method: keyof Taro.request.Method, options: ApiOptions, params?: object,): Promise> {
return new Promise>((resolve, reject) => {
@@ -29,7 +36,6 @@ class CustomRequest {
title: '请求中...',
}).then()
}
-
Taro.request, object>({
url: this.BASE_API + url,
data: params,
@@ -37,10 +43,14 @@ class CustomRequest {
...options,
success: (result) => {
Taro.hideLoading()
+ if (result.header['Content-Type'] === 'application/octet-stream') {
+ resolve(result.data)
+ return
+ }
const jsonResult = result.data
if (jsonResult.code !== 200) {
if ([401].includes(jsonResult.code)) {
- //todo 重新登录 跳转登录页 提示错误
+ // 重新登录 跳转登录页 提示错误
}
Taro.showToast({
title: jsonResult.message,
@@ -49,8 +59,9 @@ class CustomRequest {
duration: 2000
}).then()
reject(jsonResult);
+ } else {
+ resolve(jsonResult);
}
- resolve(jsonResult);
},
fail: (res) => {
Taro.hideLoading()
@@ -61,13 +72,16 @@ class CustomRequest {
duration: 2000
}).then()
reject(res.errMsg);
- console.log(res.errMsg, '000')
}
})
})
}
get(url: string, params?: object, options: ApiOptions = {loading: false}): Promise> {
+ options.header = {
+ ...options.header,
+ "content-type": 'application/x-www-form-urlencoded'
+ }
return this.request(url, "GET", options, params)
}
@@ -76,12 +90,17 @@ class CustomRequest {
}
delete(url: string, params?: object, options: ApiOptions = {loading: false}): Promise> {
+ options.header = {
+ ...options.header,
+ "content-type": 'application/x-www-form-urlencoded'
+ }
return this.request(url, "DELETE", options, params)
}
put(url: string, params?: object, options: ApiOptions = {loading: false}): Promise> {
return this.request(url, "PUT", options, params)
}
+
}
const api = new CustomRequest();
diff --git a/collect_information/src/store/index.ts b/collect_information/src/store/index.ts
index e29a946..e917126 100644
--- a/collect_information/src/store/index.ts
+++ b/collect_information/src/store/index.ts
@@ -1,51 +1,3 @@
-import {defineStore} from 'pinia'
-import Taro from '@tarojs/taro'
-
-export const useCounterStore = defineStore('counter', {
- state: () => {
- return {
- userInfo: {},
- selected: 0,
- list: Taro.getStorageSync('list') || [
- {
- pagePath: '/pages/projectManager/index/index',
- text: '首页',
- iconPath: "/assets/mine/punch.png",
- selectedIconPath: "/assets/mine/punch-active.png"
- },
- {
- pagePath: '/pages/employeeInfo/employeeInfo',
- text: '员工信息',
- iconPath: "/assets/mine/punch.png",
- selectedIconPath: "/assets/mine/punch-active.png"
- },
- {
- pagePath: '/pages/mine/mine',
- text: '我的',
- iconPath: "/assets/mine/my.png",
- selectedIconPath: "/assets/mine/my-active.png"
- },
- ]
- }
- },
- actions: {
- setSelected(index: number) {
- this.selected = index
- },
- updateHomePagePath(newPath: string) {
- this.list[0].pagePath = newPath
- // 更新 list 后存储到小程序本地存储
- Taro.setStorageSync('list', this.list)
- }
- },
- getters: {
- getSelected: (state) => state.selected,
- getList: (state) => state.list
- },
- persist: {
- // key: 'my-store', // 存储到 localStorage 的 key
- // storage: localStorage, // 持久化方式为 localStorage
- // paths: ['list'] // 持久化 list
- }
-})
+import {createPinia} from 'pinia'
+export const pinia = createPinia()
diff --git a/collect_information/src/store/tabBarStore.ts b/collect_information/src/store/tabBarStore.ts
new file mode 100644
index 0000000..accf8c3
--- /dev/null
+++ b/collect_information/src/store/tabBarStore.ts
@@ -0,0 +1,14 @@
+import {defineStore} from "pinia";
+import {ref} from "vue";
+
+export const useTabBarStore = defineStore('tabBar', () => {
+ const selected = ref(0)
+ const setSelected = (index: number) => {
+ selected.value = index;
+ }
+
+ return {
+ selected,
+ setSelected
+ }
+})
diff --git a/collect_information/src/store/userStore.ts b/collect_information/src/store/userStore.ts
index e69de29..2dafcb3 100644
--- a/collect_information/src/store/userStore.ts
+++ b/collect_information/src/store/userStore.ts
@@ -0,0 +1,40 @@
+import {defineStore} from "pinia";
+import {ref} from "vue";
+import Taro from "@tarojs/taro";
+
+export const useUserStore = defineStore('userStore', () => {
+ /** 获取token信息 **/
+ const getTokenInfo = (): TokenInfo | null => {
+ const ti = Taro.getStorageSync('tokenInfo')
+ // 如果 ti 存在且不是空字符串,则返回 ti,否则返回 null
+ return (ti !== undefined && ti !== null && ti !== '') ? ti : null;
+ }
+ /** 用户token信息 **/
+ const tokenInfo = ref(getTokenInfo())
+ /** 保存token信息 **/
+ const saveTokenInfo = (t: TokenInfo) => {
+ tokenInfo.value = t;
+ Taro.setStorageSync('tokenInfo', tokenInfo.value)
+ }
+ /** 清楚token信息 */
+ const clearTokenInfo = () => {
+ tokenInfo.value = null
+ Taro.removeStorageSync('tokenInfo')
+ }
+
+
+ /**
+ * 重置用户数据
+ * 一般用于用户退出登录 重置所有相关数据
+ */
+ const resetUserInfo = () => {
+ clearTokenInfo()
+ }
+
+ return {
+ tokenInfo,
+ saveTokenInfo,
+ getTokenInfo,
+ resetUserInfo
+ }
+})
diff --git a/collect_information/src/subPages/pages/form/form.config.ts b/collect_information/src/subPages/pages/form/form.config.ts
deleted file mode 100644
index 7652664..0000000
--- a/collect_information/src/subPages/pages/form/form.config.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export default definePageConfig({
- navigationBarTitleText: '项目人员录入',
-})
diff --git a/collect_information/src/subPages/pages/form/form.scss b/collect_information/src/subPages/pages/form/form.scss
deleted file mode 100644
index 93df7ae..0000000
--- a/collect_information/src/subPages/pages/form/form.scss
+++ /dev/null
@@ -1,8 +0,0 @@
-.form{
- .formButton{
- display: flex;
- margin-top: auto;
- justify-content: space-around;
- margin-bottom: 30px
- }
-}
diff --git a/collect_information/src/subPages/pages/myProject/myproject.config.ts b/collect_information/src/subPages/pages/myProject/myproject.config.ts
deleted file mode 100644
index 7bccd60..0000000
--- a/collect_information/src/subPages/pages/myProject/myproject.config.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export default definePageConfig({
- navigationBarTitleText: '我的项目',
-})
diff --git a/collect_information/src/subPages/pages/myProject/myproject.scss b/collect_information/src/subPages/pages/myProject/myproject.scss
deleted file mode 100644
index 867ee38..0000000
--- a/collect_information/src/subPages/pages/myProject/myproject.scss
+++ /dev/null
@@ -1,31 +0,0 @@
-.myProject{
- height: 100vh;
- overflow: hidden;
- background: #f1f1f1;
- .myProjectItem{
- //height: 20%;
- margin: 20px;
- border-radius: 10px;
- background: #ffffff;
- padding: 15px;
- font-size: 28px;
- line-height: 50px;
- color: #333333;
- .myProjectIndex{
- color: #9b9b9f;
- }
- .project{
- display: flex;
- justify-content: space-between;
- flex-flow: wrap;
- text-align: center;
- view{
- width: 45%;
- height: 100rpx;
- border: 1px solid #cccccc;
- line-height: 100rpx;
- margin: 8px 0 8px 0;
- }
- }
- }
-}
diff --git a/collect_information/src/subPages/pages/policeManager/index.scss b/collect_information/src/subPages/police/myEnterprisesUnit/myEnterprisesUnit.scss
similarity index 99%
rename from collect_information/src/subPages/pages/policeManager/index.scss
rename to collect_information/src/subPages/police/myEnterprisesUnit/myEnterprisesUnit.scss
index b1dd448..1cab77b 100644
--- a/collect_information/src/subPages/pages/policeManager/index.scss
+++ b/collect_information/src/subPages/police/myEnterprisesUnit/myEnterprisesUnit.scss
@@ -32,4 +32,3 @@ page {
}
}
}
-
diff --git a/collect_information/src/subPages/pages/policeManager/index.config.ts b/collect_information/src/subPages/police/myEnterprisesUnit/myEnterprisesUnit.ts
similarity index 98%
rename from collect_information/src/subPages/pages/policeManager/index.config.ts
rename to collect_information/src/subPages/police/myEnterprisesUnit/myEnterprisesUnit.ts
index 30c5ed6..db6b2a1 100644
--- a/collect_information/src/subPages/pages/policeManager/index.config.ts
+++ b/collect_information/src/subPages/police/myEnterprisesUnit/myEnterprisesUnit.ts
@@ -1,4 +1,3 @@
export default definePageConfig({
navigationBarTitleText: '企事业单位',
-
})
diff --git a/collect_information/src/subPages/pages/policeManager/index.vue b/collect_information/src/subPages/police/myEnterprisesUnit/myEnterprisesUnit.vue
similarity index 66%
rename from collect_information/src/subPages/pages/policeManager/index.vue
rename to collect_information/src/subPages/police/myEnterprisesUnit/myEnterprisesUnit.vue
index e8d67a4..b1cb95e 100644
--- a/collect_information/src/subPages/pages/policeManager/index.vue
+++ b/collect_information/src/subPages/police/myEnterprisesUnit/myEnterprisesUnit.vue
@@ -13,8 +13,9 @@
电话:{{ item?.contactPersonInfo.telephone }}
-
- {{ items.name }}
+
+ {{ serviceProject.name }}
@@ -25,33 +26,21 @@
import api from "@/request/index";
import {onMounted, ref} from "vue";
import Taro from "@tarojs/taro";
-import './index.scss'
+import './myEnterprisesUnit.scss'
+import {MyProjectList, ServiceProjectList} from "@/types/subPages/projectManager/myProject";
const myProjectList = ref()
const getMyServiceProject = async () => {
- const token = Taro.getStorageSync('token')
- const resp = await api.get(`/policeIndex/getUnitServiceProjectList`, {
- token: token.value
- })
-
+ const resp = await api.get(`/policeIndex/getUnitServiceProjectList`)
myProjectList.value = resp.data
- console.log(resp.data)
}
-const projectClick = (items: ServiceProjectList, name: string) => {
- console.log(name, JSON.stringify(items))
+const projectClick = (enterprisesUnitName: string, serviceProject: ServiceProjectList) => {
Taro.navigateTo({
-
- url: `/subPages/pages/policeDetails/index?name=${name}&item=${JSON.stringify(items)}`,
+ url: `/subPages/police/myEnterprisesUnit/projectDetails/projectDetails?enterprisesUnitName=${enterprisesUnitName}&serviceProject=${JSON.stringify(serviceProject)}`,
})
}
onMounted(async () => {
await getMyServiceProject()
})
-
-
-
-
-
-
diff --git a/collect_information/src/subPages/pages/policeDetails/index.scss b/collect_information/src/subPages/police/myEnterprisesUnit/projectDetails/projectDetails.scss
similarity index 79%
rename from collect_information/src/subPages/pages/policeDetails/index.scss
rename to collect_information/src/subPages/police/myEnterprisesUnit/projectDetails/projectDetails.scss
index 3bddb3c..ef412c6 100644
--- a/collect_information/src/subPages/pages/policeDetails/index.scss
+++ b/collect_information/src/subPages/police/myEnterprisesUnit/projectDetails/projectDetails.scss
@@ -1,10 +1,11 @@
-.projectDetails{
+.projectDetails {
height: 100vh;
overflow: hidden;
background: #f1f1f1;
display: flex;
flex-direction: column;
- .projectDetailsItem{
+
+ .projectDetailsItem {
margin: 10px 20px 10px 20px;
border-radius: 10px;
background: #ffffff;
@@ -12,19 +13,23 @@
font-size: 28px;
line-height: 65px;
color: #333333;
- .projectDetailsIndex{
+
+ .projectDetailsIndex {
display: flex;
flex-wrap: wrap;
line-height: 44rpx;
margin-bottom: 20px;
- .content{
- color: #9b9b9f;
+
+ .content {
+ color: #9b9b9f;
}
}
}
- .projectDetailsTableDrop{
+
+ .projectDetailsTableDrop {
height: 80%;
- .projectDetailsTable{
+
+ .projectDetailsTable {
margin: 20px;
border-radius: 10px;
background: #ffffff;
@@ -32,18 +37,21 @@
font-size: 28px;
line-height: 50px;
color: #333333;
- .projectDetailsTableItem{
+
+ .projectDetailsTableItem {
//display: flex;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
font-size: 24px;
margin-bottom: 15px;
- .projectDetailsTableIndex{
+
+ .projectDetailsTableIndex {
display: flex;
justify-content: flex-end;
text-align: center;
- view{
+
+ view {
width: 70px;
margin-right: 20px;
}
@@ -51,7 +59,8 @@
}
}
}
- .projectDetailsButton{
+
+ .projectDetailsButton {
position: fixed;
bottom: 19px;
display: flex;
@@ -60,12 +69,11 @@
right: 0;
width: 100%;
}
- .nutPopup{
+
+ .nutPopup {
width: 300px;
height: 100px;
display: flex;
flex-wrap: wrap;
}
}
-
-
diff --git a/collect_information/src/subPages/pages/projectDetails/projectDetails.config.ts b/collect_information/src/subPages/police/myEnterprisesUnit/projectDetails/projectDetails.ts
similarity index 98%
rename from collect_information/src/subPages/pages/projectDetails/projectDetails.config.ts
rename to collect_information/src/subPages/police/myEnterprisesUnit/projectDetails/projectDetails.ts
index c155561..463c9fb 100644
--- a/collect_information/src/subPages/pages/projectDetails/projectDetails.config.ts
+++ b/collect_information/src/subPages/police/myEnterprisesUnit/projectDetails/projectDetails.ts
@@ -1,4 +1,3 @@
export default definePageConfig({
navigationBarTitleText: '项目详情',
-
})
diff --git a/collect_information/src/subPages/pages/policeDetails/index.vue b/collect_information/src/subPages/police/myEnterprisesUnit/projectDetails/projectDetails.vue
similarity index 66%
rename from collect_information/src/subPages/pages/policeDetails/index.vue
rename to collect_information/src/subPages/police/myEnterprisesUnit/projectDetails/projectDetails.vue
index c6d5ba6..b68a6cc 100644
--- a/collect_information/src/subPages/pages/policeDetails/index.vue
+++ b/collect_information/src/subPages/police/myEnterprisesUnit/projectDetails/projectDetails.vue
@@ -3,14 +3,14 @@
- {{ nameValue ? nameValue : '' }}{{ '-----' + detailsList?.name }}项目
+ {{ enterprisesUnitName }}-----{{ serviceProject?.name }}项目
- 经理名称:{{ detailsList?.projectManagerMiniProgramUserInfo.name }}
+ 经理名称:{{ serviceProject?.projectManagerMiniProgramUserInfo.name }}
- 手机号:{{ detailsList?.projectManagerMiniProgramUserInfo.telephone }}
+ 手机号:{{ serviceProject?.projectManagerMiniProgramUserInfo.telephone }}
@@ -18,28 +18,28 @@
- 保安证件号:{{ detailsList?.idNumber }}
+ 保安证件号:{{ serviceProject?.idNumber }}
- 工作人员数量:{{ detailsList?.staffTotal }}
+ 工作人员数量:{{ serviceProject?.staffTotal }}
- 保安人员数量:{{ detailsList?.securityUserTotal }}
+ 保安人员数量:{{ serviceProject?.securityUserTotal }}
- 服务区域面积:{{ detailsList?.serviceArea }}
+ 服务区域面积:{{ serviceProject?.serviceArea }}
- 楼栋数量:{{ detailsList?.buildingTotal }}
+ 楼栋数量:{{ serviceProject?.buildingTotal }}
- 户数:{{ detailsList?.houseTotal }}
+ 户数:{{ serviceProject?.houseTotal }}
@@ -51,7 +51,7 @@
:scroll-into-view="toView" :scroll-top="scrollTop" :refresherEnabled="true"
@refresherrefresh="onRefresherRefresh" :refresher-triggered="isRefresher"
>
-
+
@@ -79,17 +79,19 @@
-
diff --git a/collect_information/src/subPages/projectManager/myProject/myProject.scss b/collect_information/src/subPages/projectManager/myProject/myProject.scss
new file mode 100644
index 0000000..d94d1d9
--- /dev/null
+++ b/collect_information/src/subPages/projectManager/myProject/myProject.scss
@@ -0,0 +1,35 @@
+.myProject {
+ height: 100vh;
+ overflow: hidden;
+ background: #f1f1f1;
+
+ .myProjectItem {
+ //height: 20%;
+ margin: 20px;
+ border-radius: 10px;
+ background: #ffffff;
+ padding: 15px;
+ font-size: 28px;
+ line-height: 50px;
+ color: #333333;
+
+ .myProjectIndex {
+ color: #9b9b9f;
+ }
+
+ .project {
+ display: flex;
+ justify-content: space-between;
+ flex-flow: wrap;
+ text-align: center;
+
+ view {
+ width: 45%;
+ height: 100rpx;
+ border: 1px solid #cccccc;
+ line-height: 100rpx;
+ margin: 8px 0 8px 0;
+ }
+ }
+ }
+}
diff --git a/collect_information/src/subPages/projectManager/myProject/myProject.ts b/collect_information/src/subPages/projectManager/myProject/myProject.ts
new file mode 100644
index 0000000..7d4dae7
--- /dev/null
+++ b/collect_information/src/subPages/projectManager/myProject/myProject.ts
@@ -0,0 +1,3 @@
+export default definePageConfig({
+ navigationBarTitleText: '我的项目',
+})
diff --git a/collect_information/src/subPages/pages/myProject/myProject.vue b/collect_information/src/subPages/projectManager/myProject/myProject.vue
similarity index 64%
rename from collect_information/src/subPages/pages/myProject/myProject.vue
rename to collect_information/src/subPages/projectManager/myProject/myProject.vue
index 32eadff..8cdf561 100644
--- a/collect_information/src/subPages/pages/myProject/myProject.vue
+++ b/collect_information/src/subPages/projectManager/myProject/myProject.vue
@@ -1,10 +1,9 @@
-
+
{{ item?.name }}
-
地址:
{{ item?.provinceName }}{{ item.cityName }}{{ item.districtsName }}{{ item.streetName }}
@@ -14,13 +13,14 @@
电话:{{ item?.contactPersonInfo.telephone }}
-
- {{ items.name }}
+
+ {{ serviceProject.name }}
-
+
@@ -33,7 +33,8 @@
import api from "@/request/index";
import {onMounted, ref} from "vue";
import Taro from "@tarojs/taro";
-import './myproject.scss'
+import './myProject.scss'
+import {MyProjectList, ServiceProjectList} from "@/types/subPages/projectManager/myProject";
const myProjectList = ref()
@@ -41,20 +42,15 @@ const number = ref(0)
const getMyServiceProject = async () => {
const resp = await api.get(`/projectManageIndex/getMyServiceProject`)
myProjectList.value = resp.data
- number.value = resp.data.length
+ number.value = (resp.data?.length || 0)
}
-const projectClick = (items: ServiceProjectList, name: string) => {
- console.log(items)
+const projectClick = (enterprisesUnitName: string, serviceProject: ServiceProjectList) => {
Taro.navigateTo({
- url: `/subPages/pages/projectDetails/projectDetails?name=${name}&item=${JSON.stringify(items)}`,
+ url: `/subPages/projectManager/myProject/projectDetails/projectDetails?enterprisesUnitName=${enterprisesUnitName}&serviceProject=${JSON.stringify(serviceProject)}`,
})
}
onMounted(async () => {
await getMyServiceProject()
})
-
-
-
-
diff --git a/collect_information/src/subPages/pages/projectDetails/projectDetails.scss b/collect_information/src/subPages/projectManager/myProject/projectDetails/projectDetails.scss
similarity index 66%
rename from collect_information/src/subPages/pages/projectDetails/projectDetails.scss
rename to collect_information/src/subPages/projectManager/myProject/projectDetails/projectDetails.scss
index 5ede9f2..acb1441 100644
--- a/collect_information/src/subPages/pages/projectDetails/projectDetails.scss
+++ b/collect_information/src/subPages/projectManager/myProject/projectDetails/projectDetails.scss
@@ -1,10 +1,11 @@
-.projectDetails{
+.projectDetails {
height: 100vh;
overflow: hidden;
background: #f1f1f1;
display: flex;
flex-direction: column;
- .projectDetailsItem{
+
+ .projectDetailsItem {
margin: 10px 20px 10px 20px;
border-radius: 10px;
background: #ffffff;
@@ -12,19 +13,23 @@
font-size: 28px;
line-height: 65px;
color: #333333;
- .projectDetailsIndex{
+
+ .projectDetailsIndex {
display: flex;
flex-wrap: wrap;
line-height: 44rpx;
margin-bottom: 20px;
- .content{
- color: #9b9b9f;
- }
+
+ .content {
+ color: #9b9b9f;
+ }
}
}
- .projectDetailsTableDrop{
+
+ .projectDetailsTableDrop {
height: 80%;
- .projectDetailsTable{
+
+ .projectDetailsTable {
margin: 20px;
border-radius: 10px;
background: #ffffff;
@@ -32,26 +37,30 @@
font-size: 28px;
line-height: 50px;
color: #333333;
- .projectDetailsTableItem{
+
+ .projectDetailsTableItem {
//display: flex;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
font-size: 24px;
margin-bottom: 15px;
- .projectDetailsTableIndex{
- display: flex;
- justify-content: flex-end;
- text-align: center;
- view{
- width: 70px;
- margin-right: 20px;
- }
+
+ .projectDetailsTableIndex {
+ display: flex;
+ justify-content: flex-end;
+ text-align: center;
+
+ view {
+ width: 70px;
+ margin-right: 20px;
+ }
}
}
}
}
- .projectDetailsButton{
+
+ .projectDetailsButton {
position: fixed;
bottom: 19px;
display: flex;
@@ -60,33 +69,37 @@
right: 0;
width: 100%;
}
- .nutPopup{
- width: 300px;
- height: 100px;
- display: flex;
- flex-wrap: wrap;
+
+ .nutPopup {
+ width: 300px;
+ height: 100px;
+ display: flex;
+ flex-wrap: wrap;
}
- .qrcodeVisibleUrl{
+
+ .qrcodeVisibleUrl {
margin-bottom: 5px;
+
image {
width: 100%;
}
}
- .warp{
+
+ .warp {
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
- .warpItem{
+
+ .warpItem {
width: 90%;
height: 50%;
text-align: center;
- .rect{
+
+ .rect {
width: 100%;
height: 100%;
}
}
}
}
-
-
diff --git a/collect_information/src/subPages/pages/policeDetails/index.config.ts b/collect_information/src/subPages/projectManager/myProject/projectDetails/projectDetails.ts
similarity index 98%
rename from collect_information/src/subPages/pages/policeDetails/index.config.ts
rename to collect_information/src/subPages/projectManager/myProject/projectDetails/projectDetails.ts
index c155561..463c9fb 100644
--- a/collect_information/src/subPages/pages/policeDetails/index.config.ts
+++ b/collect_information/src/subPages/projectManager/myProject/projectDetails/projectDetails.ts
@@ -1,4 +1,3 @@
export default definePageConfig({
navigationBarTitleText: '项目详情',
-
})
diff --git a/collect_information/src/subPages/pages/projectDetails/projectDetails.vue b/collect_information/src/subPages/projectManager/myProject/projectDetails/projectDetails.vue
similarity index 59%
rename from collect_information/src/subPages/pages/projectDetails/projectDetails.vue
rename to collect_information/src/subPages/projectManager/myProject/projectDetails/projectDetails.vue
index 51231ab..8fa23b9 100644
--- a/collect_information/src/subPages/pages/projectDetails/projectDetails.vue
+++ b/collect_information/src/subPages/projectManager/myProject/projectDetails/projectDetails.vue
@@ -3,17 +3,15 @@
- {{ nameValue ? nameValue : '' }}{{
- '-----' + serviceProjectDetails?.name
- }}项目
+ {{ enterprisesUnitName }}-----{{ serviceProject?.name }}
进行中
- 经理名称:{{ serviceProjectDetails?.projectManagerMiniProgramUserInfo.name }}
+ 经理名称:{{ serviceProject?.projectManagerMiniProgramUserInfo.name }}
- 手机号:{{ serviceProjectDetails?.projectManagerMiniProgramUserInfo.telephone }}
+ 手机号:{{ serviceProject?.projectManagerMiniProgramUserInfo.telephone }}
@@ -21,28 +19,28 @@
- 保安证件号:{{ serviceProjectDetails?.idNumber }}
+ 保安证件号:{{ serviceProject?.idNumber }}
- 工作人员数量:{{ serviceProjectDetails?.staffTotal }}
+ 工作人员数量:{{ serviceProject?.staffTotal }}
- 保安人员数量:{{ serviceProjectDetails?.securityUserTotal }}
+ 保安人员数量:{{ serviceProject?.securityUserTotal }}
- 服务区域面积:{{ serviceProjectDetails?.serviceArea }}
+ 服务区域面积:{{ serviceProject?.serviceArea }}
- 楼栋数量:{{ serviceProjectDetails?.buildingTotal }}
+ 楼栋数量:{{ serviceProject?.buildingTotal }}
- 户数:{{ serviceProjectDetails?.houseTotal }}
+ 户数:{{ serviceProject?.houseTotal }}
@@ -54,7 +52,7 @@
:scroll-into-view="toView" :scroll-top="scrollTop" :refresherEnabled="true"
@refresherrefresh="onRefresherRefresh" :refresher-triggered="isRefresher"
>
-
+
@@ -74,7 +72,7 @@
详情
- 编辑
+ 编辑
删除
@@ -98,33 +96,35 @@
- 籍贯:{{ content.nativePlace }}
- 公司:{{ content.securityUnitName }}
- 家庭地址:{{ content.homeAddress }}
- 备注:{{ content.remark }}
+ 籍贯:{{ securityUserDetail.nativePlace }}
+ 公司:{{ securityUserDetail.securityUnitName }}
+ 家庭地址:{{ securityUserDetail.homeAddress }}
+ 备注:{{ securityUserDetail.remark }}
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
@@ -134,21 +134,24 @@ import Taro, {useDidShow, useLoad} from "@tarojs/taro";
import './projectDetails.scss'
import {ref} from "vue";
import api from "@/request/index";
-import * as dayjs from 'dayjs'
+import dayjs from 'dayjs'
+import {ServiceProjectSecurityUserPagerVo} from "@/types/subPages/projectManager/myProject";
+import {SecurityUserFormParams} from "@/types/subPages/projectManager/securityUserForm";
-const serviceProjectDetails = ref()
-const nameValue = ref('')
-const projectData = ref([])
-const content = ref({} as any)
+const serviceProject = ref()
+const enterprisesUnitName = ref('')
+const securityUserList = ref([])
+
+const securityUserDetail = ref({} as any)
// 控制模态框的显示状态
const confirmVisible = ref(false);
const detailVisible = ref(false)
const qrcodeVisible = ref(false)
const showOverlay = ref(false)
-useLoad(async (options: MyProjectList) => {
- nameValue.value = options.name
- serviceProjectDetails.value = await JSON.parse(options.item)
+useLoad((options) => {
+ enterprisesUnitName.value = options.enterprisesUnitName
+ serviceProject.value = JSON.parse(options.serviceProject)
})
useDidShow(async () => {
initServiceProjectSecurityUserList()
@@ -159,24 +162,24 @@ const projectDetailsTable = async () => {
})
const queryParams = {
params: {
- serviceProjectId: serviceProjectDetails.value?.snowFlakeId,
+ serviceProjectId: serviceProject.value.snowFlakeId,
},
page: {
size: 4,
current: current.value
}
}
- const resp = await api.post('/miniProgramUser/securityUserPager', queryParams)
- projectData.value = [...projectData.value, ...resp?.data.records]
- total.value = resp?.data.total
+ const resp = await api.post>('/miniProgramUser/securityUserPager', queryParams)
+ securityUserList.value = [...securityUserList.value, ...resp.data!.records]
+ total.value = resp.data!.total
isRefresher.value = false
Taro.hideLoading()
}
const formAdd = () => {
const params = {
- serviceProjectId: serviceProjectDetails.value.snowFlakeId,
- securityUnitId:serviceProjectDetails.value.securityUnitId,
snowFlakeId: undefined,
+ serviceProjectId: serviceProject.value.snowFlakeId,
+ securityUnitId: serviceProject.value.securityUnitId,
name: '',
workPost: '',
sex: 0,
@@ -186,9 +189,9 @@ const formAdd = () => {
securityNumber: '',
remark: '',
homeAddress: '',
- telephone:''
- }
- Taro.navigateTo({url: `/subPages/pages/form/form?item=${JSON.stringify(params)}&&id=${1}`})
+ telephone: ''
+ } as SecurityUserFormParams
+ Taro.navigateTo({url: `/subPages/projectManager/securityUserForm/securityUserForm?securityUser=${JSON.stringify(params)}&&type=formInput`})
}
const total = ref(null)
const current = ref(1)
@@ -196,15 +199,15 @@ const isRefresher = ref(false)
const scrollTop = ref(0)
const toView = ref('demo2')
// 滚动到底部/右边时触发
-const lower = (e) => {
- if (total.value === projectData.value.length) return
- if (total.value > projectData.value.length) {
+const lower = () => {
+ if (total.value === securityUserList.value.length) return
+ if (total.value > securityUserList.value.length) {
current.value = current.value + 1
projectDetailsTable()
}
}
const initServiceProjectSecurityUserList = () => {
- projectData.value = []
+ securityUserList.value = []
total.value = null
current.value = 1 //重置
isRefresher.value = true
@@ -212,7 +215,7 @@ const initServiceProjectSecurityUserList = () => {
}
// 自定义下拉刷新被触发
-const onRefresherRefresh = (e) => {
+const onRefresherRefresh = () => {
initServiceProjectSecurityUserList()
}
@@ -225,55 +228,43 @@ const deleteUssrID = (snowFlakeId: string) => {
}
// 二次删除
const dialogOk = async () => {
- await api.delete(`/projectManageIndex/deleteSecurityUserByServiceProjectId`, {securityUserId: securityUserId.value}, {
- header: {
- "content-type": 'application/x-www-form-urlencoded'
- }
- })
+ await api.delete(`/projectManageIndex/deleteSecurityUserByServiceProjectId`, {securityUserId: securityUserId.value})
initServiceProjectSecurityUserList()
}
// 详情
-const detail = (item) => {
+const detail = (item: ServiceProjectSecurityUserPagerVo) => {
detailVisible.value = true
- content.value = item
+ securityUserDetail.value = item
}
-const projectEdit = (item) => {
+const securityUserEdit = (item: ServiceProjectSecurityUserPagerVo) => {
const params = {...item, sex: item.sex.value}
- Taro.navigateTo({url: `/subPages/pages/form/form?item=${JSON.stringify(params)}`})
+ Taro.navigateTo({url: `/subPages/projectManager/securityUserForm/securityUserForm?securityUser=${JSON.stringify(params)}&type=formInput`})
}
const qrCodeImage = ref('')
-const generateMiniProgramQRCode = ()=>{
- const params = {
- securityUnitId:serviceProjectDetails.value.securityUnitId,
- serviceProjectId:serviceProjectDetails.value.snowFlakeId
+const generateMiniProgramQRCode = async () => {
+ const paramsData = {
+ path: `/subPages/projectManager/securityUserForm/securityUserForm?uid=${serviceProject.value.securityUnitId}&pid=${serviceProject.value.snowFlakeId}&type=QcCodeInput`,
+ width: 200,
}
- const value = JSON.stringify(params)
- const paramsData = {
- path:`/subPages/pages/form/form?item=${value}&id=${2}`,
- width:200,
- }
- qrcodeVisible.value = true
- Taro.request({
- url: 'http://172.10.10.93:8765/projectManageIndex/shareForm_QR_Code',
- method:'GET',
- data:paramsData,
- responseType: 'arraybuffer',
- success(res) {
- const base64 = Taro.arrayBufferToBase64(res.data);
- qrCodeImage.value = 'data:image/jpeg;base64,' + base64
- }
- })
+ qrcodeVisible.value = true
+ const resp = await api.get('/projectManageIndex/shareForm_QR_Code', paramsData, {
+ header: {
+ "content-type": 'application/x-www-form-urlencoded'
+ },
+ responseType: 'arraybuffer'
+ })
+ qrCodeImage.value = 'data:image/jpeg;base64,' + Taro.arrayBufferToBase64(resp as unknown as ArrayBuffer);
+
}
-const showImage = ()=>{
+const showImage = () => {
showOverlay.value = true
qrcodeVisible.value = false
}
+
diff --git a/collect_information/src/subPages/projectManager/securityUserForm/securityUserForm.scss b/collect_information/src/subPages/projectManager/securityUserForm/securityUserForm.scss
new file mode 100644
index 0000000..4dd980a
--- /dev/null
+++ b/collect_information/src/subPages/projectManager/securityUserForm/securityUserForm.scss
@@ -0,0 +1,8 @@
+.form {
+ .formButton {
+ display: flex;
+ margin-top: auto;
+ justify-content: space-around;
+ margin-bottom: 30px
+ }
+}
diff --git a/collect_information/src/subPages/projectManager/securityUserForm/securityUserForm.ts b/collect_information/src/subPages/projectManager/securityUserForm/securityUserForm.ts
new file mode 100644
index 0000000..65ce4c0
--- /dev/null
+++ b/collect_information/src/subPages/projectManager/securityUserForm/securityUserForm.ts
@@ -0,0 +1,3 @@
+export default definePageConfig({
+ navigationBarTitleText: '项目人员录入',
+})
diff --git a/collect_information/src/subPages/pages/form/form.vue b/collect_information/src/subPages/projectManager/securityUserForm/securityUserForm.vue
similarity index 79%
rename from collect_information/src/subPages/pages/form/form.vue
rename to collect_information/src/subPages/projectManager/securityUserForm/securityUserForm.vue
index 012dc8f..98dadd5 100644
--- a/collect_information/src/subPages/pages/form/form.vue
+++ b/collect_information/src/subPages/projectManager/securityUserForm/securityUserForm.vue
@@ -17,7 +17,7 @@
{{
- dayjs(formData.dateOfBirth).isValid() ? dayjs(formData.dateOfBirth).format('YYYY-MM-DD') : '请选择出生年月'
+ formData.dateOfBirth ? dayjs(formData.dateOfBirth).format('YYYY-MM-DD') : '请选择出生年月'
}}
@@ -43,7 +43,7 @@
提交
- 重置表单
+ 重置表单
-
-
diff --git a/collect_information/src/utils/index.ts b/collect_information/src/utils/index.ts
index 6fab107..e69de29 100644
--- a/collect_information/src/utils/index.ts
+++ b/collect_information/src/utils/index.ts
@@ -1,67 +0,0 @@
-import Taro from "@tarojs/taro";
-
-
-/**
- * 授权综合逻辑
- * @param {*} scope 权限代表
- * @param {*} successCallback 成功回调
- * @param {*} failCallback 失败回调
- */
-export function pullAuth(scope, successCallback, failCallback) {
- const map = new Map([
- ['scope.userInfo', '用户信息'],
- ['scope.userLocation', '地理位置'],
- ['scope.userLocationBackground', '后台定位'],
- ['scope.address', '通信地址'],
- ['scope.record', '录音功能'],
- ['scope.writePhotosAlbum', '保存到相册'],
- ['scope.camera', '摄像头'],
- ['scope.invoice', '获取发票'],
- ['scope.invoiceTitle', '发票抬头'],
- ['scope.werun', '微信运动步数'],
- ])
- Taro.getSetting({
- success(res) {
- if (!res.authSetting[scope]) {
- Taro.authorize({
- scope,
- success(){ // 允许授权
- successCallback()
- },
- fail(){ // 拒绝授权
- if (map.has(scope)) {
- let word = map.get(scope)
- Taro.showModal({
- content:`检测到您没打开${word}权限,是否去设置打开?`,
- confirmText: "确认",
- cancelText:'取消',
- success: (res) => {
- if(res.confirm){
- Taro.openSetting({
- success: (res) => {
- successCallback()
- },
- fail: () => {
- failCallback()
- },
- })
- }else{
- failCallback()
- }
- }
- })
- } else {
- Taro.showToast({
- title: '无此授权功能'
- })
- failCallback()
- }
- }
- })
- } else {
- successCallback()
- }
- }
- })
-
-}
diff --git a/collect_information/tsconfig.json b/collect_information/tsconfig.json
index 39a09c5..91cfcd5 100644
--- a/collect_information/tsconfig.json
+++ b/collect_information/tsconfig.json
@@ -9,9 +9,9 @@
"noImplicitAny": false,
"allowSyntheticDefaultImports": true,
"outDir": "lib",
- "noUnusedLocals": false,
- "noUnusedParameters": false,
- "strictNullChecks": false,
+ "noUnusedLocals": true,
+ "noUnusedParameters": true,
+ "strictNullChecks": true,
"sourceMap": true,
"rootDir": ".",
"jsx": "preserve",
@@ -21,8 +21,12 @@
"node_modules/@types"
],
"paths": {
+ // TS5090 leading './'
"@/*": [
- "src/*"
+ "./src/*"
+ ],
+ "@/types/*": [
+ "./types/*"
]
}
},
diff --git a/collect_information/types/config/index.ts b/collect_information/types/config/index.ts
new file mode 100644
index 0000000..4069599
--- /dev/null
+++ b/collect_information/types/config/index.ts
@@ -0,0 +1,8 @@
+import Taro from "@tarojs/taro";
+
+export interface UserConfig {
+ /** 跳转的首页地址 **/
+ toIndex: string;
+ /** 身份对应的tabBar列表 **/
+ tabBarList: Taro.TabBarItem[]
+}
diff --git a/collect_information/types/global.d.ts b/collect_information/types/global.d.ts
index 8a62d44..e769f68 100644
--- a/collect_information/types/global.d.ts
+++ b/collect_information/types/global.d.ts
@@ -22,7 +22,8 @@ declare namespace NodeJS {
* @description 若不同环境有不同的小程序,可通过在 env 文件中配置环境变量`TARO_APP_ID`来方便快速切换 appid, 而不必手动去修改 dist/project.config.json 文件
* @see https://taro-docs.jd.com/docs/next/env-mode-config#特殊环境变量-taro_app_id
*/
- TARO_APP_ID: string,
+ TARO_APP_ID: string
+ /** 后台服务接口地址 **/
TARO_APP_BASE_API: string
}
}
@@ -31,18 +32,37 @@ declare module '@tarojs/components' {
export * from '@tarojs/components/types/index.vue3'
}
+/**
+ * 微信小程序用户身份
+ */
+type MiniProgramUserIdentity = 'police' | 'project_manager'
+
/**
* 选择
*/
-interface SelectNode {
- value: T,
- label: string,
- options?: SelectNode[]
- orderIndex?: number,
- disabled?: boolean,
- extData?: Record
+interface SelectNodeVo> {
+ value: T;
+ label: string;
+ orderIndex?: number;
+ disabled?: boolean;
+ extData?: E
}
+/**
+ * 树
+ */
+interface TreeNodeVo> {
+ value: T;
+ parentValue: T;
+ label: string;
+ orderIndex?: number;
+ children?: TreeNodeVo[]
+ extData?: E;
+}
+
+/**
+ * 全局状态返回
+ */
interface JsonResult {
code: number;
data?: T;
@@ -50,22 +70,28 @@ interface JsonResult {
}
/**
- * 树
+ * 分页对象
*/
-interface TreeNode {
- value: T,
- parentValue: T,
- label: string,
- orderIndex?: number,
- extData?: Record,
- children?: TreeNode[]
+interface PagerVo {
+ size: number,
+ total: number;
+ current: number;
+ records: T[]
}
-
-interface TokenInfo> {
+/**
+ * token信息
+ */
+interface TokenInfo {
+ /** token名称 **/
name: string;
+ /** token值 **/
value: string;
- extData?: T
+ /** 拓展属性 **/
+ extData: {
+ /** 身份 **/
+ identity: BaseEnum
+ }
}
/**
diff --git a/collect_information/types/pages/index/index.d.ts b/collect_information/types/pages/index/index.d.ts
deleted file mode 100644
index f2e0c2f..0000000
--- a/collect_information/types/pages/index/index.d.ts
+++ /dev/null
@@ -1,39 +0,0 @@
-interface PersonnelInformation {
- name: string,
- sex: number,
- dataOfBirth: Date | string,
- idCard: string,
- phone: string,
- householdRegistrationAddress: string,
- streetCommunitySmallCommunityIds: string[],
- buildingFloorHouseIds: string[]
-}
-
-interface EnterUserInfoSaveOrUpdateParams {
- snowFlakeId?: string,
-
- streetId?: string,
- communityId?: string,
- smallCommunityId?: string,
- buildingId?: string,
- floorId?: string,
- houseId?: string,
-
- name: string,
- sex: number,
- dateOfBirth?: Date | string
- idCard: string
- phone: string
- householdRegistrationAddress?: string
-
- optFlag: null | 0 | 1
-}
-
-interface SystemExitsPopulationInformationVo {
- snowFlakeId: string,
- name: string,
- sex: number,
- residentialDivisionDetail: string,
- createTime: string,
- createUserName: string
-}
diff --git a/collect_information/types/pages/login/index.d.ts b/collect_information/types/pages/login/index.d.ts
deleted file mode 100644
index cf4cc2c..0000000
--- a/collect_information/types/pages/login/index.d.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-interface LoginUserInfo {
- clientType?: string;
- avatar?: string;
-}
-
diff --git a/collect_information/types/pages/myProject/index.d.ts b/collect_information/types/pages/myProject/index.d.ts
deleted file mode 100644
index 8b4c210..0000000
--- a/collect_information/types/pages/myProject/index.d.ts
+++ /dev/null
@@ -1,45 +0,0 @@
- interface MyProjectList {
- item?:any,
- address?: string;
- city?: string;
- cityName?: string;
- contactPersonInfo:ContactPersonInfo;
- districts?: string;
- districtsName?: string;
- name: string;
- province?: string;
- provinceName: string;
- remark?: string;
- serviceProjectList: ServiceProjectList[];
- snowFlakeId?: string;
- securityUnitId:string;
- street?: string;
- streetName?:string;
-}
-
-interface ContactPersonInfo{
- name:string;
- telephone:string
-}
-
-interface ServiceProjectList {
- buildingTotal?: number;
- houseTotal?: number;
- idNumber?: string;
- isRecruitSecurity?: null;
- name?: string;
- remark?: string;
- securityUserTotal?: number;
- serviceArea?: number;
- snowFlakeId?: string;
- staffTotal?: number;
- type?:string;
- projectManagerMiniProgramUserInfo?:ProgramUserInfo
-}
-interface ProgramUserInfo{
- idCard: null
- name: string
- telephone: string
-}
-
-
diff --git a/collect_information/types/pages/projectDetails/index.d.ts b/collect_information/types/pages/projectDetails/index.d.ts
deleted file mode 100644
index 98ff724..0000000
--- a/collect_information/types/pages/projectDetails/index.d.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-interface Records{
- createTime?: string;
- dateOfBirth?: string;
- homeAddress?: string;
- idCard?: string;
- name?: string;
- nativePlace?: string;
- remark?: string;
- securityNumber?: string;
- securityUnitId?: string;
- securityUnitName?: string;
- serviceProjectId?: string;
- snowFlakeId:string;
- workPost?:string;
- sex?:Sex
-}
-interface ProjectData {
- current?:string;
- pages?:string;
- records?: Records[];
- size?: string;
- total?: string;
- data: Records[];
-}
-
-interface Sex {
- value:number,
- label:string
-}
diff --git a/collect_information/types/pages/register/index.d.ts b/collect_information/types/pages/register/index.d.ts
deleted file mode 100644
index f759fd7..0000000
--- a/collect_information/types/pages/register/index.d.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-interface RegisterParams {
- avatar: string;
- name: string;
- sex:number,
- telephone:string,
- identity: string;
- unitId: any
-}
diff --git a/collect_information/types/pages/register/index.ts b/collect_information/types/pages/register/index.ts
new file mode 100644
index 0000000..b840184
--- /dev/null
+++ b/collect_information/types/pages/register/index.ts
@@ -0,0 +1,8 @@
+export interface RegisterParams {
+ avatar: string;
+ name: string;
+ sex: number,
+ telephone: string,
+ identity: string;
+ unitId: string
+}
diff --git a/collect_information/types/request/index.d.ts b/collect_information/types/request/index.d.ts
deleted file mode 100644
index e137c22..0000000
--- a/collect_information/types/request/index.d.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-import Taro from "@tarojs/taro";
-
-export interface ApiOptions
- extends Omit<
- Taro.request.Option,
- "url" | "method" | "data" | "success" | "fail"
- > {
- loading?: boolean;
-}
diff --git a/collect_information/types/request/index.ts b/collect_information/types/request/index.ts
new file mode 100644
index 0000000..fb99bfd
--- /dev/null
+++ b/collect_information/types/request/index.ts
@@ -0,0 +1,5 @@
+import Taro from "@tarojs/taro";
+
+export interface ApiOptions extends Omit {
+ loading?: boolean;
+}
diff --git a/collect_information/types/subPages/projectManager/myProject/index.ts b/collect_information/types/subPages/projectManager/myProject/index.ts
new file mode 100644
index 0000000..bfeba41
--- /dev/null
+++ b/collect_information/types/subPages/projectManager/myProject/index.ts
@@ -0,0 +1,61 @@
+export interface MyProjectList {
+ item?: any,
+ address?: string;
+ city?: string;
+ cityName?: string;
+ contactPersonInfo: ContactPersonInfo;
+ districts?: string;
+ districtsName?: string;
+ name: string;
+ province?: string;
+ provinceName: string;
+ remark?: string;
+ serviceProjectList: ServiceProjectList[];
+ snowFlakeId?: string;
+ securityUnitId: string;
+ street?: string;
+ streetName?: string;
+}
+
+export interface ContactPersonInfo {
+ name: string;
+ telephone: string
+}
+
+export interface ServiceProjectList {
+ buildingTotal?: number;
+ houseTotal?: number;
+ idNumber?: string;
+ isRecruitSecurity?: null;
+ name?: string;
+ remark?: string;
+ securityUserTotal?: number;
+ serviceArea?: number;
+ snowFlakeId?: string;
+ staffTotal?: number;
+ type?: string;
+ projectManagerMiniProgramUserInfo?: ProgramUserInfo
+}
+
+export interface ProgramUserInfo {
+ idCard: null
+ name: string
+ telephone: string
+}
+
+export interface ServiceProjectSecurityUserPagerVo {
+ createTime?: string;
+ dateOfBirth?: string;
+ homeAddress?: string;
+ idCard?: string;
+ name?: string;
+ nativePlace?: string;
+ remark?: string;
+ securityNumber?: string;
+ securityUnitId?: string;
+ securityUnitName?: string;
+ serviceProjectId?: string;
+ snowFlakeId: string;
+ workPost?: string;
+ sex: BaseEnum
+}
diff --git a/collect_information/types/pages/form/index.d.ts b/collect_information/types/subPages/projectManager/securityUserForm/index.ts
similarity index 71%
rename from collect_information/types/pages/form/index.d.ts
rename to collect_information/types/subPages/projectManager/securityUserForm/index.ts
index 6c51ace..e02bb69 100644
--- a/collect_information/types/pages/form/index.d.ts
+++ b/collect_information/types/subPages/projectManager/securityUserForm/index.ts
@@ -1,6 +1,6 @@
-interface formDate {
+export interface SecurityUserFormParams {
snowFlakeId?: string;
- securityUnitId:string;
+ securityUnitId: string;
serviceProjectId: string;
name?: string;
workPost?: string;
@@ -8,7 +8,7 @@ interface formDate {
sex: number;
nativePlace?: string;
idCard: string;
- dateOfBirth?: Date;
+ dateOfBirth?: Date | null;
securityNumber?: string;
remark?: string;
homeAddress?: string
diff --git a/policeSecurityServer/src/main/java/com/changhu/config/WebConfig.java b/policeSecurityServer/src/main/java/com/changhu/config/WebConfig.java
index 0d429fc..8e7b4cb 100644
--- a/policeSecurityServer/src/main/java/com/changhu/config/WebConfig.java
+++ b/policeSecurityServer/src/main/java/com/changhu/config/WebConfig.java
@@ -41,6 +41,8 @@ public class WebConfig implements WebMvcConfigurer {
whiteList.add("/management/getCheckStatus");
//微信小程序注册
whiteList.add("/miniProgramUser/register");
+ //二维码表单录入保安人员
+ whiteList.add("/miniProgramUser/qrCodeFormInputSecurityUser");
}
@Override
diff --git a/policeSecurityServer/src/main/java/com/changhu/module/miniProgram/controller/MiniProgramUserController.java b/policeSecurityServer/src/main/java/com/changhu/module/miniProgram/controller/MiniProgramUserController.java
index 93e67d8..467439a 100644
--- a/policeSecurityServer/src/main/java/com/changhu/module/miniProgram/controller/MiniProgramUserController.java
+++ b/policeSecurityServer/src/main/java/com/changhu/module/miniProgram/controller/MiniProgramUserController.java
@@ -3,6 +3,7 @@ package com.changhu.module.miniProgram.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.changhu.common.annotation.JsonBody;
import com.changhu.module.miniProgram.pojo.params.MiniProgramUserRegisterParams;
+import com.changhu.module.miniProgram.pojo.params.SaveOrUpdateSecurityUserParams;
import com.changhu.module.miniProgram.pojo.queryParams.ServiceProjectSecurityUserPagerQueryParams;
import com.changhu.module.miniProgram.pojo.vo.ServiceProjectSecurityUserPagerVo;
import com.changhu.module.miniProgram.service.MiniProgramUserService;
@@ -34,6 +35,12 @@ public class MiniProgramUserController {
miniProgramUserService.register(params);
}
+ @Operation(summary = "二维码表单录入保安人员")
+ @PostMapping("/qrCodeFormInputSecurityUser")
+ public void qrCodeFormInputSecurityUser(@RequestBody @Valid SaveOrUpdateSecurityUserParams params) {
+ miniProgramUserService.qrCodeFormInputSecurityUser(params);
+ }
+
@Operation(summary = "服务项目保安人员分页")
@PostMapping("/securityUserPager")
public Page securityUserPager(@RequestBody PageParams queryParams) {
diff --git a/policeSecurityServer/src/main/java/com/changhu/module/miniProgram/controller/ProjectManageIndexController.java b/policeSecurityServer/src/main/java/com/changhu/module/miniProgram/controller/ProjectManageIndexController.java
index 9419b3a..b64d237 100644
--- a/policeSecurityServer/src/main/java/com/changhu/module/miniProgram/controller/ProjectManageIndexController.java
+++ b/policeSecurityServer/src/main/java/com/changhu/module/miniProgram/controller/ProjectManageIndexController.java
@@ -9,7 +9,11 @@ import com.changhu.module.miniProgram.service.ProjectManageIndexService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
+import jakarta.servlet.http.HttpServletResponse;
+import jakarta.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.io.Resource;
+import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@@ -42,7 +46,15 @@ public class ProjectManageIndexController {
@Operation(summary = "保存或更新保安人员")
@PostMapping("/saveOrUpdateSecurityUser")
- public void saveOrUpdateSecurityUser(@RequestBody SaveOrUpdateSecurityUserParams params) {
+ public void saveOrUpdateSecurityUser(@RequestBody @Valid SaveOrUpdateSecurityUserParams params) {
projectManageIndexService.saveOrUpdateSecurityUser(params);
}
+
+ @JsonBody(value = false)
+ @Operation(summary = "获取表单分享二维码")
+ @GetMapping(value = "/shareForm_QR_Code")
+ public ResponseEntity shareForm_QR_Code(@Schema(description = "要生成的路径") @RequestParam String path,
+ @Schema(description = "生成二维码的宽度") @RequestParam(defaultValue = "430") Integer width) {
+ return projectManageIndexService.shareForm_QR_Code(path, width);
+ }
}
diff --git a/policeSecurityServer/src/main/java/com/changhu/module/miniProgram/pojo/params/SaveOrUpdateSecurityUserParams.java b/policeSecurityServer/src/main/java/com/changhu/module/miniProgram/pojo/params/SaveOrUpdateSecurityUserParams.java
index 34ef398..0b4dc16 100644
--- a/policeSecurityServer/src/main/java/com/changhu/module/miniProgram/pojo/params/SaveOrUpdateSecurityUserParams.java
+++ b/policeSecurityServer/src/main/java/com/changhu/module/miniProgram/pojo/params/SaveOrUpdateSecurityUserParams.java
@@ -23,6 +23,10 @@ public class SaveOrUpdateSecurityUserParams {
@Schema(description = "服务项目id")
private Long serviceProjectId;
+ @NotNull(message = "保安单位不能为空")
+ @Schema(description = "保安单位id")
+ private Long securityUnitId;
+
@NotBlank(message = "名字不能为空")
@Schema(description = "名称")
private String name;
diff --git a/policeSecurityServer/src/main/java/com/changhu/module/miniProgram/pojo/vo/IndexServiceProjectListVo.java b/policeSecurityServer/src/main/java/com/changhu/module/miniProgram/pojo/vo/IndexServiceProjectListVo.java
index 961908a..ec5e49d 100644
--- a/policeSecurityServer/src/main/java/com/changhu/module/miniProgram/pojo/vo/IndexServiceProjectListVo.java
+++ b/policeSecurityServer/src/main/java/com/changhu/module/miniProgram/pojo/vo/IndexServiceProjectListVo.java
@@ -53,6 +53,8 @@ public class IndexServiceProjectListVo {
static class ServiceProjectVo {
@Schema(description = "服务项目id")
private Long snowFlakeId;
+ @Schema(description = "保安单位id")
+ private Long securityUnitId;
@Schema(description = "项目经理信息")
private Dict projectManagerMiniProgramUserInfo;
@Schema(description = "服务项目名称")
diff --git a/policeSecurityServer/src/main/java/com/changhu/module/miniProgram/service/MiniProgramUserService.java b/policeSecurityServer/src/main/java/com/changhu/module/miniProgram/service/MiniProgramUserService.java
index 536d1ed..543e642 100644
--- a/policeSecurityServer/src/main/java/com/changhu/module/miniProgram/service/MiniProgramUserService.java
+++ b/policeSecurityServer/src/main/java/com/changhu/module/miniProgram/service/MiniProgramUserService.java
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.changhu.module.miniProgram.pojo.entity.MiniProgramUser;
import com.changhu.module.miniProgram.pojo.params.MiniProgramUserRegisterParams;
+import com.changhu.module.miniProgram.pojo.params.SaveOrUpdateSecurityUserParams;
import com.changhu.module.miniProgram.pojo.queryParams.ServiceProjectSecurityUserPagerQueryParams;
import com.changhu.module.miniProgram.pojo.vo.ServiceProjectSecurityUserPagerVo;
import com.changhu.support.mybatisplus.pojo.params.PageParams;
@@ -29,4 +30,11 @@ public interface MiniProgramUserService extends IService {
* @return 保安人员
*/
Page securityUserPager(PageParams queryParams);
+
+ /**
+ * 二维码表单录入保安人员
+ *
+ * @param params 参数
+ */
+ void qrCodeFormInputSecurityUser(SaveOrUpdateSecurityUserParams params);
}
diff --git a/policeSecurityServer/src/main/java/com/changhu/module/miniProgram/service/ProjectManageIndexService.java b/policeSecurityServer/src/main/java/com/changhu/module/miniProgram/service/ProjectManageIndexService.java
index ca365ee..69c3f9d 100644
--- a/policeSecurityServer/src/main/java/com/changhu/module/miniProgram/service/ProjectManageIndexService.java
+++ b/policeSecurityServer/src/main/java/com/changhu/module/miniProgram/service/ProjectManageIndexService.java
@@ -2,6 +2,9 @@ package com.changhu.module.miniProgram.service;
import com.changhu.module.miniProgram.pojo.params.SaveOrUpdateSecurityUserParams;
import com.changhu.module.miniProgram.pojo.vo.IndexServiceProjectListVo;
+import jakarta.servlet.http.HttpServletResponse;
+import org.springframework.core.io.Resource;
+import org.springframework.http.ResponseEntity;
import java.util.List;
@@ -31,4 +34,9 @@ public interface ProjectManageIndexService {
* @param params 保安人员参数
*/
void saveOrUpdateSecurityUser(SaveOrUpdateSecurityUserParams params);
+
+ /**
+ * 分享表单录入的二维码
+ */
+ ResponseEntity shareForm_QR_Code(String path, Integer width);
}
diff --git a/policeSecurityServer/src/main/java/com/changhu/module/miniProgram/service/impl/MiniProgramUserServiceImpl.java b/policeSecurityServer/src/main/java/com/changhu/module/miniProgram/service/impl/MiniProgramUserServiceImpl.java
index 0c9b091..fb85ceb 100644
--- a/policeSecurityServer/src/main/java/com/changhu/module/miniProgram/service/impl/MiniProgramUserServiceImpl.java
+++ b/policeSecurityServer/src/main/java/com/changhu/module/miniProgram/service/impl/MiniProgramUserServiceImpl.java
@@ -13,9 +13,11 @@ import com.changhu.module.miniProgram.mapper.SecurityUserMapper;
import com.changhu.module.miniProgram.pojo.entity.MiniProgramUser;
import com.changhu.module.miniProgram.pojo.entity.SecurityUser;
import com.changhu.module.miniProgram.pojo.params.MiniProgramUserRegisterParams;
+import com.changhu.module.miniProgram.pojo.params.SaveOrUpdateSecurityUserParams;
import com.changhu.module.miniProgram.pojo.queryParams.ServiceProjectSecurityUserPagerQueryParams;
import com.changhu.module.miniProgram.pojo.vo.ServiceProjectSecurityUserPagerVo;
import com.changhu.module.miniProgram.service.MiniProgramUserService;
+import com.changhu.module.miniProgram.service.ProjectManageIndexService;
import com.changhu.support.mybatisplus.pojo.params.PageParams;
import me.chanjar.weixin.common.error.WxErrorException;
import org.springframework.beans.factory.annotation.Autowired;
@@ -35,6 +37,9 @@ public class MiniProgramUserServiceImpl extends ServiceImpl securityUserPager(PageParams queryParams) {
return securityUserMapper.securityUserPager(queryParams.getPage(), queryParams.getParams());
}
+
+ @Override
+ public void qrCodeFormInputSecurityUser(SaveOrUpdateSecurityUserParams params) {
+ projectManageIndexService.saveOrUpdateSecurityUser(params);
+ }
}
diff --git a/policeSecurityServer/src/main/java/com/changhu/module/miniProgram/service/impl/ProjectManageIndexServiceImpl.java b/policeSecurityServer/src/main/java/com/changhu/module/miniProgram/service/impl/ProjectManageIndexServiceImpl.java
index 50f784e..82ee67c 100644
--- a/policeSecurityServer/src/main/java/com/changhu/module/miniProgram/service/impl/ProjectManageIndexServiceImpl.java
+++ b/policeSecurityServer/src/main/java/com/changhu/module/miniProgram/service/impl/ProjectManageIndexServiceImpl.java
@@ -1,5 +1,7 @@
package com.changhu.module.miniProgram.service.impl;
+import cn.binarywang.wx.miniapp.api.WxMaQrcodeService;
+import cn.binarywang.wx.miniapp.api.WxMaService;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.extension.toolkit.Db;
import com.changhu.common.exception.MessageException;
@@ -10,9 +12,18 @@ import com.changhu.module.miniProgram.pojo.params.SaveOrUpdateSecurityUserParams
import com.changhu.module.miniProgram.pojo.vo.IndexServiceProjectListVo;
import com.changhu.module.miniProgram.service.ProjectManageIndexService;
import com.changhu.support.mybatisplus.pojo.entity.BaseEntity;
+import jakarta.servlet.http.HttpServletResponse;
+import lombok.extern.slf4j.Slf4j;
+import me.chanjar.weixin.common.error.WxErrorException;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.io.FileSystemResource;
+import org.springframework.core.io.Resource;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
+import java.io.*;
import java.util.List;
import java.util.Optional;
@@ -21,12 +32,16 @@ import java.util.Optional;
* @createTime 2024/9/10 下午3:50
* @desc ProjectManageIndexServiceImpl...
*/
+@Slf4j
@Service
public class ProjectManageIndexServiceImpl implements ProjectManageIndexService {
@Autowired
private ServiceProjectMapper serviceProjectMapper;
+ @Autowired
+ private WxMaService wxMaService;
+
@Override
public List getMyServiceProjectList() {
return serviceProjectMapper.getServiceProjectList(null, UserUtil.getUserId());
@@ -43,8 +58,6 @@ public class ProjectManageIndexServiceImpl implements ProjectManageIndexService
@Override
public void saveOrUpdateSecurityUser(SaveOrUpdateSecurityUserParams params) {
SecurityUser securityUser = BeanUtil.copyProperties(params, SecurityUser.class);
- //填充保安单位
- securityUser.setSecurityUnitId(UserUtil.getUnitId());
//新增的情况
Long snowFlakeId = securityUser.getSnowFlakeId();
if (snowFlakeId == null) {
@@ -74,4 +87,18 @@ public class ProjectManageIndexServiceImpl implements ProjectManageIndexService
throw new MessageException();
}
}
+
+ @Override
+ public ResponseEntity shareForm_QR_Code(String path, Integer width) {
+ WxMaQrcodeService qrcodeService = wxMaService.getQrcodeService();
+ try {
+ File qrcodeFile = qrcodeService.createQrcode(path, width);
+ return ResponseEntity.ok()
+ .header(HttpHeaders.CONTENT_DISPOSITION, "attachment;filename=" + qrcodeFile.getName())
+ .contentType(MediaType.APPLICATION_OCTET_STREAM)
+ .body(new FileSystemResource(qrcodeFile));
+ } catch (WxErrorException e) {
+ throw new MessageException("生成表单二维码失败:{}", e.getMessage());
+ }
+ }
}
diff --git a/policeSecurityServer/src/main/resources/env/dev/application.yml b/policeSecurityServer/src/main/resources/env/dev/application.yml
index d108324..b52c328 100644
--- a/policeSecurityServer/src/main/resources/env/dev/application.yml
+++ b/policeSecurityServer/src/main/resources/env/dev/application.yml
@@ -90,10 +90,10 @@ spring:
cache-names: common
data:
redis:
- database: 10
- password: lonsung301
+ database: 1
+ password: redis_csPDNr
port: 6380
- host: 172.10.10.238
+ host: 118.253.177.137
timeout: 10s
lettuce:
pool:
@@ -144,9 +144,9 @@ sa-token:
wx:
miniapp:
#微信小程序的appid
- appid: wx8902ddbfddb820d1
+ appid: wx0acd1c4fcf94bdd3
#微信小程序的Secret
- secret: 8674decea33df3362245937444944596
+ secret: 4b700dbacb42ef258537ddc61d964a17
msgDataFormat: JSON
project:
diff --git a/policeSecurityServer/src/main/resources/mapper/ServiceProjectMapper.xml b/policeSecurityServer/src/main/resources/mapper/ServiceProjectMapper.xml
index b18db61..c770498 100644
--- a/policeSecurityServer/src/main/resources/mapper/ServiceProjectMapper.xml
+++ b/policeSecurityServer/src/main/resources/mapper/ServiceProjectMapper.xml
@@ -48,6 +48,7 @@
ad4.name as 'streetName',
JSON_ARRAYAGG(JSON_OBJECT(
'snowFlakeId', sp.snow_flake_id,
+ 'securityUnitId',sp.security_unit_id,
'name', sp.name,
'type', sp.type,
'isRecruitSecurity', sp.is_recruit_security,
diff --git a/securityManagement/src/main.ts b/securityManagement/src/main.ts
index ed5c439..a2ab554 100644
--- a/securityManagement/src/main.ts
+++ b/securityManagement/src/main.ts
@@ -2,11 +2,12 @@ import {createApp} from 'vue'
import App from '@/App.vue'
import '@/reset.css'
import './index.css'
+
+// iconfont css
+import "@/assets/iconfont/iconfont.css";
// 公共样式
import '@/assets/scss/common.scss'
import '@/assets/scss/myAntD.scss'
-// iconfont css
-import "@/assets/iconfont/iconfont.css";
// vue Router
import router from "@/router";
// pinia stores
diff --git a/securityManagement/src/views/serviceManagement/index.vue b/securityManagement/src/views/serviceManagement/index.vue
index 817c081..bb325e2 100644
--- a/securityManagement/src/views/serviceManagement/index.vue
+++ b/securityManagement/src/views/serviceManagement/index.vue
@@ -126,17 +126,17 @@ const columns: TableProps['columns'] = [
dataIndex:'isRecruitSecurity',
title: '是否自招保安',
customRender: ({text}) => {text?.label},
- width:100
+ width:120
},
{
dataIndex:'idNumber',
- title: '证件号',
+ title: '保安服务许可证',
width:170
},
{
dataIndex:'serviceArea',
title:'服务区域面积',
- width:100
+ width:120
},
{
dataIndex:'buildingTotal',
@@ -151,17 +151,17 @@ const columns: TableProps['columns'] = [
{
dataIndex:'staffTotal',
title:'工作人员数量',
- width:100
+ width:120
},
{
dataIndex:'securityUserTotal',
title:'保安人员数量',
- width:100
+ width:120
},
{
dataIndex:'createUserName',
title:'创建人名称',
- width:100
+ width:110
},
{
dataIndex: 'createTime',
@@ -190,7 +190,7 @@ const columns: TableProps['columns'] = [
message.success(resp.message)
await tableRef.value?.requestGetTableData()
}}>
- 删除
+ 删除
{
// console.log(record)
@@ -275,6 +275,7 @@ const formItemOptions = ref
}
- return
- {
- const resp = await api.post('/management/disableOrEnableMiniProgramUser', {
- dataId: record.snowFlakeId,
- unitOptType: UNIT_TYPE.security
- })
- message.success(resp.message)
- await tableRef.value?.requestGetTableData()
- }}
- >{record.isEnable.value === 0 ? '禁用' : '启用'}
-
-
+ return (
+ record.isEnable.value === 0? {
+ const resp = await api.post('/management/disableOrEnableMiniProgramUser', {
+ dataId: record.snowFlakeId,
+ unitOptType: UNIT_TYPE.security
+ })
+ message.success(resp.message)
+ await tableRef.value?.requestGetTableData()
+ }}
+ >{record.isEnable.value === 0 ? '禁用' : '启用'}
+ : {
+ const resp = await api.post('/management/disableOrEnableMiniProgramUser', {
+ dataId: record.snowFlakeId,
+ unitOptType: UNIT_TYPE.security
+ })
+ message.success(resp.message)
+ await tableRef.value?.requestGetTableData()
+ }}
+ >{record.isEnable.value === 0 ? '禁用' : '启用'}
+
+ )
}
},
]