first commit
This commit is contained in:
126
unpackage/dist/dev/mp-weixin/pages/equipmentregistration/equipmentregistration.js
vendored
Normal file
126
unpackage/dist/dev/mp-weixin/pages/equipmentregistration/equipmentregistration.js
vendored
Normal file
@@ -0,0 +1,126 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
if (!Array) {
|
||||
const _easycom_up_input2 = common_vendor.resolveComponent("up-input");
|
||||
const _easycom_up_datetime_picker2 = common_vendor.resolveComponent("up-datetime-picker");
|
||||
const _easycom_up_textarea2 = common_vendor.resolveComponent("up-textarea");
|
||||
const _easycom_u_popup2 = common_vendor.resolveComponent("u-popup");
|
||||
(_easycom_up_input2 + _easycom_up_datetime_picker2 + _easycom_up_textarea2 + _easycom_u_popup2)();
|
||||
}
|
||||
const _easycom_up_input = () => "../../uni_modules/uview-plus/components/u-input/u-input.js";
|
||||
const _easycom_up_datetime_picker = () => "../../uni_modules/uview-plus/components/u-datetime-picker/u-datetime-picker.js";
|
||||
const _easycom_up_textarea = () => "../../uni_modules/uview-plus/components/u-textarea/u-textarea.js";
|
||||
const _easycom_u_popup = () => "../../uni_modules/uview-plus/components/u-popup/u-popup.js";
|
||||
if (!Math) {
|
||||
(_easycom_up_input + _easycom_up_datetime_picker + _easycom_up_textarea + _easycom_u_popup)();
|
||||
}
|
||||
const _sfc_main = {
|
||||
__name: "equipmentregistration",
|
||||
setup(__props) {
|
||||
const showAddPopup = common_vendor.ref(false);
|
||||
const fileList = common_vendor.ref([]);
|
||||
const toAdd = () => {
|
||||
showAddPopup.value = true;
|
||||
};
|
||||
const chooseFile = () => {
|
||||
common_vendor.index.chooseMessageFile({
|
||||
count: 10,
|
||||
type: "all",
|
||||
success: (res) => {
|
||||
const files = res.tempFiles.map((file) => ({
|
||||
name: file.name,
|
||||
path: file.path,
|
||||
size: file.size
|
||||
}));
|
||||
fileList.value = [...fileList.value, ...files];
|
||||
},
|
||||
fail: () => {
|
||||
common_vendor.index.chooseImage({
|
||||
count: 9,
|
||||
success: (res) => {
|
||||
const files = res.tempFilePaths.map((path, index) => ({
|
||||
name: `文件${fileList.value.length + index + 1}`,
|
||||
path,
|
||||
size: 0
|
||||
}));
|
||||
fileList.value = [...fileList.value, ...files];
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
const removeFile = (index) => {
|
||||
fileList.value.splice(index, 1);
|
||||
};
|
||||
const handleAdd = () => {
|
||||
showAddPopup.value = false;
|
||||
common_vendor.index.showToast({
|
||||
title: "新增成功",
|
||||
icon: "success"
|
||||
});
|
||||
};
|
||||
const show = common_vendor.ref(false);
|
||||
const value1 = common_vendor.ref(Date.now());
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.o(toAdd),
|
||||
b: common_vendor.o(($event) => showAddPopup.value = false),
|
||||
c: common_vendor.p({
|
||||
placeholder: "请输入型号"
|
||||
}),
|
||||
d: common_vendor.p({
|
||||
placeholder: "请输入名称"
|
||||
}),
|
||||
e: common_vendor.p({
|
||||
placeholder: "请输入参数"
|
||||
}),
|
||||
f: common_vendor.p({
|
||||
placeholder: "请输入数量"
|
||||
}),
|
||||
g: common_vendor.o(($event) => value1.value = $event),
|
||||
h: common_vendor.p({
|
||||
hasInput: true,
|
||||
show: show.value,
|
||||
mode: "date",
|
||||
modelValue: value1.value
|
||||
}),
|
||||
i: common_vendor.o(($event) => value1.value = $event),
|
||||
j: common_vendor.p({
|
||||
hasInput: true,
|
||||
show: show.value,
|
||||
mode: "date",
|
||||
modelValue: value1.value
|
||||
}),
|
||||
k: common_vendor.p({
|
||||
placeholder: "请输入区域"
|
||||
}),
|
||||
l: common_vendor.o(chooseFile),
|
||||
m: fileList.value.length > 0
|
||||
}, fileList.value.length > 0 ? {
|
||||
n: common_vendor.f(fileList.value, (file, index, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(file.name),
|
||||
b: common_vendor.o(($event) => removeFile(index), index),
|
||||
c: index
|
||||
};
|
||||
})
|
||||
} : {}, {
|
||||
o: common_vendor.o(($event) => value1.value = $event),
|
||||
p: common_vendor.p({
|
||||
placeholder: "请输入备注",
|
||||
modelValue: value1.value
|
||||
}),
|
||||
q: common_vendor.o(($event) => showAddPopup.value = false),
|
||||
r: common_vendor.o(handleAdd),
|
||||
s: common_vendor.o(($event) => showAddPopup.value = false),
|
||||
t: common_vendor.p({
|
||||
show: showAddPopup.value,
|
||||
mode: "center",
|
||||
round: "20"
|
||||
})
|
||||
});
|
||||
};
|
||||
}
|
||||
};
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-1714bad4"]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
9
unpackage/dist/dev/mp-weixin/pages/equipmentregistration/equipmentregistration.json
vendored
Normal file
9
unpackage/dist/dev/mp-weixin/pages/equipmentregistration/equipmentregistration.json
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"navigationBarTitleText": "设备登记",
|
||||
"usingComponents": {
|
||||
"up-input": "../../uni_modules/uview-plus/components/u-input/u-input",
|
||||
"up-datetime-picker": "../../uni_modules/uview-plus/components/u-datetime-picker/u-datetime-picker",
|
||||
"up-textarea": "../../uni_modules/uview-plus/components/u-textarea/u-textarea",
|
||||
"u-popup": "../../uni_modules/uview-plus/components/u-popup/u-popup"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/pages/equipmentregistration/equipmentregistration.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/pages/equipmentregistration/equipmentregistration.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view class="{{['padding', 'data-v-1714bad4', virtualHostClass]}}" style="{{virtualHostStyle}}"><view class="padding data-v-1714bad4"><view class="text-gray text-center margin-top-xl margin-bottom-xl data-v-1714bad4">暂无设备</view><button class="cuIcon-add round bg-blue data-v-1714bad4" bindtap="{{a}}">新增</button></view><u-popup wx:if="{{t}}" class="data-v-1714bad4" virtualHostClass="data-v-1714bad4" u-s="{{['d']}}" bindclose="{{s}}" u-i="1714bad4-0" bind:__l="__l" u-p="{{t}}"><view class="popup-content data-v-1714bad4"><view class="popup-header data-v-1714bad4"><view class="popup-title text-bold data-v-1714bad4">新增设备</view><view class="popup-close data-v-1714bad4" bindtap="{{b}}">×</view></view><view class="popup-body data-v-1714bad4"><view class="flex data-v-1714bad4"><view class="margin-bottom data-v-1714bad4">型号</view><view class="text-red data-v-1714bad4">*</view></view><up-input wx:if="{{c}}" class="data-v-1714bad4" virtualHostClass="data-v-1714bad4" u-i="1714bad4-1,1714bad4-0" bind:__l="__l" u-p="{{c}}"></up-input><view class="flex margin-bottom margin-top data-v-1714bad4"><view class="data-v-1714bad4">名称</view><view class="text-red data-v-1714bad4">*</view></view><up-input wx:if="{{d}}" class="data-v-1714bad4" virtualHostClass="data-v-1714bad4" u-i="1714bad4-2,1714bad4-0" bind:__l="__l" u-p="{{d}}"></up-input><view class="margin-bottom margin-top data-v-1714bad4">参数</view><up-input wx:if="{{e}}" class="data-v-1714bad4" virtualHostClass="data-v-1714bad4" u-i="1714bad4-3,1714bad4-0" bind:__l="__l" u-p="{{e}}"></up-input><view class="flex margin-bottom margin-top data-v-1714bad4"><view class="data-v-1714bad4">数量(单位:台)</view><view class="text-red data-v-1714bad4">*</view></view><up-input wx:if="{{f}}" class="data-v-1714bad4" virtualHostClass="data-v-1714bad4" u-i="1714bad4-4,1714bad4-0" bind:__l="__l" u-p="{{f}}"></up-input><view class="flex margin-bottom margin-top data-v-1714bad4"><view class="data-v-1714bad4">购买时间</view><view class="text-red data-v-1714bad4">*</view></view><up-datetime-picker wx:if="{{h}}" class="data-v-1714bad4" virtualHostClass="data-v-1714bad4" u-i="1714bad4-5,1714bad4-0" bind:__l="__l" bindupdateModelValue="{{g}}" u-p="{{h}}"></up-datetime-picker><view class="flex margin-bottom margin-top data-v-1714bad4"><view class="data-v-1714bad4">设备预警时间</view><view class="text-red data-v-1714bad4">*</view></view><up-datetime-picker wx:if="{{j}}" class="data-v-1714bad4" virtualHostClass="data-v-1714bad4" u-i="1714bad4-6,1714bad4-0" bind:__l="__l" bindupdateModelValue="{{i}}" u-p="{{j}}"></up-datetime-picker><view class="flex margin-bottom margin-top data-v-1714bad4"><view class="data-v-1714bad4">区域</view><view class="text-red data-v-1714bad4">*</view></view><up-input wx:if="{{k}}" class="data-v-1714bad4" virtualHostClass="data-v-1714bad4" u-i="1714bad4-7,1714bad4-0" bind:__l="__l" u-p="{{k}}"></up-input><view class="margin-top-sm margin-bottom-sm margin-bottom margin-top data-v-1714bad4">上传资料</view><view class="upload-area data-v-1714bad4" bindtap="{{l}}"><view class="upload-icon data-v-1714bad4"><text class="cuIcon-upload data-v-1714bad4" style="font-size:60rpx;color:#999"></text></view><view class="upload-text data-v-1714bad4">点击选择文件</view><view class="upload-tip data-v-1714bad4">支持Word、Excel、PDF、图片等格式</view><button class="cu-but bg-blue data-v-1714bad4">选择文件</button></view><view wx:if="{{m}}" class="file-list data-v-1714bad4"><view wx:for="{{n}}" wx:for-item="file" wx:key="c" class="file-item data-v-1714bad4"><text class="file-name data-v-1714bad4">{{file.a}}</text><text class="file-delete text-red data-v-1714bad4" catchtap="{{file.b}}">×</text></view></view><view class="margin-top-sm margin-bottom margin-top data-v-1714bad4">备注</view><up-textarea wx:if="{{p}}" class="data-v-1714bad4" virtualHostClass="data-v-1714bad4" u-i="1714bad4-8,1714bad4-0" bind:__l="__l" bindupdateModelValue="{{o}}" u-p="{{p}}"></up-textarea></view><view class="popup-footer data-v-1714bad4"><button class="btn-cancel data-v-1714bad4" bindtap="{{q}}">取消</button><button class="btn-confirm bg-blue data-v-1714bad4" bindtap="{{r}}">确定</button></view></view></u-popup></view>
|
||||
132
unpackage/dist/dev/mp-weixin/pages/equipmentregistration/equipmentregistration.wxss
vendored
Normal file
132
unpackage/dist/dev/mp-weixin/pages/equipmentregistration/equipmentregistration.wxss
vendored
Normal file
@@ -0,0 +1,132 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* uni.scss */
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.popup-content.data-v-1714bad4 {
|
||||
width: 600rpx;
|
||||
background: #fff;
|
||||
border-radius: 20rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
.popup-header.data-v-1714bad4 {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 30rpx;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
}
|
||||
.popup-title.data-v-1714bad4 {
|
||||
font-size: 32rpx;
|
||||
}
|
||||
.popup-close.data-v-1714bad4 {
|
||||
font-size: 40rpx;
|
||||
color: #999;
|
||||
cursor: pointer;
|
||||
}
|
||||
.popup-body.data-v-1714bad4 {
|
||||
padding: 30rpx;
|
||||
max-height: 60vh;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.popup-footer.data-v-1714bad4 {
|
||||
display: flex;
|
||||
border-top: 1rpx solid #eee;
|
||||
}
|
||||
.popup-footer button.data-v-1714bad4 {
|
||||
flex: 1;
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
border-radius: 0;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
.popup-footer button.data-v-1714bad4::after {
|
||||
border: none;
|
||||
}
|
||||
.popup-footer .btn-cancel.data-v-1714bad4 {
|
||||
background: #f5f5f5;
|
||||
color: #666;
|
||||
}
|
||||
.popup-footer .btn-confirm.data-v-1714bad4 {
|
||||
color: #fff;
|
||||
}
|
||||
.upload-area.data-v-1714bad4 {
|
||||
background: #F8F8F;
|
||||
border: 2rpx dashed #C5D4F5;
|
||||
border-radius: 16rpx;
|
||||
padding: 40rpx 30rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-top: 16rpx;
|
||||
}
|
||||
.upload-icon.data-v-1714bad4 {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-bottom: 16rpx;
|
||||
}
|
||||
.upload-text.data-v-1714bad4 {
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
margin-bottom: 8rpx;
|
||||
}
|
||||
.upload-tip.data-v-1714bad4 {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
.upload-btn.data-v-1714bad4 {
|
||||
padding: 16rpx 48rpx;
|
||||
font-size: 28rpx;
|
||||
color: #fff;
|
||||
border-radius: 40rpx;
|
||||
}
|
||||
.file-list.data-v-1714bad4 {
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
.file-item.data-v-1714bad4 {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 16rpx 20rpx;
|
||||
background: #f5f5f5;
|
||||
border-radius: 8rpx;
|
||||
margin-bottom: 12rpx;
|
||||
}
|
||||
.file-name.data-v-1714bad4 {
|
||||
font-size: 26rpx;
|
||||
color: #333;
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.file-delete.data-v-1714bad4 {
|
||||
font-size: 36rpx;
|
||||
padding-left: 20rpx;
|
||||
}
|
||||
Reference in New Issue
Block a user