123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305 |
- <template>
- <div>
- <el-form ref="form" :model="form" :rules="rules" label-width="108px">
- <div class="inputBox flexBox">
- <span class="label">配置ID</span>
- <div>{{ confId }}</div>
- </div>
- <div class="flexBox headBox">
- <el-form-item label="配置名称:" prop="secrete">
- <el-select v-model="form.secrete">
- <el-option
- v-for="item in confList"
- :label="item.caption"
- :value="item.code"
- :key="item.code"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="配置描述:" prop="title">
- <el-input
- placeholder="请输入"
- maxlength="150"
- v-autoTrim="{ obj: form, key: 'title' }"
- v-model="form.title"
- >
- </el-input>
- </el-form-item>
- <el-form-item label="车辆名称:" prop="title">
- <el-input
- placeholder="请输入"
- maxlength="150"
- v-autoTrim="{ obj: form, key: 'title' }"
- v-model="form.title"
- >
- </el-input>
- </el-form-item>
- <el-form-item label="车辆描述:" prop="title">
- <el-input
- placeholder="请输入"
- maxlength="150"
- v-autoTrim="{ obj: form, key: 'title' }"
- v-model="form.title"
- >
- </el-input>
- </el-form-item>
- </div>
- <div class="contentBox">
- <div>
- <el-button type="primary" class="previewBtn"
- >预览</el-button
- >
- <handle-config-list
- v-for="index in 4"
- :isActiveA="index === 1"
- :titleCode="index - 1"
- :key="index"
- @curItem="curItem"
- ></handle-config-list>
- </div>
- <div class="model">
- <img src="../../assets/common/image/car.png" width="100%" />
- </div>
- <div class="conditions">
- <div class="titlePanel">
- <i class="el-icon el-icon-video-camera"></i>
- <span class="name">{{ curTitle }}</span>
- </div>
- <div class="forms">
- <el-form-item label="X(M):" prop="x">
- <el-input
- placeholder="请输入"
- maxlength="15"
- v-autoTrim="{ obj: form, key: 'x' }"
- v-model="form.x"
- >
- </el-input>
- </el-form-item>
- <el-form-item label="Y(M):" prop="y">
- <el-input
- placeholder="请输入"
- maxlength="15"
- v-autoTrim="{ obj: form, key: 'y' }"
- v-model="form.y"
- >
- </el-input>
- </el-form-item>
- <el-form-item label="Z(M):" prop="z">
- <el-input
- placeholder="请输入"
- maxlength="15"
- v-autoTrim="{ obj: form, key: 'z' }"
- v-model="form.z"
- >
- </el-input>
- </el-form-item>
- <el-form-item label="横摆角(deg):" prop="title">
- <el-input
- placeholder="请输入"
- maxlength="15"
- v-autoTrim="{ obj: form, key: 'title' }"
- v-model="form.title"
- >
- </el-input>
- </el-form-item>
- <el-form-item label="俯仰角(deg):" prop="title">
- <el-input
- placeholder="请输入"
- maxlength="15"
- v-autoTrim="{ obj: form, key: 'title' }"
- v-model="form.title"
- >
- </el-input>
- </el-form-item>
- <el-form-item label="翻滚角(deg):" prop="title">
- <el-input
- placeholder="请输入"
- maxlength="15"
- v-autoTrim="{ obj: form, key: 'title' }"
- v-model="form.title"
- >
- </el-input>
- </el-form-item>
- </div>
- </div>
- </div>
- <div class="btns">
- <el-button type="primary" @click="save">保存</el-button>
- <el-button type="primary">取消</el-button>
- <el-button type="primary">分享</el-button>
- </div>
- </el-form>
- </div>
- </template>
- <script>
- import handleConfigList from "./components/handleConfigList.vue";
- export default {
- name: "addVehicleConfiguration", // 新增车辆配置
- components: { handleConfigList },
- data() {
- let validateNum = (rule, value, callback) => {
- // !/^(-?\d+)(\.\d{1,2})?$/.test(value) &&
- !/^(-?(0|[1-9][0-9]+))(\.\d{1,2})?$/.test(value) &&
- callback(new Error(rule.message));
- callback();
- };
- return {
- confId: "l2s2d3k4j5fl90898",
- confList: [{ caption: "玩儿", code: 1 }],
- curTitle: "水电费可接受的李逵负荆",
- form: {
- title: "",
- content: "",
- sendto: "",
- sendtoIds: "",
- md5PathList: [],
- secrete: "",
- x: "",
- y: "",
- z: "",
- },
- rules: {
- title: [
- { required: true, message: "请输入标题", trigger: "blur" },
- ],
- content: [
- { required: true, message: "请输入内容", trigger: "blur" },
- ],
- sendto: [
- {
- required: true,
- message: "请选择发送对象",
- trigger: "change",
- },
- ],
- secrete: [
- { required: true, message: "请选择密级", trigger: "blur" },
- ],
- x: [
- {
- required: true,
- message: "请输入X轴坐标",
- trigger: "blur",
- },
- {
- validator: validateNum,
- message: "请输入最多带有2位小数的数字",
- trigger: ["blur"],
- },
- ],
- y: [
- {
- required: true,
- message: "请输入Y轴坐标",
- trigger: "blur",
- },
- {
- validator: validateNum,
- message: "请输入最多带有2位小数的数字",
- trigger: ["blur"],
- },
- ],
- z: [
- {
- required: true,
- message: "请输入Z轴坐标",
- trigger: "blur",
- },
- {
- validator: validateNum,
- message: "请输入最多带有2位小数的数字",
- trigger: ["blur"],
- },
- ],
- },
- };
- },
- computed: {},
- methods: {
- save() {
- this.$refs.form.validate().then(
- async (valid) => {
- console.log(6);
- },
- (valid) => {
- // 表单校验失败
- this.$message.error("错了哦");
- }
- );
- },
- curItem(title) {
- this.curTitle = title;
- },
- },
- // mounted: {},
- };
- </script>
- <style lang='less' scoped>
- .el-form {
- margin: 55px 50px 0;
- }
- .headBox {
- .el-form-item {
- margin-right: 20px;
- }
- }
- .inputBox.flexBox {
- margin-bottom: 22px;
- .label {
- width: 88px;
- }
- div {
- line-height: 32px;
- }
- }
- .contentBox {
- display: flex;
- justify-content: space-between;
- margin-top: 30px;
- .previewBtn {
- width: 100%;
- margin-bottom: 15px;
- }
- .model {
- width: 400px;
- }
- .conditions {
- .titlePanel {
- padding-bottom: 30px;
- color: @themeColor;
- .name {
- margin-left: 10px;
- }
- }
- .forms /deep/ .el-form-item__label {
- width: 120px !important;
- }
- .forms /deep/ .el-form-item__content {
- margin-left: 120px !important;
- }
- }
- }
- .btns {
- padding-top: 30px;
- text-align: center;
- }
- </style>
|