增加限位时间+ 大棚相关api接入+登录密码展示
parent
e720c37b68
commit
610814d178
|
|
@ -0,0 +1,44 @@
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询大棚管理列表
|
||||||
|
export function listAgri(query) {
|
||||||
|
return request({
|
||||||
|
url: '/assets/agri/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询大棚管理详细
|
||||||
|
export function getAgri(id) {
|
||||||
|
return request({
|
||||||
|
url: '/assets/agri/' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增大棚管理
|
||||||
|
export function addAgri(data) {
|
||||||
|
return request({
|
||||||
|
url: '/assets/agri',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改大棚管理
|
||||||
|
export function updateAgri(data) {
|
||||||
|
return request({
|
||||||
|
url: '/assets/agri',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除大棚管理
|
||||||
|
export function delAgri(id) {
|
||||||
|
return request({
|
||||||
|
url: '/assets/agri/' + id,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,44 @@
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询告警方式设置列表
|
||||||
|
export function listAlarm(query) {
|
||||||
|
return request({
|
||||||
|
url: '/assets/alarm/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询告警方式设置详细
|
||||||
|
export function getAlarm(id) {
|
||||||
|
return request({
|
||||||
|
url: '/assets/alarm/' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增告警方式设置
|
||||||
|
export function addAlarm(data) {
|
||||||
|
return request({
|
||||||
|
url: '/assets/alarm',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改告警方式设置
|
||||||
|
export function updateAlarm(data) {
|
||||||
|
return request({
|
||||||
|
url: '/assets/alarm',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除告警方式设置
|
||||||
|
export function delAlarm(id) {
|
||||||
|
return request({
|
||||||
|
url: '/assets/alarm/' + id,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,52 @@
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询执行时间限位管理列表
|
||||||
|
export function listLimit(query) {
|
||||||
|
return request({
|
||||||
|
url: '/assets/limit/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询执行时间限位管理详细
|
||||||
|
export function getLimit(id) {
|
||||||
|
return request({
|
||||||
|
url: '/assets/limit/' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增执行时间限位管理
|
||||||
|
export function addLimit(data) {
|
||||||
|
return request({
|
||||||
|
url: '/assets/limit',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改执行时间限位管理
|
||||||
|
export function updateLimit(data) {
|
||||||
|
return request({
|
||||||
|
url: '/assets/limit',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除执行时间限位管理
|
||||||
|
export function delLimit(id) {
|
||||||
|
return request({
|
||||||
|
url: '/assets/limit/' + id,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 大棚运行时间限位查询
|
||||||
|
export function getAgriByImei(id) {
|
||||||
|
return request({
|
||||||
|
url: '/assets/limit/getAgriByImei/' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
2
main.js
2
main.js
|
|
@ -13,7 +13,7 @@ Vue.use(plugins)
|
||||||
Vue.config.productionTip = false
|
Vue.config.productionTip = false
|
||||||
Vue.prototype.$store = store
|
Vue.prototype.$store = store
|
||||||
Vue.prototype.getDicts = getDicts
|
Vue.prototype.getDicts = getDicts
|
||||||
|
window.wx={}
|
||||||
App.mpType = 'app'
|
App.mpType = 'app'
|
||||||
|
|
||||||
const app = new Vue({
|
const app = new Vue({
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
<view class="container">
|
<view class="container">
|
||||||
<!-- 控制设置标题 -->
|
<!-- 控制设置标题 -->
|
||||||
<view class="control-title">控制设置</view>
|
<view class="control-title">控制设置</view>
|
||||||
<uni-section title="请选择大棚:" titleFontSize="18px" type="line">
|
<uni-section title="请选择大棚:" :subTitle="imei" titleFontSize="18px" type="line">
|
||||||
<view class="uni-px-5 uni-pb-5">
|
<view class="uni-px-5 uni-pb-5">
|
||||||
<uni-data-select v-model="value" :localdata="range" @change="change"></uni-data-select>
|
<uni-data-select v-model="value" :localdata="range" @change="change"></uni-data-select>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -62,7 +62,9 @@
|
||||||
<text class="card-main">{{ card.name }}</text>
|
<text class="card-main">{{ card.name }}</text>
|
||||||
<view class="card-sub-wrapper">
|
<view class="card-sub-wrapper">
|
||||||
<text class="card-sub" v-if="showStatusText">{{ show[card.type] || '未知' }}</text>
|
<text class="card-sub" v-if="showStatusText">{{ show[card.type] || '未知' }}</text>
|
||||||
<text class="limit-time">运行时间:{{ limitTimes[card.type] || 0 }} s</text>
|
<text class="limit-time">
|
||||||
|
运行时间:{{ limitTimes[`${card.type}Limit`] && limitTimes[`${card.type}Limit`]!=='0' ? `${limitTimes[`${card.type}Limit`]} s` : '- -' }}
|
||||||
|
</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="card-icon" :class="{ active: status[card.type] === 1 }" @click.stop="handleCardClick(1 - status[card.type], card.type)">
|
<view class="card-icon" :class="{ active: status[card.type] === 1 }" @click.stop="handleCardClick(1 - status[card.type], card.type)">
|
||||||
|
|
@ -79,35 +81,22 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- 输入框示例 -->
|
|
||||||
<!-- <uni-popup ref="inputDialog" type="dialog">-->
|
|
||||||
<!-- <uni-popup-dialog ref="inputClose" mode="input" title="输入内容" value="对话框预置提示内容!"-->
|
|
||||||
<!-- placeholder="请输入内容" @confirm="confirmModifyTime"></uni-popup-dialog>-->
|
|
||||||
<!-- </uni-popup>-->
|
|
||||||
<uni-popup v-model="timeModalVisible" ref="inputDialog" mode="center" :z-index="99999">
|
|
||||||
|
|
||||||
|
<uni-popup ref="inputDialog" mode="center" >
|
||||||
<!-- 新增:修改运行时间的弹窗 -->
|
<!-- 新增:修改运行时间的弹窗 -->
|
||||||
<!-- <uni-popup v-model="timeModalVisible" mode="center">-->
|
|
||||||
<view class="modal-container">
|
<view class="modal-container">
|
||||||
<view class="modal-title">修改{{ currentCard.name }}运行时间</view>
|
<view class="modal-title">{{ `【${selectedText} - ${currentCard.name}】运行时间` }}</view>
|
||||||
<view class="modal-input-wrap">
|
<view class="modal-input-wrap">
|
||||||
<text class="modal-label">当前时间:</text>
|
<text class="modal-label">当前时间:</text>
|
||||||
<text class="modal-current">{{ currentCardTime }} s</text>
|
<text class="modal-current">{{ currentCardTime ? `${currentCardTime} 秒` : '未设置' }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="modal-input-wrap" >
|
<view class="modal-input-wrap" >
|
||||||
<text class="modal-label">新时间:</text>
|
<text class="modal-label">修改后时间:</text>
|
||||||
<input
|
<uni-number-box v-model="newLimitTime" />
|
||||||
class="modal-input"
|
<text class="modal-unit">秒</text>
|
||||||
type="number"
|
|
||||||
v-model.number="newTime"
|
|
||||||
placeholder="请输入1-60的数字"
|
|
||||||
min="1"
|
|
||||||
max="60"
|
|
||||||
/>
|
|
||||||
<text class="modal-unit">s</text>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="modal-btn-wrap">
|
<view class="modal-btn-wrap">
|
||||||
<button class="modal-btn cancel" @click="">取消</button>
|
<button class="modal-btn cancel" @click="close">取消</button>
|
||||||
<button class="modal-btn confirm" @click="confirmModifyTime">确定</button>
|
<button class="modal-btn confirm" @click="confirmModifyTime">确定</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -117,6 +106,8 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// 优化:抽离魔法值常量
|
// 优化:抽离魔法值常量
|
||||||
|
import UniPopupDialog from "../../uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue";
|
||||||
|
|
||||||
const SENSOR_MAP = {
|
const SENSOR_MAP = {
|
||||||
temp1: "201", temp2: "202", temp3: "203", temp4: "204",
|
temp1: "201", temp2: "202", temp3: "203", temp4: "204",
|
||||||
humi1: "101", humi2: "102", humi3: "103", humi4: "104"
|
humi1: "101", humi2: "102", humi3: "103", humi4: "104"
|
||||||
|
|
@ -127,10 +118,15 @@ import UniDatetimePicker from "../../uni_modules/uni-datetime-picker/components/
|
||||||
import UniPopup from "../../uni_modules/uni-popup/components/uni-popup/uni-popup.vue"; // 引入弹窗组件
|
import UniPopup from "../../uni_modules/uni-popup/components/uni-popup/uni-popup.vue"; // 引入弹窗组件
|
||||||
import { findDtuDataByInfo } from "@/api/system/data";
|
import { findDtuDataByInfo } from "@/api/system/data";
|
||||||
import mqttUtil from '@/utils/mqtt';
|
import mqttUtil from '@/utils/mqtt';
|
||||||
|
import UniNumberBox from "../../uni_modules/uni-number-box/components/uni-number-box/uni-number-box.vue";
|
||||||
|
import {addLimit, getAgriByImei, updateLimit} from "../../api/system/assets/limit";
|
||||||
|
import {listAgri} from "../../api/system/assets/agri";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
dicts: ['sys_data_map'],
|
dicts: ['sys_data_map'],
|
||||||
components: {
|
components: {
|
||||||
|
UniNumberBox,
|
||||||
|
UniPopupDialog,
|
||||||
UniDatetimePicker,
|
UniDatetimePicker,
|
||||||
UniPopup // 注册弹窗组件
|
UniPopup // 注册弹窗组件
|
||||||
},
|
},
|
||||||
|
|
@ -141,22 +137,12 @@ export default {
|
||||||
subscribeTopic:'/up',
|
subscribeTopic:'/up',
|
||||||
},
|
},
|
||||||
value: 1,
|
value: 1,
|
||||||
|
selectedText: '',
|
||||||
// 优化:语义化变量名(替换原 hide: false)
|
// 优化:语义化变量名(替换原 hide: false)
|
||||||
showStatusText: false,
|
showStatusText: false,
|
||||||
control: '正在加载中...',
|
control: '正在加载中...',
|
||||||
range: [{
|
range: [],
|
||||||
"value": '864865085016294',
|
agriId:'',
|
||||||
"text": "十方北棚"
|
|
||||||
}, {
|
|
||||||
"value": '864536071808560',
|
|
||||||
"text": "七方北棚",
|
|
||||||
}, {
|
|
||||||
"value": '862538065276939',
|
|
||||||
"text": "七方南棚",
|
|
||||||
},{
|
|
||||||
"value": '864865085008135',
|
|
||||||
"text": "八方北棚"
|
|
||||||
}],
|
|
||||||
imei:'',
|
imei:'',
|
||||||
publishTopic: '/down',
|
publishTopic: '/down',
|
||||||
title:'',
|
title:'',
|
||||||
|
|
@ -212,14 +198,14 @@ export default {
|
||||||
},
|
},
|
||||||
// 新增:限位时间配置
|
// 新增:限位时间配置
|
||||||
limitTimes: {
|
limitTimes: {
|
||||||
jbk: 30,
|
jbkLimit: 0,
|
||||||
jbg: 25,
|
jbgLimit: 0,
|
||||||
jm1k: 30,
|
jm1kLimit: 0,
|
||||||
jm1g: 28,
|
jm1gLimit: 0,
|
||||||
jm2k: 30,
|
jm2kLimit: 0,
|
||||||
jm2g: 26,
|
jm2gLimit: 0,
|
||||||
jm3k: 30,
|
jm3kLimit: 0,
|
||||||
jm3g: 29
|
jm3gLimit: 0
|
||||||
},
|
},
|
||||||
deviceType: '',
|
deviceType: '',
|
||||||
status: {
|
status: {
|
||||||
|
|
@ -234,10 +220,9 @@ export default {
|
||||||
},
|
},
|
||||||
fontStyle: '',
|
fontStyle: '',
|
||||||
// 新增:弹窗相关变量
|
// 新增:弹窗相关变量
|
||||||
timeModalVisible: false, // 弹窗显示状态
|
|
||||||
currentCard: {}, // 当前点击的卡片信息
|
currentCard: {}, // 当前点击的卡片信息
|
||||||
currentCardTime: 0, // 当前卡片的运行时间
|
currentCardTime: 0, // 当前卡片的运行时间
|
||||||
newTime: 0 // 新的运行时间
|
newLimitTime: 0 // 新的运行时间
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
|
|
@ -257,6 +242,7 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
|
this.getAgriList();
|
||||||
// 注册MQTT消息回调(接收设备消息)
|
// 注册MQTT消息回调(接收设备消息)
|
||||||
mqttUtil.setOnMessageCallback(this.ackMessage);
|
mqttUtil.setOnMessageCallback(this.ackMessage);
|
||||||
// 更新连接状态
|
// 更新连接状态
|
||||||
|
|
@ -275,6 +261,7 @@ export default {
|
||||||
const selectedItem = this.range.find(item => item.value === e);
|
const selectedItem = this.range.find(item => item.value === e);
|
||||||
if (selectedItem) {
|
if (selectedItem) {
|
||||||
this.selectedText = selectedItem.text; // 获取展示文本
|
this.selectedText = selectedItem.text; // 获取展示文本
|
||||||
|
this.agriId = selectedItem.agriId;
|
||||||
this.title= this.selectedText;
|
this.title= this.selectedText;
|
||||||
var queryParams = {
|
var queryParams = {
|
||||||
imei: this.imei
|
imei: this.imei
|
||||||
|
|
@ -286,15 +273,38 @@ export default {
|
||||||
this.temp = "最后更新时间:"+response.data.time;
|
this.temp = "最后更新时间:"+response.data.time;
|
||||||
this.fontStyle = 'font-size:16px;'
|
this.fontStyle = 'font-size:16px;'
|
||||||
})
|
})
|
||||||
|
this.getAgriByImei();
|
||||||
} else {
|
} else {
|
||||||
this.selectedText = ''; // 无匹配项时清空
|
this.selectedText = ''; // 无匹配项时清空
|
||||||
this.title='';
|
this.title='';
|
||||||
this.value=1;
|
this.value=1;
|
||||||
|
this.agriId = '';
|
||||||
}
|
}
|
||||||
this.reset();
|
this.reset();
|
||||||
this.style="";
|
this.style="";
|
||||||
},
|
},
|
||||||
|
getAgriByImei() {
|
||||||
|
getAgriByImei(this.imei).then(response => {
|
||||||
|
if (response.code === 200) {
|
||||||
|
if (!response.data) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.limitTimes = response.data;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getAgriList() {
|
||||||
|
listAgri().then(response => {
|
||||||
|
if (response.code === 200) {
|
||||||
|
this.range = response.rows.map(item => ({
|
||||||
|
agriId: item.id,
|
||||||
|
text: item.agriName,
|
||||||
|
value: item.imei // 提取并改名
|
||||||
|
}));
|
||||||
|
console.info(this.range);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
reset() {
|
reset() {
|
||||||
Object.keys(this.show).forEach(key => {
|
Object.keys(this.show).forEach(key => {
|
||||||
this.show[key] = "暂停";
|
this.show[key] = "暂停";
|
||||||
|
|
@ -305,6 +315,16 @@ export default {
|
||||||
Object.keys(this.liveData).forEach(key => {
|
Object.keys(this.liveData).forEach(key => {
|
||||||
this.liveData[key] = '数据加载中...';
|
this.liveData[key] = '数据加载中...';
|
||||||
});
|
});
|
||||||
|
this.limitTimes= {
|
||||||
|
jbkLimit: 0,
|
||||||
|
jbgLimit: 0,
|
||||||
|
jm1kLimit: 0,
|
||||||
|
jm1gLimit: 0,
|
||||||
|
jm2kLimit: 0,
|
||||||
|
jm2gLimit: 0,
|
||||||
|
jm3kLimit: 0,
|
||||||
|
jm3gLimit: 0
|
||||||
|
};
|
||||||
this.deviceType = '';
|
this.deviceType = '';
|
||||||
this.control = '正在加载中...';
|
this.control = '正在加载中...';
|
||||||
this.message = {};
|
this.message = {};
|
||||||
|
|
@ -498,34 +518,56 @@ export default {
|
||||||
// 新增:打开修改运行时间的弹窗
|
// 新增:打开修改运行时间的弹窗
|
||||||
openTimeModal(card) {
|
openTimeModal(card) {
|
||||||
this.currentCard = card; // 记录当前卡片信息
|
this.currentCard = card; // 记录当前卡片信息
|
||||||
this.currentCardTime = this.limitTimes[card.type]; // 记录当前时间
|
this.currentCardTime = this.limitTimes[`${card.type}Limit`]; // 记录当前时间
|
||||||
this.newTime = this.currentCardTime; // 默认填充当前时间
|
this.newLimitTime = this.currentCardTime; // 默认填充当前时间
|
||||||
this.timeModalVisible = true; // 显示弹窗
|
|
||||||
console.info(`this.timeModalVisible:${this.timeModalVisible}`);
|
|
||||||
this.$refs.inputDialog.open()
|
this.$refs.inputDialog.open()
|
||||||
},
|
},
|
||||||
|
close() {
|
||||||
|
this.$refs.inputDialog.close()
|
||||||
|
},
|
||||||
// 新增:确认修改运行时间
|
// 新增:确认修改运行时间
|
||||||
confirmModifyTime() {
|
confirmModifyTime() {
|
||||||
// 校验输入:必须是1-60的数字
|
// 校验输入:必须是1-60的数字
|
||||||
if (!this.newTime || this.newTime < 1 || this.newTime > 60) {
|
/*if (!this.newLimitTime || this.newLimitTime < 1 || this.newLimitTime > 60) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '请输入1-60的有效数字',
|
title: '请输入1-60的有效数字',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}*/
|
||||||
// 修改limitTimes(用$set确保响应式)
|
// 修改limitTimes(用$set确保响应式)
|
||||||
this.$set(this.limitTimes, this.currentCard.type, this.newTime);
|
if (this.newLimitTime !== this.currentCardTime) {
|
||||||
// 提示修改成功
|
// 提示修改成功
|
||||||
uni.showToast({
|
uni.showModal({
|
||||||
title: '运行时间修改成功',
|
title: '温馨提示:',
|
||||||
icon: 'success'
|
content: `确定修改${this.selectedText}-${this.currentCard.name}运行时间为:${this.newLimitTime} 秒?`,
|
||||||
});
|
cancelText: '取消',
|
||||||
|
confirmText: '确定',
|
||||||
|
success: (res) => {
|
||||||
|
if (res.confirm) {
|
||||||
|
this.$set(this.limitTimes, `${this.currentCard.type}Limit`, this.newLimitTime);
|
||||||
|
if (this.limitTimes.imei) {
|
||||||
|
updateLimit(this.limitTimes).then(response => {
|
||||||
|
response.code === 200 ? this.$modal.msgSuccess("修改成功"):this.$modal.msgSuccess("修改失败")
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.$set(this.limitTimes, 'imei', this.imei);
|
||||||
|
this.$set(this.limitTimes, 'agriName', this.selectedText);
|
||||||
|
this.$set(this.limitTimes, 'agriId', this.agriId);
|
||||||
|
addLimit(this.limitTimes).then(response => {
|
||||||
|
response.code === 200 ? this.$modal.msgSuccess("修改成功"):this.$modal.msgSuccess("修改失败")
|
||||||
|
this.getAgriByImei();
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
// 关闭弹窗
|
// 关闭弹窗
|
||||||
this.$refs.inputDialog.close()
|
this.$refs.inputDialog.close()
|
||||||
// (可选)这里可以加接口请求,把新时间同步到后端
|
// (可选)这里可以加接口请求,把新时间同步到后端
|
||||||
// this.saveLimitTimeToServer(this.currentCard.type, this.newTime);
|
// this.saveLimitTimeToServer(this.currentCard.type, this.newLimitTime);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onHide() {
|
onHide() {
|
||||||
|
|
@ -627,7 +669,7 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
.uni-pb-5 {
|
.uni-pb-5 {
|
||||||
padding-bottom: 40rpx;
|
padding-bottom: 15rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.text {
|
.text {
|
||||||
|
|
@ -696,7 +738,7 @@ export default {
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
}
|
}
|
||||||
.modal-label {
|
.modal-label {
|
||||||
width: 120rpx;
|
width: 160rpx;
|
||||||
color: #666;
|
color: #666;
|
||||||
}
|
}
|
||||||
.modal-current {
|
.modal-current {
|
||||||
|
|
@ -733,4 +775,11 @@ export default {
|
||||||
background: #007aff;
|
background: #007aff;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
.icon {
|
||||||
|
margin-left: 15rpx
|
||||||
|
}
|
||||||
|
.uni-stat-tooltip {
|
||||||
|
width: 300rpx;
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
@ -10,9 +10,17 @@
|
||||||
<view class="iconfont icon-user icon"></view>
|
<view class="iconfont icon-user icon"></view>
|
||||||
<input v-model="loginForm.username" class="input" type="text" placeholder="请输入账号" maxlength="30" />
|
<input v-model="loginForm.username" class="input" type="text" placeholder="请输入账号" maxlength="30" />
|
||||||
</view>
|
</view>
|
||||||
<view class="input-item flex align-center">
|
<view class="input-item flex align-center" style="position: relative;">
|
||||||
<view class="iconfont icon-password icon"></view>
|
<view class="iconfont icon-password icon"></view>
|
||||||
<input v-model="loginForm.password" type="password" class="input" placeholder="请输入密码" maxlength="20" />
|
<input v-model="loginForm.password" :type="isShowPwd?'text':'password'" class="input" placeholder="请输入密码" maxlength="20" />
|
||||||
|
<!-- 替换为 uni-icons 密码图标 -->
|
||||||
|
<uni-icons
|
||||||
|
class="pwd-icon"
|
||||||
|
:type="isShowPwd ? 'eye-filled' : 'eye'"
|
||||||
|
size="18"
|
||||||
|
color="#666"
|
||||||
|
@click="isShowPwd = !isShowPwd"
|
||||||
|
></uni-icons>
|
||||||
</view>
|
</view>
|
||||||
<view class="input-item flex align-center" style="width: 60%;margin: 0px;" v-if="captchaEnabled">
|
<view class="input-item flex align-center" style="width: 60%;margin: 0px;" v-if="captchaEnabled">
|
||||||
<view class="iconfont icon-code icon"></view>
|
<view class="iconfont icon-code icon"></view>
|
||||||
|
|
@ -41,10 +49,13 @@
|
||||||
<script>
|
<script>
|
||||||
import { getCodeImg } from '@/api/login'
|
import { getCodeImg } from '@/api/login'
|
||||||
import { getToken } from '@/utils/auth'
|
import { getToken } from '@/utils/auth'
|
||||||
|
import UniIcons from "../uni_modules/uni-icons/components/uni-icons/uni-icons.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
components: {UniIcons},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
isShowPwd: false,
|
||||||
codeUrl: "",
|
codeUrl: "",
|
||||||
captchaEnabled: true,
|
captchaEnabled: true,
|
||||||
// 用户注册开关
|
// 用户注册开关
|
||||||
|
|
@ -147,7 +158,13 @@
|
||||||
page {
|
page {
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
}
|
}
|
||||||
|
.pwd-icon {
|
||||||
|
position: absolute;
|
||||||
|
right: 10px;
|
||||||
|
top: 50%;
|
||||||
|
transform: translateY(-50%);
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
.normal-login-container {
|
.normal-login-container {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
|
|
@ -184,14 +201,19 @@
|
||||||
color: #999;
|
color: #999;
|
||||||
}
|
}
|
||||||
|
|
||||||
.input {
|
.input,
|
||||||
width: 100%;
|
.input:focus,
|
||||||
|
.input:active,
|
||||||
|
.input:hover {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
line-height: 20px;
|
line-height: 20px;
|
||||||
|
background-color: #f5f6f7; /* 输入框背景色(和页面背景区分) */
|
||||||
text-align: left;
|
text-align: left;
|
||||||
padding-left: 15px;
|
padding-left: 15px;
|
||||||
|
border: none;
|
||||||
|
outline: none !important;
|
||||||
|
box-shadow: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.login-btn {
|
.login-btn {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue