Merge branch '2.0.1' of http://139.186.142.91:10010/r/productDev/funingyunwei into 2.0.1
| | |
| | | NODE_ENV = 'development' |
| | | # 项ç®ä¸ä¸æè·¯å¾ |
| | | VUE_APP_CONTEXT_PATH = './' |
| | | |
| | | #VUE_APP_API_URL = 'http://localhost:10010' |
| | | |
| | | VUE_APP_API_URL = 'http://192.168.1.44:10010' |
| | | |
| | | #VUE_APP_API_URL = 'https://zhcg.fnwtzx.com/gateway_interface' |
| | | |
| | |
| | | # ç产ç¯å¢é
ç½® |
| | | NODE_ENV = 'production' |
| | | |
| | | # VUE_APP_API_URL = 'https://dmtest.ahapp.net/gateway_interface' |
| | | VUE_APP_API_URL = 'https://zhcg.fnwtzx.com/gateway_interface/doc.html' |
| | | VUE_APP_API_URL = 'https://zhcg.fnwtzx.com/gateway_interface' |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '../../utils/request' |
| | | |
| | | // æ¥è¯¢ |
| | | export function fetchList (data) { |
| | | return request.post('/visitsAdmin/cloudService/business/ywGateway/page', data) |
| | | } |
| | | // å建 |
| | | export function create (data) { |
| | | return request.post('/visitsAdmin/cloudService/business/ywGateway/create', data) |
| | | } |
| | | // ä¿®æ¹ |
| | | export function updateById (data) { |
| | | return request.post('/visitsAdmin/cloudService/business/ywGateway/updateById', data) |
| | | } |
| | | // å é¤ |
| | | export function deleteById (id) { |
| | | return request.get(`/visitsAdmin/cloudService/business/ywGateway/delete/${id}`) |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <GlobalWindow |
| | | :title="title" |
| | | :visible.sync="visible" |
| | | width="65%" |
| | | :confirm-working="isWorking" |
| | | @confirm="confirm" |
| | | > |
| | | <el-form :model="form" ref="form" :rules="rules"> |
| | | <el-form-item label="项ç®åç§°" prop="name"> |
| | | <el-select v-model="form.projectId" placeholder="è¯·éæ©é¡¹ç®åç§°"> |
| | | <el-option |
| | | v-for="item in projectList" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="ç½å
³åç§°" prop="name"> |
| | | <el-input v-model="form.name" placeholder="请è¾å
¥ç½å
³åç§°" v-trim/> |
| | | </el-form-item> |
| | | <el-form-item label="ç½å
³åå·" prop="gatewayModel"> |
| | | <el-input v-model="form.gatewayModel" placeholder="请è¾å
¥ç½å
³åå·" v-trim/> |
| | | </el-form-item> |
| | | <el-form-item label="ç½å
³è®¾å¤å·" prop="gatewayCode"> |
| | | <el-input v-model="form.gatewayCode" placeholder="请è¾å
¥ç½å
³è®¾å¤å·" v-trim/> |
| | | </el-form-item> |
| | | </el-form> |
| | | </GlobalWindow> |
| | | </template> |
| | | <script> |
| | | import BaseOpera from '@/components/base/BaseOpera' |
| | | import GlobalWindow from '@/components/common/GlobalWindow' |
| | | import { getProjectList } from '@/api/project/ywProject' |
| | | export default { |
| | | name: 'DeviceGatewayWindow ', |
| | | extends: BaseOpera, |
| | | components: { GlobalWindow }, |
| | | data () { |
| | | return { |
| | | // è¡¨åæ°æ® |
| | | form: { |
| | | id: null, |
| | | projectId: '', |
| | | name: '', |
| | | gatewayModel: '', |
| | | gatewayCode: '' |
| | | }, |
| | | // éªè¯è§å |
| | | rules: { |
| | | name: [ |
| | | { required: true, message: '请è¾å
¥è®¾å¤åç§°', trigger: 'blur' } |
| | | ], |
| | | projectId: [ |
| | | { required: true, message: 'è¯·éæ©é¡¹ç®åç§°', trigger: 'change' } |
| | | ], |
| | | gatewayModel: [ |
| | | { required: true, message: '请è¾å
¥ç½å
³åå·', trigger: 'blur' } |
| | | ], |
| | | gatewayCode: [ |
| | | { required: true, message: '请è¾å
¥ç½å
³è®¾å¤å·', trigger: 'blur' } |
| | | ] |
| | | }, |
| | | projectList: [] |
| | | } |
| | | }, |
| | | created () { |
| | | this.config({ |
| | | api: '/business/ywGateway', |
| | | 'field.id': 'id' |
| | | }) |
| | | }, |
| | | methods: { |
| | | open (title, target) { |
| | | this.title = title |
| | | this.getProject() |
| | | this.visible = true |
| | | // æ°å»º |
| | | if (target == null) { |
| | | this.$nextTick(() => { |
| | | this.$refs.form.resetFields() |
| | | this.form[this.configData['field.id']] = null |
| | | }) |
| | | return |
| | | } |
| | | // ç¼è¾ |
| | | this.$nextTick(async () => { |
| | | for (const key in this.form) { |
| | | this.form[key] = target[key] |
| | | } |
| | | }) |
| | | }, |
| | | getProject() { |
| | | getProjectList({}).then(res => { |
| | | this.projectList = res || [] |
| | | }) |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <GlobalWindow |
| | | :title="title" |
| | | :visible.sync="visible" |
| | | :showConfirm="false" |
| | | width="65%" |
| | | :confirm-working="isWorking" |
| | | @confirm="confirm" |
| | | > |
| | | <el-table |
| | | :data="tableData" |
| | | stripe |
| | | style="width: 100%"> |
| | | <el-table-column |
| | | prop="date" |
| | | label="表å·"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="name" |
| | | label="表åç§°"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="ä»è´¹ç±»å" |
| | | label="ä»è´¹ç±»å"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="设å¤ç»å®ç¶æ" |
| | | label="设å¤ç»å®ç¶æ"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="æä½"> |
| | | <template slot-scope="{row}"> |
| | | <el-button type="text">è§£ç»</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </GlobalWindow> |
| | | </template> |
| | | <script> |
| | | import BaseOpera from '@/components/base/BaseOpera' |
| | | import GlobalWindow from '@/components/common/GlobalWindow' |
| | | export default { |
| | | name: 'electricityMeter', |
| | | extends: BaseOpera, |
| | | components: { GlobalWindow }, |
| | | data () { |
| | | return { |
| | | tableData: [] |
| | | } |
| | | }, |
| | | created () { |
| | | |
| | | }, |
| | | methods: { |
| | | |
| | | } |
| | | } |
| | | </script> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <TableLayout :permissions="['business:device:query']"> |
| | | <!-- æç´¢è¡¨å --> |
| | | <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" inline> |
| | | <el-form-item title="ç½å
³åç§°" prop="name"> |
| | | <el-input v-model="searchForm.name" placeholder="请è¾å
¥ç½å
³åç§°" @keypress.enter.native="search"></el-input> |
| | | </el-form-item> |
| | | <el-form-item title="项ç®åç§°" prop="projectId"> |
| | | <el-select v-model="searchForm.projectId" placeholder="è¯·éæ©é¡¹ç®åç§°"> |
| | | <el-option |
| | | v-for="item in projectList" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <section> |
| | | <el-button type="primary" @click="search">æç´¢</el-button> |
| | | <el-button @click="reset">éç½®</el-button> |
| | | </section> |
| | | </el-form> |
| | | <!-- è¡¨æ ¼åå页 --> |
| | | <template v-slot:table-wrap> |
| | | <ul class="toolbar" v-permissions="['business:device:create', 'business:device:delete']"> |
| | | <li><el-button type="primary" @click="$refs.operaDeviceGateway.open('æ°å»ºç½å
³')" icon="el-icon-plus" v-permissions="['business:device:create']">æ·»å ç½å
³</el-button></li> |
| | | </ul> |
| | | <el-table |
| | | v-loading="isWorking.search" |
| | | :data="tableData.list" |
| | | stripe > |
| | | <el-table-column prop="name" label="ç½å
³åç§°" fixed min-width="150" align="center"></el-table-column> |
| | | <el-table-column prop="gatewayModel" label="ç½å
³åå·" min-width="100" align="center" ></el-table-column> |
| | | <el-table-column prop="gatewayCode" label="ç½å
³è®¾å¤å·" min-width="120" align="center" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="lastHeartbeatTime" label="æåå¿è·³æ¶é´" align="center" min-width="100" show-overflow-tooltip></el-table-column> |
| | | <el-table-column |
| | | label="æä½" |
| | | align="center" |
| | | min-width="280" |
| | | fixed="right" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-button type="text" @click="$refs.operaElectricityMeter.open('æ¥çç»å®çµè¡¨', row)">å·²ç»çµè¡¨</el-button> |
| | | <el-button type="text" @click="$refs.operaDeviceGateway.open('ç¼è¾ç½å
³', row)">ç¼è¾</el-button> |
| | | <el-button type="text" class="red" @click="deleteById(row)" v-permissions="['business:device:delete']">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <pagination |
| | | @size-change="handleSizeChange" |
| | | @current-change="handlePageChange" |
| | | :pagination="tableData.pagination"> |
| | | </pagination> |
| | | </template> |
| | | <!-- æ°å»º/ä¿®æ¹ --> |
| | | <DeviceGatewayWindow ref="operaDeviceGateway" @success="handlePageChange"/> |
| | | <!-- è§£ç»çµè¡¨ --> |
| | | <ElectricityMeter ref="operaElectricityMeter" @success="handlePageChange"/> |
| | | </TableLayout> |
| | | </template> |
| | | <script> |
| | | import BaseTable from '@/components/base/BaseTable' |
| | | import TableLayout from '@/layouts/TableLayout' |
| | | import Pagination from '@/components/common/Pagination' |
| | | import { getProjectList } from '@/api/project/ywProject' |
| | | import DeviceGatewayWindow from '@/components/business/DeviceGatewayWindow' |
| | | import ElectricityMeter from '@/components/business/electricityMeter' |
| | | export default { |
| | | name: 'deviceGateway', |
| | | extends: BaseTable, |
| | | components: { TableLayout, Pagination, DeviceGatewayWindow, ElectricityMeter }, |
| | | data () { |
| | | return { |
| | | // æç´¢ |
| | | searchForm: { |
| | | projectId: '', |
| | | name: '' |
| | | }, |
| | | projectList: [] |
| | | } |
| | | }, |
| | | created () { |
| | | this.config({ |
| | | module: 'ç½å
³ç®¡ç', |
| | | api: '/business/ywGateway', |
| | | 'field.id': 'id', |
| | | 'field.main': 'id' |
| | | }) |
| | | this.search() |
| | | this.getProject() |
| | | }, |
| | | methods: { |
| | | getProject() { |
| | | getProjectList({}).then(res => { |
| | | this.projectList = res || [] |
| | | }) |
| | | }, |
| | | } |
| | | } |
| | | </script> |