diff --git a/src/components/XTable/src/XTable.vue b/src/components/XTable/src/XTable.vue index 34f91ce0..e5c503ec 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 52b3709d..1070739e 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 9d30f3b2..613a7290 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 da113baf..5b6f2c52 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 85c58ce9..419a80fe 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 b2f12af3..97993f5f 100644 --- a/src/views/system/role/index.vue +++ b/src/views/system/role/index.vue @@ -99,36 +99,41 @@ - - - - - - + + + + + + + +