diff --git a/src/components/notice.component.vue b/src/components/notice.component.vue index 5bab49c..51eaecf 100644 --- a/src/components/notice.component.vue +++ b/src/components/notice.component.vue @@ -3,7 +3,7 @@
{{ noticeDataList.state.description }}
- +
@@ -13,8 +13,7 @@ {{ basicForm[items.key] }} - {{ basicForm[items.key] === 1 ? - '是' : '否' }} + {{ radioTransformName(basicForm[items.key]) }} @@ -47,7 +46,7 @@ {{ basicForm[item.key] }} - {{ basicForm[item.key] === 1 ? '是' : '否' }} + {{ radioTransformName(basicForm[item.key]) }} @@ -84,7 +83,7 @@ {{ judgmentForm[items.key] }} - {{ judgmentForm[items.key] === 1 ? '是' : '否' }} + {{ radioTransformName(judgmentForm[items.key]) }} @@ -114,7 +113,7 @@ {{ judgmentForm[item.key] }} - {{ judgmentForm[item.key] === 1 ? '是' : '否' }} + {{ radioTransformName(judgmentForm[item.key]) }} @@ -177,7 +176,7 @@ export default class NoticeComponent extends Vue { handleData() { //处理数据 this.basicForm = this.updateParams; - this.judgmentForm = this.updateParams.researchContent ? JSON.parse(this.updateParams.researchContent) : {}; + this.judgmentForm = this.updateParams.researchContent ? JSON.parse(this.updateParams.researchContent) : this.formDefaultValues(); } // 操作按钮 @Prop({ @@ -196,24 +195,28 @@ export default class NoticeComponent extends Vue { @Prop() public isReadonly: boolean; - //定义规则 - public rules = { - riskNumber: [ - { required: true, message: '请输入活动名称', trigger: 'blur' }, - ], - measureFlag: [ - { required: true, message: '请选择活动区域', trigger: 'change' } - ], - basicwork: [ - { type: 'date', required: true, message: '请选择日期', trigger: 'change' } - ], - }; + /** + * 表单默认值 + */ + public formDefaultValues() { + let tmpJudementForm = {} + this.noticeDataList.situation.content.forEach((item: any) => { + item.children.forEach((children: any) => { + if (children.defaultValue !== undefined || children.defaultValue !== null) { + tmpJudementForm[children.key] = children.defaultValue + } + }) + }) + return tmpJudementForm + } created() { // } - //提交 + /** + * 保存 + */ public onSubmit() { (this.$refs.basicForm as any).validate((valid: any) => { if (valid) { @@ -226,10 +229,22 @@ export default class NoticeComponent extends Vue { }); } - //取消 + /** + * 取消 + */ public cancel() { this.actionCallback('cancel') } + + /** + * 单选 转换name显示 + * @param value 值 + */ + public radioTransformName(value: any) { + if (value === 1) return '是' + if (value === 0) return '否' + return + } } diff --git a/src/mock/teamCommitmentLetter.ts b/src/mock/teamCommitmentLetter.ts index 1961191..bfaa3d6 100644 --- a/src/mock/teamCommitmentLetter.ts +++ b/src/mock/teamCommitmentLetter.ts @@ -294,6 +294,7 @@ export default { required: false, width: "100%", labelWidth: "600px", + defaultValue:1, datas: [ { name: "是", @@ -312,6 +313,7 @@ export default { required: false, width: "100%", labelWidth: "600px", + defaultValue:1, datas: [ { name: "是", @@ -330,6 +332,7 @@ export default { required: false, width: "100%", labelWidth: "600px", + defaultValue:1, datas: [ { name: "是", @@ -348,6 +351,7 @@ export default { required: false, width: "100%", labelWidth: "600px", + defaultValue:1, datas: [ { name: "是", @@ -372,6 +376,7 @@ export default { required: false, width: "100%", labelWidth: "600px", + defaultValue:1, datas: [ { name: "是", @@ -390,6 +395,7 @@ export default { required: false, width: "100%", labelWidth: "600px", + defaultValue:0, datas: [ { name: "是", @@ -408,6 +414,7 @@ export default { required: false, width: "100%", labelWidth: "600px", + defaultValue:1, datas: [ { name: "是", @@ -426,6 +433,7 @@ export default { required: false, width: "100%", labelWidth: "600px", + defaultValue:1, datas: [ { name: "是", @@ -444,6 +452,7 @@ export default { required: false, width: "100%", labelWidth: "600px", + defaultValue:1, datas: [ { name: "是", @@ -462,6 +471,7 @@ export default { required: false, width: "100%", labelWidth: "600px", + defaultValue:0, datas: [ { name: "是", @@ -486,6 +496,7 @@ export default { required: false, width: "100%", labelWidth: "600px", + defaultValue:1, datas: [ { name: "是", @@ -504,6 +515,7 @@ export default { required: false, width: "100%", labelWidth: "600px", + defaultValue:1, datas: [ { name: "是", @@ -522,6 +534,7 @@ export default { required: false, width: "100%", labelWidth: "600px", + defaultValue:1, datas: [ { name: "是", diff --git a/src/service/home.service.ts b/src/service/home.service.ts new file mode 100644 index 0000000..11d810f --- /dev/null +++ b/src/service/home.service.ts @@ -0,0 +1,23 @@ +import BaseService from "hbt-common/service/base.service" +import type { AxiosResponse } from 'axios' +import { ActionResult } from "hbt-common/models/actionResult"; +export default class HomeService extends BaseService{ + constructor(){ + super() + } + //安全承诺公告 + public getHomePromise(params: any):Promise>>{ + const url = this.prefix.prevention+'/home/promise'; + return this.get(url,params,true) + } + //企业风险辨识 + public getHomeRisk(params):Promise>>{ + const url = this.prefix.prevention+'/home/risk'; + return this.get(url,params,true) + } + + public getFileUrls(params):Promise>>{ + const url = this.prefix.file+'/getSysFiles'; + return this.get(url,params,false) + } +} \ No newline at end of file diff --git a/src/service/safetyNotice.service.ts b/src/service/safetyNotice.service.ts index 1b9bf0d..b4f0494 100644 --- a/src/service/safetyNotice.service.ts +++ b/src/service/safetyNotice.service.ts @@ -15,6 +15,11 @@ export default class SafetyNoticeService extends BaseService{ const url = this.prefix.prevention+'/safety/promise/task'; return this.get(url,params,true) } + //获取次级详细信息 + public selectTaskByDetail(params: any):Promise>>{ + const url = this.prefix.prevention+'/safety/promise/task/promise/detail'; + return this.get(url,params,true) + } // 批量删除 public deleteByIds(params,showLoading?):Promise>>{ const url = this.prefix.prevention+'/safety/promise/task'; diff --git a/src/views/home/home.component.html b/src/views/home/home.component.html index 1709988..8821518 100644 --- a/src/views/home/home.component.html +++ b/src/views/home/home.component.html @@ -1,24 +1,26 @@ -
安全承诺公告
- 进入受限空间作业 (处) - 13 + 进入受限空间作业 (处) + {{promiseData.confinedSpaceWork ? promiseData.confinedSpaceWork:0}}
是否处于试生产 - + +
开停车状态 - + +
罐装、仓库等重大危险源
是否处于安全状态
- + +
@@ -29,14 +31,17 @@
企业承诺
- 今天我公司已经过安全风险研判,各项安全风险防控措施已落实到位,我承诺所有运行的生产装置处于安全状态,69个重大危险源安全风险得到有效管控,已落实重大危险源安全包保责任 + {{promiseData.promise}} + +
+
+
-
吴延福
2023-05-29 15:03:22
企业风险辨识
- +
-
\ No newline at end of file +
\ No newline at end of file diff --git a/src/views/home/home.component.scss b/src/views/home/home.component.scss index 2c36ed9..37b0678 100644 --- a/src/views/home/home.component.scss +++ b/src/views/home/home.component.scss @@ -98,6 +98,10 @@ margin-top: 10px; text-align: right; } + .text-i{ + width: 80px; + margin-left: auto; + } } } .echarts-box{ diff --git a/src/views/home/home.component.vue b/src/views/home/home.component.vue index 0a17617..878324a 100644 --- a/src/views/home/home.component.vue +++ b/src/views/home/home.component.vue @@ -1,96 +1,154 @@