6.16 6

七安。發表於2024-06-17
今天實現高階檢索的html程式碼
        <template>
          <div id="search-container">
            <div class="search-row" v-for="(item, index) in limitedSearchItems" :key="index">
              <div class="search-col">
                <el-select v-model="item.logicalOperator" v-if="index > 0" class="form-control logical-operator"
                           :disabled="index === 0">
                  <el-option value="AND">AND</el-option>
                  <el-option value="OR">OR</el-option>
                </el-select>
                <el-select v-model="item.label" class="form-control inline-label">
                  <el-option value="政策名稱">政策名稱</el-option>
                  <el-option value="政策分類">政策分類</el-option>
                  <el-option value="類別">類別</el-option>
                  <el-option value="施行範圍">施行範圍</el-option>
                  <el-option value="發文字號">發文字號</el-option>
                  <el-option value="頒佈形式">頒佈形式</el-option>
                  <el-option value="制定機關">制定機關</el-option>
                  <el-option value="全文">全文</el-option>
                </el-select>
                <el-input type="text" class="form-control inline-input" v-model="item.value"
                          placeholder="請輸入關鍵詞"></el-input>
                <el-select v-model="item.matchType" class="form-control match-type">
                  <el-option value="精確">精確</el-option>
                  <el-option value="模糊">模糊</el-option>
                </el-select>
              </div>
              <el-button v-if="index > 1" @click="removeSearchItem(index)" type="warning" class="delete-btn">刪除
              </el-button>
            </div>
            <el-button  @click="addSearchItem" type="primary">新增檢索項</el-button>
            <div class="button-wrapper">
              <el-button @click="search1" type="primary" class="search-btn">開始搜尋</el-button>
            </div>
          </div>
        </template>