Merge branch 'master' of http://s16s652780.51mypc.cn:49896/r/jfpt-Vue
6 files modified
1 files added
| | |
| | | } |
| | | }) |
| | | } |
| | | export const selectTy = (hn) => { |
| | | return request({ |
| | | url: '/api/blade-system/tenant/selectTy', |
| | | method: 'post', |
| | | params: { |
| | | hn |
| | | } |
| | | }) |
| | | } |
| | | export const deletey = (hn) => { |
| | | return request({ |
| | | url: '/api/blade-system/tenant/deletey', |
| | | method: 'post', |
| | | params: { |
| | | hn |
| | | } |
| | | }) |
| | | } |
| | | export const deletes = (hn) => { |
| | | return request({ |
| | | url: '/api/blade-system/tenant/deletes', |
| | | method: 'post', |
| | | params: { |
| | | hn |
| | | } |
| | | }) |
| | | } |
| | | export const deleter = (hn) => { |
| | | return request({ |
| | | url: '/api/blade-system/tenant/deleter', |
| | | method: 'post', |
| | | params: { |
| | | hn |
| | | } |
| | | }) |
| | | } |
| | | |
| | | |
| | | export const selectTs = (hn) => { |
| | | return request({ |
| | | url: '/api/blade-system/tenant/selectTs', |
| | | method: 'post', |
| | | params: { |
| | | hn |
| | | } |
| | | }) |
| | | } |
| | | export const selectTr = (hn) => { |
| | | return request({ |
| | | url: '/api/blade-system/tenant/selectTr', |
| | | method: 'post', |
| | | params: { |
| | | hn |
| | | } |
| | | }) |
| | | } |
| | | |
| | | export const remove = (ids) => { |
| | | return request({ |
| | |
| | | data: row |
| | | }) |
| | | } |
| | | export const instery = (dj, had, ht, ctime, content,hn) => { |
| | | return request({ |
| | | url: '/api/blade-system/tenant/instery', |
| | | method: 'post', |
| | | params: { |
| | | dj, |
| | | had, |
| | | ht, |
| | | ctime, |
| | | content, |
| | | hn |
| | | } |
| | | }) |
| | | } |
| | | export const insertsr = (category, attributes, developers, had, housetype, content, hn) => { |
| | | return request({ |
| | | url: '/api/blade-system/tenant/insertsr', |
| | | method: 'post', |
| | | params: { |
| | | category, |
| | | attributes, |
| | | developers, |
| | | had, |
| | | housetype, |
| | | content, |
| | | hn |
| | | } |
| | | }) |
| | | } |
| | | export const updateInfor = (category, attributes, developers, had, housetype, content, hn) => { |
| | | return request({ |
| | | url: '/api/blade-system/tenant/updateInfor', |
| | | method: 'post', |
| | | params: { |
| | | category, |
| | | attributes, |
| | | developers, |
| | | had, |
| | | housetype, |
| | | content, |
| | | hn |
| | | } |
| | | }) |
| | | } |
| | | |
| | | export const updateInfoy = (dj, had, ht, ctime, content,hn) => { |
| | | return request({ |
| | | url: '/api/blade-system/tenant/updateInfoy', |
| | | method: 'post', |
| | | params: { |
| | | dj, |
| | | had, |
| | | ht, |
| | | ctime, |
| | | content, |
| | | hn |
| | | } |
| | | }) |
| | | } |
| | | export const insertss = (nature, had, motto, ctime, content,hn) => { |
| | | return request({ |
| | | url: '/api/blade-system/tenant/insertss', |
| | | method: 'post', |
| | | params: { |
| | | nature, |
| | | had, |
| | | motto, |
| | | ctime, |
| | | content, |
| | | hn |
| | | } |
| | | }) |
| | | } |
| | | export const updateInfos = (nature, had, motto, ctime, content,hn) => { |
| | | return request({ |
| | | url: '/api/blade-system/tenant/updateInfoy', |
| | | method: 'post', |
| | | params: { |
| | | nature, |
| | | had, |
| | | motto, |
| | | ctime, |
| | | content, |
| | | hn |
| | | } |
| | | }) |
| | | } |
| | | |
| | | export const setting = (ids, form) => { |
| | | return request({ |
| New file |
| | |
| | | <template> |
| | | <div> |
| | | <!-- 标题 --> |
| | | <div class="alarm_title"><span>预警分析</span></div> |
| | | <!-- 时间按钮 --> |
| | | <div class="timeSearchBtn"> |
| | | <el-button-group class="timeBtn"> |
| | | <el-button size="mini" @click="getData(1)">本周</el-button> |
| | | <el-button size="mini" @click="getData(2)">月初至今</el-button> |
| | | <el-button size="mini" @click="getData(3)">季度至今</el-button> |
| | | </el-button-group> |
| | | <el-date-picker class="timeSearch" size="mini" v-model="dateTime" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"> |
| | | </el-date-picker> |
| | | </div> |
| | | <!-- 监测点 --> |
| | | <div class="statisTotal"> |
| | | <avue-data-box :option="statisToTalData" class="statisTotalAvueDataBox"></avue-data-box> |
| | | </div> |
| | | <!-- 预警数量分布 --> |
| | | <div class="alarmStatis"> |
| | | <div id="alarmNumberStatis"> |
| | | </div> |
| | | <div class="alarmClassifyStatis"> |
| | | <avue-data-cardtext :option="alarmClassifyStatis"></avue-data-cardtext> |
| | | </div> |
| | | |
| | | </div> |
| | | <!-- 预警类型占比 --> |
| | | <div></div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import echarts from 'echarts' |
| | | |
| | | export default { |
| | | data(){ |
| | | return { |
| | | statisToTalData: { |
| | | span:6, |
| | | data: [] |
| | | }, |
| | | dateTime: '', |
| | | alarmClassifyStatis:{ |
| | | span:6, |
| | | data: [] |
| | | } |
| | | }; |
| | | }, |
| | | |
| | | mounted() { |
| | | this.getStatisTotalData(); |
| | | this.getAlarmNumberStatis(); |
| | | this.getAlarmClassifyStatis(); |
| | | }, |
| | | |
| | | methods: { |
| | | //警情统计总数 |
| | | getStatisTotalData(){ |
| | | var that = this; |
| | | that.statisToTalData.data = [ |
| | | { |
| | | click: function (item) { |
| | | alert(JSON.stringify(item)); |
| | | }, |
| | | title: '错误日志', |
| | | count: 12332, |
| | | icon: 'el-icon-warning', |
| | | color: '#3AA7F0', |
| | | href:'https://avuejs.com', |
| | | target:'_blank' |
| | | }, |
| | | { |
| | | click: function (item) { |
| | | alert(JSON.stringify(item)); |
| | | }, |
| | | title: '数据展示', |
| | | count: 33, |
| | | icon: 'el-icon-warning', |
| | | color: '#F34A4A', |
| | | href:'https://avuejs.com', |
| | | target:'_blank' |
| | | }, |
| | | { |
| | | click: function (item) { |
| | | alert(JSON.stringify(item)); |
| | | }, |
| | | title: '权限管理', |
| | | count: 2223, |
| | | icon: 'el-icon-setting', |
| | | color: '#8058A5', |
| | | href:'https://avuejs.com', |
| | | target:'_blank' |
| | | }, |
| | | { |
| | | click: function (item) { |
| | | alert(JSON.stringify(item)); |
| | | }, |
| | | title: '权限管理', |
| | | count: 2223, |
| | | icon: 'el-icon-setting', |
| | | color: '#29C093', |
| | | href:'https://avuejs.com', |
| | | target:'_blank' |
| | | }, |
| | | ]; |
| | | }, |
| | | |
| | | //警情类别统计总数 |
| | | getAlarmClassifyStatis(){ |
| | | var that = this; |
| | | that.alarmClassifyStatis.data = [ |
| | | { |
| | | click: function (item) { |
| | | alert(JSON.stringify(item)); |
| | | }, |
| | | title:'香菜', |
| | | color:'yellow', |
| | | href:"http://www.baidu.com", |
| | | target:'_blank', |
| | | name:'文件上传', |
| | | date:'1天前' |
| | | }, |
| | | { |
| | | click: function (item) { |
| | | alert(JSON.stringify(item)); |
| | | }, |
| | | title:'钉宫', |
| | | color:'green', |
| | | href:"http://www.baidu.com", |
| | | name:'流加载', |
| | | date:'1天前' |
| | | }, |
| | | { |
| | | click: function (item) { |
| | | alert(JSON.stringify(item)); |
| | | }, |
| | | title:'亚丝娜', |
| | | color:'#3fa1ff', |
| | | href:"http://www.baidu.com", |
| | | name:'表单', |
| | | date:'1天前' |
| | | }, |
| | | { |
| | | click: function (item) { |
| | | alert(JSON.stringify(item)); |
| | | }, |
| | | title:'狂三', |
| | | color:'red', |
| | | href:"http://www.baidu.com", |
| | | name:'文件上传', |
| | | date:'1天前' |
| | | } |
| | | ]; |
| | | }, |
| | | |
| | | //预警数量分布 |
| | | getAlarmNumberStatis(){ |
| | | let echarts = require('echarts'); |
| | | let myChart = echarts.init(document.getElementById('alarmNumberStatis')); |
| | | let option = { |
| | | color: ['#3AA7F0'], |
| | | title: { |
| | | textStyle: { |
| | | fontWeight: 'normal', |
| | | fontSize: 16, |
| | | color: '#000' |
| | | }, |
| | | left: '5%', |
| | | top: 25, |
| | | textAlign:'center', |
| | | text: '预警数量分布' |
| | | }, |
| | | tooltip : { |
| | | trigger: 'axis', |
| | | axisPointer : { |
| | | type : 'shadow' |
| | | } |
| | | }, |
| | | grid: { |
| | | left: '1%', |
| | | right: '5%', |
| | | bottom: '7%', |
| | | top: '20%', |
| | | containLabel: true |
| | | }, |
| | | xAxis : [ |
| | | { |
| | | type : 'category', |
| | | data : ['1月','2月','3月','4月','5月','6月','7月','8月','9月','10月','11月','12月',], |
| | | axisTick: { |
| | | alignWithLabel: true |
| | | } |
| | | } |
| | | ], |
| | | yAxis : [ |
| | | { |
| | | type : 'value' |
| | | } |
| | | ], |
| | | series : [ |
| | | { |
| | | name:'每月花费', |
| | | type:'bar', |
| | | barWidth: '60%', |
| | | data:[995,666,444,858,654,236,645,546,846,225,547,356] |
| | | } |
| | | ] |
| | | }; |
| | | myChart.setOption(option); |
| | | |
| | | //建议加上以下这一行代码,不加的效果图如下(当浏览器窗口缩小的时候)。超过了div的界限(红色边框) |
| | | window.addEventListener('resize',function() {myChart.resize()}); |
| | | }, |
| | | |
| | | //点击按钮获取不同时间段的数据 |
| | | getData(data){ |
| | | var that = this; |
| | | var today = new Date(); |
| | | var startTime =''; |
| | | var endTime = ''; |
| | | //本周的时间 |
| | | if(data==1){ |
| | | startTime = this.showWeekFirstDay(today); |
| | | endTime = this.showToDay(today); |
| | | that.dateTime = [startTime,endTime]; |
| | | } |
| | | //月初至今的时间 |
| | | if(data==2){ |
| | | startTime = this.showMonthFirstDay(today); |
| | | endTime = this.showToDay(today); |
| | | that.dateTime = [startTime,endTime]; |
| | | } |
| | | //本季度初至今的时间 |
| | | if(data==3){ |
| | | startTime = this.getQuarterStartDate(today); |
| | | endTime = this.showToDay(today); |
| | | that.dateTime = [startTime,endTime]; |
| | | } |
| | | }, |
| | | |
| | | //本日 |
| | | showToDay(Nowdate){ |
| | | var M=Number(Nowdate.getMonth())+1; |
| | | console.log(Nowdate.getFullYear,111); |
| | | return Nowdate.getFullYear()+"-"+M+"-"+Nowdate.getDate(); |
| | | }, |
| | | |
| | | //本周第一天 |
| | | showWeekFirstDay(Nowdate){ |
| | | var WeekFirstDay=new Date(Nowdate-(Nowdate.getDay()-1)*86400000); |
| | | var M=Number(WeekFirstDay.getMonth())+1; |
| | | return WeekFirstDay.getFullYear()+"-"+M+"-"+WeekFirstDay.getDate(); |
| | | }, |
| | | |
| | | //本月第一天 |
| | | showMonthFirstDay(Nowdate){ |
| | | var MonthFirstDay=new Date(Nowdate.getFullYear(),Nowdate.getMonth(),1); |
| | | var M=Number(MonthFirstDay.getMonth())+1 |
| | | return MonthFirstDay.getFullYear()+"-"+M+"-"+MonthFirstDay.getDate(); |
| | | }, |
| | | |
| | | //本季度的第一天 |
| | | getQuarterStartDate(Nowdate){ |
| | | var quarterStartDate = this.getQuarterStartMonth(Nowdate); |
| | | return Nowdate.getFullYear()+"-"+quarterStartDate+"-"+"01"; |
| | | }, |
| | | |
| | | |
| | | //本季度的第一个月份 |
| | | getQuarterStartMonth(Nowdate){ |
| | | var nowMonth = Nowdate.getMonth()+1; |
| | | console.log(nowMonth,555); |
| | | var quarterStartMonth = 0; |
| | | if(nowMonth<4){ |
| | | quarterStartMonth = "0"+1; |
| | | } |
| | | if(3<nowMonth && nowMonth<7){ |
| | | quarterStartMonth = "0"+4; |
| | | } |
| | | if(6<nowMonth && nowMonth<10){ |
| | | quarterStartMonth = "0"+7; |
| | | } |
| | | if(nowMonth>9){ |
| | | quarterStartMonth = 10; |
| | | } |
| | | return quarterStartMonth; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | }, |
| | | |
| | | } |
| | | |
| | | |
| | | </script> |
| | | <style lang="scss"> |
| | | .alarm_title{ |
| | | width: 100%; |
| | | height: 3%; |
| | | } |
| | | |
| | | .alarm_title span{ |
| | | font-size: 12px; |
| | | color: #7B91B4; |
| | | left: 1%; |
| | | position: relative; |
| | | } |
| | | |
| | | .timeSearchBtn{ |
| | | width: 100%; |
| | | height: 4%; |
| | | } |
| | | |
| | | .timeSearchBtn .timeBtn{ |
| | | position: relative; |
| | | left: 0.8%; |
| | | top: 15%; |
| | | } |
| | | |
| | | .timeSearchBtn .timeSearch{ |
| | | position: relative; |
| | | left: 1.2%; |
| | | top: 15.6%; |
| | | } |
| | | |
| | | .statisTotal{ |
| | | position: relative; |
| | | left: 0.3%; |
| | | top: 2%; |
| | | width: 100%; |
| | | height: 10%; |
| | | } |
| | | |
| | | /* .statisTotal statisTotalAvueDataBox{ |
| | | position: relative !important; |
| | | top: 22% !important; |
| | | left: 1% !important; |
| | | } */ |
| | | |
| | | .statisTotalAvueDataBox .el-row { |
| | | width: 99.7% !important; |
| | | } |
| | | |
| | | .alarmStatis{ |
| | | background-color: #ffffff; |
| | | width: 98.6%; |
| | | height: 550px; |
| | | position: relative; |
| | | left: 0.8%; |
| | | top: 6%; |
| | | } |
| | | |
| | | #alarmNumberStatis{ |
| | | width: 75%; |
| | | height: 550px; |
| | | position: relative; |
| | | left: 2%; |
| | | } |
| | | |
| | | .alarmClassifyStatis{ |
| | | width: 25%; |
| | | height: 550px; |
| | | position: relative; |
| | | left: 75%; |
| | | top: -85%; |
| | | } |
| | | |
| | | .alarmClassifyStatis .avue-data-cardtext{ |
| | | width: 100%; |
| | | height: 90%; |
| | | } |
| | | |
| | | .avue-data-cardText .item{ |
| | | -webkit-box-shadow: 0px 0px 0px 0px #ccc; |
| | | box-shadow: 0px 0px 0px #ccc; |
| | | } |
| | | |
| | | .avue-data-cardtext .el-row{ |
| | | width: 250px !important; |
| | | height: 50px !important; |
| | | position: relative !important; |
| | | top: 30px !important; |
| | | } |
| | | |
| | | .alarmClassifyStatis .el-col{ |
| | | float: inherit !important; |
| | | width: 100% !important; |
| | | height: 100px !important; |
| | | } |
| | | |
| | | .avue-data-cardText .item-header a{ |
| | | font-size: 14px; |
| | | margin-left: 2px; |
| | | position:absolute; |
| | | bottom: 1px; |
| | | } |
| | | |
| | | .avue-data-cardText .item-header i{ |
| | | font-size: 14px; |
| | | } |
| | | </style> |
| | |
| | | label: "体温状态", |
| | | search: true, |
| | | searchLabelWidth: 120, |
| | | searchValue: this.getAnimalType(), |
| | | prop: "status", |
| | | searchSpan: 5, |
| | | width:110, |
| | |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | }, |
| | | //体温状态回填 |
| | | getAnimalType(){ |
| | | if (this.$route.query.status != undefined) { |
| | | return this.$route.query.status |
| | | } |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | const { dateTime } = this.query; |
| | | let values = { |
| | |
| | | v-model="form" |
| | | ref="crud" |
| | | :row-style="rowStyle" |
| | | :search.sync="search" |
| | | @row-update="rowUpdate" |
| | | @row-save="rowSave" |
| | | @row-del="rowDel" |
| | |
| | | return { |
| | | form: {}, |
| | | query: {}, |
| | | search:{}, |
| | | loading: true, |
| | | page: { |
| | | pageSize: 10, |
| | |
| | | { |
| | | label: "健康码颜色", |
| | | search: true, |
| | | searchLabelWidth:100, |
| | | searchLabelWidth:120, |
| | | prop: "type", |
| | | searchSpan: 3, |
| | | searchSpan: 4, |
| | | searchValue: this.getHealthcodeType(), |
| | | width:210, |
| | | type: "select", |
| | | dicData: [ |
| | |
| | | isActive: false, |
| | | recorder: null, |
| | | }; |
| | | }, |
| | | mounted:{ |
| | | |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["permission"]), |
| | |
| | | } |
| | | } |
| | | }, |
| | | getHealthcodeType(){ |
| | | if (this.$route.query.type != undefined) { |
| | | var type = this.$route.query.type+""; |
| | | this.$route.query = {}; |
| | | return type; |
| | | } |
| | | }, |
| | | getHealthcodeData(e) { |
| | | this.activeClass = e; |
| | | var that = this; |
| | | that.activeClass = e; |
| | | //status 0:本日 1:本月 2:本年 type: 1:绿色 2:黄色 3:红色 |
| | | var params = { |
| | | status: e |
| | |
| | | status:this.$route.query.status, |
| | | type:this.$route.query.type |
| | | } |
| | | |
| | | } |
| | | |
| | | if (dateTime) { |
| | |
| | | background-color: rgb(64, 158, 255); |
| | | border-color: rgb(64, 158, 255); |
| | | } |
| | | </style> |
| | | </style> |
| | |
| | | @row-update="rowUpdate" |
| | | @row-save="rowSave" |
| | | @row-del="rowDel" |
| | | @row-click="rowClick" |
| | | @search-change="searchChange" |
| | | @search-reset="searchReset" |
| | | @selection-change="selectionChange" |
| | |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad"> |
| | | |
| | | <template slot-scope="{ type, size, row }" slot="menu"> |
| | | <!-- <template slot-scope="{ type, size, row }" slot="menu"> |
| | | |
| | | <el-button |
| | | v-if="row.imgUrl != null || row.imgUrl != ''" |
| | |
| | | @click.stop="handleParcelPic(row)" |
| | | >查看包裹图片 |
| | | </el-button> |
| | | </template> |
| | | </template> --> |
| | | |
| | | </avue-crud> |
| | | <template> |
| | |
| | | }, |
| | | selectionList: [], |
| | | option: { |
| | | menu:false, |
| | | height:'auto', |
| | | calcHeight: 30, |
| | | tip: false, |
| | |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | }, |
| | | rowClick(row){ |
| | | var that=this; |
| | | getParcelPic(row.imgUrl).then(res => { |
| | | that.imgUrl = res.data.data.imgBase64; |
| | | this.showViewer = true |
| | | }); |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | }, |
| | |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | }, |
| | | handleParcelPic(row) { |
| | | var that=this; |
| | | getParcelPic(row.imgUrl).then(res => { |
| | | that.imgUrl = res.data.data.imgBase64; |
| | | //that.$refs.preview.clickHandler(); |
| | | this.showViewer = true |
| | | }); |
| | | }, |
| | | // 关闭查看器 |
| | | closeViewer() { |
| | |
| | | @row-update="rowUpdate" |
| | | @row-save="rowSave" |
| | | @row-del="rowDel" |
| | | @row-click="rowClick" |
| | | @search-change="searchChange" |
| | | @search-reset="searchReset" |
| | | @selection-change="selectionChange" |
| | |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad"> |
| | | <template slot-scope="{ type, size, row }" slot="menu"> |
| | | <!-- <template slot-scope="{ type, size, row }" slot="menu"> |
| | | <el-button |
| | | v-if="row.imgUrl != null || row.imgUrl != ''" |
| | | icon="el-icon-view" |
| | |
| | | @click.stop="handleParcelPic(row)" |
| | | >查看包裹图片 |
| | | </el-button> |
| | | </template> |
| | | </template> --> |
| | | </avue-crud> |
| | | <template> |
| | | <div> |
| | | <!-- style="display:none" --> |
| | | <!-- <el-image |
| | | ref="preview" |
| | | :src="'data:image/png;base64,'+imgUrl" |
| | | :preview-src-list="['data:image/png;base64,'+imgUrl]" |
| | | z-index=9999></el-image> --> |
| | | <el-image-viewer |
| | | class="img" |
| | | v-if="showViewer" |
| | |
| | | }, |
| | | selectionList: [], |
| | | option: { |
| | | menu:false, |
| | | height:'auto', |
| | | calcHeight: 30, |
| | | tip: false, |
| | |
| | | this.selectionList = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | }, |
| | | rowClick(row){ |
| | | var that=this; |
| | | getParcelPic(row.imgUrl).then(res => { |
| | | that.imgUrl = res.data.data.imgBase64; |
| | | this.showViewer = true |
| | | }); |
| | | }, |
| | | currentChange(currentPage){ |
| | | this.page.currentPage = currentPage; |
| | | }, |
| | |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | }, |
| | | handleParcelPic(row) { |
| | | var that = this; |
| | | getParcelPic(row.imgUrl).then(res => { |
| | | that.imgUrl = res.data.data.imgBase64; |
| | | //that.$refs.preview.clickHandler(); |
| | | this.showViewer = true |
| | | }); |
| | | }, |
| | | // 关闭查看器 |
| | | closeViewer() { |
| | |
| | | plain |
| | | @click="handleDelete">删 除 |
| | | </el-button> |
| | | <el-button size="small" |
| | | plain |
| | | v-if="userInfo.role_name.includes('administrator')" |
| | | icon="el-icon-setting" |
| | | @click="handleSetting">授权配置 |
| | | </el-button> |
| | | <el-button size="small" |
| | | plain |
| | | v-if="userInfo.role_name.includes('administrator')" |
| | | icon="el-icon-coin" |
| | | @click="handleDatasource">数据源配置 |
| | | </el-button> |
| | | <!-- <el-button size="small"--> |
| | | <!-- plain--> |
| | | <!-- v-if="userInfo.role_name.includes('administrator')"--> |
| | | <!-- icon="el-icon-setting"--> |
| | | <!-- @click="handleSetting">授权配置--> |
| | | <!-- </el-button>--> |
| | | <!-- <el-button size="small"--> |
| | | <!-- plain--> |
| | | <!-- v-if="userInfo.role_name.includes('administrator')"--> |
| | | <!-- icon="el-icon-coin"--> |
| | | <!-- @click="handleDatasource">数据源配置--> |
| | | <!-- </el-button>--> |
| | | </template> |
| | | <template slot-scope="{row}" |
| | | slot="accountNumber"> |
| | |
| | | slot="expireTime"> |
| | | <el-tag>{{ row.expireTime ? row.expireTime : '不限制' }}</el-tag> |
| | | </template> |
| | | <template slot-scope="{ row }" slot="jfzt"> |
| | | <i class="el-icon-check client-jf" v-if="row.type == '0'"></i> |
| | | <i class="el-icon-close client-qf" v-else-if="row.type == '1'"></i> |
| | | <template slot-scope="{row}" slot="type"> |
| | | <el-tag>{{row.type==='0'?'医院':row.type==='1'?'学校':row.type==='2'?'小区':'未知'}}</el-tag> |
| | | </template> |
| | | </avue-crud> |
| | | <el-dialog title="租户授权配置" |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import {getList, getDetail, remove, update, add, setting, datasource} from "@/api/system/tenant"; |
| | | import {getList, getDetail, remove, update, add, setting, datasource,instery,updateInfoy,selectTy,insertss,updateInfos,selectTs,insertsr,updateInfor,selectTr,deletey,deletes,deleter} from "@/api/system/tenant"; |
| | | import {mapGetters} from "vuex"; |
| | | import AvueMap from 'avue-plugin-map' |
| | | import website from "@/config/website"; |
| | | |
| | | import {getRoleTree} from "@/api/system/role"; |
| | | import AvueMap from 'avue-plugin-map' |
| | | var that; |
| | | export default { |
| | | |
| | | data() { |
| | | that = this; |
| | | return { |
| | | form: {}, |
| | | selectionList: [], |
| | |
| | | }] |
| | | }, |
| | | { |
| | | label: "用户名称", |
| | | label: "客户名称", |
| | | prop: "tenantName", |
| | | search: true, |
| | | width: 190, |
| | | span: 24, |
| | | span: 12, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入参数名称", |
| | |
| | | width: 150, |
| | | }, |
| | | { |
| | | label: "省份", |
| | | prop: "province", |
| | | search: true, |
| | | searchSpan: 3, |
| | | searchLabelWidth: 45, |
| | | placeholder: "省份", |
| | | type: "select", |
| | | props: { |
| | | label: "name", |
| | | value: "code" |
| | | }, |
| | | cascaderItem: ["city", "district"], |
| | | dicUrl: "/api/blade-system/region/select", |
| | | span: 6, |
| | | className: "cityClass1" |
| | | }, |
| | | { |
| | | label: "地市", |
| | | prop: "city", |
| | | type: "select", |
| | | searchPlaceholder: "地市", |
| | | placeholder: "地市", |
| | | searchLabelWidth: 1, |
| | | searchSpan: 2, |
| | | search: true, |
| | | props: { |
| | | label: "name", |
| | | value: "code" |
| | | }, |
| | | dicUrl: "/api/blade-system/region/select?code={{key}}", |
| | | span: 3, |
| | | labelWidth: "0", |
| | | className: "cityClass2" |
| | | }, |
| | | { |
| | | label: "区县", |
| | | searchSpan: 2, |
| | | searchLabelWidth: 1, |
| | | searchPlaceholder: "区县", |
| | | placeholder: "区县", |
| | | search: true, |
| | | prop: "district", |
| | | type: "select", |
| | | props: { |
| | | label: "name", |
| | | value: "code" |
| | | }, |
| | | dicUrl: "/api/blade-system/region/select?code={{key}}", |
| | | span: 3, |
| | | labelWidth: "0", |
| | | className: "cityClass3" |
| | | }, |
| | | { |
| | | label: '坐标', |
| | | prop: 'map', |
| | | hide: true, |
| | | span: 24, |
| | | component: "AvueMap", |
| | | }, |
| | | { |
| | | label: '经度', |
| | | hide: true, |
| | | addDisplay: false, |
| | | prop: 'jd', |
| | | }, |
| | | { |
| | | label: '纬度', |
| | | hide: true, |
| | | addDisplay: false, |
| | | prop: 'wd', |
| | | }, |
| | | { |
| | | label: "账号额度", |
| | | prop: "accountNumber", |
| | | width: 90, |
| | | slot: true, |
| | | hide: true, |
| | | addDisplay: false, |
| | | editDisplay: false, |
| | | }, |
| | |
| | | prop: "expireTime", |
| | | width: 180, |
| | | slot: true, |
| | | hide: true, |
| | | addDisplay: false, |
| | | editDisplay: false, |
| | | }, |
| | | { |
| | | label: "类型", |
| | | prop: "type", |
| | | width: 80, |
| | | type: "select", |
| | | rules: [{ |
| | | required: true, |
| | | message: "请选择类型", |
| | | trigger: "blur" |
| | | }], |
| | | dicData: [ |
| | | { |
| | | label: "医院", |
| | | value: "0" |
| | | }, |
| | | { |
| | | label: "学校", |
| | | value: "1" |
| | | }, |
| | | { |
| | | label: "小区", |
| | | value: "2" |
| | | } |
| | | ], |
| | | change: function (value,column) { |
| | | if (value.value == "0") { |
| | | that.option.group = [ |
| | | { |
| | | label: '详细信息', |
| | | prop: 'detailInfo', |
| | | icon: 'el-icon-s-order', |
| | | column: [ |
| | | { |
| | | label: "医院等级", |
| | | prop: "dj", |
| | | hide: true, |
| | | dicData: [], |
| | | props: { |
| | | label: "title", |
| | | value:"" |
| | | }, |
| | | checkStrictly: true, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入医院等级", |
| | | trigger: "blur" |
| | | }] |
| | | }, |
| | | { |
| | | label: "医院类别", |
| | | prop: "ht", |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入医院类别", |
| | | trigger: "blur" |
| | | }] |
| | | }, |
| | | { |
| | | label: "成立时间", |
| | | type: "datetime", |
| | | prop: "ctime", |
| | | format: "yyyy-MM-dd", |
| | | valueFormat: "yyyy-MM-dd", |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入成立时间", |
| | | trigger: "blur" |
| | | }] |
| | | }, |
| | | { |
| | | label: "地址", |
| | | prop:"had", |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入地址", |
| | | trigger: "blur" |
| | | }] |
| | | }, |
| | | { |
| | | label: "介绍", |
| | | prop: "content", |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入介绍", |
| | | trigger: "blur" |
| | | }], |
| | | span:24, |
| | | } |
| | | ] |
| | | } |
| | | ] |
| | | } |
| | | else if (value.value=="1"){ |
| | | that.option.group = [ |
| | | { |
| | | label: '详细信息', |
| | | prop: 'dutyInfo', |
| | | icon: 'el-icon-s-custom', |
| | | column: [ |
| | | { |
| | | label: "学校性质", |
| | | prop: "nature", |
| | | hide: true, |
| | | dicData: [], |
| | | props: { |
| | | label: "title", |
| | | value:"" |
| | | }, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入学校性质", |
| | | trigger: "blur" |
| | | }] |
| | | }, |
| | | { |
| | | label: "校训", |
| | | prop: "motto", |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入校训", |
| | | trigger: "blur" |
| | | }] |
| | | }, |
| | | { |
| | | label: "创办时间", |
| | | type: "datetime", |
| | | prop: "ctime", |
| | | format: "yyyy-MM-dd", |
| | | valueFormat: "yyyy-MM-dd", |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入创办时间" |
| | | }] |
| | | }, |
| | | { |
| | | label: "地址", |
| | | prop:"had", |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入地址" |
| | | }] |
| | | }, |
| | | { |
| | | label: "介绍", |
| | | prop: "content", |
| | | span:24, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入介绍" |
| | | }] |
| | | } |
| | | ] |
| | | } |
| | | ] |
| | | } |
| | | else if (value.value=="2") { |
| | | that.option.group = [ |
| | | { |
| | | label: '详细信息', |
| | | prop: 'baseInfo', |
| | | icon: 'el-icon-s-solid', |
| | | column: [ |
| | | { |
| | | label: "小区类别", |
| | | prop: "category", |
| | | hide: true, |
| | | dicData: [], |
| | | props: { |
| | | label: "title", |
| | | value:"" |
| | | }, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入小区类别" |
| | | }] |
| | | }, |
| | | { |
| | | label: "小区属性", |
| | | prop: "attributes", |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入小区属性" |
| | | }] |
| | | }, |
| | | { |
| | | label: "开发商", |
| | | prop:"developers", |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入开发商" |
| | | }] |
| | | }, |
| | | { |
| | | label: "地址", |
| | | prop:"had", |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入地址" |
| | | }] |
| | | }, |
| | | { |
| | | label: "户型", |
| | | prop:"housetype", |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入户型" |
| | | }] |
| | | }, |
| | | { |
| | | label: "介绍", |
| | | prop: "content", |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入介绍" |
| | | }], |
| | | span:24, |
| | | } |
| | | ] |
| | | } |
| | | ] |
| | | } |
| | | else { |
| | | that.option.group =[] |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | label: "绑定域名", |
| | | prop: "domain", |
| | | span: 24, |
| | | hide: true, |
| | | }, |
| | | { |
| | | label: "系统背景", |
| | |
| | | }, |
| | | ], |
| | | group: [ |
| | | { |
| | | label: '基础信息', |
| | | prop: 'baseInfo', |
| | | icon: 'el-icon-user-solid', |
| | | column: [ |
| | | ] |
| | | }, |
| | | { |
| | | label: '详细信息', |
| | | prop: 'detailInfo', |
| | | icon: 'el-icon-s-order', |
| | | column: [ |
| | | { |
| | | label: "用户昵称", |
| | | prop: "name", |
| | | hide: true, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入用户昵称", |
| | | trigger: "blur" |
| | | }] |
| | | }, |
| | | { |
| | | label: "用户姓名", |
| | | prop: "realName", |
| | | rules: [{ |
| | | required: true, |
| | | message: "请输入用户姓名", |
| | | trigger: "blur" |
| | | }, { |
| | | min: 2, |
| | | max: 5, |
| | | message: '姓名长度在2到5个字符' |
| | | }] |
| | | }, |
| | | { |
| | | label: "手机号码", |
| | | prop: "phone", |
| | | overHidden: true |
| | | }, |
| | | { |
| | | label: "电子邮箱", |
| | | prop: "email", |
| | | hide: true, |
| | | overHidden: true |
| | | }, |
| | | { |
| | | label: "用户性别", |
| | | prop: "sex", |
| | | type: "select", |
| | | dicData: [ |
| | | { |
| | | label: "男", |
| | | value: 1 |
| | | }, |
| | | { |
| | | label: "女", |
| | | value: 2 |
| | | }, |
| | | { |
| | | label: "未知", |
| | | value: 3 |
| | | } |
| | | ], |
| | | hide: true |
| | | }, |
| | | { |
| | | label: "用户生日", |
| | | type: "date", |
| | | prop: "birthday", |
| | | format: "yyyy-MM-dd hh:mm:ss", |
| | | valueFormat: "yyyy-MM-dd hh:mm:ss", |
| | | hide: true |
| | | }, |
| | | { |
| | | label: "账号状态", |
| | | prop: "statusName", |
| | | hide: true, |
| | | display: false |
| | | } |
| | | ] |
| | | }, |
| | | ] |
| | | }, |
| | | data: [], |
| | |
| | | } |
| | | }; |
| | | }, |
| | | watch:{ |
| | | 'form.map':{// form是表单或者表格绑定的数据集,v-model='form' |
| | | handler(val){ |
| | | this.form.jd = val.latitude |
| | | this.form.wd = val.longitude |
| | | }, |
| | | immediate: true |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["userInfo", "permission"]), |
| | | permissionList() { |
| | |
| | | methods: { |
| | | rowSave(row, done, loading) { |
| | | add(row).then(() => { |
| | | if (row.type=="0"){ |
| | | instery(row.dj,row.had,row.ht,row.ctime,row.content,row.tenantName); |
| | | } |
| | | else if (row.type=="1"){ |
| | | insertss(row.nature,row.had,row.motto,row.ctime,row.content,row.tenantName); |
| | | } |
| | | else if (row.type=="2") { |
| | | insertsr(row.category, row.attributes, row.developers,row.had, row.housetype, row.content, row.hn) |
| | | } |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | |
| | | }); |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | if (row.type=="0"){ |
| | | updateInfoy(row.dj,row.had,row.ht,row.ctime,row.content,row.tenantName); |
| | | } |
| | | else if (row.type=="1"){ |
| | | updateInfos(row.nature,row.had,row.motto,row.ctime,row.content,row.tenantName); |
| | | } |
| | | else if (row.type=="2"){ |
| | | updateInfor(row.category, row.attributes, row.developers,row.had, row.housetype, row.content, row.tenantName) |
| | | } |
| | | update(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | if (row.type=="0"){ |
| | | deletey(row.tenantName) |
| | | } |
| | | else if (row.type=="1"){ |
| | | deletes(row.tenantName) |
| | | } |
| | | else if (row.type=="2"){ |
| | | deleter(row.tenantName) |
| | | } |
| | | return remove(row.id); |
| | | }) |
| | | .then(() => { |
| | |
| | | }); |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["view"].includes(type)) { |
| | | if (["edit"].includes(type)) { |
| | | getDetail(this.form.id).then(res => { |
| | | const data = res.data.data; |
| | | if (!(data.accountNumber > 0)) { |
| | | data.accountNumber = "不限制"; |
| | | if (this.form.type=="1"){ |
| | | const data = res.data.data; |
| | | selectTs(this.form.tenantName).then( re=>{ |
| | | const data = res.data.data; |
| | | data.nature=re.data.data[0].nature |
| | | data.motto=re.data.data[0].motto |
| | | data.ctime=re.data.data[0].ctime |
| | | data.had=re.data.data[0].had |
| | | data.content=re.data.data[0].content |
| | | this.form = data; |
| | | }) |
| | | } |
| | | if (!data.expireTime) { |
| | | data.expireTime = "不限制"; |
| | | else if (this.form.type=="0"){ |
| | | selectTy(this.form.tenantName).then( re=>{ |
| | | const data = res.data.data; |
| | | data.dj=re.data.data[0].dj |
| | | data.ht=re.data.data[0].ht |
| | | data.ctime=re.data.data[0].ctime |
| | | data.had=re.data.data[0].had |
| | | data.content=re.data.data[0].content |
| | | this.form = data; |
| | | }) |
| | | } |
| | | this.form = data; |
| | | else if (this.form.type=="2"){ |
| | | selectTr(this.form.tenantName).then( re=>{ |
| | | const data = res.data.data; |
| | | data.category=re.data.data[0].category |
| | | data.attributes=re.data.data[0].attributes |
| | | data.developers=re.data.data[0].developers |
| | | data.had=re.data.data[0].had |
| | | data.housetype=re.data.data[0].housetype |
| | | data.content=re.data.data[0].content |
| | | this.form = data; |
| | | }) |
| | | } |
| | | |
| | | }); |
| | | } |
| | | else if (["view"].includes(type)){ |
| | | getDetail(this.form.id).then(res => { |
| | | if (this.form.type=="1") { |
| | | selectTs(this.form.tenantName).then( re=>{ |
| | | const data = res.data.data; |
| | | data.nature=re.data.data[0].nature |
| | | data.motto=re.data.data[0].motto |
| | | data.ctime=re.data.data[0].ctime |
| | | data.had=re.data.data[0].had |
| | | data.content=re.data.data[0].content |
| | | if (!(data.accountNumber > 0)) { |
| | | data.accountNumber = "不限制"; |
| | | } |
| | | if (!data.expireTime) { |
| | | data.expireTime = "不限制"; |
| | | } |
| | | this.form = data; |
| | | }) |
| | | } |
| | | else if (this.form.type=="0"){ |
| | | selectTy(this.form.tenantName).then( re=>{ |
| | | const data = res.data.data; |
| | | data.dj=re.data.data[0].dj |
| | | data.ht=re.data.data[0].ht |
| | | data.ctime=re.data.data[0].ctime |
| | | data.had=re.data.data[0].had |
| | | data.content=re.data.data[0].content |
| | | if (!(data.accountNumber > 0)) { |
| | | data.accountNumber = "不限制"; |
| | | } |
| | | if (!data.expireTime) { |
| | | data.expireTime = "不限制"; |
| | | } |
| | | this.form = data; |
| | | }) |
| | | } |
| | | else if (this.form.type=="2"){ |
| | | selectTr(this.form.tenantName).then( re=>{ |
| | | const data = res.data.data; |
| | | data.category=re.data.data[0].category |
| | | data.attributes=re.data.data[0].attributes |
| | | data.developers=re.data.data[0].developers |
| | | data.had=re.data.data[0].had |
| | | data.housetype=re.data.data[0].housetype |
| | | data.content=re.data.data[0].content |
| | | if (!(data.accountNumber > 0)) { |
| | | data.accountNumber = "不限制"; |
| | | } |
| | | if (!data.expireTime) { |
| | | data.expireTime = "不限制"; |
| | | } |
| | | this.form = data; |
| | | }) |
| | | } |
| | | }); |
| | | } |
| | | done(); |