diff --git a/src/views/modules/shequzhili/issue/issueAuditList.vue b/src/views/modules/shequzhili/issue/issueAuditList.vue index 1716581b5..539645102 100644 --- a/src/views/modules/shequzhili/issue/issueAuditList.vue +++ b/src/views/modules/shequzhili/issue/issueAuditList.vue @@ -260,10 +260,10 @@ export default { pageSize: window.localStorage.getItem("pageSize") || 20, total: 1, endPickerOptions: { - // disabledDate: endDisabledDate + disabledDate: endDisabledDate }, startPickerOptions: { - // disabledDate: startDisabledDate + disabledDate: startDisabledDate }, issueId: '', issueDetailData: {}, @@ -482,7 +482,7 @@ export default { } this.pageNo = 1 - // this.getTableData(); + this.getTableData(); }, deepTree (arr, child) { diff --git a/src/views/modules/shequzhili/issue/issueList.vue b/src/views/modules/shequzhili/issue/issueList.vue index dd98ecaf5..17a6df94e 100644 --- a/src/views/modules/shequzhili/issue/issueList.vue +++ b/src/views/modules/shequzhili/issue/issueList.vue @@ -287,10 +287,10 @@ export default { pageSize: window.localStorage.getItem("pageSize") || 20, total: 1, endPickerOptions: { - // disabledDate: endDisabledDate + disabledDate: endDisabledDate }, startPickerOptions: { - // disabledDate: startDisabledDate + disabledDate: startDisabledDate }, issueId: '', issueDetailData: {}, @@ -531,7 +531,7 @@ export default { } this.pageNo = 1 - // this.getTableData(); + this.getTableData(); }, deepTree (arr, child) { diff --git a/src/views/modules/shequzhili/xiangmu/index.vue b/src/views/modules/shequzhili/xiangmu/index.vue index a5ab8adbe..8c9e342fb 100644 --- a/src/views/modules/shequzhili/xiangmu/index.vue +++ b/src/views/modules/shequzhili/xiangmu/index.vue @@ -1,218 +1,274 @@ @@ -227,7 +283,26 @@ import axios from "axios"; export default { components: { projectInfo }, - data () { + data() { + let endDisabledDate = (time) => { + //这个关键属性我们一定要写在data的里面并且return的外面,这是动态改变区间的关键 + let nowData = Date.now(); + if (this.fmData.startDate) { + let startDate = new Date(this.fmData.startDate); + return ( + time.getTime() > nowData || + time.getTime() < startDate || + time.getTime() === startDate + ); + } else { + return time.getTime() > nowData; + } + }; + let startDisabledDate = (time) => { + //这个关键属性我们一定要写在data的里面并且return的外面,这是动态改变区间的关键 + let nowData = Date.now(); + return time.getTime() > nowData; + }; return { pageType: "list", // 列表list 处理dispose 详情info 议题详情issue-info @@ -259,6 +334,13 @@ export default { importBtnTitle: "导入", importLoading: false, + endPickerOptions: { + disabledDate: endDisabledDate, + }, + startPickerOptions: { + disabledDate: startDisabledDate, + }, + currentProject: { projectId: "", userId: "", @@ -267,7 +349,7 @@ export default { }; }, computed: { - maxTableHeight () { + maxTableHeight() { return this.$store.state.inIframe ? this.clientHeight - 360 + this.iframeHeigh : this.clientHeight - 360; @@ -285,11 +367,11 @@ export default { } }, }, - mounted () { + mounted() { this.getTableData(); }, methods: { - async handleExportModule () { + async handleExportModule() { let url = "/heart/iccommunityselforganization/import-template-download"; let params = {}; @@ -326,18 +408,18 @@ export default { }); }, // 上传大图标成功 - handleExcelSuccess (res, file) { + handleExcelSuccess(res, file) { if (res.code === 0 && res.msg === "success") { console.log("resss---ppp", res); } else { this.$message.error(res.msg); } }, - handleProgress (event, file, fileList) { + handleProgress(event, file, fileList) { console.log("percentage", file.percentage); }, - beforeExcelUpload (file) { + beforeExcelUpload(file) { console.log("file", file); const isType = file.type === "application/vnd.ms-excel"; const isTypeComputer = @@ -354,7 +436,7 @@ export default { } return fileType && isLt1M; }, - async uploadHttpRequest (file) { + async uploadHttpRequest(file) { this.importLoading = true; this.importBtnTitle = "正在上传中..."; this.$message({ @@ -409,29 +491,35 @@ export default { this.$refs.upload.clearFiles(); }, - handleSizeChange (val) { + handleSizeChange(val) { console.log(`每页 ${val} 条`); this.pageSize = val; window.localStorage.setItem("pageSize", val); this.getTableData(); }, - handleCurrentChange (val) { + handleCurrentChange(val) { console.log(`当前页: ${val}`); this.pageNo = val; this.getTableData(); }, - handleSearch (val) { + handleSearch(val) { console.log(this.fmData); this.pageNo = 1; this.getTableData(); }, - resetForm (formName) { - this.$refs[formName].resetFields(); - this.handleSearch(); + resetForm(formName) { + (this.fmData = { + title: "", + status: "", + startDate: "", + endDate: "", + date: ["", ""], + }), + this.handleSearch(); }, - async handleChu () { + async handleChu() { const url = "/governance/project/project-list-export"; const { pageSize, pageNo, fmData } = this; axios({ @@ -466,8 +554,8 @@ export default { }); }, - async handleAdd () { }, - async handleWatch (rowIndex) { + async handleAdd() {}, + async handleWatch(rowIndex) { let item = this.tableData[rowIndex]; this.currentProject = { projectId: item.projectId, @@ -475,7 +563,7 @@ export default { this.pageType = "info"; }, - async handleEdit (rowIndex) { + async handleEdit(rowIndex) { let item = this.tableData[rowIndex]; this.currentProject = { projectId: item.projectId, @@ -483,19 +571,19 @@ export default { this.pageType = "edit"; }, - handleClose () { + handleClose() { this.pageType = "list"; this.currentProject = { projectId: "", }; }, - handleEditSuccess () { + handleEditSuccess() { this.handleClose(); this.getTableData(); }, - async handleDel (rowData, rowIndex) { + async handleDel(rowData, rowIndex) { console.log(rowData, rowIndex); const url = "/heart/iccommunityselforganization/delcommunityselforganization"; @@ -513,7 +601,7 @@ export default { } }, - async getTableData () { + async getTableData() { // const url = "http://yapi.elinkservice.cn/mock/245/gov/project/project/project-list"; const url = "/governance/project/project-list"; const { pageSize, pageNo, fmData } = this; @@ -527,27 +615,24 @@ export default { this.total = data.total || 0; this.tableData = data.list ? data.list.map((item) => { - return item; - }) + return item; + }) : []; - - this.tableData.forEach(item => { - if (item.origin === 'issue') { - item.originName = '议题 ' - } else if (item.origin === 'agency') { - item.originName = '项目立项' - } else if (item.origin === 'resi_event') { - item.originName = '旧版事件上报' - } else if (item.origin === 'work_event') { - item.originName = '巡查上报' - } else if (item.origin === 'ic_event') { - item.originName = '事件' + this.tableData.forEach((item) => { + if (item.origin === "issue") { + item.originName = "议题 "; + } else if (item.origin === "agency") { + item.originName = "项目立项"; + } else if (item.origin === "resi_event") { + item.originName = "旧版事件上报"; + } else if (item.origin === "work_event") { + item.originName = "巡查上报"; + } else if (item.origin === "ic_event") { + item.originName = "事件"; } else { - item.sourceTypeName = '--' + item.sourceTypeName = "--"; } - - }); } else { } diff --git a/src/views/modules/visual/cpts/line-chart.vue b/src/views/modules/visual/cpts/line-chart.vue index 7a6e3683d..7ffa77f5d 100644 --- a/src/views/modules/visual/cpts/line-chart.vue +++ b/src/views/modules/visual/cpts/line-chart.vue @@ -87,6 +87,7 @@ const iniChart = function (config, srcData) { // type: "linear", }, }); + // 设置坐标轴 chart.axis("date", { line: { @@ -117,6 +118,19 @@ const iniChart = function (config, srcData) { fill: "#B5B7BF", }, }); + chart.tooltip({ + custom: true, // 是否自定义 tooltip 提示框 + showXTip: true, // 是否展示 X 轴的辅助信息 + showYTip: true, // 是否展示 Y 轴的辅助信息 + snap: true, // 是否将辅助线准确定位至数据点 + crosshairsType: "xy", // 辅助线的种类 + crosshairsStyle: { + // 配置辅助线的样式 + lineDash: [2], // 点线的密度 + stroke: "rgba(255, 0, 0, 0.25)", + lineWidth: 20, + }, + }); // 类别标识区 chart.legend({ position: "bottom", @@ -156,6 +170,21 @@ const iniChart = function (config, srcData) { ], }); // 添加折线 + // chart.tooltip({ + // showCrosshairs: true, // 展示 Tooltip 辅助线 + // shared: true, + // }); + // // new Add -- 监听 tooltip:change 事件 + // chart.on('tooltip:change', ev => { + // // 自己可以在控制台打印一下ev,看下里面的结构,找到自己所需要的信息 + // hoverData = ev.data.items[0].data; + // }) + // // new Add -- 监听绘图区plot的点击事件 + // chart.on('plot:click', ev => { + // // 当用户在画布上点击时,这个时候用户看到tooltip上的数据其实已经被存在了hoverData里。拿到hoverData,相当于你拿到了折线上相关点的数据,之后再有什么需求都可以实现啦! + // console.log(JSON.stringify(hoverData)); + // }) + chart .line() .position("date*value") @@ -170,7 +199,6 @@ const iniChart = function (config, srcData) { }) .animate(); chart.render(); - addTextShape(); // 注意:需要把chart return 出来 @@ -216,6 +244,8 @@ export default { }, async created() { await nextTick(200); + console.log(this.config, "config"); + console.log(this.list, "list"); iniChart(this.config, this.list); await nextTick(200); this.iniLoading = true;