constant.ts 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. import { LineIconData } from "@/core/components/line-icon";
  2. export type IconItem = {
  3. wall?: boolean;
  4. icon: string;
  5. name: string;
  6. color?: string;
  7. parse?: {
  8. key?: string;
  9. fill?: string;
  10. stroke?: string;
  11. type?: LineIconData["type"];
  12. height?: number;
  13. width?: number;
  14. };
  15. };
  16. export type IconGroup = {
  17. name: string;
  18. children: {
  19. name: string;
  20. children: IconItem[];
  21. }[];
  22. };
  23. const traceIcons = [
  24. { icon: "zhiwen_o", name: "手印" },
  25. { icon: "zuozuji_o", name: "脚印" },
  26. { icon: "youzuji_o", name: "脚印" },
  27. { icon: "xieyin_o", name: "鞋印" },
  28. { icon: "chelunhenji_o", name: "车轮印" },
  29. { icon: "dantou_o", name: "弹头" },
  30. { icon: "danke_o", name: "弹壳" },
  31. { icon: "shouqiang_o", name: "手枪" },
  32. { icon: "buqiang_o", name: "步枪" },
  33. {
  34. icon: "xuepo_o",
  35. name: "血泊",
  36. color: "#DD2C2C",
  37. parse: { fill: "#DD2C2C", stroke: undefined },
  38. },
  39. {
  40. icon: "xueji_o",
  41. name: "血迹",
  42. color: "#DD2C2C",
  43. parse: { fill: "#DD2C2C", stroke: undefined },
  44. },
  45. { parse: { key: "trace" }, icon: "shitiz_o", name: "尸体正面" },
  46. { parse: { key: "trace" }, icon: "shitib_o", name: "尸体背面" },
  47. { parse: { key: "trace" }, icon: "shitifuhao_o", name: "尸体" },
  48. { parse: { key: "trace" }, icon: "handprint", name: "手印痕迹" },
  49. { parse: { key: "trace" }, icon: "footprint", name: "足迹痕迹" },
  50. {
  51. parse: { key: "trace" },
  52. icon: "wrenchAndScrewdriver",
  53. name: "工具痕迹",
  54. },
  55. { parse: { key: "trace" }, icon: "video", name: "视听物证" },
  56. { parse: { key: "trace" }, icon: "virus", name: "生物物证" },
  57. { parse: { key: "trace" }, icon: "cartridge", name: "枪弹痕迹" },
  58. { parse: { key: "trace" }, icon: "poison", name: "毒化物证" },
  59. {
  60. parse: { key: "trace" },
  61. icon: "physics_and_chemistry",
  62. name: "理化物证",
  63. },
  64. { parse: { key: "trace" }, icon: "folder_close", name: "文捡物证" },
  65. { parse: { key: "trace" }, icon: "check", name: "特殊物证" },
  66. {
  67. parse: { key: "trace" },
  68. icon: "case_other",
  69. name: "其他物证",
  70. },
  71. { parse: { key: "trace" }, icon: "electronic", name: "电子物证" },
  72. { parse: { key: "trace" }, icon: "cube", name: "提取物品" },
  73. { parse: { key: "trace" }, icon: "corpse", name: "尸体" },
  74. ];
  75. export const iconGroups: IconGroup[] = [
  76. {
  77. name: "常用名称",
  78. children: [
  79. {
  80. name: "门",
  81. children: [
  82. {
  83. wall: true,
  84. icon: "men_l",
  85. name: "开门",
  86. parse: { type: "align-bottom" },
  87. },
  88. // {
  89. // wall: true,
  90. // icon: "men",
  91. // name: "右开门",
  92. // parse: { type: "align-bottom" },
  93. // },
  94. {
  95. wall: true,
  96. icon: "shuangkaimen",
  97. name: "双开门",
  98. parse: { type: "align-bottom" },
  99. },
  100. {
  101. wall: true,
  102. icon: "yimen",
  103. name: "移门",
  104. parse: { type: "full" },
  105. },
  106. { wall: true, icon: "yakou", name: "哑口", parse: { type: "full" } },
  107. ],
  108. },
  109. {
  110. name: "窗",
  111. children: [
  112. { wall: true, icon: "chuang", name: "窗", parse: { type: "full" } },
  113. {
  114. wall: true,
  115. icon: "piaochuang",
  116. name: "飘窗",
  117. parse: { type: "align-bottom-fix", width: 180, height: 70 },
  118. },
  119. {
  120. wall: true,
  121. icon: "luodichuang",
  122. name: "落地窗",
  123. parse: { type: "full" },
  124. },
  125. ],
  126. },
  127. {
  128. name: "构件",
  129. children: [
  130. { icon: "zhuzi", name: "柱子" },
  131. { icon: "yandao", name: "烟道" },
  132. { icon: "loudao", name: "楼道" },
  133. ],
  134. },
  135. ],
  136. },
  137. {
  138. name: "家具",
  139. children: [
  140. {
  141. name: "客餐厅",
  142. children: [
  143. { icon: "TV", name: "电视柜" },
  144. { icon: "CombinationSofa", name: "组合沙发" },
  145. { icon: "ThreeSofa", name: "三人沙发" },
  146. { icon: "SingleSofa", name: "单人沙发" },
  147. { icon: "Chair", name: "椅子" },
  148. { icon: "TeaTable", name: "茶几" },
  149. { icon: "Carpet", name: "地毯" },
  150. { icon: "Plant", name: "植物" },
  151. { icon: "DiningTable", name: "餐桌" },
  152. ],
  153. },
  154. {
  155. name: "卧室",
  156. children: [
  157. { icon: "DoubleBed", name: "双人床" },
  158. { icon: "SingleBed", name: "单人床" },
  159. { icon: "Wardrobe", name: "衣柜" },
  160. { icon: "Dresser", name: "梳妆台" },
  161. { icon: "BedsideCupboard", name: "床头柜" },
  162. { icon: "Pillow", name: "抱枕" },
  163. ],
  164. },
  165. {
  166. name: "厨卫",
  167. children: [
  168. { icon: "GasStove", name: "燃气灶" },
  169. { icon: "Cupboard", name: "橱柜" },
  170. { icon: "Bathtub", name: "浴缸" },
  171. { icon: "Closestool", name: "马桶" },
  172. { icon: "Washstand", name: "洗漱台" },
  173. ],
  174. },
  175. {
  176. name: "其他",
  177. children: [
  178. { icon: "Desk", name: "书桌" },
  179. { icon: "BalconyChair", name: "阳台椅" },
  180. { icon: "Elevator", name: "电梯" },
  181. ],
  182. },
  183. ],
  184. },
  185. {
  186. name: "痕迹物证",
  187. children: [
  188. {
  189. name: "",
  190. children: traceIcons,
  191. },
  192. ],
  193. },
  194. ];
  195. export const getIconItem = (icon: string) => {
  196. for (const group of iconGroups) {
  197. for (const itemGroup of group.children) {
  198. for (const item of itemGroup.children) {
  199. if (item.icon === icon) {
  200. return item;
  201. }
  202. }
  203. }
  204. }
  205. };
  206. export const aiIconMap = {
  207. SingleDoor: "men_l",
  208. DoubleDoor: "shuangkaimen",
  209. SlideDoor: "yimen",
  210. Pass: "yakou",
  211. SingleWindow: "chuang",
  212. BayWindow: "piaochuang",
  213. FrenchWindow: "luodichuang",
  214. Chair: "Chair",
  215. };
  216. export const styleIconMap = {
  217. "style-4": "zhiwen_o",
  218. "style-5": "youzuji_o",
  219. "style-6": "zuozuji_o",
  220. "style-7": "xieyin_o",
  221. "style-8": "xuepo_o",
  222. "style-9": "xueji_o",
  223. "style-10": "shitiz_o",
  224. "style-11": "shitib_o",
  225. "style-12": "shitifuhao_o",
  226. "style-13": "buqiang_o",
  227. "style-14": "shouqiang_o",
  228. "style-15": "dantou_o",
  229. "style-16": "danke_o",
  230. "style-17": "chelunhenji_o",
  231. };
  232. export const traceIconMap: Record<string, string> = {};
  233. for (const icon of traceIcons) {
  234. traceIconMap[icon.icon + ".png"] = icon.icon;
  235. const ndx = icon.icon.lastIndexOf("_o");
  236. if (~ndx) {
  237. const name = icon.icon.substring(0, ndx);
  238. traceIconMap[name + ".png"] = icon.icon;
  239. }
  240. }
  241. console.log(traceIconMap);