提交 9f7b6bb1 authored 作者: 邓文彬's avatar 邓文彬

fix(操作日志): 修改完成

上级 8a6985b1
<template>
<view class="search-com">
<view class="search-com-left">
<uni-data-select
class="uni-search-item"
v-model="searchFrom.inspectionType"
:localdata="inspectArr"
@change="(e) => change(e, 'inspectionType')"
placeholder="全部巡检"
></uni-data-select>
<uni-data-select
class="uni-search-item"
v-model="searchFrom.iSync"
:localdata="synchronization"
placeholder="全部"
@change="(e) => change(e, 'iSynchronization')"
></uni-data-select>
<uni-data-select
class="uni-search-item"
v-model="searchFrom.isException"
:localdata="exceptionArr"
placeholder="有无异常"
@change="(e) => change(e, 'isException')"
></uni-data-select>
</view>
<view class="search-com-right">
<uni-datetime-picker
class="uni-datetime-picker"
type="daterange"
v-model="searchFrom.inspectionTime"
:border="false"
@change="(e) => change(e, 'inspectionTime')"
/>
</view>
</view>
</template>
<script>
export default {
data() {
return {
searchFrom: {
inspectionType: "", // 巡检类型
iSynchronization: "", // 同部数据
isException: "", // 有无异常
inspectionTime: "", // 时间选择
},
inspectArr: [
// { value: 0, text: "全部巡检" },
{ value: 1, text: "机房巡检" },
{ value: 2, text: "进到巡检" },
],
synchronization: [
// { value: 0, text: "全部" },
{ value: 1, text: "未同步" },
{ value: 2, text: "已同步" },
],
exceptionArr: [
{ value: 0, text: "有无异常" },
{ value: 1, text: "有异常" },
{ value: 2, text: "无异常" },
],
};
},
methods: {
change(e, key) {
this.searchFrom[key] = e;
this.$emit("change", this.searchFrom);
},
},
};
</script>
<style lang="less" scoped>
.search-com {
display: flex;
align-items: center;
.search-com-left {
display: flex;
align-items: center;
border: 1px solid;
flex: 1;
.uni-search-item {
margin-right: 12px;
width: 130px;
background: #fff;
border-radius: 4px;
border: none !important;
}
}
.search-com-right {
width: 300px;
.uni-datetime-picker {
background: #fff;
border: 1px solid;
}
}
}
</style>
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
<view class="month-record-item" v-for="item in 20" :key="item"> <view class="month-record-item" v-for="item in 20" :key="item">
<view class="seconed-title"> 2024年08月 </view> <view class="seconed-title"> 2024年08月 </view>
<view class="inspect-list"> <view class="inspect-list">
<InspectionItem /> <InspectionItem />
</view> </view>
...@@ -182,7 +183,7 @@ export default { ...@@ -182,7 +183,7 @@ export default {
} }
.month-list { .month-list {
height: calc(100vh - 166px - 25px - 16px); height: calc(100vh - 166px - 25px - 16px - 16px - 20px);
overflow: auto; overflow: auto;
.month-record-item { .month-record-item {
margin-bottom: 24px; margin-bottom: 24px;
......
...@@ -23,32 +23,65 @@ ...@@ -23,32 +23,65 @@
</view> </view>
<view class="button-group"> <view class="button-group">
<view class="log-button">操作日志</view> <view class="log-button" @click="lookLog">操作日志</view>
<view class="reset-password-button">修改密码?</view> <view class="reset-password-button" @click="updatePassword"
>修改密码?</view
>
<view class="reset-password-button" @click="logOut">退出账号?</view>
</view> </view>
</view> </view>
<!-- 内容区 --> <!-- 内容区 -->
<view class="right-container"> <view class="right-container">
<Content v-if="activeTabIndex == 0" /> <!-- 首页 -->
<Content v-if="activeTabIndex == 0" />
<!-- 巡检管理 -->
<InspectionManagement v-if="activeTabIndex == 1" />
<!-- 同步管理 -->
<SynchronousManagement v-if="activeTabIndex == 2" />
<!-- 日志 -->
<OperLog v-if="activeTabIndex == 4" />
</view> </view>
<!-- 退出账号弹出 -->
<uni-popup ref="inputDialog2" type="dialog">
<uni-popup-dialog
ref="inputClose2"
mode="base"
title="确定退出该账号?"
@confirm="dialogInputConfirm2"
>
</uni-popup-dialog>
</uni-popup>
</view> </view>
</template> </template>
<script> <script>
import InspectionItem from "@/components/inspectionItem/index.vue"; import InspectionItem from "@/components/inspectionItem/index.vue";
import Content from "./content.vue"; import InspectionManagement from "@/pages/inspectionManagement/index.vue";
import SynchronousManagement from "@/pages/synchronousManagement/index.vue";
import OperLog from "@/pages/index/operLog.vue"
import Content from "./content.vue";
export default { export default {
components: { components: {
InspectionItem, InspectionItem,
Content Content,
InspectionManagement,
SynchronousManagement,
OperLog
}, },
data() { data() {
return { return {
activeTabIndex: 0, activeTabIndex: 3,
tabList: [ tabList: [
{ {
defaultIcon: "iconfont icon-yingyongyewuguanli1", defaultIcon: "iconfont icon-yingyongyewuguanli1",
...@@ -69,6 +102,39 @@ export default { ...@@ -69,6 +102,39 @@ export default {
}; };
}, },
methods: { methods: {
// 修改密码
updatePassword() {
uni.navigateTo({
url: "/pages/index/editPd",
});
},
// 查看操作日志
lookLog() {
// console.log('查看操作日志');
// uni.navigateTo({
// url: "/pages/index/operLog",
// });
this.activeTabIndex = 4
},
//退出--弹出对话框
dialogInputConfirm2() {
let _this = this;
uni.redirectTo({
url: "/pages/login/login",
success() {
_this.$store.commit("SET_USER", {});
},
});
},
//退出
logOut() {
this.$refs.inputDialog2.open();
},
// 切换tab
tabClick(item, index) { tabClick(item, index) {
console.log("----"); console.log("----");
this.activeTabIndex = index; this.activeTabIndex = index;
...@@ -180,6 +246,8 @@ export default { ...@@ -180,6 +246,8 @@ export default {
flex: 1; flex: 1;
margin-left: 16px; margin-left: 16px;
z-index: 10; z-index: 10;
padding-top: 32px;
padding-right: 16px;
// .card-list { // .card-list {
// display: flex; // display: flex;
......
<template> <template>
<view class="content"> <view class="content">
<!-- 导航栏 --> <!-- 导航栏 -->
<uni-nav-bar dark :fixed="true" background-color="#5474e8" status-bar left-icon="left" left-text="返回" <!-- <uni-nav-bar dark :fixed="true" background-color="#5474e8" status-bar left-icon="left" left-text="返回"
@clickLeft="back" title="安全监管管理平台" /> @clickLeft="back" title="安全监管管理平台" /> -->
<view class="main"> <view class="main">
<!-- 搜索区域 --> <!-- 搜索区域 -->
<view class="content-box box-shaow-box"> <view class="content-box box-shaow-box">
<view class="content_header"> <view class="content_header"> 操作日志(超管专用) </view>
操作日志(超管专用) <view class="search-box-item">
</view> <span class="text">操作模块:</span>
<view class="search-box-item"> <uni-data-checkbox
<span class="text">操作模块:</span> mode="tag"
<uni-data-checkbox mode="tag" v-model="searchForm.type" :localdata="typeList" v-model="searchForm.type"
@change="selectChange"></uni-data-checkbox> :localdata="typeList"
</view> @change="selectChange"
<view class="search-box-item pl"> ></uni-data-checkbox>
<span class="text">时间:</span> </view>
<time-select @change="timeChange"></time-select> <view class="search-box-item pl">
</view> <span class="text">时间:</span>
</view> <time-select @change="timeChange"></time-select>
</view>
</view>
<!-- 展示区域 --> <!-- 展示区域 -->
<view class="table-main box-shaow-box"> <view class="table-main box-shaow-box">
<view class="table-main-custom"> <view class="table-main-custom">
<!-- 查询结果 --> <!-- 查询结果 -->
<view class="search-result"> <view class="search-result">
<span class="search-result-text">查询结果:</span> <span class="search-result-text">查询结果:</span>
<span class="search-result-number">{{total}}</span> <span class="search-result-number">{{ total }}</span>
</view> </view>
</view> </view>
<view class="table-box"> <view class="table-box">
<uni-table ref="table" :loading="loading" border stripe emptyText="暂无更多数据"> <uni-table
<uni-tr> ref="table"
<uni-th width="60" align="center">序号</uni-th> :loading="loading"
<uni-th align="center">角色</uni-th> border
<uni-th align="center">操作员账号</uni-th> stripe
<uni-th align="center">操作模块</uni-th> emptyText="暂无更多数据"
<uni-th width="200" align="center">操作详情(名称+编号)</uni-th> >
<uni-th align="center">操作类型</uni-th> <uni-tr>
<uni-th align="center">操作时间</uni-th> <uni-th width="60" align="center">序号</uni-th>
<uni-th align="center">角色</uni-th>
</uni-tr> <uni-th align="center">操作员账号</uni-th>
<uni-tr v-for="(item, index) in tableData" :key="index"> <uni-th align="center">操作模块</uni-th>
<uni-td>{{index+1}}</uni-td> <uni-th width="200" align="center">操作详情(名称+编号)</uni-th>
<uni-td>{{ item.name }}</uni-td> <uni-th align="center">操作类型</uni-th>
<uni-td> <uni-th align="center">操作时间</uni-th>
<view class="name">{{ item.user }}</view> </uni-tr>
</uni-td> <uni-tr v-for="(item, index) in tableData" :key="index">
<uni-td align="center">{{ item.module }}</uni-td> <uni-td>{{ index + 1 }}</uni-td>
<uni-td align="center">{{ item.detail }}</uni-td> <uni-td>{{ item.name }}</uni-td>
<uni-td align="center">{{ item.type }}</uni-td> <uni-td>
<uni-td align="center">{{ item.time }}</uni-td> <view class="name">{{ item.user }}</view>
</uni-tr> </uni-td>
</uni-table> <uni-td align="center">{{ item.module }}</uni-td>
</view> <uni-td align="center">{{ item.detail }}</uni-td>
<view class="uni-pagination-box"> <uni-td align="center">{{ item.type }}</uni-td>
<uni-pagination show-icon :page-size="pageSize" :current="pageCurrent" :total="total" <uni-td align="center">{{ item.time }}</uni-td>
@change="change" /> </uni-tr>
</view> </uni-table>
</view> </view>
</view> <view class="uni-pagination-box">
</view> <uni-pagination
show-icon
:page-size="pageSize"
:current="pageCurrent"
:total="total"
@change="change"
/>
</view>
</view>
</view>
</view>
</template> </template>
<script> <script>
import getDateTime from "@/common/getdateTime.js" import getDateTime from "@/common/getdateTime.js";
import timeSelect from "@/components/global/timeSelect.vue" import timeSelect from "@/components/global/timeSelect.vue";
export default { export default {
components: { components: {
timeSelect timeSelect,
}, },
data() { data() {
return { return {
searchVal: '', searchVal: "",
allData: [], allData: [],
tableData: [], tableData: [],
// 每页数据量 // 每页数据量
pageSize: 10, pageSize: 10,
// 当前页 // 当前页
pageCurrent: 1, pageCurrent: 1,
// 数据总量 // 数据总量
total: 0, total: 0,
loading: false, loading: false,
typeList: [{ typeList: [
text: '全部', {
value: '' text: "全部",
}, value: "",
{ },
text: '巡检', {
value: '巡检' text: "巡检",
}, value: "巡检",
{ },
text: '报修', {
value: '报修' text: "报修",
}, value: "报修",
{ },
text: '报告', {
value: '报告' text: "报告",
}, value: "报告",
{ },
text: '同步', {
value: '同步' text: "同步",
}, value: "同步",
{ },
text: '其他', {
value: '其他' text: "其他",
}, value: "其他",
], },
searchForm: { ],
type: '', searchForm: {
startTime: '', type: "",
endTime: '' startTime: "",
}, endTime: "",
recordData: [] },
} recordData: [],
}, };
created() {}, },
onNavigationBarButtonTap(val) { created() {},
uni.navigateBack() onNavigationBarButtonTap(val) {
}, uni.navigateBack();
onLoad() { },
this.recordData = this.$store.state.oper_record onLoad() {
this.selectChange() this.recordData = this.$store.state.oper_record;
}, this.selectChange();
methods: { },
timeChange(val) { methods: {
this.searchForm.startTime = val.startTime timeChange(val) {
this.searchForm.endTime = val.endTime this.searchForm.startTime = val.startTime;
this.selectChange() this.searchForm.endTime = val.endTime;
}, this.selectChange();
selectChange() { },
const { selectChange() {
type, const { type, startTime, endTime } = this.searchForm;
startTime, this.allData = this.recordData.filter((item) => {
endTime let matchType = true; // 类型筛选
} = this.searchForm let matchTime = true; // 时间筛选
this.allData = this.recordData.filter(item => { if (type) {
let matchType = true; // 类型筛选 matchType = item.module == type || item.type == type;
let matchTime = true; // 时间筛选 }
if (type) {
matchType = item.module == type || item.type == type
}
if (startTime && endTime) { if (startTime && endTime) {
matchTime = Date.parse(item.time) <= Date.parse(endTime) && Date.parse(item.time) >= Date matchTime =
.parse(startTime) Date.parse(item.time) <= Date.parse(endTime) &&
} Date.parse(item.time) >= Date.parse(startTime);
return matchType && matchTime }
}) return matchType && matchTime;
this.getData(1) });
}, this.getData(1);
back() { },
uni.navigateBack() back() {
}, uni.navigateBack();
// 分页触发 },
change(e) { // 分页触发
this.getData(e.current) change(e) {
}, this.getData(e.current);
// 获取数据 },
getData(pageCurrent, value = '') { // 获取数据
this.loading = true getData(pageCurrent, value = "") {
this.pageCurrent = pageCurrent this.loading = true;
this.request({ this.pageCurrent = pageCurrent;
pageSize: this.pageSize, this.request({
pageCurrent: pageCurrent, pageSize: this.pageSize,
value: value, pageCurrent: pageCurrent,
success: res => { value: value,
// console.log('data', res); success: (res) => {
this.tableData = res.data // console.log('data', res);
this.total = res.total this.tableData = res.data;
this.loading = false this.total = res.total;
} this.loading = false;
}) },
}, });
// 伪request请求 },
request(options) { // 伪request请求
const { request(options) {
pageSize, const { pageSize, pageCurrent, success, value } = options;
pageCurrent, let total = this.allData.length;
success, let data = this.allData.filter((item, index) => {
value const idx = index - (pageCurrent - 1) * pageSize;
} = options return idx < pageSize && idx >= 0;
let total = this.allData.length });
let data = this.allData.filter((item, index) => { if (value) {
const idx = index - (pageCurrent - 1) * pageSize data = [];
return idx < pageSize && idx >= 0 this.allData.forEach((item) => {
}) if (item.name.indexOf(value) !== -1) {
if (value) { data.push(item);
data = [] }
this.allData.forEach(item => { });
if (item.name.indexOf(value) !== -1) { total = data.length;
data.push(item) }
}
})
total = data.length
}
setTimeout(() => { setTimeout(() => {
typeof success === 'function' && typeof success === "function" &&
success({ success({
data: data, data: data,
total: total total: total,
}) });
}, 500) }, 500);
} },
} },
} };
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
/deep/.uni-table-scroll { /deep/.uni-table-scroll {
max-height: 210rpx; max-height: 210rpx;
overflow-y: auto; overflow-y: auto;
} }
/deep/.page--active {
color: #5474e8;
color: #ffffff;
}
/deep/.uni-pagination__num-tag { /deep/.page--active {
min-width: 30px color: #5474e8;
} color: #ffffff;
}
.content { /deep/.uni-pagination__num-tag {
.main { min-width: 30px;
width: 100%; }
// height: 100%;
// background-color: red;
background-image: linear-gradient(0deg, #f3f6fa 0%, rgba(130, 153, 238, 0.73) 49%, #5474e8 100%);
background-size: 100% 40rpx;
background-repeat: no-repeat;
.content-box { .content {
width: 730rpx; .main {
margin: 0 auto; width: 100%;
padding: 20px 30px 10px 20px; // height: 100%;
margin-bottom: 20px; // background-color: red;
background-image: linear-gradient(
0deg,
#f3f6fa 0%,
rgba(130, 153, 238, 0.73) 49%,
#5474e8 100%
);
background-size: 100% 40rpx;
background-repeat: no-repeat;
.content_header { .content-box {
border-left: 2px solid #5474e8; width: 730rpx;
padding-left: 5px; margin: 0 auto;
height: 18px; padding: 20px 30px 10px 20px;
line-height: 18px; margin-bottom: 20px;
margin-bottom: 10px;
}
.search-box-item { .content_header {
// margin-bottom: 15px; border-left: 2px solid #5474e8;
position: relative; padding-left: 5px;
height: 18px;
line-height: 18px;
margin-bottom: 10px;
}
.text { .search-box-item {
font-size: 9.41rpx; // margin-bottom: 15px;
color: #778ca2; position: relative;
margin-right: 5.88rpx;
}
.time-input { .text {
position: absolute; font-size: 9.41rpx;
top: 0; color: #778ca2;
left: 244.12rpx; margin-right: 5.88rpx;
} }
}
.pl { .time-input {
padding-left: 24px; position: absolute;
} top: 0;
} left: 244.12rpx;
}
}
.table-main { .pl {
width: 730rpx; padding-left: 24px;
margin: 0 auto; }
height: 290rpx; }
position: relative;
.uni-pagination-box { .table-main {
position: absolute; width: 730rpx;
right: 10px; margin: 0 auto;
bottom: 10px; height: 290rpx;
} position: relative;
.table-main-custom { .uni-pagination-box {
width: 100%; position: absolute;
height: 48px; right: 10px;
padding: 0 40px 0 20px; bottom: 10px;
// background-color: #4061d5; }
background-color: rgba(64, 97, 213, 0.06);
box-shadow: 0px 0px 4px 0px rgba(84, 116, 232, 0.16);
border-radius: 10px 10px 0px 0px;
display: flex;
justify-content: space-between;
align-items: center;
.search-result { .table-main-custom {
.search-result-text { width: 100%;
color: rgba(119, 140, 162, .7); height: 48px;
margin-right: 5px; padding: 0 40px 0 20px;
} // background-color: #4061d5;
background-color: rgba(64, 97, 213, 0.06);
box-shadow: 0px 0px 4px 0px rgba(84, 116, 232, 0.16);
border-radius: 10px 10px 0px 0px;
display: flex;
justify-content: space-between;
align-items: center;
.search-result-number { .search-result {
color: #32343b; .search-result-text {
} color: rgba(119, 140, 162, 0.7);
} margin-right: 5px;
}
} .search-result-number {
color: #32343b;
}
}
}
.table-box { .table-box {
padding: 10px; padding: 10px;
} }
} }
} }
} }
</style> </style>
\ No newline at end of file
<template>
<view class="inspection-management">
<!-- 搜索项 -->
<SearchCom @change="change" />
<!-- 结果 -->
<view class="inspection-management-content">
<view class="count-tatal">
<text class="num">123条</text>
<text>查询结果</text>
</view>
<view class="month-list">
<!-- 每月记录 -->
<view class="month-record-item" v-for="item in 20" :key="item">
<view class="seconed-title"> 2024年08月 </view>
<view class="inspect-list">
<InspectionItem />
</view>
</view>
</view>
</view>
<!-- 开始巡检 -->
<view class="inspection-button">开始巡检</view>
</view>
</template>
<script>
import SearchCom from "@/components/searchCom/index.vue";
import InspectionItem from "@/components/inspectionItem/index.vue";
export default {
components: {
SearchCom,
InspectionItem,
},
data() {
return {};
},
methods: {
change(e) {
console.log("----", e);
},
},
};
</script>
<style scoped lang="less">
.inspection-management {
padding-top: 16px;
.count-tatal {
margin: 16px 0 8px 0;
font-size: 14px;
color: #4a4a4a;
font-weight: 400;
.num {
font-size: 18px;
color: #3774f6;
line-height: 26px;
font-weight: 500;
}
}
.inspection-management-content {
.month-list {
height: calc(100vh - 26px - 16px - 8px - 36px - 62px);
border: 1px solid;
overflow: auto;
.seconed-title {
margin-top: 16px;
font-size: 18px;
color: #000000;
font-weight: bold;
}
.month-record-item {
margin-bottom: 24px;
&:last-of-type {
margin: 0;
}
.inspect-list {
display: flex;
flex-wrap: wrap;
}
}
}
}
.inspection-button {
display: flex;
align-items: center;
justify-content: center;
position: fixed;
bottom: 60px;
width: 240px;
height: 40px;
left: 50%;
color: #fff;
transform: translateX(-50%);
background-image: linear-gradient(180deg, #3773f6 0%, #2c57f6 99%);
box-shadow: 0px 10px 24px 0px rgba(51, 104, 246, 0.24);
border-radius: 27px;
}
}
</style>
...@@ -41,7 +41,7 @@ export default { ...@@ -41,7 +41,7 @@ export default {
return { return {
person: { person: {
user: "test", user: "test",
pd: "Aa123456789", pd: "Aa123456",
}, },
backButtonPress: 0, backButtonPress: 0,
personList: [], personList: [],
...@@ -112,10 +112,10 @@ export default { ...@@ -112,10 +112,10 @@ export default {
// 点击登录 // 点击登录
login() { login() {
// url: "/pages/index/index", // url: "/pages/index/index",
uni.navigateTo({ // uni.navigateTo({
url: "/pages/home/home", // url: "/pages/home/home",
}); // });
return; // return;
// 是否输入账号密码 // 是否输入账号密码
if (this.person.user && this.person.pd) { if (this.person.user && this.person.pd) {
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
<uni-forms-item label="客户单位:" required> <uni-forms-item label="客户单位:" required>
<hintInput :maxlength="50" :disabled="!baseFormData.customerUnit" <hintInput :maxlength="50" :disabled="!baseFormData.customerUnit"
v-model="baseFormData.customerUnit" @fous="showDialogType('unit')" v-model="baseFormData.customerUnit" @fous="showDialogType('unit')"
:configData='dialogCofig' :isShow="dialogShow"> :configData='dialogCofig' :isShow=hintInput"dialogShow">
</hintInput> </hintInput>
</uni-forms-item> </uni-forms-item>
</uni-col> </uni-col>
......
<template>
<view class="synchronous-dialog">
<view class="synchronous-content">
<view class="row-item">
<text class="title">待打包数据</text>
</view>
<view class="row-item count-num">
<text class="num">132</text>
<text></text>
</view>
<view class="operating-instructions">
<view class="title">操作说明:</view>
<view class="instructions-item">
1、在PAD端,点击“数据打包”,做好同步准备。
</view>
<view class="instructions-item">
2、完成打包后,将PAD直联PC机,等待PC机自动导入需同步记录。
</view>
<view class="instructions-item">
3、PC端自动导入完成后,请点击“同步数据”,同步成功后,列表自动刷新展示同步数据;且PAD同步的数据不支持修改。
</view>
</view>
<view class="row-item bottom-row">
<button class="button" :loading="loading" @click="packedData">
数据打包
</button>
</view>
<!-- 关闭按钮 -->
<div class="close-button">
<text class="iconfont icon-a-bianzu16beifen" @click="close"></text>
</div>
</view>
</view>
</template>
<script>
import {
SYNCHRONIZE_DATA_PAD,
checkAndCreateDirectory,
createFileWithPlusIO,
setSm2,
TEST,
} from "@/utils/systemCofig";
import getDateTime from "@/common/getdateTime.js";
export default {
components: {},
data() {
return {
loading: false,
};
},
methods: {
change(e) {
console.log("----", e);
},
close() {
this.$emit("close");
},
packedData() {
this.loading = true;
const userName = this.$store.state.now_user.name;
let timeStr = getDateTime.dateTimeStr("y-m-d h-i-s");
let fileName = `${userName}${timeStr}.txt`;
const fileContent = setSm2(TEST);
createFileWithPlusIO(
`${SYNCHRONIZE_DATA_PAD}/同步数据`,
fileName,
fileContent
)
.then((res) => {
console.log("---写入成功", res);
uni.showToast({
title: "打包成功",
icon: "none",
duration: 2000,
});
this.loading = false;
this.close()
})
.catch(() => {
uni.showToast({
title: "打包失败",
icon: "none",
duration: 2000,
});
this.loading = false;
});
},
},
};
</script>
<style scoped lang="less">
.synchronous-dialog {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
display: flex;
align-items: center;
justify-content: center;
.synchronous-content {
padding: 3% 20px 32px 24px;
width: 400px;
height: 60%;
box-sizing: border-box;
background-image: linear-gradient(
-6deg,
#f9ffe7 0%,
#ffffff 12%,
#fcfeff 73%,
#ccf1ff 100%
);
border: 0.4px solid rgba(224, 224, 224, 1);
border-radius: 12px;
position: relative;
.row-item {
display: flex;
align-items: center;
justify-content: center;
}
.title {
font-family: PingFangSC-Medium;
font-size: 18px;
color: #000000;
text-align: center;
line-height: 26px;
font-weight: 500;
}
.count-num {
margin: 5% 0 5% 0;
align-items: flex-end;
.num {
display: inline-block;
font-family: AlibabaPuHuiTi_2_65_Medium;
font-size: 50px;
color: #3774f6;
line-height: 44px;
font-weight: 500;
}
}
.operating-instructions {
margin-bottom: 8%;
.title {
font-size: 13px;
color: #4a4a4a;
line-height: 24px;
font-weight: 600;
text-align: left;
}
.instructions-item {
font-size: 12px;
color: #7c7c7c;
line-height: 22px;
font-weight: 400;
}
}
// 打包按钮
.bottom-row {
position: absolute;
bottom: 24px;
left: 50%;
transform: translateX(-50%);
.button {
display: flex;
align-items: center;
justify-content: center;
background-image: linear-gradient(180deg, #3773f6 0%, #2c57f6 99%);
box-shadow: 0px 10px 24px 0px rgba(51, 104, 246, 0.24);
border-radius: 27px;
width: 160px;
height: 40px;
color: #fff;
}
}
// 关闭按钮
.close-button {
position: absolute;
bottom: -40px;
left: 50%;
transform: translateX(-50%);
.iconfont {
color: #fff;
font-size: 24px;
}
}
}
}
</style>
<template>
<view class="synchronous-management">
<!-- 搜索项 -->
<SearchCom @change="change" />
<!-- 结果 -->
<view class="synchronous-management-content">
<view class="count-tatal">
<text class="num">123条</text>
<text>查询结果</text>
</view>
<view class="month-list">
<!-- 每月记录 -->
<view class="month-record-item" v-for="item in 20" :key="item">
<view class="seconed-title"> 2024年08月 </view>
<view class="inspect-list">
<InspectionItem />
</view>
</view>
</view>
</view>
<!-- 数据打包 -->
<view class="synchronous-button" @click="openDialog(true)">数据打包</view>
<!-- 打包弹窗 -->
<Dialog v-show="isDialog" @close="openDialog(false)"></Dialog>
</view>
</template>
<script>
import SearchCom from "@/components/searchCom/index.vue";
import InspectionItem from "@/components/inspectionItem/index.vue";
import Dialog from "./dialog.vue";
export default {
components: {
SearchCom,
InspectionItem,
Dialog
},
data() {
return {
isDialog: false, //
};
},
methods: {
change(e) {
console.log("----", e);
},
openDialog(show){
this.isDialog = show;
}
},
};
</script>
<style scoped lang="less">
.synchronous-management {
padding-top: 16px;
.count-tatal {
margin: 16px 0 8px 0;
font-size: 14px;
color: #4a4a4a;
font-weight: 400;
.num {
font-size: 18px;
color: #3774f6;
line-height: 26px;
font-weight: 500;
}
}
.synchronous-management-content {
.month-list {
height: calc(100vh - 26px - 16px - 8px - 36px - 62px);
border: 1px solid;
overflow: auto;
.seconed-title {
margin-top: 16px;
font-size: 18px;
color: #000000;
font-weight: bold;
}
.month-record-item {
margin-bottom: 24px;
&:last-of-type {
margin: 0;
}
.inspect-list {
display: flex;
flex-wrap: wrap;
}
}
}
}
.synchronous-button {
display: flex;
align-items: center;
justify-content: center;
position: fixed;
bottom: 60px;
width: 240px;
height: 40px;
left: 50%;
color: #fff;
transform: translateX(-50%);
background-image: linear-gradient(180deg, #3773f6 0%, #2c57f6 99%);
box-shadow: 0px 10px 24px 0px rgba(51, 104, 246, 0.24);
border-radius: 27px;
}
}
</style>
## 1.0.8(2024-03-28)
- 修复 在vue2下:style动态绑定导致编译失败的bug
## 1.0.7(2024-01-20)
- 修复 长文本回显超过容器的bug,超过容器部分显示省略号
## 1.0.6(2023-04-12)
- 修复 微信小程序点击时会改变背景颜色的 bug
## 1.0.5(2023-02-03) ## 1.0.5(2023-02-03)
- 修复 禁用时会显示清空按钮 - 修复 禁用时会显示清空按钮
## 1.0.4(2023-02-02) ## 1.0.4(2023-02-02)
......
...@@ -4,14 +4,18 @@ ...@@ -4,14 +4,18 @@
<view class="uni-stat-box" :class="{'uni-stat__actived': current}"> <view class="uni-stat-box" :class="{'uni-stat__actived': current}">
<view class="uni-select" :class="{'uni-select--disabled':disabled}"> <view class="uni-select" :class="{'uni-select--disabled':disabled}">
<view class="uni-select__input-box" @click="toggleSelector"> <view class="uni-select__input-box" @click="toggleSelector">
<view v-if="current" class="uni-select__input-text">{{current}}</view> <view v-if="current" class="uni-select__input-text">{{textShow}}</view>
<view v-else class="uni-select__input-text uni-select__input-placeholder">{{typePlaceholder}}</view> <view v-else class="uni-select__input-text uni-select__input-placeholder">{{typePlaceholder}}</view>
<uni-icons v-if="current && clear && !disabled" type="clear" color="#c0c4cc" size="24" @click="clearVal" /> <view v-if="current && clear && !disabled" @click.stop="clearVal">
<uni-icons v-else :type="showSelector? 'top' : 'bottom'" size="14" color="#999" /> <uni-icons type="clear" color="#c0c4cc" size="24" />
</view>
<view v-else>
<uni-icons :type="showSelector? 'top' : 'bottom'" size="14" color="#999" />
</view>
</view> </view>
<view class="uni-select--mask" v-if="showSelector" @click="toggleSelector" /> <view class="uni-select--mask" v-if="showSelector" @click="toggleSelector" />
<view class="uni-select__selector" v-if="showSelector"> <view class="uni-select__selector" :style="getOffsetByPlacement" v-if="showSelector">
<view class="uni-popper__arrow"></view> <view :class="placement=='bottom'?'uni-popper__arrow_bottom':'uni-popper__arrow_top'"></view>
<scroll-view scroll-y="true" class="uni-select__selector-scroll"> <scroll-view scroll-y="true" class="uni-select__selector-scroll">
<view class="uni-select__selector-empty" v-if="mixinDatacomResData.length === 0"> <view class="uni-select__selector-empty" v-if="mixinDatacomResData.length === 0">
<text>{{emptyTips}}</text> <text>{{emptyTips}}</text>
...@@ -39,11 +43,14 @@ ...@@ -39,11 +43,14 @@
* @property {String} label 左侧标题 * @property {String} label 左侧标题
* @property {String} placeholder 输入框的提示文字 * @property {String} placeholder 输入框的提示文字
* @property {Boolean} disabled 是否禁用 * @property {Boolean} disabled 是否禁用
* @property {String} placement 弹出位置
* @value top 顶部弹出
* @value bottom 底部弹出(default)
* @event {Function} change 选中发生变化触发 * @event {Function} change 选中发生变化触发
*/ */
export default { export default {
name: "uni-stat-select", name: "uni-data-select",
mixins: [uniCloud.mixinDatacom || {}], mixins: [uniCloud.mixinDatacom || {}],
props: { props: {
localdata: { localdata: {
...@@ -89,6 +96,10 @@ ...@@ -89,6 +96,10 @@
type: String, type: String,
default: '' default: ''
}, },
placement: {
type: String,
default: 'bottom'
}
}, },
data() { data() {
return { return {
...@@ -121,15 +132,32 @@ ...@@ -121,15 +132,32 @@
common + placeholder : common + placeholder :
common common
}, },
valueCom(){ valueCom() {
// #ifdef VUE3 // #ifdef VUE3
return this.modelValue; return this.modelValue;
// #endif // #endif
// #ifndef VUE3 // #ifndef VUE3
return this.value; return this.value;
// #endif // #endif
},
textShow() {
// 长文本显示
let text = this.current;
if (text.length > 10) {
return text.slice(0, 25) + '...';
}
return text;
},
getOffsetByPlacement() {
switch (this.placement) {
case 'top':
return "bottom:calc(100% + 12px);";
case 'bottom':
return "top:calc(100% + 12px);";
}
} }
}, },
watch: { watch: {
localdata: { localdata: {
immediate: true, immediate: true,
...@@ -149,10 +177,11 @@ ...@@ -149,10 +177,11 @@
this.initDefVal() this.initDefVal()
} }
} }
} },
}, },
methods: { methods: {
debounce(fn, time = 100){ debounce(fn, time = 100) {
let timer = null let timer = null
return function(...args) { return function(...args) {
if (timer) clearTimeout(timer) if (timer) clearTimeout(timer)
...@@ -162,11 +191,11 @@ ...@@ -162,11 +191,11 @@
} }
}, },
// 执行数据库查询 // 执行数据库查询
query(){ query() {
this.mixinDatacomEasyGet(); this.mixinDatacomEasyGet();
}, },
// 监听查询条件变更事件 // 监听查询条件变更事件
onMixinDatacomPropsChange(){ onMixinDatacomPropsChange() {
if (this.collection) { if (this.collection) {
this.debounceGet(); this.debounceGet();
} }
...@@ -189,9 +218,9 @@ ...@@ -189,9 +218,9 @@
} }
defValue = defItem defValue = defItem
} }
if (defValue || defValue === 0) { if (defValue || defValue === 0) {
this.emit(defValue) this.emit(defValue)
} }
} }
const def = this.mixinDatacomResData.find(item => item.value === defValue) const def = this.mixinDatacomResData.find(item => item.value === defValue)
this.current = def ? this.formatItemName(def) : '' this.current = def ? this.formatItemName(def) : ''
...@@ -227,9 +256,9 @@ ...@@ -227,9 +256,9 @@
} }
}, },
emit(val) { emit(val) {
this.$emit('change', val)
this.$emit('input', val) this.$emit('input', val)
this.$emit('update:modelValue', val) this.$emit('update:modelValue', val)
this.$emit('change', val)
if (this.collection) { if (this.collection) {
this.setCache(val); this.setCache(val);
} }
...@@ -254,7 +283,7 @@ ...@@ -254,7 +283,7 @@
let str = ""; let str = "";
str = this.format; str = this.format;
for (let key in item) { for (let key in item) {
str = str.replace(new RegExp(`{${key}}`,"g"),item[key]); str = str.replace(new RegExp(`{${key}}`, "g"), item[key]);
} }
return str; return str;
} else { } else {
...@@ -268,26 +297,26 @@ ...@@ -268,26 +297,26 @@
} }
}, },
// 获取当前加载的数据 // 获取当前加载的数据
getLoadData(){ getLoadData() {
return this.mixinDatacomResData; return this.mixinDatacomResData;
}, },
// 获取当前缓存key // 获取当前缓存key
getCurrentCacheKey(){ getCurrentCacheKey() {
return this.collection; return this.collection;
}, },
// 获取缓存 // 获取缓存
getCache(name=this.getCurrentCacheKey()){ getCache(name = this.getCurrentCacheKey()) {
let cacheData = uni.getStorageSync(this.cacheKey) || {}; let cacheData = uni.getStorageSync(this.cacheKey) || {};
return cacheData[name]; return cacheData[name];
}, },
// 设置缓存 // 设置缓存
setCache(value, name=this.getCurrentCacheKey()){ setCache(value, name = this.getCurrentCacheKey()) {
let cacheData = uni.getStorageSync(this.cacheKey) || {}; let cacheData = uni.getStorageSync(this.cacheKey) || {};
cacheData[name] = value; cacheData[name] = value;
uni.setStorageSync(this.cacheKey, cacheData); uni.setStorageSync(this.cacheKey, cacheData);
}, },
// 删除缓存 // 删除缓存
removeCache(name=this.getCurrentCacheKey()){ removeCache(name = this.getCurrentCacheKey()) {
let cacheData = uni.getStorageSync(this.cacheKey) || {}; let cacheData = uni.getStorageSync(this.cacheKey) || {};
delete cacheData[name]; delete cacheData[name];
uni.setStorageSync(this.cacheKey, cacheData); uni.setStorageSync(this.cacheKey, cacheData);
...@@ -302,7 +331,6 @@ ...@@ -302,7 +331,6 @@
$uni-secondary-color: #909399 !default; $uni-secondary-color: #909399 !default;
$uni-border-3: #e5e5e5; $uni-border-3: #e5e5e5;
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
@media screen and (max-width: 500px) { @media screen and (max-width: 500px) {
.hide-on-phone { .hide-on-phone {
...@@ -315,7 +343,9 @@ ...@@ -315,7 +343,9 @@
display: flex; display: flex;
align-items: center; align-items: center;
// padding: 15px; // padding: 15px;
/* #ifdef H5 */
cursor: pointer; cursor: pointer;
/* #endif */
width: 100%; width: 100%;
flex: 1; flex: 1;
box-sizing: border-box; box-sizing: border-box;
...@@ -401,7 +431,6 @@ ...@@ -401,7 +431,6 @@
box-sizing: border-box; box-sizing: border-box;
/* #endif */ /* #endif */
position: absolute; position: absolute;
top: calc(100% + 12px);
left: 0; left: 0;
width: 100%; width: 100%;
background-color: #FFFFFF; background-color: #FFFFFF;
...@@ -419,6 +448,15 @@ ...@@ -419,6 +448,15 @@
/* #endif */ /* #endif */
} }
/* #ifdef H5 */
@media (min-width: 768px) {
.uni-select__selector-scroll {
max-height: 600px;
}
}
/* #endif */
.uni-select__selector-empty, .uni-select__selector-empty,
.uni-select__selector-item { .uni-select__selector-item {
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
...@@ -449,18 +487,21 @@ ...@@ -449,18 +487,21 @@
} }
/* picker 弹出层通用的指示小三角 */ /* picker 弹出层通用的指示小三角 */
.uni-popper__arrow, .uni-popper__arrow_bottom,
.uni-popper__arrow::after { .uni-popper__arrow_bottom::after,
position: absolute; .uni-popper__arrow_top,
display: block; .uni-popper__arrow_top::after,
width: 0; {
height: 0; position: absolute;
border-color: transparent; display: block;
border-style: solid; width: 0;
border-width: 6px; height: 0;
border-color: transparent;
border-style: solid;
border-width: 6px;
} }
.uni-popper__arrow { .uni-popper__arrow_bottom {
filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.03)); filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.03));
top: -6px; top: -6px;
left: 10%; left: 10%;
...@@ -469,7 +510,7 @@ ...@@ -469,7 +510,7 @@
border-bottom-color: #EBEEF5; border-bottom-color: #EBEEF5;
} }
.uni-popper__arrow::after { .uni-popper__arrow_bottom::after {
content: " "; content: " ";
top: 1px; top: 1px;
margin-left: -6px; margin-left: -6px;
...@@ -477,6 +518,24 @@ ...@@ -477,6 +518,24 @@
border-bottom-color: #fff; border-bottom-color: #fff;
} }
.uni-popper__arrow_top {
filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.03));
bottom: -6px;
left: 10%;
margin-right: 3px;
border-bottom-width: 0;
border-top-color: #EBEEF5;
}
.uni-popper__arrow_top::after {
content: " ";
bottom: 1px;
margin-left: -6px;
border-bottom-width: 0;
border-top-color: #fff;
}
.uni-select__input-text { .uni-select__input-text {
// width: 280px; // width: 280px;
width: 100%; width: 100%;
...@@ -498,5 +557,6 @@ ...@@ -498,5 +557,6 @@
bottom: 0; bottom: 0;
right: 0; right: 0;
left: 0; left: 0;
z-index: 2;
} }
</style> </style>
{ {
"id": "uni-data-select", "id": "uni-data-select",
"displayName": "uni-data-select 下拉框选择器", "displayName": "uni-data-select 下拉框选择器",
"version": "1.0.5", "version": "1.0.8",
"description": "通过数据驱动的下拉框选择器", "description": "通过数据驱动的下拉框选择器",
"keywords": [ "keywords": [
"uni-ui", "uni-ui",
...@@ -43,7 +43,8 @@ ...@@ -43,7 +43,8 @@
"platforms": { "platforms": {
"cloud": { "cloud": {
"tcb": "y", "tcb": "y",
"aliyun": "y" "aliyun": "y",
"alipay": "n"
}, },
"client": { "client": {
"App": { "App": {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -444,6 +444,20 @@ export function createFileWithPlusIO(directoryPath, fileName, fileContent) { ...@@ -444,6 +444,20 @@ export function createFileWithPlusIO(directoryPath, fileName, fileContent) {
}); });
} }
// 加密方法
export function setSm2(data) {
const sm2 = require("sm-crypto").sm2; // 获取sm2对象
const cipherMode = 1; // 选择加密策略,1 - C1C3C2,0 - C1C2C3,默认为1
const sysPublicKey =
"042580b43bad40cc813a032ef3a4c3c38fc58796e0684dd9b5087195a305f4241f9bbefcc92a10e7296ffc167d22a921c164b8cbbbdbcf91ddc3f15202b993f03b"; // 系统后台公钥
if (data) {
return sm2.doEncrypt(JSON.stringify(data), sysPublicKey, cipherMode);
} else {
return null;
}
}
// 模拟数据 // 模拟数据
export const TEST = [ export const TEST = [
{ {
...@@ -452,7 +466,7 @@ export const TEST = [ ...@@ -452,7 +466,7 @@ export const TEST = [
deptName: "杭州市", deptName: "杭州市",
inspectionCode: "si202409031726", inspectionCode: "si202409031726",
recordName: "巡检1", recordName: "巡检1",
isException: "1", isException: "1", // 是否有异常
exceptionCodes: "1", exceptionCodes: "1",
inspectionTime: "2024-06-30 10:28:00", inspectionTime: "2024-06-30 10:28:00",
inspectionBy: "admin", inspectionBy: "admin",
...@@ -529,45 +543,61 @@ export const TEST = [ ...@@ -529,45 +543,61 @@ export const TEST = [
}, },
], ],
}, },
{ // {
id: 2, // id: 2,
deptId: 1, // deptId: 1,
deptName: "杭州市", // deptName: "杭州市",
inspectionCode: "si202409031726", // inspectionCode: "si202409031726", // 年月日+ 时分
recordName: "巡检1", // recordName: "巡检1",
isException: "1", // isException: "1",
exceptionCodes: "1", // exceptionCodes: "1",
inspectionTime: "2024-06-30 10:28:00", // inspectionTime: "2024-06-30 10:28:00",
inspectionBy: "admin", // inspectionBy: "admin",
inspectionById: 1, // inspectionById: 1,
dispatchId: null, // dispatchId: null,
dispatchName: null, // dispatchName: null,
inspectionType: 2, // 字典【pad_inspection_type】 标识 【机房巡检: 1】 [井道巡检: 2] // inspectionType: 2, // 字典【pad_inspection_type】 标识 【机房巡检: 1】 [井道巡检: 2]
syncTime: "2024-06-30 10:28:00", // syncTime: "2024-06-30 10:28:00",
inspectionFile: null, // inspectionFile: null,
params: null, // params: null,
inspectionTimeStart: null, // inspectionTimeStart: null,
inspectionTimeEnd: null, // inspectionTimeEnd: null,
items: [
// 对应【井道巡检表】
{
id: 1, // conclusion "", // 结论
inspectionId: 1, // position"", // A.B栋
itemCode: "1", // 检查项【字典: pad_inspection_items】 如:门禁、卫生、设备告警
measuredData: "1,2,3", // 选择的机房位置
floorValue: 1, // 楼层数 // items: [
inspectionResult: "1", // 结果 【0:正常】 【1: 异常】 // // 只要异常楼层的巡检项
recordTime: "2024-06-30 10:28:00", // 填写时间 // {
}, // itemCode: "1", // 检查项【字典: pad_inspection_items】 如:门禁、卫生、设备告警
{ // measuredData: "2,3,4", // 异常的楼层,逗号分隔字符串
id: 2, // },
inspectionId: 1,
itemCode: "1,2,3", // 检查项【字典】如:门禁、卫生、设备告警
measuredData: "2", // 选择的机房位置
floorValue: 2, // 楼层数 // //
inspectionResult: "1", // 结果 【0:正常】 【1: 异常】 // // // 对应【井道巡检表】
recordTime: "2024-06-30 10:28:00", // 填写时间 // // {
}, // // id: 1,
], // // inspectionId: 1,
}, // // itemCode: "1", // 检查项【字典: pad_inspection_items】 如:门禁、卫生、设备告警
// // measuredData: "1,2,3", // 选择的机房位置
// // floorValue: 1, // 楼层数
// // inspectionResult: "1", // 结果 【0:正常】 【1: 异常】
// // recordTime: "2024-06-30 10:28:00", // 填写时间
// // },
// // {
// // id: 2,
// // inspectionId: 1,
// // itemCode: "1,2,3", // 检查项【字典】如:门禁、卫生、设备告警
// // measuredData: "2", // 选择的机房位置
// // floorValue: 2, // 楼层数
// // inspectionResult: "1", // 结果 【0:正常】 【1: 异常】
// // recordTime: "2024-06-30 10:28:00", // 填写时间
// // },
// ],
// },
]; ];
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论