|
@@ -20,16 +20,16 @@
|
|
<MultiUpload v-model="form.photoLists" />
|
|
<MultiUpload v-model="form.photoLists" />
|
|
</template>
|
|
</template>
|
|
<template #fileLists-form>
|
|
<template #fileLists-form>
|
|
- <FilesUpload v-model:src-list="form.fileLists" :limit="1" />
|
|
|
|
|
|
+ <FilesUpload
|
|
|
|
+ v-model:file-name-list="photoNameList"
|
|
|
|
+ v-model:src-list="photoUrlList"
|
|
|
|
+ :limit="1"
|
|
|
|
+ @finished="photoChange"
|
|
|
|
+ />
|
|
</template>
|
|
</template>
|
|
- <template #menu-left="{ size }">
|
|
|
|
- <el-button
|
|
|
|
- :disabled="toDeleteIds.length < 1"
|
|
|
|
- :size="size"
|
|
|
|
- icon="el-icon-delete"
|
|
|
|
- type="danger"
|
|
|
|
- @click="multipleDelete"
|
|
|
|
- >删除
|
|
|
|
|
|
+ <template #menu="{ row }">
|
|
|
|
+ <el-button v-if="row.state == '0'" type="primary" @click="sendMsg(row)"
|
|
|
|
+ >发送
|
|
</el-button>
|
|
</el-button>
|
|
</template>
|
|
</template>
|
|
</avue-crud>
|
|
</avue-crud>
|
|
@@ -49,9 +49,25 @@ import { useCrud } from "@/hooks/userCrud";
|
|
import { useDictionaryStore } from "@/store";
|
|
import { useDictionaryStore } from "@/store";
|
|
import MultiUpload from "@/components/Upload/MultiUpload.vue";
|
|
import MultiUpload from "@/components/Upload/MultiUpload.vue";
|
|
import FilesUpload from "@/components/Upload/FilesUpload.vue";
|
|
import FilesUpload from "@/components/Upload/FilesUpload.vue";
|
|
|
|
+import { sendMessage } from "@/api/message/index.ts";
|
|
|
|
|
|
const userTableRef = ref(null);
|
|
const userTableRef = ref(null);
|
|
|
|
|
|
|
|
+const photoUrlList = ref([]);
|
|
|
|
+const photoNameList = ref([]);
|
|
|
|
+const photoChange = () => {
|
|
|
|
+ if (photoUrlList.value.length > 0) {
|
|
|
|
+ form.value.fileLists = [
|
|
|
|
+ {
|
|
|
|
+ name: photoNameList.value[0],
|
|
|
|
+ path: photoUrlList.value[0],
|
|
|
|
+ },
|
|
|
|
+ ];
|
|
|
|
+ } else {
|
|
|
|
+ form.value.fileLists = [];
|
|
|
|
+ }
|
|
|
|
+};
|
|
|
|
+
|
|
// 数据字典相关
|
|
// 数据字典相关
|
|
const { dicts } = useDictionaryStore();
|
|
const { dicts } = useDictionaryStore();
|
|
|
|
|
|
@@ -68,6 +84,7 @@ const crudRef = ref(null); //crudRef.value 获取avue-crud对象
|
|
|
|
|
|
const messageType = ref("");
|
|
const messageType = ref("");
|
|
const route = useRoute();
|
|
const route = useRoute();
|
|
|
|
+
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
search.value.messageId = "10";
|
|
search.value.messageId = "10";
|
|
search.value.type = messageType.value = route.params.type;
|
|
search.value.type = messageType.value = route.params.type;
|
|
@@ -84,10 +101,19 @@ onMounted(() => {
|
|
dataList();
|
|
dataList();
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+const sendMsg = (row) => {
|
|
|
|
+ sendMessage(row.id).then(() => {
|
|
|
|
+ page.value.currentPage = 1;
|
|
|
|
+ dataList();
|
|
|
|
+ });
|
|
|
|
+};
|
|
|
|
+
|
|
// 设置表格列或者其他自定义的option
|
|
// 设置表格列或者其他自定义的option
|
|
option.value = Object.assign(option.value, {
|
|
option.value = Object.assign(option.value, {
|
|
selection: true,
|
|
selection: true,
|
|
editBtn: false,
|
|
editBtn: false,
|
|
|
|
+ viewBtn: false,
|
|
|
|
+ delBtn: false,
|
|
column: [
|
|
column: [
|
|
{
|
|
{
|
|
label: "创建人",
|
|
label: "创建人",
|
|
@@ -99,6 +125,7 @@ option.value = Object.assign(option.value, {
|
|
label: "消息标题",
|
|
label: "消息标题",
|
|
prop: "title",
|
|
prop: "title",
|
|
search: true,
|
|
search: true,
|
|
|
|
+ rules: [{ required: true }],
|
|
},
|
|
},
|
|
{
|
|
{
|
|
label: "用户id ",
|
|
label: "用户id ",
|
|
@@ -163,6 +190,8 @@ option.value = Object.assign(option.value, {
|
|
search: true,
|
|
search: true,
|
|
type: "textarea",
|
|
type: "textarea",
|
|
overHidden: true,
|
|
overHidden: true,
|
|
|
|
+ required: true,
|
|
|
|
+ rules: [{ required: true }],
|
|
},
|
|
},
|
|
{
|
|
{
|
|
label: "消息类型",
|
|
label: "消息类型",
|