Browse Source

增加日历展示

develop
little4 3 months ago
parent
commit
7dc471f0aa
  1. 78
      ruoyi-ui/src/views/JiHeExpressway/pages/service/analysis/search/DialogCalendar.vue
  2. 14
      ruoyi-ui/src/views/JiHeExpressway/pages/service/analysis/search/index.vue

78
ruoyi-ui/src/views/JiHeExpressway/pages/service/analysis/search/DialogCalendar.vue

@ -0,0 +1,78 @@
<template>
<Dialog v-model="visibleModel" title="上传日历" width="700px">
<el-calendar v-model="mon">
<template
slot="dateCell"
slot-scope="{date, data}">
<p :class="selDays.indexOf(data.day)!==-1 ? 'is-selected' : ''">
{{ data.day.split('-').slice(1).join('-') }} {{ data.isSelected ? '✔️' : ''}}
</p>
</template>
</el-calendar>
</Dialog>
</template>
<script>
import Dialog from "@screen/components/Dialog/index.vue";
import request from "@/utils/request";
export default {
name: "DialogCamera",
components: {
Dialog,
},
props: {
visible: {
type: Boolean,
default: false,
}
},
emit: ["close"],
data() {
return {
mon: new Date(),
selDays:[]
};
},
watch: {
mon: {
handler(newValue, oldValue) {
this.getData();
},
deep: true,
}
},
computed: {
visibleModel: {
get() {
if (this.visible) this.getData();
return this.visible;
},
set(bool) {
this.$emit("close", bool);
},
},
},
methods: {
getData() {
const month = moment(this.mon).format('YYYY-MM')
request({
url: `/business/sdhsEvent/getDataCalendar/${month}`,
method: "get",
}).then((result) => {
if (result.code != 200) return Message.error(result?.msg);
this.selDays = result.data;
}).catch((err) => {
Message.error("查询失败", err);
})
},
},
};
</script>
<style lang="scss" scoped>
.video-stream {
width: 100%;
height: 100%;
}
</style>

14
ruoyi-ui/src/views/JiHeExpressway/pages/service/analysis/search/index.vue

@ -36,6 +36,8 @@
<el-button class="btnReset" size="mini" >导入</el-button> <el-button class="btnReset" size="mini" >导入</el-button>
</el-upload> </el-upload>
<el-button class="btnReset" size="mini" @click="onExport">导出</el-button> <el-button class="btnReset" size="mini" @click="onExport">导出</el-button>
<el-button class="btnReset" size="mini" @click="handledDialogCalendar(true)">日历</el-button>
<DialogCalendar :visible="dialogVisibleCalendar" @close="handledDialogCalendar(false)" />
</div> </div>
</template> </template>
<script> <script>
@ -44,10 +46,12 @@ import RadioGroup from "@screen/components/FormConfig/components/RadioGroup/inde
import { delay, exportFile2, confirm } from "@screen/utils/common"; import { delay, exportFile2, confirm } from "@screen/utils/common";
import request from "@/utils/request"; import request from "@/utils/request";
import { getToken } from "@/utils/auth"; import { getToken } from "@/utils/auth";
import DialogCalendar from "./DialogCalendar.vue";
export default { export default {
name: "EventQuery", name: "EventQuery",
components: { components: {
RadioGroup, RadioGroup,
DialogCalendar
}, },
data() { data() {
return { return {
@ -92,6 +96,7 @@ export default {
return time.getTime() > Date.now(); return time.getTime() > Date.now();
}, },
}, },
dialogVisibleCalendar: false
}; };
}, },
@ -114,7 +119,7 @@ export default {
}, },
}).then((result) => { }).then((result) => {
if (result.code != 200) return Message.error(result?.msg); if (result.code != 200) return Message.error(result?.msg);
this.$message.success("上传成功"); this.$message.success(`上传完成。成功${result.data.successNum}条,失败${result.data.errorNum}`);
this.bindFiles(); this.bindFiles();
}); });
}, },
@ -155,7 +160,6 @@ export default {
onQuery(){ onQuery(){
this.$parent.bind() this.$parent.bind()
}, },
onExport(){ onExport(){
const keys = this.$parent.getKeys(); const keys = this.$parent.getKeys();
if(keys.length === 0){ if(keys.length === 0){
@ -185,7 +189,11 @@ export default {
this.fileInfo = result.data this.fileInfo = result.data
} }
}); });
} },
//
handledDialogCalendar(bool) {
this.dialogVisibleCalendar = bool;
},
}, },
mounted() { mounted() {
this.$nextTick(()=>{ this.$nextTick(()=>{

Loading…
Cancel
Save