소스 검색

更新参谋

wuhongyuq 5 년 전
부모
커밋
46aebe4d75

+ 116 - 0
src/components/personnel/personnelcmdetail.vue

@@ -0,0 +1,116 @@
+<template>
+  <div id="policy">
+    <el-row>
+      <el-col :span="24" class="top">
+        <top></top>
+      </el-col>
+      <el-col :span="24" class="logo">
+        <div class="w_1200">
+          <logo :info="info"></logo>
+        </div>
+      </el-col>
+      <el-col :span="24" class="menu">
+        <div class="w_1200">
+          <menuInfo></menuInfo>
+        </div>
+      </el-col>
+      <el-col :span="24" class="main">
+        <div class="w_1200">
+          <el-col :span="19" class="rightcont">
+            <contextcm :policyInfo="policyInfo"></contextcm>
+          </el-col>
+        </div>
+      </el-col>
+      <el-col :span="24" class="foot">
+        <div class="w_1200">
+          <foot :info="info"></foot>
+        </div>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import top from '@/layout/index/top.vue';
+import logo from '@/layout/index/logo.vue';
+import menuInfo from '@/layout/index/menuInfo.vue';
+import foot from '@/layout/index/foot.vue';
+import fenlei from '@/layout/shuju/fenleis.vue';
+import contextcm from '@/layout/personnel/contextcm.vue';
+
+export default {
+  name: 'policy',
+  props: {
+    policyInfo: null,
+    info: null, //站点信息
+  },
+  components: {
+    top, //头部
+    logo, //logo
+    menuInfo, //导航
+    foot, //底部
+    contextcm, //右边栏
+  },
+  data: () => ({}),
+  created() {},
+  computed: {},
+  methods: {
+    clickList({ id }) {
+      console.log(id);
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.w_1200 {
+  width: 1200px;
+  margin: 0 auto;
+}
+.top {
+  height: 40px;
+  overflow: hidden;
+  background-color: rgba(11, 58, 125, 0.8);
+}
+.logo {
+  height: 200px;
+  overflow: hidden;
+}
+.menu {
+  height: 70px;
+  overflow: hidden;
+}
+.main {
+  min-height: 600px;
+  overflow: hidden;
+  margin: 10px 0;
+}
+
+.main .fenlei {
+  float: left;
+  width: 240px;
+  min-height: 800px;
+  margin: 0 10px 0 0;
+  overflow: hidden;
+}
+.main .rightcont {
+  float: left;
+  width: 1200px;
+  min-height: 800px;
+  overflow: hidden;
+  background-color: #fff;
+}
+.main .link {
+  float: left;
+  width: 100%;
+  height: 100px;
+  overflow: hidden;
+  background-color: #fff;
+}
+.foot {
+  float: left;
+  width: 100%;
+  height: 120px;
+  overflow: hidden;
+}
+</style>

+ 90 - 0
src/layout/personnel/contextcm.vue

@@ -0,0 +1,90 @@
+<template>
+  <div id="policyrightcont">
+    <el-row>
+      <el-col :span="24" class="info">
+        <el-col :span="24" class="topInfo">
+          <span>参谋详情</span>
+        </el-col>
+        <el-col :span="24" class="infoMess">
+          <el-col :span="24" class="title">
+            {{ policyInfo.name }}
+          </el-col>
+          <el-col :span="24" class="infoDate">
+            <p>
+              <span>发布人:{{ policyInfo.user_name }}</span>
+              <span>信息类型 {{ policyInfo.infotype }}</span>
+              <span>发布时间: {{ policyInfo.meta && policyInfo.meta.createdAt ? new Date(policyInfo.meta.createdAt).toLocaleDateString() : '' || '' }}</span>
+            </p>
+          </el-col>
+          <el-col v-if="policyInfo.picture" class="image">
+            <el-image style="width:50%" :src="policyInfo.picture"></el-image>
+          </el-col>
+          <el-col :span="24" class="content">
+            <p v-html="policyInfo.content"></p>
+          </el-col>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'policyrightcont',
+  props: {
+    columnTitle: null,
+    policyInfo: null,
+  },
+  components: {},
+  data: () => ({}),
+  created() {},
+  computed: {},
+  methods: {},
+};
+</script>
+
+<style lang="less" scoped>
+p {
+  padding: 0;
+  margin: 0;
+}
+.info {
+  min-height: 800px;
+  padding: 0 20px;
+  background-color: #fff;
+}
+.topInfo {
+  height: 60px;
+  line-height: 60px;
+  font-size: 22px;
+}
+.infoMess .title {
+  line-height: 30px;
+  text-align: center;
+  font-size: 16px;
+  font-weight: bold;
+  color: #000000;
+  margin: 0 0 20px 0;
+}
+.infoDate {
+  height: 36px;
+  line-height: 36px;
+}
+.infoDate p {
+  width: 700px;
+  background: #eeeeee;
+  margin: 0 105px;
+}
+.infoDate p span {
+  font-size: 14px;
+  color: #000;
+  padding: 0 0 0 80px;
+}
+.infoMess .image {
+  text-align: center;
+  margin: 20px 0 0 0;
+}
+.content {
+  padding: 0px 0 20px 0;
+}
+</style>

+ 10 - 1
src/layout/personnel/mainInfo.vue

@@ -65,7 +65,13 @@
           </el-tab-pane>
           <el-tab-pane label="找参谋" name="fourth">
             <el-table :data="canmoData" stripe style="width: 100%">
-              <el-table-column prop="name" label="名称" align="center"> </el-table-column>
+              <el-table-column label="名称" align="center">
+                <template slot-scope="scoped">
+                  <el-tooltip effect="dark" content="点击显示详情" placement="left">
+                    <el-col :span="24" @click.native="clickDetailcm(scoped.row)">{{ scoped.row.name }}</el-col>
+                  </el-tooltip>
+                </template>
+              </el-table-column>
               <el-table-column prop="infotype" label="信息类型" align="center"> </el-table-column>
               <el-table-column prop="user_name" label="发布人" align="center"> </el-table-column>
             </el-table>
@@ -114,6 +120,9 @@ export default {
     clickDetailzj(row) {
       this.$emit('detailzj', { data: row });
     },
+    clickDetailcm(row) {
+      this.$emit('detailcm', { data: row });
+    },
   },
 };
 </script>

+ 5 - 0
src/views/personnel/personnel.vue

@@ -12,6 +12,7 @@
       @detail="clickDetail"
       @detailgz="clickDetailgz"
       @detailzj="clickDetailzj"
+      @detailcm="clickDetailcm"
     ></personnel-detail>
   </div>
 </template>
@@ -141,6 +142,10 @@ export default {
       // 点击这个方法,跳转页面,并把id传过去,并用id查询详情
       this.$router.push({ path: '/personnel/personnelexpert', query: { id: data.id } });
     },
+    clickDetailcm({ data }) {
+      // 点击这个方法,跳转页面,并把id传过去,并用id查询详情
+      this.$router.push({ path: '/personnel/personnelcmdetail', query: { id: data.id } });
+    },
   },
 };
 </script>

+ 44 - 8
src/views/personnel/personnelcmdetail.vue

@@ -1,19 +1,55 @@
 <template>
-  <div id="personnelcmdetail">
-    <p>personnelcmdetail</p>
+  <div id="servicedetail">
+    <personnelcmdetail-detail :info="info" :policyInfo="policyInfo"></personnelcmdetail-detail>
   </div>
 </template>
 
 <script>
+import personnelcmdetailDetail from '@/components/personnel/personnelcmdetail.vue';
+import { createNamespacedHelpers, mapGetters } from 'vuex';
+const { mapActions: mapSite } = createNamespacedHelpers('site');
+
+const { mapActions: mapNews } = createNamespacedHelpers('policiesjbxx');
 export default {
-  name: 'personnelcmdetail',
+  name: 'servicedetail',
   props: {},
-  components: {},
-  data: () => ({}),
-  created() {},
+  components: {
+    personnelcmdetailDetail,
+  },
+  data: () => ({
+    info: {},
+
+    policyInfo: {},
+  }),
+  created() {
+    this.searchSite();
+
+    this.searchInfo();
+  },
   computed: {},
-  methods: {},
+  methods: {
+    ...mapSite(['showInfo']),
+    ...mapNews({ newsList: 'query', newsInfo: 'fetch' }),
+    // 查询站点信息
+    async searchSite() {
+      let res = await this.showInfo();
+      let object = JSON.parse(JSON.stringify(res.data));
+      if (object) {
+        this.$set(this, `info`, res.data);
+      } else {
+        this.$message.error(res.errmsg ? res.errmsg : 'error');
+      }
+    },
+    // 查询科技政务栏目
+
+    async searchInfo() {
+      let detailId = this.$route.query.id;
+      const res = await this.newsInfo(detailId);
+
+      this.$set(this, `policyInfo`, res.data);
+    },
+  },
 };
 </script>
 
-<style lang="scss" scoped></style>
+<style lang="less" scoped></style>