mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-13 12:56:45 +08:00
Merge branch 'master' of ssh://gitlab.dongwu-inc.com:10022/BOE/fe-manage
This commit is contained in:
@@ -16,6 +16,8 @@ http.interceptors.request.use(
|
|||||||
config.headers.token = token;
|
config.headers.token = token;
|
||||||
} else {
|
} else {
|
||||||
console.log("当前请求页面无token,请执行操作!!!")
|
console.log("当前请求页面无token,请执行操作!!!")
|
||||||
|
// 此处测试默认配置token
|
||||||
|
config.headers.token = "123456";
|
||||||
}
|
}
|
||||||
return config;
|
return config;
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -51,13 +51,21 @@ export const createProject = (obj) => http.post('/admin/project/edit', {
|
|||||||
"name": obj.name,
|
"name": obj.name,
|
||||||
"notice": obj.notice,
|
"notice": obj.notice,
|
||||||
"noticeFlag": obj.noticeFlag,
|
"noticeFlag": obj.noticeFlag,
|
||||||
"parentId": obj.parentId,
|
|
||||||
"picUrl": obj.picUrl,
|
"picUrl": obj.picUrl,
|
||||||
"projectId": obj.projectId,
|
|
||||||
"remark": obj.remark,
|
"remark": obj.remark,
|
||||||
"sourceBelongId": obj.sourceBelongId,
|
"sourceBelongId": obj.sourceBelongId,
|
||||||
"status": obj.status,
|
"status": obj.status,
|
||||||
"systemId": obj.systemId,
|
"systemId": obj.systemId,
|
||||||
"templateId": obj.templateId,
|
"templateId": obj.templateId,
|
||||||
"type": obj.type
|
"type": obj.type
|
||||||
|
})
|
||||||
|
|
||||||
|
// 创建多层项目
|
||||||
|
export const createStoreyProject = () => http.post('/admin/project/edit', {
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
// 获取项目列表
|
||||||
|
export const getProjectList = () => http.post('/admin/project/list', {
|
||||||
|
|
||||||
})
|
})
|
||||||
@@ -42,6 +42,7 @@
|
|||||||
border: 1px solid rgba(78, 166, 255, 1);
|
border: 1px solid rgba(78, 166, 255, 1);
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
position: relative;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
">
|
">
|
||||||
<a-upload v-model:file-list="fileList" name="file" list-type="picture-card" class="avatar-uploader"
|
<a-upload v-model:file-list="fileList" name="file" list-type="picture-card" class="avatar-uploader"
|
||||||
@@ -77,8 +78,8 @@
|
|||||||
<div class="in select">
|
<div class="in select">
|
||||||
<a-select :getPopupContainer="triggerNode => {
|
<a-select :getPopupContainer="triggerNode => {
|
||||||
return triggerNode.parentNode || document.body
|
return triggerNode.parentNode || document.body
|
||||||
}" :value="classifySelect1" placeholder="请选择项目经理" style="width: 100%" :options="classifyList1" allowClear
|
}" :value="classifySelect1" placeholder="请选择项目经理" style="width: 100%" :options="classifyList1"
|
||||||
showSearch>
|
@change="classificationChange1" allowClear showSearch>
|
||||||
</a-select>
|
</a-select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -118,7 +119,7 @@
|
|||||||
<div class="inname">项目级别</div>
|
<div class="inname">项目级别</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="in">
|
<div class="in">
|
||||||
<a-input v-model:value="valueE" placeholder="集团级/组织级/现地级/部门级" />
|
<a-input v-model:value="valueE1" placeholder="集团级/组织级/现地级/部门级" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="name">
|
<div class="name">
|
||||||
@@ -127,7 +128,7 @@
|
|||||||
<div class="inname">培训体系</div>
|
<div class="inname">培训体系</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="in">
|
<div class="in">
|
||||||
<a-input v-model:value="valueE" placeholder="集团级/组织级/现地级/部门级" />
|
<a-input v-model:value="valueE2" placeholder="集团级/组织级/现地级/部门级" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="name">
|
<div class="name">
|
||||||
@@ -152,7 +153,7 @@
|
|||||||
<div>
|
<div>
|
||||||
<img v-if="fileList1.length < 6" class="fileimg" src="../../assets/images/projectadd/enclosure.png" />
|
<img v-if="fileList1.length < 6" class="fileimg" src="../../assets/images/projectadd/enclosure.png" />
|
||||||
<a-upload :disabled="fileList1.length > 5" :before-upload="beforeUpload1" v-model:file-list="fileList1"
|
<a-upload :disabled="fileList1.length > 5" :before-upload="beforeUpload1" v-model:file-list="fileList1"
|
||||||
name="file" action="/api/file/upload" :headers="headers" @change="handleChange1">
|
@remove="removeFile" name="file" action="/api/file/upload" :headers="headers" @change="handleChange1">
|
||||||
<!-- <a-button> -->
|
<!-- <a-button> -->
|
||||||
<!-- <upload-outlined></upload-outlined> -->
|
<!-- <upload-outlined></upload-outlined> -->
|
||||||
<span v-if="fileList1.length > 5" class="filetext">上传数量已经达到最大值</span>
|
<span v-if="fileList1.length > 5" class="filetext">上传数量已经达到最大值</span>
|
||||||
@@ -196,7 +197,10 @@ export default {
|
|||||||
classifySelect: null,
|
classifySelect: null,
|
||||||
classifySelectId: null,
|
classifySelectId: null,
|
||||||
checked: false,
|
checked: false,
|
||||||
checked1: false
|
checked1: false,
|
||||||
|
valueE: null,
|
||||||
|
valueE1: null,
|
||||||
|
valueE2: null
|
||||||
});
|
});
|
||||||
|
|
||||||
const projectName = ref('');
|
const projectName = ref('');
|
||||||
@@ -224,6 +228,7 @@ export default {
|
|||||||
const fileList1 = ref([]);
|
const fileList1 = ref([]);
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const imageUrl = ref('');
|
const imageUrl = ref('');
|
||||||
|
let picUrl = '';
|
||||||
|
|
||||||
const handleChange = (info) => {
|
const handleChange = (info) => {
|
||||||
if (info.file.status === 'uploading') {
|
if (info.file.status === 'uploading') {
|
||||||
@@ -232,6 +237,7 @@ export default {
|
|||||||
}
|
}
|
||||||
if (info.file.status === 'done') {
|
if (info.file.status === 'done') {
|
||||||
console.log('上传图片返回的信息 %o', info)
|
console.log('上传图片返回的信息 %o', info)
|
||||||
|
picUrl = info.file.response.data;
|
||||||
// Get this url from response in real world.
|
// Get this url from response in real world.
|
||||||
getBase64(info.file.originFileObj, (base64Url) => {
|
getBase64(info.file.originFileObj, (base64Url) => {
|
||||||
imageUrl.value = base64Url;
|
imageUrl.value = base64Url;
|
||||||
@@ -246,6 +252,8 @@ export default {
|
|||||||
|
|
||||||
let uplodaFileCount = false;
|
let uplodaFileCount = false;
|
||||||
|
|
||||||
|
let attach = "";
|
||||||
|
let attachData = "";
|
||||||
const handleChange1 = (info) => {
|
const handleChange1 = (info) => {
|
||||||
if (info.file.status === 'uploading') {
|
if (info.file.status === 'uploading') {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
@@ -253,6 +261,19 @@ export default {
|
|||||||
}
|
}
|
||||||
if (info.file.status === 'done') {
|
if (info.file.status === 'done') {
|
||||||
console.log('上传附件返回的信息 %o', info, info.fileList.length, uplodaFileCount)
|
console.log('上传附件返回的信息 %o', info, info.fileList.length, uplodaFileCount)
|
||||||
|
|
||||||
|
let attachStr = "";
|
||||||
|
attachData = info.fileList;
|
||||||
|
for (let i = 0; i < attachData.length; i++) {
|
||||||
|
if (attachData.length - 1 == i) {
|
||||||
|
attachStr += attachData[i].response.data;
|
||||||
|
} else {
|
||||||
|
attachStr += attachData[i].response.data + ',';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
console.log(attachStr)
|
||||||
|
attach = attachStr;
|
||||||
|
|
||||||
if (info.fileList.length > 5) {
|
if (info.fileList.length > 5) {
|
||||||
uplodaFileCount = true;
|
uplodaFileCount = true;
|
||||||
} else {
|
} else {
|
||||||
@@ -287,12 +308,18 @@ export default {
|
|||||||
})
|
})
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let beginTime = "";
|
||||||
|
let endTime = "";
|
||||||
const onRangeChange = (value, dateString) => {
|
const onRangeChange = (value, dateString) => {
|
||||||
console.log('Selected Time: ', value);
|
console.log('Selected Time: ', value);
|
||||||
// 项目时间选择函数
|
// 项目时间选择函数
|
||||||
console.log('Formatted Selected Time: ', dateString);
|
console.log('Formatted Selected Time: ', dateString);
|
||||||
|
console.log('Formatted Selected TimeStamp', new Date(dateString[0]).getTime())
|
||||||
|
beginTime = new Date(dateString[0]).getTime();
|
||||||
|
endTime = new Date(dateString[1]).getTime();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// 项目经理 后续接口调用
|
// 项目经理 后续接口调用
|
||||||
const classifyList1 = ref([
|
const classifyList1 = ref([
|
||||||
{ value: 1, label: '李俊国' },
|
{ value: 1, label: '李俊国' },
|
||||||
@@ -300,22 +327,56 @@ export default {
|
|||||||
{ value: 3, label: '刘孟君' },
|
{ value: 3, label: '刘孟君' },
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
let manager = "";
|
||||||
|
let managerId = "";
|
||||||
|
const classificationChange1 = (key) => {
|
||||||
|
console.log(`selected ${key}`);
|
||||||
|
console.log(classifyList1.value[key - 1].label)
|
||||||
|
manager = String(classifyList1.value[key - 1].label)
|
||||||
|
managerId = String(key)
|
||||||
|
};
|
||||||
|
|
||||||
// 资源归属 sourceBelongId 后续给接口
|
// 资源归属 sourceBelongId 后续给接口
|
||||||
|
|
||||||
// 项目说明
|
// 项目说明
|
||||||
const remark = ref('');
|
const remark = ref('');
|
||||||
|
|
||||||
|
let courseSyncFlag = 0;
|
||||||
const changeChecked = () => {
|
const changeChecked = () => {
|
||||||
console.log(state.checked)
|
console.log(state.checked)
|
||||||
state.checked ? state.checked = false : state.checked = true;
|
state.checked ? state.checked = false : state.checked = true;
|
||||||
|
courseSyncFlag = state.checked ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let boeFlag = 0;
|
||||||
const changeChecked1 = () => {
|
const changeChecked1 = () => {
|
||||||
console.log(state.checked1)
|
console.log(state.checked1)
|
||||||
state.checked1 ? state.checked1 = false : state.checked1 = true;
|
state.checked1 ? state.checked1 = false : state.checked1 = true;
|
||||||
|
boeFlag = state.checked1 ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const removeFile = (file) => {
|
||||||
|
const index = fileList1.value.indexOf(file);
|
||||||
|
const newFileList = fileList1.value.slice();
|
||||||
|
newFileList.splice(index, 1);
|
||||||
|
fileList1.value = newFileList;
|
||||||
|
|
||||||
|
let attachStr = "";
|
||||||
|
if (newFileList.length == 0) {
|
||||||
|
attachStr = "";
|
||||||
|
}
|
||||||
|
for (let i = 0; i < fileList1["value"].length; i++) {
|
||||||
|
console.log(fileList1["value"][i].response.data)
|
||||||
|
if (fileList1["value"].length - 1 == i) {
|
||||||
|
attachStr += fileList1["value"][i].response.data;
|
||||||
|
} else {
|
||||||
|
attachStr += fileList1["value"][i].response.data + ',';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
attach = attachStr;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const errorMsgs = {
|
const errorMsgs = {
|
||||||
"name": "请输入项目名称",
|
"name": "请输入项目名称",
|
||||||
"type": "请选择项目分类",
|
"type": "请选择项目分类",
|
||||||
@@ -333,31 +394,29 @@ export default {
|
|||||||
|
|
||||||
const createProject = () => {
|
const createProject = () => {
|
||||||
let obj = {
|
let obj = {
|
||||||
"attach": "1",
|
|
||||||
"beginTime": 0,
|
|
||||||
"boeFlag": 0,
|
|
||||||
"category": 0,
|
|
||||||
"courseSyncFlag": 0,
|
|
||||||
"endTime": 0,
|
|
||||||
"level": 0,
|
|
||||||
"manager": "",
|
|
||||||
"managerId": "",
|
|
||||||
"name": projectName["value"],
|
"name": projectName["value"],
|
||||||
|
"type": projectType,
|
||||||
|
"picUrl": picUrl,
|
||||||
|
"beginTime": beginTime,
|
||||||
|
"endTime": endTime,
|
||||||
|
"manager": manager,
|
||||||
|
"managerId": managerId,
|
||||||
|
"sourceBelongId": 11,
|
||||||
|
"remark": remark["value"],
|
||||||
|
"courseSyncFlag": courseSyncFlag,
|
||||||
|
"level": 3,
|
||||||
|
"systemId": 4,
|
||||||
|
"boeFlag": boeFlag,
|
||||||
|
"attach": attach,
|
||||||
|
"templateId": 10,
|
||||||
|
|
||||||
|
"category": 0,
|
||||||
"notice": "",
|
"notice": "",
|
||||||
"noticeFlag": 0,
|
"noticeFlag": 0,
|
||||||
"parentId": 0,
|
"status": 0
|
||||||
"picUrl": "",
|
|
||||||
"projectId": 0,
|
|
||||||
"remark": remark["value"],
|
|
||||||
"sourceBelongId": 0,
|
|
||||||
"status": 0,
|
|
||||||
"systemId": 0,
|
|
||||||
"templateId": 0,
|
|
||||||
"type": projectType
|
|
||||||
}
|
}
|
||||||
console.log('提交的数据格式 %o', obj)
|
console.log('提交的数据格式 %o', obj)
|
||||||
|
for (let i in errorMsgs) {
|
||||||
for (let i in obj) {
|
|
||||||
console.log(obj[i])
|
console.log(obj[i])
|
||||||
if (obj[i] === "") {
|
if (obj[i] === "") {
|
||||||
message.destroy()
|
message.destroy()
|
||||||
@@ -378,6 +437,7 @@ export default {
|
|||||||
projectName,
|
projectName,
|
||||||
classifyList,
|
classifyList,
|
||||||
classificationChange,
|
classificationChange,
|
||||||
|
classificationChange1,
|
||||||
fileList,
|
fileList,
|
||||||
fileList1,
|
fileList1,
|
||||||
loading,
|
loading,
|
||||||
@@ -392,7 +452,8 @@ export default {
|
|||||||
changeChecked,
|
changeChecked,
|
||||||
changeChecked1,
|
changeChecked1,
|
||||||
uplodaFileCount,
|
uplodaFileCount,
|
||||||
createProject
|
createProject,
|
||||||
|
removeFile
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -443,6 +504,11 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 修改 antd upload 样式
|
||||||
|
.ant-upload {
|
||||||
|
border-width: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user