Compare commits
No commits in common. "c56d32bd541df4399e8d7861bfcbde2e3c9ff835" and "5b6f32b732a5ef212f98ddd0f82b7e4da5c988f6" have entirely different histories.
c56d32bd54
...
5b6f32b732
@ -5,152 +5,136 @@
|
||||
<el-card shadow="hover" class="border-0">
|
||||
<template #header>
|
||||
<el-space>
|
||||
<el-input type="text" v-model="params.name" clearable placeholder="请输入配置名称">
|
||||
<template #prefix>
|
||||
<el-icon class="el-input__icon">
|
||||
<SearchOutlined />
|
||||
</el-icon>
|
||||
</template>
|
||||
</el-input>
|
||||
<el-button type="primary" @click="reloadTable" icon="Search"> 查询 </el-button>
|
||||
<el-input type="text" v-model="params.name" clearable placeholder="请输入配置名称">
|
||||
<template #prefix>
|
||||
<el-icon class="el-input__icon">
|
||||
<SearchOutlined />
|
||||
</el-icon>
|
||||
</template>
|
||||
</el-input>
|
||||
<el-button type="primary" @click="reloadTable" icon="Search"> 查询 </el-button>
|
||||
</el-space>
|
||||
<div style="margin-top: 15px">
|
||||
<div style="margin-top:15px;">
|
||||
<el-button type="primary" @click="addConfig" icon="Plus">新建</el-button>
|
||||
<el-button
|
||||
type="danger"
|
||||
:disabled="!selectionData.length"
|
||||
@click="handleDelete()"
|
||||
icon="Delete"
|
||||
>删除</el-button
|
||||
>
|
||||
<el-button type="danger" :disabled="!selectionData.length" @click="handleDelete()" icon="Delete">删除</el-button>
|
||||
</div>
|
||||
</template>
|
||||
<BasicTable
|
||||
:columns="columns"
|
||||
:showTableSetting="false"
|
||||
:request="loadDataTable"
|
||||
:row-key="(row) => row.id"
|
||||
ref="tableRef"
|
||||
:actionColumn="actionColumn"
|
||||
@selection-change="onSelectionChange"
|
||||
highlight-current-row
|
||||
@row-click="onCheckedRow"
|
||||
:pagination="{ small: true, layout: 'total,prev, pager, next,jumper' }"
|
||||
/>
|
||||
<BasicTable :columns="columns" :showTableSetting="false" :request="loadDataTable" :row-key="(row) => row.id"
|
||||
ref="tableRef" :actionColumn="actionColumn" @selection-change="onSelectionChange" highlight-current-row
|
||||
@row-click="onCheckedRow" :pagination="{ small: true, layout: 'total,prev, pager, next,jumper' }"/>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="24" :md="16" :lg="16" :xl="16" class="mb-4">
|
||||
<el-card shadow="hover" class="mb-4 border-0 proCard">
|
||||
<configItem :configId="configId" v-if="configItemShow" />
|
||||
<configItem :configId="configId" v-if="configItemShow"></configItem>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<editDialog
|
||||
v-if="editVisible"
|
||||
:configId="configId"
|
||||
v-model:visible="editVisible"
|
||||
@success="reloadTable"
|
||||
/>
|
||||
<editDialog v-if="editVisible" :configId="configId" v-model:visible="editVisible" @success="reloadTable">
|
||||
</editDialog>
|
||||
</PageWrapper>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, h, nextTick, defineAsyncComponent } from 'vue';
|
||||
import { SearchOutlined } from '@vicons/antd';
|
||||
import { TableAction } from '@/components/Table';
|
||||
import { getConfigList, configDelete, configBatchDelete } from '@/api/data/config';
|
||||
import { columns } from './columns';
|
||||
import configItem from './configItem.vue';
|
||||
import { message, confirm } from '@/utils/auth';
|
||||
const editDialog = defineAsyncComponent(() => import('./edit.vue'));
|
||||
const configId = ref(0);
|
||||
const configItemShow = ref(false);
|
||||
const tableRef = ref();
|
||||
const editVisible = ref(false);
|
||||
const selectionData = ref([]);
|
||||
const params = ref({
|
||||
name: '',
|
||||
});
|
||||
import { ref, reactive, h, nextTick, defineAsyncComponent } from 'vue';
|
||||
import { SearchOutlined } from '@vicons/antd';
|
||||
import { TableAction } from '@/components/Table';
|
||||
import { getConfigList, configDelete, configBatchDelete } from '@/api/data/config';
|
||||
import { columns } from './columns';
|
||||
import configItem from './configItem.vue';
|
||||
import { message, confirm } from "@/utils/auth";
|
||||
const editDialog = defineAsyncComponent(() =>
|
||||
import('./edit.vue')
|
||||
)
|
||||
const configId = ref(0)
|
||||
const configItemShow = ref(false)
|
||||
const tableRef = ref();
|
||||
const editVisible = ref(false)
|
||||
const selectionData = ref([])
|
||||
const params = ref({
|
||||
name: '',
|
||||
});
|
||||
|
||||
const actionColumn = reactive({
|
||||
width: 200,
|
||||
label: '操作',
|
||||
prop: 'action',
|
||||
fixed: 'right',
|
||||
render(record) {
|
||||
return h(TableAction as any, {
|
||||
style: 'text',
|
||||
actions: [
|
||||
{
|
||||
label: '编辑',
|
||||
icon: 'Edit',
|
||||
type: 'warning',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
},
|
||||
{
|
||||
label: '删除',
|
||||
icon: 'Delete',
|
||||
type: 'danger',
|
||||
onClick: handleDelete.bind(null, record),
|
||||
},
|
||||
],
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
//新建字典
|
||||
const addConfig = async () => {
|
||||
configId.value = 0;
|
||||
await nextTick();
|
||||
editVisible.value = true;
|
||||
};
|
||||
//编辑字典
|
||||
const handleEdit = async (record: Recordable) => {
|
||||
configId.value = record.row.id;
|
||||
await nextTick();
|
||||
editVisible.value = true;
|
||||
};
|
||||
//选择字典项
|
||||
function onCheckedRow(row) {
|
||||
configId.value = row.id;
|
||||
}
|
||||
|
||||
//刷新字典项值列表
|
||||
function reloadTable() {
|
||||
tableRef.value.reload({ pageNo: 1 });
|
||||
}
|
||||
|
||||
//加载字典项值列表;
|
||||
const loadDataTable = async (res) => {
|
||||
const result = await getConfigList({ ...params.value, ...res });
|
||||
configId.value = result?.records[0]?.id;
|
||||
configItemShow.value = true;
|
||||
nextTick(() => {
|
||||
const tables = tableRef.value.getTableRef();
|
||||
tables.setCurrentRow(result?.records[0]);
|
||||
const actionColumn = reactive({
|
||||
width: 200,
|
||||
label: '操作',
|
||||
prop: 'action',
|
||||
fixed: 'right',
|
||||
render(record) {
|
||||
return h(TableAction as any, {
|
||||
style: 'text',
|
||||
actions: [
|
||||
{
|
||||
label: '编辑',
|
||||
icon:'Edit',
|
||||
type: 'warning',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
},
|
||||
{
|
||||
label: '删除',
|
||||
icon:'Delete',
|
||||
type: 'danger',
|
||||
onClick: handleDelete.bind(null, record),
|
||||
}
|
||||
],
|
||||
});
|
||||
return result;
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
//删除字典项
|
||||
async function handleDelete(record: Recordable) {
|
||||
let ids = [];
|
||||
if (!record) {
|
||||
ids = selectionData.value.map(({ id }) => id);
|
||||
}
|
||||
await confirm('确定要删除?');
|
||||
record ? await configDelete(record.row.id) : await configBatchDelete(ids);
|
||||
message('删除成功');
|
||||
reloadTable();
|
||||
}
|
||||
function onSelectionChange(value) {
|
||||
selectionData.value = value;
|
||||
|
||||
//新建字典
|
||||
const addConfig = async () => {
|
||||
configId.value=0
|
||||
await nextTick();
|
||||
editVisible.value=true
|
||||
};
|
||||
//编辑字典
|
||||
const handleEdit = async (record: Recordable) => {
|
||||
configId.value=record.row.id
|
||||
await nextTick();
|
||||
editVisible.value=true
|
||||
};
|
||||
//选择字典项
|
||||
function onCheckedRow(row) {
|
||||
configId.value = row.id
|
||||
}
|
||||
|
||||
//刷新字典项值列表
|
||||
function reloadTable() {
|
||||
tableRef.value.reload({ pageNo: 1 });
|
||||
}
|
||||
|
||||
//加载字典项值列表;
|
||||
const loadDataTable = async (res) => {
|
||||
const result = await getConfigList({ ...params.value, ...res });
|
||||
configId.value = result?.records[0]?.id
|
||||
configItemShow.value = true
|
||||
nextTick(() => {
|
||||
const tables = tableRef.value.getTableRef();
|
||||
tables.setCurrentRow(result?.records[0])
|
||||
})
|
||||
return result;
|
||||
};
|
||||
|
||||
//删除字典项
|
||||
async function handleDelete(record: Recordable) {
|
||||
let ids = []
|
||||
if (!record) {
|
||||
ids = selectionData.value.map(({ id }) => id);
|
||||
}
|
||||
await confirm('确定要删除?');
|
||||
record ? await configDelete(record.row.id) : await configBatchDelete(ids);
|
||||
message("删除成功");
|
||||
reloadTable()
|
||||
}
|
||||
function onSelectionChange(value) {
|
||||
selectionData.value = value
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.card-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
.card-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
|
@ -5,170 +5,145 @@
|
||||
<el-card shadow="hover" class="border-0">
|
||||
<template #header>
|
||||
<el-space>
|
||||
<el-input type="text" v-model="params.name" clearable placeholder="请输入字典名称">
|
||||
<template #prefix>
|
||||
<el-icon class="el-input__icon">
|
||||
<SearchOutlined />
|
||||
</el-icon>
|
||||
</template>
|
||||
</el-input>
|
||||
<el-button type="primary" icon="Search" @click="reloadTable"> 查询 </el-button>
|
||||
<el-input type="text" v-model="params.name" clearable placeholder="请输入字典名称">
|
||||
<template #prefix>
|
||||
<el-icon class="el-input__icon">
|
||||
<SearchOutlined />
|
||||
</el-icon>
|
||||
</template>
|
||||
</el-input>
|
||||
<el-button type="primary" icon="Search" @click="reloadTable"> 查询 </el-button>
|
||||
</el-space>
|
||||
<div style="margin-top: 15px">
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="dictRefresh"
|
||||
icon="RefreshRight"
|
||||
v-perm="['sys:dict:cache']"
|
||||
>刷新缓存</el-button
|
||||
>
|
||||
<el-button type="primary" @click="addDict" icon="Plus" v-perm="['sys:dict:add']"
|
||||
>新建</el-button
|
||||
>
|
||||
<el-button
|
||||
type="danger"
|
||||
v-perm="['sys:dict:delete']"
|
||||
icon="Delete"
|
||||
:disabled="!selectionData.length"
|
||||
@click="handleDelete()"
|
||||
>删除</el-button
|
||||
>
|
||||
<div style="margin-top:15px;">
|
||||
<el-button type="primary" @click="dictRefresh" icon="RefreshRight" v-perm="['sys:dict:cache']">刷新缓存</el-button>
|
||||
<el-button type="primary" @click="addDict" icon="Plus" v-perm="['sys:dict:add']">新建</el-button>
|
||||
<el-button type="danger" v-perm="['sys:dict:delete']" icon="Delete" :disabled="!selectionData.length" @click="handleDelete()">删除</el-button>
|
||||
</div>
|
||||
</template>
|
||||
<BasicTable
|
||||
:columns="columns"
|
||||
:showTableSetting="false"
|
||||
:request="loadDataTable"
|
||||
:row-key="(row) => row.id"
|
||||
ref="tableRef"
|
||||
:actionColumn="actionColumn"
|
||||
@selection-change="onSelectionChange"
|
||||
highlight-current-row
|
||||
@row-click="onCheckedRow"
|
||||
:pagination="{ small: true, layout: 'total,prev, pager, next,jumper' }"
|
||||
/>
|
||||
<BasicTable :columns="columns" :showTableSetting="false" :request="loadDataTable" :row-key="(row) => row.id"
|
||||
ref="tableRef" :actionColumn="actionColumn" @selection-change="onSelectionChange" highlight-current-row
|
||||
@row-click="onCheckedRow" :pagination="{ small: true, layout: 'total,prev, pager, next,jumper' }" />
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="24" :md="16" :lg="16" :xl="16" class="mb-4">
|
||||
<el-card shadow="hover" class="mb-4 border-0 proCard">
|
||||
<dictItem :dictId="dictId" v-if="dictItemShow" />
|
||||
<dictItem :dictId="dictId" v-if="dictItemShow"></dictItem>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<editDialog
|
||||
v-if="editVisible"
|
||||
:dictId="dictId"
|
||||
v-model:visible="editVisible"
|
||||
@success="reloadTable"
|
||||
/>
|
||||
<editDialog v-if="editVisible" :dictId="dictId" v-model:visible="editVisible" @success="reloadTable">
|
||||
</editDialog>
|
||||
</PageWrapper>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, h, nextTick, defineAsyncComponent } from 'vue';
|
||||
import { SearchOutlined } from '@vicons/antd';
|
||||
import { TableAction } from '@/components/Table';
|
||||
import { getDictList, refreshCache, dictDelete, dictBatchDelete } from '@/api/data/dictionary';
|
||||
import { columns } from './columns';
|
||||
import dictItem from './dictItem.vue';
|
||||
import { message, confirm } from '@/utils/auth';
|
||||
const editDialog = defineAsyncComponent(() => import('./edit.vue'));
|
||||
const dictId = ref(0);
|
||||
const dictItemShow = ref(false);
|
||||
const tableRef = ref();
|
||||
const selectedKey = ref('');
|
||||
const rowKeysName = ref('');
|
||||
const currentRow = ref();
|
||||
const editVisible = ref(false);
|
||||
const selectionData = ref([]);
|
||||
const params = ref({
|
||||
name: '',
|
||||
});
|
||||
import { ref, reactive, h, nextTick, defineAsyncComponent } from 'vue';
|
||||
import { SearchOutlined } from '@vicons/antd';
|
||||
import { TableAction } from '@/components/Table';
|
||||
import { getDictList, refreshCache, dictDelete, dictBatchDelete } from '@/api/data/dictionary';
|
||||
import { columns } from './columns';
|
||||
import dictItem from './dictItem.vue';
|
||||
import { message, confirm } from "@/utils/auth";
|
||||
const editDialog = defineAsyncComponent(() =>
|
||||
import('./edit.vue')
|
||||
)
|
||||
const dictId = ref(0)
|
||||
const dictItemShow = ref(false)
|
||||
const tableRef = ref();
|
||||
const selectedKey = ref('');
|
||||
const rowKeysName = ref('');
|
||||
const currentRow = ref();
|
||||
const editVisible = ref(false)
|
||||
const selectionData = ref([])
|
||||
const params = ref({
|
||||
name: '',
|
||||
});
|
||||
|
||||
const actionColumn = reactive({
|
||||
width: 200,
|
||||
label: '操作',
|
||||
prop: 'action',
|
||||
fixed: 'right',
|
||||
render(record) {
|
||||
return h(TableAction as any, {
|
||||
style: 'text',
|
||||
actions: [
|
||||
{
|
||||
label: '编辑',
|
||||
icon: 'Edit',
|
||||
type: 'warning',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
},
|
||||
{
|
||||
label: '删除',
|
||||
icon: 'Delete',
|
||||
type: 'danger',
|
||||
onClick: handleDelete.bind(null, record),
|
||||
},
|
||||
],
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
//新建字典
|
||||
const addDict = async () => {
|
||||
dictId.value = 0;
|
||||
await nextTick();
|
||||
editVisible.value = true;
|
||||
};
|
||||
//编辑字典
|
||||
const handleEdit = async (record: Recordable) => {
|
||||
dictId.value = record.row.id;
|
||||
await nextTick();
|
||||
editVisible.value = true;
|
||||
};
|
||||
//选择字典项
|
||||
function onCheckedRow(row) {
|
||||
dictId.value = row.id;
|
||||
}
|
||||
|
||||
//刷新字典项值列表
|
||||
function reloadTable() {
|
||||
tableRef.value.reload({ pageNo: 1 });
|
||||
}
|
||||
|
||||
//加载字典项值列表;
|
||||
const loadDataTable = async (res) => {
|
||||
const result = await getDictList({ ...params.value, ...res });
|
||||
dictId.value = result?.records[0]?.id;
|
||||
dictItemShow.value = true;
|
||||
nextTick(() => {
|
||||
const tables = tableRef.value.getTableRef();
|
||||
tables.setCurrentRow(result?.records[0]);
|
||||
const actionColumn = reactive({
|
||||
width: 200,
|
||||
label: '操作',
|
||||
prop: 'action',
|
||||
fixed: 'right',
|
||||
render(record) {
|
||||
return h(TableAction as any, {
|
||||
style: 'text',
|
||||
actions: [
|
||||
{
|
||||
label: '编辑',
|
||||
icon:'Edit',
|
||||
type: 'warning',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
},
|
||||
{
|
||||
label: '删除',
|
||||
icon:'Delete',
|
||||
type: 'danger',
|
||||
onClick: handleDelete.bind(null, record),
|
||||
}
|
||||
],
|
||||
});
|
||||
return result;
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
//刷新缓存
|
||||
async function dictRefresh() {
|
||||
await refreshCache();
|
||||
message('刷新成功');
|
||||
}
|
||||
//删除字典项
|
||||
async function handleDelete(record: Recordable) {
|
||||
let ids = [];
|
||||
if (!record) {
|
||||
ids = selectionData.value.map(({ id }) => id);
|
||||
}
|
||||
await confirm('确定要删除?');
|
||||
record ? await dictDelete(record.row.id) : await dictBatchDelete(ids);
|
||||
message('删除成功');
|
||||
reloadTable();
|
||||
}
|
||||
function onSelectionChange(value) {
|
||||
selectionData.value = value;
|
||||
|
||||
//新建字典
|
||||
const addDict = async () => {
|
||||
dictId.value=0
|
||||
await nextTick();
|
||||
editVisible.value=true
|
||||
};
|
||||
//编辑字典
|
||||
const handleEdit = async (record: Recordable) => {
|
||||
dictId.value=record.row.id
|
||||
await nextTick();
|
||||
editVisible.value=true
|
||||
};
|
||||
//选择字典项
|
||||
function onCheckedRow(row) {
|
||||
dictId.value = row.id
|
||||
}
|
||||
|
||||
//刷新字典项值列表
|
||||
function reloadTable() {
|
||||
tableRef.value.reload({ pageNo: 1 });
|
||||
}
|
||||
|
||||
//加载字典项值列表;
|
||||
const loadDataTable = async (res) => {
|
||||
const result = await getDictList({ ...params.value, ...res });
|
||||
dictId.value = result?.records[0]?.id
|
||||
dictItemShow.value = true
|
||||
nextTick(() => {
|
||||
const tables = tableRef.value.getTableRef();
|
||||
tables.setCurrentRow(result?.records[0])
|
||||
})
|
||||
return result;
|
||||
};
|
||||
|
||||
//刷新缓存
|
||||
async function dictRefresh() {
|
||||
await refreshCache();
|
||||
message("刷新成功");
|
||||
}
|
||||
//删除字典项
|
||||
async function handleDelete(record: Recordable) {
|
||||
let ids = []
|
||||
if (!record) {
|
||||
ids = selectionData.value.map(({ id }) => id);
|
||||
}
|
||||
await confirm('确定要删除?');
|
||||
record ? await dictDelete(record.row.id) : await dictBatchDelete(ids);
|
||||
message("删除成功");
|
||||
reloadTable()
|
||||
}
|
||||
function onSelectionChange(value) {
|
||||
selectionData.value = value
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.card-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
.card-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
|
@ -96,17 +96,18 @@
|
||||
</template>
|
||||
</BasicTable>
|
||||
</el-card>
|
||||
<!-- 添加、编辑弹框 -->
|
||||
<editDialog
|
||||
v-if="editVisible"
|
||||
:userId="userId"
|
||||
v-model:visible="editVisible"
|
||||
@success="reloadTable('noRefresh')"
|
||||
/>
|
||||
<!-- 上传文件 -->
|
||||
<userUpload v-if="importVisible" v-model:visible="importVisible" @success="reloadTable()" />
|
||||
<!-- 发送WebSocket消息 -->
|
||||
<sendMsgDialog v-if="sendMsgVisible" v-model:visible="sendMsgVisible" :receiveId="receiveId" />
|
||||
<sendMsgDialog
|
||||
v-if="sendMsgVisible"
|
||||
v-model:visible="sendMsgVisible"
|
||||
:receiveId="receiveId"
|
||||
/>
|
||||
</PageWrapper>
|
||||
</template>
|
||||
|
||||
@ -115,6 +116,7 @@
|
||||
import { ColProps } from 'element-plus';
|
||||
import { TableAction } from '@/components/Table';
|
||||
import { useForm } from '@/components/Form/index';
|
||||
import { initWebSocket,sendWebSocket } from '@/components/Websocket/index';
|
||||
import {
|
||||
getUserList,
|
||||
userDelete,
|
||||
@ -128,12 +130,8 @@
|
||||
import { schemas } from './querySchemas';
|
||||
import { downloadByData } from '@/utils/file/download';
|
||||
import printJS from 'print-js';
|
||||
|
||||
/**
|
||||
* 定义参数
|
||||
*/
|
||||
const userId = ref(0);
|
||||
const receiveId = ref('');
|
||||
const receiveId = ref('')
|
||||
const tableRef = ref();
|
||||
const editVisible = ref(false);
|
||||
const sendMsgVisible = ref(false);
|
||||
@ -143,7 +141,6 @@
|
||||
const editDialog = defineAsyncComponent(() => import('./edit.vue'));
|
||||
const sendMsgDialog = defineAsyncComponent(() => import('./sendMsg.vue'));
|
||||
const userUpload = defineAsyncComponent(() => import('./userUpload.vue'));
|
||||
|
||||
/**
|
||||
* 定义查询参数
|
||||
*/
|
||||
@ -332,21 +329,19 @@
|
||||
exportLoading.value = false;
|
||||
message('导出成功');
|
||||
};
|
||||
|
||||
/**
|
||||
* 发送消息
|
||||
* 此处写的是Socket消息发送案例,实际业务研发时根据实际需求自行接入模板消息
|
||||
*/
|
||||
const sendMessage = async () => {
|
||||
if (selectionData.value.length == 0) {
|
||||
message('请选择数据', 'error');
|
||||
return;
|
||||
const sendMessage=async ()=>{
|
||||
if(selectionData.value.length==0){
|
||||
message('请选择数据','error')
|
||||
return
|
||||
}
|
||||
let ids = [];
|
||||
ids = selectionData.value.map(({ id }) => id);
|
||||
receiveId.value = ids.join();
|
||||
sendMsgVisible.value = true;
|
||||
};
|
||||
receiveId.value = ids.join()
|
||||
sendMsgVisible.value = true
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
|
@ -7,15 +7,12 @@
|
||||
:before-close="dialogClose"
|
||||
>
|
||||
<el-form :model="formData" label-width="100px" ref="formRef">
|
||||
<el-form-item
|
||||
label="消息内容"
|
||||
prop="message"
|
||||
:rules="{ required: true, message: '请输入消息内容', trigger: 'blur' }"
|
||||
>
|
||||
<el-input v-model="formData.message" type="textarea" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-form-item label="消息内容" prop="message"
|
||||
:rules="{ required: true, message: '请输入消息内容', trigger: 'blur' }">
|
||||
<el-input v-model="formData.message" type="textarea"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="dialogClose">取消</el-button>
|
||||
<el-button :loading="subLoading" type="primary" @click="submit"> 确定 </el-button>
|
||||
@ -25,20 +22,14 @@
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import type { FormInstance } from 'element-plus';
|
||||
import { sendMsg } from '@/api/system/user';
|
||||
import {sendMsg} from '@/api/system/user';
|
||||
import { useUserStore } from '@/store/modules/user';
|
||||
import { onMounted, reactive, ref, shallowRef } from 'vue';
|
||||
import { message, buildTree } from '@/utils/auth';
|
||||
import { useLockFn } from '@/utils/useLockFn';
|
||||
|
||||
/**
|
||||
* 定义参数
|
||||
*/
|
||||
const userStore = useUserStore();
|
||||
const userInfo: object = userStore.getUserInfo || {};
|
||||
const emit = defineEmits(['update:visible']);
|
||||
const formRef = shallowRef<FormInstance>();
|
||||
|
||||
/**
|
||||
* 定义接收的参数
|
||||
*/
|
||||
@ -53,12 +44,14 @@
|
||||
default: '',
|
||||
},
|
||||
});
|
||||
const emit = defineEmits(['update:visible']);
|
||||
const formRef = shallowRef<FormInstance>();
|
||||
|
||||
/**
|
||||
* 定义表单参数
|
||||
*/
|
||||
const formData = reactive({
|
||||
message: '',
|
||||
message: ''
|
||||
});
|
||||
|
||||
/**
|
||||
@ -74,13 +67,14 @@
|
||||
const handleSubmit = async () => {
|
||||
await formRef.value?.validate();
|
||||
await sendMsg({
|
||||
formId: userInfo.id,
|
||||
receiveId: props.receiveId,
|
||||
message: formData.message,
|
||||
});
|
||||
formId:userInfo.id,
|
||||
receiveId:props.receiveId,
|
||||
message:formData.message
|
||||
})
|
||||
message('发送成功');
|
||||
emit('update:visible', false);
|
||||
};
|
||||
|
||||
const { isLock: subLoading, lockFn: submit } = useLockFn(handleSubmit);
|
||||
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user