重新排序
This commit is contained in:
parent
60d562dfc4
commit
acc48d717a
|
|
@ -5,9 +5,9 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import datav from './components/baozuo-demo/index.vue'
|
// import datav from './components/baozuo-demo/index.vue'
|
||||||
// import datav from './components/datav/index.vue'
|
// import datav from './components/datav/index.vue'
|
||||||
// import datav from './components/zidingyi/index.vue'
|
import datav from './components/zidingyi/index.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'app',
|
name: 'app',
|
||||||
|
|
|
||||||
|
|
@ -313,9 +313,19 @@ export default {
|
||||||
this.showNotices = false;
|
this.showNotices = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(data.reportSettings.length>0){
|
if(data.reportSettings.length>0){
|
||||||
data.reportSettings.forEach(item=>{
|
let sortarr = data.reportSettings.sort((a, b) => {
|
||||||
|
// 优先处理 "10001" 和 "10002"
|
||||||
|
if (a.code === "10001") return -1; // "10001" 排最前
|
||||||
|
if (a.code === "10002" && b.code !== "10001") return -1; // "10002" 次之
|
||||||
|
if (b.code === "10001") return 1; // 确保 "10001" 仍然在最前
|
||||||
|
if (b.code === "10002") return 1; // "10002" 排在前面
|
||||||
|
|
||||||
|
// 其他情况按字典序排列
|
||||||
|
return a.code.localeCompare(b.code);
|
||||||
|
});
|
||||||
|
sortarr.forEach(item=>{
|
||||||
if(item.columns.length>0){
|
if(item.columns.length>0){
|
||||||
item.columns.sort((a,b) => a.sort - b.sort)
|
item.columns.sort((a,b) => a.sort - b.sort)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue