Browse Source

项目备份

admin_zwk
zhaowenkang 5 months ago
parent
commit
a6f9461493
  1. 3
      work/.vscode/extensions.json
  2. 520
      work/package-lock.json
  3. 3
      work/package.json
  4. 17
      work/src/api/AddWorkApi.js
  5. 20
      work/src/api/ClassListApi.js
  6. 16
      work/src/api/index.js
  7. BIN
      work/src/assets/login/denglu.png
  8. BIN
      work/src/assets/login/mima.png
  9. 30
      work/src/router/index.js
  10. 359
      work/src/views/AddWork.vue
  11. 270
      work/src/views/AddWorkView.vue
  12. 110
      work/src/views/HomeView.vue
  13. 211
      work/src/views/HomeWork.vue
  14. 109
      work/src/views/Login.vue
  15. 10
      work/src/views/LoginView.vue
  16. 476
      work/src/views/UpdateWork.vue
  17. 265
      work/src/views/WorkDetail.vue
  18. 15
      work/vite.config.js

3
work/.vscode/extensions.json

@ -1,3 +0,0 @@
{
"recommendations": ["Vue.volar"]
}

520
work/package-lock.json

@ -9,15 +9,18 @@
"version": "0.0.0",
"dependencies": {
"axios": "^1.7.9",
"dayjs": "^1.11.13",
"echart": "^0.1.3",
"echarts": "^5.5.1",
"element-plus": "^2.9.0",
"elements": "^0.6.0",
"pinia": "^2.2.6",
"vue": "^3.5.13",
"vue-router": "^4.4.5"
},
"devDependencies": {
"@vitejs/plugin-vue": "^5.2.1",
"sass-embedded": "^1.83.0",
"vite": "^6.0.1",
"vite-plugin-vue-devtools": "^7.6.5"
}
@ -491,6 +494,13 @@
"node": ">=6.9.0"
}
},
"node_modules/@bufbuild/protobuf": {
"version": "2.2.3",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/@bufbuild/protobuf/-/protobuf-2.2.3.tgz",
"integrity": "sha512-tFQoXHJdkEOSwj5tRIZSPNUuXK3RaR7T1nUrPgbYX1pUbvqqaaZAsfo+NXBPsz5rZMSKVFrgK1WL8Q/MSLvprg==",
"dev": true,
"license": "(Apache-2.0 AND BSD-3-Clause)"
},
"node_modules/@ctrl/tinycolor": {
"version": "3.6.1",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/@ctrl/tinycolor/-/tinycolor-3.6.1.tgz",
@ -1690,6 +1700,13 @@
"node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7"
}
},
"node_modules/buffer-builder": {
"version": "0.2.0",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/buffer-builder/-/buffer-builder-0.2.0.tgz",
"integrity": "sha512-7VPMEPuYznPSoR21NE1zvd2Xna6c/CloiZCfcMXR1Jny6PjX0N4Nsa38zcBFo/FMK+BlA+FLKbJCQ0i2yxp+Xg==",
"dev": true,
"license": "MIT/X11"
},
"node_modules/bundle-name": {
"version": "4.1.0",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/bundle-name/-/bundle-name-4.1.0.tgz",
@ -1750,6 +1767,13 @@
"node": ">= 0.12.0"
}
},
"node_modules/colorjs.io": {
"version": "0.5.2",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/colorjs.io/-/colorjs.io-0.5.2.tgz",
"integrity": "sha512-twmVoizEW7ylZSN32OgKdXRmo1qg+wT5/6C3xu5b9QsWzSFAhHLn2xd8ro0diCsKfCj1RdaTP/nrcW+vAoQPIw==",
"dev": true,
"license": "MIT"
},
"node_modules/combined-stream": {
"version": "1.0.8",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/combined-stream/-/combined-stream-1.0.8.tgz",
@ -2007,6 +2031,20 @@
"vue": "^3.2.0"
}
},
"node_modules/elements": {
"version": "0.6.0",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/elements/-/elements-0.6.0.tgz",
"integrity": "sha512-i/PEUAMJxPcjk03mUD0ihNmnutoc/c6/gPJ3rKR8ETIZNCVAavrWPcoVX8HmEzKqY1SBLZulAQMM6nF5a6oWRg==",
"license": "MIT (http://mootools.net/license.txt)",
"dependencies": {
"mout": "^0.11.0",
"prime": "^0.5.0",
"slick": "^1.12.2"
},
"engines": {
"node": "*"
}
},
"node_modules/encodeurl": {
"version": "1.0.2",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/encodeurl/-/encodeurl-1.0.2.tgz",
@ -2260,6 +2298,16 @@
"dev": true,
"license": "ISC"
},
"node_modules/has-flag": {
"version": "4.0.0",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=8"
}
},
"node_modules/has-symbols": {
"version": "1.1.0",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/has-symbols/-/has-symbols-1.1.0.tgz",
@ -2355,6 +2403,13 @@
"node": ">=18.18.0"
}
},
"node_modules/immutable": {
"version": "5.0.3",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/immutable/-/immutable-5.0.3.tgz",
"integrity": "sha512-P8IdPQHq3lA1xVeBRi5VPqUm5HDgKnx0Ru51wZz5mjxHr5n3RWhjIpOFU7ybkUxfB+5IToy+OLaHYDBIWsv+uw==",
"dev": true,
"license": "MIT"
},
"node_modules/inherits": {
"version": "2.0.4",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/inherits/-/inherits-2.0.4.tgz",
@ -2740,6 +2795,12 @@
"dev": true,
"license": "MIT"
},
"node_modules/mout": {
"version": "0.11.1",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/mout/-/mout-0.11.1.tgz",
"integrity": "sha512-pK9VNiLE3QgGBrC/3ICAscwOLU7oTNeK2l32uqNAioBYtB2tQAfSsGDNChUlk7CP23126mc5lUt6+na9FlN8JA==",
"license": "MIT"
},
"node_modules/mrmime": {
"version": "2.0.0",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/mrmime/-/mrmime-2.0.0.tgz",
@ -3002,6 +3063,15 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/prime": {
"version": "0.5.0",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/prime/-/prime-0.5.0.tgz",
"integrity": "sha512-Ic75Ki5IFgotMS4QFgalL/xw/s1Zg3Flp4IzOjaq3ZldB2x/Lc5HvbAOkMb4GA8T1iIhtWBTbxAWpZxu9UJQeA==",
"license": "MIT",
"dependencies": {
"mout": "^0.11.0"
}
},
"node_modules/proxy-from-env": {
"version": "1.1.0",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
@ -3066,6 +3136,16 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/rxjs": {
"version": "7.8.1",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/rxjs/-/rxjs-7.8.1.tgz",
"integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==",
"dev": true,
"license": "Apache-2.0",
"dependencies": {
"tslib": "^2.1.0"
}
},
"node_modules/safe-buffer": {
"version": "5.2.1",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/safe-buffer/-/safe-buffer-5.2.1.tgz",
@ -3086,6 +3166,391 @@
],
"license": "MIT"
},
"node_modules/sass-embedded": {
"version": "1.83.0",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/sass-embedded/-/sass-embedded-1.83.0.tgz",
"integrity": "sha512-/8cYZeL39evUqe0o//193na51Q1VWZ61qhxioQvLJwOtWIrX+PgNhCyD8RSuTtmzc4+6+waFZf899bfp/MCUwA==",
"dev": true,
"license": "MIT",
"dependencies": {
"@bufbuild/protobuf": "^2.0.0",
"buffer-builder": "^0.2.0",
"colorjs.io": "^0.5.0",
"immutable": "^5.0.2",
"rxjs": "^7.4.0",
"supports-color": "^8.1.1",
"sync-child-process": "^1.0.2",
"varint": "^6.0.0"
},
"bin": {
"sass": "dist/bin/sass.js"
},
"engines": {
"node": ">=16.0.0"
},
"optionalDependencies": {
"sass-embedded-android-arm": "1.83.0",
"sass-embedded-android-arm64": "1.83.0",
"sass-embedded-android-ia32": "1.83.0",
"sass-embedded-android-riscv64": "1.83.0",
"sass-embedded-android-x64": "1.83.0",
"sass-embedded-darwin-arm64": "1.83.0",
"sass-embedded-darwin-x64": "1.83.0",
"sass-embedded-linux-arm": "1.83.0",
"sass-embedded-linux-arm64": "1.83.0",
"sass-embedded-linux-ia32": "1.83.0",
"sass-embedded-linux-musl-arm": "1.83.0",
"sass-embedded-linux-musl-arm64": "1.83.0",
"sass-embedded-linux-musl-ia32": "1.83.0",
"sass-embedded-linux-musl-riscv64": "1.83.0",
"sass-embedded-linux-musl-x64": "1.83.0",
"sass-embedded-linux-riscv64": "1.83.0",
"sass-embedded-linux-x64": "1.83.0",
"sass-embedded-win32-arm64": "1.83.0",
"sass-embedded-win32-ia32": "1.83.0",
"sass-embedded-win32-x64": "1.83.0"
}
},
"node_modules/sass-embedded-android-arm": {
"version": "1.83.0",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/sass-embedded-android-arm/-/sass-embedded-android-arm-1.83.0.tgz",
"integrity": "sha512-uwFSXzJlfbd4Px189xE5l+cxN8+TQpXdQgJec7TIrb4HEY7imabtpYufpVdqUVwT1/uiis5V4+qIEC4Vl5XObQ==",
"cpu": [
"arm"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"android"
],
"engines": {
"node": ">=14.0.0"
}
},
"node_modules/sass-embedded-android-arm64": {
"version": "1.83.0",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/sass-embedded-android-arm64/-/sass-embedded-android-arm64-1.83.0.tgz",
"integrity": "sha512-GBiCvM4a2rkWBLdYDxI6XYnprfk5U5c81g69RC2X6kqPuzxzx8qTArQ9M6keFK4+iDQ5N9QTwFCr0KbZTn+ZNQ==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"android"
],
"engines": {
"node": ">=14.0.0"
}
},
"node_modules/sass-embedded-android-ia32": {
"version": "1.83.0",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/sass-embedded-android-ia32/-/sass-embedded-android-ia32-1.83.0.tgz",
"integrity": "sha512-5ATPdGo2SICqAhiJl/Z8KQ23zH4sGgobGgux0TnrNtt83uHZ+r+To/ubVJ7xTkZxed+KJZnIpolGD8dQyQqoTg==",
"cpu": [
"ia32"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"android"
],
"engines": {
"node": ">=14.0.0"
}
},
"node_modules/sass-embedded-android-riscv64": {
"version": "1.83.0",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/sass-embedded-android-riscv64/-/sass-embedded-android-riscv64-1.83.0.tgz",
"integrity": "sha512-aveknUOB8GZewOzVn2Uwk+DKcncTR50Q6vtzslNMGbYnxtgQNHzy8A1qVEviNUruex+pHofppeMK4iMPFAbiEQ==",
"cpu": [
"riscv64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"android"
],
"engines": {
"node": ">=14.0.0"
}
},
"node_modules/sass-embedded-android-x64": {
"version": "1.83.0",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/sass-embedded-android-x64/-/sass-embedded-android-x64-1.83.0.tgz",
"integrity": "sha512-WqIay/72ncyf9Ph4vS742J3a73wZihWmzFUwpn1OD6lme1Aj4eWzWIve5IVnlTEJgcZcDHu6ECID9IZgehJKoA==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"android"
],
"engines": {
"node": ">=14.0.0"
}
},
"node_modules/sass-embedded-darwin-arm64": {
"version": "1.83.0",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/sass-embedded-darwin-arm64/-/sass-embedded-darwin-arm64-1.83.0.tgz",
"integrity": "sha512-XQl9QqgxFFIPm/CzHhmppse5o9ocxrbaAdC2/DAnlAqvYWBBtgFqPjGoYlej13h9SzfvNoogx+y9r+Ap+e+hYg==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": ">=14.0.0"
}
},
"node_modules/sass-embedded-darwin-x64": {
"version": "1.83.0",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/sass-embedded-darwin-x64/-/sass-embedded-darwin-x64-1.83.0.tgz",
"integrity": "sha512-ERQ7Tvp1kFOW3ux4VDFIxb7tkYXHYc+zJpcrbs0hzcIO5ilIRU2tIOK1OrNwrFO6Qxyf7AUuBwYKLAtIU/Nz7g==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": ">=14.0.0"
}
},
"node_modules/sass-embedded-linux-arm": {
"version": "1.83.0",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/sass-embedded-linux-arm/-/sass-embedded-linux-arm-1.83.0.tgz",
"integrity": "sha512-baG9RYBJxUFmqwDNC9h9ZFElgJoyO3jgHGjzEZ1wHhIS9anpG+zZQvO8bHx3dBpKEImX+DBeLX+CxsFR9n81gQ==",
"cpu": [
"arm"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=14.0.0"
}
},
"node_modules/sass-embedded-linux-arm64": {
"version": "1.83.0",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/sass-embedded-linux-arm64/-/sass-embedded-linux-arm64-1.83.0.tgz",
"integrity": "sha512-syEAVTJt4qhaMLxrSwOWa46zdqHJdnqJkLUK+t9aCr8xqBZLPxSUeIGji76uOehQZ1C+KGFj6n9xstHN6wzOJw==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=14.0.0"
}
},
"node_modules/sass-embedded-linux-ia32": {
"version": "1.83.0",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/sass-embedded-linux-ia32/-/sass-embedded-linux-ia32-1.83.0.tgz",
"integrity": "sha512-RRBxQxMpoxu5+XcSSc6QR/o9asEwUzR8AbCS83RaXcdTIHTa/CccQsiAoDDoPlRsMTLqnzs0LKL4CfOsf7zBbA==",
"cpu": [
"ia32"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=14.0.0"
}
},
"node_modules/sass-embedded-linux-musl-arm": {
"version": "1.83.0",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/sass-embedded-linux-musl-arm/-/sass-embedded-linux-musl-arm-1.83.0.tgz",
"integrity": "sha512-Yc7u2TelCfBab+PRob9/MNJFh3EooMiz4urvhejXkihTiKSHGCv5YqDdtWzvyb9tY2Jb7YtYREVuHwfdVn3dTQ==",
"cpu": [
"arm"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=14.0.0"
}
},
"node_modules/sass-embedded-linux-musl-arm64": {
"version": "1.83.0",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/sass-embedded-linux-musl-arm64/-/sass-embedded-linux-musl-arm64-1.83.0.tgz",
"integrity": "sha512-Y7juhPHClUO2H5O+u+StRy6SEAcwZ+hTEk5WJdEmo1Bb1gDtfHvJaWB/iFZJ2tW0W1e865AZeUrC4OcOFjyAQA==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=14.0.0"
}
},
"node_modules/sass-embedded-linux-musl-ia32": {
"version": "1.83.0",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/sass-embedded-linux-musl-ia32/-/sass-embedded-linux-musl-ia32-1.83.0.tgz",
"integrity": "sha512-arQeYwGmwXV8byx5G1PtSzZWW1jbkfR5qrIHMEbTFSAvAxpqjgSvCvrHMOFd73FcMxVaYh4BX9LQNbKinkbEdg==",
"cpu": [
"ia32"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=14.0.0"
}
},
"node_modules/sass-embedded-linux-musl-riscv64": {
"version": "1.83.0",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/sass-embedded-linux-musl-riscv64/-/sass-embedded-linux-musl-riscv64-1.83.0.tgz",
"integrity": "sha512-E6uzlIWz59rut+Z3XR6mLG915zNzv07ISvj3GUNZENdHM7dF8GQ//ANoIpl5PljMQKp89GnYdvo6kj2gnaBf/g==",
"cpu": [
"riscv64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=14.0.0"
}
},
"node_modules/sass-embedded-linux-musl-x64": {
"version": "1.83.0",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/sass-embedded-linux-musl-x64/-/sass-embedded-linux-musl-x64-1.83.0.tgz",
"integrity": "sha512-eAMK6tyGqvqr21r9g8BnR3fQc1rYFj85RGduSQ3xkITZ6jOAnOhuU94N5fwRS852Hpws0lXhET+7JHXgg3U18w==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=14.0.0"
}
},
"node_modules/sass-embedded-linux-riscv64": {
"version": "1.83.0",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/sass-embedded-linux-riscv64/-/sass-embedded-linux-riscv64-1.83.0.tgz",
"integrity": "sha512-Ojpi78pTv02sy2fUYirRGXHLY3fPnV/bvwuC2i5LwPQw2LpCcFyFTtN0c5h4LJDk9P6wr+/ZB/JXU8tHIOlK+Q==",
"cpu": [
"riscv64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=14.0.0"
}
},
"node_modules/sass-embedded-linux-x64": {
"version": "1.83.0",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/sass-embedded-linux-x64/-/sass-embedded-linux-x64-1.83.0.tgz",
"integrity": "sha512-3iLjlXdoPfgZRtX4odhRvka1BQs5mAXqfCtDIQBgh/o0JnGPzJIWWl9bYLpHxK8qb+uyVBxXYgXpI0sCzArBOw==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=14.0.0"
}
},
"node_modules/sass-embedded-win32-arm64": {
"version": "1.83.0",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/sass-embedded-win32-arm64/-/sass-embedded-win32-arm64-1.83.0.tgz",
"integrity": "sha512-iOHw/8/t2dlTW3lOFwG5eUbiwhEyGWawivlKWJ8lkXH7fjMpVx2VO9zCFAm8RvY9xOHJ9sf1L7g5bx3EnNP9BQ==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">=14.0.0"
}
},
"node_modules/sass-embedded-win32-ia32": {
"version": "1.83.0",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/sass-embedded-win32-ia32/-/sass-embedded-win32-ia32-1.83.0.tgz",
"integrity": "sha512-2PxNXJ8Pad4geVcTXY4rkyTr5AwbF8nfrCTDv0ulbTvPhzX2mMKEGcBZUXWn5BeHZTBc6whNMfS7d5fQXR9dDQ==",
"cpu": [
"ia32"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">=14.0.0"
}
},
"node_modules/sass-embedded-win32-x64": {
"version": "1.83.0",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/sass-embedded-win32-x64/-/sass-embedded-win32-x64-1.83.0.tgz",
"integrity": "sha512-muBXkFngM6eLTNqOV0FQi7Dv9s+YRQ42Yem26mosdan/GmJQc81deto6uDTgrYn+bzFNmiXcOdfm+0MkTWK3OQ==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">=14.0.0"
}
},
"node_modules/semver": {
"version": "6.3.1",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/semver/-/semver-6.3.1.tgz",
@ -3153,6 +3618,15 @@
"node": ">=18"
}
},
"node_modules/slick": {
"version": "1.12.2",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/slick/-/slick-1.12.2.tgz",
"integrity": "sha512-4qdtOGcBjral6YIBCWJ0ljFSKNLz9KkhbWtuGvUyRowl1kxfuE1x/Z/aJcaiilpb3do9bl5K7/1h9XC5wWpY/A==",
"license": "MIT (http://mootools.net/license.txt)",
"engines": {
"node": "*"
}
},
"node_modules/source-map-js": {
"version": "1.2.1",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/source-map-js/-/source-map-js-1.2.1.tgz",
@ -3207,12 +3681,51 @@
"node": ">=16"
}
},
"node_modules/supports-color": {
"version": "8.1.1",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/supports-color/-/supports-color-8.1.1.tgz",
"integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==",
"dev": true,
"license": "MIT",
"dependencies": {
"has-flag": "^4.0.0"
},
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/chalk/supports-color?sponsor=1"
}
},
"node_modules/svg-tags": {
"version": "1.0.0",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/svg-tags/-/svg-tags-1.0.0.tgz",
"integrity": "sha512-ovssysQTa+luh7A5Weu3Rta6FJlFBBbInjOh722LIt6klpU2/HtdUbszju/G4devcvk8PGt7FCLv5wftu3THUA==",
"dev": true
},
"node_modules/sync-child-process": {
"version": "1.0.2",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/sync-child-process/-/sync-child-process-1.0.2.tgz",
"integrity": "sha512-8lD+t2KrrScJ/7KXCSyfhT3/hRq78rC0wBFqNJXv3mZyn6hW2ypM05JmlSvtqRbeq6jqA94oHbxAr2vYsJ8vDA==",
"dev": true,
"license": "MIT",
"dependencies": {
"sync-message-port": "^1.0.0"
},
"engines": {
"node": ">=16.0.0"
}
},
"node_modules/sync-message-port": {
"version": "1.1.3",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/sync-message-port/-/sync-message-port-1.1.3.tgz",
"integrity": "sha512-GTt8rSKje5FilG+wEdfCkOcLL7LWqpMlr2c3LRuKt/YXxcJ52aGSbGBAdI4L3aaqfrBt6y711El53ItyH1NWzg==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=16.0.0"
}
},
"node_modules/toidentifier": {
"version": "1.0.1",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/toidentifier/-/toidentifier-1.0.1.tgz",
@ -3320,6 +3833,13 @@
"integrity": "sha512-HXgFDgDommxn5/bIv0cnQZsPhHDA90NPHD6+c/v21U5+Sx5hoP8+dP9IZXBU1gIfvdRfhG8cel9QNPeionfcCQ==",
"license": "MIT"
},
"node_modules/varint": {
"version": "6.0.0",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/varint/-/varint-6.0.0.tgz",
"integrity": "sha512-cXEIW6cfr15lFv563k4GuVuW/fiwjknytD37jIOLSdSWuOI6WnO/oKwmP2FQTU2l01LP8/M5TSAJpzUaGe3uWg==",
"dev": true,
"license": "MIT"
},
"node_modules/vary": {
"version": "1.1.2",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/vary/-/vary-1.1.2.tgz",

3
work/package.json

@ -10,15 +10,18 @@
},
"dependencies": {
"axios": "^1.7.9",
"dayjs": "^1.11.13",
"echart": "^0.1.3",
"echarts": "^5.5.1",
"element-plus": "^2.9.0",
"elements": "^0.6.0",
"pinia": "^2.2.6",
"vue": "^3.5.13",
"vue-router": "^4.4.5"
},
"devDependencies": {
"@vitejs/plugin-vue": "^5.2.1",
"sass-embedded": "^1.83.0",
"vite": "^6.0.1",
"vite-plugin-vue-devtools": "^7.6.5"
}

17
work/src/api/AddWorkApi.js

@ -0,0 +1,17 @@
import service from ".";
const AddWorkApi={
//获取关联文章列表(关键字)
getArticleList(Name){
return service.post("/api/homework_manage/get-article-list",{Name});
},
//获取关联直播列表
getLiveList(){
return service.post("/api/homework_manage/get-live-list");
},
//添加作业
addWork(data){
return service.post("/api/homework_manage/add-homework",data);
},
}
export default AddWorkApi;

20
work/src/api/ClassListApi.js

@ -0,0 +1,20 @@
import service from ".";
const ClassListApi={
//获取作业列表
getClassList(PageNo,PageSize){
return service.post("/api/homework_manage/get-homework-list",{PageNo,PageSize})
},
//为了编辑,首先获取单个作业内容
getClassListOne(Id){
return service.post("/api/homework_manage/get-homework",{Id})
},
//获取作业详情
getWorkDetail(id,pageNo,pageSize){
return service.post("/api/homework_manage/getrecordlist",{id,pageNo,pageSize})
},
//编辑作业
editWork(data){
return service.post("/api/homework_manage/edit-homework",data)
},
}
export default ClassListApi;

16
work/src/api/index.js

@ -0,0 +1,16 @@
import axios from "axios";
const service = axios.create({
// baseURL: 'http://192.168.8.191:8080',
// baseURL: 'http://localhost:8080',
baseURL: '/api',
});
// http://192.168.8.191:8080
//Axios的响应拦截器..
service.interceptors.response.use(resp => {
return resp.data;
}, error => {
return Promise.reject(error);
});
export default service;

BIN
work/src/assets/login/denglu.png

After

Width: 200  |  Height: 200  |  Size: 3.5 KiB

BIN
work/src/assets/login/mima.png

After

Width: 200  |  Height: 200  |  Size: 3.5 KiB

30
work/src/router/index.js

@ -1,25 +1,37 @@
import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import LoginView from '../views/LoginView.vue'
import AddWorkView from '../views/AddWorkView.vue'
import Login from '../views/Login.vue'
import AddWork from '../views/AddWork.vue'
import WorkDetail from '../views/WorkDetail.vue'
import HomeWorkList from '../views/HomeWork.vue'
import UpdateWork from '../views/UpdateWork.vue'
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
history: createWebHistory(),
routes: [
{
path: '/',
name: 'login',
component: LoginView,
component: Login,
},
{
path: '/home',
name: 'home',
component: HomeView,
path: '/list',
name: 'homeWorklist',
component: HomeWorkList,
},
{
path:'/addwork',
name:'addwork',
component: AddWorkView
component: AddWork
},
{
path:'/workdetail/:id',
name:'workdetail',
component: WorkDetail
},
{
path:'/updatework/:id',
name:'updatework',
component: UpdateWork
}
]
})

359
work/src/views/AddWork.vue

@ -0,0 +1,359 @@
<template>
<div class="common-layout">
<el-container>
<el-header class="header">
<el-text class="header-text">抢点班作业后台管理</el-text>
<el-button class="header-button" type="primary" text style="float: right;">退出登录</el-button>
</el-header>
<el-main class="main">
<div class="main-title">
<div class="main-title-text" style="float: left;">
新建作业
</div>
<div>
<el-button class="main-button" @click="back">返回上一页</el-button>
</div>
</div>
<div class="main-back">
<el-form :model="form" label-width="auto" style="max-width: 700px" size="large">
<el-form-item label="作业名称">
<el-input v-model="form.Name" placeholder="请输入"></el-input>
</el-form-item>
<el-form-item label="提交时间" style="width: 70%">
<el-date-picker v-model="form.picker" type="daterange" range-separator="" start-placeholder="开始日期"
end-placeholder="结束日期" />
</el-form-item>
<el-form-item label="作业归属">
<el-select v-model="form.ClubType" placeholder="请选择" style="width: 100%">
<el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="关联文章">
<el-autocomplete v-model="articleTitle" :fetch-suggestions="queryArticleList" placeholder="请输入"
@select="handleSelectArticle" />
</el-form-item>
<el-form-item label="关联直播">
<el-select v-model="form.LiveId" placeholder="请选择" style="width: 100%">
<el-option v-for="item in live" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="选择类型">
<div>
<el-button type="primary" @click="addSingleChoice">添加单选</el-button>
<el-button type="primary" @click="addMultipleChoice">添加多选</el-button>
<el-button type="primary" @click="addBlank">添加单选填空</el-button>
</div>
</el-form-item>
<div class="question-container" v-for="(question, index) in questions" :key="index"
:class="{ 'bg-change': isHovered[index] }" @mouseenter="handleMouseEnter(index)"
@mouseleave="handleMouseLeave(index)">
<div class="question-title">
{{ questionPrefix(index) }} {{ getQuestionTypeText(question.type) }}
</div>
<div style="width: 600px;">
<el-input v-model="question.description" />
</div>
<div class="add" v-if="question.type !== 'blank'">
<div class="question-option">
<span>设置选项:</span>
<el-button type="primary" text @click="addOption(index)">添加</el-button>
</div>
<div v-for="(option, optionIndex) in question.content" :key="optionIndex">
<div class="select" style="display: flex;">
<div class="selection-item" style="display: flex;">
<div style="width: 550px;">
<el-input v-model="question.content[optionIndex].text" />
</div>
<div>
<el-button type="primary" text @click="removeOption(index, optionIndex)">删除</el-button>
</div>
</div>
</div>
</div>
<div class="delete" style="margin-left: 50px;">
<el-button type="info" plain @click="removeQuestion(index)">删除</el-button>
</div>
</div>
</div>
<div class="submit">
<el-button type="primary" :disabled="!form.Name||!form.picker" @click="onSubmit">确认</el-button>
</div>
</el-form>
</div>
</el-main>
</el-container>
</div>
</template>
<script lang="ts" setup>
import { ref, onMounted, computed } from 'vue'
import AddWorkApi from '../api/AddWorkApi';
import _ from 'lodash';
import dayjs from 'dayjs';
const options = ref([
{ id: 1, name: '牧民俱乐部' },
{ id: 2, name: '博古论坛' },
{ id: 3, name: '神枪手俱乐部' },
{ id: 4, name: '环球俱乐部' },
{ id: 5, name: '价值投资' },
{ id: 6, name: '波段行情' },
{ id: 7, name: '抄底卖顶' },
{ id: 8, name: '资金及仓位管理' },
{ id: 9, name: '财富的游戏' },
]);
// do not use same name with ref
const form = ref({
Name: '',
ClubType: '',
ArticleId: '',
LiveId: '',
picker: [],
StartDate: '',
EndDate: '',
Questions: []
});
const articleTitle = ref('');
//
const questions = ref([]);
const onSubmit = () => {
// picker
if (form.value.picker && form.value.picker.length === 2) {
const startDate = dayjs(form.value.picker[0]).format('YYYY-MM-DD HH:mm:00');
const endDate = dayjs(form.value.picker[1]).format('YYYY-MM-DD HH:mm:00');
form.value.StartDate = startDate;
form.value.EndDate = endDate;
}
form.value.Questions = questions.value;
AddWorkApi.addWork(form.value)
console.log(questions.value+'--------------')
}
const back = () => {
window.history.back()
}
//
const articleSearchResults = ref([]);
//
const queryArticleList = async (queryString: string) => {
try {
const response = await AddWorkApi.getArticleList(queryString);
const formattedResults = response.data.map(article => ({
value: article.title,
label: article.id
}));
articleSearchResults.value = formattedResults;
return formattedResults;
} catch (error) {
console.error('查询关联文章失败', error);
return [];
}
};
//
const handleSelectArticle = (article: { label: string }) => {
// idarticle.label使
console.log('选中的文章id', article.label);
form.value.ArticleId = article.label; // id
const selectedArticle = articleSearchResults.value.find(a => a.label === article.label);
if (selectedArticle) {
articleTitle.value = selectedArticle.value; //
}
};
//
const live = ref([]);
function getLive() {
AddWorkApi.getLiveList()
.then(res => {
live.value = res.data;
console.log(live.value);
})
.catch(error => {
console.error('获取直播列表失败', error)
})
}
getLive();
//
const getQuestionTypeText = (type) => {
switch (type) {
case 1:
return '作业题目(单选)';
case 2:
return '作业题目(多选)';
case 3:
return '作业题目(简答题)';
default:
return '未知类型题目';
}
};
// content
// const getOptionsFromContent = (content) => {
// return JSON.parse(content);
// };
const addSingleChoice = () => {
questions.value.push({
type: 1, // 1
description: '',
content: [{ "id": "", "text": "" },{ "id": "", "text": "" }]
});
};
const addMultipleChoice = () => {
questions.value.push({
type: 2, // 2
description: '',
content: [{ "id": "", "text": "" },{ "id": "", "text": "" }]
});
};
const addBlank = () => {
questions.value.push({
type: 3, // 3
description: '',
content: [{ "id": "", "text": "" }]
});
};
const addOption = (questionIndex) => {
const currentQuestion = questions.value[questionIndex];
const currentContent = JSON.parse(currentQuestion.content);
currentContent.push({ "id": "", "text": "" });
currentQuestion.content = JSON.stringify(currentContent);
};
const removeOption = (questionIndex, optionIndex) => {
const currentQuestion = questions.value[questionIndex];
const currentContent = JSON.parse(currentQuestion.content);
currentContent.splice(optionIndex, 1);
currentQuestion.content = JSON.stringify(currentContent);
};
const removeQuestion = (questionIndex) => {
questions.value.splice(questionIndex, 1);
};
//
const questionPrefix = computed(() => {
return (index) => {
return `${index + 1}`;
};
})
// false
const isHovered = ref(Array(questions.value.length).fill(false));
const handleMouseEnter = (index) => {
isHovered.value[index] = true;
};
const handleMouseLeave = (index) => {
isHovered.value[index] = false;
};
// `isHovered` `questions`
onMounted(() => {
isHovered.value = Array(questions.value.length).fill(false);
});
</script>
<style scoped>
.submit {
margin: 100px 212px;
}
.submit .el-button {
padding: 25px 150px;
}
.question-title {
transition: background-color 0.3s ease;
}
.bg-change {
background-color: rgba(200, 200, 200, 0.3);
}
.question-title {
margin-bottom: 10px;
}
.select {
margin: 10px 0px 0px;
}
.delete {
position: absolute;
right: 10px;
bottom: 0px;
}
.add {
position: relative;
}
.question-container {
margin: 20px 0;
padding: 10px 20px;
width: 750px;
border-bottom: 1px solid #e5e5e5;
}
.header {
height: 100px;
line-height: 100px;
padding: 0 80px;
}
.header-text {
font-size: 22px;
font-weight: 500;
color: black;
float: left;
}
.header-button {
margin-top: 30px;
}
.main {
padding: 30px 212px;
background-color: #F8F8F8;
}
.main-title {
font-size: 16px;
background-color: white;
font-weight: bold;
height: 60px;
border-bottom: 2px solid #ececec;
padding: 0 15px;
line-height: 52px;
}
.main-button {
margin: 10px 15px 0 0;
padding: 12px 20px;
height: 40px;
float: right;
}
.el-form {
padding: 30px 78.5px;
margin: auto;
}
.el-form-item {
--font-size: 16px;
margin: 0 0 25px;
}
.main-back {
background-color: white;
}
</style>

270
work/src/views/AddWorkView.vue

@ -1,270 +0,0 @@
<template>
<div class="common-layout">
<el-container>
<el-header class="header">
<el-text class="header-text">抢点班作业后台管理</el-text>
<el-button class="header-button" type="primary" text style="float: right;">退出登录</el-button>
</el-header>
<el-main class="main">
<div class="main-title">
<div class="main-title-text" style="float: left;">
新建作业
</div>
<div>
<el-button class="main-button" @click="back">返回上一页</el-button>
</div>
</div>
<div class="main-back">
<el-form :model="form" label-width="auto" style="max-width: 700px" size="large">
<el-form-item label="作业名称">
<el-input placeholder="请输入" />
</el-form-item>
<el-form-item label="提交时间" style="width: 70%">
<el-date-picker v-model="value" type="daterange" range-separator="" start-placeholder="开始日期"
end-placeholder="结束日期" />
</el-form-item>
<el-form-item label="作业归属">
<el-select v-model="value" placeholder="请选择" style="width: 100%">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="关联文章">
<el-input placeholder="请输入" />
</el-form-item>
<el-form-item label="关联直播">
<el-select v-model="value" placeholder="请选择" style="width: 100%">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="选择类型">
<div>
<el-button type="primary" @click="addSingleChoice">添加单选</el-button>
<el-button type="primary" @click="addMultipleChoice">添加多选</el-button>
<el-button type="primary" @click="addBlank">添加单选填空</el-button>
</div>
</el-form-item>
<div class="question-container" v-for="(question, index) in questions" :key="index">
{{ question.type === 'single' ? '作业题目(单选)' : (question.type === 'multiple' ? '作业题目(多选)' : '作业题目(简答题)')
}}
<div style="width: 600px;">
<el-input v-model="question.title" placeholder="作业题目" />
</div>
<div class="add" v-if="question.type !== 'blank'">
<el-form-item label="设置选项:">
<el-button type="primary" text @click="addOption(index)">添加</el-button>
</el-form-item>
<div v-for="(option, optionIndex) in question.options" :key="optionIndex">
<div class="select" style="display: flex;">
<div class="selection-item" style="display: flex;">
<div style="width: 550px;">
<el-input :value="option" @input="(e) => updateOption(index, optionIndex, e.target.value)" />
</div>
<div>
<el-button type="primary" text @click="removeOption(index, optionIndex)">删除</el-button>
</div>
</div>
</div>
</div>
<div class="delete" style="margin-left: 50px;">
<el-button type="info" plain @click="removeQuestion(index)">删除</el-button>
</div>
</div>
</div>
</el-form>
</div>
</el-main>
</el-container>
</div>
</template>
<script lang="ts" setup>
import { ref, onMounted } from 'vue'
import axios from 'axios'
import { reactive } from 'vue'
// do not use same name with ref
const form = reactive({
name: '',
region: '',
date1: '',
date2: '',
delivery: false,
type: [],
resource: '',
desc: '',
})
const onSubmit = () => {
console.log('submit!')
}
const back = () => {
window.history.back()
}
const value = ref('')
const options = [
{
value: '牧民俱乐部',
label: '牧民俱乐部',
},
{
value: '博股论坛',
label: '博股论坛',
},
{
value: '神枪手俱乐部',
label: '神枪手俱乐部',
},
{
value: '环球俱乐部',
label: '环球俱乐部',
},
{
value: '价值投资',
label: '价值投资',
},
{
value: '波段行情',
label: '波段行情',
},
{
value: '抄底卖顶',
label: '抄底卖顶',
},
{
value: '资金及仓位管理',
label: '资金及仓位管理',
},
{
value: '财富的游戏',
label: '财富的游戏',
},
]
const questions = ref([]);
const addSingleChoice = () => {
questions.value.push({
type: 'single',
title: '',
options: []
});
};
const addMultipleChoice = () => {
questions.value.push({
type: 'multiple',
title: '',
options: []
});
};
const addBlank = () => {
questions.value.push({
type: 'blank',
title: ''
});
};
const addOption = (questionIndex) => {
questions.value[questionIndex].options.push('');
};
const removeOption = (questionIndex, optionIndex) => {
questions.value[questionIndex].options.splice(optionIndex, 1);
};
const removeQuestion = (questionIndex) => {
questions.value.splice(questionIndex, 1);
};
const updateOption = (questionIndex, optionIndex, newValue) => {
questions.value[questionIndex].options[optionIndex] = newValue;
};
</script>
<style scoped>
.select{
margin: 20px 0px 0px;
}
.delete{
position: absolute;
right: 10px;
bottom: 0px;
}
.add{
position: relative;
}
.question-container {
margin: 20px 0;
padding: 10px 20px;
width: 750px;
border-bottom: 1px solid #e5e5e5;
}
.header {
height: 100px;
line-height: 100px;
padding: 0 80px;
}
.header-text {
font-size: 22px;
font-weight: 500;
color: black;
float: left;
}
.header-button {
margin-top: 30px;
}
.main {
padding: 30px 212px;
background-color: #F8F8F8;
}
.main-title {
font-size: 16px;
background-color: white;
font-weight: bold;
height: 60px;
border-bottom: 2px solid #ececec;
padding: 0 15px;
line-height: 52px;
}
.main-button {
margin: 10px 15px 0 0;
padding: 12px 20px;
height: 40px;
float: right;
}
.el-form {
padding: 30px 78.5px;
margin: auto;
}
.el-form-item {
--font-size: 16px;
margin: 0 0 25px;
}
.main-back {
background-color: white;
}
</style>

110
work/src/views/HomeView.vue

@ -1,110 +0,0 @@
<template>
<div class="common-layout">
<el-container>
<el-header class="header">
<el-text class="header-text">抢点班作业后台管理</el-text>
<el-button class="header-button" type="primary" text style="float: right;">退出登录</el-button>
</el-header>
<el-main class="main">
<div class="main-title">
抢点班作业列表
</div>
<div class="list">
<el-button class="main-button" type="primary" style="float: left;" @click="newAssignment">新建作业</el-button>
<el-table :data="assignments" style="width: 100%">
<el-table-column prop="id" label="序号" width="80"></el-table-column>
<el-table-column prop="name" label="作业名称"></el-table-column>
<el-table-column prop="contentSummary" label="内容概要"></el-table-column>
<el-table-column prop="relatedArticle" label="关联文章"></el-table-column>
<el-table-column prop="relatedVideo" label="关联直播"></el-table-column>
<el-table-column prop="submissionCount" label="填写份数"></el-table-column>
<el-table-column prop="submissionDeadline" label="提交时间"></el-table-column>
<el-table-column prop="status" label="状态"></el-table-column>
<el-table-column prop="time" label="发布时间"></el-table-column>
<el-table-column label="操作">
<template #default="scope">
<el-button type="text" @click="viewDetails(scope.row)">查看明细</el-button>
<el-button type="text" @click="editAssignment(scope.row)">编辑</el-button>
</template>
</el-table-column>
</el-table>
</div>
</el-main>
</el-container>
</div>
</template>
<script setup>
import { ref, onMounted } from 'vue'
import axios from 'axios'
import router from '../router';
const assignments = ref([])
const newAssignment = () => {
router.push('/addwork')
}
const viewDetails = (row) => {
console.log(`查看作业 ${row.name} 的明细`)
}
const editAssignment = (row) => {
console.log(`编辑作业 ${row.name}`)
}
onMounted(() => {
axios.get('/api/assignments') // API/api/assignments
.then((response) => {
assignments.value = response.data
})
.catch((error) => {
console.error('获取作业列表失败', error)
})
})
</script>
<style scoped>
.header {
height: 100px;
line-height: 100px;
padding: 0 80px;
}
.header-text {
font-size: 22px;
font-weight: 500;
color: black;
float: left;
}
.header-button {
margin-top: 30px;
}
.main {
padding: 20px 203px;
background-color: #F8F8F8;
}
.list {
padding: 0 60px;
background-color: white;
}
.main-title {
font-size: 16px;
background-color: white;
font-weight: bold;
height: 52px;
border-bottom:2px solid #ececec;
padding: 0 60px;
line-height: 52px;
}
.main-button {
margin: 15px 0;
padding: 12px 20px;
height: 40px;
}
</style>

211
work/src/views/HomeWork.vue

@ -0,0 +1,211 @@
<template>
<div class="common-layout">
<el-container>
<el-header class="header">
<el-text class="header-text">抢点班作业后台管理</el-text>
<el-button class="header-button" type="primary" text style="float: right;">退出登录</el-button>
</el-header>
<el-main class="main">
<div class="main-title">
抢点班作业列表
</div>
<div class="list">
<el-button class="main-button" type="primary" style="float: left;" @click="newAssignment">新建作业</el-button>
<el-table :data="assignments" style="width: 100%" :header-cell-style="{ 'text-align': 'center' }"
:cell-style="{ 'text-align': 'center' }">
<el-table-column label="序号">
<template #default="scope">
{{ scope.$index + (PageNo - 1) * PageSize + 1 }}
</template>
</el-table-column>
<el-table-column prop="name" label="作业名称"></el-table-column>
<el-table-column label="内容归属">
<template v-slot="scope">
<span v-if="scope.row.clubType === '1'">牧民俱乐部</span>
<span v-else-if="scope.row.clubType === '2'">博古论坛</span>
<span v-else-if="scope.row.clubType === '3'">神枪手俱乐部</span>
<span v-else-if="scope.row.clubType === '4'">环球俱乐部</span>
<span v-else-if="scope.row.clubType === '5'">价值投资</span>
<span v-else-if="scope.row.clubType === '6'">波段行情</span>
<span v-else-if="scope.row.clubType === '7'">抄底卖顶</span>
<span v-else-if="scope.row.clubType === '8'">资金及仓位管理</span>
<span v-else>财富的游戏</span>
</template>
</el-table-column>
<el-table-column prop="article" label="关联文章">
<template #default="{ row }">
<el-tooltip class="tooltip" v-if="row.article" :content="row.article.title" placement="bottom"
:disabled="row.article.title.length <= 10" effect="light">
{{ row.article.title.slice(0, 10) || '—' }}
</el-tooltip>
<span v-else></span>
</template>
</el-table-column>
<el-table-column prop="live" label="关联直播">
<template #default="{ row }">
<el-tooltip class="tooltip" v-if="row.live" :content="row.live" placement="bottom"
:disabled="row.live.name.length <= 10" effect="light">
{{ row.live.name.slice(0, 10) || '—' }}
</el-tooltip>
<span v-else></span>
</template>
</el-table-column>
<el-table-column prop="count" label="填写份数"></el-table-column>
<el-table-column label="提交时间">
<template v-slot="scope">
{{ scope.row.startDate.split(' ')[0] }} {{ scope.row.endDate.split(' ')[0] }}
</template>
</el-table-column>
<el-table-column prop="status" label="状态">
<template #default="{ row }">
<span v-if="row.status === 0">未上架</span>
<span v-else-if="row.status === 1">发布中</span>
<span v-else-if="row.status === 2">已下架</span>
</template>
</el-table-column>
<el-table-column prop="createdAt" label="发布时间"></el-table-column>
<el-table-column label="操作">
<template #default="scope">
<el-button type="primary" link @click="viewDetails(scope.row)">查看明细</el-button>
<el-button type="primary" link v-if="scope.row.status != '2'" @click="editAssignment(scope.row)">编辑</el-button>
</template>
</el-table-column>
</el-table>
</div>
<div class="page">
<el-pagination v-model:current-page="PageNo" v-model:page-size="PageSize" :page-sizes="[20, 50, 100, 200]"
:size="size" :disabled="disabled" :background="background" layout="total,prev,next,sizes,jumper"
:total="total" @size-change="handleSizeChange" @current-change="handleCurrentChange" />
</div>
</el-main>
</el-container>
</div>
</template>
<script setup>
import { ref, onMounted } from 'vue';
import { ElMessage } from 'element-plus';
import ClassListApi from '../api/ClassListApi';
import { useRouter } from 'vue-router';
const assignments = ref([]);
// 1
const PageNo = ref(1);
// 10
const PageSize = ref(20);
const size = ref('default');
const disabled = ref(false);
const background = ref(true);
const total = ref(0);
// PageSize
const handleSizeChange = (newPageSize) => {
PageSize.value = newPageSize;
getAssignments(PageNo.value, PageSize.value);
};
// PageNo
const handleCurrentChange = (newPageNo) => {
PageNo.value = newPageNo;
getAssignments(PageNo.value, PageSize.value);
};
const getAssignments = (PageNo, PageSize) => {
ClassListApi.getClassList(PageNo, PageSize)
.then((response) => {
assignments.value = response.data.list;
total.value = response.data.total;
console.log(assignments.value);
})
.catch((error) => {
console.error('获取作业列表失败', error);
});
};
//mounted
onMounted(() => {
getAssignments(PageNo.value, PageSize.value);
});
const newAssignment = () => {
router.push('/addwork')
}
//
const viewDetails = async(row) => {
try {
router.push({
name: 'workdetail',
params: { id: row.id },
});
console.log(row.id)
} catch (error) {
console.log('获取数据出错:', error)
}
};
const router = useRouter();
//
const editAssignment = async (row) => {
try {
router.push({
name: 'updatework',
params: { id: row.id },
});
console.log(row.id)
} catch (error) {
console.log('获取数据出错:', error)
}
};
</script>
<style scoped>
.page {
margin-left: 70%;
}
.header {
height: 100px;
line-height: 100px;
padding: 0 80px;
}
.header-text {
font-size: 22px;
font-weight: 500;
color: black;
float: left;
}
.header-button {
margin-top: 30px;
}
.main {
padding: 20px 203px;
background-color: #F8F8F8;
}
.list {
padding: 0 60px;
background-color: white;
}
.main-title {
font-size: 16px;
background-color: white;
font-weight: bold;
height: 52px;
border-bottom: 2px solid #ececec;
padding: 0 60px;
line-height: 52px;
}
.main-button {
margin: 15px 0;
padding: 12px 20px;
height: 40px;
}
</style>

109
work/src/views/Login.vue

@ -0,0 +1,109 @@
<template>
<div class="login-container">
<div class="title1">管理后台</div>
<div class="login-box">
<div class="title2">欢迎登录</div>
<div class="username">
<el-input type="text" v-model="username" placeholder="请输入账号">
<template #prefix>
<img class="img" src="../assets/login/denglu.png" />
</template>
</el-input>
</div>
<div class="password">
<el-input type="password" v-model="password" placeholder="请输入密码">
<template #prefix>
<img class="img" src="../assets/login/mima.png" />
</template>
</el-input>
</div>
<button @click="login">登录</button>
</div>
</div>
</template>
<script setup>
import { ref } from 'vue';
// 使ref
const username = ref('');
const password = ref('');
//
const login = () => {
// API
console.log('用户名:', username.value);
console.log('密码:', password.value);
};
</script>
<style scoped>
.title1 {
font-size: 40px;
color: #21d3ca;
margin-bottom: 20px;
}
.title2 {
font-size: 20px;
color: #21d3ca;
margin-bottom: 20px;
}
.username,
.password {
display: flex;
align-items: center;
margin-bottom: 20px;
background-color: #e6e6e6;
}
:deep(.el-input__wrapper) {
background-color: rgba(0, 0, 0, 0);
}
.img {
width: 25px;
height: 25px;
}
.login-container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
}
.login-box {
background-color: white;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
padding: 50px;
text-align: center;
height: 200px;
width: 250px;
}
h1 {
margin-bottom: 20px;
}
input {
width: 100%;
padding: 10px;
margin-bottom: 10px;
border: 1px solid #ccc;
border-radius: 3px;
}
button {
width: 100%;
padding: 10px;
background-color: #21d3ca;
color: white;
border: none;
border-radius: 3px;
cursor: pointer;
}
</style>

10
work/src/views/LoginView.vue

@ -1,10 +0,0 @@
<script>
</script>
<template>
</template>
<style scoped>
</style>

476
work/src/views/UpdateWork.vue

@ -0,0 +1,476 @@
<template>
<div class="common-layout">
<el-container>
<el-header class="header">
<el-text class="header-text">抢点班作业后台管理</el-text>
<el-button class="header-button" type="primary" text style="float: right;">退出登录</el-button>
</el-header>
<el-main class="main">
<div class="main-title">
<div class="main-title-text" style="float: left;">
编辑作业
</div>
<div>
<el-button class="main-button" @click="back">返回上一页</el-button>
</div>
</div>
<div class="main-back">
<el-form :model="form" label-width="auto" style="max-width: 700px" size="large">
<el-form-item label="作业名称">
<el-input v-model="form.Name" placeholder="请输入"></el-input>
</el-form-item>
<el-form-item label="提交时间" style="width: 70%">
<el-date-picker v-model="form.picker" type="daterange" range-separator="" start-placeholder="开始日期"
end-placeholder="结束日期" />
</el-form-item>
<el-form-item label="作业归属">
<el-select v-model="form.ClubType" placeholder="请选择" style="width: 100%">
<el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="关联文章">
<el-autocomplete v-model="articleTitle" :fetch-suggestions="queryArticleList" placeholder="请输入"
@select="handleSelectArticle" clearable/>
</el-form-item>
<el-form-item label="关联直播">
<el-select v-model="form.LiveId" placeholder="请选择" style="width: 100%" clearable>
<el-option v-for="item in live" :key="item.id" :label="item.name" :value="item.id"/>
</el-select>
</el-form-item>
<el-form-item label="选择类型">
<div>
<el-button type="primary" @click="addSingleChoice">添加单选</el-button>
<el-button type="primary" @click="addMultipleChoice">添加多选</el-button>
<el-button type="primary" @click="addBlank">添加单选填空</el-button>
</div>
</el-form-item>
<div class="question-container" v-for="(question, index) in questions" :key="index"
:class="{ 'bg-change': isHovered[index] }" @mouseenter="handleMouseEnter(index)"
@mouseleave="handleMouseLeave(index)">
<div class="question-title">
{{ questionPrefix(index) }} {{ getQuestionTypeText(question.type) }}
</div>
<div style="width: 600px;">
<el-input v-model="question.description" />
</div>
<div class="add" v-if="question.type !== 'blank'">
<div class="question-option">
<span>设置选项:</span>
<el-button type="primary" text @click="addOption(index)">添加</el-button>
</div>
<div v-for="(option, optionIndex) in question.content" :key="optionIndex">
<div class="select" style="display: flex;">
<div class="selection-item" style="display: flex;">
<div style="width: 550px;">
<el-input v-model="question.content[optionIndex].text" />
</div>
<div>
<el-button type="primary" text @click="removeOption(index, optionIndex)">删除</el-button>
</div>
</div>
</div>
</div>
<div class="delete" style="margin-left: 50px;">
<el-button type="info" plain @click="removeQuestion(index)">删除</el-button>
</div>
</div>
</div>
<div class="submit">
<el-button type="primary" :disabled="!form.Name||!form.picker" @click="onSubmit">确认</el-button>
</div>
</el-form>
</div>
</el-main>
</el-container>
</div>
</template>
<script lang="ts" setup>
import { ref, onMounted, computed } from 'vue'
import { useRouter,useRoute } from 'vue-router';
import AddWorkApi from '../api/AddWorkApi';
import _ from 'lodash';
import dayjs from 'dayjs';
import ClassListApi from '../api/ClassListApi';
import { ElMessage } from 'element-plus';
const router = useRouter();
const options = ref([
{ id: 1, name: '牧民俱乐部' },
{ id: 2, name: '博古论坛' },
{ id: 3, name: '神枪手俱乐部' },
{ id: 4, name: '环球俱乐部' },
{ id: 5, name: '价值投资' },
{ id: 6, name: '波段行情' },
{ id: 7, name: '抄底卖顶' },
{ id: 8, name: '资金及仓位管理' },
{ id: 9, name: '财富的游戏' },
]);
const route = useRoute();
const id=ref(route.params.id)
console.log(id.value+'============')
//
const homeworkData = ref<{
name: string;
startDate: string;
endDate: string;
clubType: string;
article: {
id: string;
title: string;
};
live: {
id: string;
name: string;
};
form: FormItemType[];
}>({
name: '',
startDate: '',
endDate: '',
clubType: '',
article: {
id: '',
title: '',
},
live: {
id: '',
name: ''
},
form: []
});
// form
interface FormItemType {
id: number;
type: number;
description: string;
content: string; // stringJSON
groupId: number;
name: string;
sort: number;
status: number;
createdAt: string;
updatedAt: string;
}
const form = ref({
id: '',
Name: '',
ClubType: '',
ArticleId: '',
LiveId: '',
picker: [],
StartDate: '',
EndDate: '',
Questions: []
});
onMounted(async () => {
try {
const response = await ClassListApi.getClassListOne(id.value);
homeworkData.value = response.data;
console.log(homeworkData.value)
form.value.Name = homeworkData.value.name;
const start = dayjs(homeworkData.value.startDate).format('YYYY-MM-DD');
const end = dayjs(homeworkData.value.endDate).format('YYYY-MM-DD');
form.value.picker = [start, end];
if (homeworkData.value.article && homeworkData.value.article.title) {
articleTitle.value = homeworkData.value.article.title;
} else if (homeworkData.value.live && homeworkData.value.live.name) {
form.value.LiveId = homeworkData.value.live.name;
}
form.value.ClubType = homeworkData.value.clubType;
const processFormData = () => {
const newQuestions = [];
homeworkData.value.form.forEach((formItem: FormItemType) => {
// contentJSON
const contentArray = JSON.parse(formItem.content) as { id: string, text: string }[];
// questions
const question = {
id: formItem.id,
type: formItem.type,
description: formItem.description,
content: contentArray,
groupId: formItem.groupId,
name: formItem.name,
sort: formItem.sort,
status: formItem.status,
createdAt: formItem.createdAt,
updatedAt: formItem.updatedAt,
};
newQuestions.push(question);
});
return newQuestions;
};
questions.value = processFormData();
} catch (error) {
console.error('接口请求出现错误:', error);
}
});
const articleTitle = ref('');
//
const questions = ref([]);
const onSubmit = () => {
// picker
if (form.value.picker && form.value.picker.length === 2) {
const startDate = dayjs(form.value.picker[0]).format('YYYY-MM-DD HH:mm:00');
const endDate = dayjs(form.value.picker[1]).format('YYYY-MM-DD HH:mm:00');
form.value.StartDate = startDate;
form.value.EndDate = endDate;
}
form.value.Questions = questions.value;
if (form.value.LiveId) {
// form.value.liveid使liveidArticleIdliveid
form.value.ArticleId = '';
} else if (form.value.ArticleId) {
// 使idform.value.ArticleId
} else if (homeworkData.value.article && homeworkData.value.article.id) {
// 使idhomeworkData.value.article.id
form.value.ArticleId = homeworkData.value.article.id;
}
if (typeof id.value === 'string') {
form.value.id = id.value;
}
ClassListApi.editWork(form.value)
.then((response) => {
console.log(response);
ElMessage.success('编辑成功');
router.push('/list')
})
.catch((error) => {
console.error('编辑失败', error);
ElMessage.error('编辑失败');
});
console.log(id.value+'--------------')
console.log(form.value)
}
const back = () => {
window.history.back()
}
//
const articleSearchResults = ref([]);
//
const queryArticleList = async (queryString: string) => {
try {
const response = await AddWorkApi.getArticleList(queryString);
const formattedResults = response.data.map(article => ({
value: article.title,
label: article.id
}));
articleSearchResults.value = formattedResults;
return formattedResults;
} catch (error) {
console.error('查询关联文章失败', error);
return [];
}
};
//
const handleSelectArticle = (article: { label: string }) => {
// idarticle.label使
console.log('选中的文章id', article.label);
form.value.ArticleId = article.label; // id
const selectedArticle = articleSearchResults.value.find(a => a.label === article.label);
if (selectedArticle) {
articleTitle.value = selectedArticle.value; //
}
};
//
const live = ref([]);
function getLive() {
AddWorkApi.getLiveList()
.then(res => {
live.value = res.data;
console.log(live.value);
})
.catch(error => {
console.error('获取直播列表失败', error)
})
}
getLive();
//
const getQuestionTypeText = (type) => {
switch (type) {
case 1:
return '作业题目(单选)';
case 2:
return '作业题目(多选)';
case 3:
return '作业题目(简答题)';
default:
return '未知类型题目';
}
};
const addSingleChoice = () => {
questions.value.push({
type: 1, // 1
description: '',
content: [{ "id": "", "text": "" },{ "id": "", "text": "" }]
});
};
const addMultipleChoice = () => {
questions.value.push({
type: 2, // 2
description: '',
content: [{ "id": "", "text": "" },{ "id": "", "text": "" }]
});
};
const addBlank = () => {
questions.value.push({
type: 3, // 3
description: '',
content: [{ "id": "", "text": "" }]
});
};
const addOption = (questionIndex) => {
const currentQuestion = questions.value[questionIndex];
const currentContent = JSON.parse(currentQuestion.content);
currentContent.push({ "id": "", "text": "" });
currentQuestion.content = JSON.stringify(currentContent);
};
const removeOption = (questionIndex, optionIndex) => {
const currentQuestion = questions.value[questionIndex];
const currentContent = JSON.parse(currentQuestion.content);
currentContent.splice(optionIndex, 1);
currentQuestion.content = JSON.stringify(currentContent);
};
const removeQuestion = (questionIndex) => {
questions.value.splice(questionIndex, 1);
};
//
const questionPrefix = computed(() => {
return (index) => {
return `${index + 1}`;
};
})
// false
const isHovered = ref(Array(questions.value.length).fill(false));
const handleMouseEnter = (index) => {
isHovered.value[index] = true;
};
const handleMouseLeave = (index) => {
isHovered.value[index] = false;
};
// `isHovered` `questions`
onMounted(() => {
isHovered.value = Array(questions.value.length).fill(false);
});
</script>
<style scoped>
.submit {
margin: 100px 212px;
}
.submit .el-button {
padding: 25px 150px;
}
.question-title {
transition: background-color 0.3s ease;
}
.bg-change {
background-color: rgba(200, 200, 200, 0.3);
}
.question-title {
margin-bottom: 10px;
}
.select {
margin: 10px 0px 0px;
}
.delete {
position: absolute;
right: 10px;
bottom: 0px;
}
.add {
position: relative;
}
.question-container {
margin: 20px 0;
padding: 10px 20px;
width: 750px;
border-bottom: 1px solid #e5e5e5;
}
.header {
height: 100px;
line-height: 100px;
padding: 0 80px;
}
.header-text {
font-size: 22px;
font-weight: 500;
color: black;
float: left;
}
.header-button {
margin-top: 30px;
}
.main {
padding: 30px 212px;
background-color: #F8F8F8;
}
.main-title {
font-size: 16px;
background-color: white;
font-weight: bold;
height: 60px;
border-bottom: 2px solid #ececec;
padding: 0 15px;
line-height: 52px;
}
.main-button {
margin: 10px 15px 0 0;
padding: 12px 20px;
height: 40px;
float: right;
}
.el-form {
padding: 30px 78.5px;
margin: auto;
}
.el-form-item {
--font-size: 16px;
margin: 0 0 25px;
}
.main-back {
background-color: white;
}
</style>

265
work/src/views/WorkDetail.vue

@ -0,0 +1,265 @@
<template>
<div class="common-layout">
<el-container>
<el-header class="header">
<el-text class="header-text">抢点班作业后台管理</el-text>
<el-button class="header-button" type="primary" text style="float: right;">退出登录</el-button>
</el-header>
<el-main class="main">
<div class="main-title">
<div class="main-title-text" style="float: left;">
作业详情
</div>
<div>
<el-button class="main-button" @click="back">返回上一页</el-button>
</div>
</div>
<div class="table-container">
<div class="search-bar">
<el-input type="text" placeholder="请输入精网号" v-model="searchCriteria.netNumber"
style="width: 180px;" size="large" />
<el-select v-model="searchCriteria.department" placeholder="选择分店门部" size="large"
style="width: 180px; margin-left: 15px;"></el-select>
<el-select v-model="searchCriteria.store" placeholder="--请选择所属门店--" size="large"
style="width: 180px; margin-left: 15px"></el-select>
<el-button class="search-btn" type="primary" size="large" @click="searchData">搜索</el-button>
<div class="export">
<el-button class="export-btn" type="primary" size="large">导出数据</el-button>
</div>
</div>
<el-table :data="workdetail" style="width: 100%">
<el-table-column label="序号">
<template #default="scope">
{{ scope.$index + (PageNo - 1) * PageSize + 1 }}
</template>
</el-table-column>
<el-table-column prop="name" label="姓名"></el-table-column>
<el-table-column prop="jwcode" label="精网号"></el-table-column>
<el-table-column label="分布-门店">
<template v-slot="scope">
{{ scope.row.deptName }} - {{ scope.row.shopName }}
</template>
</el-table-column>
<el-table-column label="作业详情">
<template #default="scope">
<a class="look" @click="viewDetails(scope.row)">查看</a>
</template>
</el-table-column>
<el-table-column prop="submitTime" label="提交时间">
<template v-slot="scope">
{{ scope.row.Reply[0].submitTime }}
</template>
</el-table-column>
</el-table>
<div class="page">
<el-pagination v-model:current-page="PageNo" v-model:page-size="PageSize"
:page-sizes="[20, 50, 100, 200]" :size="size" :disabled="disabled" :background="background"
layout="sizes,prev,next,jumper" :total="10" @size-change="handleSizeChange"
@current-change="handleCurrentChange" />
</div>
</div>
</el-main>
</el-container>
</div>
</template>
<script lang="ts" setup>
import { ref, onMounted } from 'vue'
import { useRoute } from 'vue-router';
import ClassListApi from '../api/ClassListApi';
const back = () => {
window.history.back()
}
const route = useRoute();
const id = ref(route.params.id)
console.log(id.value + '============')
//
const workdetail = ref < {
total: number;
jwcode: number;
name: string;
depId:string;
depName: string;
shopId: string;
shopName: string;
form: FormItemType[];
} > ({
name: '',
startDate: '',
endDate: '',
clubType: '',
article: {
id: '',
title: '',
},
live: {
id: '',
name: ''
},
form: []
});
// form
interface FormItemType {
id: number;
type: number;
description: string;
content: string; // stringJSON
groupId: number;
name: string;
sort: number;
status: number;
createdAt: string;
updatedAt: string;
}
onMounted(async () => {
try {
const response = await ClassListApi.getWorkDetail(id.value, PageNo.value, PageSize.value);
workdetail.value = response.data;
console.log(workdetail.value)
} catch (error) {
console.error('接口请求出现错误:', error);
}
});
//
const searchCriteria = ref({
jwcode: '',
deptName: '',
shopName: ''
});
// 1
const PageNo = ref(1);
// 10
const PageSize = ref(20);
//
// const searchData = () => {
// filteredData.value = data.filter(item => {
// return (
// item.jwcode.includes(searchCriteria.value.netNumber) &&
// //item.department.includes(searchCriteria.value.department) &&
// item.store.includes(searchCriteria.value.store)
// );
// });
// pagination.value.page = 1;
// };
//
const viewDetails = (item) => {
console.log('查看详情', item);
};
</script>
<style scoped>
.look {
color: rgb(69, 131, 254);
cursor: pointer;
}
.table-container {
margin: 6px 0 0;
padding: 15px 60px;
}
.search-bar {
margin-bottom: 10px;
position: relative;
}
.search-btn {
padding: 10px 20px;
margin: 0 0 0 15px;
}
.export {
position: absolute;
right: 20px;
top: 0px;
}
.export-btn {
padding: 12px 20px;
text-align: right;
}
table {
width: 100%;
border-collapse: collapse;
}
th,
td {
border: 1px solid #ccc;
padding: 5px;
text-align: left;
}
.pagination {
display: flex;
align-items: center;
margin-top: 10px;
}
.pagination select {
margin-right: 10px;
}
.pagination button {
margin-right: 5px;
cursor: pointer;
}
.header {
height: 100px;
line-height: 100px;
padding: 0 80px;
}
.header-text {
font-size: 22px;
font-weight: 500;
color: black;
float: left;
}
.header-button {
margin-top: 30px;
}
.main {
padding: 30px 212px;
background-color: #F8F8F8;
}
.main-title {
font-size: 16px;
background-color: white;
font-weight: bold;
height: 60px;
border-bottom: 2px solid #ececec;
padding: 0 60px;
line-height: 52px;
}
.main-button {
margin: 10px 15px 0 0;
padding: 12px 20px;
height: 40px;
float: right;
}
.main-back {
background-color: white;
}
</style>

15
work/vite.config.js

@ -13,4 +13,19 @@ export default defineConfig({
'@': fileURLToPath(new URL('./src', import.meta.url))
},
},
server: {
proxy: {
'/api': {
target: 'http://192.168.8.191:8080',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, '')
},
// 第二个代理配置,对应/otherApi路径的请求转发到第二个IP地址
// '/otherApi': {
// target: 'http://192.168.8.191:8080',
// changeOrigin: true,
// rewrite: (path) => path.replace(/^\/otherApi/, '')
// }
}
}
})
Loading…
Cancel
Save