create-jnrs-template-vue 1.2.1 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/create.mjs +3 -3
- package/jnrs-template-vue/auto-imports.d.ts +4 -0
- package/jnrs-template-vue/components.d.ts +0 -1
- package/jnrs-template-vue/package.json +2 -2
- package/jnrs-template-vue/public/system/menu.json +1 -1
- package/jnrs-template-vue/src/api/demos/index.ts +13 -12
- package/jnrs-template-vue/src/assets/styles/animation.scss +0 -0
- package/jnrs-template-vue/src/assets/styles/common.scss +4 -0
- package/jnrs-template-vue/src/assets/styles/fonts.scss +4 -1
- package/jnrs-template-vue/src/assets/styles/{main.scss → index.scss} +1 -0
- package/jnrs-template-vue/src/assets/styles/init.scss +4 -13
- package/jnrs-template-vue/src/assets/styles/root.scss +0 -3
- package/jnrs-template-vue/src/components/common/{JnDictTag.vue → DictTag.vue} +1 -1
- package/jnrs-template-vue/src/components/{base → common}/PdfView.vue +2 -2
- package/jnrs-template-vue/src/components/select/SelectManager.vue +20 -0
- package/jnrs-template-vue/src/composables/common/usePagination.ts +4 -4
- package/jnrs-template-vue/src/composables/common/useTable.ts +4 -4
- package/jnrs-template-vue/src/composables/tools/useMouseSelection.ts +150 -0
- package/jnrs-template-vue/src/layout/SideMenu.vue +1 -0
- package/jnrs-template-vue/src/layout/TopHeader.vue +1 -1
- package/jnrs-template-vue/src/locales/en.ts +1 -1
- package/jnrs-template-vue/src/main.ts +1 -1
- package/jnrs-template-vue/src/types/index.ts +45 -3
- package/jnrs-template-vue/src/views/demos/crud/index.vue +98 -35
- package/jnrs-template-vue/src/views/demos/unitTest/RequestPage.vue +1 -1
- package/jnrs-template-vue/src/views/login/index.vue +7 -2
- package/jnrs-template-vue/src/views/system/dict/index.vue +2 -2
- package/jnrs-template-vue/src/views/system/menu/index.vue +2 -2
- package/jnrs-template-vue/tsconfig.json +1 -9
- package/jnrs-template-vue/vite.config.ts +1 -2
- package/jnrs-template-vue/viteMockServe/file.ts +2 -3
- package/jnrs-template-vue/viteMockServe/json/tableRes.json +384 -342
- package/package.json +1 -1
- package/jnrs-template-vue/src/assets/images/fileIcon/iconArchive.png +0 -0
- package/jnrs-template-vue/src/assets/images/fileIcon/iconAudio.png +0 -0
- package/jnrs-template-vue/src/assets/images/fileIcon/iconCode.png +0 -0
- package/jnrs-template-vue/src/assets/images/fileIcon/iconExcel.png +0 -0
- package/jnrs-template-vue/src/assets/images/fileIcon/iconFile.png +0 -0
- package/jnrs-template-vue/src/assets/images/fileIcon/iconFlash.png +0 -0
- package/jnrs-template-vue/src/assets/images/fileIcon/iconGif.png +0 -0
- package/jnrs-template-vue/src/assets/images/fileIcon/iconImage.png +0 -0
- package/jnrs-template-vue/src/assets/images/fileIcon/iconMac.png +0 -0
- package/jnrs-template-vue/src/assets/images/fileIcon/iconOfd.png +0 -0
- package/jnrs-template-vue/src/assets/images/fileIcon/iconPdf.png +0 -0
- package/jnrs-template-vue/src/assets/images/fileIcon/iconPpt.png +0 -0
- package/jnrs-template-vue/src/assets/images/fileIcon/iconText.png +0 -0
- package/jnrs-template-vue/src/assets/images/fileIcon/iconUnknown.png +0 -0
- package/jnrs-template-vue/src/assets/images/fileIcon/iconVideo.png +0 -0
- package/jnrs-template-vue/src/assets/images/fileIcon/iconWindows.png +0 -0
- package/jnrs-template-vue/src/assets/images/fileIcon/iconWord.png +0 -0
- package/jnrs-template-vue/src/assets/images/fileIcon/iconWps.png +0 -0
- package/jnrs-template-vue/src/components/base/JnFileUpload.vue +0 -433
- package/jnrs-template-vue/src/components/common/JnDatetime.vue +0 -37
- package/jnrs-template-vue/src/components/common/JnEdit.vue +0 -68
- package/jnrs-template-vue/src/components/common/JnPagination.vue +0 -83
- package/jnrs-template-vue/src/components/common/JnTable.vue +0 -133
- package/jnrs-template-vue/src/composables/tools/useReactivityTableHeight.ts +0 -63
- /package/jnrs-template-vue/src/components/{base → common}/ImageView.vue +0 -0
- /package/jnrs-template-vue/viteMockServe/{fileSrc → file}/mock-pdf.pdf +0 -0
- /package/jnrs-template-vue/viteMockServe/{fileSrc → file}/mock-png-0.png +0 -0
- /package/jnrs-template-vue/viteMockServe/{fileSrc → file}/mock-png-1.png +0 -0
package/bin/create.mjs
CHANGED
|
@@ -38,7 +38,7 @@ function getInstallCommand(packageManager) {
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
function getRunCommand(packageManager, script) {
|
|
41
|
-
if (!packageManager || packageManager === 'skip') return `
|
|
41
|
+
if (!packageManager || packageManager === 'skip') return `pnpm ${script}` // fallback for skip
|
|
42
42
|
switch (packageManager) {
|
|
43
43
|
case 'pnpm':
|
|
44
44
|
return `pnpm ${script}`
|
|
@@ -125,7 +125,7 @@ async function main() {
|
|
|
125
125
|
|
|
126
126
|
if (!selected) process.exit(1)
|
|
127
127
|
|
|
128
|
-
let packageManager = '
|
|
128
|
+
let packageManager = 'pnpm' // 默认用于生成 dev 命令
|
|
129
129
|
if (selected !== 'skip') {
|
|
130
130
|
packageManager = selected
|
|
131
131
|
console.log(`\n📦 使用 ${packageManager} 安装依赖项中...\n`)
|
|
@@ -153,7 +153,7 @@ async function main() {
|
|
|
153
153
|
if (selected === 'skip') {
|
|
154
154
|
const fallbackPM = availablePMs[0] || 'npm'
|
|
155
155
|
const [cmd, ...args] = getInstallCommand(fallbackPM)
|
|
156
|
-
console.log(
|
|
156
|
+
console.log(`\n👉 手动安装依赖:`)
|
|
157
157
|
console.log(` ${cmd} ${args.join(' ')}`)
|
|
158
158
|
}
|
|
159
159
|
console.log(` ${devCmd}\n`)
|
|
@@ -7,7 +7,11 @@
|
|
|
7
7
|
export {}
|
|
8
8
|
declare global {
|
|
9
9
|
const ElButton: typeof import('element-plus/es').ElButton
|
|
10
|
+
const ElCheckbox: typeof import('element-plus/es').ElCheckbox
|
|
10
11
|
const ElMessage: typeof import('element-plus/es').ElMessage
|
|
11
12
|
const ElMessageBox: typeof import('element-plus/es').ElMessageBox
|
|
13
|
+
const ElOption: typeof import('element-plus/es').ElOption
|
|
12
14
|
const ElSwitch: typeof import('element-plus/es').ElSwitch
|
|
15
|
+
const ElTableColumn: typeof import('element-plus/es').ElTableColumn
|
|
16
|
+
const vLoading: typeof import('element-plus/es').ElLoadingDirective
|
|
13
17
|
}
|
|
@@ -33,7 +33,6 @@ declare module 'vue' {
|
|
|
33
33
|
ElMenu: typeof import('element-plus/es')['ElMenu']
|
|
34
34
|
ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
|
|
35
35
|
ElOption: typeof import('element-plus/es')['ElOption']
|
|
36
|
-
ElPagination: typeof import('element-plus/es')['ElPagination']
|
|
37
36
|
ElPopover: typeof import('element-plus/es')['ElPopover']
|
|
38
37
|
ElSelect: typeof import('element-plus/es')['ElSelect']
|
|
39
38
|
ElSubMenu: typeof import('element-plus/es')['ElSubMenu']
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jnrs-template-vue",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.2",
|
|
4
4
|
"description": "JNRS 信息化管理系统模板",
|
|
5
5
|
"author": "Talia-Tan",
|
|
6
6
|
"private": true,
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"@element-plus/icons-vue": "^2.3.2",
|
|
22
22
|
"@jnrs/core": "1.1.7",
|
|
23
23
|
"@jnrs/shared": "1.1.7",
|
|
24
|
-
"@jnrs/vue-core": "1.2.
|
|
24
|
+
"@jnrs/vue-core": "1.2.2",
|
|
25
25
|
"@vueuse/core": "^14.1.0",
|
|
26
26
|
"element-plus": "^2.11.9",
|
|
27
27
|
"pinia": "^3.0.4",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Pagination, PageTableData, FileContainer } from '@/types'
|
|
2
2
|
import { request } from '@jnrs/vue-core'
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -23,15 +23,10 @@ export const NoAuth = (showErrorMsg: boolean) => {
|
|
|
23
23
|
})
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
interface DetailsParams {
|
|
27
|
-
attachmentDocument: Document
|
|
28
|
-
imageDocument: Document
|
|
29
|
-
}
|
|
30
|
-
|
|
31
26
|
/**
|
|
32
27
|
* 数据详情
|
|
33
28
|
*/
|
|
34
|
-
export const DetailsApi = (): Promise<
|
|
29
|
+
export const DetailsApi = (): Promise<FileContainer> => {
|
|
35
30
|
return request({
|
|
36
31
|
url: '/details',
|
|
37
32
|
method: 'get'
|
|
@@ -41,7 +36,7 @@ export const DetailsApi = (): Promise<DetailsParams> => {
|
|
|
41
36
|
/**
|
|
42
37
|
* 项目项
|
|
43
38
|
*/
|
|
44
|
-
export interface ProjectItem {
|
|
39
|
+
export interface ProjectItem extends FileContainer {
|
|
45
40
|
id: string
|
|
46
41
|
programCode: string
|
|
47
42
|
program: string
|
|
@@ -55,8 +50,6 @@ export interface ProjectItem {
|
|
|
55
50
|
plannedFinishDate: string
|
|
56
51
|
progress: string
|
|
57
52
|
status: '进行中' | '已完成' | '未开始' | '已暂停'
|
|
58
|
-
imageDocument?: Document // 图片类附件
|
|
59
|
-
attachmentDocument?: Document // 普通文件类附件
|
|
60
53
|
}
|
|
61
54
|
|
|
62
55
|
/**
|
|
@@ -75,10 +68,17 @@ type AddProjectOmitKeys =
|
|
|
75
68
|
|
|
76
69
|
export type AddProjectItem = Omit<ProjectItem, AddProjectOmitKeys> & {
|
|
77
70
|
id?: string
|
|
71
|
+
managerId?: Record<string, unknown>
|
|
78
72
|
newAttachmentFile: []
|
|
79
73
|
newImageFiles: []
|
|
80
74
|
}
|
|
81
75
|
|
|
76
|
+
export interface ProjectQuery extends Pagination {
|
|
77
|
+
code?: string
|
|
78
|
+
projectType?: '敏捷型' | '瀑布型' | '混合型'
|
|
79
|
+
manager?: string
|
|
80
|
+
}
|
|
81
|
+
|
|
82
82
|
/**
|
|
83
83
|
* 表单新增
|
|
84
84
|
*/
|
|
@@ -93,9 +93,10 @@ export const DemosFormApi = (data: FormData) => {
|
|
|
93
93
|
/**
|
|
94
94
|
* 数据详情
|
|
95
95
|
*/
|
|
96
|
-
export const DemosTableApi = (): Promise<ProjectItem
|
|
96
|
+
export const DemosTableApi = (query: ProjectQuery): Promise<PageTableData<ProjectItem>> => {
|
|
97
97
|
return request({
|
|
98
98
|
url: '/mock/demos/table',
|
|
99
|
-
method: 'get'
|
|
99
|
+
method: 'get',
|
|
100
|
+
data: query
|
|
100
101
|
})
|
|
101
102
|
}
|
|
File without changes
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* 初始化重置样式表
|
|
3
|
+
*/
|
|
4
|
+
|
|
1
5
|
*,
|
|
2
6
|
*::before,
|
|
3
7
|
*::after {
|
|
@@ -10,19 +14,6 @@ a {
|
|
|
10
14
|
text-decoration: none;
|
|
11
15
|
}
|
|
12
16
|
|
|
13
|
-
/* 所有自动填充 input */
|
|
14
|
-
input:-webkit-autofill,
|
|
15
|
-
input:-webkit-autofill:hover,
|
|
16
|
-
input:-webkit-autofill:focus,
|
|
17
|
-
input:-webkit-autofill:active,
|
|
18
|
-
input:autofill,
|
|
19
|
-
input:-webkit-autofill-strong-password,
|
|
20
|
-
input:-webkit-autofill-strong-password-viewable,
|
|
21
|
-
input:-webkit-autofill-and-obscured {
|
|
22
|
-
-webkit-box-shadow: 0 0 0 1000px rgba(255, 0, 0, 0) inset !important;
|
|
23
|
-
background-color: rgb(255, 0, 0) !important;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
17
|
/*
|
|
27
18
|
* 禁止拖拽图片
|
|
28
19
|
* 禁止长按弹出菜单
|
|
@@ -69,7 +69,7 @@ const loadFiles = async (keys: Props['loadKeys']) => {
|
|
|
69
69
|
return { url, fileName, revoke }
|
|
70
70
|
} catch (err) {
|
|
71
71
|
console.warn(uniqueFileName, err)
|
|
72
|
-
return { url: '', fileName:
|
|
72
|
+
return { url: '', fileName: fileName || uniqueFileName, revoke: () => {} }
|
|
73
73
|
}
|
|
74
74
|
})
|
|
75
75
|
)
|
|
@@ -102,5 +102,5 @@ onBeforeUnmount(() => {
|
|
|
102
102
|
</script>
|
|
103
103
|
|
|
104
104
|
<template>
|
|
105
|
-
<
|
|
105
|
+
<JnPdfView :fileList="fileList"></JnPdfView>
|
|
106
106
|
</template>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
@Author : TanRui
|
|
3
|
+
@WeChat : Tan578853789
|
|
4
|
+
@File : SelectManager.vue
|
|
5
|
+
@Date : 2025/12/31
|
|
6
|
+
@Desc. : 选择项目经理
|
|
7
|
+
-->
|
|
8
|
+
|
|
9
|
+
<script setup lang="ts">
|
|
10
|
+
import { DemosTableApi } from '@/api/demos/index'
|
|
11
|
+
import { JnSelectTemplate } from '@jnrs/vue-core/components'
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<JnSelectTemplate tableName="项目经理" :keyValue="{ label: 'manager', value: 'managerId' }" :listApi="DemosTableApi">
|
|
16
|
+
<template #table>
|
|
17
|
+
<el-table-column prop="manager" label="项目经理" align="center" sortable />
|
|
18
|
+
</template>
|
|
19
|
+
</JnSelectTemplate>
|
|
20
|
+
</template>
|
|
@@ -11,24 +11,24 @@ import { ref, computed } from 'vue'
|
|
|
11
11
|
export function useTable<T>(initialData: T[] = []) {
|
|
12
12
|
const data = ref<T[]>(initialData)
|
|
13
13
|
const pageSize = ref(10)
|
|
14
|
-
const
|
|
14
|
+
const pageNo = ref(1)
|
|
15
15
|
|
|
16
16
|
// 分页数据
|
|
17
17
|
const paginatedData = computed(() => {
|
|
18
|
-
const start = (
|
|
18
|
+
const start = (pageNo.value - 1) * pageSize.value
|
|
19
19
|
return data.value?.slice(start, start + pageSize.value)
|
|
20
20
|
})
|
|
21
21
|
|
|
22
22
|
// 设置新的数据
|
|
23
23
|
const setNewData = (newData: T[]) => {
|
|
24
24
|
data.value = newData
|
|
25
|
-
|
|
25
|
+
pageNo.value = 1
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
return {
|
|
29
29
|
data,
|
|
30
30
|
pageSize,
|
|
31
|
-
|
|
31
|
+
pageNo,
|
|
32
32
|
paginatedData,
|
|
33
33
|
setNewData
|
|
34
34
|
}
|
|
@@ -11,24 +11,24 @@ import { ref, computed } from 'vue'
|
|
|
11
11
|
export function useTable<T>(initialData: T[] = []) {
|
|
12
12
|
const data = ref<T[]>(initialData)
|
|
13
13
|
const pageSize = ref(10)
|
|
14
|
-
const
|
|
14
|
+
const pageNo = ref(1)
|
|
15
15
|
|
|
16
16
|
// 分页数据
|
|
17
17
|
const paginatedData = computed(() => {
|
|
18
|
-
const start = (
|
|
18
|
+
const start = (pageNo.value - 1) * pageSize.value
|
|
19
19
|
return data.value?.slice(start, start + pageSize.value)
|
|
20
20
|
})
|
|
21
21
|
|
|
22
22
|
// 设置新的数据
|
|
23
23
|
const setNewData = (newData: T[]) => {
|
|
24
24
|
data.value = newData
|
|
25
|
-
|
|
25
|
+
pageNo.value = 1
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
return {
|
|
29
29
|
data,
|
|
30
30
|
pageSize,
|
|
31
|
-
|
|
31
|
+
pageNo,
|
|
32
32
|
paginatedData,
|
|
33
33
|
setNewData
|
|
34
34
|
}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @Author : TanRui
|
|
3
|
+
* @WeChat : Tan578853789
|
|
4
|
+
* @File : useMouseSelection.ts
|
|
5
|
+
* @Date : 2025/04/14
|
|
6
|
+
* @Desc. : 鼠标框选表格进行多选、回车执行回调
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { onMounted, onUnmounted, onActivated, onDeactivated } from 'vue'
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @param {*} containerClass 表格或容器类名,默认值 el-table,如果页面存在多个表格,则必须分别传入自定义类名
|
|
13
|
+
* @param {*} rowClass 表格或容器类名,默认值 el-table__row
|
|
14
|
+
* @param {*} callback 框选后的回调,默认处理的是 input[type='checkbox'] 元素
|
|
15
|
+
* @returns handleMouseDown
|
|
16
|
+
* @example <el-table @mousedown="handleMouseDown" @selection-change="handleSelectionChange">
|
|
17
|
+
*/
|
|
18
|
+
export function useMouseSelection({
|
|
19
|
+
containerClass = 'jn_table',
|
|
20
|
+
rowClass = 'el-table__row',
|
|
21
|
+
callback = handleSelection
|
|
22
|
+
} = {}) {
|
|
23
|
+
let isDragging = false
|
|
24
|
+
let startPoint = { x: 0, y: 0 }
|
|
25
|
+
let endPoint = { x: 0, y: 0 }
|
|
26
|
+
|
|
27
|
+
onMounted(() => {
|
|
28
|
+
window.addEventListener('mouseup', handleMouseUp)
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
onUnmounted(() => {
|
|
32
|
+
window.removeEventListener('mouseup', handleMouseUp)
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
onActivated(() => {
|
|
36
|
+
window.addEventListener('mouseup', handleMouseUp)
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
onDeactivated(() => {
|
|
40
|
+
window.removeEventListener('mouseup', handleMouseUp)
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
// 鼠标按下事件
|
|
44
|
+
const handleMouseDown = (event: MouseEvent) => {
|
|
45
|
+
window.addEventListener('mousemove', handleMouseMove)
|
|
46
|
+
isDragging = false
|
|
47
|
+
startPoint = { x: event.clientX, y: event.clientY }
|
|
48
|
+
endPoint = { ...startPoint }
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// 鼠标移动事件
|
|
52
|
+
const handleMouseMove = (event: MouseEvent) => {
|
|
53
|
+
endPoint = { x: event.clientX, y: event.clientY }
|
|
54
|
+
// 判断是否为拖动
|
|
55
|
+
if (Math.abs(endPoint.x - startPoint.x) > 5 && Math.abs(endPoint.y - startPoint.y) > 25) {
|
|
56
|
+
isDragging = true
|
|
57
|
+
}
|
|
58
|
+
// 如果没有拖动,则认为是单击
|
|
59
|
+
if (isDragging) {
|
|
60
|
+
selectRows()
|
|
61
|
+
}
|
|
62
|
+
setFixedRectBoxStyle()
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// 鼠标抬起事件
|
|
66
|
+
const handleMouseUp = () => {
|
|
67
|
+
window.removeEventListener('mousemove', handleMouseMove)
|
|
68
|
+
// 如果没有拖动,则认为是单击
|
|
69
|
+
if (isDragging) {
|
|
70
|
+
isDragging = false
|
|
71
|
+
}
|
|
72
|
+
setFixedRectBoxStyle()
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// 判断选中的行
|
|
76
|
+
const selectRows = () => {
|
|
77
|
+
const container = document.querySelector(`.${containerClass}`) as HTMLElement
|
|
78
|
+
const rows = container?.querySelectorAll(`.${rowClass}`) as NodeListOf<HTMLElement>
|
|
79
|
+
if (!rows) {
|
|
80
|
+
return false
|
|
81
|
+
}
|
|
82
|
+
rows.forEach((row) => {
|
|
83
|
+
const rect = row.getBoundingClientRect()
|
|
84
|
+
const isIntersecting =
|
|
85
|
+
rect.right > Math.min(startPoint.x, endPoint.x) &&
|
|
86
|
+
rect.left < Math.max(startPoint.x, endPoint.x) &&
|
|
87
|
+
rect.bottom > Math.min(startPoint.y, endPoint.y) &&
|
|
88
|
+
rect.top < Math.max(startPoint.y, endPoint.y)
|
|
89
|
+
if (isIntersecting && callback) {
|
|
90
|
+
callback(row)
|
|
91
|
+
}
|
|
92
|
+
})
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// 设置框选框的位置
|
|
96
|
+
const setFixedRectBoxStyle = () => {
|
|
97
|
+
const selectionBox = document.querySelector('.useMouseSelection_fixedRectBox') as HTMLElement
|
|
98
|
+
if (selectionBox) {
|
|
99
|
+
const left = Math.min(startPoint.x, endPoint.x) + 'px'
|
|
100
|
+
const top = Math.min(startPoint.y, endPoint.y) + 'px'
|
|
101
|
+
const width = Math.abs(endPoint.x - startPoint.x) + 'px'
|
|
102
|
+
const height = Math.abs(endPoint.y - startPoint.y) + 'px'
|
|
103
|
+
Object.assign(selectionBox.style, {
|
|
104
|
+
display: isDragging ? 'block' : 'none',
|
|
105
|
+
left: left,
|
|
106
|
+
top: top,
|
|
107
|
+
width: width,
|
|
108
|
+
height: height
|
|
109
|
+
})
|
|
110
|
+
|
|
111
|
+
const container = document.querySelector(`.${containerClass}`) as HTMLElement
|
|
112
|
+
Object.assign(container.style, {
|
|
113
|
+
'user-select': isDragging ? 'none' : 'auto'
|
|
114
|
+
})
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
checkAndAddElement()
|
|
119
|
+
|
|
120
|
+
return {
|
|
121
|
+
handleMouseDown
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// 回调选中逻辑
|
|
126
|
+
const handleSelection = (row: HTMLElement) => {
|
|
127
|
+
const checkbox = row.querySelector("input[type='checkbox']") as HTMLInputElement
|
|
128
|
+
if (checkbox && !checkbox.checked) {
|
|
129
|
+
checkbox.click()
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// 往页面上添加框选框元素
|
|
134
|
+
const checkAndAddElement = () => {
|
|
135
|
+
const fixedRectBox = document.querySelector('.useMouseSelection_fixedRectBox')
|
|
136
|
+
if (!fixedRectBox) {
|
|
137
|
+
const newDiv = document.createElement('div')
|
|
138
|
+
newDiv.className = 'useMouseSelection_fixedRectBox'
|
|
139
|
+
Object.assign(newDiv.style, {
|
|
140
|
+
display: 'none',
|
|
141
|
+
position: 'fixed',
|
|
142
|
+
'z-index': 100,
|
|
143
|
+
border: '2px dashed #409eff',
|
|
144
|
+
'background-color': 'rgba(64, 158, 255, 0.2)',
|
|
145
|
+
'pointer-events': 'none',
|
|
146
|
+
'will-change': 'transform'
|
|
147
|
+
})
|
|
148
|
+
document.body.appendChild(newDiv)
|
|
149
|
+
}
|
|
150
|
+
}
|
|
@@ -8,7 +8,7 @@ import { useSystemStore, useAuthStore, useMenuStore } from '@jnrs/vue-core/pinia
|
|
|
8
8
|
import { LogoutApi } from '@/api/system'
|
|
9
9
|
import { getDictLabel, getDictColor } from '@/utils/packages'
|
|
10
10
|
|
|
11
|
-
import ImageView from '@/components/
|
|
11
|
+
import ImageView from '@/components/common/ImageView.vue'
|
|
12
12
|
|
|
13
13
|
const { userInfo, clearAuth } = useAuthStore()
|
|
14
14
|
const { clearMenu } = useMenuStore()
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import 'element-plus/dist/index.css'
|
|
2
2
|
import 'element-plus/theme-chalk/dark/css-vars.css'
|
|
3
3
|
import '@jnrs/shared/styles/theme.scss'
|
|
4
|
-
import '@/assets/styles/
|
|
4
|
+
import '@/assets/styles/index.scss'
|
|
5
5
|
|
|
6
6
|
import { createApp } from 'vue'
|
|
7
7
|
import { createPinia } from 'pinia'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* 文件信息
|
|
3
3
|
*/
|
|
4
4
|
export interface Attachment {
|
|
5
5
|
/**
|
|
@@ -15,7 +15,7 @@ export interface Attachment {
|
|
|
15
15
|
*/
|
|
16
16
|
fileName: string
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
18
|
+
* 文件名唯一标识(用于文件获取 API)
|
|
19
19
|
*/
|
|
20
20
|
uniqueFileName: string
|
|
21
21
|
/**
|
|
@@ -29,10 +29,52 @@ export interface Attachment {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
32
|
+
* 文件容器(用于图片或附件)
|
|
33
33
|
*/
|
|
34
34
|
export interface Document {
|
|
35
35
|
id: number
|
|
36
36
|
description: string | null
|
|
37
37
|
attachments: Attachment[]
|
|
38
38
|
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* 图片 & 附件数据
|
|
42
|
+
*/
|
|
43
|
+
export interface FileContainer {
|
|
44
|
+
/**
|
|
45
|
+
* 图片
|
|
46
|
+
*/
|
|
47
|
+
imageDocument?: Document
|
|
48
|
+
/**
|
|
49
|
+
* 附件
|
|
50
|
+
*/
|
|
51
|
+
attachmentDocument?: Document
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* 分页
|
|
56
|
+
*/
|
|
57
|
+
export interface Pagination {
|
|
58
|
+
/**
|
|
59
|
+
* 当前页码
|
|
60
|
+
*/
|
|
61
|
+
pageNo: number
|
|
62
|
+
/**
|
|
63
|
+
* 每页大小
|
|
64
|
+
*/
|
|
65
|
+
pageSize: number
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* 分页列表数据
|
|
70
|
+
*/
|
|
71
|
+
export interface PageTableData<T> extends Pagination {
|
|
72
|
+
/**
|
|
73
|
+
* 数据列表
|
|
74
|
+
*/
|
|
75
|
+
list: T[]
|
|
76
|
+
/**
|
|
77
|
+
* 数据总数
|
|
78
|
+
*/
|
|
79
|
+
count: number
|
|
80
|
+
}
|