原创 JS 根據對象的某個屬性排序

//定義一個比較器 compare(propertyName) { return function(object1, object2) { var value1 = object1[propertyName] va

原创 JS rgba顏色(字符串)轉化16進制顏色值

值爲:rgba(194, 78, 78, 1) 轉化爲: #c24e4e //轉化顏色 getHexColor(color) { var values = color .replace(/rgba?\(/, '')

原创 JS 公用函數Date格式化

1.Date格式化 示例:dateFormat(new Date(),"yyyy-MM-dd") function dateFormat(date, format) { format = format || 'yyyy-MM-dd

原创 JS 字符串轉Date類型

//字符串轉日期時間格式 getDate(strDate) { var date = eval('new Date(' + strDate.replace(/\d+(?=-[^-]+$)/, function (a) {

原创 跳轉路由刷新頁面,緩存操作(Element + Vue)

在跳轉之前關閉,跳轉之後,在刷新函數的裏面加入開啓緩存(寫在最後一行)。 //全局關閉緩存 this.$route.meta.$keepAlive = false; //全局開啓緩存 this.$route.meta.$kee

原创 SpringCloud自定義定時任務

import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Configur

原创 java將Map對象轉換成JSON字符串

Map<String, String> params = getParams(adentity); //將參數map轉換成json字符串 String resData = JSON.toJSONString(params, Se

原创 JS日期差,相差的天數

// 相差的天數 getDaysBetween: function(dateString1, dateString2) { var startDate = Date.parse(dateString1); var endDat

原创 Vue Form對象轉JSON對象(Element + Vue)

//實例對象參數屬性 form轉json對象 let data = this.form; let jsonObjList = []; let jsonObj = { name: "", value: "" }; for (let

原创 MYSQL JOIN ON 字段類型不同數據混亂解決方法

role.id字段是bigint類型  1.CAST(xxx  AS   類型) 例子:role.id= CAST(bu.role_id AS DECIMAL(64))         2.CONVERT(xxx,類型) 例子:role

原创 Mysql 添加查詢語句(防老年癡呆)

 就是添加,查詢的內容。 1.先添加一條記錄 INSERT INTO tenant_baseparameter`(`id`,`parameter_name`,`parameter_cn`,...,...,...)values ( #{i

原创 HTML即時搜索(防老年癡呆)

    維護一個APP項目時,本來是個下拉選擇的input,因爲選擇項太多了,要求方便使用,我就做了個及時搜索,blur失焦時做了驗證處理。 HTML: <div class="mui-col-sm-6 mui-col-xs-6 mu

原创 中文字符,提取首字母大寫(防老年癡呆)

轉載的 1.先下載配置文件 <dependency> <groupId>com.belerweb</groupId> <artifactId>pinyin4j</artifactId> <version>2.5.0</version

原创 初學Thymeleaf,筆記(防老年癡呆)

  Thymeleaf官方學習地址:https://www.thymeleaf.org/doc/tutorials/2.1/usingthymeleaf.html#what-is-thymeleaf 以下是個人筆記(只記錄了比較具有特色的

原创 bootstrap 下拉複選框並回顯驗證(防老年癡呆)

<th:block th:include="include :: select2-css" /> <th:block th:include="include :: bootstrap-select-css" /> <th:block