| | |
| | | indexLabel: '序号', |
| | | stripe: true, |
| | | menuAlign: 'center', |
| | | menuWidth: 150, |
| | | menuWidth: 280, |
| | | align: 'center', |
| | | refreshBtn: true, |
| | | searchSize: 'mini', |
| | |
| | | value: 'created' |
| | | } |
| | | ] |
| | | // },{ |
| | | // label: '订单盈亏控制情况(优先级高于交割场控设置)', |
| | | // prop: 'profitLosssStr', |
| | | },{ |
| | | label: '盈亏%', |
| | | prop: 'manualProfitPercent', |
| | | },{ |
| | | label: '场控', |
| | | prop: 'profitLosssStr', |
| | | },] |
| | | } |
| | |
| | | type: 1, |
| | | icon: "bianji", |
| | | orderNum: 1, |
| | | }, |
| | | { |
| | | menuId: 459, |
| | | parentId: 415, |
| | | parentName: null, |
| | | name: "盘前配置(US)", |
| | | url: "us-spots/us-pre-market-config", |
| | | perms: "", |
| | | type: 1, |
| | | icon: "bianji", |
| | | orderNum: 2, |
| | | list: null, |
| | | appType: "1", |
| | | }, |
| | |
| | | type: 1, |
| | | icon: "sql", |
| | | orderNum: 12, |
| | | }, |
| | | { |
| | | menuId: 486, |
| | | parentId: 473, |
| | | parentName: null, |
| | | name: "盘前配置(美股)", |
| | | url: "us-spots/us-pre-market-config", |
| | | perms: "", |
| | | type: 1, |
| | | icon: "sql", |
| | | orderNum: 13, |
| | | list: null, |
| | | appType: "1", |
| | | }, |
| | |
| | | // 提示: 如需要通过iframe嵌套展示内容, 但不通过tab打开, 请自行创建组件使用iframe处理! |
| | | { path: '/home', component: _import('modules/user/user'), name: 'home', meta: { title: '首页' } }, |
| | | { path: '/prodInfo', component: _import('modules/prod/prodInfo'), name: 'prodInfo', meta: { title: '产品详情' } }, |
| | | { path: '/message', component: _import('message/index'), name: 'message', meta: { title: '产品详情' } } |
| | | { path: '/message', component: _import('message/index'), name: 'message', meta: { title: '产品详情' } }, |
| | | // 美股交割合约单:固定路由,不依赖 tz_sys_menu 配置 |
| | | { |
| | | path: '/us-spots-us-pickAddr', |
| | | component: _import('modules/us-spots/us-pickAddr'), |
| | | name: 'us-spots-us-pickAddr', |
| | | meta: { title: '交割合约单(US)', isTab: true, menuId: 1981 } |
| | | } |
| | | ], |
| | | beforeEnter (to, from, next) { |
| | | let authorization = Vue.cookie.get('Authorization') |
| | |
| | | }, |
| | | ) |
| | | }).then(({ data }) => { |
| | | const menuList = pinFixedUsPickAddrMenu(data.menuList || []) |
| | | sessionStorage.setItem('authorities', JSON.stringify(data.authorities || '[]')) |
| | | //sessionStorage.setItem('authorities', JSON.stringify(menu.authorities || '[]'))(本地模拟) |
| | | //fnAddDynamicMenuRoutes(menu.menuList)(本地模拟) |
| | | fnAddDynamicMenuRoutes(data.menuList) |
| | | fnAddDynamicMenuRoutes(menuList) |
| | | router.options.isAddDynamicMenuRoutes = true |
| | | sessionStorage.setItem('menuList', JSON.stringify(data.menuList || '[]')) |
| | | //sessionStorage.setItem('menuList', JSON.stringify(menu.menuList || '[]'))(本地模拟) |
| | | sessionStorage.setItem('menuList', JSON.stringify(menuList || '[]')) |
| | | |
| | | // |
| | | let menuList = data.menuList |
| | | // console.log("menuList = " + JSON.stringify(menuList)); |
| | | let urls = [] |
| | | for(let i = 0 ;menuList && i < menuList.length ; i++){ |
| | |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | /** |
| | | * 固定注入「交割合约单(US)」到左侧菜单(orderNum>23),不依赖数据库菜单配置 |
| | | */ |
| | | function pinFixedUsPickAddrMenu (menuList) { |
| | | const url = 'us-spots/us-pickAddr' |
| | | if (menuTreeHasUrl(menuList, url)) { |
| | | return menuList |
| | | } |
| | | menuList.push({ |
| | | menuId: 1981, |
| | | parentId: 0, |
| | | name: '交割合约单(US)', |
| | | url: url, |
| | | perms: '', |
| | | type: 1, |
| | | icon: 'sql', |
| | | orderNum: 24, |
| | | list: null, |
| | | appType: '1' |
| | | }) |
| | | menuList.sort((a, b) => (a.orderNum || 0) - (b.orderNum || 0)) |
| | | return menuList |
| | | } |
| | | |
| | | function menuTreeHasUrl (list, url) { |
| | | if (!list || !list.length) { |
| | | return false |
| | | } |
| | | for (const node of list) { |
| | | if (node.url === url) { |
| | | return true |
| | | } |
| | | if (node.list && menuTreeHasUrl(node.list, url)) { |
| | | return true |
| | | } |
| | | } |
| | | return false |
| | | } |
| | | |
| | | function ensureEssentialUsRoutes (routes) { |
| | | const name = 'us-spots-us-pickAddr' |
| | | if (routes.some((r) => r.name === name)) { |
| | | return |
| | | } |
| | | routes.push({ |
| | | path: '/us-spots-us-pickAddr', |
| | | component: _import('modules/us-spots/us-pickAddr'), |
| | | name: name, |
| | | meta: { title: '交割合约单(US)', isTab: true, menuId: 1981, isDynamic: true, iframeUrl: '' } |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * 判断当前路由类型, global: 全局路由, main: 主入口路由 |
| | |
| | | if (temp.length >= 1) { |
| | | fnAddDynamicMenuRoutes(temp, routes) |
| | | } else { |
| | | ensureEssentialUsRoutes(routes) |
| | | const fixedChildren = mainRoutes.children.filter((r) => r.meta && !r.meta.isDynamic) |
| | | mainRoutes.name = 'main-dynamic' |
| | | mainRoutes.children = routes |
| | | mainRoutes.children = fixedChildren.concat( |
| | | routes.filter((r) => !fixedChildren.some((f) => f.name === r.name)) |
| | | ) |
| | | router.addRoutes([ |
| | | mainRoutes, |
| | | { path: '*', redirect: { name: '404' } } |
| | |
| | | ) { |
| | | searchAll = JSON.parse(sessionStorage.getItem("menuList")); |
| | | } |
| | | // 过滤数组并生成新的数组对象 |
| | | //console.log(searchAll); |
| | | if (searchAll.length > 0) { |
| | | this.restaurants = searchAll.flatMap((menuItem) => { |
| | | return menuItem.orderNum > 0 && menuItem.list |
| | | ? menuItem.list |
| | | .filter((item) => item.url.trim() !== "") |
| | | .map((item) => ({ |
| | | value: item.name, |
| | | url: item.url, |
| | | })) |
| | | : []; |
| | | const items = []; |
| | | const walk = (nodes) => { |
| | | if (!nodes) return; |
| | | nodes.forEach((node) => { |
| | | if (node.url && node.url.trim() !== "") { |
| | | items.push({ value: node.name, url: node.url }); |
| | | } |
| | | if (node.list && node.list.length) { |
| | | walk(node.list); |
| | | } |
| | | }); |
| | | }; |
| | | searchAll.forEach((root) => { |
| | | if (root.orderNum > 0) { |
| | | walk(root.list || []); |
| | | } |
| | | }); |
| | | this.restaurants = items; |
| | | } |
| | | }, |
| | | }, |
| | |
| | | // 通过menuId与动态(菜单)路由进行匹配跳转至指定路由 |
| | | gotoRouteHandle (menu) { |
| | | var route = this.dynamicMenuRoutes.filter(item => item.meta.menuId === menu.menuId) |
| | | console.log(menu) |
| | | if (route.length >= 1) { |
| | | this.$router.push({ name: route[0].name }) |
| | | } else if (menu.url) { |
| | | this.$router.push({ name: menu.url.replace('/', '-') }) |
| | | } |
| | | }, |
| | | countNum(name){ |
| | |
| | | icon="el-icon-edit" |
| | | size="small" |
| | | v-if="isAuth('shop-spots:operate') && scope.row.state !== 'created'" |
| | | @click.stop="pickHandle(scope.row.orderNo)" |
| | | @click.stop="manualProfitHandle(scope.row)" |
| | | >场控</el-button> |
| | | </template> |
| | | </avue-crud> |
| | | <pickUpdate |
| | | v-if="pickUpdateVisible" |
| | | ref="pickUpdate" |
| | | <manualProfitUpdate |
| | | v-if="manualProfitUpdateVisible" |
| | | ref="manualProfitUpdate" |
| | | @refreshDataList="getDataList" |
| | | ></pickUpdate> |
| | | ></manualProfitUpdate> |
| | | <!-- 弹窗, 新增 / 修改 --> |
| | | <!-- <add-or-update v-if="addOrUpdateVisible" |
| | | ref="addOrUpdate" |
| | |
| | | </template> |
| | | <script> |
| | | import { tableOption } from "@/crud/shop/pickAddr"; |
| | | import pickUpdate from "./pick-update"; |
| | | import manualProfitUpdate from "./manual-profit-update"; |
| | | export default { |
| | | data() { |
| | | return { |
| | |
| | | }, |
| | | ], |
| | | dataListLoading: false, |
| | | pickUpdateVisible: false, |
| | | manualProfitUpdateVisible: false, |
| | | dataListSelections: [], |
| | | tableOption: tableOption, |
| | | page: { |
| | |
| | | }; |
| | | }, |
| | | components: { |
| | | pickUpdate, |
| | | manualProfitUpdate, |
| | | // AddOrUpdate, |
| | | // AddOrGogle |
| | | }, |
| | |
| | | const seconds = String(date.getSeconds()).padStart(2, "0"); |
| | | return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; |
| | | }, |
| | | // 场控 |
| | | pickHandle(id) { |
| | | this.pickUpdateVisible = true; |
| | | manualProfitHandle(row) { |
| | | this.manualProfitUpdateVisible = true; |
| | | this.$nextTick(() => { |
| | | this.$refs.pickUpdate.init(id); |
| | | this.$refs.manualProfitUpdate.init(row); |
| | | }); |
| | | }, |
| | | // tab切换 |
| | |
| | | <template slot-scope="scope" slot="settlementTimes"> |
| | | <span>{{ formatTimestamp(scope.row.settlementTime) }}</span> |
| | | </template> |
| | | <template slot-scope="scope" |
| | | slot="menu"> |
| | | <el-button type="primary" |
| | | <template slot-scope="scope" slot="menu"> |
| | | <el-button |
| | | type="primary" |
| | | icon="el-icon-edit" |
| | | size="small" |
| | | v-if="scope.row.state !=='created'&&isAuth('union-spots:operate')" |
| | | <!-- @click.stop="pickHandle(scope.row.orderNo)">电控</el-button> --> |
| | | |
| | | v-if="scope.row.state !== 'created'" |
| | | @click.stop="manualProfitHandle(scope.row)" |
| | | >场控</el-button> |
| | | </template> |
| | | </avue-crud> |
| | | <pickUpdate v-if="pickUpdateVisible" |
| | | ref="pickUpdate" |
| | | @refreshDataList="getDataList"></pickUpdate> |
| | | <manualProfitUpdate |
| | | v-if="manualProfitUpdateVisible" |
| | | ref="manualProfitUpdate" |
| | | @refreshDataList="getDataList" |
| | | ></manualProfitUpdate> |
| | | <!-- 弹窗, 新增 / 修改 --> |
| | | <!-- <add-or-update v-if="addOrUpdateVisible" |
| | | ref="addOrUpdate" |
| | |
| | | </div> |
| | | </template> |
| | | <script> |
| | | import { tableOption } from "@/crud/shop/pickAddr"; |
| | | import pickUpdate from "./pick-update"; |
| | | import { tableOption } from "@/crud/us-spots/us-pickAddr"; |
| | | import manualProfitUpdate from "../shop/manual-profit-update"; |
| | | import { getStockName } from "./config"; |
| | | import { isAuth } from '@/utils' |
| | | export default { |
| | | data() { |
| | | return { |
| | |
| | | }, |
| | | ], |
| | | dataListLoading: false, |
| | | pickUpdateVisible:false, |
| | | manualProfitUpdateVisible: false, |
| | | dataListSelections: [], |
| | | tableOption: tableOption, |
| | | page: { |
| | |
| | | ], |
| | | }, |
| | | symbol:"", |
| | | stockName: "", |
| | | stocksMap:{} |
| | | }; |
| | | }, |
| | | components: { |
| | | pickUpdate |
| | | // AddOrUpdate, |
| | | // AddOrGogle |
| | | manualProfitUpdate |
| | | }, |
| | | created() { |
| | | this.stockName = getStockName(); |
| | |
| | | const seconds = String(date.getSeconds()).padStart(2, "0"); |
| | | return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; |
| | | }, |
| | | // 场控 |
| | | pickHandle(id) { |
| | | this.pickUpdateVisible = true; |
| | | manualProfitHandle(row) { |
| | | this.manualProfitUpdateVisible = true; |
| | | this.$nextTick(() => { |
| | | this.$refs.pickUpdate.init(id); |
| | | this.$refs.manualProfitUpdate.init(row); |
| | | }); |
| | | }, |
| | | // tab切换 |
| | |
| | | <template slot-scope="scope" slot="settlementTimes"> |
| | | <span>{{ formatTimestamp(scope.row.settlementTime) }}</span> |
| | | </template> |
| | | <template slot-scope="scope" |
| | | slot="menu"> |
| | | <el-button type="primary" |
| | | <template slot-scope="scope" slot="menu"> |
| | | <el-button |
| | | type="primary" |
| | | icon="el-icon-edit" |
| | | size="small" |
| | | v-if="scope.row.state !=='created'&&isAuth('us-spots:operate')" |
| | | <!-- @click.stop="pickHandle(scope.row.orderNo)">电控</el-button> --> |
| | | |
| | | v-if="scope.row.state !== 'created'" |
| | | @click.stop="manualProfitHandle(scope.row)" |
| | | >场控</el-button> |
| | | </template> |
| | | </avue-crud> |
| | | <pickUpdate v-if="pickUpdateVisible" |
| | | ref="pickUpdate" |
| | | @refreshDataList="getDataList"></pickUpdate> |
| | | <manualProfitUpdate |
| | | v-if="manualProfitUpdateVisible" |
| | | ref="manualProfitUpdate" |
| | | @refreshDataList="getDataList" |
| | | ></manualProfitUpdate> |
| | | <!-- 弹窗, 新增 / 修改 --> |
| | | <!-- <add-or-update v-if="addOrUpdateVisible" |
| | | ref="addOrUpdate" |
| | |
| | | </div> |
| | | </template> |
| | | <script> |
| | | import { tableOption } from "@/crud/shop/pickAddr"; |
| | | import pickUpdate from "./pick-update"; |
| | | import { tableOption } from "@/crud/us-spots/us-pickAddr"; |
| | | import manualProfitUpdate from "../shop/manual-profit-update"; |
| | | export default { |
| | | data() { |
| | | return { |
| | |
| | | }, |
| | | ], |
| | | dataListLoading: false, |
| | | pickUpdateVisible:false, |
| | | manualProfitUpdateVisible: false, |
| | | dataListSelections: [], |
| | | tableOption: tableOption, |
| | | page: { |
| | |
| | | }; |
| | | }, |
| | | components: { |
| | | pickUpdate |
| | | // AddOrUpdate, |
| | | // AddOrGogle |
| | | manualProfitUpdate |
| | | }, |
| | | created() { |
| | | this.type = this.option.column[0]; |
| | |
| | | const seconds = String(date.getSeconds()).padStart(2, "0"); |
| | | return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; |
| | | }, |
| | | // 场控 |
| | | pickHandle(id) { |
| | | this.pickUpdateVisible = true; |
| | | manualProfitHandle(row) { |
| | | this.manualProfitUpdateVisible = true; |
| | | this.$nextTick(() => { |
| | | this.$refs.pickUpdate.init(id); |
| | | this.$refs.manualProfitUpdate.init(row); |
| | | }); |
| | | }, |
| | | // tab切换 |