From 49d495b5cf52db8c165a7a4a6f6c8145c77f0513 Mon Sep 17 00:00:00 2001 From: 石广澎 <shiguangpeng@163.com> Date: 星期一, 23 十月 2023 13:03:49 +0800 Subject: [PATCH] 前端静态字典 --- admin-web/src/constants/dbTableDict.js | 93 ++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 93 insertions(+), 0 deletions(-) diff --git a/admin-web/src/constants/dbTableDict.js b/admin-web/src/constants/dbTableDict.js new file mode 100644 index 0000000..ea73732 --- /dev/null +++ b/admin-web/src/constants/dbTableDict.js @@ -0,0 +1,93 @@ +/** + * dqyy_resource_hotel.nature 閲婁箟锛氫綇瀹垮棣嗙鐞嗐�恉qyy_resource_hotel銆� -- 瀹鹃鎬ц川銆�1锛氳嚜鏈� 2锛氬悎浣溿�� + * @type {[{label: string, value: number}, {label: string, value: number}]} + */ +export const dqyy_resource_hotel_nature = + [ + { label: '鑷湁', value: 1 }, + { label: '鍚堜綔', value: 2 } + ]; +/** + * dqyy_resource_classroom.nature 閲婁箟锛氭暀瀛﹀満鍦伴绠$悊銆恉qyy_resource_classroom銆� -- 瀹鹃鎬ц川銆�1锛氳嚜鏈� 2锛氬悎浣溿�� + * @type {[{label: string, value: number}, {label: string, value: number}]} + */ +export const dqyy_resource_classroom_nature = + [ + { label: '鑷湁', value: 1 }, + { label: '鍚堜綔', value: 2 } + ]; +/** + * dqyy_resource_foremen.nature 閲婁箟锛氬甫鐝汉鍛樼鐞嗐�恉qyy_resource_foremen銆� -- 绫诲瀷銆�1锛氫笓鑱� 2锛氬吋鑱屻�� + * @type {[{label: string, value: number}, {label: string, value: number}]} + */ +export const dqyy_resource_foremen_nature = + [ + { label: '涓撹亴', value: 1 }, + { label: '鍏艰亴', value: 2 } + ]; +/** + * dqyy_resource_foremen.user_type 閲婁箟锛氬甫鐝汉鍛樼鐞嗐�恉qyy_resource_foremen銆� -- 甯︾彮绫诲瀷銆�1锛氱彮涓讳换銆�2锛氫富鍔炴柟銆� + * @type {[{label: string, value: number}, {label: string, value: number}]} + */ +export const dqyy_resource_foremen_user_type = + [ + { label: '鐝富浠�', value: 1 }, + { label: '涓诲姙鏂�', value: 2 } + ]; + /** + * dqyy_resource_dining_room.nature 閲婁箟锛氬氨椁愰鍘呯鐞嗐�恉qyy_resource_dining_room銆� -- 椁愬巺鎬ц川銆�1锛氳嚜鏈� 2锛氬悎浣溿�� + * @type {[{label: string, value: number}, {label: string, value: number}]} + */ +export const dqyy_resource_dining_room_nature = +[ + { label: '鑷湁', value: 1 }, + { label: '鍚堜綔', value: 2 } +]; +/** + * ct_train_base.base_type 閲婁箟锛氬煿璁熀鍦扮鐞嗐�恈t_train_base銆� -- 鍩哄湴绫诲瀷锛氥��1锛氬厷鏍� 2锛氬煿璁腑蹇冦�� + * @type {[{label: string, value: string}, {label: string, value: string}]} + */ +export const ct_train_base_base_type = + [ + { label: '鍏氭牎', value: '1' }, + { label: '鍩硅涓績', value: '2' } + ]; + + + +/** + * 鍦╗{label:"",value:""},{label:"",value:""}]鏁版嵁缁撴瀯涓紝鏍规嵁浼犲叆鐨剉alue锛岃繑鍥瀕abel鍊� + * @param array + * @param key + * @returns {string} + */ +function getLabel(array,key){ + if(array == undefined) array = []; + + let label = ''; + array.forEach((value,index)=>{ + if (String(value["value"]) == String(key)){ + label = value["label"]; + return; + } + }) + return label; +} + +/** + * 鍚戝綋鍓嶆暟缁勭殑棣栦綅鍔犲叆obj鍏冪礌 + * @param obj + * @returns {Array} + */ +Array.prototype.addItem=function(obj){ + this.unshift(obj); + return this; +} +/** + * 鍦╗{label:"",value:""},{label:"",value:""}]鏁版嵁缁撴瀯涓紝鏍规嵁浼犲叆鐨剉alue锛岃繑鍥瀕abel鍊� + * @param key + * @returns {string} + */ +Array.prototype.getLabel=function(key){ + return getLabel(this,key); +} -- Gitblit v1.9.1