diff --git a/src/components/XTable/src/XTable.vue b/src/components/XTable/src/XTable.vue index 34f91ce0f6476fd203329a16884e976003f2d645..e5c503ec66db89fb8e4145aa63a264264d0cdf72 100644 --- a/src/components/XTable/src/XTable.vue +++ b/src/components/XTable/src/XTable.vue @@ -12,7 +12,7 @@ import { useAppStore } from '@/store/modules/app' import { useDesign } from '@/hooks/web/useDesign' import { XTableProps } from './type' import { isBoolean, isFunction } from '@/utils/is' - +import styleCss from './style/dark.scss' import download from '@/utils/download' const { t } = useI18n() @@ -25,15 +25,38 @@ const prefixCls = getPrefixCls('x-vxe-table') const attrs = useAttrs() const emit = defineEmits(['register']) - +const removeStyles = () => { + var filename = 'cssTheme' + //移除引入的文件名 + var targetelement = 'style' + var targetattr = 'id' + var allsuspects = document.getElementsByTagName(targetelement) + for (var i = allsuspects.length; i >= 0; i--) { + if ( + allsuspects[i] && + allsuspects[i].getAttribute(targetattr) != null && + allsuspects[i].getAttribute(targetattr)?.indexOf(filename) != -1 + ) { + console.log(allsuspects[i], 'node') + allsuspects[i].parentNode?.removeChild(allsuspects[i]) + } + } +} +const reImport = () => { + var head = document.getElementsByTagName('head')[0] + var style = document.createElement('style') + style.innerText = styleCss + style.id = 'cssTheme' + head.appendChild(style) +} watch( () => appStore.getIsDark, () => { if (appStore.getIsDark == true) { - import('./style/dark.scss') + reImport() } if (appStore.getIsDark == false) { - import('./style/light.scss') + removeStyles() } }, { immediate: true } diff --git a/src/views/bpm/form/formEditor.vue b/src/views/bpm/form/formEditor.vue index 52b3709dd36c4a22f2fd274a1bb34edf3261bb6b..1070739e113ef8788c2d72afa88b0c8100efb31f 100644 --- a/src/views/bpm/form/formEditor.vue +++ b/src/views/bpm/form/formEditor.vue @@ -3,9 +3,21 @@ + +
+ + +
+            {{ formValue }}
+          
+
+
+
@@ -48,13 +60,18 @@ import { DICT_TYPE, getIntDictOptions } from '@/utils/dict' import { CommonStatusEnum } from '@/utils/constants' import * as FormApi from '@/api/bpm/form' import { encodeConf, encodeFields, setConfAndFields } from '@/utils/formCreate' +import { useClipboard } from '@vueuse/core' + const { t } = useI18n() // 国际化 const message = useMessage() // 消息 const { query } = useRoute() // 路由 const designer = ref() // 表单设计器 - +const type = ref(-1) +const formValue = ref('') +const dialogTitle = ref('') const dialogVisible = ref(false) // 弹窗是否展示 +const dialogVisible1 = ref(false) // 弹窗是否展示 const dialogLoading = ref(false) // 弹窗的加载中 const formRef = ref() const formRules = reactive({ @@ -98,7 +115,32 @@ const submitForm = async () => { dialogLoading.value = false } } - +const showJson = () => { + openModel('生成JSON') + type.value = 0 + formValue.value = designer.value.getRule() +} +const showOption = () => { + openModel('生成Options') + type.value = 1 + formValue.value = designer.value.getOption() +} +const openModel = (title: string) => { + dialogVisible1.value = true + dialogTitle.value = title +} +/** 复制 **/ +const copy = async (text: string) => { + const { copy, copied, isSupported } = useClipboard({ source: text }) + if (!isSupported) { + message.error(t('common.copyError')) + } else { + await copy() + if (unref(copied)) { + message.success(t('common.copySuccess')) + } + } +} // ========== 初始化 ========== onMounted(() => { // 场景一:新增表单 diff --git a/src/views/bpm/group/group.data.ts b/src/views/bpm/group/group.data.ts index 9d30f3b25c1693fbd4b910aa20aa664f2f2e4149..613a7290f242ec3bf5e4aeef018fc9ce217e7d83 100644 --- a/src/views/bpm/group/group.data.ts +++ b/src/views/bpm/group/group.data.ts @@ -16,6 +16,7 @@ const crudSchemas = reactive({ primaryType: 'id', primaryTitle: '编号', action: true, + searchSpan: 8, columns: [ { title: '组名', diff --git a/src/views/bpm/oa/leave/leave.data.ts b/src/views/bpm/oa/leave/leave.data.ts index da113baf61092e352793e5909817a09c769c7d9e..5b6f2c527f76c3a4094b6d5610596427a64b0d3a 100644 --- a/src/views/bpm/oa/leave/leave.data.ts +++ b/src/views/bpm/oa/leave/leave.data.ts @@ -16,6 +16,7 @@ const crudSchemas = reactive({ primaryTitle: '申请编号', action: true, actionWidth: '260', + searchSpan: 8, columns: [ { title: t('common.status'), diff --git a/src/views/bpm/task/todo/todo.data.ts b/src/views/bpm/task/todo/todo.data.ts index 85c58ce936d2388d0eaa1f9c99b33cc4bb5be40b..419a80fef072e17c2324293334dad185caec2fb6 100644 --- a/src/views/bpm/task/todo/todo.data.ts +++ b/src/views/bpm/task/todo/todo.data.ts @@ -7,6 +7,7 @@ const crudSchemas = reactive({ primaryKey: 'id', primaryType: null, action: true, + searchSpan: 8, columns: [ { title: '任务编号', diff --git a/src/views/system/role/index.vue b/src/views/system/role/index.vue index b2f12af353799be55a6cd2572e0fb70be698e645..97993f5f97aa2ea577c9267bacc3b00d59b913c4 100644 --- a/src/views/system/role/index.vue +++ b/src/views/system/role/index.vue @@ -99,36 +99,41 @@ - - - - - - + + + + + + + +