RuoYi 4 місяців тому
батько
коміт
837ecf26bf

+ 2 - 2
src/components/FileUpload/index.vue

@@ -29,11 +29,11 @@
     <!-- 文件列表 -->
     <transition-group ref="uploadFileList" class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear" tag="ul">
       <li :key="file.uid" class="el-upload-list__item ele-upload-list__item-content" v-for="(file, index) in fileList">
-        <el-link :href="`${baseUrl}${file.url}`" :underline="false" target="_blank">
+        <el-link :href="`${baseUrl}${file.url}`" underline="never" target="_blank">
           <span class="el-icon-document"> {{ getFileName(file.name) }} </span>
         </el-link>
         <div class="ele-upload-list__item-content-action">
-          <el-link :underline="false" @click="handleDelete(index)" type="danger" v-if="!disabled">&nbsp;删除</el-link>
+          <el-link underline="never" @click="handleDelete(index)" type="danger" v-if="!disabled">&nbsp;删除</el-link>
         </div>
       </li>
     </transition-group>

+ 1 - 1
src/components/Screenfull/index.vue

@@ -7,7 +7,7 @@
 <script setup>
 import { useFullscreen } from '@vueuse/core'
 
-const { isFullscreen, enter, exit, toggle } = useFullscreen()
+const { isFullscreen, toggle } = useFullscreen()
 </script>
 
 <style lang='scss' scoped>

+ 0 - 2
src/components/SizeSelect/index.vue

@@ -20,8 +20,6 @@ import useAppStore from "@/store/modules/app"
 
 const appStore = useAppStore()
 const size = computed(() => appStore.size)
-const route = useRoute()
-const router = useRouter()
 const { proxy } = getCurrentInstance()
 const sizeOptions = ref([
   { label: "较大", value: "large" },

+ 0 - 1
src/layout/index.vue

@@ -22,7 +22,6 @@ import useSettingsStore from '@/store/modules/settings'
 
 const settingsStore = useSettingsStore()
 const theme = computed(() => settingsStore.theme)
-const sideTheme = computed(() => settingsStore.sideTheme)
 const sidebar = computed(() => useAppStore().sidebar)
 const device = computed(() => useAppStore().device)
 const needTagsView = computed(() => settingsStore.tagsView)

+ 1 - 1
src/store/index.js

@@ -1,3 +1,3 @@
 const store = createPinia()
 
-export default store
+export default store

+ 8 - 8
src/utils/index.js

@@ -5,13 +5,13 @@ import { parseTime } from './ruoyi'
  */
 export function formatDate(cellValue) {
   if (cellValue == null || cellValue == "") return ""
-  var date = new Date(cellValue) 
-  var year = date.getFullYear()
-  var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1
-  var day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate() 
-  var hours = date.getHours() < 10 ? '0' + date.getHours() : date.getHours() 
-  var minutes = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes() 
-  var seconds = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds()
+  const date = new Date(cellValue) 
+  const year = date.getFullYear()
+  const month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1
+  const day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate() 
+  const hours = date.getHours() < 10 ? '0' + date.getHours() : date.getHours() 
+  const minutes = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes() 
+  const seconds = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds()
   return year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds
 }
 
@@ -84,7 +84,7 @@ export function getQueryObject(url) {
 export function byteLength(str) {
   // returns the byte length of an utf8 string
   let s = str.length
-  for (var i = str.length - 1; i >= 0; i--) {
+  for (let i = str.length - 1; i >= 0; i--) {
     const code = str.charCodeAt(i)
     if (code > 0x7f && code <= 0x7ff) s++
     else if (code > 0x7ff && code <= 0xffff) s += 2

+ 19 - 19
src/utils/ruoyi.js

@@ -71,7 +71,7 @@ export function selectDictLabel(datas, value) {
   if (value === undefined) {
     return ""
   }
-  var actions = []
+  const actions = []
   Object.keys(datas).some((key) => {
     if (datas[key].value == ('' + value)) {
       actions.push(datas[key].label)
@@ -92,11 +92,11 @@ export function selectDictLabels(datas, value, separator) {
   if (Array.isArray(value)) {
     value = value.join(",")
   }
-  var actions = []
-  var currentSeparator = undefined === separator ? "," : separator
-  var temp = value.split(currentSeparator)
+  const actions = []
+  const currentSeparator = undefined === separator ? "," : separator
+  const temp = value.split(currentSeparator)
   Object.keys(value.split(currentSeparator)).some((val) => {
-    var match = false
+    let match = false
     Object.keys(datas).some((key) => {
       if (datas[key].value == ('' + temp[val])) {
         actions.push(datas[key].label + currentSeparator)
@@ -112,9 +112,9 @@ export function selectDictLabels(datas, value, separator) {
 
 // 字符串格式化(%s )
 export function sprintf(str) {
-  var args = arguments, flag = true, i = 1
+  let flag = true, i = 1
   str = str.replace(/%s/g, function () {
-    var arg = args[i++]
+    const arg = args[i++]
     if (typeof arg === 'undefined') {
       flag = false
       return ''
@@ -134,7 +134,7 @@ export function parseStrEmpty(str) {
 
 // 数据合并
 export function mergeRecursive(source, target) {
-  for (var p in target) {
+  for (const p in target) {
     try {
       if (target[p].constructor == Object) {
         source[p] = mergeRecursive(source[p], target[p])
@@ -156,25 +156,25 @@ export function mergeRecursive(source, target) {
  * @param {*} children 孩子节点字段 默认 'children'
  */
 export function handleTree(data, id, parentId, children) {
-  let config = {
+  const config = {
     id: id || 'id',
     parentId: parentId || 'parentId',
     childrenList: children || 'children'
   }
 
-  var childrenListMap = {}
-  var tree = []
-  for (let d of data) {
-    let id = d[config.id]
+  const childrenListMap = {}
+  const tree = []
+  for (const d of data) {
+    const id = d[config.id]
     childrenListMap[id] = d
     if (!d[config.childrenList]) {
       d[config.childrenList] = []
     }
   }
 
-  for (let d of data) {
-    let parentId = d[config.parentId]
-    let parentObj = childrenListMap[parentId]
+  for (const d of data) {
+    const parentId = d[config.parentId]
+    const parentObj = childrenListMap[parentId]
     if (!parentObj) {
       tree.push(d)
     } else {
@@ -192,13 +192,13 @@ export function tansParams(params) {
   let result = ''
   for (const propName of Object.keys(params)) {
     const value = params[propName]
-    var part = encodeURIComponent(propName) + "="
+    const part = encodeURIComponent(propName) + "="
     if (value !== null && value !== "" && typeof (value) !== "undefined") {
       if (typeof value === 'object') {
         for (const key of Object.keys(value)) {
           if (value[key] !== null && value[key] !== "" && typeof (value[key]) !== 'undefined') {
-            let params = propName + '[' + key + ']'
-            var subPart = encodeURIComponent(params) + "="
+            const params = propName + '[' + key + ']'
+            const subPart = encodeURIComponent(params) + "="
             result += subPart + encodeURIComponent(value[key]) + "&"
           }
         }

+ 3 - 3
src/utils/scroll-to.js

@@ -8,7 +8,7 @@ Math.easeInOutQuad = function(t, b, c, d) {
 }
 
 // requestAnimationFrame for Smart Animating http://goo.gl/sx5sts
-var requestAnimFrame = (function() {
+const requestAnimFrame = (function() {
   return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function(callback) { window.setTimeout(callback, 1000 / 60) }
 })()
 
@@ -37,11 +37,11 @@ export function scrollTo(to, duration, callback) {
   const increment = 20
   let currentTime = 0
   duration = (typeof (duration) === 'undefined') ? 500 : duration
-  var animateScroll = function() {
+  const animateScroll = function() {
     // increment the time
     currentTime += increment
     // find the value with the quadratic in-out easing function
-    var val = Math.easeInOutQuad(currentTime, start, change, duration)
+    const val = Math.easeInOutQuad(currentTime, start, change, duration)
     // move the document.body
     move(val)
     // do the animation unless its over

+ 30 - 30
src/utils/theme.js

@@ -1,49 +1,49 @@
 // 处理主题样式
 export function handleThemeStyle(theme) {
-	document.documentElement.style.setProperty('--el-color-primary', theme)
-	for (let i = 1; i <= 9; i++) {
-		document.documentElement.style.setProperty(`--el-color-primary-light-${i}`, `${getLightColor(theme, i / 10)}`)
-	}
-	for (let i = 1; i <= 9; i++) {
-		document.documentElement.style.setProperty(`--el-color-primary-dark-${i}`, `${getDarkColor(theme, i / 10)}`)
-	}
+  document.documentElement.style.setProperty('--el-color-primary', theme)
+  for (let i = 1; i <= 9; i++) {
+    document.documentElement.style.setProperty(`--el-color-primary-light-${i}`, `${getLightColor(theme, i / 10)}`)
+  }
+  for (let i = 1; i <= 9; i++) {
+    document.documentElement.style.setProperty(`--el-color-primary-dark-${i}`, `${getDarkColor(theme, i / 10)}`)
+  }
 }
 
 // hex颜色转rgb颜色
 export function hexToRgb(str) {
-	str = str.replace('#', '')
-	let hexs = str.match(/../g)
-	for (let i = 0; i < 3; i++) {
-		hexs[i] = parseInt(hexs[i], 16)
-	}
-	return hexs
+  str = str.replace('#', '')
+  let hexs = str.match(/../g)
+  for (let i = 0; i < 3; i++) {
+    hexs[i] = parseInt(hexs[i], 16)
+  }
+  return hexs
 }
 
 // rgb颜色转Hex颜色
 export function rgbToHex(r, g, b) {
-	let hexs = [r.toString(16), g.toString(16), b.toString(16)]
-	for (let i = 0; i < 3; i++) {
-		if (hexs[i].length == 1) {
-			hexs[i] = `0${hexs[i]}`
-		}
-	}
-	return `#${hexs.join('')}`
+  let hexs = [r.toString(16), g.toString(16), b.toString(16)]
+  for (let i = 0; i < 3; i++) {
+    if (hexs[i].length == 1) {
+      hexs[i] = `0${hexs[i]}`
+    }
+  }
+  return `#${hexs.join('')}`
 }
 
 // 变浅颜色值
 export function getLightColor(color, level) {
-	let rgb = hexToRgb(color)
-	for (let i = 0; i < 3; i++) {
-		rgb[i] = Math.floor((255 - rgb[i]) * level + rgb[i])
-	}
-	return rgbToHex(rgb[0], rgb[1], rgb[2])
+  let rgb = hexToRgb(color)
+  for (let i = 0; i < 3; i++) {
+    rgb[i] = Math.floor((255 - rgb[i]) * level + rgb[i])
+  }
+  return rgbToHex(rgb[0], rgb[1], rgb[2])
 }
 
 // 变深颜色值
 export function getDarkColor(color, level) {
-	let rgb = hexToRgb(color)
-	for (let i = 0; i < 3; i++) {
-		rgb[i] = Math.floor(rgb[i] * (1 - level))
-	}
-	return rgbToHex(rgb[0], rgb[1], rgb[2])
+  let rgb = hexToRgb(color)
+  for (let i = 0; i < 3; i++) {
+    rgb[i] = Math.floor(rgb[i] * (1 - level))
+  }
+  return rgbToHex(rgb[0], rgb[1], rgb[2])
 }

+ 4 - 4
src/views/monitor/job/index.vue

@@ -352,8 +352,8 @@ function reset() {
     jobGroup: undefined,
     invokeTarget: undefined,
     cronExpression: undefined,
-    misfirePolicy: 1,
-    concurrent: 1,
+    misfirePolicy: '1',
+    concurrent: '1',
     status: "0"
   }
   proxy.resetForm("jobRef")
@@ -412,8 +412,8 @@ function handleRun(row) {
   proxy.$modal.confirm('确认要立即执行一次"' + row.jobName + '"任务吗?').then(function () {
     return runJob(row.jobId, row.jobGroup)
   }).then(() => {
-    proxy.$modal.msgSuccess("执行成功")})
-  .catch(() => {})
+    proxy.$modal.msgSuccess("执行成功")
+  }).catch(() => {})
 }
 
 /** 任务详细信息 */

+ 2 - 2
src/views/monitor/online/index.vue

@@ -97,8 +97,8 @@ function resetQuery() {
 
 /** 强退按钮操作 */
 function handleForceLogout(row) {
-    proxy.$modal.confirm('是否确认强退名称为"' + row.userName + '"的用户?').then(function () {
-  return forceLogout(row.tokenId)
+  proxy.$modal.confirm('是否确认强退名称为"' + row.userName + '"的用户?').then(function () {
+    return forceLogout(row.tokenId)
   }).then(() => {
     getList()
     proxy.$modal.msgSuccess("删除成功")

+ 2 - 2
src/views/system/post/index.vue

@@ -249,13 +249,13 @@ function submitForm() {
   proxy.$refs["postRef"].validate(valid => {
     if (valid) {
       if (form.value.postId != undefined) {
-        updatePost(form.value).then(response => {
+        updatePost(form.value).then(() => {
           proxy.$modal.msgSuccess("修改成功")
           open.value = false
           getList()
         })
       } else {
-        addPost(form.value).then(response => {
+        addPost(form.value).then(() => {
           proxy.$modal.msgSuccess("新增成功")
           open.value = false
           getList()

+ 1 - 1
src/views/system/role/authUser.vue

@@ -164,7 +164,7 @@ function cancelAuthUser(row) {
 }
 
 /** 批量取消授权按钮操作 */
-function cancelAuthUserAll(row) {
+function cancelAuthUserAll() {
   const roleId = queryParams.roleId
   const uIds = userIds.value.join(",")
   proxy.$modal.confirm("是否取消选中用户授权数据项?").then(function () {

+ 3 - 3
src/views/system/role/index.vue

@@ -512,14 +512,14 @@ function submitForm() {
     if (valid) {
       if (form.value.roleId != undefined) {
         form.value.menuIds = getMenuAllCheckedKeys()
-        updateRole(form.value).then(response => {
+        updateRole(form.value).then(() => {
           proxy.$modal.msgSuccess("修改成功")
           open.value = false
           getList()
         })
       } else {
         form.value.menuIds = getMenuAllCheckedKeys()
-        addRole(form.value).then(response => {
+        addRole(form.value).then(() => {
           proxy.$modal.msgSuccess("新增成功")
           open.value = false
           getList()
@@ -566,7 +566,7 @@ function handleDataScope(row) {
 function submitDataScope() {
   if (form.value.roleId != undefined) {
     form.value.deptIds = getDeptAllCheckedKeys()
-    dataScope(form.value).then(response => {
+    dataScope(form.value).then(() => {
       proxy.$modal.msgSuccess("修改成功")
       openDataScope.value = false
       getList()

+ 1 - 1
src/views/system/user/authRole.vue

@@ -95,7 +95,7 @@ function close() {
 function submitForm() {
   const userId = form.value.userId
   const rIds = roleIds.value.join(",")
-  updateAuthRole({ userId: userId, roleIds: rIds }).then(response => {
+  updateAuthRole({ userId: userId, roleIds: rIds }).then(() => {
     proxy.$modal.msgSuccess("授权成功")
     close()
   })

+ 5 - 5
src/views/system/user/index.vue

@@ -199,7 +199,7 @@
               <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据
             </div>
             <span>仅允许导入xls、xlsx格式文件。</span>
-            <el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline" @click="importTemplate">下载模板</el-link>
+            <el-link type="primary" underline="never" style="font-size: 12px; vertical-align: baseline" @click="importTemplate">下载模板</el-link>
           </div>
         </template>
       </el-upload>
@@ -415,7 +415,7 @@ function handleResetPwd(row) {
       }
     },
   }).then(({ value }) => {
-    resetUserPwd(row.userId, value).then(response => {
+    resetUserPwd(row.userId, value).then(() => {
       proxy.$modal.msgSuccess("修改成功,新密码是:" + value)
     })
   }).catch(() => {})
@@ -524,7 +524,7 @@ function handleUpdate(row) {
     form.value.roleIds = response.roleIds
     open.value = true
     title.value = "修改用户"
-    form.password = ""
+    form.value.password = ""
   })
 }
 
@@ -533,13 +533,13 @@ function submitForm() {
   proxy.$refs["userRef"].validate(valid => {
     if (valid) {
       if (form.value.userId != undefined) {
-        updateUser(form.value).then(response => {
+        updateUser(form.value).then(() => {
           proxy.$modal.msgSuccess("修改成功")
           open.value = false
           getList()
         })
       } else {
-        addUser(form.value).then(response => {
+        addUser(form.value).then(() => {
           proxy.$modal.msgSuccess("新增成功")
           open.value = false
           getList()

+ 1 - 1
src/views/system/user/profile/resetPwd.vue

@@ -45,7 +45,7 @@ const rules = ref({
 function submit() {
   proxy.$refs.pwdRef.validate(valid => {
     if (valid) {
-      updateUserPwd(user.oldPassword, user.newPassword).then(response => {
+      updateUserPwd(user.oldPassword, user.newPassword).then(() => {
         proxy.$modal.msgSuccess("修改成功")
       })
     }

+ 1 - 1
src/views/system/user/profile/userInfo.vue

@@ -44,7 +44,7 @@ const rules = ref({
 function submit() {
   proxy.$refs.userRef.validate(valid => {
     if (valid) {
-      updateUserProfile(form.value).then(response => {
+      updateUserProfile(form.value).then(() => {
         proxy.$modal.msgSuccess("修改成功")
         props.user.phonenumber = form.value.phonenumber
         props.user.email = form.value.email

+ 8 - 8
vite/plugins/auto-import.js

@@ -1,12 +1,12 @@
 import autoImport from 'unplugin-auto-import/vite'
 
 export default function createAutoImport() {
-    return autoImport({
-        imports: [
-            'vue',
-            'vue-router',
-            'pinia'
-        ],
-        dts: false
-    })
+  return autoImport({
+    imports: [
+      'vue',
+      'vue-router',
+      'pinia'
+    ],
+    dts: false
+  })
 }

+ 23 - 23
vite/plugins/compression.js

@@ -1,28 +1,28 @@
 import compression from 'vite-plugin-compression'
 
 export default function createCompression(env) {
-    const { VITE_BUILD_COMPRESS } = env
-    const plugin = []
-    if (VITE_BUILD_COMPRESS) {
-        const compressList = VITE_BUILD_COMPRESS.split(',')
-        if (compressList.includes('gzip')) {
-            // http://doc.ruoyi.vip/ruoyi-vue/other/faq.html#使用gzip解压缩静态文件
-            plugin.push(
-                compression({
-                    ext: '.gz',
-                    deleteOriginFile: false
-                })
-            )
-        }
-        if (compressList.includes('brotli')) {
-            plugin.push(
-                compression({
-                    ext: '.br',
-                    algorithm: 'brotliCompress',
-                    deleteOriginFile: false
-                })
-            )
-        }
+  const { VITE_BUILD_COMPRESS } = env
+  const plugin = []
+  if (VITE_BUILD_COMPRESS) {
+    const compressList = VITE_BUILD_COMPRESS.split(',')
+    if (compressList.includes('gzip')) {
+      // http://doc.ruoyi.vip/ruoyi-vue/other/faq.html#使用gzip解压缩静态文件
+      plugin.push(
+        compression({
+          ext: '.gz',
+          deleteOriginFile: false
+        })
+      )
     }
-    return plugin
+    if (compressList.includes('brotli')) {
+      plugin.push(
+        compression({
+          ext: '.br',
+          algorithm: 'brotliCompress',
+          deleteOriginFile: false
+        })
+      )
+    }
+  }
+  return plugin
 }

+ 6 - 6
vite/plugins/index.js

@@ -6,10 +6,10 @@ import createCompression from './compression'
 import createSetupExtend from './setup-extend'
 
 export default function createVitePlugins(viteEnv, isBuild = false) {
-    const vitePlugins = [vue()]
-    vitePlugins.push(createAutoImport())
-	vitePlugins.push(createSetupExtend())
-    vitePlugins.push(createSvgIcon(isBuild))
-	isBuild && vitePlugins.push(...createCompression(viteEnv))
-    return vitePlugins
+  const vitePlugins = [vue()]
+  vitePlugins.push(createAutoImport())
+  vitePlugins.push(createSetupExtend())
+  vitePlugins.push(createSvgIcon(isBuild))
+  isBuild && vitePlugins.push(...createCompression(viteEnv))
+  return vitePlugins
 }

+ 1 - 1
vite/plugins/setup-extend.js

@@ -1,5 +1,5 @@
 import setupExtend from 'unplugin-vue-setup-extend-plus/vite'
 
 export default function createSetupExtend() {
-    return setupExtend({})
+  return setupExtend({})
 }

+ 5 - 5
vite/plugins/svg-icon.js

@@ -2,9 +2,9 @@ import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'
 import path from 'path'
 
 export default function createSvgIcon(isBuild) {
-    return createSvgIconsPlugin({
-		iconDirs: [path.resolve(process.cwd(), 'src/assets/icons/svg')],
-        symbolId: 'icon-[dir]-[name]',
-        svgoOptions: isBuild
-    })
+  return createSvgIconsPlugin({
+    iconDirs: [path.resolve(process.cwd(), 'src/assets/icons/svg')],
+    symbolId: 'icon-[dir]-[name]',
+    svgoOptions: isBuild
+  })
 }