|
@@ -26,6 +26,14 @@
|
|
|
@finished="onUploadFinish"
|
|
|
/>
|
|
|
</template>
|
|
|
+ <template #menu="{ row }">
|
|
|
+ <el-button v-if="row.state == 1" style="color: red" link @click="sendMsg(row)">
|
|
|
+ <el-icon>
|
|
|
+ <Delete/>
|
|
|
+ </el-icon>
|
|
|
+ 过期
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
</avue-crud>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -42,6 +50,7 @@ import {
|
|
|
} from "@/api/user/index";
|
|
|
import SingleUpload from "@/components/Upload/SingleUpload.vue";
|
|
|
import FilesUpload from "@/components/Upload/FilesUpload.vue";
|
|
|
+import {endMessage} from "@/api/message/index";
|
|
|
// 传入一个url,后面不带/
|
|
|
const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
|
|
|
useCrud({
|
|
@@ -61,7 +70,11 @@ const getDeptList = async () => {
|
|
|
deptList.value = res.data ?? []; //获取部门列表
|
|
|
}
|
|
|
};
|
|
|
-
|
|
|
+const sendMsg = (row) => {
|
|
|
+ endMessage(row.id).then(() => {
|
|
|
+ dataList();
|
|
|
+ });
|
|
|
+};
|
|
|
// 设置表格列或者其他自定义的option
|
|
|
option.value = Object.assign(option.value, {
|
|
|
editBtn: true, //是否显示编辑按钮
|
|
@@ -80,6 +93,13 @@ option.value = Object.assign(option.value, {
|
|
|
label: "文件标题",
|
|
|
prop: "fileTitle",
|
|
|
search: true,
|
|
|
+ rules: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: "请输入文件标题",
|
|
|
+ trigger: "blur",
|
|
|
+ },
|
|
|
+ ],
|
|
|
},
|
|
|
{
|
|
|
label: "描述",
|
|
@@ -87,10 +107,34 @@ option.value = Object.assign(option.value, {
|
|
|
search: false,
|
|
|
},
|
|
|
{
|
|
|
+ label: "是否过期",
|
|
|
+ prop: "state",
|
|
|
+ search: false,
|
|
|
+ type: "radio", //类型为单选框
|
|
|
+ dicData: [
|
|
|
+ {
|
|
|
+ label: "过期",
|
|
|
+ value: 0,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "正常",
|
|
|
+ value: 1,
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ value: 1,
|
|
|
+ },
|
|
|
+ {
|
|
|
label: "文件上传",
|
|
|
prop: "fileUrl",
|
|
|
slot: true,
|
|
|
hide: true,
|
|
|
+ rules: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: "请选择文件",
|
|
|
+ trigger: "blur",
|
|
|
+ },
|
|
|
+ ],
|
|
|
},
|
|
|
{
|
|
|
label: "创建人",
|