|
|
@@ -16,7 +16,7 @@
|
|
|
</div>
|
|
|
<avue-crud ref="crud"
|
|
|
v-model="form"
|
|
|
- v-model:page="page"
|
|
|
+ :page="page"
|
|
|
:before-open="beforeOpen"
|
|
|
:data="data"
|
|
|
:option="option"
|
|
|
@@ -28,18 +28,18 @@
|
|
|
@on-load="onLoad">
|
|
|
</avue-crud>
|
|
|
<el-dialog v-model="showInfo" append-to-body width="45%">
|
|
|
- <dialog_info :id="id"/>
|
|
|
+ <dialog-info :id="id"/>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import dialog_info from './dialog_info.vue'
|
|
|
+import dialogInfo from './dialog_info.vue'
|
|
|
|
|
|
export default {
|
|
|
name: 'list',
|
|
|
- components: {dialog_info},
|
|
|
- data() {
|
|
|
+ components: { dialogInfo },
|
|
|
+ data () {
|
|
|
return {
|
|
|
showInfo: false,
|
|
|
keyWords: '',
|
|
|
@@ -65,7 +65,7 @@ export default {
|
|
|
{
|
|
|
label: '文件名称',
|
|
|
prop: 'title',
|
|
|
- width: 380,
|
|
|
+ width: 380
|
|
|
},
|
|
|
{
|
|
|
label: '所属项目',
|
|
|
@@ -77,7 +77,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
label: '上传人',
|
|
|
- prop: 'createUserName',
|
|
|
+ prop: 'createUserName'
|
|
|
},
|
|
|
{
|
|
|
label: '上传时间',
|
|
|
@@ -85,39 +85,40 @@ export default {
|
|
|
}]
|
|
|
},
|
|
|
page: {
|
|
|
- pageSize: 20,
|
|
|
- currentPage: 1,
|
|
|
+ size: 10,
|
|
|
+ current: 1,
|
|
|
total: 0
|
|
|
},
|
|
|
id: ''
|
|
|
}
|
|
|
},
|
|
|
- created() {
|
|
|
+ created () {
|
|
|
this.$bus.on('serachFile', (res) => {
|
|
|
this.onLoad(res)
|
|
|
})
|
|
|
},
|
|
|
methods: {
|
|
|
- onLoad(query = {}) {
|
|
|
- let data = {...query, ...this.page}
|
|
|
+ onLoad (query = {}) {
|
|
|
+ const data = { ...query, ...this.page }
|
|
|
+ this.loading = true
|
|
|
this.$api.database.fileList(data).then(res => {
|
|
|
+ this.loading = false
|
|
|
if (res.code === 200) {
|
|
|
this.data = res.data.records
|
|
|
this.page.total = res.data.total
|
|
|
- this.loading = false;
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- currentChange(currentPage) {
|
|
|
- this.page.currentPage = currentPage;
|
|
|
+ currentChange (currentPage) {
|
|
|
+ this.page.current = currentPage
|
|
|
},
|
|
|
- sizeChange(pageSize) {
|
|
|
- this.page.pageSize = pageSize;
|
|
|
+ sizeChange (pageSize) {
|
|
|
+ this.page.size = pageSize
|
|
|
},
|
|
|
- refreshChange() {
|
|
|
- this.onLoad(this.page, this.query);
|
|
|
+ refreshChange () {
|
|
|
+ this.onLoad(this.page, this.query)
|
|
|
},
|
|
|
- beforeOpen(done, type) {
|
|
|
+ beforeOpen (done, type) {
|
|
|
if (['view'].includes(type)) {
|
|
|
this.showInfo = true
|
|
|
console.log(this.showInfo)
|
|
|
@@ -125,28 +126,28 @@ export default {
|
|
|
} else if (type === 'edit') {
|
|
|
this.$router.push({
|
|
|
path: '/home/details',
|
|
|
- query: {id: this.form.id, type: '1'}
|
|
|
+ query: { id: this.form.id, type: '1' }
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
- rowDel(row) {
|
|
|
- this.$confirm("确定删除选择的项目?", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
+ rowDel (row) {
|
|
|
+ this.$confirm('确定删除选择的项目?', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
})
|
|
|
- .then(() => {
|
|
|
- this.$api.database.fileRemove({ids: row.id}).then(res => {
|
|
|
- if (res.code === 200) {
|
|
|
- this.$message.success(res.msg)
|
|
|
- this.onLoad()
|
|
|
- } else {
|
|
|
- this.$message.error(res.msg)
|
|
|
- }
|
|
|
- })
|
|
|
+ .then(() => {
|
|
|
+ this.$api.database.fileRemove({ ids: row.id }).then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.$message.success(res.msg)
|
|
|
+ this.onLoad()
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.msg)
|
|
|
+ }
|
|
|
})
|
|
|
+ })
|
|
|
},
|
|
|
- choise(index) {
|
|
|
+ choise (index) {
|
|
|
this.active = index
|
|
|
}
|
|
|
}
|