lrf402788946 il y a 5 ans
Parent
commit
09e72dd7d3
2 fichiers modifiés avec 1 ajouts et 95 suppressions
  1. 1 8
      src/router/index.js
  2. 0 87
      src/views/duty/detail.vue

+ 1 - 8
src/router/index.js

@@ -172,17 +172,10 @@ const routes = [
         meta: { title: '部门', sub: '详情' },
         component: () => import('@/views/dept/detail.vue'),
       },
-      {
-        path: '/duty/detail',
-        name: 'duty_detail',
-        meta: { title: '职责', sub: '说明详情' },
-        component: () => import('@/views/duty/detail.vue'),
-      },
-
       {
         path: '/duty/index',
         name: 'duty_index',
-        meta: { title: '职责', sub: '说明管理' },
+        meta: { title: '职责', sub: '说明' },
         component: () => import('@/views/duty/index.vue'),
       },
       {

+ 0 - 87
src/views/duty/detail.vue

@@ -1,87 +0,0 @@
-<template>
-  <div id="detail">
-    <detail-frame :title="mainTitle" returns="/dept/index">
-      <data-form :data="info" :fields="fields" :rules="rules" @save="handleSave" :isNew="isNew"> </data-form>
-    </detail-frame>
-  </div>
-</template>
-
-<script>
-import detailFrame from '@frame/layout/admin/detail-frame';
-import dataForm from '@frame/components/form';
-import { mapActions, mapState, createNamespacedHelpers } from 'vuex';
-const { mapActions: mapClass } = createNamespacedHelpers('duty');
-
-export default {
-  metaInfo: { title: '职责详情' },
-  name: 'detail',
-  props: {},
-  components: {
-    detailFrame,
-    dataForm,
-  },
-  data: () => ({
-    info: {},
-    fields: [
-      { label: '班长职责', required: true, model: 'bzduty', type: 'editor' },
-      { label: '学委职责', required: true, model: 'xwduty', type: 'editor' },
-    ],
-    rules: {
-      bzduty: [{ required: true, message: '请输入班长职责' }],
-      xwduty: [{ required: true, message: '请输入学委职责' }],
-    },
-  }),
-  created() {},
-  computed: {
-    id() {
-      return this.$route.query.id;
-    },
-    isNew() {
-      return this.$route.query.id ? false : true;
-    },
-    mainTitle() {
-      let meta = this.$route.meta;
-      let main = meta.title || '';
-      let sub = meta.sub || '';
-      return `${main}${sub}`;
-    },
-    keyWord() {
-      let meta = this.$route.meta;
-      let main = meta.title || '';
-      return main;
-    },
-  },
-  watch: {
-    isNew: {
-      immediate: true,
-      handler(val) {
-        if (val) this.loading = false;
-        else this.search();
-      },
-    },
-  },
-  methods: {
-    ...mapClass(['fetch', 'create', 'update']),
-    async search() {
-      const res = await this.fetch(this.id);
-      console.log(res);
-      if (this.$checkRes(res)) this.$set(this, `info`, res.data);
-      this.loading = false;
-    },
-    async handleSave({ isNew, data }) {
-      let res;
-      let msg;
-      if (isNew) {
-        res = await this.create(data);
-        msg = `${this.keyWord}添加成功`;
-      } else {
-        res = await this.update(data);
-        msg = `${this.keyWord}修改成功`;
-      }
-      if (this.$checkRes(res, msg)) this.$router.push({ path: '/duty/index' });
-    },
-  },
-};
-</script>
-
-<style lang="less" scoped></style>