This commit is contained in:
13713575202 2025-04-18 17:29:32 +08:00
commit 764c59a18f
29 changed files with 102 additions and 71 deletions

View File

@ -22,7 +22,7 @@ VUE_APP_EMQX_API_USER_NAME = 'admin'
VUE_APP_EMQX_API_PASSWORD = 'sznyb@2025'
# EMQX消息服务器连接地址
VUE_APP_EMQX_SERVER_URL = 'ws://localhost:8083/mqtt'
VUE_APP_EMQX_SERVER_URL = 'ws://47.109.205.240:8083/mqtt'
# 高德地图参数
VUE_APP_GAO_DE_SECURITYJSCODE = '77ef0c4c95553799630ad60dd9b692d7'

View File

@ -9,7 +9,7 @@ VUE_APP_BASE_API = '/prod-api'
# EMQX接口账号后端地址和EMQX接口地址部署时通过nginx配置代理
VUE_APP_EMQX_API_USER_NAME = 'admin'
VUE_APP_EMQX_API_PASSWORD = 'public'
VUE_APP_EMQX_API_PASSWORD = 'sznyb@2025'
# EMQX消息服务器连接地址,使用空字符串则会自动获取服务器地址
VUE_APP_EMQX_SERVER_URL = 'ws://47.117.148.147:8083/mqtt'

View File

@ -48,7 +48,7 @@ module.exports = {
'camelcase': [0, {
'properties': 'always'
}],
'comma-dangle': [0, 'always'],
'comma-dangle': [1, 'off'],
'comma-spacing': [2, {
'before': false,
'after': true

View File

@ -96,11 +96,12 @@
"@vue/cli-service": "4.4.6",
"babel-eslint": "10.1.0",
"chalk": "4.1.0",
"compression-webpack-plugin": "6.x",
"connect": "3.6.6",
"eslint": "7.15.0",
"eslint-plugin-vue": "7.2.0",
"prettier": "^3.4.2",
"lint-staged": "10.5.3",
"prettier": "^3.4.2",
"runjs": "4.4.2",
"sass": "1.32.13",
"sass-loader": "10.1.1",

View File

@ -3,7 +3,7 @@
<ul class="upload-list">
<transition-group class="animation" name="el-zoom-in-top">
<li class="upload-list_item" v-for="(item, index) in fileList" :key="item">
<video class="video" controls :src="'/dev-api' + item"></video>
<video class="video" controls :src="item"></video>
<i class="el-icon-delete" v-show="!disabled" @click="handleDel(index)"></i>
</li>
</transition-group>

View File

@ -7,7 +7,7 @@ import { getToken } from '@/utils/auth';
NProgress.configure({ showSpinner: false });
const whiteList = ['/login', '/auth-redirect', '/bind', '/register', '/preview'];
const whiteList = ['/login', '/auth-redirect', '/bind', '/register', '/preview', '/dataV'];
router.beforeEach((to, from, next) => {
NProgress.start();

View File

@ -13,7 +13,8 @@
:key="germplasm.germplasmId"
:label="germplasm.germplasmName"
:value="germplasm.germplasmId"
></el-option>
>
</el-option>
</el-select>
</el-form-item>
<!-- <el-form-item label="地块" prop="landId">

View File

@ -17,12 +17,20 @@
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
<el-form-item class="fr">
<el-button v-if="!isAdmin" type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['agriculture:employee:add']"
>新增</el-button
>
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['agriculture:employee:export']"
>导出</el-button
<el-button
v-if="!isAdmin"
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['agriculture:employee:add']"
>
新增
</el-button>
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['agriculture:employee:export']">
导出
</el-button>
</el-form-item>
</el-form>
</el-card>

View File

@ -22,11 +22,12 @@
size="mini"
@click="handleAdd"
v-hasPermi="['agriculture:germplasm:add']"
>新增</el-button
>
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['agriculture:germplasm:export']"
>导出</el-button
>
新增
</el-button>
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['agriculture:germplasm:export']">
导出
</el-button>
</el-form-item>
</el-form>
</el-card>

View File

@ -21,8 +21,8 @@
</template>
<script>
import AMapLoader from '@amap/amap-jsapi-loader';
import { listBaseinfo } from '@/api/agriculture/baseinfo';
// import AMapLoader from '@amap/amap-jsapi-loader';
// import { listBaseinfo } from '@/api/agriculture/baseinfo';
export default {
name: 'DrawArea',
props: {

View File

@ -281,7 +281,7 @@ export default {
//id
mapStyle: 'amap://styles/802500eb9c17892dd91047988cc1ece1',
zoom: 16, //
//center: baseCoordinate, //
// center: baseCoordinate, //
layers: [new this.AMap.TileLayer.Satellite()],
doubleClickZoom: false,
});
@ -510,6 +510,7 @@ export default {
this.map.add(this.AreaLabelGroup);
this.map.add(this.AreaPolygonGroup);
this.map.setFitView([...this.AreaPolygonGroup]);
this.isWatch = true;
},
/* 创建设备marker点 */

View File

@ -53,7 +53,7 @@
</div>
<div class="flex">
<div class="hbm345 w40 flex aic jcc">
<img :src="$baseUrl + device.imgUrl.split(',')[0]" class="w100" />
<img :src="device.imgUrl.split(',')[0]" class="w100" />
</div>
<div class="hbm345 w60">
<el-form :model="form" ref="form" label-width="120px" :inline="false" size="normal" class="h95 flex fdc jcsa margin-top-20">

View File

@ -36,8 +36,16 @@
<el-table-column label="基地负责人" align="center" prop="baseLeader" />
<el-table-column label="基地负责人电话" align="center" prop="leaderTel" />
<el-table-column label="基地负责人地址" align="center" prop="baseAddress" />
<el-table-column label="基地面积" align="center" prop="baseArea" />
<el-table-column label="基地海拔" align="center" prop="baseAltitude" />
<el-table-column label="基地面积" align="center" prop="baseArea">
<template slot-scope="scope">
<span>{{ scope.row.baseArea ? `${scope.row.baseArea}` : '' }}</span>
</template>
</el-table-column>
<el-table-column label="基地海拔" align="center" prop="baseAltitude">
<template slot-scope="scope">
<span>{{ scope.row.baseAltitude ? `${scope.row.baseAltitude}` : '' }}</span>
</template>
</el-table-column>
<!-- <el-table-column label="现场图片" align="center" prop="baseImg" />
<el-table-column label="基地描述" align="center" prop="baseDes" /> -->
<!-- <el-table-column label="备注" align="center" prop="remark" />

View File

@ -27,7 +27,7 @@
<div class="r-image">
<span @click="removeImage(index)" class="el-icon-close"></span>
<div class="image-box">
<img :src="item && $baseUrl + item.url" />
<img :src="item && item.url" />
<span @click="addImage(index)" class="el-icon-edit-outline"></span>
</div>
</div>

View File

@ -30,7 +30,7 @@
<div class="r-image">
<span @click="removeImage(index)" class="el-icon-close"></span>
<div class="image-box">
<img :src="item && $baseUrl + item.url" />
<img :src="item && item.url" />
<span @click="addImage(index)" class="el-icon-edit-outline"></span>
</div>
</div>

View File

@ -35,7 +35,7 @@
<div class="r-image">
<span @click="removeImage(index)" class="el-icon-close"></span>
<div class="image-box">
<img :src="item && $baseUrl + item.url" />
<img :src="item && item.url" />
<span @click="addImage(index)" class="el-icon-edit-outline"></span>
</div>
</div>

View File

@ -41,7 +41,7 @@
<div class="r-image">
<span @click="removeItem(index)" class="el-icon-close"></span>
<div class="image-box margin-top-25 width-50 height-50">
<img :src="item && $baseUrl + item.taskImage" />
<img :src="item && item.taskImage" />
<span @click="addItem(index)" class="el-icon-edit-outline"></span>
</div>
</div>

View File

@ -10,7 +10,7 @@
<el-image
class="width-40 height-40"
v-if="row.taskImages"
:src="$baseUrl + row.taskImages.split(',')[0]"
:src="row.taskImages.split(',')[0]"
fit="fill"
:lazy="true"
></el-image>

View File

@ -27,7 +27,7 @@
<div class="r-image">
<span @click="removeImage(index)" class="el-icon-close"></span>
<div class="image-box">
<img :src="item && $baseUrl + item.url" />
<img :src="item && item.url" />
<span @click="addImage(index)" class="el-icon-edit-outline"></span>
</div>
</div>

View File

@ -80,7 +80,7 @@
</p> -->
</div>
<div>
<el-image class="width-60 height-60 margin-top-20 border-radius-10" :src="$baseUrl + item.shopImg" fit="fill" :lazy="true"></el-image>
<el-image class="width-60 height-60 margin-top-20 border-radius-10" :src="item.shopImg" fit="fill" :lazy="true"></el-image>
</div>
<span @click="remove(index)" class="el-icon-close"></span>
</li>

View File

@ -2,7 +2,7 @@
<div class="banner">
<el-carousel height="176px" v-if="data.data && data.data.length > 0">
<el-carousel-item v-for="(item, index) in data.data" :key="index">
<img :src="$baseUrl + item.url" />
<img :src="item.url" />
</el-carousel-item>
</el-carousel>
<div class="image-null" v-else><span class="el-icon-picture"></span></div>

View File

@ -3,7 +3,7 @@
<div :class="$isMobile ? 'mobileImain' : 'pcImain'">
<template v-if="data.data.length > 0">
<a v-for="(item, index) in data.data" :key="index" :href="item.link" target="_blank" rel="noopener noreferrer">
<div class="fimg"><img :src="$baseUrl + item.url" /></div>
<div class="fimg"><img :src="item.url" /></div>
</a>
</template>
<template v-else>

View File

@ -2,7 +2,7 @@
<div class="image-box" :class="className">
<template v-if="data.data && data.data.length > 0">
<a v-for="(item, index) in data.data" :key="index" :href="item.link">
<img :src="$baseUrl + item.url" />
<img :src="item.url" />
</a>
</template>
<template v-else>

View File

@ -6,7 +6,7 @@
<div class="ibox_m">
<div class="szhjss">
<div class="item" v-for="(item, index) in data.data" :key="index">
<div class="img"><img :src="$baseUrl + item.url" /></div>
<div class="img"><img :src="item.url" /></div>
<div class="con">
<p>
<b>{{ item.value }}</b

View File

@ -11,7 +11,7 @@
{{ item.actualStart }}-{{ item.actualFinish }}
</div>
<div class="item_m">
<div class="img"><img :src="$baseUrl + item.taskImage" /></div>
<div class="img"><img :src="item.taskImage" /></div>
<div class="con">
<div class="t">
负责人<b>{{ item.taskHeadName }}</b>

View File

@ -6,7 +6,7 @@
<div class="ibox_m">
<div class="smrz">
<div class="img">
<img v-if="data.data.sellproImg" :src="$baseUrl + data.data.sellproImg" />
<img v-if="data.data.sellproImg" :src="data.data.sellproImg" />
<img v-else src="@/assets/images/trace/1.jpg" />
</div>
<div class="con">

View File

@ -8,7 +8,7 @@
<el-carousel class="carousel" :interval="4000" type="card" arrow="always" indicator-position="none">
<template v-if="data.data.length > 0">
<el-carousel-item class="carouselItem" v-for="(item, index) in data.data" :key="index">
<a :href="item.link" target="_blank"><img :src="$baseUrl + item.url" /></a>
<a :href="item.link" target="_blank"><img :src="item.url" /></a>
</el-carousel-item>
</template>
<template>

View File

@ -7,7 +7,7 @@
<div class="dpif">
<div class="item" v-for="(item, index) in data.data" :key="index">
<a :href="item.shopUrl" target="_blank">
<div class="img"><img :src="$baseUrl + item.shopImg" /></div>
<div class="img"><img :src="item.shopImg" /></div>
<div class="con">
<div class="t">{{ item.shopName }}</div>
<div class="m">

View File

@ -1,13 +1,14 @@
'use strict'
const path = require('path')
'use strict';
const path = require('path');
const CompressionWebpackPlugin = require('compression-webpack-plugin');
function resolve(dir) {
return path.join(__dirname, dir)
return path.join(__dirname, dir);
}
const name = process.env.VUE_APP_TITLE || '智慧农业智能控制系统' // 网页标题
const name = process.env.VUE_APP_TITLE || '智慧农业智能控制系统'; // 网页标题
const port = process.env.VUE_PORT || process.env.npm_config_port || 80 // 端口
const port = process.env.VUE_PORT || process.env.npm_config_port || 80; // 端口
// vue.config.js 配置说明
// 官方vue.config.js 参考文档 https://cli.vuejs.org/zh/config/#css-loaderoptions
// 这里只列一部分,具体配置参考文档
@ -35,32 +36,40 @@ module.exports = {
target: process.env.VUE_APP_SERVER_API_URL,
changeOrigin: true,
pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: ''
}
['^' + process.env.VUE_APP_BASE_API]: '',
},
},
'/api/v4': {
target: process.env.VUE_APP_EMQX_API_URL,
changeOrigin: true
changeOrigin: true,
// logLevel: 'debug',
}
},
},
https: false,
disableHostCheck: true
disableHostCheck: true,
},
configureWebpack: {
name: name,
resolve: {
alias: {
'@': resolve('src')
}
}
'@': resolve('src'),
},
},
plugins: [
// 开启 Gzip 压缩
new CompressionWebpackPlugin({
test: /\.(js|css|html|svg)$/,
threshold: 10240,
minRatio: 0.8,
}),
],
},
chainWebpack(config) {
config.plugins.delete('preload') // TODO: need test
config.plugins.delete('prefetch') // TODO: need test
config.plugins.delete('preload'); // TODO: need test
config.plugins.delete('prefetch'); // TODO: need test
// set svg-sprite-loader
config.module.rule('svg').exclude.add(resolve('src/assets/icons')).end()
config.module.rule('svg').exclude.add(resolve('src/assets/icons')).end();
config.module
.rule('icons')
.test(/\.svg$/)
@ -69,9 +78,9 @@ module.exports = {
.use('svg-sprite-loader')
.loader('svg-sprite-loader')
.options({
symbolId: 'icon-[name]'
symbolId: 'icon-[name]',
})
.end()
.end();
config.when(process.env.NODE_ENV !== 'development', (config) => {
config
@ -80,10 +89,11 @@ module.exports = {
.use('script-ext-html-webpack-plugin', [
{
// `runtime` must same as runtimeChunk name. default is `runtime`
inline: /runtime\..*\.js$/
}
inline: /runtime\..*\.js$/,
},
])
.end()
.end();
config.optimization.splitChunks({
chunks: 'all',
cacheGroups: {
@ -91,28 +101,29 @@ module.exports = {
name: 'chunk-libs',
test: /[\\/]node_modules[\\/]/,
priority: 10,
chunks: 'initial' // only package third parties that are initially dependent
chunks: 'initial', // only package third parties that are initially dependent
},
elementUI: {
name: 'chunk-elementUI', // split elementUI into a single package
priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app
test: /[\\/]node_modules[\\/]_?element-ui(.*)/ // in order to adapt to cnpm
test: /[\\/]node_modules[\\/]_?element-ui(.*)/, // in order to adapt to cnpm
},
commons: {
name: 'chunk-commons',
test: resolve('src/components'), // can customize your rules
minChunks: 3, // minimum common number
priority: 5,
reuseExistingChunk: true
}
}
})
reuseExistingChunk: true,
},
},
});
// eslint-disable-next-line no-sequences
config.optimization.runtimeChunk('single'),
{
from: path.resolve(__dirname, './public/robots.txt'), // 防爬虫文件
to: './' // 到根目录下
}
})
}
}
{
from: path.resolve(__dirname, './public/robots.txt'), // 防爬虫文件
to: './', // 到根目录下
};
});
},
};