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