From 05b908bb4e6c612b5afe4a60c2f74cb7734cf3c5 Mon Sep 17 00:00:00 2001 From: licp <lichunping@guanfang.com.cn> Date: 星期二, 23 四月 2024 13:09:41 +0800 Subject: [PATCH] 完成消息列表页 --- src/view/notice.vue | 86 +++++++++++++++------ src/main.js | 4 static/js/menu.js | 5 + src/components/view/a5-laboratory-management.vue | 57 ++++++++++--- src/assets/api/controller.js | 6 + src/components/view/notice-detail.vue | 71 +++++++++++++++++ 6 files changed, 186 insertions(+), 43 deletions(-) diff --git a/src/assets/api/controller.js b/src/assets/api/controller.js index 5fa4b80..0af6352 100644 --- a/src/assets/api/controller.js +++ b/src/assets/api/controller.js @@ -20,6 +20,7 @@ department, report, certification, + sealScope, } } @@ -231,5 +232,8 @@ delCertificationDetail:"certification/delCertificationDetail",//鍒犻櫎璧勮川鏄庣粏鍒楄〃 } - +const sealScope = { + selectSeal:"/sealScope/selectSeal",//鏌ヨ鍗扮珷鍒楄〃 + addSeal:"/sealScope/addSeal",//娣诲姞鍗扮珷鍙傛暟 +} diff --git a/src/components/view/a5-laboratory-management.vue b/src/components/view/a5-laboratory-management.vue index 87acad9..add07bd 100644 --- a/src/components/view/a5-laboratory-management.vue +++ b/src/components/view/a5-laboratory-management.vue @@ -100,7 +100,7 @@ <div class="btns"> <el-button size="medium" type="primary" @click="openUpload">鏇存柊鍗扮珷</el-button> </div> - <ValueTable ref="ValueTable0" :url="$api.laboratoryScope.selectItemParameter" + <ValueTable ref="ValueTable0" :url="$api.sealScope.selectSeal" :componentData="fileComponentData" :key="upIndex" style="height: 400px;" /> </el-dialog> <el-dialog title="鏇存柊鍗扮珷" :visible.sync="upFileVisible" width="400px"> @@ -108,7 +108,7 @@ <div class="search_label" style="width:90px">鍗扮珷绫诲瀷锛�</div> <div class="search_input"> <el-cascader - v-model="dataForm.insProductIds" + v-model="dataForm.type" :options="options" :show-all-levels="false" :props="props" @@ -130,9 +130,8 @@ :on-change="beforeUpload" ref="upload" :on-error="onError" - :limit="1" > - <img v-if="dataForm.pic1" :src="dataForm.pic1" > + <img v-if="dataForm.address" :src="javaApi+'/img/'+dataForm.address" style="width: 110px;height: 110px;" > <i v-else class="el-icon-plus avatar-uploader-icon"></i> </el-upload> </div> @@ -200,6 +199,7 @@ }, fileComponentData: { entity: { + labId:null, orderBy: { field: 'id', order: 'asc' @@ -220,10 +220,13 @@ upIndex: 0, addDia: true, addPower: true, - fileVisible:true, + fileVisible:false, upFileVisible:false, loading:false, - dataForm:{}, + dataForm:{ + type:'', + address:'', + }, props: { multiple: false,emitPath:false,}, options:[ { @@ -236,7 +239,7 @@ label:'棰濆绫诲瀷', children:null }, - ] + ], } }, mounted() { @@ -281,27 +284,46 @@ this.$refs.ValueTable.openAddDia(this.$api.laboratoryScope.addParameter); }, openUpload(){ - this.dataForm = {}; + this.dataForm.type = ''; + this.dataForm.address = ''; this.upFileVisible = true; }, fileManagement(row){ - this.$refs['ValueTable0'].selectList() this.fileVisible = true; + this.fileComponentData.entity.labId = row.id; + this.$nextTick(function () { + this.$refs['ValueTable0'].selectList() + }) }, confirmConnect(){ - if(!this.dataForm.pic1){ - this.$message.error('鏈笂浼犱紒涓氬嵃绔�'); + if(!this.dataForm.type){ + this.$message.error('鏈笂閫夋嫨鍗扮珷绫诲瀷'); return } - if(!this.dataForm.pic2){ - this.$message.error('鏈笂浼燙NAS鍗扮珷'); + if(!this.dataForm.address){ + this.$message.error('鏈笂浼犲嵃绔�'); return } this.loading = true; + this.$axios.post(this.$api.sealScope.addSeal, { + labId:this.fileComponentData.entity.labId, + ...this.dataForm + }, { + headers: { + 'Content-Type': 'application/json' + } + }).then(res => { + this.loading = false; + if (res.code === 201) { + return + } + this.$refs['ValueTable0'].selectList() + this.upFileVisible = false; + }) }, handleSuccess(response,){ if (response.code == 200) { - this.dataForm.pic1 = response.data + this.dataForm.address = response.data.url } }, beforeUpload(file,type) { @@ -323,6 +345,7 @@ let up = false let del = false let add = false + let file = false for (var i = 0; i < power.length; i++) { if (power[i].menuMethod == 'upParameter') { up = true @@ -333,6 +356,12 @@ if (power[i].menuMethod == 'addParameter') { add = true } + if (power[i].menuMethod == 'selectSeal') { + file = true + } + } + if (!file) { + this.componentData.do.splice(2, 1) } if (!del) { this.componentData.do.splice(1, 1) diff --git a/src/components/view/notice-detail.vue b/src/components/view/notice-detail.vue new file mode 100644 index 0000000..5aecffe --- /dev/null +++ b/src/components/view/notice-detail.vue @@ -0,0 +1,71 @@ +<template> + <div class="notice-detail-page"> + <div class="notice-detail-head"> + <el-row :gutter="20"> + <el-col :xs="12" :sm="8" :md="6" :lg="4" :xl="4" style="margin-bottom: 16px;"></el-col> + </el-row> + <div class="head-item"> + <label>涓婚锛�</label> + <p></p> + </div> + <div class="head-item"> + <label>鍐呭锛�</label> + <p></p> + </div> + <div class="head-item"> + <label>鍙戜欢鏃堕棿锛�</label> + <p></p> + </div> + <div class="head-item"> + <label>鍙戦�佷汉锛�</label> + <p></p> + </div> + <div class="head-item"> + <label>鏀朵欢浜猴細</label> + <p></p> + </div> + </div> + <component class="notice-content" :is="noticeInfo.u"> + </component> + </div> +</template> + +<script> +const requireComponent = require.context("../view", false, /\.vue/); +var comObj = {}; +requireComponent.keys().forEach(fileName => { + var names = fileName + .split("/") + .pop() + .replace(".vue", ""); + const componentConfig = requireComponent(fileName); + comObj[names] = componentConfig.default || componentConfig; +}); +export default { + components: comObj, + data() { + return{ + noticeInfo:{ + u:'b1-inspect-order-plan' + }, + } + } +} +</script> + +<style scoped> +.notice-detail-page{ + padding-top: 16px; +} +.notice-detail-head{ + background: #fff; + border-radius: 3px; + box-sizing: border-box; + padding: 16px; +} +.notice-detail-head{ + display: flex; + align-items: center; + justify-content: space-between; +} +</style> diff --git a/src/main.js b/src/main.js index a14d504..08cbca9 100644 --- a/src/main.js +++ b/src/main.js @@ -13,9 +13,9 @@ //鏈湴 Vue.prototype.LOCATIONVUE = "http://127.0.0.1:80"; -const javaApi = 'http://192.168.11.200:8001';//鏉� +// const javaApi = 'http://192.168.11.200:8001';//鏉� // const javaApi = 'http://192.168.11.249:8001';//寮� -// const javaApi = 'http://192.168.11.50:8001';//濮� +const javaApi = 'http://192.168.11.50:8002';//濮� // const javaApi = 'http://114.132.189.42:9006';//娴嬭瘯鏈� //鑳滀簯鏈嶅姟鍣� // Vue.prototype.LOCATIONVUE = "http://syxt.shxiao2.cn"; diff --git a/src/view/notice.vue b/src/view/notice.vue index 44aabd0..dac79a8 100644 --- a/src/view/notice.vue +++ b/src/view/notice.vue @@ -36,31 +36,13 @@ <div class="notice-content"> <div class="notice-content-item" v-for="(m,i) in list" :key="i"> <div class="btns"> - <el-dropdown style="margin-right: 20px;" trigger="click"> + <el-dropdown style="margin-right: 20px;" trigger="click" @command="handleDropdown"> <span class="el-dropdown-link"> <span class="more" style="line-height: 26px;display: inline-block;">···</span> </span> <el-dropdown-menu slot="dropdown"> - <el-dropdown-item> - 鎷掔粷 - </el-dropdown-item> - <el-dropdown-item> - 鎺ユ敹 - </el-dropdown-item> - <el-dropdown-item> - 閫氳繃 - </el-dropdown-item> - <el-dropdown-item> - 涓嶉�氳繃 - </el-dropdown-item> - <el-dropdown-item> - 鎵瑰噯 - </el-dropdown-item> - <el-dropdown-item> - 涓嶆壒鍑� - </el-dropdown-item> - <el-dropdown-item> - 鏇村 + <el-dropdown-item v-for="(n,j) in dropdownList" :key="j" :command="n.value"> + {{ n.label }} </el-dropdown-item> </el-dropdown-menu> </el-dropdown> @@ -74,8 +56,8 @@ <span class="time" style="color: #999999;font-size: 12px;">{{ m.time }}</span> </h4> <p style="color: #999999;font-size: 14px;margin-bottom: 6px;" class="ellipsis-multiline">{{ m.content }}</p> - <el-tag type="danger" size="small" v-if="m.status==0" style="margin-bottom: 4px;">宸叉嫆缁�</el-tag> - <el-tag type="success" size="small" v-if="m.status==1" style="margin-bottom: 4px;">宸叉帴鏀�</el-tag> + <el-tag type="danger" size="small" v-if="m.status==0&&m.type==2" style="margin-bottom: 4px;">宸叉嫆缁�</el-tag> + <el-tag type="success" size="small" v-if="m.status==1&&m.type==2" style="margin-bottom: 4px;">宸叉帴鏀�</el-tag> <p style="font-size: 12px;color: #999999;display: flex;align-items: center;justify-content: space-between;"> <span>鍙戦�佷汉锛歿{m.sendUser}}</span> <span>鏀朵欢浜猴細{{ m.getUser }}</span> @@ -200,6 +182,36 @@ sendUser:'灏忔槑', getUser:'鏉庡崕', }, + ], + dropdownList:[ + { + label:'鎷掔粷', + value:0 + }, + { + label:'鎺ユ敹', + value:1 + }, + { + label:'閫氳繃', + value:2 + }, + { + label:'涓嶉�氳繃', + value:3 + }, + { + label:'鎵瑰噯', + value:4 + }, + { + label:'涓嶆壒鍑�', + value:5 + }, + { + label:'鏌ョ湅鏇村', + value:6 + }, ] } }, @@ -221,6 +233,25 @@ this.options = data; }) }, + goNoticeDetail(){ + this.drawer = false; + this.$parent.addTab({ + v: "娑堟伅璇︽儏", + i: "el-icon-s-tools", + u: "notice-detail", + k:35, + p: "abcd" + },29); + }, + handleDropdown(e){ + switch(e){ + case 0: + break; + case 6: + this.goNoticeDetail() + break; + } + } } } </script> @@ -241,8 +272,6 @@ color: #303133; } >>>.el-drawer__body{ - box-sizing: border-box; - padding: 0 16px; height: calc(100vh - 82px); overflow: hidden; } @@ -251,6 +280,8 @@ align-items: center; justify-content: space-between; margin-bottom: 16px; + box-sizing: border-box; + padding: 0 16px; } .more{ font-size: 20px; @@ -260,11 +291,13 @@ .notice-content{ height: calc(100% - 60px); overflow-y: auto; + box-sizing: border-box; + padding: 0 16px; } .notice-content-item{ position: relative; width: 100%; - padding: 16px; + padding: 8px; border-radius: 8px; box-sizing: border-box; border: 1px solid #EEEEEE; @@ -275,6 +308,7 @@ position: absolute; right: 20px; top: 4px; + z-index: 4; } .notice-content-item .btns{ opacity: 0; diff --git a/static/js/menu.js b/static/js/menu.js index afe46e8..23c17b7 100644 --- a/static/js/menu.js +++ b/static/js/menu.js @@ -184,6 +184,11 @@ i: "el-icon-s-tools", u: "system-log", p: "selectSystemLogList" + }, { + v: "娑堟伅璇︽儏", + i: "el-icon-s-tools", + u: "notice-detail", + p: "abcd" }] }, { -- Gitblit v1.9.3