This commit is contained in:
2025-12-30 13:47:53 +08:00
parent f1637501b2
commit a623c5673f
137 changed files with 11031 additions and 4043 deletions

View File

@@ -0,0 +1,231 @@
<template>
<div class="pdf-stamper">
<div class="toolbar">
<el-button size="mini" @click="prevPage" :disabled="pageNo <= 1">上一页</el-button>
<span class="page"> {{ pageNo }} / {{ pageCount }} </span>
<el-button size="mini" @click="nextPage" :disabled="pageNo >= pageCount">下一页</el-button>
<span class="split"></span>
<el-input-number size="mini" v-model="stampWidth" :min="10" :max="600" :step="5" />
<span class="wh"></span>
<el-input-number size="mini" v-model="stampHeight" :min="10" :max="600" :step="5" />
<span class="wh"></span>
<span class="hint"> PDF 上单击选择盖章位置以页面左下为原点</span>
</div>
<div class="canvas-wrap" ref="wrap" @click="onClick">
<canvas ref="canvas"></canvas>
<div
v-if="hasStamp"
class="stamp-box"
:style="stampBoxStyle"
title="盖章位置预览"
></div>
</div>
</div>
</template>
<script>
import * as pdfjsLib from 'pdfjs-dist'
// worker
import pdfjsWorker from 'pdfjs-dist/build/pdf.worker.min.js'
pdfjsLib.GlobalWorkerOptions.workerSrc = pdfjsWorker
export default {
name: 'PdfStamper',
props: {
/** PDF 的可访问 URLOSS url */
pdfUrl: {
type: String,
required: true
},
/** 初始页 */
initialPage: {
type: Number,
default: 1
}
},
data() {
return {
loading: false,
pdf: null,
pageCount: 1,
pageNo: 1,
// 渲染缩放
scale: 1,
// pdf 页面像素尺寸(渲染后)
viewportWidth: 0,
viewportHeight: 0,
// 盖章尺寸(像素,基于当前 scale 渲染像素)
stampWidth: 160,
stampHeight: 160,
// 盖章位置(以 canvas 左上为原点的像素)
stampXTopLeft: 0,
stampYTopLeft: 0,
hasStamp: false
}
},
watch: {
pdfUrl: {
immediate: true,
handler() {
this.init()
}
},
pageNo() {
this.renderPage()
},
stampWidth() {
this.emitStamp()
},
stampHeight() {
this.emitStamp()
}
},
methods: {
async init() {
if (!this.pdfUrl) return
this.loading = true
this.hasStamp = false
try {
this.pdf = await pdfjsLib.getDocument({ url: this.pdfUrl }).promise
this.pageCount = this.pdf.numPages || 1
this.pageNo = Math.min(Math.max(this.initialPage, 1), this.pageCount)
await this.$nextTick()
await this.renderPage()
} catch (e) {
console.error('PDF加载失败', e)
this.$emit('error', e)
} finally {
this.loading = false
}
},
async renderPage() {
if (!this.pdf) return
const page = await this.pdf.getPage(this.pageNo)
const wrap = this.$refs.wrap
const canvas = this.$refs.canvas
const ctx = canvas.getContext('2d')
// 自适应容器宽度
const unscaledViewport = page.getViewport({ scale: 1 })
const maxWidth = (wrap && wrap.clientWidth) ? wrap.clientWidth : 900
this.scale = maxWidth / unscaledViewport.width
const viewport = page.getViewport({ scale: this.scale })
canvas.width = viewport.width
canvas.height = viewport.height
this.viewportWidth = viewport.width
this.viewportHeight = viewport.height
// 清空
ctx.clearRect(0, 0, canvas.width, canvas.height)
await page.render({ canvasContext: ctx, viewport }).promise
// 切页后清空盖章框(避免误用上一页坐标)
this.hasStamp = false
this.emitStamp()
},
prevPage() {
if (this.pageNo > 1) this.pageNo -= 1
},
nextPage() {
if (this.pageNo < this.pageCount) this.pageNo += 1
},
onClick(e) {
const rect = this.$refs.canvas.getBoundingClientRect()
const x = e.clientX - rect.left
const y = e.clientY - rect.top
// 让点击点成为盖章框中心
this.stampXTopLeft = Math.max(0, Math.min(x - this.stampWidth / 2, this.viewportWidth - this.stampWidth))
this.stampYTopLeft = Math.max(0, Math.min(y - this.stampHeight / 2, this.viewportHeight - this.stampHeight))
this.hasStamp = true
this.emitStamp()
},
emitStamp() {
// 输出给父组件的坐标必须是 PDFBox 期望的坐标:左下为原点
// 当前 stampXTopLeft / stampYTopLeft 是左上原点
const xPx = this.stampXTopLeft
const yPx = this.viewportHeight - this.stampYTopLeft - this.stampHeight
this.$emit('change', {
pageNo: this.pageNo,
xPx: Math.round(xPx),
yPx: Math.round(yPx),
// 位置换算需要:当前渲染后的 viewport 尺寸(像素)
viewportWidth: Math.round(this.viewportWidth),
viewportHeight: Math.round(this.viewportHeight),
// 方案B后端严格用原图大小这里不再强依赖 widthPx/heightPx可留给预览
widthPx: Math.round(this.stampWidth),
heightPx: Math.round(this.stampHeight),
ready: this.hasStamp
})
}
},
computed: {
stampBoxStyle() {
return {
width: this.stampWidth + 'px',
height: this.stampHeight + 'px',
left: this.stampXTopLeft + 'px',
top: this.stampYTopLeft + 'px'
}
}
}
}
</script>
<style scoped>
.pdf-stamper {
width: 100%;
}
.toolbar {
display: flex;
align-items: center;
gap: 8px;
margin-bottom: 8px;
flex-wrap: wrap;
}
.page {
font-weight: 700;
color: #2b2f36;
}
.split {
width: 1px;
height: 16px;
background: #e6e8ed;
margin: 0 6px;
}
.wh {
font-size: 12px;
color: #606266;
}
.hint {
font-size: 12px;
color: #8a8f99;
}
.canvas-wrap {
position: relative;
border: 1px solid #e6e8ed;
border-radius: 8px;
overflow: auto;
background: #fff;
}
canvas {
display: block;
}
.stamp-box {
position: absolute;
border: 2px dashed #e6a23c;
box-sizing: border-box;
pointer-events: none;
background: rgba(230, 162, 60, 0.08);
}
</style>

View File

@@ -1,13 +1,14 @@
<template>
<el-dialog title="人员选择"
v-if="showFlag"
<el-dialog
title="人员选择(多选)"
:visible.sync="showFlag"
:modal= false
:modal="false"
width="80%"
center
append-to-body
>
<el-row :gutter="20">
<!--部门数据-->
<!-- 部门数据 -->
<el-col :span="4" :xs="24">
<div class="head-container">
<el-input
@@ -26,14 +27,23 @@
:expand-on-click-node="false"
:filter-node-method="filterNode"
ref="tree"
node-key="deptId"
default-expand-all
@node-click="handleNodeClick"
/>
</div>
</el-col>
<!--用户数据-->
<!-- 用户数据 -->
<el-col :span="20" :xs="24">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="用户名称" prop="userName">
<el-input
v-model="queryParams.userName"
@@ -57,23 +67,13 @@
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<KLPTable v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="50" align="center" />
<el-table-column label="用户编号" align="center" key="userId" prop="userId" v-if="columns[0].visible" />
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="用户名称" align="center" key="userName" prop="userName" v-if="columns[1].visible" :show-overflow-tooltip="true" />
<el-table-column label="用户昵称" align="center" key="nickName" prop="nickName" v-if="columns[2].visible" :show-overflow-tooltip="true" />
<el-table-column label="部门" align="center" key="deptName" prop="dept.deptName" v-if="columns[3].visible" :show-overflow-tooltip="true" />
<el-table-column label="手机号码" align="center" key="phonenumber" prop="phonenumber" v-if="columns[4].visible" width="120" />
<!-- <el-table-column label="状态" align="center" key="status" v-if="columns[5].visible">-->
<!-- <template slot-scope="scope">-->
<!-- <el-switch-->
<!-- v-model="scope.row.status"-->
<!-- active-value="0"-->
<!-- inactive-value="1"-->
<!-- @change="handleStatusChange(scope.row)"-->
<!-- ></el-switch>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="创建时间" align="center" prop="createTime" v-if="columns[6].visible" width="160">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
@@ -82,7 +82,7 @@
</KLPTable>
<pagination
v-show="total>0"
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@@ -90,64 +90,40 @@
/>
</el-col>
</el-row>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="confirmSelect"> </el-button>
<el-button @click="showFlag=false"> </el-button>
<el-button @click="showFlag = false"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { listUser, getUser, delUser, addUser, updateUser, resetUserPwd, changeUserStatus } from "@/api/system/user";
import { getToken } from "@/utils/auth";
import { treeselect } from "@/api/system/dept";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import { listUser } from '@/api/system/user'
import { listDept } from '@/api/system/dept'
export default {
name: "UserMultiSelect",
dicts: ['sys_normal_disable', 'sys_user_sex'],
components: { Treeselect },
name: 'UserMultiSelect',
props: {
value: {
type: Boolean,
default: false
}
},
data() {
return {
showFlag:false,
// 遮罩层
showFlag: false,
loading: true,
// 选中数组
ids: [],
selectedRows: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 用户表格数据
userList: null,
// 弹出层标题
title: "",
// 部门树选项
deptOptions: undefined,
// 是否显示弹出层
open: false,
// 部门名称
userList: [],
deptOptions: [],
deptName: undefined,
// 日期范围
dateRange: [],
// 岗位选项
postOptions: [],
// 角色选项
roleOptions: [],
// 表单参数
form: {},
selectedRows: [],
defaultProps: {
children: "children",
label: "label"
children: 'children',
label: 'deptName'
},
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 20,
@@ -156,87 +132,120 @@ export default {
status: undefined,
deptId: undefined
},
// 列信息
columns: [
{ key: 0, label: `用户编号`, visible: true },
{ key: 1, label: `用户名称`, visible: true },
{ key: 2, label: `用户昵称`, visible: true },
{ key: 3, label: `部门`, visible: true },
{ key: 4, label: `手机号码`, visible: true },
{ key: 5, label: `状态`, visible: true },
{ key: 6, label: `创建时间`, visible: true }
],
};
{ key: 0, label: '用户编号', visible: true },
{ key: 1, label: '用户名称', visible: true },
{ key: 2, label: '用户昵称', visible: true },
{ key: 3, label: '部门', visible: true },
{ key: 4, label: '手机号码', visible: true },
{ key: 5, label: '状态', visible: true },
{ key: 6, label: '创建时间', visible: true }
]
}
},
watch: {
// 根据名称筛选部门树
value: {
immediate: true,
handler(val) {
this.showFlag = !!val
if (val) {
this.getDeptTree()
this.getList()
}
}
},
showFlag(val) {
this.$emit('input', !!val)
},
deptName(val) {
this.$refs.tree.filter(val);
if (this.$refs.tree) {
this.$refs.tree.filter(val)
}
}
},
created() {
this.getList();
this.getTreeselect();
},
methods: {
/** 查询用户列表 */
open() {
this.showFlag = true
this.getDeptTree()
this.getList()
},
buildTree(list, parentId = 0) {
const tree = []
if (!Array.isArray(list)) return tree
list.forEach(item => {
const pid = item.parentId ?? item.pid ?? 0
if (Number(pid) === Number(parentId)) {
const children = this.buildTree(list, item.deptId)
const node = { ...item }
if (children.length) node.children = children
tree.push(node)
}
})
return tree
},
async getDeptTree() {
try {
const res = await listDept()
const rows = res.rows || res.data || []
this.deptOptions = this.buildTree(rows, 0)
} catch (e) {
console.error('获取部门列表失败', e)
this.deptOptions = []
}
},
getList() {
this.loading = true;
listUser(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
this.userList = response.rows;
this.total = response.total;
this.loading = false;
}
);
this.loading = true
const params = { ...this.queryParams }
if (params.deptId !== undefined && params.deptId !== null) {
const num = Number(params.deptId)
params.deptId = isNaN(num) ? undefined : num
}
listUser(params)
.then(res => {
this.userList = res.rows || []
this.total = res.total || 0
})
.finally(() => {
this.loading = false
})
},
/** 查询部门下拉树结构 */
getTreeselect() {
treeselect().then(response => {
debugger;
this.deptOptions = response.data;
});
},
// 筛选节点
filterNode(value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
if (!value) return true
return (data.deptName || '').indexOf(value) !== -1
},
// 节点单击事件
handleNodeClick(data) {
this.queryParams.deptId = data.id;
this.handleQuery();
const id = data && (data.deptId ?? data.id)
const num = Number(id)
this.queryParams.deptId = isNaN(num) ? undefined : num
this.queryParams.pageNum = 1
this.getList()
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.dateRange = [];
this.resetForm("queryForm");
this.handleQuery();
this.queryParams.pageNum = 1
this.queryParams.userName = undefined
this.queryParams.phonenumber = undefined
this.queryParams.deptId = undefined
this.getList()
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.userId);
this.selectedRows = selection;
this.single = selection.length != 1;
this.multiple = !selection.length;
handleSelectionChange(rows) {
this.selectedRows = rows || []
},
//确定选中
confirmSelect(){
if(this.selectedRows == null || this.selectedRows.size == 0){
confirmSelect() {
if (!this.selectedRows || this.selectedRows.length === 0) {
this.$notify({
title:'提示',
type:'warning',
title: '提示',
type: 'warning',
message: '请至少选择一条数据!'
});
return;
})
return
}
this.$emit('onSelected',this.selectedRows);
this.showFlag = false;
this.$emit('onSelected', this.selectedRows)
this.showFlag = false
}
}
};
}
</script>

View File

@@ -1,13 +1,14 @@
<template>
<el-dialog title="人员选择"
v-if="showFlag"
<el-dialog
title="人员选择"
:visible.sync="showFlag"
:modal= false
:modal="false"
width="80%"
center
append-to-body
>
<el-row :gutter="20">
<!--部门数据-->
<!-- 部门数据 -->
<el-col :span="4" :xs="24">
<div class="head-container">
<el-input
@@ -26,14 +27,23 @@
:expand-on-click-node="false"
:filter-node-method="filterNode"
ref="tree"
node-key="deptId"
default-expand-all
@node-click="handleNodeClick"
/>
</div>
</el-col>
<!--用户数据-->
<!-- 用户数据 -->
<el-col :span="20" :xs="24">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="用户名称" prop="userName">
<el-input
v-model="queryParams.userName"
@@ -57,26 +67,17 @@
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<KLPTable v-loading="loading" :data="userList" @current-change="handleCurrent" @row-dblclick="handleRowDbClick">
<el-table-column width="55" align="center" >
<el-table-column width="55" align="center">
<template v-slot="scope">
<el-radio v-model="selectedId" :label="scope.row.userId" @change="handleRowChange(scope.row)">{{""}}</el-radio>
<el-radio v-model="selectedId" :label="scope.row.userId" @change="handleRowChange(scope.row)">{{ '' }}</el-radio>
</template>
</el-table-column>
<el-table-column label="用户名称" align="center" key="userName" prop="userName" v-if="columns[1].visible" :show-overflow-tooltip="true" />
<el-table-column label="用户昵称" align="center" key="nickName" prop="nickName" v-if="columns[2].visible" :show-overflow-tooltip="true" />
<el-table-column label="部门" align="center" key="deptName" prop="dept.deptName" v-if="columns[3].visible" :show-overflow-tooltip="true" />
<el-table-column label="手机号码" align="center" key="phonenumber" prop="phonenumber" v-if="columns[4].visible" width="120" />
<!-- <el-table-column label="状态" align="center" key="status" v-if="columns[5].visible">-->
<!-- <template slot-scope="scope">-->
<!-- <el-switch-->
<!-- v-model="scope.row.status"-->
<!-- active-value="0"-->
<!-- inactive-value="1"-->
<!-- @change="handleStatusChange(scope.row)"-->
<!-- ></el-switch>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="创建时间" align="center" prop="createTime" v-if="columns[6].visible" width="160">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
@@ -85,7 +86,7 @@
</KLPTable>
<pagination
v-show="total>0"
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@@ -93,62 +94,48 @@
/>
</el-col>
</el-row>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="confirmSelect"> </el-button>
<el-button @click="showFlag=false"> </el-button>
<el-button @click="showFlag = false"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { listUser, getUser, delUser, addUser, updateUser, resetUserPwd, changeUserStatus } from "@/api/system/user";
import { getToken } from "@/utils/auth";
import { treeselect } from "@/api/system/dept";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import { listUser } from '@/api/system/user'
import { listDept } from '@/api/system/dept'
export default {
name: "UserSingleSelect",
dicts: ['sys_normal_disable', 'sys_user_sex'],
components: { Treeselect },
name: 'UserSingleSelect',
// 让父组件可以通过 v-model 控制弹窗显示
props: {
value: {
type: Boolean,
default: false
}
},
data() {
return {
showFlag:false,
showFlag: false,
// 遮罩层
loading: true,
// 选中数组
// 选中
selectedId: null,
selectedRow: null,
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 用户表格数据
userList: null,
// 弹出层标题
title: "",
// 部门树选项
deptOptions: undefined,
// 是否显示弹出层
open: false,
userList: [],
// 部门树
deptOptions: [],
// 部门名称
deptName: undefined,
// 日期范围
dateRange: [],
// 岗位选项
postOptions: [],
// 角色选项
roleOptions: [],
// 表单参数
form: {},
defaultProps: {
children: "children",
label: "label"
children: 'children',
label: 'deptName'
},
// 查询参数
queryParams: {
@@ -161,98 +148,160 @@ export default {
},
// 列信息
columns: [
{ key: 0, label: `用户编号`, visible: true },
{ key: 1, label: `用户名称`, visible: true },
{ key: 2, label: `用户昵称`, visible: true },
{ key: 3, label: `部门`, visible: true },
{ key: 4, label: `手机号码`, visible: true },
{ key: 5, label: `状态`, visible: true },
{ key: 6, label: `创建时间`, visible: true }
],
};
{ key: 0, label: '用户编号', visible: true },
{ key: 1, label: '用户名称', visible: true },
{ key: 2, label: '用户昵称', visible: true },
{ key: 3, label: '部门', visible: true },
{ key: 4, label: '手机号码', visible: true },
{ key: 5, label: '状态', visible: true },
{ key: 6, label: '创建时间', visible: true }
]
}
},
watch: {
// v-model -> showFlag
value: {
immediate: true,
handler(val) {
this.showFlag = !!val
if (val) {
// 打开时再加载,避免页面初始化就请求
this.getDeptTree()
this.getList()
}
}
},
// showFlag -> v-model
showFlag(val) {
this.$emit('input', !!val)
},
// 根据名称筛选部门树
deptName(val) {
this.$refs.tree.filter(val);
if (this.$refs.tree) {
this.$refs.tree.filter(val)
}
}
},
created() {
this.getList();
this.getTreeselect();
},
methods: {
// 供父组件 ref 调用this.$refs.xxx.open()
open() {
this.showFlag = true
// watch(value) 不会触发,这里手动加载
this.getDeptTree()
this.getList()
},
// 构建树形
buildTree(list, parentId = 0) {
const tree = []
if (!Array.isArray(list)) return tree
list.forEach(item => {
const pid = item.parentId ?? item.pid ?? 0
if (Number(pid) === Number(parentId)) {
const children = this.buildTree(list, item.deptId)
const node = { ...item }
if (children.length) node.children = children
tree.push(node)
}
})
return tree
},
/** 查询部门树:用 listDept 自己组装,彻底避免 /treeselect 路由冲突 */
async getDeptTree() {
try {
const res = await listDept()
const rows = res.rows || res.data || []
this.deptOptions = this.buildTree(rows, 0)
} catch (e) {
console.error('获取部门列表失败', e)
this.deptOptions = []
}
},
/** 查询用户列表 */
getList() {
this.loading = true;
listUser(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
this.userList = response.rows;
this.total = response.total;
this.loading = false;
}
);
},
/** 查询部门下拉树结构 */
getTreeselect() {
treeselect().then(response => {
debugger;
this.deptOptions = response.data;
});
this.loading = true
const params = { ...this.queryParams }
// deptId 必须是 Long对非法值直接丢弃
if (params.deptId !== undefined && params.deptId !== null) {
const num = Number(params.deptId)
params.deptId = isNaN(num) ? undefined : num
}
listUser(params)
.then(response => {
this.userList = response.rows || []
this.total = response.total || 0
})
.finally(() => {
this.loading = false
})
},
// 筛选节点
filterNode(value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
if (!value) return true
return (data.deptName || '').indexOf(value) !== -1
},
// 节点单击事件
handleNodeClick(data) {
this.queryParams.deptId = data.id;
this.handleQuery();
const id = data && (data.deptId ?? data.id)
const num = Number(id)
this.queryParams.deptId = isNaN(num) ? undefined : num
this.queryParams.pageNum = 1
this.getList()
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.dateRange = [];
this.resetForm("queryForm");
this.handleQuery();
this.queryParams.pageNum = 1
this.queryParams.userName = undefined
this.queryParams.phonenumber = undefined
this.queryParams.deptId = undefined
this.getList()
},
handleCurrent(row){
if(row){
this.selectedRow = row;
handleCurrent(row) {
if (row) {
this.selectedRow = row
}
},
//行双击选中
handleRowDbClick(row){
if(row){
this.selectedRow = row;
this.$emit('onSelected',this.selectedRow);
this.showFlag = false;
// 行双击选中
handleRowDbClick(row) {
if (row) {
this.selectedRow = row
this.confirmSelect()
}
},
// 单选选中数据
handleRowChange(row) {
debugger;
if(row){
this.selectedRow = row;
if (row) {
this.selectedRow = row
}
},
//确定选中
confirmSelect(){
if(this.selectedId == null || this.selectedId == 0){
// 确定选中
confirmSelect() {
if (!this.selectedRow) {
this.$notify({
title:'提示',
type:'warning',
title: '提示',
type: 'warning',
message: '请至少选择一条数据!'
});
return;
})
return
}
this.$emit('onSelected',this.selectedRow);
this.showFlag = false;
this.$emit('onSelected', this.selectedRow)
this.showFlag = false
}
}
};
}
</script>