From 61cb6f1f20185e88a35da6945776b0a3e7b235cf Mon Sep 17 00:00:00 2001 From: heimawl <1785969728@qq.com> Date: 星期三, 07 六月 2023 09:59:17 +0800 Subject: [PATCH] 安装echarts5.4.0依赖,完整患者管理主页面及其个人信息及附属页面基础开发 --- src/views/patient/patient/authRole.vue | 117 +++ src/views/monitor/job/index.vue | 2 src/assets/common/head.jpg | 0 src/views/patient/patient/index.vue | 904 +++++++++++++++++++++++++ src/components/RightToolbar/index.vue | 2 src/components/Pagination/index.vue | 1 src/views/patient/patient/profile/userAvatar.vue | 187 +++++ src/main.js | 10 src/views/patient/patient/profile/resetPwd.vue | 68 + package.json | 2 src/directives/index.js | 22 src/views/patient/patient/profile/index.vue | 767 +++++++++++++++++++++ src/views/patient/patient/profile/userInfo.vue | 75 ++ 13 files changed, 2,153 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 0d1291b..69e215e 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "core-js": "3.25.3", "cos-js-sdk-v5": "^1.4.18", "dayjs": "^1.11.7", - "echarts": "5.4.0", + "echarts": "^5.4.2", "element-ui": "2.15.12", "file-saver": "^2.0.5", "fuse.js": "6.4.3", diff --git a/src/assets/common/head.jpg b/src/assets/common/head.jpg new file mode 100644 index 0000000..d961795 --- /dev/null +++ b/src/assets/common/head.jpg Binary files differ diff --git a/src/components/Pagination/index.vue b/src/components/Pagination/index.vue index f16425c..3dc5b9f 100644 --- a/src/components/Pagination/index.vue +++ b/src/components/Pagination/index.vue @@ -18,6 +18,7 @@ </template> <script> +// 寰呭畾 import { scrollTo } from '@/utils/scroll-to' export default { diff --git a/src/components/RightToolbar/index.vue b/src/components/RightToolbar/index.vue index d682090..14dfa2d 100644 --- a/src/components/RightToolbar/index.vue +++ b/src/components/RightToolbar/index.vue @@ -65,7 +65,7 @@ props: { showSearch: { type: Boolean, - default: true, + default: true, //required鏄惁蹇呴』锛屼负true娓叉煋鏃朵細鎶涘嚭typeError锛沝efault锛氶粯璁ゅ�硷紝 }, columns: { type: Array, diff --git a/src/directives/index.js b/src/directives/index.js new file mode 100644 index 0000000..6dc4fc2 --- /dev/null +++ b/src/directives/index.js @@ -0,0 +1,22 @@ +export const imgError = { + // 褰撹缁戝畾鐨勫厓绱犳彃鍏ュ埌DOM涓� + inserted: function (el, { value }) { + // 鐩戝惉img/src鏄剧ず澶辫触鎯呭喌 + if (!el.src) { + el.src = value + } else { + // 鑱氱劍 + el.onerror = function () { + el.src = value + } + } + }, + // 鎸囦护缁戝畾鐨勫厓绱犳洿鏂版椂鐢熸晥 + updated(el,{ value}) { + if (!el.src) { + el.src=value + } + }, +} +export const aa = {} +export const bb = {} diff --git a/src/main.js b/src/main.js index 861cfc1..c95a818 100644 --- a/src/main.js +++ b/src/main.js @@ -1,6 +1,7 @@ import Vue from 'vue' import Cookies from 'js-cookie' +import * as echarts from "echarts"; import Element from 'element-ui' import './assets/styles/element-variables.scss' @@ -40,13 +41,15 @@ // 缁勪欢灏佽闆嗘垚 import components from './components' // 娉ㄥ唽杩囨护鍣� +// 鑷畾涔夋寚浠� +import * as directives from './directives' import * as filters from './filters' for(let key in filters){ Vue.filter(key, filters[key]) } - // 鍏ㄥ眬鏂规硶鎸傝浇 + Vue.prototype.getDicts = getDicts Vue.prototype.getConfigKey = getConfigKey Vue.prototype.parseTime = parseTime @@ -56,7 +59,6 @@ Vue.prototype.selectDictLabels = selectDictLabels Vue.prototype.download = download Vue.prototype.handleTree = handleTree - // 鍏ㄥ眬缁勪欢鎸傝浇 Vue.component('DictTag', DictTag) Vue.component('Pagination', Pagination) @@ -66,6 +68,10 @@ Vue.component('ImageUpload', ImageUpload) Vue.component('ImagePreview', ImagePreview) + +// 灏佽鑷畾涔夋寚浠� +for(let key in directives) +Vue.directive(key, directives[key]) Vue.use(directive) Vue.use(plugins) Vue.use(VueMeta) diff --git a/src/views/monitor/job/index.vue b/src/views/monitor/job/index.vue index 37c8fc1..e5f808d 100644 --- a/src/views/monitor/job/index.vue +++ b/src/views/monitor/job/index.vue @@ -293,6 +293,8 @@ <script> import { listJob, getJob, delJob, addJob, updateJob, runJob, changeJobStatus } from "@/api/monitor/job"; import Crontab from '@/components/Crontab' +import * as echarts from "echarts"; + export default { components: { Crontab }, diff --git a/src/views/patient/patient/authRole.vue b/src/views/patient/patient/authRole.vue new file mode 100644 index 0000000..ab5e72f --- /dev/null +++ b/src/views/patient/patient/authRole.vue @@ -0,0 +1,117 @@ +<template> + <div class="app-container"> + <h4 class="form-header h4">鍩烘湰淇℃伅</h4> + <el-form ref="form" :model="form" label-width="80px"> + <el-row> + <el-col :span="8" :offset="2"> + <el-form-item label="鐢ㄦ埛鏄电О" prop="nickName"> + <el-input v-model="form.nickName" disabled /> + </el-form-item> + </el-col> + <el-col :span="8" :offset="2"> + <el-form-item label="鐧诲綍璐﹀彿" prop="userName"> + <el-input v-model="form.userName" disabled /> + </el-form-item> + </el-col> + </el-row> + </el-form> + + <h4 class="form-header h4">瑙掕壊淇℃伅</h4> + <el-table v-loading="loading" :row-key="getRowKey" @row-click="clickRow" ref="table" @selection-change="handleSelectionChange" :data="roles.slice((pageNum-1)*pageSize,pageNum*pageSize)"> + <el-table-column label="搴忓彿" type="index" align="center"> + <template slot-scope="scope"> + <span>{{(pageNum - 1) * pageSize + scope.$index + 1}}</span> + </template> + </el-table-column> + <el-table-column type="selection" :reserve-selection="true" width="55"></el-table-column> + <el-table-column label="瑙掕壊缂栧彿" align="center" prop="roleId" /> + <el-table-column label="瑙掕壊鍚嶇О" align="center" prop="roleName" /> + <el-table-column label="鏉冮檺瀛楃" align="center" prop="roleKey" /> + <el-table-column label="鍒涘缓鏃堕棿" align="center" prop="createTime" width="180"> + <template slot-scope="scope"> + <span>{{ parseTime(scope.row.createTime) }}</span> + </template> + </el-table-column> + </el-table> + + <pagination v-show="total>0" :total="total" :page.sync="pageNum" :limit.sync="pageSize" /> + + <el-form label-width="100px"> + <el-form-item style="text-align: center;margin-left:-120px;margin-top:30px;"> + <el-button type="primary" @click="submitForm()">鎻愪氦</el-button> + <el-button @click="close()">杩斿洖</el-button> + </el-form-item> + </el-form> + </div> +</template> + +<script> +import { getAuthRole, updateAuthRole } from "@/api/system/user"; + +export default { + name: "AuthRole", + data() { + return { + // 閬僵灞� + loading: true, + // 鍒嗛〉淇℃伅 + total: 0, + pageNum: 1, + pageSize: 10, + // 閫変腑瑙掕壊缂栧彿 + roleIds:[], + // 瑙掕壊淇℃伅 + roles: [], + // 鐢ㄦ埛淇℃伅 + form: {} + }; + }, + created() { + const userId = this.$route.params && this.$route.params.userId; + if (userId) { + this.loading = true; + getAuthRole(userId).then((response) => { + this.form = response.user; + this.roles = response.roles; + this.total = this.roles.length; + this.$nextTick(() => { + this.roles.forEach((row) => { + if (row.flag) { + this.$refs.table.toggleRowSelection(row); + } + }); + }); + this.loading = false; + }); + } + }, + methods: { + /** 鍗曞嚮閫変腑琛屾暟鎹� */ + clickRow(row) { + this.$refs.table.toggleRowSelection(row); + }, + // 澶氶�夋閫変腑鏁版嵁 + handleSelectionChange(selection) { + this.roleIds = selection.map((item) => item.roleId); + }, + // 淇濆瓨閫変腑鐨勬暟鎹紪鍙� + getRowKey(row) { + return row.roleId; + }, + /** 鎻愪氦鎸夐挳 */ + submitForm() { + const userId = this.form.userId; + const roleIds = this.roleIds.join(","); + updateAuthRole({ userId: userId, roleIds: roleIds }).then((response) => { + this.$modal.msgSuccess("鎺堟潈鎴愬姛"); + this.close(); + }); + }, + /** 鍏抽棴鎸夐挳 */ + close() { + const obj = { path: "/system/user" }; + this.$tab.closeOpenPage(obj); + }, + }, +}; +</script> \ No newline at end of file diff --git a/src/views/patient/patient/index.vue b/src/views/patient/patient/index.vue new file mode 100644 index 0000000..7ca4b28 --- /dev/null +++ b/src/views/patient/patient/index.vue @@ -0,0 +1,904 @@ +<template> + <div class="app-container"> + <el-row :gutter="20"> + <!--閮ㄩ棬鏁版嵁--> + <!-- <el-col :span="4" :xs="24"> + <div class="head-container"> + <el-input + v-model="deptName" + placeholder="璇疯緭鍏ラ儴闂ㄥ悕绉�" + clearable + size="small" + prefix-icon="el-icon-search" + style="margin-bottom: 20px" + /> + </div> + <div class="head-container"> + <el-tree + :data="deptOptions" + :props="defaultProps" + :expand-on-click-node="false" + :filter-node-method="filterNode" + ref="tree" + node-key="id" + default-expand-all + highlight-current + @node-click="handleNodeClick" + /> + </div> + </el-col> --> + <!--鐢ㄦ埛鏁版嵁--> + <el-col :span="24" :xs="24"> + <el-form + :model="queryParams" + ref="queryForm" + size="small" + :inline="true" + v-show="showSearch" + label-width="98px" + > + <el-form-item label="濮撳悕" prop="userName"> + <el-input + v-model="queryParams.userName" + placeholder="璇疯緭鍏ュ鍚�" + clearable + style="width: 200px" + @keyup.enter.native="handleQuery" + /> + </el-form-item> + <el-form-item label="韬唤璇佸彿鐮�" prop="IDnumber"> + <el-input + v-model="queryParams.IDnumber" + placeholder="璇疯緭鍏ヨ韩浠借瘉鍙风爜" + clearable + style="width: 250px" + @keyup.enter.native="handleQuery" + /> + </el-form-item> + <el-form-item label="鑱旂郴鏂瑰紡" prop="phonenumber"> + <el-input + v-model="queryParams.phonenumber" + placeholder="璇疯緭鍏ヨ仈绯绘柟寮�" + clearable + style="width: 280px" + @keyup.enter.native="handleQuery" + /> + </el-form-item> + <el-row> + <el-form-item label="鎮h�呮爣绛�" prop="status"> + <el-cascader + v-model="queryParams.status" + :options="optionss" + :props="propss" + clearable + ></el-cascader> + </el-form-item> + </el-row> + + <!-- <el-form-item label="鍒涘缓鏃堕棿"> + <el-date-picker + v-model="dateRange" + style="width: 240px" + value-format="yyyy-MM-dd" + type="daterange" + range-separator="-" + start-placeholder="寮�濮嬫棩鏈�" + end-placeholder="缁撴潫鏃ユ湡" + ></el-date-picker> + </el-form-item> + <el-form-item> + <el-button type="primary" icon="el-icon-search" size="medium" @click="handleQuery">鎼滅储</el-button> + <el-button icon="el-icon-refresh" size="medium" @click="resetQuery">閲嶇疆</el-button> + </el-form-item> --> + </el-form> + + <el-row :gutter="10" class="mb8"> + <el-col :span="1.5"> + <el-button + type="primary" + plain + icon="el-icon-plus" + size="medium" + @click="handleAdd" + v-hasPermi="['system:user:add']" + >鏂板</el-button + > + </el-col> + <el-col :span="1.5"> + <el-button + type="success" + plain + icon="el-icon-edit" + size="medium" + :disabled="single" + @click="handleUpdate" + v-hasPermi="['system:user:edit']" + >淇敼</el-button + > + </el-col> + <el-col :span="1.5"> + <el-button + type="danger" + plain + icon="el-icon-delete" + size="medium" + :disabled="multiple" + @click="handleDelete" + v-hasPermi="['system:user:remove']" + >鍒犻櫎</el-button + > + </el-col> + <el-col :span="19"> + <div class="documentf"> + <div class="document"> + <el-button + type="info" + plain + icon="el-icon-upload2" + size="medium" + @click="handleImport" + v-hasPermi="['system:user:import']" + >瀵煎叆</el-button + > + </div> + <div class="document"> + <el-button + type="warning" + plain + icon="el-icon-download" + size="medium" + @click="handleExport" + v-hasPermi="['system:user:export']" + >瀵煎嚭</el-button + > + </div> + </div> + </el-col> + <!-- <el-col :span="1.5"> </el-col> --> + </el-row> + <!-- <right-toolbar + :showSearch.sync="showSearch" + @queryTable="getList" + :columns="columns" + ></right-toolbar> --> + <el-table + v-loading="loading" + :data="userList" + @selection-change="handleSelectionChange" + > + <el-table-column type="selection" width="50" align="center" /> + <el-table-column + label="搴忓彿" + align="center" + key="userId" + prop="userId" + v-if="columns[0].visible" + /> + <el-table-column + label="濮撳悕" + align="center" + key="userName" + prop="userName" + v-if="columns[1].visible" + :show-overflow-tooltip="true" + /> + <el-table-column + label="鎬у埆" + align="center" + key="nickName" + prop="nickName" + v-if="columns[2].visible" + :show-overflow-tooltip="true" + /> + <el-table-column + label="鎮h�呮爣绛�" + align="center" + key="deptName" + prop="dept.deptName" + v-if="columns[3].visible" + :show-overflow-tooltip="true" + /> + <el-table-column + label="璇佷欢绫诲瀷" + align="center" + key="phonenumber" + prop="phonenumber" + v-if="columns[4].visible" + width="120" + /><el-table-column + label="璇佷欢鍙风爜" + align="center" + key="phonenumber" + prop="phonenumber" + v-if="columns[4].visible" + width="120" + /> + <el-table-column + label="骞撮緞" + align="center" + key="phonenumber" + prop="phonenumber" + v-if="columns[4].visible" + width="120" + /> + <!-- <el-table-column + label="鐘舵��" + align="center" + key="status" + v-if="columns[5].visible" + > + <template slot-scope="scope"> + <el-switch + v-model="scope.row.status" + active-value="0" + inactive-value="1" + @change="handleStatusChange(scope.row)" + ></el-switch> + </template> + </el-table-column> --> + + <el-table-column + label="鑱旂郴鏂瑰紡" + align="center" + key="phonenumber" + prop="phonenumber" + v-if="columns[4].visible" + width="120" + /> + <el-table-column + label="寤烘。鏃ユ湡" + align="center" + prop="createTime" + v-if="columns[6].visible" + width="160" + > + <template slot-scope="scope"> + <span>{{ parseTime(scope.row.createTime) }}</span> + </template> + </el-table-column> + <el-table-column + label="鏇存柊鏃ユ湡" + align="center" + prop="createTime" + v-if="columns[6].visible" + width="160" + > + <template slot-scope="scope"> + <span>{{ parseTime(scope.row.createTime) }}</span> + </template> + </el-table-column> + <el-table-column + label="鎿嶄綔" + align="center" + width="160" + class-name="small-padding fixed-width" + > + <template slot-scope="scope" v-if="scope.row.userId !== 1"> + <el-button + size="medium" + type="text" + icon="el-icon-edit" + @click="$router.push('/patient/patient/profile/')" + v-hasPermi="['system:user:edit']" + >鏌ョ湅</el-button + > + </template> + </el-table-column> + </el-table> + + <pagination + v-show="total > 0" + :total="total" + :page.sync="queryParams.pageNum" + :limit.sync="queryParams.pageSize" + @pagination="getList" + /> + </el-col> + </el-row> + + <!-- 娣诲姞鎴栦慨鏀圭敤鎴烽厤缃璇濇 --> + <el-dialog :title="title" :visible.sync="open" width="900px" append-to-body> + <el-form ref="form" :model="form" :rules="rules" label-width="100px"> + <el-row> + <el-col :span="12"> + <el-form-item label="濮撳悕" prop="nickName"> + <el-input + v-model="form.nickName" + placeholder="璇疯緭鍏ュ鍚�" + maxlength="30" + /> + </el-form-item> + </el-col> + <el-col :span="12"> + <el-form-item label="鎬у埆" prop="deptId"> + <el-select v-model="form.sex" placeholder="璇烽�夋嫨鎬у埆"> + <el-option + v-for="dict in dict.type.sys_user_sex" + :key="dict.value" + :label="dict.label" + :value="dict.value" + ></el-option> + </el-select> + </el-form-item> + </el-col> + </el-row> + <el-row> + <el-col :span="12"> + <el-form-item label="璇佷欢绫诲瀷" prop="phonenumber"> + <el-input + v-model="form.phonenumber" + placeholder="璇烽�夋嫨璇佷欢绫诲瀷" + maxlength="11" + /> + </el-form-item> + </el-col> + <el-col :span="12"> + <el-form-item label="璇佷欢鍙�" prop="email"> + <el-input + v-model="form.email" + placeholder="璇疯緭鍏ヨ瘉浠跺彿" + maxlength="50" + /> + </el-form-item> + </el-col> + </el-row> + <el-row> + <el-col :span="12"> + <el-form-item label="鏈汉鎵嬫満鍙�" prop="userName"> + <el-input + v-model="form.userName" + placeholder="璇疯緭鍏ユ墜鏈哄彿" + maxlength="30" + /> + </el-form-item> + </el-col> + <el-col :span="12"> + <el-form-item label="浜插睘鎵嬫満鍙�" prop="password"> + <el-input + v-model="form.password" + placeholder="璇疯緭鍏ヤ翰灞炴墜鏈哄彿" + type="password" + maxlength="20" + show-password + /> + </el-form-item> + </el-col> + </el-row> + <el-row> + <el-col :span="12"> + <el-form-item label="鎮h�呮爣绛�"> + <!-- <el-select v-model="form.sex" placeholder="璇烽�夋嫨"> --> + <el-cascader + :options="optionss" + :props="propss" + clearable + ></el-cascader> + <!-- </el-select> --> + </el-form-item> + </el-col> + <!-- <el-col :span="12"> + <el-form-item label="鐘舵��"> + <el-radio-group v-model="form.status"> + <el-radio + v-for="dict in dict.type.sys_normal_disable" + :key="dict.value" + :label="dict.value" + >{{ dict.label }}</el-radio + > + </el-radio-group> + </el-form-item> + </el-col> --> + </el-row> + <!-- <el-row> + <el-col :span="12"> + <el-form-item label="宀椾綅"> + <el-select + v-model="form.postIds" + multiple + placeholder="璇烽�夋嫨宀椾綅" + > + <el-option + v-for="item in postOptions" + :key="item.postId" + :label="item.postName" + :value="item.postId" + :disabled="item.status == 1" + ></el-option> + </el-select> + </el-form-item> + </el-col> + <el-col :span="12"> + <el-form-item label="瑙掕壊"> + <el-select + v-model="form.roleIds" + multiple + placeholder="璇烽�夋嫨瑙掕壊" + > + <el-option + v-for="item in roleOptions" + :key="item.roleId" + :label="item.roleName" + :value="item.roleId" + :disabled="item.status == 1" + ></el-option> + </el-select> + </el-form-item> + </el-col> + </el-row> --> + <el-row> + <el-col :span="24"> + <el-form-item label="澶囨敞"> + <el-input + v-model="form.remark" + type="textarea" + placeholder="璇疯緭鍏ュ唴瀹�" + ></el-input> + </el-form-item> + </el-col> + </el-row> + </el-form> + <div slot="footer" class="dialog-footer"> + <el-button type="primary" @click="submitForm">纭� 瀹�</el-button> + <el-button @click="cancel">鍙� 娑�</el-button> + </div> + </el-dialog> + + <!-- 鐢ㄦ埛瀵煎叆瀵硅瘽妗� --> + <el-dialog + :title="upload.title" + :visible.sync="upload.open" + width="400px" + append-to-body + > + <el-upload + ref="upload" + :limit="1" + accept=".xlsx, .xls" + :headers="upload.headers" + :action="upload.url + '?updateSupport=' + upload.updateSupport" + :disabled="upload.isUploading" + :on-progress="handleFileUploadProgress" + :on-success="handleFileSuccess" + :auto-upload="false" + drag + > + <i class="el-icon-upload"></i> + <div class="el-upload__text">灏嗘枃浠舵嫋鍒版澶勶紝鎴�<em>鐐瑰嚮涓婁紶</em></div> + <div class="el-upload__tip text-center" slot="tip"> + <div class="el-upload__tip" slot="tip"> + <el-checkbox v-model="upload.updateSupport" /> + 鏄惁鏇存柊宸茬粡瀛樺湪鐨勭敤鎴锋暟鎹� + </div> + <span>浠呭厑璁稿鍏ls銆亁lsx鏍煎紡鏂囦欢銆�</span> + <el-link + type="primary" + :underline="false" + style="font-size: 12px; vertical-align: baseline" + @click="importTemplate" + >涓嬭浇妯℃澘</el-link + > + </div> + </el-upload> + <div slot="footer" class="dialog-footer"> + <el-button type="primary" @click="submitFileForm">纭� 瀹�</el-button> + <el-button @click="upload.open = false">鍙� 娑�</el-button> + </div> + </el-dialog> + </div> +</template> + +<script> +import { + listUser, + getUser, + delUser, + addUser, + updateUser, + resetUserPwd, + changeUserStatus, + deptTreeSelect, +} from "@/api/system/user"; +import { getToken } from "@/utils/auth"; +import Treeselect from "@riophae/vue-treeselect"; +import "@riophae/vue-treeselect/dist/vue-treeselect.css"; + +export default { + name: "User", + dicts: ["sys_normal_disable", "sys_user_sex"], + components: { Treeselect }, + data() { + return { + // 閬僵灞� + loading: true, + // 閫変腑鏁扮粍 + ids: [], + // 闈炲崟涓鐢� + single: true, + // 闈炲涓鐢� + multiple: true, + // 鏄剧ず鎼滅储鏉′欢 + showSearch: true, + // 鎬绘潯鏁� + total: 0, + // 鐢ㄦ埛琛ㄦ牸鏁版嵁 + userList: null, + // 寮瑰嚭灞傛爣棰� + title: "", + // 閮ㄩ棬鏍戦�夐」 + deptOptions: undefined, + // 鏄惁鏄剧ず寮瑰嚭灞� + open: false, + // 閮ㄩ棬鍚嶇О + deptName: undefined, + // 榛樿瀵嗙爜 + initPassword: undefined, + // 鏃ユ湡鑼冨洿 + dateRange: [], + // 宀椾綅閫夐」 + postOptions: [], + // 瑙掕壊閫夐」 + roleOptions: [], + // 琛ㄥ崟鍙傛暟 + form: {}, + propss: { multiple: true }, + optionss: [ + { + value: 1, + label: "涓滃崡", + }, + { + value: 2, + label: "瑗垮寳", + }, + { + value: 3, + label: "浠ㄤ花浠�", + }, + { + value: 4, + label: "鍏椋掗", + }, + ], + defaultProps: { + children: "children", + label: "label", + }, + // 鐢ㄦ埛瀵煎叆鍙傛暟 + upload: { + // 鏄惁鏄剧ず寮瑰嚭灞傦紙鐢ㄦ埛瀵煎叆锛� + open: false, + // 寮瑰嚭灞傛爣棰橈紙鐢ㄦ埛瀵煎叆锛� + title: "", + // 鏄惁绂佺敤涓婁紶 + isUploading: false, + // 鏄惁鏇存柊宸茬粡瀛樺湪鐨勭敤鎴锋暟鎹� + updateSupport: 0, + // 璁剧疆涓婁紶鐨勮姹傚ご閮� + headers: { Authorization: "Bearer " + getToken() }, + // 涓婁紶鐨勫湴鍧� + url: process.env.VUE_APP_BASE_API + "/system/user/importData", + }, + // 鏌ヨ鍙傛暟 + queryParams: { + pageNum: 1, + pageSize: 10, + userName: undefined, + phonenumber: undefined, + status: undefined, + deptId: undefined, + IDnumber: undefined, + }, + // 鍒椾俊鎭� + columns: [ + { key: 0, label: `鐢ㄦ埛缂栧彿`, visible: true }, + { key: 1, label: `鐢ㄦ埛鍚嶇О`, visible: true }, + { key: 2, label: `鐢ㄦ埛鏄电О`, visible: true }, + { key: 3, label: `閮ㄩ棬`, visible: true }, + { key: 4, label: `鎵嬫満鍙风爜`, visible: true }, + { key: 5, label: `鐘舵�乣, visible: true }, + { key: 6, label: `鍒涘缓鏃堕棿`, visible: true }, + ], + // 琛ㄥ崟鏍¢獙 + rules: { + userName: [ + { required: true, message: "鐢ㄦ埛鍚嶇О涓嶈兘涓虹┖", trigger: "blur" }, + { + min: 2, + max: 20, + message: "鐢ㄦ埛鍚嶇О闀垮害蹇呴』浠嬩簬 2 鍜� 20 涔嬮棿", + trigger: "blur", + }, + ], + nickName: [ + { required: true, message: "鐢ㄦ埛鏄电О涓嶈兘涓虹┖", trigger: "blur" }, + ], + password: [ + { required: true, message: "鐢ㄦ埛瀵嗙爜涓嶈兘涓虹┖", trigger: "blur" }, + { + min: 5, + max: 20, + message: "鐢ㄦ埛瀵嗙爜闀垮害蹇呴』浠嬩簬 5 鍜� 20 涔嬮棿", + trigger: "blur", + }, + ], + email: [ + { + type: "email", + message: "璇疯緭鍏ユ纭殑閭鍦板潃", + trigger: ["blur", "change"], + }, + ], + phonenumber: [ + { + pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, + message: "璇疯緭鍏ユ纭殑鎵嬫満鍙风爜", + trigger: "blur", + }, + ], + IDnumber: [ + { + pattern: + /^\d{6}((((((19|20)\d{2})(0[13-9]|1[012])(0[1-9]|[12]\d|30))|(((19|20)\d{2})(0[13578]|1[02])31)|((19|20)\d{2})02(0[1-9]|1\d|2[0-8])|((((19|20)([13579][26]|[2468][048]|0[48]))|(2000))0229))\d{3})|((((\d{2})(0[13-9]|1[012])(0[1-9]|[12]\d|30))|((\d{2})(0[13578]|1[02])31)|((\d{2})02(0[1-9]|1\d|2[0-8]))|(([13579][26]|[2468][048]|0[048])0229))\d{2}))(\d|X|x)$/, + message: "璇疯緭鍏ユ纭殑韬唤璇佸彿鐮�", + trigger: "blur", + }, + ], + }, + }; + }, + watch: { + // 鏍规嵁鍚嶇О绛涢�夐儴闂ㄦ爲 + deptName(val) { + this.$refs.tree.filter(val); + }, + }, + created() { + this.getList(); + this.getDeptTree(); + this.getConfigKey("sys.user.initPassword").then((response) => { + this.initPassword = response.msg; + }); + }, + methods: { + /** 鏌ヨ鐢ㄦ埛鍒楄〃 */ + getList() { + this.loading = true; + listUser(this.addDateRange(this.queryParams, this.dateRange)).then( + (response) => { + this.userList = response.rows; + this.total = response.total; + this.loading = false; + } + ); + }, + /** 鏌ヨ閮ㄩ棬涓嬫媺鏍戠粨鏋� */ + getDeptTree() { + deptTreeSelect().then((response) => { + this.deptOptions = response.data; + }); + }, + // 绛涢�夎妭鐐� + filterNode(value, data) { + if (!value) return true; + return data.label.indexOf(value) !== -1; + }, + // 鑺傜偣鍗曞嚮浜嬩欢 + handleNodeClick(data) { + this.queryParams.deptId = data.id; + this.handleQuery(); + }, + // 鐢ㄦ埛鐘舵�佷慨鏀� + handleStatusChange(row) { + let text = row.status === "0" ? "鍚敤" : "鍋滅敤"; + this.$modal + .confirm('纭瑕�"' + text + '""' + row.userName + '"鐢ㄦ埛鍚楋紵') + .then(function () { + return changeUserStatus(row.userId, row.status); + }) + .then(() => { + this.$modal.msgSuccess(text + "鎴愬姛"); + }) + .catch(function () { + row.status = row.status === "0" ? "1" : "0"; + }); + }, + // 鍙栨秷鎸夐挳 + cancel() { + this.open = false; + this.reset(); + }, + // 琛ㄥ崟閲嶇疆 + reset() { + this.form = { + userId: undefined, + deptId: undefined, + userName: undefined, + nickName: undefined, + password: undefined, + phonenumber: undefined, + email: undefined, + sex: undefined, + status: "0", + remark: undefined, + postIds: [], + roleIds: [], + }; + this.resetForm("form"); + }, + /** 鎼滅储鎸夐挳鎿嶄綔 */ + handleQuery() { + this.queryParams.pageNum = 1; + this.getList(); + }, + /** 閲嶇疆鎸夐挳鎿嶄綔 */ + resetQuery() { + this.dateRange = []; + this.resetForm("queryForm"); + this.queryParams.deptId = undefined; + this.$refs.tree.setCurrentKey(null); + this.handleQuery(); + }, + // 澶氶�夋閫変腑鏁版嵁 + handleSelectionChange(selection) { + this.ids = selection.map((item) => item.userId); + this.single = selection.length != 1; + this.multiple = !selection.length; + }, + // 鏇村鎿嶄綔瑙﹀彂 + handleCommand(command, row) { + switch (command) { + case "handleResetPwd": + this.handleResetPwd(row); + break; + case "handleAuthRole": + this.handleAuthRole(row); + break; + default: + break; + } + }, + /** 鏂板鎸夐挳鎿嶄綔 */ + handleAdd() { + this.reset(); + getUser().then((response) => { + this.postOptions = response.posts; + this.roleOptions = response.roles; + this.open = true; + this.title = "鏂板鎮h��"; + this.form.password = this.initPassword; + }); + }, + /** 淇敼鎸夐挳鎿嶄綔 */ + handleUpdate(row) { + this.reset(); + const userId = row.userId || this.ids; + getUser(userId).then((response) => { + this.form = response.data; + this.postOptions = response.posts; + this.roleOptions = response.roles; + this.$set(this.form, "postIds", response.postIds); + this.$set(this.form, "roleIds", response.roleIds); + this.open = true; + this.title = "淇敼鐢ㄦ埛"; + this.form.password = ""; + }); + }, + /** 閲嶇疆瀵嗙爜鎸夐挳鎿嶄綔 */ + handleResetPwd(row) { + this.$prompt('璇疯緭鍏�"' + row.userName + '"鐨勬柊瀵嗙爜', "鎻愮ず", { + confirmButtonText: "纭畾", + cancelButtonText: "鍙栨秷", + closeOnClickModal: false, + inputPattern: /^.{5,20}$/, + inputErrorMessage: "鐢ㄦ埛瀵嗙爜闀垮害蹇呴』浠嬩簬 5 鍜� 20 涔嬮棿", + }) + .then(({ value }) => { + resetUserPwd(row.userId, value).then((response) => { + this.$modal.msgSuccess("淇敼鎴愬姛锛屾柊瀵嗙爜鏄細" + value); + }); + }) + .catch(() => {}); + }, + /** 鍒嗛厤瑙掕壊鎿嶄綔 */ + handleAuthRole: function (row) { + const userId = row.userId; + this.$router.push("/system/user-auth/role/" + userId); + }, + /** 鎻愪氦鎸夐挳 */ + submitForm: function () { + this.$refs["form"].validate((valid) => { + if (valid) { + if (this.form.userId != undefined) { + updateUser(this.form).then((response) => { + this.$modal.msgSuccess("淇敼鎴愬姛"); + this.open = false; + this.getList(); + }); + } else { + addUser(this.form).then((response) => { + this.$modal.msgSuccess("鏂板鎴愬姛"); + this.open = false; + this.getList(); + }); + } + } + }); + }, + /** 鍒犻櫎鎸夐挳鎿嶄綔 */ + handleDelete(row) { + const userIds = row.userId || this.ids; + this.$modal + .confirm('鏄惁纭鍒犻櫎鐢ㄦ埛缂栧彿涓�"' + userIds + '"鐨勬暟鎹」锛�') + .then(function () { + return delUser(userIds); + }) + .then(() => { + this.getList(); + this.$modal.msgSuccess("鍒犻櫎鎴愬姛"); + }) + .catch(() => {}); + }, + /** 瀵煎嚭鎸夐挳鎿嶄綔 */ + handleExport() { + this.download( + "system/user/export", + { + ...this.queryParams, + }, + `user_${new Date().getTime()}.xlsx` + ); + }, + /** 瀵煎叆鎸夐挳鎿嶄綔 */ + handleImport() { + this.upload.title = "鐢ㄦ埛瀵煎叆"; + this.upload.open = true; + }, + /** 涓嬭浇妯℃澘鎿嶄綔 */ + importTemplate() { + this.download( + "system/user/importTemplate", + {}, + `user_template_${new Date().getTime()}.xlsx` + ); + }, + // 鏂囦欢涓婁紶涓鐞� + handleFileUploadProgress(event, file, fileList) { + this.upload.isUploading = true; + }, + // 鏂囦欢涓婁紶鎴愬姛澶勭悊 + handleFileSuccess(response, file, fileList) { + this.upload.open = false; + this.upload.isUploading = false; + this.$refs.upload.clearFiles(); + this.$alert( + "<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + + response.msg + + "</div>", + "瀵煎叆缁撴灉", + { dangerouslyUseHTMLString: true } + ); + this.getList(); + }, + // 鎻愪氦涓婁紶鏂囦欢 + submitFileForm() { + this.$refs.upload.submit(); + }, + }, +}; +</script> + +<style lang="scss" scoped> +.el-button--primary.is-plain { + color: #ffffff; + background: #409eff; + border-color: #4fabe9; +} +.document { + width: 100px; + height: 50px; +} +.documentf { + display: flex; + justify-content: flex-end; +} +</style> diff --git a/src/views/patient/patient/profile/index.vue b/src/views/patient/patient/profile/index.vue new file mode 100644 index 0000000..cd3849d --- /dev/null +++ b/src/views/patient/patient/profile/index.vue @@ -0,0 +1,767 @@ +<template> + <div class="app-container"> + <el-row :gutter="20"> + <el-col :span="4" :xs="24"> + <el-card class="box-card"> + <!-- <div slot="header" class="clearfix"> + <span>涓汉淇℃伅</span> + </div> --> + <div class="personage"> + <div class="text-center"> + <img v-imgError="require('@/assets/common/head.jpg')" src="" /> + </div> + <div class="information"> + <div class="info-xx"> + 鍚撮緳 + <div class="xinz-inf">+鏂板鏍囩</div> + </div> + <div class="info-xx">鐢�<span>66宀�</span></div> + <div class="info-xx">13803963330</div> + </div> + </div> + </el-card> + </el-col> + <el-col :span="18" :xs="24"> + <el-tabs + type="border-card" + v-model="activeName" + @tab-click="handleClick" + > + <el-tab-pane name="health"> + <span class="mulsz" slot="label" + ><i class="el-icon-date"></i> 鍋ュ悍妗f</span + > + 鍩烘湰淇℃伅 + </el-tab-pane> + <el-tab-pane name="medical"> + <span class="mulsz" slot="label" + ><i class="el-icon-s-management"></i> 鍖荤枟妗f</span + > + <el-tabs v-model="sonactiveName" @tab-click="handleClick"> + <el-tab-pane name="outpatient" + ><span class="mulsz" slot="label" + >闂ㄨ瘖({{ mznumber }})</span + ></el-tab-pane + > + <el-tab-pane name="inhospital" + ><span class="mulsz" slot="label" + >浣忛櫌({{ zynumber }}) + </span></el-tab-pane + > + <el-tab-pane name="checkout" + ><span class="mulsz" slot="label" + >妫�楠�({{ jynumber }}) + </span></el-tab-pane + > + <el-tab-pane name="examine" + ><span class="mulsz" slot="label" + >妫�鏌�({{ jcnumber }}) + </span></el-tab-pane + > + <el-tab-pane name="physical" + ><span class="mulsz" slot="label"> + 浣撴({{ tjnumber }})</span + ></el-tab-pane + > + <el-tab-pane name="pharmacy" + ><span class="mulsz" slot="label" + >鐢ㄨ嵂({{ yynumber }}) + </span></el-tab-pane + > + </el-tabs> + </el-tab-pane> + <el-tab-pane name="monitor"> + <span class="mulsz" slot="label" + ><i class="el-icon-s-data"></i> 鍋ュ悍鐩戞祴</span + > + + <el-tabs v-model="sontwoactiveName" @tab-click="handleClick"> + <el-tab-pane name="blood" + ><span class="mulsz" slot="label" + ><i class="el-icon-s-operation"></i> 琛�鍘�</span + ></el-tab-pane + > + <el-tab-pane name="glucose" + ><span class="mulsz" slot="label" + ><i class="el-icon-odometer"></i>琛�绯� + </span></el-tab-pane + > + <el-tab-pane name="weight" + ><span class="mulsz" slot="label" + ><i class="el-icon-s-data"></i>浣撻噸 + </span></el-tab-pane + > + </el-tabs></el-tab-pane + > + <el-tab-pane name="serve"> + <span class="mulsz" slot="label" + ><i class="el-icon-s-custom"></i> 鏈嶅姟璁板綍</span + > + + 瀹氭椂浠诲姟琛ュ伩</el-tab-pane + > + </el-tabs> + </el-col> + </el-row> + <!-- 鍋ュ悍妗f妯″潡 --> + <div class="information-content" v-if="activeName == 'health'"> + <div class="top-message"> + <div class="headline">鍩虹淇℃伅</div> + <div class="detailed"> + <div class="one-column"> + <div>鎮h�呭鍚嶏細<span class="spanvalue">鐜嬪ぇ缇�</span></div> + <div>鎬у埆锛�<span class="spanvalue">鐢�</span></div> + + <div>璇佷欢绫诲瀷锛�<span class="spanvalue">韬唤璇�</span></div> + </div> + <div class="one-column"> + <div>鍑虹敓鏃ユ湡锛�<span class="spanvalue">1999-01-02</span></div> + + <div>骞撮緞锛�<span class="spanvalue">121</span></div> + + <div class=""> + 璇佷欢鍙风爜锛�<span class="spanvalue">312223222322232223</span> + </div> + </div> + </div> + </div> + <div class="bottom-message"> + <div class="headline">鍙风爜缁存姢</div> + <div class="Table-screen"> + <el-table :data="tableData" style="width: 100%"> + <el-table-column prop="name" label="濮撳悕" width="180"> + </el-table-column> + <el-table-column prop="phonenumber" label="鑱旂郴鏂瑰紡" width="180"> + </el-table-column> + <el-table-column prop="concern" label="鍏崇郴"> </el-table-column> + <el-table-column prop="source" label="鑱旂郴浜烘潵婧�"> + </el-table-column> + <el-table-column prop="default" label="榛樿鑱旂郴鏂瑰紡"> + </el-table-column> + <el-table-column + label-class-name="columcz" + fixed="right" + label="鎿嶄綔" + width="300" + > + <template slot-scope="scope"> + <el-button type="success" size="small" + >璁句负榛樿鑱旂郴鏂瑰紡</el-button + > + <el-button type="warning" size="small">缂栬緫</el-button> + <el-button type="danger" size="small">鍒犻櫎</el-button> + </template> + </el-table-column> + </el-table> + </div> + </div> + </div> + <!-- 鍖荤枟妗f --> + <div class="medical-record" v-else-if="activeName == 'medical'"> + <!-- 闂ㄨ瘖 --> + <div v-if="sonactiveName == 'outpatient'"> + <el-table :data="serviceData" style="width: 100%"> + <el-table-column prop="daya" label="灏辫瘖鏃ユ湡" width="180"> + </el-table-column> + <el-table-column prop="hospitalname" label="鍖婚櫌鍚嶇О" width="180"> + </el-table-column> + <el-table-column prop="result" label="璇婃柇缁撴灉"> </el-table-column> + <el-table-column prop="administrative" label="灏辫瘖绉戝"> + </el-table-column> + <el-table-column prop="doctor" label="鍖荤敓"> </el-table-column> + <el-table-column label-class-name="columcz" label="鎿嶄綔" width="300"> + <template slot-scope="scope"> + <el-button type="text" size="small">璇︽儏</el-button> + </template> + </el-table-column> + </el-table> + + <pagination + v-show="total > 0" + :total="total" + :page.sync="queryParams.pageNum" + :limit.sync="queryParams.pageSize" + @pagination="getList" + /> + </div> + <!-- 浣忛櫌 --> + <div v-if="sonactiveName == 'inhospital'"> + <el-table :data="serviceData" style="width: 100%"> + <el-table-column prop="godaya" label="鍏ラ櫌鏃ユ湡"> </el-table-column> + <el-table-column prop="hospitalname" label="鍖婚櫌鍚嶇О"> + </el-table-column> + <el-table-column prop="result" label="鍏ラ櫌绉戝埆"> </el-table-column> + <el-table-column prop="administrative" label="鐥呭尯"> + </el-table-column> + <el-table-column prop="bed" label="搴婁綅鍙�"> </el-table-column> + <el-table-column prop="doctor" label="鍏ラ櫌璇婃柇"> </el-table-column> + <el-table-column prop="today" label="鍑洪櫌鏃堕棿"> </el-table-column> + </el-table> + </div> + <!-- 妫�楠� --> + <div v-if="sonactiveName == 'checkout'"> + <el-table :data="serviceData" style="width: 100%"> + <el-table-column prop="godaya" label="妫�楠屽崟鍙�"> </el-table-column> + <el-table-column prop="hospitalname" label="鎶ュ憡鏃ユ湡"> + </el-table-column> + <el-table-column prop="result" label="妫�楠岄」鐩�"> </el-table-column> + <el-table-column prop="administrative" label="鍖婚櫌鍚嶇О"> + </el-table-column> + </el-table> + </div> + <!-- 妫�鏌� --> + <div v-if="sonactiveName == 'examine'"> + <el-table :data="serviceData" style="width: 100%"> + <el-table-column prop="godaya" label="鎶ュ憡鍗�"> </el-table-column> + <el-table-column prop="hospitalname" label="鎶ュ憡鏃堕棿"> + </el-table-column> + <el-table-column prop="result" label="妫�鏌ラ」鐩�"> </el-table-column> + <el-table-column prop="administrative" label="鍖婚櫌鍚嶇О"> + </el-table-column> + </el-table> + </div> + <!-- 浣撴 --> + <div v-if="sonactiveName == 'physical'"> + <el-table :data="serviceData" style="width: 100%"> + <el-table-column prop="daya" label="灏辫瘖鏃ユ湡"> </el-table-column> + <el-table-column prop="hospitalname" label="鍖婚櫌鍚嶇О"> + </el-table-column> + <el-table-column prop="result" label="璇婃柇缁撴灉"> </el-table-column> + <el-table-column prop="administrative" label="灏辫瘖绉戝"> + </el-table-column> + <el-table-column prop="doctor" label="鍖荤敓"> </el-table-column> + <!-- <el-table-column + label-class-name="columcz" + fixed="right" + label="鎿嶄綔" + width="300" + > + <template slot-scope="scope"> + <el-button type="text" size="small">璇︽儏</el-button> + </template> + </el-table-column> --> + </el-table> + </div> + <!-- 鐢ㄨ嵂 --> + <div v-if="sonactiveName == 'pharmacy'"> + <el-table :data="serviceData" style="width: 100%"> + <el-table-column prop="daya" label="灏辫瘖鏃ユ湡"> </el-table-column> + <el-table-column prop="hospitalname" label="鍖婚櫌鍚嶇О"> + </el-table-column> + <el-table-column prop="result" label="璇婃柇缁撴灉"> </el-table-column> + <el-table-column prop="administrative" label="灏辫瘖绉戝"> + </el-table-column> + <el-table-column prop="doctor" label="鍖荤敓"> </el-table-column> + </el-table> + </div> + </div> + + <!-- 鏈嶅姟璁板綍 --> + <div class="medical-record" v-else-if="activeName == 'serve'">sdaad</div> + <!-- 鍋ュ悍鐩戞祴 --> + <div class="medical-record" v-show="activeName == 'monitor'"> + <!-- 琛�鍘嬪浘鏍� --> + <div v-show="sontwoactiveName == 'blood'"> + <div + id="xyeCharts" + class="sontwoactiveName" + style="width: 1300px; height: 800px" + ></div> + </div> + <!-- 琛�绯� --> + <div v-show="sontwoactiveName == 'glucose'"> + <div + id="xteCharts" + class="sontwoactiveName" + style="width: 1300px; height: 800px" + ></div> + </div> + <!-- 浣撻噸 --> + <div v-show="sontwoactiveName == 'weight'"> + <div + id="tzeCharts" + class="sontwoactiveName" + style="width: 1300px; height: 800px" + ></div> + </div> + </div> + + <!-- <div id="xyeCharts" style="width: 500px; height: 500px"></div> --> + </div> +</template> + +<script> +import userAvatar from "./userAvatar"; +import userInfo from "./userInfo"; +import resetPwd from "./resetPwd"; +import * as echarts from "echarts"; + +import { getUserProfile } from "@/api/system/user"; +import { listJob } from "@/api/monitor/job"; //鑾峰彇鍒楄〃鎺ュ彛寰呭畾 + +export default { + name: "Profile", + components: { userAvatar, userInfo, resetPwd }, + data() { + return { + user: {}, + roleGroup: {}, + postGroup: {}, + mznumber: 14, + zynumber: 34, + jynumber: 32, + jcnumber: 12, + tjnumber: 12, + yynumber: 12, + total: 0, // 鎬绘潯鏁� + activeTab: "userinfo", + activeName: "health", //涓�绫诲鑸� + sonactiveName: "outpatient", //鍋ュ悍鐩戞祴瀵艰埅 + sontwoactiveName: "blood", //鍖荤枟妗f瀵艰埅 + // 鏌ヨ鍙傛暟 + queryParams: { + pageNum: 1, + pageSize: 10, + jobName: undefined, + jobGroup: undefined, + status: undefined, + }, + echartdom: {}, + xtechartdom: {}, + tzechartdom: {}, + tableData: [ + { + date: "2016-05-02", + name: "鐜嬪皬铏�", + address: "涓婃捣甯傛櫘闄�鍖洪噾娌欐睙璺� 1518 寮�", + }, + { + date: "2016-05-04", + name: "鐜嬪皬铏�", + address: "涓婃捣甯傛櫘闄�鍖洪噾娌欐睙璺� 1517 寮�", + }, + { + date: "2016-05-01", + name: "鐜嬪皬铏�", + address: "涓婃捣甯傛櫘闄�鍖洪噾娌欐睙璺� 1519 寮�", + }, + { + date: "2016-05-03", + name: "鐜嬪皬铏�", + address: "涓婃捣甯傛櫘闄�鍖洪噾娌欐睙璺� 1516 寮�", + }, + ], + serviceData: [ + { + daya: "2023-12-12", + hospitalname: "鍗忓拰", + result: "闊у甫鎷変激", + administrative: "楠ㄧ", + doctor: "鍚村ぇ榫�", + }, + ], + }; + }, + created() { + this.$nextTick(function () { + this.echartdom = document.getElementById("xyeCharts"); + this.xtechartdom = document.getElementById("xteCharts"); + this.tzechartdom = document.getElementById("tzeCharts"); + console.log(this.echartdom); + console.log(this.xtechartdom); + console.log(this.tzechartdom); + this.echartsInit(); + this.xtechartsInit(); + this.tzechartsInit(); + }); + this.getList(); + }, + methods() {}, + + methods: { + // 鏌ヨ鍒楄〃 + getList() { + this.loading = true; + listJob(this.queryParams).then((response) => { + this.jobList = 1; + this.total = 1; + this.loading = false; + }); + }, + // getUser() { + // getUserProfile().then((response) => { + // this.user = response.data; + // this.roleGroup = response.roleGroup; + // this.postGroup = response.postGroup; + // }); + // }, + handleClick(tab, event) { + console.log(tab, event); + }, + + // 琛�鍘嬪浘琛ㄩ儴鍒� + echartsInit() { + // 鍩轰簬鍑嗗濂界殑dom锛屽垵濮嬪寲echarts瀹炰緥 + console.log(echarts); + console.log(this.echartdom); + console.log(this.$refs.xyeCharts); + var myxyChart = echarts.init(this.echartdom); + console.log(myxyChart); + // var myxyChart = this.$echarts.init(document.getElementById("xyeCharts")); + // var myxyChart = this.$echarts.init(this.$refs.xyeCharts); + var option = { + title: { + text: "鍘嗗彶琛�鍘嬭褰�", + }, + tooltip: { + trigger: "axis", + }, + legend: {}, + toolbox: { + show: true, + feature: { + dataZoom: { + yAxisIndex: "none", + }, + dataView: { readOnly: false }, + magicType: { type: ["line", "bar"] }, + restore: {}, + saveAsImage: {}, + }, + }, + xAxis: { + type: "category", + boundaryGap: false, + data: ["涓�鏈�", "浜屾湀", "涓夋湀", "鍥涙湀", "浜旀湀", "鍏湀", "涓冩湀"], + }, + yAxis: { + type: "value", + axisLabel: { + formatter: "{value}", + }, + }, + series: [ + { + name: "鏀剁缉鍘�", + type: "line", + data: [100, 120, 130, 121, 132, 142, 119], + itemStyle: { + normal: { + color: "#ff7979", + }, + }, + markPoint: { + data: [{ type: "max", name: "鑸掑紶鍘嬮珮鍊�" }], + }, + markLine: { + data: [{ yAxis: 140, name: "姝e父鑸掑紶鍘嬮珮鍊�" }], + }, + }, + { + name: "鑸掑紶鍘�", + type: "line", + data: [71, 79, 82, 85, 93, 82, 90], + itemStyle: { + normal: { + color: "#409eff", + }, + }, + markPoint: { + data: [{ name: "鍛ㄦ渶浣�", type: "min" }], + }, + markLine: { + data: [{ yAxis: 80, name: "姝e父鑸掑紶鍘嬮珮鍊�" }], + }, + }, + ], + }; + console.log("ss"); + // 浣跨敤鍒氭寚瀹氱殑閰嶇疆椤瑰拰鏁版嵁鏄剧ず鍥捐〃銆� + myxyChart.setOption(option); + }, + // 琛�绯栧浘琛� + xtechartsInit() { + // 鍩轰簬鍑嗗濂界殑dom锛屽垵濮嬪寲echarts瀹炰緥 + // console.log(echarts); + console.log(this.xtechartdom); + var myxyChart = echarts.init(this.xtechartdom); + console.log(myxyChart); + const data = [ + ["2000-06-05", 116], + ["2000-06-06", 129], + ["2000-06-07", 135], + ["2000-06-08", 86], + ["2000-06-09", 73], + ["2000-06-10", 85], + ["2000-06-11", 73], + ["2000-06-12", 68], + ["2000-06-13", 92], + ["2000-06-14", 130], + ["2000-06-15", 245], + ["2000-06-16", 139], + ["2000-06-17", 115], + ["2000-06-18", 111], + ["2000-06-19", 309], + ["2000-06-20", 206], + ["2000-06-21", 137], + ["2000-06-22", 128], + ["2000-06-23", 85], + ]; + const dateList = data.map(function (item) { + return item[0]; + }); + const valueList = data.map(function (item) { + return item[1]; + }); + var option = { + title: { + text: "鍘嗗彶琛�绯栬褰�", + }, + visualMap: [ + { + show: false, + type: "continuous", + seriesIndex: 0, + min: 0, + max: 400, + }, + ], + title: [ + { + left: "center", + text: "琛�绯栧巻鍙茬洃娴�", + }, + ], + tooltip: { + trigger: "axis", + }, + xAxis: [ + { + data: dateList, + }, + ], + yAxis: [{}], + series: [ + { + type: "line", + showSymbol: false, + data: valueList, + }, + ], + }; + console.log("ss"); + // 浣跨敤鍒氭寚瀹氱殑閰嶇疆椤瑰拰鏁版嵁鏄剧ず鍥捐〃銆� + myxyChart.setOption(option); + }, + // 浣撻噸鍥捐〃 + tzechartsInit() { + // 鍩轰簬鍑嗗濂界殑dom锛屽垵濮嬪寲echarts瀹炰緥 + console.log(echarts); + console.log(this.tzechartdom); + var myxyChart = echarts.init(this.tzechartdom); + console.log(myxyChart); + const data = [ + ["2000-06-05", 116], + ["2000-06-06", 99], + ["2000-06-07", 105], + ["2000-06-08", 126], + ["2000-06-09", 73], + ["2000-06-10", 85], + ["2000-06-11", 73], + ["2000-06-12", 68], + ["2000-06-13", 92], + ["2000-06-14", 130], + ["2000-06-15", 245], + ["2000-06-16", 119], + ["2000-06-17", 115], + ["2000-06-18", 201], + ["2000-06-19", 209], + ["2000-06-20", 106], + ["2000-06-21", 137], + ["2000-06-22", 128], + ["2000-06-23", 85], + ]; + const dateList = data.map(function (item) { + return item[0]; + }); + const valueList = data.map(function (item) { + return item[1]; + }); + var option = { + title: { + text: "鍘嗗彶琛�绯栬褰�", + }, + toolbox: { + show: true, + feature: { + dataZoom: { + yAxisIndex: "none", + }, + dataView: { readOnly: false }, + magicType: { type: ["line", "bar"] }, + restore: {}, + saveAsImage: {}, + }, + }, + visualMap: [ + { + show: false, + type: "continuous", + seriesIndex: 0, + min: 0, + max: 400, + }, + ], + title: [ + { + left: "center", + text: "琛�绯栧巻鍙茬洃娴�", + }, + ], + tooltip: { + trigger: "axis", + }, + xAxis: [ + { + data: dateList, + }, + ], + yAxis: [{}], + series: [ + { + type: "line", + showSymbol: false, + data: valueList, + lineStyle: { + width: 3, + type: "solid", + color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ + { + offset: 0, + color: "#FE7D2F", + }, + { + offset: 1, + color: "#F9D423", + }, + ]), + }, + }, + ], + }; + console.log("ss"); + // 浣跨敤鍒氭寚瀹氱殑閰嶇疆椤瑰拰鏁版嵁鏄剧ず鍥捐〃銆� + myxyChart.setOption(option); + }, + }, +}; +</script> + +<style lang="scss" scoped> +.personage { + display: flex; + .text-center { + width: 40px; + height: 40px; + margin-right: 10px; + img { + width: 100%; + } + } + .information { + font-size: 25px; + .info-xx { + margin-top: 15px; + border-bottom: 2px solid rgb(65, 161, 190); + display: flex; + span { + margin-left: 30px; + } + .xinz-inf { + cursor: pointer; + margin-left: 20px; + height: 23px; + line-height: 23px; + padding: 2px; + align-items: center; + font-size: 16px; + color: rgb(85, 151, 250); + border: 1px solid #439fff; + border-radius: 9px; + } + } + } +} +.el-tabs--border-card { + font-size: 25px; + .mulsz { + font-size: 25px; + margin-top: 20px; + } +} +.information-content { + margin-top: 20px; + background: #ffffff; + border: 1px solid #dcdfe6; + -webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12), + 0 0 6px 0 rgba(0, 0, 0, 0.04); + .top-message { + margin-top: 25px; + margin-left: 100px; + .detailed { + width: 70%; + padding: 30px; + margin-bottom: 30px; + background-color: #ddf0f8; + .one-column { + display: flex; + font-size: 20px; + margin-bottom: 30px; + padding-bottom: 3px; + .spanvalue { + display: inline-block; + min-width: 200px; + border-bottom: 1px solid rgb(172, 172, 172); + } + + div { + width: 330px; + } + } + } + } + + .headline { + font-size: 25px; + padding-left: 5px; + margin-bottom: 10px; + border-left: 8px solid rgb(65, 161, 190); + } + .bottom-message { + margin-bottom: 25px; + margin-left: 100px; + .Table-screen { + width: 70%; + padding: 30px; + margin-bottom: 30px; + background-color: #ddf0f8; + font-size: 20px !important; + } + } +} +.medical-record { + margin-top: 20px; + margin: 20px; + padding: 30px; + background: #ffffff; + border: 1px solid #dcdfe6; + -webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12), + 0 0 6px 0 rgba(0, 0, 0, 0.04); +} +.sontwoactiveName { + margin: 0 auto; +} +// .columcz { +// align-items: center!important; +// } +</style> diff --git a/src/views/patient/patient/profile/resetPwd.vue b/src/views/patient/patient/profile/resetPwd.vue new file mode 100644 index 0000000..64e8f8c --- /dev/null +++ b/src/views/patient/patient/profile/resetPwd.vue @@ -0,0 +1,68 @@ +<template> + <el-form ref="form" :model="user" :rules="rules" label-width="80px"> + <el-form-item label="鏃у瘑鐮�" prop="oldPassword"> + <el-input v-model="user.oldPassword" placeholder="璇疯緭鍏ユ棫瀵嗙爜" type="password" show-password/> + </el-form-item> + <el-form-item label="鏂板瘑鐮�" prop="newPassword"> + <el-input v-model="user.newPassword" placeholder="璇疯緭鍏ユ柊瀵嗙爜" type="password" show-password/> + </el-form-item> + <el-form-item label="纭瀵嗙爜" prop="confirmPassword"> + <el-input v-model="user.confirmPassword" placeholder="璇风‘璁ゆ柊瀵嗙爜" type="password" show-password/> + </el-form-item> + <el-form-item> + <el-button type="primary" size="mini" @click="submit">淇濆瓨</el-button> + <el-button type="danger" size="mini" @click="close">鍏抽棴</el-button> + </el-form-item> + </el-form> +</template> + +<script> +import { updateUserPwd } from "@/api/system/user"; + +export default { + data() { + const equalToPassword = (rule, value, callback) => { + if (this.user.newPassword !== value) { + callback(new Error("涓ゆ杈撳叆鐨勫瘑鐮佷笉涓�鑷�")); + } else { + callback(); + } + }; + return { + user: { + oldPassword: undefined, + newPassword: undefined, + confirmPassword: undefined + }, + // 琛ㄥ崟鏍¢獙 + rules: { + oldPassword: [ + { required: true, message: "鏃у瘑鐮佷笉鑳戒负绌�", trigger: "blur" } + ], + newPassword: [ + { required: true, message: "鏂板瘑鐮佷笉鑳戒负绌�", trigger: "blur" }, + { min: 6, max: 20, message: "闀垮害鍦� 6 鍒� 20 涓瓧绗�", trigger: "blur" } + ], + confirmPassword: [ + { required: true, message: "纭瀵嗙爜涓嶈兘涓虹┖", trigger: "blur" }, + { required: true, validator: equalToPassword, trigger: "blur" } + ] + } + }; + }, + methods: { + submit() { + this.$refs["form"].validate(valid => { + if (valid) { + updateUserPwd(this.user.oldPassword, this.user.newPassword).then(response => { + this.$modal.msgSuccess("淇敼鎴愬姛"); + }); + } + }); + }, + close() { + this.$tab.closePage(); + } + } +}; +</script> diff --git a/src/views/patient/patient/profile/userAvatar.vue b/src/views/patient/patient/profile/userAvatar.vue new file mode 100644 index 0000000..70d8487 --- /dev/null +++ b/src/views/patient/patient/profile/userAvatar.vue @@ -0,0 +1,187 @@ +<template> + <div> + <div class="user-info-head" @click="editCropper()"><img v-bind:src="options.img" title="鐐瑰嚮涓婁紶澶村儚" class="img-circle img-lg" /></div> + <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body @opened="modalOpened" @close="closeDialog"> + <el-row> + <el-col :xs="24" :md="12" :style="{height: '350px'}"> + <vue-cropper + ref="cropper" + :img="options.img" + :info="true" + :autoCrop="options.autoCrop" + :autoCropWidth="options.autoCropWidth" + :autoCropHeight="options.autoCropHeight" + :fixedBox="options.fixedBox" + :outputType="options.outputType" + @realTime="realTime" + v-if="visible" + /> + </el-col> + <el-col :xs="24" :md="12" :style="{height: '350px'}"> + <div class="avatar-upload-preview"> + <img :src="previews.url" :style="previews.img" /> + </div> + </el-col> + </el-row> + <br /> + <el-row> + <el-col :lg="2" :sm="3" :xs="3"> + <el-upload action="#" :http-request="requestUpload" :show-file-list="false" :before-upload="beforeUpload"> + <el-button size="small"> + 閫夋嫨 + <i class="el-icon-upload el-icon--right"></i> + </el-button> + </el-upload> + </el-col> + <el-col :lg="{span: 1, offset: 2}" :sm="2" :xs="2"> + <el-button icon="el-icon-plus" size="small" @click="changeScale(1)"></el-button> + </el-col> + <el-col :lg="{span: 1, offset: 1}" :sm="2" :xs="2"> + <el-button icon="el-icon-minus" size="small" @click="changeScale(-1)"></el-button> + </el-col> + <el-col :lg="{span: 1, offset: 1}" :sm="2" :xs="2"> + <el-button icon="el-icon-refresh-left" size="small" @click="rotateLeft()"></el-button> + </el-col> + <el-col :lg="{span: 1, offset: 1}" :sm="2" :xs="2"> + <el-button icon="el-icon-refresh-right" size="small" @click="rotateRight()"></el-button> + </el-col> + <el-col :lg="{span: 2, offset: 6}" :sm="2" :xs="2"> + <el-button type="primary" size="small" @click="uploadImg()">鎻� 浜�</el-button> + </el-col> + </el-row> + </el-dialog> + </div> +</template> + +<script> +import store from "@/store"; +import { VueCropper } from "vue-cropper"; +import { uploadAvatar } from "@/api/system/user"; +import { debounce } from '@/utils' + +export default { + components: { VueCropper }, + props: { + user: { + type: Object + } + }, + data() { + return { + // 鏄惁鏄剧ず寮瑰嚭灞� + open: false, + // 鏄惁鏄剧ずcropper + visible: false, + // 寮瑰嚭灞傛爣棰� + title: "淇敼澶村儚", + options: { + img: store.getters.avatar, //瑁佸壀鍥剧墖鐨勫湴鍧� + autoCrop: true, // 鏄惁榛樿鐢熸垚鎴浘妗� + autoCropWidth: 200, // 榛樿鐢熸垚鎴浘妗嗗搴� + autoCropHeight: 200, // 榛樿鐢熸垚鎴浘妗嗛珮搴� + fixedBox: true, // 鍥哄畾鎴浘妗嗗ぇ灏� 涓嶅厑璁告敼鍙� + outputType:"png" // 榛樿鐢熸垚鎴浘涓篜NG鏍煎紡 + }, + previews: {}, + resizeHandler: null + }; + }, + methods: { + // 缂栬緫澶村儚 + editCropper() { + this.open = true; + }, + // 鎵撳紑寮瑰嚭灞傜粨鏉熸椂鐨勫洖璋� + modalOpened() { + this.visible = true; + if (!this.resizeHandler) { + this.resizeHandler = debounce(() => { + this.refresh() + }, 100) + } + window.addEventListener("resize", this.resizeHandler) + }, + // 鍒锋柊缁勪欢 + refresh() { + this.$refs.cropper.refresh(); + }, + // 瑕嗙洊榛樿鐨勪笂浼犺涓� + requestUpload() { + }, + // 鍚戝乏鏃嬭浆 + rotateLeft() { + this.$refs.cropper.rotateLeft(); + }, + // 鍚戝彸鏃嬭浆 + rotateRight() { + this.$refs.cropper.rotateRight(); + }, + // 鍥剧墖缂╂斁 + changeScale(num) { + num = num || 1; + this.$refs.cropper.changeScale(num); + }, + // 涓婁紶棰勫鐞� + beforeUpload(file) { + if (file.type.indexOf("image/") == -1) { + this.$modal.msgError("鏂囦欢鏍煎紡閿欒锛岃涓婁紶鍥剧墖绫诲瀷,濡傦細JPG锛孭NG鍚庣紑鐨勬枃浠躲��"); + } else { + const reader = new FileReader(); + reader.readAsDataURL(file); + reader.onload = () => { + this.options.img = reader.result; + }; + } + }, + // 涓婁紶鍥剧墖 + uploadImg() { + this.$refs.cropper.getCropBlob(data => { + let formData = new FormData(); + formData.append("avatarfile", data); + uploadAvatar(formData).then(response => { + this.open = false; + this.options.img = process.env.VUE_APP_BASE_API + response.imgUrl; + store.commit('SET_AVATAR', this.options.img); + this.$modal.msgSuccess("淇敼鎴愬姛"); + this.visible = false; + }); + }); + }, + // 瀹炴椂棰勮 + realTime(data) { + this.previews = data; + }, + // 鍏抽棴绐楀彛 + closeDialog() { + this.options.img = store.getters.avatar + this.visible = false; + window.removeEventListener("resize", this.resizeHandler) + } + } +}; +</script> +<style scoped lang="scss"> +.user-info-head { + position: relative; + display: inline-block; + height: 120px; +} + +.user-info-head:hover:after { + content: '+'; + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + color: #eee; + background: rgba(0, 0, 0, 0.5); + font-size: 24px; + font-style: normal; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + cursor: pointer; + line-height: 110px; + border-radius: 50%; +} +</style> diff --git a/src/views/patient/patient/profile/userInfo.vue b/src/views/patient/patient/profile/userInfo.vue new file mode 100644 index 0000000..c09a20b --- /dev/null +++ b/src/views/patient/patient/profile/userInfo.vue @@ -0,0 +1,75 @@ +<template> + <el-form ref="form" :model="user" :rules="rules" label-width="80px"> + <el-form-item label="鐢ㄦ埛鏄电О" prop="nickName"> + <el-input v-model="user.nickName" maxlength="30" /> + </el-form-item> + <el-form-item label="鎵嬫満鍙风爜" prop="phonenumber"> + <el-input v-model="user.phonenumber" maxlength="11" /> + </el-form-item> + <el-form-item label="閭" prop="email"> + <el-input v-model="user.email" maxlength="50" /> + </el-form-item> + <el-form-item label="鎬у埆"> + <el-radio-group v-model="user.sex"> + <el-radio label="0">鐢�</el-radio> + <el-radio label="1">濂�</el-radio> + </el-radio-group> + </el-form-item> + <el-form-item> + <el-button type="primary" size="mini" @click="submit">淇濆瓨</el-button> + <el-button type="danger" size="mini" @click="close">鍏抽棴</el-button> + </el-form-item> + </el-form> +</template> + +<script> +import { updateUserProfile } from "@/api/system/user"; + +export default { + props: { + user: { + type: Object + } + }, + data() { + return { + // 琛ㄥ崟鏍¢獙 + rules: { + nickName: [ + { required: true, message: "鐢ㄦ埛鏄电О涓嶈兘涓虹┖", trigger: "blur" } + ], + email: [ + { required: true, message: "閭鍦板潃涓嶈兘涓虹┖", trigger: "blur" }, + { + type: "email", + message: "璇疯緭鍏ユ纭殑閭鍦板潃", + trigger: ["blur", "change"] + } + ], + phonenumber: [ + { required: true, message: "鎵嬫満鍙风爜涓嶈兘涓虹┖", trigger: "blur" }, + { + pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, + message: "璇疯緭鍏ユ纭殑鎵嬫満鍙风爜", + trigger: "blur" + } + ] + } + }; + }, + methods: { + submit() { + this.$refs["form"].validate(valid => { + if (valid) { + updateUserProfile(this.user).then(response => { + this.$modal.msgSuccess("淇敼鎴愬姛"); + }); + } + }); + }, + close() { + this.$tab.closePage(); + } + } +}; +</script> -- Gitblit v1.9.3