|
@@ -7,12 +7,19 @@
|
|
|
:data="data"
|
|
|
:option="option"
|
|
|
v-model:page="page"
|
|
|
- @row-click="rowClick"
|
|
|
+ @row-click="clickItem"
|
|
|
@search-change="searchChange"
|
|
|
@search-reset="resetChange"
|
|
|
@size-change="dataList"
|
|
|
@current-change="dataList"
|
|
|
- />
|
|
|
+ @selection-change="selectionChange"
|
|
|
+ >
|
|
|
+ <template #footer>
|
|
|
+ <div v-if="multipleKey" style="width:60px;height:35px;float:right;margin-top: 15px;">
|
|
|
+ <el-button type="primary" @click="onSelected"> 确定 </el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </avue-crud>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script setup>
|
|
@@ -26,10 +33,25 @@ const test = () => {
|
|
|
isShowTable.value = true;
|
|
|
tableType.value = tableType.value == 1 ? 2 : 1;
|
|
|
};
|
|
|
+const props = defineProps({
|
|
|
+ queryType: {
|
|
|
+ type: String,
|
|
|
+ default: () => {
|
|
|
+ return "0";
|
|
|
+ },
|
|
|
+ },
|
|
|
+ multipleKey:{
|
|
|
+ type: String,
|
|
|
+ default: ()=>{
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+});
|
|
|
// 传入一个url,后面不带/
|
|
|
const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
|
|
|
useCrud({
|
|
|
src: "/api/v1/plan/workOrder",
|
|
|
+ multipleSelectKey: props.multipleKey,
|
|
|
});
|
|
|
const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } =
|
|
|
Methords; //增删改查
|
|
@@ -41,18 +63,22 @@ const emit = defineEmits(["orderInfo"]);
|
|
|
const rowClick = (row) => {
|
|
|
emit("orderInfo", row);
|
|
|
};
|
|
|
-const props = defineProps({
|
|
|
- queryType: {
|
|
|
- type: String,
|
|
|
- default: () => {
|
|
|
- return "0";
|
|
|
- },
|
|
|
- },
|
|
|
-});
|
|
|
+const multipleKeyVal = ref(null)
|
|
|
+
|
|
|
+const onSelected = () => {
|
|
|
+ emit("orderInfo", toDeleteIds.value);
|
|
|
+};
|
|
|
+const clickItem = (row)=>{
|
|
|
+ if(!props.multipleKey){
|
|
|
+ rowClick(row)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
// 设置表格列或者其他自定义的option
|
|
|
option.value = Object.assign(option.value, {
|
|
|
delBtn: false,
|
|
|
- selection: false,
|
|
|
+ selection: props.multipleKey ? true : false,
|
|
|
search: false,
|
|
|
editBtn: false,
|
|
|
addBtn: false,
|
|
@@ -227,6 +253,7 @@ option.value = Object.assign(option.value, {
|
|
|
});
|
|
|
|
|
|
onMounted(() => {
|
|
|
+ multipleKeyVal.value = props.multipleKey
|
|
|
search.value.queryType = String(props.queryType);
|
|
|
dataList();
|
|
|
});
|