Skip to content

Commit d8c3470

Browse files
committed
.
1 parent 8641f25 commit d8c3470

File tree

2 files changed

+24
-13
lines changed

2 files changed

+24
-13
lines changed

src/assets/constant.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,11 @@ export const XUN_SHOU = ['甲子戊', '甲戌己', '甲申庚', '甲午辛', '
145145

146146
// 飞盘星
147147
export const XING_F = ['蓬', '芮', '冲', '辅', '禽', '心', '柱', '任', '英']
148-
// 转盘星
148+
// 转盘星(天禽另寄)
149149
export const XING_Z = ['蓬', '任', '冲', '辅', '英', '芮', '柱', '心']
150150

151151
// 飞盘门
152-
export const MEN_F = ['休', '死', '伤', '杜', '中', '开', '惊', '生', '景']
152+
export const MEN_F = ['休', '死', '伤', '杜', '开', '惊', '生', '景']
153153
// 转盘门
154154
export const MEN_Z = ['休', '生', '伤', '杜', '景', '死', '惊', '开']
155155

src/components/QiMen.vue

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -155,26 +155,37 @@ function paiQiYi() {
155155
}
156156
function paiFeiPan() {
157157
zhiFu.value = XING_F[xunShouGong - 1]
158-
zhiShi.value = MEN_F[xunShouGong - 1]
158+
zhiShi.value = xunShouGong === 5 ? '' : [...MEN_F.slice(0, 4), '', ...MEN_F.slice(-3)][xunShouGong - 1]
159159
for (let i = 0; i < 9; i++) {
160-
const index = XING_F.indexOf(zhiFu.value)
161-
cfg.value[(shiGanGong + i - 1) % 9 + 1][5] = [...XING_F, ...XING_F][index + i]
160+
cfg.value[(shiGanGong + i - 1) % 9 + 1][5] = [...XING_F, ...XING_F][XING_F.indexOf(zhiFu.value) + i]
161+
}
162+
let mark = 0
163+
for (let i = 0; i < 8; i++) {
164+
if ((shiZhiGong + i) % 9 === 5) mark = 1
165+
cfg.value[(shiZhiGong + i + mark - 1) % 9 + 1][8] = [...MEN_F, ...MEN_F][MEN_F.indexOf(zhiShi.value) + i]
162166
}
163-
// for (let i = 0; i < 8; i++) {
164-
// const tmp = (shiZhiGong + i - 1) % 9 + 1
165-
// if (tmp === 5) continue
166-
// const index = MEN_F.indexOf(zhiShi.value)
167-
// cfg.value[tmp][8] = [...MEN_F, ...MEN_F][index + i]
168-
// }
169167
for (let i = 0; i < 9; i++) {
170168
const shenList = juShu.value > 0 ? SHEN_F : [SHEN_F[0], ...SHEN_F.slice().reverse()]
171169
cfg.value[(shiGanGong + i - 1) % 9 + 1][2] = shenList[i]
172170
}
173171
}
174172
function paiZhuanPan() {
175-
const transer = [1, 8, 3, 4, 9, 2, 7, 6]
173+
const transer = [1,8,3,4,9,2,7,6, 1,8,3,4,9,2,7,6]
176174
zhiFu.value = xunShouGong === 5 ? '' : XING_Z[transer.indexOf(xunShouGong)]
177-
zhiShi.value = xunShouGong === 5 ? '' : MEN_Z[transer.indexOf(xunShouGong)]
175+
zhiShi.value = xunShouGong === 5 ? '' : MEN_Z[transer.indexOf(xunShouGong)]
176+
for (let i = 0; i < 8; i++) {
177+
const j = transer[transer.indexOf(shiGanGong) + i]
178+
cfg.value[j][5] = [...XING_Z, ...XING_Z][XING_Z.indexOf(zhiFu.value === '' ? '' : zhiFu.value) + i]
179+
}
180+
for (let i = 0; i < 8; i++) {
181+
const j = transer[transer.indexOf(shiZhiGong) + i]
182+
cfg.value[j][8] = [...MEN_Z, ...MEN_Z][MEN_Z.indexOf(zhiShi.value) + i]
183+
}
184+
for (let i = 0; i < 8; i++) {
185+
const j = transer[transer.indexOf(shiGanGong) + i]
186+
const shenList = juShu.value > 0 ? SHEN_Z : [SHEN_Z[0], ...SHEN_Z.slice().reverse()]
187+
cfg.value[j][2] = shenList[i]
188+
}
178189
}
179190
function paiPan(type) {
180191
if (!shiGan.value || !shiZhi.value || !juShu.value) return

0 commit comments

Comments
 (0)