From 4d56d69047571edc112283ceac1c9c285ca8d679 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=99=E8=8F=B2?= <1622041228@qq.com> Date: Tue, 24 May 2022 16:52:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=94=A8=E6=88=B7=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E6=A8=A1=E5=9D=97=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/CardModal/index.vue | 5 + src/utils/handleData.js | 23 ++ src/views/login/index.vue | 3 +- .../system/user/components/UserModal.vue | 222 +++++++++++++++++- src/views/system/user/index.vue | 39 +-- 5 files changed, 267 insertions(+), 25 deletions(-) diff --git a/src/components/CardModal/index.vue b/src/components/CardModal/index.vue index 7290e53..722712b 100644 --- a/src/components/CardModal/index.vue +++ b/src/components/CardModal/index.vue @@ -3,10 +3,15 @@ v-bind="getModalOptions" :style="`width:${getModalOptions.width}px`" preset="card" + :title="options.title" @update:show="handleClose" > + + 取消 + 确认 + diff --git a/src/utils/handleData.js b/src/utils/handleData.js index 47b839a..e9a79ec 100644 --- a/src/utils/handleData.js +++ b/src/utils/handleData.js @@ -107,3 +107,26 @@ export function formatTreeData(data, formatter, childKey = 'children') { } return result } + +/** + * 处理select数据 + * @param data 需要处理的数据 + * @params {label: XX, value: XX, children: XX} 需要处理的结构 + * @returns {[]} 处理后的数据 + */ +export function dataToSelect(data, optionsObj) { + const result = [] + if (data && data.length) { + data.forEach((item) => { + const i = {} + i.label = item[optionsObj.label] + i.value = item[optionsObj.value] + if (item.children && item.children.length) { + dataToSelect(item.children, optionsObj) + i.children = item[optionsObj.children] + } + result.push(i) + }) + } + return result +} diff --git a/src/views/login/index.vue b/src/views/login/index.vue index aa48a75..8108522 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -105,7 +105,8 @@ export default { goPage() { // const query = this.$route.query // const path = query && query.from ? query.from : '/' - // this.$router.push(path) + // console.log(path) + // this.$router.replace(path) this.$router.replace('/home') } } diff --git a/src/views/system/user/components/UserModal.vue b/src/views/system/user/components/UserModal.vue index ad97dae..59b9837 100644 --- a/src/views/system/user/components/UserModal.vue +++ b/src/views/system/user/components/UserModal.vue @@ -1,15 +1,147 @@ + diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index 1fe039c..5ea6e4e 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -8,15 +8,16 @@ :row-key="(row) => row.id" :request="loadDataTable" size="large" - scroll-x="1200" > + +