guhongwei há 2 anos atrás
pai
commit
620a411357

+ 31 - 5
src/router/index.js

@@ -3,16 +3,42 @@ import VueRouter from 'vue-router';
 import store from '@/store/index';
 // 公共
 import common from './module/common';
+// 网站部分
+import webs from './module/web';
+// 网站部分
+import system from './module/system';
 const jwt = require('jsonwebtoken');
 Vue.use(VueRouter);
 const web = [
-  // {
-  //   path: '/',
-  //   meta: { title: '网站首页' },
-  //   component: () => import('../views/homeIndex.vue'),
-  // },
   // 公共
   ...common,
+  // 中台
+  {
+    path: '/homeIndex',
+    meta: { title: '自由天空', is_filter: true },
+    component: () => import('@common/src/components/admin-frame/home.vue'),
+    children: [
+      {
+        path: '/homeIndex',
+        meta: { title: '自由天空', is_filter: true },
+        component: () => import('@/views/home/index.vue'),
+      },
+      // {
+      //   path: '/tvadmin',
+      //   meta: { title: '电视节目管理', is_filter: true },
+      //   component: () => import('@/views/tvadmin/index.vue'),
+      // },
+      // {
+      //   path: '/tvadmin/add',
+      //   meta: { title: '信息管理', is_filter: true },
+      //   component: () => import('@/views/tvadmin/add.vue'),
+      // },
+      // 网站管理部分
+      ...webs,
+      // 系统管理部分
+      ...system,
+    ],
+  },
 ];
 const routes = [...web];
 const router = new VueRouter({ mode: 'history', base: process.env.BASE_URL, routes });

+ 0 - 22
src/router/module/common.js

@@ -13,26 +13,4 @@ export default [
     meta: { title: '账号登录', is_filter: false },
     component: () => import('@/views/login.vue'),
   },
-  {
-    path: '/homeIndex',
-    meta: { title: '中台', is_filter: true },
-    component: () => import('@common/src/components/admin-frame/home.vue'),
-    children: [
-      {
-        path: '/homeIndex',
-        meta: { title: '中台', is_filter: true },
-        component: () => import('@/views/home/index.vue'),
-      },
-      {
-        path: '/tvadmin',
-        meta: { title: '电视节目管理', is_filter: true },
-        component: () => import('@/views/tvadmin/index.vue'),
-      },
-      {
-        path: '/tvadmin/add',
-        meta: { title: '信息管理', is_filter: true },
-        component: () => import('@/views/tvadmin/add.vue'),
-      },
-    ],
-  },
 ];

+ 22 - 0
src/router/module/system.js

@@ -0,0 +1,22 @@
+export default [
+  {
+    path: '/system/dict',
+    meta: { title: '字典类型管理', is_filter: false },
+    component: () => import('@/views/system/dict/index.vue'),
+  },
+  {
+    path: '/system/dict/add',
+    meta: { title: '信息管理', is_filter: false },
+    component: () => import('@/views/system/dict/add.vue'),
+  },
+  {
+    path: '/system/dictdata',
+    meta: { title: '字典数据管理', is_filter: false },
+    component: () => import('@/views/system/dictdata/index.vue'),
+  },
+  {
+    path: '/system/dictdata/add',
+    meta: { title: '信息管理', is_filter: false },
+    component: () => import('@/views/system/dictdata/add.vue'),
+  },
+];

+ 27 - 0
src/router/module/web.js

@@ -0,0 +1,27 @@
+export default [
+  {
+    path: '/web/company',
+    meta: { title: '公司信息', is_filter: false },
+    component: () => import('@/views/web/company/index.vue'),
+  },
+  {
+    path: '/web/banner',
+    meta: { title: '轮播图', is_filter: false },
+    component: () => import('@/views/web/banner/index.vue'),
+  },
+  {
+    path: '/web/news',
+    meta: { title: '新闻资讯', is_filter: false },
+    component: () => import('@/views/web/news/index.vue'),
+  },
+  {
+    path: '/web/cases',
+    meta: { title: '案例管理', is_filter: false },
+    component: () => import('@/views/web/cases/index.vue'),
+  },
+  {
+    path: '/web/leavemess',
+    meta: { title: '留言管理', is_filter: false },
+    component: () => import('@/views/web/leavemess/index.vue'),
+  },
+];

+ 22 - 1
src/store/index.js

@@ -6,6 +6,17 @@ import * as umutations from '@common/src/store/user/mutations';
 import admin from '@common/src/store/admin';
 import program from '@common/src/store/program';
 
+// 系统设置
+import dicttype from '@common/src/store/system/dicttype';
+import dictdata from '@common/src/store/system/dictdata';
+
+// 网站
+import company from '@common/src/store/web/company';
+import banner from '@common/src/store/web/banner';
+import news from '@common/src/store/web/news';
+import cases from '@common/src/store/web/cases';
+import leavemess from '@common/src/store/web/leavemess';
+
 Vue.use(Vuex);
 
 export default new Vuex.Store({
@@ -13,5 +24,15 @@ export default new Vuex.Store({
   getters: {},
   mutations: { ...umutations },
   actions: {},
-  modules: { admin, program },
+  modules: {
+    admin,
+    program,
+    dicttype,
+    dictdata,
+    company,
+    banner,
+    news,
+    cases,
+    leavemess,
+  },
 });

+ 2 - 1
src/views/login.vue

@@ -39,7 +39,8 @@ export default {
       }
     },
     toRegister() {
-      this.$router.push({ path: '/register' });
+      this.$message({ message: '暂未开放', type: 'error' });
+      // this.$router.push({ path: '/register' });
     },
   },
   computed: {

+ 97 - 0
src/views/system/dict/add.vue

@@ -0,0 +1,97 @@
+<template>
+  <div id="add">
+    <el-row>
+      <el-col :span="24" class="main animate__animated animate__backInRight">
+        <el-col :span="24" class="one">
+          <c-search :is_title="true" :is_back="true" @toBack="toBack"></c-search>
+        </el-col>
+        <el-col :span="24" class="two">
+          <data-form :fields="fields" :form="form" :rules="{}" @save="toSave" :span="24">
+            <template #is_use>
+              <el-option v-for="i in isuseList" :key="i._id" :label="i.label" :value="i.value"></el-option>
+            </template>
+          </data-form>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions } = createNamespacedHelpers('dicttype');
+const { mapActions: dictdata } = createNamespacedHelpers('dictdata');
+
+export default {
+  name: 'add',
+  props: {},
+  components: {},
+  data: function () {
+    return {
+      fields: [
+        { label: '字典名称', model: 'name' },
+        { label: '字典类型', model: 'type' },
+        { label: '排序', model: 'sort', type: 'number' },
+        { label: '是否启用', model: 'is_use', type: 'select' },
+      ],
+      form: {},
+      // 是否启用
+      isuseList: [],
+    };
+  },
+  async created() {
+    await this.searchOther();
+    await this.search();
+  },
+  methods: {
+    ...mapActions(['fetch', 'create', 'update']),
+    ...dictdata({ dQuery: 'query' }),
+    async search() {
+      if (this.id) {
+        let res = await this.fetch(this.id);
+        if (this.$checkRes(res)) {
+          this.$set(this, `form`, res.data);
+        }
+      }
+    },
+    // 保存信息
+    async toSave({ data }) {
+      let res;
+      if (data.id) res = await this.update(data);
+      else res = await this.create(data);
+      if (this.$checkRes(res, `维护信息成功`, res.errmsg)) this.toBack();
+    },
+    // 字典
+    async searchOther() {
+      let res;
+      // 是否启用
+      res = await this.dQuery({ type: 'is_use' });
+      if (this.$checkRes(res)) {
+        this.$set(this, `isuseList`, res.data);
+      }
+    },
+    // 返回
+    toBack() {
+      window.history.go('-1');
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    id() {
+      return this.$route.query.id;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 120 - 0
src/views/system/dict/index.vue

@@ -0,0 +1,120 @@
+<template>
+  <div id="index">
+    <el-row>
+      <el-col :span="24" class="main animate__animated animate__backInRight">
+        <el-col :span="24" class="one">
+          <c-search :is_search="true" :fields="fields" @search="btSearch"></c-search>
+        </el-col>
+        <el-col :span="24" class="two">
+          <c-button @toAdd="toAdd"></c-button>
+        </el-col>
+        <el-col :span="24" class="thr">
+          <data-table :fields="fields" :opera="opera" @query="search" :data="list" :total="total" @edit="toEdit" @del="toDel">
+            <template #type="{ row, item }">
+              <el-link :underline="false" @click="toType(row[item.model])">{{ row[item.model] }}</el-link>
+            </template>
+          </data-table>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions } = createNamespacedHelpers('dicttype');
+const { mapActions: dictdata } = createNamespacedHelpers('dictdata');
+export default {
+  name: 'index',
+  props: {},
+  components: {},
+  data: function () {
+    return {
+      // 查询
+      searchInfo: {},
+      fields: [
+        { label: '序号', options: { type: 'index' } },
+        { label: '字典名称', model: 'name', isSearch: true },
+        { label: '字典类型', model: 'type', custom: true },
+        { label: '排序', model: 'sort' },
+        {
+          label: '是否启用',
+          model: 'is_use',
+          format: (i) => {
+            let data = this.isuseList.find((r) => r.value == i);
+            if (data) return data.label;
+            else return '暂无';
+          },
+        },
+      ],
+      opera: [
+        { label: '修改', method: 'edit' },
+        { label: '删除', method: 'del', confirm: true, type: 'danger' },
+      ],
+      list: [],
+      total: 0,
+      // 是否启用
+      isuseList: [],
+    };
+  },
+  async created() {
+    await this.searchOther();
+    await this.search();
+  },
+  methods: {
+    ...mapActions(['query', 'delete']),
+    ...dictdata({ dQuery: 'query' }),
+    async search({ skip = 0, limit = this.limit, ...info } = {}) {
+      let res = await this.query({ skip, limit, ...info, ...this.searchInfo });
+      if (this.$checkRes(res)) {
+        this.$set(this, `list`, res.data);
+        this.$set(this, `total`, res.total);
+      }
+    },
+    btSearch(query) {
+      this.$set(this, `searchInfo`, query);
+      this.search();
+    },
+    // 新增
+    toAdd() {
+      this.$router.push({ path: '/system/dict/add' });
+    },
+    // 修改
+    toEdit({ data }) {
+      this.$router.push({ path: '/system/dict/add', query: { id: data._id } });
+    },
+    async toDel({ data }) {
+      let res = await this.delete(data._id);
+      if (this.$checkRes(res, '删除信息成功', res.errmsg)) this.search();
+    },
+    // 字典数据
+    toType(e) {
+      this.$router.push({ path: '/system/dictdata', query: { type: e } });
+    },
+    // 字典表
+    async searchOther() {
+      let res;
+      // 是否启用
+      res = await this.dQuery({ type: 'is_use' });
+      if (this.$checkRes(res)) {
+        this.$set(this, `isuseList`, res.data);
+      }
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 114 - 0
src/views/system/dictdata/add.vue

@@ -0,0 +1,114 @@
+<template>
+  <div id="add">
+    <el-row>
+      <el-col :span="24" class="main animate__animated animate__backInRight">
+        <el-col :span="24" class="one">
+          <c-search :is_title="true" :is_back="true" @toBack="toBack"></c-search>
+        </el-col>
+        <el-col :span="24" class="two">
+          <data-form :fields="fields" :form="form" :rules="{}" @save="toSave" :span="24">
+            <template #type>
+              <el-option v-for="i in typeList" :key="i._id" :label="i.name" :value="i.type"></el-option>
+            </template>
+            <template #is_use>
+              <el-option v-for="i in isuseList" :key="i._id" :label="i.label" :value="i.value"></el-option>
+            </template>
+          </data-form>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions } = createNamespacedHelpers('dictdata');
+const { mapActions: dicttype } = createNamespacedHelpers('dicttype');
+export default {
+  name: 'add',
+  props: {},
+  components: {},
+  data: function () {
+    return {
+      fields: [
+        { label: '字典类型', model: 'type', type: 'select' },
+        { label: '字典内容', model: 'label' },
+        { label: '字典键值', model: 'value' },
+        { label: '排序', model: 'sort', type: 'number' },
+        { label: '是否启用', model: 'is_use', type: 'select' },
+      ],
+      form: {},
+      // 字典类型
+      typeList: [],
+      // 是否启用
+      isuseList: [],
+    };
+  },
+  async created() {
+    await this.searchOther();
+    await this.search();
+  },
+  methods: {
+    ...mapActions(['query', 'fetch', 'create', 'update']),
+    ...dicttype({ dQuery: 'query' }),
+    async search() {
+      let form = {};
+      if (this.id) {
+        let res = await this.fetch(this.id);
+        if (this.$checkRes(res)) {
+          form = res.data;
+        }
+      } else {
+        if (this.type) form.type = this.type;
+      }
+      this.$set(this, `form`, form);
+    },
+    // 保存信息
+    async toSave({ data }) {
+      let res;
+      if (data.id) res = await this.update(data);
+      else res = await this.create(data);
+      if (this.$checkRes(res, `维护信息成功`, res.errmsg)) this.toBack();
+    },
+    // 字典表
+    async searchOther() {
+      let res;
+      // 字典类型
+      res = await this.dQuery({ is_use: '0' });
+      if (this.$checkRes(res)) {
+        this.$set(this, `typeList`, res.data);
+      }
+      // 是否启用
+      res = await this.query({ type: 'is_use' });
+      if (this.$checkRes(res)) {
+        this.$set(this, `isuseList`, res.data);
+      }
+    },
+    // 返回
+    toBack() {
+      window.history.go('-1');
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    id() {
+      return this.$route.query.id;
+    },
+    type() {
+      return this.$route.query.type;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 131 - 0
src/views/system/dictdata/index.vue

@@ -0,0 +1,131 @@
+<template>
+  <div id="index">
+    <el-row>
+      <el-col :span="24" class="main animate__animated animate__backInRight">
+        <el-col :span="24" class="one">
+          <c-search :is_search="true" :fields="fields" @search="btSearch">
+            <template #type>
+              <el-option v-for="i in typeList" :key="i._id" :label="i.name" :value="i.type"></el-option>
+            </template>
+          </c-search>
+        </el-col>
+        <el-col :span="24" class="two">
+          <c-button @toAdd="toAdd"></c-button>
+        </el-col>
+        <el-col :span="24" class="thr">
+          <data-table :fields="fields" :opera="opera" @query="search" :data="list" :total="total" @edit="toEdit" @del="toDel"> </data-table>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions } = createNamespacedHelpers('dictdata');
+const { mapActions: dicttype } = createNamespacedHelpers('dicttype');
+export default {
+  name: 'index',
+  props: {},
+  components: {},
+  data: function () {
+    return {
+      // 查询
+      searchInfo: {},
+      fields: [
+        { label: '序号', options: { type: 'index' } },
+        { label: '字典类型', model: 'type', type: 'select', isSearch: true },
+        { label: '字典内容', model: 'label', isSearch: true },
+        { label: '字典键值', model: 'value', isSearch: true },
+        { label: '排序', model: 'sort' },
+        {
+          label: '是否启用',
+          model: 'is_use',
+          format: (i) => {
+            let data = this.isuseList.find((r) => r.value == i);
+            if (data) return data.label;
+            else return '暂无';
+          },
+        },
+      ],
+      opera: [
+        { label: '修改', method: 'edit' },
+        { label: '删除', method: 'del', confirm: true, type: 'danger' },
+      ],
+      list: [],
+      total: 0,
+      // 字典类型
+      typeList: [],
+      // 是否启用
+      isuseList: [],
+    };
+  },
+  async created() {
+    await this.searchOther();
+    await this.search();
+  },
+  methods: {
+    ...mapActions(['query', 'delete']),
+    ...dicttype({ dQuery: 'query' }),
+    async search({ skip = 0, limit = this.limit, ...info } = {}) {
+      let res = await this.query({ skip, limit, ...info, ...this.searchInfo });
+      if (this.$checkRes(res)) {
+        this.$set(this, `list`, res.data);
+        this.$set(this, `total`, res.total);
+      }
+    },
+    btSearch(query) {
+      this.$set(this, `searchInfo`, query);
+      this.search();
+    },
+    // 新增
+    toAdd() {
+      this.$router.push({ path: '/system/dictdata/add', query: { type: this.type } });
+    },
+    // 修改
+    toEdit({ data }) {
+      this.$router.push({ path: '/system/dictdata/add', query: { id: data._id } });
+    },
+    async toDel({ data }) {
+      let res = await this.delete(data._id);
+      if (this.$checkRes(res, '删除信息成功', res.errmsg)) this.search();
+    },
+    // 字典表
+    async searchOther() {
+      let res;
+      // 是否启用
+      res = await this.query({ type: 'is_use' });
+      if (this.$checkRes(res)) {
+        this.$set(this, `isuseList`, res.data);
+      }
+      // 字典类型
+      res = await this.dQuery({ is_use: '0' });
+      if (this.$checkRes(res)) {
+        this.$set(this, `typeList`, res.data);
+      }
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+    type() {
+      return this.$route.query.type;
+    },
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    '$route.query': {
+      deep: true,
+      immediate: true,
+      handler(val) {
+        if (val.type) {
+          this.$set(this.searchInfo, `type`, val.type);
+        }
+      },
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 36 - 0
src/views/web/banner/index.vue

@@ -0,0 +1,36 @@
+<template>
+  <div id="index">
+    <el-row>
+      <el-col :span="24" class="main animate__animated animate__backInRight"> test </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'index',
+  props: {},
+  components: {},
+  data: function () {
+    return {};
+  },
+  created() {},
+  methods: {},
+  computed: {
+    ...mapState(['user']),
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 36 - 0
src/views/web/cases/index.vue

@@ -0,0 +1,36 @@
+<template>
+  <div id="index">
+    <el-row>
+      <el-col :span="24" class="main animate__animated animate__backInRight"> test </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'index',
+  props: {},
+  components: {},
+  data: function () {
+    return {};
+  },
+  created() {},
+  methods: {},
+  computed: {
+    ...mapState(['user']),
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 170 - 0
src/views/web/company/index.vue

@@ -0,0 +1,170 @@
+<template>
+  <div id="index">
+    <el-row>
+      <el-col :span="24" class="main animate__animated animate__backInRight">
+        <el-col :span="24" class="one">
+          <c-search></c-search>
+        </el-col>
+        <el-col :span="24" class="two">
+          <data-form :fields="fields" :form="form" :rules="{}" @save="toSave" :span="24">
+            <template #logo_url="{ item }">
+              <c-upload v-model="form[item.model]" url="/files/projectadmin/imgurl/upload" accept="" listType="text" :limit="1"></c-upload>
+            </template>
+            <template #advantage="{ item }">
+              <el-button type="primary" size="small" @click="toAdd('1')">添加</el-button>
+              <data-table :fields="adfields" :opera="adopera" :data="form[item.model]" @del="diaDel" :usePage="false">
+                <template #img_url="{ row, item }">
+                  <el-image class="image" @click="imgView(row[item.model][0])" :src="row[item.model][0].uri"></el-image>
+                </template>
+              </data-table>
+            </template>
+            <template #programme="{ item }">
+              <el-button type="primary" size="small" @click="toAdd('2')">添加</el-button>
+              <data-table :fields="adfields" :opera="adopera" :data="form[item.model]" @del="diaDel" :usePage="false">
+                <template #img_url="{ row, item }">
+                  <el-image class="image" @click="imgView(row[item.model][0])" :src="row[item.model][0].uri"></el-image>
+                </template>
+              </data-table>
+            </template>
+          </data-form>
+        </el-col>
+      </el-col>
+    </el-row>
+    <c-dialog :dialog="dialog" @toClose="toClose">
+      <template v-slot:info>
+        <el-col :span="24" class="dialog_one" v-if="dialog.type == '1'">
+          <data-form :fields="otherFields" :form="otherForm" :rules="{}" @save="dialogSave" :span="24">
+            <template #img_url="{ item }">
+              <c-upload v-model="otherForm[item.model]" url="/files/projectadmin/imgurl/upload" accept="" listType="text" :limit="1"></c-upload>
+            </template>
+          </data-form>
+        </el-col>
+      </template>
+    </c-dialog>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions } = createNamespacedHelpers('company');
+const moment = require('moment');
+export default {
+  name: 'index',
+  props: {},
+  components: {},
+  data: function () {
+    return {
+      form: { advantage: [], programme: [] },
+      fields: [
+        { label: '公司名称', model: 'name' },
+        { label: '联系地址', model: 'address' },
+        { label: '公司logo', model: 'logo_url', custom: true },
+        { label: '联系人', model: 'contact' },
+        { label: '联系电话', model: 'phone' },
+        { label: 'qq', model: 'qq' },
+        { label: '电子邮箱', model: 'email' },
+        { label: '座机', model: 'mobile' },
+        { label: '公司优势', model: 'advantage', custom: true },
+        { label: '解决方案', model: 'programme', custom: true },
+        { label: '品牌理念', model: 'idea', type: 'textarea' },
+        { label: '独特优势', model: 'unique', type: 'textarea' },
+        { label: '加入我们', model: 'join', type: 'textarea' },
+      ],
+      dialog: { title: '信息审核', show: false, type: '1' },
+      otherForm: {},
+      otherFields: [
+        { label: '名称', model: 'name' },
+        { label: '简介', model: 'brief', type: 'textarea' },
+        { label: '图片', model: 'img_url', custom: true },
+      ],
+      // 添加数据类型
+      type: '',
+      // 公司优势
+      adfields: [
+        { label: '名称', model: 'name' },
+        { label: '简介', model: 'brief' },
+        { label: '图片', model: 'img_url', custom: true },
+      ],
+      adopera: [{ label: '删除', method: 'del', confirm: true, type: 'danger' }],
+      // 解决方案
+    };
+  },
+  created() {
+    this.search();
+  },
+  methods: {
+    ...mapActions(['query', 'create', 'update']),
+    async search() {
+      let res = await this.query();
+      if (this.$checkRes(res)) {
+        let data = res.data;
+        if (!data.advantage) data.advantage = [];
+        if (!data.programme) data.programme = [];
+        this.$set(this, `form`, res.data);
+      }
+    },
+    // 保存信息
+    async toSave({ data }) {
+      let res;
+      if (data.id) res = await this.update(data);
+      else res = await this.create(data);
+      if (this.$checkRes(res, '维护信息成功', res.errmsg)) this.search();
+    },
+    // 添加公司优势,解决方案
+    toAdd(e) {
+      this.$set(this, `type`, e);
+      this.dialog = { title: e == '1' ? '公司优势' : '解决方案', show: true, type: '1' };
+    },
+    // 保存
+    dialogSave({ data }) {
+      if (!data.id) data.id = moment().valueOf();
+      data.type = this.type;
+      if (this.type == '1') {
+        this.form.advantage = [...this.form.advantage, data];
+      } else if (this.type == '2') {
+        this.form.programme = [...this.form.programme, data];
+      }
+      this.toClose();
+    },
+    // 删除
+    diaDel({ data }) {
+      if (data.type == '1') {
+        let advantage = this.form.advantage.filter((i) => i.id != data.id);
+        this.$set(this.form, `advantage`, advantage);
+      } else if (data.type == '2') {
+        let programme = this.form.programme.filter((i) => i.id != data.id);
+        this.$set(this.form, `programme`, programme);
+      }
+    },
+    // 预览图片
+    imgView(e) {
+      window.open(e.uri);
+    },
+    // 关闭弹框
+    toClose() {
+      this.otherForm = {};
+      this.dialog = { title: '公司优势', show: false, type: '1' };
+    },
+  },
+  computed: {
+    ...mapState(['user']),
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.image {
+  width: 50px;
+  height: 50px;
+}
+</style>

+ 36 - 0
src/views/web/leavemess/index.vue

@@ -0,0 +1,36 @@
+<template>
+  <div id="index">
+    <el-row>
+      <el-col :span="24" class="main animate__animated animate__backInRight"> test </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'index',
+  props: {},
+  components: {},
+  data: function () {
+    return {};
+  },
+  created() {},
+  methods: {},
+  computed: {
+    ...mapState(['user']),
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 36 - 0
src/views/web/news/index.vue

@@ -0,0 +1,36 @@
+<template>
+  <div id="index">
+    <el-row>
+      <el-col :span="24" class="main animate__animated animate__backInRight"> test </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+export default {
+  name: 'index',
+  props: {},
+  components: {},
+  data: function () {
+    return {};
+  },
+  created() {},
+  methods: {},
+  computed: {
+    ...mapState(['user']),
+  },
+  metaInfo() {
+    return { title: this.$route.meta.title };
+  },
+  watch: {
+    test: {
+      deep: true,
+      immediate: true,
+      handler(val) {},
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped></style>

+ 1 - 1
vue.config.js

@@ -23,7 +23,7 @@ module.exports = {
         target: 'http://47.93.34.200',
       },
       '/projectadmin/api': {
-        target: 'http://47.93.34.200', //http://127.0.0.1:10102  http://www.freeskyghw.cn  http://47.93.34.200
+        target: 'http://127.0.0.1:10102', //http://127.0.0.1:10102  http://www.freeskyghw.cn  http://47.93.34.200
         changeOrigin: true,
         ws: false,
       },