@ -9,6 +9,12 @@
< div >
< el -input v-model ="select.title" placeholder="Title" > < / el -input >
< / div >
< div >
< el -select clearable style = "width:100%" filterable v-model ="select.number" placeholder="Product Phase" >
< el -option v-for ="(item,index) in productList" :key="index" :label="item.number" :value="item.id" >
< / e l - o p t i o n >
< / e l - s e l e c t >
< / div >
< div >
< el -button type = "primary" size = "small" @click ="select.page=1,getList()" > search < / el -button >
< / div >
@ -24,13 +30,14 @@
< / l x - h e a d e r >
< / div >
< / div >
< xy -table :list ="list" :total ="total" @pageIndexChange ="pageIndexChange"
@ pageSizeChange = "pageSizeChange" : table - item = "table_item" >
< xy -table :list ="list" :total ="total" @pageIndexChange ="pageIndexChange" @pageSizeChange ="pageSizeChange"
: table - item = "table_item" >
< template v -slot : btns >
< el -table -column align = 'center' fixed = "right" label = "Operate" width = "180" header -align = " center " >
< template slot -scope = " scope " >
< el -button type = "primary" size = "small" @click ="editLr('editor',scope.row.id)" > edit < / el -button >
< el -popconfirm confirm -button -text = " confirm " cancel -button -text = " cancel " style = "margin:0 10px" @confirm ="deleteList(scope.row.id)" title = "Are you sure to delete it?" >
< el -popconfirm confirm -button -text = " confirm " cancel -button -text = " cancel " style = "margin:0 10px"
@ confirm = "deleteList(scope.row.id)" title = "Are you sure to delete it?" >
< el -button type = "danger" size = "small" slot = "reference" > delete < / e l - b u t t o n >
< / e l - p o p c o n f i r m >
< / template >
@ -43,10 +50,13 @@
< script >
import addLr from './components/addLr.vue' ;
import {
index ,
destroy
import {
index ,
destroy
} from "@/api/system/baseForm.js"
import {
index as getProduct
} from "@/api/product/index.js"
export default {
components : {
addLr
@ -54,15 +64,17 @@
data ( ) {
return {
select : {
title : '' ,
table _name : 'literature_references' ,
title : '' ,
table _name : 'literature_references' ,
number : '' ,
page : 1 ,
page _size : 10 ,
sort _name : "year" ,
sort _type : "DESC" ,
sort _name2 : "date" ,
sort _type2 : "DESC" ,
} ,
page _size : 10 ,
sort _name : "year" ,
sort _type : "DESC" ,
sort _name2 : "date" ,
sort _type2 : "DESC" ,
} ,
productList : [ ] ,
total : 0 ,
list : [ ] ,
table _item : [ {
@ -72,36 +84,36 @@
} , {
prop : 'year' ,
label : 'Year' ,
align : 'left' ,
width : 120 ,
align : 'left' ,
width : 120 ,
} , {
prop : 'title' ,
label : 'Title' ,
align : 'left' ,
width : 480 ,
align : 'left' ,
width : 480 ,
} ,
{
prop : 'link' ,
label : 'Link' ,
align : 'left' ,
width : 480 ,
} , {
prop : 'date' ,
label : 'Release Time' ,
align : 'left' ,
width : 180
} ,
align : 'left' ,
width : 480 ,
} , {
prop : 'date' ,
label : 'Release Time' ,
align : 'left' ,
width : 180
} ,
/ / {
/ / p r o p : ' d a t e ' ,
/ / l a b e l : ' R e l e a s e T i m e ' ,
/ / a l i g n : ' l e f t ' ,
/ / a l i g n : ' l e f t ' ,
/ / w i d t h : 1 8 0
/ / } ,
{
prop : 'admin.name' ,
label : 'Creator' ,
align : 'left' ,
width : 180
/ / } ,
{
prop : 'admin.name' ,
label : 'Creator' ,
align : 'left' ,
width : 180
}
]
@ -109,12 +121,21 @@
} ,
created ( ) {
this . getList ( )
this . getProductList ( )
} ,
methods : {
async getProductList ( ) {
const res = await getProduct ( {
page _size : 9999 ,
page : 1
} )
this . productList = res . data
} ,
editLr ( type , id ) {
if ( type == 'editor' ) {
this . $refs . addLr . id = id
}
}
this . $refs . addLr . productList = this . productList
this . $refs . addLr . type = type
this . $refs . addLr . isShow = true
} ,
@ -132,23 +153,27 @@
this . select . title = ''
this . getList ( )
} ,
async getList ( ) {
const res = await index ( {
... this . select ,
filter : [ {
key : 'title' ,
op : 'like' ,
value : this . select . title
} ]
async getList ( ) {
const res = await index ( {
... this . select ,
filter : [ {
key : 'title' ,
op : 'like' ,
value : this . select . title
} , {
key : 'product_numbers' ,
op : 'like' ,
value : this . select . number
} ]
} )
this . list = res . data
this . total = res . total
} ,
deleteList ( id ) {
var that = this ;
destroy ( {
table _name : this . select . table _name ,
id : id
destroy ( {
table _name : this . select . table _name ,
id : id
} ) . then ( response => {
this . $Message . success ( 'Success' ) ;
this . getList ( )