|
|
|
@ -2,20 +2,25 @@ |
|
|
|
<div class="mod-config"> |
|
|
|
<div> |
|
|
|
<span @click="favoriteFunction()"> |
|
|
|
<icon-svg :name="favorite?'xiangqufill':'xiangqu'" class="sl-svg" ></icon-svg> |
|
|
|
<icon-svg :name="favorite?'xiangqufill':'xiangqu'" class="sl-svg"></icon-svg> |
|
|
|
</span> |
|
|
|
</div> |
|
|
|
<el-button @click="searchList()" type="primary">{{buttons.search}}</el-button> |
|
|
|
<el-button @click="saveColumnList()" type="primary" v-show="showDefault">{{buttons.defaultTable}} |
|
|
|
<el-button @click="searchList()" type="primary">{{ buttons.search }}</el-button> |
|
|
|
<el-button @click="userSetting" type="primary">{{ buttons.settingTable }}</el-button> |
|
|
|
<el-button @click="saveColumnList()" type="primary" v-show="showDefault">{{ buttons.defaultTable }} |
|
|
|
</el-button> |
|
|
|
<el-button @click="userSetting" type="primary">{{ buttons.settingTable}}</el-button> |
|
|
|
<el-button @click="updateExpDate()" type="primary">{{ buttons.updateExp }} |
|
|
|
</el-button> |
|
|
|
|
|
|
|
<el-table |
|
|
|
ref="rollInfo" |
|
|
|
:height="height" |
|
|
|
:data="dataList" |
|
|
|
border |
|
|
|
:cell-style="{ padding: '2px' }" |
|
|
|
v-loading="dataListLoading" |
|
|
|
style="width: 100%;"> |
|
|
|
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column> |
|
|
|
<el-table-column |
|
|
|
v-for="(item,index) in columnList" :key="index" |
|
|
|
:sortable="item.columnSortable" |
|
|
|
@ -27,7 +32,7 @@ |
|
|
|
:min-width="item.columnWidth" |
|
|
|
:label="item.columnLabel"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span v-if="!item.columnHidden"> {{scope.row[item.columnProp]}}</span> |
|
|
|
<span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span> |
|
|
|
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" |
|
|
|
style="width: 100px; height: 80px"/></span> |
|
|
|
</template> |
|
|
|
@ -40,23 +45,42 @@ |
|
|
|
width="150" |
|
|
|
label="操作"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<a type="text" size="small" @click="addOrUpdateHandle(scope.row.rollno,scope.row.site)">修改失效日期</a> |
|
|
|
<a type="text" size="small" @click="addOrUpdateHandle(scope.row.rollno,scope.row.site)">修改有效期</a> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
</el-table> |
|
|
|
|
|
|
|
<!-- 设置查询条件 --> |
|
|
|
<search v-if="searchVisible" v-on:childByValue="childByValue" ref="search" @refreshDataList="getDataList" ></search> |
|
|
|
<search v-if="searchVisible" v-on:childByValue="childByValue" ref="search" @refreshDataList="getDataList"></search> |
|
|
|
<!-- 设置列 --> |
|
|
|
<column v-if="visible" ref="column" @refreshData="getTableUserColumn"></column> |
|
|
|
<column v-if="visible" ref="column" @refreshData="getTableUserColumn"></column> |
|
|
|
<!-- 弹窗, 新增 / 修改 --> |
|
|
|
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update> |
|
|
|
|
|
|
|
<el-dialog |
|
|
|
:title="'修改有效期'" |
|
|
|
:close-on-click-modal="false" |
|
|
|
width="350px" |
|
|
|
:visible.sync="updateExp"> |
|
|
|
<el-form ref="dataForm" @keyup.enter.native="dataFormSubmit()" |
|
|
|
label-width="80px"> |
|
|
|
<el-form-item label="失效日期" prop="expireddate"> |
|
|
|
<el-date-picker value-format="yyyy-MM-dd" v-model="expireddate" placeholder="失效日期"></el-date-picker> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
</el-form> |
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
<el-button type="primary" @click="updateExpSubmit()">确定</el-button> |
|
|
|
<el-button @click="updateExp = false">取消</el-button> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import AddOrUpdate from './crollinfo-add-or-update' |
|
|
|
import {getCRollInfoList} from '@/api/crollinfo/crollinfo.js' |
|
|
|
import {getCRollInfoList,batchUpdateExpireddate} from '@/api/crollinfo/crollinfo.js' |
|
|
|
import column from "../common/column"; |
|
|
|
import search from "../common/search"; |
|
|
|
import { |
|
|
|
@ -69,14 +93,16 @@ import { |
|
|
|
getTableDefaultListLanguage, |
|
|
|
getTableUserListLanguage |
|
|
|
} from "@/api/table.js" |
|
|
|
import {userFavoriteList,saveUserFavorite,removeUserFavorite} from '@/api/userFavorite.js' |
|
|
|
import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js' |
|
|
|
|
|
|
|
export default { |
|
|
|
data () { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
searchVisible: false, |
|
|
|
updateExp: false, |
|
|
|
expireddate:'', |
|
|
|
// table高度 |
|
|
|
height:450, |
|
|
|
height: 450, |
|
|
|
// 是否收藏 |
|
|
|
favorite: false, |
|
|
|
addLanguage: false, |
|
|
|
@ -85,13 +111,10 @@ export default { |
|
|
|
languageCode: this.$i18n.locale, |
|
|
|
visible: false, |
|
|
|
showDefault: false, |
|
|
|
query:{ |
|
|
|
|
|
|
|
}, |
|
|
|
query: {}, |
|
|
|
// 语言词典集合 |
|
|
|
sysLanguageParams: [], |
|
|
|
columnList: [ |
|
|
|
], |
|
|
|
columnList: [], |
|
|
|
dataList: [], |
|
|
|
buttons: { |
|
|
|
add: '添加', |
|
|
|
@ -102,7 +125,8 @@ export default { |
|
|
|
search: '搜索', |
|
|
|
download: '导出', |
|
|
|
settingTable: '设置列表', |
|
|
|
defaultTable: '设置默认配置' |
|
|
|
defaultTable: '设置默认配置', |
|
|
|
updateExp: '修改有效期' |
|
|
|
}, |
|
|
|
dataListLoading: false, |
|
|
|
dataListSelections: [], |
|
|
|
@ -115,14 +139,44 @@ export default { |
|
|
|
search |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
this.$nextTick(()=>{ |
|
|
|
this.$nextTick(() => { |
|
|
|
this.height = window.innerHeight - 165; |
|
|
|
}) |
|
|
|
}, |
|
|
|
activated () { |
|
|
|
activated() { |
|
|
|
this.getDataList() |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// 修改有效期 |
|
|
|
updateExpDate() { |
|
|
|
this.updateExp = true |
|
|
|
}, |
|
|
|
// 表单提交 |
|
|
|
updateExpSubmit() { |
|
|
|
let rollInfoList = this.$refs.rollInfo.selection.map(item =>{ |
|
|
|
let rollInfo = { |
|
|
|
site:item.site, |
|
|
|
rollno: item.rollno, |
|
|
|
expireddate: this.expireddate |
|
|
|
} |
|
|
|
return rollInfo; |
|
|
|
}) |
|
|
|
batchUpdateExpireddate(rollInfoList).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.$message({ |
|
|
|
message: '操作成功', |
|
|
|
type: 'success', |
|
|
|
duration: 1500, |
|
|
|
onClose: () => { |
|
|
|
this.updateExp = false |
|
|
|
this.getDataList() |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.$message.error(data.msg) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
childByValue(childValue) { |
|
|
|
this.getDataList(childValue) |
|
|
|
}, |
|
|
|
@ -140,41 +194,41 @@ export default { |
|
|
|
}); |
|
|
|
}, |
|
|
|
// 校验用户是否收藏 |
|
|
|
favoriteIsOk(){ |
|
|
|
let userFavorite ={ |
|
|
|
userId:this.$store.state.user.id, |
|
|
|
languageCode:this.$i18n.locale |
|
|
|
favoriteIsOk() { |
|
|
|
let userFavorite = { |
|
|
|
userId: this.$store.state.user.id, |
|
|
|
languageCode: this.$i18n.locale |
|
|
|
} |
|
|
|
userFavoriteList(userFavorite).then(({data}) =>{ |
|
|
|
userFavoriteList(userFavorite).then(({data}) => { |
|
|
|
let size = data.list.filter(item => item.menuId == this.$route.meta.menuId).length; |
|
|
|
if (size>0){ |
|
|
|
if (size > 0) { |
|
|
|
this.favorite = true |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
this.favorite = false |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 收藏 OR 取消收藏 |
|
|
|
favoriteFunction(){ |
|
|
|
let userFavorite ={ |
|
|
|
favoriteFunction() { |
|
|
|
let userFavorite = { |
|
|
|
userId: this.$store.state.user.id, |
|
|
|
functionId: this.$route.meta.menuId, |
|
|
|
} |
|
|
|
if (this.favorite){ |
|
|
|
if (this.favorite) { |
|
|
|
// 取消收藏 |
|
|
|
this.$confirm(`确定取消收藏`, '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
removeUserFavorite(userFavorite).then(({data})=>{ |
|
|
|
removeUserFavorite(userFavorite).then(({data}) => { |
|
|
|
this.$message.success(data.msg) |
|
|
|
this.favorite = false |
|
|
|
}) |
|
|
|
}) |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
// 收藏 |
|
|
|
saveUserFavorite(userFavorite).then(({data})=>{ |
|
|
|
saveUserFavorite(userFavorite).then(({data}) => { |
|
|
|
this.$message.success(data.msg) |
|
|
|
this.favorite = true |
|
|
|
}) |
|
|
|
@ -190,7 +244,7 @@ export default { |
|
|
|
objectType: 'button' |
|
|
|
} |
|
|
|
searchFunctionButtonList(queryButton).then(({data}) => { |
|
|
|
if (data.data.length>0) { |
|
|
|
if (data.data.length > 0) { |
|
|
|
this.buttons = data.data |
|
|
|
} |
|
|
|
}) |
|
|
|
@ -269,9 +323,9 @@ export default { |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 获取数据列表 |
|
|
|
getDataList (val) { |
|
|
|
getDataList(val) { |
|
|
|
this.dataListLoading = true |
|
|
|
let query = val?val:[] |
|
|
|
let query = val ? val : [] |
|
|
|
let f = { |
|
|
|
queryAttributes: "parttypeFlag", |
|
|
|
queryType: "string", |
|
|
|
@ -286,14 +340,14 @@ export default { |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 新增 / 修改 |
|
|
|
addOrUpdateHandle (rollno,site) { |
|
|
|
addOrUpdateHandle(rollno, site) { |
|
|
|
this.addOrUpdateVisible = true |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs.addOrUpdate.init(rollno,site) |
|
|
|
this.$refs.addOrUpdate.init(rollno, site) |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 删除 |
|
|
|
deleteHandle (id) { |
|
|
|
deleteHandle(id) { |
|
|
|
var ids = id ? [id] : this.dataListSelections.map(item => { |
|
|
|
return item.site |
|
|
|
}) |
|
|
|
@ -332,7 +386,7 @@ export default { |
|
|
|
} |
|
|
|
</script> |
|
|
|
<style scoped> |
|
|
|
.sl-svg{ |
|
|
|
.sl-svg { |
|
|
|
overflow: hidden; |
|
|
|
float: right; |
|
|
|
} |
|
|
|
|