修复问题
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { ref } from "vue"
|
||||
|
||||
/**
|
||||
* 该hook传入一个远程数据储存默认值,以及请求远程数据的函数
|
||||
* 该hook传入一个远程数据储存默认值以及请求服务器的异步函数,以及请求远程数据的函数
|
||||
*/
|
||||
const useFetchData = (defaultValue = {}, fetDataFunc) => {
|
||||
const loadingData = ref(defaultValue) // 远程请求的数据
|
||||
|
||||
@@ -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({
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
},
|
||||
// 切换用户设备
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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" />
|
||||
|
||||
Reference in New Issue
Block a user