mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-21 16:56:46 +08:00
项目编号新增排序功能
This commit is contained in:
@@ -31,13 +31,22 @@ const handleChange = (value,option)=>{
|
|||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
// console.log(store.state.project_number,'store.state.project_number')
|
// console.log(store.state.project_number,'store.state.project_number')
|
||||||
});
|
});
|
||||||
const options = computed(()=>store.state.project_number.map(e => {
|
const options = computed(() => {
|
||||||
return{
|
const projectNumberList = store.state.project_number;
|
||||||
|
const sortedList = projectNumberList.sort((a, b) => {
|
||||||
|
if (a.sort !== b.sort) {
|
||||||
|
return a.sort - b.sort;
|
||||||
|
}
|
||||||
|
const aTimestamp = Date.parse(a.createTime);
|
||||||
|
const bTimestamp = Date.parse(b.createTime);
|
||||||
|
return bTimestamp - aTimestamp;
|
||||||
|
});
|
||||||
|
return sortedList.map(e => ({
|
||||||
value: e.value + e.name,
|
value: e.value + e.name,
|
||||||
label: ' 【 ' + e.value + ' 】 ' + e.name,
|
label: ' 【 ' + e.value + ' 】 ' + e.name,
|
||||||
searchData: e.value
|
searchData: e.value
|
||||||
}
|
}));
|
||||||
}))
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
Reference in New Issue
Block a user