|
@@ -1,17 +1,17 @@
|
|
|
<template>
|
|
|
<div class="mainContentBox">
|
|
|
<avue-crud
|
|
|
- ref="crudRef"
|
|
|
- v-model:search="search"
|
|
|
- v-model="form"
|
|
|
- :data="data"
|
|
|
- :option="option"
|
|
|
- v-model:page="page"
|
|
|
- @row-click="rowClick"
|
|
|
- @search-change="searchChange"
|
|
|
- @search-reset="resetChange"
|
|
|
- @size-change="dataList"
|
|
|
- @current-change="dataList"
|
|
|
+ ref="crudRef"
|
|
|
+ v-model:search="search"
|
|
|
+ v-model="form"
|
|
|
+ :data="data"
|
|
|
+ :option="option"
|
|
|
+ v-model:page="page"
|
|
|
+ @row-click="rowClick"
|
|
|
+ @search-change="searchChange"
|
|
|
+ @search-reset="resetChange"
|
|
|
+ @size-change="dataList"
|
|
|
+ @current-change="dataList"
|
|
|
>
|
|
|
</avue-crud>
|
|
|
</div>
|
|
@@ -32,7 +32,8 @@ const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
|
|
|
useCrud({
|
|
|
src: "/api/v1/device",
|
|
|
});
|
|
|
-const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } = Methords; //增删改查
|
|
|
+const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } =
|
|
|
+ Methords; //增删改查
|
|
|
const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
|
|
|
const { checkBtnPerm, downloadTemplate } = Utils; //按钮权限等工具
|
|
|
const props = defineProps({
|
|
@@ -40,14 +41,20 @@ const props = defineProps({
|
|
|
type: String,
|
|
|
default: () => {
|
|
|
return 0;
|
|
|
- }
|
|
|
- }
|
|
|
-})
|
|
|
+ },
|
|
|
+ },
|
|
|
+ operate: {
|
|
|
+ type: String,
|
|
|
+ default: () => {
|
|
|
+ return "";
|
|
|
+ },
|
|
|
+ },
|
|
|
+});
|
|
|
const crudRef = ref(null); //crudRef.value 获取avue-crud对象
|
|
|
-const emit = defineEmits(["deviceInfo"])
|
|
|
-const rowClick = (row)=>{
|
|
|
- emit("deviceInfo", row)
|
|
|
-}
|
|
|
+const emit = defineEmits(["deviceInfo"]);
|
|
|
+const rowClick = (row) => {
|
|
|
+ emit("deviceInfo", row);
|
|
|
+};
|
|
|
|
|
|
// 设置表格列或者其他自定义的option
|
|
|
option.value = Object.assign(option.value, {
|
|
@@ -63,7 +70,7 @@ option.value = Object.assign(option.value, {
|
|
|
label: "资产编号",
|
|
|
prop: "deviceNo",
|
|
|
search: true,
|
|
|
- width: '120',
|
|
|
+ width: "120",
|
|
|
rules: [
|
|
|
{
|
|
|
required: true,
|
|
@@ -76,7 +83,7 @@ option.value = Object.assign(option.value, {
|
|
|
label: "设备名称",
|
|
|
prop: "deviceName",
|
|
|
search: true,
|
|
|
- width: '120',
|
|
|
+ width: "120",
|
|
|
rules: [
|
|
|
{
|
|
|
required: true,
|
|
@@ -88,45 +95,43 @@ option.value = Object.assign(option.value, {
|
|
|
|
|
|
{
|
|
|
label: "负责人",
|
|
|
- width: '100',
|
|
|
+ width: "100",
|
|
|
prop: "head",
|
|
|
},
|
|
|
{
|
|
|
label: "存放位置",
|
|
|
- width: '150',
|
|
|
+ width: "150",
|
|
|
prop: "devicePosition",
|
|
|
},
|
|
|
{
|
|
|
label: "型号",
|
|
|
- width: '150',
|
|
|
+ width: "150",
|
|
|
prop: "specifications",
|
|
|
},
|
|
|
{
|
|
|
label: "制造厂",
|
|
|
- width: '150',
|
|
|
+ width: "150",
|
|
|
prop: "brand",
|
|
|
},
|
|
|
- {
|
|
|
- label: "原值",
|
|
|
- prop: "originalValue",
|
|
|
- width: 100,
|
|
|
- overHidden: true,
|
|
|
- },
|
|
|
- {
|
|
|
- label: "出厂编号",
|
|
|
- prop: "serialNumber",
|
|
|
- width: 100,
|
|
|
- overHidden: true,
|
|
|
- },
|
|
|
+ {
|
|
|
+ label: "原值",
|
|
|
+ prop: "originalValue",
|
|
|
+ width: 100,
|
|
|
+ overHidden: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "出厂编号",
|
|
|
+ prop: "serialNumber",
|
|
|
+ width: 100,
|
|
|
+ overHidden: true,
|
|
|
+ },
|
|
|
{
|
|
|
label: "设备类型",
|
|
|
prop: "deviceType",
|
|
|
type: "select",
|
|
|
search: true,
|
|
|
- width: '100',
|
|
|
- dicUrl:
|
|
|
- dictDataUtil.request_url +
|
|
|
- dictDataUtil.TYPE_CODE.device_type,
|
|
|
+ width: "100",
|
|
|
+ dicUrl: dictDataUtil.request_url + dictDataUtil.TYPE_CODE.device_type,
|
|
|
props: {
|
|
|
label: "dictLabel",
|
|
|
value: "dictValue",
|
|
@@ -136,9 +141,13 @@ option.value = Object.assign(option.value, {
|
|
|
});
|
|
|
|
|
|
onMounted(() => {
|
|
|
- if(props.deviceType!=null){
|
|
|
+ console.log("aaa", props.operate);
|
|
|
+ if (props.deviceType != null) {
|
|
|
search.value.deviceType = props.deviceType;
|
|
|
}
|
|
|
+ if (props.operate != null) {
|
|
|
+ search.value.operate = props.operate;
|
|
|
+ }
|
|
|
dataList();
|
|
|
});
|
|
|
</script>
|