Commit 9b7e125f9e8f5f755c624bc331f6486425af496c

Authored by monkeyhouyi
1 parent 7371e0b2

属地页面

README.md 0 → 100644
  1 +# system-project
  2 +
  3 +## Project setup
  4 +```
  5 +npm install
  6 +```
  7 +
  8 +### Compiles and hot-reloads for development
  9 +```
  10 +npm run serve
  11 +```
  12 +
  13 +### Compiles and minifies for production
  14 +```
  15 +npm run build
  16 +```
  17 +
  18 +### Lints and fixes files
  19 +```
  20 +npm run lint
  21 +```
  22 +
  23 +### Customize configuration
  24 +See [Configuration Reference](https://cli.vuejs.org/config/).
... ...
babel.config.js 0 → 100644
  1 +module.exports = {
  2 + presets: [
  3 + '@vue/cli-plugin-babel/preset'
  4 + ]
  5 +}
... ...
jsconfig.json 0 → 100644
  1 +{
  2 + "compilerOptions": {
  3 + "target": "es5",
  4 + "module": "esnext",
  5 + "baseUrl": "./",
  6 + "moduleResolution": "node",
  7 + "paths": {
  8 + "@/*": [
  9 + "src/*"
  10 + ]
  11 + },
  12 + "lib": [
  13 + "esnext",
  14 + "dom",
  15 + "dom.iterable",
  16 + "scripthost"
  17 + ]
  18 + }
  19 +}
... ...
package.json 0 → 100644
  1 +{
  2 + "name": "system-project",
  3 + "version": "0.1.0",
  4 + "private": true,
  5 + "scripts": {
  6 + "serve": "vue-cli-service serve",
  7 + "build": "vue-cli-service build",
  8 + "lint": "vue-cli-service lint"
  9 + },
  10 + "dependencies": {
  11 + "axios": "^1.7.2",
  12 + "compression-webpack-plugin": "^6.1.2",
  13 + "core-js": "^3.8.3",
  14 + "css-loader": "^7.1.2",
  15 + "element-ui": "^2.15.14",
  16 + "js-cookie": "^3.0.5",
  17 + "js-md5": "^0.8.3",
  18 + "node-sass": "^9.0.0",
  19 + "normalize.css": "^8.0.1",
  20 + "nprogress": "^0.2.0",
  21 + "sass-loader": "^14.2.1",
  22 + "style-loader": "^4.0.0",
  23 + "vue": "^2.6.14",
  24 + "vue-router": "^2.8.1",
  25 + "vuex": "^3.6.2"
  26 + },
  27 + "devDependencies": {
  28 + "@babel/core": "^7.12.16",
  29 + "@babel/eslint-parser": "^7.12.16",
  30 + "@vue/cli-plugin-babel": "~5.0.0",
  31 + "@vue/cli-plugin-eslint": "~5.0.0",
  32 + "@vue/cli-service": "~5.0.0",
  33 + "eslint": "^7.32.0",
  34 + "eslint-plugin-vue": "^8.0.3",
  35 + "vue-template-compiler": "^2.6.14"
  36 + },
  37 + "eslintConfig": {
  38 + "root": true,
  39 + "env": {
  40 + "node": true
  41 + },
  42 + "extends": [
  43 + "plugin:vue/essential",
  44 + "eslint:recommended"
  45 + ],
  46 + "parserOptions": {
  47 + "parser": "@babel/eslint-parser"
  48 + },
  49 + "rules": {}
  50 + },
  51 + "browserslist": [
  52 + "> 1%",
  53 + "last 2 versions",
  54 + "not dead"
  55 + ]
  56 +}
... ...
public/favicon.ico 0 → 100644
No preview for this file type
public/index.html 0 → 100644
  1 +<!DOCTYPE html>
  2 +<html lang="">
  3 + <head>
  4 + <meta charset="utf-8">
  5 + <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6 + <meta name="viewport" content="width=device-width,initial-scale=1.0">
  7 + <link rel="icon" href="<%= BASE_URL %>favicon.ico">
  8 + <title><%= htmlWebpackPlugin.options.title %></title>
  9 + </head>
  10 + <body>
  11 + <noscript>
  12 + <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
  13 + </noscript>
  14 + <div id="app"></div>
  15 + <!-- built files will be auto injected -->
  16 + </body>
  17 +</html>
... ...
src/App.vue 0 → 100644
  1 +<template>
  2 + <div id="app">
  3 + <router-view></router-view>
  4 + </div>
  5 +</template>
  6 +
  7 +<script>
  8 +export default {
  9 + name: "App",
  10 +};
  11 +</script>
... ...
src/api/area.js 0 → 100644
  1 +// 公司信息
  2 +import request from "@/utils/request";
  3 +
  4 +// 获取系统类型
  5 +export async function getAreaSelect(data) {
  6 + return await request({
  7 + url: '/extend/systeminformation/GetRegionList',
  8 + method: 'get',
  9 + params: data
  10 + });
  11 +}
  12 +
... ...
src/api/common.js 0 → 100644
  1 +// 公司信息
  2 +import request from "@/utils/request";
  3 +
  4 +// 获取系统类型
  5 +export async function getSystemTypeList() {
  6 + return await request({
  7 + url: '/extend/systeminformation/GetSystemTypeList',
  8 + method: 'get',
  9 + });
  10 +}
  11 +
  12 +// 上传文件
  13 +export async function uploader({ type, file }) {
  14 + return await request({
  15 + headers: {
  16 + 'Content-Type': 'multipart/form-data',
  17 + },
  18 + url: `/file/Uploader/${type}`,
  19 + method: 'post',
  20 + data: { file }
  21 + });
  22 +}
  23 +
... ...
src/api/company.js 0 → 100644
  1 +// 公司信息
  2 +import request from "@/utils/request";
  3 +
  4 +// 获取公司信息列表
  5 +export async function getCompanyInfoList() {
  6 + return await request({
  7 + url: '/Extend/basecomapnyinfo',
  8 + method: 'get',
  9 + });
  10 +}
  11 +// 获取公司信息
  12 +export async function getCompanyInfoById(id) {
  13 + return await request({
  14 + url: `/Extend/basecomapnyinfo/${id}`,
  15 + method: 'get',
  16 + });
  17 +}
  18 +
... ...
src/api/index.js 0 → 100644
  1 +import request from "@/utils/request";
  2 +
  3 +
  4 +// 登录
  5 +export async function login(data) {
  6 + return await request({
  7 + url: '/oauth/Login',
  8 + headers: {
  9 + 'Content-Type': 'application/x-www-form-urlencoded',//类型设置
  10 + },
  11 + method: 'post',
  12 + data: data
  13 + });
  14 +}
  15 +// 获取用户信息
  16 +export async function getInfo() {
  17 + return await request({
  18 + url: '/oauth/CurrentUser',
  19 + method: 'get',
  20 + });
  21 +}
  22 +// 退出登录
  23 +export async function logout() {
  24 + return await request({
  25 + url: '/oauth/Logout',
  26 + method: 'get',
  27 + });
  28 +}
  29 +// 修改密码
  30 +export async function updateUserPwd(id, userPassword, validatePassword) {
  31 + return await request({
  32 + url: `/permission/users/${id}/Actions/ResetPassword`,
  33 + method: 'post',
  34 + data: {userPassword, validatePassword}
  35 + });
  36 +}
  37 +
  38 +// 注册账号
  39 +export async function register(data) {
  40 + return await request({
  41 + url: `/permission/users/CreateSimple`,
  42 + method: 'post',
  43 + data
  44 + });
  45 +}
... ...
src/api/info.js 0 → 100644
  1 +// 公司信息
  2 +import request from "@/utils/request";
  3 +
  4 +// 新增应用
  5 +export async function addSystem(data) {
  6 + return await request({
  7 + url: '/Extend/basesysteminfo',
  8 + method: 'post',
  9 + data
  10 + });
  11 +}
  12 +export async function getInfoList(data) {
  13 + return await request({
  14 + url: '/Extend/basesysteminfo/SearchSystemList',
  15 + method: 'get',
  16 + params: data
  17 + });
  18 +}
  19 +export async function updataSystem(data) {
  20 + let id = data.id;
  21 + return await request({
  22 + url: `/Extend/basesysteminfo/${id}`,
  23 + method: 'put',
  24 + params: data
  25 + });
  26 +}
  27 +export async function getSystemDetail(id) {
  28 + return await request({
  29 + url: `/Extend/basesysteminfo/${id}`,
  30 + method: 'get',
  31 + });
  32 +}
  33 +
... ...
src/api/systemClass.js 0 → 100644
  1 +// 公司信息
  2 +import request from "@/utils/request";
  3 +
  4 +// 获取系统类型
  5 +export async function getSystemClassSelect(data) {
  6 + return await request({
  7 + url: '/Extend/basesystemclassification/GetSystemClassificationlist',
  8 + method: 'get',
  9 + params: data
  10 + });
  11 +}
  12 +
... ...
src/assets/images/bg.jpg 0 → 100644

104 KB

src/assets/images/login-box-container.png 0 → 100644

87.8 KB

src/assets/images/login-btn.png 0 → 100644

54.8 KB

src/assets/images/login_bg.png 0 → 100644

593 KB

src/assets/images/user.jpg 0 → 100644

173 KB

src/assets/logo.png 0 → 100644

6.69 KB

src/assets/mockdata/demodata.json 0 → 100644
  1 +{
  2 + "todoObj": {
  3 + "teskName": "任务名称1",
  4 + "teskCode": "任务编号",
  5 + "teskStatus": "任务状态",
  6 + "teskTime": "任务期限",
  7 + "teskUser": "分配者"
  8 + },
  9 + "tipObj": {
  10 + "content": "任务名称1",
  11 + "time": "2022-01-01 20:00:00"
  12 + },
  13 + "areaObj": {
  14 + "actName": "行动名称",
  15 + "child1": "8",
  16 + "child2": "8",
  17 + "startTime": "2024-07-01",
  18 + "endTime": "2024-07-31",
  19 + "type": "1"
  20 + },
  21 + "chObj": {
  22 + "actName": "行动名称",
  23 + "startTime": "2024-07-01",
  24 + "endTime": "2024-07-31",
  25 + "type": "2"
  26 + },
  27 + "navArr": [
  28 + {"title": "专项行动"},
  29 + {"title": "侦查处置"},
  30 + {"title": "网信执法"},
  31 + {"title": "考核评估"},
  32 + {"title": "清单管理"},
  33 + {"title": "查询上报"},
  34 + {"title": "数字大屏"}
  35 + ]
  36 +}
0 37 \ No newline at end of file
... ...
src/assets/style/common.scss 0 → 100644
  1 +html,
  2 +body,
  3 +#app {
  4 + margin: 0;
  5 + padding: 0;
  6 + width: 100%;
  7 + height: 100%;
  8 +}
  9 +
  10 +::-webkit-scrollbar-track-piece {
  11 + -webkit-border-radius: 0
  12 +}
  13 +::-webkit-scrollbar {
  14 + width: 5px;
  15 + height: 10px
  16 +}
  17 +::-webkit-scrollbar-thumb {
  18 + height: 50px;
  19 + background-color: #b8b8b8;
  20 + -webkit-border-radius: 6px;
  21 + outline-offset: -2px;
  22 + filter: alpha(opacity = 50);
  23 + -moz-opacity: 0.5;
  24 + -khtml-opacity: 0.5;
  25 + opacity: 0.5
  26 +}
  27 +::-webkit-scrollbar-thumb:hover {
  28 + height: 50px;
  29 + background-color: #878987;
  30 + -webkit-border-radius: 6px
  31 +}
  32 +
  33 +.item-box {
  34 + width: 100%;
  35 + border-radius: 10px;
  36 + background-color: rgba(244, 244, 245, 0.38);
  37 + margin-bottom: 15px;
  38 + .item-title {
  39 + color: rgba(255, 255, 255, 1);
  40 + font-size: 16px;
  41 + line-height: 23px;
  42 + padding: 10px;
  43 + }
  44 + .item-body {
  45 + height: calc(100% - 68px);
  46 + margin: 0 13px;
  47 + padding-bottom: 28px;
  48 + .el-table {
  49 + border-radius: 10px;
  50 + height: 100%;
  51 + }
  52 + }
  53 +}
  54 +
  55 +.router-link-active {
  56 + text-decoration: none
  57 +}
  58 +
  59 +a {
  60 + text-decoration: none
  61 +
  62 +}
0 63 \ No newline at end of file
... ...
src/assets/style/homePage.scss 0 → 100644
  1 +.HomePage {
  2 + width: 100%;
  3 + height: 100%;
  4 + background-image: url("@/assets/images/bg.jpg"); /* 替换为你的图片路径 */
  5 + background-size: cover; /* 背景图片覆盖整个元素 */
  6 + background-position: center; /* 背景图片居中 */
  7 + background-repeat: no-repeat; /* 不重复背景图片 */
  8 +}
  9 +.content {
  10 + margin-top: 56px;
  11 + position: relative;
  12 + .navs {
  13 + position: absolute;
  14 + left: 0;
  15 + box-sizing: border-box;
  16 + width: 122px;
  17 + height: 80vh;
  18 + background-color: rgba(228, 231, 237, 0.23);
  19 + border-radius: 0px 10px 10px 0px;
  20 + padding: 25px;
  21 + border-right: unset;
  22 + .el-menu-item {
  23 + display: flex;
  24 + flex-direction: column;
  25 + align-items: center;
  26 + color: #fff;
  27 + margin-bottom: 15px;
  28 + &.is-active {
  29 + border-radius: 5px;
  30 + background-color: #67c23a;
  31 + }
  32 + &:hover {
  33 + background-color: #dfdada56;
  34 + }
  35 + i {
  36 + font-size: 30px;
  37 + color: #fff;
  38 + }
  39 + span {
  40 + color: #fff;
  41 + line-height: 36px;
  42 + }
  43 + }
  44 + }
  45 + .table-box {
  46 + position: absolute;
  47 + right: 122px;
  48 + width: calc(100% - 122px - 122px - 26px - 26px);
  49 + margin: 0 26px;
  50 + .search {
  51 + border-radius: 10px;
  52 + background-color: rgba(244, 244, 245, 0.38);
  53 + display: flex;
  54 + flex-direction: row;
  55 + align-items: center;
  56 + padding: 12px;
  57 + .ipt-box {
  58 + display: flex;
  59 + flex-direction: row;
  60 + align-items: center;
  61 + .el-input {
  62 + width: 300px;
  63 + :deep(.el-input__inner) {
  64 + border-radius: 4px 0 0 4px;
  65 + }
  66 + }
  67 + .el-button {
  68 + height: 40px;
  69 + background: rgb(164, 173, 179);
  70 + color: #fff;
  71 + border-radius: 0 4px 4px 0;
  72 + margin-right: 10px;
  73 + border: unset;
  74 + }
  75 + }
  76 + }
  77 + .info {
  78 + margin-top: 14px;
  79 + border-radius: 10px;
  80 + height: calc(100vh - 195px);
  81 + }
  82 + }
  83 + .news {
  84 + position: absolute;
  85 + right: 0;
  86 + box-sizing: border-box;
  87 + width: 122px;
  88 + height: 200px;
  89 + background-color: rgba(228, 231, 237, 0.23);
  90 + border-radius: 10px 0px 0px 10px;
  91 + padding: 20px;
  92 + .news-item {
  93 + display: flex;
  94 + flex-direction: column;
  95 + align-items: center;
  96 + color: #fff;
  97 + cursor: pointer;
  98 + margin-bottom: 8px;
  99 + .icon-item {
  100 + position: relative;
  101 + width: 40px;
  102 + height: 40px;
  103 + text-align: center;
  104 + line-height: 40px;
  105 + font-size: 40px;
  106 + margin: 8px;
  107 + .red-spot {
  108 + position: absolute;
  109 + right: -6px;
  110 + top: -6px;
  111 + width: 12px;
  112 + height: 12px;
  113 + background-color: red;
  114 + border-radius: 50%;
  115 + }
  116 + }
  117 + }
  118 + }
  119 + }
0 120 \ No newline at end of file
... ...
src/components/CompanyForm/index.vue 0 → 100644
  1 +<template>
  2 + <div class="companyForm">
  3 + <div class="userSelect-input" @click="openDialog">
  4 + <el-button type="text" icon="el-icon-circle-plus-outline" size="small"
  5 + >点击新增企业</el-button
  6 + >
  7 + </div>
  8 + <el-dialog
  9 + title="新增企业"
  10 + :close-on-click-modal="false"
  11 + :visible.sync="visible"
  12 + lock-scroll
  13 + append-to-body
  14 + width="50%"
  15 + top="15vh"
  16 + :modal-append-to-body="false"
  17 + >
  18 + <el-form :model="companyForm" size="small" label-width="100px">
  19 + <el-row :gutter="20">
  20 + <el-col :span="12">
  21 + <el-form-item label="企业名称">
  22 + <el-input
  23 + v-model="companyForm.name"
  24 + placeholder="请输入企业名称"
  25 + ></el-input>
  26 + </el-form-item>
  27 + </el-col>
  28 + <el-col :span="12">
  29 + <el-form-item label="负责人姓名">
  30 + <el-input
  31 + v-model="companyForm.name"
  32 + placeholder="请输入负责人姓名"
  33 + ></el-input>
  34 + </el-form-item>
  35 + </el-col>
  36 + <el-col :span="12">
  37 + <el-form-item label="负责人电话">
  38 + <el-input
  39 + v-model="companyForm.name"
  40 + placeholder="请输入负责人电话"
  41 + ></el-input>
  42 + </el-form-item>
  43 + </el-col>
  44 + <el-col :span="24">
  45 + <el-form-item label="办公地址">
  46 + <el-input
  47 + v-model="companyForm.name"
  48 + placeholder="请输入办公地址"
  49 + ></el-input>
  50 + </el-form-item>
  51 + </el-col>
  52 + </el-row>
  53 + </el-form>
  54 + <span slot="footer" class="dialog-footer">
  55 + <el-button @click="close">取消</el-button>
  56 + <el-button type="primary" @click="confirm">确认</el-button>
  57 + </span>
  58 + </el-dialog>
  59 + </div>
  60 +</template>
  61 +
  62 +<script>
  63 +import { getCompanyInfoList } from "@/api/company";
  64 +export default {
  65 + name: "companyForm",
  66 + props: {},
  67 + data() {
  68 + return {
  69 + visible: false,
  70 + loading: false,
  71 + companyForm: {
  72 + name: "",
  73 + },
  74 + value: "",
  75 + companyOptions: [],
  76 + options: [{ value: 1, label: "选项1" }],
  77 + dialogFormVisible: false,
  78 + };
  79 + },
  80 + watch: {},
  81 + mounted() {},
  82 + created() {},
  83 + methods: {
  84 + // 请求公司列表
  85 + getAllCompanyList() {
  86 + getCompanyInfoList().then((res) => {
  87 + console.log(res, "全部公司信息");
  88 + });
  89 + },
  90 + close() {
  91 + this.visible = false;
  92 + },
  93 + openDialog() {
  94 + this.visible = true;
  95 + },
  96 + async confirm() {},
  97 + },
  98 +};
  99 +</script>
  100 +<style lang="scss" scoped></style>
... ...
src/components/Header.vue 0 → 100644
  1 +<template>
  2 + <header>
  3 + <div class="slogin">
  4 + 举旗帜聚民心、防风险保安全、强治理惠民生、 增动能促发展、谋合作图共赢
  5 + </div>
  6 + <div class="title">内部系统</div>
  7 + <div class="user">
  8 + <div class="head">
  9 + <el-image :src="userInfo.avatar" fit="cover"></el-image>
  10 + </div>
  11 + <el-dropdown @command="handleCommand">
  12 + <div class="info">{{ userInfo.name }}({{ userInfo.address }})</div>
  13 + <el-dropdown-menu slot="dropdown" router>
  14 + <el-dropdown-item>修改信息</el-dropdown-item>
  15 + <passwordForm>
  16 + <el-dropdown-item>修改密码</el-dropdown-item>
  17 + </passwordForm>
  18 + <el-dropdown-item command="logout">退出系统</el-dropdown-item>
  19 + </el-dropdown-menu>
  20 + </el-dropdown>
  21 + </div>
  22 + </header>
  23 +</template>
  24 +
  25 +<script>
  26 +export default {
  27 + name: "Header",
  28 + data() {
  29 + return {
  30 + userInfo: this.$store.state.user,
  31 + };
  32 + },
  33 + mounted() {},
  34 + methods: {
  35 + toLogin() {
  36 + console.log(111);
  37 + this.$router.push({ path: "/login" });
  38 + },
  39 + handleCommand(command) {
  40 + switch (command) {
  41 + case "logout":
  42 + this.$confirm("确定退出登录?", "提示", {
  43 + confirmButtonText: "确定",
  44 + cancelButtonText: "取消",
  45 + type: "warning",
  46 + })
  47 + .then(() => {
  48 + this.$store.dispatch("LogOut").then(() => {
  49 + this.$router.push({ path: "/login" });
  50 + });
  51 + })
  52 + .catch(() => {});
  53 +
  54 + break;
  55 +
  56 + default:
  57 + break;
  58 + }
  59 + },
  60 + },
  61 +};
  62 +</script>
  63 +<style scoped lang="scss">
  64 +header {
  65 + width: 100%;
  66 + color: rgba(255, 255, 255, 1);
  67 + position: relative;
  68 + .slogin {
  69 + position: absolute;
  70 + left: 28px;
  71 + top: 21px;
  72 + width: 600px;
  73 + text-align: right;
  74 + font-size: 28px;
  75 + font-family: Roboto;
  76 + font-weight: 400;
  77 + line-height: 39px;
  78 + }
  79 + .title {
  80 + text-align: center;
  81 + width: 100%;
  82 + padding-top: 5px;
  83 + font-size: 40px;
  84 + font-weight: 700;
  85 + line-height: 56px;
  86 + }
  87 + .user {
  88 + position: absolute;
  89 + right: 33px;
  90 + top: 25px;
  91 + display: flex;
  92 + align-items: center;
  93 + flex-direction: row;
  94 + .head {
  95 + width: 50px;
  96 + height: 50px;
  97 + margin-right: 13px;
  98 + .el-image {
  99 + width: 100%;
  100 + height: 100%;
  101 + border-radius: 50%;
  102 + }
  103 + }
  104 + .info {
  105 + color: #fff;
  106 + cursor: pointer;
  107 + }
  108 + }
  109 +}
  110 +</style>
... ...
src/components/InfoForm/index.vue 0 → 100644
  1 +<template>
  2 + <div class="infoForm">
  3 + <div class="userSelect-input" @click="openDialog">
  4 + <slot></slot>
  5 + </div>
  6 + <el-dialog
  7 + :title="`${type == 'add' ? '新增' : '编辑'}信息`"
  8 + :close-on-click-modal="false"
  9 + :visible.sync="visible"
  10 + lock-scroll
  11 + append-to-body
  12 + width="80%"
  13 + top="10vh"
  14 + :modal-append-to-body="false"
  15 + class="dialog-box"
  16 + destroy-on-close
  17 + v-loading="infoForm_loading"
  18 + >
  19 + <el-form
  20 + :model="infoForm"
  21 + :rules="infoRules"
  22 + ref="infoForm"
  23 + size="small"
  24 + label-width="100px"
  25 + >
  26 + <el-row :gutter="20">
  27 + <el-col :span="24">
  28 + <el-col :span="12">
  29 + <el-form-item label="主体企业" prop="companyId">
  30 + <el-select
  31 + v-model="infoForm.companyId"
  32 + placeholder="请选择主体企业"
  33 + clearable
  34 + v-loadMore="nextCompanyList"
  35 + style="width: 100%"
  36 + @change="companyChange"
  37 + >
  38 + <el-option
  39 + v-for="item in companyOptions"
  40 + :key="item.id"
  41 + :label="item.companyName"
  42 + :value="item.id"
  43 + >
  44 + </el-option>
  45 + </el-select>
  46 + </el-form-item>
  47 + </el-col>
  48 + <el-col :span="12">
  49 + <companyForm />
  50 + </el-col>
  51 + </el-col>
  52 + <el-col :span="24" v-if="isShowCompanyInfo">
  53 + <div class="company-info">
  54 + <div class="company-info-items">
  55 + <div :span="12">
  56 + 企业归属:{{ companyInfo.areaName || "--" }}
  57 + </div>
  58 + <div :span="12">
  59 + 联系人:{{ companyInfo.contactUser || "--" }}
  60 + </div>
  61 + <div :span="12">
  62 + 公司地址:{{ companyInfo.address || "--" }}
  63 + </div>
  64 + </div>
  65 + <div class="company-info-items">
  66 + <div :span="12">
  67 + 社会信用代码:{{ companyInfo.socialCreditAgency || "--" }}
  68 + </div>
  69 + <div :span="12">
  70 + 联系电话:{{ companyInfo.contactPhone || "--" }}
  71 + </div>
  72 + </div>
  73 + </div>
  74 + </el-col>
  75 + <el-col :span="24">
  76 + <el-form-item label="系统类型" prop="systemType">
  77 + <el-radio-group v-model="infoForm.systemType">
  78 + <el-radio
  79 + v-for="v in systemTypeOptions"
  80 + :key="v.Id"
  81 + :label="v.Id"
  82 + @change="systemTypeChange"
  83 + >{{ v.FullName }}</el-radio
  84 + >
  85 + </el-radio-group>
  86 + </el-form-item>
  87 + </el-col>
  88 + <el-col :span="12">
  89 + <el-form-item label="系统名称" prop="systemName">
  90 + <el-input
  91 + v-model="infoForm.systemName"
  92 + placeholder="请输入系统名称"
  93 + maxlength="50"
  94 + ></el-input>
  95 + </el-form-item>
  96 + </el-col>
  97 + <el-col :span="12">
  98 + <el-form-item label="系统分类" prop="systemClass">
  99 + <el-select
  100 + v-model="infoForm.systemClass"
  101 + placeholder="请选择系统分类"
  102 + :disabled="!infoForm.systemType"
  103 + style="width: 100%"
  104 + >
  105 + <el-option
  106 + v-for="item in systemClassOptions"
  107 + :key="item.Id"
  108 + :label="item.ClassName"
  109 + :value="item.Id"
  110 + >
  111 + </el-option>
  112 + </el-select>
  113 + </el-form-item>
  114 + </el-col>
  115 + <el-col :span="12">
  116 + <el-form-item label="备案号" prop="systemRecordNumber">
  117 + <el-input
  118 + v-model="infoForm.systemRecordNumber"
  119 + placeholder="请输入备案号"
  120 + maxlength="200"
  121 + ></el-input>
  122 + </el-form-item>
  123 + </el-col>
  124 + <el-col :span="12">
  125 + <el-form-item label="备案许可证" prop="recordLicense">
  126 + <el-input
  127 + v-model="infoForm.recordLicense"
  128 + placeholder="请输入备案许可证"
  129 + maxlength="200"
  130 + ></el-input>
  131 + </el-form-item>
  132 + </el-col>
  133 + <el-col :span="12">
  134 + <el-form-item label="归属平台" prop="platform">
  135 + <el-input
  136 + v-model="infoForm.platform"
  137 + placeholder="请输入归属平台"
  138 + maxlength="200"
  139 + ></el-input>
  140 + </el-form-item>
  141 + </el-col>
  142 + <el-col :span="12">
  143 + <el-form-item label="域名" prop="domain">
  144 + <el-input
  145 + v-model="infoForm.domain"
  146 + placeholder="请输入域名"
  147 + maxlength="200"
  148 + ></el-input>
  149 + </el-form-item>
  150 + </el-col>
  151 + <el-col :span="12">
  152 + <el-form-item label="下载量" prop="systemDownloadVolume">
  153 + <el-input
  154 + v-model.number="infoForm.systemDownloadVolume"
  155 + maxlength="200"
  156 + placeholder="请输入下载量"
  157 + ></el-input>
  158 + </el-form-item>
  159 + </el-col>
  160 + <el-col :span="12">
  161 + <el-form-item label="版本" prop="version">
  162 + <el-input
  163 + v-model="infoForm.version"
  164 + maxlength="200"
  165 + placeholder="请输入版本"
  166 + ></el-input>
  167 + </el-form-item>
  168 + </el-col>
  169 + <el-col :span="12">
  170 + <el-form-item label="负责人姓名" prop="principalName">
  171 + <el-input
  172 + v-model="infoForm.principalName"
  173 + maxlength="50"
  174 + placeholder="请输入负责人姓名"
  175 + ></el-input>
  176 + </el-form-item>
  177 + </el-col>
  178 + <el-col :span="12">
  179 + <el-form-item label="负责人电话" prop="principalPhone">
  180 + <el-input
  181 + v-model="infoForm.principalPhone"
  182 + maxlength="20"
  183 + placeholder="请输入负责人电话"
  184 + ></el-input>
  185 + </el-form-item>
  186 + </el-col>
  187 + <el-col :span="24">
  188 + <el-form-item label="办公地址" prop="officeAddress">
  189 + <el-input
  190 + v-model="infoForm.officeAddress"
  191 + maxlength="200"
  192 + placeholder="请输入办公地址"
  193 + ></el-input>
  194 + </el-form-item>
  195 + </el-col>
  196 + <el-col :span="24" class="icom-box">
  197 + <el-form-item label="系统图标" prop="systemIcon">
  198 + <el-upload
  199 + class="avatar-uploader"
  200 + action="#"
  201 + :show-file-list="false"
  202 + :limit="1"
  203 + :multiple="false"
  204 + :http-request="httpRequest"
  205 + >
  206 + <img
  207 + v-if="infoForm.systemIcon"
  208 + :src="infoForm.systemIcon"
  209 + class="avatar"
  210 + />
  211 + <i v-else class="el-icon-plus avatar-uploader-icon"></i>
  212 + </el-upload>
  213 + </el-form-item>
  214 + </el-col>
  215 + <el-col :span="24">
  216 + <el-form-item label="所属区县" prop="areaId">
  217 + <el-radio-group
  218 + v-model="infoForm.areaId"
  219 + placeholder="请选择所属区县"
  220 + style="line-height: 22px"
  221 + >
  222 + <el-radio v-for="v in areaOptions" :key="v.id" :label="v.id">{{
  223 + v.fullName
  224 + }}</el-radio>
  225 + </el-radio-group>
  226 + </el-form-item>
  227 + </el-col>
  228 + </el-row>
  229 + </el-form>
  230 + <span slot="footer" class="dialog-footer">
  231 + <el-button @click="close">取消</el-button>
  232 + <el-button type="primary" @click="confirm">确认</el-button>
  233 + </span>
  234 + </el-dialog>
  235 + </div>
  236 +</template>
  237 +
  238 +<script>
  239 +import { getCompanyInfoList, getCompanyInfoById } from "@/api/company";
  240 +import { getSystemTypeList, uploader } from "@/api/common";
  241 +import { getSystemClassSelect } from "@/api/systemClass";
  242 +import { getAreaSelect } from "@/api/area";
  243 +import { addSystem, updataSystem, getSystemDetail } from "@/api/info";
  244 +export default {
  245 + name: "infoForm",
  246 + props: {
  247 + type: {
  248 + type: String,
  249 + default: "add",
  250 + },
  251 + systemId: {
  252 + type: String,
  253 + default: "",
  254 + },
  255 + },
  256 + data() {
  257 + return {
  258 + visible: false,
  259 + infoForm_loading: false,
  260 + infoForm: {
  261 + companyId: "", // 主体企业
  262 + systemType: "", // 系统类型
  263 + systemName: "", // 系统名称
  264 + systemClass: "", // 系统分类
  265 + systemRecordNumber: "",
  266 + recordLicense: "",
  267 + platform: "",
  268 + domain: "",
  269 + systemDownloadVolume: "",
  270 + version: "",
  271 + principalName: "",
  272 + principalPhone: "",
  273 + officeAddress: "",
  274 + systemIcon: "",
  275 + areaId: "",
  276 + },
  277 + infoRules: {
  278 + systemName: {
  279 + required: true,
  280 + message: "请输入系统名称",
  281 + trigger: "blur",
  282 + },
  283 + systemClass: {
  284 + required: true,
  285 + message: "请输入系统分类",
  286 + trigger: "change",
  287 + },
  288 + systemType: {
  289 + required: true,
  290 + message: "请输入系统类型",
  291 + trigger: "change",
  292 + },
  293 + companyId: {
  294 + required: true,
  295 + message: "请输入主体企业",
  296 + trigger: "change",
  297 + },
  298 + areaId: {
  299 + required: true,
  300 + message: "请输入所属区县",
  301 + trigger: "change",
  302 + },
  303 + pincipalPhone: {
  304 + pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
  305 + message: "请输入正确的手机号码",
  306 + trigger: "blur",
  307 + },
  308 + },
  309 + value: "",
  310 + companyOptions: [],
  311 + listQuery_company: {
  312 + pageIndex: 1,
  313 + pageSize: 10,
  314 + },
  315 + total_company: 0,
  316 + isShowCompanyInfo: false,
  317 + companyInfo: {},
  318 + systemTypeOptions: [],
  319 + systemClassOptions: [],
  320 + areaOptions: [],
  321 + };
  322 + },
  323 + watch: {},
  324 + mounted() {},
  325 + created() {},
  326 + methods: {
  327 + // 请求公司列表
  328 + async initCompanyList() {
  329 + let { data } = await getCompanyInfoList(this.listQuery_company);
  330 + this.companyOptions = [...this.companyOptions, ...data.list];
  331 + this.total_company = data.pagination.total;
  332 + },
  333 + // 无限下拉
  334 + nextCompanyList() {
  335 + if (total_company == this.listQuery_company.length) return;
  336 + this.listQuery_company.pageIndex++;
  337 + this.initCompanyList();
  338 + },
  339 + async companyChange(val) {
  340 + // 公司信息
  341 + let { data } = await getCompanyInfoById(val);
  342 + this.companyInfo = data;
  343 + this.isShowCompanyInfo = true;
  344 + },
  345 + // 系统类型
  346 + async initSystemTypeList() {
  347 + let { data } = await getSystemTypeList();
  348 + this.systemTypeOptions = data;
  349 + },
  350 + async systemTypeChange(val) {
  351 + // 系统分类
  352 + let { data } = await getSystemClassSelect({ systemType: val });
  353 + this.systemClassOptions = data;
  354 + },
  355 + // 文件上传--------------------
  356 + httpRequest(file) {
  357 + uploader({
  358 + type: 1,
  359 + file: file.file,
  360 + }).then((res) => {
  361 + console.log(res, "上传成功");
  362 + });
  363 + },
  364 + // 文件上传--------------------
  365 +
  366 + async initAreaTypeList() {
  367 + let { data } = await getAreaSelect();
  368 + this.areaOptions = data;
  369 + },
  370 + reset() {
  371 + for (let key in this.infoForm) {
  372 + this.infoForm[key] = undefined;
  373 + }
  374 + this.companyOptions = [];
  375 + this.listQuery_company = {
  376 + pageIndex: 1,
  377 + pageSize: 10,
  378 + };
  379 + this.total_company = 0;
  380 + this.companyInfo = {};
  381 + this.isShowCompanyInfo = false;
  382 + },
  383 + close() {
  384 + this.reset();
  385 + this.visible = false;
  386 + },
  387 + async openDialog() {
  388 + this.visible = true;
  389 + this.infoForm_loading = true;
  390 + await this.initCompanyList();
  391 + await this.initSystemTypeList();
  392 + await this.initAreaTypeList();
  393 + this.type == "edit" && (await this.initForm());
  394 + this.infoForm_loading = false;
  395 + },
  396 + async initForm() {
  397 + let { data } = await getSystemDetail(this.systemId);
  398 + this.infoForm = data;
  399 + this.systemTypeChange(data.systemType);
  400 + await this.companyChange(data.companyId);
  401 + this.$forceUpdate();
  402 + },
  403 + async confirm() {
  404 + this.$refs["infoForm"].validate((valid) => {
  405 + if (valid) {
  406 + switch (this.type) {
  407 + case "add":
  408 + addSystem(this.infoForm).then((res) => {
  409 + this.$message({
  410 + message: "恭喜你,新增成功",
  411 + type: "success",
  412 + });
  413 + this.close();
  414 + });
  415 + break;
  416 + case "edit":
  417 + this.infoForm.id = this.initInfoForm.Id;
  418 + updataSystem(this.infoForm).then((res) => {
  419 + this.$message({
  420 + message: "恭喜你,修改成功",
  421 + type: "success",
  422 + });
  423 + this.close();
  424 + });
  425 + break;
  426 +
  427 + default:
  428 + break;
  429 + }
  430 + }
  431 + });
  432 + },
  433 + },
  434 +};
  435 +</script>
  436 +<style lang="scss" scoped>
  437 +.dialog-box {
  438 + :deep(.el-dialog__body) {
  439 + max-height: 60vh;
  440 + overflow-y: scroll;
  441 + }
  442 +}
  443 +.company-info {
  444 + display: flex;
  445 + flex-direction: row;
  446 + justify-content: flex-start;
  447 + background: rgba(187, 187, 187, 0.23);
  448 + margin-left: 80px;
  449 + padding: 10px 20px;
  450 + border-radius: 10px;
  451 + width: 50%;
  452 + margin-bottom: 10px;
  453 + .company-info-items {
  454 + width: 50%;
  455 + div {
  456 + line-height: 20px;
  457 + }
  458 + }
  459 +}
  460 +.icom-box {
  461 + :deep(.avatar-uploader .el-upload) {
  462 + border: 1px dashed #d9d9d9;
  463 + border-radius: 6px;
  464 + cursor: pointer;
  465 + position: relative;
  466 + overflow: hidden;
  467 + &:hover {
  468 + border-color: #409eff;
  469 + }
  470 + .avatar-uploader-icon {
  471 + font-size: 28px;
  472 + color: #8c939d;
  473 + width: 100px;
  474 + height: 100px;
  475 + line-height: 100px;
  476 + text-align: center;
  477 + }
  478 + .avatar {
  479 + width: 100px;
  480 + height: 100px;
  481 + display: block;
  482 + }
  483 + }
  484 +}
  485 +</style>
... ...
src/components/InfoList.vue 0 → 100644
  1 +<template>
  2 + <div class="infoList">
  3 + <div class="item-box info-box">
  4 + <div class="item-title">系统信息列表</div>
  5 + <div class="item-body">
  6 + <template>
  7 + <el-table
  8 + :data="infoDataList"
  9 + style="width: 100%"
  10 + stripe
  11 + v-loading="loading"
  12 + >
  13 + <el-table-column
  14 + type="index"
  15 + width="50"
  16 + label="序号"
  17 + ></el-table-column>
  18 + <el-table-column
  19 + prop="CompanyName"
  20 + label="主体企业"
  21 + show-overflow-tooltip
  22 + />
  23 + <el-table-column
  24 + prop="SystemName"
  25 + label="系统名称"
  26 + show-overflow-tooltip
  27 + />
  28 + <el-table-column
  29 + prop="ContactUser"
  30 + label="联系人"
  31 + show-overflow-tooltip
  32 + />
  33 + <el-table-column
  34 + prop="ContactPhone"
  35 + label="联系电话"
  36 + show-overflow-tooltip
  37 + />
  38 + <el-table-column label="操作">
  39 + <template scope="scope">
  40 + <infoForm
  41 + style="display: inline-block; margin-right: 5px"
  42 + type="edit"
  43 + :systemId="scope.row.Id"
  44 + >
  45 + <el-button type="primary" size="small">修改</el-button>
  46 + </infoForm>
  47 + <el-button type="success" size="small">查看记录</el-button>
  48 + </template>
  49 + </el-table-column>
  50 + </el-table>
  51 + </template>
  52 + </div>
  53 + </div>
  54 + </div>
  55 +</template>
  56 +
  57 +<script>
  58 +import { getInfoList } from "@/api/info";
  59 +export default {
  60 + name: "InfoList",
  61 + data() {
  62 + return {
  63 + loading: true,
  64 + listquery: {
  65 + keyword: this.$route.query.keyword,
  66 + pageIndex: 1,
  67 + pageSize: 10,
  68 + },
  69 + total: 0,
  70 + infoDataList: [],
  71 + };
  72 + },
  73 + created() {
  74 + this.initList();
  75 + },
  76 + mounted() {
  77 + console.log(this.$route.path, "path");
  78 + },
  79 + watch: {
  80 + $route: {
  81 + handler: function (route) {
  82 + this.listquery.keyword = route.query.keyword;
  83 + this.initList();
  84 + },
  85 + immediate: true,
  86 + },
  87 + },
  88 + methods: {
  89 + initList() {
  90 + getInfoList(this.listquery).then(({ data }) => {
  91 + let list = [];
  92 + data.list.forEach((v) => {
  93 + let obj = {
  94 + CompanyName: v.compayInfo.CompanyName,
  95 + SystemName: v.SysytemInfo.SystemName,
  96 + ContactUser: v.compayInfo.ContactUser,
  97 + ContactPhone: v.compayInfo.ContactPhone,
  98 + Id: v.SysytemInfo.Id,
  99 + };
  100 + console.log(obj);
  101 + list.push(obj);
  102 + });
  103 + this.infoDataList = list;
  104 + this.total = data.totalCount;
  105 + this.loading = false;
  106 + });
  107 + },
  108 + getSystemUpdataList() {
  109 + getInfoList({
  110 + id: "580628220576007429",
  111 + pageIndex: 1,
  112 + pageSize: 10,
  113 + }).then(({ data }) => {
  114 + console.log(data);
  115 + });
  116 + },
  117 + },
  118 +};
  119 +</script>
  120 +<style scoped lang="scss">
  121 +.item-box.info-box {
  122 + height: 70vh;
  123 + :deep(.el-table__body-wrapper.is-scrolling-none) {
  124 + height: calc(100% - 47px);
  125 + overflow-y: scroll;
  126 + }
  127 +}
  128 +</style>
... ...
src/components/Overview.vue 0 → 100644
  1 +<template>
  2 + <div class="overview">
  3 + <el-row :gutter="20">
  4 + <el-col :span="16">
  5 + <div class="item-box todo">
  6 + <div class="item-title">任务待办</div>
  7 + <div class="item-body">
  8 + <template>
  9 + <el-table :data="todoTableData" style="width: 100%" stripe>
  10 + <el-table-column type="index" width="50"> </el-table-column>
  11 + <el-table-column
  12 + prop="teskName"
  13 + label="任务名称"
  14 + show-overflow-tooltip
  15 + >
  16 + </el-table-column>
  17 + <el-table-column
  18 + prop="teskCode"
  19 + label="任务编号"
  20 + show-overflow-tooltip
  21 + >
  22 + </el-table-column>
  23 + <el-table-column
  24 + prop="teskStatus"
  25 + label="状态"
  26 + show-overflow-tooltip
  27 + >
  28 + </el-table-column>
  29 + <el-table-column
  30 + prop="teskUser"
  31 + label="分配者"
  32 + show-overflow-tooltip
  33 + >
  34 + </el-table-column>
  35 + <el-table-column
  36 + prop="teskTime"
  37 + label="任务期限"
  38 + show-overflow-tooltip
  39 + >
  40 + </el-table-column>
  41 + <el-table-column label="操作">
  42 + <template>
  43 + <el-button type="primary" size="small">处理</el-button>
  44 + </template>
  45 + </el-table-column>
  46 + </el-table>
  47 + </template>
  48 + </div>
  49 + </div>
  50 + <div class="item-box earmarked">
  51 + <div class="item-title">专项行动</div>
  52 + <div class="item-body">
  53 + <el-row :gutter="6" class="item-one-list">
  54 + <el-col
  55 + :span="6"
  56 + v-for="(item, index) in aimList"
  57 + :key="index"
  58 + style="margin-bottom: 6px"
  59 + >
  60 + <div class="item-one-box">
  61 + <div class="one-title">关于xxxxxx的专项行动</div>
  62 + <template v-if="item.type == 1">
  63 + <div class="one-info">
  64 + <div>区县:8(已填7)</div>
  65 + <div>外协:无</div>
  66 + </div>
  67 + <div class="one-info">行动时间:2024-07-01至2024-07-31</div>
  68 + <el-button type="text" class="el-button-qu">管理</el-button>
  69 + <el-button type="text" class="el-button-qu">查看</el-button>
  70 + </template>
  71 + <template v-else>
  72 + <div class="one-info">行动时间:2024-07-01至2024-07-31</div>
  73 + <div class="btn-box">
  74 + <el-button type="success" size="small">填报</el-button>
  75 + <div class="err">即将超时</div>
  76 + </div>
  77 + </template>
  78 + </div>
  79 + </el-col>
  80 + </el-row>
  81 + </div>
  82 + </div>
  83 + </el-col>
  84 + <el-col :span="8">
  85 + <div class="item-box tip">
  86 + <div class="item-title">工作提示</div>
  87 + <div class="item-body">
  88 + <template>
  89 + <el-table :data="todoTableData" style="width: 100%" stripe>
  90 + <el-table-column
  91 + prop="teskName"
  92 + label="内容"
  93 + show-overflow-tooltip
  94 + >
  95 + </el-table-column>
  96 + <el-table-column
  97 + prop="teskCode"
  98 + label="事件"
  99 + show-overflow-tooltip
  100 + >
  101 + </el-table-column>
  102 + </el-table>
  103 + </template>
  104 + </div>
  105 + </div>
  106 + <div class="item-box msg">
  107 + <div class="item-title">通知公告</div>
  108 + <div class="item-body">
  109 + <template>
  110 + <el-table :data="todoTableData" style="width: 100%" stripe>
  111 + <el-table-column
  112 + prop="teskName"
  113 + label="内容"
  114 + show-overflow-tooltip
  115 + >
  116 + </el-table-column>
  117 + <el-table-column
  118 + prop="teskCode"
  119 + label="事件"
  120 + show-overflow-tooltip
  121 + >
  122 + </el-table-column>
  123 + </el-table>
  124 + </template>
  125 + </div>
  126 + </div>
  127 + </el-col>
  128 + </el-row>
  129 + </div>
  130 +</template>
  131 +
  132 +<script>
  133 +import {
  134 + todoObj,
  135 + tipObj,
  136 + areaObj,
  137 + chObj,
  138 +} from "@/assets/mockdata/demodata.json";
  139 +export default {
  140 + name: "Overview",
  141 + data() {
  142 + return {
  143 + todoTableData: [],
  144 + tipTableData: [],
  145 + aimList: [],
  146 + }
  147 + },
  148 + created() {
  149 + this.getTodoList();
  150 + this.getTipList();
  151 + this.getAimList();
  152 + },
  153 + methods: {
  154 + getTodoList() {
  155 + for (let index = 0; index < 10; index++) {
  156 + this.todoTableData.push(todoObj);
  157 + }
  158 + },
  159 + getTipList() {
  160 + for (let index = 0; index < 10; index++) {
  161 + this.tipTableData.push(tipObj);
  162 + }
  163 + },
  164 + getAimList() {
  165 + for (let index = 0; index < 12; index++) {
  166 + if (Math.random() > 0.5) {
  167 + this.aimList.push(areaObj);
  168 + } else {
  169 + this.aimList.push(chObj);
  170 + }
  171 + }
  172 + },
  173 + },
  174 +
  175 +};
  176 +</script>
  177 +<style scoped lang="scss">
  178 +.overview {
  179 + .item-box {
  180 + width: 100%;
  181 + border-radius: 10px;
  182 + background-color: rgba(244, 244, 245, 0.38);
  183 + margin-bottom: 15px;
  184 + &.todo {
  185 + height: calc(50vh - 115px);
  186 + }
  187 + &.earmarked {
  188 + height: calc(50vh - 115px);
  189 + margin-bottom: 0;
  190 + }
  191 + &.tip {
  192 + height: calc(50vh - 60px);
  193 + }
  194 + &.msg {
  195 + height: calc(50vh - 175px);
  196 + margin-bottom: 0;
  197 + }
  198 + .item-title {
  199 + color: rgba(255, 255, 255, 1);
  200 + font-size: 16px;
  201 + line-height: 23px;
  202 + padding: 10px;
  203 + }
  204 + .item-body {
  205 + height: calc(100% - 68px);
  206 + margin: 0 13px;
  207 + padding-bottom: 28px;
  208 + .el-table {
  209 + border-radius: 10px;
  210 + height: 100%;
  211 + :deep(.el-table__body-wrapper.is-scrolling-none) {
  212 + height: calc(100% - 47px);
  213 + overflow-y: scroll;
  214 + }
  215 + }
  216 + }
  217 + }
  218 + .earmarked {
  219 + .item-title {
  220 + margin-bottom: 0;
  221 + }
  222 + .item-one-list {
  223 + max-height: 100%;
  224 + overflow-y: scroll;
  225 + margin-bottom: -6px;
  226 + .item-one-box {
  227 + box-sizing: border-box;
  228 + background-color: #fff;
  229 + border-radius: 5px;
  230 + padding: 3px;
  231 + height: 90px;
  232 + .one-title {
  233 + color: rgba(0, 122, 255, 1);
  234 + font-size: 14px;
  235 + line-height: 20px;
  236 + }
  237 + .one-info {
  238 + display: flex;
  239 + font-size: 12px;
  240 + line-height: 20px;
  241 + }
  242 + .el-button-qu {
  243 + padding: 5px 0;
  244 + }
  245 + .btn-box {
  246 + margin-top: 10px;
  247 + display: flex;
  248 + align-items: flex-end;
  249 + .err {
  250 + margin-left: 10px;
  251 + color: rgba(236, 47, 47, 1);
  252 + font-size: 12px;
  253 + line-height: 17px;
  254 + }
  255 + }
  256 + }
  257 + }
  258 + }
  259 +}
  260 +</style>
... ...
src/components/ParentView/index.vue 0 → 100644
  1 +<template >
  2 + <router-view />
  3 +</template>
... ...
src/components/PasswordForm/index.vue 0 → 100644
  1 +<template>
  2 + <div class="passForm">
  3 + <div class="btn" @click="openDialog">
  4 + <slot></slot>
  5 + </div>
  6 + <el-dialog
  7 + title="修改密码"
  8 + :close-on-click-modal="false"
  9 + :visible.sync="visible"
  10 + lock-scroll
  11 + append-to-body
  12 + width="600px"
  13 + :modal-append-to-body="false"
  14 + class="dialog-box"
  15 + destroy-on-close
  16 + >
  17 + <el-form ref="form" :model="user" :rules="rules" label-width="80px">
  18 + <el-form-item label="旧密码" prop="oldPassword">
  19 + <el-input
  20 + v-model="user.oldPassword"
  21 + placeholder="请输入旧密码"
  22 + type="password"
  23 + show-password
  24 + />
  25 + </el-form-item>
  26 + <el-form-item label="新密码" prop="newPassword">
  27 + <el-input
  28 + v-model="user.newPassword"
  29 + placeholder="请输入新密码"
  30 + type="password"
  31 + show-password
  32 + />
  33 + </el-form-item>
  34 + <el-form-item label="确认密码" prop="confirmPassword">
  35 + <el-input
  36 + v-model="user.confirmPassword"
  37 + placeholder="请确认新密码"
  38 + type="password"
  39 + show-password
  40 + />
  41 + </el-form-item>
  42 + </el-form>
  43 + <span slot="footer" class="dialog-footer">
  44 + <el-button type="primary" @click="submit">保存</el-button>
  45 + <el-button type="danger" @click="visible = false">关闭</el-button>
  46 + </span>
  47 + </el-dialog>
  48 + </div>
  49 +</template>
  50 +
  51 +<script>
  52 +import { updateUserPwd } from "@/api/index";
  53 +export default {
  54 + name: "PassForm",
  55 + props: {},
  56 + data() {
  57 + const equalToPassword = (rule, value, callback) => {
  58 + if (this.user.newPassword !== value) {
  59 + callback(new Error("两次输入的密码不一致"));
  60 + } else {
  61 + callback();
  62 + }
  63 + };
  64 + return {
  65 + visible: false,
  66 + user: {
  67 + oldPassword: undefined,
  68 + newPassword: undefined,
  69 + confirmPassword: undefined,
  70 + },
  71 + // 表单校验
  72 + rules: {
  73 + oldPassword: [
  74 + { required: true, message: "旧密码不能为空", trigger: "blur" },
  75 + ],
  76 + newPassword: [
  77 + { required: true, message: "新密码不能为空", trigger: "blur" },
  78 + {
  79 + min: 6,
  80 + max: 20,
  81 + message: "长度在 6 到 20 个字符",
  82 + trigger: "blur",
  83 + },
  84 + {
  85 + pattern: /^[^<>"'|\\]+$/,
  86 + message: "不能包含非法字符:< > \" ' \\\ |",
  87 + trigger: "blur",
  88 + },
  89 + ],
  90 + confirmPassword: [
  91 + { required: true, message: "确认密码不能为空", trigger: "blur" },
  92 + { required: true, validator: equalToPassword, trigger: "blur" },
  93 + ],
  94 + },
  95 + };
  96 + },
  97 + watch: {},
  98 + mounted() {},
  99 + created() {},
  100 + methods: {
  101 + openDialog() {
  102 + this.visible = true;
  103 + this.$nextTick(() => {
  104 + this.$refs["form"].resetFields();
  105 + });
  106 + },
  107 +
  108 + submit() {
  109 + this.$refs["form"].validate((valid) => {
  110 + if (valid) {
  111 + updateUserPwd(
  112 + this.$store.state.id,
  113 + this.user.oldPassword,
  114 + this.user.newPassword
  115 + ).then((res) => {
  116 + this.$message({
  117 + message: "修改密码成功,请重新登录!",
  118 + type: "success",
  119 + duration: 1000,
  120 + onClose: () => {
  121 + // 修改成功之后重新登陆
  122 + this.visible = false;
  123 + this.$store.dispatch("LogOut").then(() => {
  124 + this.$router.push({ path: "/login" });
  125 + });
  126 + },
  127 + });
  128 + });
  129 + }
  130 + });
  131 + },
  132 + },
  133 +};
  134 +</script>
  135 +<style lang="scss" scoped>
  136 +.dialog-box {
  137 + :deep(.el-dialog__body) {
  138 + max-height: 60vh;
  139 + overflow-y: scroll;
  140 + }
  141 +}
  142 +</style>
... ...
src/components/RegisterForm/index.vue 0 → 100644
  1 +<template>
  2 + <div class="register">
  3 + <div class="btn" @click="openDialog">
  4 + <slot></slot>
  5 + </div>
  6 + <el-dialog
  7 + title="注册账号"
  8 + :close-on-click-modal="false"
  9 + :visible.sync="visible"
  10 + lock-scroll
  11 + append-to-body
  12 + width="600px"
  13 + :modal-append-to-body="false"
  14 + class="dialog-box"
  15 + destroy-on-close
  16 + >
  17 + <el-form
  18 + ref="registerForm"
  19 + :model="registerForm"
  20 + :rules="registerRules"
  21 + class="register-form"
  22 + label-width="100px"
  23 + >
  24 + <el-form-item prop="account" label="账号:">
  25 + <el-input
  26 + v-model="registerForm.account"
  27 + type="text"
  28 + auto-complete="off"
  29 + placeholder="账号"
  30 + />
  31 + </el-form-item>
  32 + <el-form-item prop="password" label="密码:">
  33 + <el-input
  34 + v-model="registerForm.password"
  35 + type="password"
  36 + auto-complete="off"
  37 + placeholder="密码"
  38 + @keyup.enter.native="handleRegister"
  39 + />
  40 + </el-form-item>
  41 + <el-form-item prop="confirmPassword" label="确认密码:">
  42 + <el-input
  43 + v-model="registerForm.confirmPassword"
  44 + type="password"
  45 + auto-complete="off"
  46 + placeholder="确认密码"
  47 + @keyup.enter.native="handleRegister"
  48 + />
  49 + </el-form-item>
  50 + <div>
  51 + <el-button
  52 + :loading="register_loading"
  53 + size="medium"
  54 + type="primary"
  55 + style="width: 100%"
  56 + @click.native.prevent="handleRegister"
  57 + >
  58 + <span v-if="!register_loading">注 册</span>
  59 + <span v-else>注 册 中...</span>
  60 + </el-button>
  61 + </div>
  62 + <el-form-item style="width: 100%">
  63 + <div style="float: right">
  64 + <el-button type="text" @click="visible = false" size="mini"
  65 + >使用已有账户登录</el-button
  66 + >
  67 + </div>
  68 + </el-form-item>
  69 + </el-form>
  70 + </el-dialog>
  71 + </div>
  72 +</template>
  73 +
  74 +<script>
  75 +import { register } from "@/api/index";
  76 +export default {
  77 + name: "RegisterForm",
  78 + props: {},
  79 + data() {
  80 + const equalToPassword = (rule, value, callback) => {
  81 + if (this.registerForm.password !== value) {
  82 + callback(new Error("两次输入的密码不一致"));
  83 + } else {
  84 + callback();
  85 + }
  86 + };
  87 + return {
  88 + visible: false,
  89 + register_loading: false,
  90 + registerForm: {
  91 + account: "",
  92 + password: "",
  93 + confirmPassword: "",
  94 + },
  95 + registerRules: {
  96 + account: [
  97 + { required: true, trigger: "blur", message: "请输入您的账号" },
  98 + {
  99 + min: 2,
  100 + max: 20,
  101 + message: "用户账号长度必须介于 2 和 20 之间",
  102 + trigger: "blur",
  103 + },
  104 + ],
  105 + password: [
  106 + { required: true, trigger: "blur", message: "请输入您的密码" },
  107 + {
  108 + min: 5,
  109 + max: 20,
  110 + message: "用户密码长度必须介于 5 和 20 之间",
  111 + trigger: "blur",
  112 + },
  113 + {
  114 + pattern: /^[^<>"'|\\]+$/,
  115 + message: "不能包含非法字符:< > \" ' \\\ |",
  116 + trigger: "blur",
  117 + },
  118 + ],
  119 + confirmPassword: [
  120 + { required: true, trigger: "blur", message: "请再次输入您的密码" },
  121 + { required: true, validator: equalToPassword, trigger: "blur" },
  122 + ],
  123 + },
  124 + };
  125 + },
  126 + watch: {},
  127 + mounted() {},
  128 + created() {},
  129 + methods: {
  130 + openDialog() {
  131 + this.visible = true;
  132 + this.$nextTick(() => {
  133 + this.$refs.registerForm.resetFields();
  134 + });
  135 + },
  136 +
  137 + submit() {
  138 + this.$refs.registerForm.validate((valid) => {
  139 + if (valid) {
  140 + this.register_loading = true;
  141 + register(this.registerForm).then((res) => {
  142 + const account = this.registerForm.account;
  143 + this.$alert(
  144 + "<font color='red'>恭喜你,您的账号 " +
  145 + account +
  146 + " 注册成功!</font>",
  147 + "系统提示",
  148 + {
  149 + type: "success",
  150 + }
  151 + )
  152 + .then(() => {
  153 + this.visible = false;
  154 + })
  155 + .catch(() => {});
  156 + });
  157 + }
  158 + });
  159 + },
  160 + },
  161 +};
  162 +</script>
  163 +<style lang="scss" scoped>
  164 +.dialog-box {
  165 + :deep(.el-dialog__body) {
  166 + max-height: 60vh;
  167 + overflow-y: scroll;
  168 + }
  169 +}
  170 +</style>
... ...
src/components/index.js 0 → 100644
  1 +import InfoForm from '@/components/InfoForm'
  2 +import CompanyForm from '@/components/CompanyForm'
  3 +import PasswordForm from '@/components/PasswordForm'
  4 +import RegisterForm from '@/components/RegisterForm'
  5 +export default {
  6 + install(Vue, options) {
  7 + Vue.component('InfoForm', InfoForm)
  8 + Vue.component('CompanyForm', CompanyForm)
  9 + Vue.component('PasswordForm', PasswordForm)
  10 + Vue.component('RegisterForm', RegisterForm)
  11 + }
  12 + }
0 13 \ No newline at end of file
... ...
src/main.js 0 → 100644
  1 +import Vue from 'vue'
  2 +import App from './App.vue'
  3 +import router from './router'
  4 +import 'normalize.css/normalize.css'
  5 +import '@/assets/style/common.scss'
  6 +import ElementUI from 'element-ui';
  7 +import 'element-ui/lib/theme-chalk/index.css';
  8 +import store from './store'
  9 +import './permission'
  10 +
  11 +Vue.config.productionTip = false
  12 +Vue.use(ElementUI);
  13 +// 批量引入组件
  14 +import components from './components'
  15 +Vue.use(components)
  16 +Vue.directive('loadMore', {
  17 + bind(el, binding) {
  18 + // 获取element-ui定义好的scroll盒子
  19 + const SELECTWRAP_DOM = el.querySelector('.el-select-dropdown .el-select-dropdown__wrap')
  20 + SELECTWRAP_DOM.addEventListener('scroll', function () {
  21 +
  22 + const CONDITION = this.scrollHeight - this.scrollTop <= this.clientHeight
  23 + if (CONDITION) {
  24 + binding.value()
  25 + }
  26 + })
  27 + }
  28 +})
  29 +new Vue({
  30 + router,
  31 + store,
  32 + render: h => h(App),
  33 +}).$mount('#app')
... ...
src/permission.js 0 → 100644
  1 +import router from './router'
  2 +import store from './store'
  3 +import { Message } from 'element-ui'
  4 +import { getToken } from '@/utils/auth'
  5 +import { isRelogin } from '@/utils/request'
  6 +import NProgress from 'nprogress'
  7 +import 'nprogress/nprogress.css'
  8 +
  9 +NProgress.configure({ showSpinner: false })
  10 +const whiteList = ['/login', '/register']
  11 +
  12 +router.beforeEach((to, from, next) => {
  13 + NProgress.start()
  14 + if (getToken()) {
  15 + /* has token*/
  16 + if (to.path === '/login') {
  17 + next({ path: '/' })
  18 + NProgress.done()
  19 + } else if (whiteList.indexOf(to.path) !== -1) {
  20 + next()
  21 + } else {
  22 + if (store.getters.roles.length === 0) {
  23 + isRelogin.show = true
  24 +
  25 + // 判断当前用户是否已拉取完user_info信息
  26 + store.dispatch('GetInfo').then(() => {
  27 + isRelogin.show = false
  28 + next({ ...to, replace: true })
  29 + // store.dispatch('GenerateRoutes').then(accessRoutes => {
  30 + // // 根据roles权限生成可访问的路由表
  31 + // router.addRoutes(accessRoutes) // 动态添加可访问路由表
  32 + // next({ ...to, replace: true }) // hack方法 确保addRoutes已完成
  33 + // })
  34 + }).catch(err => {
  35 + store.dispatch('LogOut').then(() => {
  36 + Message.error(err)
  37 + next({ path: '/login' })
  38 + })
  39 + })
  40 + } else {
  41 + next()
  42 + }
  43 + }
  44 + } else {
  45 + // 没有token
  46 + if (whiteList.indexOf(to.path) !== -1) {
  47 + // 在免登录白名单,直接进入
  48 + next()
  49 + } else {
  50 + next(`/login`) // 否则全部重定向到登录页
  51 + NProgress.done()
  52 + }
  53 + }
  54 +})
  55 +
  56 +router.afterEach(() => {
  57 + NProgress.done()
  58 +})
... ...
src/router/index.js 0 → 100644
  1 +
  2 +import Vue from "vue";
  3 +import VueRouter from "vue-router";
  4 +import Layout from '@/views/HomePage.vue'
  5 +
  6 +
  7 +Vue.use(VueRouter);
  8 +
  9 +const router = new VueRouter({
  10 + mode: 'hash', // 使用 hash 模式
  11 + routes: [
  12 + {
  13 + path: '',
  14 + component: Layout,
  15 + name: 'homePage',
  16 + children: [
  17 + {
  18 + path: '/homePage',
  19 + name: 'homePage',
  20 + component: () => import('@/components/Overview.vue'),
  21 + meta: { title: '首页', icon: 'dashboard', affix: true }
  22 + },
  23 + ]
  24 + },
  25 + {
  26 + path: '',
  27 + component: Layout,
  28 + name: 'infoList',
  29 + children: [
  30 + {
  31 + path: '/infoList',
  32 + name: 'infoList',
  33 + component: () => import('@/components/InfoList.vue'),
  34 + meta: { title: '系统', icon: 'dashboard', affix: true }
  35 + },
  36 + ]
  37 + },
  38 + {
  39 + path: '/login',
  40 + name: 'login',
  41 + component: () => import('@/views/Login.vue'),
  42 + },
  43 + ]
  44 +});
  45 +
  46 +export default router;
0 47 \ No newline at end of file
... ...
src/store/getters.js 0 → 100644
  1 +const getters = {
  2 + sidebar: state => state.app.sidebar,
  3 + size: state => state.app.size,
  4 + device: state => state.app.device,
  5 + dict: state => state.dict.dict,
  6 + visitedViews: state => state.tagsView.visitedViews,
  7 + cachedViews: state => state.tagsView.cachedViews,
  8 + token: state => state.user.token,
  9 + avatar: state => state.user.avatar,
  10 + name: state => state.user.name,
  11 + introduction: state => state.user.introduction,
  12 + roles: state => state.user.roles,
  13 + permissions: state => state.user.permissions,
  14 + permission_routes: state => state.permission.routes,
  15 + topbarRouters:state => state.permission.topbarRouters,
  16 + defaultRoutes:state => state.permission.defaultRoutes,
  17 + sidebarRouters:state => state.permission.sidebarRouters,
  18 + }
  19 + export default getters
  20 +
0 21 \ No newline at end of file
... ...
src/store/index.js 0 → 100644
  1 +import Vue from 'vue'
  2 +import Vuex from 'vuex'
  3 +import user from './modules/user'
  4 +import meta from './modules/meta'
  5 +import getters from './getters'
  6 +import permission from './modules/permission'
  7 +
  8 +Vue.use(Vuex)
  9 +
  10 +const store = new Vuex.Store({
  11 + modules: {
  12 + user,
  13 + meta,
  14 + permission,
  15 + },
  16 + getters
  17 +})
  18 +
  19 +export default store
... ...
src/store/modules/meta.js 0 → 100644
  1 +// 获取公司列表
  2 +import { register } from "@/api";
  3 +import { getCompanyInfoList } from "@/api/company";
  4 +
  5 +const meta = {
  6 + state: {
  7 + metaData: {}
  8 + },
  9 +
  10 + mutations: {
  11 + ADD_MATA_DATA_ITEMS: (state, data) => {
  12 + Object.keys(data).forEach(key => {
  13 + let value = data[key].map(item => {
  14 + let {dictCode, dictValue, dictLabel} = item
  15 + return {dictCode, dictValue, dictLabel}
  16 + })
  17 + Vue.set(state.metaData, key, value)
  18 + })
  19 + }
  20 + },
  21 +
  22 + actions: {
  23 + registerMateDataItems({ commit, state }, items) {
  24 + let types = items.filter(item => !state.metaData[item])
  25 + if(types && types.length) {
  26 + getCompanyInfoList(types.join(',')).then(res => {
  27 + commit('ADD_MATA_DATA_ITEMS', res.data)
  28 + })
  29 + }
  30 + }
  31 + }
  32 +}
  33 +
  34 +export default meta
... ...
src/store/modules/permission.js 0 → 100644
  1 +// import auth from '@/plugins/auth'
  2 +import router, { constantRoutes, dynamicRoutes } from '@/router'
  3 +// import { getRouters } from '@/api/menu'
  4 +import Layout from '@/views/HomePage.vue'
  5 +import ParentView from '@/components/ParentView'
  6 +
  7 +const permission = {
  8 + state: {
  9 + routes: [],
  10 + addRoutes: [],
  11 + defaultRoutes: [],
  12 + topbarRouters: [],
  13 + sidebarRouters: []
  14 + },
  15 + mutations: {
  16 + SET_ROUTES: (state, routes) => {
  17 + state.addRoutes = routes
  18 + state.routes = constantRoutes.concat(routes)
  19 + },
  20 + SET_DEFAULT_ROUTES: (state, routes) => {
  21 + state.defaultRoutes = constantRoutes.concat(routes)
  22 + },
  23 + SET_TOPBAR_ROUTES: (state, routes) => {
  24 + state.topbarRouters = routes
  25 + },
  26 + SET_SIDEBAR_ROUTERS: (state, routes) => {
  27 + state.sidebarRouters = routes
  28 + },
  29 + },
  30 + actions: {
  31 + // 生成路由
  32 + GenerateRoutes({ commit }) {
  33 + return new Promise(resolve => {
  34 + // 向后端请求路由数据
  35 + // getRouters().then(res => {
  36 + // let data = res.data.filter(v => !(v.name && v.name == 'System'));
  37 + // const sdata = JSON.parse(JSON.stringify(data))
  38 + // const rdata = JSON.parse(JSON.stringify(data))
  39 + // const sidebarRoutes = filterAsyncRouter(sdata)
  40 + // const rewriteRoutes = filterAsyncRouter(rdata, false, true)
  41 + // const asyncRoutes = filterDynamicRoutes(dynamicRoutes);
  42 + // rewriteRoutes.push({ path: '*', redirect: '/404', hidden: true })
  43 + // router.addRoutes(asyncRoutes);
  44 + // commit('SET_ROUTES', rewriteRoutes)
  45 + // commit('SET_SIDEBAR_ROUTERS', constantRoutes.concat(sidebarRoutes))
  46 + // commit('SET_DEFAULT_ROUTES', sidebarRoutes)
  47 + // commit('SET_TOPBAR_ROUTES', sidebarRoutes)
  48 + // resolve(rewriteRoutes)
  49 + // })
  50 + })
  51 + }
  52 + }
  53 +}
  54 +
  55 +// 遍历后台传来的路由字符串,转换为组件对象
  56 +function filterAsyncRouter(asyncRouterMap, lastRouter = false, type = false) {
  57 + return asyncRouterMap.filter(route => {
  58 + if (type && route.children) {
  59 + route.children = filterChildren(route.children)
  60 + }
  61 + if (route.component) {
  62 + // Layout ParentView 组件特殊处理
  63 + if (route.component === 'Layout') {
  64 + route.component = Layout
  65 + } else if (route.component === 'ParentView') {
  66 + route.component = ParentView
  67 + } else {
  68 + route.component = loadView(route.component)
  69 + }
  70 + }
  71 + if (route.children != null && route.children && route.children.length) {
  72 + route.children = filterAsyncRouter(route.children, route, type)
  73 + } else {
  74 + delete route['children']
  75 + delete route['redirect']
  76 + }
  77 + return true
  78 + })
  79 +}
  80 +
  81 +function filterChildren(childrenMap, lastRouter = false) {
  82 + var children = []
  83 + childrenMap.forEach((el, index) => {
  84 + if (el.children && el.children.length) {
  85 + if (el.component === 'ParentView' && !lastRouter) {
  86 + el.children.forEach(c => {
  87 + c.path = el.path + '/' + c.path
  88 + if (c.children && c.children.length) {
  89 + children = children.concat(filterChildren(c.children, c))
  90 + return
  91 + }
  92 + children.push(c)
  93 + })
  94 + return
  95 + }
  96 + }
  97 + if (lastRouter) {
  98 + el.path = lastRouter.path + '/' + el.path
  99 + if (el.children && el.children.length) {
  100 + children = children.concat(filterChildren(el.children, el))
  101 + return
  102 + }
  103 + }
  104 + children = children.concat(el)
  105 + })
  106 + return children
  107 +}
  108 +
  109 +// 动态路由遍历,验证是否具备权限
  110 +export function filterDynamicRoutes(routes) {
  111 + const res = []
  112 + // routes.forEach(route => {
  113 + // if (route.permissions) {
  114 + // if (auth.hasPermiOr(route.permissions)) {
  115 + // res.push(route)
  116 + // }
  117 + // } else if (route.roles) {
  118 + // if (auth.hasRoleOr(route.roles)) {
  119 + // res.push(route)
  120 + // }
  121 + // }
  122 + // })
  123 + return res
  124 +}
  125 +
  126 +export const loadView = (view) => {
  127 + if (process.env.NODE_ENV === 'development') {
  128 + return (resolve) => require([`@/views/${view}`], resolve)
  129 + } else {
  130 + // 使用 import 实现生产环境的路由懒加载
  131 + return () => import(`@/views/${view}`)
  132 + }
  133 +}
  134 +
  135 +export default permission
... ...
src/store/modules/user.js 0 → 100644
  1 +import { login, getInfo, logout } from '@/api/index'
  2 +import { getToken, setToken, removeToken } from '@/utils/auth'
  3 +import md5 from "js-md5"; // 密码加密
  4 +
  5 +const user = {
  6 + state: {
  7 + token: getToken(),
  8 + id: '',
  9 + name: '',
  10 + avatar: '',
  11 + roles: [],
  12 + address: '',
  13 + },
  14 +
  15 + mutations: {
  16 + SET_TOKEN: (state, token) => {
  17 + state.token = token
  18 + },
  19 + SET_ID: (state, id) => {
  20 + state.id = id
  21 + },
  22 + SET_NAME: (state, name) => {
  23 + state.name = name
  24 + },
  25 + SET_AVATAR: (state, avatar) => {
  26 + state.avatar = avatar
  27 + },
  28 + SET_ROLES: (state, roles) => {
  29 + state.roles = roles
  30 + },
  31 + SET_ADDRESS: (state, address) => {
  32 + state.address = address
  33 + }
  34 + },
  35 +
  36 + actions: {
  37 + // 登录
  38 + Login({ commit }, data) {
  39 + return new Promise((resolve, reject) => {
  40 + let password = md5(data.password); ``
  41 + let account = data.account;
  42 + login({ account, password }).then(res => {
  43 + setToken(res.data.token)
  44 + commit('SET_TOKEN', res.data.token)
  45 + resolve()
  46 + }).catch(error => {
  47 + reject(error)
  48 + })
  49 + })
  50 + },
  51 +
  52 + // 获取用户信息
  53 + GetInfo({ commit, state }) {
  54 + return new Promise((resolve, reject) => {
  55 + getInfo().then((res) => {
  56 + let { data } = res;
  57 + const user = data.userInfo
  58 + const avatar = (user.headIcon == "" || user.headIcon == null) || require("@/assets/images/user.jpg");
  59 + if (user.roleIds && user.roleIds.length > 0) { // 验证返回的roles是否是一个非空数组
  60 + commit('SET_ROLES', user.roleIds)
  61 + } else {
  62 + commit('SET_ROLES', ['ROLE_DEFAULT'])
  63 + }
  64 + commit('SET_ID', user.userId)
  65 + commit('SET_NAME', user.userName)
  66 + commit('SET_AVATAR', avatar)
  67 + commit('SET_ADDRESS', user.loginIPAddressName)
  68 + resolve(res)
  69 + }).catch(error => {
  70 + reject(error)
  71 + })
  72 + })
  73 + },
  74 +
  75 + // 退出系统
  76 + LogOut({ commit, state }) {
  77 + return new Promise((resolve, reject) => {
  78 + logout().then(() => {
  79 + commit('SET_TOKEN', '')
  80 + commit('SET_ROLES', [])
  81 + removeToken()
  82 + resolve()
  83 + }).catch(error => {
  84 + reject(error)
  85 + })
  86 + })
  87 + },
  88 + // 前端退出
  89 + FedLogOut({ commit, state }) {
  90 + return new Promise((resolve, reject) => {
  91 + commit('SET_TOKEN', '')
  92 + removeToken()
  93 + resolve()
  94 + })
  95 + },
  96 + }
  97 +}
  98 +
  99 +export default user
... ...
src/utils/auth.js 0 → 100644
  1 +import Cookies from 'js-cookie'
  2 +
  3 +const TokenKey = 'Account-Token'
  4 +
  5 +export function getToken() {
  6 + return Cookies.get(TokenKey)
  7 +}
  8 +
  9 +export function setToken(token) {
  10 + return Cookies.set(TokenKey, token)
  11 +}
  12 +
  13 +export function removeToken() {
  14 + return Cookies.remove(TokenKey)
  15 +}
... ...
src/utils/errorCode.js 0 → 100644
  1 +export default {
  2 + '401': '认证失败,无法访问系统资源',
  3 + '403': '当前操作没有权限',
  4 + '404': '访问资源不存在',
  5 + 'default': '系统未知错误,请反馈给管理员'
  6 +}
... ...
src/utils/index.js 0 → 100644
  1 +
  2 +
  3 +/**
  4 + * 通用js方法封装处理
  5 + * Copyright (c) 2019 ruoyi
  6 + */
  7 +
  8 +// 日期格式化
  9 +export function parseTime(time, pattern) {
  10 + if (arguments.length === 0 || !time) {
  11 + return null
  12 + }
  13 + const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}'
  14 + let date
  15 + if (typeof time === 'object') {
  16 + date = time
  17 + } else {
  18 + if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
  19 + time = parseInt(time)
  20 + } else if (typeof time === 'string') {
  21 + time = time.replace(new RegExp(/-/gm), '/').replace('T', ' ').replace(new RegExp(/\.[\d]{3}/gm), '');
  22 + }
  23 + if ((typeof time === 'number') && (time.toString().length === 10)) {
  24 + time = time * 1000
  25 + }
  26 + date = new Date(time)
  27 + }
  28 + const formatObj = {
  29 + y: date.getFullYear(),
  30 + m: date.getMonth() + 1,
  31 + d: date.getDate(),
  32 + h: date.getHours(),
  33 + i: date.getMinutes(),
  34 + s: date.getSeconds(),
  35 + a: date.getDay()
  36 + }
  37 + const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => {
  38 + let value = formatObj[key]
  39 + // Note: getDay() returns 0 on Sunday
  40 + if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value] }
  41 + if (result.length > 0 && value < 10) {
  42 + value = '0' + value
  43 + }
  44 + return value || 0
  45 + })
  46 + return time_str
  47 + }
  48 +
  49 + // 表单重置
  50 + export function resetForm(refName) {
  51 + if (this.$refs[refName]) {
  52 + this.$refs[refName].resetFields();
  53 + }
  54 + }
  55 +
  56 + // 添加日期范围
  57 + export function addDateRange(params, dateRange, propName) {
  58 + let search = params;
  59 + search.params = typeof (search.params) === 'object' && search.params !== null && !Array.isArray(search.params) ? search.params : {};
  60 + dateRange = Array.isArray(dateRange) ? dateRange : [];
  61 + if (typeof (propName) === 'undefined') {
  62 + search.params['beginTime'] = dateRange[0];
  63 + search.params['endTime'] = dateRange[1];
  64 + } else {
  65 + search.params['begin' + propName] = dateRange[0];
  66 + search.params['end' + propName] = dateRange[1];
  67 + }
  68 + return search;
  69 + }
  70 +
  71 + // 回显数据字典
  72 + export function selectDictLabel(datas, value) {
  73 + if (value === undefined) {
  74 + return "";
  75 + }
  76 + var actions = [];
  77 + Object.keys(datas).some((key) => {
  78 + if (datas[key].value == ('' + value)) {
  79 + actions.push(datas[key].label);
  80 + return true;
  81 + }
  82 + })
  83 + if (actions.length === 0) {
  84 + actions.push(value);
  85 + }
  86 + return actions.join('');
  87 + }
  88 +
  89 + // 回显数据字典(字符串、数组)
  90 + export function selectDictLabels(datas, value, separator) {
  91 + if (value === undefined || value.length ===0) {
  92 + return "";
  93 + }
  94 + if (Array.isArray(value)) {
  95 + value = value.join(",");
  96 + }
  97 + var actions = [];
  98 + var currentSeparator = undefined === separator ? "," : separator;
  99 + var temp = value.split(currentSeparator);
  100 + Object.keys(value.split(currentSeparator)).some((val) => {
  101 + var match = false;
  102 + Object.keys(datas).some((key) => {
  103 + if (datas[key].value == ('' + temp[val])) {
  104 + actions.push(datas[key].label + currentSeparator);
  105 + match = true;
  106 + }
  107 + })
  108 + if (!match) {
  109 + actions.push(temp[val] + currentSeparator);
  110 + }
  111 + })
  112 + return actions.join('').substring(0, actions.join('').length - 1);
  113 + }
  114 +
  115 + // 字符串格式化(%s )
  116 + export function sprintf(str) {
  117 + var args = arguments, flag = true, i = 1;
  118 + str = str.replace(/%s/g, function () {
  119 + var arg = args[i++];
  120 + if (typeof arg === 'undefined') {
  121 + flag = false;
  122 + return '';
  123 + }
  124 + return arg;
  125 + });
  126 + return flag ? str : '';
  127 + }
  128 +
  129 + // 转换字符串,undefined,null等转化为""
  130 + export function parseStrEmpty(str) {
  131 + if (!str || str == "undefined" || str == "null") {
  132 + return "";
  133 + }
  134 + return str;
  135 + }
  136 +
  137 + // 数据合并
  138 + export function mergeRecursive(source, target) {
  139 + for (var p in target) {
  140 + try {
  141 + if (target[p].constructor == Object) {
  142 + source[p] = mergeRecursive(source[p], target[p]);
  143 + } else {
  144 + source[p] = target[p];
  145 + }
  146 + } catch (e) {
  147 + source[p] = target[p];
  148 + }
  149 + }
  150 + return source;
  151 + };
  152 +
  153 + /**
  154 + * 构造树型结构数据
  155 + * @param {*} data 数据源
  156 + * @param {*} id id字段 默认 'id'
  157 + * @param {*} parentId 父节点字段 默认 'parentId'
  158 + * @param {*} children 孩子节点字段 默认 'children'
  159 + */
  160 + export function handleTree(data, id, parentId, children) {
  161 + let config = {
  162 + id: id || 'id',
  163 + parentId: parentId || 'parentId',
  164 + childrenList: children || 'children'
  165 + };
  166 +
  167 + var childrenListMap = {};
  168 + var nodeIds = {};
  169 + var tree = [];
  170 +
  171 + for (let d of data) {
  172 + let parentId = d[config.parentId];
  173 + if (childrenListMap[parentId] == null) {
  174 + childrenListMap[parentId] = [];
  175 + }
  176 + nodeIds[d[config.id]] = d;
  177 + childrenListMap[parentId].push(d);
  178 + }
  179 +
  180 + for (let d of data) {
  181 + let parentId = d[config.parentId];
  182 + if (nodeIds[parentId] == null) {
  183 + tree.push(d);
  184 + }
  185 + }
  186 +
  187 + for (let t of tree) {
  188 + adaptToChildrenList(t);
  189 + }
  190 +
  191 + function adaptToChildrenList(o) {
  192 + if (childrenListMap[o[config.id]] !== null) {
  193 + o[config.childrenList] = childrenListMap[o[config.id]];
  194 + }
  195 + if (o[config.childrenList]) {
  196 + for (let c of o[config.childrenList]) {
  197 + adaptToChildrenList(c);
  198 + }
  199 + }
  200 + }
  201 + return tree;
  202 + }
  203 +
  204 + /**
  205 + * 参数处理
  206 + * @param {*} params 参数
  207 + */
  208 + export function tansParams(params) {
  209 + let result = ''
  210 + for (const propName of Object.keys(params)) {
  211 + const value = params[propName];
  212 + var part = encodeURIComponent(propName) + "=";
  213 + if (value !== null && value !== "" && typeof (value) !== "undefined") {
  214 + if (typeof value === 'object') {
  215 + for (const key of Object.keys(value)) {
  216 + if (value[key] !== null && value[key] !== "" && typeof (value[key]) !== 'undefined') {
  217 + let params = propName + '[' + key + ']';
  218 + var subPart = encodeURIComponent(params) + "=";
  219 + result += subPart + encodeURIComponent(value[key]) + "&";
  220 + }
  221 + }
  222 + } else {
  223 + result += part + encodeURIComponent(value) + "&";
  224 + }
  225 + }
  226 + }
  227 + return result
  228 + }
  229 +
  230 + // 验证是否为blob格式
  231 + export function blobValidate(data) {
  232 + return data.type !== 'application/json'
  233 + }
  234 +
0 235 \ No newline at end of file
... ...
src/utils/mixin/metaMixin.js 0 → 100644
  1 +import store from "@/store";
  2 +const metaMixin = {
  3 + created() {},
  4 + computed: {
  5 + },
  6 + methods: {
  7 +
  8 + },
  9 +}
  10 +export {
  11 + metaMixin
  12 +}
0 13 \ No newline at end of file
... ...
src/utils/request.js 0 → 100644
  1 +import axios from "axios";
  2 +import { getToken, removeToken } from "@/utils/auth";
  3 +import { Notification, MessageBox, Message, Loading } from 'element-ui'
  4 +import errorCode from '@/utils/errorCode'
  5 +import { tansParams, blobValidate } from "@/utils/index";
  6 +
  7 +// 是否显示重新登录
  8 +export let isRelogin = { show: false };
  9 +
  10 +axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
  11 +
  12 +const service = axios.create({
  13 + // axios中请求配置有baseURL选项,表示请求URL公共部分
  14 + baseURL: '/api',
  15 + // 超时
  16 + // timeout: 20000
  17 +})
  18 +
  19 +//拦截器(请求,响应)
  20 +//请求
  21 +service.interceptors.request.use(config => {
  22 + // 是否需要设置 token
  23 + const isToken = (config.headers || {}).isToken === false
  24 + // 是否需要防止数据重复提交
  25 + // const isRepeatSubmit = (config.headers || {}).repeatSubmit === false
  26 + // 判断token
  27 + if (getToken() && !isToken) {
  28 + config.headers['Authorization'] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
  29 + }
  30 + // get请求映射params参数
  31 + if (config.method === 'get' && config.params) {
  32 + let url = config.url + '?' + tansParams(config.params);
  33 + url = url.slice(0, -1);
  34 + config.params = {};
  35 + config.url = url;
  36 + }
  37 + return config;
  38 +})
  39 +//响应
  40 +service.interceptors.response.use(res => {
  41 + const code = res.data.code || 200;
  42 + const msg = errorCode[code] || res.data.msg || errorCode['default']
  43 +
  44 + if (code === 401 || code == 600) {
  45 + if (!isRelogin.show) {
  46 + isRelogin.show = true;
  47 + MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', { confirmButtonText: '重新登录', cancelButtonText: '取消', type: 'warning' }).then(() => {
  48 + isRelogin.show = false;
  49 + removeToken();
  50 + location.href = '#/login';
  51 + }).catch(() => {
  52 + isRelogin.show = false;
  53 + });
  54 + }
  55 + } else if (code === 500) {
  56 + Message({ message: msg, type: 'error' })
  57 + return Promise.reject(new Error(msg))
  58 + } else if (code === 601) {
  59 + Message({ message: msg, type: 'warning' })
  60 + return Promise.reject('error')
  61 + } else if (code !== 200) {
  62 + Notification.error({ title: msg })
  63 + return Promise.reject('error')
  64 + } else {
  65 + return res.data
  66 + }
  67 +}, err => {
  68 + //失败
  69 + return Promise.reject(err)
  70 +})
  71 +
  72 +
  73 +export default service;
0 74 \ No newline at end of file
... ...
src/views/HomePage.vue 0 → 100644
  1 +r
  2 +<template>
  3 + <div class="HomePage">
  4 + <Header />
  5 + <div class="content">
  6 + <el-menu :default-active="activeMenu" class="navs" router>
  7 + <el-menu-item index="/homePage">
  8 + <i class="el-icon-s-home"></i>
  9 + <span slot="title">主 页</span>
  10 + </el-menu-item>
  11 + <el-menu-item index="/infoList">
  12 + <i class="el-icon-menu"></i>
  13 + <span slot="title">系统管理</span>
  14 + </el-menu-item>
  15 + <el-menu-item v-for="(item, index) in navList" :key="index">
  16 + <i class="el-icon-circle-plus"></i>
  17 + <span slot="title">{{ item.title }}</span>
  18 + </el-menu-item>
  19 + </el-menu>
  20 + <div class="table-box">
  21 + <div class="search">
  22 + <div class="ipt-box">
  23 + <el-input
  24 + placeholder="请输入应用名称,企业名称进行查询"
  25 + v-model="searchKeyword"
  26 + ></el-input>
  27 + <el-button type="primary" @click="toSearchInfoList">搜索</el-button>
  28 + </div>
  29 + <infoForm type="add">
  30 + <el-button type="success">新增</el-button>
  31 + </infoForm>
  32 + <el-button type="text" style="color: #fff; margin-left: 10px"
  33 + >更多</el-button
  34 + >
  35 + </div>
  36 + <div class="info">
  37 + <router-view></router-view>
  38 + </div>
  39 + </div>
  40 + <div class="news">
  41 + <div class="news-item">
  42 + <div class="icon-item">
  43 + <i class="el-icon-s-order"></i>
  44 + </div>
  45 + <div class="nav-title">我的待办</div>
  46 + </div>
  47 + <div class="news-item">
  48 + <div class="icon-item">
  49 + <i class="el-icon-message-solid"></i>
  50 + <div class="red-spot"></div>
  51 + </div>
  52 + <div class="nav-title">我的消息</div>
  53 + </div>
  54 + </div>
  55 + </div>
  56 + </div>
  57 +</template>
  58 +
  59 +<script>
  60 +import Header from "@/components/Header";
  61 +import { navArr } from "@/assets/mockdata/demodata.json";
  62 +export default {
  63 + name: "HomePage",
  64 + components: {
  65 + Header,
  66 + },
  67 + data() {
  68 + return {
  69 + navList: [],
  70 + searchKeyword: "",
  71 + };
  72 + },
  73 + created() {
  74 + this.navList = navArr;
  75 + },
  76 + mounted() {},
  77 + computed: {
  78 + // 默认激活的菜单
  79 + activeMenu() {
  80 + return this.$route.path;
  81 + },
  82 + },
  83 + methods: {
  84 + toSearchInfoList() {
  85 + this.$router.push({
  86 + path: "/infoList",
  87 + query: { keyword: this.searchKeyword },
  88 + });
  89 + },
  90 + },
  91 +};
  92 +</script>
  93 +
  94 +<style scoped lang="scss">
  95 +@import "@/assets/style/homePage.scss";
  96 +</style>
... ...
src/views/Login.vue 0 → 100644
  1 +<template>
  2 + <div class="Login">
  3 + <div class="login-wrap">
  4 + <div class="login-wrap_header">系统名称</div>
  5 + <div class="login-wrap_container">
  6 + <div class="welcome-text">欢迎登录!</div>
  7 + <el-form
  8 + ref="form"
  9 + :model="form"
  10 + :rules="rules"
  11 + class="login-wrap_container-form"
  12 + >
  13 + <el-form-item label="账号" prop="account">
  14 + <el-input
  15 + v-model="form.account"
  16 + placeholder="请输入账号"
  17 + ></el-input>
  18 + </el-form-item>
  19 + <el-form-item label="密码" prop="password">
  20 + <el-input
  21 + type="password"
  22 + v-model="form.password"
  23 + placeholder="请输入密码"
  24 + autocomplete="off"
  25 + >
  26 + </el-input>
  27 + </el-form-item>
  28 + <div class="password-remind">
  29 + <registerForm>
  30 + <div class="user-register">账户注册</div>
  31 + </registerForm>
  32 + <div class="forget-password">
  33 + <!-- 忘记密码? -->
  34 + </div>
  35 + </div>
  36 + <div class="login-button" @click="toHome">登录</div>
  37 + </el-form>
  38 + </div>
  39 + </div>
  40 + </div>
  41 +</template>
  42 +
  43 +<script>
  44 +import { login } from "@/api/index";
  45 +import { setToken } from "@/utils/auth";
  46 +export default {
  47 + name: "Login",
  48 + components: {},
  49 + data() {
  50 + return {
  51 + form: {
  52 + account: "admin",
  53 + password: "123456",
  54 + },
  55 + rules: {
  56 + account: { required: true, message: "用户名不能为空", trigger: "blur" },
  57 + password: { required: true, message: "密码不能为空", trigger: "blur" },
  58 + },
  59 + };
  60 + },
  61 + created() {},
  62 + mounted() {},
  63 + methods: {
  64 + toHome() {
  65 + this.$refs["form"].validate((valid) => {
  66 + if (valid) {
  67 + this.$store.dispatch("Login", this.form).then(() => {
  68 + this.$router.push({ path: "/homePage" });
  69 + });
  70 + }
  71 + });
  72 + },
  73 + },
  74 +};
  75 +</script>
  76 +
  77 +<style scoped lang="scss">
  78 +.Login {
  79 + width: 100%;
  80 + height: 100%;
  81 + background-image: url("@/assets/images/login_bg.png"); /* 替换为你的图片路径 */
  82 + background-size: cover; /* 背景图片覆盖整个元素 */
  83 + background-position: center; /* 背景图片居中 */
  84 + background-repeat: no-repeat; /* 不重复背景图片 */
  85 + .login-wrap {
  86 + width: 626px;
  87 + position: absolute;
  88 + top: 50%;
  89 + right: 8%;
  90 + transform: translateY(-50%);
  91 + .login-wrap_header {
  92 + width: 510px;
  93 + margin: 0 auto;
  94 + color: #5ed0fa;
  95 + font-size: 40px;
  96 + text-align: center;
  97 + }
  98 + .login-wrap_container {
  99 + width: 100%;
  100 + height: 520px;
  101 + padding: 64px 67px 67px;
  102 + box-sizing: border-box;
  103 + background-image: url("@/assets/images/login-box-container.png");
  104 + background-size: 100% 100%;
  105 + background-repeat: no-repeat;
  106 + text-align: left;
  107 + position: relative;
  108 + .welcome-text {
  109 + width: 392px;
  110 + margin: 0 auto 20px;
  111 + font-size: 20px;
  112 + font-weight: 700;
  113 + color: #5ed0fa;
  114 + }
  115 + .login-wrap_container-form {
  116 + width: 392px;
  117 + margin: 0 auto;
  118 + :deep(.el-form-item__label) {
  119 + font-size: 16px;
  120 + font-weight: 700;
  121 + color: #5ed0fa;
  122 + padding: 0;
  123 + }
  124 + :deep(.el-input__inner) {
  125 + background: none;
  126 + border: none;
  127 + border-bottom: 1px solid #5ed0fa;
  128 + padding: 0;
  129 + border-radius: 0;
  130 + color: #5ed0fa;
  131 + }
  132 + .password-remind {
  133 + width: 100%;
  134 + margin-bottom: 30px;
  135 + display: flex;
  136 + -webkit-box-pack: justify;
  137 + -ms-flex-pack: justify;
  138 + -webkit-box-align: center;
  139 + align-items: center;
  140 + justify-content: space-between;
  141 + .user-register {
  142 + color: #5ed0fa;
  143 + font-weight: 700;
  144 + cursor: pointer;
  145 + }
  146 + .forget-password {
  147 + color: #5ed0fa;
  148 + font-weight: 700;
  149 + cursor: pointer;
  150 + }
  151 + }
  152 + .login-button {
  153 + width: 100%;
  154 + height: 46px;
  155 + line-height: 46px;
  156 + text-align: center;
  157 + background-image: url("@/assets/images/login-btn.png");
  158 + background-size: 100%;
  159 + background-repeat: no-repeat;
  160 + cursor: pointer;
  161 + color: #5ed0fa;
  162 + font-size: 18px;
  163 + }
  164 + }
  165 + }
  166 + }
  167 +}
  168 +</style>
... ...
src/views/Systeminfo/AddDialog.vue 0 → 100644
  1 +<template>
  2 + <div class="addDialog">
  3 + <el-form :model="infoForm" size="small" label-width="100px">
  4 + <el-row :gutter="20">
  5 + <el-col :span="24">
  6 + <el-col :span="12">
  7 + <el-form-item label="主体企业">
  8 + <el-input
  9 + v-model="infoForm.name"
  10 + placeholder="请选择主体企业"
  11 + ></el-input>
  12 + </el-form-item>
  13 + </el-col>
  14 + <el-col :span="12">
  15 + <el-button
  16 + type="text"
  17 + icon="el-icon-circle-plus-outline"
  18 + size="small"
  19 + >点击新增企业</el-button
  20 + >
  21 + </el-col>
  22 + </el-col>
  23 + <el-col :span="24" class="company-info">
  24 + <el-col :span="12">企业归属:武侯区</el-col>
  25 + <el-col :span="12">社会信用代码:暂无</el-col>
  26 + <el-col :span="12">联系人:张三</el-col>
  27 + <el-col :span="12">联系电话:1358888888</el-col>
  28 + <el-col :span="12">公司地址:成都市茂业中心操作</el-col>
  29 + </el-col>
  30 + <el-col :span="24">
  31 + <el-form-item label="系统类型">
  32 + <el-input
  33 + v-model="infoForm.name"
  34 + placeholder="请选择系统类型"
  35 + ></el-input>
  36 + </el-form-item>
  37 + </el-col>
  38 + <el-col :span="12">
  39 + <el-form-item label="系统分类">
  40 + <el-input
  41 + v-model="infoForm.name"
  42 + placeholder="请选择系统分类"
  43 + ></el-input>
  44 + </el-form-item>
  45 + </el-col>
  46 + <el-col :span="12">
  47 + <el-form-item label="备案号">
  48 + <el-input
  49 + v-model="infoForm.name"
  50 + placeholder="请输入备案号"
  51 + ></el-input>
  52 + </el-form-item>
  53 + </el-col>
  54 + <el-col :span="12">
  55 + <el-form-item label="备案许可证">
  56 + <el-input
  57 + v-model="infoForm.name"
  58 + placeholder="请输入备案许可证"
  59 + ></el-input>
  60 + </el-form-item>
  61 + </el-col>
  62 + <el-col :span="12">
  63 + <el-form-item label="归属平台">
  64 + <el-input
  65 + v-model="infoForm.name"
  66 + placeholder="请输入归属平台"
  67 + ></el-input>
  68 + </el-form-item>
  69 + </el-col>
  70 + <el-col :span="12">
  71 + <el-form-item label="域名">
  72 + <el-input
  73 + v-model="infoForm.name"
  74 + placeholder="请输入域名"
  75 + ></el-input>
  76 + </el-form-item>
  77 + </el-col>
  78 + <el-col :span="12">
  79 + <el-form-item label="下载量">
  80 + <el-input
  81 + v-model="infoForm.name"
  82 + placeholder="请输入下载量"
  83 + ></el-input>
  84 + </el-form-item>
  85 + </el-col>
  86 + <el-col :span="12">
  87 + <el-form-item label="版本">
  88 + <el-input
  89 + v-model="infoForm.name"
  90 + placeholder="请输入版本"
  91 + ></el-input>
  92 + </el-form-item>
  93 + </el-col>
  94 + <el-col :span="12">
  95 + <el-form-item label="负责人姓名">
  96 + <el-input
  97 + v-model="infoForm.name"
  98 + placeholder="请输入负责人姓名"
  99 + ></el-input>
  100 + </el-form-item>
  101 + </el-col>
  102 + <el-col :span="12">
  103 + <el-form-item label="负责人电话">
  104 + <el-input
  105 + v-model="infoForm.name"
  106 + placeholder="请输入负责人电话"
  107 + ></el-input>
  108 + </el-form-item>
  109 + </el-col>
  110 + <el-col :span="24">
  111 + <el-form-item label="办公地址">
  112 + <el-input
  113 + v-model="infoForm.name"
  114 + placeholder="请输入办公地址"
  115 + ></el-input>
  116 + </el-form-item>
  117 + </el-col>
  118 + <el-col :span="24">
  119 + <el-form-item label="系统图标">
  120 + <el-input
  121 + v-model="infoForm.name"
  122 + placeholder="请输入系统图标"
  123 + ></el-input>
  124 + </el-form-item>
  125 + </el-col>
  126 + <el-col :span="24">
  127 + <el-form-item label="所属区县">
  128 + <el-input
  129 + v-model="infoForm.name"
  130 + placeholder="请输入所属区县"
  131 + ></el-input>
  132 + </el-form-item>
  133 + </el-col>
  134 + </el-row>
  135 + </el-form>
  136 + <div>
  137 + <el-button @click="$emit('close')">取 消</el-button>
  138 + <el-button type="primary" @click="$emit('close')">确 定</el-button>
  139 + </div>
  140 + </div>
  141 +</template>
  142 +
  143 +<script>
  144 +import { getCompanyInfoList } from "@/api/company";
  145 +export default {
  146 + name: "AddDialog",
  147 + props: [],
  148 + data() {
  149 + return {
  150 + infoForm: {
  151 + name: "",
  152 + },
  153 + value: "",
  154 + companyOptions: [],
  155 + options: [{ value: 1, label: "选项1" }],
  156 + dialogFormVisible: false,
  157 + };
  158 + },
  159 + mounted() {
  160 + this.getAllCompanyList();
  161 + },
  162 + methods: {
  163 + // 请求公司列表
  164 + getAllCompanyList() {
  165 + getCompanyInfoList().then((res) => {
  166 + console.log(res, '全部公司信息');
  167 + });
  168 + },
  169 + },
  170 +};
  171 +</script>
  172 +
  173 +<style></style>
... ...
vue.config.js 0 → 100644
  1 +const { defineConfig } = require('@vue/cli-service')
  2 +const path = require('path')
  3 +function resolve(dir) {
  4 + return path.join(__dirname, dir)
  5 +}
  6 +const CompressionPlugin = require('compression-webpack-plugin')
  7 +
  8 +module.exports = defineConfig({
  9 + // 如果你不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。
  10 + productionSourceMap: false,
  11 + transpileDependencies: true,
  12 + lintOnSave: false,
  13 + devServer: {
  14 + port: 8080,
  15 + open: true,
  16 + proxy: {
  17 + '/api': {
  18 + // 跨域请求的地址
  19 + target: 'http://8.130.38.56:8043/api',
  20 + changeOrigin: true, // 是否允许跨域请求,在本地会创建一个虚拟服务端,发送接收请求数据,这样服务端和服务端进行数据的交互就不会有跨域问题
  21 + // 路径重写,替换请求地址
  22 + pathRewrite: {
  23 + '^/api': ''
  24 + }
  25 + }
  26 + }
  27 + },
  28 + configureWebpack: {
  29 + name: '属地',
  30 + resolve: {
  31 + alias: {
  32 + '@': resolve('src')
  33 + }
  34 + },
  35 + plugins: [
  36 + // http://doc.ruoyi.vip/ruoyi-vue/other/faq.html#使用gzip解压缩静态文件
  37 + new CompressionPlugin({
  38 + cache: false, // 不启用文件缓存
  39 + test: /\.(js|css|html|jpe?g|png|gif|svg)?$/i, // 压缩文件格式
  40 + filename: '[path][base].gz[query]', // 压缩后的文件名
  41 + algorithm: 'gzip', // 使用gzip压缩
  42 + minRatio: 0.8, // 压缩比例,小于 80% 的文件不会被压缩
  43 + deleteOriginalAssets: false // 压缩后删除原文件
  44 + })
  45 + ],
  46 + },
  47 + // 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)(默认dist)
  48 + outputDir: 'dist',
  49 + // 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下)
  50 + assetsDir: 'static',
  51 +})
... ...