diff --git a/package.json b/package.json index f9e34b6..b01d825 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,12 @@ { "name": "dc3-web", - "version": "1.2.3", + "version": "1.3.2", "private": true, "author": "pnoker", "description": "IOT DC3 Demo Application UI", "scripts": { "serve": "vue-cli-service serve", - "build": "vue-cli-service build", - "lint": "vue-cli-service lint" + "build": "vue-cli-service build" }, "dependencies": { "@antv/g2": "^4.0.12", @@ -30,51 +29,15 @@ }, "devDependencies": { "@vue/cli-plugin-babel": "^4.4.6", - "@vue/cli-plugin-eslint": "^4.4.6", "@vue/cli-plugin-router": "^4.4.6", "@vue/cli-plugin-vuex": "^4.4.6", "@vue/cli-service": "^4.4.6", - "babel-eslint": "^10.1.0", - "eslint": "^6.8.0", - "eslint-plugin-vue": "^6.2.2", "webpack": "^4.43.0", "node-sass": "^4.14.1", "sass-loader": "^8.0.2", "vue-cli-plugin-element": "^1.0.1", "vue-template-compiler": "^2.6.11" }, - "lint-staged": { - "*.js": [ - "vue-cli-service lint", - "git add" - ], - "*.vue": [ - "vue-cli-service lint", - "git add" - ] - }, - "eslintConfig": { - "root": true, - "env": { - "node": true - }, - "extends": [ - "plugin:vue/essential", - "eslint:recommended" - ], - "rules": { - "no-console": "off", - "no-debugger": "off" - }, - "parserOptions": { - "parser": "babel-eslint" - } - }, - "postcss": { - "plugins": { - "autoprefixer": {} - } - }, "browserslist": [ "> 1%", "last 2 versions", diff --git a/postcss.config.js b/postcss.config.js deleted file mode 100644 index 59ea1f3..0000000 --- a/postcss.config.js +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = { - plugins: { - autoprefixer: {} - } -}; diff --git a/src/api/manager.js b/src/api/manager.js index 7cb3563..16b5b6a 100644 --- a/src/api/manager.js +++ b/src/api/manager.js @@ -205,12 +205,8 @@ export const dictionaryApi = { url: 'manager_api/manager/dictionary/point_attribute', method: 'get' }), - groupDictionary: () => request({ - url: 'manager_api/manager/dictionary/group', - method: 'get' - }), - deviceDictionary: (parent) => request({ - url: 'manager_api/manager/dictionary/device/' + parent, + deviceDictionary: () => request({ + url: 'manager_api/manager/dictionary/device', method: 'get' }), pointDictionary: (parent) => request({ @@ -243,4 +239,4 @@ export const statusApi = { method: 'post', data: device }) -}; \ No newline at end of file +}; diff --git a/src/api/user.js b/src/api/user.js deleted file mode 100644 index f4445ae..0000000 --- a/src/api/user.js +++ /dev/null @@ -1,25 +0,0 @@ -import request from '@/config/axios' - -export const generateSalt = (name) => request({ - url: 'user_api/auth/token/salt', - method: 'post', - data: name -}); - -export const generateToken = (login) => request({ - url: 'user_api/auth/token/generate', - method: 'post', - data: login -}); - -export const checkTokenValid = (login) => request({ - url: 'user_api/auth/token/check', - method: 'post', - data: login -}); - -export const cancelToken = (name) => request({ - url: 'user_api/auth/token/cancel', - method: 'post', - data: name -}); diff --git a/src/config/axios.js b/src/config/axios.js index f87c55c..03c2e22 100644 --- a/src/config/axios.js +++ b/src/config/axios.js @@ -1,6 +1,4 @@ import axios from 'axios' -import router from '@/router/router' -import store from '@/store/store'; import NProgress from 'nprogress' import 'nprogress/nprogress.css' import {failMessage} from '@/util/util' @@ -33,11 +31,7 @@ axios.interceptors.response.use(res => { const ok = res.data.ok || false, status = res.status || 200, message = res.data.message || 'Internal Server Error!'; if (!ok) { - if (status === 401) { - store.dispatch('ClearToken').then(() => router.push({path: '/login'})); - } else { - failMessage(message); - } + failMessage(message); return Promise.reject(new Error(message)); } diff --git a/src/plugins/element/element.js b/src/plugins/element/element.js index 1c2c3b5..a64671d 100644 --- a/src/plugins/element/element.js +++ b/src/plugins/element/element.js @@ -25,8 +25,8 @@ console.log( '| ( <_> ) | / /_/ \\ \\___ / \\\n' + '|__|\\____/|__| \\____ |\\___ >______ /\n' + ' \\/ \\/ \\/\n' + - ' https://dc3.site\n' + + ' 开发文档:https://dc3.site\n' + ' https://gitee.com/pnoker/iot-dc3\n' + ' https://github.com/pnoker/iot-dc3\n' + - ' DC3 IOT Platform V3.0 Pnoker Authors' + ' DC3 IOT Platform V1.3.2.SR Pnoker Authors' ); diff --git a/src/router/common/index.js b/src/router/common/index.js index 8db3095..1ceb7bc 100644 --- a/src/router/common/index.js +++ b/src/router/common/index.js @@ -1,13 +1,4 @@ export default [ - { - name: 'login', - path: '/login', - meta: { - isAuth: false, - title: 'DC3 物联万物,智控未来!' - }, - component: () => import('@/views/login/Login') - }, { name: '403', path: '/403', diff --git a/src/router/router.js b/src/router/router.js index 627fa32..c54a6d7 100644 --- a/src/router/router.js +++ b/src/router/router.js @@ -7,7 +7,7 @@ import NProgress from "nprogress"; Vue.use(VueRouter); const router = new VueRouter({ - scrollBehavior(to, from, savedPosition) { + scrollBehavior: (to, from, savedPosition) => { if (savedPosition) { return savedPosition } else { diff --git a/src/router/views/index.js b/src/router/views/index.js index 0da79e3..146b51a 100644 --- a/src/router/views/index.js +++ b/src/router/views/index.js @@ -69,15 +69,6 @@ export default [ }, component: () => import('@/views/point/Point') }, - { - name: 'group', - path: '/group', - meta: { - isAuth: true, - title: '分组' - }, - component: () => import('@/views/group/Group') - }, { name: 'device', path: '/device', diff --git a/src/store/getters.js b/src/store/getters.js deleted file mode 100644 index bc3e9aa..0000000 --- a/src/store/getters.js +++ /dev/null @@ -1,6 +0,0 @@ -const getters = { - token: state => state.user.token, - user: state => state.user.user, -}; - -export default getters \ No newline at end of file diff --git a/src/store/modules/user.js b/src/store/modules/user.js deleted file mode 100644 index c4e725a..0000000 --- a/src/store/modules/user.js +++ /dev/null @@ -1,67 +0,0 @@ -import md5 from 'js-md5'; - -import {getStore, removeCookies, removeStore, setCookies, setStore} from '@/util/store' -import {cancelToken, generateSalt, generateToken} from '@/api/user' - -import website from "@/config/website"; - -const user = { - state: {}, - actions: { - GenerateSalt({commit}, name) { - return new Promise((resolve, reject) => { - generateSalt(name).then(res => { - resolve(res.data); - }).catch(error => { - reject(error); - }) - }); - }, - GenerateToken({commit}, form) { - let login = { - tenant: form.tenant, - name: form.name, - salt: form.salt, - password: md5(md5(form.password) + form.salt) - }; - return new Promise((resolve, reject) => { - generateToken(login).then(res => { - const data = res.data; - commit('SET_TOKEN', - { - tenant: login.tenant, - name: login.name, - salt: login.salt, - token: data - } - ); - resolve(); - }).catch(error => { - reject(error); - }); - }); - }, - ClearToken({commit}) { - return new Promise((resolve) => { - let token = getStore(website.token_header); - if (token && token.name) { - cancelToken(token.name); - } - commit('REMOVE_TOKEN'); - resolve(); - }); - } - }, - mutations: { - SET_TOKEN: (state, token) => { - setCookies(website.token_header, token); - setStore(website.token_header, token); - }, - REMOVE_TOKEN: () => { - removeCookies(website.token_header); - removeStore(website.token_header); - } - } -}; - -export default user diff --git a/src/store/store.js b/src/store/store.js index 4119dcb..70fc88c 100644 --- a/src/store/store.js +++ b/src/store/store.js @@ -1,16 +1,11 @@ import Vue from 'vue' import Vuex from 'vuex' -import user from './modules/user' import common from './modules/common' -import getters from './getters' Vue.use(Vuex); const store = new Vuex.Store({ - modules: { - common, user - }, - getters + modules: {common} }); export default store diff --git a/src/util/auth.js b/src/util/auth.js deleted file mode 100644 index 88daabc..0000000 --- a/src/util/auth.js +++ /dev/null @@ -1,20 +0,0 @@ -import Cookies from 'js-cookie' -import website from "@/config/website"; - -const keyName = website.key + '-'; -const TokenKey = keyName + 'auth-token'; - -// 360分钟,360 * 60 * 1000 -const expiration = new Date(new Date().getTime() + 360 * 60 * 1000); - -export function getTokenCookies() { - return Cookies.get(TokenKey); -} - -export function setTokenCookies(token) { - return Cookies.set(TokenKey, token, {expires: expiration}); -} - -export function removeTokenCookies() { - return Cookies.remove(TokenKey); -} \ No newline at end of file diff --git a/src/util/store.js b/src/util/store.js deleted file mode 100644 index cc30016..0000000 --- a/src/util/store.js +++ /dev/null @@ -1,136 +0,0 @@ -import {isNull} from './validate'; -import website from '@/config/website'; -import Cookies from "js-cookie"; -import {decode, encode} from 'js-base64' - -const keyName = website.key + '-'; - -export function getCookies(key) { - return JSON.parse(decode(Cookies.get(key))); -} - -export function setCookies(key, value) { - return Cookies.set(key, encode(JSON.stringify(value))); -} - -export function removeCookies(key) { - return Cookies.remove(key); -} - -/** - * 存储 localStorage - * @param params - */ -export const setStore = (params = {}) => { - let { - name, - content, - type, - } = params; - name = keyName + name; - let obj = { - dataType: typeof (content), - content: content, - type: type, - datetime: new Date().getTime() - }; - if (type) window.sessionStorage.setItem(name, JSON.stringify(obj)); - else window.localStorage.setItem(name, JSON.stringify(obj)); -}; - -/** - * 获取 localStorage - * @param params - */ -export const getStore = (params = {}) => { - let { - name, - debug - } = params; - name = keyName + name; - let obj = {}, content; - obj = window.sessionStorage.getItem(name); - if (isNull(obj)) obj = window.localStorage.getItem(name); - if (isNull(obj)) return; - try { - obj = JSON.parse(obj); - } catch { - return obj; - } - if (debug) { - return obj; - } - if (obj.dataType === 'string') { - content = obj.content; - } else if (obj.dataType === 'number') { - content = Number(obj.content); - } else if (obj.dataType === 'boolean') { - content = eval(obj.content); - } else if (obj.dataType === 'object') { - content = obj.content; - } - return content; -}; - -/** - * 删除 localStorage - * @param params - */ -export const removeStore = (params = {}) => { - let { - name, - type - } = params; - name = keyName + name; - if (type) { - window.sessionStorage.removeItem(name); - } else { - window.localStorage.removeItem(name); - } -}; - -/** - * 获取全部 localStorage - * @param params - */ -export const getAllStore = (params = {}) => { - let list = []; - let { - type - } = params; - if (type) { - for (let i = 0; i <= window.sessionStorage.length; i++) { - list.push({ - name: window.sessionStorage.key(i), - content: getStore({ - name: window.sessionStorage.key(i), - type: 'session' - }) - }) - } - } else { - for (let i = 0; i <= window.localStorage.length; i++) { - list.push({ - name: window.localStorage.key(i), - content: getStore({ - name: window.localStorage.key(i), - }) - }) - - } - } - return list; -}; - -/** - * 清空全部 localStorage - * @param params - */ -export const clearStore = (params = {}) => { - let {type} = params; - if (type) { - window.sessionStorage.clear(); - } else { - window.localStorage.clear() - } -}; diff --git a/src/views/device/Device.vue b/src/views/device/Device.vue index cfaa122..7ef3ec2 100644 --- a/src/views/device/Device.vue +++ b/src/views/device/Device.vue @@ -82,7 +82,7 @@ index: true, stripe: true, border: true, - height: 664, + height: 725, align: 'center', column: [ { @@ -90,7 +90,7 @@ prop: 'name', span: 24, search: true, - searchSpan: 8, + searchSpan: 16, rules: [ { required: true, @@ -107,8 +107,8 @@ } ] }, { - label: '所属模板', - prop: 'profileId', + label: '所属驱动', + prop: 'driverId', span: 8, search: true, searchSpan: 8, @@ -118,25 +118,22 @@ rules: [ { required: true, - message: '请选择使用模板', + message: '请选择使用驱动', trigger: 'click' } ] }, { - label: '所属分组', - prop: 'groupId', - width: 180, + label: '包含模板', + prop: 'profileIds', span: 8, - search: true, - searchSpan: 8, - type: 'select', - filterable: true, - searchFilterable: true, + type: 'tree', dicData: [], + multiple: true, + defaultExpandAll: true, rules: [ { required: true, - message: '请选择所属分组', + message: '请选择使用模板', trigger: 'click' } ] @@ -198,21 +195,19 @@ }, { label: '修改日期', prop: 'updateTime', - width: 155, + width: 180, span: 12, disabled: true, type: 'date', - format: 'yyyy-MM-dd HH:mm:ss', - valueFormat: 'yyyy-MM-dd HH:mm:ss' + format: 'yyyy-MM-dd HH:mm:ss.SSS' }, { label: '创建日期', prop: 'createTime', - width: 155, + width: 180, span: 12, disabled: true, type: 'date', - format: 'yyyy-MM-dd HH:mm:ss', - valueFormat: 'yyyy-MM-dd HH:mm:ss' + format: 'yyyy-MM-dd HH:mm:ss.SSS' } ] }, @@ -225,7 +220,7 @@ } }, created() { - this.group(); + this.driver(); this.profile(); }, methods: @@ -260,15 +255,15 @@ this.loading = false; }); }, - group() { - dictionaryApi.groupDictionary().then(res => { - this.findObject(this.listOption.column, 'groupId').dicData = res.data; + driver() { + dictionaryApi.driverDictionary().then(res => { + this.findObject(this.listOption.column, 'driverId').dicData = res.data; }).catch(() => { }); }, profile() { dictionaryApi.profileDictionary().then(res => { - this.findObject(this.listOption.column, 'profileId').dicData = res.data; + this.findObject(this.listOption.column, 'profileIds').dicData = res.data; }).catch(() => { }); }, diff --git a/src/views/driver/Driver.vue b/src/views/driver/Driver.vue index ad8ae90..d66ddcf 100644 --- a/src/views/driver/Driver.vue +++ b/src/views/driver/Driver.vue @@ -47,7 +47,7 @@ addBtn: false, editBtn: false, delBtn: false, - height: 664, + height: 725, align: 'center', column: [ { @@ -118,21 +118,19 @@ }, { label: '修改日期', prop: 'updateTime', - width: 155, + width: 180, span: 12, disabled: true, type: 'date', - format: 'yyyy-MM-dd HH:mm:ss', - valueFormat: 'yyyy-MM-dd HH:mm:ss' + format: 'yyyy-MM-dd HH:mm:ss.SSS' }, { label: '创建日期', prop: 'createTime', - width: 155, + width: 180, span: 12, disabled: true, type: 'date', - format: 'yyyy-MM-dd HH:mm:ss', - valueFormat: 'yyyy-MM-dd HH:mm:ss' + format: 'yyyy-MM-dd HH:mm:ss.SSS' } ] }, diff --git a/src/views/driver/DriverAttribute.vue b/src/views/driver/DriverAttribute.vue index 6beee41..1584efb 100644 --- a/src/views/driver/DriverAttribute.vue +++ b/src/views/driver/DriverAttribute.vue @@ -42,7 +42,7 @@ viewBtn: false, editBtn: false, delBtn: false, - height: 664, + height: 725, align: 'center', column: [ { @@ -168,21 +168,19 @@ }, { label: '修改日期', prop: 'updateTime', - width: 155, + width: 180, span: 12, disabled: true, type: 'date', - format: 'yyyy-MM-dd HH:mm:ss', - valueFormat: 'yyyy-MM-dd HH:mm:ss' + format: 'yyyy-MM-dd HH:mm:ss.SSS' }, { label: '创建日期', prop: 'createTime', - width: 155, + width: 180, span: 12, disabled: true, type: 'date', - format: 'yyyy-MM-dd HH:mm:ss', - valueFormat: 'yyyy-MM-dd HH:mm:ss' + format: 'yyyy-MM-dd HH:mm:ss.SSS' } ] }, diff --git a/src/views/driver/DriverInfo.vue b/src/views/driver/DriverInfo.vue index 308b884..c0575ee 100644 --- a/src/views/driver/DriverInfo.vue +++ b/src/views/driver/DriverInfo.vue @@ -37,12 +37,12 @@ index: true, stripe: true, border: true, - height: 664, + height: 725, align: 'center', column: [ { - label: '所属模板', - prop: 'profileId', + label: '所属设备', + prop: 'deviceId', span: 24, search: true, searchSpan: 12, @@ -100,21 +100,19 @@ }, { label: '修改日期', prop: 'updateTime', - width: 155, + width: 180, span: 12, disabled: true, type: 'date', - format: 'yyyy-MM-dd HH:mm:ss', - valueFormat: 'yyyy-MM-dd HH:mm:ss' + format: 'yyyy-MM-dd HH:mm:ss.SSS' }, { label: '创建日期', prop: 'createTime', - width: 155, + width: 180, span: 12, disabled: true, type: 'date', - format: 'yyyy-MM-dd HH:mm:ss', - valueFormat: 'yyyy-MM-dd HH:mm:ss' + format: 'yyyy-MM-dd HH:mm:ss.SSS' } ] }, @@ -127,7 +125,7 @@ } }, created() { - this.profile(); + this.device(); this.driverAttribute(); }, methods: @@ -148,15 +146,15 @@ this.loading = false; }); }, - profile() { - dictionaryApi.profileDictionary().then(res => { - this.findObject(this.listOption.column,'profileId').dicData = res.data; + device() { + dictionaryApi.deviceDictionary().then(res => { + this.findObject(this.listOption.column, 'deviceId').dicData = res.data; }).catch(() => { }); }, driverAttribute() { dictionaryApi.driverAttributeDictionary().then(res => { - this.findObject(this.listOption.column,'driverAttributeId').dicData = res.data; + this.findObject(this.listOption.column, 'driverAttributeId').dicData = res.data; }).catch(() => { }); }, diff --git a/src/views/event/DeviceEvent.vue b/src/views/event/DeviceEvent.vue index ab6941d..b7519eb 100644 --- a/src/views/event/DeviceEvent.vue +++ b/src/views/event/DeviceEvent.vue @@ -49,7 +49,7 @@ addBtn: false, delBtn: false, editBtn: false, - height: 664, + height: 725, align: 'center', defaultExpandAll: true, column: [ diff --git a/src/views/group/Group.vue b/src/views/group/Group.vue deleted file mode 100644 index ca50355..0000000 --- a/src/views/group/Group.vue +++ /dev/null @@ -1,177 +0,0 @@ - - - - - diff --git a/src/views/home/Home.vue b/src/views/home/Home.vue index 52341d7..566d2e4 100644 --- a/src/views/home/Home.vue +++ b/src/views/home/Home.vue @@ -66,6 +66,6 @@ position: relative; width: 100%; overflow: hidden; - height: 875px; + height: 945px; } diff --git a/src/views/layout/Layout.vue b/src/views/layout/Layout.vue index b5ebb34..b46878d 100644 --- a/src/views/layout/Layout.vue +++ b/src/views/layout/Layout.vue @@ -14,19 +14,12 @@ 驱动属性 位号属性 模板 - 驱动配置 位号 - 分组 设备 + 驱动配置 位号配置 数据 事件 - @@ -42,8 +35,8 @@ - 个人信息 帮助 + 仅供测试1.3.2.SR接口使用 退出登录 @@ -71,14 +64,8 @@ this.$message('click on message'); }, handleCommand(command) { - if (command === 'logout') { - this.$store.dispatch('ClearToken').then((res) => { - if (res.ok) { - this.$router.push('/login'); - } - }); - } else { - this.$message('click on item ' + command); + if (command === 'help') { + window.open('https://doc.dc3.site'); } } } diff --git a/src/views/login/Login.vue b/src/views/login/Login.vue deleted file mode 100644 index ad036b2..0000000 --- a/src/views/login/Login.vue +++ /dev/null @@ -1,124 +0,0 @@ - - - - diff --git a/src/views/point/Point.vue b/src/views/point/Point.vue index fcd77b7..ed670cd 100644 --- a/src/views/point/Point.vue +++ b/src/views/point/Point.vue @@ -38,7 +38,7 @@ stripe: true, border: true, viewBtn: true, - height: 664, + height: 725, align: 'center', column: [ { @@ -272,21 +272,19 @@ }, { label: '修改日期', prop: 'updateTime', - width: 155, + width: 180, span: 12, disabled: true, type: 'date', - format: 'yyyy-MM-dd HH:mm:ss', - valueFormat: 'yyyy-MM-dd HH:mm:ss' + format: 'yyyy-MM-dd HH:mm:ss.SSS' }, { label: '创建日期', prop: 'createTime', - width: 155, + width: 180, span: 12, disabled: true, type: 'date', - format: 'yyyy-MM-dd HH:mm:ss', - valueFormat: 'yyyy-MM-dd HH:mm:ss' + format: 'yyyy-MM-dd HH:mm:ss.SSS' } ] }, diff --git a/src/views/point/PointAttribute.vue b/src/views/point/PointAttribute.vue index 4dada52..5a53314 100644 --- a/src/views/point/PointAttribute.vue +++ b/src/views/point/PointAttribute.vue @@ -42,7 +42,7 @@ viewBtn: false, editBtn: false, delBtn: false, - height: 664, + height: 725, align: 'center', column: [ { @@ -168,21 +168,19 @@ }, { label: '修改日期', prop: 'updateTime', - width: 155, + width: 180, span: 12, disabled: true, type: 'date', - format: 'yyyy-MM-dd HH:mm:ss', - valueFormat: 'yyyy-MM-dd HH:mm:ss' + format: 'yyyy-MM-dd HH:mm:ss.SSS' }, { label: '创建日期', prop: 'createTime', - width: 155, + width: 180, span: 12, disabled: true, type: 'date', - format: 'yyyy-MM-dd HH:mm:ss', - valueFormat: 'yyyy-MM-dd HH:mm:ss' + format: 'yyyy-MM-dd HH:mm:ss.SSS' } ] }, diff --git a/src/views/point/PointInfo.vue b/src/views/point/PointInfo.vue index 26da5f4..240bdce 100644 --- a/src/views/point/PointInfo.vue +++ b/src/views/point/PointInfo.vue @@ -37,7 +37,7 @@ index: true, stripe: true, border: true, - height: 664, + height: 725, align: 'center', column: [ { @@ -116,21 +116,19 @@ }, { label: '修改日期', prop: 'updateTime', - width: 155, + width: 180, span: 12, disabled: true, type: 'date', - format: 'yyyy-MM-dd HH:mm:ss', - valueFormat: 'yyyy-MM-dd HH:mm:ss' + format: 'yyyy-MM-dd HH:mm:ss.SSS' }, { label: '创建日期', prop: 'createTime', - width: 155, + width: 180, span: 12, disabled: true, type: 'date', - format: 'yyyy-MM-dd HH:mm:ss', - valueFormat: 'yyyy-MM-dd HH:mm:ss' + format: 'yyyy-MM-dd HH:mm:ss.SSS' } ] }, @@ -166,7 +164,7 @@ }); }, device() { - dictionaryApi.deviceDictionary('group').then(res => { + dictionaryApi.deviceDictionary().then(res => { this.findObject(this.listOption.column,'deviceId').dicData = res.data; }).catch(() => { }); diff --git a/src/views/point/PointValue.vue b/src/views/point/PointValue.vue index 096387f..07ac310 100644 --- a/src/views/point/PointValue.vue +++ b/src/views/point/PointValue.vue @@ -16,7 +16,7 @@ @current-change="currentChange" > @@ -43,7 +43,7 @@ addBtn: false, delBtn: false, editBtn: false, - height: 664, + height: 725, align: 'center', defaultExpandAll: true, column: [ @@ -100,9 +100,9 @@ type: 'date', format: 'yyyy-MM-dd HH:mm:ss.SSS' }, { - label: '延时(毫秒)', + label: 'Debug|延时(ms)', prop: 'interval', - width: 90, + width: 120, span: 4, slot: true }, { @@ -151,7 +151,7 @@ }); }, device() { - dictionaryApi.deviceDictionary('group').then(res => { + dictionaryApi.deviceDictionary().then(res => { this.findObject(this.listOption.column, 'deviceId').dicData = res.data; }).catch(() => { }); @@ -186,6 +186,11 @@ searchReset() { this.query = {}; this.list(this.page); + }, + interval(date1, date2) { + let tempDate1 = new Date(date1); + let tempDate2 = new Date(date2); + return tempDate1.getTime() - tempDate2.getTime(); } } } diff --git a/src/views/profile/Profile.vue b/src/views/profile/Profile.vue index 5f3ba18..37fcc5c 100644 --- a/src/views/profile/Profile.vue +++ b/src/views/profile/Profile.vue @@ -37,7 +37,7 @@ index: true, stripe: true, border: true, - height: 664, + height: 725, align: 'center', column: [ { @@ -45,7 +45,7 @@ prop: 'name', span: 24, search: true, - searchSpan: 12, + searchSpan: 24, rules: [ { required: true, @@ -61,50 +61,6 @@ message: '请输入 正确格式的模板名称' } ] - }, { - label: '公/私有', - prop: 'share', - width: 100, - search: true, - searchSpan: 6, - type: 'select', - searchFilterable: true, - value: false, - dicData: [ - { - label: '私有', - value: false - }, - { - label: '公有', - value: true, - disabled: true - - } - ], - rules: [ - { - required: true, - message: '请选择模板共享类型', - trigger: 'click' - } - ] - }, { - label: '所属驱动', - prop: 'driverId', - search: true, - searchSpan: 6, - type: 'select', - filterable: true, - searchFilterable: true, - dicData: [], - rules: [ - { - required: true, - message: '请选择所属驱动', - trigger: 'click' - } - ] }, { label: '备注', prop: 'description', @@ -122,21 +78,19 @@ }, { label: '修改日期', prop: 'updateTime', - width: 155, + width: 180, span: 12, disabled: true, type: 'date', - format: 'yyyy-MM-dd HH:mm:ss', - valueFormat: 'yyyy-MM-dd HH:mm:ss' + format: 'yyyy-MM-dd HH:mm:ss.SSS' }, { label: '创建日期', prop: 'createTime', - width: 155, + width: 180, span: 12, disabled: true, type: 'date', - format: 'yyyy-MM-dd HH:mm:ss', - valueFormat: 'yyyy-MM-dd HH:mm:ss' + format: 'yyyy-MM-dd HH:mm:ss.SSS' } ] },