Merge branch 'main' of http://47.92.168.204:3000/VoRDM/vordm-admin
# Conflicts: # src/views/responseManagement/userResponse/index.vue
This commit is contained in:
commit
37ab2316be
|
@ -82,3 +82,16 @@ export const deleteData = (id) => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改实体数据
|
||||||
|
* @param data
|
||||||
|
* @returns {Promise<AxiosResponse<any>>}
|
||||||
|
*/
|
||||||
|
export const updateEntityData = (data) => {
|
||||||
|
return request({
|
||||||
|
url: '/api/' + moduleName + '/ui/EntityData/updateEntityData',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<el-dialog title="upload" v-model="state.isShowDialog" width="700px">
|
<el-dialog title="upload" v-model="state.isShowDialog" width="500px">
|
||||||
<el-form :model="state.ruleForm" size="default" label-width="120px" :rules="rules" ref="adminAddFormRef">
|
<el-form :model="state.ruleForm" size="default" label-width="120px" :rules="rules" ref="adminAddFormRef" style="margin-left: 6%;">
|
||||||
<el-form-item label="upload picture" prop="img">
|
<el-form-item label="upload picture" prop="img">
|
||||||
<el-upload ref="upFileRef" class="upload-demo" drag accept="image/*" action="#" multiple :http-request="uploadPic"
|
<el-upload ref="upFileRef" class="upload-demo" drag accept="image/*" action="#" multiple :http-request="uploadPic"
|
||||||
:on-remove="removePic" :before-upload="beforeUpload">
|
:on-remove="removePic" :before-upload="beforeUpload">
|
||||||
|
@ -15,6 +15,10 @@
|
||||||
</template>
|
</template>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item prop="title" label="data title">
|
||||||
|
<el-input v-model="state.ruleForm.title" class="m-2" placeholder="please enter data title" :rows="3"
|
||||||
|
type="text" style="width:220px;" />
|
||||||
|
</el-form-item>
|
||||||
<el-form-item prop="type" label="data type">
|
<el-form-item prop="type" label="data type">
|
||||||
<el-select v-model="state.ruleForm.type" class="m-2" placeholder="please select data type">
|
<el-select v-model="state.ruleForm.type" class="m-2" placeholder="please select data type">
|
||||||
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
|
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
|
||||||
|
@ -149,6 +153,7 @@ const onSubmit = () => {
|
||||||
state.dataForm.append('remark', state.ruleForm.remark);
|
state.dataForm.append('remark', state.ruleForm.remark);
|
||||||
state.dataForm.append('disasterId', state.disasterId);
|
state.dataForm.append('disasterId', state.disasterId);
|
||||||
state.dataForm.append('visualFlag', state.ruleForm.visualFlag);
|
state.dataForm.append('visualFlag', state.ruleForm.visualFlag);
|
||||||
|
state.dataForm.append('title', state.ruleForm.title);
|
||||||
for (let [a, b] of state.dataForm.entries()) {
|
for (let [a, b] of state.dataForm.entries()) {
|
||||||
console.log(a, b, '--------------');
|
console.log(a, b, '--------------');
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<div class="system-role-padding layout-padding-auto layout-padding-view">
|
<div class="system-role-padding layout-padding-auto layout-padding-view">
|
||||||
<el-table :data="state.disasterData.data" v-loading="state.disasterData.loading" style="width: 100%"
|
<el-table :data="state.disasterData.data" v-loading="state.disasterData.loading" style="width: 100%"
|
||||||
highlight-current-row @row-click="tableClick">
|
highlight-current-row @row-click="tableClick">
|
||||||
<el-table-column prop="vordmId" label="ID" width="118" />
|
<el-table-column prop="vordmId" label="VoRDM ID" width="118" />
|
||||||
<el-table-column prop="disasterType" label="Disaster type" show-overflow-tooltip></el-table-column>
|
<el-table-column prop="disasterType" label="Disaster type" show-overflow-tooltip></el-table-column>
|
||||||
<el-table-column prop="disasterCountry" label="Disaster country" show-overflow-tooltip></el-table-column>
|
<el-table-column prop="disasterCountry" label="Disaster country" show-overflow-tooltip></el-table-column>
|
||||||
<el-table-column prop="disasterTime" label="Disaster time" show-overflow-tooltip></el-table-column>
|
<el-table-column prop="disasterTime" label="Disaster time" show-overflow-tooltip></el-table-column>
|
||||||
|
@ -50,8 +50,14 @@
|
||||||
<el-table :data="state.tableData.data" v-loading="state.tableData.loading"
|
<el-table :data="state.tableData.data" v-loading="state.tableData.loading"
|
||||||
@selection-change="handleSelectionChange" style="width: 100%">
|
@selection-change="handleSelectionChange" style="width: 100%">
|
||||||
<el-table-column type="selection" width="55" />
|
<el-table-column type="selection" width="55" />
|
||||||
<el-table-column prop="uploaderName" label="Uploader name" show-overflow-tooltip></el-table-column>
|
<el-table-column prop="uploaderName" label="Uploader name" width="100" show-overflow-tooltip></el-table-column>
|
||||||
<el-table-column prop="sourceOrganization" label="Organization" show-overflow-tooltip></el-table-column>
|
<el-table-column prop="sourceOrganization" label="Organization" show-overflow-tooltip></el-table-column>
|
||||||
|
<el-table-column prop="isPublish" label="isPublish" width="100" show-overflow-tooltip>
|
||||||
|
<template #default=" scope ">
|
||||||
|
<el-tag type="warning" v-if=" scope.row.isPublish == 0 ">NO</el-tag>
|
||||||
|
<el-tag type="success" v-if=" scope.row.isPublish == 1 ">YES</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column prop="title" label="Professional title" show-overflow-tooltip
|
<el-table-column prop="title" label="Professional title" show-overflow-tooltip
|
||||||
width="150"></el-table-column>
|
width="150"></el-table-column>
|
||||||
<el-table-column prop="size" label="Data size" show-overflow-tooltip>
|
<el-table-column prop="size" label="Data size" show-overflow-tooltip>
|
||||||
|
@ -63,6 +69,7 @@
|
||||||
<el-table-column prop="Operate" label="Operate" show-overflow-tooltip>
|
<el-table-column prop="Operate" label="Operate" show-overflow-tooltip>
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button size="small" text type="primary" @click="del(scope.row)">Delete</el-button>
|
<el-button size="small" text type="primary" @click="del(scope.row)">Delete</el-button>
|
||||||
|
<el-button v-if="scope.row.visualFlag == 1" size="small" text type="primary" @click="pub(scope.row)">Publish</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
@ -84,7 +91,7 @@
|
||||||
import en from 'element-plus/dist/locale/en.mjs'
|
import en from 'element-plus/dist/locale/en.mjs'
|
||||||
import type { TabsPaneContext } from 'element-plus';
|
import type { TabsPaneContext } from 'element-plus';
|
||||||
import Upload from './component/upload.vue';
|
import Upload from './component/upload.vue';
|
||||||
import { getOtherDataPage, getDisasterPage, deleteData } from '/@/api/data/otherData.js'
|
import { getOtherDataPage, getDisasterPage, deleteData, updateEntityData } from '/@/api/data/otherData.js'
|
||||||
const activeName = ref('first');
|
const activeName = ref('first');
|
||||||
|
|
||||||
//复制内容
|
//复制内容
|
||||||
|
@ -166,8 +173,8 @@ const getDisasterData = () => {
|
||||||
state.disasterData.loading = true;
|
state.disasterData.loading = true;
|
||||||
getDisasterPage(state.disasterData.param.pageNum, state.disasterData.param.pageSize, {}).then(res => {
|
getDisasterPage(state.disasterData.param.pageNum, state.disasterData.param.pageSize, {}).then(res => {
|
||||||
state.disasterData.data = res.records;
|
state.disasterData.data = res.records;
|
||||||
state.disasterData.data.forEach(item=>{
|
state.disasterData.data.forEach(item => {
|
||||||
let date = item.disasterTime.slice(0,10);
|
let date = item.disasterTime.slice(0, 10);
|
||||||
item.disasterTime = date;
|
item.disasterTime = date;
|
||||||
})
|
})
|
||||||
state.disasterData.total = res.total;
|
state.disasterData.total = res.total;
|
||||||
|
@ -237,6 +244,17 @@ const del = (row) => {
|
||||||
})
|
})
|
||||||
.catch(() => { });
|
.catch(() => { });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 删除其他数据
|
||||||
|
const pub = (row) => {
|
||||||
|
console.log(row, "发布信息");
|
||||||
|
updateEntityData().then(da => {
|
||||||
|
|
||||||
|
})
|
||||||
|
};
|
||||||
|
|
||||||
// 分页改变
|
// 分页改变
|
||||||
const onHandleDisasterSizeChange = (val) => {
|
const onHandleDisasterSizeChange = (val) => {
|
||||||
state.disasterData.param.pageSize = val;
|
state.disasterData.param.pageSize = val;
|
||||||
|
@ -280,6 +298,7 @@ onMounted(() => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt15 {
|
.mt15 {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: end;
|
justify-content: end;
|
||||||
|
|
|
@ -2,17 +2,8 @@
|
||||||
<el-dialog title="upload" v-model="state.isShowDialog" width="700px">
|
<el-dialog title="upload" v-model="state.isShowDialog" width="700px">
|
||||||
<el-form :model="state.ruleForm" size="default" label-width="150px" :rules="rules" ref="adminAddFormRef">
|
<el-form :model="state.ruleForm" size="default" label-width="150px" :rules="rules" ref="adminAddFormRef">
|
||||||
<el-form-item label="upload picture" prop="img">
|
<el-form-item label="upload picture" prop="img">
|
||||||
<el-upload
|
<el-upload ref="upFileRef" class="upload-demo" drag accept="image/*" action="#" multiple :http-request="uploadPic"
|
||||||
ref="upFileRef"
|
:on-remove="removePic" :before-upload="beforeUpload">
|
||||||
class="upload-demo"
|
|
||||||
drag
|
|
||||||
accept="image/*"
|
|
||||||
action="#"
|
|
||||||
multiple
|
|
||||||
:http-request="uploadPic"
|
|
||||||
:on-remove="removePic"
|
|
||||||
:before-upload="beforeUpload"
|
|
||||||
>
|
|
||||||
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
|
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
|
||||||
<div class="el-upload__text">
|
<div class="el-upload__text">
|
||||||
Drop file here or <em>click to upload</em>
|
Drop file here or <em>click to upload</em>
|
||||||
|
@ -24,16 +15,14 @@
|
||||||
</template>
|
</template>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item prop="title" label="data title">
|
||||||
|
<el-input v-model="state.ruleForm.title" class="m-2" placeholder="please enter data title" :rows="3" type="text"
|
||||||
|
style="width:220px;" />
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="Home page show" prop="isMain">
|
<el-form-item label="Home page show" prop="isMain">
|
||||||
<el-select v-model="state.ruleForm.isMain" class="m-2" placeholder="please select home show">
|
<el-select v-model="state.ruleForm.isMain" class="m-2" placeholder="please select home show">
|
||||||
<el-option
|
<el-option label="show" value="1"></el-option>
|
||||||
label="show"
|
<el-option label="not show" value="0"></el-option>
|
||||||
value="1"
|
|
||||||
></el-option>
|
|
||||||
<el-option
|
|
||||||
label="not show"
|
|
||||||
value="0"
|
|
||||||
></el-option>
|
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
@ -47,46 +36,46 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {reactive, ref} from "vue";
|
import { reactive, ref } from "vue";
|
||||||
import {uploadData} from '/@/api/data/pictureInfo.js';
|
import { uploadData } from '/@/api/data/pictureInfo.js';
|
||||||
import {ElMessage} from "element-plus";
|
import { ElMessage } from "element-plus";
|
||||||
import { UploadFilled } from '@element-plus/icons-vue'
|
import { UploadFilled } from '@element-plus/icons-vue'
|
||||||
const upFileRef = ref();
|
const upFileRef = ref();
|
||||||
const emit = defineEmits(['callback']);
|
const emit = defineEmits(['callback']);
|
||||||
const adminAddFormRef = ref();
|
const adminAddFormRef = ref();
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
isShowDialog: false,
|
isShowDialog: false,
|
||||||
isLoading:false,
|
isLoading: false,
|
||||||
ruleForm: {
|
ruleForm: {
|
||||||
},
|
},
|
||||||
tableData: [],
|
tableData: [],
|
||||||
//字典值
|
//字典值
|
||||||
dictData: [],
|
dictData: [],
|
||||||
unitData:[],
|
unitData: [],
|
||||||
standardId: '',
|
standardId: '',
|
||||||
detectionData: [],
|
detectionData: [],
|
||||||
disasterId:null,
|
disasterId: null,
|
||||||
dataForm:new FormData(),
|
dataForm: new FormData(),
|
||||||
fileArray:[],
|
fileArray: [],
|
||||||
})
|
})
|
||||||
const validImg = (rule, value, callback) => {
|
const validImg = (rule, value, callback) => {
|
||||||
if(state.fileArray.length>0){
|
if (state.fileArray.length > 0) {
|
||||||
adminAddFormRef.value.clearValidate('img')
|
adminAddFormRef.value.clearValidate('img')
|
||||||
callback();
|
callback();
|
||||||
}else{
|
} else {
|
||||||
return callback(new Error('please upload image'));
|
return callback(new Error('please upload image'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//校验规则
|
//校验规则
|
||||||
const rules = reactive({
|
const rules = reactive({
|
||||||
img: [
|
img: [
|
||||||
{required: true,trigger: 'change',validator:validImg}
|
{ required: true, trigger: 'change', validator: validImg }
|
||||||
],
|
],
|
||||||
isMain: [
|
isMain: [
|
||||||
{required: true, message: 'please select home page show', trigger: 'change'}
|
{ required: true, message: 'please select home page show', trigger: 'change' }
|
||||||
],
|
],
|
||||||
remark:[
|
remark: [
|
||||||
{required: true, message: 'please select data details', trigger: 'blur'}
|
{ required: true, message: 'please select data details', trigger: 'blur' }
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
//图片上传之前
|
//图片上传之前
|
||||||
|
@ -103,7 +92,7 @@ const uploadPic = (data) => {
|
||||||
}
|
}
|
||||||
//移除时
|
//移除时
|
||||||
const removePic = (data) => {
|
const removePic = (data) => {
|
||||||
state.fileArray.splice(state.fileArray.findIndex(item=>item.uid===data.raw.uid), 1)
|
state.fileArray.splice(state.fileArray.findIndex(item => item.uid === data.raw.uid), 1)
|
||||||
console.log(state.fileArray)
|
console.log(state.fileArray)
|
||||||
}
|
}
|
||||||
//重置表单
|
//重置表单
|
||||||
|
@ -134,18 +123,19 @@ const onSubmit = () => {
|
||||||
adminAddFormRef.value.validate((valid, fields) => {
|
adminAddFormRef.value.validate((valid, fields) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
state.isLoading = true;
|
state.isLoading = true;
|
||||||
state.fileArray.forEach(item=>{
|
state.fileArray.forEach(item => {
|
||||||
state.dataForm.append('file',item);
|
state.dataForm.append('file', item);
|
||||||
})
|
})
|
||||||
state.dataForm.append('disasterId',state.disasterId);
|
state.dataForm.append('disasterId', state.disasterId);
|
||||||
state.dataForm.append('isMain',state.ruleForm.isMain);
|
state.dataForm.append('isMain', state.ruleForm.isMain);
|
||||||
for(let [a, b] of state.dataForm.entries()){
|
state.dataForm.append('title', state.ruleForm.title);
|
||||||
|
for (let [a, b] of state.dataForm.entries()) {
|
||||||
console.log(a, b, '--------------');
|
console.log(a, b, '--------------');
|
||||||
}
|
}
|
||||||
uploadData(state.dataForm).then(res => {
|
uploadData(state.dataForm).then(res => {
|
||||||
ElMessage.success("Upload successfully");
|
ElMessage.success("Upload successfully");
|
||||||
emit('callback');
|
emit('callback');
|
||||||
}).finally(()=>{
|
}).finally(() => {
|
||||||
state.isLoading = false;
|
state.isLoading = false;
|
||||||
})
|
})
|
||||||
closeDialog();
|
closeDialog();
|
||||||
|
@ -160,6 +150,4 @@ defineExpose({
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped></style>
|
||||||
|
|
||||||
</style>
|
|
|
@ -65,16 +65,6 @@
|
||||||
</el-popover>
|
</el-popover>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<!-- <el-table-column prop="size"
|
|
||||||
label="size"
|
|
||||||
show-overflow-tooltip>
|
|
||||||
<template #default="scope">
|
|
||||||
{{formatSizeUnits(scope.row.size)}}
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="type"
|
|
||||||
label="type"
|
|
||||||
show-overflow-tooltip></el-table-column>-->
|
|
||||||
<el-table-column prop="Operate" label="Operate" show-overflow-tooltip>
|
<el-table-column prop="Operate" label="Operate" show-overflow-tooltip>
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button size="small" text type="primary" @click="editData(scope.row)">Edit</el-button>
|
<el-button size="small" text type="primary" @click="editData(scope.row)">Edit</el-button>
|
||||||
|
@ -146,9 +136,7 @@ const handleSelectionChange = (val) => {
|
||||||
};
|
};
|
||||||
//格式化图片名称
|
//格式化图片名称
|
||||||
const formatName = (name) => {
|
const formatName = (name) => {
|
||||||
if (name) {
|
|
||||||
return name.substr(0, name.indexOf('.'));
|
|
||||||
}
|
|
||||||
return name;
|
return name;
|
||||||
};
|
};
|
||||||
const auditData = (row) => {
|
const auditData = (row) => {
|
||||||
|
|
|
@ -25,17 +25,15 @@
|
||||||
</div>
|
</div>
|
||||||
<el-table :data="state.tableData.data" v-loading="state.tableData.loading"
|
<el-table :data="state.tableData.data" v-loading="state.tableData.loading"
|
||||||
@selection-change="handleSelectionChange" style="width: 100%">
|
@selection-change="handleSelectionChange" style="width: 100%">
|
||||||
<el-table-column type="selection" width="55" />
|
<el-table-column prop="disasterType" label="DisasterType" show-overflow-tooltip sortable></el-table-column>
|
||||||
<el-table-column type="index" label="ID" width="50" />
|
<el-table-column prop="disasterCountry" label="DisasterCountry" show-overflow-tooltip sortable></el-table-column>
|
||||||
<el-table-column prop="disasterType" label="DisasterType" show-overflow-tooltip></el-table-column>
|
<el-table-column prop="disasterTime" label="disasterTime" show-overflow-tooltip sortable></el-table-column>
|
||||||
<el-table-column prop="disasterCountry" label="DisasterCountry" show-overflow-tooltip></el-table-column>
|
<el-table-column prop="managerName" label="ManagerName" show-overflow-tooltip sortable></el-table-column>
|
||||||
<el-table-column prop="disasterKeyword" label="DisasterKeyword" show-overflow-tooltip></el-table-column>
|
<el-table-column prop="sponsorOrganization" label="SponsorOrganization" show-overflow-tooltip sortable></el-table-column>
|
||||||
<el-table-column prop="managerName" label="ManagerName" show-overflow-tooltip></el-table-column>
|
<el-table-column prop="researchField" label="ResearchField" show-overflow-tooltip sortable></el-table-column>
|
||||||
<el-table-column prop="sponsorOrganization" label="SponsorOrganization" show-overflow-tooltip></el-table-column>
|
<el-table-column prop="occupation" label="occupation" show-overflow-tooltip sortable></el-table-column>
|
||||||
<el-table-column prop="researchField" label="ResearchField" show-overflow-tooltip></el-table-column>
|
<el-table-column prop="applyTime" label="applyTime" show-overflow-tooltip sortable></el-table-column>
|
||||||
<el-table-column prop="occupation" label="occupation" show-overflow-tooltip></el-table-column>
|
<el-table-column v-if="state.status == '1'" prop="reviewTime" label="reviewTime" show-overflow-tooltip sortable></el-table-column>
|
||||||
<el-table-column prop="applyTime" label="applyTime" show-overflow-tooltip></el-table-column>
|
|
||||||
<el-table-column v-if="state.status == '1'" prop="reviewTime" label="reviewTime" show-overflow-tooltip></el-table-column>
|
|
||||||
<el-table-column v-if="state.status == '0'" prop="Operate" label="Operate" show-overflow-tooltip>
|
<el-table-column v-if="state.status == '0'" prop="Operate" label="Operate" show-overflow-tooltip>
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<!-- <el-button link type="primary" size="small" @click="handleClick">Detail</el-button>-->
|
<!-- <el-button link type="primary" size="small" @click="handleClick">Detail</el-button>-->
|
||||||
|
@ -113,6 +111,10 @@ const getTableData = () => {
|
||||||
state.tableData.loading = true;
|
state.tableData.loading = true;
|
||||||
getAdminManagerPage(state.tableData.param.pageNum, state.tableData.param.pageSize, { "managerName": state.searchName,"status": state.status}).then(res => {
|
getAdminManagerPage(state.tableData.param.pageNum, state.tableData.param.pageSize, { "managerName": state.searchName,"status": state.status}).then(res => {
|
||||||
state.tableData.data = res.records;
|
state.tableData.data = res.records;
|
||||||
|
state.tableData.data.forEach(item => {
|
||||||
|
let date = item.disasterTime.slice(0, 10);
|
||||||
|
item.disasterTime = date;
|
||||||
|
})
|
||||||
state.tableData.total = res.total;
|
state.tableData.total = res.total;
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue