瀏覽代碼

合并冲突

master
甘明坤 3 年之前
父節點
當前提交
83bcfdb88d
共有 11 個檔案被更改,包括 551 行新增19 行删除
  1. +29
    -3
      .eslintrc.js
  2. +5
    -0
      Dockerfile
  3. +16
    -2
      README.md
  4. +36
    -0
      gps_card_admin_run.sh
  5. +57
    -0
      nginx/nginx.conf
  6. +30
    -0
      setup_development.sh
  7. +28
    -0
      setup_production.sh
  8. +31
    -0
      setup_test.sh
  9. +2
    -2
      src/utils/model.js
  10. +315
    -10
      src/views/off-limits-manage/off-limits-main/off-limits-type/index.vue
  11. +2
    -2
      vue.config.js

+ 29
- 3
.eslintrc.js 查看文件

@@ -1,4 +1,5 @@
module.exports = {
// 取消 自定义eslintrc验证
/* module.exports = {
root: true,
parserOptions: {
parser: 'babel-eslint',
@@ -11,8 +12,6 @@ module.exports = {
},
extends: ['plugin:vue/recommended', 'eslint:recommended'],

// add your custom rules here
//it is base on https://github.com/vuejs/eslint-config-vue
rules: {
"vue/max-attributes-per-line": [0, {
"singleline": 10,
@@ -199,3 +198,30 @@ module.exports = {
'array-bracket-spacing': [2, 'never']
}
}
*/
module.exports = {
root: true,
env: {
node: true,
},
extends: ["plugin:vue/essential", "eslint:recommended"],
parserOptions: {
parser: "babel-eslint",
},
rules: {
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
/* "prettier/prettier": "off" */
},
overrides: [
{
files: [
"**/__tests__/*.{j,t}s?(x)",
"**/tests/unit/**/*.spec.{j,t}s?(x)",
],
env: {
jest: true,
},
},
],
};

+ 5
- 0
Dockerfile 查看文件

@@ -0,0 +1,5 @@
FROM nginx
RUN mkdir /app
COPY dist /app
COPY nginx/nginx.conf /etc/nginx/nginx.conf
EXPOSE 80

+ 16
- 2
README.md 查看文件

@@ -1,7 +1,7 @@
<!--
* @Date: 2021-11-29 11:14:13
* @LastEditors: JinxuChen
* @LastEditTime: 2021-12-01 18:17:18
* @LastEditors: Please set LastEditors
* @LastEditTime: 2021-12-03 16:10:08
* @FilePath: \GpsCardAdmin\README.md
* @description:
-->
@@ -21,3 +21,17 @@ FEATURE
`2021年12月1日`
FEATURE
- 完成 静态页面编写与交互


## v1.0.2F
`2021年12月2日`
FEATURE
- 增加 docker部署文件
- 修改 docker部署文件

## v1.0.3F
`2021年12月3日`
FEATURE
- merge off-limits-type
- 增加 禁入类别
- 修复 打包路径错误的问题

+ 36
- 0
gps_card_admin_run.sh 查看文件

@@ -0,0 +1,36 @@
#!/bin/bash
###
# @Date: 2021-11-15 09:37:49
# @LastEditors: JinxuChen
# @LastEditTime: 2021-12-02 15:19:14
# @FilePath: \GpsCardAdmin\gps_card_admin_run.sh
# @description: 功能
###
environment=$1
version=$2
echo "环境变量为${environment},版本为$version!"
if [[ ${environment} = 'production' ]]; then
echo "开始远程构建容器"
docker stop gps_card_admin_web || true;
docker rm gps_card_admin_web || true;
docker rmi -f $(docker images | grep registry.cn-shanghai.aliyuncs.com/gps_card/gps_card_admin_web | awk '{print $3}')
#docker login --username=telpo_linwl@1111649216405698 --password=telpo#1234 registry.cn-shanghai.aliyuncs.com;
docker login --username=rzl_wangjx@1111649216405698 --password=telpo.123 registry.cn-shanghai.aliyuncs.com
docker pull registry.cn-shanghai.aliyuncs.com/gps_card/gps_card_admin_web:$version
docker run -p 8803:80 -d --restart=always --name gps_card_admin_web registry.cn-shanghai.aliyuncs.com/gps_card/gps_card_admin_web:$version;
#删除产生的None镜像
docker rmi -f $(docker images | grep none | awk '{print $3}')
docker ps -a

elif [[ ${environment} == 'test' ]]; then
echo "开始在测试环境远程构建容器"
docker stop gps_card_admin_web || true
docker rm gps_card_admin_web || true
docker rmi -f $(docker images | grep 139.224.254.18:5000/gps_card_admin_web | awk '{print $3}')
docker pull 139.224.254.18:5000/gps_card_admin_web:$version
docker run -p 8803:80 -d --restart=always --name gps_card_admin_web 139.224.254.18:5000/gps_card_admin_web:$version;
#删除产生的None镜像
docker rmi -f $(docker images | grep none | awk '{print $3}')
docker ps -a

fi

+ 57
- 0
nginx/nginx.conf 查看文件

@@ -0,0 +1,57 @@
#user nobody;
worker_processes 1;

#error_log logs/error.log;
#error_log logs/error.log notice;
error_log /var/log/nginx/error.log warn;

pid /var/run/nginx.pid;


events {
accept_mutex on; #设置网路连接序列化,防止惊群现象发生,默认为on
multi_accept on; #设置一个进程是否同时接受多个网络连接,默认为off
use epoll; #事件驱动模型,select|poll|kqueue|epoll|resig|/dev/poll|eventport
worker_connections 1024;
}


http {
include mime.types;
default_type application/octet-stream;

log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

#access_log logs/access.log main;
access_log /var/log/nginx/access.log main;

sendfile on;
#tcp_nopush on;

#keepalive_timeout 0;
keepalive_timeout 65;


server {
listen 80;
server_name localhost;

#charset koi8-r;
charset utf-8;

location / {
root /app; # 指向目录
index index.html;
try_files $uri $uri/ /index.html;
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
}

+ 30
- 0
setup_development.sh 查看文件

@@ -0,0 +1,30 @@
###
# @Author: JinxuChen
# @Date: 2021-11-15
# @LastEditTime: 2021-12-02 15:19:22
# @LastEditors: JinxuChen
# @Description: In User Settings Edit
# @FilePath: \GpsCardAdmin\setup_development.sh
###
#!/bin/bash
npm -v
npm config set registry https://registry.npm.taobao.org
npm config list
npm install
npm run build-test
image_version=`date +%Y%m%d%H%M`;
docker stop gps_card_admin_web || true;
# 删除gps_parent_web容器
docker rm gps_card_admin_web || true;
# 删除镜像
docker rmi -f $(docker images | grep telpo/gps_card_admin_web | awk '{print $3}')
# 构建telpo/gps_card_admin_web:$image_version镜像
docker build . -t telpo/gps_card_admin_web:$image_version;
#删除产生的None镜像
docker rmi -f $(docker images | grep none | awk '{print $3}')
# 查看镜像列表
docker images;
# 启动容器
docker run -p 8803:80 -d --restart=always --name gps_card_admin_web telpo/gps_card_admin_web:$image_version;
# 查看日志
docker logs gps_card_admin_web;

+ 28
- 0
setup_production.sh 查看文件

@@ -0,0 +1,28 @@
###
# @Author: JinxuChen
# @Date: 2021-11-15
# @LastEditTime: 2021-12-02 15:17:27
# @LastEditors: JinxuChen
# @Description: In User Settings Edit
# @FilePath: \GpsCardAdmin\setup_production.sh
###
#!/bin/bash
npm -v
npm install
npm run build
image_version=$version;
# 删除镜像
docker rmi -f $(docker images | grep registry.cn-shanghai.aliyuncs.com/gps_card/gps_card_admin_web | awk '{print $3}')

docker build . -t telpo/gps_card_admin_web:$image_version;
#TODO:推送镜像到阿里仓库
echo '=================开始推送镜像======================='
#docker login --username=telpo_linwl@1111649216405698 --password=telpo#1234 registry.cn-shanghai.aliyuncs.com;
docker login --username=rzl_wangjx@1111649216405698 --password=telpo.123 registry.cn-shanghai.aliyuncs.com
docker tag telpo/gps_card_admin_web:$image_version registry.cn-shanghai.aliyuncs.com/gps_card/gps_card_admin_web:$image_version
docker push registry.cn-shanghai.aliyuncs.com/gps_card/gps_card_admin_web:$image_version
echo '=================推送镜像完成======================='
#删除产生的None镜像
docker rmi -f $(docker images | grep none | awk '{print $3}')
# 查看镜像列表
docker images;

+ 31
- 0
setup_test.sh 查看文件

@@ -0,0 +1,31 @@
###
# @Author: JinxuChen
# @Date: 2021-11-15
# @LastEditTime: 2021-12-02 15:17:38
# @LastEditors: JinxuChen
# @Description: In User Settings Edit
# @FilePath: \GpsCardAdmin\setup_test.sh
###
#!/usr/bin/env bash
npm -v
npm config set registry https://registry.npm.taobao.org
npm config list
npm install
npm run build-test

image_version=$version
# 删除镜像
docker rmi -f $(
docker images | grep 139.224.254.18:5000/gps_card_admin_web | awk '{print $3}'
)
# 构建gps_card_admin:$image_version镜像
docker build . -t telpo/gps_card_admin_web:$image_version;
#TODO:推送镜像到私有仓库
echo '=================开始推送镜像======================='
docker tag telpo/gps_card_admin_web:$image_version 139.224.254.18:5000/gps_card_admin_web:$image_version
docker push 139.224.254.18:5000/gps_card_admin_web:$image_version
echo '=================推送镜像完成======================='
#删除产生的None镜像
docker rmi -f $(docker images | grep none | awk '{print $3}')
# 查看镜像列表
docker images

+ 2
- 2
src/utils/model.js 查看文件

@@ -1,8 +1,8 @@
/*
* @Date: 2021-11-30 15:09:25
* @LastEditors: JinxuChen
* @LastEditTime: 2021-12-01 18:17:55
* @LastEditTime: 2021-12-03 15:26:11
* @FilePath: \GpsCardAdmin\src\utils\model.js
* @description: 版本号
*/
export const VersionModel = '1.0.1';
export const VersionModel = '1.0.3';

+ 315
- 10
src/views/off-limits-manage/off-limits-main/off-limits-type/index.vue 查看文件

@@ -1,27 +1,332 @@
<!--
* @Date: 2021-11-30 09:28:55
* @LastEditors: JinxuChen
* @LastEditTime: 2021-11-30 16:47:31
* @LastEditTime: 2021-12-03 15:22:29
* @FilePath: \GpsCardAdmin\src\views\off-limits-manage\off-limits-main\off-limits-type\index.vue
* @description:
-->
<template>
<div>
禁用类别
<div class="custom-tree-container">

<div class="block">

<el-tree
:data="data"
node-key="id"
:default-expand-all="false"
:render-after-expand="true"
:expand-on-click-node="false">
<span class="custom-tree-node" slot-scope="{ node, data }">
<span>{{ node.label }} ( {{ data.no }} )</span><span></span>

<div class="Operation">
<span>
<el-button v-if=" data.children"
type="text"
size="mini"
@click="() => append(node,data)">
增加类别
</el-button>
<el-button v-if="!data.children"
type="text"
size="mini"
@click="() => modify(node, data)">
修改
</el-button>
<el-button v-if="!data.children"
type="text"
size="mini"
@click="() => remove(node, data)">
删除
</el-button>
</span></div>
</span>
</el-tree>
<el-row>

<el-col :span="8"><div class="grid-content bg-purple-light add-btn" >
<el-button type="text" @click="dialogVisible = true"> 增加场景</el-button>
</div></el-col>



</el-row>

<el-dialog
title="新增场景"
:visible.sync="dialogVisible"
width="50%"
>
<el-form :model="currentAddScenes" ref="currentAddScenes">
<el-form-item label="场景"
prop="inputNew"
:rules="[
{ required: true, message: '场景不能为空'}
]"
>
<el-input v-model="currentAddScenes.inputNew" placeholder="请输入场景"></el-input>

</el-form-item>
<el-form-item>

<el-button type="primary" @click="submitScenesForm('currentAddScenes')">提交</el-button>
<el-button @click="resetForm('currentAddScenes')">重置</el-button>
<el-button @click="dialogVisible = false">取 消</el-button>
</el-form-item>


</el-form>
</el-dialog>

<el-dialog
:title="titleTypeAddorModify"
:visible.sync="dialogVisibleType"
width="50%"
>
<el-form :model="currentAddType" ref="currentAddType">
<el-form-item label="类别"
prop="typeLabel"
:rules="[
{ required: true, message: '类别不能为空'}
]"
>
<el-input v-model="currentAddType.typeLabel" placeholder="请输入类别"></el-input>

</el-form-item>
<el-form-item>

<el-button type="primary" @click="submitForm('currentAddType')">提交</el-button>
<el-button @click="resetForm('currentAddType')">重置</el-button>
<el-button @click="dialogVisibleType = false">取 消</el-button>
</el-form-item>



</el-form>
</el-dialog>


<el-dialog
title="修改类别"
:visible.sync="dialogVisibleM"
width="50%"
>
<el-input v-model="inputModify" placeholder="请输入类别"></el-input>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisibleM = false">取 消</el-button>
<el-button type="primary" @click="() => save()">确 定</el-button>
</span>
</el-dialog>

</div>
</div>
</template>

<script>
let id = 1000;
export default {
name:'',
data(){
return {
name: ''
}
}
const data = [{
id: 1,
no:101,
label: '场景1',
children: [{
id: 4,
no:101001,
label: '类别 1-1'
}]
}, {
id: 2,
no:102,
label: '场景 2',
children: [{
id: 5,
no:102001,
label: '类别 2-1'
}, {
id: 6,
no:102002,
label: '类别 2-2'
}]
}
];
return {
titleTypeAddorModify:"新增类别",
inputNew: '',
inputType:'',
inputModify: '',
parentNode:{},
dialogVisible: false,
dialogVisibleType:false,
dialogVisibleM: false,
currentData:{},
currentParentData:{},
currentAddScenes:{
inputNew:"",
},
currentAddType:{
typeLabel:""
},

data: JSON.parse(JSON.stringify(data))
}
},
methods: {
submitScenesForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
//alert('submit!');
this.addScenes();

} else {
console.log('error submit!!');
return false;
}
});
},
submitForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
//alert('submit!');
if(this.titleTypeAddorModify=="增加类别")
{
this.addType();
}
else
{
this.save();
}

} else {
console.log('error submit!!');
return false;
}
});
},
resetForm(formName) {
this.$refs[formName].resetFields();
},
append(node,data) {
const parent = node;
this.currentParentData=parent.data;
this.dialogVisibleType=true;
this.titleTypeAddorModify="增加类别";

if(this.$refs['currentAddType']){
this.resetForm('currentAddType');
}

},

addScenes(){
this.dialogVisible=false;
let no=this.data[this.data.length-1].no+1;
let id=this.data[this.data.length-1].id+1;

this.data.push( {
id: id,
no:no,
label: this.currentAddScenes.inputNew,
children: []
});


},
addType(){

this.dialogVisibleType=false;

//模拟保存
this.data.forEach(i=>{

if(i.id==this.currentParentData.id)
{

let no,id;
if(i.children && i.children.length>0){
no=i.children[i.children.length-1].no+1;
id=i.children[i.children.length-1].id+1;
}
else{
no=i.no+'001';
id=i.id+'001';
}


i.children.push({
id:id,
label: this.currentAddType.typeLabel,
no:no
});
}
});

//this.inputType
},
remove(node, data) {
const parent = node.parent;
const children = parent.data.children || parent.data;
const index = children.findIndex(d => d.id === data.id);
children.splice(index, 1);
},
modify(node,data){
this.titleTypeAddorModify="修改类别";
this.dialogVisibleType=true;
this.currentData=data;
//this.dialogVisibleM=true;
//this.inputModify=data.label;
this.currentAddType.typeLabel=data.label;
},
save(){

//模拟保存:
this.dialogVisibleType = false
this.data.forEach(element => {
if(element.children)
{
element.children.forEach(i=>{
if(i.id===this.currentData.id)
{
i.label=this.currentAddType.typeLabel;
}
});

}
});


},
renderContent(h, { node, data, store }) {
return (
<span class="custom-tree-node">
<span>{node.label}</span>
<span>
<el-button size="mini" type="text" on-click={ () => this.append(data) }>Append</el-button>
<el-button v-if="node.children.len==0" size="mini" type="text" on-click={ () => this.remove(node, data) }>Delete</el-button>
</span>
</span>);
}
}
}
</script>

<style scoped>
<style>
.custom-tree-node {
flex: 1;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 14px;
padding-right: 8px;
}
.custom-tree-container .block{
width: 50%;
margin-top: 5%;
margin-left: 5%;
}

.add-btn {
margin-left:10%;
}

</style>
</style>

+ 2
- 2
vue.config.js 查看文件

@@ -24,9 +24,9 @@ module.exports = {
* In most cases please use '/' !!!
* Detail: https://cli.vuejs.org/config/#publicpath
*/
publicPath: '/',
publicPath: './',
outputDir: 'dist',
assetsDir: 'static',
/* assetsDir: 'static', */
lintOnSave: process.env.NODE_ENV === 'development',
productionSourceMap: false,
devServer: {


Loading…
取消
儲存