|
|
@@ -35,11 +35,11 @@
|
|
|
<el-date-picker type="datetime" placeholder="请选择有效期" v-model="uploadform.ValidityTime" style="width: 100%;"></el-date-picker>
|
|
|
</el-form-item>
|
|
|
</el-col> -->
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="版本信息" prop="VersionInfo">
|
|
|
- <el-input v-model="uploadform.VersionInfo" placeholder="请输入版本信息"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
+ <!--<el-col :span="8">-->
|
|
|
+ <!-- <el-form-item label="版本信息" prop="VersionInfo">-->
|
|
|
+ <!-- <el-input v-model="uploadform.VersionInfo" placeholder="请输入版本信息"></el-input>-->
|
|
|
+ <!-- </el-form-item>-->
|
|
|
+ <!--</el-col>-->
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="类型" prop="DocTab">
|
|
|
<el-select v-model="uploadform.RangeType" placeholder="请选择">
|
|
|
@@ -132,7 +132,7 @@
|
|
|
authUser: 'authUser'
|
|
|
})
|
|
|
},
|
|
|
- data() {
|
|
|
+ data () {
|
|
|
var CheckDirectoryId = (rule, value, callback) => {
|
|
|
if (this.JLDirectoryIds && this.JLDirectoryIds.length < 1) {
|
|
|
callback(new Error('请选择文档结构'))
|
|
|
@@ -150,24 +150,24 @@
|
|
|
label: 'ItemName',
|
|
|
children: 'children'
|
|
|
},
|
|
|
- orgtreelist: [], //文档结构
|
|
|
- JLDirectoryIds: [], //文档结构Id
|
|
|
+ orgtreelist: [], // 文档结构
|
|
|
+ JLDirectoryIds: [], // 文档结构Id
|
|
|
list: [],
|
|
|
// typeList: [], //文档类别列表
|
|
|
uploadform: {
|
|
|
- DirectoryId: '', //目录结构Id
|
|
|
- Name: '', //文档名称
|
|
|
- VersionInfo: '', //文档版本
|
|
|
- NoticeTab: '', //通知公告标签
|
|
|
- DocTab: '', //文件资料标签
|
|
|
+ DirectoryId: '', // 目录结构Id
|
|
|
+ Name: '', // 文档名称
|
|
|
+ VersionInfo: '', // 文档版本
|
|
|
+ NoticeTab: '', // 通知公告标签
|
|
|
+ DocTab: '', // 文件资料标签
|
|
|
RangeType: '',
|
|
|
- FileURL: '', //文档地址
|
|
|
- ValidityTime: '', //有效期至
|
|
|
- Remark: '', //备注
|
|
|
+ FileURL: '', // 文档地址
|
|
|
+ ValidityTime: '', // 有效期至
|
|
|
+ Remark: '' // 备注
|
|
|
},
|
|
|
AuthorUser: '',
|
|
|
AuthorUserName: '',
|
|
|
- loginDialogVisible: false, //登陆验证弹窗
|
|
|
+ loginDialogVisible: false, // 登陆验证弹窗
|
|
|
isLoginSucceed: false,
|
|
|
acceptUsers: [],
|
|
|
username: '',
|
|
|
@@ -189,10 +189,10 @@
|
|
|
trigger: 'blur'
|
|
|
}],
|
|
|
VersionInfo: [{
|
|
|
- required: true,
|
|
|
+ required: false,
|
|
|
message: '请填写版本信息',
|
|
|
trigger: 'blur'
|
|
|
- }],
|
|
|
+ }]
|
|
|
},
|
|
|
DocTaboptions: [
|
|
|
{
|
|
|
@@ -208,18 +208,18 @@
|
|
|
label: '外部'
|
|
|
}
|
|
|
],
|
|
|
- //标题设置
|
|
|
+ // 标题设置
|
|
|
path: '',
|
|
|
pathName: '',
|
|
|
- pathName2: '',
|
|
|
+ pathName2: ''
|
|
|
}
|
|
|
},
|
|
|
- created() {
|
|
|
+ created () {
|
|
|
this.documentId = this.$route.params.opera
|
|
|
this.initinfo()
|
|
|
},
|
|
|
methods: {
|
|
|
- initinfo() {
|
|
|
+ initinfo () {
|
|
|
let _this = this
|
|
|
this.$axios.get('/document/geteditinitinfo/' + this.documentId, {})
|
|
|
.then(res => {
|
|
|
@@ -245,11 +245,10 @@
|
|
|
// _this.typeList = list
|
|
|
_this.gettreelist(218)
|
|
|
_this.getwendanginfo(res.data.items.FileURL)
|
|
|
-
|
|
|
})
|
|
|
},
|
|
|
- //文档列表
|
|
|
- getwendanginfo(iUrl) {
|
|
|
+ // 文档列表
|
|
|
+ getwendanginfo (iUrl) {
|
|
|
let _this = this
|
|
|
_this.maintainlogattrlist = []
|
|
|
let exArr = iUrl.split('|')
|
|
|
@@ -259,18 +258,18 @@
|
|
|
}
|
|
|
_this.maintainlogattrlist.push(params)
|
|
|
},
|
|
|
- //获取文档结构树
|
|
|
- gettreelist(pid) {
|
|
|
+ // 获取文档结构树
|
|
|
+ gettreelist (pid) {
|
|
|
let _this = this
|
|
|
let params = {
|
|
|
pid: pid + ''
|
|
|
}
|
|
|
_this.$axios.get('/items/gettreeitemsdetail', {
|
|
|
- params
|
|
|
- })
|
|
|
+ params
|
|
|
+ })
|
|
|
.then(res => {
|
|
|
_this.orgtreelist = window.toolfun_gettreejson(res.data.items, 'Id', 'ParentId', 'Id,ItemName')
|
|
|
- //显示原来文档结构
|
|
|
+ // 显示原来文档结构
|
|
|
let arr = []
|
|
|
arr.push(_this.orgtreelist[0].id)
|
|
|
arr.push(_this.orgtreelist[0].children[0].id)
|
|
|
@@ -281,40 +280,40 @@
|
|
|
console.error(err)
|
|
|
})
|
|
|
},
|
|
|
- clickachment(url, uid) {
|
|
|
+ clickachment (url, uid) {
|
|
|
window.open(`http://${url}`)
|
|
|
},
|
|
|
- //保存编辑信息
|
|
|
- save() {
|
|
|
+ // 保存编辑信息
|
|
|
+ save () {
|
|
|
let _this = this
|
|
|
- this.$refs["uploadform"].validate((valid) => {
|
|
|
+ this.$refs['uploadform'].validate((valid) => {
|
|
|
if (valid) {
|
|
|
if (this.$refs.refuploadattach.uploadFiles && this.$refs.refuploadattach.uploadFiles.length > 0) {
|
|
|
- // 上传附件是否完成判断
|
|
|
+ // 上传附件是否完成判断
|
|
|
if (!this.attachissuccess()) {
|
|
|
this.$message.error('有附件未成功上传!不能保存数据')
|
|
|
return
|
|
|
}
|
|
|
- //判断是否存在已上传文档
|
|
|
+ // 判断是否存在已上传文档
|
|
|
if (_this.maintainlogattrlist.length > 0) {
|
|
|
_this.$confirm('此操作将更改现有文档, 是否继续?', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- _this.getattachissuccess()
|
|
|
- _this.editdocumentinfo() //保存编辑信息
|
|
|
- _this.getwendanginfo(_this.uploadform.FileURL) //更新已有文档列表
|
|
|
- // 清空上传数据
|
|
|
- if (_this.$refs.refuploadattach) {
|
|
|
- _this.$refs.refuploadattach.clearFiles()
|
|
|
- }
|
|
|
- })
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ _this.getattachissuccess()
|
|
|
+ _this.editdocumentinfo() // 保存编辑信息
|
|
|
+ _this.getwendanginfo(_this.uploadform.FileURL) // 更新已有文档列表
|
|
|
+ // 清空上传数据
|
|
|
+ if (_this.$refs.refuploadattach) {
|
|
|
+ _this.$refs.refuploadattach.clearFiles()
|
|
|
+ }
|
|
|
+ })
|
|
|
.catch(() => {})
|
|
|
} else {
|
|
|
_this.getattachissuccess()
|
|
|
- _this.editdocumentinfo() //保存编辑信息
|
|
|
- _this.getwendanginfo(_this.uploadform.FileURL) //更新已有文档列表
|
|
|
+ _this.editdocumentinfo() // 保存编辑信息
|
|
|
+ _this.getwendanginfo(_this.uploadform.FileURL) // 更新已有文档列表
|
|
|
// 清空上传数据
|
|
|
if (_this.$refs.refuploadattach) {
|
|
|
_this.$refs.refuploadattach.clearFiles()
|
|
|
@@ -326,19 +325,18 @@
|
|
|
type: 'warning',
|
|
|
message: '请上传文档'
|
|
|
})
|
|
|
- return
|
|
|
} else {
|
|
|
- _this.editdocumentinfo() //保存编辑信息
|
|
|
+ _this.editdocumentinfo() // 保存编辑信息
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
- console.log('error submit!!');
|
|
|
- return false;
|
|
|
+ console.log('error submit!!')
|
|
|
+ return false
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- //执行保存操作
|
|
|
- editdocumentinfo() {
|
|
|
+ // 执行保存操作
|
|
|
+ editdocumentinfo () {
|
|
|
let _this = this
|
|
|
_this.uploadform.DirectoryId = parseInt(_this.JLDirectoryIds[_this.JLDirectoryIds.length - 1])
|
|
|
// 设置文档类别的对应标签值
|
|
|
@@ -374,7 +372,7 @@
|
|
|
console.log(error)
|
|
|
})
|
|
|
},
|
|
|
- beforeAvatarUpload(file) {
|
|
|
+ beforeAvatarUpload (file) {
|
|
|
let isLt50m = file.size / 1024 / 1024 / 50 < 1
|
|
|
if (!isLt50m) {
|
|
|
this.$message.error('上传文件大小不能超过 50MB!')
|
|
|
@@ -383,7 +381,7 @@
|
|
|
return true
|
|
|
},
|
|
|
// 判断附件是否上传成功
|
|
|
- attachissuccess() {
|
|
|
+ attachissuccess () {
|
|
|
if (this.$refs.refuploadattach.uploadFiles && this.$refs.refuploadattach.uploadFiles.length > 0) {
|
|
|
for (let i = 0; i < this.$refs.refuploadattach.uploadFiles.length; i++) {
|
|
|
if (this.$refs.refuploadattach.uploadFiles[i].status !== 'success') {
|
|
|
@@ -393,7 +391,7 @@
|
|
|
}
|
|
|
return true
|
|
|
},
|
|
|
- uploadrequest(option) {
|
|
|
+ uploadrequest (option) {
|
|
|
let _this = this
|
|
|
if (process.client) {
|
|
|
const myDomain = window.location.host
|
|
|
@@ -410,7 +408,7 @@
|
|
|
url: res.data.publicUrl,
|
|
|
fid: res.data.fid
|
|
|
})
|
|
|
- //显示文档名称
|
|
|
+ // 显示文档名称
|
|
|
if (_this.uploadform.Name == '') {
|
|
|
_this.uploadform.Name = _this.$refs.refuploadattach.uploadFiles[0].name
|
|
|
}
|
|
|
@@ -431,7 +429,7 @@
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
- getattachissuccess() {
|
|
|
+ getattachissuccess () {
|
|
|
this.uploadform.FileURL = ''
|
|
|
if (this.$refs.refuploadattach.uploadFiles && this.$refs.refuploadattach.uploadFiles.length > 0) {
|
|
|
for (let i = 0; i < this.$refs.refuploadattach.uploadFiles.length; i++) {
|
|
|
@@ -446,8 +444,8 @@
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- //取消验证
|
|
|
- cancelLogin() {
|
|
|
+ // 取消验证
|
|
|
+ cancelLogin () {
|
|
|
if (this.isLoginSucceed) {
|
|
|
this.isLoginSucceed = false
|
|
|
} else {
|
|
|
@@ -455,14 +453,14 @@
|
|
|
}
|
|
|
this.loginDialogVisible = false
|
|
|
},
|
|
|
- //密码验证
|
|
|
- confirmLogin() {
|
|
|
+ // 密码验证
|
|
|
+ confirmLogin () {
|
|
|
let _this = this
|
|
|
let fields = {
|
|
|
username: this.username,
|
|
|
- password: this.password,
|
|
|
+ password: this.password
|
|
|
}
|
|
|
- this.$axios.post("/users/checkUserPwd?RealName=" + this.AuthorUserName, fields)
|
|
|
+ this.$axios.post('/users/checkUserPwd?RealName=' + this.AuthorUserName, fields)
|
|
|
.then(res => {
|
|
|
if (res.data.code == 0) {
|
|
|
_this.loginDialogVisible = false
|
|
|
@@ -480,14 +478,14 @@
|
|
|
console.error(err)
|
|
|
})
|
|
|
},
|
|
|
- //删除文件
|
|
|
- deletedatafile() {
|
|
|
+ // 删除文件
|
|
|
+ deletedatafile () {
|
|
|
let _this = this
|
|
|
_this.$confirm('此操作将彻底删除该数据, 是否继续?', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- })
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
.then(() => {
|
|
|
_this.maintainlogattrlist = []
|
|
|
})
|
|
|
@@ -495,7 +493,6 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
</script>
|
|
|
<style lang="scss">
|
|
|
.samplesinputmaincard .el-card__header {
|