guhongwei 2 anos atrás
pai
commit
8b8f74cb64

+ 1 - 2
.env

@@ -1,4 +1,3 @@
 VUE_APP_AXIOS_BASE_URL = ''
 VUE_APP_ROUTER="padmin"
-VUE_APP_HOST="http://47.93.34.200"
-# http://broadcast.waityou24.cn
+VUE_APP_HOST="http://broadcast.waityou24.cn"

+ 20 - 0
src/router/module/app.js

@@ -4,4 +4,24 @@ export default [
     meta: { title: '基本信息', is_filter: false },
     component: () => import('@/views/app/basic/index.vue'),
   },
+  {
+    path: '/app/banner',
+    meta: { title: 'app轮播图', is_filter: false },
+    component: () => import('@/views/app/banner/index.vue'),
+  },
+  {
+    path: '/app/banner/add',
+    meta: { title: '信息管理', is_filter: false },
+    component: () => import('@/views/app/banner/add.vue'),
+  },
+  {
+    path: '/app/hotlink',
+    meta: { title: '热门链接', is_filter: false },
+    component: () => import('@/views/app/hotlink/index.vue'),
+  },
+  {
+    path: '/app/hotlink/add',
+    meta: { title: '信息管理', is_filter: false },
+    component: () => import('@/views/app/hotlink/add.vue'),
+  },
 ];

+ 4 - 0
src/store/index.js

@@ -18,6 +18,8 @@ import cases from '@common/src/store/web/cases';
 import leavemess from '@common/src/store/web/leavemess';
 // app
 import appbasic from '@common/src/store/app/appbasic';
+import appbanner from '@common/src/store/app/appbanner';
+import hotlink from '@common/src/store/app/hotlink';
 
 Vue.use(Vuex);
 
@@ -39,5 +41,7 @@ export default new Vuex.Store({
     leavemess,
     // app
     appbasic,
+    appbanner,
+    hotlink,
   },
 });

+ 112 - 0
src/views/app/banner/add.vue

@@ -0,0 +1,112 @@
+<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 #place>
+              <el-option v-for="i in placeList" :key="i._id" :label="i.label" :value="i.value"></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>
+            <template #img_url="{ item }">
+              <c-upload v-model="form[item.model]" url="/files/projectadmin/imgurl/upload" accept="" listType="text" :limit="1"></c-upload>
+            </template>
+          </data-form>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions } = createNamespacedHelpers('appbanner');
+const { mapActions: dictdata } = createNamespacedHelpers('dictdata');
+export default {
+  name: 'add',
+  props: {},
+  components: {},
+  data: function () {
+    return {
+      fields: [
+        { label: '名称', model: 'title' },
+        { label: '来源', model: 'origin' },
+        { label: '发布时间', model: 'create_time', type: 'date' },
+        { label: '图片', model: 'img_url', custom: true },
+        { label: '平台网址', model: 'web_url' },
+        { label: '展示位置', model: 'place', type: 'select' },
+        { label: '是否启用', model: 'is_use', type: 'select' },
+      ],
+      form: {},
+      // 是否启用
+      isuseList: [],
+      // 展示位置
+      placeList: [],
+    };
+  },
+  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);
+      }
+      // 展示位置
+      res = await this.dQuery({ type: 'app_message_place' });
+      if (this.$checkRes(res)) {
+        this.$set(this, `placeList`, 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>

+ 136 - 0
src/views/app/banner/index.vue

@@ -0,0 +1,136 @@
+<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 #place>
+              <el-option v-for="i in placeList" :key="i._id" :label="i.label" :value="i.value"></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('appbanner');
+const { mapActions: dictdata } = createNamespacedHelpers('dictdata');
+export default {
+  name: 'index',
+  props: {},
+  components: {},
+  data: function () {
+    return {
+      // 查询
+      searchInfo: {},
+      fields: [
+        { label: '序号', options: { type: 'index' } },
+        { label: '名称', model: 'title', isSearch: true },
+        { label: '来源', model: 'origin', isSearch: true },
+        { label: '发布时间', model: 'create_time' },
+        { label: '平台网址', model: 'web_url' },
+        {
+          label: '展示位置',
+          model: 'place',
+          type: 'select',
+          format: (i) => {
+            let data = this.placeList.find((r) => r.value == i);
+            if (data) return data.label;
+            else return '暂无';
+          },
+          isSearch: true,
+        },
+        {
+          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: [],
+      // 展示位置
+      placeList: [],
+    };
+  },
+  async created() {
+    await this.searchOther();
+    await this.search();
+  },
+  methods: {
+    ...mapActions(['query', 'delete']),
+    ...dictdata({ dQuery: 'query' }),
+    async search({ skip = 0, limit = 10, ...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: '/app/banner/add' });
+    },
+    // 修改
+    toEdit({ data }) {
+      this.$router.push({ path: '/app/banner/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.dQuery({ type: 'is_use' });
+      if (this.$checkRes(res)) {
+        this.$set(this, `isuseList`, res.data);
+      }
+      // 展示位置
+      res = await this.dQuery({ type: 'app_message_place' });
+      if (this.$checkRes(res)) {
+        this.$set(this, `placeList`, 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>

+ 0 - 1
src/views/app/basic/index.vue

@@ -311,7 +311,6 @@ export default {
       // 跳转类型
       res = await this.dQuery({ type: 'jump_type' });
       if (this.$checkRes(res)) {
-        console.log(res.data);
         this.$set(this, `jumptypeLsit`, res.data);
       }
       // 是否

+ 112 - 0
src/views/app/hotlink/add.vue

@@ -0,0 +1,112 @@
+<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 #place>
+              <el-option v-for="i in placeList" :key="i._id" :label="i.label" :value="i.value"></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>
+            <template #img_url="{ item }">
+              <c-upload v-model="form[item.model]" url="/files/projectadmin/imgurl/upload" accept="" listType="text" :limit="1"></c-upload>
+            </template>
+          </data-form>
+        </el-col>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import { mapState, createNamespacedHelpers } from 'vuex';
+const { mapActions } = createNamespacedHelpers('hotlink');
+const { mapActions: dictdata } = createNamespacedHelpers('dictdata');
+export default {
+  name: 'add',
+  props: {},
+  components: {},
+  data: function () {
+    return {
+      fields: [
+        { label: '名称', model: 'title' },
+        { label: '来源', model: 'origin' },
+        { label: '发布时间', model: 'create_time', type: 'date' },
+        { label: '图片', model: 'img_url', custom: true },
+        { label: '平台网址', model: 'web_url' },
+        { label: '展示位置', model: 'place', type: 'select' },
+        { label: '是否启用', model: 'is_use', type: 'select' },
+      ],
+      form: {},
+      // 是否启用
+      isuseList: [],
+      // 展示位置
+      placeList: [],
+    };
+  },
+  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);
+      }
+      // 展示位置
+      res = await this.dQuery({ type: 'app_message_place' });
+      if (this.$checkRes(res)) {
+        this.$set(this, `placeList`, 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>

+ 136 - 0
src/views/app/hotlink/index.vue

@@ -0,0 +1,136 @@
+<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 #place>
+              <el-option v-for="i in placeList" :key="i._id" :label="i.label" :value="i.value"></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('hotlink');
+const { mapActions: dictdata } = createNamespacedHelpers('dictdata');
+export default {
+  name: 'index',
+  props: {},
+  components: {},
+  data: function () {
+    return {
+      // 查询
+      searchInfo: {},
+      fields: [
+        { label: '序号', options: { type: 'index' } },
+        { label: '名称', model: 'title', isSearch: true },
+        { label: '来源', model: 'origin', isSearch: true },
+        { label: '发布时间', model: 'create_time' },
+        { label: '平台网址', model: 'web_url' },
+        {
+          label: '展示位置',
+          model: 'place',
+          type: 'select',
+          format: (i) => {
+            let data = this.placeList.find((r) => r.value == i);
+            if (data) return data.label;
+            else return '暂无';
+          },
+          isSearch: true,
+        },
+        {
+          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: [],
+      // 展示位置
+      placeList: [],
+    };
+  },
+  async created() {
+    await this.searchOther();
+    await this.search();
+  },
+  methods: {
+    ...mapActions(['query', 'delete']),
+    ...dictdata({ dQuery: 'query' }),
+    async search({ skip = 0, limit = 10, ...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: '/app/hotlink/add' });
+    },
+    // 修改
+    toEdit({ data }) {
+      this.$router.push({ path: '/app/hotlink/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.dQuery({ type: 'is_use' });
+      if (this.$checkRes(res)) {
+        this.$set(this, `isuseList`, res.data);
+      }
+      // 展示位置
+      res = await this.dQuery({ type: 'app_message_place' });
+      if (this.$checkRes(res)) {
+        this.$set(this, `placeList`, 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>

+ 1 - 1
src/views/system/dict/add.vue

@@ -31,7 +31,7 @@ export default {
       fields: [
         { label: '字典名称', model: 'name' },
         { label: '字典类型', model: 'type' },
-        { label: '排序', model: 'sort', type: 'number' },
+        // { label: '排序', model: 'sort', type: 'number' },
         { label: '是否启用', model: 'is_use', type: 'select' },
       ],
       form: {},

+ 1 - 2
src/views/system/dict/index.vue

@@ -36,7 +36,6 @@ export default {
         { label: '序号', options: { type: 'index' } },
         { label: '字典名称', model: 'name', isSearch: true },
         { label: '字典类型', model: 'type', custom: true },
-        { label: '排序', model: 'sort' },
         {
           label: '是否启用',
           model: 'is_use',
@@ -64,7 +63,7 @@ export default {
   methods: {
     ...mapActions(['query', 'delete']),
     ...dictdata({ dQuery: 'query' }),
-    async search({ skip = 0, limit = this.limit, ...info } = {}) {
+    async search({ skip = 0, limit = 10, ...info } = {}) {
       let res = await this.query({ skip, limit, ...info, ...this.searchInfo });
       if (this.$checkRes(res)) {
         this.$set(this, `list`, res.data);

+ 1 - 1
src/views/system/dictdata/index.vue

@@ -67,7 +67,7 @@ export default {
   methods: {
     ...mapActions(['query', 'delete']),
     ...dicttype({ dQuery: 'query' }),
-    async search({ skip = 0, limit = this.limit, ...info } = {}) {
+    async search({ skip = 0, limit = 10, ...info } = {}) {
       let res = await this.query({ skip, limit, ...info, ...this.searchInfo });
       if (this.$checkRes(res)) {
         this.$set(this, `list`, res.data);

+ 1 - 1
src/views/web/banner/index.vue

@@ -78,7 +78,7 @@ export default {
   methods: {
     ...mapActions(['query', 'delete']),
     ...dictdata({ dQuery: 'query' }),
-    async search({ skip = 0, limit = this.limit, ...info } = {}) {
+    async search({ skip = 0, limit = 10, ...info } = {}) {
       let res = await this.query({ skip, limit, ...info, ...this.searchInfo });
       if (this.$checkRes(res)) {
         this.$set(this, `list`, res.data);

+ 1 - 1
src/views/web/cases/index.vue

@@ -61,7 +61,7 @@ export default {
   methods: {
     ...mapActions(['query', 'delete']),
     ...dictdata({ dQuery: 'query' }),
-    async search({ skip = 0, limit = this.limit, ...info } = {}) {
+    async search({ skip = 0, limit = 10, ...info } = {}) {
       let res = await this.query({ skip, limit, ...info, ...this.searchInfo });
       if (this.$checkRes(res)) {
         this.$set(this, `list`, res.data);

+ 1 - 1
src/views/web/leavemess/index.vue

@@ -58,7 +58,7 @@ export default {
     ...mapActions(['query', 'update']),
     ...dictdata({ dQuery: 'query' }),
 
-    async search({ skip = 0, limit = this.limit, ...info } = {}) {
+    async search({ skip = 0, limit = 10, ...info } = {}) {
       let res = await this.query({ skip, limit, ...info, ...this.searchInfo });
       if (this.$checkRes(res)) {
         this.$set(this, `list`, res.data);

+ 1 - 1
src/views/web/news/index.vue

@@ -94,7 +94,7 @@ export default {
   methods: {
     ...mapActions(['query', 'delete']),
     ...dictdata({ dQuery: 'query' }),
-    async search({ skip = 0, limit = this.limit, ...info } = {}) {
+    async search({ skip = 0, limit = 10, ...info } = {}) {
       let res = await this.query({ skip, limit, ...info, ...this.searchInfo });
       if (this.$checkRes(res)) {
         this.$set(this, `list`, res.data);

+ 1 - 1
vue.config.js

@@ -20,7 +20,7 @@ module.exports = {
     port: '8001',
     proxy: {
       '/files': {
-        target: 'http://47.93.34.200',
+        target: 'http://broadcast.waityou24.cn',
       },
       '/projectadmin/api': {
         target: 'http://127.0.0.1:10102', //http://127.0.0.1:10102  http://www.freeskyghw.cn  http://47.93.34.200