lrf пре 3 година
родитељ
комит
66364b8ac8

+ 12 - 3
java代码/ruoyi-admin/src/main/java/com/ruoyi/web/controller/JccBasicInformationController.java

@@ -62,10 +62,19 @@ public class JccBasicInformationController extends BaseController
      * 获取基础信息详细信息
      */
     @PreAuthorize("@ss.hasPermi('system:information:query')")
-    @GetMapping()
-    public AjaxResult getInfo()
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") String id)
     {
-        return AjaxResult.success(jccBasicInformationService.selectJccBasicInformationById());
+        return AjaxResult.success(jccBasicInformationService.selectJccBasicInformationById(id));
+    }
+    
+    /**
+     * 获取基础信息详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:information:query')")
+    @GetMapping()
+    public AjaxResult getInfoFirst() {
+      return AjaxResult.success(jccBasicInformationService.selectJccBasicInformationById(null));
     }
 
     /**

+ 1 - 1
java代码/ruoyi-admin/src/main/java/com/ruoyi/web/service/IJccBasicInformationService.java

@@ -16,7 +16,7 @@ public interface IJccBasicInformationService
      *
      * @return 基础信息
      */
-    JccBasicInformation selectJccBasicInformationById();
+    JccBasicInformation selectJccBasicInformationById(String id);
 
     /**
      * 查询基础信息列表

+ 10 - 8
java代码/ruoyi-admin/src/main/java/com/ruoyi/web/service/impl/JccBasicInformationServiceImpl.java

@@ -2,6 +2,7 @@ package com.ruoyi.web.service.impl;
 
 import java.util.List;
 
+import com.alibaba.druid.util.StringUtils;
 import com.ruoyi.common.core.domain.entity.SysUser;
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.SecurityUtils;
@@ -33,17 +34,18 @@ public class JccBasicInformationServiceImpl implements IJccBasicInformationServi
      * @return 基础信息
      */
     @Override
-    public JccBasicInformation selectJccBasicInformationById()
+    public JccBasicInformation selectJccBasicInformationById(String id)
     {
+      if(StringUtils.isEmpty(id)) {
         SysUser thisUser = SecurityUtils.getLoginUser().getUser();
-        SysUser sysUser=userMapper.selectUserById(thisUser.getUserId());
-        JccBasicInformation jccBasicInformation=new JccBasicInformation();
+        SysUser sysUser = userMapper.selectUserById(thisUser.getUserId());
+        JccBasicInformation jccBasicInformation = new JccBasicInformation();
         jccBasicInformation.setCreateBy(sysUser.getLabId());
-        List list=jccBasicInformationMapper.selectJccBasicInformationList(jccBasicInformation);
-        JccBasicInformation basicInformation= (JccBasicInformation) list.get(0);
-
-
-        return jccBasicInformationMapper.selectJccBasicInformationById(basicInformation.getId());
+        List list = jccBasicInformationMapper.selectJccBasicInformationList(jccBasicInformation);
+        JccBasicInformation basicInformation = (JccBasicInformation) list.get(0);
+        id = basicInformation.getId();
+      }
+        return jccBasicInformationMapper.selectJccBasicInformationById(id);
     }
 
     /**

+ 1 - 0
java代码/ruoyi-admin/src/main/resources/application-druid.yml

@@ -8,6 +8,7 @@ spring:
             master:
                 url: jdbc:mysql://localhost:3307/management_platform?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
                 username: root
+                # 服务器 1qaz2wsx
                 password: root
             # 从库数据源
             slave:

+ 1 - 1
java代码/ruoyi-admin/src/main/resources/application.yml

@@ -22,7 +22,7 @@ server:
   port: 8112
   servlet:
     # 应用的访问路径
-    context-path: /
+    context-path: /prod-api
   tomcat:
     # tomcat的URI编码
     uri-encoding: UTF-8

+ 4 - 1
java代码/ruoyi-ui/.env.development

@@ -2,7 +2,10 @@
 ENV = 'development'
 
 # 若依管理系统/开发环境
-VUE_APP_BASE_API = '/dev-api'
+VUE_APP_BASE_API = '/prod-api'
 
 # 路由懒加载
 VUE_CLI_BABEL_TRANSPILE_MODULES = true
+
+# 前缀路由
+VUE_APP_ROUTER='label'

+ 3 - 0
java代码/ruoyi-ui/.env.production

@@ -3,3 +3,6 @@ ENV = 'production'
 
 # 若依管理系统/生产环境
 VUE_APP_BASE_API = '/prod-api'
+
+# 前缀路由
+VUE_APP_ROUTER='label'

+ 1 - 0
java代码/ruoyi-ui/.gitignore

@@ -5,6 +5,7 @@ npm-debug.log*
 yarn-debug.log*
 yarn-error.log*
 **/*.log
+label
 
 tests/**/coverage/
 tests/e2e/reports

+ 5 - 5
java代码/ruoyi-ui/src/layout/components/Navbar.vue

@@ -2,13 +2,13 @@
   <div class="navbar">
     <hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" />
 
-    <breadcrumb id="breadcrumb-container" class="breadcrumb-container" v-if="!topNav"/>
-    <top-nav id="topmenu-container" class="topmenu-container" v-if="topNav"/>
+    <breadcrumb v-if="!topNav" id="breadcrumb-container" class="breadcrumb-container" />
+    <top-nav v-if="topNav" id="topmenu-container" class="topmenu-container" />
 
     <div class="right-menu">
       <template v-if="device!=='mobile'">
         <search id="header-search" class="right-menu-item" />
-        
+
         <el-tooltip content="源码地址" effect="dark" placement="bottom">
           <ruo-yi-git id="ruoyi-git" class="right-menu-item hover-effect" />
         </el-tooltip>
@@ -102,9 +102,9 @@ export default {
         type: 'warning'
       }).then(() => {
         this.$store.dispatch('LogOut').then(() => {
-          location.href = '/index';
+          this.$router.push('/login')
         })
-      }).catch(() => {});
+      }).catch(() => {})
     }
   }
 }

+ 2 - 1
java代码/ruoyi-ui/src/router/index.js

@@ -5,7 +5,7 @@ Vue.use(Router)
 
 /* Layout */
 import Layout from '@/layout'
-import ParentView from '@/components/ParentView';
+import ParentView from '@/components/ParentView'
 
 /**
  * Note: 路由配置项
@@ -123,6 +123,7 @@ export const constantRoutes = [
 
 export default new Router({
   mode: 'history', // 去掉url中的#
+  base: process.env.VUE_APP_ROUTER,
   scrollBehavior: () => ({ y: 0 }),
   routes: constantRoutes
 })

+ 56 - 58
java代码/ruoyi-ui/src/utils/request.js

@@ -21,83 +21,81 @@ service.interceptors.request.use(config => {
   }
   // get请求映射params参数
   if (config.method === 'get' && config.params) {
-    let url = config.url + '?';
+    let url = config.url + '?'
     for (const propName of Object.keys(config.params)) {
-      const value = config.params[propName];
-      var part = encodeURIComponent(propName) + "=";
-      if (value !== null && typeof(value) !== "undefined") {
+      const value = config.params[propName]
+      var part = encodeURIComponent(propName) + '='
+      if (value !== null && typeof (value) !== 'undefined') {
         if (typeof value === 'object') {
           for (const key of Object.keys(value)) {
-            let params = propName + '[' + key + ']';
-            var subPart = encodeURIComponent(params) + "=";
-            url += subPart + encodeURIComponent(value[key]) + "&";
+            const params = propName + '[' + key + ']'
+            var subPart = encodeURIComponent(params) + '='
+            url += subPart + encodeURIComponent(value[key]) + '&'
           }
         } else {
-          url += part + encodeURIComponent(value) + "&";
+          url += part + encodeURIComponent(value) + '&'
         }
       }
     }
-    url = url.slice(0, -1);
-    config.params = {};
-    config.url = url;
+    url = url.slice(0, -1)
+    config.params = {}
+    config.url = url
   }
   return config
 }, error => {
-    console.log(error)
-    Promise.reject(error)
+  console.log(error)
+  Promise.reject(error)
 })
 
 // 响应拦截器
 service.interceptors.response.use(res => {
-    // 未设置状态码则默认成功状态
-    const code = res.data.code || 200;
-    // 获取错误信息
-    const msg = errorCode[code] || res.data.msg || errorCode['default']
-    if (code === 401) {
-      MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', {
-          confirmButtonText: '重新登录',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }
-      ).then(() => {
-        store.dispatch('LogOut').then(() => {
-          location.href = '/index';
-        })
-      }).catch(() => {});
-    } else if (code === 500) {
-      Message({
-        message: msg,
-        type: 'error'
-      })
-      return Promise.reject(new Error(msg))
-    } else if (code !== 200) {
-      Notification.error({
-        title: msg
-      })
-      return Promise.reject('error')
-    } else {
-      return res.data
-    }
-  },
-  error => {
-    console.log('err' + error)
-    let { message } = error;
-    if (message == "Network Error") {
-      message = "后端接口连接异常";
-    }
-    else if (message.includes("timeout")) {
-      message = "系统接口请求超时";
-    }
-    else if (message.includes("Request failed with status code")) {
-      message = "系统接口" + message.substr(message.length - 3) + "异常";
+  // 未设置状态码则默认成功状态
+  const code = res.data.code || 200
+  // 获取错误信息
+  const msg = errorCode[code] || res.data.msg || errorCode['default']
+  if (code === 401) {
+    MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', {
+      confirmButtonText: '重新登录',
+      cancelButtonText: '取消',
+      type: 'warning'
     }
+    ).then(() => {
+      store.dispatch('LogOut').then(() => {
+        location.href = '/label/index'
+      })
+    }).catch(() => {})
+  } else if (code === 500) {
     Message({
-      message: message,
-      type: 'error',
-      duration: 5 * 1000
+      message: msg,
+      type: 'error'
     })
-    return Promise.reject(error)
+    return Promise.reject(new Error(msg))
+  } else if (code !== 200) {
+    Notification.error({
+      title: msg
+    })
+    return Promise.reject('error')
+  } else {
+    return res.data
+  }
+},
+error => {
+  console.log('err' + error)
+  let { message } = error
+  if (message == 'Network Error') {
+    message = '后端接口连接异常'
+  } else if (message.includes('timeout')) {
+    message = '系统接口请求超时'
+  } else if (message.includes('Request failed with status code')) {
+    message = '系统接口' + message.substr(message.length - 3) + '异常'
   }
+  Message({
+    message: message,
+    type: 'error',
+    duration: 5 * 1000
+  })
+  return Promise.reject(error)
+}
 )
 
 export default service

+ 122 - 122
java代码/ruoyi-ui/src/utils/ruoyi.js

@@ -7,120 +7,120 @@ const baseURL = process.env.VUE_APP_BASE_API
 
 // 日期格式化
 export function parseTime(time, pattern) {
-	if (arguments.length === 0 || !time) {
-		return null
-	}
-	const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}'
-	let date
-	if (typeof time === 'object') {
-		date = time
-	} else {
-		if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
-			time = parseInt(time)
-		} else if (typeof time === 'string') {
-			time = time.replace(new RegExp(/-/gm), '/');
-		}
-		if ((typeof time === 'number') && (time.toString().length === 10)) {
-			time = time * 1000
-		}
-		date = new Date(time)
-	}
-	const formatObj = {
-		y: date.getFullYear(),
-		m: date.getMonth() + 1,
-		d: date.getDate(),
-		h: date.getHours(),
-		i: date.getMinutes(),
-		s: date.getSeconds(),
-		a: date.getDay()
-	}
-	const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => {
-		let value = formatObj[key]
-		// Note: getDay() returns 0 on Sunday
-		if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value] }
-		if (result.length > 0 && value < 10) {
-			value = '0' + value
-		}
-		return value || 0
-	})
-	return time_str
+  if (arguments.length === 0 || !time) {
+    return null
+  }
+  const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}'
+  let date
+  if (typeof time === 'object') {
+    date = time
+  } else {
+    if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
+      time = parseInt(time)
+    } else if (typeof time === 'string') {
+      time = time.replace(new RegExp(/-/gm), '/')
+    }
+    if ((typeof time === 'number') && (time.toString().length === 10)) {
+      time = time * 1000
+    }
+    date = new Date(time)
+  }
+  const formatObj = {
+    y: date.getFullYear(),
+    m: date.getMonth() + 1,
+    d: date.getDate(),
+    h: date.getHours(),
+    i: date.getMinutes(),
+    s: date.getSeconds(),
+    a: date.getDay()
+  }
+  const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => {
+    let value = formatObj[key]
+    // Note: getDay() returns 0 on Sunday
+    if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value] }
+    if (result.length > 0 && value < 10) {
+      value = '0' + value
+    }
+    return value || 0
+  })
+  return time_str
 }
 
 // 表单重置
 export function resetForm(refName) {
-	if (this.$refs[refName]) {
-		this.$refs[refName].resetFields();
-	}
+  if (this.$refs[refName]) {
+    this.$refs[refName].resetFields()
+  }
 }
 
 // 添加日期范围
 export function addDateRange(params, dateRange, propName) {
-	var search = params;
-	search.params = {};
-	if (null != dateRange && '' != dateRange) {
-		if (typeof (propName) === "undefined") {
-			search.params["beginTime"] = dateRange[0];
-			search.params["endTime"] = dateRange[1];
-		} else {
-			search.params["begin" + propName] = dateRange[0];
-			search.params["end" + propName] = dateRange[1];
-		}
-	}
-	return search;
+  var search = params
+  search.params = {}
+  if (dateRange != null && dateRange != '') {
+    if (typeof (propName) === 'undefined') {
+      search.params['beginTime'] = dateRange[0]
+      search.params['endTime'] = dateRange[1]
+    } else {
+      search.params['begin' + propName] = dateRange[0]
+      search.params['end' + propName] = dateRange[1]
+    }
+  }
+  return search
 }
 
 // 回显数据字典
 export function selectDictLabel(datas, value) {
-	var actions = [];
-	Object.keys(datas).some((key) => {
-		if (datas[key].dictValue == ('' + value)) {
-			actions.push(datas[key].dictLabel);
-			return true;
-		}
-	})
-	return actions.join('');
+  var actions = []
+  Object.keys(datas).some((key) => {
+    if (datas[key].dictValue == ('' + value)) {
+      actions.push(datas[key].dictLabel)
+      return true
+    }
+  })
+  return actions.join('')
 }
 
 // 回显数据字典(字符串数组)
 export function selectDictLabels(datas, value, separator) {
-	var actions = [];
-	var currentSeparator = undefined === separator ? "," : separator;
-	var temp = value.split(currentSeparator);
-	Object.keys(value.split(currentSeparator)).some((val) => {
-		Object.keys(datas).some((key) => {
-			if (datas[key].dictValue == ('' + temp[val])) {
-				actions.push(datas[key].dictLabel + currentSeparator);
-			}
-		})
-	})
-	return actions.join('').substring(0, actions.join('').length - 1);
+  var actions = []
+  var currentSeparator = undefined === separator ? ',' : separator
+  var temp = value.split(currentSeparator)
+  Object.keys(value.split(currentSeparator)).some((val) => {
+    Object.keys(datas).some((key) => {
+      if (datas[key].dictValue == ('' + temp[val])) {
+        actions.push(datas[key].dictLabel + currentSeparator)
+      }
+    })
+  })
+  return actions.join('').substring(0, actions.join('').length - 1)
 }
 
 // 通用下载方法
 export function download(fileName) {
-	window.location.href = baseURL + "/common/download?fileName=" + encodeURI(fileName) + "&delete=" + true;
+  window.location.href = baseURL + '/common/download?fileName=' + encodeURI(fileName) + '&delete=' + true
 }
 
 // 字符串格式化(%s )
 export function sprintf(str) {
-	var args = arguments, flag = true, i = 1;
-	str = str.replace(/%s/g, function () {
-		var arg = args[i++];
-		if (typeof arg === 'undefined') {
-			flag = false;
-			return '';
-		}
-		return arg;
-	});
-	return flag ? str : '';
+  var args = arguments; var flag = true; var i = 1
+  str = str.replace(/%s/g, function() {
+    var arg = args[i++]
+    if (typeof arg === 'undefined') {
+      flag = false
+      return ''
+    }
+    return arg
+  })
+  return flag ? str : ''
 }
 
 // 转换字符串,undefined,null等转化为""
 export function praseStrEmpty(str) {
-	if (!str || str == "undefined" || str == "null") {
-		return "";
-	}
-	return str;
+  if (!str || str == 'undefined' || str == 'null') {
+    return ''
+  }
+  return str
 }
 
 /**
@@ -131,45 +131,45 @@ export function praseStrEmpty(str) {
  * @param {*} children 孩子节点字段 默认 'children'
  */
 export function handleTree(data, id, parentId, children) {
-	let config = {
-		id: id || 'id',
-		parentId: parentId || 'parentId',
-		childrenList: children || 'children'
-	};
+  const config = {
+    id: id || 'id',
+    parentId: parentId || 'parentId',
+    childrenList: children || 'children'
+  }
 
-	var childrenListMap = {};
-	var nodeIds = {};
-	var tree = [];
+  var childrenListMap = {}
+  var nodeIds = {}
+  var tree = []
 
-	for (let d of data) {
-		let parentId = d[config.parentId];
-		if (childrenListMap[parentId] == null) {
-			childrenListMap[parentId] = [];
-		}
-		nodeIds[d[config.id]] = d;
-		childrenListMap[parentId].push(d);
-	}
+  for (const d of data) {
+    const parentId = d[config.parentId]
+    if (childrenListMap[parentId] == null) {
+      childrenListMap[parentId] = []
+    }
+    nodeIds[d[config.id]] = d
+    childrenListMap[parentId].push(d)
+  }
 
-	for (let d of data) {
-		let parentId = d[config.parentId];
-		if (nodeIds[parentId] == null) {
-			tree.push(d);
-		}
-	}
+  for (const d of data) {
+    const parentId = d[config.parentId]
+    if (nodeIds[parentId] == null) {
+      tree.push(d)
+    }
+  }
 
-	for (let t of tree) {
-		adaptToChildrenList(t);
-	}
+  for (const t of tree) {
+    adaptToChildrenList(t)
+  }
 
-	function adaptToChildrenList(o) {
-		if (childrenListMap[o[config.id]] !== null) {
-			o[config.childrenList] = childrenListMap[o[config.id]];
-		}
-		if (o[config.childrenList]) {
-			for (let c of o[config.childrenList]) {
-				adaptToChildrenList(c);
-			}
-		}
-	}
-	return tree;
+  function adaptToChildrenList(o) {
+    if (childrenListMap[o[config.id]] !== null) {
+      o[config.childrenList] = childrenListMap[o[config.id]]
+    }
+    if (o[config.childrenList]) {
+      for (const c of o[config.childrenList]) {
+        adaptToChildrenList(c)
+      }
+    }
+  }
+  return tree
 }

+ 37 - 37
java代码/ruoyi-ui/src/views/login.vue

@@ -29,7 +29,7 @@
           <svg-icon slot="prefix" icon-class="validCode" class="el-input__icon input-icon" />
         </el-input>
         <div class="login-code">
-          <img :src="codeUrl" @click="getCode" class="login-code-img"/>
+          <img :src="codeUrl" class="login-code-img" @click="getCode">
         </div>
       </el-form-item>
       <el-checkbox v-model="loginForm.rememberMe" style="margin:0px 0px 25px 0px;">记住密码</el-checkbox>
@@ -54,89 +54,89 @@
 </template>
 
 <script>
-import { getCodeImg } from "@/api/login";
-import Cookies from "js-cookie";
+import { getCodeImg } from '@/api/login'
+import Cookies from 'js-cookie'
 import { encrypt, decrypt } from '@/utils/jsencrypt'
 
 export default {
-  name: "Login",
+  name: 'Login',
   data() {
     return {
-      codeUrl: "",
-      cookiePassword: "",
+      codeUrl: '',
+      cookiePassword: '',
       loginForm: {
-        username: "",
-        password: "",
+        username: '',
+        password: '',
         rememberMe: false,
-        code: "",
-        uuid: ""
+        code: '',
+        uuid: ''
       },
       loginRules: {
         username: [
-          { required: true, trigger: "blur", message: "用户名不能为空" }
+          { required: true, trigger: 'blur', message: '用户名不能为空' }
         ],
         password: [
-          { required: true, trigger: "blur", message: "密码不能为空" }
+          { required: true, trigger: 'blur', message: '密码不能为空' }
         ],
-        code: [{ required: true, trigger: "change", message: "验证码不能为空" }]
+        code: [{ required: true, trigger: 'change', message: '验证码不能为空' }]
       },
       loading: false,
       redirect: undefined
-    };
+    }
   },
   watch: {
     $route: {
       handler: function(route) {
-        this.redirect = route.query && route.query.redirect;
+        this.redirect = route.query && route.query.redirect
       },
       immediate: true
     }
   },
   created() {
-    this.getCode();
-    this.getCookie();
+    this.getCode()
+    this.getCookie()
   },
   methods: {
     getCode() {
       getCodeImg().then(res => {
-        this.codeUrl = "data:image/gif;base64," + res.img;
-        this.loginForm.uuid = res.uuid;
-      });
+        this.codeUrl = 'data:image/gif;base64,' + res.img
+        this.loginForm.uuid = res.uuid
+      })
     },
     getCookie() {
-      const username = Cookies.get("username");
-      const password = Cookies.get("password");
+      const username = Cookies.get('username')
+      const password = Cookies.get('password')
       const rememberMe = Cookies.get('rememberMe')
       this.loginForm = {
         username: username === undefined ? this.loginForm.username : username,
         password: password === undefined ? this.loginForm.password : decrypt(password),
         rememberMe: rememberMe === undefined ? false : Boolean(rememberMe)
-      };
+      }
     },
     handleLogin() {
       this.$refs.loginForm.validate(valid => {
         if (valid) {
-          this.loading = true;
+          this.loading = true
           if (this.loginForm.rememberMe) {
-            Cookies.set("username", this.loginForm.username, { expires: 30 });
-            Cookies.set("password", encrypt(this.loginForm.password), { expires: 30 });
-            Cookies.set('rememberMe', this.loginForm.rememberMe, { expires: 30 });
+            Cookies.set('username', this.loginForm.username, { expires: 30 })
+            Cookies.set('password', encrypt(this.loginForm.password), { expires: 30 })
+            Cookies.set('rememberMe', this.loginForm.rememberMe, { expires: 30 })
           } else {
-            Cookies.remove("username");
-            Cookies.remove("password");
-            Cookies.remove('rememberMe');
+            Cookies.remove('username')
+            Cookies.remove('password')
+            Cookies.remove('rememberMe')
           }
-          this.$store.dispatch("Login", this.loginForm).then(() => {
-            this.$router.push({ path: this.redirect || "/" }).catch(()=>{});
+          this.$store.dispatch('Login', this.loginForm).then(() => {
+            this.$router.push({ path: this.redirect || '/' }).catch(() => {})
           }).catch(() => {
-            this.loading = false;
-            this.getCode();
-          });
+            this.loading = false
+            this.getCode()
+          })
         }
-      });
+      })
     }
   }
-};
+}
 </script>
 
 <style rel="stylesheet/scss" lang="scss">

+ 211 - 202
java代码/ruoyi-ui/src/views/system/award/index.vue

@@ -4,11 +4,11 @@
       <div class="app-container">
         <!--标题1-->
         <div class="title-box">
-          <div class="blue-line inline"></div>
+          <div class="blue-line inline" />
           <div class="inline titleWord">实验室建设期内发明专利、新药证书、软件登记及制定标准明细</div>
           <div class="remark">*注:填第一单位、完成人为核心成员的成果;仅填写1次,不得多实验室重复填写。*</div>
         </div>
-        <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+        <el-form v-show="showSearch" ref="queryForm" :model="queryParams" :inline="true" label-width="68px">
           <el-form-item label="类别" prop="type">
             <el-select v-model="queryParams.type" placeholder="请选择类别" clearable size="small">
               <el-option
@@ -54,7 +54,7 @@
                 :key="dict.id"
                 :label="dict.name"
                 :value="dict.id"
-              ></el-option>
+              />
             </el-select>
           </el-form-item>
           <el-form-item label="完成人" prop="userId">
@@ -64,7 +64,7 @@
                 :key="dict.id"
                 :label="dict.name"
                 :value="dict.id"
-              ></el-option>
+              />
             </el-select>
           </el-form-item>
           <el-form-item>
@@ -72,52 +72,52 @@
             <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
           </el-form-item>
         </el-form>
-        <div class="spliceLine"></div>
+        <div class="spliceLine" />
         <el-row :gutter="10" class="mb8">
           <el-col :span="1.5">
             <el-button
+              v-hasPermi="['system:award:add']"
               type="primary"
               plain
               icon="el-icon-plus"
               size="mini"
               @click="handleAdd"
-              v-hasPermi="['system:award:add']"
             >新增</el-button>
           </el-col>
           <el-col :span="1.5">
             <el-button
+              v-hasPermi="['system:award:edit']"
               type="success"
               plain
               icon="el-icon-edit"
               size="mini"
               :disabled="single"
               @click="handleUpdate"
-              v-hasPermi="['system:award:edit']"
             >修改</el-button>
           </el-col>
           <el-col :span="1.5">
             <el-button
+              v-hasPermi="['system:award:remove']"
               type="danger"
               plain
               icon="el-icon-delete"
               size="mini"
               :disabled="multiple"
               @click="handleDelete"
-              v-hasPermi="['system:award:remove']"
             >删除</el-button>
           </el-col>
           <el-col :span="1.5">
             <el-button
+              v-hasPermi="['system:award:export']"
               type="warning"
               plain
               icon="el-icon-download"
               size="mini"
-          :loading="exportLoading"
+              :loading="exportLoading"
               @click="handleExport"
-              v-hasPermi="['system:award:export']"
             >导出</el-button>
           </el-col>
-          <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+          <right-toolbar :show-search.sync="showSearch" @queryTable="getList" />
         </el-row>
 
         <el-table v-loading="loading" :data="awardList" @selection-change="handleSelectionChange">
@@ -125,33 +125,33 @@
           <el-table-column label="类别" align="center" prop="type":formatter="typeFormat" />
           <el-table-column label="成果编号" align="center" prop="resulnumber" />
           <el-table-column label="成果名称" align="center" prop="name" />
-          <el-table-column label="成果类别" align="center" prop="resultype" :formatter="resultypeFormat"/>
-          <el-table-column label="研究方向" align="center" prop="directionName"  />
+          <el-table-column label="成果类别" align="center" prop="resultype" :formatter="resultypeFormat" />
+          <el-table-column label="研究方向" align="center" prop="directionName" />
           <el-table-column label="完成人" align="center" prop="userName" />
           <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
             <template slot-scope="scope">
               <el-button
+                v-hasPermi="['system:award:edit']"
                 size="mini"
                 type="text"
                 icon="el-icon-edit"
                 @click="handleUpdate(scope.row)"
-                v-hasPermi="['system:award:edit']"
               >修改</el-button>
               <el-button
+                v-hasPermi="['system:award:remove']"
                 size="mini"
                 type="text"
                 icon="el-icon-delete"
-                @click="handleDelete(scope.row)"
-                v-hasPermi="['system:award:remove']"
                 style="color: #F56C6C;"
+                @click="handleDelete(scope.row)"
               >删除</el-button>
               <el-button
+                v-hasPermi="['system:patent:remove']"
                 size="mini"
                 type="text"
                 icon="el-icon-upload2"
-                @click="handleUpload(scope.row)"
-                v-hasPermi="['system:patent:remove']"
                 style="color: #E6A23C;"
+                @click="handleUpload(scope.row)"
               >附件</el-button>
             </template>
           </el-table-column>
@@ -175,7 +175,7 @@
                   :key="dict.dictValue"
                   :label="dict.dictLabel"
                   :value="dict.dictValue"
-                ></el-option>
+                />
               </el-select>
             </el-form-item>
             <el-form-item label="成果编号" prop="resulnumber">
@@ -191,7 +191,7 @@
                   :key="dict.dictValue"
                   :label="dict.dictLabel"
                   :value="dict.dictValue"
-                ></el-option>
+                />
               </el-select>
             </el-form-item>
             <el-form-item label="研究方向" prop="direction">
@@ -201,7 +201,7 @@
                   :key="dict.id"
                   :label="dict.name"
                   :value="dict.id"
-                ></el-option>
+                />
               </el-select>
             </el-form-item>
             <el-form-item label="完成人" prop="userId">
@@ -211,12 +211,12 @@
                   :key="dict.id"
                   :label="dict.name"
                   :value="dict.id"
-                ></el-option>
+                />
               </el-select>
             </el-form-item>
           </el-form>
           <div slot="footer" class="dialog-footer">
-            <el-button type="primary" plain @click="handleUpload" class="float-left">上传附件</el-button>
+            <el-button type="primary" plain class="float-left" @click="handleUpload">上传附件</el-button>
             <el-button type="primary" @click="submitForm">确 定</el-button>
             <el-button @click="cancel">取 消</el-button>
           </div>
@@ -231,37 +231,44 @@
               :file-list="loadList"
               :auto-upload="true"
               list-type="picture-card"
-              :on-change="handleChange">
-              <i slot="default" class="el-icon-plus"></i>
+              :on-change="handleChange"
+            >
+              <i slot="default" class="el-icon-plus" />
               <div slot="file" slot-scope="{file}">
-                <img v-if="file.picture"
-                     class="el-upload-list__item-thumbnail"
-                     :src="file.url" alt="">
+                <img
+                  v-if="file.picture"
+                  class="el-upload-list__item-thumbnail"
+                  :src="file.url"
+                  alt=""
+                >
                 <div v-else>
-                  <img class="el-upload-list__item-thumbnail wordIcon"
-                       :src="wordImg" alt="">
-                  <div>{{file.name}}</div>
+                  <img
+                    class="el-upload-list__item-thumbnail wordIcon"
+                    :src="wordImg"
+                    alt=""
+                  >
+                  <div>{{ file.name }}</div>
                 </div>
                 <span class="el-upload-list__item-actions">
                   <!--<span-->
-                    <!--class="el-upload-list__item-preview"-->
-                    <!--@click="handlePictureCardPreview(file)"-->
+                  <!--class="el-upload-list__item-preview"-->
+                  <!--@click="handlePictureCardPreview(file)"-->
                   <!--&gt;-->
-                    <!--<i class="el-icon-zoom-in"></i>-->
+                  <!--<i class="el-icon-zoom-in"></i>-->
                   <!--</span>-->
                   <span
                     v-if="!disabled"
                     class="el-upload-list__item-delete"
                     @click="handleDownload(file)"
                   >
-                    <i class="el-icon-download"></i>
+                    <i class="el-icon-download" />
                   </span>
                   <span
                     v-if="!disabled"
                     class="el-upload-list__item-delete"
                     @click="handleRemove(file)"
                   >
-                    <i class="el-icon-delete"></i>
+                    <i class="el-icon-delete" />
                   </span>
                 </span>
               </div>
@@ -277,9 +284,11 @@
           <img v-if="picture" width="100%" :src="dialogImageUrl" alt="图片加载失败">
           <div v-else>文件请下载查看详情</div>
           <div>
-            <el-button type="primary" @click="handleDownload(dialogImageUrl)"
-                       icon="el-icon-download"
-                       style="text-align: center; margin-top: 30px;"
+            <el-button
+              type="primary"
+              icon="el-icon-download"
+              style="text-align: center; margin-top: 30px;"
+              @click="handleDownload(dialogImageUrl)"
             >下载附件</el-button>
           </div>
         </el-dialog>
@@ -289,14 +298,14 @@
 </template>
 
 <script>
-import { listAward, getAward, delAward, addAward, updateAward, exportAward } from "@/api/system/award";
-import { listDirection} from "@/api/system/direction";
-import { listPersonnel} from "@/api/system/personnel";
-import { listFile ,delFile} from "@/api/system/file";
-import { getToken } from "@/utils/auth";
+import { listAward, getAward, delAward, addAward, updateAward, exportAward } from '@/api/system/award'
+import { listDirection } from '@/api/system/direction'
+import { listPersonnel } from '@/api/system/personnel'
+import { listFile, delFile } from '@/api/system/file'
+import { getToken } from '@/utils/auth'
 
 export default {
-  name: "Award",
+  name: 'Award',
   components: {
   },
   data() {
@@ -307,14 +316,14 @@ export default {
       exportLoading: false,
       // 选中数组
       ids: [],
-      //临时id
-      filesssssid:null,
+      // 临时id
+      filesssssid: null,
       // 类别字典
       type: [],
       // 成果类别字典
       resultype: [],
-      //附件列表
-      loadList:[],
+      // 附件列表
+      loadList: [],
       // 方向字典
       direction: [],
       // 完成人字典
@@ -330,7 +339,7 @@ export default {
       // 制定标准明细表格数据
       awardList: [],
       // 弹出层标题
-      title: "",
+      title: '',
       // 是否显示弹出层
       open: false,
       // 查询参数
@@ -342,7 +351,7 @@ export default {
         resulnumber: null,
         name: null,
         direction: null,
-        userId: null,
+        userId: null
       },
       // 文件查询参数
       queryParamsFile: {
@@ -350,43 +359,43 @@ export default {
         pageSize: 10,
         fileName: null,
         fliePath: null,
-        moduleName: null,
+        moduleName: null
       },
       // 表单参数
       form: {},
       // 表单校验
       rules: {
         createTime: [
-          { required: true, message: "创建时间不能为空", trigger: "blur" }
+          { required: true, message: '创建时间不能为空', trigger: 'blur' }
         ],
         createBy: [
-          { required: true, message: "创建人不能为空", trigger: "blur" }
-        ],
+          { required: true, message: '创建人不能为空', trigger: 'blur' }
+        ]
       },
-      //上传附件弹出层
-      upLoadBox:false,
-      //上传附件
+      // 上传附件弹出层
+      upLoadBox: false,
+      // 上传附件
       dialogImageUrl: '',
       dialogVisible: false,
       disabled: false,
-      //判断是否为图片
-      picture:true,
-      uploadImgUrl: process.env.VUE_APP_BASE_API + "/common/upload/award", // 上传的图片服务器地址
+      // 判断是否为图片
+      picture: true,
+      uploadImgUrl: process.env.VUE_APP_BASE_API + '/common/upload/award', // 上传的图片服务器地址
       headers: {
-        Authorization: "Bearer " + getToken(),
-      },
-    };
+        Authorization: 'Bearer ' + getToken()
+      }
+    }
   },
   created() {
-    this.getList();
-    this.getPerson();
-    this.getFangxiang();
-    this.getDicts("mingxi_type").then(response => {
-      this.type = response.data;
-    });
-    this.getDicts("cheng_resultype").then(response => {
-      this.resultype = response.data;
-    });
+    this.getList()
+    this.getPerson()
+    this.getFangxiang()
+    this.getDicts('mingxi_type').then(response => {
+      this.type = response.data
+    })
+    this.getDicts('cheng_resultype').then(response => {
+      this.resultype = response.data
+    })
     // this.getDicts("jiang_direction").then(response => {
     //   this.direction = response.data;
     // });
@@ -397,66 +406,66 @@ export default {
   methods: {
     /** 查询制定标准明细列表 */
     getList() {
-      this.loading = true;
+      this.loading = true
       listAward(this.queryParams).then(response => {
-        this.awardList = response.rows;
-        this.total = response.total;
-        this.loading = false;
-      });
+        this.awardList = response.rows
+        this.total = response.total
+        this.loading = false
+      })
     },
     getPerson() {
-      this.loading = true;
+      this.loading = true
       listPersonnel(this.queryParams).then(response => {
-        this.userId = response.rows;
-        this.total = response.total;
-        this.loading = false;
-      });
+        this.userId = response.rows
+        this.total = response.total
+        this.loading = false
+      })
     },
     getFangxiang() {
-      this.loading = true;
+      this.loading = true
       listDirection(this.queryParams).then(response => {
-        this.direction = response.rows;
-        this.total = response.total;
-        this.loading = false;
-      });
+        this.direction = response.rows
+        this.total = response.total
+        this.loading = false
+      })
     },
-    //上传成功组件
-    handleAvatarSuccess(){
-      this.getModuleList(this.filesssssid);
+    // 上传成功组件
+    handleAvatarSuccess() {
+      this.getModuleList(this.filesssssid)
     },
 
     /** 查询模块文件列表 */
     getModuleList(id) {
-      this.loading = true;
-      this.queryParamsFile.moduleId=id;
+      this.loading = true
+      this.queryParamsFile.moduleId = id
       listFile(this.queryParamsFile).then(response => {
-        console.log(response.rows);
-        this.loadList = response.rows;
-        this.total = response.total;
-        this.loading = false;
-      });
+        console.log(response.rows)
+        this.loadList = response.rows
+        this.total = response.total
+        this.loading = false
+      })
     },
 
     // 类别字典翻译
     typeFormat(row, column) {
-      return this.selectDictLabel(this.type, row.type);
+      return this.selectDictLabel(this.type, row.type)
     },
     // 类别字典翻译
     resultypeFormat(row, column) {
-      return this.selectDictLabel(this.resultype, row.resultype);
+      return this.selectDictLabel(this.resultype, row.resultype)
     },
     // 类别字典翻译
     directionFormat(row, column) {
-      return this.selectDictLabel(this.direction, row.direction);
+      return this.selectDictLabel(this.direction, row.direction)
     },
     // 完成人字典翻译
     userIdFormat(row, column) {
-      return this.selectDictLabel(this.userId, row.userId);
+      return this.selectDictLabel(this.userId, row.userId)
     },
     // 取消按钮
     cancel() {
-      this.open = false;
-      this.reset();
+      this.open = false
+      this.reset()
     },
     // 表单重置
     reset() {
@@ -473,169 +482,169 @@ export default {
         createBy: null,
         updateTime: null,
         updateBy: null
-      };
-      this.resetForm("form");
+      }
+      this.resetForm('form')
     },
     /** 搜索按钮操作 */
     handleQuery() {
-      this.queryParams.pageNum = 1;
-      this.getList();
+      this.queryParams.pageNum = 1
+      this.getList()
     },
     /** 重置按钮操作 */
     resetQuery() {
-      this.resetForm("queryForm");
-      this.handleQuery();
+      this.resetForm('queryForm')
+      this.handleQuery()
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
-      this.ids = selection.map(item => item.id);
-      this.single = selection.length!==1;
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length !== 1
       this.multiple = !selection.length
     },
     /** 新增按钮操作 */
     handleAdd() {
-      this.reset();
-      this.open = true;
-      this.title = "添加制定标准明细";
+      this.reset()
+      this.open = true
+      this.title = '添加制定标准明细'
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
-      this.reset();
-      const id = row.id || this.ids;
+      this.reset()
+      const id = row.id || this.ids
       getAward(id).then(response => {
-        this.form = response.data;
-        this.open = true;
-        this.title = "修改制定标准明细";
-      });
+        this.form = response.data
+        this.open = true
+        this.title = '修改制定标准明细'
+      })
     },
     /** 提交按钮 */
     submitForm() {
-      this.$refs["form"].validate(valid => {
+      this.$refs['form'].validate(valid => {
         if (valid) {
           if (this.form.id != null) {
             updateAward(this.form).then(response => {
-              this.msgSuccess("修改成功");
-              this.open = false;
-              this.getList();
-            });
+              this.msgSuccess('修改成功')
+              this.open = false
+              this.getList()
+            })
           } else {
             addAward(this.form).then(response => {
-              this.msgSuccess("新增成功");
-              this.open = false;
-              this.getList();
-            });
+              this.msgSuccess('新增成功')
+              this.open = false
+              this.getList()
+            })
           }
         }
-      });
+      })
     },
     /** 删除按钮操作 */
     handleDelete(row) {
-      const ids = row.id || this.ids;
-      this.$confirm('是否确认删除制定标准明细编号为"' + ids + '"的数据项?', "警告", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        }).then(function() {
-          return delAward(ids);
-        }).then(() => {
-          this.getList();
-          this.msgSuccess("删除成功");
-        }).catch(() => {});
+      const ids = row.id || this.ids
+      this.$confirm('是否确认删除制定标准明细编号为"' + ids + '"的数据项?', '警告', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(function() {
+        return delAward(ids)
+      }).then(() => {
+        this.getList()
+        this.msgSuccess('删除成功')
+      }).catch(() => {})
     },
     /** 导出按钮操作 */
     handleExport() {
-      const queryParams = this.queryParams;
-      this.$confirm('是否确认导出所有制定标准明细数据项?', "警告", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        }).then(() => {
-          this.exportLoading = true;
-          return exportAward(queryParams);
-        }).then(response => {
-          this.download(response.msg);
-          this.exportLoading = false;
-        }).catch(() => {});
+      const queryParams = this.queryParams
+      this.$confirm('是否确认导出所有制定标准明细数据项?', '警告', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.exportLoading = true
+        return exportAward(queryParams)
+      }).then(response => {
+        this.download(response.msg)
+        this.exportLoading = false
+      }).catch(() => {})
     },
-    //上传附件按钮
-    handleUpload(row){
-      this.moduleId= row.id;
-      this.filesssssid= row.id;
-      this.uploadImgUrl=process.env.VUE_APP_BASE_API + "/common/upload/science?listId="+row.id,
-        this.reset();
-      this.getModuleList(row.id);
-      this.upLoadBox = true;
-      this.title = "上传附件";
+    // 上传附件按钮
+    handleUpload(row) {
+      this.moduleId = row.id
+      this.filesssssid = row.id
+      this.uploadImgUrl = process.env.VUE_APP_BASE_API + '/common/upload/science?listId=' + row.id,
+      this.reset()
+      this.getModuleList(row.id)
+      this.upLoadBox = true
+      this.title = '上传附件'
     },
-    //上传附件取消按钮
-    uploadCancel(){
-      this.upLoadBox = false;
-      this.reset();
+    // 上传附件取消按钮
+    uploadCancel() {
+      this.upLoadBox = false
+      this.reset()
     },
-    //删除附件
+    // 删除附件
     handleRemove(file) {
-      console.log(file);
-      let name = file.name;
-      let fileId = file.id;
-      this.handleDeleteModule(fileId);
-      console.log(this.loadList);
+      console.log(file)
+      const name = file.name
+      const fileId = file.id
+      this.handleDeleteModule(fileId)
+      console.log(this.loadList)
       this.$confirm('是否删除该附件?', '提示', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
         type: 'warning'
       }).then(() => {
-        for (let i=0;i<this.loadList.length;i++){
-          if(name==this.loadList[i].name){
-            console.log(i);
-            this.loadList.splice(i,1)
+        for (let i = 0; i < this.loadList.length; i++) {
+          if (name == this.loadList[i].name) {
+            console.log(i)
+            this.loadList.splice(i, 1)
           }
         }
         this.$message({
           type: 'success',
           message: '删除成功!'
-        });
+        })
       }).catch(() => {
         this.$message({
           type: 'info',
           message: '已取消删除'
-        });
-      });
+        })
+      })
     },
     handleDeleteModule(id) {
       delFile(id)
     },
-    //展示附件
+    // 展示附件
     handlePictureCardPreview(file) {
-      this.dialogImageUrl = file.url;
-      if(file.picture==true){
-        this.picture=true
-      }else{
-        this.picture=false
+      this.dialogImageUrl = file.url
+      if (file.picture == true) {
+        this.picture = true
+      } else {
+        this.picture = false
       }
-      this.dialogVisible = true;
+      this.dialogVisible = true
     },
-    //下载附件
+    // 下载附件
     handleDownload(file) {
-      window.location.href = file.url;
+      window.location.href = file.url
     },
-    //上传时判断上传的是图片还是文件
-    handleChange(file, fileList){
-      console.log(file);
-      fileList.forEach((value , index) => {
-        let url = fileList[index].name;
-        let imgStr = /\.(jpg|jpeg|png|bmp|BMP|JPG|PNG|JPEG)$/;
-        if (!imgStr.test(url)){
-          console.log('文件');
+    // 上传时判断上传的是图片还是文件
+    handleChange(file, fileList) {
+      console.log(file)
+      fileList.forEach((value, index) => {
+        const url = fileList[index].name
+        const imgStr = /\.(jpg|jpeg|png|bmp|BMP|JPG|PNG|JPEG)$/
+        if (!imgStr.test(url)) {
+          console.log('文件')
           value['picture'] = false
-        }else {
-          console.log('图片');
+        } else {
+          console.log('图片')
           value['picture'] = true
         }
-      });
-      this.loadList=fileList
+      })
+      this.loadList = fileList
     }
   }
-};
+}
 </script>
 
 <style scoped lang="scss">

+ 263 - 256
java代码/ruoyi-ui/src/views/system/patent/index.vue

@@ -4,12 +4,12 @@
       <div class="app-container">
         <!--标题1-->
         <div class="title-box">
-          <div class="blue-line inline"></div>
+          <div class="blue-line inline" />
           <div class="inline titleWord">实验室建设期内获奖明细</div>
           <div class="inline note">(建设期不足五年的新建实验室可不填)</div>
           <div class="remark">*注:省部级以下奖不填;省部级合作获奖不填;获奖人须为核心成员;获奖仅填写1次,不得多实验室重复填写。*</div>
         </div>
-        <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+        <el-form v-show="showSearch" ref="queryForm" :model="queryParams" :inline="true" label-width="68px">
           <el-form-item label="类别" prop="type">
             <el-select v-model="queryParams.type" placeholder="请选择类别" clearable size="small">
               <el-option
@@ -56,18 +56,18 @@
                 :key="dict.id"
                 :label="dict.name"
                 :value="dict.id"
-              ></el-option>
+              />
             </el-select>
           </el-form-item>
           <!--<el-form-item label="获奖人" prop="userId">-->
-            <!--<el-select v-model="queryParams.userId" placeholder="请选择" clearable size="small">-->
-              <!--<el-option-->
-                <!--v-for="dict in userId"-->
-                <!--:key="dict.id"-->
-                <!--:label="dict.name"-->
-                <!--:value="dict.id"-->
-              <!--&gt;</el-option>-->
-            <!--</el-select>-->
+          <!--<el-select v-model="queryParams.userId" placeholder="请选择" clearable size="small">-->
+          <!--<el-option-->
+          <!--v-for="dict in userId"-->
+          <!--:key="dict.id"-->
+          <!--:label="dict.name"-->
+          <!--:value="dict.id"-->
+          <!--&gt;</el-option>-->
+          <!--</el-select>-->
 
           <!--</el-form-item>-->
           <el-form-item>
@@ -75,65 +75,65 @@
             <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
           </el-form-item>
         </el-form>
-        <div class="spliceLine"></div>
+        <div class="spliceLine" />
         <el-row :gutter="10" class="mb8">
           <el-col :span="1.5">
             <el-button
+              v-hasPermi="['system:patent:add']"
               type="primary"
               plain
               icon="el-icon-plus"
               size="mini"
               @click="handleAdd"
-              v-hasPermi="['system:patent:add']"
             >新增</el-button>
           </el-col>
           <el-col :span="1.5">
             <el-button
+              v-hasPermi="['system:patent:edit']"
               type="success"
               plain
               icon="el-icon-edit"
               size="mini"
               :disabled="single"
               @click="handleUpdate"
-              v-hasPermi="['system:patent:edit']"
             >修改</el-button>
           </el-col>
           <el-col :span="1.5">
             <el-button
+              v-hasPermi="['system:patent:remove']"
               type="danger"
               plain
               icon="el-icon-delete"
               size="mini"
               :disabled="multiple"
               @click="handleDelete"
-              v-hasPermi="['system:patent:remove']"
             >删除</el-button>
           </el-col>
           <el-col :span="1.5">
             <el-button
+              v-hasPermi="['system:patent:export']"
               type="warning"
               plain
               icon="el-icon-download"
               size="mini"
-          :loading="exportLoading"
+              :loading="exportLoading"
               @click="handleExport"
-              v-hasPermi="['system:patent:export']"
             >导出</el-button>
           </el-col>
-          <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+          <right-toolbar :show-search.sync="showSearch" @queryTable="getList" />
         </el-row>
 
         <el-table v-loading="loading" :data="patentList" @selection-change="handleSelectionChange">
           <el-table-column type="selection" width="55" align="center" />
-          <el-table-column label="类别" align="left" prop="type" :formatter="typeFormat"/>
+          <el-table-column label="类别" align="left" prop="type" :formatter="typeFormat" />
           <el-table-column label="成果编号" align="left" prop="resulnumber" />
           <el-table-column label="成果名称" align="left" prop="name" />
-          <el-table-column label="获奖等级" align="left" prop="level" :formatter="levelFormat"/>
-          <el-table-column label="研究方向" align="left" prop="directionName"  />
-          <el-table-column label="获奖人" align="left"  >
+          <el-table-column label="获奖等级" align="left" prop="level" :formatter="levelFormat" />
+          <el-table-column label="研究方向" align="left" prop="directionName" />
+          <el-table-column label="获奖人" align="left">
             <template slot-scope="scope">
               <el-tag v-for="item in scope.row.person">
-                {{ item.userName+ 'No.'+item.level}}
+                {{ item.userName+ 'No.'+item.level }}
               </el-tag>
             </template>
 
@@ -141,27 +141,27 @@
           <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
             <template slot-scope="scope">
               <el-button
+                v-hasPermi="['system:patent:edit']"
                 size="mini"
                 type="text"
                 icon="el-icon-edit"
                 @click="handleUpdate(scope.row)"
-                v-hasPermi="['system:patent:edit']"
               >修改</el-button>
               <el-button
+                v-hasPermi="['system:patent:remove']"
                 size="mini"
                 type="text"
                 icon="el-icon-delete"
-                @click="handleDelete(scope.row)"
-                v-hasPermi="['system:patent:remove']"
                 style="color: #F56C6C;"
+                @click="handleDelete(scope.row)"
               >删除</el-button>
               <el-button
+                v-hasPermi="['system:patent:remove']"
                 size="mini"
                 type="text"
                 icon="el-icon-upload2"
-                @click="handleUpload(scope.row)"
-                v-hasPermi="['system:patent:remove']"
                 style="color: #E6A23C;"
+                @click="handleUpload(scope.row)"
               >附件</el-button>
             </template>
           </el-table-column>
@@ -185,7 +185,7 @@
                   :key="dict.dictValue"
                   :label="dict.dictLabel"
                   :value="dict.dictValue"
-                ></el-option>
+                />
               </el-select>
             </el-form-item>
             <el-form-item label="成果编号" prop="resulnumber">
@@ -201,7 +201,7 @@
                   :key="dict.dictValue"
                   :label="dict.dictLabel"
                   :value="dict.dictValue"
-                ></el-option>
+                />
               </el-select>
             </el-form-item>
             <el-form-item label="研究方向" prop="direction">
@@ -212,7 +212,7 @@
                   :key="dict.id"
                   :label="dict.name"
                   :value="dict.id"
-                ></el-option>
+                />
               </el-select>
             </el-form-item>
             <!--<el-select v-model="form.userId" placeholder="请选择获奖人">-->
@@ -232,11 +232,11 @@
                   v-for="(item, index) in personnelList"
                   :key="item.id"
                   :label="item.id"
-                  @change = "asdzxc(index)"
+                  @change="asdzxc(index)"
                 >{{ item.name }}
-                  <el-input-number v-if="!asdasd[index]"   v-model="personlevel[index]" placeholder="排序" :min="0"/>
+                  <el-input-number v-if="!asdasd[index]" v-model="personlevel[index]" placeholder="排序" :min="0" />
                   <!--<el-input-number :disabled="asdasd[index]" v-model="personlevel[index]" placeholder="排序" :min="0"/>-->
-                 </el-checkbox>
+                </el-checkbox>
               </el-checkbox-group>
             </el-form-item>
           </el-form>
@@ -258,36 +258,42 @@
               list-type="picture-card"
               :on-change="handleChange"
             >
-              <i slot="default" class="el-icon-plus"></i>
+              <i slot="default" class="el-icon-plus" />
               <div slot="file" slot-scope="{file}">
-                <img v-if="file.picture"
-                     class="el-upload-list__item-thumbnail"
-                     :src="file.url" alt="">
+                <img
+                  v-if="file.picture"
+                  class="el-upload-list__item-thumbnail"
+                  :src="file.url"
+                  alt=""
+                >
                 <div v-else>
-                  <img class="el-upload-list__item-thumbnail wordIcon"
-                       :src="wordImg" alt="">
-                  <div>{{file.name}}</div>
+                  <img
+                    class="el-upload-list__item-thumbnail wordIcon"
+                    :src="wordImg"
+                    alt=""
+                  >
+                  <div>{{ file.name }}</div>
                 </div>
                 <span class="el-upload-list__item-actions">
                   <!--<span-->
-                    <!--class="el-upload-list__item-preview"-->
-                    <!--@click="handlePictureCardPreview(file)"-->
+                  <!--class="el-upload-list__item-preview"-->
+                  <!--@click="handlePictureCardPreview(file)"-->
                   <!--&gt;-->
-                    <!--<i class="el-icon-zoom-in"></i>-->
+                  <!--<i class="el-icon-zoom-in"></i>-->
                   <!--</span>-->
                   <span
                     v-if="!disabled"
                     class="el-upload-list__item-delete"
                     @click="handleDownload(file)"
                   >
-                    <i class="el-icon-download"></i>
+                    <i class="el-icon-download" />
                   </span>
                   <span
                     v-if="!disabled"
                     class="el-upload-list__item-delete"
                     @click="handleRemove(file)"
                   >
-                    <i class="el-icon-delete"></i>
+                    <i class="el-icon-delete" />
                   </span>
                 </span>
               </div>
@@ -303,9 +309,11 @@
           <img v-if="picture" width="100%" :src="dialogImageUrl" alt="图片加载失败">
           <div v-else>文件请下载查看详情</div>
           <div>
-            <el-button type="primary" @click="handleDownload(dialogImageUrl)"
-                       icon="el-icon-download"
-                       style="text-align: center; margin-top: 30px;"
+            <el-button
+              type="primary"
+              icon="el-icon-download"
+              style="text-align: center; margin-top: 30px;"
+              @click="handleDownload(dialogImageUrl)"
             >下载附件</el-button>
           </div>
         </el-dialog>
@@ -315,36 +323,36 @@
 </template>
 
 <script>
-import { listPatent, getPatent, delPatent, addPatent, updatePatent, exportPatent } from "@/api/system/patent";
-import { listPersonnel,listPersonnelsss} from "@/api/system/personnel";
-import { listDirection} from "@/api/system/direction";
-import { listFile ,delFile} from "@/api/system/file";
-import { getToken } from "@/utils/auth";
+import { listPatent, getPatent, delPatent, addPatent, updatePatent, exportPatent } from '@/api/system/patent'
+import { listPersonnel, listPersonnelsss } from '@/api/system/personnel'
+import { listDirection } from '@/api/system/direction'
+import { listFile, delFile } from '@/api/system/file'
+import { getToken } from '@/utils/auth'
 
 export default {
-  name: "Patent",
+  name: 'Patent',
   components: {
   },
   data() {
     return {
-      listId:"",
+      listId: '',
       // 遮罩层
       loading: true,
       // 导出遮罩层
       exportLoading: false,
       // 选中数组
       ids: [],
-      //类别字典
+      // 类别字典
       type: [],
-      asdasd:[],
-      //获奖人
-      person:[],
+      asdasd: [],
+      // 获奖人
+      person: [],
       personnelList: [],
-      personlevel:[],
+      personlevel: [],
 
-      //等级字典
+      // 等级字典
       level: [],
-      //方向字典
+      // 方向字典
       direction: [],
       // 非单个禁用
       single: true,
@@ -352,16 +360,16 @@ export default {
       multiple: true,
       // 显示搜索条件
       showSearch: true,
-      //临时id
-      filesssssid:null,
+      // 临时id
+      filesssssid: null,
       // 总条数
       total: 0,
       // 获奖情况表格数据
       patentList: [],
       // 弹出层标题
-      title: "",
-      //附件列表
-      loadList:[],
+      title: '',
+      // 附件列表
+      loadList: [],
       // 是否显示弹出层
       open: false,
 
@@ -374,7 +382,7 @@ export default {
         resulnumber: null,
         name: null,
         direction: null,
-        userId: null,
+        userId: null
       },
 
       // 文件查询参数
@@ -384,57 +392,57 @@ export default {
         fileName: null,
         fliePath: null,
         moduleName: null,
-        moduleId: null,
+        moduleId: null
       },
       // 表单参数
       form: {},
       // 表单校验
       rules: {
         delFlag: [
-          { required: true, message: "删除标识不能为空", trigger: "blur" }
+          { required: true, message: '删除标识不能为空', trigger: 'blur' }
         ],
         createTime: [
-          { required: true, message: "创建时间不能为空", trigger: "blur" }
+          { required: true, message: '创建时间不能为空', trigger: 'blur' }
         ],
         createBy: [
-          { required: true, message: "创建人不能为空", trigger: "blur" }
-        ],
+          { required: true, message: '创建人不能为空', trigger: 'blur' }
+        ]
       },
-      //上传附件弹出层
-      upLoadBox:false,
-      //上传附件
+      // 上传附件弹出层
+      upLoadBox: false,
+      // 上传附件
       dialogImageUrl: '',
       dialogVisible: false,
       disabled: false,
-      //判断是否为图片
-      picture:true,
-      uploadImgUrl: process.env.VUE_APP_BASE_API + "/common/upload/patent", // 上传的图片服务器地址
+      // 判断是否为图片
+      picture: true,
+      uploadImgUrl: process.env.VUE_APP_BASE_API + '/common/upload/patent', // 上传的图片服务器地址
       headers: {
-        Authorization: "Bearer " + getToken(),
-      },
-    };
+        Authorization: 'Bearer ' + getToken()
+      }
+    }
   },
   created() {
-    this.getList();
-    this.getPerson();
-    this.getFangxiang();
-    this.getDicts("jiang_type").then(response => {
-      this.type = response.data;
-    });
-    this.getDicts("jiang_level").then(response => {
-      this.level = response.data;
-    });
+    this.getList()
+    this.getPerson()
+    this.getFangxiang()
+    this.getDicts('jiang_type').then(response => {
+      this.type = response.data
+    })
+    this.getDicts('jiang_level').then(response => {
+      this.level = response.data
+    })
   },
   methods: {
-    asdzxc(e){
+    asdzxc(e) {
       console.log(e)
       // this.asdasd[e]?this.asdasd[e]=false:this.asdasd[e]=true
-      if(this.asdasd[e]){
-        this.asdasd[e]=false;
-        this.personlevel[e] = ""
-      }else{
-        this.asdasd[e]=true;
-        this.personlevel[e] = ""
+      if (this.asdasd[e]) {
+        this.asdasd[e] = false
+        this.personlevel[e] = ''
+      } else {
+        this.asdasd[e] = true
+        this.personlevel[e] = ''
       }
       console.log(this.asdasd)
 
@@ -442,33 +450,33 @@ export default {
     },
     /** 查询获奖情况列表 */
     getList() {
-      this.loading = true;
+      this.loading = true
       listPatent(this.queryParams).then(response => {
-        this.patentList = response.rows;
-        this.total = response.total;
-        this.loading = false;
-      });
+        this.patentList = response.rows
+        this.total = response.total
+        this.loading = false
+      })
     },
     getPerson() {
-      this.loading = true;
+      this.loading = true
       listPersonnelsss(this.queryParams).then(response => {
-        this.personnelList = response.rows;//所有人元列表
-        console.log(this.personnelList,222222222)
+        this.personnelList = response.rows// 所有人元列表
+        console.log(this.personnelList, 222222222)
 
-        for(let i in response.rows){
-          this.personlevel.push("") //创建跟所有人元列表同等数量的人员排序
-          this.asdasd.push(true)//创建跟所有人元列表同等数量的输入框禁用属性
+        for (const i in response.rows) {
+          this.personlevel.push('') // 创建跟所有人元列表同等数量的人员排序
+          this.asdasd.push(true)// 创建跟所有人元列表同等数量的输入框禁用属性
         }
-        console.log(this.personlevel,this.asdasd)
+        console.log(this.personlevel, this.asdasd)
         // this.asdasd = Object.assign([], this.asdasd);
         // console.log(this.asdasd,111111111111)
         // this.total = response.total;
-        this.loading = false;
-      });
+        this.loading = false
+      })
     },
-    //上传成功组件
-    handleAvatarSuccess(){
-      this.getModuleList(this.filesssssid);
+    // 上传成功组件
+    handleAvatarSuccess() {
+      this.getModuleList(this.filesssssid)
     },
     // handleCheckedCitiesChange(value) {
     //   var a = this.persons.length/this.form.usernum*100;
@@ -477,42 +485,41 @@ export default {
     //   // console.log(this.persons,this.personnelList)
     // },
     getFangxiang() {
-      this.loading = true;
+      this.loading = true
       listDirection(this.queryParams).then(response => {
-        this.direction = response.rows;
+        this.direction = response.rows
         // this.total = response.total;
-        this.loading = false;
-      });
+        this.loading = false
+      })
     },
 
-
-/** 查询模块文件列表 */
+    /** 查询模块文件列表 */
     getModuleList(id) {
-      this.loading = true;
-      this.queryParamsFile.moduleName="jcc_scientific_output_patent";
-      this.queryParamsFile.moduleId=id;
+      this.loading = true
+      this.queryParamsFile.moduleName = 'jcc_scientific_output_patent'
+      this.queryParamsFile.moduleId = id
       listFile(this.queryParamsFile).then(response => {
-        console.log(response.rows);
-        this.loadList = response.rows;
+        console.log(response.rows)
+        this.loadList = response.rows
         // this.total = response.total;
-        this.loading = false;
-      });
+        this.loading = false
+      })
     },
 
     // 类别字典翻译
     typeFormat(row, column) {
-      return this.selectDictLabel(this.type, row.type);
+      return this.selectDictLabel(this.type, row.type)
     },
     levelFormat(row, column) {
-      return this.selectDictLabel(this.level, row.level);
+      return this.selectDictLabel(this.level, row.level)
     },
     directionFormat(row, column) {
-      return this.selectDictLabel(this.direction, row.direction);
+      return this.selectDictLabel(this.direction, row.direction)
     },
     // 取消按钮
     cancel() {
-      this.open = false;
-      this.reset();
+      this.open = false
+      this.reset()
     },
     // 表单重置
     reset() {
@@ -527,59 +534,59 @@ export default {
         createBy: null,
         updateTime: null,
         updateBy: null
-      };
-      this.resetForm("form");
+      }
+      this.resetForm('form')
     },
     /** 搜索按钮操作 */
     handleQuery() {
-      this.queryParams.pageNum = 1;
-      this.getList();
+      this.queryParams.pageNum = 1
+      this.getList()
     },
     /** 重置按钮操作 */
     resetQuery() {
-      this.resetForm("queryForm");
-      this.handleQuery();
+      this.resetForm('queryForm')
+      this.handleQuery()
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
       this.ids = selection.map(item => item.id)
-      this.single = selection.length!==1
+      this.single = selection.length !== 1
       this.multiple = !selection.length
     },
     /** 新增按钮操作 */
     handleAdd() {
-    for(let i in this.asdasd){
-      this.asdasd[i] = true
-      this.personlevel[i] =''
-    }
-      this.reset();
-      this.person=[];
-      this.open = true;
-      this.title = "添加获奖情况";
+      for (const i in this.asdasd) {
+        this.asdasd[i] = true
+        this.personlevel[i] = ''
+      }
+      this.reset()
+      this.person = []
+      this.open = true
+      this.title = '添加获奖情况'
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
-      this.person=[];
-      row.person.map((item)=>{
-        this.personnelList.map((ite)=>{
-          if(item.userId == ite.id){
-            ite.level = ""
+      this.person = []
+      row.person.map((item) => {
+        this.personnelList.map((ite) => {
+          if (item.userId == ite.id) {
+            ite.level = ''
             ite.level = item.level
           }
         })
         this.person.push(item.userId)
         // console.log(item.userId+"22222222222222");
-      });
-      console.log(this.personnelList,44444)
-      if(this.person.length == 0){
+      })
+      console.log(this.personnelList, 44444)
+      if (this.person.length == 0) {
         return
-      }else{
-        this.person.map((it)=>{  //循环person的id
-          this.personnelList.map((ite,index)=>{  //循环所有人员的列表 循环元素和下角标
-            //如果pserson的id == psersonslist中id
+      } else {
+        this.person.map((it) => { // 循环person的id
+          this.personnelList.map((ite, index) => { // 循环所有人员的列表 循环元素和下角标
+            // 如果pserson的id == psersonslist中id
             // 那么相对应asdasd位置的禁用属性变成启用
-            //那么相对应的personlevel位置的排序号是personnelList相对应的排序号
-            if(it == ite.id){
+            // 那么相对应的personlevel位置的排序号是personnelList相对应的排序号
+            if (it == ite.id) {
               this.asdasd[index] = false
               this.personlevel[index] = ite.level
             }
@@ -588,156 +595,156 @@ export default {
       }
 
       console.log(this.asdasd)
-      this.reset();
-      const id = row.id || this.ids;
+      this.reset()
+      const id = row.id || this.ids
       getPatent(id).then(response => {
-        this.form = response.data;
-        console.log(this.form);
-        this.open = true;
-        this.title = "修改获奖情况";
-      });
+        this.form = response.data
+        console.log(this.form)
+        this.open = true
+        this.title = '修改获奖情况'
+      })
     },
     /** 提交按钮 */
     submitForm() {
-      this.form.person = this.person;
-      this.form.personlevel = [];
-      this.personlevel.map((e)=>{
-        if (e.length!=''){
+      this.form.person = this.person
+      this.form.personlevel = []
+      this.personlevel.map((e) => {
+        if (e.length != '') {
           this.form.personlevel.push(e)
         }
       })
       // console.log(this.form.person);
       // console.log(this.form.personlevel);
 
-      this.$refs["form"].validate(valid => {
+      this.$refs['form'].validate(valid => {
         if (valid) {
           console.log(this.personslevel)
 
           if (this.form.id != null) {
             updatePatent(this.form).then(response => {
-              this.msgSuccess("修改成功");
-              this.open = false;
-              this.getList();
-            });
+              this.msgSuccess('修改成功')
+              this.open = false
+              this.getList()
+            })
           } else {
             addPatent(this.form).then(response => {
-              this.msgSuccess("新增成功");
-              this.open = false;
-              this.getList();
-            });
+              this.msgSuccess('新增成功')
+              this.open = false
+              this.getList()
+            })
           }
         }
-      });
+      })
     },
     /** 删除按钮操作 */
     handleDelete(row) {
-      const ids = row.id || this.ids;
-      this.$confirm('是否确认删除获奖情况编号为"' + ids + '"的数据项?', "警告", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        }).then(function() {
-          return delPatent(ids);
-        }).then(() => {
-          this.getList();
-          this.msgSuccess("删除成功");
-        }).catch(() => {});
+      const ids = row.id || this.ids
+      this.$confirm('是否确认删除获奖情况编号为"' + ids + '"的数据项?', '警告', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(function() {
+        return delPatent(ids)
+      }).then(() => {
+        this.getList()
+        this.msgSuccess('删除成功')
+      }).catch(() => {})
     },
     /** 导出按钮操作 */
     handleExport() {
-      const queryParams = this.queryParams;
-      this.$confirm('是否确认导出所有获奖情况数据项?', "警告", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        }).then(() => {
-          this.exportLoading = true;
-          return exportPatent(queryParams);
-        }).then(response => {
-          this.download(response.msg);
-          this.exportLoading = false;
-        }).catch(() => {});
+      const queryParams = this.queryParams
+      this.$confirm('是否确认导出所有获奖情况数据项?', '警告', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        this.exportLoading = true
+        return exportPatent(queryParams)
+      }).then(response => {
+        this.download(response.msg)
+        this.exportLoading = false
+      }).catch(() => {})
     },
-    //上传附件按钮
-    handleUpload(row){
-      this.moduleId= row.id;
-
-      this.filesssssid= row.id;
-      this.uploadImgUrl=process.env.VUE_APP_BASE_API + "/common/upload/patent?listId="+row.id,
-      this.reset();
-      this.getModuleList(row.id);
-      this.upLoadBox = true;
-      this.title = "上传附件";
+    // 上传附件按钮
+    handleUpload(row) {
+      this.moduleId = row.id
+
+      this.filesssssid = row.id
+      this.uploadImgUrl = process.env.VUE_APP_BASE_API + '/common/upload/patent?listId=' + row.id,
+      this.reset()
+      this.getModuleList(row.id)
+      this.upLoadBox = true
+      this.title = '上传附件'
     },
-    //上传附件取消按钮
-    uploadCancel(){
-      this.upLoadBox = false;
-      this.reset();
+    // 上传附件取消按钮
+    uploadCancel() {
+      this.upLoadBox = false
+      this.reset()
     },
-    //删除附件
+    // 删除附件
     handleRemove(file) {
-      console.log(file);
-      let name = file.name
-      let fileId = file.id;
-      this.handleDeleteModule(fileId);
-      console.log(this.loadList);
+      console.log(file)
+      const name = file.name
+      const fileId = file.id
+      this.handleDeleteModule(fileId)
+      console.log(this.loadList)
       this.$confirm('是否删除该附件?', '提示', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
         type: 'warning'
       }).then(() => {
-        for (let i=0;i<this.loadList.length;i++){
-          if(name==this.loadList[i].name){
-            console.log(i);
-            this.loadList.splice(i,1)
+        for (let i = 0; i < this.loadList.length; i++) {
+          if (name == this.loadList[i].name) {
+            console.log(i)
+            this.loadList.splice(i, 1)
           }
         }
         this.$message({
           type: 'success',
           message: '删除成功!'
-        });
+        })
       }).catch(() => {
         this.$message({
           type: 'info',
           message: '已取消删除'
-        });
-      });
+        })
+      })
     },
     handleDeleteModule(id) {
       delFile(id)
     },
-    //展示附件
+    // 展示附件
     handlePictureCardPreview(file) {
-      this.dialogImageUrl = file.url;
-      if(file.picture==true){
-        this.picture=true
-      }else{
-        this.picture=false
+      this.dialogImageUrl = file.url
+      if (file.picture == true) {
+        this.picture = true
+      } else {
+        this.picture = false
       }
-      this.dialogVisible = true;
+      this.dialogVisible = true
     },
-    //下载附件
+    // 下载附件
     handleDownload(file) {
-      window.location.href = file.url;
+      window.location.href = file.url
     },
-    //上传时判断上传的是图片还是文件
-    handleChange(file, fileList){
-      console.log(file);
-      fileList.forEach((value , index) => {
-        let url = fileList[index].name;
-        let imgStr = /\.(jpg|jpeg|png|bmp|BMP|JPG|PNG|JPEG)$/;
-        if (!imgStr.test(url)){
-          console.log('文件');
+    // 上传时判断上传的是图片还是文件
+    handleChange(file, fileList) {
+      console.log(file)
+      fileList.forEach((value, index) => {
+        const url = fileList[index].name
+        const imgStr = /\.(jpg|jpeg|png|bmp|BMP|JPG|PNG|JPEG)$/
+        if (!imgStr.test(url)) {
+          console.log('文件')
           value['picture'] = false
-        }else {
-          console.log('图片');
+        } else {
+          console.log('图片')
           value['picture'] = true
         }
       })
-      this.loadList=fileList
+      this.loadList = fileList
     }
-  },
-};
+  }
+}
 </script>
 
 <style scoped lang="scss">

+ 44 - 46
java代码/ruoyi-ui/vue.config.js

@@ -11,15 +11,15 @@ const name = defaultSettings.title || '若依管理系统' // 标题
 const port = process.env.port || process.env.npm_config_port || 80 // 端口
 
 // vue.config.js 配置说明
-//官方vue.config.js 参考文档 https://cli.vuejs.org/zh/config/#css-loaderoptions
+// 官方vue.config.js 参考文档 https://cli.vuejs.org/zh/config/#css-loaderoptions
 // 这里只列一部分,具体配置参考文档
 module.exports = {
   // 部署生产环境和开发环境下的URL。
   // 默认情况下,Vue CLI 会假设你的应用是被部署在一个域名的根路径上
   // 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。
-  publicPath: process.env.NODE_ENV === "production" ? "/" : "/",
+  publicPath: `/${process.env.VUE_APP_ROUTER}/`,
   // 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)(默认dist)
-  outputDir: 'dist',
+  outputDir: process.env.VUE_APP_ROUTER,
   // 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下)
   assetsDir: 'static',
   // 是否开启eslint保存检测,有效值:ture | false | 'error'
@@ -35,10 +35,10 @@ module.exports = {
       // detail: https://cli.vuejs.org/config/#devserver-proxy
       [process.env.VUE_APP_BASE_API]: {
         target: `http://localhost:8112`,
-        changeOrigin: true,
-        pathRewrite: {
-          ['^' + process.env.VUE_APP_BASE_API]: ''
-        }
+        changeOrigin: true
+        // pathRewrite: {
+        //   ['^' + process.env.VUE_APP_BASE_API]: ''
+        // }
       }
     },
     disableHostCheck: true
@@ -72,47 +72,45 @@ module.exports = {
       })
       .end()
 
-    config
-      .when(process.env.NODE_ENV !== 'development',
-        config => {
-          config
-            .plugin('ScriptExtHtmlWebpackPlugin')
-            .after('html')
-            .use('script-ext-html-webpack-plugin', [{
-            // `runtime` must same as runtimeChunk name. default is `runtime`
-              inline: /runtime\..*\.js$/
-            }])
-            .end()
-          config
-            .optimization.splitChunks({
-              chunks: 'all',
-              cacheGroups: {
-                libs: {
-                  name: 'chunk-libs',
-                  test: /[\\/]node_modules[\\/]/,
-                  priority: 10,
-                  chunks: 'initial' // only package third parties that are initially dependent
-                },
-                elementUI: {
-                  name: 'chunk-elementUI', // split elementUI into a single package
-                  priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app
-                  test: /[\\/]node_modules[\\/]_?element-ui(.*)/ // in order to adapt to cnpm
-                },
-                commons: {
-                  name: 'chunk-commons',
-                  test: resolve('src/components'), // can customize your rules
-                  minChunks: 3, //  minimum common number
-                  priority: 5,
-                  reuseExistingChunk: true
-                }
-              }
-            })
-          config.optimization.runtimeChunk('single'),
+    config.when(process.env.NODE_ENV !== 'development', config => {
+      config
+        .plugin('ScriptExtHtmlWebpackPlugin')
+        .after('html')
+        .use('script-ext-html-webpack-plugin', [
           {
-             from: path.resolve(__dirname, './public/robots.txt'), //防爬虫文件
-             to: './', //到根目录下
+            // `runtime` must same as runtimeChunk name. default is `runtime`
+            inline: /runtime\..*\.js$/
+          }
+        ])
+        .end()
+      config.optimization.splitChunks({
+        chunks: 'all',
+        cacheGroups: {
+          libs: {
+            name: 'chunk-libs',
+            test: /[\\/]node_modules[\\/]/,
+            priority: 10,
+            chunks: 'initial' // only package third parties that are initially dependent
+          },
+          elementUI: {
+            name: 'chunk-elementUI', // split elementUI into a single package
+            priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app
+            test: /[\\/]node_modules[\\/]_?element-ui(.*)/ // in order to adapt to cnpm
+          },
+          commons: {
+            name: 'chunk-commons',
+            test: resolve('src/components'), // can customize your rules
+            minChunks: 3, //  minimum common number
+            priority: 5,
+            reuseExistingChunk: true
           }
         }
-      )
+      })
+      config.optimization.runtimeChunk('single'),
+      {
+        from: path.resolve(__dirname, './public/robots.txt'), // 防爬虫文件
+        to: './' // 到根目录下
+      }
+    })
   }
 }