UploadInfor.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815
  1. <template>
  2. <div class="upload_infor">
  3. <form>
  4. <div class="dataName">
  5. <span>资料名称</span
  6. ><input
  7. type="text"
  8. class="inputStyle focusStyle"
  9. v-model="inforName"
  10. @focus="hideTip"
  11. @blur="checkName()"
  12. />
  13. <p v-show="tipFlag">{{ tipText }}</p>
  14. </div>
  15. <div class="inforDes">
  16. <span>资料描述</span
  17. ><textarea
  18. name="inforDes"
  19. cols="40"
  20. rows="4"
  21. class="focusStyle"
  22. v-model="inforDes"
  23. ></textarea>
  24. </div>
  25. <div class="selectType">
  26. <p>选择类型</p>
  27. <div>
  28. <span>素材时间</span>
  29. <input
  30. type="month"
  31. :min="localMonth"
  32. class="inputStyle"
  33. v-model="materialTime"
  34. @change="materialTimeChange"
  35. />
  36. <span style="margin-left: 30px">经销商范围</span>
  37. <select class="selectStyle" v-model="scope" autocomplete="off">
  38. <option value="1">共通</option>
  39. <option value="0">部分</option>
  40. </select>
  41. </div>
  42. </div>
  43. <div v-show="scope === '0'">
  44. <p>权限设置</p>
  45. <div class="addByArea">
  46. <span>按区域添加</span>
  47. <div v-for="(item, index) in areaList" :key="index">
  48. <input
  49. type="checkbox"
  50. :value="item"
  51. v-model="checkedBoxList"
  52. @click="clickCheckbox(index)"
  53. /><span>{{ item }}</span>
  54. </div>
  55. <button @click.prevent="addByArea">添加</button>
  56. </div>
  57. <div class="addByCustomize">
  58. <span>自定义添加</span>
  59. <input
  60. id="dlr"
  61. list="dlrs"
  62. class="inputStyle"
  63. v-model="addByCustomize"
  64. placeholder="DLR Code / 经销商"
  65. />
  66. <datalist id="dlrs">
  67. <option v-for="(item, index) in dlrList" :key="index" :value="item">
  68. {{ item }}
  69. </option>
  70. </datalist>
  71. <button @click.prevent="addBySelf">添加</button>
  72. </div>
  73. <div class="addByGroup">
  74. <span>按小组添加</span>
  75. <div class="selectBox">
  76. <div class="group_select" @click="showOption">
  77. <p>请选择</p>
  78. <img src="../../img/select_arrow.png" />
  79. </div>
  80. <div class="optionBox" v-if="optionFlag">
  81. <ul>
  82. <li v-for="(item, index) in groupList" :key="index">
  83. <p>{{ item.groupName }}</p>
  84. <img
  85. src="../../img/add.png"
  86. @click="addGroup(index)"
  87. v-if="item.flag"
  88. />
  89. <img
  90. src="../../img/delete.png"
  91. @click="deleteGroup(index)"
  92. v-else
  93. />
  94. </li>
  95. </ul>
  96. </div>
  97. </div>
  98. <button @click.prevent="addByGroup">添加</button>
  99. </div>
  100. </div>
  101. </form>
  102. <div v-show="scope === '0'">
  103. <div class="count">
  104. <Count :sum="sum" />
  105. </div>
  106. <div class="table">
  107. <UpLoadTable
  108. :tableData="tableData"
  109. @change_icon="changeIcon"
  110. :pageSize="pageSize"
  111. :currentPage="currentPage"
  112. />
  113. </div>
  114. <div class="page" v-show="sum > 0">
  115. <Tablepage
  116. :totalPage="totalPage"
  117. :currentPage="currentPage"
  118. @change_page="changePage"
  119. @jump_page="jumpPage"
  120. />
  121. </div>
  122. </div>
  123. <div class="dataName" style="margin-top: 2%;">
  124. <span>反馈设置</span>
  125. <select class="selectStyle" v-model="isFeedBack" autocomplete="off">
  126. <option value="0">不需要反馈</option>
  127. <option value="1">需要反馈</option>
  128. </select>
  129. <input
  130. type="date"
  131. :min="localDay"
  132. class="inputStyle"
  133. v-model="feedBackTime"
  134. v-show="isFeedBack === '1'"
  135. @change="feedBackTimeChange"
  136. />
  137. </div>
  138. <div class="uploadFile">
  139. <p>附件</p>
  140. <label for="fileInput" @change="getFileInfo($event)"
  141. >导入<input type="file" name="fileName" id="fileInput" multiple
  142. /></label>
  143. <div class="fileDes">
  144. <p v-for="(item, index) in fileDes" :key="index">{{ item }}</p>
  145. </div>
  146. </div>
  147. <button @click="submit" class="submitBtn">提交</button>
  148. <TipModal
  149. :tipFlag="tipModalFlag"
  150. :tipText="tipModalText"
  151. @close_tip_modal="closeTipModal"
  152. />
  153. </div>
  154. </template>
  155. <script>
  156. import UpLoadTable from "./components/UploadInforTable";
  157. import Count from "../../components/Count";
  158. import Tablepage from "../../components/TablePage";
  159. import TipModal from "../../components/TipModal";
  160. export default {
  161. props: {
  162. isManufacturer: {
  163. type: String,
  164. default: "distributor",
  165. },
  166. },
  167. components: {
  168. UpLoadTable,
  169. Count,
  170. Tablepage,
  171. TipModal,
  172. },
  173. watch: {},
  174. data() {
  175. return {
  176. allDataNameList: [],
  177. tipFlag: false, // 是否展示提示
  178. tipText: "资料名称不能重复,请重新输入",
  179. inforName: "",
  180. inforDes: "",
  181. materialTime: "",
  182. feedBackTime:'',
  183. scope: "1", //1为共通 , 0为部分
  184. checkedBoxList: [], // 多选框选中的值
  185. addByCustomize: "",
  186. dlrList: [], // 自定义添加
  187. addGroupList: [], // 添加的小组
  188. optionFlag: false, // 是否展示按小组添加的选择栏
  189. fileDes: [], // 上传的文件名
  190. file: "", //上传的文件
  191. // 表格配置
  192. sum: 0, // 一共有多少条数据
  193. pageSize: 20, // 每页展示的数据
  194. currentPage: 1,
  195. areaList: [], // 按区域添加
  196. groupList: [], // 按小组添加
  197. localMonth: "",
  198. localDay:'',
  199. tableData: [], // 表格显示的数据
  200. allDlr: [], // 所有经销商数据
  201. idList: [],
  202. tipModalFlag: false,
  203. tipModalText: "",
  204. isFeedBack:'0'
  205. };
  206. },
  207. computed: {
  208. // 表格总页数
  209. totalPage() {
  210. return Math.ceil(this.sum / this.pageSize);
  211. },
  212. },
  213. methods: {
  214. // 检查名字是否重复 失去焦点判断
  215. checkName: function () {
  216. let include = this.allDataNameList.indexOf(this.inforName);
  217. if (!this.inforName) {
  218. this.tipText = "资料名不能为空";
  219. this.tipFlag = true;
  220. return;
  221. } else if (include > 0) {
  222. this.tipText = "资料名称不能重复,请重新输入";
  223. this.tipFlag = true;
  224. return;
  225. }
  226. },
  227. // 名字不重复,隐藏提示
  228. hideTip: function () {
  229. this.tipText = "资料名称不能重复,请重新输入";
  230. this.tipFlag = false;
  231. },
  232. // 素材时间变化
  233. materialTimeChange: function () {
  234. // this.materialTime = this.localMonth.replace('-', '/');
  235. console.log(this.materialTime);
  236. },
  237. // 反馈时间变化
  238. feedBackTimeChange: function () {
  239. // this.materialTime = this.localMonth.replace('-', '/');
  240. console.log(this.feedBackTime);
  241. },
  242. // 显示隐藏按小组添加下拉框
  243. showOption() {
  244. this.optionFlag = !this.optionFlag;
  245. },
  246. // 保证多选框东区和其他的多选框互斥
  247. clickCheckbox(i) {
  248. let list = this.checkedBoxList;
  249. let include = list.indexOf("东区");
  250. console.log(i, include);
  251. // if (i === 0) {
  252. // this.checkedBoxList = [];
  253. // return;
  254. // }
  255. // if (include >= 0) {
  256. // this.checkedBoxList.splice(0, 1);
  257. // }
  258. },
  259. // 点击按区域添加button
  260. addByArea: function () {
  261. if (this.checkedBoxList.length !== 0) {
  262. let strReq = this.checkedBoxList.join(",");
  263. let req = {
  264. localArea: strReq,
  265. };
  266. this.getAllDlr(req);
  267. }
  268. },
  269. // 自定义添加
  270. addBySelf: function () {
  271. if (this.addByCustomize) {
  272. let dataObj = {
  273. queryParams: this.addByCustomize,
  274. };
  275. this.getAllDlr(dataObj, false, true);
  276. }
  277. },
  278. // 按小组添加,增加小组
  279. addGroup: function (index) {
  280. this.groupList[index].flag = !this.groupList[index].flag;
  281. },
  282. // 按小组添加,删除小组
  283. deleteGroup: function (index) {
  284. this.groupList[index].flag = !this.groupList[index].flag;
  285. },
  286. // 点击按小组添加 添加按钮
  287. addByGroup: function () {
  288. this.addGroupList = [];
  289. this.groupList.forEach((element) => {
  290. if (!element.flag) {
  291. this.addGroupList.push(element.id);
  292. }
  293. });
  294. if (this.addGroupList.length !== 0) {
  295. let strReq = this.addGroupList.join(",");
  296. let req = {
  297. groupId: strReq,
  298. };
  299. this.getAllDlr(req);
  300. this.optionFlag = false;
  301. } else {
  302. alert("没有选择一个或多个小组");
  303. }
  304. },
  305. // 筛选
  306. changeIcon: function (i) {
  307. let index = (this.currentPage - 1) * this.pageSize + i;
  308. this.allDlr[index].flag = !this.allDlr[index].flag;
  309. },
  310. // 选中经销商的id 组成列表
  311. dlrIdList: function () {
  312. this.idList = [];
  313. this.allDlr.forEach((element) => {
  314. if (element.flag) {
  315. this.idList.push(element.id);
  316. }
  317. });
  318. },
  319. // 关闭提示框
  320. closeTipModal: function () {
  321. this.tipModalFlag = false;
  322. this.$router.push({path:'/uploadRecord'});
  323. },
  324. // 获取某一页面的数据,展示在表格
  325. changePage: function (page) {
  326. this.currentPage = page;
  327. this.tableData = this.allDlr.slice(
  328. (this.currentPage - 1) * this.pageSize,
  329. this.currentPage * this.pageSize
  330. );
  331. },
  332. // 点击上一页,下一页,首页,尾页
  333. jumpPage: function (item) {
  334. switch (item) {
  335. case 1:
  336. this.currentPage = 1;
  337. break;
  338. case 2:
  339. this.currentPage = this.currentPage - 1;
  340. break;
  341. case 3:
  342. this.currentPage = this.currentPage + 1;
  343. break;
  344. case 4:
  345. this.currentPage = this.totalPage;
  346. break;
  347. }
  348. this.tableData = this.allDlr.slice(
  349. (this.currentPage - 1) * this.pageSize,
  350. this.currentPage * this.pageSize
  351. );
  352. },
  353. // 点击提交,检查名字是否重复,获取数据
  354. submit: function () {
  355. if(this.isFeedBack === '0'){
  356. this.feedBackTime = '';
  357. }
  358. this.checkName();
  359. if (!this.tipFlag) {
  360. if (!this.inforDes) {
  361. alert("资料描述不能为空");
  362. return;
  363. }
  364. if (!this.materialTime) {
  365. alert("请选择素材时间");
  366. return;
  367. }
  368. if(this.isFeedBack === '1'){
  369. if(!this.feedBackTime){
  370. alert("请选择截止日期");
  371. return;
  372. }
  373. }
  374. if (!this.file) {
  375. alert("请导入资料附件");
  376. return;
  377. }
  378. this.dlrIdList();
  379. this.submitRequest();
  380. }
  381. },
  382. // 获取文件名
  383. getFileInfo: function (event) {
  384. this.file = event.target.files;
  385. console.log(this.file);
  386. this.fileDes = [];
  387. this.file.forEach((item) => {
  388. this.fileDes.push(item.name);
  389. });
  390. },
  391. // 获取当前的月份
  392. getLocalMonth: function () {
  393. let data = new Date();
  394. let year = data.getFullYear();
  395. let month = data.getMonth() + 1;
  396. let day = data.getDate();
  397. if (month < 10) {
  398. month = "0" + month;
  399. } else {
  400. month = month + "";
  401. }
  402. this.localMonth = year + "-" + month;
  403. this.localDay = year + "-" + month + "-" + day;
  404. console.log(this.localDay)
  405. },
  406. // 提交接口
  407. submitRequest: function () {
  408. let paramData = new FormData();
  409. this.file.forEach((item) => {
  410. paramData.append("file", item);
  411. });
  412. paramData.append("dataName", this.inforName);
  413. paramData.append("dataDesc", this.inforDes);
  414. paramData.append("sourceTime", this.materialTime);
  415. paramData.append("endDate", this.feedBackTime);
  416. paramData.append("dealerScope", this.scope);
  417. console.log(this.scope, 111);
  418. if (this.scope === "0") {
  419. paramData.append("dealerList", this.idList);
  420. console.log(1111, this.idList);
  421. }
  422. console.log(paramData.getAll("dataName"));
  423. this.$http
  424. .uploadFile("/firmsUpload", paramData)
  425. .then((res) => {
  426. if (res.data && res.data.code === 200) {
  427. this.tipModalFlag = true;
  428. this.tipModalText = "上传成功!";
  429. } else {
  430. alert("上传失败,请重试");
  431. console.log(res);
  432. }
  433. })
  434. .catch((err) => {
  435. alert("上传失败,请重试");
  436. console.log(err);
  437. });
  438. },
  439. // 获取所有资料名称
  440. getAllDataName: function () {
  441. this.$http({
  442. method: "post",
  443. url: "/firmsUploadList",
  444. })
  445. .then((res) => {
  446. if (res.data && res.data.code === 200) {
  447. (this.allDataNameList = []),
  448. res.data.data.forEach((item) => {
  449. this.allDataNameList.push(item.informationName);
  450. });
  451. } else {
  452. console.log(res);
  453. }
  454. })
  455. .catch((err) => {
  456. console.log(err);
  457. });
  458. },
  459. // 获取所有经销商信息接口
  460. getAllDlr: function (data = {}, flag, addBySelfFlag) {
  461. this.$http({
  462. method: "post",
  463. url: "/sys/agent/selectAgentInfoPage",
  464. data: data,
  465. })
  466. .then((res) => {
  467. console.log(res);
  468. this.tableData = [];
  469. let nowSum = this.sum;
  470. if (res.data && res.data.code === 200) {
  471. // created时,获取自定义添加datalist下拉框的值
  472. if (flag) {
  473. this.dlrList = [];
  474. let allDlrList = res.data.data;
  475. allDlrList.forEach((item) => {
  476. this.dlrList.push(item.dlrName);
  477. this.dlrList.push(item.dlrCode);
  478. });
  479. } else {
  480. // 整合数据, 主要目的是加一个 flag,在用户点击筛选的时候,好判断
  481. res.data.data.forEach((item) => {
  482. this.allDlr.push({
  483. id: item.id,
  484. dlrCode: item.dlrCode,
  485. dlrName: item.dlrName,
  486. localArea: item.localArea,
  487. flag: true,
  488. });
  489. });
  490. // 去重
  491. let hash = {};
  492. this.allDlr = this.allDlr.reduce(function (item, next) {
  493. hash[next.id] ? "" : (hash[next.id] = true && item.push(next));
  494. return item;
  495. }, []);
  496. this.sum = this.allDlr.length;
  497. // 添加以后跳到最后一页
  498. this.currentPage = this.totalPage;
  499. let startData = (this.currentPage - 1) * this.pageSize;
  500. let endData = this.currentPage * this.pageSize;
  501. this.tableData = this.allDlr.slice(startData, endData);
  502. // 自定义添加 提示
  503. let include = this.dlrList.indexOf(this.addByCustomize);
  504. if (include < 0 && addBySelfFlag) {
  505. alert('没有找到该经销商');
  506. return
  507. }
  508. if (this.sum === nowSum && addBySelfFlag) {
  509. alert("该经销商已在列表中,不用重复添加");
  510. return
  511. }
  512. }
  513. } else {
  514. console.log(res);
  515. }
  516. })
  517. .catch((err) => {
  518. console.log(err);
  519. });
  520. },
  521. // 获取小组接口
  522. selectGroupList: function () {
  523. this.$http({
  524. method: "post",
  525. url: "/sys/group/selectGroupList",
  526. data: {},
  527. })
  528. .then((res) => {
  529. if (res.data && res.data.code === 200) {
  530. this.groupList = [];
  531. res.data.data.forEach((item) => {
  532. this.groupList.push({
  533. id: item.id,
  534. groupName: item.groupName,
  535. flag: true,
  536. });
  537. });
  538. } else {
  539. console.log(res);
  540. }
  541. })
  542. .catch((err) => {
  543. console.log(err);
  544. });
  545. },
  546. // 获取 所有区域 接口
  547. getAreaList: function () {
  548. this.$http({
  549. method: "post",
  550. url: "/sys/agent/selectAgentAreaInfoList",
  551. })
  552. .then((res) => {
  553. if (res.data && res.data.code === 200) {
  554. this.areaList = res.data.data;
  555. } else {
  556. console.log(res);
  557. }
  558. })
  559. .catch((err) => {
  560. console.log(err);
  561. });
  562. },
  563. },
  564. mounted() {
  565. this.getLocalMonth();
  566. },
  567. created() {
  568. // if (this.isManufacturer === 'distributor') {
  569. // this.$router.replace({ path: "/inforList" });
  570. // }
  571. this.getAllDlr({}, true);
  572. this.getAllDataName();
  573. this.selectGroupList();
  574. this.getAreaList();
  575. },
  576. beforeCreate() {
  577. }
  578. };
  579. </script>
  580. <style scoped lang="less">
  581. .upload_infor {
  582. form {
  583. border: 1px solid #ccc;
  584. padding: 10px;
  585. }
  586. .dataName {
  587. p {
  588. margin-left: 65px;
  589. font-size: 10px;
  590. color: rgb(206, 84, 84);
  591. }
  592. }
  593. .inforDes {
  594. margin: 10px 0 0 0;
  595. span {
  596. vertical-align: top;
  597. margin-right: 17px;
  598. }
  599. textarea {
  600. border: 1px solid #ccc;
  601. border-radius: 3px;
  602. color: #555555;
  603. font-size: 12px;
  604. }
  605. }
  606. .selectType {
  607. margin-top: 10px;
  608. margin-bottom: 10px;
  609. div {
  610. margin-left: 65px;
  611. }
  612. }
  613. .selectStyle {
  614. margin-left: 20px;
  615. margin-right: 20px;
  616. padding: 4px 6px;
  617. height: 28px;
  618. width: 144px;
  619. border: 1px solid #ccc;
  620. color: #555555;
  621. font-size: 12px;
  622. }
  623. .addByArea {
  624. margin: 10px 0 0 65px;
  625. display: flex;
  626. height: 28px;
  627. align-items: center;
  628. span {
  629. margin-right: 10px;
  630. }
  631. div {
  632. margin-right: 18px;
  633. height: 18px;
  634. input {
  635. width: 12px;
  636. height: 12px;
  637. vertical-align: middle;
  638. margin-top: -2px;
  639. border: 1px solid #ccc;
  640. }
  641. span {
  642. margin-left: 2px;
  643. height: 18px;
  644. line-height: 18px;
  645. }
  646. }
  647. button {
  648. height: 28px;
  649. }
  650. }
  651. .addByCustomize {
  652. margin: 10px 0 0 65px;
  653. button {
  654. height: 28px;
  655. }
  656. input {
  657. // background: url('../../img/search.svg') no-repeat center left;
  658. // background-size: 21px 25px;
  659. background-color: #fff;
  660. }
  661. }
  662. .addByGroup {
  663. margin: 10px 0 0 65px;
  664. display: flex;
  665. align-items: center;
  666. .selectBox {
  667. position: relative;
  668. margin-left: 17px;
  669. .group_select {
  670. width: 124px;
  671. height: 28px;
  672. border: 1px solid #ccc;
  673. background-color: #fff;
  674. padding: 0 10px;
  675. display: flex;
  676. justify-content: space-between;
  677. align-items: center;
  678. p {
  679. font-size: 12px;
  680. height: 28px;
  681. line-height: 28px;
  682. color: #555555;
  683. }
  684. img {
  685. width: 16px;
  686. height: 16px;
  687. }
  688. &:hover {
  689. cursor: pointer;
  690. }
  691. }
  692. img {
  693. width: 144px;
  694. height: 28px;
  695. &:hover {
  696. cursor: pointer;
  697. }
  698. }
  699. .optionBox {
  700. position: absolute;
  701. top: 28px;
  702. left: 0;
  703. border: 1px solid #ccc;
  704. border-top: none;
  705. width: 142px;
  706. background-color: #fff;
  707. border-radius: 5px;
  708. ul {
  709. width: 144px;
  710. padding-bottom: 6px;
  711. display: flex;
  712. flex-direction: column;
  713. align-items: center;
  714. li {
  715. width: 132px;
  716. height: 28px;
  717. font-size: 12px;
  718. color: #555555;
  719. display: flex;
  720. align-items: center;
  721. border-bottom: 1px solid #ccc;
  722. display: flex;
  723. justify-content: space-between;
  724. padding-right: 5px;
  725. img {
  726. width: 20px;
  727. height: 20px;
  728. &:hover {
  729. cursor: pointer;
  730. }
  731. }
  732. }
  733. }
  734. }
  735. }
  736. button {
  737. height: 28px;
  738. }
  739. }
  740. .table {
  741. margin-top: 10px;
  742. }
  743. .count {
  744. display: flex;
  745. justify-content: flex-end;
  746. }
  747. .uploadFile {
  748. display: flex;
  749. margin-top: 35px;
  750. height: 30px;
  751. align-items: center;
  752. p {
  753. margin-right: 20px;
  754. height: 20px;
  755. line-height: 20px;
  756. }
  757. .fileDes {
  758. margin-left: 20px;
  759. width: 500px;
  760. overflow: hidden;
  761. overflow: hidden; /* 超出一行文字自动隐藏 */
  762. text-overflow: ellipsis; /* 文字隐藏后添加省略号 */
  763. white-space: nowrap; /* 强制不换行 */
  764. }
  765. label {
  766. height: 30px;
  767. line-height: 30px;
  768. width: 56px;
  769. background-color: #0056a0;
  770. color: #fff;
  771. text-align: center;
  772. font-size: 14px;
  773. input {
  774. display: none;
  775. }
  776. }
  777. }
  778. .submitBtn {
  779. margin-top: 50px;
  780. }
  781. }
  782. .inputStyle {
  783. margin-left: 17px;
  784. width: 130px;
  785. height: 18px;
  786. line-height: 18px;
  787. padding: 4px 6px;
  788. border: 1px solid #ccc;
  789. color: #555555;
  790. font-size: 12px;
  791. }
  792. .focusStyle {
  793. border: 1px solid #ccc;
  794. line-height: 20px;
  795. color: #555555;
  796. outline: none;
  797. }
  798. .focusStyle:focus {
  799. animation: shadowAni 200ms linear forwards;
  800. }
  801. @keyframes shadowAni {
  802. 0% {
  803. border-color: #cccccc;
  804. box-shadow: inset 0px 0px 0 #ccc;
  805. }
  806. 100% {
  807. border-color: #75b9f0;
  808. box-shadow: 0px 0px 10px #75b9f0;
  809. }
  810. }
  811. </style>