From fecb2f5b3a5b4c7994eb76cc730c2bd27b6f8b67 Mon Sep 17 00:00:00 2001 From: WXL <1785969728@qq.com> Date: 星期二, 22 四月 2025 09:34:17 +0800 Subject: [PATCH] 测试完成 --- vue.config.js | 2 src/main.js | 2 src/views/followvisit/record/detailpage/index.vue | 18 +++ src/views/shortmessage/communication/index.vue | 4 src/utils/drag.js | 87 +++++++++++++++++++++ src/views/patient/patient/index.vue | 66 ++++++++++++---- src/views/patient/patient/profile/index.vue | 6 7 files changed, 158 insertions(+), 27 deletions(-) diff --git a/src/main.js b/src/main.js index 5549b74..e523ac8 100644 --- a/src/main.js +++ b/src/main.js @@ -77,6 +77,8 @@ import components from "./components"; // 璇煶缁勪欢 import VueAudio from 'vue-audio-better' +// 寮规鎷栧姩 +import '@/utils/drag.js'; // 娉ㄥ唽杩囨护鍣� // 鑷畾涔夋寚浠� import * as directives from "./directives"; diff --git a/src/utils/drag.js b/src/utils/drag.js new file mode 100644 index 0000000..d9f10ac --- /dev/null +++ b/src/utils/drag.js @@ -0,0 +1,87 @@ +import Vue from 'vue'; + +/* + +* 浣跨敤鏂规硶锛� + +* 灏嗕互涓嬩唬鐮佸鍒跺埌涓�涓猨s鏂囦欢涓紝鐒跺悗鍦ㄥ叆鍙f枃浠秏ain.js涓璱mport寮曞叆鍗冲彲锛� + +* 缁檈lementUI鐨刣ialog涓婂姞涓� v-dialogDrags + +* 缁檇ialog璁剧疆 :close-on-click-modal="false" , 绂佹鐐瑰嚮閬僵灞傚叧闂脊鍑哄眰 + +*/ + +// 鍏煎ie,璋锋瓕 +// v-dialogDrags: 寮圭獥鎷栨嫿灞炴�� 锛堥噸鐐癸紒锛侊紒 缁欐ā鎬佹娣诲姞杩欎釜灞炴�фā鎬佹灏辫兘鎷栨嫿浜嗭級 +Vue.directive('dialogDrags', { // 灞炴�у悕绉癲ialogDrags锛屽墠闈㈠姞v- 浣跨敤 + bind(el, binding, vnode, oldVnode) { + const dialogHeaderEl = el.querySelector('.el-dialog__header'); + const dragDom = el.querySelector('.el-dialog'); + dialogHeaderEl.style.cssText += ';cursor:move;'; + + // 鑾峰彇鍘熸湁灞炴�� ie dom鍏冪礌.currentStyle 鐏嫄璋锋瓕 window.getComputedStyle(dom鍏冪礌, null); + const sty = (function () { + if (window.document.currentStyle) { + return (dom, attr) => dom.currentStyle[attr]; + } else { + return (dom, attr) => getComputedStyle(dom, false)[attr]; + } + })(); + + dialogHeaderEl.onmousedown = (e) => { + // 榧犳爣鎸変笅锛岃绠楀綋鍓嶅厓绱犺窛绂诲彲瑙嗗尯鐨勮窛绂� + const disX = e.clientX - dialogHeaderEl.offsetLeft; + const disY = e.clientY - dialogHeaderEl.offsetTop; + + const screenWidth = document.body.clientWidth; // body褰撳墠瀹藉害 + const screenHeight = document.documentElement.clientHeight; // 鍙鍖哄煙楂樺害(搴斾负body楂樺害锛屽彲鏌愪簺鐜涓嬫棤娉曡幏鍙�) + + const dragDomWidth = dragDom.offsetWidth; // 瀵硅瘽妗嗗搴� + const dragDomheight = dragDom.offsetHeight; // 瀵硅瘽妗嗛珮搴� + + // 鑾峰彇鍒扮殑鍊煎甫px 姝e垯鍖归厤鏇挎崲 + let styL = sty(dragDom, 'left'); + let styT = sty(dragDom, 'top'); + + // 娉ㄦ剰鍦╥e涓� 绗竴娆¤幏鍙栧埌鐨勫�间负缁勪欢鑷甫50% 绉诲姩涔嬪悗璧嬪�间负px + if (styL.includes('%')) { + styL = +document.body.clientWidth * (+styL.replace(/\%/g, '') / 100); + styT = +document.body.clientHeight * (+styT.replace(/\%/g, '') / 100); + } else { + styL = +styL.replace(/\px/g, ''); + styT = +styT.replace(/\px/g, ''); + }; + + document.onmousemove = function (e) { + // 閫氳繃浜嬩欢濮旀墭锛岃绠楃Щ鍔ㄧ殑璺濈 + let left = e.clientX - disX + styL; + let top = e.clientY - disY + styT; + + // // 杈圭晫澶勭悊 + // if (left < 0) { + // left = 0; + // } + + // if (left > screenWidth - dragDomWidth) { + // left = screenWidth - dragDomWidth; + // } + + // if (top < 0) { + // top = 0; + // } + // if (top > screenHeight - dragDomheight) { + // top = screenHeight - dragDomheight; + // } + + // 绉诲姩褰撳墠鍏冪礌 + dragDom.style.cssText += `;left:${left}px;top:${top}px;`; + }; + + document.onmouseup = function (e) { + document.onmousemove = null; + document.onmouseup = null; + }; + }; + } +}); diff --git a/src/views/followvisit/record/detailpage/index.vue b/src/views/followvisit/record/detailpage/index.vue index 62dfbbc..60a7b10 100644 --- a/src/views/followvisit/record/detailpage/index.vue +++ b/src/views/followvisit/record/detailpage/index.vue @@ -1,6 +1,6 @@ <template> <!-- 鑱婅繛椤甸潰璁板綍 --> - <div class="Followupdetailspage"> + <div class="Followupdetailspage" id="app-container"> <div class="Followuserinfo"> <div> <div class="userinfo-text"> @@ -532,7 +532,11 @@ </el-tab-pane> </el-tabs> </div> - <el-dialog title="鎮h�呭啀娆¢殢璁�" :visible.sync="dialogFormVisible"> + <el-dialog + title="鎮h�呭啀娆¢殢璁�" + v-dialogDrags + :visible.sync="dialogFormVisible" + > <el-form ref="zcform" :rules="zcrules" :model="form" label-width="80px"> <el-form-item label="浠诲姟鍚嶇О"> <el-input @@ -809,11 +813,15 @@ } }); this.Editsingletasksonyic(6); + this.$modal .confirm( - '浠诲姟淇濆瓨鎴愬姛鏄惁閽堝鎮h�咃細"' + this.userform.name + '"鍐嶆闅忚锛�' + '浠诲姟淇濆瓨鎴愬姛鏄惁閽堝鎮h�咃細"' + + this.logsheetlist[0].sendname + + '"鍐嶆闅忚锛�' ) .then(() => { + document.querySelector("#app").scrollTo(0, 0); this.dialogFormVisible = true; }) .catch(() => {}); @@ -852,6 +860,7 @@ '浠诲姟淇濆瓨鎴愬姛鏄惁閽堝鎮h�咃細"' + this.userform.name + '"鍐嶆闅忚锛�' ) .then(() => { + document.querySelector("#app").scrollTo(0, 0); this.dialogFormVisible = true; }) .catch(() => {}); @@ -948,6 +957,8 @@ }, // 璋冭捣鍐嶆鍙戦�� sendAgain() { + document.querySelector("#app").scrollTo(0, 0); + // scrollTo(0, 0) this.dialogFormVisible = true; }, // 鏌ョ湅璇︽儏 @@ -1026,6 +1037,7 @@ } else { this.$modal.msgError("鍒涘缓澶辫触"); } + document.querySelector("#app").scrollTo(0, 0); this.dialogFormVisible = false; }); } diff --git a/src/views/patient/patient/index.vue b/src/views/patient/patient/index.vue index 78643ad..05db6d9 100644 --- a/src/views/patient/patient/index.vue +++ b/src/views/patient/patient/index.vue @@ -109,7 +109,7 @@ @keyup.enter.native="handleQuery" /> </el-form-item> - <el-form-item label="鎮h�呰寖鍥�" prop="tagId"> + <!-- <el-form-item label="鎮h�呰寖鍥�" prop="tagId"> <el-select v-model="queryParams.searchscope" placeholder="璇烽�夋嫨鎮h�呰寖鍥�" @@ -122,7 +122,16 @@ > </el-option> </el-select> - </el-form-item> + </el-form-item> --> + <el-form-item label="鎮h�呰寖鍥�" prop="status"> + <el-cascader + v-model="queryParams.scopetype" + placeholder="榛樿鍏ㄩ儴" + :options="sourcetype" + :props="{ expandTrigger: 'hover' }" + @change="handleChange" + ></el-cascader> + </el-form-item> <el-form-item label="鑱旂郴鐢佃瘽" prop="telcode"> <el-input v-model="queryParams.telcode" @@ -1031,12 +1040,26 @@ pageSize: 10, notrequiredFlag:0, searchscope: 2, - idcardno: undefined, - name: undefined, - status: undefined, - tagIds: undefined, - telcode: undefined, + scopetype: [], + leaveldeptcodes: [], + leavehospitaldistrictcodes: [], }, + sourcetype: [ + { + value: 1, + label: "绉戝", + children: [], + }, + { + value: 2, + label: "鐥呭尯", + children: [], + }, + { + value: 3, + label: "鍏ㄩ儴", + }, + ], // 琛ㄥ崟鏍¢獙 rules: { name: [ @@ -1093,16 +1116,7 @@ methods: { /** 鏌ヨ鎮h�呭垪琛� */ getList() { - if (this.queryParams.searchscope == 1) { - this.queryParams.leaveldeptcodes = store.getters.belongDepts.map( - (obj) => obj.deptCode - ); - this.queryParams.leavehospitaldistrictcodes = null; - } else if (this.queryParams.searchscope == 2) { - this.queryParams.leavehospitaldistrictcodes = - store.getters.belongWards.map((obj) => obj.districtCode); - this.queryParams.leaveldeptcodes = null; - } else { + if (this.queryParams.searchscope == 3) { this.queryParams.leaveldeptcodes = store.getters.belongDepts.map( (obj) => obj.deptCode ); @@ -1250,7 +1264,25 @@ } }); }, + // 鎮h�呰寖鍥村鐞� + handleChange(value) { + let type = value[0]; + let code = value.slice(-1)[0]; + this.queryParams.leavehospitaldistrictcodes = []; + this.queryParams.leaveldeptcodes = []; + if (type == 1) { + this.queryParams.leaveldeptcodes.push(code); + this.queryParams.leavehospitaldistrictcodes = []; + this.queryParams.searchscope = 1; + } else if (type == 2) { + this.queryParams.leavehospitaldistrictcodes.push(code); + this.queryParams.leaveldeptcodes = []; + this.queryParams.searchscope = 2; + } else { + this.queryParams.searchscope = 3; + } + }, /** 鍒犻櫎鎸夐挳鎿嶄綔 */ handleDelete(row) { const userIds = row.userId || this.ids; diff --git a/src/views/patient/patient/profile/index.vue b/src/views/patient/patient/profile/index.vue index cce88ea..976aff7 100644 --- a/src/views/patient/patient/profile/index.vue +++ b/src/views/patient/patient/profile/index.vue @@ -111,7 +111,7 @@ ref="userform" :model="userform" :rules="rules" - label-width="100px" + label-width="150px" > <el-row :gutter="20"> <el-col :span="12"> @@ -123,7 +123,7 @@ ></el-input> </el-form-item ></el-col> </el-row> - <el-row :gutter="20"> + <el-row > <el-col :span="12" ><el-form-item label="鑱旂郴鏂瑰紡" prop="telcode"> <el-input @@ -133,7 +133,7 @@ /> </el-form-item ></el-col> <el-col :span="12"> - <el-form-item label="浜插睘鑱旂郴鏂瑰紡" prop="name"> + <el-form-item label="浜插睘鑱旂郴鏂瑰紡" prop="name"> <el-input v-model="userform.telcodewx" placeholder="璇疯緭鍏ュ鍚�" diff --git a/src/views/shortmessage/communication/index.vue b/src/views/shortmessage/communication/index.vue index bbfa8a8..14407b5 100644 --- a/src/views/shortmessage/communication/index.vue +++ b/src/views/shortmessage/communication/index.vue @@ -702,9 +702,7 @@ }, // 鑾峰彇鑱旂郴浜轰俊鎭垨婊氬姩鍒伴《閮ㄨЕ鍙� handlePullMessages(contact, next, instance) { - console.log(contact, "鑾峰彇鑱旂郴浜轰俊鎭疉"); - console.log(instance, "鑾峰彇鑱旂郴浜轰俊鎭疊"); - console.log(next, "鑾峰彇鑱旂郴浜轰俊鎭疌"); + const otheruser = { id: contact.id, displayName: contact.displayName, diff --git a/vue.config.js b/vue.config.js index e576a70..5f156f6 100644 --- a/vue.config.js +++ b/vue.config.js @@ -38,7 +38,7 @@ // target: `http://192.168.68.111:8095`, // target: `http://10.202.20.185:8095`, // target: `http://192.168.100.184:8095`, - target:`http://localhost:8096`, + target:`http://localhost:8095`, // target: `http://192.168.101.135:8095`, // target: `http://192.168.101.166:8093`, // target: `http://192.168.191.181:8095`, -- Gitblit v1.9.3