diff --git a/src/api/dict/index.js b/src/api/dict/index.js new file mode 100644 index 0000000..8fe09a8 --- /dev/null +++ b/src/api/dict/index.js @@ -0,0 +1,25 @@ +import request from '@/utils/request' + +const getDict=(dictName)=> { + let key='dict_'+dictName; + let obj=window.jhcaches[key]; + if(obj && obj.length>0){ + return new Promise((resolve)=>{ + resolve(obj); + }) + }else{ + return new Promise(async (resolve)=>{ + let data=await request({ + url: `system/dict/data/type/${dictName}`, + method: 'get' + }); + let obj=data.data||[]; + if(obj && obj.length>0){ + window.jhcaches[key]=obj; + } + resolve(obj); + }); + } +} + +export default getDict; diff --git a/src/api/index.js b/src/api/index.js index a67fad1..a2bee7e 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -6,6 +6,7 @@ import problemmodify from './problemmodify/index' import workFile from './workFile/index' import workTrain from './workTrain/index' import special from './special/index' +import dict from './dict/index' export default { project, dept, @@ -14,5 +15,6 @@ export default { problemmodify, workFile, workTrain, - special + special, + dict } \ No newline at end of file diff --git a/src/pages/components/ProblemmodifyDetail.vue b/src/pages/components/ProblemmodifyDetail.vue index ca1a567..bfc85bd 100644 --- a/src/pages/components/ProblemmodifyDetail.vue +++ b/src/pages/components/ProblemmodifyDetail.vue @@ -1,31 +1,99 @@ @@ -39,18 +107,21 @@ export default { }, data() { return { - elKey:0, - nav:0, - infoType:0, - row:null, + fontSize: 0, + elKey: 0, + nav: 0, + infoType: 0, + row: null, show: false, - count:{ - "0":0, - "1":0, - "3":0, - "4":0 + count: { + "0": 0, + "1": 0, + "3": 0, + "4": 0 }, - dataTable:[] + dataTable: [], + dicts: [], + checkStateDicts: [] }; }, @@ -58,31 +129,64 @@ export default { }, methods: { - doNav(n,init) { - if(n==this.nav && !init){ + getDangerType(v) { + let tmps = this.dicts.filter(d => d.dictValue == v); + return tmps.length > 0 ? tmps[0].dictLabel : ''; + }, + getCheckState(v) { + let tmps = this.checkStateDicts.filter(d => d.dictValue == v); + return tmps.length > 0 ? tmps[0].dictLabel : ''; + }, + doNav(n, init) { + if (n == this.nav && !init) { return; } this.nav = n; this.$api.problemmodify.listSspProblemmodify({ - projectId:this.row.projectId, - infoType:this.infoType, - checkState:n - }).then(d=>{ - this.dataTable=d.data||[]; + projectId: this.row.projectId, + infoType: this.infoType, + checkState: n + }).then(d => { + this.dataTable = (d.data || []).map(it=>{ + if(it.nickedTime){ + let dt1=+this.$dt(this.$dt(it.nickedTime).format("YYYY-MM-DD")); + let dt2=+this.$dt(this.$dt(new Date()).format("YYYY-MM-DD")); + if(dt1 { + this.dicts = d || []; + }) + } else { + this.$api.dict('ssp_zlyhlx').then(d => { + this.dicts = d || []; + }) + } + this.$api.dict('smz_ssp_checkstate').then(d => { + this.checkStateDicts = d || []; + }); this.show = true - this.doNav(0,true); - this.$api.problemmodify.groupByInfotypeCheckState({ - projectId:this.row.projectId - }).then(d=>{ - let tmps=(d.data||[]).filter(it=>it.infoType==this.infoType); - tmps.forEach(it=>{ - this.count[""+it.checkState]=it.id; + this.doNav(0, true); + this.$api.problemmodify.groupByInfotypeCheckState({ + projectId: this.row.projectId + }).then(d => { + let tmps = (d.data || []).filter(it => it.infoType == this.infoType); + tmps.forEach(it => { + this.count["" + it.checkState] = it.id; }) }) } @@ -91,23 +195,113 @@ export default { \ No newline at end of file + + .data-list { + .data-item { + border-bottom: solid 1px #fff; + box-shadow: inset 7px 0px 11px 5px rgb(36 131 167 / 70%); + display: flex; + &.time-out{ + box-shadow: inset 7px 0px 11px 5px rgb(167, 36, 36); + } + .item-left { + display: inline-flex; + width: 200px; + align-items: center; + } + + .item-right { + display: inline-block; + margin-left: 10px; + width: calc(100% - 214px); + position: relative; + + .sp-lbl { + display: inline-block; + color: aquamarine; + + } + .text-timeout{ + position: absolute; + right: 0px; + font-size: 64px; + color: red; + transform: rotate(45deg); + top: 27px; + } + + .item-data { + display: flex; + align-items: center; + border-bottom: solid 1px rgba(255, 255, 255, 0.1); + line-height: 32px; + + .div-text { + display: inline-block; + width: calc(100% - 200px); + vertical-align: top; + white-space: break-spaces; + word-break: break-word; + + } + } + } + } + } +} \ No newline at end of file diff --git a/src/pages/init.js b/src/pages/init.js index 44449f3..c9fdae3 100644 --- a/src/pages/init.js +++ b/src/pages/init.js @@ -2,6 +2,8 @@ import Vue from 'vue' import Api from '../api/index' import dayjs from 'dayjs' import './style/index.less' +import dayfilter from '@/utils/dayfilter' +dayfilter(Vue); Vue.prototype.$api=Api; Vue.prototype.$bus=new Vue(); Vue.prototype.$apiPath="/jhapi" diff --git a/src/pages/projectSafety.vue b/src/pages/projectSafety.vue index ea6bf31..b40cc36 100644 --- a/src/pages/projectSafety.vue +++ b/src/pages/projectSafety.vue @@ -352,7 +352,7 @@ export default { }, methods: { doProbleRowClick(a,b,c){ - //this.$refs.probDlg.showDialog(a,0); + this.$refs.probDlg.showDialog(a,0); }, doSpecialRowClick(row){ row.title = row.projectName+"特种作业人员清单"; diff --git a/src/utils/dayfilter.js b/src/utils/dayfilter.js new file mode 100644 index 0000000..01eee5f --- /dev/null +++ b/src/utils/dayfilter.js @@ -0,0 +1,28 @@ +import dayjs from 'dayjs' + +const filters={ + formatDate:(dt,fmt)=>{ + if(dt){ + return dayjs(dt).format(fmt||"YYYY-MM-DD"); + } + return ""; + }, + formatTime:dt=>{ + if(dt){ + return dayjs(dt).format("HH:mm:ss"); + } + return ""; + }, + formatDateTime:dt=>{ + if(dt){ + return dayjs(dt).format("YYYY-MM-DD HH:mm:ss"); + } + return ""; + }, +} + +export default (vm)=>{ + Object.keys(filters).forEach(k=>{ + vm.filter(k,filters[k]); + }) +} \ No newline at end of file diff --git a/vue.config.js b/vue.config.js index 08dffb1..7653f35 100644 --- a/vue.config.js +++ b/vue.config.js @@ -8,6 +8,20 @@ module.exports = defineConfig({ port: 3000, open: true, proxy: { + '/profile':{ + target: `http://62.234.3.186/profile`, + changeOrigin: true, + pathRewrite: { + ['^/profile']:'' + } + }, + '/jhapi/profile':{ + target: `http://62.234.3.186/jhapi/profile`, + changeOrigin: true, + pathRewrite: { + ['^/jhapi/profile']:'' + } + }, [process.env.VUE_APP_BASE_API]: { //target: `http://62.234.3.186/jhapi`, target: `http://127.0.0.1:8090/jhapi`, @@ -15,7 +29,7 @@ module.exports = defineConfig({ pathRewrite: { ['^' + process.env.VUE_APP_BASE_API]: '' } - } + }, } }, pages:{