Compare commits

...

8 Commits
main ... dev

Author SHA1 Message Date
Cc ce63b7dfcc 同步 2025-04-22 13:42:10 +08:00
Cc 090bbaf977 传感器同步 2025-03-24 09:20:23 +08:00
Cc d4bced25ce bug 2025-03-11 13:54:21 +08:00
Cc 746657d25f 自适应打印图片 2025-02-28 09:24:56 +08:00
Cc 5ad085bf27 传感器类型 2025-02-21 15:02:56 +08:00
Cc bd27dbc86a 二维码模板 2025-02-20 14:27:17 +08:00
Cc ab81562fdd 模板修改中文修改 2025-02-18 16:00:31 +08:00
Cc 573c35c881 一物一码 2025-02-18 08:19:37 +08:00
135 changed files with 7153 additions and 928 deletions

View File

@ -4,9 +4,10 @@
"module": "commonjs", "module": "commonjs",
"allowSyntheticDefaultImports": true, "allowSyntheticDefaultImports": true,
"baseUrl": "./", "baseUrl": "./",
"paths": { "paths": {
"@/*": ["src/*"] "@/*": ["src/*"]
} }
}, },
"exclude": ["node_modules", "*.ignore.*"] "exclude": ["node_modules", "*.ignore.*"]
} }

View File

@ -37,6 +37,9 @@
"@ckeditor/ckeditor5-vue": "^4.0.1", "@ckeditor/ckeditor5-vue": "^4.0.1",
"@element-plus/icons": "^0.0.11", "@element-plus/icons": "^0.0.11",
"@tinymce/tinymce-vue": "^5.0.0", "@tinymce/tinymce-vue": "^5.0.0",
"@vue-office/docx": "^1.6.3",
"@vue-office/excel": "^1.7.14",
"@vue-office/pdf": "^2.0.10",
"axios": "^0.21.1", "axios": "^0.21.1",
"clipboard": "^2.0.8", "clipboard": "^2.0.8",
"core-js": "^3.15.0", "core-js": "^3.15.0",
@ -50,7 +53,9 @@
"jsencrypt": "^3.2.0", "jsencrypt": "^3.2.0",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"mockjs": "^1.1.0", "mockjs": "^1.1.0",
"node-ssh": "^13.2.0",
"nprogress": "^0.2.0", "nprogress": "^0.2.0",
"qrcode": "^1.5.4",
"qs": "^6.10.1", "qs": "^6.10.1",
"quill-image-drop-module": "^1.0.3", "quill-image-drop-module": "^1.0.3",
"quill-image-resize-module": "^3.0.0", "quill-image-resize-module": "^3.0.0",
@ -63,6 +68,7 @@
"vue-echarts": "^6.0.0-rc.6", "vue-echarts": "^6.0.0-rc.6",
"vue-quill-editor": "^3.0.6", "vue-quill-editor": "^3.0.6",
"vue-router": "^4.0.0-rc.6", "vue-router": "^4.0.0-rc.6",
"vue3-print-nb": "^0.1.4",
"vuex": "^4.0.0-rc.2", "vuex": "^4.0.0-rc.2",
"xlsx": "^0.18.5" "xlsx": "^0.18.5"
}, },

View File

@ -45,3 +45,92 @@ export function getCategoryDict(data) {
data, data,
}); });
} }
// 知识库分类树
export function getTypeCategoryTree(data) {
return request({
url: '/knowledgeCategory/categoryTree',
method: 'get',
data,
});
}
// 知识库分类
export function getTypeList(data) {
return request({
url: '/knowledgeCategory/list',
method: 'get',
data,
});
}
// 添加分类
export function doTypeAdd(data) {
return request({
url: '/knowledgeCategory/add',
method: 'post',
data,
});
}
// 编辑分类
export function doTypeEdit(data) {
return request({
url: '/knowledgeCategory/update',
method: 'post',
data,
});
}
// 删除分类
export function doTypeDel(data) {
return request({
url: '/knowledgeCategory/delete?categoryId=' + data.categoryId,
method: 'post',
data,
});
}
// 知识库查询
export function getKnowledgeList(data) {
let param = '?page=' + data.page + '&size=' + data.size;
if (data.title != undefined && data.title != '') {
param += '&title=' + data.title;
}
if (data.category != undefined && data.category != '') {
param += '&category=' + data.category;
}
return request({
url: '/knowledge/list' + param,
method: 'get',
data,
});
}
// 附件上传
export function upload(data) {
return request({
url: '/file/upload',
method: 'post',
data,
});
}
// 附件删除
export function fileDel(data) {
return request({
url: '/file/del',
method: 'post',
data,
});
}
// 类型字典查询
export function getTypeDict(data) {
return request({
url: '/knowledge/typeDict',
method: 'get',
data,
});
}

View File

@ -83,7 +83,12 @@ export function getWaterRate(data) {
export function getCaptureImg(data) { export function getCaptureImg(data) {
return request({ return request({
url: url:
'/device/captureImg?deviceCode=' + data.deviceCode + '&page=' + data.page, '/device/captureImg?deviceCode=' +
data.deviceCode +
'&page=' +
data.page +
'&size=' +
data.size,
method: 'get', method: 'get',
data, data,
}); });
@ -102,6 +107,20 @@ export function deviceCode(data) {
data, data,
}); });
} }
export function energyStorage(data) {
return request({
url:
'/device/energyStorage?deviceId=' +
data.deviceCode +
'&page=' +
data.page +
'&size=' +
data.size,
method: 'get',
data,
});
}
//传感器数据 可读 //传感器数据 可读
export function sensorsOfWrite(data) { export function sensorsOfWrite(data) {
return request({ return request({

54
src/api/operation.js Normal file
View File

@ -0,0 +1,54 @@
import request from '@/utils/request';
import { baseURL } from '@/config';
// 获取故障信息
export function getData(data) {
let param = '?page=' + data.page + '&size=' + data.size;
if (data.projectId != '') {
param += '&projectId=' + data.projectId;
}
if (data.deviceId != '') {
param += '&deviceId=' + data.deviceId;
}
if (data.start != '') {
param += '&start=' + data.start;
}
if (data.end != '') {
param += '&end=' + data.end;
}
return request({
url: '/faultAnalysis/getFaultInfo' + param,
method: 'get',
data,
});
}
// 获取层级项目站点
export function getProjectDeviceTree(data) {
return request({
url: '/faultAnalysis/getProjectDeviceTree',
method: 'get',
data,
});
}
// 获取故障详情
export function getFaultDetails(data) {
let param = '?page=' + data.page + '&size=' + data.size;
if (data.projectId != '') {
param += '&projectId=' + data.projectId;
}
if (data.deviceId != '') {
param += '&deviceId=' + data.deviceId;
}
if (data.start != '') {
param += '&start=' + data.start;
}
if (data.end != '') {
param += '&end=' + data.end;
}
return request({
url: '/faultAnalysis/getFaultDetails' + param,
method: 'get',
data,
});
}

63
src/api/platform.js Normal file
View File

@ -0,0 +1,63 @@
import request from '@/utils/request';
// 平台三级按钮列表
export function getList(data) {
let param = '?page=' + data.page + '&size=' + data.size;
if (data.name !== '' && data.name !== undefined) {
param += '&name=' + data.name;
}
return request({
url: '/sysButton/list' + param,
method: 'get',
data,
});
}
// 平台按钮树桩列表
export async function buttonTree(data) {
return request({
url: '/sysButton/buttonTree',
method: 'get',
data,
});
}
// 添加平台三级按钮
export async function doAdd(data) {
return request({
url: '/sysButton/insert',
method: 'post',
data,
});
}
// 修改平台三级按钮
export async function doEdit(data) {
return request({
url: '/sysButton/update',
method: 'post',
data,
});
}
// 分配平台三级按钮
export async function assignButton(data) {
return request({
url: '/sysRole/assignButton',
method: 'post',
data,
});
}
// 查询角色已有按钮权限id
export async function getButtonIds(data) {
return request({
url: '/sysRole/getButtonIds',
method: 'get',
params: data,
});
}
// 查询当前用户按钮权限标识
export async function getButtonPerms(data) {
return request({
url: '/system/getButtonPerms',
method: 'get',
params: data,
});
}

52
src/api/product.js Normal file
View File

@ -0,0 +1,52 @@
import request from '@/utils/request';
//查询tuya设备列表
export function getList(data) {
let param = '?page=' + data.page + '&size=' + data.size;
if (data.name != '' && data.name != undefined) {
param += '&name=' + data.name;
}
if (data.materialCode != '' && data.materialCode != undefined) {
param += '&materialCode=' + data.materialCode;
}
return request({
url: '/productCategory/list' + param,
method: 'get',
data,
});
}
//注册设备
export function addData(data) {
return request({
url: '/productCategory/add',
method: 'post',
data,
});
}
//删除设备
export function updateData(data) {
return request({
url: '/productCategory/update',
method: 'post',
data,
});
}
export function delectData(ids) {
return request({
url: '/productCategory/delete/' + ids,
method: 'post',
});
}
//配置产品参数
export function addAttribute(data) {
return request({
url: '/productCategory/addAttribute',
method: 'post',
data,
});
}
export function getAttribute(id) {
return request({
url: '/productCategory/getAttribute/' + id,
method: 'get',
});
}

55
src/api/program.js Normal file
View File

@ -0,0 +1,55 @@
import request from '@/utils/request';
// 小程序三级按钮列表
export function getList(data) {
let param = '?page=' + data.page + '&size=' + data.size;
if (data.name !== '' && data.name !== undefined) {
param += '&name=' + data.name;
}
return request({
url: '/wechatButton/list' + param,
method: 'get',
data,
});
}
// 添加小程序三级按钮
export async function doAdd(data) {
return request({
url: '/wechatButton/insert',
method: 'post',
data,
});
}
// 修改小程序三级按钮
export async function doEdit(data) {
return request({
url: '/wechatButton/update',
method: 'post',
data,
});
}
// 分配小程序三级按钮
export async function assignButton(data) {
return request({
url: '/miniRole/assignButton',
method: 'post',
data,
});
}
// 查询角色已有按钮权限id
export async function getButtonIds(data) {
return request({
url: '/miniRole/getButtonIds',
method: 'get',
params: data,
});
}
// 树形列表
export async function buttonTree(data) {
return request({
url: '/wechatButton/buttonTree',
method: 'get',
params: data,
});
}

View File

@ -23,3 +23,67 @@ export async function getData(data) {
data, data,
}); });
} }
// 基础信息
export async function baseInfo(data) {
let param = '';
if (data.month) {
param = '?month=' + data.month;
}
return request({
url: '/systemAnalysis/baseInfo' + param,
method: 'get',
data,
});
}
// 用户分析
export async function user(data) {
let param = '';
if (data.month) {
param = '?month=' + data.month;
}
return request({
url: '/systemAnalysis/user' + param,
method: 'get',
data,
});
}
// 基础信息
export async function dept(data) {
let param = '';
if (data.month) {
param = '?month=' + data.month;
}
return request({
url: '/systemAnalysis/dept' + param,
method: 'get',
data,
});
}
// 模块分析
export async function module(data) {
let param = '';
if (data.month) {
param = '?month=' + data.month;
}
return request({
url: '/systemAnalysis/module' + param,
method: 'get',
data,
});
}
// 详情分析
export async function details(data) {
let param = '';
if (data.month) {
param = '?month=' + data.month;
}
return request({
url: '/systemAnalysis/details' + param,
method: 'get',
data,
});
}

31
src/api/tuya.js Normal file
View File

@ -0,0 +1,31 @@
import request from '@/utils/request';
//查询tuya设备列表
export function getList(data) {
let param = '?page=' + data.page + '&size=' + data.size;
if (data.ldDeviceSerial != '' && data.ldDeviceSerial != undefined) {
param += '&ldDeviceSerial=' + data.ldDeviceSerial;
}
if (data.tuyaDeviceId != '' && data.tuyaDeviceId != undefined) {
param += '&tuyaDeviceId=' + data.tuyaDeviceId;
}
return request({
url: '/tuya/devices/list' + param,
method: 'get',
data,
});
}
//注册设备
export function register(data) {
return request({
url: '/tuya/devices/register',
method: 'post',
data,
});
}
//删除设备
export function deleteDevice(tuyaDeviceId) {
return request({
url: '/tuya/devices/delete/' + tuyaDeviceId,
method: 'post',
});
}

39
src/api/ywry.js Normal file
View File

@ -0,0 +1,39 @@
import request from '@/utils/request';
//查询tuya设备列表
export function getList(data) {
let param =
'?startIndex=' + (data.page - 1) * data.size + '&pageSize=' + data.size;
// if (data.ldDeviceSerial != '' && data.ldDeviceSerial != undefined) {
param += '&OrderString=date';
param += '&orderType=desc';
// }
if (data.billNo != '' && data.billNo != undefined) {
param += '&billNo=' + data.billNo;
}
return request({
url: '/k3Cloud/salStock/list' + param,
method: 'get',
data,
});
}
//注册设备
export function details(fid) {
return request({
url: '/k3Cloud/salStock/details?fid=' + fid,
method: 'get',
});
}
//删除设备
export function productAttribute(materialCode) {
return request({
url: '/k3Cloud/salStock/productAttribute?materialCode=' + materialCode,
method: 'get',
});
}
export function getNameplate(code) {
return request({
url: '/productCategory/getNameplate/' + code,
method: 'get',
});
}

BIN
src/assets/mb.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

BIN
src/assets/mb1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

View File

@ -65,12 +65,14 @@ export function getPastTime(month) {
const d = time.getDate(); //获取当前日(1-31) const d = time.getDate(); //获取当前日(1-31)
// 获取指定的过去时间 // 获取指定的过去时间
const past = M - month; const past = M - month;
const pastM = past < 0 ? past + 12 : past > 10 ? past : '0' + past; const pastM = past <= 0 ? past + 12 : past > 10 ? past : '0' + past;
const startyy = past <= 0 ? yy - 1 : yy;
// 小于9的在前面加0 // 小于9的在前面加0
const MM = M > 9 ? M : '0' + M; const MM = M > 9 ? M : '0' + M;
const dd = d > 9 ? d : '0' + d; const dd = d > 9 ? d : '0' + d;
// 指定的过去时间 // 指定的过去时间
const PastTime = yy + '-' + pastM + '-' + dd; const PastTime = startyy + '-' + pastM + '-' + dd;
// 当前时间 // 当前时间
const nowTime = yy + '-' + MM + '-' + dd; const nowTime = yy + '-' + MM + '-' + dd;
return [PastTime, nowTime]; return [PastTime, nowTime];

View File

@ -5,7 +5,7 @@ module.exports = {
// 默认的接口地址,开发环境和生产环境走/mock-server // 默认的接口地址,开发环境和生产环境走/mock-server
// 当然你也可以选择自己配置成需要的接口地址,如"https://api.xxx.com" // 当然你也可以选择自己配置成需要的接口地址,如"https://api.xxx.com"
// process.env.NODE_ENV === 'development' ? '/mock-server' : '/mock-server', // process.env.NODE_ENV === 'development' ? '/mock-server' : '/mock-server',
baseURL:'api', baseURL: 'http://101.133.141.167:8081',
// 配后端数据的接收方式application/json;charset=UTF-8 或 application/x-www-form-urlencoded;charset=UTF-8 // 配后端数据的接收方式application/json;charset=UTF-8 或 application/x-www-form-urlencoded;charset=UTF-8
contentType: 'application/json;charset=UTF-8', contentType: 'application/json;charset=UTF-8',
// 最长请求时间 // 最长请求时间

View File

@ -6,11 +6,15 @@ import { setupStore } from '@/store';
import { setupRouter } from '@/router'; import { setupRouter } from '@/router';
import '@/vab/styles/tianditu.scss'; import '@/vab/styles/tianditu.scss';
import locale from 'element-plus/lib/locale/lang/zh-cn'; import locale from 'element-plus/lib/locale/lang/zh-cn';
import print from 'vue3-print-nb';
import CKEditor from '@ckeditor/ckeditor5-vue'; import CKEditor from '@ckeditor/ckeditor5-vue';
const app = createApp(App); const app = createApp(App);
import mixin from '@/mixin/index';
app.mixin(mixin);
app.use(ElementPlus, { locale }); app.use(ElementPlus, { locale });
app.use(CKEditor); app.use(CKEditor);
app.use(print);
/** /**
* @description 正式环境默认使用mock正式项目记得注释后再打包 * @description 正式环境默认使用mock正式项目记得注释后再打包
*/ */

20
src/mixin/index.js Normal file
View File

@ -0,0 +1,20 @@
import store from '@/store';
// 利用mixin(混入)来封装全局函数
// 这里封装在methods中的所有函数都自动会添加到
// 每个vue文件中methods中
// 封装判断按钮权限的函数
export default {
methods: {
// 判断是否具有按钮权限的函数
// 判断需要有2个条件
// 1、需要有判断的标识符到底要判断哪个按钮显示隐藏这个标识符就是绑定函数时传递过来的值
// 2、按钮权限的数据集合就是保存到vuex中的operation数组
isBtnPerm(key) {
const button = store.state.user.button;
if (button && button.length) {
return button.some(item => item === key);
}
return false;
},
},
};

View File

@ -45,6 +45,7 @@ export function setupGuard(router) {
if (loginInterception) await store.dispatch('user/getUserInfo'); if (loginInterception) await store.dispatch('user/getUserInfo');
// settings.js loginInterception为false关闭登录拦截时创建虚拟角色 // settings.js loginInterception为false关闭登录拦截时创建虚拟角色
else await store.dispatch('user/setVirtualRoles'); else await store.dispatch('user/setVirtualRoles');
await store.dispatch('user/getButtonPerms');
// 根据路由模式获取路由并根据权限过滤 // 根据路由模式获取路由并根据权限过滤
await store.dispatch('routes/setRoutes', authentication); await store.dispatch('routes/setRoutes', authentication);
next({ ...to, replace: true }); next({ ...to, replace: true });

View File

@ -1,5 +1,6 @@
import { constantRoutes } from '@/router'; import { constantRoutes } from '@/router';
import { getAuthMenu } from '@/api/user'; import { getAuthMenu } from '@/api/user';
import { getButtonPerms } from '@/api/platform';
function filterAsyncRouter(asyncRouterMap) { function filterAsyncRouter(asyncRouterMap) {
// 遍历后台传来的路由字符串,转换为组件对象 // 遍历后台传来的路由字符串,转换为组件对象

View File

@ -5,6 +5,7 @@ import { resetRouter, setRouterMenus, delRouterMenus } from '@/router';
// import { isArray } from '@/utils/validate' // import { isArray } from '@/utils/validate'
import { title, tokenName } from '@/config'; import { title, tokenName } from '@/config';
import { ElNotification, ElMessage } from 'element-plus'; import { ElNotification, ElMessage } from 'element-plus';
import { getButtonPerms } from '@/api/platform';
const state = () => ({ const state = () => ({
token: getToken(), token: getToken(),
@ -16,7 +17,7 @@ const getters = {
username: state => state.username, username: state => state.username,
avatar: state => state.avatar, avatar: state => state.avatar,
roles: state => state.roles, roles: state => state.roles,
// menu: (state) => state.menu, button: state => state.button,
}; };
const mutations = { const mutations = {
setToken(state, token) { setToken(state, token) {
@ -32,6 +33,9 @@ const mutations = {
SET_ROLES: (state, roles) => { SET_ROLES: (state, roles) => {
state.roles = roles; state.roles = roles;
}, },
setButton(state, button) {
state.button = button;
},
// menu: (state, menu) => { // menu: (state, menu) => {
// state.menu = menu // state.menu = menu
// }, // },
@ -106,6 +110,10 @@ const actions = {
return Promise.reject(); return Promise.reject();
} }
}, },
async getButtonPerms({ commit }) {
const { data } = await getButtonPerms();
commit('setButton', data);
},
async logout({ dispatch }) { async logout({ dispatch }) {
delRouterMenus(); delRouterMenus();
await logout(state.token); await logout(state.token);

6
src/utils/button.js Normal file
View File

@ -0,0 +1,6 @@
import { getButtonPerms } from '@/api/platform';
export default async function getButtonPermission(button) {
const { data } = await getButtonPerms();
return !!data.indexOf(button);
}

View File

@ -6,7 +6,13 @@
type="danger" type="danger"
@click="jumpAlarm" @click="jumpAlarm"
> >
<el-link type="primary" :href="url" target="_blank" style="margin: 0 20px"> <el-link
type="primary"
:href="url"
:underline="false"
target="_blank"
style="margin: 0 20px"
>
项目大屏 项目大屏
</el-link> </el-link>
<i class="el-icon-message-solid"></i> <i class="el-icon-message-solid"></i>

View File

@ -2,16 +2,18 @@
<div class="logo-container-vertical"> <div class="logo-container-vertical">
<router-link to="/"> <router-link to="/">
<span class="logo"> <span class="logo">
<img :src="url" /> <img :src="data.logo1" />
</span> </span>
<span class="title"> <span class="title">
{{ title }} {{ data.name }}
</span> </span>
</router-link> </router-link>
</div> </div>
</template> </template>
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { getData } from '@/api/sys';
import { baseURL } from '@/config/net.config';
export default { export default {
name: 'VabLogo', name: 'VabLogo',
@ -19,13 +21,29 @@ export default {
const url = require('@/assets/logo.png'); const url = require('@/assets/logo.png');
return { return {
url: url, url: url,
data: [],
}; };
}, },
computed: { // computed: {
...mapGetters({ // // ...mapGetters({
logo: 'settings/logo', // // logo: 'settings/logo',
title: 'settings/title', // // title: 'settings/title',
}), // // }),
// this.getWebData();
// },
mounted() {
this.getWebData();
},
methods: {
async getWebData() {
const { data } = await getData();
if (data) {
if (data.logo) {
data.logo1 = baseURL + '/static/img/' + data.logo;
}
this.data = data;
}
},
}, },
}; };
</script> </script>

View File

@ -19,7 +19,14 @@
:value="item.id" :value="item.id"
></el-option> ></el-option>
</el-select> </el-select>
<el-link type="primary" :href="url" target="_blank">首页大屏</el-link> <el-link
type="primary"
:href="url"
:underline="false"
target="_blank"
>
首页大屏
</el-link>
<!-- <el-dropdown @command="onToggleProject">--> <!-- <el-dropdown @command="onToggleProject">-->
<!-- <span class="el-dropdown-link cursor">--> <!-- <span class="el-dropdown-link cursor">-->
<!-- {{ activeProject.name }}--> <!-- {{ activeProject.name }}-->
@ -87,7 +94,6 @@ export default {
watch: { watch: {
$route: { $route: {
handler(route) { handler(route) {
console.log(route, ',,,,,,');
const firstMenu = route.matched[0].path || '/'; const firstMenu = route.matched[0].path || '/';
// if (this.firstMenu !== firstMenu) { // if (this.firstMenu !== firstMenu) {
// this.firstMenu = firstMenu; // this.firstMenu = firstMenu;

View File

@ -26,7 +26,12 @@
<div class="manage-button"> <div class="manage-button">
<el-button size="small" @click="resetForm()">重置</el-button> <el-button size="small" @click="resetForm()">重置</el-button>
<el-button type="primary" size="small" @click="search">查询</el-button> <el-button type="primary" size="small" @click="search">查询</el-button>
<el-button type="primary" size="small" @click="exportData"> <el-button
v-if="isBtnPerm('/waterElec/elecDayExport')"
type="primary"
size="small"
@click="exportData"
>
导出 导出
</el-button> </el-button>
</div> </div>
@ -50,7 +55,13 @@
></el-table-column> ></el-table-column>
<el-table-column fixed="right" label="操作" align="center"> <el-table-column fixed="right" label="操作" align="center">
<template #default="{ row }"> <template #default="{ row }">
<el-button type="text" @click="graph(row)">曲线图</el-button> <el-button
v-if="isBtnPerm('/waterElec/elecDay')"
type="text"
@click="graph(row)"
>
曲线图
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@ -26,7 +26,12 @@
<div class="manage-button"> <div class="manage-button">
<el-button size="small" @click="resetForm()">重置</el-button> <el-button size="small" @click="resetForm()">重置</el-button>
<el-button type="primary" size="small" @click="search">查询</el-button> <el-button type="primary" size="small" @click="search">查询</el-button>
<el-button type="primary" size="small" @click="exportData"> <el-button
v-if="isBtnPerm('/waterElec/waterDayExport')"
type="primary"
size="small"
@click="exportData"
>
导出 导出
</el-button> </el-button>
</div> </div>
@ -50,7 +55,13 @@
></el-table-column> ></el-table-column>
<el-table-column fixed="right" label="操作" align="center"> <el-table-column fixed="right" label="操作" align="center">
<template #default="{ row }"> <template #default="{ row }">
<el-button type="text" @click="graph(row)">曲线图</el-button> <el-button
v-if="isBtnPerm('/waterElec/waterDay')"
type="text"
@click="graph(row)"
>
曲线图
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@ -30,7 +30,13 @@
</el-checkbox> </el-checkbox>
</el-checkbox-group> </el-checkbox-group>
</div> </div>
<el-button type="primary" @click="add">新增</el-button> <el-button
v-if="isBtnPerm('/haian/add')"
type="primary"
@click="add"
>
新增
</el-button>
<el-table <el-table
:data="tableData" :data="tableData"
v-loading="listLoading" v-loading="listLoading"
@ -84,8 +90,20 @@
<el-table-column fixed="right" width="120" label="操作" align="center"> <el-table-column fixed="right" width="120" label="操作" align="center">
<template #default="{ row }"> <template #default="{ row }">
<el-button type="text" @click="handleClick(row)">编辑</el-button> <el-button
<el-button type="text" @click="handleDelete(row)">删除</el-button> v-if="isBtnPerm('/haian/update')"
type="text"
@click="handleClick(row)"
>
编辑
</el-button>
<el-button
v-if="isBtnPerm('/haian/remove')"
type="text"
@click="handleDelete(row)"
>
删除
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -355,11 +373,8 @@ export default {
this.form[item.deviceId][val.name] = null; this.form[item.deviceId][val.name] = null;
}); });
}); });
console.log(this.form);
}, },
save() { save() {
console.log(this.form);
if ( if (
!( !(
this.form.basic.date != null && this.form.basic.date != null &&

View File

@ -26,7 +26,12 @@
<div class="manage-button"> <div class="manage-button">
<el-button size="small" @click="resetForm()">重置</el-button> <el-button size="small" @click="resetForm()">重置</el-button>
<el-button type="primary" size="small" @click="search">查询</el-button> <el-button type="primary" size="small" @click="search">查询</el-button>
<el-button type="primary" size="small" @click="exportData"> <el-button
v-if="isBtnPerm('/waterElec/elecMonthExport')"
type="primary"
size="small"
@click="exportData"
>
导出 导出
</el-button> </el-button>
</div> </div>
@ -50,7 +55,13 @@
></el-table-column> ></el-table-column>
<el-table-column fixed="right" label="操作" align="center"> <el-table-column fixed="right" label="操作" align="center">
<template #default="{ row }"> <template #default="{ row }">
<el-button type="text" @click="graph(row)">曲线图</el-button> <el-button
v-if="isBtnPerm('/waterElec/elecMonth')"
type="text"
@click="graph(row)"
>
曲线图
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@ -19,7 +19,12 @@
<div class="manage-button"> <div class="manage-button">
<el-button size="small" @click="resetForm()">重置</el-button> <el-button size="small" @click="resetForm()">重置</el-button>
<el-button type="primary" size="small" @click="search">查询</el-button> <el-button type="primary" size="small" @click="search">查询</el-button>
<el-button type="primary" size="small" @click="exportData"> <el-button
v-if="isBtnPerm('/deviceReport/deviceMonth/export')"
type="primary"
size="small"
@click="exportData"
>
导出 导出
</el-button> </el-button>
</div> </div>

View File

@ -26,7 +26,12 @@
<div class="manage-button"> <div class="manage-button">
<el-button size="small" @click="resetForm()">重置</el-button> <el-button size="small" @click="resetForm()">重置</el-button>
<el-button type="primary" size="small" @click="search">查询</el-button> <el-button type="primary" size="small" @click="search">查询</el-button>
<el-button type="primary" size="small" @click="exportData"> <el-button
v-if="isBtnPerm('/waterElec/waterMonthExport')"
type="primary"
size="small"
@click="exportData"
>
导出 导出
</el-button> </el-button>
</div> </div>
@ -50,7 +55,13 @@
></el-table-column> ></el-table-column>
<el-table-column fixed="right" label="操作" align="center"> <el-table-column fixed="right" label="操作" align="center">
<template #default="{ row }"> <template #default="{ row }">
<el-button type="text" @click="graph(row)">曲线图</el-button> <el-button
v-if="isBtnPerm('/waterElec/waterMonth')"
type="text"
@click="graph(row)"
>
曲线图
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@ -79,7 +79,12 @@
<div class="manage-button"> <div class="manage-button">
<el-button size="small" @click="resetForm()">重置</el-button> <el-button size="small" @click="resetForm()">重置</el-button>
<el-button type="primary" size="small" @click="search">查询</el-button> <el-button type="primary" size="small" @click="search">查询</el-button>
<el-button type="primary" size="small" @click="exportData"> <el-button
v-if="isBtnPerm('/deviceReport/exportDevice')"
type="primary"
size="small"
@click="exportData"
>
导出 导出
</el-button> </el-button>
</div> </div>
@ -286,6 +291,43 @@
width="200" width="200"
align="center" align="center"
></el-table-column> ></el-table-column>
<el-table-column
prop="boardImg"
label="公示牌"
width="200"
align="center"
>
<template #default="{ row }">
<el-image
style="width: 100px; height: 100px"
:src="fileUrl + row.boardImg"
></el-image>
</template>
</el-table-column>
<el-table-column
prop="warrantyPeriod"
label="设备保修到期时间"
width="200"
align="center"
></el-table-column>
<el-table-column
prop="deviceVersion.dataValue"
label="设备版本"
width="200"
align="center"
></el-table-column>
<el-table-column
prop="ownerName"
label="站点客户联系人"
width="200"
align="center"
></el-table-column>
<el-table-column
prop="ownerPhone"
label="站点客户联系方式"
width="200"
align="center"
></el-table-column>
<el-table-column <el-table-column
prop="offlineTime" prop="offlineTime"
label="离线时间" label="离线时间"
@ -322,6 +364,7 @@ import {
exportDevice, exportDevice,
} from '@/api/device'; } from '@/api/device';
import ajax from '@/api/download'; import ajax from '@/api/download';
import { baseURL } from '@/config';
// import deviceEdit from './deviceEdit'; // import deviceEdit from './deviceEdit';
// import CopyDevice from './copyDevice'; // import CopyDevice from './copyDevice';
export default { export default {
@ -332,6 +375,7 @@ export default {
}, },
data() { data() {
return { return {
fileUrl: baseURL + '/static/img/',
deviceData: [], deviceData: [],
lazy: true, lazy: true,
activeName: 'first', activeName: 'first',

View File

@ -0,0 +1,50 @@
<template>
<div>
<vue-office-pdf
:src="pdfSrc"
style="width: 100%; height: 600px"
@rendered="onRendered"
@error="onError"
/>
</div>
</template>
<script>
import { ref } from 'vue';
import VueOfficePdf from '@vue-office/pdf';
export default {
components: {
VueOfficePdf,
},
setup() {
const pdfUrl = ref('');
const pdfSrc = ref(null);
const updatePdfSrc = () => {
// URLPDF
pdfSrc.value = pdfUrl.value;
};
const onRendered = () => {
console.log('PDF rendered successfully');
};
const onError = error => {
console.error('Error rendering PDF:', error);
};
return {
pdfUrl,
pdfSrc,
updatePdfSrc,
onRendered,
onError,
};
},
};
</script>
<style scoped>
/* 你可以在这里添加自定义样式 */
</style>

View File

@ -15,7 +15,12 @@
</div> </div>
<div class="manage-button"> <div class="manage-button">
<el-form-item width="100"> <el-form-item width="100">
<el-button type="primary" size="small" @click="handleAdd"> <el-button
v-if="isBtnPerm('/sysDept/add')"
type="primary"
size="small"
@click="handleAdd"
>
添加部门 添加部门
</el-button> </el-button>
</el-form-item> </el-form-item>
@ -76,8 +81,18 @@
align="center" align="center"
> >
<template #default="{ row }"> <template #default="{ row }">
<el-button type="text" @click="handleEdit(row)">编辑</el-button> <el-button
<el-button type="text" @click="handleDelete(row)"> v-if="isBtnPerm('/sysDept/update')"
type="text"
@click="handleEdit(row)"
>
编辑
</el-button>
<el-button
v-if="isBtnPerm('/sysDept/delete')"
type="text"
@click="handleDelete(row)"
>
删除 删除
</el-button> </el-button>
</template> </template>

View File

@ -75,9 +75,15 @@
></el-table-column> ></el-table-column>
<el-table-column fixed="right" label="操作" align="center"> <el-table-column fixed="right" label="操作" align="center">
<template #default="{ row }"> <template #default="{ row }">
<el-button type="text" @click="handleDelete(row)">删除</el-button>
<el-button <el-button
v-if="row.status == '未派工'" v-if="isBtnPerm('/alarmRecord/remove')"
type="text"
@click="handleDelete(row)"
>
删除
</el-button>
<el-button
v-if="row.status == '未派工' && isBtnPerm('/alarmRecord/toTask')"
type="text" type="text"
@click="handleTask(row)" @click="handleTask(row)"
> >

View File

@ -82,8 +82,20 @@
<div class="manage-button"> <div class="manage-button">
<el-button size="small" @click="resetForm()">重置</el-button> <el-button size="small" @click="resetForm()">重置</el-button>
<el-button type="primary" size="small" @click="search">查询</el-button> <el-button type="primary" size="small" @click="search">查询</el-button>
<el-button type="primary" size="small" @click="save">添加</el-button> <el-button
<el-button type="primary" size="small" @click="exportData"> v-if="isBtnPerm('/alarmRecord/insert')"
type="primary"
size="small"
@click="save"
>
添加
</el-button>
<el-button
v-if="isBtnPerm('/alarmRecordReport/export')"
type="primary"
size="small"
@click="exportData"
>
导出 导出
</el-button> </el-button>
</div> </div>
@ -162,9 +174,15 @@
></el-table-column> ></el-table-column>
<el-table-column fixed="right" label="操作" align="center"> <el-table-column fixed="right" label="操作" align="center">
<template #default="{ row }"> <template #default="{ row }">
<el-button type="text" @click="handleDelete(row)">删除</el-button>
<el-button <el-button
v-if="row.status == '未派工'" v-if="isBtnPerm('/alarmRecord/remove')"
type="text"
@click="handleDelete(row)"
>
删除
</el-button>
<el-button
v-if="row.status == '未派工' && isBtnPerm('/alarmRecord/toTask')"
type="text" type="text"
@click="handleTask(row)" @click="handleTask(row)"
> >

View File

@ -32,11 +32,28 @@
<div class="manage-button"> <div class="manage-button">
<el-button size="small" @click="resetForm()">重置</el-button> <el-button size="small" @click="resetForm()">重置</el-button>
<el-button type="primary" size="small" @click="search">查询</el-button> <el-button type="primary" size="small" @click="search">查询</el-button>
<el-button type="primary" size="small" @click="handleAdd">添加</el-button> <el-button
<el-button type="primary" size="small" @click="exportData"> v-if="isBtnPerm('/waterApply/add')"
type="primary"
size="small"
@click="handleAdd"
>
添加
</el-button>
<el-button
v-if="isBtnPerm('/waterApplyReport/export')"
type="primary"
size="small"
@click="exportData"
>
导出 导出
</el-button> </el-button>
<el-button type="primary" size="small" @click="deletes"> <el-button
v-if="isBtnPerm('/waterApply/remove')"
type="primary"
size="small"
@click="deletes"
>
批量删除 批量删除
</el-button> </el-button>
</div> </div>
@ -128,10 +145,22 @@
></el-table-column> ></el-table-column>
<el-table-column prop="details" label="申请详情" align="center"> <el-table-column prop="details" label="申请详情" align="center">
<template #default="{ row }"> <template #default="{ row }">
<el-button size="mini" type="primary" plain @click="handleEdit(row)"> <el-button
v-if="isBtnPerm('/waterApply/update')"
size="mini"
type="primary"
plain
@click="handleEdit(row)"
>
编辑 编辑
</el-button> </el-button>
<el-button type="text" @click="handleDelete(row)">删除</el-button> <el-button
v-if="isBtnPerm('/waterApply/remove')"
type="text"
@click="handleDelete(row)"
>
删除
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@ -30,23 +30,40 @@
</vab-query-form> </vab-query-form>
<vab-query-form> <vab-query-form>
<el-form-item width="100"> <el-form-item width="100">
<el-button size="small" type="primary" plain @click="handleAdd"> <el-button
v-if="isBtnPerm('/waterDetection/add')"
size="small"
type="primary"
plain
@click="handleAdd"
>
新建 新建
</el-button> </el-button>
<el-button type="small" size="medium" @click="exportData"> <el-button
v-if="isBtnPerm('/waterDetectionReport/export')"
type="small"
size="medium"
@click="exportData"
>
导出 导出
</el-button> </el-button>
<el-button type="small" @click="deletes">批量删除</el-button> <el-button
<el-upload v-if="isBtnPerm('/waterDetection/remove')"
class="upload-demo" type="small"
:action="action" @click="deletes"
:headers="headers"
:on-preview="handlePreview"
:on-remove="handleRemove"
list-type="picture"
> >
<el-button size="small" type="primary">点击上传</el-button> 批量删除
</el-upload> </el-button>
<!-- <el-upload-->
<!-- class="upload-demo"-->
<!-- :action="action"-->
<!-- :headers="headers"-->
<!-- :on-preview="handlePreview"-->
<!-- :on-remove="handleRemove"-->
<!-- list-type="picture"-->
<!-- >-->
<!-- <el-button size="small" type="primary">点击上传</el-button>-->
<!-- </el-upload>-->
</el-form-item> </el-form-item>
</vab-query-form> </vab-query-form>
</el-form> </el-form>
@ -211,7 +228,13 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" width="100"> <el-table-column label="操作" align="center" width="100">
<template #default="{ row }"> <template #default="{ row }">
<el-button type="text" @click="handleDelete(row)">删除</el-button> <el-button
v-if="isBtnPerm('/waterDetection/remove')"
type="text"
@click="handleDelete(row)"
>
删除
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@ -32,6 +32,9 @@ export default {
this.$refs['testing'].testingIndex(); this.$refs['testing'].testingIndex();
} }
}, },
showData() {
this.$refs['apply'].applyIndex();
},
}, },
}; };
</script> </script>

View File

@ -51,7 +51,12 @@
<el-form-item width="100"> <el-form-item width="100">
<el-button size="small" @click="resetForm()">重置</el-button> <el-button size="small" @click="resetForm()">重置</el-button>
<el-button type="primary" size="small" @click="search">查询</el-button> <el-button type="primary" size="small" @click="search">查询</el-button>
<el-button type="primary" size="small" @click="exportData"> <el-button
v-if="isBtnPerm('/sign/export')"
type="primary"
size="small"
@click="exportData"
>
导出 导出
</el-button> </el-button>
</el-form-item> </el-form-item>
@ -121,9 +126,27 @@
</el-table-column> </el-table-column>
<el-table-column fixed="right" label="操作" align="center" width="150"> <el-table-column fixed="right" label="操作" align="center" width="150">
<template #default="{ row }"> <template #default="{ row }">
<el-button type="text" @click="trajectory(row)">轨迹</el-button> <el-button
<el-button type="text" @click="handleEdit(row)">编辑</el-button> v-if="isBtnPerm('/sign/trajectory')"
<el-button type="text" @click="handleDelete(row)">删除</el-button> type="text"
@click="trajectory(row)"
>
轨迹
</el-button>
<el-button
v-if="isBtnPerm('/sign/updateLocation')"
type="text"
@click="handleEdit(row)"
>
编辑
</el-button>
<el-button
v-if="isBtnPerm('/sign/remove')"
type="text"
@click="handleDelete(row)"
>
删除
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -152,6 +175,9 @@ export default {
}, },
data() { data() {
return { return {
trajectoryButton: false,
updateButton: false,
delButton: false,
tableData: [], tableData: [],
lazy: true, lazy: true,
layout: 'total, sizes, prev, pager, next, jumper', layout: 'total, sizes, prev, pager, next, jumper',
@ -198,6 +224,9 @@ export default {
}, 1000); }, 1000);
}, },
methods: { methods: {
showData() {
this.created();
},
changeTime() { changeTime() {
this.queryForm.start = getDate(this.queryForm.time[0]); this.queryForm.start = getDate(this.queryForm.time[0]);
this.queryForm.end = getDate(this.queryForm.time[1]); this.queryForm.end = getDate(this.queryForm.time[1]);
@ -209,6 +238,7 @@ export default {
}, },
setDefaultTime() { setDefaultTime() {
this.queryForm.time = getPastTime(1); this.queryForm.time = getPastTime(1);
console.log(12312312, this.queryForm.time);
this.queryForm.start = getDate(this.queryForm.time[0]); this.queryForm.start = getDate(this.queryForm.time[0]);
this.queryForm.end = getDate(this.queryForm.time[1]); this.queryForm.end = getDate(this.queryForm.time[1]);
}, },

View File

@ -31,10 +31,20 @@
<div class="manage-button"> <div class="manage-button">
<el-button size="small" @click="resetForm()">重置</el-button> <el-button size="small" @click="resetForm()">重置</el-button>
<el-button type="primary" size="small" @click="search">查询</el-button> <el-button type="primary" size="small" @click="search">查询</el-button>
<el-button type="primary" size="small" @click="exportData"> <el-button
v-if="isBtnPerm('/taskReport/export')"
type="primary"
size="small"
@click="exportData"
>
导出 导出
</el-button> </el-button>
<el-button type="primary" size="small" @click="deletes"> <el-button
v-if="isBtnPerm('/inspection/remove')"
type="primary"
size="small"
@click="deletes"
>
批量删除 批量删除
</el-button> </el-button>
</div> </div>
@ -73,8 +83,20 @@
></el-table-column> ></el-table-column>
<el-table-column label="操作" align="center"> <el-table-column label="操作" align="center">
<template #default="{ row }"> <template #default="{ row }">
<el-button type="text" @click="showDetail(row)">详情</el-button> <el-button
<el-button type="text" @click="handleDelete(row)">删除</el-button> v-if="isBtnPerm('/inspection/list')"
type="text"
@click="showDetail(row)"
>
详情
</el-button>
<el-button
v-if="isBtnPerm('/inspection/remove')"
type="text"
@click="handleDelete(row)"
>
删除
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -133,6 +155,9 @@ export default {
search() { search() {
this.fetchData(); this.fetchData();
}, },
showData() {
this.created();
},
async fetchData() { async fetchData() {
this.listLoading = true; this.listLoading = true;
const { data } = await getList(this.queryForm); const { data } = await getList(this.queryForm);

View File

@ -0,0 +1,313 @@
<template>
<el-dialog
v-model="dialogFormVisible"
:title="title"
width="800px"
@close="close"
>
<el-form
ref="form"
:model="form"
:rules="rules"
label-width="80px"
label-position="left"
>
<el-form-item label="标题" prop="title">
<el-input
v-model.trim="form.title"
size="small"
autocomplete="off"
></el-input>
</el-form-item>
<el-form-item label="分类" prop="category">
<el-cascader
v-model="form.category"
:options="categoryData"
:props="props"
@change="handleChange"
></el-cascader>
</el-form-item>
<el-form-item label="类型" prop="type">
<el-select
v-model="form.type"
size="small"
filterable
placeholder="请选择类型"
>
<el-option
v-for="item in typeData"
:key="item.dataCode"
:label="item.dataValue"
:value="item.dataCode"
></el-option>
</el-select>
</el-form-item>
<el-form-item v-if="form.type === '0'" label="简介" prop="introduction">
<ckeditor
v-model="form.introduction"
size="small"
:editor="editor"
:config="editorConfig"
></ckeditor>
</el-form-item>
<el-form-item v-if="form.type === '0'" label="详情" prop="detail">
<ckeditor
v-model="form.detail"
size="small"
:editor="editor"
:config="editorConfig"
></ckeditor>
</el-form-item>
<el-form-item v-if="form.type === '1'" label="文档附件" prop="file">
<el-upload
v-loading="loading"
class="avatar-uploader"
:action="action"
:headers="headers"
name="file"
:show-file-list="false"
:on-success="handleAvatarSuccess"
:before-upload="beforeAvatarUpload"
:on-change="fileChange"
>
<i class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
<el-link
v-if="filePath"
type="primary"
:href="filePath"
target="_blank"
>
查看文档
</el-link>
</el-form-item>
<el-form-item v-if="form.type === '2'" label="视频附件" prop="file">
<el-upload
v-loading="loading"
class="avatar-uploader"
:action="action"
:headers="headers"
name="file"
:show-file-list="false"
:on-success="handleAvatarSuccess"
:before-upload="beforeAvatarUpload"
:on-change="fileChange"
>
<i class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
<video
v-if="videoPath"
width="300"
height="200"
:src="videoPath"
class="avatar"
/>
</el-form-item>
</el-form>
<div class="dialog-footer">
<el-button type="primary" size="small" @click="save"> </el-button>
<el-button size="small" @click="close"> </el-button>
</div>
</el-dialog>
</template>
<script>
import {
doAdd,
doEdit,
getTypeCategoryTree,
getTypeDict,
getTypeList,
} from '@/api/knowledge';
import ClassicEditor from '@/common/ckeditor/ckeditor';
import '@/common/ckeditor/zh';
import { knowledgeEditorConfig } from '@/common/ckeditor.config.js';
import { baseURL } from '@/config/net.config';
import store from '@/store';
import Video from '@/views/server/siteDetails/video.vue';
export default {
components: { Video },
data() {
return {
action: baseURL + '/file/upload',
headers: { token: store.getters['user/token'] },
filePath: '',
videoPath: '',
form: {
id: '',
title: '',
introduction: '',
detail: '',
category: '',
},
rules: {
title: [{ required: true, trigger: 'blur', message: '请输入标题' }],
category: [
{ required: true, trigger: 'change', message: '请选择分类' },
],
type: [{ required: true, trigger: 'change', message: '请选择类型' }],
introduction: [
{ required: true, trigger: 'blur', message: '请输入简介' },
],
detail: [{ required: true, trigger: 'blur', message: '请输入详情' }],
},
dictData: [],
roleData: [],
clearable: true,
roleId: '',
parentData: [],
title: '',
dialogFormVisible: false,
editor: ClassicEditor,
editorConfig: knowledgeEditorConfig,
typeData: [],
typeList: [],
categoryData: [],
props: {
value: 'id',
label: 'label',
children: 'children',
},
loading: false,
};
},
created() {},
methods: {
showEdit(row) {
this.getTypeDict();
this.getTypeCategoryTree();
this.getTypeList();
if (!row) {
this.title = '添加知识库';
} else {
this.title = '编辑知识库';
const data = Object.assign({}, row);
this.form.type = data.type.dataCode;
this.form.category = data.category.categoryId;
this.form.id = data.id;
this.form.title = data.title;
this.form.introduction = data.introduction;
this.form.detail = data.detail;
this.form.annex = data.annex;
if (this.form.type === '1') {
this.filePath = baseURL + '/static/img/' + data.annex;
}
if (this.form.type === '2') {
this.videoPath = baseURL + '/static/img/' + data.annex;
}
}
this.dialogFormVisible = true;
},
//
async getTypeDict() {
const { data } = await getTypeDict();
this.typeData = data;
},
//
async getTypeList() {
const { data } = await getTypeList();
this.typeList = data;
},
//
handleChange(e) {
this.form.category = e[e.length - 1];
},
//
handleAvatarSuccess(res, file) {
if (res.code == 0) {
this.form.annex = res.data;
if (this.form.type === '1') {
this.filePath = baseURL + '/static/img/' + res.data;
} else {
this.videoPath = baseURL + '/static/img/' + res.data;
}
} else {
this.$message.error(res.msg);
}
console.log(111, res);
},
//
beforeAvatarUpload(file) {
this.loading = true;
if (this.form.type === '1') {
const isLt10M = file.size / 1024 / 1024 < 200;
if (!isLt10M) {
this.$message.error('上传附件大小不能超过 200MB!');
}
return isLt10M;
} else {
const isLt10M = file.size / 1024 / 1024 < 500;
if (!isLt10M) {
this.$message.error('上传视频大小不能超过 500MB!');
}
return isLt10M;
}
},
fileChange() {
this.loading = false;
},
async getTypeCategoryTree() {
const { data } = await getTypeCategoryTree();
this.categoryData = data;
},
close() {
this.$refs['form'].resetFields();
this.form = this.$options.data().form;
this.dialogFormVisible = false;
this.$emit('fetch-data');
},
save() {
this.$refs['form'].validate(async valid => {
if (valid) {
if (this.form.id) {
const { msg } = await doEdit(this.form);
this.$notify({
title: msg,
type: 'success',
});
} else {
delete this.form.id;
const { msg } = await doAdd(this.form);
this.$notify({
title: msg,
type: 'success',
});
}
this.$refs['form'].resetFields();
this.$parent.getKnowledgeList();
this.dialogFormVisible = false;
} else {
return false;
}
});
},
},
};
</script>
<style>
.avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
.avatar-uploader .el-upload:hover {
border-color: #409EFF;
}
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 178px;
height: 178px;
line-height: 178px;
text-align: center;
}
.avatar {
width: 178px;
height: 178px;
display: block;
}
</style>

View File

@ -0,0 +1,23 @@
<template>
<vue-office-docx :src="docx" @rendered="rendered" />
</template>
<script>
//VueOfficeDocx;
import VueOfficeDocx from '@vue-office/docx';
export default {
components: {
VueOfficeDocx,
},
data() {
return {
docx: 'http://static.shanhuxueyuan.com/test6.docx', //
};
},
methods: {
rendered() {
console.log('渲染完成');
},
},
};
</script>

View File

@ -1,185 +1,243 @@
<template> <template>
<div class="manage-container"> <div class="manage-container">
<div class="manage-input"> <div class="manage-wrap">
<el-form ref="queryForm" :model="queryForm" label-width="80px"> <div class="manage-button">
<vab-query-form> <el-form-item width="100">
<el-form-item width="100" prop="title" label="项目标题"> <el-input
<el-input v-model="queryForm.title"
v-model="queryForm.title" placeholder="请输入标题"
size="small" ></el-input>
placeholder="请输入标题" <el-button type="primary" @click="search">查询</el-button>
></el-input> <el-button
</el-form-item> v-if="isBtnPerm('/knowledge/insert')"
<el-form-item width="100" prop="date" label="日期"> type="primary"
<el-date-picker size="small"
v-model="queryForm.date" @click="handleKnowledgeAdd"
size="small" >
type="date" 添加知识库
placeholder="选择日期" </el-button>
></el-date-picker> <el-button
</el-form-item> v-if="isBtnPerm('/knowledge/remove')"
<el-form-item width="100" prop="category" label="分类"> type="primary"
<el-select size="small"
v-model="queryForm.category" @click="handleKnowledgeDels"
size="small" >
filterable 批量删除知识库
placeholder="请选择分类" </el-button>
</el-form-item>
</div>
</div>
<el-row :gutter="20">
<el-col :span="4">
<div class="grid-content bg-purple">
<h1 style="margin-top: 0">知识库分类</h1>
<el-button type="text" @click="clockCheck">取消选择</el-button>
<el-tree
:data="typeData"
:props="defaultProps"
:default-expand-all="true"
:expand-on-click-node="false"
show-checkbox
check-strictly
accordion
node-key="id"
@check="handleCheckChange"
ref="tree"
></el-tree>
</div>
</el-col>
<el-col :span="20">
<div class="grid-content bg-purple">
<el-table
:data="knowledgeData"
style="width: 100%; margin-bottom: 20px"
border
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="40"></el-table-column>
<el-table-column
prop="title"
label="标题"
width="300"
align="center"
></el-table-column>
<el-table-column prop="introduction" label="简介" align="center">
<template #default="{ row }">
<span v-html="row.introduction"></span>
</template>
</el-table-column>
<el-table-column
prop="category"
label="分类"
align="center"
width="100"
> >
<el-option <template #default="{ row }">
v-for="item in dictData" <span>{{ row.category.categoryName }}</span>
:key="item.dataCode" </template>
:label="item.dataValue" </el-table-column>
:value="item.dataCode" <el-table-column
></el-option> prop="type"
</el-select> label="类型"
</el-form-item> align="center"
</vab-query-form> width="100"
</el-form> >
</div> <template #default="{ row }">
<div class="manage-button"> <span>{{ row.type.dataValue }}</span>
<el-button size="small" @click="resetForm()">重置</el-button> </template>
<el-button type="primary" size="small" @click="search">查询</el-button> </el-table-column>
<el-button type="primary" size="small" @click="handleAdd()"> <el-table-column
添加知识库 fixed="right"
</el-button> label="操作"
<el-button type="primary" size="small" @click="deletes"> width="280"
批量删除 align="center"
</el-button> >
</div> <template #default="{ row }">
<el-table <el-button
:data="tableData" v-if="row.type.dataCode === '1'"
stripe type="text"
border @click="showWord(row)"
style="width: 100%" >
@selection-change="handleSelectionChange" 查看
> </el-button>
<el-table-column <el-button
fixed v-if="row.type.dataCode !== '0'"
type="selection" type="text"
width="60" @click="download(row)"
align="center" >
></el-table-column> 下载
<el-table-column </el-button>
prop="id" <el-button
label="Id" v-if="isBtnPerm('/knowledge/update')"
width="50" type="text"
align="center" @click="handleKnowledgeEdit(row)"
></el-table-column> >
<el-table-column 编辑
prop="addUser" </el-button>
label="添加人" <el-button
width="250" v-if="isBtnPerm('/knowledge/remove')"
align="center" type="text"
></el-table-column> @click="handleKnowledgeDel(row)"
<el-table-column >
prop="title" 删除
label="标题" </el-button>
width="250" </template>
align="center" </el-table-column>
></el-table-column> </el-table>
<el-table-column <el-pagination
prop="introduction" :background="background"
label="简介" :current-page="queryForm.page"
width="150" :layout="layout"
align="center" :page-size="queryForm.size"
> :total="total"
<template #default="{ row }"> style="text-align: right"
<p v-html="row.introduction"></p> @current-change="handleCurrentChange"
</template> @size-change="handleSizeChange"
</el-table-column> ></el-pagination>
<el-table-column </div>
prop="createTime" </el-col>
label="创建时间" </el-row>
width="150" <add-knowledge ref="knowledge"></add-knowledge>
align="center" <show-file ref="file"></show-file>
></el-table-column>
<el-table-column label="操作" align="center">
<template #default="{ row }">
<el-button type="text" @click="handleshow(row)">查看</el-button>
<el-button type="text" @click="handleEdit(row)">编辑</el-button>
<el-button type="text" @click="handleDelete(row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
:background="background"
:current-page="queryForm.page"
:layout="layout"
:page-size="queryForm.size"
:total="total"
style="text-align: right"
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
></el-pagination>
<knowledge-edit ref="edit"></knowledge-edit>
<detail ref="detail"></detail>
</div> </div>
</template> </template>
<script> <script>
import knowledgeEdit from './components/knowledgeEdit'; import {
import detail from './components/detail'; doDelete,
import { getList, doDelete, getCategoryDict } from '@/api/knowledge'; doTypeDel,
getKnowledgeList,
getTypeCategoryTree,
} from '@/api/knowledge';
import addKnowledge from './components/knowledge/add';
import { baseURL } from '@/config/net.config';
import showFile from '@/views/dev/knowledge/components/knowledge/showFile.vue';
export default { export default {
components: { components: {
knowledgeEdit, addKnowledge,
detail, showFile,
}, },
data() { data() {
return { return {
tableData: [], typeData: [],
dialogTableVisible: false, deptData: [],
dialogFormVisible: false, defaultProps: {
lazy: true, children: 'children',
label: 'label',
},
currentNodeKey: '',
knowledgeData: [],
queryForm: {
category: '',
title: '',
page: 1,
size: 20,
},
background: true,
layout: 'total, sizes, prev, pager, next, jumper', layout: 'total, sizes, prev, pager, next, jumper',
total: 0, total: 0,
ids: [], ids: [],
dictData: [],
background: true,
listLoading: false,
elementLoadingText: '正在加载...',
queryForm: {
page: 1,
size: 20,
title: '',
date: '',
category: '',
},
}; };
}, },
created() { created() {
this.fetchData(); this.getKnowledgeList();
this.getCategoryDict(); this.getTypeCategoryTree();
}, },
methods: { methods: {
// showWord(row) {
var filePath = baseURL + '/static/img/' + row.annex;
var parts = filePath.split('.');
var extension = parts.pop().toLowerCase();
console.log(extension);
this.$refs.file.showFileView({
src: filePath,
type: extension,
});
},
download(row) {
window.open(baseURL + '/static/img/' + row.annex);
},
//
async getTypeCategoryTree() {
const { data } = await getTypeCategoryTree();
this.typeData = data;
},
//
handleCheckChange(data, node, self) {
//
if (this.currentNodeKey?.label && this.$refs.tree) {
this.$refs.tree.setCheckedKeys([]);
// key
this.$refs.tree.setCheckedNodes([data]);
}
// key
this.currentNodeKey = data;
this.queryForm.category = data.id;
this.getKnowledgeList();
},
search() { search() {
this.fetchData(); this.getKnowledgeList();
}, },
async getCategoryDict() { //
const { data } = await getCategoryDict(); clockCheck() {
this.dictData = data; this.queryForm.category = '';
this.currentNodeKey = '';
this.$refs.tree.setCheckedKeys([]);
this.getKnowledgeList();
}, },
async fetchData() { //
this.listLoading = true; async getKnowledgeList() {
const { data } = await getList(this.queryForm); const { data } = await getKnowledgeList(this.queryForm);
this.tableData = data.items; this.knowledgeData = data.items;
this.total = data.total; this.total = data.total;
setTimeout(() => {
this.listLoading = false;
}, 500);
}, },
resetForm() { //
this.$refs.queryForm.resetFields(); handleKnowledgeAdd() {
this.$refs.knowledge.showEdit();
}, },
handleAdd() { //
this.$refs['edit'].showEdit(); handleKnowledgeEdit(row) {
}, this.$refs.knowledge.showEdit(row);
handleEdit(row) {
this.$refs['edit'].showEdit(row);
},
handleshow(row) {
this.$refs['detail'].showData(row);
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
const ids = []; const ids = [];
@ -188,33 +246,36 @@ export default {
}); });
this.ids = ids; this.ids = ids;
}, },
deletes() { //
const ids = this.ids; handleKnowledgeDels() {
if (ids.length == 0) { if (this.ids == '') {
this.$message({ this.$message({
type: 'info', type: 'info',
message: '没有选中任何项', message: '请选择要删除的数据',
}); });
return false; } else {
this.knowledgeRemove(this.ids);
} }
this.deleteData(ids);
}, },
// //
deleteData(dis) { handleKnowledgeDel(row) {
const that = this; this.knowledgeRemove([row.id]);
},
knowledgeRemove(ids) {
this.$confirm('你确定要删除当前项吗?', '提示', { this.$confirm('你确定要删除当前项吗?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning',
}) })
.then(() => { .then(() => {
const { msg } = doDelete(dis); const { msg } = doDelete(ids);
this.$message({ this.$message({
type: 'success', type: 'success',
message: msg == undefined ? '删除成功' : msg, message: msg == undefined ? '删除成功' : msg,
}); });
const that = this;
setTimeout(function () { setTimeout(function () {
that.fetchData(); that.getKnowledgeList();
}, 1000); }, 1000);
}) })
.catch(() => { .catch(() => {
@ -224,76 +285,35 @@ export default {
}); });
}); });
}, },
handleDelete(row) {
const that = this;
that.deletes([row.id]);
},
handleQuery() { handleQuery() {
this.queryForm.page = 1; this.queryForm.page = 1;
this.fetchData(); this.getKnowledgeList();
}, },
handleSizeChange(val) { handleSizeChange(val) {
this.queryForm.size = val; this.queryForm.size = val;
this.fetchData(); this.getKnowledgeList();
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.queryForm.page = val; this.queryForm.page = val;
this.fetchData(); this.getKnowledgeList();
}, },
}, },
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.el-input { .manage-wrap {
width: 200px !important; display: flex;
} justify-content: space-between;
.el-select { align-items: flex-start;
width: 200px !important; .el-input {
} width: 200px !important;
.manage-button {
padding-left: 12px;
margin-bottom: 30px;
}
</style>
<style lang="scss" scoped>
.el-submenu__title:hover {
background-color: rgba(#1890ff, 0.085) !important;
color: hsla(208, 100%, 55%, 0.95) !important;
}
.el-dialog {
.el-dialog__header {
background-color: #1890ff !important;
padding: 15px 20px;
text-align: left !important;
.el-dialog__title {
color: #e8f4ff !important;
}
.el-dialog__headerbtn .el-dialog__close {
color: #e8f4ff !important;
}
} }
.el-dialog__body { .el-select {
padding: 20px !important; width: 200px !important;
.el-form-item {
margin-bottom: 10px !important;
.el-input {
width: 100% !important;
}
.el-select {
width: 100% !important;
}
.el-cascader {
width: 100% !important;
}
}
.el-form-item:last-child {
margin-bottom: 20px !important;
}
} }
.dialog-footer { .manage-button {
text-align: right; padding-left: 12px;
} }
} }
</style> </style>

View File

@ -0,0 +1,118 @@
<template>
<el-dialog
v-model="dialogFormVisible"
:title="title"
width="500px"
@close="close"
>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="分类名称" prop="categoryName">
<el-input
v-model.trim="form.categoryName"
autocomplete="off"
></el-input>
</el-form-item>
<el-form-item label="上级分类" prop="parentId">
<el-select v-model="form.parentId" placeholder="请选择上级分类">
<el-option
v-for="item in categoryData"
:key="item.categoryId"
:label="item.categoryName"
:value="item.categoryId"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="排序" prop="orderNum">
<el-input v-model.trim="form.orderNum" autocomplete="off"></el-input>
</el-form-item>
</el-form>
<div class="dialog-footer">
<el-button type="primary" size="small" @click="save"> </el-button>
<el-button size="small" @click="close"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { getDeptList, doDeptAdd, doDeptEdit } from '@/api/dept';
import { doTypeAdd, doTypeEdit, getTypeList } from '@/api/knowledge';
export default {
data() {
return {
form: {
categoryId: '',
parentId: '',
categoryName: '',
orderNum: '',
},
rules: {
categoryName: [
{ required: true, trigger: 'blur', message: '请输入分类名称' },
],
},
clearable: true,
categoryData: [],
title: '',
dialogFormVisible: false,
};
},
created() {},
methods: {
async getTypeList() {
const { data } = await getTypeList();
data.push({ categoryId: 0, categoryName: '顶级分类' });
this.categoryData = data;
},
categoryEdit(row) {
this.getTypeList();
if (!row) {
this.title = '添加分类';
} else {
this.title = '编辑分类';
this.form.categoryId = row.id;
this.form.parentId = row.parentId;
this.form.categoryName = row.label;
this.form.orderNum = row.weight;
}
this.dialogFormVisible = true;
},
close() {
this.$refs['form'].resetFields();
this.form = this.$options.data().form;
this.dialogFormVisible = false;
this.$emit('fetch-data');
},
save() {
this.$refs['form'].validate(async valid => {
if (valid) {
if (this.form.categoryId) {
const { msg } = await doTypeEdit(this.form);
this.$notify({
title: msg,
type: 'success',
});
} else {
delete this.form.categoryId;
const { msg } = await doTypeAdd(this.form);
this.$notify({
title: msg,
type: 'success',
});
}
this.$refs['form'].resetFields();
this.dialogFormVisible = false;
this.$parent.fetchData();
} else {
return false;
}
});
},
},
};
</script>
<style>
.select {
width: 100%;
}
</style>

View File

@ -0,0 +1,154 @@
<template>
<div class="manage-container">
<vab-query-form>
<el-button
v-if="isBtnPerm('/knowledgeCategory/add')"
type="primary"
@click="handleAdd"
>
添加分类
</el-button>
</vab-query-form>
<el-table
v-loading="listLoading"
:data="typeData"
style="width: 100%; margin-bottom: 20px"
row-key="id"
border
default-expand-all
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
>
<el-table-column
prop="id"
label="ID"
sortable
width="180"
></el-table-column>
<el-table-column
prop="label"
label="分类名称"
sortable
width="180"
></el-table-column>
<el-table-column fixed="right" label="操作" align="center">
<template #default="{ row }">
<el-button
v-if="isBtnPerm('/knowledgeCategory/update')"
type="text"
@click="handleEdit(row)"
>
编辑
</el-button>
<el-button
v-if="isBtnPerm('/knowledgeCategory/delete')"
type="text"
@click="handleDelete(row)"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<add-type ref="type"></add-type>
</div>
</template>
<script>
import addType from './components/add';
import { doTypeDel, getTypeCategoryTree } from '@/api/knowledge';
export default {
components: {
addType,
},
data() {
return {
typeData: [],
lazy: true,
listLoading: true,
elementLoadingText: '正在加载...',
};
},
computed: {
height() {
return 500;
},
},
created() {
this.fetchData();
},
methods: {
async fetchData() {
this.listLoading = true;
const { data } = await getTypeCategoryTree();
this.typeData = data;
this.listLoading = false;
},
handleAdd() {
this.$refs.type.categoryEdit();
},
handleEdit(row) {
this.$refs.type.categoryEdit(row);
},
handleDelete(row) {
const that = this;
if (row.id) {
this.$confirm('你确定要删除当前项吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
const { msg } = doTypeDel({ categoryId: row.id });
this.$message({
type: 'success',
message: msg == undefined ? '删除成功' : msg,
});
setTimeout(function () {
that.fetchData();
}, 1000);
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消删除',
});
});
}
},
},
};
</script>
<style lang="scss">
.el-submenu__title:hover {
background-color: rgba(#1890ff, 0.085) !important;
color: hsla(208, 100%, 55%, 0.95) !important;
}
.el-dialog {
.el-dialog__header {
background-color: #1890ff !important;
padding: 15px 20px;
text-align: left !important;
.el-dialog__title {
color: #e8f4ff !important;
}
.el-dialog__headerbtn .el-dialog__close {
color: #e8f4ff !important;
}
}
.el-dialog__body {
padding: 20px !important;
.el-form-item {
margin-bottom: 10px !important;
.el-input {
width: 100% !important;
}
.el-select {
width: 100% !important;
}
}
.el-form-item:last-child {
margin-bottom: 20px !important;
}
}
}
</style>

View File

@ -23,8 +23,20 @@
<div class="manage-button"> <div class="manage-button">
<el-button size="small" @click="resetForm()">重置</el-button> <el-button size="small" @click="resetForm()">重置</el-button>
<el-button type="primary" size="small" @click="search">查询</el-button> <el-button type="primary" size="small" @click="search">查询</el-button>
<el-button type="primary" size="small" @click="handleAdd">添加</el-button> <el-button
<el-button type="primary" size="small" @click="exportData"> v-if="isBtnPerm('/equipment/add')"
type="primary"
size="small"
@click="handleAdd"
>
添加
</el-button>
<el-button
v-if="isBtnPerm('/equipment/export')"
type="primary"
size="small"
@click="exportData"
>
导出 导出
</el-button> </el-button>
</div> </div>
@ -99,8 +111,20 @@
></el-table-column> ></el-table-column>
<el-table-column fixed="right" label="操作" align="center" width="150"> <el-table-column fixed="right" label="操作" align="center" width="150">
<template #default="{ row }"> <template #default="{ row }">
<el-button type="text" @click="handleDelete(row)">删除</el-button> <el-button
<el-button type="text" @click="handleEdit(row)">编辑</el-button> v-if="isBtnPerm('/alarmRecord/remove')"
type="text"
@click="handleDelete(row)"
>
删除
</el-button>
<el-button
v-if="isBtnPerm('/equipment/update')"
type="text"
@click="handleEdit(row)"
>
编辑
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@ -71,10 +71,20 @@
<div class="manage-button"> <div class="manage-button">
<el-button size="small" @click="resetForm()">重置</el-button> <el-button size="small" @click="resetForm()">重置</el-button>
<el-button type="primary" size="small" @click="search">查询</el-button> <el-button type="primary" size="small" @click="search">查询</el-button>
<el-button type="primary" size="small" @click="handleAdd()"> <el-button
v-if="isBtnPerm('/repair/add')"
type="primary"
size="small"
@click="handleAdd()"
>
添加 添加
</el-button> </el-button>
<el-button type="primary" size="small" @click="exportData"> <el-button
v-if="isBtnPerm('/repair/export')"
type="primary"
size="small"
@click="exportData"
>
导出 导出
</el-button> </el-button>
</div> </div>
@ -163,9 +173,27 @@
</el-table-column> </el-table-column>
<el-table-column fixed="right" label="操作" align="center"> <el-table-column fixed="right" label="操作" align="center">
<template #default="{ row }"> <template #default="{ row }">
<el-button type="text" @click="handleTask(row)">转任务</el-button> <el-button
<el-button type="text" @click="handleEdit(row)">编辑</el-button> v-if="isBtnPerm('/repair/toTask')"
<el-button type="text" @click="handleDelete(row)">删除</el-button> type="text"
@click="handleTask(row)"
>
转任务
</el-button>
<el-button
v-if="isBtnPerm('/repair/update')"
type="text"
@click="handleEdit(row)"
>
编辑
</el-button>
<el-button
v-if="isBtnPerm('/repair/remove')"
type="text"
@click="handleDelete(row)"
>
删除
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@ -39,6 +39,9 @@ export default {
this.$refs['equipment'].showData(); this.$refs['equipment'].showData();
} }
}, },
showData() {
this.$refs['online'].showData();
},
}, },
}; };
</script> </script>

View File

@ -63,6 +63,9 @@ export default {
this.fetchData(); this.fetchData();
}, },
methods: { methods: {
showData() {
this.created();
},
async fetchData() { async fetchData() {
this.listLoading = true; this.listLoading = true;
const { data } = await getList(this.queryForm); const { data } = await getList(this.queryForm);

View File

@ -30,10 +30,20 @@
<div class="manage-button"> <div class="manage-button">
<el-button size="small" @click="resetForm()">重置</el-button> <el-button size="small" @click="resetForm()">重置</el-button>
<el-button type="primary" size="small" @click="search">查询</el-button> <el-button type="primary" size="small" @click="search">查询</el-button>
<el-button type="primary" size="small" @click="exportData"> <el-button
v-if="isBtnPerm('/taskReport/export')"
type="primary"
size="small"
@click="exportData"
>
导出 导出
</el-button> </el-button>
<el-button type="primary" size="small" @click="deletes"> <el-button
v-if="isBtnPerm('/task/remove')"
type="primary"
size="small"
@click="deletes"
>
批量删除 批量删除
</el-button> </el-button>
</div> </div>
@ -118,9 +128,29 @@
</el-table-column> </el-table-column>
<el-table-column fixed="right" label="操作" align="center" width="180"> <el-table-column fixed="right" label="操作" align="center" width="180">
<template #default="{ row }"> <template #default="{ row }">
<el-button type="text" plain @click="feedbackShow(row)">反馈</el-button> <el-button
<el-button type="text" plain @click="handleEdit(row)">编辑</el-button> v-if="isBtnPerm('/task/feedback')"
<el-button type="text" @click="handleDelete(row)">删除</el-button> type="text"
plain
@click="feedbackShow(row)"
>
反馈
</el-button>
<el-button
v-if="isBtnPerm('/task/update')"
type="text"
plain
@click="handleEdit(row)"
>
编辑
</el-button>
<el-button
v-if="isBtnPerm('/task/remove')"
type="text"
@click="handleDelete(row)"
>
删除
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@ -30,10 +30,20 @@
<div class="manage-button"> <div class="manage-button">
<el-button size="small" @click="resetForm()">重置</el-button> <el-button size="small" @click="resetForm()">重置</el-button>
<el-button type="primary" size="small" @click="search">查询</el-button> <el-button type="primary" size="small" @click="search">查询</el-button>
<el-button type="primary" size="small" @click="exportData"> <el-button
v-if="isBtnPerm('/taskReport/export')"
type="primary"
size="small"
@click="exportData"
>
导出 导出
</el-button> </el-button>
<el-button type="primary" size="small" @click="deletes"> <el-button
v-if="isBtnPerm('/task/remove')"
type="primary"
size="small"
@click="deletes"
>
批量删除 批量删除
</el-button> </el-button>
</div> </div>
@ -112,13 +122,31 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" width="180"> <el-table-column label="操作" align="center" width="180">
<template #default="{ row }"> <template #default="{ row }">
<el-button size="mini" type="primary" plain @click="feedbackShow(row)"> <el-button
v-if="isBtnPerm('/task/feedback')"
size="mini"
type="primary"
plain
@click="feedbackShow(row)"
>
反馈 反馈
</el-button> </el-button>
<el-button size="mini" type="primary" plain @click="handleEdit(row)"> <el-button
v-if="isBtnPerm('/task/update')"
size="mini"
type="primary"
plain
@click="handleEdit(row)"
>
编辑 编辑
</el-button> </el-button>
<el-button type="text" @click="handleDelete(row)">删除</el-button> <el-button
v-if="isBtnPerm('/task/remove')"
type="text"
@click="handleDelete(row)"
>
删除
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@ -29,14 +29,30 @@
</div> </div>
<div class="manage-button"> <div class="manage-button">
<el-button size="small" @click="resetForm()">重置</el-button> <el-button size="small" @click="resetForm()">重置</el-button>
<el-button type="primary" size="small" plain @click="handleAdd"> <el-button
v-if="isBtnPerm('/task/add')"
type="primary"
size="small"
plain
@click="handleAdd"
>
新建 新建
</el-button> </el-button>
<el-button type="primary" size="small" @click="search">查询</el-button> <el-button type="primary" size="small" @click="search">查询</el-button>
<el-button type="primary" size="small" @click="exportData"> <el-button
v-if="isBtnPerm('/taskReport/export')"
type="primary"
size="small"
@click="exportData"
>
导出 导出
</el-button> </el-button>
<el-button type="primary" size="small" @click="deletes"> <el-button
v-if="isBtnPerm('/task/remove')"
type="primary"
size="small"
@click="deletes"
>
批量删除 批量删除
</el-button> </el-button>
</div> </div>
@ -121,9 +137,27 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" width="180"> <el-table-column label="操作" align="center" width="180">
<template #default="{ row }"> <template #default="{ row }">
<el-button type="text" @click="feedbackShow(row)">反馈</el-button> <el-button
<el-button type="text" @click="handleEdit(row)">编辑</el-button> v-if="isBtnPerm('/task/feedback')"
<el-button type="text" @click="handleDelete(row)">删除</el-button> type="text"
@click="feedbackShow(row)"
>
反馈
</el-button>
<el-button
v-if="isBtnPerm('/task/update')"
type="text"
@click="handleEdit(row)"
>
编辑
</el-button>
<el-button
v-if="isBtnPerm('/task/remove')"
type="text"
@click="handleDelete(row)"
>
删除
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@ -40,6 +40,9 @@ export default {
this.$refs['other'].otherIndex(); this.$refs['other'].otherIndex();
} }
}, },
showData() {
this.$refs['alarm'].alarmIndex();
},
}, },
}; };
</script> </script>

View File

@ -3,7 +3,13 @@
<div class="title"> <div class="title">
<el-image :src="require('@/assets/copy.png')" class="icon" /> <el-image :src="require('@/assets/copy.png')" class="icon" />
<span>{{ deviceInfo.name }}</span> <span>{{ deviceInfo.name }}</span>
<!-- <span style="color: #3281fd">{{ 20 }}</span>--> <a
href="javascript:;"
style="position: fixed; right: 20px"
@click="close()"
>
关闭
</a>
</div> </div>
<div class="body"> <div class="body">
<div class="body-item"> <div class="body-item">
@ -106,6 +112,9 @@ export default {
isDetailShow(status) { isDetailShow(status) {
this.isShow = status; this.isShow = status;
}, },
close() {
this.isShow = false;
},
}, },
}; };
</script> </script>

View File

@ -201,11 +201,12 @@ export default {
`#a${this.siteDetailOpenPoint.id}` `#a${this.siteDetailOpenPoint.id}`
); );
const { const {
top = 0, top = 339,
left = 0, left = 1286,
width = 60, width = 60,
} = abc?.getBoundingClientRect?.() ?? {}; } = abc?.getBoundingClientRect?.() ?? {};
const { top: t = 0, left: l = 0 } = this.markerContainRect; const { top: t = 0, left: l = 0 } = this.markerContainRect;
this.$refs?.de?.setPosition?.({ this.$refs?.de?.setPosition?.({
top: top - t, top: top - t,
left: left + width - l, left: left + width - l,
@ -214,22 +215,16 @@ export default {
} }
}, },
detailShow(point) { detailShow(point) {
const infoWin = new DefinedMarkerInfoWindow(`a${point.id}`, {
placement: 'rightBottom',
});
this.siteDetailOpenPoint = null;
// infoWin.on('open', () => {
this.$refs['detail'].isDetailShow(true); this.$refs['detail'].isDetailShow(true);
this.markerSiteData = point;
this.siteDetailOpenPoint = point; this.siteDetailOpenPoint = point;
this.resizeSiteDetailPosition(); this.resizeSiteDetailPosition();
// });
}, },
onNodeClick(node) { onNodeClick(node) {
// this.$refs['detail'].isDetailShow(true);
this.map.centerAndZoom(new T.LngLat(node.longitude, node.latitude), 18); this.map.centerAndZoom(new T.LngLat(node.longitude, node.latitude), 18);
// this.siteDetailOpenPoint = node; this.detailShow(node);
// this.detailShow(node); this.loading.close();
console.log(node, 'node-click______-11111'); console.log(node.id, 'node-click______-11111');
}, },
}, },
}; };

View File

@ -49,7 +49,13 @@
></el-table-column> ></el-table-column>
<el-table-column fixed="right" label="操作" align="center"> <el-table-column fixed="right" label="操作" align="center">
<template #default="{ row }"> <template #default="{ row }">
<el-button type="text" @click="bindDevice(row)">绑定项目</el-button> <el-button
v-if="isBtnPerm('/alarmUser/addProjects')"
type="text"
@click="bindDevice(row)"
>
绑定项目
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@ -53,12 +53,12 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="站点工艺" prop="technology"> <el-form-item label="设备工艺" prop="technology">
<el-select <el-select
v-model="form.technology" v-model="form.technology"
size="small" size="small"
filterable filterable
placeholder="请选择站点工艺" placeholder="请选择设备工艺"
> >
<el-option <el-option
v-for="item in deviceTechnologyData" v-for="item in deviceTechnologyData"
@ -68,12 +68,12 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="站点材质" prop="material"> <el-form-item label="设备材质" prop="material">
<el-select <el-select
v-model="form.material" v-model="form.material"
size="small" size="small"
filterable filterable
placeholder="请选择站点材质" placeholder="请选择设备材质"
> >
<el-option <el-option
v-for="item in deviceMaterialData" v-for="item in deviceMaterialData"
@ -149,7 +149,7 @@
type="number" type="number"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item label="物联网卡" prop="simNum"> <el-form-item label="sim卡接入号码" prop="simNum">
<el-input v-model="form.simNum" size="small" type="text"></el-input> <el-input v-model="form.simNum" size="small" type="text"></el-input>
</el-form-item> </el-form-item>
<!-- <el-form-item label="报警用户" prop="alarmUser">--> <!-- <el-form-item label="报警用户" prop="alarmUser">-->

View File

@ -12,7 +12,12 @@
<el-button icon="el-icon-search" type="primary" @click="searchAddress"> <el-button icon="el-icon-search" type="primary" @click="searchAddress">
查询 查询
</el-button> </el-button>
<el-button icon="el-icon-del" type="danger" @click="delAddress" style="float:right"> <el-button
icon="el-icon-del"
type="danger"
style="float: right"
@click="delAddress"
>
清空 清空
</el-button> </el-button>
<bd-map <bd-map
@ -51,9 +56,9 @@ export default {
searchAddress() { searchAddress() {
this.$refs['maps'].setPlace(this.keyWords); this.$refs['maps'].setPlace(this.keyWords);
}, },
delAddress(){ delAddress() {
this.keyWords = '' this.keyWords = '';
this.$refs['maps'].removeMarker(); this.$refs['maps'].removeMarker();
}, },
showMap(location) { showMap(location) {
this.dialogFormVisible = true; this.dialogFormVisible = true;

View File

@ -79,16 +79,36 @@
<div class="manage-button"> <div class="manage-button">
<el-button size="small" @click="resetForm()">重置</el-button> <el-button size="small" @click="resetForm()">重置</el-button>
<el-button type="primary" size="small" @click="search">查询</el-button> <el-button type="primary" size="small" @click="search">查询</el-button>
<el-button type="primary" size="small" @click="handleAdd"> <el-button
v-if="isBtnPerm('/iot/device/insert')"
type="primary"
size="small"
@click="handleAdd"
>
添加站点 添加站点
</el-button> </el-button>
<el-button type="primary" size="small" @click="deletes"> <el-button
v-if="isBtnPerm('/iot/device/remove')"
type="primary"
size="small"
@click="deletes"
>
批量删除 批量删除
</el-button> </el-button>
<el-button type="primary" size="small" @click="exportData"> <el-button
v-if="isBtnPerm('/iot/device/exportDevice')"
type="primary"
size="small"
@click="exportData"
>
导出 导出
</el-button> </el-button>
<el-button type="primary" size="small" @click="fboxSync"> <el-button
v-if="isBtnPerm('/fbox/sync')"
type="primary"
size="small"
@click="fboxSync"
>
盒子同步 盒子同步
</el-button> </el-button>
</div> </div>
@ -289,6 +309,43 @@
width="200" width="200"
align="center" align="center"
></el-table-column> ></el-table-column>
<el-table-column
prop="boardImg"
label="公示牌"
width="200"
align="center"
>
<template #default="{ row }">
<el-image
style="width: 100px; height: 100px"
:src="fileUrl + row.boardImg"
></el-image>
</template>
</el-table-column>
<el-table-column
prop="warrantyPeriod"
label="设备保修到期时间"
width="200"
align="center"
></el-table-column>
<el-table-column
prop="deviceVersion.dataValue"
label="设备版本"
width="200"
align="center"
></el-table-column>
<el-table-column
prop="ownerName"
label="站点客户联系人"
width="200"
align="center"
></el-table-column>
<el-table-column
prop="ownerPhone"
label="站点客户联系方式"
width="200"
align="center"
></el-table-column>
<el-table-column <el-table-column
prop="offlineTime" prop="offlineTime"
label="离线时间" label="离线时间"
@ -303,11 +360,41 @@
></el-table-column> ></el-table-column>
<el-table-column fixed="right" label="操作" width="280" align="center"> <el-table-column fixed="right" label="操作" width="280" align="center">
<template #default="{ row }"> <template #default="{ row }">
<el-button type="text" @click="sensorData(row)">数据</el-button> <el-button
<el-button type="text" @click="sensorEdit(row)">传感器</el-button> v-if="isBtnPerm('/iot/device/shuju')"
<el-button type="text" @click="copyDevice(row)">复制</el-button> type="text"
<el-button type="text" @click="handleEdit(row)">编辑</el-button> @click="sensorData(row)"
<el-button type="text" @click="handleDelete(row)">删除</el-button> >
数据
</el-button>
<el-button
v-if="isBtnPerm('/iot/device/chuanganqi')"
type="text"
@click="sensorEdit(row)"
>
传感器
</el-button>
<el-button
v-if="isBtnPerm('/iot/device/copy')"
type="text"
@click="copyDevice(row)"
>
复制
</el-button>
<el-button
v-if="isBtnPerm('/iot/device/update')"
type="text"
@click="handleEdit(row)"
>
编辑
</el-button>
<el-button
v-if="isBtnPerm('/iot/device/remove')"
type="text"
@click="handleDelete(row)"
>
删除
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -339,6 +426,7 @@ import ajax from '@/api/download';
import deviceEdit from './components/deviceEdit'; import deviceEdit from './components/deviceEdit';
import CopyDevice from './components/copyDevice'; import CopyDevice from './components/copyDevice';
import syncDevice from './components/sync'; import syncDevice from './components/sync';
import { baseURL } from '@/config';
export default { export default {
name: 'Index', name: 'Index',
components: { components: {
@ -348,6 +436,7 @@ export default {
}, },
data() { data() {
return { return {
fileUrl: baseURL + '/static/img/',
deviceData: [], deviceData: [],
lazy: true, lazy: true,
activeName: 'first', activeName: 'first',

View File

@ -17,10 +17,20 @@
<div class="manage-button"> <div class="manage-button">
<el-button size="small" @click="resetForm()">重置</el-button> <el-button size="small" @click="resetForm()">重置</el-button>
<el-button type="primary" size="small" @click="search">查询</el-button> <el-button type="primary" size="small" @click="search">查询</el-button>
<el-button type="primary" size="small" @click="deletes"> <el-button
v-if="isBtnPerm('/iot/project/group/remove')"
type="primary"
size="small"
@click="deletes"
>
批量删除 批量删除
</el-button> </el-button>
<el-button type="primary" size="small" @click="handleAdd"> <el-button
v-if="isBtnPerm('/iot/project/group/saveOrUpdate')"
type="primary"
size="small"
@click="handleAdd"
>
添加项目组 添加项目组
</el-button> </el-button>
</div> </div>
@ -60,9 +70,27 @@
></el-table-column> ></el-table-column>
<el-table-column fixed="right" label="操作" align="center"> <el-table-column fixed="right" label="操作" align="center">
<template #default="{ row }"> <template #default="{ row }">
<el-button type="text" @click="handleEdit(row)">编辑</el-button> <el-button
<el-button type="text" @click="addProject(row)">项目</el-button> v-if="isBtnPerm('/iot/project/group/edit')"
<el-button type="text" @click="handleDelete(row)">删除</el-button> type="text"
@click="handleEdit(row)"
>
编辑
</el-button>
<el-button
v-if="isBtnPerm('/iot/project/group/xiangmu')"
type="text"
@click="addProject(row)"
>
项目
</el-button>
<el-button
v-if="isBtnPerm('/iot/project/group/remove')"
type="text"
@click="handleDelete(row)"
>
删除
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@ -0,0 +1,216 @@
<template>
<el-dialog
v-model="dialogFormVisible"
:title="title"
width="700px"
@close="close"
>
<el-button type="primary" size="small" @click="addAtt">
新增配置项
</el-button>
<div class="item-line" v-for="(item, index) in attribute" :key="index">
<div class="item-title">
<i
class="el-icon-remove"
style="color: red; margin-top: 26px; font-size: 23px"
size="26"
@click="delItem(index)"
></i>
配置项{{ parseInt(index) + 1 }}
</div>
<el-row type="flex" class="row-bg">
<el-col :span="12" class="item-content">
<el-input
v-model.trim="item.attributeName"
size="small"
placeholder="配置参数"
autocomplete="off"
></el-input>
</el-col>
<el-col :span="12" class="item-content">
<el-input
v-model.trim="item.attributeValue"
size="small"
placeholder="配置值"
autocomplete="off"
></el-input>
</el-col>
<el-col :span="12" class="item-content">
<el-input
v-model.trim="item.attributeNameEn"
size="small"
placeholder="configuration parameter"
autocomplete="off"
></el-input>
</el-col>
<el-col :span="12" class="item-content">
<el-input
v-model.trim="item.attributeValueEn"
size="small"
placeholder="Configuration value"
autocomplete="off"
></el-input>
</el-col>
</el-row>
<div class="item-sort">
<i
class="el-icon-sort-up sort"
@click="sortData(index, -1)"
atl="上移"
></i>
<i
class="el-icon-sort-down sort"
@click="sortData(index, 1)"
alt="上移"
></i>
</div>
</div>
<div class="dialog-footer">
<el-button type="primary" size="small" @click="save"> </el-button>
<el-button size="small" @click="close"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { addData, updateData, addAttribute } from '@/api/product';
export default {
name: 'GroupEdit',
data() {
return {
form: {
id: '',
name: '',
},
attribute: [],
categoryId: '',
rules: {
name: [{ required: true, trigger: 'blur', message: '请输入产品名称' }],
materialCode: [
{ required: true, trigger: 'blur', message: '请输入物料编码' },
],
},
roleData: [],
clearable: true,
roleId: '',
parentData: [],
title: '',
dialogFormVisible: false,
};
},
created() {},
methods: {
addAtt() {
this.attribute.push({
attributeName: '',
attributeValue: '',
attributeNameEn: '',
attributeValueEn: '',
});
},
showEdit(row, categoryId) {
this.categoryId = categoryId;
this.title = '配置参数';
this.attribute = Object.assign([], row);
this.dialogFormVisible = true;
},
delItem(index) {
this.$confirm('你确定删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
this.attribute.splice(index, 1);
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消删除',
});
});
},
sortData(index, type) {
let index1, index2;
if (
(index == 0 && type == -1) ||
(index == this.attribute.length - 1 && type == 1)
) {
return;
}
if (type == -1) {
index1 = index;
index2 = index - 1;
} else {
index1 = index + 1;
index2 = index;
}
[this.attribute[index1], this.attribute[index2]] = [
this.attribute[index2],
this.attribute[index1],
];
},
close() {
this.dialogFormVisible = false;
this.$emit('fetch-data');
},
save() {
console.log(this.attribute);
let attribute = this.attribute.map((item, index) => {
return {
...item,
orderNum: index + 1,
};
});
addAttribute({ categoryId: this.categoryId, attribute }).then(res => {
this.$notify({
title: '操作成功',
type: 'success',
});
this.dialogFormVisible = false;
});
},
},
};
</script>
<style lang="scss">
.el-dialog {
.el-dialog__header {
border-bottom: 1px solid #e3e3e3 !important;
padding: 15px 20px;
}
.dialog-footer {
text-align: right;
.el button {
height: 36px !important;
min-height: 36px !important;
line-height: 366px !important;
}
}
}
.item-line {
width: 100%;
display: flex;
.item-title {
width: 140px;
display: flex;
line-height: 76px;
}
}
.item-content {
padding: 5px;
}
.item-sort {
width: 50px;
display: flex;
.sort {
font-size: 18px;
font-weight: bolder;
margin-top: 33px;
&:hover {
color: #409eff;
}
}
}
</style>

View File

@ -0,0 +1,175 @@
<template>
<el-dialog
v-model="dialogFormVisible"
:title="title"
width="500px"
@close="close"
>
<el-form
ref="form"
:model="form"
:rules="rules"
label-width="80px"
label-position="left"
>
<el-form-item label="产品名称" prop="name">
<el-input
v-model.trim="form.name"
size="small"
autocomplete="off"
></el-input>
</el-form-item>
<el-form-item label="物料编码" prop="materialCode">
<el-input
v-model.trim="form.materialCode"
size="small"
autocomplete="off"
></el-input>
</el-form-item>
<el-form-item label="铭片模板" prop="nameplate">
<el-upload
v-if="dialogFormVisible"
:action="updateAction"
list-type="picture-card"
:on-preview="handlePictureCardPreview"
:on-remove="handleRemove"
:on-success="fileSuccess"
:headers="headerData"
name="files"
:file-list="fileList"
>
<i class="el-icon-plus"></i>
</el-upload>
<el-dialog title="大图" v-model="dialogVisible">
<img width="100%" :src="dialogImageUrl" alt="" />
</el-dialog>
</el-form-item>
<el-form-item label="备注">
<el-input
v-model.trim="form.remark"
size="small"
autocomplete="off"
></el-input>
</el-form-item>
</el-form>
<div class="dialog-footer">
<el-button type="primary" size="small" @click="save"> </el-button>
<el-button size="small" @click="close"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { addData, updateData } from '@/api/product';
import { baseURL } from '@/config';
import store from '@/store';
export default {
name: 'GroupEdit',
data() {
return {
updateAction: '',
fileList: [],
form: {
id: '',
name: '',
},
rules: {
name: [{ required: true, trigger: 'blur', message: '请输入产品名称' }],
materialCode: [
{ required: true, trigger: 'blur', message: '请输入物料编码' },
],
nameplate: [
{ required: true, trigger: 'blur', message: '请上传铭片模板' },
],
},
roleData: [],
clearable: true,
roleId: '',
parentData: [],
title: '',
dialogVisible: false,
dialogFormVisible: false,
};
},
created() {
this.setUpdateData();
},
methods: {
setUpdateData() {
this.updateAction = baseURL + '/file/uploadImg';
this.headerData = { token: store.getters['user/token'] };
},
fileSuccess(response, file, fileList) {
var img = this.form.nameplate;
this.form.nameplate = response.data;
console.log(this.form);
},
handleRemove(file, fileList) {
console.log(file, fileList);
this.form.nameplate = '';
},
handlePictureCardPreview(file) {
console.log(file);
this.dialogImageUrl = file.url;
this.dialogVisible = true;
},
showEdit(row) {
if (!row) {
this.title = '添加产品';
} else {
this.title = '编辑产品';
row.nameplate &&
this.fileList.push({
url: row.nameplate,
});
this.form = Object.assign({}, row);
}
this.dialogFormVisible = true;
},
close() {
this.fileList = [];
this.$refs['form'].resetFields();
this.form = this.$options.data().form;
this.dialogFormVisible = false;
this.$emit('fetch-data');
},
save() {
this.$refs['form'].validate(async valid => {
if (valid) {
const { msg } = this.form.id
? await updateData(this.form)
: await addData(this.form);
this.$notify({
title: msg,
type: 'success',
});
this.$refs['form'].resetFields();
this.dialogFormVisible = false;
this.$parent.fetchData();
} else {
return false;
}
});
},
},
};
</script>
<style lang="scss">
.el-dialog {
.el-dialog__header {
border-bottom: 1px solid #e3e3e3 !important;
padding: 15px 20px;
}
.dialog-footer {
text-align: right;
.el button {
height: 36px !important;
min-height: 36px !important;
line-height: 366px !important;
}
}
}
</style>

View File

@ -0,0 +1,291 @@
<template>
<div class="manage-container">
<div class="manage-wrap">
<div class="manage-input">
<el-form ref="queryForm" :model="queryForm" label-width="80px">
<vab-query-form>
<el-form-item width="100" prop="name" label="产品名称">
<el-input
v-model="queryForm.name"
size="small"
placeholder="请输入产品名称"
></el-input>
</el-form-item>
</vab-query-form>
</el-form>
</div>
<div class="manage-button">
<el-button size="small" @click="resetForm()">重置</el-button>
<el-button type="primary" size="small" @click="search">查询</el-button>
<el-button type="primary" size="small" @click="deletes">
批量删除
</el-button>
<el-button type="primary" size="small" @click="handleAdd">
添加产品
</el-button>
</div>
</div>
<el-table
v-loading="listLoading"
:data="groupData"
border
stripe
style="width: 100%"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column
prop="id"
label="ID"
width="60"
align="center"
></el-table-column>
<el-table-column
prop="name"
label="产品名称"
width="300"
align="center"
></el-table-column>
<el-table-column
prop="materialCode"
label="金蝶物料编号"
width="250"
align="center"
></el-table-column>
<el-table-column
prop="remark"
label="备注"
width="250"
align="center"
></el-table-column>
<el-table-column fixed="right" label="操作" align="center">
<template #default="{ row }">
<el-button type="text" @click="handleEdit(row)">编辑</el-button>
<el-button type="text" @click="addProject(row)">产品参数</el-button>
<el-button type="text" @click="handleDelete(row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
:background="background"
:current-page="queryForm.page"
:layout="layout"
:page-size="queryForm.size"
:total="total"
style="text-align: right"
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
></el-pagination>
<group-edit ref="edit"></group-edit>
<attribute-edit ref="attribute"></attribute-edit>
</div>
</template>
<script>
import {
delectData,
getList,
addAttribute,
updateData,
getAttribute,
} from '@/api/product';
import groupEdit from './groupEdit';
import attributeEdit from './attributeEdit';
import { baseURL } from '@/config';
import { imgReplacePath } from '@/utils/img';
export default {
name: 'Index',
components: { groupEdit, attributeEdit },
data() {
return {
groupData: [],
lazy: true,
layout: 'total, sizes, prev, pager, next, jumper',
total: 0,
background: true,
listLoading: true,
elementLoadingText: '正在加载...',
ids: [],
queryForm: {
page: 1,
size: 20,
name: '',
},
};
},
computed: {
height() {
return 500;
},
},
created() {
this.fetchData();
},
methods: {
async fetchData() {
this.listLoading = true;
const { data } = await getList(this.queryForm);
this.groupData = data.items.map(item => {
item.nameplate &&
(item.nameplate = baseURL + '/static/img/' + item.nameplate);
return item;
});
console.log(this.groupData);
this.total = data.total;
setTimeout(() => {
this.listLoading = false;
}, 500);
},
search() {
this.fetchData();
},
addProject(row) {
getAttribute(row.id).then(res => {
let attribute = res.data;
attribute.sort((a, b) => a.orderNum - b.orderNum);
this.$refs['attribute'].showEdit(attribute, row.id);
});
},
handleAdd() {
this.$refs['edit'].showEdit();
},
handleEdit(row) {
this.$refs['edit'].showEdit(row);
},
resetForm() {
this.$refs.queryForm.resetFields();
},
handleQuery() {
this.queryForm.page = 1;
this.fetchData();
},
handleSizeChange(val) {
this.queryForm.size = val;
this.fetchData();
},
handleCurrentChange(val) {
this.queryForm.page = val;
this.fetchData();
},
deletes() {
const ids = this.ids;
const that = this;
if (ids.length == 0) {
this.$message({
type: 'info',
message: '没有选中任何项',
});
return false;
}
this.$confirm('你确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
const { msg } = delectData(ids);
this.$message({
type: 'success',
message: msg == undefined ? '删除成功' : msg,
});
setTimeout(function () {
that.fetchData();
}, 1000);
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消删除',
});
});
},
handleSelectionChange(val) {
const ids = [];
val.forEach(row => {
ids.push(row.id);
});
this.ids = ids;
},
handleDelete(row) {
var that = this;
if (row.id) {
this.$confirm('你确定要删除当前项吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
const { msg } = delectData([row.id]);
this.$message({
type: 'success',
message: msg == undefined ? '删除成功' : msg,
});
setTimeout(function () {
that.fetchData();
}, 1000);
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消删除',
});
});
}
},
},
};
</script>
<style lang="scss" scoped>
.manage-wrap {
display: flex;
justify-content: space-between;
align-items: flex-start;
.el-input {
width: 200px !important;
}
.el-select {
width: 200px !important;
}
.manage-button {
padding-left: 12px;
margin-bottom: 30px;
}
}
</style>
<style lang="scss">
.el-submenu__title:hover {
background-color: rgba(#1890ff, 0.085) !important;
color: hsla(208, 100%, 55%, 0.95) !important;
}
.el-dialog {
.el-dialog__header {
background-color: #1890ff !important;
padding: 15px 20px;
text-align: left !important;
.el-dialog__title {
color: #e8f4ff !important;
}
.el-dialog__headerbtn .el-dialog__close {
color: #e8f4ff !important;
}
}
.el-dialog__body {
padding: 20px !important;
.el-form-item {
margin-bottom: 10px !important;
.el-input {
width: 100% !important;
}
.el-select {
width: 100% !important;
}
}
.el-form-item:last-child {
margin-bottom: 20px !important;
}
}
}
</style>

View File

@ -51,13 +51,28 @@
<div class="manage-button"> <div class="manage-button">
<el-button size="small" @click="resetForm()">重置</el-button> <el-button size="small" @click="resetForm()">重置</el-button>
<el-button type="primary" size="small" @click="search">查询</el-button> <el-button type="primary" size="small" @click="search">查询</el-button>
<el-button type="primary" size="small" @click="handleAdd"> <el-button
v-if="isBtnPerm('/iot/project/insert')"
type="primary"
size="small"
@click="handleAdd"
>
添加项目 添加项目
</el-button> </el-button>
<el-button type="primary" size="small" @click="remove"> <el-button
v-if="isBtnPerm('/iot/project/remove')"
type="primary"
size="small"
@click="remove"
>
批量删除 批量删除
</el-button> </el-button>
<el-button type="primary" size="small" @click="exportData"> <el-button
v-if="isBtnPerm('/iot/project/export')"
type="primary"
size="small"
@click="exportData"
>
导出 导出
</el-button> </el-button>
</div> </div>
@ -168,10 +183,34 @@
></el-table-column> ></el-table-column>
<el-table-column fixed="right" label="操作" width="220" align="center"> <el-table-column fixed="right" label="操作" width="220" align="center">
<template #default="{ row }"> <template #default="{ row }">
<el-button type="text" @click="device(row)">站点</el-button> <el-button
<el-button type="text" @click="alarmUser(row)">报警用户</el-button> v-if="isBtnPerm('/iot/project/zhandian')"
<el-button type="text" @click="handleEdit(row)">编辑</el-button> type="text"
<el-button type="text" @click="handleDelete(row)">删除</el-button> @click="device(row)"
>
站点
</el-button>
<el-button
v-if="isBtnPerm('/iot/project/yonghu')"
type="text"
@click="alarmUser(row)"
>
报警用户
</el-button>
<el-button
v-if="isBtnPerm('/iot/project/update')"
type="text"
@click="handleEdit(row)"
>
编辑
</el-button>
<el-button
v-if="isBtnPerm('/iot/project/remove')"
type="text"
@click="handleDelete(row)"
>
删除
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@ -71,7 +71,7 @@
<el-input v-model="data.remark" placeholder="1"></el-input> <el-input v-model="data.remark" placeholder="1"></el-input>
</el-form-item> </el-form-item>
<el-form-item v-if="isConfig" label="传感点类型"> <el-form-item v-if="isConfig" label="传感点类型">
<el-select v-model="data.type" placeholder="请选择传感点类型"> <el-select v-model="form.type" placeholder="请选择传感点类型">
<el-option <el-option
v-for="item in typeData" v-for="item in typeData"
:key="item.dataCode" :key="item.dataCode"
@ -143,6 +143,7 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="数据格式"> <el-form-item label="数据格式">
<el-select v-model="form.dataFormat" placeholder="请选择数据格式"> <el-select v-model="form.dataFormat" placeholder="请选择数据格式">
<el-option <el-option
@ -153,20 +154,20 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- <el-form-item label="公式处理">--> <el-form-item label="公式处理">
<!-- <el-input--> <el-input
<!-- v-model="form.formulaUp"--> v-model="form.formulaUp"
<!-- placeholder="公式计算如x/100 可不填"--> placeholder="公式计算如x/100 可不填"
<!-- ></el-input>--> ></el-input>
<!-- <span class="notes">(设备->平台)</span>--> <span class="notes">(设备->平台)</span>
<!-- </el-form-item>--> </el-form-item>
<!-- <el-form-item label="公式处理">--> <el-form-item label="公式处理">
<!-- <el-input--> <el-input
<!-- v-model="form.formulaDown"--> v-model="form.formulaDown"
<!-- placeholder="公式计算如x*100 可不填"--> placeholder="公式计算如x*100 可不填"
<!-- ></el-input>--> ></el-input>
<!-- <span class="notes">(平台->设备)</span>--> <span class="notes">(平台->设备)</span>
<!-- </el-form-item>--> </el-form-item>
<!-- <el-form-item label="参数配置">--> <!-- <el-form-item label="参数配置">-->
<!-- <el-input--> <!-- <el-input-->
<!-- v-model="config"--> <!-- v-model="config"-->
@ -200,6 +201,7 @@ export default {
attrData: [], attrData: [],
typeData: [], typeData: [],
unitData: [], unitData: [],
strategyData: [], strategyData: [],
codeData: [], codeData: [],
fileUrl: baseURL + '/static/img/', fileUrl: baseURL + '/static/img/',
@ -255,7 +257,7 @@ export default {
}, },
config: '', config: '',
isNumber: false, isNumber: false,
isConfig: false, isConfig: true,
dialogFormVisible: false, dialogFormVisible: false,
title: '', title: '',
diffData: {}, diffData: {},
@ -309,6 +311,7 @@ export default {
} }
this.form.id = form.id; this.form.id = form.id;
this.form.name = form.name; this.form.name = form.name;
this.form.type = form.type.dataCode;
this.form.img = form.img; this.form.img = form.img;
this.form.addressId = form.addressId; this.form.addressId = form.addressId;
this.form.offset = form.offset; this.form.offset = form.offset;
@ -360,6 +363,7 @@ export default {
}, },
async getDictData() { async getDictData() {
const { data } = await getDictData(); const { data } = await getDictData();
this.sensorTypeData = data.sensorType;
this.attrData = data.sensorAttribute; this.attrData = data.sensorAttribute;
this.typeData = data.sensorType; this.typeData = data.sensorType;
this.unitData = data.sensorUnit; this.unitData = data.sensorUnit;

View File

@ -24,7 +24,12 @@
<div class="manage-button"> <div class="manage-button">
<el-button size="small" @click="resetForm()">重置</el-button> <el-button size="small" @click="resetForm()">重置</el-button>
<el-button type="primary" size="small" @click="search">查询</el-button> <el-button type="primary" size="small" @click="search">查询</el-button>
<el-button type="primary" size="small" @click="handleAdd()"> <el-button
v-if="isBtnPerm('/iot/sensor/insert')"
type="primary"
size="small"
@click="handleAdd()"
>
添加传感器 添加传感器
</el-button> </el-button>
</div> </div>
@ -84,8 +89,14 @@
width="200" width="200"
align="center" align="center"
></el-table-column> ></el-table-column>
<el-table-column
prop="type.dataValue"
label="类型"
width="200"
align="center"
></el-table-column>
<!-- <el-table-column--> <!-- <el-table-column-->
<!-- prop="status"--> <!-- pr op="status"-->
<!-- label="传感器状态"--> <!-- label="传感器状态"-->
<!-- width="120"--> <!-- width="120"-->
<!-- align="center"--> <!-- align="center"-->
@ -140,8 +151,20 @@
></el-table-column> ></el-table-column>
<el-table-column fixed="right" label="操作" align="center"> <el-table-column fixed="right" label="操作" align="center">
<template #default="{ row }"> <template #default="{ row }">
<el-button type="text" @click="handleEdit(row)">编辑</el-button> <el-button
<el-button type="text" @click="handleDelete(row)">删除</el-button> v-if="isBtnPerm('/iot/sensor/update')"
type="text"
@click="handleEdit(row)"
>
编辑
</el-button>
<el-button
v-if="isBtnPerm('/iot/sensor/remove')"
type="text"
@click="handleDelete(row)"
>
删除
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@ -14,17 +14,32 @@
</el-form-item> </el-form-item>
<el-form-item width="100"> <el-form-item width="100">
<el-button @click="resetForm()">重置</el-button> <el-button @click="resetForm()">重置</el-button>
<el-button type="primary" size="medium" @click="search"> <el-button
:disabled="disabled"
type="primary"
size="medium"
@click="search"
>
查询 查询
</el-button> </el-button>
<el-button type="primary" size="medium" @click="exportData"> <el-button
v-if="isBtnPerm('/iot/device/exportData')"
type="primary"
size="medium"
@click="exportData"
>
导出 导出
</el-button> </el-button>
</el-form-item> </el-form-item>
</vab-query-form> </vab-query-form>
</el-form> </el-form>
<el-card style="height: 380px"> <el-card style="height: 380px">
<div id="main2" ref="echarts" style="height: 380px"></div> <div
v-loading="cardLoading"
id="main2"
ref="echarts"
style="height: 380px"
></div>
</el-card> </el-card>
<el-table <el-table
v-loading="listLoading" v-loading="listLoading"
@ -85,6 +100,7 @@ export default {
components: {}, components: {},
data() { data() {
return { return {
disabled: true,
newTableData: [], newTableData: [],
data: [], data: [],
deviceCode: '', deviceCode: '',
@ -94,6 +110,7 @@ export default {
total: 0, total: 0,
background: true, background: true,
listLoading: true, listLoading: true,
cardLoading: true,
elementLoadingText: '正在加载...', elementLoadingText: '正在加载...',
deviceId: '', deviceId: '',
historyData: [], historyData: [],
@ -135,6 +152,7 @@ export default {
this.listLoading = false; this.listLoading = false;
this.getHistoryData(); this.getHistoryData();
}, 500); }, 500);
this.disabled = false;
}, },
async sensorInfo() { async sensorInfo() {
const { data } = await sensorInfo(this.queryForm); const { data } = await sensorInfo(this.queryForm);
@ -147,10 +165,10 @@ export default {
async getHistoryData() { async getHistoryData() {
var myChart = echarts.init(document.getElementById('main2')); var myChart = echarts.init(document.getElementById('main2'));
var option; var option;
const { data } = await getReportHistoryData(this.queryForm); // const { data } = await getReportHistoryData(this.queryForm);
var yData = []; var yData = [];
for (let i = 0; i < data.length; i++) { for (let i = 0; i < this.data.length; i++) {
yData.push(data[i][1]); yData.push(this.data[i][1]);
} }
var min = Math.min.apply(null, yData); var min = Math.min.apply(null, yData);
var max = Math.max.apply(null, yData); var max = Math.max.apply(null, yData);
@ -196,11 +214,13 @@ export default {
smooth: true, smooth: true,
symbol: 'none', symbol: 'none',
areaStyle: {}, areaStyle: {},
data: data, data: this.data,
}, },
], ],
}; };
option && myChart.setOption(option); option && myChart.setOption(option);
this.disabled = false;
this.cardLoading = false;
}, },
setDefaultTime() { setDefaultTime() {
this.queryForm.end = getFMdate(0); this.queryForm.end = getFMdate(0);
@ -213,6 +233,8 @@ export default {
ajax.downloadFile(url, { fileName: '站点最新数据.xls' }); ajax.downloadFile(url, { fileName: '站点最新数据.xls' });
}, },
search() { search() {
this.cardLoading = true;
this.disabled = true;
this.sensorInfo(); this.sensorInfo();
this.fetchData(); this.fetchData();
}, },

View File

@ -23,14 +23,24 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item width="100"> <el-form-item width="100">
<el-button type="primary" size="medium" @click="search"> <el-button
:disabled="disabled"
type="primary"
size="medium"
@click="search"
>
查询 查询
</el-button> </el-button>
</el-form-item> </el-form-item>
</vab-query-form> </vab-query-form>
</el-form> </el-form>
<el-card style="height: 380px"> <el-card style="height: 380px">
<div id="main3" ref="echarts" style="height: 380px"></div> <div
v-loading="cardLoading"
id="main3"
ref="echarts"
style="height: 380px"
></div>
</el-card> </el-card>
<el-table <el-table
v-loading="listLoading" v-loading="listLoading"
@ -96,8 +106,10 @@ export default {
lazy: true, lazy: true,
layout: 'total, sizes, prev, pager, next, jumper', layout: 'total, sizes, prev, pager, next, jumper',
total: 0, total: 0,
disabled: true,
background: true, background: true,
listLoading: true, listLoading: true,
cardLoading: true,
elementLoadingText: '正在加载...', elementLoadingText: '正在加载...',
deviceId: '', deviceId: '',
historyData: [], historyData: [],
@ -129,10 +141,9 @@ export default {
setTimeout(() => { setTimeout(() => {
this.listLoading = false; this.listLoading = false;
this.getReportHistory(); this.getReportHistory();
console.log(123);
}, 500); }, 500);
this.disabled = false;
}, },
async getReportHistoryData() {},
async getSensorsData() { async getSensorsData() {
const { data } = await sensors(this.queryForm); const { data } = await sensors(this.queryForm);
this.sensorsData = data; this.sensorsData = data;
@ -155,8 +166,8 @@ export default {
if (this.startDate && this.startDate.length > 0) { if (this.startDate && this.startDate.length > 0) {
const timestampBegin = +new Date(this.startDate[0]); const timestampBegin = +new Date(this.startDate[0]);
const timestampEnd = +new Date(this.startDate[1]); const timestampEnd = +new Date(this.startDate[1]);
if (timestampEnd > timestampBegin + 3600 * 1000 * 24 * 30) { if (timestampEnd > timestampBegin + 3600 * 1000 * 24 * 7) {
this.$alert('日期的起止时间跨度不能超过30天', '提示', { this.$alert('日期的起止时间跨度不能超过7天', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
type: 'warning', type: 'warning',
}) })
@ -171,10 +182,10 @@ export default {
async getReportHistory() { async getReportHistory() {
var myChart = echarts.init(document.getElementById('main3')); var myChart = echarts.init(document.getElementById('main3'));
var option; var option;
const { data } = await getReportHistoryData(this.queryForm); // const { data } = await getReportHistoryData(this.queryForm);
var yData = []; var yData = [];
for (let i = 0; i < data.length; i++) { for (let i = 0; i < this.data.length; i++) {
yData.push(data[i][1]); yData.push(this.data[i][1]);
} }
var min = Math.min.apply(null, yData); var min = Math.min.apply(null, yData);
var max = Math.max.apply(null, yData); var max = Math.max.apply(null, yData);
@ -226,13 +237,17 @@ export default {
smooth: true, smooth: true,
symbol: 'none', symbol: 'none',
areaStyle: {}, areaStyle: {},
data: data, data: this.data,
}, },
], ],
}; };
option && myChart.setOption(option); option && myChart.setOption(option);
this.disabled = false;
this.cardLoading = false;
}, },
search() { search() {
this.disabled = true;
this.cardLoading = true;
this.sensorInfo(); this.sensorInfo();
this.fetchData(); this.fetchData();
}, },

View File

@ -49,7 +49,13 @@
</el-table-column> </el-table-column>
<el-table-column fixed="right" label="操作" align="center"> <el-table-column fixed="right" label="操作" align="center">
<template #default="{ row }"> <template #default="{ row }">
<el-button type="text" @click="historical(row)">历史数据</el-button> <!-- v-if="isBtnPerm('/iot/sensordata/historydata')"-->
<el-button
type="text"
@click="historical(row)"
>
历史数据
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@ -24,13 +24,28 @@
<div class="manage-input"> <div class="manage-input">
<el-button size="small" @click="resetForm()">重置</el-button> <el-button size="small" @click="resetForm()">重置</el-button>
<el-button type="primary" size="small" @click="search">查询</el-button> <el-button type="primary" size="small" @click="search">查询</el-button>
<el-button type="primary" size="small" @click="handleAdd()"> <el-button
v-if="isBtnPerm('/triggerRule/add')"
type="primary"
size="small"
@click="handleAdd()"
>
添加触发器规则 添加触发器规则
</el-button> </el-button>
<el-button type="primary" size="small" @click="deletes"> <el-button
v-if="isBtnPerm('/triggerRule/remove')"
type="primary"
size="small"
@click="deletes"
>
批量删除 批量删除
</el-button> </el-button>
<el-button type="primary" size="small" @click="triggerRuleUse"> <el-button
v-if="isBtnPerm('/triggerRule/use')"
type="primary"
size="small"
@click="triggerRuleUse"
>
批量应用 批量应用
</el-button> </el-button>
</div> </div>
@ -115,8 +130,20 @@
></el-table-column> ></el-table-column>
<el-table-column fixed="right" label="操作" align="center"> <el-table-column fixed="right" label="操作" align="center">
<template #default="{ row }"> <template #default="{ row }">
<el-button type="text" @click="handleEdit(row)">编辑</el-button> <el-button
<el-button type="text" @click="handleDelete(row)">删除</el-button> v-if="isBtnPerm('/triggerRule/update')"
type="text"
@click="handleEdit(row)"
>
编辑
</el-button>
<el-button
v-if="isBtnPerm('/triggerRule/remove')"
type="text"
@click="handleDelete(row)"
>
删除
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@ -24,7 +24,12 @@
<div class="manage-button"> <div class="manage-button">
<el-button size="small" @click="resetForm()">重置</el-button> <el-button size="small" @click="resetForm()">重置</el-button>
<el-button type="primary" size="small" @click="search">查询</el-button> <el-button type="primary" size="small" @click="search">查询</el-button>
<el-button type="primary" size="small" @click="handleAdd"> <el-button
v-if="isBtnPerm('/iot/trigger/insert')"
type="primary"
size="small"
@click="handleAdd"
>
添加触发器 添加触发器
</el-button> </el-button>
</div> </div>
@ -91,8 +96,20 @@
></el-table-column> ></el-table-column>
<el-table-column fixed="right" label="操作" width="160" align="center"> <el-table-column fixed="right" label="操作" width="160" align="center">
<template #default="{ row }"> <template #default="{ row }">
<el-button type="text" @click="handleEdit(row)">编辑</el-button> <el-button
<el-button type="text" @click="handleDelete(row)">删除</el-button> v-if="isBtnPerm('/iot/trigger/update')"
type="text"
@click="handleEdit(row)"
>
编辑
</el-button>
<el-button
v-if="isBtnPerm('/iot/trigger/remove')"
type="text"
@click="handleDelete(row)"
>
删除
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@ -149,7 +149,13 @@
></el-table-column> ></el-table-column>
<el-table-column fixed="right" label="操作" width="120" align="center"> <el-table-column fixed="right" label="操作" width="120" align="center">
<template #default="{ row }"> <template #default="{ row }">
<el-button type="text" @click="bindProject(row)">绑定项目</el-button> <el-button
v-if="isBtnPerm('/tq/api/bindProject')"
type="text"
@click="bindProject(row)"
>
绑定项目
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@ -0,0 +1,391 @@
<template>
<div class="manage-container">
<div class="manage-wrap">
<div class="manage-input">
<el-form ref="queryForm" :model="queryForm" label-width="80px">
<vab-query-form>
<el-form-item width="100" prop="name" label="单据编号">
<el-input
v-model="queryForm.billNo"
size="small"
placeholder="请输入单据编号"
></el-input>
</el-form-item>
</vab-query-form>
</el-form>
</div>
<div class="manage-button">
<el-button size="small" @click="resetForm()">重置</el-button>
<el-button type="primary" size="small" @click="search">查询</el-button>
<el-button type="primary" size="small" @click="deletes">
批量删除
</el-button>
</div>
</div>
<el-table
v-loading="listLoading"
:data="groupData"
border
stripe
style="width: 100%"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column
prop="fid"
label="ID"
width="80"
align="center"
></el-table-column>
<el-table-column
prop="billNo"
label="单据编号"
width="160"
align="center"
></el-table-column>
<el-table-column
prop="customerName"
label="客户名称"
width="240"
align="center"
></el-table-column>
<el-table-column
prop="materialCode"
label="物料编码"
align="center"
></el-table-column>
<el-table-column
prop="materialName"
label="物料名称"
align="center"
></el-table-column>
<el-table-column prop="realQty" label="数量/单位" align="center">
<template #default="{ row }">
{{ row.realQty }} /{{ row.unitName }}
</template>
</el-table-column>
<el-table-column
prop="stockName"
label="仓库"
align="center"
></el-table-column>
<el-table-column prop="" label="时间" align="center">
<template #default="{ row }">
{{ getFormatData(row.date) }}
</template>
</el-table-column>
<el-table-column
prop="documentStatus"
label="状态"
align="center"
></el-table-column>
<el-table-column fixed="right" label="操作" align="center">
<template #default="{ row }">
<el-button type="text" @click="handleEdit(row)">出库详情</el-button>
<el-button type="text" @click="qrProject(row)">二维码</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
:background="background"
:current-page="queryForm.page"
layout="prev, pager, next, jumper"
:page-size="queryForm.size"
style="text-align: right"
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
></el-pagination>
<el-dialog
v-model="dialogFormVisible"
:title="title"
width="50%"
@close="close"
>
<el-tabs>
<el-tab-pane label="基本信息" v-if="dialogFormVisible">
<info :data="data.basicInfo" keyName="basicInfo"></info>
</el-tab-pane>
<el-tab-pane label="客户信息" name="second">
<info :data="data.customerInfo" keyName="customerInfo"></info>
</el-tab-pane>
<el-tab-pane label="财务信息" name="third">
<info :data="data.financialInfo" keyName="financialInfo"></info>
</el-tab-pane>
<el-tab-pane label="物流信息" name="fourth">暂无物流信息</el-tab-pane>
</el-tabs>
<div class="dialog-footer"></div>
</el-dialog>
<el-dialog
v-model="dialogqrcodeVisible"
title="二维码信息"
width="50%"
@close="close"
>
<qcode
v-if="dialogqrcodeVisible"
:url="codeUrl"
:nameplate="nameplate"
:id="codeId"
></qcode>
<el-descriptions :column="3" border>
<el-descriptions-item
:label="item.attributeName"
v-for="(item, index) in qrinfoData"
>
{{ item.attributeValue }}
</el-descriptions-item>
</el-descriptions>
<div class="dialog-footer"></div>
</el-dialog>
</div>
</template>
<script>
import { getList, details, productAttribute, getNameplate } from '@/api/ywry';
import qcode from './qcode';
import { baseURL } from '@/config';
import info from './info';
import { getDate } from '@/common/times';
import QRCode from 'qrcode';
export default {
name: 'Index',
components: {
info,
qcode,
},
data() {
return {
groupData: [],
lazy: true,
layout: 'total, sizes, prev, pager, next, jumper',
total: 0,
codeId: '',
background: true,
listLoading: true,
dialogFormVisible: false,
dialogqrcodeVisible: false,
title: '详情',
elementLoadingText: '正在加载...',
ids: [],
queryForm: {
page: 1,
size: 10,
billNo: '',
},
codeUrl: '',
data: {},
qrinfoData: {},
nameplate: '',
};
},
computed: {
height() {
return 500;
},
},
created() {
this.fetchData();
},
methods: {
async fetchData() {
this.listLoading = true;
const { data } = await getList(this.queryForm);
this.groupData = data;
this.total = data.total;
setTimeout(() => {
this.listLoading = false;
}, 500);
},
close() {},
getFormatData(time) {
return getDate(time);
},
search() {
this.fetchData();
},
qrProject(row) {
let code = row.materialCode;
let producInfo = new Promise((resolve, reject) => {
productAttribute(code).then(res => {
resolve(res.data);
});
});
let getPlate = new Promise((resolve, reject) => {
getNameplate(code).then(res => {
resolve(res.data ? baseURL + '/static/img/' + res.data : null);
});
});
Promise.all([producInfo, getPlate]).then(proData => {
if (proData[1]) {
this.codeId = row.billNo;
this.codeUrl =
'http://sm.lidinghb.com?materialCode=' +
code +
'&billNo=' +
row.billNo;
this.qrinfoData = proData[0];
this.nameplate = proData[1];
this.dialogqrcodeVisible = true;
} else {
this.$message({
type: 'warning',
message: '当前物料产品未配置',
});
}
});
},
handleAdd() {
this.$refs['edit'].showEdit();
},
handleEdit(row) {
details(row.fid).then(res => {
this.data = res.data;
this.dialogFormVisible = true;
});
},
resetForm() {
this.$refs.queryForm.resetFields();
},
handleQuery() {
this.queryForm.page = 1;
this.fetchData();
},
handleSizeChange(val) {
this.queryForm.size = val;
this.fetchData();
},
handleCurrentChange(val) {
if (val) {
this.queryForm.page = val;
this.fetchData();
}
},
deletes() {
const ids = this.ids;
const that = this;
if (ids.length == 0) {
this.$message({
type: 'info',
message: '没有选中任何项',
});
return false;
}
this.$confirm('你确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
const { msg } = remove(ids);
this.$message({
type: 'success',
message: msg == undefined ? '删除成功' : msg,
});
setTimeout(function () {
that.fetchData();
}, 1000);
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消删除',
});
});
},
handleSelectionChange(val) {
const ids = [];
val.forEach(row => {
ids.push(row.id);
});
this.ids = ids;
},
handleDelete(row) {
var that = this;
if (row.id) {
this.$confirm('你确定要删除当前项吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
const { msg } = doDelete([row.id]);
this.$message({
type: 'success',
message: msg == undefined ? '删除成功' : msg,
});
setTimeout(function () {
that.fetchData();
}, 1000);
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消删除',
});
});
}
},
},
};
</script>
<style lang="scss" scoped>
.manage-wrap {
display: flex;
justify-content: space-between;
align-items: flex-start;
.el-input {
width: 200px !important;
}
.el-select {
width: 200px !important;
}
.manage-button {
padding-left: 12px;
margin-bottom: 30px;
}
}
</style>
<style lang="scss">
.el-submenu__title:hover {
background-color: rgba(#1890ff, 0.085) !important;
color: hsla(208, 100%, 55%, 0.95) !important;
}
.el-dialog {
.el-dialog__header {
background-color: #1890ff !important;
padding: 15px 20px;
text-align: left !important;
.el-dialog__title {
color: #e8f4ff !important;
}
.el-dialog__headerbtn .el-dialog__close {
color: #e8f4ff !important;
}
}
.el-dialog__body {
padding: 20px !important;
.el-form-item {
margin-bottom: 10px !important;
.el-input {
width: 100% !important;
}
.el-select {
width: 100% !important;
}
}
.el-form-item:last-child {
margin-bottom: 20px !important;
}
}
}
</style>

177
src/views/iot/ywry/info.vue Normal file
View File

@ -0,0 +1,177 @@
<template>
<el-descriptions :column="4" border>
<el-descriptions-item :label="item.label" v-for="(item, index) in projectData">{{item.value}}</el-descriptions-item>
暂无信息
</el-descriptions>
</template>
<script >
export default {
data() {
return {
basicInfo:{
billNo: '单据编号',
/**
* 单据类型
*/
billTypeName: '单据类型',
/**
* 运输单号
*/
carriageNO: '运输单号',
/**
* 承运商
*/
carrierName: '承运商',
/**
* 客户
*/
customerName: '客户',
/**
* 日期
*/
date: '日期',
/**
* 发货部门
*/
deliveryDeptName: '发货部门',
/**
* 单据状态
*/
documentStatus: '单据状态',
/**
* 交货地点
*/
headLocationName: '交货地点',
/**
* 销售部门
*/
saleDeptName: '销售部门',
/**
* 销售组织
*/
saleOrgName: '销售组织',
/**
* 销售组
*/
salesGroupName: '销售组',
/**
* 销售员
*/
salesManName: '销售员',
/**
* 结算币种
*/
settleCurrName: '结算币种',
/**
* 库存组
*/
stockerGroupName: '库存组',
/**
* 仓管员
*/
stockerName: '仓管员',
/**
* 发货组织
*/
stockOrgName: '发货组织',
},
customerInfo:{
/**
* 收货人姓名
*/
linkMan: '收货人姓名',
/**
* 联系电
*/
linkPhone: '联系电话',
/**
* 结算方
*/
payerName: '结算方',
/**
* 收货方地址
*/
receiveAddress: '收货方地址',
/**
* 收货方联系人
*/
receiverContactName: '收货方联系人',
/**
* 收货方
*/
receiverName: '收货方',
/**
* 结算方
*/
settleName: '结算方',
},
financialInfo:{
/**
* 整单折扣额
*/
allDisCount: '整单折扣额',
/**
* 汇率
*/
exchangeRate: '汇率',
/**
* 汇率类型
*/
exchangeTypeName: '汇率类型',
/**
* 本位币
*/
localCurrName: '本位币',
/**
* 收款条件
*/
receiptConditionName: '收款条件',
/**
* 结算币种
*/
settleCurrName: '结算币种',
/**
* 结算组织
*/
settleOrgName: '结算组织',
/**
* 结算方式
*/
settleTypeName: '结算方式',
},
projectData:[],
};
},
props:['data','keyName'],
created() {
this.formatData(this.data)
},
methods: {
formatData(data){
if(data){
for(var key in data){
if(this[this.keyName][key]){
this.projectData.push({
label:this[this.keyName][key],
value:data[key]||'/'
})
}
}
}
}
},
};
</script>
<style>
.select {
width: 100%;
}
</style>

View File

@ -0,0 +1,185 @@
<template>
<div>
<el-button
type="primary"
style="display: block; margin-left: 40px"
ref="printButton"
v-print="'#printCanvas'"
>
打印
</el-button>
<div id="printCanvas" class="container">
<img :src="srcImg" />
<div class="date">{{ currentDate }}</div>
<img :src="qcodeImg" class="qrcodeimg" ass />
<div class="qrcodeSn">{{ sn }}</div>
</div>
</div>
</template>
<script setup>
import QRCode from 'qrcode';
import { ref, onMounted } from 'vue';
const canvasref = ref(null);
const qcodeImg = ref();
const props = defineProps(['url', 'id', 'nameplate']);
console.log(props.url);
const srcImg = ref(props.nameplate);
const sn = ref(props.id);
const printButton = ref(null);
const currentDate = ref('');
function getCurrentDate() {
const date = new Date();
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
currentDate.value = `${year}-${month}-${day}`;
}
onMounted(() => {
QRCode.toDataURL(props.url, (error, url) => {
if (url) {
qcodeImg.value = url;
}
if (error) console.error(error);
});
getCurrentDate(); //
});
</script>
<style second>
.container {
width: 30vw;
height: calc(20vw);
position: relative;
img {
width: 100%;
height: 100%;
}
.qrcodeimg {
width: 6vw;
height: 6vw;
position: absolute;
bottom: 2.2vw;
right: 1.5vw;
}
.qrcodeSn {
position: absolute;
bottom: 1.3vw;
right: 1.9vw;
color: #000;
font-weight: bold;
}
.equipment {
position: absolute;
top: 231px;
left: 281px;
font-size: 20px;
font-weight: 500;
color: #000;
}
.date {
position: absolute;
top: 6.4vw;
left: 8.5vw;
font-size: 20px;
font-weight: 500;
color: #000;
}
}
</style>
<style scoped>
@media print {
@page {
size: 90mm 60mm;
margin: 0;
padding: 0;
}
body {
font-family: 'Arial', sans-serif;
font-size: 12pt;
color: #333;
margin: 0;
padding: 0;
}
.container {
width: 90mm;
height: 60mm;
position: relative;
.equipment {
position: absolute;
top: 24mm;
left: 28mm;
font-size: 6pt;
font-weight: 500;
color: #000;
}
.date {
position: absolute;
top: 71px;
left: 25mm;
font-size: 9pt;
font-weight: 500;
color: #000;
}
img {
width: 85mm;
height: 58mm;
}
.qrcodeimg {
width: 17mm;
height: 17mm;
position: absolute;
bottom: 33px;
right: 10mm;
}
.qrcodeSn {
position: absolute;
bottom: 22px;
right: 11mm;
font-size: 6pt;
color: #000;
font-weight: bold;
}
}
.containerTable {
width: 60mm;
border: 1px solid #000;
background: #ccc;
font-size: 12pt;
color: #000;
.item {
border-top: 1px solid #000;
padding-left: 10px;
height: 5mm;
line-height: 5mm;
}
.flexCss {
text-align: center;
display: flex;
.flexleft {
width: 30%;
border-right: 1px solid #000;
}
}
.footer {
border-top: 1px solid #000;
display: flex;
.footerLeft {
width: 70%;
text-align: center;
.smallsize {
font-size: 2pt;
}
}
}
}
}
</style>

View File

@ -62,7 +62,12 @@
<div class="manage-button"> <div class="manage-button">
<el-button size="small" @click="resetForm()">重置</el-button> <el-button size="small" @click="resetForm()">重置</el-button>
<el-button type="primary" size="small" @click="search">查询</el-button> <el-button type="primary" size="small" @click="search">查询</el-button>
<el-button type="primary" size="small" @click="exportData"> <el-button
v-if="isBtnPerm('/operLog/export')"
type="primary"
size="small"
@click="exportData"
>
导出 导出
</el-button> </el-button>
</div> </div>
@ -170,7 +175,13 @@
align="center" align="center"
> >
<template #default="{ row }"> <template #default="{ row }">
<el-button type="text" @click="handleDelete(row)">删除</el-button> <el-button
v-if="isBtnPerm('/operLog/remove')"
type="text"
@click="handleDelete(row)"
>
删除
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@ -28,7 +28,12 @@
<div class="manage-button"> <div class="manage-button">
<el-button size="small" @click="resetForm()">重置</el-button> <el-button size="small" @click="resetForm()">重置</el-button>
<el-button type="primary" size="small" @click="search">查询</el-button> <el-button type="primary" size="small" @click="search">查询</el-button>
<el-button type="primary" size="small" @click="exportData"> <el-button
v-if="isBtnPerm('/loginLog/export')"
type="primary"
size="small"
@click="exportData"
>
导出 导出
</el-button> </el-button>
</div> </div>
@ -90,7 +95,13 @@
></el-table-column> ></el-table-column>
<el-table-column fixed="right" prop="details" label="操作" align="center"> <el-table-column fixed="right" prop="details" label="操作" align="center">
<template #default="{ row }"> <template #default="{ row }">
<el-button type="text" @click="handleDelete(row)">删除</el-button> <el-button
v-if="isBtnPerm('/loginLog/remove')"
type="text"
@click="handleDelete(row)"
>
删除
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@ -96,6 +96,7 @@ export default {
}); });
this.$refs['form'].resetFields(); this.$refs['form'].resetFields();
this.dialogFormVisible = false; this.dialogFormVisible = false;
this.$router.go(-1);
} else { } else {
return false; return false;
} }

View File

@ -0,0 +1,177 @@
<template>
<div class="manage-container">
<div class="manage-input">
<el-form ref="queryForm" :model="queryForm" label-width="80px">
<vab-query-form>
<el-form-item width="330" prop="type" label="站点">
<el-cascader
v-model="queryForm.device"
:options="deviceData"
:props="{
value: 'id',
label: 'name',
children: 'deviceList',
}"
clearable
filterable
@change="changeDevice"
></el-cascader>
</el-form-item>
<el-form-item width="100" prop="time" label="日期">
<el-date-picker
v-model="queryForm.time"
size="small"
type="daterange"
align="right"
start-placeholder="开始时间"
end-placeholder="结束时间"
@change="changeTime"
></el-date-picker>
</el-form-item>
</vab-query-form>
</el-form>
</div>
<div class="manage-button">
<el-form-item width="100">
<el-button size="small" @click="resetForm()">重置</el-button>
<el-button type="primary" size="small" @click="search">查询</el-button>
</el-form-item>
</div>
<el-table
id="table"
v-loading="listLoading"
:data="tableData"
border
stripe
style="width: 100%"
>
<el-table-column
prop="name"
label="站点"
align="center"
></el-table-column>
<el-table-column
prop="风机指示灯-故障"
label="风机指示灯-故障"
align="center"
sortable
></el-table-column>
<el-table-column
prop="电磁阀指示灯-故障"
label="电磁阀指示灯-故障"
align="center"
sortable
></el-table-column>
<el-table-column
prop="水泵指示灯-故障"
label="水泵指示灯-故障"
align="center"
sortable
></el-table-column>
<el-table-column
prop="抽水泵状态-故障"
label="抽水泵状态-故障"
align="center"
sortable
></el-table-column>
<el-table-column
prop="站点离线"
label="站点离线"
align="center"
sortable
></el-table-column>
<el-table-column
prop="风机状态-故障"
label="风机状态-故障"
align="center"
sortable
></el-table-column>
<el-table-column
prop="加药泵指示灯-故障"
label="加药泵指示灯-故障"
align="center"
sortable
></el-table-column>
<el-table-column
prop="水泵状态-故障"
label="水泵状态-故障"
align="center"
sortable
></el-table-column>
</el-table>
</div>
</template>
<script>
import { getFaultDetails, getProjectDeviceTree } from '@/api/operation';
import { getDate, getPastTime } from '@/common/times';
export default {
data() {
return {
listLoading: true,
title: '故障详情',
tableData: [],
deviceData: [],
queryForm: {
page: 1,
size: 20,
start: '',
end: '',
projectId: '',
deviceId: '',
},
};
},
created() {
this.getProjectDeviceTree();
this.queryForm.start = this.$route.query.start;
this.queryForm.end = this.$route.query.end;
this.queryForm.projectId = this.$route.query.projectId;
this.queryForm.deviceId = this.$route.query.deviceId;
this.getFaultDetails();
},
methods: {
// loadScript() {
// const row = this.$route.query.row;
// this.dialogFormVisible = true;
// this.queryForm.start = row.start;
// this.queryForm.end = row.end;
// this.queryForm.projectId = row.projectId;
// this.queryForm.deviceId = row.deviceId;
// this.getFaultDetails();
// },
changeTime() {
this.queryForm.start = getDate(this.queryForm.time[0]);
this.queryForm.end = getDate(this.queryForm.time[1]);
},
//
async getProjectDeviceTree() {
const { data } = await getProjectDeviceTree();
this.deviceData = data;
},
//
search() {
this.getFaultDetails(this.queryForm);
},
resetForm() {
this.$refs.queryForm.resetFields();
},
changeDevice(e) {
this.queryForm.projectId = e[0];
this.queryForm.deviceId = e[1];
},
async getFaultDetails() {
const { data } = await getFaultDetails(this.queryForm);
this.listLoading = false;
this.tableData = data;
},
},
};
</script>
<style>
#mapContainer {
width: 100%;
height: 400px;
}
</style>

View File

@ -0,0 +1,163 @@
<template>
<div class="manage-container">
<div class="manage-input">
<el-form ref="queryForm" :model="queryForm" label-width="80px">
<vab-query-form>
<el-form-item width="330" prop="type" label="站点">
<el-cascader
v-model="queryForm.device"
:options="deviceData"
:props="{
value: 'id',
label: 'name',
children: 'deviceList',
}"
@change="changeDevice"
clearable
filterable
></el-cascader>
</el-form-item>
<el-form-item width="100" prop="time" label="日期">
<el-date-picker
v-model="queryForm.time"
size="small"
type="daterange"
align="right"
start-placeholder="开始时间"
end-placeholder="结束时间"
@change="changeTime"
></el-date-picker>
</el-form-item>
</vab-query-form>
</el-form>
</div>
<div class="manage-button">
<el-form-item width="100">
<el-button size="small" @click="resetForm()">重置</el-button>
<el-button type="primary" size="small" @click="search">查询</el-button>
</el-form-item>
</div>
<el-table
id="table"
v-loading="listLoading"
:data="tableData"
border
stripe
style="width: 100%"
>
<el-table-column
fixed
prop="count"
label="故障次数"
align="center"
></el-table-column>
<el-table-column
prop="fault"
label="故障"
align="center"
></el-table-column>
<el-table-column fixed="right" label="操作" align="center">
<template #default="{ row }">
<el-button type="text" @click="details(row)">详情</el-button>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
import { getDate, getPastTime } from '@/common/times';
import { getData, getProjectDeviceTree } from '@/api/operation';
export default {
data() {
return {
tableData: [],
lazy: true,
layout: 'total, sizes, prev, pager, next, jumper',
total: 0,
background: true,
listLoading: false,
elementLoadingText: '正在加载...',
queryForm: {
page: 1,
size: 20,
deviceId: '',
start: '',
end: '',
time: '',
projectId: '',
},
deviceData: [],
form: {
id: '',
location: '',
},
};
},
created() {
this.fetchData();
this.getProjectDeviceTree();
},
methods: {
changeTime() {
this.queryForm.start = getDate(this.queryForm.time[0]);
this.queryForm.end = getDate(this.queryForm.time[1]);
},
//
async getProjectDeviceTree() {
const { data } = await getProjectDeviceTree();
this.deviceData = data;
},
//
changeDevice(e) {
this.queryForm.projectId = e[0];
this.queryForm.deviceId = e[1];
},
//
details(row) {
this.$router.push({
name: '故障详情',
path: '/operationData',
query: {
deviceId: this.queryForm.deviceId,
projectId: this.queryForm.projectId,
start: this.queryForm.start,
end: this.queryForm.end,
},
});
// this.$refs['details'].loadScript(this.queryForm);
},
//
async fetchData() {
const { data } = await getData(this.queryForm);
this.tableData = data;
},
//
search() {
this.fetchData(this.queryForm);
},
resetForm() {
this.$refs.queryForm.resetFields();
},
},
};
</script>
<style lang="scss" scoped>
.el-input {
width: 200px !important;
}
.el-select {
width: 200px !important;
}
.manage-button {
padding-left: 12px;
}
</style>
<style lang="scss">
.el-submenu__title:hover {
background-color: rgba(#1890ff, 0.085) !important;
color: hsla(208, 100%, 55%, 0.95) !important;
}
</style>

View File

@ -0,0 +1,98 @@
<template>
<div
id="deptAnalysis"
v-loading="Loading"
style="width: 100%; height: 300px"
></div>
</template>
<script>
import * as echarts from 'echarts';
import { dept } from '@/api/sys';
export default {
props: {
time: {
type: String,
},
},
data() {
return {
chartPie: null,
Loading: true,
data: [],
month: '',
};
},
watch: {
time(value) {
this.month = value;
this.getUserAnalysis();
setTimeout(() => {
this.drawPieChart();
}, 2000);
},
},
mounted: function () {},
methods: {
async getUserAnalysis() {
const { data } = await dept({ month: this.month });
var list = [];
data.forEach(function (v, k) {
list.push({ name: v.dept, value: v.count });
});
this.data = list;
},
drawPieChart() {
this.chartPie = echarts.init(document.getElementById('deptAnalysis'));
this.chartPie.setOption({
tooltip: {
trigger: 'item',
axisPointer: {
type: 'shadow',
},
},
legend: {
top: '15%',
left: 'center',
},
title: {
left: 'center',
text: '部门分析',
},
series: {
type: 'pie',
top: 65,
radius: [60, 100],
left: 'center',
itemStyle: {
borderColor: '#fff',
borderWidth: 1,
},
label: {
alignTo: 'edge',
minMargin: 5,
edgeDistance: 10,
lineHeight: 15,
rich: {
time: {
fontSize: 10,
color: '#999',
},
},
},
labelLine: {
length: 15,
length2: 0,
maxSurfaceAngle: 80,
},
data: this.data,
},
});
this.Loading = false;
},
},
};
</script>
<style scoped></style>

View File

@ -0,0 +1,102 @@
<template>
<div
id="details"
style="width: 100%; height: 300px"
v-loading="Loading"
></div>
</template>
<script>
import * as echarts from 'echarts';
import { details } from '@/api/sys';
export default {
props: {
time: {
type: String,
},
},
data() {
return {
chartPie: null,
Loading: true,
yData: [],
xData: [],
month: '',
};
},
watch: {
time(value) {
this.month = value;
this.getUserAnalysis();
setTimeout(() => {
this.drawCharts();
}, 2000);
},
},
mounted: function () {},
methods: {
async getUserAnalysis() {
const { data } = await details({ month: this.month });
var xData = [];
var yData = [];
data.forEach(function (v, k) {
xData.push(v.date);
yData.push(v.count);
});
this.xData = xData;
this.yData = yData;
},
drawPieChart() {
this.chartPie = echarts.init(document.getElementById('details'));
this.chartPie.setOption({
tooltip: {
trigger: 'item',
axisPointer: {
type: 'shadow',
},
},
title: {
left: 'center',
text: '详情分析',
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true,
},
xAxis: [
{
type: 'category',
axisLabel: { interval: 0, rotate: 270 },
data: this.xData,
axisTick: {
alignWithLabel: true,
},
},
],
yAxis: [
{
type: 'value',
},
],
series: [
{
name: '数量',
type: 'line',
barWidth: '60%',
data: this.yData,
},
],
});
this.Loading = false;
},
drawCharts() {
this.drawPieChart();
},
},
};
</script>
<style scoped></style>

View File

@ -0,0 +1,98 @@
<template>
<div id="module" style="width: 100%; height: 300px" v-loading="Loading"></div>
</template>
<script>
import * as echarts from 'echarts';
import { module } from '@/api/sys';
export default {
props: {
time: {
type: String,
},
},
data() {
return {
chartPie: null,
Loading: true,
yData: [],
xData: [],
month: '',
};
},
watch: {
time(value) {
this.month = value;
this.getUserAnalysis();
setTimeout(() => {
this.drawCharts();
}, 2000);
},
},
mounted: function () {},
methods: {
async getUserAnalysis() {
const { data } = await module({ month: this.month });
var xData = [];
var yData = [];
data.forEach(function (v, k) {
xData.push(v.module);
yData.push(v.count);
});
this.xData = xData;
this.yData = yData;
},
drawPieChart() {
this.chartPie = echarts.init(document.getElementById('module'));
this.chartPie.setOption({
tooltip: {
trigger: 'item',
axisPointer: {
type: 'shadow',
},
},
title: {
left: '部门分析',
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true,
},
xAxis: [
{
type: 'category',
axisLabel: { interval: 0, rotate: 270 },
data: this.xData,
axisTick: {
alignWithLabel: true,
},
},
],
yAxis: [
{
title: '111',
type: 'value',
},
],
series: [
{
name: '数量',
type: 'bar',
barWidth: '60%',
data: this.yData,
},
],
});
this.Loading = false;
},
drawCharts() {
this.drawPieChart();
},
},
};
</script>
<style scoped></style>

View File

@ -0,0 +1,102 @@
<template>
<div
id="personnel"
style="width: 100%; height: 300px"
v-loading="Loading"
></div>
</template>
<script>
import * as echarts from 'echarts';
import { user } from '@/api/sys';
export default {
props: {
time: {
type: String,
},
},
data() {
return {
chartPie: null,
Loading: true,
yData: [],
xData: [],
month: '',
};
},
watch: {
time(value) {
this.month = value;
this.getUserAnalysis();
setTimeout(() => {
this.drawCharts();
}, 2000);
},
},
mounted: function () {},
methods: {
async getUserAnalysis() {
const { data } = await user({ month: this.month });
var xData = [];
var yData = [];
data.forEach(function (v, k) {
xData.push(v.user);
yData.push(v.count);
});
this.xData = xData;
this.yData = yData;
},
drawPieChart() {
this.chartPie = echarts.init(document.getElementById('personnel'));
this.chartPie.setOption({
tooltip: {
trigger: 'item',
axisPointer: {
type: 'shadow',
},
},
title: {
left: 'center',
text: '用户分析',
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true,
},
xAxis: [
{
type: 'category',
axisLabel: { interval: 0, rotate: 270 },
data: this.xData,
axisTick: {
alignWithLabel: true,
},
},
],
yAxis: [
{
type: 'value',
},
],
series: [
{
name: '数量',
type: 'bar',
barWidth: '60%',
data: this.yData,
},
],
});
this.Loading = false;
},
drawCharts() {
this.drawPieChart();
},
},
};
</script>
<style scoped></style>

View File

@ -0,0 +1,252 @@
<template>
<div class="container">
<div class="echart-wrap">
<div class="echart-item" style="width: 100%">
<div class="echart-head">
<h1 class="echart-title">时间选择</h1>
<el-date-picker
v-model="queryForm.month"
type="month"
size="small"
format="YYYY-MM"
placeholder="选择日期"
@change="changeMonth"
/>
</div>
</div>
</div>
<el-statistic
:value="basicData.loginCount"
title="用户登录次数"
></el-statistic>
<div class="echart-wrap" v-loading="Loading">
<div class="echart-item" style="width: 100%">
<div class="echart-head">
<h1 class="echart-title">基础信息</h1>
</div>
<div class="wrap-content">
<div class="wrap-content-item">
<p>用户登录次数</p>
<p>{{ basicData.loginCount }}</p>
</div>
<div class="wrap-content-item">
<p>访问次数</p>
<p>{{ basicData.visitsCount }}</p>
</div>
<div class="wrap-content-item">
<p>总访问次数</p>
<p>{{ basicData.totalVisitsCount }}</p>
</div>
</div>
</div>
</div>
<div class="echart-wrap">
<div class="echart-item" style="width: 100%">
<div class="echart-head">
<h1 class="echart-title">使用情况分析</h1>
</div>
<div class="echart-list">
<div class="personnel-content-item">
<user-analysis :time="month"></user-analysis>
</div>
<div class="personnel-content-item">
<dept-analysis :time="month"></dept-analysis>
</div>
</div>
<div class="echart-list">
<div class="personnel-content-item">
<module-analysis :time="month"></module-analysis>
</div>
<div class="personnel-content-item">
<details-analysis :time="month"></details-analysis>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import userAnalysis from '@/views/operation/sys/analysis/userAnalysis';
import deptAnalysis from '@/views/operation/sys/analysis/deptAnalysis.vue';
import moduleAnalysis from '@/views/operation/sys/analysis/moduleAnalysis.vue';
import detailsAnalysis from '@/views/operation/sys/analysis/detailsAnalysis.vue';
import { getDate1 } from '@/common/times';
import { baseInfo } from '@/api/sys';
export default {
components: {
userAnalysis,
deptAnalysis,
moduleAnalysis,
detailsAnalysis,
},
data() {
return {
basicData: [],
Loading: true,
month: '',
queryForm: {
month: '',
},
};
},
created() {
setTimeout(() => {
this.defaultTime();
this.baseInfo();
}, 100);
},
methods: {
async baseInfo() {
const { data } = await baseInfo(this.queryForm);
this.basicData = data;
this.Loading = false;
},
defaultTime() {
this.queryForm.month = this.month = getDate1();
},
changeMonth() {
this.month = getDate1(this.queryForm.month);
},
},
};
</script>
<style lang="scss">
.container {
background-color: rgba(0, 0, 0, 0.038);
position: relative;
.echart-wrap {
display: flex;
justify-content: space-between;
align-items: flex-start;
margin-bottom: 20px;
.echart-item {
background-color: white;
border-radius: 6px;
.echart-head {
display: flex;
justify-content: space-between;
align-items: center;
padding: 15px;
border-bottom: 1px solid rgba(0, 0, 0, 0.08);
.echart-title {
font-size: 16px;
font-weight: 500;
margin: 0;
line-height: 40px;
}
}
}
.wrap-content {
display: flex;
justify-content: space-between;
align-items: center;
padding: 15px;
.wrap-content-item {
width: 32%;
text-align: center;
border-radius: 6px;
.wrap-content-item-h1 {
font-size: 30px;
}
.wrap-content-item-h2 {
font-size: 28px;
}
}
}
.wrap-content-second {
padding: 0 15px;
display: flex;
justify-content: space-between;
align-items: flex-start;
.wrap-content-L {
width: 70%;
display: flex;
justify-content: flex-start;
align-items: center;
flex-wrap: wrap;
.wrap-content-top {
display: flex;
justify-content: flex-start;
align-items: center;
width: 100%;
.wrap-content-item {
display: flex;
justify-content: flex-start;
align-items: center;
width: 30%;
margin-top: 20px;
.wrap-content-img {
}
.wrap-content-font {
.wrap-content-size {
font-size: 16px;
font-weight: 500;
margin: 0;
margin-left: 10px;
}
}
}
}
.wrap-content-bottom {
display: flex;
justify-content: flex-start;
align-items: center;
width: 100%;
.wrap-content-item {
display: flex;
justify-content: flex-start;
align-items: center;
width: 30%;
margin: 20px 0;
.wrap-content-img {
}
.wrap-content-font {
.wrap-content-size {
font-size: 16px;
font-weight: 500;
margin: 0;
margin-left: 10px;
}
}
}
}
}
.wrap-content-R {
width: 30%;
}
}
.echart-list {
display: flex;
justify-content: space-between;
align-items: center;
padding: 15px;
.personnel-content-item {
width: 45%;
.echart-title {
margin: 15px 0 20px;
text-align: center;
}
}
.echart-line {
background-color: rgba(0, 0, 0, 0.04);
width: 1px;
height: 200px;
}
}
}
}
</style>

View File

@ -135,8 +135,20 @@
</el-table-column> </el-table-column>
<el-table-column fixed="right" label="操作" align="center"> <el-table-column fixed="right" label="操作" align="center">
<template #default="{ row }"> <template #default="{ row }">
<el-button type="text" @click="bindDevice(row)">绑定设备</el-button> <el-button
<el-button type="text" @click="ShowDetail(row)">详情</el-button> v-if="isBtnPerm('/telcom/api/simBindDevice')"
type="text"
@click="bindDevice(row)"
>
绑定设备
</el-button>
<el-button
v-if="isBtnPerm('/telcom/api/xiangqing')"
type="text"
@click="ShowDetail(row)"
>
详情
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@ -1,7 +1,12 @@
<template> <template>
<div class="manage-container"> <div class="manage-container">
<div class="manage-button"> <div class="manage-button">
<el-button type="primary" size="small" @click="handleAdd()"> <el-button
v-if="isBtnPerm('/ys/author/insert')"
type="primary"
size="small"
@click="handleAdd()"
>
添加萤石云 添加萤石云
</el-button> </el-button>
</div> </div>
@ -66,9 +71,27 @@
></el-table-column> ></el-table-column>
<el-table-column fixed="right" label="操作" width="180" align="center"> <el-table-column fixed="right" label="操作" width="180" align="center">
<template #default="{ row }"> <template #default="{ row }">
<el-button type="text" @click="sensorData(row)">设备</el-button> <el-button
<el-button type="text" @click="handleEdit(row)">编辑</el-button> v-if="isBtnPerm('/ys/author/shebei')"
<el-button type="text" @click="handleDelete(row)">删除</el-button> type="text"
@click="sensorData(row)"
>
设备
</el-button>
<el-button
v-if="isBtnPerm('/ys/author/update')"
type="text"
@click="handleEdit(row)"
>
编辑
</el-button>
<el-button
v-if="isBtnPerm('/ys/author/delete')"
type="text"
@click="handleDelete(row)"
>
删除
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@ -106,8 +106,20 @@
></el-table-column> ></el-table-column>
<el-table-column fixed="right" label="操作" width="180" align="center"> <el-table-column fixed="right" label="操作" width="180" align="center">
<template #default="{ row }"> <template #default="{ row }">
<el-button type="text" @click="bindDevice(row)">绑定站点</el-button> <el-button
<el-button type="text" @click="videoData(row)">播放</el-button> v-if="isBtnPerm('/ys/api/ysBindDevice')"
type="text"
@click="bindDevice(row)"
>
绑定站点
</el-button>
<el-button
v-if="isBtnPerm('/ys/api/bofang')"
type="text"
@click="videoData(row)"
>
播放
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@ -0,0 +1,95 @@
<template>
<el-dialog
v-model="dialogFormVisible"
:title="title"
width="500px"
@close="close"
>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item width="100" prop="name" label="设备名称">
<el-input
v-model="form.name"
size="small"
placeholder="请输入涂鸦平台设备名称"
></el-input>
</el-form-item>
<el-form-item width="100" prop="serial" label="序列号">
<el-input
v-model="form.serial"
size="small"
placeholder="请输入运维平台站点序列号"
></el-input>
</el-form-item>
</el-form>
<div class="dialog-footer">
<el-button @click="close"> </el-button>
<el-button type="primary" @click="save"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { register } from '@/api/tuya';
export default {
name: 'BindDevice',
data() {
return {
form: {
name: '',
serial: '',
},
rules: {
name: [{ required: true, trigger: 'blur', message: '请输入设备名称' }],
serial: [{ required: true, trigger: 'blur', message: '请输入序列号' }],
},
projectId: '',
deviceData: [],
title: '',
dialogFormVisible: false,
};
},
created() {},
methods: {
handleCountryChange(value) {
if (value) {
const len = value.length - 1;
this.form.parentId = value[len];
} else {
this.form.parentId = 0;
}
},
showDetail(accNumber) {
this.title = '注册设备';
this.dialogFormVisible = true;
},
close() {
this.$refs['form'].resetFields();
this.form = this.$options.data().form;
this.dialogFormVisible = false;
this.$emit('fetch-data');
},
save() {
this.$refs['form'].validate(async valid => {
if (valid) {
const { msg } = await register(this.form);
this.$notify({
title: msg,
type: 'success',
});
this.$refs['form'].resetFields();
this.dialogFormVisible = false;
this.$parent.fetchData();
} else {
return false;
}
});
},
},
};
</script>
<style>
.select {
width: 100%;
}
</style>

View File

@ -0,0 +1,199 @@
<template>
<div class="manage-container">
<div class="manage-wrap">
<div class="manage-input">
<el-form ref="queryForm" :model="queryForm" label-width="120px">
<vab-query-form>
<el-form-item width="100" prop="ldDeviceSerial" label="力鼎序列号">
<el-input
v-model="queryForm.ldDeviceSerial"
size="small"
placeholder="请输入力鼎序列号"
></el-input>
</el-form-item>
<el-form-item width="100" prop="tuyaDeviceId" label="涂鸦设备ID">
<el-input
v-model="queryForm.tuyaDeviceId"
size="small"
placeholder="请输入力鼎序列号"
></el-input>
</el-form-item>
</vab-query-form>
</el-form>
</div>
<div class="manage-button">
<el-button size="small" @click="resetForm()">重置</el-button>
<el-button type="primary" size="small" @click="search">查询</el-button>
</div>
</div>
<div class="manage-button">
<el-button type="primary" size="small" @click="registerDevice()">
注册设备
</el-button>
</div>
<el-table
v-loading="listLoading"
:data="flowData"
border
stripe
style="width: 100%"
>
<el-table-column
prop="tuyaDeviceName"
label="涂鸦平台设备名称"
align="center"
></el-table-column>
<el-table-column
prop="ldDeviceSerial"
label="站点序列号"
align="center"
></el-table-column>
<el-table-column
prop="tuyaDeviceId"
label="涂鸦设备id"
align="center"
></el-table-column>
<el-table-column fixed="right" label="操作" align="center">
<template #default="{ row }">
<el-button type="text" @click="handleDelete(row)">删除设备</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
:background="background"
:current-page="queryForm.pageIndex"
:layout="layout"
:page-size="queryForm.size"
:total="total"
style="text-align: right"
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
></el-pagination>
<bind-device ref="device"></bind-device>
</div>
</template>
<script>
import { getList, deleteDevice } from '@/api/tuya';
import bindDevice from './bindDevice';
export default {
name: 'Index',
components: {
bindDevice,
},
data() {
return {
flowData: [],
layout: 'total, sizes, prev, pager, next, jumper',
total: 0,
background: true,
listLoading: true,
elementLoadingText: '正在加载...',
statusData: [],
queryForm: {
page: 1,
size: 20,
tuyaDeviceId: '',
ldDeviceSerial: '',
},
};
},
computed: {
height() {
return 500;
},
},
created() {
this.fetchData();
},
methods: {
async fetchData() {
this.listLoading = true;
const { data } = await getList(this.queryForm);
this.flowData = data.items;
this.total = data.total;
setTimeout(() => {
this.listLoading = false;
}, 500);
},
search() {
this.fetchData();
},
resetForm() {
this.$refs.queryForm.resetFields();
},
registerDevice(row) {
this.$refs['device'].showDetail();
},
ShowDetail(row) {
this.$refs['details'].showDetail(row.accNumber);
},
handleQuery() {
this.queryForm.page = 1;
this.fetchData();
},
handleSizeChange(val) {
this.queryForm.size = val;
this.fetchData();
},
handleCurrentChange(val) {
this.queryForm.page = val;
this.fetchData();
},
handleDelete(row) {
let that = this;
if (row.tuyaDeviceId) {
this.$confirm('你确定要删除当前项吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(async () => {
const { msg } = await deleteDevice(row.tuyaDeviceId);
this.$message({
type: 'success',
message: msg == undefined ? '删除成功' : msg,
});
setTimeout(function () {
that.fetchData();
}, 1000);
})
.catch(e => {
console.log(e);
this.$message({
type: 'info',
message: '已取消删除',
});
});
}
},
},
};
</script>
<style lang="scss" scoped>
.manage-wrap {
display: flex;
justify-content: space-between;
align-items: flex-start;
.el-input {
width: 200px !important;
}
.el-select {
width: 200px !important;
}
}
.manage-button {
padding-left: 12px;
margin-bottom: 10px;
}
</style>
<style lang="scss">
.el-submenu__title:hover {
background-color: rgba(#1890ff, 0.085) !important;
color: hsla(208, 100%, 55%, 0.95) !important;
}
</style>

View File

@ -79,16 +79,16 @@
<div class="manage-button"> <div class="manage-button">
<el-button size="small" @click="resetForm()">重置</el-button> <el-button size="small" @click="resetForm()">重置</el-button>
<el-button type="primary" size="small" @click="search">查询</el-button> <el-button type="primary" size="small" @click="search">查询</el-button>
<el-button type="primary" size="small" @click="handleAdd"> <el-button v-if="isBtnPerm('/iot/device/insert')" type="primary" size="small" @click="handleAdd">
添加站点 添加站点
</el-button> </el-button>
<el-button type="primary" size="small" @click="deletes"> <el-button v-if="isBtnPerm('/iot/device/remove')" type="primary" size="small" @click="deletes">
批量删除 批量删除
</el-button> </el-button>
<el-button type="primary" size="small" @click="exportData"> <el-button v-if="isBtnPerm('/iot/device/exportDevice')" type="primary" size="small" @click="exportData">
导出 导出
</el-button> </el-button>
<el-button type="primary" size="small" @click="fboxSync"> <el-button v-if="isBtnPerm('/fbox/sync')" type="primary" size="small" @click="fboxSync">
盒子同步 盒子同步
</el-button> </el-button>
</div> </div>
@ -297,11 +297,11 @@
></el-table-column> ></el-table-column>
<el-table-column fixed="right" label="操作" width="250" align="center"> <el-table-column fixed="right" label="操作" width="250" align="center">
<template #default="{ row }"> <template #default="{ row }">
<el-button type="text" @click="sensorData(row)">数据</el-button> <el-button v-if="isBtnPerm('/iot/device/shuju')" type="text" @click="sensorData(row)">数据</el-button>
<el-button type="text" @click="sensorEdit(row)">传感器</el-button> <el-button v-if="isBtnPerm('/iot/device/chuanganqi')" type="text" @click="sensorEdit(row)">传感器</el-button>
<el-button type="text" @click="copyDevice(row)">复制</el-button> <el-button v-if="isBtnPerm('/iot/device/copy')" type="text" @click="copyDevice(row)">复制</el-button>
<el-button type="text" @click="handleEdit(row)">编辑</el-button> <el-button v-if="isBtnPerm('/iot/device/update')" type="text" @click="handleEdit(row)">编辑</el-button>
<el-button type="text" @click="handleDelete(row)">删除</el-button> <el-button v-if="isBtnPerm('/iot/device/remove')" type="text" @click="handleDelete(row)">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@ -48,7 +48,13 @@
></el-table-column> ></el-table-column>
<el-table-column fixed="right" label="操作" width="200" align="center"> <el-table-column fixed="right" label="操作" width="200" align="center">
<template #default="{ row }"> <template #default="{ row }">
<el-button type="text" @click="bindDevice(row)">绑定站点</el-button> <el-button
v-if="isBtnPerm('/alarmUser/addProjects')"
type="text"
@click="bindDevice(row)"
>
绑定项目
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@ -51,13 +51,28 @@
<div class="manage-button"> <div class="manage-button">
<el-button size="small" @click="resetForm()">重置</el-button> <el-button size="small" @click="resetForm()">重置</el-button>
<el-button type="primary" size="small" @click="search">查询</el-button> <el-button type="primary" size="small" @click="search">查询</el-button>
<el-button type="primary" size="small" @click="handleAdd"> <el-button
v-if="isBtnPerm('/iot/project/insert')"
type="primary"
size="small"
@click="handleAdd"
>
添加项目 添加项目
</el-button> </el-button>
<el-button type="primary" size="small" @click="remove"> <el-button
v-if="isBtnPerm('/iot/project/remove')"
type="primary"
size="small"
@click="remove"
>
批量删除 批量删除
</el-button> </el-button>
<el-button type="primary" size="small" @click="exportData"> <el-button
v-if="isBtnPerm('/iot/project/export')"
type="primary"
size="small"
@click="exportData"
>
导出 导出
</el-button> </el-button>
</div> </div>
@ -168,9 +183,27 @@
></el-table-column> ></el-table-column>
<el-table-column fixed="right" label="操作" width="160" align="center"> <el-table-column fixed="right" label="操作" width="160" align="center">
<template #default="{ row }"> <template #default="{ row }">
<el-button type="text" @click="device(row)">站点</el-button> <el-button
<el-button type="text" @click="handleEdit(row)">编辑</el-button> v-if="isBtnPerm('/iot/project/zhandian')"
<el-button type="text" @click="handleDelete(row)">删除</el-button> type="text"
@click="device(row)"
>
站点
</el-button>
<el-button
v-if="isBtnPerm('/iot/project/update')"
type="text"
@click="handleEdit(row)"
>
编辑
</el-button>
<el-button
v-if="isBtnPerm('/iot/project/remove')"
type="text"
@click="handleDelete(row)"
>
删除
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@ -26,7 +26,12 @@
<div class="manage-button"> <div class="manage-button">
<el-button size="small" @click="resetForm()">重置</el-button> <el-button size="small" @click="resetForm()">重置</el-button>
<el-button type="primary" size="small" @click="search">查询</el-button> <el-button type="primary" size="small" @click="search">查询</el-button>
<el-button type="primary" size="small" @click="exportData"> <el-button
v-if="isBtnPerm('/deviceReport/deviceMonth/export')"
type="primary"
size="small"
@click="exportData"
>
导出 导出
</el-button> </el-button>
</div> </div>

View File

@ -102,7 +102,13 @@
></el-table-column> ></el-table-column>
<el-table-column fixed="right" label="操作" width="120" align="center"> <el-table-column fixed="right" label="操作" width="120" align="center">
<template #default="{ row }"> <template #default="{ row }">
<el-button type="text" @click="bindProject(row)">绑定项目</el-button> <el-button
v-if="isBtnPerm('/tq/api/bindProject')"
type="text"
@click="bindProject(row)"
>
绑定项目
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@ -19,6 +19,24 @@
<el-tab-pane label="告警管理" name="six"> <el-tab-pane label="告警管理" name="six">
<alarm-index ref="alarm"></alarm-index> <alarm-index ref="alarm"></alarm-index>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="打卡纪录" name="seven">
<clock-index ref="clock"></clock-index>
</el-tab-pane>
<el-tab-pane label="水质管理" name="eight">
<apply-index ref="apply"></apply-index>
</el-tab-pane>
<el-tab-pane label="巡检填报" name="nine">
<filling-index ref="filling"></filling-index>
</el-tab-pane>
<el-tab-pane label="设备维保" name="ten">
<maintenance-index ref="maintenance"></maintenance-index>
</el-tab-pane>
<el-tab-pane label="人员管理" name="eleven">
<staff-index ref="staff"></staff-index>
</el-tab-pane>
<el-tab-pane label="任务管理" name="twelve">
<task-index ref="task"></task-index>
</el-tab-pane>
</el-tabs> </el-tabs>
</div> </div>
</template> </template>
@ -29,7 +47,13 @@ import deviceIndex from './components/device/index';
import vehicleIndex from './components/vehicle/index'; import vehicleIndex from './components/vehicle/index';
import policeIndex from './components/police/index'; import policeIndex from './components/police/index';
import runIndex from './components/run/index'; import runIndex from './components/run/index';
import alarmIndex from './components/alarm/index'; import alarmIndex from '../../dev/alarm/index';
import clockIndex from '../../dev/clock/index';
import applyIndex from '../../dev/apply/index';
import fillingIndex from '../../dev/filling/index';
import maintenanceIndex from '../../dev/maintenance/index';
import staffIndex from '../../dev/staff/index';
import taskIndex from '../../dev/task/index';
export default { export default {
components: { components: {
projectIndex, projectIndex,
@ -38,6 +62,12 @@ export default {
policeIndex, policeIndex,
runIndex, runIndex,
alarmIndex, alarmIndex,
clockIndex,
applyIndex,
fillingIndex,
maintenanceIndex,
staffIndex,
taskIndex,
}, },
data() { data() {
return { return {
@ -70,6 +100,18 @@ export default {
this.$refs['run'].showData(); this.$refs['run'].showData();
} else if (tab.paneName == 'six') { } else if (tab.paneName == 'six') {
this.$refs['alarm'].showData(); this.$refs['alarm'].showData();
} else if (tab.paneName == 'seven') {
this.$refs['clock'].showData();
} else if (tab.paneName == 'eight') {
this.$refs['apply'].showData();
} else if (tab.paneName == 'nine') {
this.$refs['filling'].showData();
} else if (tab.paneName == 'ten') {
this.$refs['maintenance'].showData();
} else if (tab.paneName == 'eleven') {
this.$refs['staff'].showData();
} else if (tab.paneName == 'twelve') {
this.$refs['task'].showData();
} }
}, },
}, },

View File

@ -270,6 +270,43 @@
width="180" width="180"
align="center" align="center"
></el-table-column> ></el-table-column>
<el-table-column
prop="boardImg"
label="公示牌"
width="200"
align="center"
>
<template #default="{ row }">
<el-image
style="width: 100px; height: 100px"
:src="fileUrl + row.boardImg"
></el-image>
</template>
</el-table-column>
<el-table-column
prop="warrantyPeriod"
label="设备保修到期时间"
width="200"
align="center"
></el-table-column>
<el-table-column
prop="deviceVersion.dataValue"
label="设备版本"
width="200"
align="center"
></el-table-column>
<el-table-column
prop="ownerName"
label="站点客户联系人"
width="200"
align="center"
></el-table-column>
<el-table-column
prop="ownerPhone"
label="站点客户联系方式"
width="200"
align="center"
></el-table-column>
<el-table-column <el-table-column
prop="offlineTime" prop="offlineTime"
label="离线时间" label="离线时间"
@ -284,8 +321,20 @@
></el-table-column> ></el-table-column>
<el-table-column fixed="right" label="操作" width="150" align="center"> <el-table-column fixed="right" label="操作" width="150" align="center">
<template #default="{ row }"> <template #default="{ row }">
<el-button type="text" @click="sensorEdit(row)">传感器</el-button> <el-button
<el-button type="text" @click="sensorData(row)">数据</el-button> v-if="isBtnPerm('/iot/sensor/select')"
type="text"
@click="sensorEdit(row)"
>
传感器
</el-button>
<el-button
v-if="isBtnPerm('/deviceData/latestData')"
type="text"
@click="sensorData(row)"
>
数据
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -308,9 +357,11 @@ import {
getDictData, getDictData,
doEdit, doEdit,
} from '@/api/device'; } from '@/api/device';
import { baseURL } from '@/config';
export default { export default {
data() { data() {
return { return {
fileUrl: baseURL + '/static/img/',
deviceData: [], deviceData: [],
lazy: true, lazy: true,
activeName: 'first', activeName: 'first',

View File

@ -72,7 +72,13 @@
</el-table-column> </el-table-column>
<el-table-column fixed="right" label="操作" width="100" align="center"> <el-table-column fixed="right" label="操作" width="100" align="center">
<template #default="{ row }"> <template #default="{ row }">
<el-button type="text" @click="handleLive(row)">播放</el-button> <el-button
v-if="isBtnPerm('/ys/api/getLiveAddr')"
type="text"
@click="handleLive(row)"
>
播放
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

View File

@ -0,0 +1,123 @@
<template>
<el-table
v-loading="listLoading"
:data="sensorData"
border
stripe
style="width: 100%"
>
<el-table-column
prop="name"
label="传感器名称"
align="center"
></el-table-column>
<el-table-column
prop="dataKey"
label="传输id"
align="center"
></el-table-column>
<el-table-column prop="dataValue" label="值" align="center">
<template #default="{ row }">
<el-tag type="success">{{ row.dataValue }}</el-tag>
</template>
</el-table-column>
<el-table-column prop="unit" label="单位" align="center"></el-table-column>
<el-table-column label="操作" align="center">
<template #default="{ row }">
<el-button
v-if="row.readWrite == '读写' && isBtnPerm('/deviceSensor/write')"
type="text"
@click="distribute(row)"
>
下发指令
</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
:background="background"
:current-page="queryForm.page"
:layout="layout"
:page-size="queryForm.size"
:total="total"
style="text-align: right"
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
></el-pagination>
<distribute ref="distribute"></distribute>
</template>
<script>
import { energyStorage } from '@/api/monitor';
import distribute from '@/views/server/siteDetails/distribute';
export default {
components: {
distribute,
},
data() {
return {
sensorData: [],
lazy: true,
activeName: 'first',
layout: 'prev, pager, next',
total: 0,
background: true,
listLoading: true,
elementLoadingText: '正在加载...',
queryForm: {
page: 1,
size: 5,
deviceCode: '',
},
};
},
computed: {
height() {
return 500;
},
},
methods: {
showData(row) {
this.queryForm.deviceCode = row.deviceCode;
this.fetchData();
},
async fetchData() {
this.listLoading = true;
const { data } = await energyStorage(this.queryForm);
this.sensorData = data.items;
this.total = data.total;
setTimeout(() => {
this.listLoading = false;
}, 500);
},
distribute(row) {
const dataKey = row.dataKey;
const deviceCode = this.queryForm.deviceCode;
this.$refs['distribute'].showEdit({
deviceCode: deviceCode,
dataKey: dataKey,
unit: row.unit,
convertFlag: row.convertFlag,
});
},
handleQuery() {
this.queryForm.page = 1;
this.fetchData();
},
handleSizeChange(val) {
this.queryForm.pageSize = val;
this.fetchData();
},
handleCurrentChange(val) {
this.queryForm.page = val;
this.fetchData();
},
},
};
</script>
<style lang="scss" scoped>
.manage-button {
margin-bottom: 30px;
}
</style>

View File

@ -1,12 +1,18 @@
<template> <template>
<div class="image-list"> <div class="image-list">
<div v-for="img in imageData" :key="img" class="block"> <div class="block">
<el-image <div class="block_item" :key="img" v-for="(img, index) in imageData">
style="width: 200px; height: 200px" <div class="block_text" @click="handleClick(index)">
:src="img" {{ img.turbidity }}
fit="cover" </div>
:preview-src-list="imageData" <el-image
></el-image> :ref="`imageRef${index}`"
style="width: 200px; height: 200px"
:src="img.img"
fit="cover"
:preview-src-list="imageList"
></el-image>
</div>
</div> </div>
<div class="page"> <div class="page">
<el-pagination <el-pagination
@ -36,6 +42,7 @@ export default {
data() { data() {
return { return {
imageData: [], imageData: [],
imageList: [],
fileUrl: baseURL + '/static/capture/', fileUrl: baseURL + '/static/capture/',
background: true, background: true,
lazy: true, lazy: true,
@ -44,6 +51,7 @@ export default {
queryForm: { queryForm: {
deviceCode: '', deviceCode: '',
page: 1, page: 1,
size: 10,
}, },
}; };
}, },
@ -55,6 +63,9 @@ export default {
}, },
created() {}, created() {},
methods: { methods: {
handleClick(index) {
this.$refs[`imageRef${index}`][0].showViewer = true;
},
showData(row) { showData(row) {
this.queryForm.deviceCode = row.deviceCode; this.queryForm.deviceCode = row.deviceCode;
this.fetchData(); this.fetchData();
@ -66,6 +77,7 @@ export default {
// list[i] = this.fileUrl + list[i]; // list[i] = this.fileUrl + list[i];
// } // }
this.imageData = data.items; this.imageData = data.items;
this.imageList = data.items.map(item => item.img);
this.total = data.total; this.total = data.total;
}, },
handleQuery() { handleQuery() {
@ -88,7 +100,31 @@ export default {
.image-list { .image-list {
width: 100%; width: 100%;
.block { .block {
float: left; .block_text {
position: absolute;
top: 80px;
text-align: center;
z-index: 1;
width: 200px;
font-weight: bold;
opacity: 0.7;
color: #fde2c2;
font-size: 48px;
transform: rotateZ(-37deg);
cursor: pointer;
font-family: serif;
}
.block_item {
margin: 0 10px;
position: relative;
}
.image-item {
position: absolute;
}
display: flex;
flex-wrap: wrap;
margin-left: 20px; margin-left: 20px;
margin-top: 20px; margin-top: 20px;
} }

Some files were not shown because too many files have changed in this diff Show More