From 2f7798820057f2c996640e221cddd02a27f64621 Mon Sep 17 00:00:00 2001
From: long <515897141@qq.com>
Date: 星期四, 04 十一月 2021 17:02:01 +0800
Subject: [PATCH] 更新elemenui版本、添加模块详情2

---
 package.json               |    2 
 src/pages/demo/detail2.vue |  165 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 src/router/demo_router.js  |    6 ++
 3 files changed, 172 insertions(+), 1 deletions(-)

diff --git a/package.json b/package.json
index 1e950ef..1e23c28 100644
--- a/package.json
+++ b/package.json
@@ -16,7 +16,7 @@
   "dependencies": {
     "axios": "0.18.1",
     "core-js": "3.6.5",
-    "element-ui": "2.13.2",
+    "element-ui": "^2.15.6",
     "js-cookie": "2.2.0",
     "normalize.css": "7.0.0",
     "nprogress": "0.2.0",
diff --git a/src/pages/demo/detail2.vue b/src/pages/demo/detail2.vue
new file mode 100644
index 0000000..f02e5e1
--- /dev/null
+++ b/src/pages/demo/detail2.vue
@@ -0,0 +1,165 @@
+<template>
+  <div class="app-container">
+    <!-- 杩斿洖鎸夐挳鍜屾爣棰� -->
+    <el-page-header class="mb20" :content="objectName+'璇︽儏'" @back="$router.go(-1)" />
+
+    <el-descriptions title="鍩烘湰淇℃伅" :column="3" label-class-name="my-label" class="mb20">
+      <template slot="extra">
+        <el-button type="primary" size="small">鎿嶄綔</el-button>
+      </template>
+      <el-descriptions-item label="鐢ㄦ埛鍚�">kooriookami</el-descriptions-item>
+      <el-descriptions-item label="鎵嬫満鍙�">18100000000</el-descriptions-item>
+      <el-descriptions-item label="灞呬綇鍦�">鑻忓窞甯�</el-descriptions-item>
+      <el-descriptions-item label="澶囨敞">
+        <el-tag size="small">瀛︽牎</el-tag>
+      </el-descriptions-item>
+      <el-descriptions-item label="鑱旂郴鍦板潃">姹熻嫃鐪佽嫃宸炲競鍚翠腑鍖哄惔涓ぇ閬� 1188 鍙�</el-descriptions-item>
+    </el-descriptions>
+
+    <!-- upload鏀惧ぇ鍥剧墖 -->
+    <el-dialog :visible.sync="uploadPreviewVisible" style="text-align:center">
+      <img style="max-width:100%" :src="uploadPreviewUrl" alt="">
+    </el-dialog>
+
+    <back-to-top :visibility-height="300" :back-position="50" transition-name="fade" />
+  </div>
+</template>
+
+<script>
+import mixin_Upload from '@/mixins/upload.js'
+import BackToTop from '@/components/BackToTop'
+export default {
+  name: 'Demo',
+  components: { BackToTop },
+  mixins: [mixin_Upload],
+  data() {
+    return {
+      id: this.$route.query.id || '',
+      showSearch: true, // 鏄惁鏄剧ず鎼滅储鍖�
+      keyWord: '', // 鎼滅储鍖哄瓧娈碉紝鍙嚜琛屾墿灞曞叾浣欏瓧娈�
+
+      // TODO
+      objectName: 'xx', // 瀵硅薄鍚嶇О锛岀敤浜庡垹闄ゆ彁绀恒�佸惎鐢ㄦ彁绀恒�佸脊绐楁爣棰樼瓑
+
+      // 鏁版嵁
+      detail: '',
+
+      // 琛ㄥ崟鏍¢獙
+      rules: {}
+    }
+  },
+  mounted() {
+    this.init()
+  },
+  methods: {
+    // 鍒濆鍖�
+    init() {
+      this.getDetail()
+    },
+
+    // 鑾峰彇鍒楄〃
+    getDetail() {
+      var { id } = this
+      this.postFN({
+        url: 'admin/student/see',
+        params: {
+          id: id
+        },
+        mockData: {
+          code: 100,
+          msg: '',
+          data: {
+            allergyData: '["鑺辩敓"]',
+            birthday: '2017-07-13',
+            createTime: '2021-06-10 14:49:15',
+            dayStatus: 0,
+            dayTime: null,
+            fatherName: '榛勫ぇ澶�',
+            headImg: 'https://phitab20.oss-cn-shenzhen.aliyuncs.com/imagesUrl/IMG/5162a280-6ed5-4cfb-bb3c-02fc90d30209.jpg',
+            id: 'f8b32dc8c9b711ebb79300163e0133f7',
+            inTime: '2021-06-10 00:00:00',
+            isDel: 0,
+            isUp: 1,
+            linkTel1: '15999971794',
+            linkTel2: '13631419717',
+            motherName: '闄堟檽鏅�',
+            name: '榛勫皬闆�',
+            numberNo: '0000010',
+            outTime: '2023-07-01 00:00:00',
+            remark: '1111',
+            schoolClassId: '1',
+            sexType: 2,
+            status: 0
+          }
+        }
+      }, (inf) => {
+        this.detail = inf
+      })
+    },
+
+    // 鍒犻櫎
+    handleDelete(item) {
+      // 鎵撳紑浜屾纭寮圭獥
+      this.$confirm('鏄惁纭鍒犻櫎璇�' + this.objectName + '?', '鎻愮ず', {
+        confirmButtonText: '纭畾',
+        cancelButtonText: '鍙栨秷',
+        type: 'warning'
+      }).then(() => {
+        // 纭畾鍥炶皟
+        // TODO url
+        this.postFN({
+          url: 'xxx',
+          params: {
+            id: item.id
+          },
+          mockData: {
+            code: 100,
+            msg: '',
+            data: {}
+          }
+        }, () => {
+          this.getList()
+          this.$messageSuc('鍒犻櫎鎴愬姛')
+        })
+      }).catch(() => {})
+    },
+    // 淇敼鏄惁涓婃灦
+    handleUpChange(item) {
+      const text = item.isUp === 1 ? '涓婃灦' : '涓嬫灦'
+      this.$confirm('纭瑕�' + text + '璇�' + this.objectName + '鍚�?', '鎻愮ず', {
+        confirmButtonText: '纭畾',
+        cancelButtonText: '鍙栨秷',
+        type: 'warning'
+      }).then(() => {
+        // TODO url
+        this.postFN({
+          url: 'xxx',
+          params: {
+            id: item.id,
+            isUp: item.isUp
+          },
+          mockData: {
+            code: 100,
+            msg: '',
+            data: {}
+          }
+        }, () => {
+          this.$messageSuc(text + '鎴愬姛')
+        }, (res) => {
+          item.isUp = item.isUp === 1 ? 0 : 1
+          this.$messageError(res.msg)
+        })
+      }).catch(() => {
+        item.isUp = item.isUp === 1 ? 0 : 1
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.my-label{
+  white-space: nowrap;
+  font-weight: bold
+}
+</style>
diff --git a/src/router/demo_router.js b/src/router/demo_router.js
index a5e1acb..b30b5f0 100644
--- a/src/router/demo_router.js
+++ b/src/router/demo_router.js
@@ -36,6 +36,12 @@
       meta: { title: '妯℃澘璇︽儏' }
     },
     {
+      path: 'detail2',
+      component: () => import('@/pages/demo/detail2'), // Parent router-view
+      name: 'demoDetail2',
+      meta: { title: '妯℃澘璇︽儏2' }
+    },
+    {
       path: 'listDialog',
       component: () => import('@/pages/demo/classList'), // Parent router-view
       name: 'listDialog',

--
Gitblit v1.8.0