plugInunit.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401
  1. <template>
  2. <fullscreen :fullscreen.sync="fullscreen" class="container">
  3. <div class="container-box">
  4. <toolList @iconCli='iconCli' :tooltit='tooltit'></toolList>
  5. <div class="search">
  6. <mySearch :searchList="searchList" @searchInfo="searchInfo"></mySearch>
  7. <el-button class="btn-check" size="medium" type="primary" @click="dialogCheck(3)">添加
  8. </el-button>
  9. </div>
  10. <div class="tabbox">
  11. <el-table height="calc(100% - 40px)" class="com-table" ref="multipleTable" :data="tableData"
  12. tooltip-effect="dark" size="small" border style="width: 100%" v-loading="loading">
  13. <el-table-column prop="implClassName" label="插件名称">
  14. </el-table-column>
  15. <el-table-column prop="implClassDesc" label="插件中文名称">
  16. </el-table-column>
  17. <el-table-column prop="opName" label="创建姓名">
  18. </el-table-column>
  19. <el-table-column prop="opNo" label="创建工号">
  20. </el-table-column>
  21. <el-table-column prop="opTime" label="创建时间">
  22. </el-table-column>
  23. <el-table-column label="操作" width="160px" align="center">
  24. <template slot-scope="scope">
  25. <el-button size="mini" type="primary" @click="dialogCheck(1,scope.row)">查看</el-button>
  26. <el-button size="mini" type="primary" @click="dialogCheck(2,scope.row)">修改</el-button>
  27. <el-button size="mini" type="danger" @click="delLine(scope.row)">删除</el-button>
  28. </template>
  29. </el-table-column>
  30. </el-table>
  31. <el-pagination class="pageBox" @current-change="currchange" layout="prev, pager, next" background
  32. :total="total">
  33. </el-pagination>
  34. </div>
  35. </div>
  36. <el-dialog :title="titname + '插件'" :visible.sync="dialogStatus" width="50%" :destroy-on-close="true"
  37. :modal-append-to-body="false" :close-on-click-modal="false" :before-close="closedia">
  38. <div v-loading="loadinged">
  39. <el-form :model="infolist" ref="infolist" :rules="rules">
  40. <div class="info-line">
  41. <el-form-item prop="implClassName">
  42. <span>插件名称</span>
  43. <el-input v-model="infolist.implClassName" placeholder="插件名称" :disabled="disableStatus"></el-input>
  44. </el-form-item>
  45. <el-form-item prop="implClassDesc">
  46. <span>中文名称</span>
  47. <el-input v-model="infolist.implClassDesc" placeholder="插件中文名称" :disabled="disableStatus"></el-input>
  48. </el-form-item>
  49. </div>
  50. <div class="info-line">
  51. <el-form-item>
  52. <span>创建工号</span>
  53. <el-input v-model="infolist.opNo" placeholder="创建工号" disabled></el-input>
  54. </el-form-item>
  55. <el-form-item>
  56. <span>创建姓名</span>
  57. <el-input v-model="infolist.opName" placeholder="创建姓名" disabled></el-input>
  58. </el-form-item>
  59. </div>
  60. <div class="info-line">
  61. <el-form-item>
  62. <span>创建时间</span>
  63. <el-date-picker v-model="infolist.opTime" type="date" placeholder="创建时间" disabled>
  64. </el-date-picker>
  65. </el-form-item>
  66. </div>
  67. </el-form>
  68. <div slot="footer" class="dialog-footer myfooter">
  69. <el-button type="primary" @click="dialogCli(2)" v-if="titname !== '查看'">确 定</el-button>
  70. <el-button @click="dialogCli(1)" v-if="titname === '查看'">确 定</el-button>
  71. <el-button @click="dialogCli(1)">取 消</el-button>
  72. </div>
  73. </div>
  74. </el-dialog>
  75. <myMessage :messTit='messTit' @closeMessage="closeMessage" :centerDialogVisible="centerDialogVisible" v-if="centerDialogVisible"></myMessage>
  76. </fullscreen>
  77. </template>
  78. <script>
  79. import mySearch from "../../../components/search.vue";
  80. import myUpload from '../../../components/upload'
  81. import uploadDown from '../../../components/uploadDown'
  82. import myMessage from "../../../components/myMessage.vue"
  83. import toolList from '../../../components/toolList'
  84. export default {
  85. components: {
  86. mySearch,
  87. myUpload,
  88. uploadDown,
  89. myMessage,
  90. toolList
  91. },
  92. data() {
  93. const implClassName = (rule, value, callback) => {
  94. if (!this.infolist.implClassName) {
  95. callback(new Error('不能为空'))
  96. } else {
  97. callback()
  98. }
  99. }
  100. const implClassDesc = (rule, value, callback) => {
  101. if (!this.infolist.implClassDesc) {
  102. callback(new Error('不能为空'))
  103. } else {
  104. callback()
  105. }
  106. }
  107. return {
  108. rules: {
  109. implClassName: [{
  110. required: true,
  111. trigger: 'blur',
  112. validator: implClassName
  113. }],
  114. implClassDesc: [{
  115. required: true,
  116. trigger: 'blur',
  117. validator: implClassDesc
  118. }],
  119. },
  120. searchList: [
  121. {
  122. type: 'input',
  123. tit: '插件名称',
  124. value: '',
  125. width: '48%',
  126. },
  127. {
  128. type: 'input',
  129. tit: '插件中文名称',
  130. value: '',
  131. width: '48%',
  132. },
  133. ],
  134. tooltit:'插件管理',
  135. fullscreen: false,
  136. total: 0,
  137. pageSize: 1,
  138. tableData: [{}],
  139. dialogStatus: false,
  140. disableStatus: false,
  141. titname: '',
  142. infolist: {},
  143. userInfo: {},
  144. params: {},
  145. centerDialogVisible: false,
  146. messTit: '',
  147. delid: '',
  148. loading:false,
  149. loadinged:false,
  150. }
  151. },
  152. methods: {
  153. closedia() {
  154. this.infolist = {};
  155. this.dialogStatus = false;
  156. },
  157. //搜索数据
  158. searchInfo(v) {
  159. this.params = {};
  160. v[0] ? this.params.implClassName = v[0] : '';
  161. v[1] ? this.params.implClassDesc = v[1] : '';
  162. this.getList(this.params, this.pageSize);
  163. },
  164. //获取列表
  165. getList(v, n) {
  166. this.pageSize = n;
  167. let _this = this;
  168. this.loading = true;
  169. this.tableData = [];
  170. this.$http({
  171. url: "/bpm/api/queryBpmPrePluginPage",
  172. method: "post",
  173. headers: {
  174. "Content-Type": "application/json",
  175. "page": '{"pageNo":"' + n + '","pageSize":"10"}'
  176. },
  177. data: v,
  178. }).then((res) => {
  179. this.tableData = res.data.data;
  180. this.total = res.data.totalRecord;
  181. this.loading = false;
  182. });
  183. },
  184. // 分页
  185. currchange(v) {
  186. this.pageSize = v;
  187. this.getList(this.params, this.pageSize);
  188. },
  189. //申请
  190. dialogCheck(v, n) {
  191. this.dialogStatus = true;
  192. this.infolist = Object.assign({}, n);
  193. if (v === 1) {
  194. this.titname = '查看';
  195. this.disableStatus = true;
  196. return
  197. } else if (v === 2) {
  198. this.titname = '修改';
  199. this.disableStatus = false;
  200. } else if (v === 3) {
  201. this.titname = '添加';
  202. this.disableStatus = false;
  203. }
  204. this.infolist.opNo = this.userInfo.loginNo;
  205. this.infolist.opName = this.userInfo.loginName;
  206. },
  207. //添加
  208. dialogCli(v) {
  209. if (v === 1) {
  210. this.infolist = {};
  211. this.dialogStatus = false;
  212. return
  213. } else {
  214. this.infolist.opTime = this.$formatDate(new Date(), "YYYY-MM-DD");
  215. if (this.titname === '添加') {
  216. this.submitInfo("/bpm/api/addBpmPrePlugin");
  217. } else if (this.titname === '修改') {
  218. this.submitInfo("/bpm/api/updateBpmPrePlugin", v);
  219. }
  220. }
  221. },
  222. submitInfo(u) {
  223. let _this = this;
  224. this.$refs.infolist.validate(valid => {
  225. if (valid) {
  226. this.loadinged = true;
  227. this.$http({
  228. url: u,
  229. method: "post",
  230. headers: {
  231. "Content-Type": "application/json",
  232. },
  233. data: this.infolist,
  234. }).then((res) => {
  235. this.loadinged = false;
  236. if (res.data.result === 1) {
  237. _this.$message({
  238. message: res.data.desc,
  239. type: 'error'
  240. });
  241. } else {
  242. _this.$message({
  243. message: '成功',
  244. type: 'success'
  245. });
  246. _this.infolist = {};
  247. _this.dialogStatus = false;
  248. _this.getList({}, _this.pageSize);
  249. }
  250. });
  251. }
  252. })
  253. },
  254. closeMessage(v) {
  255. this.centerDialogVisible = false;
  256. let _this = this;
  257. if (v === 1) {
  258. _this.$http({
  259. url: "/bpm/api/deleteBpmPrePlugin",
  260. method: "post",
  261. headers: {
  262. "Content-Type": "application/json",
  263. },
  264. data: {
  265. id: this.delid
  266. },
  267. }).then((res) => {
  268. if (res.data.result === 1) {
  269. _this.$message({
  270. message: res.data.desc,
  271. type: 'error'
  272. });
  273. } else {
  274. _this.$message({
  275. message: '删除成功',
  276. type: 'success'
  277. });
  278. _this.getList(this.params, this.pageSize);
  279. }
  280. });
  281. }
  282. },
  283. //删除
  284. delLine(v) {
  285. this.centerDialogVisible = true;
  286. this.messTit = '即将删除此条数据, 是否删除?';
  287. this.delid = v.id;
  288. },
  289. //文件返回值
  290. uploadBack(v) {
  291. console.log(v)
  292. },
  293. //功能栏
  294. iconCli(v) {
  295. if (v === 1) {
  296. this.getList(this.params, this.pageSize);
  297. }
  298. if (v === 2) {
  299. this.fullscreen = !this.fullscreen
  300. }
  301. },
  302. getUser() {
  303. this.userInfo = JSON.parse(window.sessionStorage.userInfo);
  304. this.infolist = {
  305. opNo: '',
  306. opName: '',
  307. };
  308. this.infolist.opNo = this.userInfo.loginNo;
  309. this.infolist.opName = this.userInfo.loginName;
  310. }
  311. },
  312. mounted() {
  313. this.getList({}, 1);
  314. this.getUser();
  315. },
  316. created() {
  317. }
  318. }
  319. </script>
  320. <style scoped lang="scss">
  321. .onetab {
  322. margin-bottom: 20px;
  323. padding: 0 20px;
  324. }
  325. .titbox {
  326. div {
  327. float: right;
  328. i {
  329. font-size: 22px;
  330. margin-left: 20px;
  331. cursor: pointer;
  332. }
  333. }
  334. }
  335. .tabbox {
  336. margin-top: 15px;
  337. }
  338. .pageBox {
  339. text-align: right;
  340. margin-top: 10px;
  341. }
  342. .info-line {
  343. width: 100%;
  344. display: block;
  345. padding-left: 20px;
  346. div {
  347. width: 50%;
  348. display: inline-block;
  349. }
  350. span {
  351. width: 80px;
  352. display: inline-block;
  353. text-align: left;
  354. i {
  355. color: red;
  356. display: inline-block;
  357. padding-right: 5px;
  358. }
  359. }
  360. .el-select,
  361. .el-input {
  362. width: calc(100% - 100px);
  363. }
  364. }
  365. .online {
  366. width: 100%;
  367. .el-select {
  368. width: calc(100% - 100px);
  369. }
  370. span {
  371. vertical-align: top;
  372. }
  373. .el-textarea {
  374. width: calc(100% - 100px);
  375. }
  376. }
  377. </style>