From 4ae5fbee7f608cd85d615ee055a075d51de30e59 Mon Sep 17 00:00:00 2001
From: long <515897141@qq.com>
Date: 星期五, 11 六月 2021 11:04:53 +0800
Subject: [PATCH] 模板详情

---
 src/pages/demo/detail.vue |  220 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 src/router/demo_router.js |    6 +
 2 files changed, 226 insertions(+), 0 deletions(-)

diff --git a/src/pages/demo/detail.vue b/src/pages/demo/detail.vue
new file mode 100644
index 0000000..7ee4a8f
--- /dev/null
+++ b/src/pages/demo/detail.vue
@@ -0,0 +1,220 @@
+<template>
+  <div class="app-container">
+    <!-- 杩斿洖鎸夐挳鍜屾爣棰� -->
+    <el-page-header class="mb20" :content="objectName+'璇︽儏'" @back="$router.go(-1)" />
+
+    <div class="group-title">鍩烘湰淇℃伅</div>
+    <el-row :gutter="22" class="flex-1">
+      <el-col :span="8"><div class="col-tx">鍏憡鍚嶇О锛�</div></el-col>
+      <el-col :span="8"><div class="col-tx">璁㈠崟缂栧彿锛�</div></el-col>
+      <el-col :span="8">
+        <div class="col-tx flex flex-ver">鐘舵�侊細
+          <span v-if="order" class="status-btn" :class="'status'+order.status">{{ statusOptions[order.status].name }}</span>
+        </div>
+      </el-col>
+      <el-col :span="8"><div class="col-tx">閲囪喘浼佷笟锛�</div></el-col>
+      <el-col :span="8"><div class="col-tx">鍒拌揣鏈熼檺锛�</div></el-col>
+    </el-row>
+
+    <div class="flex">
+      <div class="flex-1" />
+      <el-row :gutter="10" class="mb8">
+        <el-col :span="1.5">
+          <el-button
+            size="small"
+            type="primary"
+          >閲嶆柊鍘嬬缉</el-button>
+        </el-col>
+        <el-col :span="1.5">
+          <el-button
+            size="small"
+            type="danger"
+          >鍙栨秷璁㈠崟</el-button>
+        </el-col>
+      </el-row>
+    </div>
+
+    <!-- 鍗犱綅绗� -->
+    <div style="height: 100px" />
+
+    <!-- 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>
+.line{
+  margin: 20px 0;
+  border-bottom: 1px solid #E7E7E7;
+}
+.group-title{
+  margin-bottom: 20px;
+  font-size: 18px;
+  line-height: 30px;
+  color: #000000;
+  padding: 10px 0;
+  border-bottom: 1px solid #E7E7E7;
+  font-weight: bold;
+}
+.col-tx{
+  margin-bottom: 20px;
+  line-height: 1.4;
+  .light{
+    color: #0DB9B4;
+  }
+  .editbtn{
+    padding: 4px 15px;
+    font-size: 12px;
+    margin-left: 10px;
+  }
+}
+.question-item{
+  margin-bottom: 20px;
+  .title{
+    font-size: 14px;
+    font-weight: bold;
+    line-height: 1.4;
+  }
+  .answer{
+    font-size: 14px;
+    line-height: 1.4;
+    padding: 10px 30px 0;
+  }
+}
+</style>
diff --git a/src/router/demo_router.js b/src/router/demo_router.js
index c8817ec..7c493f6 100644
--- a/src/router/demo_router.js
+++ b/src/router/demo_router.js
@@ -28,6 +28,12 @@
       component: () => import('@/pages/demo/form'), // Parent router-view
       name: 'demoForm',
       meta: { title: '妯℃澘琛ㄥ崟' }
+    },
+    {
+      path: 'detail',
+      component: () => import('@/pages/demo/detail'), // Parent router-view
+      name: 'demoDetail',
+      meta: { title: '妯℃澘璇︽儏' }
     }
   ]
 }

--
Gitblit v1.8.0