mirror of
https://gitee.com/xiangheng/x_admin.git
synced 2025-10-25 00:50:28 +08:00
加入VxeTable,逐步替换shallowRef为useTemplateRef
This commit is contained in:
@@ -39,7 +39,8 @@
|
|||||||
"vue-echarts": "^7.0.3",
|
"vue-echarts": "^7.0.3",
|
||||||
"vue-router": "^4.5.1",
|
"vue-router": "^4.5.1",
|
||||||
"vue3-video-play": "^1.3.2",
|
"vue3-video-play": "^1.3.2",
|
||||||
"vuedraggable": "^4.1.0"
|
"vuedraggable": "^4.1.0",
|
||||||
|
"vxe-table": "^4.14.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@rushstack/eslint-patch": "^1.11.0",
|
"@rushstack/eslint-patch": "^1.11.0",
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ import type { IEditorConfig, IToolbarConfig } from '@wangeditor/editor'
|
|||||||
import MaterialPicker from '@/components/material/picker.vue'
|
import MaterialPicker from '@/components/material/picker.vue'
|
||||||
import { addUnit } from '@/utils/util'
|
import { addUnit } from '@/utils/util'
|
||||||
|
|
||||||
import { computed, shallowRef, ref, onBeforeUnmount } from 'vue'
|
import { computed, shallowRef, ref, onBeforeUnmount, useTemplateRef } from 'vue'
|
||||||
import type { CSSProperties } from 'vue'
|
import type { CSSProperties } from 'vue'
|
||||||
|
|
||||||
const props = withDefaults(
|
const props = withDefaults(
|
||||||
@@ -55,7 +55,7 @@ const props = withDefaults(
|
|||||||
|
|
||||||
// 编辑器实例,必须用 shallowRef
|
// 编辑器实例,必须用 shallowRef
|
||||||
const editorRef = shallowRef()
|
const editorRef = shallowRef()
|
||||||
const materialPickerRef = shallowRef<InstanceType<typeof MaterialPicker>>()
|
const materialPickerRef = useTemplateRef<InstanceType<typeof MaterialPicker>>('materialPickerRef')
|
||||||
const fileType = ref('')
|
const fileType = ref('')
|
||||||
|
|
||||||
let insertFn: any
|
let insertFn: any
|
||||||
|
|||||||
@@ -60,7 +60,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, shallowRef, watch } from 'vue'
|
import { ref, useTemplateRef, watch } from 'vue'
|
||||||
import XForm from './XForm/index.vue'
|
import XForm from './XForm/index.vue'
|
||||||
import FlowEdit from './flowEdit/index.vue'
|
import FlowEdit from './flowEdit/index.vue'
|
||||||
import BasicSetting from './BasicSetting/index.vue'
|
import BasicSetting from './BasicSetting/index.vue'
|
||||||
@@ -87,9 +87,9 @@ const props = defineProps({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
const basicSetting = shallowRef<InstanceType<typeof BasicSetting>>()
|
const basicSetting = useTemplateRef<InstanceType<typeof BasicSetting>>('basicSetting')
|
||||||
const formDesign = shallowRef<InstanceType<typeof XForm>>()
|
const formDesign = useTemplateRef<InstanceType<typeof XForm>>('formDesign')
|
||||||
const flowEdit = shallowRef<InstanceType<typeof FlowEdit>>()
|
const flowEdit = useTemplateRef<InstanceType<typeof FlowEdit>>('flowEdit')
|
||||||
const dialogVisible = ref(false)
|
const dialogVisible = ref(false)
|
||||||
const activeStep = ref('basicSetting')
|
const activeStep = ref('basicSetting')
|
||||||
const mockData = ref({
|
const mockData = ref({
|
||||||
|
|||||||
@@ -51,7 +51,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { onMounted, ref, shallowRef } from 'vue'
|
import { onMounted, ref, useTemplateRef } from 'vue'
|
||||||
import type { FormInstance } from 'element-plus'
|
import type { FormInstance } from 'element-plus'
|
||||||
import { useDictData } from '@/hooks/useDictOptions'
|
import { useDictData } from '@/hooks/useDictOptions'
|
||||||
defineOptions({
|
defineOptions({
|
||||||
@@ -86,7 +86,7 @@ onMounted(() => {
|
|||||||
Object.assign(formData.value, props.conf)
|
Object.assign(formData.value, props.conf)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const elFormRef = shallowRef<FormInstance>()
|
const elFormRef = useTemplateRef<FormInstance>('elFormRef')
|
||||||
function getData() {
|
function getData() {
|
||||||
return new Promise<{
|
return new Promise<{
|
||||||
formData: any
|
formData: any
|
||||||
|
|||||||
@@ -3,9 +3,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted } from 'vue'
|
import { onMounted, useTemplateRef } from 'vue'
|
||||||
import 'vform3-builds/dist/designer.style.css' //引入VForm3样式
|
import 'vform3-builds/dist/designer.style.css' //引入VForm3样式
|
||||||
const designerRef = ref(null)
|
const designerRef = useTemplateRef<any>('designerRef')
|
||||||
function setData(json) {
|
function setData(json) {
|
||||||
console.log('setFormJson', json)
|
console.log('setFormJson', json)
|
||||||
designerRef.value.setFormJson(json)
|
designerRef.value.setFormJson(json)
|
||||||
|
|||||||
@@ -17,13 +17,13 @@
|
|||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<el-table fit size="small" :data="props.properties.gateway" style="width: 100%">
|
<vxe-table size="small" :data="props.properties.gateway" auto-resize>
|
||||||
<el-table-column prop="label" label="表单项">
|
<vxe-column field="label" title="表单项">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
{{ getLabel(row.id) }}
|
{{ getLabel(row.id) }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</vxe-column>
|
||||||
<el-table-column label="判断方式">
|
<vxe-column title="判断方式">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-select v-model="row.condition" placeholder="请选择判断符">
|
<el-select v-model="row.condition" placeholder="请选择判断符">
|
||||||
<el-option
|
<el-option
|
||||||
@@ -34,18 +34,18 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</vxe-column>
|
||||||
<el-table-column label="值">
|
<vxe-column title="值">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-input v-model="row.value" placeholder="请输入"></el-input>
|
<el-input v-model="row.value" placeholder="请输入"></el-input>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</vxe-column>
|
||||||
<el-table-column width="50px">
|
<vxe-column width="50">
|
||||||
<template #default="{ row, $index }">
|
<template #default="{ row, rowIndex }">
|
||||||
<el-button :icon="Close" circle @click="removeCondition(row, $index)" />
|
<el-button :icon="Close" circle @click="removeCondition(row, rowIndex)" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</vxe-column>
|
||||||
</el-table>
|
</vxe-table>
|
||||||
</el-card>
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -54,7 +54,8 @@
|
|||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
// import type { PropType } from 'vue'
|
// import type { PropType } from 'vue'
|
||||||
import { Close } from '@element-plus/icons-vue'
|
import { Close } from '@element-plus/icons-vue'
|
||||||
|
// import { VxeTable, VxeColumn, VxeTableInstance } from 'vxe-table'
|
||||||
|
// import 'vxe-table/lib/style.css'
|
||||||
import type { NodeType, PropertiesType, FieldListType } from './property.type'
|
import type { NodeType, PropertiesType, FieldListType } from './property.type'
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
/>
|
/>
|
||||||
<div class="diagram-main">
|
<div class="diagram-main">
|
||||||
<diagram-sidebar class="diagram-sidebar" @dragInNode="dragInNode" />
|
<diagram-sidebar class="diagram-sidebar" @dragInNode="dragInNode" />
|
||||||
<div ref="container" class="diagram-container">
|
<div class="diagram-container">
|
||||||
<div class="diagram-wrapper">
|
<div class="diagram-wrapper">
|
||||||
<div ref="diagramRef" class="lf-diagram"></div>
|
<div ref="diagramRef" class="lf-diagram"></div>
|
||||||
</div>
|
</div>
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
// Importing necessary functions and components
|
// Importing necessary functions and components
|
||||||
import { ref, onMounted } from 'vue'
|
import { ref, onMounted, useTemplateRef } from 'vue'
|
||||||
import LogicFlow from '@logicflow/core'
|
import LogicFlow from '@logicflow/core'
|
||||||
import { SelectionSelect, Menu, BpmnElement, MiniMap } from '@logicflow/extension'
|
import { SelectionSelect, Menu, BpmnElement, MiniMap } from '@logicflow/extension'
|
||||||
import type { NodeType, PropertiesType } from './PropertyPanel/property.type'
|
import type { NodeType, PropertiesType } from './PropertyPanel/property.type'
|
||||||
@@ -59,8 +59,8 @@ const props = defineProps({
|
|||||||
// Define refs for reactive data and component references
|
// Define refs for reactive data and component references
|
||||||
const lf = ref(null) // Reference to LogicFlow instance
|
const lf = ref(null) // Reference to LogicFlow instance
|
||||||
const activeEdges = ref([]) // Reactive array for active edges
|
const activeEdges = ref([]) // Reactive array for active edges
|
||||||
const diagramRef = ref(null) // Reference to the diagram container
|
const diagramRef = useTemplateRef<HTMLInputElement>('diagramRef') // Reference to the diagram container
|
||||||
const PropertyPanelRef = ref(null) // Reference to the PropertyPanel component
|
const PropertyPanelRef = useTemplateRef<InstanceType<typeof PropertyPanel>>('PropertyPanelRef') // Reference to the PropertyPanel component
|
||||||
|
|
||||||
// Lifecycle hook to initialize LogicFlow when the component is mounted
|
// Lifecycle hook to initialize LogicFlow when the component is mounted
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|||||||
@@ -67,8 +67,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref } from 'vue'
|
import { ref, useTemplateRef } from 'vue'
|
||||||
import { computed, reactive, shallowRef } from 'vue'
|
import { computed, reactive } from 'vue'
|
||||||
|
|
||||||
import { ElInput } from 'element-plus'
|
import { ElInput } from 'element-plus'
|
||||||
import { getElementPlusIconNames, getLocalIconNames } from './index'
|
import { getElementPlusIconNames, getLocalIconNames } from './index'
|
||||||
@@ -98,7 +98,7 @@ const iconTabsMap = [
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
const inputRef = shallowRef<InstanceType<typeof ElInput>>()
|
const inputRef = useTemplateRef<InstanceType<typeof ElInput>>('inputRef')
|
||||||
|
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
inputValue: ''
|
inputValue: ''
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, shallowRef, ref, watch } from 'vue'
|
import { computed, useTemplateRef, ref, watch } from 'vue'
|
||||||
import { LinkTypeEnum, type Link } from '.'
|
import { LinkTypeEnum, type Link } from '.'
|
||||||
import LinkContent from './index.vue'
|
import LinkContent from './index.vue'
|
||||||
import Popup from '@/components/popup/index.vue'
|
import Popup from '@/components/popup/index.vue'
|
||||||
@@ -34,7 +34,7 @@ const emit = defineEmits<{
|
|||||||
(event: 'update:modelValue', value: any): void
|
(event: 'update:modelValue', value: any): void
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
const popupRef = useTemplateRef<InstanceType<typeof Popup>>('popupRef')
|
||||||
const activeLink = ref<Link>({ path: '', type: LinkTypeEnum.SHOP_PAGES })
|
const activeLink = ref<Link>({ path: '', type: LinkTypeEnum.SHOP_PAGES })
|
||||||
const handleConfirm = () => {
|
const handleConfirm = () => {
|
||||||
emit('update:modelValue', activeLink.value)
|
emit('update:modelValue', activeLink.value)
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, shallowRef, watch, nextTick } from 'vue'
|
import { ref, useTemplateRef, watch, nextTick } from 'vue'
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
modelValue: {
|
modelValue: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
@@ -33,7 +33,7 @@ const props = defineProps({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
const playerRef = shallowRef()
|
const playerRef = useTemplateRef('playerRef')
|
||||||
const visible = defineModel({
|
const visible = defineModel({
|
||||||
type: Boolean
|
type: Boolean
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, shallowRef } from 'vue'
|
import { ref, useTemplateRef } from 'vue'
|
||||||
import { useEventListener } from '@vueuse/core'
|
import { useEventListener } from '@vueuse/core'
|
||||||
import { useTooltipContentProps, type Placement } from 'element-plus'
|
import { useTooltipContentProps, type Placement } from 'element-plus'
|
||||||
import type { PropType } from 'vue'
|
import type { PropType } from 'vue'
|
||||||
@@ -33,7 +33,7 @@ const props = defineProps({
|
|||||||
default: 'ellipsis'
|
default: 'ellipsis'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const textRef = shallowRef<HTMLElement>()
|
const textRef = useTemplateRef<HTMLElement>('textRef')
|
||||||
const disabled = ref(false)
|
const disabled = ref(false)
|
||||||
|
|
||||||
useEventListener(textRef, 'mouseenter', () => {
|
useEventListener(textRef, 'mouseenter', () => {
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { computed, defineComponent, ref, toRaw, shallowRef } from 'vue'
|
import { computed, defineComponent, ref, toRaw, useTemplateRef } from 'vue'
|
||||||
import useUserStore from '@/stores/modules/user'
|
import useUserStore from '@/stores/modules/user'
|
||||||
import config from '@/config'
|
import config from '@/config'
|
||||||
import feedback from '@/utils/feedback'
|
import feedback from '@/utils/feedback'
|
||||||
@@ -83,7 +83,7 @@ export default defineComponent({
|
|||||||
emits: ['change', 'error'],
|
emits: ['change', 'error'],
|
||||||
setup(props, { emit }) {
|
setup(props, { emit }) {
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
const uploadRefs = shallowRef<InstanceType<typeof ElUpload>>()
|
const uploadRefs = useTemplateRef<InstanceType<typeof ElUpload>>('uploadRefs')
|
||||||
let action = ''
|
let action = ''
|
||||||
if (props.url && typeof props.url === 'string') {
|
if (props.url && typeof props.url === 'string') {
|
||||||
console.log('props.url', props.url)
|
console.log('props.url', props.url)
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { reactive, shallowRef } from 'vue'
|
import { reactive, useTemplateRef } from 'vue'
|
||||||
import 'vue3-video-play/dist/style.css'
|
import 'vue3-video-play/dist/style.css'
|
||||||
import { videoPlay } from 'vue3-video-play/dist/index.mjs'
|
import { videoPlay } from 'vue3-video-play/dist/index.mjs'
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@@ -26,7 +26,7 @@ const props = defineProps({
|
|||||||
poster: String
|
poster: String
|
||||||
})
|
})
|
||||||
|
|
||||||
const playerRef = shallowRef()
|
const playerRef = useTemplateRef('playerRef')
|
||||||
const options = reactive({
|
const options = reactive({
|
||||||
color: 'var(--el-color-primary)', //主题色
|
color: 'var(--el-color-primary)', //主题色
|
||||||
muted: false, //静音
|
muted: false, //静音
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ import './styles/index.scss'
|
|||||||
import 'virtual:svg-icons-register'
|
import 'virtual:svg-icons-register'
|
||||||
|
|
||||||
import ElementPlus from 'element-plus'
|
import ElementPlus from 'element-plus'
|
||||||
|
import { VxeTable, VxeColumn } from 'vxe-table'
|
||||||
|
import 'vxe-table/lib/style.css'
|
||||||
|
|
||||||
import VForm3 from 'vform3-builds' //引入VForm3库
|
import VForm3 from 'vform3-builds' //引入VForm3库
|
||||||
|
|
||||||
@@ -26,5 +28,7 @@ const app = createApp(App)
|
|||||||
app.use(install)
|
app.use(install)
|
||||||
app.use(ElementPlus)
|
app.use(ElementPlus)
|
||||||
app.use(VForm3)
|
app.use(VForm3)
|
||||||
|
app.use(VxeTable)
|
||||||
|
app.use(VxeColumn)
|
||||||
|
|
||||||
app.mount('#app')
|
app.mount('#app')
|
||||||
|
|||||||
@@ -102,7 +102,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, onMounted, reactive, shallowRef } from 'vue'
|
import { computed, onMounted, reactive, useTemplateRef } from 'vue'
|
||||||
import { useRoute, useRouter } from 'vue-router'
|
import { useRoute, useRouter } from 'vue-router'
|
||||||
import type { InputInstance, FormInstance } from 'element-plus'
|
import type { InputInstance, FormInstance } from 'element-plus'
|
||||||
import LayoutFooter from '@/layout/components/footer.vue'
|
import LayoutFooter from '@/layout/components/footer.vue'
|
||||||
@@ -116,7 +116,7 @@ import { encryptPassword } from '@/utils/util'
|
|||||||
import Verify from '@/components/verify/Verify.vue'
|
import Verify from '@/components/verify/Verify.vue'
|
||||||
import ImageContain from '@/components/image-contain/index.vue'
|
import ImageContain from '@/components/image-contain/index.vue'
|
||||||
// const verifyRef = ref(null)
|
// const verifyRef = ref(null)
|
||||||
const verifyRef = shallowRef<InstanceType<typeof Verify>>()
|
const verifyRef = useTemplateRef<InstanceType<typeof Verify>>('verifyRef')
|
||||||
const onShowCaptcha = () => {
|
const onShowCaptcha = () => {
|
||||||
verifyRef.value.show()
|
verifyRef.value.show()
|
||||||
}
|
}
|
||||||
@@ -127,8 +127,8 @@ const handleSuccess = (res) => {
|
|||||||
lockLogin(res)
|
lockLogin(res)
|
||||||
}
|
}
|
||||||
|
|
||||||
const passwordRef = shallowRef<InputInstance>()
|
const passwordRef = useTemplateRef<InputInstance>('passwordRef')
|
||||||
const formRef = shallowRef<FormInstance>()
|
const formRef = useTemplateRef<FormInstance>('formRef')
|
||||||
const appStore = useAppStore()
|
const appStore = useAppStore()
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
|||||||
@@ -26,14 +26,14 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, computed, shallowRef, reactive } from 'vue'
|
import { ref, computed, useTemplateRef, reactive } from 'vue'
|
||||||
import type { FormInstance } from 'element-plus'
|
import type { FormInstance } from 'element-plus'
|
||||||
import { articleCateEdit, articleCateAdd, articleCateDetail } from '@/api/article'
|
import { articleCateEdit, articleCateAdd, articleCateDetail } from '@/api/article'
|
||||||
import Popup from '@/components/popup/index.vue'
|
import Popup from '@/components/popup/index.vue'
|
||||||
import feedback from '@/utils/feedback'
|
import feedback from '@/utils/feedback'
|
||||||
const emit = defineEmits(['success', 'close'])
|
const emit = defineEmits(['success', 'close'])
|
||||||
const formRef = shallowRef<FormInstance>()
|
const formRef = useTemplateRef<FormInstance>('formRef')
|
||||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
const popupRef = useTemplateRef<InstanceType<typeof Popup>>('popupRef')
|
||||||
const mode = ref('add')
|
const mode = ref('add')
|
||||||
const popupTitle = computed(() => {
|
const popupTitle = computed(() => {
|
||||||
return mode.value == 'edit' ? '编辑栏目' : '新增栏目'
|
return mode.value == 'edit' ? '编辑栏目' : '新增栏目'
|
||||||
|
|||||||
@@ -66,7 +66,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, shallowRef, nextTick } from 'vue'
|
import { ref, useTemplateRef, nextTick } from 'vue'
|
||||||
import { articleCateDelete, articleCateLists, articleCateStatus } from '@/api/article'
|
import { articleCateDelete, articleCateLists, articleCateStatus } from '@/api/article'
|
||||||
import { usePaging } from '@/hooks/usePaging'
|
import { usePaging } from '@/hooks/usePaging'
|
||||||
import feedback from '@/utils/feedback'
|
import feedback from '@/utils/feedback'
|
||||||
@@ -75,7 +75,7 @@ import EditPopup from './edit.vue'
|
|||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'articleColumn'
|
name: 'articleColumn'
|
||||||
})
|
})
|
||||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
const editRef = useTemplateRef<InstanceType<typeof EditPopup>>('editRef')
|
||||||
const showEdit = ref(false)
|
const showEdit = ref(false)
|
||||||
|
|
||||||
const { pager, getLists } = usePaging({
|
const { pager, getLists } = usePaging({
|
||||||
|
|||||||
@@ -112,7 +112,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { reactive, shallowRef } from 'vue'
|
import { reactive, useTemplateRef } from 'vue'
|
||||||
import { useRoute, useRouter } from 'vue-router'
|
import { useRoute, useRouter } from 'vue-router'
|
||||||
import type { FormInstance } from 'element-plus'
|
import type { FormInstance } from 'element-plus'
|
||||||
import feedback from '@/utils/feedback'
|
import feedback from '@/utils/feedback'
|
||||||
@@ -139,7 +139,7 @@ const formData = reactive({
|
|||||||
})
|
})
|
||||||
|
|
||||||
const { removeTab } = useMultipleTabs()
|
const { removeTab } = useMultipleTabs()
|
||||||
const formRef = shallowRef<FormInstance>()
|
const formRef = useTemplateRef<FormInstance>('formRef')
|
||||||
const rules = reactive({
|
const rules = reactive({
|
||||||
title: [{ required: true, message: '请输入文章标题', trigger: 'blur' }],
|
title: [{ required: true, message: '请输入文章标题', trigger: 'blur' }],
|
||||||
cid: [{ required: true, message: '请选择文章栏目', trigger: 'blur' }]
|
cid: [{ required: true, message: '请选择文章栏目', trigger: 'blur' }]
|
||||||
|
|||||||
@@ -85,7 +85,7 @@
|
|||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { useRoute } from 'vue-router'
|
import { useRoute } from 'vue-router'
|
||||||
import { shallowRef, reactive } from 'vue'
|
import { useTemplateRef, reactive } from 'vue'
|
||||||
import type { FormInstance } from 'element-plus'
|
import type { FormInstance } from 'element-plus'
|
||||||
import { getUserDetail, userEdit } from '@/api/consumer'
|
import { getUserDetail, userEdit } from '@/api/consumer'
|
||||||
import feedback from '@/utils/feedback'
|
import feedback from '@/utils/feedback'
|
||||||
@@ -109,7 +109,7 @@ const formData = reactive({
|
|||||||
username: ''
|
username: ''
|
||||||
})
|
})
|
||||||
|
|
||||||
const formRef = shallowRef<FormInstance>()
|
const formRef = useTemplateRef<FormInstance>('formRef')
|
||||||
|
|
||||||
const getDetails = async () => {
|
const getDetails = async () => {
|
||||||
const data = await getUserDetail({
|
const data = await getUserDetail({
|
||||||
|
|||||||
@@ -8,9 +8,81 @@
|
|||||||
</template>
|
</template>
|
||||||
新增
|
新增
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button @click="handleExpand"> 展开/折叠 </el-button>
|
<el-button @click="handleExpand"> 展开/收起 </el-button>
|
||||||
</div>
|
</div>
|
||||||
<el-table
|
<div style="height: calc(100vh - 200px)">
|
||||||
|
<vxe-table
|
||||||
|
ref="tableRef"
|
||||||
|
:row-config="rowConfig"
|
||||||
|
:tree-config="treeConfig"
|
||||||
|
:data="lists"
|
||||||
|
max-height="100%"
|
||||||
|
>
|
||||||
|
<vxe-column type="seq" width="60"></vxe-column>
|
||||||
|
<vxe-column
|
||||||
|
field="menuName"
|
||||||
|
title="菜单名称"
|
||||||
|
min-width="200"
|
||||||
|
tree-node
|
||||||
|
></vxe-column>
|
||||||
|
<vxe-column field="menuType" title="类型" width="60">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<div v-if="row.menuType == MenuEnum.CATALOGUE">目录</div>
|
||||||
|
<div v-else-if="row.menuType == MenuEnum.MENU">菜单</div>
|
||||||
|
<div v-else-if="row.menuType == MenuEnum.BUTTON">按钮</div>
|
||||||
|
</template>
|
||||||
|
</vxe-column>
|
||||||
|
<vxe-column field="menuIcon" title="图标" width="60">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<div class="flex">
|
||||||
|
<icon :name="row.menuIcon" :size="20" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</vxe-column>
|
||||||
|
<vxe-column field="paths" title="路径" min-width="100"></vxe-column>
|
||||||
|
<vxe-column field="permsArr" title="权限标识" min-width="120">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<span v-if="row.perms" type="info">{{ row.perms }}</span>
|
||||||
|
</template>
|
||||||
|
</vxe-column>
|
||||||
|
<vxe-column field="isDisable" title="状态" width="80">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<el-tag v-if="row.isDisable == 0" type="primary">正常</el-tag>
|
||||||
|
<el-tag v-else type="danger">停用</el-tag>
|
||||||
|
</template>
|
||||||
|
</vxe-column>
|
||||||
|
<vxe-column field="menuSort" title="排序" width="60"></vxe-column>
|
||||||
|
<vxe-column title="操作" width="160">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<el-button
|
||||||
|
v-perms="['admin:system:menu:add']"
|
||||||
|
type="primary"
|
||||||
|
link
|
||||||
|
@click="handleAdd(row.id)"
|
||||||
|
>
|
||||||
|
新增
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
v-perms="['admin:system:menu:edit']"
|
||||||
|
type="primary"
|
||||||
|
link
|
||||||
|
@click="handleEdit(row)"
|
||||||
|
>
|
||||||
|
编辑
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
v-perms="['admin:system:menu:del']"
|
||||||
|
type="danger"
|
||||||
|
link
|
||||||
|
@click="handleDelete(row.id)"
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</vxe-column>
|
||||||
|
</vxe-table>
|
||||||
|
</div>
|
||||||
|
<!-- <el-table
|
||||||
v-loading="loading"
|
v-loading="loading"
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
class="mt-4"
|
class="mt-4"
|
||||||
@@ -84,25 +156,35 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table> -->
|
||||||
</el-card>
|
</el-card>
|
||||||
<edit-popup v-if="showEdit" ref="editRef" @success="getLists" @close="showEdit = false" />
|
<edit-popup v-if="showEdit" ref="editRef" @success="getLists" @close="showEdit = false" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, shallowRef, nextTick } from 'vue'
|
import { ref, useTemplateRef, nextTick } from 'vue'
|
||||||
import { menuDelete, menuLists } from '@/api/perms/menu'
|
import { menuDelete, menuLists } from '@/api/perms/menu'
|
||||||
import { arrayToTree } from '@/utils/util'
|
import { arrayToTree } from '@/utils/util'
|
||||||
import type { ElTable } from 'element-plus'
|
|
||||||
import { MenuEnum } from '@/enums/appEnums'
|
import { MenuEnum } from '@/enums/appEnums'
|
||||||
import EditPopup from './edit.vue'
|
import EditPopup from './edit.vue'
|
||||||
import feedback from '@/utils/feedback'
|
import feedback from '@/utils/feedback'
|
||||||
|
|
||||||
|
import { VxeTableInstance } from 'vxe-table'
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'MenuView'
|
name: 'MenuView'
|
||||||
})
|
})
|
||||||
|
const rowConfig = {
|
||||||
const tableRef = shallowRef<InstanceType<typeof ElTable>>()
|
keyField: 'id'
|
||||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
}
|
||||||
|
const treeConfig = {
|
||||||
|
rowField: 'id',
|
||||||
|
childrenField: 'children',
|
||||||
|
indent: 10,
|
||||||
|
reserve: true
|
||||||
|
}
|
||||||
|
const tableRef = useTemplateRef<VxeTableInstance<any>>('tableRef')
|
||||||
|
const editRef = useTemplateRef<InstanceType<typeof EditPopup>>('editRef')
|
||||||
let isExpand = false
|
let isExpand = false
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const showEdit = ref(false)
|
const showEdit = ref(false)
|
||||||
@@ -149,18 +231,15 @@ const handleDelete = async (id: number) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const handleExpand = () => {
|
const handleExpand = () => {
|
||||||
isExpand = !isExpand
|
const $table = tableRef.value
|
||||||
toggleExpand(lists.value, isExpand)
|
if ($table) {
|
||||||
}
|
isExpand = !isExpand
|
||||||
|
if (isExpand) {
|
||||||
const toggleExpand = (children: any[], unfold = true) => {
|
$table.setAllTreeExpand(true)
|
||||||
for (const key in children) {
|
} else {
|
||||||
tableRef.value?.toggleRowExpansion(children[key], unfold)
|
$table.clearTreeExpand()
|
||||||
if (children[key].children) {
|
|
||||||
toggleExpand(children[key].children!, unfold)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getLists()
|
getLists()
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -43,7 +43,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, shallowRef, nextTick, reactive } from 'vue'
|
import { ref, useTemplateRef, nextTick, reactive } from 'vue'
|
||||||
import type { CheckboxValueType, ElTree, FormInstance } from 'element-plus'
|
import type { CheckboxValueType, ElTree, FormInstance } from 'element-plus'
|
||||||
import { roleDetail, roleEdit } from '@/api/perms/role'
|
import { roleDetail, roleEdit } from '@/api/perms/role'
|
||||||
import { menuLists } from '@/api/perms/menu'
|
import { menuLists } from '@/api/perms/menu'
|
||||||
@@ -51,9 +51,9 @@ import Popup from '@/components/popup/index.vue'
|
|||||||
import { treeToArray, arrayToTree } from '@/utils/util'
|
import { treeToArray, arrayToTree } from '@/utils/util'
|
||||||
import feedback from '@/utils/feedback'
|
import feedback from '@/utils/feedback'
|
||||||
const emit = defineEmits(['success', 'close'])
|
const emit = defineEmits(['success', 'close'])
|
||||||
const treeRef = shallowRef<InstanceType<typeof ElTree>>()
|
const treeRef = useTemplateRef<InstanceType<typeof ElTree>>('treeRef')
|
||||||
const formRef = shallowRef<FormInstance>()
|
const formRef = useTemplateRef<FormInstance>('formRef')
|
||||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
const popupRef = useTemplateRef<InstanceType<typeof Popup>>('popupRef')
|
||||||
const isExpand = ref(false)
|
const isExpand = ref(false)
|
||||||
const checkStrictly = ref(true)
|
const checkStrictly = ref(true)
|
||||||
const menuArray = ref<any[]>([])
|
const menuArray = ref<any[]>([])
|
||||||
|
|||||||
@@ -47,14 +47,14 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, computed, shallowRef, reactive } from 'vue'
|
import { ref, computed, useTemplateRef, reactive } from 'vue'
|
||||||
import type { FormInstance } from 'element-plus'
|
import type { FormInstance } from 'element-plus'
|
||||||
import { roleAdd, roleDetail, roleEdit } from '@/api/perms/role'
|
import { roleAdd, roleDetail, roleEdit } from '@/api/perms/role'
|
||||||
import Popup from '@/components/popup/index.vue'
|
import Popup from '@/components/popup/index.vue'
|
||||||
import feedback from '@/utils/feedback'
|
import feedback from '@/utils/feedback'
|
||||||
const emit = defineEmits(['success', 'close'])
|
const emit = defineEmits(['success', 'close'])
|
||||||
const formRef = shallowRef<FormInstance>()
|
const formRef = useTemplateRef<FormInstance>('formRef')
|
||||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
const popupRef = useTemplateRef<InstanceType<typeof Popup>>('popupRef')
|
||||||
const mode = ref('add')
|
const mode = ref('add')
|
||||||
const popupTitle = computed(() => {
|
const popupTitle = computed(() => {
|
||||||
return mode.value == 'edit' ? '编辑角色' : '新增角色'
|
return mode.value == 'edit' ? '编辑角色' : '新增角色'
|
||||||
|
|||||||
@@ -72,7 +72,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, shallowRef, nextTick } from 'vue'
|
import { ref, useTemplateRef, nextTick } from 'vue'
|
||||||
import { roleLists, roleDelete } from '@/api/perms/role'
|
import { roleLists, roleDelete } from '@/api/perms/role'
|
||||||
import { usePaging } from '@/hooks/usePaging'
|
import { usePaging } from '@/hooks/usePaging'
|
||||||
import feedback from '@/utils/feedback'
|
import feedback from '@/utils/feedback'
|
||||||
@@ -82,8 +82,8 @@ defineOptions({
|
|||||||
name: 'role'
|
name: 'role'
|
||||||
})
|
})
|
||||||
|
|
||||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
const editRef = useTemplateRef<InstanceType<typeof EditPopup>>('editRef')
|
||||||
const authRef = shallowRef<InstanceType<typeof AuthPopup>>()
|
const authRef = useTemplateRef<InstanceType<typeof AuthPopup>>('authRef')
|
||||||
const showEdit = ref(false)
|
const showEdit = ref(false)
|
||||||
const showAuth = ref(false)
|
const showAuth = ref(false)
|
||||||
const { pager, getLists } = usePaging({
|
const { pager, getLists } = usePaging({
|
||||||
|
|||||||
@@ -99,7 +99,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, reactive } from 'vue'
|
import { reactive, useTemplateRef } from 'vue'
|
||||||
import type { LoginSetup } from '@/api/setting/user'
|
import type { LoginSetup } from '@/api/setting/user'
|
||||||
import { getLogin, setLogin } from '@/api/setting/user'
|
import { getLogin, setLogin } from '@/api/setting/user'
|
||||||
import feedback from '@/utils/feedback'
|
import feedback from '@/utils/feedback'
|
||||||
@@ -107,7 +107,7 @@ import type { FormInstance, FormRules } from 'element-plus'
|
|||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'loginRegister'
|
name: 'loginRegister'
|
||||||
})
|
})
|
||||||
const formRef = ref<FormInstance>()
|
const formRef = useTemplateRef<FormInstance>('formRef')
|
||||||
|
|
||||||
// 表单数据
|
// 表单数据
|
||||||
const formData = reactive<LoginSetup>({
|
const formData = reactive<LoginSetup>({
|
||||||
|
|||||||
@@ -60,12 +60,12 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, reactive } from 'vue'
|
import { useTemplateRef, reactive } from 'vue'
|
||||||
import { getWebsite, setWebsite } from '@/api/setting/website'
|
import { getWebsite, setWebsite } from '@/api/setting/website'
|
||||||
import useAppStore from '@/stores/modules/app'
|
import useAppStore from '@/stores/modules/app'
|
||||||
import feedback from '@/utils/feedback'
|
import feedback from '@/utils/feedback'
|
||||||
import type { FormInstance } from 'element-plus'
|
import type { FormInstance } from 'element-plus'
|
||||||
const formRef = ref<FormInstance>()
|
const formRef = useTemplateRef<FormInstance>('formRef')
|
||||||
const { getConfig } = useAppStore()
|
const { getConfig } = useAppStore()
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ import type { FormInstance } from 'element-plus'
|
|||||||
import { user_protocol_detail } from '@/api/user/protocol'
|
import { user_protocol_detail } from '@/api/user/protocol'
|
||||||
import Popup from '@/components/popup/index.vue'
|
import Popup from '@/components/popup/index.vue'
|
||||||
|
|
||||||
import { shallowRef, computed, reactive } from 'vue'
|
import { useTemplateRef, computed, reactive } from 'vue'
|
||||||
import type { PropType } from 'vue'
|
import type { PropType } from 'vue'
|
||||||
defineProps({
|
defineProps({
|
||||||
dictData: {
|
dictData: {
|
||||||
@@ -41,8 +41,8 @@ defineProps({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
const emit = defineEmits(['close'])
|
const emit = defineEmits(['close'])
|
||||||
const formRef = shallowRef<FormInstance>()
|
const formRef = useTemplateRef<FormInstance>('formRef')
|
||||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
const popupRef = useTemplateRef<InstanceType<typeof Popup>>('popupRef')
|
||||||
|
|
||||||
const popupTitle = computed(() => {
|
const popupTitle = computed(() => {
|
||||||
return '预览用户协议'
|
return '预览用户协议'
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, computed, shallowRef, reactive } from 'vue'
|
import { ref, computed, reactive, useTemplateRef } from 'vue'
|
||||||
import type { FormInstance } from 'element-plus'
|
import type { FormInstance } from 'element-plus'
|
||||||
import { user_protocol_edit, user_protocol_add, user_protocol_detail } from '@/api/user/protocol'
|
import { user_protocol_edit, user_protocol_add, user_protocol_detail } from '@/api/user/protocol'
|
||||||
import Popup from '@/components/popup/index.vue'
|
import Popup from '@/components/popup/index.vue'
|
||||||
@@ -41,8 +41,8 @@ defineProps({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
const emit = defineEmits(['success', 'close'])
|
const emit = defineEmits(['success', 'close'])
|
||||||
const formRef = shallowRef<FormInstance>()
|
const formRef = useTemplateRef<FormInstance>('formRef')
|
||||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
const popupRef = useTemplateRef<InstanceType<typeof Popup>>('popupRef')
|
||||||
const mode = ref('add')
|
const mode = ref('add')
|
||||||
const popupTitle = computed(() => {
|
const popupTitle = computed(() => {
|
||||||
return mode.value == 'edit' ? '编辑用户协议' : '新增用户协议'
|
return mode.value == 'edit' ? '编辑用户协议' : '新增用户协议'
|
||||||
|
|||||||
@@ -77,19 +77,23 @@
|
|||||||
批量删除
|
批量删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
<el-table
|
<vxe-table
|
||||||
|
ref="tableRef"
|
||||||
|
border
|
||||||
|
size="medium"
|
||||||
class="mt-4"
|
class="mt-4"
|
||||||
size="large"
|
|
||||||
v-loading="pager.loading"
|
|
||||||
:data="pager.lists"
|
:data="pager.lists"
|
||||||
@selection-change="handleSelectionChange"
|
:loading="pager.loading"
|
||||||
|
auto-resize
|
||||||
|
@checkbox-change="handleSelectionChange"
|
||||||
|
@checkbox-all="handleSelectionChange"
|
||||||
>
|
>
|
||||||
<el-table-column type="selection" width="55" />
|
<vxe-column type="checkbox" width="55"></vxe-column>
|
||||||
<el-table-column label="标题" prop="Title" min-width="130" />
|
<vxe-column field="Title" title="标题" min-width="130"></vxe-column>
|
||||||
<el-table-column label="排序" prop="Sort" width="60" />
|
<vxe-column field="Sort" title="排序" width="60"></vxe-column>
|
||||||
<el-table-column label="创建时间" prop="CreateTime" width="180" />
|
<vxe-column field="CreateTime" title="创建时间" width="180"></vxe-column>
|
||||||
<el-table-column label="更新时间" prop="UpdateTime" width="180" />
|
<vxe-column field="UpdateTime" title="更新时间" width="180"></vxe-column>
|
||||||
<el-table-column label="操作" width="160" fixed="right">
|
<vxe-column title="操作" width="160" fixed="right">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-button
|
<el-button
|
||||||
v-perms="['admin:user_protocol:detail']"
|
v-perms="['admin:user_protocol:detail']"
|
||||||
@@ -115,8 +119,8 @@
|
|||||||
删除
|
删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</vxe-column>
|
||||||
</el-table>
|
</vxe-table>
|
||||||
<div class="flex justify-end mt-4">
|
<div class="flex justify-end mt-4">
|
||||||
<pagination v-model="pager" @change="getLists" />
|
<pagination v-model="pager" @change="getLists" />
|
||||||
</div>
|
</div>
|
||||||
@@ -126,7 +130,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, shallowRef, reactive, nextTick } from 'vue'
|
import { ref, reactive, nextTick, useTemplateRef } from 'vue'
|
||||||
import {
|
import {
|
||||||
user_protocol_delete,
|
user_protocol_delete,
|
||||||
user_protocol_delete_batch,
|
user_protocol_delete_batch,
|
||||||
@@ -135,6 +139,7 @@ import {
|
|||||||
user_protocol_export_file
|
user_protocol_export_file
|
||||||
} from '@/api/user/protocol'
|
} from '@/api/user/protocol'
|
||||||
import type { type_user_protocol, type_user_protocol_query } from '@/api/user/protocol'
|
import type { type_user_protocol, type_user_protocol_query } from '@/api/user/protocol'
|
||||||
|
import type { VxeTableInstance } from 'vxe-table'
|
||||||
|
|
||||||
import { usePaging } from '@/hooks/usePaging'
|
import { usePaging } from '@/hooks/usePaging'
|
||||||
import feedback from '@/utils/feedback'
|
import feedback from '@/utils/feedback'
|
||||||
@@ -143,9 +148,9 @@ import DetailsPopup from './details.vue'
|
|||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'user_protocol'
|
name: 'user_protocol'
|
||||||
})
|
})
|
||||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
const editRef = useTemplateRef<InstanceType<typeof EditPopup>>('editRef')
|
||||||
const showEdit = ref(false)
|
const showEdit = ref(false)
|
||||||
const detailsRef = shallowRef<InstanceType<typeof DetailsPopup>>()
|
const detailsRef = useTemplateRef<InstanceType<typeof DetailsPopup>>('detailsRef')
|
||||||
const showDetails = ref(false)
|
const showDetails = ref(false)
|
||||||
const queryParams = reactive<type_user_protocol_query>({
|
const queryParams = reactive<type_user_protocol_query>({
|
||||||
Title: null,
|
Title: null,
|
||||||
@@ -180,10 +185,13 @@ const viewDetails = async (data: any) => {
|
|||||||
detailsRef.value?.open()
|
detailsRef.value?.open()
|
||||||
detailsRef.value?.getDetail(data)
|
detailsRef.value?.getDetail(data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const tableRef = useTemplateRef<VxeTableInstance<type_user_protocol>>('tableRef')
|
||||||
const multipleSelection = ref<type_user_protocol[]>([])
|
const multipleSelection = ref<type_user_protocol[]>([])
|
||||||
const handleSelectionChange = (val: type_user_protocol[]) => {
|
const handleSelectionChange = () => {
|
||||||
console.log(val)
|
if (tableRef.value) {
|
||||||
multipleSelection.value = val
|
multipleSelection.value = tableRef.value.getCheckboxRecords()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleDelete = async (Id: number) => {
|
const handleDelete = async (Id: number) => {
|
||||||
|
|||||||
@@ -78,7 +78,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive } from 'vue'
|
import { useTemplateRef, reactive } from 'vue'
|
||||||
import { setUserInfo } from '@/api/user'
|
import { setUserInfo } from '@/api/user'
|
||||||
import useUserStore from '@/stores/modules/user'
|
import useUserStore from '@/stores/modules/user'
|
||||||
import feedback from '@/utils/feedback'
|
import feedback from '@/utils/feedback'
|
||||||
@@ -87,7 +87,7 @@ import type { FormInstance } from 'element-plus'
|
|||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'userSetting'
|
name: 'userSetting'
|
||||||
})
|
})
|
||||||
const formRef = ref<FormInstance>()
|
const formRef = useTemplateRef<FormInstance>('formRef')
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
// 表单数据
|
// 表单数据
|
||||||
const formData = reactive({
|
const formData = reactive({
|
||||||
|
|||||||
Reference in New Issue
Block a user