|
@@ -69,19 +69,30 @@
|
|
v-model:show="oper.state.show"
|
|
v-model:show="oper.state.show"
|
|
enterText="确 定"
|
|
enterText="确 定"
|
|
@submit="submit"
|
|
@submit="submit"
|
|
- width="480"
|
|
|
|
|
|
+ width="500"
|
|
>
|
|
>
|
|
- <el-form ref="form" :model="form" label-width="68px" class="camera-from">
|
|
|
|
|
|
+ <el-form ref="form" :model="form" label-width="75px" class="camera-from">
|
|
<el-form-item label="SN码:" class="mandatory">
|
|
<el-form-item label="SN码:" class="mandatory">
|
|
<el-input :modelValue="oper.state.snCode" placeholder="请输入相机底部SN码,如214D5RE2G8" @update:modelValue="val => oper.state.snCode = val.trim()"></el-input>
|
|
<el-input :modelValue="oper.state.snCode" placeholder="请输入相机底部SN码,如214D5RE2G8" @update:modelValue="val => oper.state.snCode = val.trim()"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
+ <el-form-item label="管理员:" label-width="75px" class="mandatory">
|
|
|
|
+ <el-select v-model="oper.state.userId" placeholder="请选择">
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="item in list"
|
|
|
|
+ :key="item.id"
|
|
|
|
+ :label="item.nickName"
|
|
|
|
+ :value="item.id"
|
|
|
|
+ >
|
|
|
|
+ </el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
</com-dialog>
|
|
</com-dialog>
|
|
|
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import { ref, watch } from "vue";
|
|
|
|
|
|
+import { reactive, ref, watch,onMounted,toRefs } from "vue";
|
|
import getTableState from "@/state/tableRef";
|
|
import getTableState from "@/state/tableRef";
|
|
import auth from "@/state/viewAuth";
|
|
import auth from "@/state/viewAuth";
|
|
import comDialog from "@/components/dialog";
|
|
import comDialog from "@/components/dialog";
|
|
@@ -94,7 +105,8 @@ import {
|
|
insertCamera,
|
|
insertCamera,
|
|
deleteCamera,
|
|
deleteCamera,
|
|
unbindCamera,
|
|
unbindCamera,
|
|
- updateCamera
|
|
|
|
|
|
+ updateCamera,
|
|
|
|
+ getUserListSelect
|
|
} from '@/request/config'
|
|
} from '@/request/config'
|
|
import axios from 'axios';
|
|
import axios from 'axios';
|
|
|
|
|
|
@@ -107,12 +119,18 @@ export default {
|
|
getUrl: getCameraList,
|
|
getUrl: getCameraList,
|
|
delUrl: deleteCamera,
|
|
delUrl: deleteCamera,
|
|
searchAttr: { deptId: '', snCode: '' },
|
|
searchAttr: { deptId: '', snCode: '' },
|
|
- operAttr: { snCode: '', cameraSn: '' },
|
|
|
|
|
|
+ operAttr: { snCode: '', cameraSn: '',userId:'' },
|
|
delMsg: '解绑相机,该相机拍摄的场景也将一并解绑(场景在云端存储,不会删除)确定要解绑吗?'
|
|
delMsg: '解绑相机,该相机拍摄的场景也将一并解绑(场景在云端存储,不会删除)确定要解绑吗?'
|
|
});
|
|
});
|
|
const headList = ref([{ name: "相机管理", value: 2 }]);
|
|
const headList = ref([{ name: "相机管理", value: 2 }]);
|
|
|
|
+ const userList = reactive({
|
|
|
|
+ list:[]
|
|
|
|
+ })
|
|
const time = ref(null)
|
|
const time = ref(null)
|
|
-
|
|
|
|
|
|
+ const getuserlist = async () =>{
|
|
|
|
+ let res = await axios.get(getUserListSelect, {})
|
|
|
|
+ userList.list = res.data || []
|
|
|
|
+ }
|
|
watch(state.oper.value.state, () => {
|
|
watch(state.oper.value.state, () => {
|
|
state.oper.value.state.cameraSn = state.oper.value.state.snCode
|
|
state.oper.value.state.cameraSn = state.oper.value.state.snCode
|
|
})
|
|
})
|
|
@@ -133,8 +151,10 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
)
|
|
)
|
|
-
|
|
|
|
- return { ...state, headList, time, auth };
|
|
|
|
|
|
+ onMounted(async ()=>{
|
|
|
|
+ getuserlist()
|
|
|
|
+ })
|
|
|
|
+ return { ...state,...toRefs(userList), headList, time, auth,getuserlist, };
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
async unbindCamrea(data) {
|
|
async unbindCamrea(data) {
|
|
@@ -148,6 +168,9 @@ export default {
|
|
if (!this.oper.state.snCode.trim()) {
|
|
if (!this.oper.state.snCode.trim()) {
|
|
return this.$message.error('S/N码不能为空!', '提示')
|
|
return this.$message.error('S/N码不能为空!', '提示')
|
|
}
|
|
}
|
|
|
|
+ if (!this.oper.state.userId) {
|
|
|
|
+ return this.$message.error('请选择管理员', '提示')
|
|
|
|
+ }
|
|
|
|
|
|
this.oper.state.id ? this.oper.update() : this.oper.insert()
|
|
this.oper.state.id ? this.oper.update() : this.oper.insert()
|
|
}
|
|
}
|