diff --git a/App.vue b/App.vue
index 96333d0..5b7d92c 100644
--- a/App.vue
+++ b/App.vue
@@ -50,6 +50,7 @@
.font13{font-size: 13px;}
.font14{font-size: 14px;}
.font15{font-size: 15px;}
+ .font18{font-size: 18px;}
.font20{font-size: 20px;}
.font22{font-size: 22px;}
.font24{font-size: 24px;}
@@ -64,16 +65,19 @@
//布局
.flex_layout{display: flex;}
- .flex1{flex: 1;}
+ .flex1{flex: 1;}
+ .comView{flex: 1;overflow: hidden;}
//paddind
.padd_rigth5{padding-right: 5px;}
.padd_bot6{padding-bottom: 6px;}
.padd_top12{padding-top:12px;}
.padd_rigth12{padding-right: 12px;}
.padd_bot12{padding-bottom: 12px;}
- .padd_left12{padding-left:12px;}
+ .padd_left12{padding-left:12px;}
+ .padd12{padding: 12px;}
//margin
- .mar_top12{margin-top: 12px;}
+ .mar_top12{margin-top: 12px;}
+ .mar_bot12{margin-bottom: 12px;}
.page_list{margin-bottom: 12px;padding:0 12px;}
//有详情的列表
@@ -96,23 +100,32 @@
display: flex;
flex-direction: column;
.status{
- padding: 3px 10px;
background: $uni-bg-color-success-dark;
color: $uni-text-color-success;
+ padding: 3px 10px;
border-radius: 4px;
font-size: 12px;
}
.success{
background: $uni-bg-color-success-dark;
color: $uni-text-color-success;
+ padding: 3px 10px;
+ border-radius: 4px;
+ font-size: 12px;
}
.warning{
background: $uni-bg-color-warning-dark;
color: $uni-text-color-warning;
+ padding: 3px 10px;
+ border-radius: 4px;
+ font-size: 12px;
}
.error{
background: $uni-bg-color-error-dark;
color: $uni-text-color-danger;
+ padding: 3px 10px;
+ border-radius: 4px;
+ font-size: 12px;
}
}
}
@@ -131,13 +144,13 @@
background-color: #060B26;
border-top: 1px solid #2E3249;
height: 80px;
- // bottom: 40px;bottom: 40px;position: fixed;width: calc(100% - 28px);
view{width: 50%;text-align: center;margin: 0 20px;border-radius: 19px;background: #DDD;line-height: 38px;height: 38px;margin-top: 6px;}
}
//底部固定添加按钮
.page_bottom_button{
width: 100%;position: fixed;bottom: 0px;background-color: #060B26;border-top: 1px solid #2E3249;height: 80px;
- .page_add{display: flex;justify-content: center;margin: 7px 20px;border-radius: 17.5px;background: #1C2755;line-height: 35px;}
+ .page_add{display:flex;justify-content:center;align-items: center;margin: 7px 20px;border-radius: 17.5px;background: #1C2755;height: 38px;}
+ .page_add .icon{margin-right: 4px;}
}
.bot_padding{padding-bottom: 100px;}
@@ -177,6 +190,7 @@
height: 102px;
position: relative;
overflow: hidden;
+ border-radius: 50%;
background: $uni-bg-color-primary;
}
diff --git a/components/calendar/index.vue b/components/calendar/index.vue
new file mode 100644
index 0000000..ba0b3b1
--- /dev/null
+++ b/components/calendar/index.vue
@@ -0,0 +1,306 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{em.text}}
+ {{em.name}}
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/components/loadMore/index.vue b/components/loadMore/index.vue
index 3a577ad..ed23f99 100644
--- a/components/loadMore/index.vue
+++ b/components/loadMore/index.vue
@@ -65,6 +65,6 @@
}
}
.loadBox{
- color: $uni-color-primary;
+ color: $uni-text-color-loading;
}
\ No newline at end of file
diff --git a/components/pickerSelect/index.vue b/components/pickerSelect/index.vue
new file mode 100644
index 0000000..78f5858
--- /dev/null
+++ b/components/pickerSelect/index.vue
@@ -0,0 +1,119 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/main.js b/main.js
index b0d1d26..39fa54e 100644
--- a/main.js
+++ b/main.js
@@ -7,6 +7,8 @@ import "./static/iconfont/iconfont-weapp/iconfont-weapp-icon.css"
import searchView from './components/searchView/index'
import loadMore from './components/loadMore/index'
import progressBar from './components/progressBar'
+import pickerSelect from './components/pickerSelect/index'
+import calendar from './components/calendar/index'
// #ifndef VUE3
import Vue from 'vue'
@@ -16,6 +18,8 @@ import svg from './static/iconfont/svg.js'
Vue.component('search-view',searchView);
Vue.component('load-more',loadMore);
Vue.component('progress-bar',progressBar);
+Vue.component('picker-select',pickerSelect);
+Vue.component('calendar',calendar);
Vue.use(svg);
@@ -42,6 +46,8 @@ export function createApp() {
app.component('searchView', searchView);
app.component('loadMore', loadMore);
app.component('progressBar', progressBar);
+ app.component('pickerSelect', pickerSelect);
+ app.component('calendar',calendar);
app.config.globalProperties.$api = request;
app.config.globalProperties.$wf = publicMethods;
diff --git a/pages.json b/pages.json
index 890e916..89211b7 100644
--- a/pages.json
+++ b/pages.json
@@ -46,9 +46,17 @@
"navigationBarTitleText" : "生产工单管理",
"enablePullDownRefresh" : true,
"pullToRefresh":{
- "color":"red"
+
}
}
+ },
+ {
+ "path" : "pages/schedul/list",
+ "style" :
+ {
+ "navigationBarTitleText" : "工单排程",
+ "enablePullDownRefresh" : false
+ }
},
{
"path" : "pages/index/schedule",
@@ -71,14 +79,14 @@
"style" :
{
"navigationBarTitleText" : "设备管理",
- "enablePullDownRefresh" : false
+ "enablePullDownRefresh" : true
}
},
{
"path" : "pages/equipmentManage/editDevice",
"style" :
{
- "navigationBarTitleText" : "",
+ "navigationBarTitleText" : "添加设备",
"enablePullDownRefresh" : false
}
},
diff --git a/pages/deviceStatus/deviceCamera.vue b/pages/deviceStatus/deviceCamera.vue
index 85aa79c..232f318 100644
--- a/pages/deviceStatus/deviceCamera.vue
+++ b/pages/deviceStatus/deviceCamera.vue
@@ -1,12 +1,13 @@
-
- 硬件设备状态
+
+ 硬件设备状态
+ 在线
- 相机工作中
+ 相机工作中
更多安全事件
@@ -19,19 +20,19 @@
设备名称
- 安全监控相机
+ 安全监控相机
开机时间
- 2024-02-11 08:00:45
+ 2024-02-11 08:00:45
安全事件
- 检测到指定区域内有目标越过警戒线
+ 检测到指定区域内有目标越过警戒线
检测时间
- 2024-01-11 19:09:56
+ 2024-01-11 19:09:56
@@ -55,11 +56,34 @@
}
-
diff --git a/pages/deviceStatus/deviceStatus.vue b/pages/deviceStatus/deviceStatus.vue
index fe13693..d5028ea 100644
--- a/pages/deviceStatus/deviceStatus.vue
+++ b/pages/deviceStatus/deviceStatus.vue
@@ -1,54 +1,54 @@
-
- 硬件设备状态
+
+ 硬件设备状态
+ 在线
-
+
-
+
-
+
-
-
-
+
+
+
-
+
设备名称
- 双头立锯
-
- 相机
+ 双头立锯
+
+
开机时间
- 2024-02-11 08:00:45
+ 2024-02-11 08:00:45
保养到期日
- 2024-02-11 08:00:45
+ 2024-02-11 08:00:45
今日停机
- 5次
+ 5次
-
@@ -62,169 +62,114 @@
return {
list: [{
id: 1,
- name: '多片锯'
+ name: '多片锯',
},
{
id: 2,
- name: '立式带锯'
+ name: '双头带锯',
},
{
id: 3,
- name: '视觉'
+ name: '视觉分析',
},
{
id: 4,
- name: '卧锯'
+ name: '卧锯带锯',
},
{
id: 5,
- name: '多片锯'
- },
- {
- id: 6,
- name: '卧锯测试A'
- },
- {
- id: 7,
- name: '卧锯B'
- },
- {
- id: 8,
- name: '卧锯测试3'
- },
- {
- id: 9,
- name: '卧锯4'
- },
- {
- id: 10,
- name: '卧锯5'
- },
- {
- id: 11,
- name: '卧锯6'
+ name: '上料机架',
},
],
// Tab切换内容
swiperDateList: [
{
id: 1,
- content: '1'
+ content: '1',
+ img:'http://dm-auto.oss-cn-shanghai.aliyuncs.com/mes_wechat/duopian.png'
},
{
id: 2,
- content: '2'
+ content: '2',
+ img:'http://dm-auto.oss-cn-shanghai.aliyuncs.com/mes_wechat/liju.png'
},
{
id: 3,
- content: '3'
+ content: '3',
+ img:'http://dm-auto.oss-cn-shanghai.aliyuncs.com/mes_wechat/shijue.png'
},
{
id: 4,
- content: '4'
+ content: '4',
+ img:'http://dm-auto.oss-cn-shanghai.aliyuncs.com/mes_wechat/woshi.png'
},
{
id: 5,
- content: '5'
- },
- {
- id: 6,
- content: '6'
- },
- {
- id: 7,
- content: '7'
- },
- {
- id: 8,
- content: '8'
- },
- {
- id: 9,
- content: '9'
- },
- {
- id: 10,
- content: '10'
- },
- {
- id: 11,
- content: '11'
+ content: '5',
+ img:'http://dm-auto.oss-cn-shanghai.aliyuncs.com/mes_wechat/shang.png'
},
],
- contentScrollW: 0, // 导航区宽度
- curIndex: 0, // 当前选中
- scrollLeft: 0, // 横向滚动条位置
+ itemWidth: 90,
+ curIndex: 0,
+ scrollLeft: 0,
}
},
mounted() {
- // 获取标题区域宽度,和每个子元素节点的宽度
- this.getScrollW()
+
},
+ onReady() {
+ this.getScrollW();
+ },
methods: {
toCamera(){
uni.navigateTo({
url:'/pages/deviceStatus/deviceCamera'
})
},
- // 获取标题区域宽度,和每个子元素节点的宽度以及元素距离左边栏的距离
- getScrollW() {
- let query = uni.createSelectorQuery().in(this);
- query.select('.scroll-view').boundingClientRect(data => {
- // 拿到 scroll-view 组件宽度
- this.contentScrollW = data.width
- }).exec();
-
- query.selectAll('.scroll-item').boundingClientRect(data => {
- let dataLen = data.length;
- for (let i = 0; i < dataLen; i++) {
- // scroll-view 子元素组件距离左边栏的距离
- this.list[i].left = data[i].left;
- // scroll-view 子元素组件宽度
- this.list[i].width = data[i].width
- }
- }).exec()
- },
-
- // 选择标题
- changeMenu(index) {
- this.curIndex = index;
- // console.log(index,111)
- // 效果一(当前点击子元素靠左展示) 局限性:子元素宽度相同
- // this.scrollLeft = index * this.list[index].width
-
- // 效果一(当前点击子元素靠左展示) 子元素宽度不相同也可实现
- // this.scrollLeft = 0;
- // for (let i = 0; i < index; i++) {
- // this.scrollLeft += this.list[i].width
- // };
-
-
- // 效果二(当前点击子元素靠左留一展示) 局限性:子元素宽度相同
- // this.scrollLeft = (index - 1) * this.list[index].width
-
- // 效果二(当前点击子元素靠左留一展示) 子元素宽度不相同也可实现
- this.scrollLeft = 0;
- for (let i = 0; i < index - 1; i++) {
- this.scrollLeft += this.list[i].width
- };
-
-
- // 效果三(当前点击子元素居中展示) 不受子元素宽度影响
- // this.scrollLeft = this.list[index].left - this.contentScrollW / 2 + this.list[index].width / 2;
- },
- //
- swiperChange(e) {
- // console.log(22,e)
- let index = e.detail.current
- this.changeMenu(index)
- }
+ // 区域宽度,子元素的宽度以及距离左边栏的距离
+ getScrollW() {
+ let itemWidth = 0;
+ let query = uni.createSelectorQuery().in(this);
+ query.select('.scroll-view').boundingClientRect(data => {
+ this.itemWidth = (data.width/3).toFixed(0);
+ itemWidth = (data.width/3).toFixed(0);
+ this.getItemWidth(itemWidth);
+ }).exec();
+ },
+ getItemWidth(num){
+ let query = uni.createSelectorQuery().in(this);
+ query.selectAll('.scroll-item').boundingClientRect(data => {
+ let dataLen = data.length;
+ for (let i = 0; i < dataLen; i++) {
+ this.list[i].width = Number(num);
+ this.list[i].left = Number(num) + Number(data[i].left);
+ }
+ }).exec()
+ },
+
+ // 选择标题
+ changeMenu(index) {
+ this.curIndex = index;
+ this.scrollLeft = 0;
+ for (let i = 0; i < index - 1; i++) {
+ this.scrollLeft += this.list[i].width;
+ };
+ },
+ swiperChange(e) {
+ let index = e.detail.current;
+ this.changeMenu(index);
+ },
+ prveClick(){
+ this.curIndex = this.curIndex==0? 0 : this.curIndex-1;
+ },
+ nextClick(){
+ this.curIndex = this.curIndex < this.list.length-1? this.curIndex+1 : this.curIndex;
+ }
}
}
-
diff --git a/pages/equipmentManage/bindingDevice.vue b/pages/equipmentManage/bindingDevice.vue
index ee9fe1c..b37ce44 100644
--- a/pages/equipmentManage/bindingDevice.vue
+++ b/pages/equipmentManage/bindingDevice.vue
@@ -2,18 +2,17 @@
- 绑定安全生产监控相机
- 串流推流Url
-
-
+ 串流推流Url
+
+
- AppName
-
-
+ AppName
+
+
@@ -23,9 +22,9 @@
- StreamName
-
-
+ StreamName
+
+
@@ -35,43 +34,49 @@
- 设备IP
-
-
+ 设备IP
+
+
- 端口
-
-
+ 端口
+
+
- 用户名
-
-
+ 用户名
+
+
- 密码
-
-
+ 密码
+
+
- 监控推流权限
-
- Token验证
- 禁用
-
+ 监控推流权限
+
+
+
+
+ Token验证
+
+
+
+
+ 禁用
+
- 保存
- 取消
+ 保存
+ 取消
@@ -80,24 +85,85 @@
export default {
data() {
return {
-
+ form:{
+ id:'',
+ stream_url:'',
+ app_name:'',
+ stream_name:'',
+ stream_type:1,
+ monitor_ip:'',
+ monitor_port:'',
+ monitor_account:'',
+ monitor_password:''
+ }
}
+ },
+ onLoad(option) {
+ this.form.id = option.id;
+ this.getVideo(option.id);
+ },
+ onReady() {
+
},
methods: {
-
+ getVideo(id){
+ this.$api.request('/get.video.config',{id:id}).then(res=>{
+ this.form.stream_url = res.data.stream_url;
+ if(res.data.app_name && res.data.eq_name){
+ this.form.app_name = res.data.app_name;
+ this.form.stream_name = res.data.stream_name;
+ this.form.stream_type = res.data.stream_type;
+ this.form.monitor_ip = res.data.monitor_ip;
+ this.form.monitor_port = res.data.monitor_port;
+ this.form.monitor_account = res.data.monitor_account;
+ this.form.monitor_password = res.data.monitor_password;
+ }
+ }).catch(err=>{
+
+ })
+ },
+ save(){
+ this.$api.postFuncLoading('/bind.video.config',this.form).then(res=>{
+ this.parentClick();
+ this.reset();
+ this.$wf.toast({type:'success',text:'保存成功'});
+ }).catch(err=>{
+
+ })
+ },
+ cancel(){
+ this.reset();
+ },
+ reset(){
+ this.form.app_name = '';
+ this.form.stream_name = '';
+ this.form.stream_type = 1;
+ this.form.monitor_ip = '';
+ this.form.monitor_port = '';
+ this.form.monitor_account = '';
+ this.form.monitor_password = '';
+ },
+ parentClick(){
+ const pages = getCurrentPages();
+ if (pages.length >= 2) {
+ const prevPage = pages[pages.length - 2];
+ prevPage.$vm.getList();
+ }
+ }
}
}
-
diff --git a/pages/equipmentManage/deviceDetail.vue b/pages/equipmentManage/deviceDetail.vue
index c29d2b0..78c0659 100644
--- a/pages/equipmentManage/deviceDetail.vue
+++ b/pages/equipmentManage/deviceDetail.vue
@@ -1,34 +1,33 @@
-
-
+
- 设备
- {{form.name}}
+ 设备
+ {{form.eq_name}}
- 设备名称
- 双头立锯
+ 设备名称
+ {{form.name}}
- 设备功率
- 双头立锯
+ 设备功率
+ {{form.power}}
- 设备IP
- 双头立锯
+ 设备IP
+ {{form.equipment_configs.length>0? form.equipment_configs[0].ip:''}}
- 端口
- 双头立锯
+ 端口
+ {{form.equipment_configs.length>0? form.equipment_configs[0].port:''}}
- 状态
- {{form.active_status==true?'启用':'禁用'}}
+ 状态
+ {{form.active_status==true?'启用':'禁用'}}
- 设置备注
-
+ 备注
+
{{form.remark}}
@@ -40,7 +39,11 @@
export default {
data() {
return {
- form:{}
+ form:{
+ equipment_configs:[
+ {ip:'',port:''}
+ ]
+ }
}
},
onLoad(options){
@@ -49,7 +52,6 @@
methods: {
getDetail(id){
this.$api.postFuncLoading('/device.info',{id:id}).then(res=>{
- console.log(res)
this.form = res.data
})
},
@@ -57,13 +59,13 @@
}
-
diff --git a/pages/equipmentManage/editDevice.vue b/pages/equipmentManage/editDevice.vue
index 5ec2e6c..316ea15 100644
--- a/pages/equipmentManage/editDevice.vue
+++ b/pages/equipmentManage/editDevice.vue
@@ -1,111 +1,229 @@
-
-
-
+
+
+
-
-
+
- 选择设备
-
-
-
-
-
+ 选择设备
+
- 设备自定义名称
-
-
-
+ 设备自定义名称
+
+
+
+
+
+ 设备编号
+
+
+
+
+
+ 设备功率
+
+
- 设备功率
-
-
+ 设备IP
+
+
- 设备IP
-
-
+ 端口
+
+
- 端口
-
-
-
-
-
- 状态
-
-
-
-
- 启用
+ 型号
+
+
+
+
+ H3U
-
-
-
- 禁用
+
+
+
+ H5U
+
+
+ 逻辑控制器(PLC)
+
+
+
+ 状态
+
+
+
+
+ 启用
+
+
+
+
+ 禁用
+
+
- 设置备注
+ 设置备注
-
-
+
- 保存
- 取消
+ 保存
+ 取消
-
diff --git a/pages/equipmentManage/equipmentManage.vue b/pages/equipmentManage/equipmentManage.vue
index 61ab208..6bb1335 100644
--- a/pages/equipmentManage/equipmentManage.vue
+++ b/pages/equipmentManage/equipmentManage.vue
@@ -1,39 +1,36 @@
-
-
-
-
-
- 设备名称
+
+
+
+
+
+ 设备名称
+
+ {{item.name}}
+
+
+
+
+ 设备IP/端口
+ {{item.equipment_monitor_config?item.equipment_monitor_config.monitor_ip+'/'+item.equipment_monitor_config.monitor_port:'-'}}
-
- {{item.name}}
+
+ 已绑定设备
+
+ {{item.equipment_monitor_config && item.equipment_monitor_config.eq_name?item.equipment_monitor_config.eq_name:'-'}}
+
+
-
-
- 设备IP/端口
-
-
-
- 已绑定设备
-
-
- {{item.name}}
-
-
-
-
+
+
-
-
-
- 添加
+
+
+ 添加
@@ -42,46 +39,97 @@
-
diff --git a/pages/index/index.vue b/pages/index/index.vue
index baa8510..b5aa25b 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -176,7 +176,7 @@
生产排程
-
+
排程管理
@@ -258,6 +258,12 @@
uni.navigateTo({
url:'/pages/production/productionOrder'
})
+ },
+ // 工单排程
+ toSchedul(){
+ uni.navigateTo({
+ url:'/pages/schedul/list'
+ })
},
//跳转工单进度页
toSchedule(){
diff --git a/pages/index/materialYield.vue b/pages/index/materialYield.vue
index 6e2b30a..c55e934 100644
--- a/pages/index/materialYield.vue
+++ b/pages/index/materialYield.vue
@@ -113,7 +113,7 @@
}
}
}
- .list_below{display: flex;text-align: center;padding: 20px 0;
+ .list_below{display: flex;text-align: center;padding: 10px 0;
.below_left{flex: 1;display: flex;align-items: center;justify-content: center;}
.percentage{color: $uni-text-color-inverse;}
}
diff --git a/pages/person/person.vue b/pages/person/person.vue
index 4c662e4..c0c1f79 100644
--- a/pages/person/person.vue
+++ b/pages/person/person.vue
@@ -10,7 +10,7 @@
肖银奎
-
+
登录账号:ykxiao
diff --git a/pages/production/productionDetail.vue b/pages/production/productionDetail.vue
index 406c8d7..9ce16a5 100644
--- a/pages/production/productionDetail.vue
+++ b/pages/production/productionDetail.vue
@@ -1,6 +1,6 @@
-
+
工单号 {{form.order_sn}}
@@ -13,11 +13,11 @@
生产开始时间
- {{form.created_at}}
+ {{form.time_start==''?'-':form.time_start}}
生产结束时间
- {{form.updated_at}}
+ {{form.time_end==''?'-':form.time_end}}
工单耗时
diff --git a/pages/production/productionOrder.vue b/pages/production/productionOrder.vue
index 3a44f0b..f26e7b8 100644
--- a/pages/production/productionOrder.vue
+++ b/pages/production/productionOrder.vue
@@ -5,7 +5,6 @@
-
@@ -67,7 +66,6 @@
-
@@ -108,6 +106,11 @@
// 上拉刷新
onPullDownRefresh(){
this.params.page = 1;
+ this.loadParams = {
+ noData:false,
+ loading:false,
+ loadEnd:false
+ };
this.listData(2);
},
// 加载下一页
@@ -127,11 +130,10 @@
})
}
this.$api.request('/order.list',this.params).then(res=>{
- console.log(res,566)
if(type ==2){
uni.stopPullDownRefresh();
}
- setTimeout(function () {
+ setTimeout( ()=> {
uni.hideLoading();
}, 200);
@@ -147,10 +149,8 @@
}else{
this.list = this.list.concat(res.data.rows);
}
-
}).catch(err=>{
- console.log('err',err)
- setTimeout(function () {
+ setTimeout( ()=> {
uni.hideLoading();
}, 200);
})
@@ -175,7 +175,7 @@
.percentage{color: $uni-text-color-primary;margin: 10px 0 0 0;}
}
.list_below{padding-bottom: 12px;
- .row{display: flex;padding-top: 10px;
+ .row{display: flex;padding-top: 12px;
.row_left{
white-space: nowrap;overflow: hidden;text-overflow: ellipsis;
padding-right: 4px;
diff --git a/pages/schedul/list.vue b/pages/schedul/list.vue
new file mode 100644
index 0000000..fc23394
--- /dev/null
+++ b/pages/schedul/list.vue
@@ -0,0 +1,270 @@
+
+
+
+ 排程日统计
+
+
+ 待生产
+ 32
+
+
+ 生产中
+ 12
+
+
+ 生产完成
+ 102
+
+
+
+
+
+
+ 排程视图 {{dateText}}
+
+ {{item.name}}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.time}}
+
+ {{item.status}}
+
+ 工单号:
+ {{item.sn}}
+
+
+ 规格:
+ 4*9*63
+
+
+
+ 开始时间:
+ 00:00
+
+
+ 剩余时间:
+ 00:30
+
+
+
+
+
+ 74.3%
+ 出材率
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/static/css/app.css b/static/css/app.css
index 653429a..5580ec3 100644
--- a/static/css/app.css
+++ b/static/css/app.css
@@ -1,3 +1,10 @@
+/* 横向滚动条 */
+.horizontalScrollView ::-webkit-scrollbar{
+ display: none;
+ width: 0;
+ height: 0;
+}
+
/* 检索部分 */
.columnFlex{
width: 100%;
@@ -76,3 +83,11 @@
transform: rotate(360deg);
}
}
+
+
+/* picker 下啦选择 */
+.pickerBom{
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
\ No newline at end of file
diff --git a/static/iconfont/iconfont.css b/static/iconfont/iconfont.css
index 01474ec..e7aaeb0 100644
--- a/static/iconfont/iconfont.css
+++ b/static/iconfont/iconfont.css
@@ -1,8 +1,8 @@
@font-face {
font-family: "iconfont"; /* Project id 4403683 */
- src: url('//at.alicdn.com/t/c/font_4403683_4mp9v07pqat.woff2?t=1713756401049') format('woff2'),
- url('//at.alicdn.com/t/c/font_4403683_4mp9v07pqat.woff?t=1713756401049') format('woff'),
- url('//at.alicdn.com/t/c/font_4403683_4mp9v07pqat.ttf?t=1713756401049') format('truetype');
+ src: url('//at.alicdn.com/t/c/font_4403683_noneyo0uteq.woff2?t=1714293192496') format('woff2'),
+ url('//at.alicdn.com/t/c/font_4403683_noneyo0uteq.woff?t=1714293192496') format('woff'),
+ url('//at.alicdn.com/t/c/font_4403683_noneyo0uteq.ttf?t=1714293192496') format('truetype');
}
.iconfont {
@@ -13,6 +13,10 @@
-moz-osx-font-smoothing: grayscale;
}
+.icon-a-shexiangtou_shiti1:before {
+ content: "\e639";
+}
+
.icon-meiyougengduo:before {
content: "\e638";
}
diff --git a/uni.scss b/uni.scss
index 54e09bf..e5a3924 100644
--- a/uni.scss
+++ b/uni.scss
@@ -19,6 +19,8 @@ $uni-text-color-inverse: #fff;
$uni-text-color-grey: #999999;
$uni-text-color-placeholder: rgba(255,255,255,0.7);
$uni-text-color-default: #000000;
+$uni-text-color-loading: #5D71A3;
+
/* 文字尺寸 */
$uni-font-size-sm:24rpx;
@@ -34,10 +36,12 @@ $uni-bg-color-error:#F84545;
$uni-bg-color-info:#6576B7;
$uni-bg-color-grey:#CCCCCC;
$uni-bg-color-whith:#FFFFFF;
+$uni-bg-color-schedule:#45538C;
$uni-bg-color-default-dark:rgba(0, 150, 136, 0.5);
$uni-bg-color-success-dark:rgba(103, 194, 58, 0.25);
$uni-bg-color-warning-dark:rgba(230, 162, 60, 0.25);
$uni-bg-color-error-dark:rgba(248, 69, 69, 0.25);
+$uni-bg-color-placeholder:rgba(255, 255, 255, 0.5);
/* 边框的颜色 */
diff --git a/utils/api.js b/utils/api.js
index c273385..d8a9a36 100644
--- a/utils/api.js
+++ b/utils/api.js
@@ -16,8 +16,6 @@ const request = (url = '', data = {}, header = {
setTimeout( ()=> {
uni.hideLoading();
}, 200);
-
- console.log(res.data.code,455)
uni.showModal({
showCancel: false,
title: '温馨提示',
@@ -32,8 +30,7 @@ const request = (url = '', data = {}, header = {
}
}
});
- console.log(res.data.code,888)
-
+ return
}
if(res.header.Authorization){
uni.removeStorageSync('mes_token');
@@ -46,7 +43,12 @@ const request = (url = '', data = {}, header = {
// 成功的回调
if(res.data.code == 200){
- resolve(res.data)
+ resolve(res.data);
+ }else{
+ uni.showToast({
+ icon:'none',
+ title:res.data.message
+ })
}
},
fail: (err) => {
@@ -91,7 +93,8 @@ const request = (url = '', data = {}, header = {
});
}
}
- });
+ });
+ return
}
if(res.header.Authorization){
uni.removeStorageSync('mes_token');
@@ -104,6 +107,11 @@ const request = (url = '', data = {}, header = {
// 成功的回调
if(res.data.code == 200){
resolve(res.data)
+ }else{
+ uni.showToast({
+ icon:'none',
+ title:res.data.message
+ })
}
},
fail: (err) => {
diff --git a/utils/public.js b/utils/public.js
index 9b8d89e..947dad1 100644
--- a/utils/public.js
+++ b/utils/public.js
@@ -7,9 +7,284 @@ const setLoginData=function(obj){
const removeLoginData=function(){
uni.removeStorageSync("demu_mes_user_name");
uni.removeStorageSync("mes_token");
-}
+}
+// 重定义 弹窗
+const toast = function(params){
+ uni.showToast({
+ title:params.text,
+ icon:params.type,
+ duration:1000
+ })
+}
+
+// 0~9 对应小数转换
+const numberToChineseLower = function(num) {
+ var chineseNums = ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九'];
+ return num.toString().split('').map(function(digit) {
+ return chineseNums[parseInt(digit)];
+ }).join('');
+}
+
+const getDatesOfWeek = function() {
+ var now = new Date();
+ // 获取当前日期是周几,0表示周日,1表示周一,以此类推
+ var dayOfWeek = now.getDay();
+ var monday = new Date(now.setDate(now.getDate() - dayOfWeek + (dayOfWeek === 0 ? 0 : 1)));
+ var datesOfWeek = [];
+ for (var i = 0; i < 7; i++) {
+ var currentDate = new Date(monday.getTime() + i * 24 * 60 * 60 * 1000);
+ var weekdays = ['日', '一', '二', '三', '四', '五', '六'];
+ var weekday = weekdays[currentDate.getDay()];
+
+ var dateInfo = {
+ date: currentDate.toISOString().split('T')[0],
+ name: weekday
+ };
+ datesOfWeek.push(dateInfo);
+ }
+ return datesOfWeek;
+}
+
+// 往前一周
+const getPreviousWeekDatesWithDays = function(date=null) {
+ var now = new Date(date);
+ var lastMonday = new Date(now);
+ lastMonday.setDate(lastMonday.getDate() - 7);
+ var datesAndDays = [];
+
+ for (var i = 0; i < 7; i++) {
+ var currentDate = new Date(lastMonday.getTime() + i * 24 * 60 * 60 * 1000);
+ var weekdays = ['日', '一', '二', '三', '四', '五', '六'];
+ datesAndDays.push({
+ date: currentDate.toISOString().split('T')[0],
+ name: weekdays[currentDate.getDay()]
+ });
+ }
+
+ return datesAndDays;
+}
+
+// 往后一周
+const getNextWeekDatesWithDays = function(date = null) {
+ var now = new Date(date);
+ var nextMonday = new Date(now);
+ nextMonday.setDate(nextMonday.getDate() + (8 - now.getDay()) % 7);
+ var datesAndDays = [];
+
+ for (var i = 0; i < 7; i++) {
+ var currentDate = new Date(nextMonday.getTime() + i * 24 * 60 * 60 * 1000);
+ var weekdays = ['日', '一', '二', '三', '四', '五', '六'];
+ datesAndDays.push({
+ date: currentDate.toISOString().split('T')[0],
+ name: weekdays[currentDate.getDay()]
+ });
+ }
+
+ return datesAndDays;
+}
+
+// 获取本月日期
+// year, month
+const getWeeksOfMonth = function() {
+ var now = new Date();
+ var year = now.getFullYear();
+ var month = now.getMonth() + 1;
+ const startDate = new Date(year, month - 1, 1);
+ const endDate = new Date(year, month, 0);
+ const startDateDayOfWeek = startDate.getDay(); // 获取本月第一天是周几
+ const totalDays = endDate.getDate(); // 获取本月总天数
+
+ let weeks = [];
+ let currentWeek = [];
+ let currentDate = new Date(startDate);
+
+ // 填充到本周开始
+ for (let i = 0; i < startDateDayOfWeek; i++) {
+ currentWeek.push(null);
+ }
+
+ while (currentDate <= endDate) {
+ let textMonth = month<10?'0'+month:month;
+ let textDate = currentDate.getDate()<10?'0'+currentDate.getDate():currentDate.getDate();
+ currentWeek.push({
+ date: year +'-'+ textMonth +'-'+ textDate,
+ name: ['一', '二', '三', '四', '五', '六','日'][currentDate.getDay()]
+ });
+ currentDate.setDate(currentDate.getDate() + 1);
+
+ // 当前周已满,开始新周
+ if (currentWeek.length === 7) {
+ weeks.push(currentWeek);
+ currentWeek = [];
+ }
+ }
+
+ // 处理最后不满一周的情况
+ if (currentWeek.length > 0) {
+ while (currentWeek.length < 7) {
+ currentWeek.push(null);
+ }
+ weeks.push(currentWeek);
+ }
+
+ return weeks;
+}
+
+// 往前推一个月
+const getPreviousMonthGroupedByWeek = function(date = null) {
+ let now = new Date(date);
+ var year = now.getFullYear();
+ var month = now.getMonth();
+ // 如果当前月份是1月,则年份减1,月份变成12月
+ if (month === 0) {
+ year--;
+ month = 11;
+ } else {
+ month--;
+ }
+ let prevMonthFirstDay = new Date(year, month, 1); // 获取上一个月的第一天
+ let prevMonthLastDay = new Date(year, month + 1, 0); // 获取上一个月的最后一天
+ let currentDate = new Date(prevMonthFirstDay); // 从上一个月的第一天开始
+ let weeksData = [];
+ let currentWeek = [];
+
+ const weekdays = ['一', '二', '三', '四', '五', '六', '日'];
+
+ while (currentDate <= prevMonthLastDay) {
+ // 获取当前日期和星期几
+ let date = currentDate.getDate();
+ let weekdayIndex = currentDate.getDay();
+
+ let textMonth = month<9?'0'+(month+1):(month+1);
+ let textDate = date<10?'0'+date:date;
+ currentWeek.push({
+ date: year + '-' + textMonth + '-' + textDate,
+ name: weekdays[weekdayIndex]
+ });
+
+ // 如果到达了周日或者已经是最后一日,将当前周添加到weeksData,并重置currentWeek
+ if (weekdayIndex === 6 || currentDate.getTime() === prevMonthLastDay.getTime()) {
+ weeksData.push(currentWeek);
+ currentWeek = [];
+ }
+
+ // 前往下一天
+ currentDate.setDate(currentDate.getDate() + 1);
+ }
+
+ return weeksData;
+}
+
+const getNextMonthGroupedByWeek = function(date = null) {
+ let now = new Date(date);
+ var year = now.getFullYear();
+ var month = now.getMonth();
+ if (month === 11) {
+ year++;
+ month = 0;
+ } else {
+ month++;
+ }
+ let nextMonthFirstDay = new Date(year, month, 1); // 获取下一个月的第一天
+ let nextMonthLastDay = new Date(year, month + 1, 0); // 获取下一个月的最后一天
+ let currentDate = new Date(nextMonthFirstDay); // 从下一个月的第一天开始
+ let weeksData = [];
+ let currentWeek = [];
+
+ const weekdays = ['一', '二', '三', '四', '五', '六', '日'];
+
+ while (currentDate <= nextMonthLastDay) {
+ let date = currentDate.getDate();
+ let weekdayIndex = currentDate.getDay();
+
+ let textMonth = month<9?'0'+(month+1):(month+1);
+ let textDate = date<10?'0'+date:date;
+ currentWeek.push({
+ date: year + '-' + textMonth + '-' + textDate,
+ name: weekdays[weekdayIndex]
+ });
+
+ if (weekdayIndex === 6 || currentDate.getTime() === nextMonthLastDay.getTime()) {
+ weeksData.push(currentWeek);
+ currentWeek = [];
+ }
+
+ // 前往下一天
+ currentDate.setDate(currentDate.getDate() + 1);
+ }
+
+ return weeksData;
+}
+
+// 上一个月有几周
+const getPreviousMonthWeekCount = function(date = null) {
+ let now = new Date(date);
+ var year = now.getFullYear();
+ var month = now.getMonth();
+ if (month === 0) {
+ year--;
+ month = 11;
+ } else {
+ month--;
+ }
+ let prevMonthFirstDay = new Date(year, month, 1); // 获取上一个月的第一天
+ let prevMonthLastDay = new Date(year, month + 1, 0); // 获取上一个月的最后一天
+ let totalWeeks = 0;
+
+ // 计算上一个月有几周
+ let currentDate = new Date(prevMonthFirstDay);
+ while (currentDate <= prevMonthLastDay) {
+ let weekdayIndex = currentDate.getDay();
+ if (weekdayIndex === 6 || currentDate.getTime() === prevMonthLastDay.getTime()) {
+ totalWeeks++;
+ }
+ currentDate.setDate(currentDate.getDate() + 1);
+ }
+
+ return totalWeeks;
+}
+
+
+// 下个月有几周
+const getNextMonthWeekCount = function(date = null) {
+ let now = new Date(date);
+ var year = now.getFullYear();
+ var month = now.getMonth();
+ if (month === 11) {
+ year++;
+ month = 0;
+ } else {
+ month++;
+ }
+ let nextMonthFirstDay = new Date(year, month, 1); // 获取下一个月的第一天
+ let nextMonthLastDay = new Date(year, month + 1, 0); // 获取下一个月的最后一天
+ let totalWeeks = 0;
+
+ let currentDate = new Date(nextMonthFirstDay);
+ while (currentDate <= nextMonthLastDay) {
+ let weekdayIndex = currentDate.getDay();
+ if (weekdayIndex === 6 || currentDate.getTime() === nextMonthLastDay.getTime()) {
+ totalWeeks++;
+ }
+ // 前往下一天
+ currentDate.setDate(currentDate.getDate() + 1);
+ }
+
+ return totalWeeks;
+}
+
export default {
setLoginData,
- removeLoginData
+ removeLoginData,
+ toast,
+ numberToChineseLower,
+ getDatesOfWeek,
+ getPreviousWeekDatesWithDays,
+ getNextWeekDatesWithDays,
+ getWeeksOfMonth,
+ getPreviousMonthGroupedByWeek,
+ getNextMonthGroupedByWeek,
+ getPreviousMonthWeekCount,
+ getNextMonthWeekCount,
};
\ No newline at end of file