修复问题

This commit is contained in:
2024-08-12 19:34:21 +08:00
parent aa479d22fe
commit 4575d12071
12 changed files with 139 additions and 62 deletions

View File

@@ -29,13 +29,13 @@
"vue": "^3.4.37",
"vue-clipboard3": "^2.0.0",
"vue-color-kit": "^1.0.6",
"vue-echarts": "^6.5.5",
"vue-echarts": "^6.7.3",
"vue-router": "^4.4.3",
"vuedraggable": "^2.24.3"
},
"devDependencies": {
"@types/lodash": "^4.14.195",
"@types/node": "^22.1.0",
"@types/node": "^22.2.0",
"@types/nprogress": "^0.2.3",
"@types/qs": "^6.9.15",
"@vitejs/plugin-vue": "^5.1.2",
@@ -43,8 +43,8 @@
"@vue/babel-plugin-jsx": "^1.1.1",
"autoprefixer": "^10.4.20",
"browserslist": "^4.23.0",
"caniuse-lite": "^1.0.30001591",
"eslint": "^9.8.0",
"caniuse-lite": "^1.0.30001651",
"eslint": "^9.9.0",
"eslint-plugin-vue": "^9.27.0",
"less": "^4.2.0",
"less-loader": "^12.2.0",
@@ -1013,9 +1013,9 @@
}
},
"node_modules/@eslint/js": {
"version": "9.8.0",
"resolved": "https://registry.npmmirror.com/@eslint/js/-/js-9.8.0.tgz",
"integrity": "sha512-MfluB7EUfxXtv3i/++oh89uzAr4PDI4nn201hsp+qaXqsjAWzinlZEHEfPgAX4doIlKvPG/i0A9dpKxOLII8yA==",
"version": "9.9.0",
"resolved": "https://registry.npmmirror.com/@eslint/js/-/js-9.9.0.tgz",
"integrity": "sha512-hhetes6ZHP3BlXLxmd8K2SNgkhNSi+UcecbnwWKwpP7kyi/uC75DJ1lOOBO3xrC4jyojtGE3YxKZPHfk4yrgug==",
"dev": true,
"license": "MIT",
"engines": {
@@ -1415,9 +1415,9 @@
"license": "MIT"
},
"node_modules/@types/node": {
"version": "22.1.0",
"resolved": "https://registry.npmmirror.com/@types/node/-/node-22.1.0.tgz",
"integrity": "sha512-AOmuRF0R2/5j1knA3c6G3HOk523Ga+l+ZXltX8SF1+5oqcXijjfTd8fY3XRZqSihEu9XhtQnKYLmkFaoxgsJHw==",
"version": "22.2.0",
"resolved": "https://registry.npmmirror.com/@types/node/-/node-22.2.0.tgz",
"integrity": "sha512-bm6EG6/pCpkxDf/0gDNDdtDILMOHgaQBVOJGdwsqClnxA3xL6jtMv76rLBc006RVMWbmaf0xbmom4Z/5o2nRkQ==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -2259,9 +2259,9 @@
}
},
"node_modules/caniuse-lite": {
"version": "1.0.30001649",
"resolved": "https://registry.npmmirror.com/caniuse-lite/-/caniuse-lite-1.0.30001649.tgz",
"integrity": "sha512-fJegqZZ0ZX8HOWr6rcafGr72+xcgJKI9oWfDW5DrD7ExUtgZC7a7R7ZYmZqplh7XDocFdGeIFn7roAxhOeYrPQ==",
"version": "1.0.30001651",
"resolved": "https://registry.npmmirror.com/caniuse-lite/-/caniuse-lite-1.0.30001651.tgz",
"integrity": "sha512-9Cf+Xv1jJNe1xPZLGuUXLNkE1BoDkqRqYyFJ9TDYSqhduqA4hu4oR9HluGoWYQC/aj8WHjsGVV+bwkh0+tegRg==",
"dev": true,
"funding": [
{
@@ -2689,9 +2689,9 @@
}
},
"node_modules/eslint": {
"version": "9.8.0",
"resolved": "https://registry.npmmirror.com/eslint/-/eslint-9.8.0.tgz",
"integrity": "sha512-K8qnZ/QJzT2dLKdZJVX6W4XOwBzutMYmt0lqUS+JdXgd+HTYFlonFgkJ8s44d/zMPPCnOOk0kMWCApCPhiOy9A==",
"version": "9.9.0",
"resolved": "https://registry.npmmirror.com/eslint/-/eslint-9.9.0.tgz",
"integrity": "sha512-JfiKJrbx0506OEerjK2Y1QlldtBxkAlLxT5OEcRF8uaQ86noDe2k31Vw9rnSWv+MXZHj7OOUV/dA0AhdLFcyvA==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -2699,7 +2699,7 @@
"@eslint-community/regexpp": "^4.11.0",
"@eslint/config-array": "^0.17.1",
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "9.8.0",
"@eslint/js": "9.9.0",
"@humanwhocodes/module-importer": "^1.0.1",
"@humanwhocodes/retry": "^0.3.0",
"@nodelib/fs.walk": "^1.2.8",
@@ -2738,6 +2738,14 @@
},
"funding": {
"url": "https://eslint.org/donate"
},
"peerDependencies": {
"jiti": "*"
},
"peerDependenciesMeta": {
"jiti": {
"optional": true
}
}
},
"node_modules/eslint-plugin-vue": {
@@ -3981,7 +3989,8 @@
"node_modules/monaco-editor": {
"version": "0.33.0",
"resolved": "https://registry.npmmirror.com/monaco-editor/-/monaco-editor-0.33.0.tgz",
"integrity": "sha512-VcRWPSLIUEgQJQIE0pVT8FcGBIgFoxz7jtqctE+IiCxWugD0DwgyQBcZBhdSrdMC84eumoqMZsGl2GTreOzwqw=="
"integrity": "sha512-VcRWPSLIUEgQJQIE0pVT8FcGBIgFoxz7jtqctE+IiCxWugD0DwgyQBcZBhdSrdMC84eumoqMZsGl2GTreOzwqw==",
"license": "MIT"
},
"node_modules/ms": {
"version": "2.1.2",
@@ -5345,22 +5354,27 @@
}
},
"node_modules/vue-echarts": {
"version": "6.5.5",
"resolved": "https://registry.npmmirror.com/vue-echarts/-/vue-echarts-6.5.5.tgz",
"integrity": "sha512-KJD1MSyoMQ33q8M4hM45OYeSC+t7LzesIXQOrkRSXv4xhOi0iN+6yEjQuIuqRB9zZGCT2J4bK3eQ+1ttdz4Uag==",
"version": "6.7.3",
"resolved": "https://registry.npmmirror.com/vue-echarts/-/vue-echarts-6.7.3.tgz",
"integrity": "sha512-vXLKpALFjbPphW9IfQPOVfb1KjGZ/f8qa/FZHi9lZIWzAnQC1DgnmEK3pJgEkyo6EP7UnX6Bv/V3Ke7p+qCNXA==",
"hasInstallScript": true,
"license": "MIT",
"dependencies": {
"resize-detector": "^0.3.0",
"vue-demi": "^0.13.2"
"vue-demi": "^0.13.11"
},
"peerDependencies": {
"@vue/composition-api": "^1.0.5",
"@vue/runtime-core": "^3.0.0",
"echarts": "^5.4.1",
"vue": "^2.6.12 || ^3.1.1"
},
"peerDependenciesMeta": {
"@vue/composition-api": {
"optional": true
},
"@vue/runtime-core": {
"optional": true
}
}
},

View File

@@ -32,13 +32,13 @@
"vue": "^3.4.37",
"vue-clipboard3": "^2.0.0",
"vue-color-kit": "^1.0.6",
"vue-echarts": "^6.5.5",
"vue-echarts": "^6.7.3",
"vue-router": "^4.4.3",
"vuedraggable": "^2.24.3"
},
"devDependencies": {
"@types/lodash": "^4.14.195",
"@types/node": "^22.1.0",
"@types/node": "^22.2.0",
"@types/nprogress": "^0.2.3",
"@types/qs": "^6.9.15",
"@vitejs/plugin-vue": "^5.1.2",
@@ -46,8 +46,8 @@
"@vue/babel-plugin-jsx": "^1.1.1",
"autoprefixer": "^10.4.20",
"browserslist": "^4.23.0",
"caniuse-lite": "^1.0.30001591",
"eslint": "^9.8.0",
"caniuse-lite": "^1.0.30001651",
"eslint": "^9.9.0",
"eslint-plugin-vue": "^9.27.0",
"less": "^4.2.0",
"less-loader": "^12.2.0",

View File

@@ -3,6 +3,21 @@
<router-view />
</a-config-provider>
</template>
<script setup></script>
<script setup lang="ts">
import { onUnmounted } from "vue"
import { Modal } from "@arco-design/web-vue"
const storageEvent = function (e: StorageEvent) {
if (e.key === "token") {
Modal.warning({
title: "警告消息",
content: "登录用户在其他窗口发生改变,正在刷新浏览器"
})
}
}
window.addEventListener("storage", storageEvent)
onUnmounted(() => {
window.removeEventListener("storage", storageEvent)
})
</script>
<style scoped></style>

View File

@@ -36,6 +36,7 @@ import "tinymce/plugins/searchreplace" // 查找替换
import "tinymce/plugins/table" // 表格
// import "tinymce/plugins/visualblocks" //显示元素范围
import "tinymce/plugins/visualchars" // 显示不可见字符
import { storeToRefs } from "pinia"
// import "tinymce/plugins/wordcount" // 字数统计
const appStore = useAppStore()
@@ -45,7 +46,7 @@ const props = defineProps({
height: { type: Number, default: 200 },
id: {
type: String,
default: () => "tinymce" + new Date().getTime().toString() + "-" + Math.random().toString(16).substring(2,10)
default: () => "tinymce" + new Date().getTime().toString() + "-" + Math.random().toString(16).substring(2, 10)
},
plugins: {
type: [String, Array],
@@ -73,7 +74,9 @@ let content = computed({
const list = ref([])
// 辅助函数遍历元素和子元素的style样式
/**
* 辅助函数遍历元素和子元素的style样式
*/
function cleanStyles(element) {
element.removeAttribute("style") // 移除元素自身的style属性
element.removeAttribute("class") // 移除元素自身的class属性
@@ -84,7 +87,9 @@ function cleanStyles(element) {
}
}
// 辅助函数将元素中span变为text节点
/**
* 辅助函数将元素中span变为text节点
*/
function removeUnwantedSpansAndMore(element) {
// 所有span变为字符串
const spans = element.querySelectorAll("span")
@@ -106,7 +111,9 @@ function removeUnwantedSpansAndMore(element) {
}
}
// 辅助函数:去掉注释节点
/**
* 辅助函数:去掉注释节点
*/
function removeCommentNodes(node) {
const childNodes = node.childNodes
// 遍历子节点
@@ -120,18 +127,24 @@ function removeCommentNodes(node) {
}
}
// 解构pinia中app仓库中的主题响应式数据
const { theme } = storeToRefs(appStore)
const initConfig = reactive({
menubar: false, // 菜单栏显隐
language_url: "/tinymce/i18n/zh_CN.js",
language: "zh_CN",
skin_url: "/tinymce/skins/ui/tinymce-5",
skin_url: "/tinymce/skins/ui/tinymce-5" + (theme.value === "dark" ? "-dark" : ""),
height: props.height,
toolbar_mode: "wrap",
plugins: props.plugins,
toolbar: props.toolbar,
skeletonScreen: true,
branding: false,
content_css: "/tinymce/skins/content/default/content.css",
content_css:
theme.value === "dark"
? "/tinymce/skins/content/dark/content.css"
: "/tinymce/skins/content/default/content.css",
// selector: "#textarea1", // 下面自定义样式选中的区域为编辑区
content_style: "body {line-height:1.5;font-size:14px;} p {margin:2px 0px;}", // 这里可以设置自定义样式
// paste_as_text: false, // 粘贴文字只能是纯文本
@@ -175,7 +188,9 @@ watch(
)
watch(
() => content.value,
(vl) => emit("change", vl)
(vl) => {
emit("change", vl)
}
)
</script>
<style lang="less"></style>

View File

@@ -1,7 +1,7 @@
import { ref } from "vue"
/**
* 该hook传入一个远程数据储存默认值以及请求远程数据的函数
* 该hook传入一个远程数据储存默认值以及请求服务器的异步函数,以及请求远程数据的函数
*/
const useFetchData = (defaultValue = {}, fetDataFunc) => {
const loadingData = ref(defaultValue) // 远程请求的数据

View File

@@ -22,7 +22,9 @@
<div class="center-side flex items-center justify-center font-bold text-lg">
<template v-if="title">
<a-typography-title :style="{ margin: 0, fontSize: '1.1rem', fontWeight: 'bold' }" :heading="4">
项目名称{{ $route.query.ident }}-{{ title }}
项目名称{{ $route.query.ident }}-{{ title }}- key的值为{{
route.query.key ? route.query.key : "无key值"
}}
</a-typography-title>
</template>
<Menu v-if="topMenu"></Menu>
@@ -101,14 +103,13 @@ import { useFullscreen } from "@vueuse/core"
import useUser from "@/hooks/logout"
import { Message } from "@arco-design/web-vue"
import Menu from "@/layout/components/menu.vue"
import { useRouter } from "vue-router"
import { useRouter, useRoute } from "vue-router"
const router = useRouter()
const route = useRoute()
const appStore = useAppStore()
// 切换暗黑主题
const handleChangeTheme = () => {
document.body.hasAttribute("arco-theme")
? document.body.removeAttribute("arco-theme")
: document.body.setAttribute("arco-theme", "dark")
appStore.toggleTheme()
}
// title管理-默认在后台
const props = defineProps({

View File

@@ -23,13 +23,14 @@ const useAppStore = defineStore("app", {
this.$patch(partial)
},
// 改变主题
toggleTheme(dark) {
if (dark) {
this.theme = "dark"
document.body.setAttribute("arco-theme", "dark")
} else {
toggleTheme() {
const currentTheme = document.body.getAttribute("arco-theme")
if (currentTheme === "dark") {
this.theme = "light"
document.body.setAttribute("arco-theme", "light")
} else {
this.theme = "dark"
document.body.setAttribute("arco-theme", "dark")
}
},
// 切换用户设备

View File

@@ -17,7 +17,7 @@
</template>
<script setup>
import { reactive, ref, onMounted, readonly } from "vue"
import { reactive, ref } from "vue"
import userApi from "@/api/system/user"
import user from "@/api/system/user"
import { Message } from "@arco-design/web-vue"
@@ -99,9 +99,22 @@ const crudColumns = reactive([
dataIndex: "name",
search: true,
width: 80,
commonRules: [{ required: true, message: "名称必填" }]
commonRules: [
{ required: true, message: "名称必填" },
{ maxLength: 50, message: "名称不能超过50个字符" }
]
},
{
title: "用户名",
dataIndex: "username",
search: true,
align: "center",
commonRules: [
{ required: true, message: "用户名必填" },
{ maxLength: 18, message: "用户名不能超过18个字符" },
{ minLength: 5, message: "用户名不能少于5个字符" }
]
},
{ title: "用户名", dataIndex: "username", search: true, align: "center" },
{
title: "电话",
align: "center",

View File

@@ -9,7 +9,7 @@
<a-link @click="viewDetail(record)">{{ record.title }}</a-link>
</template>
</a-table>
<a-modal v-model:visible="detailVisible" fullscreen :footer="false">
<a-modal v-model:visible="detailVisible" width="80%" draggable :footer="false">
<template #title>公告详情</template>
<a-typography :style="{ marginTop: '-30px' }">
<a-typography-title class="text-center">
@@ -55,7 +55,7 @@ getNoticeList()
</script>
<style lang="less" scoped>
.bg-color{
.bg-color {
background-color: var(--color-bg-1);
}
</style>

View File

@@ -1,5 +1,5 @@
<template>
<a-modal v-model:visible="visible" fullscreen :footer="false">
<a-modal v-model:visible="visible" width="auto" draggable :footer="false">
<template #title>维护数据字典 {{ currentRow.name }}</template>
<!-- crud组件 -->
<div class="lg:w-full w-full lg:mt-0">
@@ -29,7 +29,7 @@
</template>
<script setup>
import { ref, nextTick } from "vue"
import { ref } from "vue"
import dictApi from "@/api/system/dict"
import { Message } from "@arco-design/web-vue"
@@ -40,9 +40,8 @@ const currentRow = ref({ id: undefined, name: undefined })
// 改变dictItem的sort字段
const changeSort = async (value, id) => {
const response = await dictApi.numberOperation({ id, numberName: "sort", numberValue: value })
if (response.success) {
Message.success(response.message)
}
response.success && Message.success(response.message)
crudRef.value.refresh()
}
// 改变dictItem状态
const changeStatus = async (status, id) => {
@@ -84,7 +83,7 @@ const open = (row) => {
columnService.get("source").setAttr("editDisplay", false)
}
}
// crudOptions
// crud选项
const crudOptions = ref({
autoRequest: false,
api: dictApi.getDictItemAll,

View File

@@ -27,7 +27,7 @@
</ma-crud>
</div>
<data-list ref="datalist"></data-list>
<data-list ref="datalistRef"></data-list>
</div>
</template>
@@ -38,11 +38,11 @@ import { Message } from "@arco-design/web-vue"
import DataList from "./dataList.vue"
const crudRef = ref()
const datalist = ref()
const datalistRef = ref()
// 打开datalist页面
const openDictList = async (row) => {
datalist.value.open(row)
datalistRef.value.open(row)
}
// 点击切换status

View File

@@ -23,7 +23,14 @@
{ maxLength: 30, message: '用户名不能超过30个字符' }
]"
>
<a-input v-model="form.username" class="w-full" size="large" placeholder="用户名" allow-clear :max-length="30">
<a-input
v-model="form.username"
class="w-full"
size="large"
placeholder="用户名"
allow-clear
:max-length="30"
>
<template #prefix><icon-user /></template>
</a-input>
</a-form-item>
@@ -36,7 +43,13 @@
{ maxLength: 30, message: '密码不超过30字符' }
]"
>
<a-input-password v-model="form.password" placeholder="请输入密码" size="large" allow-clear :max-length="30">
<a-input-password
v-model="form.password"
placeholder="请输入密码"
size="large"
allow-clear
:max-length="30"
>
<template #prefix><icon-lock /></template>
</a-input-password>
</a-form-item>
@@ -52,7 +65,13 @@
}
]"
>
<a-input v-model="form.code" placeholder="请输入验证码" size="large" allow-clear :max-length="4">
<a-input
v-model="form.code"
placeholder="请输入验证码"
size="large"
allow-clear
:max-length="4"
>
<template #prefix><icon-safe /></template>
<template #append>
<verify-code ref="Verify" />