Commit 717d6e30 by 袁成

fix:文件列表、文件管理增加分组

parent f36b1934
......@@ -38,7 +38,8 @@ export default {
fileList: [],
fileWidth: '100%',
modalShow: false,
fileTitle: '资料下载'
fileTitle: '资料下载',
groupId: 'rbc-0'
}
},
created() {
......@@ -48,6 +49,8 @@ export default {
let str = Math.floor(100 / num) + '%'
this.fileTitle = prop.fileTitle
this.fileWidth = `calc(${str} - 10px)`
let id = prop.groupId? prop.groupId: '0'
this.groupId = 'rbc-' + id
}
},
mounted() {
......@@ -58,7 +61,9 @@ export default {
async getFileLList() {
const url = `/common/attachment/owner/00000000-0000-0000-0000-000000000000`
const { data } = await GMS.$http.get(url)
this.fileList = data
this.fileList = data.filter(item => item.category === this.groupId)
console.log('groupId', this.groupId)
console.log('fileList', this.fileList)
console.log({ data })
},
handleMore() {
......
......@@ -10,6 +10,11 @@
<FormItem label="标题">
<Input v-model="config.fileTitle" placeholder="资料下载"></Input>
</FormItem>
<FormItem label="分组">
<Select v-model="config.groupId">
<Option v-for="item in fileGroup" :value="item.value" :key="item.value">{{item.label}}</Option>
</Select>
</FormItem>
</Form>
</div>
</Panel>
......@@ -18,14 +23,6 @@
<script>
export default {
watch: {
// configList: {
// handler(newVal) {
// this.itemSetting.properties = newVal
// },
// deep: true,
// },
},
props: {
itemSetting: {
type: Array,
......@@ -37,8 +34,35 @@ export default {
value1: '1',
config: {
num: 1,
fileTitle: '资料下载'
fileTitle: '资料下载',
groupId: '0'
},
fileGroup: [
{
label: '默认分组',
value: '0'
},
{
label: '分组一',
value: '1'
},
{
label: '分组二',
value: '2'
},
{
label: '分组三',
value: '3'
},
{
label: '分组四',
value: '4'
},
{
label: '分组五',
value: '5'
}
]
}
},
created() {
......
......@@ -34,8 +34,6 @@
"eslint": "^6.7.2",
"eslint-plugin-vue": "^6.2.2",
"less": "^4.1.1",
"node-sass": "^4.12.0",
"sass-loader": "^8.0.2",
"vue-template-compiler": "^2.6.11"
}
}
......@@ -75,6 +75,9 @@ export default {
filesList() {
return this.files.filter((item) => item.saveState !== -1)
},
url() {
return `${osConfig.baseUrl}/common/attachment/?ownerId=${this.billidParam}&ownerType=bill&category=${this.groupName}-${this.groupId}`
}
},
props: {
......@@ -109,7 +112,6 @@ export default {
modalShow: false,
files: [],
fileName: '',
url: `${osConfig.baseUrl}/common/attachment/?ownerId=${this.billidParam}&ownerType=bill&category=${this.groupName}-${this.groupId}`,
messageVal: 0,
uploadGroupTitle: '',
groupinfo: {
......@@ -243,19 +245,6 @@ export default {
//取消按钮
cancel() {
this.modalShow = false
// let promises = []
// this.filesList.forEach((item) => {
// var url = `/common/attachment/${item.id}`
// promises.push(GMS.$http.delete(url))
// })
// Promise.all(promises)
// .then((res) => {
// this.modalShow = false
// })
// .catch((err) => {
// console.log('附件删除失败', err)
// })
},
//查看预览
handleView(list) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment