瀏覽代碼

技术问答更新

guhongwei 5 年之前
父節點
當前提交
9c19c12b3b

+ 171 - 0
src/layout/technology/answerData.vue

@@ -0,0 +1,171 @@
+<template>
+  <div id="answerData">
+    <el-row>
+      <el-col :span="24" class="answerData">
+        <el-table :data="answerData" style="width: 100%" border>
+          <el-table-column label="序号" type="index" width="50" align="left"> </el-table-column>
+          <el-table-column prop="themeId" label="问题主题ID" width="" align="left"> </el-table-column>
+          <el-table-column prop="bianma" label="回答编号" width="" align="left"> </el-table-column>
+          <el-table-column prop="answerID" label="回答用户ID" width="" align="left"> </el-table-column>
+          <el-table-column prop="answer" label="答案" width="" align="left"> </el-table-column>
+          <el-table-column prop="date" label="回答日期" width="" align="left"> </el-table-column>
+          <el-table-column prop="state" label="状态" width="" align="left"> </el-table-column>
+          <el-table-column label="操作" width="199" align="left">
+            <template slot-scope="scoped">
+              <el-button size="mini" type="primary" icon="el-icon-view" title="查看详情" @click="openDialog(scoped.$index)"></el-button>
+              <el-button size="mini" type="primary" icon="el-icon-edit" title="通过" @click="adopt"></el-button>
+              <el-button size="mini" type="danger" icon="el-icon-delete" title="拒绝" @click="refuse"></el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+        <el-col :span="24" class="page">
+          <el-pagination
+            @size-change="handleSizeChange"
+            @current-change="handleCurrentChange"
+            :current-page="currentPage"
+            layout="total, prev, pager, next, jumper"
+            :total="1"
+          >
+          </el-pagination>
+        </el-col>
+      </el-col>
+    </el-row>
+    <el-dialog title="产品服务审核" :visible.sync="dialog">
+      <el-form :model="info">
+        <el-form-item label="技术问答主题ID:" :label-width="formLabelWidth">
+          <span>{{ info.themeId }}</span>
+        </el-form-item>
+        <el-form-item label="回答编号:" :label-width="formLabelWidth">
+          <span>{{ info.bianma }}</span>
+        </el-form-item>
+        <el-form-item label="回答用户ID" :label-width="formLabelWidth">
+          <span>{{ info.answerID }}</span>
+        </el-form-item>
+        <el-form-item label="答案:" :label-width="formLabelWidth">
+          <span>{{ info.answer }}</span>
+        </el-form-item>
+        <el-form-item label="审核结果描述:" :label-width="formLabelWidth">
+          <el-input type="textarea" v-model="info.miaoshu" placeholder="请输入审核结果描述"></el-input>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="dialog = false">通 过</el-button>
+        <el-button type="danger" @click="dialog = false">拒 绝</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'examineData',
+  props: {
+    answerData: null,
+  },
+  components: {},
+  data: () => ({
+    currentPage: 1,
+    dialog: false,
+    info: {},
+    formLabelWidth: '120px',
+    pic: require('@/assets/logo.png'),
+  }),
+  created() {},
+  computed: {},
+  methods: {
+    handleSizeChange(val) {
+      console.log(`每页 ${val} 条`);
+    },
+    handleCurrentChange(val) {
+      console.log(`当前页: ${val}`);
+    },
+    openDialog(index) {
+      if (index !== undefined) {
+        let data = JSON.parse(JSON.stringify(this.answerData[index]));
+        data[`index`] = index;
+        this.$set(this, `info`, data);
+      }
+      this.dialog = true;
+    },
+    refuse() {
+      this.$confirm('审核拒绝,您确定吗?', '系统提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning',
+      })
+        .then(() => {
+          this.$message({
+            type: 'success',
+            message: '操作成功!',
+          });
+        })
+        .catch(() => {
+          this.$message({
+            type: 'info',
+            message: '已取消操作',
+          });
+        });
+    },
+    adopt() {
+      this.$confirm('审核通过,您确定吗?', '系统提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning',
+      })
+        .then(() => {
+          this.$message({
+            type: 'success',
+            message: '操作成功!',
+          });
+        })
+        .catch(() => {
+          this.$message({
+            type: 'info',
+            message: '已取消操作',
+          });
+        });
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+p {
+  padding: 0;
+  margin: 0;
+}
+.answerData {
+  padding: 20px 0 0 0;
+}
+/deep/.el-table th {
+  padding: 5px 0;
+  background: #f2f2f2;
+}
+/deep/.el-table td {
+  padding: 5px 0;
+}
+/deep/.el-table tr {
+  background: #f9f9f9;
+}
+/deep/.el-table tr:nth-child(2n) {
+  background: #fff;
+}
+.page {
+  text-align: center;
+  padding: 30px 0;
+}
+.text {
+  font-size: 16px;
+  padding: 0 0 10px 0;
+}
+.text span {
+  display: inherit;
+  text-indent: 1rem;
+}
+/deep/.el-form-item {
+  margin-bottom: 0;
+}
+/deep/.el-dialog__footer {
+  text-align: center;
+}
+</style>

+ 95 - 0
src/layout/technology/labelData.vue

@@ -0,0 +1,95 @@
+<template>
+  <div id="labelData">
+    <el-row>
+      <el-col :span="24" class="labelData">
+        <el-table :data="tableData" style="width: 100%" border>
+          <el-table-column label="序号" type="index" width="50" align="left"> </el-table-column>
+          <el-table-column prop="title" label="标签名称" width="" align="left"> </el-table-column>
+          <el-table-column prop="bianma" label="标签编码" width="" align="left"> </el-table-column>
+          <el-table-column label="操作" width="" align="left">
+            <template slot-scope="scoped">
+              <el-button size="mini" type="primary" icon="el-icon-edit" @click="addData(scoped.$index)"></el-button>
+              <el-button size="mini" type="danger" icon="el-icon-delete" @click.native.prevent="deleteRow(scoped.$index, tableData)"></el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+        <el-col :span="24" class="page">
+          <el-pagination
+            @size-change="handleSizeChange"
+            @current-change="handleCurrentChange"
+            :current-page="currentPage"
+            layout="total, prev, pager, next, jumper"
+            :total="1"
+          >
+          </el-pagination>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'labelData',
+  props: {
+    tableData: null,
+  },
+  components: {},
+  data: () => ({
+    currentPage: 1,
+  }),
+  created() {},
+  computed: {},
+  methods: {
+    handleSizeChange(val) {
+      console.log(`每页 ${val} 条`);
+    },
+    handleCurrentChange(val) {
+      console.log(`当前页: ${val}`);
+    },
+    addData(index) {
+      if (index !== undefined) {
+        let data = this.tableData[index];
+      } else {
+        this.form = {};
+      }
+      this.$router.push({ path: './detail' });
+    },
+    deleteRow(index, rows) {
+      rows.splice(index, 1);
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+p {
+  padding: 0;
+  margin: 0;
+}
+/deep/.el-table th {
+  padding: 5px 0;
+  background: #f2f2f2;
+}
+/deep/.el-table td {
+  padding: 5px 0;
+}
+/deep/.el-table tr {
+  background: #f9f9f9;
+}
+/deep/.el-table tr:nth-child(2n) {
+  background: #fff;
+}
+.page {
+  text-align: center;
+  padding: 30px 0;
+}
+.text {
+  font-size: 16px;
+  padding: 0 0 10px 0;
+}
+.text span {
+  display: inherit;
+  text-indent: 1rem;
+}
+</style>

+ 50 - 0
src/layout/technology/labelForm.vue

@@ -0,0 +1,50 @@
+<template>
+  <div id="labelForm">
+    <el-row>
+      <el-col :span="24" class="labelForm">
+        <el-form ref="form" :model="form" label-width="120px">
+          <el-form-item label="标签名称">
+            <el-input v-model="form.title" placeholder="请输入标签名称"></el-input>
+          </el-form-item>
+          <el-form-item label="标签编码">
+            <el-input v-model="form.title" placeholder="请输入标签编码"></el-input>
+          </el-form-item>
+          <el-form-item>
+            <el-button @click="handleCancel">返回</el-button>
+            <el-button type="primary" @click="handleEdit()">提交</el-button>
+          </el-form-item>
+        </el-form>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'labelForm',
+  props: {
+    form: null,
+  },
+  components: {},
+  data: () => ({}),
+  created() {},
+  computed: {},
+  methods: {
+    handleEdit() {
+      this.handleCancel();
+    },
+    handleCancel() {
+      this.$router.push({ path: './index' });
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.el-form {
+  padding: 0 200px;
+}
+.labelForm {
+  padding: 20px 0;
+}
+</style>

+ 47 - 0
src/layout/technology/searchInfo.vue

@@ -0,0 +1,47 @@
+<template>
+  <div id="searchInfo">
+    <el-row>
+      <el-col :span="24" class="searchInfo">
+        <el-col :span="6" class="left">
+          <span>查看标签名称:</span>
+          <el-input v-model="input" placeholder="请输入标签名称"></el-input>
+        </el-col>
+        <el-col :span="6" class="right">
+          <el-button size="mini" type="primary" icon="el-icon-search">查询</el-button>
+          <el-button size="mini" type="success" icon="el-icon-check" @click="addData()">添加标签</el-button>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'searchInfo',
+  props: {},
+  components: {},
+  data: () => ({
+    input: '',
+  }),
+  created() {},
+  computed: {},
+  methods: {
+    addData() {
+      this.$router.push({ path: './detail' });
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.searchInfo .left span {
+  font-size: 13px;
+  color: #393939;
+}
+.searchInfo .left .el-input {
+  width: 50%;
+}
+/deep/.searchInfo .left .el-input .el-input__inner {
+  height: 28px;
+}
+</style>

+ 4 - 0
src/router/index.js

@@ -262,6 +262,10 @@ export default new Router({
       path: '/technology/label/index',
       component: () => import('../views/technology/label/index.vue'),
     },
+    {
+      path: '/technology/label/detail',
+      component: () => import('../views/technology/label/detail.vue'),
+    },
     // 技术问答-主题审核
     {
       path: '/technology/theme/index',

+ 44 - 5
src/views/technology/answer/index.vue

@@ -1,19 +1,58 @@
 <template>
   <div id="index">
-    <p>index</p>
+    <el-row>
+      <el-col :span="24" class="info">
+        <el-col :span="24" class="top">
+          <topInfo :topTitle="topTitle"></topInfo>
+        </el-col>
+        <el-col :span="24" class="main">
+          <answerData :answerData="answerData"></answerData>
+        </el-col>
+      </el-col>
+    </el-row>
   </div>
 </template>
 
 <script>
+import topInfo from '@/layout/public/top.vue';
+import answerData from '@/layout/technology/answerData.vue';
 export default {
   name: 'index',
   props: {},
-  components: {},
-  data: () => ({}),
+  components: {
+    topInfo, //头部标题
+    answerData, //商铺类别管理
+  },
+  data: () => ({
+    topTitle: '技术问答回答审核',
+    answerData: [
+      {
+        themeId: '1',
+        bianma: 'asdf',
+        answerID: '1',
+        answer: '答案',
+        date: '2019-01-14',
+        state: '待审核',
+      },
+    ],
+  }),
   created() {},
   computed: {},
-  methods: {},
+  methods: {
+    addData() {
+      this.$router.push({ path: './detail' });
+    },
+  },
 };
 </script>
 
-<style lang="less" scoped></style>
+<style lang="less" scoped>
+.top {
+  height: 40px;
+  background-color: #f5f5f5;
+}
+.main {
+  width: 97%;
+  margin: 0 15px;
+}
+</style>

+ 45 - 0
src/views/technology/label/detail.vue

@@ -0,0 +1,45 @@
+<template>
+  <div id="detail">
+    <el-row>
+      <el-col :span="24" class="info">
+        <el-col :span="24" class="top">
+          <topInfo :topTitle="topTitle"></topInfo>
+        </el-col>
+        <el-col :span="24" class="main">
+          <labelForm :form="form"></labelForm>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import topInfo from '@/layout/public/top.vue';
+import labelForm from '@/layout/technology/labelForm.vue';
+export default {
+  name: 'detail',
+  props: {},
+  components: {
+    topInfo, //头部标题
+    labelForm, //新闻信息form
+  },
+  data: () => ({
+    topTitle: '标签编辑',
+    form: {},
+  }),
+  created() {},
+  computed: {},
+  methods: {},
+};
+</script>
+
+<style lang="less" scoped>
+.top {
+  height: 40px;
+  background-color: #f5f5f5;
+}
+.main {
+  width: 97%;
+  margin: 0 15px;
+}
+</style>

+ 49 - 4
src/views/technology/label/index.vue

@@ -1,19 +1,64 @@
 <template>
   <div id="index">
-    <p>index</p>
+    <el-row>
+      <el-col :span="24" class="info">
+        <el-col :span="24" class="top">
+          <topInfo :topTitle="topTitle"></topInfo>
+        </el-col>
+        <el-col :span="24" class="search">
+          <searchInfo></searchInfo>
+        </el-col>
+        <el-col :span="24" class="main">
+          <labelData :tableData="tableData"></labelData>
+        </el-col>
+      </el-col>
+    </el-row>
   </div>
 </template>
 
 <script>
+import topInfo from '@/layout/public/top.vue';
+import searchInfo from '@/layout/technology/searchInfo.vue';
+import labelData from '@/layout/technology/labelData.vue';
 export default {
   name: 'index',
   props: {},
-  components: {},
-  data: () => ({}),
+  components: {
+    topInfo, //头部标题
+    searchInfo, //搜索
+    labelData, //新闻信息列表
+  },
+  data: () => ({
+    topTitle: '标签管理',
+    tableData: [
+      {
+        title: '标题',
+        bianma: 'asdf',
+      },
+      {
+        title: '标题',
+        bianma: 'asdf',
+      },
+    ],
+  }),
   created() {},
   computed: {},
   methods: {},
 };
 </script>
 
-<style lang="less" scoped></style>
+<style lang="less" scoped>
+.top {
+  height: 40px;
+  background-color: #f5f5f5;
+}
+.search {
+  height: 40px;
+  line-height: 40px;
+  padding: 0 15px;
+}
+.main {
+  width: 97%;
+  margin: 0 15px;
+}
+</style>