|
|
@@ -1,6 +1,210 @@
|
|
|
import { shallowRef } from 'vue'
|
|
|
import { sessionData } from '@/stores'
|
|
|
|
|
|
+type TableColumnKey = typeof tableColumnKeys[number]
|
|
|
+const tableColumnKeys = ['system_menu', 'system_role', 'warehousing_diamond', 'warehousing_warehouse', 'mine_capital', 'listing_sellorder', 'listing_buyorder', 'listing_saleorder', 'listing_purchaseorder', 'listing_delisting', 'listing_inquire_buy', 'listing_inquire_sell', 'mine_address', 'mine_invoice'] as const
|
|
|
+
|
|
|
+/**
|
|
|
+ * PC端表格列
|
|
|
+ */
|
|
|
+const pcTableColumnMap = new Map<TableColumnKey, Ermcp.TableColumn[]>([
|
|
|
+ // 系统管理-菜单管理
|
|
|
+ ['system_menu', [
|
|
|
+ { prop: 'resourcename', label: '菜单' },
|
|
|
+ { prop: 'resourcecode', label: '代码' },
|
|
|
+ { prop: 'component', label: '组件' },
|
|
|
+ { prop: 'iconame', label: '图标' },
|
|
|
+ { prop: 'operate', label: '操作' }
|
|
|
+ ]],
|
|
|
+ // 系统管理-角色管理
|
|
|
+ ['system_role', [
|
|
|
+ { prop: 'id', label: '序号', width: 100 },
|
|
|
+ { prop: 'roleName', label: '角色名称' },
|
|
|
+ { prop: 'createdAt', label: '创建时间' },
|
|
|
+ { prop: 'updatedAt', label: '更新时间' },
|
|
|
+ { prop: 'operate', label: '操作', width: 300 }
|
|
|
+ ]],
|
|
|
+ // 我的仓储-我的库存
|
|
|
+ ['warehousing_diamond', [
|
|
|
+ { prop: 'goodsno', label: '商品编号' },
|
|
|
+ { prop: 'price', label: '总价' },
|
|
|
+ { prop: 'weight', label: '总重量' },
|
|
|
+ { prop: 'weightavg', label: '平均单颗重量' },
|
|
|
+ { prop: 'priceper', label: '克拉单位' },
|
|
|
+ { prop: 'ftotalqty', label: '库存重量' },
|
|
|
+ { prop: 'ffreezeqty', label: '冻结重量' },
|
|
|
+ { prop: 'warehousenamedisplay', label: '仓库', width: 180 },
|
|
|
+ { prop: 'zsshapetypedisplay', label: '形状', width: 200 },
|
|
|
+ { prop: 'zscolortype', label: '颜色' },
|
|
|
+ { prop: 'zsclaritytype', label: '净度' },
|
|
|
+ { prop: 'operate', label: '操作' }
|
|
|
+ ]],
|
|
|
+ // 我的仓储-我的仓库
|
|
|
+ ['warehousing_warehouse', [
|
|
|
+ { prop: 'warehousecode', label: '仓库代码' },
|
|
|
+ { prop: 'warehousename', label: '仓库名称' },
|
|
|
+ { prop: 'address', label: '仓库地址' },
|
|
|
+ { prop: 'contactname', label: '联系人' },
|
|
|
+ { prop: 'contactnum', label: '联系电话' },
|
|
|
+ { prop: 'createtime', label: '创建时间' },
|
|
|
+ { prop: 'operate', label: '操作' }
|
|
|
+ ]],
|
|
|
+ // 挂牌大厅-出售大厅
|
|
|
+ ['listing_sellorder', [
|
|
|
+ { prop: 'wrtradeorderid', label: '卖方' },
|
|
|
+ { prop: 'sellusername', label: '仓库' },
|
|
|
+ { prop: 'zscategorydisplay', label: '形状' },
|
|
|
+ { prop: 'goodsno', label: '颜色' },
|
|
|
+ { prop: 'totalqty', label: '净度' },
|
|
|
+ { prop: 'fixedprice', label: '切工' },
|
|
|
+ { prop: 'remainqty', label: '抛光' },
|
|
|
+ { prop: 'wrtradeorderstatus', label: '对称' },
|
|
|
+ { prop: 'ordertime', label: '荧光' },
|
|
|
+ { prop: 'tradedate', label: '尺寸' },
|
|
|
+ { prop: 'tradedate', label: '价格' },
|
|
|
+ { prop: 'tradedate', label: '克拉重量' },
|
|
|
+ { prop: 'tradedate', label: '克拉单价' },
|
|
|
+ { prop: 'operate', label: '操作', width: 180 }
|
|
|
+ ]],
|
|
|
+ // 挂牌大厅-求购大厅
|
|
|
+ ['listing_buyorder', [
|
|
|
+ { prop: 'wrtradeorderid', label: '委托单号', width: 200 },
|
|
|
+ { prop: 'buyusername', label: '买方' },
|
|
|
+ { prop: 'zscategorydisplay', label: '商品分类' },
|
|
|
+ { prop: 'zstabledisplay', label: '求购信息' },
|
|
|
+ { prop: 'wrtradeorderstatus', label: '状态' },
|
|
|
+ { prop: 'validtime', label: '有效日期', width: 180 },
|
|
|
+ { prop: 'ordertime', label: '委托时间', width: 180 },
|
|
|
+ { prop: 'operate', label: '操作' }
|
|
|
+ ]],
|
|
|
+ // 挂牌大厅-我的出售
|
|
|
+ ['listing_saleorder', [
|
|
|
+ { prop: 'wrtradeorderid', label: '委托单号', width: 200 },
|
|
|
+ { prop: 'zscategorydisplay', label: '商品分类' },
|
|
|
+ { prop: 'goodsno', label: '商品编号' },
|
|
|
+ { prop: 'totalqty', label: '委托重量' },
|
|
|
+ { prop: 'fixedprice', label: '克拉单价' },
|
|
|
+ { prop: 'selledqty', label: '成交重量' },
|
|
|
+ { prop: 'wrtradeorderstatus', label: '委托状态' },
|
|
|
+ { prop: 'ordertime', label: '委托时间', width: 180 },
|
|
|
+ { prop: 'operate', label: '操作' }
|
|
|
+ ]],
|
|
|
+ // 挂牌大厅-我的求购
|
|
|
+ ['listing_purchaseorder', [
|
|
|
+ { prop: 'wrtradeorderid', label: '委托单号', width: 200 },
|
|
|
+ { prop: 'zscategorydisplay', label: '商品分类' },
|
|
|
+ { prop: 'zstabledisplay', label: '求购信息' },
|
|
|
+ { prop: 'wrtradeorderstatus', label: '状态' },
|
|
|
+ { prop: 'validtime', label: '有效日期', width: 180 },
|
|
|
+ { prop: 'ordertime', label: '委托时间', width: 180 },
|
|
|
+ { prop: 'operate', label: '操作' }
|
|
|
+ ]],
|
|
|
+ // 挂牌大厅-我的摘牌
|
|
|
+ ['listing_delisting', [
|
|
|
+ { prop: 'buyorsell', label: '类型' },
|
|
|
+ { prop: 'matchusername', label: '对手方' },
|
|
|
+ { prop: 'zsshapetypedisplay', label: '形状' },
|
|
|
+ { prop: 'zscolortype1display', label: '颜色' },
|
|
|
+ { prop: 'zsclaritytype1display', label: '净度' },
|
|
|
+ { prop: 'zscuttype1display', label: '切工' },
|
|
|
+ { prop: 'zspolishtype1display', label: '抛光' },
|
|
|
+ { prop: 'zssymmetrytype1display', label: '对称' },
|
|
|
+ { prop: 'zsfluorescencetype1display', label: '荧光' },
|
|
|
+ { prop: 'ordertime', label: '尺寸' },
|
|
|
+ { prop: 'qty', label: '重量' },
|
|
|
+ { prop: 'ordertime', label: '价格' },
|
|
|
+ { prop: 'exchangerate', label: '汇率' },
|
|
|
+ { prop: 'tradeprice', label: '成交价格' },
|
|
|
+ { prop: 'tradetime', label: '成交时间', width: 200 },
|
|
|
+ { prop: 'operate', label: '操作' }
|
|
|
+ ]],
|
|
|
+ // 挂牌大厅-我的询价-求购
|
|
|
+ ['listing_inquire_buy', [
|
|
|
+ { prop: 'buyorsell', label: '类型' },
|
|
|
+ { prop: 'matchusername', label: '对手方' },
|
|
|
+ { prop: 'zstabledisplay', label: '形状' },
|
|
|
+ { prop: 'wrtradeorderstatus', label: '颜色' },
|
|
|
+ { prop: 'validtime', label: '净度' },
|
|
|
+ { prop: 'ordertime', label: '切工' },
|
|
|
+ { prop: 'ordertime', label: '抛光' },
|
|
|
+ { prop: 'ordertime', label: '对称' },
|
|
|
+ { prop: 'ordertime', label: '荧光' },
|
|
|
+ { prop: 'ordertime', label: '尺寸' },
|
|
|
+ { prop: 'qty', label: '重量' },
|
|
|
+ { prop: 'ordertime', label: '价格' },
|
|
|
+ { prop: 'exchangerate', label: '汇率' },
|
|
|
+ { prop: 'tradeprice', label: '成交价格' },
|
|
|
+ { prop: 'tradetime', label: '成交时间', width: 200 },
|
|
|
+ { prop: 'operate', label: '操作' }
|
|
|
+ ]],
|
|
|
+ // 挂牌大厅-我的询价-出售
|
|
|
+ ['listing_inquire_sell', [
|
|
|
+ { prop: 'buyorsell', label: '类型' },
|
|
|
+ { prop: 'matchusername', label: '对手方' },
|
|
|
+ { prop: 'zstabledisplay', label: '形状' },
|
|
|
+ { prop: 'wrtradeorderstatus', label: '颜色' },
|
|
|
+ { prop: 'validtime', label: '净度' },
|
|
|
+ { prop: 'ordertime', label: '切工' },
|
|
|
+ { prop: 'ordertime', label: '抛光' },
|
|
|
+ { prop: 'ordertime', label: '对称' },
|
|
|
+ { prop: 'ordertime', label: '荧光' },
|
|
|
+ { prop: 'ordertime', label: '尺寸' },
|
|
|
+ { prop: 'qty', label: '重量' },
|
|
|
+ { prop: 'ordertime', label: '价格' },
|
|
|
+ { prop: 'exchangerate', label: '汇率' },
|
|
|
+ { prop: 'tradeprice', label: '成交价格' },
|
|
|
+ { prop: 'tradetime', label: '成交时间', width: 200 },
|
|
|
+ { prop: 'operate', label: '操作' }
|
|
|
+ ]],
|
|
|
+ // 会员中心-我的出入金
|
|
|
+ ['mine_capital', [
|
|
|
+ { prop: 'logincode', label: '资金账户' },
|
|
|
+ { prop: 'branchbankname', label: '托管银行' },
|
|
|
+ { prop: 'executetype', label: '申请类型' },
|
|
|
+ { prop: 'amount', label: '金额' },
|
|
|
+ { prop: 'charge', label: '服务费' },
|
|
|
+ { prop: 'updatetime', label: '申请时间' },
|
|
|
+ { prop: 'applystatus', label: '状态' },
|
|
|
+ { prop: 'operate', label: '操作' }
|
|
|
+ ]],
|
|
|
+ // 会员中心-我的地址
|
|
|
+ ['mine_address', [
|
|
|
+ { prop: 'receivername', label: '收货人' },
|
|
|
+ { prop: 'cardtypeid', label: '证件类型' },
|
|
|
+ { prop: 'cardnum', label: '证件号码' },
|
|
|
+ { prop: 'phonenum', label: '联系电话' },
|
|
|
+ { prop: 'address', label: '收货地址' },
|
|
|
+ { prop: 'isdefault', label: '是否默认' },
|
|
|
+ { prop: 'operate', label: '操作', width: 250 }
|
|
|
+ ]],
|
|
|
+ // 会员中心-我的发票
|
|
|
+ ['mine_invoice', [
|
|
|
+ { prop: 'receipttype', label: '发票类型' },
|
|
|
+ { prop: 'username', label: '发票抬头' },
|
|
|
+ { prop: 'taxpayerid', label: '税号' },
|
|
|
+ { prop: 'contactinfo', label: '企业电话' },
|
|
|
+ { prop: 'information', label: '企业信息' },
|
|
|
+ { prop: 'operate', label: '操作' }
|
|
|
+ ]],
|
|
|
+])
|
|
|
+
|
|
|
+/**
|
|
|
+ * 获取表格列数据
|
|
|
+ * @param tableKey
|
|
|
+ * @returns
|
|
|
+ */
|
|
|
+export function getTableColumns(tableKey: TableColumnKey) {
|
|
|
+ const tableColumns = pcTableColumnMap.get(tableKey) ?? [] // *这里应该判断终端类型,有空再处理*
|
|
|
+
|
|
|
+ return tableColumns.map((e) => {
|
|
|
+ e.show = true
|
|
|
+ if (e.prop === 'operate') {
|
|
|
+ e.fixed = 'right'
|
|
|
+ }
|
|
|
+ return e
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
export function useTableColumns(tableKey: string, operateColumn = true) {
|
|
|
const tableColumns = sessionData.getValue('tableColumns')
|
|
|
|
|
|
@@ -34,42 +238,4 @@ export function useTableColumns(tableKey: string, operateColumn = true) {
|
|
|
columns,
|
|
|
updateColumns,
|
|
|
}
|
|
|
-}
|
|
|
-
|
|
|
-/**
|
|
|
- * 获取表格列数据
|
|
|
- * @param tableKey
|
|
|
- * @returns
|
|
|
- */
|
|
|
-export function getTableColumns(tableKey: string) {
|
|
|
- const tableColumns = tableColumnMap.get(tableKey) ?? []
|
|
|
- const columns = tableColumns.map((e) => {
|
|
|
- e.show = true
|
|
|
- if (e.prop === 'operate') {
|
|
|
- e.fixed = 'right'
|
|
|
- }
|
|
|
- return e
|
|
|
- })
|
|
|
- return shallowRef(columns)
|
|
|
-}
|
|
|
-
|
|
|
-const tableColumnMap = new Map<string, Ermcp.TableColumn[]>([
|
|
|
- // 我的仓储-我的库存
|
|
|
- ['warehousingDiamond', [
|
|
|
- { prop: 'goodsno', label: '商品编号' },
|
|
|
- { prop: 'price', label: '总价' },
|
|
|
- { prop: 'weight', label: '总重量' },
|
|
|
- { prop: 'weightavg', label: '平均单颗重量' },
|
|
|
- { prop: 'priceper', label: '克拉单位' },
|
|
|
- { prop: 'ftotalqty', label: '库存重量' },
|
|
|
- { prop: 'ffreezeqty', label: '冻结重量' },
|
|
|
- { prop: 'warehousenamedisplay', label: '仓库', width: 180 },
|
|
|
- { prop: 'zsshapetypedisplay', label: '形状', width: 200 },
|
|
|
- { prop: 'zscolortype', label: '颜色' },
|
|
|
- { prop: 'zsclaritytype', label: '净度' },
|
|
|
- { prop: 'operate', label: '操作' }
|
|
|
- ]],
|
|
|
- ['aa', [
|
|
|
- { prop: 'wrtradeorderid', label: '卖方' },
|
|
|
- ]]
|
|
|
-])
|
|
|
+}
|