lrf402788946 4 роки тому
батько
коміт
b7625c7cda

+ 7 - 1
dict/index.js

@@ -9,4 +9,10 @@ export const status = [
   { label: '通过', value: '1' },
   { label: '通过', value: '1' },
   { label: '拒绝', value: '2' },
   { label: '拒绝', value: '2' },
 ];
 ];
-// export default ['政务动态', '通知通告', '科技新闻', '媒体聚焦', '信息公开'];
+export const onlineType = ['线上培训', '线上新品发布', '线上展会', '线上科技产品宣传', '线上科普教育'];
+
+export const progressType = [
+  { label: '准备中', value: '0' },
+  { label: '进行中', value: '1' },
+  { label: '已结束', value: '2' },
+];

+ 1 - 0
src/components/adminCommon/frame.vue

@@ -30,6 +30,7 @@
             <el-menu-item index="/adminCenter/expert">专家管理</el-menu-item>
             <el-menu-item index="/adminCenter/expert">专家管理</el-menu-item>
             <el-menu-item index="/adminCenter/organization">企业管理</el-menu-item>
             <el-menu-item index="/adminCenter/organization">企业管理</el-menu-item>
             <el-menu-item index="/adminCenter/mechanism">机构管理</el-menu-item>
             <el-menu-item index="/adminCenter/mechanism">机构管理</el-menu-item>
+            <el-menu-item index="/adminCenter/online">线上管理</el-menu-item>
           </el-menu>
           </el-menu>
         </el-aside>
         </el-aside>
         <el-main class="main">
         <el-main class="main">

+ 24 - 1
src/components/frame/e-upload.vue

@@ -1,6 +1,16 @@
 <template>
 <template>
   <div id="e-upload">
   <div id="e-upload">
-    <el-upload :action="url" :http-request="upload" :list-type="type" :fileList="fileList" :on-remove="onRemove">
+    <el-upload
+      :action="url"
+      :http-request="upload"
+      :list-type="type"
+      :fileList="fileList"
+      :on-remove="onRemove"
+      :on-error="onError"
+      :on-preview="onPreview"
+      :limit="limit"
+      :on-exceed="onExceed"
+    >
       <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
       <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
     </el-upload>
     </el-upload>
   </div>
   </div>
@@ -16,6 +26,7 @@ export default {
     url: { type: String, required: true },
     url: { type: String, required: true },
     type: { type: String, default: 'picture-card' },
     type: { type: String, default: 'picture-card' },
     fileList: { type: Array },
     fileList: { type: Array },
+    limit: { type: Number },
   },
   },
   model: {
   model: {
     prop: 'fileList',
     prop: 'fileList',
@@ -41,6 +52,18 @@ export default {
       const index = this.fileList.findIndex(f => f.url === file.url);
       const index = this.fileList.findIndex(f => f.url === file.url);
       this.fileList.splice(index, 1);
       this.fileList.splice(index, 1);
     },
     },
+    onError(err) {
+      this.$message.error(err);
+    },
+    // 点击事件
+    onPreview(file) {
+      const { url } = file;
+      window.open(url);
+    },
+    // 超出限制
+    onExceed() {
+      this.$message.error(`只能上传${this.limit}个文件`);
+    },
   },
   },
   computed: {
   computed: {
     ...mapState(['user', 'menuParams']),
     ...mapState(['user', 'menuParams']),

+ 53 - 0
src/store/code.js

@@ -0,0 +1,53 @@
+import Vue from 'vue';
+import Vuex from 'vuex';
+import _ from 'lodash';
+Vue.use(Vuex);
+const api = {
+  interface: `/api/m/main/code`,
+};
+const state = () => ({});
+const mutations = {};
+
+const actions = {
+  async query({ commit }, { skip = 0, limit, ...info } = {}) {
+    const res = await this.$axios.$get(`${api.interface}`, {
+      skip,
+      limit,
+      ...info,
+    });
+    return res;
+  },
+  async create({ commit }, payload) {
+    const res = await this.$axios.$post(`${api.interface}`, payload);
+    return res;
+  },
+  async fetch({ commit }, payload) {
+    const res = await this.$axios.$get(`${api.interface}/${payload}`);
+    return res;
+  },
+  async update({ commit }, { id, ...data }) {
+    const res = await this.$axios.$post(`${api.interface}/update/${id}`, data);
+    return res;
+  },
+
+  async delete({ commit }, payload) {
+    const res = await this.$axios.$delete(`${api.interface}/${payload}`);
+    return res;
+  },
+  // 获取行政区划
+  async xzqh({ commit }, payload) {
+    const res = await this.$axios.$get(`${api.interface}/xzqh`, payload);
+    return res;
+  },
+  // 用code换该项
+  async getItemByCode({ commit }, payload) {
+    const res = await this.$axios.$post(`${api.interface}/name`, payload);
+    return res;
+  },
+};
+export default {
+  namespaced: true,
+  state,
+  mutations,
+  actions,
+};

+ 43 - 0
src/store/online.js

@@ -0,0 +1,43 @@
+import Vue from 'vue';
+import Vuex from 'vuex';
+import _ from 'lodash';
+Vue.use(Vuex);
+const api = {
+  interface: `/api/m/main/online`,
+};
+const state = () => ({});
+const mutations = {};
+
+const actions = {
+  async query({ commit }, { skip = 0, limit, ...info } = {}) {
+    const res = await this.$axios.$get(`${api.interface}`, {
+      skip,
+      limit,
+      ...info,
+    });
+    return res;
+  },
+  async create({ commit }, payload) {
+    const res = await this.$axios.$post(`${api.interface}`, payload);
+    return res;
+  },
+  async fetch({ commit }, payload) {
+    const res = await this.$axios.$get(`${api.interface}/${payload}`);
+    return res;
+  },
+  async update({ commit }, { id, ...data }) {
+    const res = await this.$axios.$post(`${api.interface}/update/${id}`, data);
+    return res;
+  },
+
+  async delete({ commit }, payload) {
+    const res = await this.$axios.$delete(`${api.interface}/${payload}`);
+    return res;
+  },
+};
+export default {
+  namespaced: true,
+  state,
+  mutations,
+  actions,
+};